Changeset: 0ae1d2ae7be9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ae1d2ae7be9
Removed Files:
        monetdb5/extras/mal_optimizer_template/opt_sql_append.h
Modified Files:
        monetdb5/extras/mal_optimizer_template/CMakeLists.txt
        monetdb5/extras/mal_optimizer_template/opt_sql_append.c
        monetdb5/extras/rapi/rapi.c
        monetdb5/extras/rapi/rapi.h
Branch: default
Log Message:

Reduce exports.


diffs (180 lines):

diff --git a/monetdb5/extras/mal_optimizer_template/CMakeLists.txt 
b/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
--- a/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
+++ b/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
@@ -10,8 +10,7 @@ add_library(opt_sql_append MODULE)
 
 target_sources(opt_sql_append
   PRIVATE
-  opt_sql_append.c
-  opt_sql_append.h)
+  opt_sql_append.c)
 
 target_include_directories(opt_sql_append
   PRIVATE
diff --git a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c 
b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
--- a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
+++ b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
@@ -69,7 +69,7 @@
  * This allows the optimizer implementation to find them and react on them.
  */
 #include "monetdb_config.h"
-#include "opt_sql_append.h"
+#include "opt_prelude.h"
 #include "mal_interpreter.h"
 
 /* focus initially on persistent tables. */
@@ -246,7 +246,8 @@ OPTsql_appendImplementation(Client cntxt
  * actions taken, i.e. number of successful changes to the code.
  */
 
-str OPTsql_append(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p){
+static str
+OPTsql_append(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p){
        str modnme;
        str fcnnme;
        str msg= MAL_SUCCEED;
diff --git a/monetdb5/extras/mal_optimizer_template/opt_sql_append.h 
b/monetdb5/extras/mal_optimizer_template/opt_sql_append.h
deleted file mode 100644
--- a/monetdb5/extras/mal_optimizer_template/opt_sql_append.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V.
- */
-
-#ifndef _OPT_SQL_APPEND_
-#define _OPT_SQL_APPEND_
-
-#ifdef WIN32
-#ifndef LIBOPT_SQL_APPEND
-#define opt_sql_append_export extern __declspec(dllimport)
-#else
-#define opt_sql_append_export extern __declspec(dllexport)
-#endif
-#else
-#define opt_sql_append_export extern
-#endif
-
-#include "opt_prelude.h"
-
-opt_sql_append_export str OPTsql_append(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr p);
-
-#endif /* _OPT_SQL_APPEND_ */
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -59,14 +59,17 @@ static bool RAPIEnabled(void) {
 // The R-environment should be single threaded, calling for some protective 
measures.
 static MT_Lock rapiLock = MT_LOCK_INITIALIZER("rapiLock");
 static bool rapiInitialized = false;
+#if 0
 static char* rtypenames[] = { "NIL", "SYM", "LIST", "CLO", "ENV", "PROM",
                "LANG", "SPECIAL", "BUILTIN", "CHAR", "LGL", "unknown", 
"unknown",
                "INT", "REAL", "CPLX", "STR", "DOT", "ANY", "VEC", "EXPR", 
"BCODE",
                "EXTPTR", "WEAKREF", "RAW", "S4" };
+#endif
 
 static Client rapiClient = NULL;
 
 
+#if 0
 // helper function to translate R TYPEOF() return values to something readable
 char* rtypename(int rtypeid) {
        if (rtypeid < 0 || rtypeid > 25) {
@@ -74,8 +77,9 @@ char* rtypename(int rtypeid) {
        } else
                return rtypenames[rtypeid];
 }
+#endif
 
-void writeConsoleEx(const char * buf, int buflen, int foo) {
+static void writeConsoleEx(const char * buf, int buflen, int foo) {
        (void) buflen;
        (void) foo;
        (void) buf; // silence compiler
@@ -84,11 +88,11 @@ void writeConsoleEx(const char * buf, in
 #endif
 }
 
-void writeConsole(const char * buf, int buflen) {
+static void writeConsole(const char * buf, int buflen) {
        writeConsoleEx(buf, buflen, -42);
 }
 
-void clearRErrConsole(void) {
+static void clearRErrConsole(void) {
        // Do nothing?
 }
 
@@ -230,16 +234,7 @@ static char *RAPIinstalladdons(void) {
        return NULL;
 }
 
-rapi_export str RAPIevalStd(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
-                                                       InstrPtr pci) {
-       return RAPIeval(cntxt, mb, stk, pci, 0);
-}
-rapi_export str RAPIevalAggr(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
-                                                        InstrPtr pci) {
-       return RAPIeval(cntxt, mb, stk, pci, 1);
-}
-
-str RAPIeval(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, bit 
grouped) {
+static str RAPIeval(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, 
bit grouped) {
        sql_func * sqlfun = NULL;
        str exprStr = *getArgReference_str(stk, pci, pci->retc + 1);
 
@@ -489,6 +484,15 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
        return msg;
 }
 
+static str RAPIevalStd(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
+                                                       InstrPtr pci) {
+       return RAPIeval(cntxt, mb, stk, pci, 0);
+}
+static str RAPIevalAggr(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
+                                                        InstrPtr pci) {
+       return RAPIeval(cntxt, mb, stk, pci, 1);
+}
+
 void* RAPIloopback(void *query) {
        res_table* output = NULL;
        char* querystr = (char*)CHAR(STRING_ELT(query, 0));
@@ -527,7 +531,7 @@ void* RAPIloopback(void *query) {
 }
 
 
-str RAPIprelude(void *ret) {
+static str RAPIprelude(void *ret) {
        (void) ret;
 
        if (RAPIEnabled()) {
diff --git a/monetdb5/extras/rapi/rapi.h b/monetdb5/extras/rapi/rapi.h
--- a/monetdb5/extras/rapi/rapi.h
+++ b/monetdb5/extras/rapi/rapi.h
@@ -29,19 +29,10 @@
 
 #define RAPI_MAX_TUPLES 2147483647L
 
-rapi_export str RAPIeval(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
-               InstrPtr pci, bit grouped);
-rapi_export str RAPIevalStd(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
-               InstrPtr pci);
-rapi_export str RAPIevalAggr(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
-               InstrPtr pci);
 rapi_export void* RAPIloopback(void *query);
-rapi_export str RAPIprelude(void *ret);
 
-rapi_export void writeConsoleEx(const char * buf, int buflen, int foo);
-rapi_export void writeConsole(const char * buf, int buflen);
-rapi_export void clearRErrConsole(void);
-
+#if 0
 char* rtypename(int rtypeid);
+#endif
 
 #endif /* _RAPI_LIB_ */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to