10#include "../nyx_node_internal.h"
18 if(label == NULL || label[0] ==
'\0')
23 if(format == NULL || format[0] ==
'\0')
28 if(size == 0x00 || buff == NULL)
42 nyx_dict_set_string_unref(result,
"<>",
"defBLOB",
false);
46 nyx_dict_set_string_unref(result,
"@name",
nyx_string_dup(name),
true);
47 nyx_dict_set_string_unref(result,
"@label",
nyx_string_dup(label),
true);
48 nyx_dict_set_string_unref(result,
"@format",
nyx_string_dup(format),
true);
52 nyx_dict_set_buff_unref(result,
"$", size, buff, managed);
63bool nyx_blob_prop_set(
const nyx_dict_t *prop,
size_t size,
BUFF_t buff,
bool managed)
65 if(size == 0x00 || buff == NULL)
73 return nyx_dict_set_buff(prop,
"$", size, buff, managed);
80 return nyx_dict_get_buff(prop,
"$", size, buff);
101 nyx_dict_set_string_unref(result,
"<>",
"defBLOBVector",
false);
105 nyx_dict_set_string_unref(result,
"@client",
"unknown",
false);
106 nyx_dict_set_string_unref(result,
"@device",
nyx_string_dup(device),
true);
107 nyx_dict_set_string_unref(result,
"@name",
nyx_string_dup(name),
true);
109 nyx_dict_set_string_unref(result,
"@state", nyx_state_to_str(state),
false);
110 nyx_dict_set_string_unref(result,
"@perm", nyx_perm_to_str(perm),
false);
114 internal_set_opts(result, opts);
118 nyx_dict_set(result,
"children", children);
120 if(props)
for(; *props != NULL; props++)
122 nyx_list_push(children, *props);
124 nyx_object_unref(*props);
127 nyx_object_unref(children);
140 return internal_prop_to_set_vector(vector,
"setBLOBVector",
"oneBLOB");
Struct describing a JSON dict object.
Struct describing a JSON list object.
#define STR_t
Alias for const char *.
#define buff_t
Alias for void *.
#define BUFF_t
Alias for const void *.
__NYX_NULLABLE__ str_t nyx_string_dup(__NYX_NULLABLE__ STR_t s)
Similar to libc strdup.
nyx_perm_t
Vector permission hint.
nyx_state_t
Vector state hint.
Struct describing the options for INDI / Nyx vectors.