#include <stdarg.h>
#include <string.h>
+#ifndef __USE_POSIX199309
#define __USE_POSIX199309
+#endif
+
#include <time.h>
#include "../core/config.h"
size_t sqliteescapestring(char *buf, char *src, unsigned int len) {
unsigned int i;
- char *p;
+ char *p, *d;
- for(p=src,i=0;i<len;i++,p++) {
+ for(p=src,d=buf,i=0;i<len;i++,p++) {
if(*p == '\'')
- *buf++ = *p;
- *buf++ = *p;
+ *d++ = *p;
+ *d++ = *p;
}
- *buf = '\0';
+ *d = '\0';
- return p - src;
+ return d - buf;
}
SQLiteResult *sqlitegetresult(SQLiteConn *r) {
/* the handlers do all the checking and cleanup */
if(t->init)
- (t->init)(c, t->tag);
+ (t->init)(NULL, t->tag);
(t->data)(c, t->tag);
if(t->fini)
- (t->fini)(c, t->tag);
+ (t->fini)(NULL, t->tag);
nsfree(POOL_SQLITE, t);
}
}
}
+sqlite3 *sqlitegetconn(void) {
+ return conn;
+}