This was exactly the same as g_obex_packet_get_header.
return pkt->opcode;
}
-GObexHeader *g_obex_packet_find_header(GObexPacket *pkt, guint8 id)
-{
- GSList *l;
-
- for (l = pkt->headers; l != NULL; l = g_slist_next(l)) {
- GObexHeader *hdr = l->data;
-
- if (g_obex_header_get_id(hdr) == id)
- return hdr;
- }
-
- return NULL;
-}
-
gboolean g_obex_packet_prepend_header(GObexPacket *pkt, GObexHeader *header)
{
pkt->headers = g_slist_prepend(pkt->headers, header);
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);
gboolean g_obex_packet_add_header(GObexPacket *pkt, GObexHeader *header);
gboolean g_obex_packet_add_body(GObexPacket *pkt, GObexDataProducer func,
init_connect_data(obex, &data);
g_obex_packet_set_data(rsp, &data, sizeof(data), G_OBEX_DATA_COPY);
- connid = g_obex_packet_find_header(rsp, G_OBEX_HDR_CONNECTION);
+ connid = g_obex_packet_get_header(rsp, G_OBEX_HDR_CONNECTION);
if (connid != NULL) {
g_obex_header_get_uint32(connid, &obex->conn_id);
return;
if (obex->conn_id == CONNID_INVALID)
goto create_pending;
- connid = g_obex_packet_find_header(req, G_OBEX_HDR_CONNECTION);
+ connid = g_obex_packet_get_header(req, G_OBEX_HDR_CONNECTION);
if (connid != NULL)
goto create_pending;
obex->tx_mtu = obex->io_tx_mtu;
obex->tx_buf = g_realloc(obex->tx_buf, obex->tx_mtu);
- connid = g_obex_packet_find_header(pkt, G_OBEX_HDR_CONNECTION);
+ connid = g_obex_packet_get_header(pkt, G_OBEX_HDR_CONNECTION);
if (connid != NULL)
g_obex_header_get_uint32(connid, &obex->conn_id);
}
struct transfer_data *data;
gsize type_len;
- hdr = g_obex_packet_find_header(req, G_OBEX_HDR_TYPE);
+ hdr = g_obex_packet_get_header(req, G_OBEX_HDR_TYPE);
if (hdr != NULL) {
g_obex_header_get_bytes(hdr, (const guint8 **) &type,
&type_len);
} else
type = NULL;
- hdr = g_obex_packet_find_header(req, G_OBEX_HDR_NAME);
+ hdr = g_obex_packet_get_header(req, G_OBEX_HDR_NAME);
if (hdr != NULL)
g_obex_header_get_unicode(hdr, &name);
else
GObexHeader *hdr;
gsize type_len;
- hdr = g_obex_packet_find_header(req, G_OBEX_HDR_TYPE);
+ hdr = g_obex_packet_get_header(req, G_OBEX_HDR_TYPE);
if (hdr != NULL) {
g_obex_header_get_bytes(hdr, (const guint8 **) &type,
&type_len);
} else
type = NULL;
- hdr = g_obex_packet_find_header(req, G_OBEX_HDR_NAME);
+ hdr = g_obex_packet_get_header(req, G_OBEX_HDR_NAME);
if (hdr != NULL)
g_obex_header_get_unicode(hdr, &name);
else