Commit b2bc00c6 authored by John P. Willis's avatar John P. Willis
Browse files

Make BERKELEYDB global handler a compile-time option

parent 777f2f88
Pipeline #689 passed with stage
in 1 minute and 57 seconds
......@@ -708,3 +708,8 @@ VERSION 0.45.2
VERSION 0.45.3
Fix bus error in merr_dump on Ubuntu 20.04
********************************************************************************
VERSION 0.46.0
Make BERKELEYDB global handler a compile-time option
......@@ -37,7 +37,7 @@
#
#
AC_INIT([freem],[0.45.3],[jpw@coherent-logic.com])
AC_INIT([freem],[0.46.0],[jpw@coherent-logic.com])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_MACRO_DIRS([m4])
......@@ -45,7 +45,7 @@ AC_CONFIG_MACRO_DIRS([m4])
PKG_PROG_PKG_CONFIG
AC_ARG_ENABLE([mwapigtk],
AS_HELP_STRING([--enable-mwapigtk], [Enable MWAPI (GTK) support]))
AS_HELP_STRING([--enable-mwapigtk], [Enable MWAPI (GTK) support (EXPERIMENTAL)]))
AS_IF([test "x$enable_mwapigtk" = "xyes"], [
PKG_CHECK_MODULES([FREEM], [
......@@ -65,12 +65,18 @@ AC_CHECK_LIB([m], [pow])
AC_CANONICAL_HOST
# get some BDB action...
AX_PATH_BDB([3],[
LIBS="$BDB_LIBS $LIBS"
LDFLAGS="$BDB_LDFLAGS $LDFLAGS"
CPPFLAGS="$CPPFLAGS $BDB_CPPFLAGS"
])
AC_ARG_ENABLE([berkeleydb],
AS_HELP_STRING([--enable-berkeleydb], [Enable BerkeleyDB global handler (EXPERIMENTAL)]))
AS_IF([test "x$enable_berkeleydb" = "xyes"], [
# get some BDB action...
AX_PATH_BDB([3],[
LIBS="$BDB_LIBS $LIBS"
LDFLAGS="$BDB_LDFLAGS $LDFLAGS"
CPPFLAGS="$CPPFLAGS $BDB_CPPFLAGS"
])
AC_DEFINE([GVH_BDB], [1], [Define if --enable-berkeleydb is set])
])
# find out if we need to link with -lsocket and/or -lnsl to get
# BSD sockets support
......
......@@ -4,7 +4,7 @@
@settitle The FreeM Manual
@copying
This manual is for FreeM, (version 0.45.3), which is a free and open-source implementation of the M programming language and database system.
This manual is for FreeM, (version 0.46.0), which is a free and open-source implementation of the M programming language and database system.
Copyright @copyright{} 2014-2021 Coherent Logic Development LLC
......@@ -18,7 +18,7 @@ Permission is granted to copy, distribute and/or modify this document under the
@title The FreeM Manual
@subtitle @sc{The Official Manual of FreeM}
@subtitle Version 0.45.3
@subtitle Version 0.46.0
@c@vskip 10pt
@c@center @image{freem-logo-sm,,,,.png}
@author John P. Willis
......@@ -280,7 +280,7 @@ $ chmod +x @emph{myscript.m}
The FreeM direct-mode environment is the mode entered when FreeM is invoked without the use of @option{-r @emph{<entryref>}} or @option{--routine=@emph{<entryref>}}:
@example
Coherent Logic Development FreeM version 0.45.3 (x86_64-pc-linux-gnu)
Coherent Logic Development FreeM version 0.46.0 (x86_64-pc-linux-gnu)
Copyright (C) 2014, 2020, 2021 Coherent Logic Development LLC
......@@ -1501,7 +1501,7 @@ In the above @emph{inclusive} form, @code{KVALUE} will kill the data values at e
@cartouche
@quotation
@emph{Note}
The below @emph{argumentless} and @emph{exclusive} forms of @code{KVALUE} are not implemented in FreeM, as of version 0.45.3, but are planned for a future release.
The below @emph{argumentless} and @emph{exclusive} forms of @code{KVALUE} are not implemented in FreeM, as of version 0.46.0, but are planned for a future release.
@end quotation
@end cartouche
......
......@@ -40,6 +40,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#if defined(GVH_BDB)
#include <db.h>
#include "mpsdef.h"
......@@ -491,3 +495,4 @@ void frm_bdb_gbl_session_dump(void)
printf ("ENGINE [%-20s]:\t%s\r\n", nsname, gbl_u_engine);
printf ("CACHE SYNC THRESHOLD :\t%ld\r\n\r\n", bdb_flush_threshold);
}
#endif
......@@ -43,6 +43,7 @@
#include "mpsdef.h"
#include "mref.h"
#include "events.h"
#include "config.h"
void (*gbl_u)(short, char *, char *);
void (*gbl_s)(short, char *, char *);
......@@ -74,11 +75,16 @@ void global_set_engine(char ns, char *engine)
if (strcmp (engine, "BUILTIN") == 0) {
gbl_u = &global_bltin;
}
#if defined(GVH_BDB)
else if (strcmp (engine, "BERKELEYDB") == 0) {
gbl_u = &global_bdb;
}
// printf ("global handler for namespace '%s' set to '%s'\r\n", nsname, engine);
#endif
else {
fprintf (stderr, "global_set_engine: invalid global handler '%s' or FreeM built without '%s' global handler support.\r\n", engine, engine);
fprintf (stderr, "global set_engine: defaulting to 'BUILTIN' global handler for namespace '%s'.\r\n", nsname);
gbl_u = &global_bltin;
}
break;
......@@ -88,12 +94,16 @@ void global_set_engine(char ns, char *engine)
if (strcmp (engine, "BUILTIN") == 0) {
gbl_s = &global_bltin;
}
#if defined(GVH_BDB)
else if (strcmp (engine, "BERKELEYDB") == 0) {
gbl_s = &global_bdb;
}
// printf ("global handler for namespace '%s' set to '%s'\r\n", "SYSTEM", engine);
#endif
else {
fprintf (stderr, "global_set_engine: invalid global handler '%s' or FreeM built without '%s' global handler support.\r\n", engine, engine);
fprintf (stderr, "global set_engine: defaulting to 'BUILTIN' global handler for namespace 'SYSTEM'.\r\n");
gbl_s = &global_bltin;
}
break;
......
......@@ -561,8 +561,9 @@ void cleanup (void)
snprintf (k_buf, 255, "^$JOB\202%d\201", pid);
global (kill_sym, k_buf, " \201");
#if defined(GVH_BDB)
frm_bdb_flush_all ();
#endif
set_io (UNIX); /* reset io_handling */
......
......@@ -49,6 +49,7 @@
#include <ctype.h>
#include <time.h>
#include "config.h"
#include "mpsdef.h"
#include "transact.h"
#include "namespace.h"
......@@ -208,9 +209,11 @@ void ssvn_job_update(void)
snprintf (d_buf, 512 - 1, "%s\201", loc_engine);
global (set_sym, k_buf, d_buf);
#if defined(GVH_BDB)
snprintf (k_buf, 512 - 1, "^$JOB\202%d\202BERKELEYDB\202FLUSH_THRESHOLD\201", pid);
snprintf (d_buf, 512 - 1, "%d\201", bdb_flush_threshold);
global (set_sym, k_buf, d_buf);
#endif
snprintf (k_buf, 512 - 1, "^$JOB\202%d\202CHARACTER\201", pid);
global (set_sym, k_buf, "M\201");
......@@ -666,6 +669,7 @@ void ssvn_job(short action, char *key, char *data)
goto done;
}
#if defined(GVH_BDB)
else if (strcmp (mref_get_subscript (r, 1), "BERKELEYDB") == 0) {
if (strcmp (mref_get_subscript (r, 2), "FLUSH_THRESHOLD") == 0) {
bdb_flush_threshold = atol (data);
......@@ -675,6 +679,7 @@ void ssvn_job(short action, char *key, char *data)
goto done;
}
}
#endif
else if (strcmp (mref_get_subscript (r, 1), "USER_ERRORS") == 0) {
global (set_sym, key, data);
......
......@@ -7389,9 +7389,11 @@ restore:
else if (strcmp (fmrl_buf, "shmpages") == 0) {
shm_dump_pages ();
}
#if defined(GVH_BDB)
else if (strcmp (fmrl_buf, "dbstats") == 0) {
frm_bdb_gbl_session_dump ();
}
#endif
else if (strcmp (fmrl_buf, "events") == 0) {
char stat_desc[30];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment