You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
intd_bytes_to(d_token_t*item, uint8_t*dst, constintmax); /**< writes the byte-representation to the dst. details see d_to_bytes.*/
108
-
bytes_t*d_bytes(constd_token_t*item); /**< returns the value as bytes (Carefully, make sure that the token is a bytes-type!)*/
109
-
bytes_t*d_bytesl(d_token_t*item, size_tl); /**< returns the value as bytes with length l (may reallocates) */
110
-
char*d_string(constd_token_t*item); /**< converts the value as string. Make sure the type is string! */
111
-
int32_td_int(constd_token_t*item); /**< returns the value as integer. only if type is integer */
112
-
int32_td_intd(constd_token_t*item, constuint32_tdef_val); /**< returns the value as integer or if NULL the default. only if type is integer */
113
-
uint64_td_long(constd_token_t*item); /**< returns the value as long. only if type is integer or bytes, but short enough */
114
-
uint64_td_longd(constd_token_t*item, constuint64_tdef_val); /**< returns the value as long or if NULL the default. only if type is integer or bytes, but short enough */
115
-
bytes_t**d_create_bytes_vec(constd_token_t*arr); /** creates a array of bytes from JOSN-array */
116
-
staticinlined_type_td_type(constd_token_t*item) { returnitem==NULL ? T_NULL : (item->len&0xF0000000) >> 28; } /**< type of the token */
117
-
staticinlineintd_len(constd_token_t*item) { returnitem==NULL ? 0 : item->len&0xFFFFFFF; } /**< number of elements in the token (only for object or array, other will return 0) */
118
-
boold_eq(constd_token_t*a, constd_token_t*b); /**< compares 2 token and if the value is equal */
119
-
d_key_tkeyn(constchar*c, constsize_tlen); /**< generates the keyhash for the given stringrange as defined by len */
107
+
intd_bytes_to(d_token_t*item, uint8_t*dst, constintmax); /**< writes the byte-representation to the dst. details see d_to_bytes.*/
108
+
bytes_t*d_bytes(constd_token_t*item); /**< returns the value as bytes (Carefully, make sure that the token is a bytes-type!)*/
109
+
bytes_t*d_bytesl(d_token_t*item, size_tl); /**< returns the value as bytes with length l (may reallocates) */
110
+
char*d_string(constd_token_t*item); /**< converts the value as string. Make sure the type is string! */
111
+
int32_td_int(constd_token_t*item); /**< returns the value as integer. only if type is integer */
112
+
int32_td_intd(constd_token_t*item, constuint32_tdef_val); /**< returns the value as integer or if NULL the default. only if type is integer */
113
+
uint64_td_long(constd_token_t*item); /**< returns the value as long. only if type is integer or bytes, but short enough */
114
+
uint64_td_longd(constd_token_t*item, constuint64_tdef_val); /**< returns the value as long or if NULL the default. only if type is integer or bytes, but short enough */
115
+
bytes_t**d_create_bytes_vec(constd_token_t*arr); /** creates a array of bytes from JOSN-array */
116
+
staticinlined_type_td_type(constd_token_t*item) { return (item ? ((item->len&0xF0000000) >> 28) : T_NULL); } /**< type of the token */
117
+
staticinlineintd_len(constd_token_t*item) { /**< number of elements in the token (only for object or array, other will return 0) */
118
+
if (item==NULL) return0;
119
+
returnitem->len&0xFFFFFFF;
120
+
}
121
+
boold_eq(constd_token_t*a, constd_token_t*b); /**< compares 2 token and if the value is equal */
122
+
d_key_tkeyn(constchar*c, constsize_tlen); /**< generates the keyhash for the given stringrange as defined by len */
120
123
121
124
d_token_t*d_get(d_token_t*item, constuint16_tkey); /**< returns the token with the given propertyname (only if item is a object) */
122
125
d_token_t*d_get_or(d_token_t*item, constuint16_tkey1, constuint16_tkey2); /**< returns the token with the given propertyname or if not found, tries the other. (only if item is a object) */
@@ -191,8 +194,8 @@ typedef struct d_iterator {
191
194
intleft; /**< number of result left */
192
195
} d_iterator_t;
193
196
194
-
staticinlined_iterator_td_iter(d_token_t*parent) { return (d_iterator_t){.left=d_len(parent), .token=parent+1}; }/**< creates a iterator for a object or array */
0 commit comments