26# pragma clang diagnostic push
27# pragma ide diagnostic ignored "OCUnusedMacroInspection"
28# pragma ide diagnostic ignored "UnreachableCallsOfFunction"
33double nan(
const char *tag);
44 __attribute__((unused))
47 __attribute__((always_inline)) static inline
52typedef const void *BUFF_t;
55typedef const char *STR_t;
87 __NULLABLE__ buff_t buff
97 __ZEROABLE__
size_t size
107 __NULLABLE__ buff_t buff,
108 __ZEROABLE__
size_t size
127 NYX_LOG_LEVEL_NONE = 0,
128 NYX_LOG_LEVEL_FATAL = 1,
129 NYX_LOG_LEVEL_ERROR = 2,
130 NYX_LOG_LEVEL_INFO = 3,
131 NYX_LOG_LEVEL_DEBUG = 4,
132 NYX_LOG_LEVEL_VERBOSE = 5,
172#define NYX_LOG_FATAL(fmt, ...) \
173 do { nyx_log(NYX_LOG_LEVEL_FATAL, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(1)
182#define NYX_LOG_ERROR(fmt, ...) \
183 do { nyx_log(NYX_LOG_LEVEL_ERROR, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
192#define NYX_LOG_INFO(fmt, ...) \
193 do { nyx_log(NYX_LOG_LEVEL_INFO, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
202#define NYX_LOG_DEBUG(fmt, ...) \
203 do { nyx_log(NYX_LOG_LEVEL_DEBUG, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
212#define NYX_LOG_VERBOSE(fmt, ...) \
213 do { nyx_log(NYX_LOG_LEVEL_VERBOSE, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
235 uint8_t result_mac[6],
253 __NULLABLE__
size_t *result_len,
254 __ZEROABLE__
size_t size,
255 __NULLABLE__ BUFF_t buff
270 __NULLABLE__
size_t *result_size,
271 __ZEROABLE__
size_t len,
272 __NULLABLE__ STR_t str
287 __ZEROABLE__
size_t size,
288 __NULLABLE__ BUFF_t buff,
302#define NYX_OBJECT_MAGIC 0x65656565U
306#define NYX_FLAGS_DISABLED ((uint64_t) 0x0000000000000001U)
309#define NYX_FLAGS_BLOB_MASK ((uint64_t) 0x00000001FFFFFFFCU)
312#define NYX_FLAGS_STREAM_MASK ((uint64_t) 0xFFFFFFFE00000000U)
345 __NULLABLE__
struct nyx_node_s *
node;
372 __ZEROABLE__
size_t size,
373 __NULLABLE__ BUFF_t buff
385 __NULLABLE__ STR_t text
565bool nyx_number_set_alt(
582 return nyx_number_set_alt(
object, value,
true);
613 nyx_number_set(result, value);
684bool nyx_boolean_set_alt(
701 return nyx_boolean_set_alt(
object, value,
true);
732 nyx_boolean_set(result, value);
806void nyx_string_get_buff(
808 __NULLABLE__
size_t *result_size,
809 __NULLABLE__ buff_t *result_buff,
819bool nyx_string_set_dup_alt(
836 return nyx_string_set_dup_alt(
object, value,
true);
845bool nyx_string_set_ref_alt(
862 return nyx_string_set_ref_alt(
object, value,
true);
871bool nyx_string_set_buff_alt(
873 __ZEROABLE__
size_t size,
874 __NULLABLE__ BUFF_t buff,
892 return nyx_string_set_buff_alt(
object, size, buff, base64_encode,
true);
951 nyx_string_set_dup(result, value);
970 nyx_string_set_ref(result, value);
991 nyx_string_set_buff(result, size, buff, base64_encode);
1002#define nyx_string_set nyx_string_set_dup
1008#define nyx_string_from nyx_string_from_dup
1047#define NYX_DICT_ITER(object) \
1048 ((nyx_dict_iter_t) {.idx = 0, .type = ((nyx_dict_t *) (object))->base.type, .head = ((nyx_dict_t *) (object))->head})
1142bool nyx_dict_set_alt(
1161 return nyx_dict_set_alt(
object, key, value,
true);
1269#define NYX_LIST_ITER(object) \
1270 ((nyx_list_iter_t) {.idx = 0, .type = ((nyx_list_t *) (object))->base.type, .head = ((nyx_list_t *) (object))->head})
1382 return nyx_list_set_alt(
object, -1, value,
true);
1511 __ZEROABLE__
size_t size,
1512 __NULLABLE__ BUFF_t buff
1526 __NULLABLE__ STR_t text
1643#define NYX_INDI_VERSION "1.7"
1649 NYX_STATE_IDLE = 200,
1651 NYX_STATE_BUSY = 202,
1652 NYX_STATE_ALERT = 203,
1658STR_t nyx_state_to_str(
1664nyx_state_t nyx_str_to_state(
1680STR_t nyx_perm_to_str(
1686nyx_perm_t nyx_str_to_perm(
1694 NYX_RULE_ONE_OF_MANY = 400,
1695 NYX_RULE_AT_MOST_ONE = 401,
1696 NYX_RULE_ANY_OF_MANY = 402,
1702STR_t nyx_rule_to_str(
1708nyx_rule_t nyx_str_to_rule(
1717 NYX_ONOFF_OFF = 501,
1723STR_t nyx_onoff_to_str(
1729nyx_onoff_t nyx_str_to_onoff(
1737 NYX_BLOB_NEVER = 600,
1738 NYX_BLOB_ALSO = 601,
1739 NYX_BLOB_ONLY = 602,
1745STR_t nyx_blob_to_str(
1751nyx_blob_t nyx_str_to_blob(
1759 NYX_STREAM_NEVER = 700,
1760 NYX_STREAM_ALSO = 701,
1761 NYX_STREAM_ONLY = 702,
1767STR_t nyx_stream_to_str(
1773nyx_stream_t nyx_str_to_stream(
1781 __NULLABLE__ STR_t label;
1782 __NULLABLE__ STR_t group;
1783 __NULLABLE__
double timeout;
1784 __NULLABLE__ STR_t message;
1803int nyx_format_string_to_int(
1823long nyx_format_string_to_long(
1843double nyx_format_string_to_double(
1870 __NULLABLE__ STR_t label,
1880__INLINE__
bool nyx_number_def_set_int(
nyx_dict_t *def,
int value)
1884 nyx_string_t *
string = nyx_format_int_to_string(format, value);
1886 return nyx_dict_set(def,
"$",
string);
1891__INLINE__
int nyx_number_def_get_int(
const nyx_dict_t *def)
1897 return nyx_format_string_to_int(format,
string);
1902__INLINE__
bool nyx_number_def_set_long(
nyx_dict_t *def,
long value)
1906 nyx_string_t *
string = nyx_format_long_to_string(format, value);
1908 return nyx_dict_set(def,
"$",
string);
1913__INLINE__
long nyx_number_def_get_long(
const nyx_dict_t *def)
1919 return nyx_format_string_to_long(format,
string);
1924__INLINE__
bool nyx_number_def_set_double(
nyx_dict_t *def,
double value)
1928 nyx_string_t *
string = nyx_format_double_to_string(format, value);
1930 return nyx_dict_set(def,
"$",
string);
1935__INLINE__
double nyx_number_def_get_double(
const nyx_dict_t *def)
1941 return nyx_format_string_to_double(format,
string);
1994 __NULLABLE__ STR_t label,
2000__INLINE__
bool nyx_text_def_set(
nyx_dict_t *def, STR_t value)
2007__INLINE__ STR_t nyx_text_def_get(
const nyx_dict_t *def)
2009 return nyx_string_get((
nyx_string_t *) nyx_dict_get(def,
"$"));
2062 __NULLABLE__ STR_t label,
2068__INLINE__
bool nyx_light_def_set(
nyx_dict_t *def, nyx_state_t value)
2070 return nyx_dict_set(def,
"$",
nyx_string_from(nyx_state_to_str(value)));
2075__INLINE__ nyx_state_t nyx_light_def_get(
const nyx_dict_t *def)
2077 return nyx_str_to_state(((
nyx_string_t *) nyx_dict_get(def,
"$"))->value);
2128 __NULLABLE__ STR_t label,
2134__INLINE__
bool nyx_switch_def_set(
nyx_dict_t *def, nyx_onoff_t value)
2136 return nyx_dict_set(def,
"$",
nyx_string_from(nyx_onoff_to_str(value)));
2141__INLINE__ nyx_onoff_t nyx_switch_def_get(
const nyx_dict_t *def)
2143 return nyx_str_to_onoff(((
nyx_string_t *) nyx_dict_get(def,
"$"))->value);
2199 __NULLABLE__ STR_t label,
2206__INLINE__
bool nyx_blob_def_set(
nyx_dict_t *def,
size_t size, BUFF_t buff,
bool base64_encode)
2208 return nyx_dict_set(def,
"$", nyx_string_from_buff(size, buff, base64_encode));
2213__INLINE__
void nyx_blob_def_get(
const nyx_dict_t *def,
size_t *size, buff_t *buff,
bool base64_decode)
2215 nyx_string_get_buff((
nyx_string_t *) nyx_dict_get(def,
"$"), size, buff, base64_decode);
2267 __NULLABLE__ STR_t label
2330 __NULLABLE__ STR_t name,
2331 __NULLABLE__ STR_t message
2382 size_t message_size,
2412 __NULLABLE__ STR_t indi_url,
2414 __NULLABLE__ STR_t mqtt_url,
2415 __NULLABLE__ STR_t mqtt_username,
2416 __NULLABLE__ STR_t mqtt_password,
2420 __NULLABLE__ STR_t redis_url,
2421 __NULLABLE__ STR_t redis_username,
2422 __NULLABLE__ STR_t redis_password,
2474 __NULLABLE__ STR_t name,
2475 __NULLABLE__ STR_t message
2493 __NULLABLE__ STR_t name,
2494 __NULLABLE__ STR_t message
2544 __ZEROABLE__
size_t message_size,
2545 __NULLABLE__ BUFF_t message_buff
2573 __ZEROABLE__
size_t n_fields,
2574 const str_t field_names[],
2575 const size_t field_sizes[],
2576 const buff_t field_buffs[]
2584# pragma clang diagnostic pop
void nyx_boolean_free(nyx_boolean_t *object)
Frees memory of the provided JSON boolean object.
bool nyx_boolean_get(const nyx_boolean_t *object)
Get the value of the provided JSON boolean object.
nyx_boolean_t * nyx_boolean_new()
Allocates a new JSON boolean object.
__INLINE__ nyx_boolean_t * nyx_boolean_from(bool value)
Returns a JSON boolean object holding the value of the provided argument.
Definition nyx_node.h:728
__INLINE__ bool nyx_boolean_set(nyx_boolean_t *object, bool value)
Set the value of the provided JSON boolean object.
Definition nyx_node.h:699
str_t nyx_boolean_to_string(const nyx_boolean_t *object)
Returns a string representing the provided JSON boolean object.
__INLINE__ double nyx_dict_get_number(const nyx_dict_t *object, STR_t key)
Definition nyx_node.h:1203
size_t nyx_dict_size(const nyx_dict_t *object)
Gets the number of items in the provided JSON dict object.
bool nyx_dict_iterate(nyx_dict_iter_t *iter, STR_t *key, nyx_object_t **object)
str_t nyx_dict_to_string(const nyx_dict_t *object)
Returns a string representing the provided JSON dict object.
nyx_dict_t * nyx_dict_new()
Allocates a new JSON dict object.
nyx_object_t * nyx_dict_get(const nyx_dict_t *object, STR_t key)
void nyx_dict_del(nyx_dict_t *object, STR_t key)
void nyx_dict_clear(nyx_dict_t *object)
Clears the content of the provided JSON dict object.
__INLINE__ bool nyx_dict_set(nyx_dict_t *object, STR_t key, buff_t value)
Definition nyx_node.h:1159
void nyx_dict_free(nyx_dict_t *object)
Frees memory of the provided JSON dict object.
__INLINE__ STR_t nyx_dict_get_string(const nyx_dict_t *object, STR_t key)
Definition nyx_node.h:1223
__INLINE__ STR_t nyx_list_get_string(const nyx_list_t *object, int idx)
Definition nyx_node.h:1444
bool nyx_list_iterate(nyx_list_iter_t *iter, int *idx, nyx_object_t **object)
nyx_object_t * nyx_list_get(const nyx_list_t *object, int idx)
str_t nyx_list_to_string(const nyx_list_t *object)
Returns a string representing the provided JSON list object.
void nyx_list_del(nyx_list_t *object, int idx)
__INLINE__ double nyx_list_get_number(const nyx_list_t *object, int idx)
Definition nyx_node.h:1424
void nyx_list_free(nyx_list_t *object)
Frees memory of the provided JSON list object.
size_t nyx_list_size(const nyx_list_t *object)
Gets the number of items in the provided JSON list object.
__INLINE__ bool nyx_list_push(nyx_list_t *object, buff_t value)
Definition nyx_node.h:1380
nyx_list_t * nyx_list_new()
Allocates a new JSON list.
void nyx_list_clear(nyx_list_t *object)
Clears the content of the provided JSON list object.
nyx_log_level_e
Nyx log levels.
Definition nyx_node.h:126
void nyx_set_log_level(nyx_log_level_t level)
Sets the log level threshold.
enum nyx_log_level_e nyx_log_level_t
Nyx log levels.
void nyx_memory_initialize()
Initialize the memory subsystem.
bool nyx_memory_finalize()
Finalize the memory subsystem.
__NULLABLE__ buff_t nyx_memory_realloc(__NULLABLE__ buff_t buff, __ZEROABLE__ size_t size)
Similar to libc realloc except that a memory overflow causes the node to stop.
__NULLABLE__ buff_t nyx_memory_alloc(__ZEROABLE__ size_t size)
Similar to libc malloc except that a memory overflow causes the node to stop.
__ZEROABLE__ size_t nyx_memory_free(__NULLABLE__ buff_t buff)
Similar to libc free except that it returns the amount of memory freed.
void(* nyx_mqtt_handler_t)(nyx_node_t *node, nyx_event_t event, size_t topic_size, BUFF_t topic_buff, size_t message_size, BUFF_t message_buff)
MQTT event handler.
Definition nyx_node.h:2377
void nyx_node_poll(nyx_node_t *node, int timeout_ms)
Performs a single poll iteration.
void nyx_mqtt_sub(nyx_node_t *node, STR_t topic)
If MQTT is enabled, subscribes to a topic.
bool nyx_stream_pub(nyx_node_t *node, STR_t device, STR_t stream, bool check, size_t max_len, __ZEROABLE__ size_t n_fields, const str_t field_names[], const size_t field_sizes[], const buff_t field_buffs[])
If Redis is enabled, publishes an entry to a stream, see https://redis.io/commands/xadd/.
nyx_event_t
Nyx TCP or MQTT event type.
Definition nyx_node.h:2358
void nyx_node_send_message(nyx_node_t *node, STR_t device, STR_t message)
Sends a message to the clients.
void nyx_node_enable(nyx_node_t *node, STR_t device, __NULLABLE__ STR_t name, __NULLABLE__ STR_t message)
Enables a whole device or a definition vector.
void nyx_node_disable(nyx_node_t *node, STR_t device, __NULLABLE__ STR_t name, __NULLABLE__ STR_t message)
Disables a whole device or a definition vector.
void nyx_mqtt_pub(nyx_node_t *node, STR_t topic, __ZEROABLE__ size_t message_size, __NULLABLE__ BUFF_t message_buff)
If MQTT is enabled, publishes a message to a topic.
nyx_node_t * nyx_node_initialize(STR_t node_id, nyx_dict_t *def_vectors[], __NULLABLE__ STR_t indi_url, __NULLABLE__ STR_t mqtt_url, __NULLABLE__ STR_t mqtt_username, __NULLABLE__ STR_t mqtt_password, __NULLABLE__ nyx_mqtt_handler_t mqtt_handler, __NULLABLE__ STR_t redis_url, __NULLABLE__ STR_t redis_username, __NULLABLE__ STR_t redis_password, int retry_ms, bool enable_xml, bool validate_xml)
Initializes the Nyx node.
void nyx_node_finalize(nyx_node_t *node, bool free_vectors)
Finalizes the Nyx node.
@ NYX_EVENT_OPEN
A connection is opened.
Definition nyx_node.h:2359
@ NYX_EVENT_MSG
A message is received.
Definition nyx_node.h:2360
str_t nyx_null_to_string(const nyx_null_t *object)
Returns a string representing the provided JSON null object.
nyx_null_t * nyx_null_new()
Allocates a new JSON null object.
void nyx_null_free(nyx_null_t *object)
Frees memory of the provided JSON null object.
double nyx_number_get(const nyx_number_t *object)
Get the value of the provided JSON number object.
nyx_number_t * nyx_number_new()
Allocates a new JSON number object.
str_t nyx_number_to_string(const nyx_number_t *object)
Returns a string representing the provided JSON number object.
__INLINE__ nyx_number_t * nyx_number_from(double value)
Returns a JSON number object holding the value of the provided argument.
Definition nyx_node.h:609
void nyx_number_free(nyx_number_t *object)
Frees memory of the provided JSON number object.
__INLINE__ bool nyx_number_set(nyx_number_t *object, double value)
Set the value of the provided JSON number object.
Definition nyx_node.h:580
nyx_dict_t * nyx_blob_def_vector_new(STR_t device, STR_t name, nyx_state_t state, nyx_perm_t perm, nyx_dict_t *defs[], __NULLABLE__ const nyx_opts_t *opts)
Allocates a new INDI / Nyx BLOB vector.
nyx_dict_t * nyx_blob_def_new(STR_t name, __NULLABLE__ STR_t label, STR_t value, STR_t format)
Allocates a new INDI / Nyx BLOB.
nyx_dict_t * nyx_light_def_vector_new(STR_t device, STR_t name, nyx_state_t state, nyx_dict_t *defs[], __NULLABLE__ const nyx_opts_t *opts)
Allocates a new INDI / Nyx light vector.
nyx_dict_t * nyx_light_def_new(STR_t name, __NULLABLE__ STR_t label, nyx_state_t value)
Allocates a new INDI / Nyx light.
nyx_dict_t * nyx_message_new(STR_t device, STR_t message)
Allocates a new INDI / Nyx message.
nyx_dict_t * nyx_number_def_vector_new(STR_t device, STR_t name, nyx_state_t state, nyx_perm_t perm, nyx_dict_t *defs[], __NULLABLE__ const nyx_opts_t *opts)
Allocates a new INDI / Nyx number vector.
nyx_dict_t * nyx_number_def_new(STR_t name, __NULLABLE__ STR_t label, STR_t format, double min, double max, double step, double value)
Allocates a new INDI / Nyx number.
nyx_dict_t * nyx_stream_def_vector_new(STR_t device, STR_t name, nyx_state_t state, nyx_dict_t *defs[], __NULLABLE__ const nyx_opts_t *opts)
Allocates a new Nyx stream vector.
nyx_dict_t * nyx_stream_def_new(STR_t name, __NULLABLE__ STR_t label)
Allocates a new INDI / Nyx Stream.
nyx_dict_t * nyx_switch_def_vector_new(STR_t device, STR_t name, nyx_state_t state, nyx_perm_t perm, nyx_rule_t rule, nyx_dict_t *defs[], __NULLABLE__ const nyx_opts_t *opts)
Allocates a new INDI / Nyx switch vector.
nyx_dict_t * nyx_switch_def_new(STR_t name, __NULLABLE__ STR_t label, nyx_onoff_t value)
Allocates a new INDI / Nyx switch.
nyx_dict_t * nyx_text_def_new(STR_t name, __NULLABLE__ STR_t label, STR_t value)
Allocates a new INDI / Nyx text.
nyx_dict_t * nyx_text_def_vector_new(STR_t device, STR_t name, nyx_state_t state, nyx_perm_t perm, nyx_dict_t *defs[], __NULLABLE__ const nyx_opts_t *opts)
Allocates a new INDI / Nyx text vector.
str_t nyx_object_to_string(__NULLABLE__ const nyx_object_t *object)
Returns a string representing the provided object.
__NULLABLE__ nyx_object_t * nyx_object_parse(__NULLABLE__ STR_t text)
Parses a JSON object from a string.
bool nyx_object_equal(__NULLABLE__ const nyx_object_t *object1, __NULLABLE__ const nyx_object_t *object2)
Compares two JSON objects.
nyx_type_t
JSON object types.
Definition nyx_node.h:322
void nyx_object_free(__NULLABLE__ nyx_object_t *object)
Frees memory of the provided JSON object.
str_t nyx_object_to_cstring(__NULLABLE__ const nyx_object_t *object)
Returns a C/C++ string representing the provided object.
nyx_object_t * nyx_object_parse_buff(__ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
Parses a JSON object from a string buffer.
@ NYX_TYPE_DICT
Dict object.
Definition nyx_node.h:327
@ NYX_TYPE_LIST
List object.
Definition nyx_node.h:328
@ NYX_TYPE_BOOLEAN
Boolean object.
Definition nyx_node.h:324
@ NYX_TYPE_NUMBER
Number object.
Definition nyx_node.h:325
@ NYX_TYPE_NULL
Null object.
Definition nyx_node.h:323
@ NYX_TYPE_STRING
String object.
Definition nyx_node.h:326
__INLINE__ nyx_string_t * nyx_string_from_dup(STR_t value)
Returns a JSON string object holding the value of the provided argument (string duplication).
Definition nyx_node.h:947
nyx_string_t * nyx_string_new()
Allocates a new JSON string object.
__INLINE__ nyx_string_t * nyx_string_from_ref(STR_t value)
Returns a JSON string object holding the value of the provided argument (string reference).
Definition nyx_node.h:966
size_t nyx_string_length(const nyx_string_t *object)
Returns the length of the string representing the provided JSON string object.
str_t nyx_string_to_string(const nyx_string_t *object)
Returns a string representing the provided JSON string object.
__INLINE__ bool nyx_string_set_ref(nyx_string_t *object, STR_t value)
Set the value of the provided JSON string object (string reference).
Definition nyx_node.h:860
str_t nyx_string_to_cstring(const nyx_string_t *object)
Returns a C/C++ string representing the provided JSON string object.
__INLINE__ bool nyx_string_set_buff(nyx_string_t *object, size_t size, BUFF_t buff, bool base64_encode)
Set the value of the provided JSON string object (buffer reference or base64 encoding).
Definition nyx_node.h:890
__INLINE__ bool nyx_string_set_dup(nyx_string_t *object, STR_t value)
Set the value of the provided JSON string object (string duplication).
Definition nyx_node.h:834
#define nyx_string_from
Alias to nyx_string_from_dup.
Definition nyx_node.h:1008
STR_t nyx_string_get(const nyx_string_t *object)
Get the value of the provided JSON string object.
__INLINE__ nyx_string_t * nyx_string_from_buff(size_t size, BUFF_t buff, bool base64_encode)
Returns a JSON string object holding the value of the provided argument (buffer reference or base64 e...
Definition nyx_node.h:987
void nyx_string_free(nyx_string_t *object)
Frees memory of the provided JSON string object.
__NULLABLE__ str_t nyx_base64_encode(__NULLABLE__ size_t *result_len, __ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
Encodes a buffer to a Base64-encoded string.
__NULLABLE__ buff_t nyx_base64_decode(__NULLABLE__ size_t *result_size, __ZEROABLE__ size_t len, __NULLABLE__ STR_t str)
Decodes a Base64-encoded string to a buffer.
uint32_t nyx_hash32(__ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff, uint32_t seed)
Hashes a buffer using the MurmurHash2 algorithm.
void nyx_generate_mac_addr(uint8_t result_mac[6], uint8_t mac0, uint8_t mac1, STR_t node_id)
Generates a MAC address based on a node identifier.
bool nyx_validation_check(__NULLABLE__ const nyx_xmldoc_t *xmldoc)
Validate the provided XML command using the XSD schema extended with INDI and Nyx additions.
bool nyx_validation_finalize()
Initialize the XML validation subsystem.
bool nyx_validation_initialize()
Initialize the XML validation subsystem.
nyx_xml_type_t
XML node types.
Definition nyx_node.h:1468
str_t nyx_xmldoc_to_string(const nyx_xmldoc_t *xmldoc)
Returns a string representing the provided XML document.
void nyx_xmldoc_free(__NULLABLE__ nyx_xmldoc_t *xmldoc)
Frees memory of the provided XML document.
nyx_xmldoc_t * nyx_xmldoc_parse_buff(__ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
Parses an XML document from a string buffer.
nyx_xmldoc_t * nyx_xmldoc_parse(__NULLABLE__ STR_t text)
Parses an XML document from a string.
@ NYX_XML_CDATA
CDATA content.
Definition nyx_node.h:1472
@ NYX_XML_ELEM
Element node.
Definition nyx_node.h:1469
@ NYX_XML_COMMENT
Comment node.
Definition nyx_node.h:1471
@ NYX_XML_TEXT
Text content.
Definition nyx_node.h:1473
@ NYX_XML_ATTR
Attribute node.
Definition nyx_node.h:1470
Struct describing a JSON boolean.
Definition nyx_node.h:633
bool value
???
Definition nyx_node.h:636
nyx_object_t base
???
Definition nyx_node.h:634
Definition nyx_node.h:1036
nyx_type_t type
???
Definition nyx_node.h:1039
struct nyx_dict_node_s * head
???
Definition nyx_node.h:1041
int idx
???
Definition nyx_node.h:1037
Struct describing a JSON dict.
Definition nyx_node.h:1025
struct nyx_dict_node_s * tail
???
Definition nyx_node.h:1029
struct nyx_dict_node_s * head
???
Definition nyx_node.h:1028
nyx_object_t base
???
Definition nyx_node.h:1026
Definition nyx_node.h:1258
int idx
???
Definition nyx_node.h:1259
struct nyx_list_node_s * head
???
Definition nyx_node.h:1263
nyx_type_t type
???
Definition nyx_node.h:1261
Struct describing a JSON list.
Definition nyx_node.h:1247
nyx_object_t base
???
Definition nyx_node.h:1248
struct nyx_list_node_s * head
???
Definition nyx_node.h:1250
struct nyx_list_node_s * tail
???
Definition nyx_node.h:1251
Opaque struct describing a Nyx node.
Struct describing a JSON null value.
Definition nyx_node.h:460
nyx_object_t base
???
Definition nyx_node.h:461
Struct describing a JSON number.
Definition nyx_node.h:514
double value
???
Definition nyx_node.h:517
nyx_object_t base
???
Definition nyx_node.h:515
Definition nyx_node.h:339
uint32_t magic
Magic number, must always be NYX_OBJECT_MAGIC.
Definition nyx_node.h:340
__NULLABLE__ void(* in_callback)(struct nyx_object_s *object, bool modified)
Callback triggered when a client modifies this object.
Definition nyx_node.h:349
__NULLABLE__ struct nyx_object_s * parent
Pointer to the parent object.
Definition nyx_node.h:347
nyx_type_t type
Type of object, see nyx_type_t.
Definition nyx_node.h:343
uint64_t flags
Mask of flags, see NYX_FLAGS_XXX definitions.
Definition nyx_node.h:341
__NULLABLE__ struct nyx_node_s * node
Pointer to the associated Nyx node.
Definition nyx_node.h:345
__NULLABLE__ void(* out_callback)(struct nyx_object_s *object, bool modified)
Callback triggered when the server modifies this object.
Definition nyx_node.h:353
Definition nyx_node.h:1780
Struct describing a JSON string.
Definition nyx_node.h:752
bool dyn
???
Definition nyx_node.h:758
str_t value
???
Definition nyx_node.h:756
nyx_object_t base
???
Definition nyx_node.h:753
size_t length
???
Definition nyx_node.h:755
Definition nyx_node.h:1484