Changeset 32eb01b in mainline for uspace/app/bithenge/transform.h


Ignore:
Timestamp:
2012-07-28T04:19:00Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f85ca3f
Parents:
4056ad0
Message:

Bithenge: allow defining transforms with parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bithenge/transform.h

    r4056ad0 r32eb01b  
    8888}
    8989
     90/** Copy a scope.
     91 * @param[out] out The scope to fill in; must have been initialized with @a
     92 * bithenge_scope_init.
     93 * @param scope The scope to copy.
     94 * @return EOK on success or an error code from errno.h. */
     95static inline int bithenge_scope_copy(bithenge_scope_t *out,
     96    bithenge_scope_t *scope)
     97{
     98        out->params = malloc(sizeof(*out->params) * scope->num_params);
     99        if (!out->params)
     100                return ENOMEM;
     101        memcpy(out->params, scope->params, sizeof(*out->params) *
     102            scope->num_params);
     103        out->num_params = scope->num_params;
     104        for (int i = 0; i < out->num_params; i++)
     105                bithenge_node_inc_ref(out->params[i]);
     106        return EOK;
     107}
     108
    90109/** Allocate parameters. The parameters must then be set with @a
    91110 * bithenge_scope_set_param.
Note: See TracChangeset for help on using the changeset viewer.