![]() |
Fun 0.41.5
The programming language that makes you have fun!
|
SQLite handle registry and helper utilities for the Fun VM extension. More...
#include <sqlite3.h>Go to the source code of this file.
Data Structures | |
| struct | SqlHandle |
| Node in a singly-linked list of registered SQLite handles. More... | |
Typedefs | |
| typedef struct SqlHandle | SqlHandle |
| Node in a singly-linked list of registered SQLite handles. | |
Functions | |
| static SqlHandle * | sql_reg_add (sqlite3 *db) |
| Add a sqlite3 handle to the registry. | |
| static SqlHandle * | sql_reg_get (int id) |
| Look up a registered SQLite handle by id. | |
| static void | sql_reg_del (int id) |
| Remove a SQLite handle entry from the registry. | |
Variables | |
| static SqlHandle * | g_sql_handles = NULL |
| static int | g_sql_next_id = 1 |
SQLite handle registry and helper utilities for the Fun VM extension.
This module provides a very small registry for SQLite database handles when the project is compiled with FUN_WITH_SQLITE. It assigns small integer identifiers to opened sqlite3 connections and allows retrieval or removal of those entries. The registry itself does not open or close SQLite databases — it only stores pointers provided by the caller.
Thread-safety: This registry is not thread-safe. Callers must ensure external synchronization if used from multiple threads.
Definition in file sqlite.c.
| typedef struct SqlHandle SqlHandle |
Node in a singly-linked list of registered SQLite handles.
|
static |
Add a sqlite3 handle to the registry.
The function allocates a new list node, assigns a fresh positive id, and prepends it to the internal registry list.
| db | Valid pointer to an opened sqlite3 connection. |
|
static |
Remove a SQLite handle entry from the registry.
Deletes the list node associated with the given id.
| id | Positive identifier of the entry to remove. |
|
static |
Look up a registered SQLite handle by id.
| id | Positive identifier previously returned by sql_reg_add(). |
|
static |