mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-12 13:34:41 +08:00
gobex: Add a simple g_obex_request_add_header implementation
This commit is contained in:
parent
4e4246a90a
commit
eed615f8b3
@ -156,6 +156,13 @@ void g_obex_header_free(GObexHeader *header)
|
||||
g_free(header);
|
||||
}
|
||||
|
||||
gboolean g_obex_request_add_header(GObexRequest *req, GObexHeader *header)
|
||||
{
|
||||
req->headers = g_slist_append(req->headers, header);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GObexRequest *g_obex_request_new(uint8_t opcode)
|
||||
{
|
||||
GObexRequest *req;
|
||||
@ -169,6 +176,8 @@ GObexRequest *g_obex_request_new(uint8_t opcode)
|
||||
|
||||
void g_obex_request_free(GObexRequest *req)
|
||||
{
|
||||
g_slist_foreach(req->headers, (GFunc) g_obex_header_free, NULL);
|
||||
g_slist_free(req->headers);
|
||||
g_free(req);
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,8 @@ GObexHeader *g_obex_header_parse(const void *data, size_t len,
|
||||
gboolean copy, size_t *parsed);
|
||||
void g_obex_header_free(GObexHeader *header);
|
||||
|
||||
gboolean g_obex_request_add_header(GObexRequest *req, GObexHeader *header);
|
||||
|
||||
GObexRequest *g_obex_request_new(uint8_t opcode);
|
||||
void g_obex_request_free(GObexRequest *req);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user