sqlite/src/wrapper.c

45 lines
743 B
C
Raw Normal View History

2019-07-19 15:12:49 +03:00
#include <stdlib.h>
#include "sqliteInt.h"
const char *RESULT_PTR;
2020-09-14 21:00:27 +03:00
int RESULT_SIZE;
2019-07-19 15:12:49 +03:00
void* OBJECTS_TO_RELEASE[];
unsigned int OBJECTS_TO_RELEASE_COUNT;
2020-04-17 20:44:55 +03:00
void* allocate(size_t size) {
2019-07-19 15:12:49 +03:00
return malloc(size + 1);
}
void release_objects() {
for(unsigned int i = 0; i < OBJECTS_TO_RELEASE_COUNT; ++i) {
free(OBJECTS_TO_RELEASE[i]);
}
OBJECTS_TO_RELEASE_COUNT = 0;
}
void add_object_to_release(void *) {
2019-07-19 15:12:49 +03:00
}
void set_result_ptr(const char *ptr) {
2020-09-14 21:00:27 +03:00
RESULT_PTR = ptr;
}
2019-07-19 15:12:49 +03:00
2020-09-14 21:00:27 +03:00
void set_result_size(int size) {
RESULT_SIZE = size;
}
int get_result_size(void) {
return RESULT_SIZE;
}
2019-07-19 15:12:49 +03:00
const char *get_result_ptr() {
2020-09-14 21:00:27 +03:00
return RESULT_PTR;
2019-07-19 15:12:49 +03:00
}
2021-03-04 14:04:48 +03:00
int main() {
// the main purpose of this empty main is to initialize WASi subsystem
return 0;
}