Changeset: 9bf4d7ada7ae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9bf4d7ada7ae
Modified Files:
monetdb5/mal/mal_import.c
monetdb5/mal/mal_import.h
Branch: mbedded
Log Message:
add mal_module to register a mal module
diffs (38 lines):
diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -33,6 +33,21 @@
#include "mal_authorize.h"
#include "mal_private.h"
+#define MAX_MAL_MODULES 128
+static int mel_modules = 0;
+static str mel_module_name[MAX_MAL_MODULES] = {0};
+static mel_atom *mel_module_atoms[MAX_MAL_MODULES] = {0};
+static mel_func *mel_module_funcs[MAX_MAL_MODULES] = {0};
+
+void
+mal_module(str name, mel_atom *atoms, mel_func *funcs)
+{
+ assert (mel_modules < MAX_MAL_MODULES);
+ mel_module_name[mel_modules] = name;
+ mel_module_atoms[mel_modules] = atoms;
+ mel_module_funcs[mel_modules] = funcs;
+ mel_modules++;
+}
#define MAX_MAL_MODULES 128
static int mal_modules = 0;
diff --git a/monetdb5/mal/mal_import.h b/monetdb5/mal/mal_import.h
--- a/monetdb5/mal/mal_import.h
+++ b/monetdb5/mal/mal_import.h
@@ -14,6 +14,9 @@
#include "mal_session.h"
#include "mal_utils.h"
+#include "mel.h"
+mal_export void mal_module(str name, mel_atom *atoms, mel_func *funcs);
+
mal_export void mal_register(str name, unsigned char *code);
mal_export str malIncludeModules(Client c, char *modules[], int listing, int
embedded);
mal_export str malIncludeString(Client c, const str name, const str mal, int
listing);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list