10#include "../nyx_node_internal.h"
18 if(label == NULL || label[0] ==
'\0')
36 nyx_dict_set_string_unref(result,
"<>",
"defText",
false);
40 nyx_dict_set_string_unref(result,
"@name",
nyx_string_dup(name),
true);
41 nyx_dict_set_string_unref(result,
"@label",
nyx_string_dup(label),
true);
45 nyx_dict_set_string_unref(result,
"$", value, managed);
56bool nyx_text_prop_set(
const nyx_dict_t *prop,
STR_t value,
bool managed)
65 return nyx_dict_set_string(prop,
"$",
nyx_string_dup(value), managed);
72 return nyx_dict_get_string(prop,
"$");
93 nyx_dict_set_string_unref(result,
"<>",
"defTextVector",
false);
97 nyx_dict_set_string_unref(result,
"@client",
"unknown",
false);
98 nyx_dict_set_string_unref(result,
"@device",
nyx_string_dup(device),
true);
99 nyx_dict_set_string_unref(result,
"@name",
nyx_string_dup(name),
true);
101 nyx_dict_set_string_unref(result,
"@state", nyx_state_to_str(state),
false);
102 nyx_dict_set_string_unref(result,
"@perm", nyx_perm_to_str(perm),
false);
106 internal_set_opts(result, opts);
110 nyx_dict_set(result,
"children", children);
112 if(props)
for(; *props != NULL; props++)
114 nyx_list_push(children, *props);
116 nyx_object_unref(*props);
119 nyx_object_unref(children);
132 return internal_prop_to_set_vector(vector,
"setTextVector",
"oneText");
Struct describing a JSON dict object.
Struct describing a JSON list object.
#define STR_t
Alias for const char *.
__NYX_NULLABLE__ str_t nyx_string_dup(__NYX_NULLABLE__ STR_t s)
Similar to libc strdup.
STR_t nyx_text_prop_get(const nyx_dict_t *prop)
Gets the text value of the provided property object.
nyx_perm_t
Vector permission hint.
nyx_state_t
Vector state hint.
Struct describing the options for INDI / Nyx vectors.