OSDN Git Service

gobex: Remove g_obex_packet_find_header
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 5 Sep 2011 09:29:54 +0000 (12:29 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 4 Dec 2012 21:22:03 +0000 (22:22 +0100)
This was exactly the same as g_obex_packet_get_header.

gobex/gobex-packet.c
gobex/gobex-packet.h
gobex/gobex.c
tools/obex-server-tool.c

index 5765c8b..e2914a4 100644 (file)
@@ -79,20 +79,6 @@ guint8 g_obex_packet_get_operation(GObexPacket *pkt, gboolean *final)
        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);
index 6bdfcf0..24c9dcc 100644 (file)
@@ -84,7 +84,6 @@ 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);
 gboolean g_obex_packet_add_header(GObexPacket *pkt, GObexHeader *header);
 gboolean g_obex_packet_add_body(GObexPacket *pkt, GObexDataProducer func,
index 5f9e9db..b2c0199 100644 (file)
@@ -344,7 +344,7 @@ static void prepare_connect_rsp(GObex *obex, GObexPacket *rsp)
        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;
@@ -392,7 +392,7 @@ guint g_obex_send_req(GObex *obex, GObexPacket *req, gint timeout,
        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;
 
@@ -611,7 +611,7 @@ static void parse_connect_data(GObex *obex, GObexPacket *pkt)
                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);
 }
index 4b39ba8..7db153e 100644 (file)
@@ -121,7 +121,7 @@ static void handle_put(GObex *obex, GObexPacket *req, gpointer user_data)
        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);
@@ -132,7 +132,7 @@ static void handle_put(GObex *obex, GObexPacket *req, gpointer user_data)
        } 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
@@ -180,7 +180,7 @@ static void handle_get(GObex *obex, GObexPacket *req, gpointer user_data)
        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);
@@ -191,7 +191,7 @@ static void handle_get(GObex *obex, GObexPacket *req, gpointer user_data)
        } 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