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

INI handle registry for iniparser 4.2.6 used by INI VM opcodes. More...

#include <iniparser/dictionary.h>
#include <iniparser/iniparser.h>
#include <stddef.h>
Include dependency graph for handles.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  IniSlot
 One slot in the global INI handle registry. More...

Functions

int ini_alloc_handle (dictionary *d)
 Allocate a registry handle for a newly created dictionary.
dictionary * ini_get (int h)
 Look up a dictionary pointer by registry handle.
int ini_free_handle (int h)
 Free a previously allocated handle and close its dictionary.
void ini_make_full_key (char *buf, size_t cap, const char *sec, const char *key)
 Build a fully qualified key "section:key" into a caller-provided buffer.

Variables

IniSlot g_ini [64]

Detailed Description

INI handle registry for iniparser 4.2.6 used by INI VM opcodes.

Definition in file handles.h.

Function Documentation

◆ ini_alloc_handle()

int ini_alloc_handle ( dictionary * d)

Allocate a registry handle for a newly created dictionary.

Parameters
dPointer to an iniparser dictionary.
Returns
Handle id (>0) on success or 0 on failure.

Definition at line 43 of file handles.c.

◆ ini_free_handle()

int ini_free_handle ( int h)

Free a previously allocated handle and close its dictionary.

Parameters
hHandle id to free.
Returns
1 on success, 0 on error (invalid handle or not in use).

Definition at line 60 of file handles.c.

◆ ini_get()

dictionary * ini_get ( int h)

Look up a dictionary pointer by registry handle.

Parameters
hHandle id previously returned by ini_alloc_handle().
Returns
Pointer to dictionary or NULL if not found.

Definition at line 55 of file handles.c.

◆ ini_make_full_key()

void ini_make_full_key ( char * buf,
size_t cap,
const char * sec,
const char * key )

Build a fully qualified key "section:key" into a caller-provided buffer.

Parameters
bufDestination buffer.
capCapacity of buf in bytes (including terminator).
secSection name (may be NULL for default section).
keyKey name (must not be NULL).

Definition at line 68 of file handles.c.

Variable Documentation

◆ g_ini

IniSlot g_ini[64]
extern

Single global registry (defined in handles.c).

Definition at line 41 of file handles.c.