Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -38,15 +38,13 @@ libconfig.dll.a libconfig.dll.a/* libconfig.dll.def libconfig.dll.def/* libconfig.dll/* -libconfig.h -libconfig.h/* libconfig.so libconfig.so/* test-lc test-lc.exe test-lc.exe/* test-lc/* test.cfg test.cfg/* Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -50,19 +50,15 @@ $(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) -c -o $@ "$(filter %.c, $^)" %.o: $(srcdir)/%.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ "$(filter %.c, $^)" -libconfig.h: $(srcdir)/libconfig.h.in - cat "$^" | $(CPP) $(CPPFLAGS) - | grep -v '^#' | grep -v '^ *$$' | sed 's/^!/# /g;s/__BLANK_LINE__//' > $@ - test-lc$(EXEEXT): $(LIBS) $(srcdir)/test-lc.c $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(filter %.c, $^) $(LDFLAGS) -Wl,-R -Wl,. -L. -lconfig -.PHONY: clean distclean install clean: - rm -f *.o $(BINS) $(LIBS) libconfig.h *~ test-lc$(EXEEXT) *.dll.a *.dll.def *.dll + rm -f *.o $(BINS) $(LIBS) *~ test-lc$(EXEEXT) *.dll.a *.dll.def *.dll distclean: clean rm -f Makefile config.h config.status config.log lc_geterrno.3 lc_process.3 lc_cleanup.3 lc_process_file.3 lc_register_var.3 lc_geterrstr.3 lc_register_callback.3 libconfig.3 install: all libconfig.h @@ -85,5 +81,7 @@ $(INSTALL) -m 644 lc_cleanup.3 "$(mandir)/man3/lc_cleanup.3" $(INSTALL) -m 644 libconfig.3 "$(mandir)/man3/libconfig.3" $(INSTALL) -m 644 libconfig.h "$(includedir)/libconfig.h" -( cd "$(libdir)" && rm -f libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) ) -( cd "$(libdir)" && rm -f libconfig.$(SHOBJEXT) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT) ) + +.PHONY: all clean distclean install DELETED build/h-to-hin Index: build/h-to-hin ================================================================== --- build/h-to-hin +++ build/h-to-hin @@ -1,9 +0,0 @@ -#! /bin/sh - -if [ libconfig.h -nt libconfig.h.in ]; then - echo 'Updating libconfig.h.in ...' - sed 's@^# @!@;s@^ *$@:__BLANK_LINE__:@' libconfig.h | tr ':' "\n" > libconfig.h.in -else - echo 'Updating libconfig.h ...' - make libconfig.h -fi ADDED libconfig.h Index: libconfig.h ================================================================== --- libconfig.h +++ libconfig.h @@ -0,0 +1,91 @@ +#ifndef _RSK_LIBCONFIG_H +# define _RSK_LIBCONFIG_H +# ifdef __cplusplus +extern "C" { +# endif + +typedef enum { + LC_CONF_SECTION, + LC_CONF_APACHE, + LC_CONF_COLON, + LC_CONF_EQUAL, + LC_CONF_SPACE, + LC_CONF_XML +} lc_conf_type_t; + +typedef enum { + LC_VAR_UNKNOWN, + LC_VAR_NONE, + LC_VAR_STRING, + LC_VAR_LONG_LONG, + LC_VAR_LONG, + LC_VAR_INT, + LC_VAR_SHORT, + LC_VAR_BOOL, + LC_VAR_FILENAME, + LC_VAR_DIRECTORY, + LC_VAR_SIZE_LONG_LONG, + LC_VAR_SIZE_LONG, + LC_VAR_SIZE_INT, + LC_VAR_SIZE_SHORT, + LC_VAR_TIME, + LC_VAR_DATE, + LC_VAR_SECTION, + LC_VAR_SECTIONSTART, + LC_VAR_SECTIONEND, + LC_VAR_BOOL_BY_EXISTANCE, + LC_VAR_SIZE_SIZE_T, + LC_VAR_CIDR, + LC_VAR_IP, + LC_VAR_IP4, + LC_VAR_IP6, + LC_VAR_ADDR, + LC_VAR_ADDR4, + LC_VAR_ADDR6, + LC_VAR_HOSTNAME, + LC_VAR_HOSTNAME4, + LC_VAR_HOSTNAME6, + LC_VAR_DOUBLE, + LC_VAR_FLOAT, + LC_VAR_LIST = 0x80 +} lc_var_type_t; + +typedef enum { + LC_FLAGS_VAR, + LC_FLAGS_CMDLINE, + LC_FLAGS_ENVIRON, + LC_FLAGS_SECTIONSTART, + LC_FLAGS_SECTIONEND +} lc_flags_t; + +typedef enum { + LC_ERR_NONE, + LC_ERR_INVCMD, + LC_ERR_INVSECTION, + LC_ERR_INVDATA, + LC_ERR_BADFORMAT, + LC_ERR_CANTOPEN, + LC_ERR_CALLBACK, + LC_ERR_ENOMEM +} lc_err_t; + +int lc_process(int argc, char **argv, const char *appname, lc_conf_type_t type, const char *extra); +int lc_register_callback(const char *var, char opt, lc_var_type_t type, int (*callback)(const char *, const char *, const char *, const char *, lc_flags_t, void *), void *extra); +int lc_register_var(const char *var, lc_var_type_t type, void *data, char opt); +lc_err_t lc_geterrno(void); +void lc_seterrstr(const char *usererrstr); +char *lc_geterrstr(void); +int lc_process_file(const char *appname, const char *pathname, lc_conf_type_t type); +int lc_handle_type(lc_var_type_t type, const char *value, void *data); +void lc_cleanup(void); + +# define LC_CBRET_IGNORESECTION (255) +# define LC_CBRET_OKAY (0) +# define LC_CBRET_ERROR (-1) + +extern int lc_optind; + +# ifdef __cplusplus +} +# endif +#endif DELETED libconfig.h.in Index: libconfig.h.in ================================================================== --- libconfig.h.in +++ libconfig.h.in @@ -1,107 +0,0 @@ -!ifndef _RSK_LIBCONFIG_H -!define _RSK_LIBCONFIG_H -!ifdef __cplusplus -extern "C" { -!endif - -__BLANK_LINE__ - -typedef enum { - LC_CONF_SECTION, - LC_CONF_APACHE, - LC_CONF_COLON, - LC_CONF_EQUAL, - LC_CONF_SPACE, - LC_CONF_XML -} lc_conf_type_t; - -__BLANK_LINE__ - -typedef enum { - LC_VAR_UNKNOWN, - LC_VAR_NONE, - LC_VAR_STRING, - LC_VAR_LONG_LONG, - LC_VAR_LONG, - LC_VAR_INT, - LC_VAR_SHORT, - LC_VAR_BOOL, - LC_VAR_FILENAME, - LC_VAR_DIRECTORY, - LC_VAR_SIZE_LONG_LONG, - LC_VAR_SIZE_LONG, - LC_VAR_SIZE_INT, - LC_VAR_SIZE_SHORT, - LC_VAR_TIME, - LC_VAR_DATE, - LC_VAR_SECTION, - LC_VAR_SECTIONSTART, - LC_VAR_SECTIONEND, - LC_VAR_BOOL_BY_EXISTANCE, - LC_VAR_SIZE_SIZE_T, - LC_VAR_CIDR, - LC_VAR_IP, - LC_VAR_IP4, - LC_VAR_IP6, - LC_VAR_ADDR, - LC_VAR_ADDR4, - LC_VAR_ADDR6, - LC_VAR_HOSTNAME, - LC_VAR_HOSTNAME4, - LC_VAR_HOSTNAME6, - LC_VAR_DOUBLE, - LC_VAR_FLOAT, - LC_VAR_LIST = 0x80 -} lc_var_type_t; - -__BLANK_LINE__ - -typedef enum { - LC_FLAGS_VAR, - LC_FLAGS_CMDLINE, - LC_FLAGS_ENVIRON, - LC_FLAGS_SECTIONSTART, - LC_FLAGS_SECTIONEND -} lc_flags_t; - -__BLANK_LINE__ - -typedef enum { - LC_ERR_NONE, - LC_ERR_INVCMD, - LC_ERR_INVSECTION, - LC_ERR_INVDATA, - LC_ERR_BADFORMAT, - LC_ERR_CANTOPEN, - LC_ERR_CALLBACK, - LC_ERR_ENOMEM -} lc_err_t; - -__BLANK_LINE__ - -int lc_process(int argc, char **argv, const char *appname, lc_conf_type_t type, const char *extra); -int lc_register_callback(const char *var, char opt, lc_var_type_t type, int (*callback)(const char *, const char *, const char *, const char *, lc_flags_t, void *), void *extra); -int lc_register_var(const char *var, lc_var_type_t type, void *data, char opt); -lc_err_t lc_geterrno(void); -void lc_seterrstr(const char *usererrstr); -char *lc_geterrstr(void); -int lc_process_file(const char *appname, const char *pathname, lc_conf_type_t type); -int lc_handle_type(lc_var_type_t type, const char *value, void *data); -void lc_cleanup(void); - -__BLANK_LINE__ - -!define LC_CBRET_IGNORESECTION (255) -!define LC_CBRET_OKAY (0) -!define LC_CBRET_ERROR (-1) - -__BLANK_LINE__ - -extern int lc_optind; - -__BLANK_LINE__ - -!ifdef __cplusplus -} -!endif -!endif