Changeset 8375d0eb in mainline for uspace/app/bithenge/tree.c


Ignore:
Timestamp:
2012-06-08T07:02:55Z (13 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8b36bf2
Parents:
5c925ce
Message:

Bithenge: add Doxygen comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bithenge/tree.c

    r5c925ce r8375d0eb  
    4747}
    4848
     49/** Destroy a node.
     50 * @memberof bithenge_node_t
     51 * @param node The node to destroy.
     52 * @return EOK on success or an error code from errno.h. */
    4953int bithenge_node_destroy(bithenge_node_t *node)
    5054{
     
    6165                return EOK; // the boolean nodes are allocated statically below
    6266        case BITHENGE_NODE_INTEGER: /* pass-through */
    63         case BITHENGE_NODE_NONE:
    6467                break;
    6568        }
     
    8184}
    8285
    83 static int simple_internal_node_for_each(bithenge_node_t *base, bithenge_for_each_func_t func, void *data)
     86static int simple_internal_node_for_each(bithenge_node_t *base,
     87    bithenge_for_each_func_t func, void *data)
    8488{
    8589        int rc;
     
    121125}
    122126
    123 int bithenge_new_simple_internal_node(bithenge_node_t **out, bithenge_node_t **nodes, bithenge_int_t len, bool needs_free)
     127/** Create an internal node from a set of keys and values. The node must be
     128 * freed with @a bithenge_node_t::bithenge_node_destroy after it is used, which
     129 * will also destroy all the key and value nodes.
     130 * @memberof bithenge_node_t
     131 * @param[out] out Stores the created internal node.
     132 * @param nodes The array of key-value pairs. Keys are stored at even indices
     133 * and values are stored at odd indices.
     134 * @param len The number of key-value pairs in the node array.
     135 * @param needs_free If true, when the internal node is destroyed it will free
     136 * the nodes array as well as destroying each node inside it.
     137 * @return EOK on success or an error code from errno.h. */
     138int bithenge_new_simple_internal_node(bithenge_node_t **out,
     139    bithenge_node_t **nodes, bithenge_int_t len, bool needs_free)
    124140{
    125141        assert(out);
     
    139155static bithenge_node_t true_node = { BITHENGE_NODE_BOOLEAN, .boolean_value = true };
    140156
     157/** Create a boolean node. The node must be freed with @a
     158 * bithenge_node_t::bithenge_node_destroy after it is used.
     159 * @memberof bithenge_node_t
     160 * @param[out] out Stores the created boolean node.
     161 * @param value The value for the node to hold.
     162 * @return EOK on success or an error code from errno.h. */
    141163int bithenge_new_boolean_node(bithenge_node_t **out, bool value)
    142164{
     
    146168}
    147169
     170/** Create an integer node. The node must be freed with @a
     171 * bithenge_node_t::bithenge_node_destroy after it is used.
     172 * @memberof bithenge_node_t
     173 * @param[out] out Stores the created integer node.
     174 * @param value The value for the node to hold.
     175 * @return EOK on success or an error code from errno.h. */
    148176int bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
    149177{
     
    158186}
    159187
     188/** Create a string node. The node must be freed with @a
     189 * bithenge_node_t::bithenge_node_destroy after it is used.
     190 * @memberof bithenge_node_t
     191 * @param[out] out Stores the created string node.
     192 * @param value The value for the node to hold.
     193 * @param needs_free Whether the string should be freed when the node is
     194 * destroyed.
     195 * @return EOK on success or an error code from errno.h. */
    160196int bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
    161197{
     
    170206        return EOK;
    171207}
     208
     209/** @}
     210 */
Note: See TracChangeset for help on using the changeset viewer.