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

VM opcode snippet for releasing an INI handle (OP_INI_FREE). More...

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

Go to the source code of this file.

Functions

 free_value (vh)
 push_value (vm, make_int(ok))

Variables

case OP_INI_FREE
int h = (vh.type == VAL_INT) ? (int)vh.i : 0
int ok = ini_free_handle(h)
 break

Detailed Description

VM opcode snippet for releasing an INI handle (OP_INI_FREE).

This file is included into the main VM dispatch switch in vm.c. It is only compiled when FUN_WITH_INI is enabled and iniparser headers are available.

Opcode: OP_INI_FREE Stack: [handle:int] -> [ok:int]

Behavior

  • Pops an integer handle referring to an INI dictionary previously returned by OP_INI_LOAD.
  • Attempts to close the underlying dictionary and free the registry slot.
  • Pushes 1 on success, 0 if the handle was invalid or already freed.

Errors

  • No VM error is thrown for invalid handles; the opcode simply returns 0.

See also

Definition in file free.c.

Function Documentation

◆ free_value()

free_value ( vh )

◆ push_value()

push_value ( vm ,
make_int(ok)  )

Variable Documentation

◆ break

break

Definition at line 41 of file free.c.

◆ h

int h = (vh.type == VAL_INT) ? (int)vh.i : 0

Definition at line 37 of file free.c.

◆ ok

int ok = ini_free_handle(h)

Definition at line 39 of file free.c.

◆ OP_INI_FREE

case OP_INI_FREE

Definition at line 35 of file free.c.