Changeset 7c3fb9b in mainline for uspace/lib/bithenge/include
- Timestamp:
- 2018-05-17T08:29:01Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- Location:
- uspace/lib/bithenge/include/bithenge
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/bithenge/include/bithenge/blob.h
rfac0ac7 r7c3fb9b 43 43 44 44 /** A blob of raw binary data. 45 * @implements bithenge_node_t */ 45 * @implements bithenge_node_t 46 */ 46 47 typedef struct { 47 48 /** @privatesection */ … … 50 51 51 52 /** Operations providing random access to binary data. 52 * @todo Should these be thread-safe? */ 53 * @todo Should these be thread-safe? 54 */ 53 55 typedef struct bithenge_random_access_blob_ops_t { 54 56 /** @copydoc bithenge_blob_t::bithenge_blob_size */ … … 61 63 aoff64_t *size, bool little_endian); 62 64 /** Destroy the blob. 63 * @param blob The blob. */ 65 * @param blob The blob. 66 */ 64 67 void (*destroy)(bithenge_blob_t *self); 65 68 } bithenge_random_access_blob_ops_t; 66 69 67 70 /** A blob built from an object that supports only sequential reading. 68 * @implements bithenge_blob_t */ 71 * @implements bithenge_blob_t 72 */ 69 73 typedef struct { 70 74 /** @privatesection */ … … 82 86 83 87 /** Operations providing sequential access to binary data. 84 * @memberof bithenge_sequential_blob_t */ 88 * @memberof bithenge_sequential_blob_t 89 */ 85 90 typedef struct bithenge_sequential_blob_ops_t { 86 91 … … 112 117 113 118 /** Destroy the blob. 114 * @param self The blob. */ 119 * @param self The blob. 120 */ 115 121 void (*destroy)(bithenge_sequential_blob_t *self); 116 122 } bithenge_sequential_blob_ops_t; … … 189 195 * @param self The blob. 190 196 * @param[out] out Holds whether the blob is empty. 191 * @return EOK on success or an error code from errno.h. */ 197 * @return EOK on success or an error code from errno.h. 198 */ 192 199 static inline errno_t bithenge_blob_empty(bithenge_blob_t *self, bool *out) 193 200 { … … 203 210 * @memberof bithenge_blob_t 204 211 * @param blob The blob to cast. 205 * @return The blob node as a generic node. */ 212 * @return The blob node as a generic node. 213 */ 206 214 static inline bithenge_node_t *bithenge_blob_as_node(bithenge_blob_t *blob) 207 215 { … … 212 220 * @memberof bithenge_blob_t 213 221 * @param node The node to cast, which must be a blob node. 214 * @return The generic node as a blob node. */ 222 * @return The generic node as a blob node. 223 */ 215 224 static inline bithenge_blob_t *bithenge_node_as_blob(bithenge_node_t *node) 216 225 { … … 220 229 221 230 /** Increment a blob's reference count. 222 * @param blob The blob to reference. */ 231 * @param blob The blob to reference. 232 */ 223 233 static inline void bithenge_blob_inc_ref(bithenge_blob_t *blob) 224 234 { … … 227 237 228 238 /** Decrement a blob's reference count. 229 * @param blob The blob to dereference, or NULL. */ 239 * @param blob The blob to dereference, or NULL. 240 */ 230 241 static inline void bithenge_blob_dec_ref(bithenge_blob_t *blob) 231 242 { -
uspace/lib/bithenge/include/bithenge/expression.h
rfac0ac7 r7c3fb9b 55 55 bithenge_node_t **out); 56 56 /** Destroy the expression. 57 * @param self The expression. */ 57 * @param self The expression. 58 */ 58 59 void (*destroy)(bithenge_expression_t *self); 59 60 } bithenge_expression_ops_t; 60 61 61 62 /** Increment an expression's reference count. 62 * @param self The expression to reference. */ 63 * @param self The expression to reference. 64 */ 63 65 static inline void bithenge_expression_inc_ref(bithenge_expression_t *self) 64 66 { … … 68 70 69 71 /** Decrement an expression's reference count and free it if appropriate. 70 * @param self The expression to dereference, or NULL. */ 72 * @param self The expression to dereference, or NULL. 73 */ 71 74 static inline void bithenge_expression_dec_ref(bithenge_expression_t *self) 72 75 { … … 84 87 * @param scope The scope. 85 88 * @param[out] out Where the output tree will be stored. 86 * @return EOK on success or an error code from errno.h. */ 89 * @return EOK on success or an error code from errno.h. 90 */ 87 91 static inline errno_t bithenge_expression_evaluate(bithenge_expression_t *self, 88 92 bithenge_scope_t *scope, bithenge_node_t **out) -
uspace/lib/bithenge/include/bithenge/print.h
rfac0ac7 r7c3fb9b 43 43 typedef enum { 44 44 /** Print a Python value. Note that internal nodes will be represented 45 * as unordered dictionaries. */ 45 * as unordered dictionaries. 46 */ 46 47 BITHENGE_PRINT_PYTHON, 47 48 /** Print JSON. Due to the limitations of JSON, type information may be 48 * lost. */ 49 * lost. 50 */ 49 51 BITHENGE_PRINT_JSON, 50 52 } bithenge_print_type_t; -
uspace/lib/bithenge/include/bithenge/transform.h
rfac0ac7 r7c3fb9b 64 64 /** Increment a scope's reference count. 65 65 * @memberof bithenge_scope_t 66 * @param self The scope to reference. */ 66 * @param self The scope to reference. 67 */ 67 68 static inline void bithenge_scope_inc_ref(bithenge_scope_t *self) 68 69 { … … 73 74 /** Operations that may be provided by a transform. All transforms must provide 74 75 * apply and/or prefix_apply. To be used in struct transforms and repeat 75 * transforms, transforms must provide prefix_length and/or prefix_apply. */ 76 * transforms, transforms must provide prefix_length and/or prefix_apply. 77 */ 76 78 typedef struct bithenge_transform_ops { 77 79 /** @copydoc bithenge_transform_t::bithenge_transform_apply */ … … 86 88 bithenge_node_t **out_node, aoff64_t *out_size); 87 89 /** Destroy the transform. 88 * @param self The transform. */ 90 * @param self The transform. 91 */ 89 92 void (*destroy)(bithenge_transform_t *self); 90 93 } bithenge_transform_ops_t; … … 93 96 * by the parser and param-wrapper. Takes ownership of nothing. 94 97 * @param self The transform. 95 * @return The number of parameters required. */ 98 * @return The number of parameters required. 99 */ 96 100 static inline int bithenge_transform_num_params(bithenge_transform_t *self) 97 101 { … … 101 105 102 106 /** Increment a transform's reference count. 103 * @param self The transform to reference. */ 107 * @param self The transform to reference. 108 */ 104 109 static inline void bithenge_transform_inc_ref(bithenge_transform_t *self) 105 110 { … … 109 114 110 115 /** Decrement a transform's reference count and free it if appropriate. 111 * @param self The transform to dereference, or NULL. */ 116 * @param self The transform to dereference, or NULL. 117 */ 112 118 static inline void bithenge_transform_dec_ref(bithenge_transform_t *self) 113 119 { -
uspace/lib/bithenge/include/bithenge/tree.h
rfac0ac7 r7c3fb9b 81 81 * @param value The value. 82 82 * @param data Data provided to @a bithenge_node_t::bithenge_node_for_each. 83 * @return EOK on success or an error code from errno.h. */ 83 * @return EOK on success or an error code from errno.h. 84 */ 84 85 typedef errno_t (*bithenge_for_each_func_t)(bithenge_node_t *key, bithenge_node_t *value, void *data); 85 86 … … 92 93 bithenge_node_t **out); 93 94 /** Destroys the internal node. 94 * @param self The node to destroy. */ 95 * @param self The node to destroy. 96 */ 95 97 void (*destroy)(bithenge_node_t *self); 96 98 } bithenge_internal_node_ops_t; … … 99 101 * @memberof bithenge_node_t 100 102 * @param node The node. 101 * @return The type of the node. */ 103 * @return The type of the node. 104 */ 102 105 static inline bithenge_node_type_t bithenge_node_type(const bithenge_node_t *node) 103 106 { … … 107 110 /** Increment a node's reference count. 108 111 * @memberof bithenge_node_t 109 * @param node The node to reference. */ 112 * @param node The node to reference. 113 */ 110 114 static inline void bithenge_node_inc_ref(bithenge_node_t *node) 111 115 { … … 122 126 * @param func The callback function. 123 127 * @param data Data to provide to the callback function. 124 * @return EOK on success or an error code from errno.h. */ 128 * @return EOK on success or an error code from errno.h. 129 */ 125 130 static inline errno_t bithenge_node_for_each(bithenge_node_t *self, 126 131 bithenge_for_each_func_t func, void *data) … … 137 142 * @memberof bithenge_node_t 138 143 * @param self The boolean node. 139 * @return The node's value. */ 144 * @return The node's value. 145 */ 140 146 static inline bool bithenge_boolean_node_value(bithenge_node_t *self) 141 147 { … … 147 153 * @memberof bithenge_node_t 148 154 * @param self The integer node. 149 * @return The node's value. */ 155 * @return The node's value. 156 */ 150 157 static inline bithenge_int_t bithenge_integer_node_value(bithenge_node_t *self) 151 158 { … … 157 164 * @memberof bithenge_node_t 158 165 * @param self The string node. 159 * @return The node's value. */ 166 * @return The node's value. 167 */ 160 168 static inline const char *bithenge_string_node_value(bithenge_node_t *self) 161 169 {
Note:
See TracChangeset
for help on using the changeset viewer.