gobex/header: Add g_obex_header_new_tag function

This function can be used to set tag using GObexApparam as argument but
for arbritary headers.
This commit is contained in:
Luiz Augusto von Dentz 2014-03-27 18:03:58 +02:00
parent c7fece8847
commit ab22fce6bb
2 changed files with 8 additions and 2 deletions

View File

@ -425,7 +425,7 @@ GObexHeader *g_obex_header_new_bytes(guint8 id, const void *data, gsize len)
return header;
}
GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam)
GObexHeader *g_obex_header_new_tag(guint8 id, GObexApparam *apparam)
{
guint8 buf[1024];
gssize len;
@ -434,7 +434,12 @@ GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam)
if (len < 0)
return NULL;
return g_obex_header_new_bytes(G_OBEX_HDR_APPARAM, buf, len);
return g_obex_header_new_bytes(id, buf, len);
}
GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam)
{
return g_obex_header_new_tag(G_OBEX_HDR_APPARAM, apparam);
}
GObexHeader *g_obex_header_new_uint8(guint8 id, guint8 val)

View File

@ -85,6 +85,7 @@ GObexHeader *g_obex_header_new_unicode(guint8 id, const char *str);
GObexHeader *g_obex_header_new_bytes(guint8 id, const void *data, gsize len);
GObexHeader *g_obex_header_new_uint8(guint8 id, guint8 val);
GObexHeader *g_obex_header_new_uint32(guint8 id, guint32 val);
GObexHeader *g_obex_header_new_tag(guint8 id, GObexApparam *apparam);
GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam);
GSList *g_obex_header_create_list(guint8 first_hdr_id, va_list args,