aboutsummaryrefslogtreecommitdiff
path: root/src/gdbm.h.in
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-07-25 12:37:52 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2016-07-25 12:54:39 +0300
commit364f4246159b8d338c2fafc70b868ffc83816c2f (patch)
treed6609a1a066d657df4d7615f55834a29f45c6c6f /src/gdbm.h.in
parentde7834e96602695db1cb6efd6238398b84d2ca60 (diff)
downloadgdbm-364f4246159b8d338c2fafc70b868ffc83816c2f.tar.gz
gdbm-364f4246159b8d338c2fafc70b868ffc83816c2f.tar.bz2
Add debug info.
* configure.ac: Fix description wording. * src/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Don't define GDBM_DEBUG_ENABLE. * tests/Makefile.am: Likewise. * src/debug.c (gdbm_debug_printer) (gdbm_debug_flags): New globals. (gdbm_debug_token, gdbm_debug_parse_state) (gdbm_debug_datum): New functions. * src/gdbm.h.in [@GDBM_DEBUG_ENABLE@]: Define GDBM_DEBUG_ENABLE. (gdbm_debug_printer_t): New typedef. (gdbm_debug_printer, gdbm_debug_flags): New externs. (GDBM_DEBUG_ERR,GDBM_DEBUG_OPEN) (GDBM_DEBUG_READ,GDBM_DEBUG_STORE) (GDBM_DEBUG_LOOKUP,GDBM_DEBUG_ALL): New defines. (gdbm_debug_token,gdbm_debug_parse_state) (gdbm_debug_datum): New protos. * src/gdbmdefs.h (GDBM_DEBUG,GDBM_DEBUG_DATUM): New macros. * src/findkey.c: Add debugging info. * src/gdbmfetch.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmseq.c: Likewise. * src/gdbmstore.c: Likewise. * src/gdbmtool.c (open_handler): Allow the use of ~/ (command) <repeat,variadic>: New members. (run_command): Handle variadic functions. (run_last_command): New command. In interactive mode, repeats the last command if it was marked with repeat=1 (currently, only "next"). New command: "debug". (all functions): Use terror instead of fprintf(stderr,...); * src/gdbmtool.h (handler_param) <vararg>: New member. (run_last_command): New proto. * src/gram.y: Call run_last_command) on empty input. * tests/gtload.c: New option: -debug=
Diffstat (limited to 'src/gdbm.h.in')
-rw-r--r--src/gdbm.h.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gdbm.h.in b/src/gdbm.h.in
index 4ee3a11..3d3a7d0 100644
--- a/src/gdbm.h.in
+++ b/src/gdbm.h.in
@@ -240,6 +240,29 @@ extern const char *gdbm_db_strerror (GDBM_FILE dbf);
extern int gdbm_version_cmp (int const a[], int const b[]);
+#if @GDBM_DEBUG_ENABLE@
+# define GDBM_DEBUG_ENABLE 1
+
+typedef void (*gdbm_debug_printer_t) (char const *, ...);
+extern gdbm_debug_printer_t gdbm_debug_printer;
+extern int gdbm_debug_flags;
+
+# define GDBM_DEBUG_ERR 0x00000001
+# define GDBM_DEBUG_OPEN 0x00000002
+# define GDBM_DEBUG_READ 0x00000004
+# define GDBM_DEBUG_STORE 0x00000008
+# define GDBM_DEBUG_LOOKUP 0x00000010
+
+# define GDBM_DEBUG_ALL 0xffffffff
+
+extern int gdbm_debug_token (char const *tok);
+extern void gdbm_debug_parse_state (int (*f) (void *, int, char const *),
+ void *d);
+
+extern void gdbm_debug_datum (datum dat, char const *pfx);
+
+#endif
+
# if defined(__cplusplus) || defined(c_plusplus)
}
# endif

Return to:

Send suggestions and report system problems to the System administrator.