diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-14 21:02:01 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-14 21:02:01 +0000 |
commit | 4032f92867e5570f130e4175b3b4fb61240f9752 (patch) | |
tree | 4e56172ca9f3f586d85d912a487357d9fe3496ed | |
parent | 7a6b6a56dabe1e62a0fbc6222c090aa077bcadc7 (diff) | |
download | librcc-4032f92867e5570f130e4175b3b4fb61240f9752.tar.gz librcc-4032f92867e5570f130e4175b3b4fb61240f9752.tar.bz2 librcc-4032f92867e5570f130e4175b3b4fb61240f9752.tar.xz librcc-4032f92867e5570f130e4175b3b4fb61240f9752.zip |
0.1.0
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | configure.in | 10 | ||||
-rw-r--r-- | librcc.spec.in | 6 | ||||
-rw-r--r-- | src/fs.c | 24 | ||||
-rw-r--r-- | src/rccdb4.c | 29 | ||||
-rw-r--r-- | src/rccdb4.h | 9 | ||||
-rw-r--r-- | src/rccxml.c | 26 |
7 files changed, 80 insertions, 26 deletions
@@ -1 +1 @@ -0.1.0 +0.1.1 diff --git a/configure.in b/configure.in index 2b4c0fc..e4c6027 100644 --- a/configure.in +++ b/configure.in @@ -17,12 +17,12 @@ AC_SUBST(LIBRCC_VERSION_SUBMINOR) AC_SUBST(LIBRCC_VERSION_INFO) LIBRCC_CVS=`cat VERSION | sed -e s/.*CVS.*/CVS/` -if test "x$LIBRCC_CVS" = "x"; then -LIBRCC_CVS=0 -LIBRCC_CVS_DATE=0 -else +if test "x$LIBRCC_CVS" = "xCVS"; then LIBRCC_CVS=1 LIBRCC_CVS_DATE=`date +%y%m%d.%H` +else +LIBRCC_CVS=0 +LIBRCC_CVS_DATE=0 fi AC_SUBST(LIBRCC_CVS) AC_SUBST(LIBRCC_CVS_DATE) @@ -47,7 +47,7 @@ AC_PATH_PROG(TAR, tar, /bin/tar) dnl Checks for header files. AC_CHECK_HEADERS(iconv.h,, [AC_MSG_ERROR(Missing iconv header)]) -AC_CHECK_HEADERS(mntent.h pwd.h sys/types.h sys/stat.h unistd.h) +AC_CHECK_HEADERS(mntent.h pwd.h sys/types.h sys/stat.h sys/file.h unistd.h fcntl.h) AC_TRY_COMPILE([#include <langinfo.h>], [char *codeset = nl_langinfo (CODESET);], diff --git a/librcc.spec.in b/librcc.spec.in index a0778dc..ec3025f 100644 --- a/librcc.spec.in +++ b/librcc.spec.in @@ -53,10 +53,10 @@ is part of rusxmms patch. rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc -mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/rcc/ -%makeinstall prefix=$RPM_BUILD_ROOT%{prefix} +mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/rcc/engines/ +make install DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT%{prefix}/lib/*.la -rm -f $RPM_BUILD_ROOT%{prefix}/lib/rcc/engines/*.?a +rm -f $RPM_BUILD_ROOT%{prefix}/lib/rcc/engines/*.a rm -f $RPM_BUILD_ROOT%{prefix}/lib/rcc/engines/*.la install -m 644 examples/rcc.xml $RPM_BUILD_ROOT/etc @@ -1,10 +1,24 @@ #include <stdio.h> #include <string.h> #include <errno.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <mntent.h> + +#include "../config.h" + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif /* HAVE_UNISTD_H */ + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif /* HAVE_SYS_TYPES_H */ + +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif /* HAVE_SYS_STAT_H */ + +#ifdef HAVE_MNTENT_H +# include <mntent.h> +#endif /* HAVE_MNTENT_H */ #include "internal.h" #include "rcciconv.h" @@ -75,6 +89,7 @@ int rccFS0(rcc_language_config config, const char *fspath, const char *filename, if (!len) return 1; if (!strncmp(filename, fspath, len)) tmp = filename + strlen(fspath); +#ifdef HAVE_MNTENT_H } else { lastprefix = config->ctx->lastprefix; @@ -102,6 +117,7 @@ int rccFS0(rcc_language_config config, const char *fspath, const char *filename, } endmntent(mtab); } +#endif /* HAVE_MNTENT_H */ } if (!tmp) return 1; diff --git a/src/rccdb4.c b/src/rccdb4.c index fc821a8..60c9606 100644 --- a/src/rccdb4.c +++ b/src/rccdb4.c @@ -37,6 +37,7 @@ int rccInitDb4(rcc_context ctx, const char *name, rcc_db4_flags flags) { db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) { int err; db4_context ctx; +#ifdef HAVE_DB_H DB_ENV *dbe; DB *db; @@ -61,34 +62,43 @@ db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) { dbe->close(dbe, 0); return NULL; } +#endif /* HAVE_DB_H */ ctx = (db4_context)malloc(sizeof(db4_context_s)); if (!ctx) { +#ifdef HAVE_DB_H db->close(db, 0); dbe->close(dbe, 0); +#endif /* HAVE_DB_H */ return NULL; } +#ifdef HAVE_DB_H ctx->db = db; ctx->dbe = dbe; +#endif /* HAVE_DB_H */ ctx->flags = flags; return ctx; } void rccDb4FreeContext(db4_context ctx) { if (ctx) { +#ifdef HAVE_DB_H ctx->db->close(ctx->db, 0); ctx->dbe->close(ctx->dbe, 0); +#endif /* HAVE_DB_H */ free(ctx); } } int rccDb4SetKey(db4_context ctx, const char *orig, size_t olen, const rcc_string string) { - int err; +#ifdef HAVE_DB_H DBT key, data; +#endif /* HAVE_DB_H */ if ((!ctx)||(!orig)||(!string)) return -1; +#ifdef HAVE_DB_H memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); @@ -99,16 +109,20 @@ int rccDb4SetKey(db4_context ctx, const char *orig, size_t olen, const rcc_strin if (key.size < RCC_MIN_DB4_CHARS) return -1; - err = ctx->db->put(ctx->db, NULL, &key, &data, 0); - return err; + if (!ctx->db->put(ctx->db, NULL, &key, &data, 0)) return 0; +#endif /* HAVE_DB_H */ + + return 1; } rcc_string rccDb4GetKey(db4_context ctx, const char *orig, size_t olen) { - int err; +#ifdef HAVE_DB_H DBT key, data; +#endif /* HAVE_DB_H */ if ((!ctx)||(!orig)) return NULL; +#ifdef HAVE_DB_H memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); @@ -119,7 +133,8 @@ rcc_string rccDb4GetKey(db4_context ctx, const char *orig, size_t olen) { if (key.size < RCC_MIN_DB4_CHARS) return NULL; - err = ctx->db->get(ctx->db, NULL, &key, &data, 0); - if (err) return NULL; - return data.data; + if (!ctx->db->get(ctx->db, NULL, &key, &data, 0)) return data.data; +#endif /* HAVE_DB_H */ + + return NULL; } diff --git a/src/rccdb4.h b/src/rccdb4.h index 33457ef..1d5072b 100644 --- a/src/rccdb4.h +++ b/src/rccdb4.h @@ -1,12 +1,19 @@ #ifndef _RCC_DB4_H #define _RCC_DB4_H -#include <db.h> +#include "../config.h" + +#ifdef HAVE_DB_H +# include <db.h> +#endif /* HAVE_DB_H */ + #include "rccstring.h" struct db4_context_t { +#ifdef HAVE_DB_H DB_ENV *dbe; DB *db; +#endif /* HAVE_DB_H */ rcc_db4_flags flags; }; diff --git a/src/rccxml.c b/src/rccxml.c index b7cc1d8..c7ee405 100644 --- a/src/rccxml.c +++ b/src/rccxml.c @@ -1,11 +1,27 @@ #include <stdio.h> #include <stdarg.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/file.h> +#include "../config.h" + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif /* HAVE_UNISTD_H */ + +#ifdef HAVE_FCNTL_H +# include <fcntl.h> +#endif /* HAVE_FCNTL_H */ + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif /* HAVE_SYS_TYPES_H */ + +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif /* HAVE_SYS_STAT_H */ + +#ifdef HAVE_SYS_FILE_H +# include <sys/file.h> +#endif /* HAVE_SYS_FILE_H */ #include <libxml/parser.h> #include <libxml/tree.h> |