Fun 0.41.5
The programming language that makes you have fun!
Loading...
Searching...
No Matches
open.c File Reference

Implements the OP_SQLITE_OPEN opcode (conditional build). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 free_value (vpath)
 if (!path)
 free (path)
 if (rc !=SQLITE_OK||!db)
 push_value (vm, make_int(h->id))

Variables

case OP_SQLITE_OPEN
char * path = value_to_string_alloc(&vpath)
sqlite3 * db = NULL
int rc = sqlite3_open(path, &db)
SqlHandleh = sql_reg_add(db)
 break

Detailed Description

Implements the OP_SQLITE_OPEN opcode (conditional build).

Opens a SQLite database and registers a handle when FUN_WITH_SQLITE is enabled. On failure or when SQLite support is disabled, pushes 0.

OP_SQLITE_OPEN: (path:string) -> handle:int (>0) or 0 on error

Definition in file open.c.

Function Documentation

◆ free()

free ( path )

◆ free_value()

free_value ( vpath )

◆ if() [1/2]

if ( ! path)

Definition at line 25 of file open.c.

◆ if() [2/2]

if ( rc ! = SQLITE_OK || !db)

Definition at line 32 of file open.c.

◆ push_value()

push_value ( vm ,
make_int(h->id)  )

Variable Documentation

◆ break

break

Definition at line 49 of file open.c.

◆ db

sqlite3* db = NULL

Definition at line 29 of file open.c.

◆ h

Definition at line 37 of file open.c.

◆ OP_SQLITE_OPEN

case OP_SQLITE_OPEN

Definition at line 20 of file open.c.

◆ path

char* path = value_to_string_alloc(&vpath)

Definition at line 23 of file open.c.

◆ rc

int rc = sqlite3_open(path, &db)

Definition at line 30 of file open.c.