![]() |
Fun 0.41.5
The programming language that makes you have fun!
|
Lightweight libxml2 handle registry for Fun VM extension helpers. More...
#include <libxml/parser.h>#include <libxml/tree.h>Go to the source code of this file.
Data Structures | |
| struct | XmlDocSlot |
| Slot describing a registered XML document. More... | |
| struct | XmlNodeSlot |
| Slot describing a registered XML node. More... | |
Functions | |
| static int | xml_doc_alloc (xmlDocPtr d) |
| Allocate a document handle for the given xmlDoc pointer. | |
| static xmlDocPtr | xml_doc_get (int h) |
| Retrieve a registered xmlDoc by handle. | |
| static int | xml_doc_free_handle (int h) |
| Free a document handle and the underlying xmlDoc. | |
| static int | xml_node_alloc (xmlNodePtr n) |
| Allocate a node handle for the given xmlNode pointer. | |
| static xmlNodePtr | xml_node_get (int h) |
| Retrieve a registered xmlNode by handle. | |
| static int | xml_node_free_handle (int h) |
| Free a node handle without freeing the underlying node. | |
Variables | |
| static XmlDocSlot | g_xml_docs [64] |
| static XmlNodeSlot | g_xml_nodes [256] |
Lightweight libxml2 handle registry for Fun VM extension helpers.
This module provides small fixed-size registries for libxml2 objects when compiled with FUN_WITH_XML2. Documents and nodes can be associated with small integer handles to make them easier to pass around inside the interpreter and its C API boundaries. The document registry owns the underlying xmlDoc, while the node registry does not own the xmlNode — nodes are freed when their owning document is freed.
Limits: The registries are fixed-size (docs: 64, nodes: 256). Handle value 0 is reserved and indicates failure/invalid.
Thread-safety: Not thread-safe. Coordinate access externally if needed.
Definition in file xml2.c.
|
static |
Allocate a document handle for the given xmlDoc pointer.
| d | Valid xmlDocPtr to register. Ownership is transferred to the registry, which will xmlFreeDoc() it when the handle is freed. |
|
static |
|
static |
Retrieve a registered xmlDoc by handle.
| h | Handle previously returned by xml_doc_alloc(). |
|
static |
|
static |
|
static |
Retrieve a registered xmlNode by handle.
| h | Handle previously returned by xml_node_alloc(). |
|
static |
|
static |