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

VM opcode snippet for removing an INI entry (OP_INI_UNSET). More...

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

Go to the source code of this file.

Functions

 if (d &&sec &&key)
 free_value (vkey)
 free_value (vsec)
 free_value (vh)
 push_value (vm, make_int(ok))

Variables

case OP_INI_UNSET
Value vsec = pop_value(vm)
Value vh = pop_value(vm)
dictionary * d = ini_get((vh.type == VAL_INT) ? (int)vh.i : 0)
const char * key = (vkey.type == VAL_STRING) ? vkey.s : NULL
const char * sec = (vsec.type == VAL_STRING) ? vsec.s : NULL
int ok = 0
 break

Detailed Description

VM opcode snippet for removing an INI entry (OP_INI_UNSET).

Opcode: OP_INI_UNSET Stack: [key:string] [section:string] [handle:int] -> [ok:int]

Behavior

  • Pops key, section, and handle. Removes both "section:key" and a dotted fallback key from the dictionary. Pushes 1 if the operation was attempted (with a valid handle and arguments), otherwise 0.

Notes

  • iniparser 4.2.6 dictionary_unset() returns void; we assume success when called with valid parameters.

Definition in file unset.c.

Function Documentation

◆ free_value() [1/3]

free_value ( vh )

◆ free_value() [2/3]

free_value ( vkey )

◆ free_value() [3/3]

free_value ( vsec )

◆ if()

if ( d &&sec && key)

Definition at line 37 of file unset.c.

◆ push_value()

push_value ( vm ,
make_int(ok)  )

Variable Documentation

◆ break

break

Definition at line 57 of file unset.c.

◆ d

dictionary* d = ini_get((vh.type == VAL_INT) ? (int)vh.i : 0)

Definition at line 33 of file unset.c.

◆ key

const char* key = (vkey.type == VAL_STRING) ? vkey.s : NULL

Definition at line 34 of file unset.c.

◆ ok

int ok = 0

Definition at line 36 of file unset.c.

◆ OP_INI_UNSET

case OP_INI_UNSET

Definition at line 29 of file unset.c.

◆ sec

const char* sec = (vsec.type == VAL_STRING) ? vsec.s : NULL

Definition at line 35 of file unset.c.

◆ vh

Value vh = pop_value(vm)

Definition at line 32 of file unset.c.

◆ vsec

Value vsec = pop_value(vm)

Definition at line 31 of file unset.c.