Changeset 03cad47 in mainline for uspace/app/bithenge/transform.c


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

Bithenge: make num_params more dynamic

File:
1 edited

Legend:

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

    r6e34bd0 r03cad47  
    4444 * @param[out] self Transform to initialize.
    4545 * @param[in] ops Operations provided by the transform.
     46 * @param num_params The number of parameters required. If this is nonzero, the
     47 * transform will get its own context with parameters, probably provided by a
     48 * param_wrapper. If this is zero, the existing outer context will be used with
     49 * whatever parameters it has.
    4650 * @return EOK or an error code from errno.h. */
    4751int bithenge_init_transform(bithenge_transform_t *self,
    48     const bithenge_transform_ops_t *ops)
     52    const bithenge_transform_ops_t *ops, int num_params)
    4953{
    5054        assert(ops);
     
    5357        self->ops = ops;
    5458        self->refs = 1;
     59        self->num_params = num_params;
    5560        return EOK;
    5661}
     
    99104/** The ASCII text transform. */
    100105bithenge_transform_t bithenge_ascii_transform = {
    101         &ascii_ops, 1
     106        &ascii_ops, 1, 0
    102107};
    103108
     
    159164                                                                               \
    160165        bithenge_transform_t bithenge_##NAME##_transform = {                   \
    161                 &NAME##_ops, 1                                                 \
     166                &NAME##_ops, 1, 0                                              \
    162167        }
    163168
     
    222227/** The zero-terminated data transform. */
    223228bithenge_transform_t bithenge_zero_terminated_transform = {
    224         &zero_terminated_ops, 1
     229        &zero_terminated_ops, 1, 0
    225230};
    226231
     
    480485        }
    481486        rc = bithenge_init_transform(struct_as_transform(self),
    482             &struct_transform_ops);
     487            &struct_transform_ops, 0);
    483488        if (rc != EOK)
    484489                goto error;
     
    579584        }
    580585        rc = bithenge_init_transform(compose_as_transform(self),
    581             &compose_transform_ops);
     586            &compose_transform_ops, 0);
    582587        if (rc != EOK)
    583588                goto error;
Note: See TracChangeset for help on using the changeset viewer.