Fun
0.41.5
The programming language that makes You have fun
Main Page
Data Structures
Files
File List
Globals
Loading...
Searching...
No Matches
src
vm
sqlite
close.c
Go to the documentation of this file.
1
/*
2
* This file is part of the Fun programming language.
3
* https://fun-lang.xyz/
4
*
5
* Copyright 2025 Johannes Findeisen <you@hanez.org>
6
* Licensed under the terms of the Apache-2.0 license.
7
* https://opensource.org/license/apache-2-0
8
*/
9
17
21
case
OP_SQLITE_CLOSE
: {
22
#ifdef FUN_WITH_SQLITE
23
Value
vh
= pop_value(vm);
24
int
hid = (int)
vh
.i;
25
free_value
(
vh
);
26
SqlHandle *h = sql_reg_get(hid);
27
if
(h && h->db) {
28
sqlite3_close(h->db);
29
h->db = NULL;
30
sql_reg_del(hid);
31
}
32
push_value
(vm,
make_nil
());
33
#else
34
Value
v
= pop_value(vm);
35
free_value
(
v
);
36
push_value
(vm,
make_nil
());
37
#endif
38
break
;
39
}
OP_SQLITE_CLOSE
@ OP_SQLITE_CLOSE
Definition
bytecode.h:179
v
Value v
Definition
cast.c:22
push_value
push_value(vm, make_nil())
free_value
free_value(v)
Value
Tagged union representing a Fun value.
Definition
value.h:68
vh
Value vh
Definition
stubs.c:44
make_nil
Value make_nil(void)
Construct a nil Value.
Definition
value.c:126
Generated on
for Fun by
1.16.1