diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2011-07-12 00:37:25 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-12-04 22:22:01 +0100 |
commit | d9ef079522891a0a256e455158704e82228370d7 (patch) | |
tree | 98d3420c5862f3b37ffcd53e22cad1df2730809c /gobex | |
parent | b0341a13d519b401c972127c0738a530acd5f944 (diff) | |
download | bluez-d9ef079522891a0a256e455158704e82228370d7.tar.gz |
gobex: Add g_obex_packet_get_body convenience function
Diffstat (limited to 'gobex')
-rw-r--r-- | gobex/gobex-packet.c | 11 | ||||
-rw-r--r-- | gobex/gobex-packet.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gobex/gobex-packet.c b/gobex/gobex-packet.c index 679a2dd9f..8303456c3 100644 --- a/gobex/gobex-packet.c +++ b/gobex/gobex-packet.c @@ -60,6 +60,17 @@ GObexHeader *g_obex_packet_get_header(GObexPacket *pkt, guint8 id) return NULL; } +GObexHeader *g_obex_packet_get_body(GObexPacket *pkt) +{ + GObexHeader *body; + + body = g_obex_packet_get_header(pkt, G_OBEX_HDR_BODY); + if (body != NULL) + return body; + + return g_obex_packet_get_header(pkt, G_OBEX_HDR_BODY_END); +} + guint8 g_obex_packet_get_operation(GObexPacket *pkt, gboolean *final) { if (final) diff --git a/gobex/gobex-packet.h b/gobex/gobex-packet.h index ea61d99be..ff6dcd295 100644 --- a/gobex/gobex-packet.h +++ b/gobex/gobex-packet.h @@ -82,6 +82,7 @@ typedef struct _GObexPacket GObexPacket; GObexHeader *g_obex_packet_get_header(GObexPacket *pkt, guint8 id); +GObexHeader *g_obex_packet_get_body(GObexPacket *pkt); guint8 g_obex_packet_get_operation(GObexPacket *pkt, gboolean *final); GObexHeader *g_obex_packet_find_header(GObexPacket *pkt, guint8 id); gboolean g_obex_packet_prepend_header(GObexPacket *pkt, GObexHeader *header); |