This commit is contained in:
xeodou 2015-04-02 11:03:51 +08:00
parent afd39ebd2e
commit b81936c4b2
1 changed files with 4 additions and 4 deletions

8
doc.go
View File

@ -5,7 +5,7 @@ This works as driver for database/sql.
Installation Installation
go get github.com/mattn/go-sqlite3 go get github.com/xeodou/go-sqlcipher
Supported Types Supported Types
@ -33,7 +33,7 @@ extension for Regexp matcher operation.
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <sqlite3ext.h> #include <sqlite3ext.h>
SQLITE_EXTENSION_INIT1 SQLITE_EXTENSION_INIT1
static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) { static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
if (argc >= 2) { if (argc >= 2) {
@ -44,7 +44,7 @@ extension for Regexp matcher operation.
int vec[500]; int vec[500];
int n, rc; int n, rc;
pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL); pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500); rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500);
if (rc <= 0) { if (rc <= 0) {
sqlite3_result_error(context, errstr, 0); sqlite3_result_error(context, errstr, 0);
return; return;
@ -52,7 +52,7 @@ extension for Regexp matcher operation.
sqlite3_result_int(context, 1); sqlite3_result_int(context, 1);
} }
} }
#ifdef _WIN32 #ifdef _WIN32
__declspec(dllexport) __declspec(dllexport)
#endif #endif