Changeset 7c3fb9b in mainline for uspace/lib/bithenge/src/transform.c
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/bithenge/src/transform.c
rfac0ac7 r7c3fb9b 56 56 * whatever parameters it has, so they can be passed to any param_wrappers 57 57 * within. 58 * @return EOK or an error code from errno.h. */ 58 * @return EOK or an error code from errno.h. 59 */ 59 60 errno_t bithenge_init_transform(bithenge_transform_t *self, 60 61 const bithenge_transform_ops_t *ops, int num_params) … … 82 83 * @param in The input tree. 83 84 * @param[out] out Where the output tree will be stored. 84 * @return EOK on success or an error code from errno.h. */ 85 * @return EOK on success or an error code from errno.h. 86 */ 85 87 errno_t bithenge_transform_apply(bithenge_transform_t *self, 86 88 bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out) … … 118 120 * @param[out] out Where the prefix length will be stored. 119 121 * @return EOK on success, ENOTSUP if not supported, or another error code from 120 * errno.h. */ 122 * errno.h. 123 */ 121 124 errno_t bithenge_transform_prefix_length(bithenge_transform_t *self, 122 125 bithenge_scope_t *scope, bithenge_blob_t *blob, aoff64_t *out) … … 149 152 * case the size is not determined. 150 153 * @return EOK on success, ENOTSUP if not supported, or another error code from 151 * errno.h. */ 154 * errno.h. 155 */ 152 156 errno_t bithenge_transform_prefix_apply(bithenge_transform_t *self, 153 157 bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node, … … 187 191 * @param[out] out Holds the new scope. 188 192 * @param outer The outer scope, or NULL. 189 * @return EOK on success or an error code from errno.h. */ 193 * @return EOK on success or an error code from errno.h. 194 */ 190 195 errno_t bithenge_scope_new(bithenge_scope_t **out, bithenge_scope_t *outer) 191 196 { … … 209 214 /** Dereference a transform scope. 210 215 * @memberof bithenge_scope_t 211 * @param self The scope to dereference, or NULL. */ 216 * @param self The scope to dereference, or NULL. 217 */ 212 218 void bithenge_scope_dec_ref(bithenge_scope_t *self) 213 219 { … … 228 234 * @memberof bithenge_scope_t 229 235 * @param self The scope to examine. 230 * @return The outer scope, which may be NULL. */ 236 * @return The outer scope, which may be NULL. 237 */ 231 238 bithenge_scope_t *bithenge_scope_outer(bithenge_scope_t *self) 232 239 { … … 238 245 * @memberof bithenge_scope_t 239 246 * @param scope The scope to get the error message from. 240 * @return The error message, or NULL. */ 247 * @return The error message, or NULL. 248 */ 241 249 const char *bithenge_scope_get_error(bithenge_scope_t *scope) 242 250 { … … 250 258 * @param scope The scope. 251 259 * @param format The format string. 252 * @return EINVAL normally, or another error code from errno.h. */ 260 * @return EINVAL normally, or another error code from errno.h. 261 */ 253 262 errno_t bithenge_scope_error(bithenge_scope_t *scope, const char *format, ...) 254 263 { … … 299 308 * @memberof bithenge_scope_t 300 309 * @param scope The scope to get the current node from. 301 * @return The node being created, or NULL. */ 310 * @return The node being created, or NULL. 311 */ 302 312 bithenge_node_t *bithenge_scope_get_current_node(bithenge_scope_t *scope) 303 313 { … … 310 320 * @memberof bithenge_scope_t 311 321 * @param scope The scope to set the current node in. 312 * @param node The current node being created, or NULL. */ 322 * @param node The current node being created, or NULL. 323 */ 313 324 void bithenge_scope_set_current_node(bithenge_scope_t *scope, 314 325 bithenge_node_t *node) … … 321 332 * @memberof bithenge_scope_t 322 333 * @param scope The scope to get the current input node from. 323 * @return The input node, or NULL. */ 334 * @return The input node, or NULL. 335 */ 324 336 bithenge_node_t *bithenge_scope_in_node(bithenge_scope_t *scope) 325 337 { … … 332 344 * @memberof bithenge_scope_t 333 345 * @param scope The scope to set the input node in. 334 * @param node The input node, or NULL. */ 346 * @param node The input node, or NULL. 347 */ 335 348 void bithenge_scope_set_in_node(bithenge_scope_t *scope, bithenge_node_t *node) 336 349 { … … 341 354 /** Set a scope as a barrier. 342 355 * @memberof bithenge_scope_t 343 * @param self The scope to change. */ 356 * @param self The scope to change. 357 */ 344 358 void bithenge_scope_set_barrier(bithenge_scope_t *self) 345 359 { … … 351 365 * @memberof bithenge_scope_t 352 366 * @param self The scope to check. 353 * @return Whether the scope is a barrier. */ 367 * @return Whether the scope is a barrier. 368 */ 354 369 bool bithenge_scope_is_barrier(bithenge_scope_t *self) 355 370 { … … 363 378 * @param scope The scope in which to allocate parameters. 364 379 * @param num_params The number of parameters to allocate. 365 * @return EOK on success or an error code from errno.h. */ 380 * @return EOK on success or an error code from errno.h. 381 */ 366 382 errno_t bithenge_scope_alloc_params(bithenge_scope_t *scope, int num_params) 367 383 { … … 381 397 * @param i The index of the parameter to set. 382 398 * @param node The value to store in the parameter. 383 * @return EOK on success or an error code from errno.h. */ 399 * @return EOK on success or an error code from errno.h. 400 */ 384 401 errno_t bithenge_scope_set_param(bithenge_scope_t *scope, int i, 385 402 bithenge_node_t *node) … … 400 417 * @param i The index of the parameter to set. 401 418 * @param[out] out Stores a new reference to the parameter. 402 * @return EOK on success or an error code from errno.h. */ 419 * @return EOK on success or an error code from errno.h. 420 */ 403 421 errno_t bithenge_scope_get_param(bithenge_scope_t *scope, int i, 404 422 bithenge_node_t **out) … … 502 520 * @param base The barrier transform. 503 521 * @param transform The subtransform to use for all operations. 504 * @return EOK on success or an error code from errno.h. */ 522 * @return EOK on success or an error code from errno.h. 523 */ 505 524 errno_t bithenge_barrier_transform_set_subtransform(bithenge_transform_t *base, 506 525 bithenge_transform_t *transform) … … 526 545 * @param[out] out Holds the created transform. 527 546 * @param num_params The number of parameters to require, which may be 0. 528 * @return EOK on success or an error code from errno.h. */ 547 * @return EOK on success or an error code from errno.h. 548 */ 529 549 errno_t bithenge_new_barrier_transform(bithenge_transform_t **out, int num_params) 530 550 { … … 742 762 743 763 /** A transform that converts a byte blob to a bit blob, most-significant bit 744 * first. */ 764 * first. 765 */ 745 766 bithenge_transform_t bithenge_bits_be_transform = { 746 767 &bits_xe_ops, 1, 0 … … 748 769 749 770 /** A transform that converts a byte blob to a bit blob, least-significant bit 750 * first. */ 771 * first. 772 */ 751 773 bithenge_transform_t bithenge_bits_le_transform = { 752 774 &bits_xe_ops, 1, 0 … … 987 1009 988 1010 /** A transform that reads an unsigned integer from an arbitrary number of 989 * bits, most-significant bit first. */ 1011 * bits, most-significant bit first. 1012 */ 990 1013 bithenge_transform_t bithenge_uint_be_transform = { 991 1014 &uint_xe_ops, 1, 1 … … 993 1016 994 1017 /** A transform that reads an unsigned integer from an arbitrary number of 995 * bits, least-significant bit first. */ 1018 * bits, least-significant bit first. 1019 */ 996 1020 bithenge_transform_t bithenge_uint_le_transform = { 997 1021 &uint_xe_ops, 1, 1
Note:
See TracChangeset
for help on using the changeset viewer.