Fork us on GitHub Follow us on Facebook Follow us on Twitter

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


Ignore:
Timestamp:
2012-07-28T04:19:00Z (10 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial
Children:
f85ca3f
Parents:
4056ad0
Message:

Bithenge: allow defining transforms with parameters

File:
1 edited

Legend:

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

    r4056ad0 r32eb01b  
    385385        bithenge_node_t base;
    386386        struct struct_transform *transform;
    387         bithenge_scope_t *scope;
     387        bithenge_scope_t scope;
    388388        bithenge_blob_t *blob;
    389389} struct_node_t;
     
    491491        for (size_t i = 0; subxforms[i].transform; i++) {
    492492                rc = struct_node_for_one(subxforms[i].name,
    493                     subxforms[i].transform, struct_node->scope, &blob, func,
     493                    subxforms[i].transform, &struct_node->scope, &blob, func,
    494494                    data);
    495495                if (rc != EOK)
     
    516516        bithenge_transform_dec_ref(struct_as_transform(node->transform));
    517517        bithenge_blob_dec_ref(node->blob);
     518        bithenge_scope_destroy(&node->scope);
    518519        free(node);
    519520}
     
    533534        if (!node)
    534535                return ENOMEM;
    535         int rc = bithenge_init_internal_node(struct_as_node(node),
     536        bithenge_scope_init(&node->scope);
     537        int rc = bithenge_scope_copy(&node->scope, scope);
     538        if (rc != EOK) {
     539                free(node);
     540                return rc;
     541        }
     542        rc = bithenge_init_internal_node(struct_as_node(node),
    536543            &struct_node_ops);
    537544        if (rc != EOK) {
     545                bithenge_scope_destroy(&node->scope);
    538546                free(node);
    539547                return rc;
     
    542550        node->transform = self;
    543551        bithenge_node_inc_ref(in);
    544         node->scope = scope;
    545552        node->blob = bithenge_node_as_blob(in);
    546553        *out = struct_as_node(node);
Note: See TracChangeset for help on using the changeset viewer.