26# pragma clang diagnostic push
27# pragma ide diagnostic ignored "OCUnusedMacroInspection"
28# pragma ide diagnostic ignored "UnreachableCallsOfFunction"
33double nan(
const char *tag);
47 __attribute__((unused))
50 __attribute__((always_inline)) static inline
55typedef const void *BUFF_t;
58typedef const char *STR_t;
90 __NULLABLE__ buff_t buff
100 __ZEROABLE__
size_t size
110 __NULLABLE__ buff_t buff,
111 __ZEROABLE__
size_t size
130 NYX_LOG_LEVEL_NONE = 0,
131 NYX_LOG_LEVEL_FATAL = 1,
132 NYX_LOG_LEVEL_ERROR = 2,
133 NYX_LOG_LEVEL_INFO = 3,
134 NYX_LOG_LEVEL_DEBUG = 4,
135 NYX_LOG_LEVEL_VERBOSE = 5,
175#define NYX_LOG_FATAL(fmt, ...) \
176 do { nyx_log(NYX_LOG_LEVEL_FATAL, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(1)
185#define NYX_LOG_ERROR(fmt, ...) \
186 do { nyx_log(NYX_LOG_LEVEL_ERROR, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
195#define NYX_LOG_INFO(fmt, ...) \
196 do { nyx_log(NYX_LOG_LEVEL_INFO, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
205#define NYX_LOG_DEBUG(fmt, ...) \
206 do { nyx_log(NYX_LOG_LEVEL_DEBUG, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
215#define NYX_LOG_VERBOSE(fmt, ...) \
216 do { nyx_log(NYX_LOG_LEVEL_VERBOSE, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
238 __ZEROABLE__
size_t size,
239 __NULLABLE__ BUFF_t buff,
255 uint8_t result_mac[6],
273 __NULLABLE__
size_t *result_len,
274 __ZEROABLE__
size_t size,
275 __NULLABLE__ BUFF_t buff
290 __NULLABLE__
size_t *result_size,
291 __ZEROABLE__
size_t len,
292 __NULLABLE__ STR_t str
307 __NULLABLE__
size_t *result_buff,
308 __ZEROABLE__
size_t size,
309 __NULLABLE__ BUFF_t buff
324 __NOTNULL__
size_t *result_size,
325 __ZEROABLE__
size_t size,
326 __NULLABLE__ BUFF_t buff
341 __NULLABLE__
size_t *result_len,
342 __ZEROABLE__
size_t size,
343 __NULLABLE__ BUFF_t buff
358 __NOTNULL__
size_t *result_size,
359 __ZEROABLE__
size_t len,
360 __NULLABLE__ STR_t str
373#define NYX_OBJECT_MAGIC 0x65656565U
377#define NYX_FLAGS_DISABLED ((uint64_t) 0x0000000000000001U)
380#define NYX_FLAGS_BLOB_MASK ((uint64_t) 0x00000001FFFFFFFCU)
383#define NYX_FLAGS_STREAM_MASK ((uint64_t) 0xFFFFFFFE00000000U)
416 __NULLABLE__
struct nyx_node_s *
node;
446 __ZEROABLE__
size_t size,
447 __NULLABLE__ BUFF_t buff
459 __NULLABLE__ STR_t text
639bool nyx_number_set_alt(
656 return nyx_number_set_alt(
object,
value,
true);
758bool nyx_boolean_set_alt(
775 return nyx_boolean_set_alt(
object,
value,
true);
881void nyx_string_get_buff(
883 __NULLABLE__
size_t *result_size,
884 __NULLABLE__ buff_t *result_buff,
895bool nyx_string_set_dup_alt(
912 return nyx_string_set_dup_alt(
object,
value,
true);
921bool nyx_string_set_ref_alt(
938 return nyx_string_set_ref_alt(
object,
value,
true);
947bool nyx_string_set_buff_alt(
949 __ZEROABLE__
size_t size,
950 __NULLABLE__ BUFF_t buff,
970 return nyx_string_set_buff_alt(
object, size, buff, base64_encode, compress,
true);
1095#define nyx_string_set nyx_string_set_dup
1101#define nyx_string_from nyx_string_from_dup
1140#define NYX_DICT_ITER(object) \
1141 ((nyx_dict_iter_t) {.idx = 0, .type = ((nyx_dict_t *) (object))->base.type, .head = ((nyx_dict_t *) (object))->head})
1210 nyx_object_t **
object
1235bool nyx_dict_set_alt(
1254 return nyx_dict_set_alt(
object, key, value,
true);
1362#define NYX_LIST_ITER(object) \
1363 ((nyx_list_iter_t) {.idx = 0, .type = ((nyx_list_t *) (object))->base.type, .head = ((nyx_list_t *) (object))->head})
1432 nyx_object_t **
object
1475 return nyx_list_set_alt(
object, -1, value,
true);
1604 __ZEROABLE__
size_t size,
1605 __NULLABLE__ BUFF_t buff
1619 __NULLABLE__ STR_t text
1693#define NYX_INDI_VERSION "1.7"
1699 NYX_STATE_IDLE = 200,
1701 NYX_STATE_BUSY = 202,
1702 NYX_STATE_ALERT = 203,
1708STR_t nyx_state_to_str(
1714nyx_state_t nyx_str_to_state(
1730STR_t nyx_perm_to_str(
1736nyx_perm_t nyx_str_to_perm(
1744 NYX_RULE_ONE_OF_MANY = 400,
1745 NYX_RULE_AT_MOST_ONE = 401,
1746 NYX_RULE_ANY_OF_MANY = 402,
1752STR_t nyx_rule_to_str(
1758nyx_rule_t nyx_str_to_rule(
1767 NYX_ONOFF_OFF = 501,
1773STR_t nyx_onoff_to_str(
1779nyx_onoff_t nyx_str_to_onoff(
1787 NYX_BLOB_NEVER = 600,
1788 NYX_BLOB_ALSO = 601,
1789 NYX_BLOB_ONLY = 602,
1795STR_t nyx_blob_to_str(
1801nyx_blob_t nyx_str_to_blob(
1809 NYX_STREAM_NEVER = 700,
1810 NYX_STREAM_ALSO = 701,
1811 NYX_STREAM_ONLY = 702,
1817STR_t nyx_stream_to_str(
1823nyx_stream_t nyx_str_to_stream(
1831 __NULLABLE__ STR_t label;
1832 __NULLABLE__ STR_t group;
1833 __NULLABLE__ STR_t hints;
1834 __NULLABLE__
double timeout;
1835 __NULLABLE__ STR_t message;
1854double nyx_format_string_to_double(
1881 __NULLABLE__ STR_t label,
1891__INLINE__
bool nyx_number_def_set(
nyx_dict_t *def,
double value)
1897 return nyx_dict_set(def,
"$",
string);
1902__INLINE__
double nyx_number_def_get(
const nyx_dict_t *def)
1908 return nyx_format_string_to_double(format->
value,
string);
1961 __NULLABLE__ STR_t label,
1967__INLINE__
bool nyx_text_def_set(
nyx_dict_t *def, STR_t value)
1974__INLINE__ STR_t nyx_text_def_get(
const nyx_dict_t *def)
1976 return nyx_string_get((
nyx_string_t *) nyx_dict_get(def,
"$"));
2029 __NULLABLE__ STR_t label,
2035__INLINE__
bool nyx_light_def_set(
nyx_dict_t *def, nyx_state_t value)
2037 return nyx_dict_set(def,
"$",
nyx_string_from(nyx_state_to_str(value)));
2042__INLINE__ nyx_state_t nyx_light_def_get(
const nyx_dict_t *def)
2044 return nyx_str_to_state(((
nyx_string_t *) nyx_dict_get(def,
"$"))->value);
2095 __NULLABLE__ STR_t label,
2101__INLINE__
bool nyx_switch_def_set(
nyx_dict_t *def, nyx_onoff_t value)
2103 return nyx_dict_set(def,
"$",
nyx_string_from(nyx_onoff_to_str(value)));
2108__INLINE__ nyx_onoff_t nyx_switch_def_get(
const nyx_dict_t *def)
2110 return nyx_str_to_onoff(((
nyx_string_t *) nyx_dict_get(def,
"$"))->value);
2166 __NULLABLE__ STR_t label,
2177bool nyx_glob_is_compressed(
const nyx_dict_t *def);
2181__INLINE__
bool nyx_blob_def_set(
nyx_dict_t *def,
size_t size, BUFF_t buff)
2183 return nyx_dict_set(def,
"$", nyx_string_from_buff(size, buff,
true, nyx_glob_is_compressed(def)));
2188__INLINE__
void nyx_blob_def_get(
const nyx_dict_t *def,
size_t *size, buff_t *buff)
2190 nyx_string_get_buff((
nyx_string_t *) nyx_dict_get(def,
"$"), size, buff,
true, nyx_glob_is_compressed(def));
2242 __NULLABLE__ STR_t label
2305 __NULLABLE__ STR_t name,
2306 __NULLABLE__ STR_t message
2357 size_t message_size,
2386 __NULLABLE__ STR_t indi_url,
2388 __NULLABLE__ STR_t mqtt_url,
2389 __NULLABLE__ STR_t mqtt_username,
2390 __NULLABLE__ STR_t mqtt_password,
2394 __NULLABLE__ STR_t redis_url,
2395 __NULLABLE__ STR_t redis_username,
2396 __NULLABLE__ STR_t redis_password,
2447 __NULLABLE__ STR_t name,
2448 __NULLABLE__ STR_t message
2466 __NULLABLE__ STR_t name,
2467 __NULLABLE__ STR_t message
2517 __ZEROABLE__
size_t message_size,
2518 __NULLABLE__ BUFF_t message_buff
2547 __ZEROABLE__
size_t n_fields,
2548 const str_t field_names[],
2549 const size_t field_sizes[],
2550 const buff_t field_buffs[]
2558# 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:802
__INLINE__ bool nyx_boolean_set(nyx_boolean_t *object, bool value)
Set the value of the provided JSON boolean object.
Definition nyx_node.h:773
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:1296
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:1252
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:1316
__INLINE__ STR_t nyx_list_get_string(const nyx_list_t *object, int idx)
Definition nyx_node.h:1537
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:1517
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:1473
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:129
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:2352
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:2333
void nyx_node_send_message(nyx_node_t *node, STR_t device, STR_t message)
Sends a message to the clients.
nyx_node_t * nyx_node_initialize(STR_t node_id, nyx_dict_t *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)
Initializes the Nyx node.
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.
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:2334
@ NYX_EVENT_MSG
A message is received.
Definition nyx_node.h:2335
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:683
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:654
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 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:393
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:398
@ NYX_TYPE_LIST
List object.
Definition nyx_node.h:399
@ NYX_TYPE_BOOLEAN
Boolean object.
Definition nyx_node.h:395
@ NYX_TYPE_NUMBER
Number object.
Definition nyx_node.h:396
@ NYX_TYPE_NULL
Null object.
Definition nyx_node.h:394
@ NYX_TYPE_STRING
String object.
Definition nyx_node.h:397
__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:1039
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:1058
size_t nyx_string_length(const nyx_string_t *object)
Returns the length of the provided JSON string object.
__INLINE__ bool nyx_string_set_buff(nyx_string_t *object, size_t size, BUFF_t buff, bool base64_encode, bool compress)
Set the value of the provided JSON string object (buffer reference or base64 encoding).
Definition nyx_node.h:968
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:936
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_dup(nyx_string_t *object, STR_t value)
Set the value of the provided JSON string object (string duplication).
Definition nyx_node.h:910
size_t nyx_string_raw_size(const nyx_string_t *object)
Returns the raw size (before base64-encoding or compressing) of JSON string object.
#define nyx_string_from
Alias to nyx_string_from_dup.
Definition nyx_node.h:1101
__INLINE__ nyx_string_t * nyx_string_from_buff(size_t size, BUFF_t buff, bool base64_encode, bool compress)
Returns a JSON string object holding the value of the provided argument (buffer reference or base64 e...
Definition nyx_node.h:1080
STR_t nyx_string_get(const nyx_string_t *object)
Get the value of the provided JSON string object.
void nyx_string_free(nyx_string_t *object)
Frees memory of the provided JSON string object.
__NULLABLE__ buff_t nyx_zlib_inflate(__NOTNULL__ size_t *result_size, __ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
ZLib-uncompresses a string to a buffer.
__NULLABLE__ str_t nyx_base64_encode(__NULLABLE__ size_t *result_len, __ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
Base64-encodes a buffer to a string.
__NULLABLE__ buff_t nyx_base64_decode(__NULLABLE__ size_t *result_size, __ZEROABLE__ size_t len, __NULLABLE__ STR_t str)
Base64-encodes a string to a buffer.
__NULLABLE__ buff_t nyx_zlib_deflate(__NULLABLE__ size_t *result_buff, __ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
ZLib-compresses a buffer to a string.
__NULLABLE__ buff_t nyx_zlib_base64_inflate(__NOTNULL__ size_t *result_size, __ZEROABLE__ size_t len, __NULLABLE__ STR_t str)
ZLib+base64-uncompresses a 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.
__NULLABLE__ str_t nyx_zlib_base64_deflate(__NULLABLE__ size_t *result_len, __ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
ZLib+base64-compresses a buffer to a string.
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.
nyx_xml_type_t
XML node types.
Definition nyx_node.h:1561
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:1565
@ NYX_XML_ELEM
Element node.
Definition nyx_node.h:1562
@ NYX_XML_COMMENT
Comment node.
Definition nyx_node.h:1564
@ NYX_XML_TEXT
Text content.
Definition nyx_node.h:1566
@ NYX_XML_ATTR
Attribute node.
Definition nyx_node.h:1563
Struct describing a JSON boolean.
Definition nyx_node.h:707
bool value
???
Definition nyx_node.h:710
nyx_object_t base
???
Definition nyx_node.h:708
Definition nyx_node.h:1129
nyx_type_t type
???
Definition nyx_node.h:1132
struct nyx_dict_node_s * head
???
Definition nyx_node.h:1134
int idx
???
Definition nyx_node.h:1130
Struct describing a JSON dict.
Definition nyx_node.h:1118
struct nyx_dict_node_s * tail
???
Definition nyx_node.h:1122
struct nyx_dict_node_s * head
???
Definition nyx_node.h:1121
nyx_object_t base
???
Definition nyx_node.h:1119
Definition nyx_node.h:1351
int idx
???
Definition nyx_node.h:1352
struct nyx_list_node_s * head
???
Definition nyx_node.h:1356
nyx_type_t type
???
Definition nyx_node.h:1354
Struct describing a JSON list.
Definition nyx_node.h:1340
nyx_object_t base
???
Definition nyx_node.h:1341
struct nyx_list_node_s * head
???
Definition nyx_node.h:1343
struct nyx_list_node_s * tail
???
Definition nyx_node.h:1344
Opaque struct describing a Nyx node.
Struct describing a JSON null value.
Definition nyx_node.h:534
nyx_object_t base
???
Definition nyx_node.h:535
Struct describing a JSON number.
Definition nyx_node.h:588
double value
???
Definition nyx_node.h:591
nyx_object_t base
???
Definition nyx_node.h:589
Definition nyx_node.h:410
uint32_t magic
Magic number, must always be NYX_OBJECT_MAGIC.
Definition nyx_node.h:411
__NULLABLE__ void(* in_callback)(struct nyx_object_s *object, bool modified)
Callback triggered when a client modifies this object.
Definition nyx_node.h:420
__NULLABLE__ struct nyx_object_s * parent
Pointer to the parent object.
Definition nyx_node.h:418
nyx_type_t type
Type of object, see nyx_type_t.
Definition nyx_node.h:414
uint64_t flags
Mask of flags, see NYX_FLAGS_XXX definitions.
Definition nyx_node.h:412
__NULLABLE__ struct nyx_node_s * node
Pointer to the associated Nyx node.
Definition nyx_node.h:416
__NULLABLE__ void(* out_callback)(struct nyx_object_s *object, bool modified)
Callback triggered when the server modifies this object.
Definition nyx_node.h:425
__NULLABLE__ void * ctx
Custom pointer for callbacks.
Definition nyx_node.h:430
Definition nyx_node.h:1830
Struct describing a JSON string.
Definition nyx_node.h:826
bool dyn
???
Definition nyx_node.h:833
str_t value
???
Definition nyx_node.h:831
nyx_object_t base
???
Definition nyx_node.h:827
size_t raw_size
???
Definition nyx_node.h:829
size_t length
???
Definition nyx_node.h:830
Definition nyx_node.h:1577