mirror of
https://github.com/fluencelabs/sqlite
synced 2025-04-24 17:02:14 +00:00
update to the latest ABI
This commit is contained in:
parent
d040370779
commit
8960e72d3b
@ -15,14 +15,38 @@ int init() {
|
|||||||
|
|
||||||
int g_isInited = 0;
|
int g_isInited = 0;
|
||||||
|
|
||||||
|
void store(char *ptr, unsigned char byte) {
|
||||||
|
*ptr = byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sqlite_store(char *ptr, unsigned char byte) {
|
||||||
|
store(ptr, byte);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char load(const unsigned char *ptr) {
|
||||||
|
return *ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char sqlite_load(const unsigned char *ptr) {
|
||||||
|
return load(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
void* allocate(size_t size) {
|
void* allocate(size_t size) {
|
||||||
return malloc(size + 1);
|
return malloc(size + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* sqlite_allocate(size_t size) {
|
||||||
|
return allocate(size);
|
||||||
|
}
|
||||||
|
|
||||||
void deallocate(void *ptr, int size) {
|
void deallocate(void *ptr, int size) {
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sqlite_deallocate(void *ptr, int size) {
|
||||||
|
deallocate(ptr, size);
|
||||||
|
}
|
||||||
|
|
||||||
char *write_response(char *response, int response_size) {
|
char *write_response(char *response, int response_size) {
|
||||||
char *result_response = allocate(response_size + 4);
|
char *result_response = allocate(response_size + 4);
|
||||||
|
|
||||||
@ -36,9 +60,9 @@ char *write_response(char *response, int response_size) {
|
|||||||
|
|
||||||
typedef struct ShellText ShellText;
|
typedef struct ShellText ShellText;
|
||||||
struct ShellText {
|
struct ShellText {
|
||||||
char *z;
|
char *z;
|
||||||
int n;
|
int n;
|
||||||
int nAlloc;
|
int nAlloc;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void initText(ShellText *p){
|
static void initText(ShellText *p){
|
||||||
@ -112,7 +136,7 @@ const char *invoke(char *request, int request_size) {
|
|||||||
init();
|
init();
|
||||||
|
|
||||||
#if LOG_ENABLED
|
#if LOG_ENABLED
|
||||||
const char successInitMessage[] = "Sqlite has been initialized";
|
const char successInitMessage[] = "Sqlite has been initialized\n";
|
||||||
log_utf8_string(successInitMessage, sizeof(successInitMessage));
|
log_utf8_string(successInitMessage, sizeof(successInitMessage));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -150,3 +174,6 @@ const char *invoke(char *request, int request_size) {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *sqlite_invoke(char *request, int request_size) {
|
||||||
|
return invoke(request, request_size);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user