--- db2/clib/getlong.c.jj Tue Jun 9 17:02:31 1998 +++ db2/clib/getlong.c Thu Apr 20 13:53:38 2000 @@ -34,7 +34,7 @@ get_long(p, min, max, storep) long val; char *end; - __set_errno(0); + errno = 0; val = strtol(p, &end, 10); if ((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE) err(1, "%s", p); --- db2/db185/db185.c.jj Tue Jun 9 17:03:04 1998 +++ db2/db185/db185.c Thu Apr 20 14:00:23 2000 @@ -205,7 +205,7 @@ __dbopen(file, oflags, mode, type, openi s_errno = errno; (void)dbp->close(dbp, 0); __db_free(db185p); - __set_errno(s_errno); + errno = s_errno; return (NULL); } @@ -213,7 +213,7 @@ __dbopen(file, oflags, mode, type, openi return (db185p); einval: __db_free(db185p); - __set_errno(EINVAL); + errno = EINVAL; return (NULL); } weak_alias (__dbopen, dbopen) @@ -226,7 +226,7 @@ db185_close(db185p) dbp = (DB *)db185p->internal; - __set_errno(dbp->close(dbp, 0)); + errno = dbp->close(dbp, 0); __db_free(db185p); @@ -251,9 +251,9 @@ db185_del(db185p, key185, flags) if (flags & ~R_CURSOR) goto einval; if (flags & R_CURSOR) - __set_errno(db185p->dbc->c_del(db185p->dbc, 0)); + errno = db185p->dbc->c_del(db185p->dbc, 0); else - __set_errno(dbp->del(dbp, NULL, &key, 0)); + errno = dbp->del(dbp, NULL, &key, 0); switch (errno) { case 0: @@ -263,7 +263,7 @@ db185_del(db185p, key185, flags) } return (-1); -einval: __set_errno(EINVAL); +einval: errno = EINVAL; return (-1); } @@ -276,7 +276,7 @@ db185_fd(db185p) dbp = (DB *)db185p->internal; - return ((__set_errno(dbp->fd(dbp, &fd))) == 0 ? fd : -1); + return ((errno = dbp->fd(dbp, &fd)) == 0 ? fd : -1); } static int @@ -301,7 +301,7 @@ db185_get(db185p, key185, data185, flags if (flags) goto einval; - switch (__set_errno(dbp->get(dbp, NULL, &key, &data, 0))) { + switch (errno = dbp->get(dbp, NULL, &key, &data, 0)) { case 0: data185->data = data.data; data185->size = data.size; @@ -311,7 +311,7 @@ db185_get(db185p, key185, data185, flags } return (-1); -einval: __set_errno(EINVAL); +einval: errno = EINVAL; return (-1); } @@ -338,46 +338,46 @@ db185_put(db185p, key185, data185, flags switch (flags) { case 0: - __set_errno(dbp->put(dbp, NULL, &key, &data, 0)); + errno = dbp->put(dbp, NULL, &key, &data, 0); break; case R_CURSOR: - __set_errno( - db185p->dbc->c_put(db185p->dbc, &key, &data, DB_CURRENT)); + errno = + db185p->dbc->c_put(db185p->dbc, &key, &data, DB_CURRENT); break; case R_IAFTER: case R_IBEFORE: if (dbp->type != DB_RECNO) goto einval; - if ((__set_errno(dbp->cursor(dbp, NULL, &dbcp_put))) != 0) + if ((errno = dbp->cursor(dbp, NULL, &dbcp_put)) != 0) return (-1); - if ((__set_errno( - dbcp_put->c_get(dbcp_put, &key, &data, DB_SET))) != 0) { + if ((errno = + dbcp_put->c_get(dbcp_put, &key, &data, DB_SET)) != 0) { s_errno = errno; (void)dbcp_put->c_close(dbcp_put); - __set_errno(s_errno); + errno = s_errno; return (-1); } memset(&data, 0, sizeof(data)); data.data = data185->data; data.size = data185->size; - __set_errno(dbcp_put->c_put(dbcp_put, - &key, &data, flags == R_IAFTER ? DB_AFTER : DB_BEFORE)); + errno = dbcp_put->c_put(dbcp_put, + &key, &data, flags == R_IAFTER ? DB_AFTER : DB_BEFORE); s_errno = errno; (void)dbcp_put->c_close(dbcp_put); - __set_errno(s_errno); + errno = s_errno; break; case R_NOOVERWRITE: - __set_errno(dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE)); + errno = dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE); break; case R_SETCURSOR: if (dbp->type != DB_BTREE && dbp->type != DB_RECNO) goto einval; - if ((__set_errno(dbp->put(dbp, NULL, &key, &data, 0))) != 0) + if ((errno = dbp->put(dbp, NULL, &key, &data, 0)) != 0) break; - __set_errno(db185p->dbc->c_get(db185p->dbc, - &key, &data, DB_SET_RANGE)); + errno = db185p->dbc->c_get(db185p->dbc, + &key, &data, DB_SET_RANGE); break; default: goto einval; @@ -393,7 +393,7 @@ db185_put(db185p, key185, data185, flags } return (-1); -einval: __set_errno(EINVAL); +einval: errno = EINVAL; return (-1); } @@ -438,8 +438,8 @@ db185_seq(db185p, key185, data185, flags default: goto einval; } - switch (__set_errno(db185p->dbc->c_get(db185p->dbc, - &key, &data, flags))) { + switch (errno = db185p->dbc->c_get(db185p->dbc, + &key, &data, flags)) { case 0: key185->data = key.data; key185->size = key.size; @@ -451,7 +451,7 @@ db185_seq(db185p, key185, data185, flags } return (-1); -einval: __set_errno(EINVAL); +einval: errno = EINVAL; return (-1); } @@ -479,8 +479,8 @@ db185_sync(db185p, flags) goto einval; } - return ((__set_errno(dbp->sync(dbp, 0))) == 0 ? 0 : -1); + return ((errno = dbp->sync(dbp, 0)) == 0 ? 0 : -1); -einval: __set_errno(EINVAL); +einval: errno = EINVAL; return (-1); } --- db2/dbm/dbm.c.jj Tue Jun 9 17:03:09 1998 +++ db2/dbm/dbm.c Thu Apr 20 13:58:27 2000 @@ -255,7 +255,7 @@ __db_ndbm_fetch(db, key) } else { data.dptr = NULL; data.dsize = 0; - __set_errno (ret == DB_NOTFOUND ? ENOENT : ret); + errno = (ret == DB_NOTFOUND ? ENOENT : ret); } return (data); } @@ -290,7 +290,7 @@ __db_ndbm_firstkey(db) } else { key.dptr = NULL; key.dsize = 0; - __set_errno (ret == DB_NOTFOUND ? ENOENT : ret); + errno = (ret == DB_NOTFOUND ? ENOENT : ret); } return (key); } @@ -324,7 +324,7 @@ __db_ndbm_nextkey(db) } else { key.dptr = NULL; key.dsize = 0; - __set_errno (ret == DB_NOTFOUND ? ENOENT : ret); + errno = (ret == DB_NOTFOUND ? ENOENT : ret); } return (key); } --- db2/Versions.jj Fri Aug 21 19:20:21 1998 +++ db2/Versions Wed Apr 19 18:41:45 2000 @@ -1,5 +1,5 @@ -libdb { - GLIBC_2.0 { +GLIBC_2.0 { + global: # db 1.85 interface dbopen; __dbopen; @@ -7,8 +7,11 @@ libdb { dbm_clearerr; dbm_close; dbm_delete; dbm_dirfno; dbm_error; dbm_fetch; dbm_firstkey; dbminit; dbm_nextkey; dbm_open; dbm_pagfno; dbm_store; - } - GLIBC_2.1 { + local: + *; +}; +GLIBC_2.1 { + global: # db.2.x interface # Internal functions used by db maintenance programs __bam_init_print; __bam_pgin; __bam_pgout; @@ -50,5 +53,4 @@ libdb { # compatibility interface for dbm __db_dbm_delete; __db_dbm_fetch; __db_dbm_firstkey; __db_dbm_init; __db_dbm_nextkey; __db_dbm_store; - } -} +}GLIBC_2.0; --- db2/Makefile.jj Wed Aug 25 21:41:51 1999 +++ db2/Makefile Thu Apr 20 14:04:28 2000 @@ -17,14 +17,12 @@ # Boston, MA 02111-1307, USA. # -# Sub-makefile for libdb. +# Makefile for libdb. # # The code is lifted straight from the db 2.3.12 distribution # with minimal changes. # -subdir = db2 - subdir-dirs = btree common db db185 dbm hash lock log mp mutex os txn \ progs/db_archive progs/db_checkpoint progs/db_deadlock \ progs/db_dump progs/db_dump185 progs/db_load progs/db_printlog \ @@ -32,23 +30,6 @@ subdir-dirs = btree common db db185 dbm headers = db.h db_185.h -distribute = db_int.h config.h compat.h clib/getlong.c btree/btree.src \ - db/db.src db185/db185_int.h hash/hash.src log/log.src \ - txn/txn.src README LICENSE \ - $(addprefix include/,btree.h btree_auto.h btree_ext.h \ - clib_ext.h common_ext.h cxx_int.h \ - db.h.src db_185.h.src db_am.h db_auto.h \ - db_cxx.h db_dispatch.h db_ext.h \ - db_int.h.src db_page.h db_shash.h db_swap.h \ - hash.h hash_auto.h hash_ext.h lock.h \ - lock_ext.h log.h log_auto.h log_ext.h \ - mp.h mp_ext.h mutex_ext.h os_ext.h queue.h \ - shqueue.h txn.h txn_auto.h txn_ext.h \ - os_func.h) \ - $(addprefix mutex/,x86.gcc uts4.cc.s sparc.gcc parisc.hp \ - parisc.gcc alpha.gcc alpha.dec README \ - 68020.gcc tsl_parisc.s sco.cc) - vpath %.c $(subdir-dirs) extra-libs := libdb @@ -71,54 +52,39 @@ libdb-routines := bt_close bt_compare bt mp_open mp_pr mp_region mp_sync mutex txn txn_auto \ txn_rec dbm db185 -others := makedb db_dump185 db_archive db_checkpoint db_deadlock \ - db_dump db_load db_recover db_stat db_printlog -install-bin := makedb db_dump185 db_archive db_checkpoint db_deadlock \ - db_dump db_load db_recover db_stat db_printlog - -include ../Rules - -CPPFLAGS += -I./include -include ./compat.h - -$(objpfx)db_checkpoint: $(objpfx)getlong.o -$(objpfx)db_deadlock: $(objpfx)getlong.o -$(objpfx)db_load: $(objpfx)getlong.o - -ifeq ($(build-shared),yes) -$(objpfx)makedb: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_dump185: $(common-objpfx)db/libdb1.so$(libdb1.so-version) -$(objpfx)db_archive: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_checkpoint: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_deadlock: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_dump: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_load: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_printlog: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_recover: $(objpfx)libdb.so$(libdb.so-version) -$(objpfx)db_stat: $(objpfx)libdb.so$(libdb.so-version) -else -$(objpfx)makedb: $(objpfx)libdb.a -$(objpfx)db_dump185: $(common-objpfx)db/libdb1.a -$(objpfx)db_archive: $(objpfx)libdb.a -$(objpfx)db_checkpoint: $(objpfx)libdb.a -$(objpfx)db_deadlock: $(objpfx)libdb.a -$(objpfx)db_dump: $(objpfx)libdb.a -$(objpfx)db_load: $(objpfx)libdb.a -$(objpfx)db_printlog: $(objpfx)libdb.a -$(objpfx)db_recover: $(objpfx)libdb.a -$(objpfx)db_stat: $(objpfx)libdb.a -endif - -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -$(objpfx)libdb.so: $(common-objpfx)libc.so - -ifeq ($(build-static),yes) -subdir_install: $(inst_libdir)/libndbm.a -$(inst_libdir)/libndbm.a: $(inst_libdir)/libdb.a $(+force) - $(make-link) -endif - -ifeq ($(build-shared),yes) -subdir_install: $(inst_libdir)/libndbm.so -$(inst_libdir)/libndbm.so: $(inst_libdir)/libdb.so $(+force) - $(make-link) -endif +others := makedb db_archive \ + db_dump db_recover db_stat db_printlog +others2 := db_checkpoint db_deadlock db_load + +CFLAGS += -I. -I./include -include ./compat.h +libdb.so-version=.3 +objpfx= + +all: libdb.a libdb.so$(libdb.so-version) $(extra-objs) $(others) $(others2) + +%.o: %.c + $(CC) $(CFLAGS) -c -g -o $@ $< +%.os: %.c + $(CC) $(CFLAGS) -c -fpic -o $@ $< + +libdb.a: $(patsubst %,%.o,$(libdb-routines)) + rm -f $@ + ar cq $@ $^ + ranlib $@ + +libdb.so$(libdb.so-version): $(patsubst %,%.os,$(libdb-routines)) + $(CC) -Wl,-O1 -Wl,--version-script=Versions -Wl,-soname=libdb.so$(libdb.so-version) -shared -o $@ $^ + ln -sf $@ libdb.so + +$(others): %: %.o + $(CC) -o $@ $< -L. -ldb + +$(others2): %: %.o + $(CC) -o $@ $< $(extra-objs) -L. -ldb + +clean: + rm -f $(patsubst %,%.o,$(libdb-routines)) + rm -f $(patsubst %,%.os,$(libdb-routines)) + rm -f $(extra-objs) *~ $(others) $(others2) + rm -f libdb.a libdb.so libdb.so$(libdb.so-version) + rm -f $(patsubst %,%.o,$(others) $(others2)) --- db2/config.h.jj Tue Jun 9 17:02:06 1998 +++ db2/config.h Thu Apr 20 08:45:11 2000 @@ -153,4 +153,3 @@ /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 -#include_next --- db2/compat.h.jj Mon Apr 20 20:01:29 1998 +++ db2/compat.h Thu Apr 20 13:15:37 2000 @@ -11,3 +11,6 @@ typedef loff_t offset_t; extern int llseek (int fd, loff_t offset, int whence); + +#define weak_alias(original, alias) \ + asm (".weak " #alias "\n" #alias " = " #original); --- db2/makedb.c.jj Mon Jan 4 13:30:30 1999 +++ db2/makedb.c Thu Apr 20 13:52:32 2000 @@ -31,11 +31,6 @@ #include #include -/* Get libc version number. */ -#include "../version.h" - -#define PACKAGE _libc_intl_domainname - /* If non-zero convert key to lower case. */ static int to_lowercase; @@ -55,21 +50,21 @@ void (*argp_program_version_hook) (FILE /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = { - { "fold-case", 'f', NULL, 0, N_("Convert key to lower case") }, - { "output", 'o', N_("NAME"), 0, N_("Write output to file NAME") }, + { "fold-case", 'f', NULL, 0, "Convert key to lower case" }, + { "output", 'o', "NAME", 0, "Write output to file NAME" }, { "quiet", 'q', NULL, 0, - N_("Do not print messages while building database") }, + "Do not print messages while building database" }, { "undo", 'u', NULL, 0, - N_("Print content of database file, one entry a line") }, + "Print content of database file, one entry a line" }, { NULL, 0, NULL, 0, NULL } }; /* Short description of program. */ -static const char doc[] = N_("Create simple DB database from textual input."); +static const char doc[] = "Create simple DB database from textual input."; /* Strings for arguments in help texts. */ -static const char args_doc[] = N_("\ -INPUT-FILE OUTPUT-FILE\n-o OUTPUT-FILE INPUT-FILE\n-u INPUT-FILE"); +static const char args_doc[] = "\ +INPUT-FILE OUTPUT-FILE\n-o OUTPUT-FILE INPUT-FILE\n-u INPUT-FILE"; /* Prototype for option handler. */ static error_t parse_opt __P ((int key, char *arg, struct argp_state *state)); @@ -97,6 +92,7 @@ main (argc, argv) char *argv[]; { const char *input_name; + char *short_name; FILE *input_file; DB *db_file; int status; @@ -106,9 +102,6 @@ main (argc, argv) /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); - /* Set the text message domain. */ - textdomain (_libc_intl_domainname); - /* Initialize local variables. */ input_name = NULL; @@ -122,8 +115,13 @@ main (argc, argv) { wrong_arguments: error (0, 0, gettext ("wrong number of arguments")); + short_name = strrchr(argv[0], '/'); + if (short_name) + short_name++; + else + short_name = argv[0]; argp_help (&argp, stdout, ARGP_HELP_SEE, - program_invocation_short_name); + short_name); exit (1); } input_name = argv[remaining]; @@ -238,7 +236,7 @@ Report bugs using the `glibcbug' script static void print_version (FILE *stream, struct argp_state *state) { - fprintf (stream, "makedb (GNU %s) %s\n", PACKAGE, VERSION); + fprintf (stream, "makedb (from GNU libc 2.1.3)\n"); fprintf (stream, gettext ("\ Copyright (C) %s Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\