Changeset 7c3fb9b in mainline for uspace/lib/bithenge/src


Ignore:
Timestamp:
2018-05-17T08:29:01Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
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)
Message:

Fix block comment formatting (ccheck).

Location:
uspace/lib/bithenge/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/bithenge/src/blob.c

    rfac0ac7 r7c3fb9b  
    239239 * @param needs_free If true, the buffer will be freed with free() if this
    240240 * function fails or the blob is destroyed.
    241  * @return EOK on success or an error code from errno.h. */
     241 * @return EOK on success or an error code from errno.h.
     242 */
    242243errno_t bithenge_new_blob_from_buffer(bithenge_node_t **out, const void *buffer,
    243244    size_t len, bool needs_free)
     
    277278 * @param[in] data The data.
    278279 * @param len The length of the data.
    279  * @return EOK on success or an error code from errno.h. */
     280 * @return EOK on success or an error code from errno.h.
     281 */
    280282errno_t bithenge_new_blob_from_data(bithenge_node_t **out, const void *data,
    281283    size_t len)
     
    435437 * @param[in] source The input blob.
    436438 * @param offset The offset within the input blob at which the new blob will start.
    437  * @return EOK on success or an error code from errno.h. */
     439 * @return EOK on success or an error code from errno.h.
     440 */
    438441errno_t bithenge_new_offset_blob(bithenge_node_t **out, bithenge_blob_t *source,
    439442    aoff64_t offset)
     
    448451 * @param offset The offset within the input blob at which the new blob will start.
    449452 * @param size The size of the new blob.
    450  * @return EOK on success or an error code from errno.h. */
     453 * @return EOK on success or an error code from errno.h.
     454 */
    451455errno_t bithenge_new_subblob(bithenge_node_t **out, bithenge_blob_t *source,
    452456    aoff64_t offset, aoff64_t size)
  • uspace/lib/bithenge/src/compound.c

    rfac0ac7 r7c3fb9b  
    115115 * @param[in] xforms The transforms to apply.
    116116 * @param num The number of transforms.
    117  * @return EOK on success or an error code from errno.h. */
     117 * @return EOK on success or an error code from errno.h.
     118 */
    118119errno_t bithenge_new_composed_transform(bithenge_transform_t **out,
    119120    bithenge_transform_t **xforms, size_t num)
     
    231232 * @param true_xform The transform to apply if the expression is true.
    232233 * @param false_xform The transform to apply if the expression is false.
    233  * @return EOK on success or an error code from errno.h. */
     234 * @return EOK on success or an error code from errno.h.
     235 */
    234236errno_t bithenge_if_transform(bithenge_transform_t **out,
    235237    bithenge_expression_t *expr, bithenge_transform_t *true_xform,
     
    309311 * @param[out] out Holds the new transform.
    310312 * @param xform The subtransform to apply.
    311  * @return EOK on success or an error code from errno.h. */
     313 * @return EOK on success or an error code from errno.h.
     314 */
    312315errno_t bithenge_partial_transform(bithenge_transform_t **out,
    313316    bithenge_transform_t *xform)
  • uspace/lib/bithenge/src/expression.c

    rfac0ac7 r7c3fb9b  
    4747 * @param[out] self Expression to initialize.
    4848 * @param[in] ops Operations provided by the expression.
    49  * @return EOK or an error code from errno.h. */
     49 * @return EOK or an error code from errno.h.
     50 */
    5051errno_t bithenge_init_expression(bithenge_expression_t *self,
    5152    const bithenge_expression_ops_t *ops)
     
    156157                break;
    157158        case BITHENGE_EXPRESSION_INTEGER_DIVIDE:
    158                 /* Integer division can behave in three major ways when the
    159                   operands are signed: truncated, floored, or Euclidean. When
     159                /*
     160                 * Integer division can behave in three major ways when the
     161                 * operands are signed: truncated, floored, or Euclidean. When
    160162                 * b > 0, we give the same result as floored and Euclidean;
    161163                 * otherwise, we currently raise an error. See
    162164                 * https://en.wikipedia.org/wiki/Modulo_operation and its
    163                  * references. */
     165                 * references.
     166                 */
    164167                if (b_int <= 0) {
    165168                        rc = EINVAL;
     
    249252 * @param a The first operand.
    250253 * @param b The second operand.
    251  * @return EOK on success or an error code from errno.h. */
     254 * @return EOK on success or an error code from errno.h.
     255 */
    252256errno_t bithenge_binary_expression(bithenge_expression_t **out,
    253257    bithenge_binary_op_t op, bithenge_expression_t *a,
     
    305309/** Create an expression that gets the current input node.
    306310 * @param[out] out Holds the new expression.
    307  * @return EOK on success or an error code from errno.h. */
     311 * @return EOK on success or an error code from errno.h.
     312 */
    308313errno_t bithenge_in_node_expression(bithenge_expression_t **out)
    309314{
     
    339344/** Create an expression that gets the current node being created.
    340345 * @param[out] out Holds the new expression.
    341  * @return EOK on success or an error code from errno.h. */
     346 * @return EOK on success or an error code from errno.h.
     347 */
    342348errno_t bithenge_current_node_expression(bithenge_expression_t **out)
    343349{
     
    389395 * @param[out] out Holds the created expression.
    390396 * @param index The index of the parameter to get.
    391  * @return EOK on success or an error code from errno.h. */
     397 * @return EOK on success or an error code from errno.h.
     398 */
    392399errno_t bithenge_param_expression(bithenge_expression_t **out, int index)
    393400{
     
    454461 * @param[out] out Holds the created expression.
    455462 * @param node The constant.
    456  * @return EOK on success or an error code from errno.h. */
     463 * @return EOK on success or an error code from errno.h.
     464 */
    457465errno_t bithenge_const_expression(bithenge_expression_t **out,
    458466    bithenge_node_t *node)
     
    536544 * @param[out] out Holds the new expression.
    537545 * @param key The key to search for in nodes being created.
    538  * @return EOK on success or an error code from errno.h. */
     546 * @return EOK on success or an error code from errno.h.
     547 */
    539548errno_t bithenge_scope_member_expression(bithenge_expression_t **out,
    540549    bithenge_node_t *key)
     
    657666 * @param absolute_limit If true, the limit is an absolute offset; otherwise,
    658667 * it is relative to the start.
    659  * @return EOK on success or an error code from errno.h. */
     668 * @return EOK on success or an error code from errno.h.
     669 */
    660670errno_t bithenge_subblob_expression(bithenge_expression_t **out,
    661671    bithenge_expression_t *blob, bithenge_expression_t *start,
     
    815825 * @param transform The transform for which parameters are calculated.
    816826 * @param params The expressions used to calculate the parameters.
    817  * @return EOK on success or an error code from errno.h. */
     827 * @return EOK on success or an error code from errno.h.
     828 */
    818829errno_t bithenge_param_wrapper(bithenge_transform_t **out,
    819830    bithenge_transform_t *transform, bithenge_expression_t **params)
     
    899910 * @param[out] out Holds the new transform.
    900911 * @param expr The expression to evaluate.
    901  * @return EOK on success or an error code from errno.h. */
     912 * @return EOK on success or an error code from errno.h.
     913 */
    902914errno_t bithenge_expression_transform(bithenge_transform_t **out,
    903915    bithenge_expression_t *expr)
     
    956968 * @param[out] out Holds the new transform.
    957969 * @param expr The expression to evaluate.
    958  * @return EOK on success or an error code from errno.h. */
     970 * @return EOK on success or an error code from errno.h.
     971 */
    959972errno_t bithenge_inputless_transform(bithenge_transform_t **out,
    960973    bithenge_expression_t *expr)
     
    11171130 * @param a The first blob.
    11181131 * @param b The second blob.
    1119  * @return EOK on success or an error code from errno.h. */
     1132 * @return EOK on success or an error code from errno.h.
     1133 */
    11201134errno_t bithenge_concat_blob(bithenge_node_t **out, bithenge_blob_t *a,
    11211135    bithenge_blob_t *b)
     
    11591173 * @param b_expr An expression to calculate the second blob.
    11601174 * @param scope The scope in which @a b_expr should be evaluated.
    1161  * @return EOK on success or an error code from errno.h. */
     1175 * @return EOK on success or an error code from errno.h.
     1176 */
    11621177errno_t bithenge_concat_blob_lazy(bithenge_node_t **out, bithenge_blob_t *a,
    11631178    bithenge_expression_t *b_expr, bithenge_scope_t *scope)
  • uspace/lib/bithenge/src/failure.c

    rfac0ac7 r7c3fb9b  
    4747#include "common.h"
    4848
    49 /* This file raises fake errors from system calls, to test that Bithenge
     49/*
     50 * This file raises fake errors from system calls, to test that Bithenge
    5051 * handles the errors correctly. It has two primary modes of operation,
    5152 * depending on an environment variable:
     
    6061 * BITHENGE_FAILURE_INDEX set: the program runs normally until system call
    6162 * number BITHENGE_FAILURE_INDEX is made; a fake error is returned from this
    62  * call. */
     63 * call.
     64 */
    6365
    6466static int g_initialized = 0;
     
    9496}
    9597
    96 /* Record a hit for a backtrace address and return whether this is the first
    97  * hit. */
     98/*
     99 * Record a hit for a backtrace address and return whether this is the first
     100 * hit.
     101 */
    98102static inline errno_t backtrace_item_hit(void *addr)
    99103{
     
    133137        }
    134138
    135         /* If all backtrace items have been seen already, there's no need to
    136          * try raising an error. */
     139        /*
     140         * If all backtrace items have been seen already, there's no need to
     141         * try raising an error.
     142         */
    137143        void *trace[256];
    138144        int size = backtrace(trace, 256);
     
    162168                return 0;
    163169
    164         /* The child had an error! We couldn't easily debug it because it was
     170        /*
     171         * The child had an error! We couldn't easily debug it because it was
    165172         * in a separate process with redirected stdout and stderr. Do it again
    166          * without redirecting or forking. */
     173         * without redirecting or forking.
     174         */
    167175        fprintf(stderr, "** Fake error raised here (BITHENGE_FAILURE_INDEX=%d)\n",
    168176            g_failure_index);
  • uspace/lib/bithenge/src/file.c

    rfac0ac7 r7c3fb9b  
    140140 * @param[out] out Stores the created blob.
    141141 * @param filename The name of the file.
    142  * @return EOK on success or an error code from errno.h. */
     142 * @return EOK on success or an error code from errno.h.
     143 */
    143144errno_t bithenge_new_file_blob(bithenge_node_t **out, const char *filename)
    144145{
     
    157158 * @param[out] out Stores the created blob.
    158159 * @param fd The file descriptor.
    159  * @return EOK on success or an error code from errno.h. */
     160 * @return EOK on success or an error code from errno.h.
     161 */
    160162errno_t bithenge_new_file_blob_from_fd(bithenge_node_t **out, int fd)
    161163{
     
    167169 * @param[out] out Stores the created blob.
    168170 * @param file The file pointer.
    169  * @return EOK on success or an error code from errno.h. */
     171 * @return EOK on success or an error code from errno.h.
     172 */
    170173errno_t bithenge_new_file_blob_from_file(bithenge_node_t **out, FILE *file)
    171174{
  • uspace/lib/bithenge/src/helenos/block.c

    rfac0ac7 r7c3fb9b  
    9595 * @param[out] out Stores the created blob.
    9696 * @param service_id The service ID of the block device.
    97  * @return EOK on success or an error code from errno.h. */
     97 * @return EOK on success or an error code from errno.h.
     98 */
    9899errno_t bithenge_new_block_blob(bithenge_node_t **out, service_id_t service_id)
    99100{
  • uspace/lib/bithenge/src/print.c

    rfac0ac7 r7c3fb9b  
    222222 * @param type The format to use.
    223223 * @param tree The root node of the tree to print.
    224  * @return EOK on success or an error code from errno.h. */
     224 * @return EOK on success or an error code from errno.h.
     225 */
    225226errno_t bithenge_print_node(bithenge_print_type_t type, bithenge_node_t *tree)
    226227{
     
    236237 * @param type The format to use.
    237238 * @param tree The root node of the tree to print.
    238  * @return EOK on success or an error code from errno.h. */
     239 * @return EOK on success or an error code from errno.h.
     240 */
    239241errno_t bithenge_print_node_to_string(char **str, size_t *size,
    240242    bithenge_print_type_t type, bithenge_node_t *tree)
  • uspace/lib/bithenge/src/script.c

    rfac0ac7 r7c3fb9b  
    5555/** @cond internal
    5656 * Single-character symbols are represented by the character itself. Every
    57  * other token uses one of these values: */
     57 * other token uses one of these values:
     58 */
    5859typedef enum {
    5960        TOKEN_ERROR = -128,
     
    9899typedef struct {
    99100        /** Rather than constantly checking return values, the parser uses this
    100          * to indicate whether an error has occurred. */
     101         * to indicate whether an error has occurred.
     102         */
    101103        errno_t error;
    102104
     
    109111        FILE *file;
    110112        /** The buffer that holds script code. There is always a '\0' after the
    111          * current position to prevent reading too far. */
     113         * current position to prevent reading too far.
     114         */
    112115        char buffer[BUFFER_SIZE];
    113116        /** The start position within the buffer of the next unread token. */
     
    124127        union {
    125128                /** The value of a TOKEN_IDENTIFIER token. Unless changed to
    126                  * NULL, it will be freed when the next token is read. */
     129                 * NULL, it will be freed when the next token is read.
     130                 */
    127131                char *token_string;
    128132                /** The value of a TOKEN_INTEGER token. */
     
    139143
    140144/** Free the previous token's data. This must be called before changing
    141  * state->token. */
     145 * state->token.
     146 */
    142147static void done_with_token(state_t *state)
    143148{
     
    346351/** Allocate memory and handle failure by setting the error in the state. The
    347352 * caller must check the state for errors before using the return value of this
    348  * function. */
     353 * function.
     354 */
    349355static void *state_malloc(state_t *state, size_t size)
    350356{
     
    358364
    359365/** Reallocate memory and handle failure by setting the error in the state. If
    360  * an error occurs, the existing pointer will be returned. */
     366 * an error occurs, the existing pointer will be returned.
     367 */
    361368static void *state_realloc(state_t *state, void *ptr, size_t size)
    362369{
     
    372379
    373380/** Expect and consume a certain token. If the next token is of the wrong type,
    374  * an error is caused. */
     381 * an error is caused.
     382 */
    375383static void expect(state_t *state, token_type_t type)
    376384{
     
    383391
    384392/** Expect and consume an identifier token. If the next token is not an
    385  * identifier, an error is caused and this function returns null. */
     393 * identifier, an error is caused and this function returns null.
     394 */
    386395static char *expect_identifier(state_t *state)
    387396{
     
    397406
    398407/** Find a transform by name. A reference will be added to the transform.
    399  * @return The found transform, or NULL if none was found. */
     408 * @return The found transform, or NULL if none was found.
     409 */
    400410static bithenge_transform_t *get_named_transform(state_t *state,
    401411    const char *name)
     
    419429
    420430/** Add a named transform. This function takes ownership of the name and a
    421  * reference to the transform. If an error has occurred, either may be null. */
     431 * reference to the transform. If an error has occurred, either may be null.
     432 */
    422433static void add_named_transform(state_t *state, bithenge_transform_t *xform, char *name)
    423434{
     
    809820/** Create a transform that just produces an empty node.
    810821 * @param state The parser state.
    811  * @return The new transform, or NULL on error. */
     822 * @return The new transform, or NULL on error.
     823 */
    812824static bithenge_transform_t *make_empty_transform(state_t *state)
    813825{
     
    11391151
    11401152/** Parse a transform without composition.
    1141  * @return The parsed transform, or NULL if an error occurred. */
     1153 * @return The parsed transform, or NULL if an error occurred.
     1154 */
    11421155static bithenge_transform_t *parse_transform_no_compose(state_t *state)
    11431156{
     
    11881201
    11891202/** Parse a transform.
    1190  * @return The parsed transform, or NULL if an error occurred. */
     1203 * @return The parsed transform, or NULL if an error occurred.
     1204 */
    11911205static bithenge_transform_t *parse_transform(state_t *state)
    11921206{
     
    13201334 * @param[out] out Stores the "main" transform.
    13211335 * @return EOK on success, EINVAL on syntax error, or an error code from
    1322  * errno.h. */
     1336 * errno.h.
     1337 */
    13231338errno_t bithenge_parse_script(const char *filename, bithenge_transform_t **out)
    13241339{
  • uspace/lib/bithenge/src/sequence.c

    rfac0ac7 r7c3fb9b  
    150150
    151151        if (index == self->num_ends) {
    152                 /* We can apply the subtransform and cache its prefix length at
    153                  * the same time. */
     152                /*
     153                 * We can apply the subtransform and cache its prefix length at
     154                 * the same time.
     155                 */
    154156                bithenge_node_t *blob_node;
    155157                bithenge_blob_inc_ref(self->blob);
     
    418420        struct_node_t *node = node_as_struct(base);
    419421
    420         /* Treat the scope carefully because of the circular reference. In
     422        /*
     423         * Treat the scope carefully because of the circular reference. In
    421424         * struct_transform_make_node, things are set up so node owns a
    422425         * reference to the scope, but scope doesn't own a reference to node,
    423          * so node's reference count is too low. */
     426         * so node's reference count is too low.
     427         */
    424428        bithenge_scope_t *scope = seq_node_scope(struct_as_seq(node));
    425429        if (scope->refs == 1) {
    426                 /* Mostly normal destroy, but we didn't inc_ref(node) for the
     430                /*
     431                 * Mostly normal destroy, but we didn't inc_ref(node) for the
    427432                 * scope in struct_transform_make_node, so make sure it doesn't
    428                  * try to dec_ref. */
     433                 * try to dec_ref.
     434                 */
    429435                scope->current_node = NULL;
    430436                seq_node_destroy(struct_as_seq(node));
    431437        } else if (scope->refs > 1) {
    432                 /* The scope is still needed, but node isn't otherwise needed.
     438                /*
     439                 * The scope is still needed, but node isn't otherwise needed.
    433440                 * Switch things around so scope owns a reference to node, but
    434                  * not vice versa, and scope's reference count is too low. */
     441                 * not vice versa, and scope's reference count is too low.
     442                 */
    435443                bithenge_node_inc_ref(base);
    436444                bithenge_scope_dec_ref(scope);
    437445                return;
    438446        } else {
    439                 /* This happens after the previous case, when scope is no
     447                /*
     448                 * This happens after the previous case, when scope is no
    440449                 * longer used and is being destroyed. Since scope is already
    441450                 * being destroyed, set it to NULL here so we don't try to
    442                  * destroy it twice. */
     451                 * destroy it twice.
     452                 */
    443453                struct_as_seq(node)->scope = NULL;
    444454                seq_node_destroy(struct_as_seq(node));
     
    501511        node->prefix = prefix;
    502512
    503         /* We should inc_ref(node) here, but that would make a cycle. Instead,
     513        /*
     514         * We should inc_ref(node) here, but that would make a cycle. Instead,
    504515         * we leave it 1 too low, so that when the only remaining use of node
    505516         * is the scope, node will be destroyed. Also see the comment in
    506          * struct_node_destroy. */
     517         * struct_node_destroy.
     518         */
    507519        bithenge_scope_set_current_node(inner, struct_as_node(node));
    508520        bithenge_scope_dec_ref(inner);
     
    591603 * @param[out] out Stores the created transform.
    592604 * @param subtransforms The subtransforms and field names.
    593  * @return EOK on success or an error code from errno.h. */
     605 * @return EOK on success or an error code from errno.h.
     606 */
    594607errno_t bithenge_new_struct(bithenge_transform_t **out,
    595608    bithenge_named_transform_t *subtransforms)
     
    869882 * @param expr Used to calculate the number of times @a xform will be applied.
    870883 * May be NULL, in which case @a xform will be applied indefinitely.
    871  * @return EOK on success or an error code from errno.h. */
     884 * @return EOK on success or an error code from errno.h.
     885 */
    872886errno_t bithenge_repeat_transform(bithenge_transform_t **out,
    873887    bithenge_transform_t *xform, bithenge_expression_t *expr)
     
    11141128 * @param expr Applied in the result of each application of @a xform to
    11151129 * determine whether there will be more.
    1116  * @return EOK on success or an error code from errno.h. */
     1130 * @return EOK on success or an error code from errno.h.
     1131 */
    11171132errno_t bithenge_do_while_transform(bithenge_transform_t **out,
    11181133    bithenge_transform_t *xform, bithenge_expression_t *expr)
  • uspace/lib/bithenge/src/source.c

    rfac0ac7 r7c3fb9b  
    8484 * @param[out] out Stores the created node.
    8585 * @param source Specifies the node to be created.
    86  * @return EOK on success or an error code from errno.h. */
     86 * @return EOK on success or an error code from errno.h.
     87 */
    8788errno_t bithenge_node_from_source(bithenge_node_t **out, const char *source)
    8889{
  • uspace/lib/bithenge/src/transform.c

    rfac0ac7 r7c3fb9b  
    5656 * whatever parameters it has, so they can be passed to any param_wrappers
    5757 * within.
    58  * @return EOK or an error code from errno.h. */
     58 * @return EOK or an error code from errno.h.
     59 */
    5960errno_t bithenge_init_transform(bithenge_transform_t *self,
    6061    const bithenge_transform_ops_t *ops, int num_params)
     
    8283 * @param in The input tree.
    8384 * @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 */
    8587errno_t bithenge_transform_apply(bithenge_transform_t *self,
    8688    bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
     
    118120 * @param[out] out Where the prefix length will be stored.
    119121 * @return EOK on success, ENOTSUP if not supported, or another error code from
    120  * errno.h. */
     122 * errno.h.
     123 */
    121124errno_t bithenge_transform_prefix_length(bithenge_transform_t *self,
    122125    bithenge_scope_t *scope, bithenge_blob_t *blob, aoff64_t *out)
     
    149152 * case the size is not determined.
    150153 * @return EOK on success, ENOTSUP if not supported, or another error code from
    151  * errno.h. */
     154 * errno.h.
     155 */
    152156errno_t bithenge_transform_prefix_apply(bithenge_transform_t *self,
    153157    bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     
    187191 * @param[out] out Holds the new scope.
    188192 * @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 */
    190195errno_t bithenge_scope_new(bithenge_scope_t **out, bithenge_scope_t *outer)
    191196{
     
    209214/** Dereference a transform scope.
    210215 * @memberof bithenge_scope_t
    211  * @param self The scope to dereference, or NULL. */
     216 * @param self The scope to dereference, or NULL.
     217 */
    212218void bithenge_scope_dec_ref(bithenge_scope_t *self)
    213219{
     
    228234 * @memberof bithenge_scope_t
    229235 * @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 */
    231238bithenge_scope_t *bithenge_scope_outer(bithenge_scope_t *self)
    232239{
     
    238245 * @memberof bithenge_scope_t
    239246 * @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 */
    241249const char *bithenge_scope_get_error(bithenge_scope_t *scope)
    242250{
     
    250258 * @param scope The scope.
    251259 * @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 */
    253262errno_t bithenge_scope_error(bithenge_scope_t *scope, const char *format, ...)
    254263{
     
    299308 * @memberof bithenge_scope_t
    300309 * @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 */
    302312bithenge_node_t *bithenge_scope_get_current_node(bithenge_scope_t *scope)
    303313{
     
    310320 * @memberof bithenge_scope_t
    311321 * @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 */
    313324void bithenge_scope_set_current_node(bithenge_scope_t *scope,
    314325    bithenge_node_t *node)
     
    321332 * @memberof bithenge_scope_t
    322333 * @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 */
    324336bithenge_node_t *bithenge_scope_in_node(bithenge_scope_t *scope)
    325337{
     
    332344 * @memberof bithenge_scope_t
    333345 * @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 */
    335348void bithenge_scope_set_in_node(bithenge_scope_t *scope, bithenge_node_t *node)
    336349{
     
    341354/** Set a scope as a barrier.
    342355 * @memberof bithenge_scope_t
    343  * @param self The scope to change. */
     356 * @param self The scope to change.
     357 */
    344358void bithenge_scope_set_barrier(bithenge_scope_t *self)
    345359{
     
    351365 * @memberof bithenge_scope_t
    352366 * @param self The scope to check.
    353  * @return Whether the scope is a barrier. */
     367 * @return Whether the scope is a barrier.
     368 */
    354369bool bithenge_scope_is_barrier(bithenge_scope_t *self)
    355370{
     
    363378 * @param scope The scope in which to allocate parameters.
    364379 * @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 */
    366382errno_t bithenge_scope_alloc_params(bithenge_scope_t *scope, int num_params)
    367383{
     
    381397 * @param i The index of the parameter to set.
    382398 * @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 */
    384401errno_t bithenge_scope_set_param(bithenge_scope_t *scope, int i,
    385402    bithenge_node_t *node)
     
    400417 * @param i The index of the parameter to set.
    401418 * @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 */
    403421errno_t bithenge_scope_get_param(bithenge_scope_t *scope, int i,
    404422    bithenge_node_t **out)
     
    502520 * @param base The barrier transform.
    503521 * @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 */
    505524errno_t bithenge_barrier_transform_set_subtransform(bithenge_transform_t *base,
    506525    bithenge_transform_t *transform)
     
    526545 * @param[out] out Holds the created transform.
    527546 * @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 */
    529549errno_t bithenge_new_barrier_transform(bithenge_transform_t **out, int num_params)
    530550{
     
    742762
    743763/** A transform that converts a byte blob to a bit blob, most-significant bit
    744  * first. */
     764 * first.
     765 */
    745766bithenge_transform_t bithenge_bits_be_transform = {
    746767        &bits_xe_ops, 1, 0
     
    748769
    749770/** A transform that converts a byte blob to a bit blob, least-significant bit
    750  * first. */
     771 * first.
     772 */
    751773bithenge_transform_t bithenge_bits_le_transform = {
    752774        &bits_xe_ops, 1, 0
     
    9871009
    9881010/** 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 */
    9901013bithenge_transform_t bithenge_uint_be_transform = {
    9911014        &uint_xe_ops, 1, 1
     
    9931016
    9941017/** 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 */
    9961020bithenge_transform_t bithenge_uint_le_transform = {
    9971021        &uint_xe_ops, 1, 1
  • uspace/lib/bithenge/src/tree.c

    rfac0ac7 r7c3fb9b  
    7171/** Decrement a node's reference count and free it if appropriate.
    7272 * @memberof bithenge_node_t
    73  * @param node The node to dereference, or NULL. */
     73 * @param node The node to dereference, or NULL.
     74 */
    7475void bithenge_node_dec_ref(bithenge_node_t *node)
    7576{
     
    112113 * @param[out] out Holds the found node.
    113114 * @return EOK on success, ENOENT if not found, or another error code from
    114  * errno.h. */
     115 * errno.h.
     116 */
    115117errno_t bithenge_node_get(bithenge_node_t *self, bithenge_node_t *key,
    116118    bithenge_node_t **out)
     
    154156 * @param[out] self The node.
    155157 * @param[in] ops The operations provided.
    156  * @return EOK on success or an error code from errno.h. */
     158 * @return EOK on success or an error code from errno.h.
     159 */
    157160errno_t bithenge_init_internal_node(bithenge_node_t *self,
    158161    const bithenge_internal_node_ops_t *ops)
     
    195198/** Create an empty internal node.
    196199 * @param[out] out Holds the created node.
    197  * @return EOK on success or an error code from errno.h. */
     200 * @return EOK on success or an error code from errno.h.
     201 */
    198202errno_t bithenge_new_empty_internal_node(bithenge_node_t **out)
    199203{
     
    262266 * @param needs_free If true, when the internal node is destroyed it will free
    263267 * the nodes array rather than just dereferencing each node inside it.
    264  * @return EOK on success or an error code from errno.h. */
     268 * @return EOK on success or an error code from errno.h.
     269 */
    265270errno_t bithenge_new_simple_internal_node(bithenge_node_t **out,
    266271    bithenge_node_t **nodes, bithenge_int_t len, bool needs_free)
     
    298303 * @param[out] out Stores the created boolean node.
    299304 * @param value The value for the node to hold.
    300  * @return EOK on success or an error code from errno.h. */
     305 * @return EOK on success or an error code from errno.h.
     306 */
    301307errno_t bithenge_new_boolean_node(bithenge_node_t **out, bool value)
    302308{
     
    313319 * @param[out] out Stores the created integer node.
    314320 * @param value The value for the node to hold.
    315  * @return EOK on success or an error code from errno.h. */
     321 * @return EOK on success or an error code from errno.h.
     322 */
    316323errno_t bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
    317324{
     
    333340 * @param needs_free Whether the string should be freed when the node is
    334341 * destroyed.
    335  * @return EOK on success or an error code from errno.h. */
     342 * @return EOK on success or an error code from errno.h.
     343 */
    336344errno_t bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
    337345{
     
    357365 * @param a, b Nodes to compare.
    358366 * @return EOK on success or an error code from errno.h.
    359  * @todo Add support for internal nodes. */
     367 * @todo Add support for internal nodes.
     368 */
    360369errno_t bithenge_node_equal(bool *out, bithenge_node_t *a, bithenge_node_t *b)
    361370{
Note: See TracChangeset for help on using the changeset viewer.