Changeset 0191bd3 in mainline for uspace/app/bithenge/expression.c


Ignore:
Timestamp:
2012-08-07T04:30:04Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a8be91a
Parents:
f9c314a5
Message:

Bithenge: keep track of outer scopes and find parameters there

File:
1 edited

Legend:

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

    rf9c314a5 r0191bd3  
    425425        param_wrapper_t *self = transform_as_param_wrapper(base);
    426426        bithenge_scope_t *inner;
    427         int rc = bithenge_scope_new(&inner);
     427        int rc = bithenge_scope_new(&inner, outer);
    428428        if (rc != EOK)
    429429                return rc;
     
    445445        param_wrapper_t *self = transform_as_param_wrapper(base);
    446446        bithenge_scope_t *inner;
    447         int rc = bithenge_scope_new(&inner);
     447        int rc = bithenge_scope_new(&inner, outer);
    448448        if (rc != EOK)
    449449                return rc;
     
    454454        rc = bithenge_transform_prefix_length(self->transform, inner, in, out);
    455455        in = NULL;
     456
     457error:
     458        bithenge_scope_dec_ref(inner);
     459        return rc;
     460}
     461
     462static int param_wrapper_prefix_apply(bithenge_transform_t *base,
     463    bithenge_scope_t *outer, bithenge_blob_t *in, bithenge_node_t **out_node,
     464    aoff64_t *out_length)
     465{
     466        param_wrapper_t *self = transform_as_param_wrapper(base);
     467        bithenge_scope_t *inner;
     468        int rc = bithenge_scope_new(&inner, outer);
     469        if (rc != EOK)
     470                return rc;
     471        rc = param_wrapper_fill_scope(self, inner, outer);
     472        if (rc != EOK)
     473                goto error;
     474
     475        rc = bithenge_transform_prefix_apply(self->transform, inner, in,
     476            out_node, out_length);
    456477
    457478error:
     
    474495        .apply = param_wrapper_apply,
    475496        .prefix_length = param_wrapper_prefix_length,
     497        .prefix_apply = param_wrapper_prefix_apply,
    476498        .destroy = param_wrapper_destroy,
    477499};
Note: See TracChangeset for help on using the changeset viewer.