Changeset: 711224f016ee for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=711224f016ee
Modified Files:
monetdb5/mal/mal_module.c
monetdb5/mal/mal_module.h
Branch: geo
Log Message:
Added a function that checks whether a module exists
diffs (35 lines):
diff --git a/monetdb5/mal/mal_module.c b/monetdb5/mal/mal_module.c
--- a/monetdb5/mal/mal_module.c
+++ b/monetdb5/mal/mal_module.c
@@ -274,6 +274,20 @@ int isModuleDefined(Module scope, str na
}
return FALSE;
}
+
+int
+moduleExists(str name) {
+ Module scope = NULL;
+ if (name == NULL) return 0;
+ scope = scopeJump[(int)(*name)][(int)(*(name+1))];
+ while (scope != NULL){
+ if (idcmp(name, scope->name) == 0)
+ return 1;
+ scope= scope->sibling;
+ }
+ return 0;
+}
+
/*
* The routine findSymbolInModule starts at a MAL scope level and searches
* an element amongst the peers. If it fails, it will recursively
diff --git a/monetdb5/mal/mal_module.h b/monetdb5/mal/mal_module.h
--- a/monetdb5/mal/mal_module.h
+++ b/monetdb5/mal/mal_module.h
@@ -43,6 +43,7 @@ mal_export void dumpSearchTable(stream
mal_export char **getHelp(Module m, str pat, int flag);
mal_export char **getHelpMatch(char *pat);
mal_export void showHelp(Module m, str txt,stream *fs);
+mal_export int moduleExists(str name);
#define getSubScope(N) (*(N))
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list