diff options
| author | Manuel Traut <manut@mecka.net> | 2013-01-15 00:41:33 +0100 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2013-01-15 00:41:33 +0100 |
| commit | 3dfb4cefed51c9cc4dd5879bfe63cc835aaf1568 (patch) | |
| tree | 37c5eaed7e9803b98250a2113e9278c2a313c1e2 | |
| parent | f8b3b3b854ad05329c73d5b98fa24916a270de65 (diff) | |
add libiniparser c++ library wrapper
needed to use the functions of the c library
Signed-off-by: Manuel Traut <manut@mecka.net>
| -rw-r--r-- | io/bin/generic_gpio/Makefile | 2 | ||||
| -rw-r--r-- | io/bin/generic_gpio/ini.c | 17 | ||||
| -rw-r--r-- | io/bin/generic_gpio/ini.h | 14 |
3 files changed, 33 insertions, 0 deletions
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 <iniparser.h> +#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 |
