Ignore:
File:
1 edited

Legend:

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

    r6cd10ac rb7fd2a0  
    8686} get_for_each_data_t;
    8787
    88 static int get_for_each_func(bithenge_node_t *key, bithenge_node_t *value,
     88static errno_t get_for_each_func(bithenge_node_t *key, bithenge_node_t *value,
    8989    void *raw_data)
    9090{
    9191        get_for_each_data_t *data = (get_for_each_data_t *)raw_data;
    9292        bool equal;
    93         int rc = bithenge_node_equal(&equal, key, data->key);
     93        errno_t rc = bithenge_node_equal(&equal, key, data->key);
    9494        bithenge_node_dec_ref(key);
    9595        if (rc != EOK)
     
    113113 * @return EOK on success, ENOENT if not found, or another error code from
    114114 * errno.h. */
    115 int bithenge_node_get(bithenge_node_t *self, bithenge_node_t *key,
     115errno_t bithenge_node_get(bithenge_node_t *self, bithenge_node_t *key,
    116116    bithenge_node_t **out)
    117117{
     
    125125                uint8_t byte;
    126126                aoff64_t size = 1;
    127                 int rc = bithenge_blob_read(bithenge_node_as_blob(self),
     127                errno_t rc = bithenge_blob_read(bithenge_node_as_blob(self),
    128128                    offset, (char *)&byte, &size);
    129129                if (rc != EOK)
     
    140140        *out = NULL;
    141141        get_for_each_data_t data = {key, out};
    142         int rc = bithenge_node_for_each(self, get_for_each_func, &data);
     142        errno_t rc = bithenge_node_for_each(self, get_for_each_func, &data);
    143143        bithenge_node_dec_ref(key);
    144144        if (rc == EEXIST && *out)
     
    155155 * @param[in] ops The operations provided.
    156156 * @return EOK on success or an error code from errno.h. */
    157 int bithenge_init_internal_node(bithenge_node_t *self,
     157errno_t bithenge_init_internal_node(bithenge_node_t *self,
    158158    const bithenge_internal_node_ops_t *ops)
    159159{
     
    169169}
    170170
    171 static int empty_internal_node_for_each(bithenge_node_t *base,
     171static errno_t empty_internal_node_for_each(bithenge_node_t *base,
    172172    bithenge_for_each_func_t func, void *data)
    173173{
     
    175175}
    176176
    177 static int empty_internal_node_get(bithenge_node_t *self, bithenge_node_t *key,
     177static errno_t empty_internal_node_get(bithenge_node_t *self, bithenge_node_t *key,
    178178    bithenge_node_t **out)
    179179{
     
    196196 * @param[out] out Holds the created node.
    197197 * @return EOK on success or an error code from errno.h. */
    198 int bithenge_new_empty_internal_node(bithenge_node_t **out)
     198errno_t bithenge_new_empty_internal_node(bithenge_node_t **out)
    199199{
    200200        if (bithenge_should_fail())
     
    223223}
    224224
    225 static int simple_internal_node_for_each(bithenge_node_t *base,
     225static errno_t simple_internal_node_for_each(bithenge_node_t *base,
    226226    bithenge_for_each_func_t func, void *data)
    227227{
    228         int rc;
     228        errno_t rc;
    229229        simple_internal_node_t *self = node_as_simple(base);
    230230        for (bithenge_int_t i = 0; i < self->len; i++) {
     
    264264 * the nodes array rather than just dereferencing each node inside it.
    265265 * @return EOK on success or an error code from errno.h. */
    266 int bithenge_new_simple_internal_node(bithenge_node_t **out,
     266errno_t bithenge_new_simple_internal_node(bithenge_node_t **out,
    267267    bithenge_node_t **nodes, bithenge_int_t len, bool needs_free)
    268268{
    269         int rc;
     269        errno_t rc;
    270270        assert(out);
    271271        simple_internal_node_t *self = malloc(sizeof(*self));
     
    300300 * @param value The value for the node to hold.
    301301 * @return EOK on success or an error code from errno.h. */
    302 int bithenge_new_boolean_node(bithenge_node_t **out, bool value)
     302errno_t bithenge_new_boolean_node(bithenge_node_t **out, bool value)
    303303{
    304304        assert(out);
     
    315315 * @param value The value for the node to hold.
    316316 * @return EOK on success or an error code from errno.h. */
    317 int bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
     317errno_t bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
    318318{
    319319        assert(out);
     
    335335 * destroyed.
    336336 * @return EOK on success or an error code from errno.h. */
    337 int bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
     337errno_t bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
    338338{
    339339        assert(out);
     
    359359 * @return EOK on success or an error code from errno.h.
    360360 * @todo Add support for internal nodes. */
    361 int bithenge_node_equal(bool *out, bithenge_node_t *a, bithenge_node_t *b)
     361errno_t bithenge_node_equal(bool *out, bithenge_node_t *a, bithenge_node_t *b)
    362362{
    363363        if (a->type != b->type) {
Note: See TracChangeset for help on using the changeset viewer.