From 3dfb4cefed51c9cc4dd5879bfe63cc835aaf1568 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 15 Jan 2013 00:41:33 +0100 Subject: add libiniparser c++ library wrapper needed to use the functions of the c library Signed-off-by: Manuel Traut --- io/bin/generic_gpio/Makefile | 2 ++ io/bin/generic_gpio/ini.c | 17 +++++++++++++++++ io/bin/generic_gpio/ini.h | 14 ++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 io/bin/generic_gpio/ini.c create mode 100644 io/bin/generic_gpio/ini.h (limited to 'io/bin') diff --git a/io/bin/generic_gpio/Makefile b/io/bin/generic_gpio/Makefile index b3e04ff..0528035 100644 --- a/io/bin/generic_gpio/Makefile +++ b/io/bin/generic_gpio/Makefile @@ -13,6 +13,7 @@ LDFLAGS += -L$(DISTRIO_COMMON) -ldistrio_common \ -L$(DISTRIO_IO) -ldistrio_io \ -L$(DISTRIO_MANAGER) -ldistrio_manager \ -lACE -lTAO -lTAO_AnyTypeCode -lTAO_CosNaming -lTAO_PortableServer \ + -L. -lini \ -lrt CFLAGS += -fPIC -I$(DISTRIO_COMMON) -I$(DISTRIO_IO) -I$(DISTRIO_MANAGER) CXXFLAGS += $(CFLAGS) @@ -24,6 +25,7 @@ EXEC = $(COMPONENT) OBJ = generic_gpio.o all: $(OBJ) + $(CC) --shared -o libini.so -fPIC ini.c -liniparser $(LD) $(LDFLAGS) -o $(EXEC) $(OBJ) clean: diff --git a/io/bin/generic_gpio/ini.c b/io/bin/generic_gpio/ini.c new file mode 100644 index 0000000..2472c54 --- /dev/null +++ b/io/bin/generic_gpio/ini.c @@ -0,0 +1,17 @@ +#include "ini.h" +int init (){;} +dictionary *_iniparser_load (const char *conf) { + return iniparser_load (conf); +} + +int _iniparser_getnsec (dictionary *d) { + return iniparser_getnsec (d); +} + +char *_iniparser_getsecname (dictionary *d, int i) { + return iniparser_getsecname (d, i); +} + +void _iniparser_freedict (dictionary *d) { + iniparser_freedict (d); +} diff --git a/io/bin/generic_gpio/ini.h b/io/bin/generic_gpio/ini.h new file mode 100644 index 0000000..accc454 --- /dev/null +++ b/io/bin/generic_gpio/ini.h @@ -0,0 +1,14 @@ +#include +#define GPIO_CONFIG "gpio.conf" + +#ifdef __cplusplus +extern "C" { +#endif +int init (void); +dictionary * _iniparser_load (const char *conf); +int _iniparser_getnsec (dictionary *d); +char *_iniparser_getsecname (dictionary *d, int i); +void _iniparser_freedict (dictionary *d); +#ifdef __cplusplus +} +#endif -- cgit v1.2.3