2010-09-13 08:17:29

by Zhenhua Zhang

[permalink] [raw]
Subject: [PATCH V2 0/2] bluez: cleanup btio library

Hi,

These two patches are to cleanup BlueZ btio.[ch] in bluez source directory.

Regards,
Zhenhua


2010-09-13 08:26:42

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH V2 0/2] bluez: cleanup btio library

Hi Zhenhua,

On Mon, Sep 13, 2010, Zhenhua Zhang wrote:
> These two patches are to cleanup BlueZ btio.[ch] in bluez source directory.

Thanks. These patches have also been pushed upstream.

Johan

2010-09-13 08:17:31

by Zhenhua Zhang

[permalink] [raw]
Subject: [PATCH V2 2/2] btio: Seperate btio.[ch] into btio directory

Seperate btio.[ch] from src directory to btio sub-folder.
---
Makefile.am | 8 +++++---
Makefile.tools | 2 +-
{src => btio}/btio.c | 0
{src => btio}/btio.h | 0
4 files changed, 6 insertions(+), 4 deletions(-)
rename {src => btio}/btio.c (100%)
rename {src => btio}/btio.h (100%)

diff --git a/Makefile.am b/Makefile.am
index 7895be2..a8829d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -102,6 +102,8 @@ endif
gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
gdbus/object.c gdbus/polkit.c

+btio_sources = btio/btio.h btio/btio.c
+
builtin_modules =
builtin_sources =
builtin_nodist =
@@ -216,14 +218,14 @@ endif
sbin_PROGRAMS += src/bluetoothd

src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
- $(attrib_sources) \
+ $(attrib_sources) $(btio_sources) \
$(mcap_sources) \
src/main.c src/log.h src/log.c \
src/security.c src/rfkill.c src/hcid.h src/sdpd.h \
src/sdpd-server.c src/sdpd-request.c \
src/sdpd-service.c src/sdpd-database.c \
src/attrib-server.h src/attrib-server.c \
- src/sdp-xml.h src/sdp-xml.c src/btio.h src/btio.c \
+ src/sdp-xml.h src/sdp-xml.c \
src/textfile.h src/textfile.c \
src/glib-helper.h src/glib-helper.c \
src/oui.h src/oui.c src/uinput.h src/ppoll.h \
@@ -357,7 +359,7 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ \

INCLUDES = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \
-I$(srcdir)/audio -I$(srcdir)/sbc -I$(srcdir)/gdbus \
- -I$(srcdir)/attrib
+ -I$(srcdir)/attrib -I$(srcdir)/btio

if MCAP
INCLUDES += -I$(builddir)/health
diff --git a/Makefile.tools b/Makefile.tools
index 1c46542..14ecf31 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -170,7 +170,7 @@ test_bdaddr_LDADD = lib/libbluetooth.la

test_agent_LDADD = @DBUS_LIBS@

-test_btiotest_SOURCES = test/btiotest.c src/btio.h src/btio.c
+test_btiotest_SOURCES = test/btiotest.c btio/btio.h btio/btio.c
test_btiotest_LDADD = @GLIB_LIBS@ lib/libbluetooth.la

test_test_textfile_SOURCES = test/test-textfile.c src/textfile.h src/textfile.c
diff --git a/src/btio.c b/btio/btio.c
similarity index 100%
rename from src/btio.c
rename to btio/btio.c
diff --git a/src/btio.h b/btio/btio.h
similarity index 100%
rename from src/btio.h
rename to btio/btio.h
--
1.7.0.4


2010-09-13 08:17:30

by Zhenhua Zhang

[permalink] [raw]
Subject: [PATCH V2 1/2] btio: Add ifndef/endif guard for btio.h

To avoid circular inclusion of include file.
---
src/btio.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/btio.h b/src/btio.h
index 81fda8e..d373ed1 100644
--- a/src/btio.h
+++ b/src/btio.h
@@ -21,6 +21,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
+#ifndef BT_IO_H
+#define BT_IO_H

#include <glib.h>

@@ -92,3 +94,4 @@ GIOChannel *bt_io_listen(BtIOType type, BtIOConnect connect,
GDestroyNotify destroy, GError **err,
BtIOOption opt1, ...);

+#endif
--
1.7.0.4