From e1046e6b02c2eef72ad63f2a61949e1ca606f63f Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 10 Nov 2006 17:59:14 +0000 Subject: Added raw service record to xml conversion functions --- common/sdp-xml.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 common/sdp-xml.h (limited to 'common/sdp-xml.h') diff --git a/common/sdp-xml.h b/common/sdp-xml.h new file mode 100644 index 00000000..fe781f57 --- /dev/null +++ b/common/sdp-xml.h @@ -0,0 +1,35 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2004-2006 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + + +#ifndef __SDP_XML_H__ +#define __SDP_XML_H__ + +#include +#include + +void convert_sdp_record_to_xml(sdp_record_t * rec, + void *userData, + void (*appendFunc) (void *, const char *)); + +#endif /* __SDP_XML_H__ */ -- cgit From b1a10a46b1cdeb034823b83c993836b0dce3ed06 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 13 Nov 2006 07:38:20 +0000 Subject: Cleanup SDP XML support --- common/sdp-xml.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'common/sdp-xml.h') diff --git a/common/sdp-xml.h b/common/sdp-xml.h index fe781f57..5e6bb7ce 100644 --- a/common/sdp-xml.h +++ b/common/sdp-xml.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2004-2006 Marcel Holtmann + * Copyright (C) 2005-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify @@ -22,14 +22,12 @@ */ -#ifndef __SDP_XML_H__ -#define __SDP_XML_H__ +#ifndef __SDP_XML_H +#define __SDP_XML_H -#include #include -void convert_sdp_record_to_xml(sdp_record_t * rec, - void *userData, - void (*appendFunc) (void *, const char *)); +void convert_sdp_record_to_xml(sdp_record_t *rec, + void *user_data, void (*append_func) (void *, const char *)); -#endif /* __SDP_XML_H__ */ +#endif /* __SDP_XML_H */ -- cgit From 214cc18ef97fcaa0a4c3746e183caf5820bc811b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 22 Nov 2006 06:06:36 +0000 Subject: Add first draft XML based service record registration --- common/sdp-xml.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/sdp-xml.h') diff --git a/common/sdp-xml.h b/common/sdp-xml.h index 5e6bb7ce..16bea948 100644 --- a/common/sdp-xml.h +++ b/common/sdp-xml.h @@ -27,7 +27,18 @@ #include +#define SDP_XML_ENCODING_NORMAL 0 +#define SDP_XML_ENCODING_HEX 1 + void convert_sdp_record_to_xml(sdp_record_t *rec, void *user_data, void (*append_func) (void *, const char *)); +sdp_data_t *sdp_xml_parse_nil(const char *data); +sdp_data_t *sdp_xml_parse_text(const char *data, char encoding); +sdp_data_t *sdp_xml_parse_url(const char *data); +sdp_data_t *sdp_xml_parse_int(const char *data, uint8_t dtd); +sdp_data_t *sdp_xml_parse_uuid(const char *data); + +sdp_record_t *sdp_xml_parse_record(const char *data, int size); + #endif /* __SDP_XML_H */ -- cgit From 607695ed109340f4b7a5628420e0a8e8aee34f4e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Jan 2007 17:48:12 +0000 Subject: Update copyright information --- common/sdp-xml.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/sdp-xml.h') diff --git a/common/sdp-xml.h b/common/sdp-xml.h index 16bea948..ab8ed09b 100644 --- a/common/sdp-xml.h +++ b/common/sdp-xml.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2005-2006 Marcel Holtmann + * Copyright (C) 2005-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify -- cgit From e21806ba296e3062960ad4f85e216d81753c5b7a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 20 Jan 2007 18:10:17 +0000 Subject: Extract common function from expat based parser --- common/sdp-xml.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'common/sdp-xml.h') diff --git a/common/sdp-xml.h b/common/sdp-xml.h index ab8ed09b..2d4d7d79 100644 --- a/common/sdp-xml.h +++ b/common/sdp-xml.h @@ -39,6 +39,22 @@ sdp_data_t *sdp_xml_parse_url(const char *data); sdp_data_t *sdp_xml_parse_int(const char *data, uint8_t dtd); sdp_data_t *sdp_xml_parse_uuid(const char *data); +struct sdp_xml_data { + char *text; /* Pointer to the current buffer */ + int size; /* Size of the current buffer */ + sdp_data_t *data; /* The current item being built */ + struct sdp_xml_data *next; /* Next item on the stack */ + char type; /* 0 = Text or Hexadecimal */ + char *name; /* Name, optional in the dtd */ + /* TODO: What is it used for? */ +}; + +struct sdp_xml_data *sdp_xml_data_alloc(); +void sdp_xml_data_free(struct sdp_xml_data *elem); +struct sdp_xml_data *sdp_xml_data_expand(struct sdp_xml_data *elem); + +sdp_data_t *sdp_xml_parse_datatype(const char *el, struct sdp_xml_data *elem); + sdp_record_t *sdp_xml_parse_record(const char *data, int size); - + #endif /* __SDP_XML_H */ -- cgit From cb5898ff72875b9c24d7fc44cddb005f4495dff3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 May 2007 15:13:50 +0000 Subject: Fix SDP pattern extraction for XML --- common/sdp-xml.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/sdp-xml.h') diff --git a/common/sdp-xml.h b/common/sdp-xml.h index 2d4d7d79..1ab6bb19 100644 --- a/common/sdp-xml.h +++ b/common/sdp-xml.h @@ -37,7 +37,7 @@ sdp_data_t *sdp_xml_parse_nil(const char *data); sdp_data_t *sdp_xml_parse_text(const char *data, char encoding); sdp_data_t *sdp_xml_parse_url(const char *data); sdp_data_t *sdp_xml_parse_int(const char *data, uint8_t dtd); -sdp_data_t *sdp_xml_parse_uuid(const char *data); +sdp_data_t *sdp_xml_parse_uuid(const char *data, sdp_record_t *record); struct sdp_xml_data { char *text; /* Pointer to the current buffer */ @@ -53,7 +53,8 @@ struct sdp_xml_data *sdp_xml_data_alloc(); void sdp_xml_data_free(struct sdp_xml_data *elem); struct sdp_xml_data *sdp_xml_data_expand(struct sdp_xml_data *elem); -sdp_data_t *sdp_xml_parse_datatype(const char *el, struct sdp_xml_data *elem); +sdp_data_t *sdp_xml_parse_datatype(const char *el, struct sdp_xml_data *elem, + sdp_record_t *record); sdp_record_t *sdp_xml_parse_record(const char *data, int size); -- cgit From e823c15e43a6f924779e466d434c51157002d9ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:37:05 +0000 Subject: Update copyright information --- common/sdp-xml.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/sdp-xml.h') diff --git a/common/sdp-xml.h b/common/sdp-xml.h index 1ab6bb19..adb173e2 100644 --- a/common/sdp-xml.h +++ b/common/sdp-xml.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2005-2007 Marcel Holtmann + * Copyright (C) 2005-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify -- cgit