return header;
}
-GObexHeader *g_obex_header_new_bytes(guint8 id, void *data, gsize len,
- GObexDataPolicy data_policy)
+GObexHeader *g_obex_header_new_bytes(guint8 id, void *data, gsize len)
{
GObexHeader *header;
header->id = id;
header->vlen = len;
header->hlen = len + 3;
-
- switch (data_policy) {
- case G_OBEX_DATA_INHERIT:
- header->v.data = data;
- break;
- case G_OBEX_DATA_COPY:
- header->v.data = g_memdup(data, len);
- break;
- case G_OBEX_DATA_REF:
- header->extdata = TRUE;
- header->v.extdata = data;
- break;
- }
+ header->v.data = g_memdup(data, len);
return header;
}
gboolean g_obex_header_get_uint32(GObexHeader *header, guint32 *val);
GObexHeader *g_obex_header_new_unicode(guint8 id, const char *str);
-GObexHeader *g_obex_header_new_bytes(guint8 id, void *data, gsize len,
- GObexDataPolicy data_policy);
+GObexHeader *g_obex_header_new_bytes(guint8 id, void *data, gsize len);
GObexHeader *g_obex_header_new_uint8(guint8 id, guint8 val);
GObexHeader *g_obex_header_new_uint32(guint8 id, guint32 val);
if (type) {
hdr = g_obex_header_new_bytes(G_OBEX_HDR_ID_TYPE,
- (char *) type, strlen(type) + 1,
- G_OBEX_DATA_COPY);
+ (char *) type, strlen(type) + 1);
g_obex_packet_add_header(req, hdr);
}
if (type) {
hdr = g_obex_header_new_bytes(G_OBEX_HDR_ID_TYPE,
- (char *) type, strlen(type) + 1,
- G_OBEX_DATA_COPY);
+ (char *) type, strlen(type) + 1);
g_obex_packet_add_header(req, hdr);
}
if (target != NULL) {
GObexHeader *hdr;
hdr = g_obex_header_new_bytes(G_OBEX_HDR_ID_TARGET,
- target, target_len,
- G_OBEX_DATA_COPY);
+ target, target_len);
g_obex_packet_add_header(req, hdr);
}
size_t len;
header = g_obex_header_new_bytes(G_OBEX_HDR_ID_BODY, data,
- sizeof(data), G_OBEX_DATA_REF);
+ sizeof(data));
g_assert(header != NULL);
len = g_obex_header_encode(header, buf, sizeof(buf));