diff -r -u Genesis-1.1.11-STABLE/configure Genesis-1.1.12-STABLE/configure --- Genesis-1.1.11-STABLE/configure 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/configure 2004-05-07 21:25:32.000000000 -0700 @@ -1044,7 +1044,7 @@ fi -for ac_hdr in fcntl.h sys/file.h sys/time.h unistd.h vfork.h ndbm.h db1/ndbm.h gdbm-ndbm.h +for ac_hdr in fcntl.h sys/file.h sys/time.h unistd.h vfork.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n " Checking for <$ac_hdr>""... $ac_c" 1>&6 @@ -1080,32 +1080,6 @@ fi done -if eval "test \"`echo '$ac_cv_header_ndbm_h'`\" = yes"; then - cat >> confdefs.h <<\EOF -#define DBM_H_FILE -EOF -elif eval "test \"`echo '$ac_cv_header_db1_ndbm_h'`\" = yes"; then - echo "** working around odd placement of ndbm.h file" - cat >> confdefs.h <<\EOF -#define DBM_H_FILE -EOF -elif eval "test \"`echo '$ac_cv_header_gdbm_ndbm_h'`\" = yes"; then - echo "** working around odd placement of ndbm.h file" - cat >> confdefs.h <<\EOF -#define DBM_H_FILE -EOF -else - cat <&6 @@ -1687,88 +1661,6 @@ echo "$ac_t""no" 1>&6 fi -# -## check for a dbm library to use.. -## -lgdbm has priority over -lndbm -# -have_dbm=no -echo $ac_n " Checking for -lgdbm""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_gdbm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lgdbm $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="-lgdbm $LIBS" -else - echo "$ac_t""no" 1>&6 - - echo $ac_n " Checking for -lndbm""... $ac_c" 1>&6 - if eval "test \"`echo '$''{'ac_cv_lib_ndbm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" - LIBS="-lndbm $LIBS" - cat > conftest.$ac_ext <&6 - if [ $SYS = "hp-hpux" ]; then - cat <&6 - fi - fi -fi - ##### # strftime is in -lintl on SCO UNIX. echo $ac_n " Checking for -lintl""... $ac_c" 1>&6 @@ -2274,6 +2166,155 @@ echo "$ac_t""no" 1>&6 fi +######################################################### +## Find an implementation of the db libraries + +echo 1>&6 +echo " Checking for how to get db support" 1>&6 + +# preferred entries are at the end of the list +for ac_hdr in gdbm-ndbm.h db1/ndbm.h ndbm.h db.h +do +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +echo $ac_n " Checking for <$ac_hdr>""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` + cat >> confdefs.h <&6 +fi +done + +if test -z "$db_header_to_use"; then + echo " Unable to figure out what header to include to get db support" 1>&6 + exit 1 +else + echo " Using... <$ac_hdr>" 1>&6 + cat >> confdefs.h < +EOF +fi + +echo $ac_n " Checking to see if DB_DBM_HSEARCH needs to be defined... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_db_dbm_hsearch'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +datum test_var; +int main() { return 0; } +EOF + if eval $ac_compile; then + ac_cv_db_dbm_hsearch=no + else + cat > conftest.$ac_ext < +datum test_var; +int main() { return 0; } +EOF + if eval $ac_compile; then + ac_cv_db_dbm_hsearch=yes + else + ac_cv_db_dbm_hsearch=no + fi + fi + rm -f conftest* +fi + +echo "$ac_t""$ac_cv_db_dbm_hsearch" 1>&6 +if test $ac_cv_db_dbm_hsearch = yes; then + cat >> confdefs.h <<\EOF +#define DB_DBM_HSEARCH 1 +EOF +fi + +## check for a dbm library to use.. + +for ac_lib in gdbm gdbm_compat ndbm db; do + echo $ac_n " Checking for -l$ac_lib""... $ac_c" 1>&6 + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-l$ac_lib $LIBS" + cat > conftest.$ac_ext < +int main() { return 0; } +int t() { +dbm_open(NULL, NULL, NULL) +; return 0; } +EOF + if eval $ac_link; then + eval "ac_cv_lib_$ac_lib=yes" + else + eval "ac_cv_lib_$ac_lib=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + fi + + if eval "test \"`echo '$ac_cv_lib_'$ac_lib`\" = yes"; then + echo "$ac_t""yes" 1>&6 + db_lib_to_use=$ac_lib + else + echo "$ac_t""no" 1>&6 + fi +done + +if test -z "$db_lib_to_use"; then + echo " Unable to figure out what library to ling to get db support" + exit 1 +else + LIBS="-l$db_lib_to_use $LIBS" + echo " Using... -l$db_lib_to_use" 1>&6 +fi + +if eval "test \"`echo '$ac_cv_lib_'ndbm`\" = yes"; then + if [ $SYS = "hp-hpux" ]; then + cat <&6 + ###################################################################### echo "- Genesis Configuration" diff -r -u Genesis-1.1.11-STABLE/etc/notes Genesis-1.1.12-STABLE/etc/notes --- Genesis-1.1.11-STABLE/etc/notes 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/etc/notes 2004-05-07 22:28:08.000000000 -0700 @@ -10,6 +10,12 @@ http://web.cold.org/contact.html RELEASE INFORMATION: +1.1.12 [5/7/2004] + * remove some improper win32 borland compiler logic (Jon Lambert) + * fix origin bug in listidx (Will Robertson) + * fix `[buffer1] in `[buffer2] where buffer2 is empty to return 0 (Brad) + * overhaul the configure script for db header and library finding (Brad) + 1.1.11 [6/28/2002] * fix BUFFER in BUFFER. Use buffer_index which contained a fix not propagated to the previously duplicated code in op_in diff -r -u Genesis-1.1.11-STABLE/etc/version Genesis-1.1.12-STABLE/etc/version --- Genesis-1.1.11-STABLE/etc/version 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/etc/version 2004-05-07 22:28:08.000000000 -0700 @@ -1 +1 @@ -1.1.11 +1.1.12-STABLE diff -r -u Genesis-1.1.11-STABLE/src/Makefile.in Genesis-1.1.12-STABLE/src/Makefile.in --- Genesis-1.1.11-STABLE/src/Makefile.in 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/Makefile.in 2004-05-07 21:25:34.000000000 -0700 @@ -99,7 +99,7 @@ @cd $(DATADIR); make $@ commitable: - @cd $(MODULES); ./modbuild -m0 cdc veil web ext_math + @cd $(MODULES); ./modbuild -m0 cdc web ext_math commit: commitable cvs commit diff -r -u Genesis-1.1.11-STABLE/src/data/list.c Genesis-1.1.12-STABLE/src/data/list.c --- Genesis-1.1.11-STABLE/src/data/list.c 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/data/list.c 2004-05-07 22:28:09.000000000 -0700 @@ -379,8 +379,7 @@ return (d - start) + 1; } } else { - start += origin; - for (d = start; d < end; d++) { + for (d = start + origin; d < end; d++) { if (data_cmp(search, d) == 0) return (d - start) + 1; } diff -r -u Genesis-1.1.11-STABLE/src/include/config.h.in Genesis-1.1.12-STABLE/src/include/config.h.in --- Genesis-1.1.11-STABLE/src/include/config.h.in 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/include/config.h.in 2004-05-07 21:25:35.000000000 -0700 @@ -20,8 +20,9 @@ /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -/* workaround for lame RedHat Linux placement of ndbm.h */ +/* Define for the right header for dbm routines */ #undef DBM_H_FILE +#undef DB_DBM_HSEARCH /* Define if your struct dirent has d_namlen */ #undef HAVE_D_NAMLEN diff -r -u Genesis-1.1.11-STABLE/src/io.c Genesis-1.1.12-STABLE/src/io.c --- Genesis-1.1.11-STABLE/src/io.c 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/io.c 2003-02-01 21:56:14.000000000 -0800 @@ -318,6 +318,8 @@ conn->flags.dead = 1; return; } + /* hrm.. we got ERR_AGAIN, do nothing this time */ + return; } else if (len == 0) { conn->flags.readable = 0; conn->flags.dead = 1; diff -r -u Genesis-1.1.11-STABLE/src/lookup.c Genesis-1.1.12-STABLE/src/lookup.c --- Genesis-1.1.11-STABLE/src/lookup.c 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/lookup.c 2004-05-07 21:25:34.000000000 -0700 @@ -11,20 +11,13 @@ #include #endif #include -#ifdef __UNIX__ -#ifdef DBM_H_FILE -#include DBM_H_FILE -#else -#include -#endif -#else -#include "ndbm.h" -#endif #include #include #include "cdc_db.h" #include "util.h" +#include DBM_H_FILE + #ifdef S_IRUSR #define READ_WRITE (S_IRUSR | S_IWUSR) #define READ_WRITE_EXECUTE (S_IRUSR | S_IWUSR | S_IXUSR) diff -r -u Genesis-1.1.11-STABLE/src/modules/cdc_misc.c Genesis-1.1.12-STABLE/src/modules/cdc_misc.c --- Genesis-1.1.11-STABLE/src/modules/cdc_misc.c 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/modules/cdc_misc.c 2004-05-07 22:28:09.000000000 -0700 @@ -16,12 +16,6 @@ #include "net.h" #include "dns.h" -#if defined(__Win32__) && !defined(__MSVC__) -#define FTIME _lstrftime -#else -#define FTIME strftime -#endif - NATIVE_METHOD(strftime) { char s[LINE]; char * fmt; @@ -57,7 +51,7 @@ if (fmt[strlen(fmt)] == '%') fmt[strlen(fmt)] = (char) NULL; - if (FTIME(s, LINE, fmt, t) == (size_t) 0) + if (strftime(s, LINE, fmt, t) == (size_t) 0) THROW((range_id,"Format results in a string longer than 80 characters.")) CLEAN_RETURN_STRING(string_from_chars(s, strlen(s))); diff -r -u Genesis-1.1.11-STABLE/src/ops/buffer.c Genesis-1.1.12-STABLE/src/ops/buffer.c --- Genesis-1.1.11-STABLE/src/ops/buffer.c 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/ops/buffer.c 2004-05-07 21:25:35.000000000 -0700 @@ -199,7 +199,7 @@ push_int(0); return; } - + if ((r = buffer_index(BUF1, cp, clen, origin)) == F_FAILURE) THROW((range_id, "Origin is beyond the range of the buffer.")) diff -r -u Genesis-1.1.11-STABLE/src/ops/operators.c Genesis-1.1.12-STABLE/src/ops/operators.c --- Genesis-1.1.11-STABLE/src/ops/operators.c 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/src/ops/operators.c 2004-05-07 21:25:35.000000000 -0700 @@ -2275,7 +2275,8 @@ uchar * ss = d1->u.buffer->s; int slen = d1->u.buffer->len; - pos = buffer_index(buf, ss, slen, 1) - 1; + if ((pos = buffer_index(buf, ss, slen, 1)) != F_FAILURE) + pos--; } else goto error; diff -r -u Genesis-1.1.11-STABLE/test/test.in Genesis-1.1.12-STABLE/test/test.in --- Genesis-1.1.11-STABLE/test/test.in 2002-06-28 20:45:41.000000000 -0700 +++ Genesis-1.1.12-STABLE/test/test.in 2004-05-07 22:28:10.000000000 -0700 @@ -683,8 +683,12 @@ "a" in "cab" ==> 2 "am" in "llama" ==> 3 "bc" in "llama" ==> 0 + "" in "llama" ==> 0 4 in 'foo ==> ~type + `[10, 13] in `[10, 13] ==> 1 `[10, 13] in `[10, 10] ==> 0 + `[10, 13] in `[0] ==> 0 + `[10, 13] in `[] ==> 0 Logic 1 && 1 ==> 1 1 && 0 ==> 0 @@ -775,8 +779,12 @@ dblog(" \"a\" in \"cab\" ==> " + toliteral("a" in "cab")); dblog(" \"am\" in \"llama\" ==> " + toliteral("am" in "llama")); dblog(" \"bc\" in \"llama\" ==> " + toliteral("bc" in "llama")); + dblog(" \"\" in \"llama\" ==> " + toliteral("" in "llama")); dblog(" 4 in 'foo ==> " + toliteral((| 4 in 'foo |))); + dblog(" `[10, 13] in `[10, 13] ==> " + toliteral((| `[10, 13] in `[10, 13] |))); dblog(" `[10, 13] in `[10, 10] ==> " + toliteral((| `[10, 13] in `[10, 10] |))); + dblog(" `[10, 13] in `[0] ==> " + toliteral((| `[10, 13] in `[0] |))); + dblog(" `[10, 13] in `[] ==> " + toliteral((| `[10, 13] in `[] |))); dblog(" Logic"); dblog(" 1 && 1 ==> " + toliteral(1 && 1)); dblog(" 1 && 0 ==> " + toliteral(1 && 0)); @@ -1535,7 +1543,10 @@ `[1, 2, 3, 4, 5, 5], 5, 7 -> ~range 1 `[1, 2, 3, 4, 5, 5], 5, -7 -> ~range 2 `[0, 0, 97, 0, 0, 98, 92, 65, 99], `[92, 65], 6 -> 7 - + `[10, 13], `[10, 13] -> 1 + `[10, 10], `[10, 13] -> 0 + `[0], `[10, 13] -> 0 + `[], `[10, 13] -> 0 eval { var a, b; @@ -1558,6 +1569,14 @@ b = `[92, 65]; dblog(" " + toliteral(a) + ", " + b + ", 6 -> " + toliteral((| bufidx(a, b, 6) |))); + + a = `[10, 13]; + + dblog(" `[10, 13], " + toliteral(a) + " -> " + toliteral((| bufidx(`[10, 13], a) |))); + dblog(" `[10, 10], " + toliteral(a) + " -> " + toliteral((| bufidx(`[10, 10], a) |))); + dblog(" `[0], " + toliteral(a) + " -> " + toliteral((| bufidx(`[0], a) |))); + dblog(" `[], " + toliteral(a) + " -> " + toliteral((| bufidx(`[], a) |))); + }; // Buffer test 7 @@ -1980,8 +1999,11 @@ List test 6 [1], 1 -> 1 + ['a, 'a, 'v], 'a, 2 -> 2 [1, 2, 3, 4, 5, 5], 1 -> 1 [1, 2, 3, 4, 5, 5], 5 -> 5 + [1, 2, 3, 4, 5, 5], 3, 2 -> 3 + [1, 2, 3, 4, 5, 5], 5, 4 -> 5 [1, 2, 3, 4, 5, 5], 5, -1 -> 6 [1, 2, 3, 4, 5, 5], 5, -3 -> 0 [1, 2, 3, 4, 5, 5], [5, 6] -> 0 @@ -1997,9 +2019,14 @@ dblog("List test 6"); dblog(" " + toliteral(a) + ", 1 -> " + toliteral(listidx(a, 1))); + a = ['a, 'a, 'v]; + dblog(" " + toliteral(a) + ", 'a, 2 -> " + toliteral(listidx(a, 'a, 2))); + a = [1, 2, 3, 4, 5, 5]; dblog(" " + toliteral(a) + ", 1 -> " + toliteral(listidx(a, 1))); dblog(" " + toliteral(a) + ", 5 -> " + toliteral(listidx(a, 5))); + dblog(" " + toliteral(a) + ", 3, 2 -> " + toliteral(listidx(a, 3, 2))); + dblog(" " + toliteral(a) + ", 5, 4 -> " + toliteral(listidx(a, 5, 4))); dblog(" " + toliteral(a) + ", 5, -1 -> " + toliteral(listidx(a, 5, -1))); dblog(" " + toliteral(a) + ", 5, -3 -> " + toliteral(listidx(a, 5, -3))); dblog(" " + toliteral(a) + ", [5, 6] -> " + toliteral(listidx(a, [5, 6])));