OSDN Git Service

built-in extension-functions
authorleo <leo@ae02f08e-27ec-0310-ae8c-8ba02fe2eafd>
Wed, 16 Sep 2009 08:18:42 +0000 (08:18 +0000)
committerleo <leo@ae02f08e-27ec-0310-ae8c-8ba02fe2eafd>
Wed, 16 Sep 2009 08:18:42 +0000 (08:18 +0000)
git-svn-id: http://www.xerial.org/svn/project/XerialJ/trunk/sqlite-jdbc@3593 ae02f08e-27ec-0310-ae8c-8ba02fe2eafd

Makefile.package
archive/nestedvm-2009-08-09.tgz [new file with mode: 0644]
sqlitejdbc/Makefile.nested
sqlitejdbc/ext/extension-functions.c
src/main/resources/native/Linux/amd64/libsqlitejdbc.so
src/main/resources/native/Linux/i386/libsqlitejdbc.so
src/main/resources/native/Mac/i386/libsqlitejdbc.jnilib
src/main/resources/native/Windows/x86/sqlitejdbc.dll
src/main/resources/org/sqlite/SQLite.class

index c716ff1..b9ec0b5 100644 (file)
@@ -69,7 +69,7 @@ test:
        ssh $(MAC_SERVER) "source .zprofile && cd $(MAC_WORK) && $(TEST_CMD)"\r
        ssh $(LINUX_SERVER) "source .zprofile && source /etc/profile.d/java.sh && cd $(LINUX_WORK) && $(TEST_CMD)"\r
        ssh $(AMD_SERVER) "source .zprofile && cd $(AMD_WORK) && $(TEST_CMD)"\r
-       ssh $(WIN_SERVER) "source .zprofile && cd $(WIN_WORK) && $(TEST_CMD) -DargLine='-Dsqlite.purejava=true'"\r
+       ssh $(MAC_SERVER) "source .zprofile && cd $(MAC_WORK) && $(TEST_CMD) -DargLine='-Dsqlite.purejava=true'"\r
 \r
        \r
 release:\r
diff --git a/archive/nestedvm-2009-08-09.tgz b/archive/nestedvm-2009-08-09.tgz
new file mode 100644 (file)
index 0000000..e56d04e
Binary files /dev/null and b/archive/nestedvm-2009-08-09.tgz differ
index 22a2626..b7b6d17 100644 (file)
@@ -1,6 +1,6 @@
 include Makefile.common
 
-nestedvm_version := 2007-06-30
+nestedvm_version := 2009-08-09
 nestedvm := nestedvm-$(nestedvm_version)
 
 default: test
@@ -31,7 +31,7 @@ $(nestedvm)/%:
 dl/$(nestedvm).tgz:
        @mkdir -p dl
        cp ../archive/$(nestedvm).tgz $@
-#      curl -odl/$(nestedvm).tgz http://files.zentus.com/sqlitejdbc/$(nestedvm).tgz
+#      curl -odl/$(nestedvm).tgz http://nestedvm.ibex.org/dist/$(nestedvm).tgz
 
 dl/$(sqlite)-amal.zip:
        @mkdir -p dl
@@ -49,7 +49,6 @@ build/SQLite.mips: $(nestedvm)/Makefile $(nestedvm)/env.sh dl/$(sqlite)-amal.zip
        cp ../src/main/java/org/sqlite/Nested*.c build/$(sqlite)-nestedvm
        perl -pi -e "s/sqlite3_api;/sqlite3_api = 0;/g" \
            build/$(sqlite)-nestedvm/sqlite3ext.h
-
        # we need a dummy main
        echo 'int main() { return 0; }' >> build/$(sqlite)-nestedvm/sqlite3.c
        # remove utimes
@@ -69,11 +68,10 @@ build/SQLite.mips: $(nestedvm)/Makefile $(nestedvm)/env.sh dl/$(sqlite)-amal.zip
                -DSQLITE_OMIT_LOAD_EXTENSION \
                sqlite3.c; \
        $$CC -c $$CFLAGS -o NestedDB.o Nested*.c)
-
        ./$(nestedvm)/upstream/install/bin/mips-unknown-elf-gcc \
-               -march=mips1 --static -lc \
+               -march=mips1 --static \
                -o $@ build/$(sqlite)-nestedvm/sqlite3.o \
-                             build/$(sqlite)-nestedvm/NestedDB.o
+                             build/$(sqlite)-nestedvm/NestedDB.o -lm -lc
 
 build/org/sqlite/SQLite.class: build/SQLite.mips
        java -cp $(nestedvm)/build$(sep)$(nestedvm)/upstream/build/classgen/build \
index e3ff358..0893500 100644 (file)
@@ -98,7 +98,7 @@ Original code 2006 June 05 by relicoder.
 
 //#include "config.h"
 
-#define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE 1
+//#define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE 1
 #define HAVE_ACOSH 1
 #define HAVE_ASINH 1
 #define HAVE_ATANH 1
@@ -130,7 +130,7 @@ SQLITE_EXTENSION_INIT1
 #ifndef _MAP_H_
 #define _MAP_H_
 
-#include <stdint.h>
+//#include <stdint.h>
 
 /*
 ** Simple binary tree implementation to use in median, mode and quartile calculations
@@ -138,13 +138,13 @@ SQLITE_EXTENSION_INIT1
 */
 
 typedef int(*cmp_func)(const void *, const void *);
-typedef void(*map_iterator)(void*, int64_t, void*);
+typedef void(*map_iterator)(void*, sqlite_int64, void*);
 
 typedef struct node{
   struct node *l;
   struct node *r;
   void* data;
-  int64_t count;
+  sqlite_int64 count;
 } node;
 
 typedef struct map{
@@ -1882,8 +1882,8 @@ void map_destroy(map *m){
 }
 
 int int_cmp(const void *a, const void *b){
-  int64_t aa = *(int64_t *)(a);
-  int64_t bb = *(int64_t *)(b);
+  sqlite_int64 aa = *(sqlite_int64 *)(a);
+  sqlite_int64 bb = *(sqlite_int64 *)(b);
   /* printf("cmp %d <=> %d\n",aa,bb); */
   if(aa==bb)
     return 0;
@@ -1905,7 +1905,7 @@ int double_cmp(const void *a, const void *b){
     return 1;
 }
 
-void print_elem(void *e, int64_t c, void* p){
+void print_elem(void *e, sqlite_int64 c, void* p){
   int ee = *(int*)(e);
   printf("%d => %lld\n", ee,c);
 }
index 3a8863e..840eca0 100755 (executable)
Binary files a/src/main/resources/native/Linux/amd64/libsqlitejdbc.so and b/src/main/resources/native/Linux/amd64/libsqlitejdbc.so differ
index d7d5028..77c8b49 100755 (executable)
Binary files a/src/main/resources/native/Linux/i386/libsqlitejdbc.so and b/src/main/resources/native/Linux/i386/libsqlitejdbc.so differ
index f21eff1..ab33ece 100755 (executable)
Binary files a/src/main/resources/native/Mac/i386/libsqlitejdbc.jnilib and b/src/main/resources/native/Mac/i386/libsqlitejdbc.jnilib differ
index e55cdd3..dd6e0fb 100644 (file)
Binary files a/src/main/resources/native/Windows/x86/sqlitejdbc.dll and b/src/main/resources/native/Windows/x86/sqlitejdbc.dll differ
index 644240b..37b4819 100644 (file)
Binary files a/src/main/resources/org/sqlite/SQLite.class and b/src/main/resources/org/sqlite/SQLite.class differ