1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-31 15:43:01 +00:00

Add sqlite3 native module to repo.

This commit is contained in:
Calvin Rose
2018-05-05 23:51:29 -04:00
parent 06b80e56eb
commit 181a38f412
8 changed files with 221306 additions and 5 deletions

View File

@@ -237,7 +237,7 @@ static void dst_deinit_block(DstGCMemoryHeader *block) {
case DST_MEMORY_ABSTRACT:
if (h->type->gc) {
if (h->type->gc((void *)(h + 1), h->size)) {
/* finalizer failed. try again later? */
/* finalizer failed. try again later? Panic? For now do nothing. */
;
}
}

View File

@@ -257,9 +257,9 @@ int dst_arity_err(DstArgs args, int32_t n, const char *prefix) {
prefix, n, n == 1 ? "" : "s", args.n)));
}
int dst_typeabstract_err(DstArgs args, int32_t n, DstAbstractType *at) {
int dst_typeabstract_err(DstArgs args, int32_t n, const DstAbstractType *at) {
return dst_throwv(args,
dst_wrap_string(dst_formatc(
"bad argument #%d, expected %t, got %s",
"bad argument #%d, expected %s, got %s",
n, at->name, typestr(args, n))));
}

View File

@@ -201,7 +201,7 @@ DstTable *dst_stl_env(void);
int dst_arity_err(DstArgs args, int32_t n, const char *prefix);
int dst_type_err(DstArgs args, int32_t n, DstType expected);
int dst_typemany_err(DstArgs args, int32_t n, int expected);
int dst_typeabstract_err(DstArgs args, int32_t n, DstAbstractType *at);
int dst_typeabstract_err(DstArgs args, int32_t n, const DstAbstractType *at);
#define dst_throw(a, e) (*((a).ret) = dst_cstringv(e), 1)
#define dst_throwv(a, v) (*((a).ret) = (v), 1)
#define dst_return(a, v) (*((a).ret) = (v), 0)
@@ -230,7 +230,7 @@ int dst_typeabstract_err(DstArgs args, int32_t n, DstAbstractType *at);
} while (0)
#define dst_checkabstract(A, N, AT) do {\
if ((A).n <= (N) || !dst_checktype() {\
if ((A).n > (N)) {\
Dst x = (A).v[(N)];\
if (!dst_checktype(x, DST_ABSTRACT) ||\
dst_abstract_type(dst_unwrap_abstract(x)) != (AT))\