projects
/
chise
/
xemacs-chise.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge r21-4-14-chise-b1.
[chise/xemacs-chise.git]
/
src
/
database.c
diff --git
a/src/database.c
b/src/database.c
index
79dd595
..
3e70dc3
100644
(file)
--- a/
src/database.c
+++ b/
src/database.c
@@
-45,18
+45,27
@@
Boston, MA 02111-1307, USA. */
#ifdef HAVE_INTTYPES_H
#define __BIT_TYPES_DEFINED__
#include <inttypes.h>
#ifdef HAVE_INTTYPES_H
#define __BIT_TYPES_DEFINED__
#include <inttypes.h>
+#ifndef __FreeBSD__
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
#ifdef WE_DONT_NEED_QUADS
typedef uint64_t u_int64_t;
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
#ifdef WE_DONT_NEED_QUADS
typedef uint64_t u_int64_t;
+#endif
#endif /* WE_DONT_NEED_QUADS */
#endif /* HAVE_INTTYPES_H */
#endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */
#endif /* WE_DONT_NEED_QUADS */
#endif /* HAVE_INTTYPES_H */
#endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */
+/* Berkeley DB wants __STDC__ to be defined; else if does `#define const' */
+#if ! defined (__STDC__) && ! defined(__cplusplus)
+#define __STDC__ 0
+#endif
#include DB_H_FILE /* Berkeley db's header file */
#ifndef DB_VERSION_MAJOR
# define DB_VERSION_MAJOR 1
#endif /* DB_VERSION_MAJOR */
#include DB_H_FILE /* Berkeley db's header file */
#ifndef DB_VERSION_MAJOR
# define DB_VERSION_MAJOR 1
#endif /* DB_VERSION_MAJOR */
+#ifndef DB_VERSION_MINOR
+# define DB_VERSION_MINOR 0
+#endif /* DB_VERSION_MINOR */
Lisp_Object Qberkeley_db;
Lisp_Object Qhash, Qbtree, Qrecno, Qunknown;
#if DB_VERSION_MAJOR > 2
Lisp_Object Qberkeley_db;
Lisp_Object Qhash, Qbtree, Qrecno, Qunknown;
#if DB_VERSION_MAJOR > 2
@@
-688,8
+697,14
@@
and defaults to 0755.
status = db_create (&dbase, NULL, 0);
if (status)
return Qnil;
status = db_create (&dbase, NULL, 0);
if (status)
return Qnil;
+#if DB_VERSION_MAJOR < 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 1)
status = dbase->open (dbase, filename, NULL,
real_subtype, accessmask, modemask);
status = dbase->open (dbase, filename, NULL,
real_subtype, accessmask, modemask);
+#else /* DB_VERSION >= 4.1 */
+ /* DB_AUTO_COMMIT requires transaction support, don't try it */
+ status = dbase->open (dbase, NULL, filename, NULL, real_subtype,
+ accessmask, modemask);
+#endif /* DB_VERSION < 4.1 */
if (status)
{
dbase->close (dbase, 0);
if (status)
{
dbase->close (dbase, 0);
@@
-769,7
+784,7
@@
If there is no corresponding value, return DEFAULT (defaults to nil).
}
}
}
}
-DEFUN ("map-database", Fmapdatabase, 2, 2, 0, /*
+DEFUN ("map-database", Fmap_database, 2, 2, 0, /*
Map FUNCTION over entries in DATABASE, calling it with two args,
each key and value in the database.
*/
Map FUNCTION over entries in DATABASE, calling it with two args,
each key and value in the database.
*/
@@
-804,7
+819,7
@@
syms_of_database (void)
DEFSUBR (Fopen_database);
DEFSUBR (Fdatabasep);
DEFSUBR (Fopen_database);
DEFSUBR (Fdatabasep);
- DEFSUBR (Fmapdatabase);
+ DEFSUBR (Fmap_database);
DEFSUBR (Fput_database);
DEFSUBR (Fget_database);
DEFSUBR (Fremove_database);
DEFSUBR (Fput_database);
DEFSUBR (Fget_database);
DEFSUBR (Fremove_database);