Changeset: a07d8f560d30 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a07d8f560d30
Added Files:
        tools/monetdbe/monetdbe_mapi.h
Removed Files:
        tools/monetdbe/mapi.h
Modified Files:
        tools/monetdbe/CMakeLists.txt
        tools/monetdbe/monetdbe.c
        tools/monetdbe/monetdbe_mapi.c
Branch: default
Log Message:

use local mapi structure definitions, but mapi.h for mapilib
add define for windows build (when we need mapi at this layer
the fun will realy begin)


diffs (107 lines):

diff --git a/tools/monetdbe/CMakeLists.txt b/tools/monetdbe/CMakeLists.txt
--- a/tools/monetdbe/CMakeLists.txt
+++ b/tools/monetdbe/CMakeLists.txt
@@ -15,7 +15,7 @@ add_library(monetdbe SHARED)
 target_sources(monetdbe
   PRIVATE
   monetdbe.c
-  monetdbe_mapi.c mapi.h
+  monetdbe_mapi.c
   ${CMAKE_SOURCE_DIR}/clients/mapiclient/dump.c
   PUBLIC
   ${monetdbe_public_headers})
@@ -30,6 +30,7 @@ target_include_directories(monetdbe
 
 target_compile_definitions(monetdbe
   PRIVATE
+  LIBMAPI
   LIBMONETDBE)
 
 set_target_properties(monetdbe
@@ -46,7 +47,6 @@ target_link_libraries(monetdbe
   mutils
   mcrypt
   gdk
-  mapi
   monetdb5
   sql
   $<$<NOT:$<PLATFORM_ID:Windows>>:m>
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -26,6 +26,7 @@
 #include "rel_updates.h"
 #include "monet_options.h"
 #include "mapi.h"
+#include "monetdbe_mapi.h"
 
 #define UNUSED(x) (void)(x)
 
diff --git a/tools/monetdbe/monetdbe_mapi.c b/tools/monetdbe/monetdbe_mapi.c
--- a/tools/monetdbe/monetdbe_mapi.c
+++ b/tools/monetdbe/monetdbe_mapi.c
@@ -2,14 +2,17 @@
 #include "monetdb_config.h"
 #include "stream.h"
 #include "mapi.h"
+#include "monetdbe_mapi.h"
 
 #define MAPIalloc(sz) malloc(sz)
 #define MAPIfree(p)   free(p)
 
-char *
+MapiMsg
 mapi_error(Mapi mid)
 {
-       return mid->msg;
+       if (mid->msg)
+               return MERROR;
+       return MOK;
 }
 
 MapiHdl 
diff --git a/tools/monetdbe/mapi.h b/tools/monetdbe/monetdbe_mapi.h
rename from tools/monetdbe/mapi.h
rename to tools/monetdbe/monetdbe_mapi.h
--- a/tools/monetdbe/mapi.h
+++ b/tools/monetdbe/monetdbe_mapi.h
@@ -1,6 +1,5 @@
-
-#ifndef MAPI_H_
-#define MAPI_H_
+#ifndef MONETDBE_MAPI_H_
+#define MONETDBE_MAPI_H_
 
 #include "monetdb_config.h"
 #include "stream.h"
@@ -25,29 +24,4 @@ typedef struct MapiStatement {
        char *msg;
 } *MapiHdl;
 
-typedef int MapiMsg;
-
-#define MAPI_SEEK_SET  0
-#define MAPI_SEEK_CUR  1
-#define MAPI_SEEK_END  2
-
-#define MOK            0
-
-extern char *mapi_error(Mapi mid);
-extern MapiHdl mapi_query(Mapi mid, const char *query);
-extern MapiMsg mapi_close_handle(MapiHdl hdl);
-extern int mapi_fetch_row(MapiHdl hdl);
-extern char *mapi_fetch_field(MapiHdl hdl, int fnr);
-extern char *mapi_get_type(MapiHdl hdl, int fnr);
-extern MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence);
-extern int64_t mapi_get_row_count(MapiHdl hdl);
-extern int64_t mapi_rows_affected(MapiHdl hdl);
-extern int mapi_get_field_count(MapiHdl hdl);
-extern const char *mapi_result_error(MapiHdl hdl);
-extern int mapi_get_len(MapiHdl hdl, int fnr);
-
-extern void mapi_explain(Mapi mid, FILE *fd);
-extern void mapi_explain_query(MapiHdl hdl, FILE *fd);
-extern void mapi_explain_result(MapiHdl hdl, FILE *fd);
-
-#endif // MAPI_H_
+#endif // MONETDBE_MAPI_H_
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to