Esempio n. 1
0
// Cached version of the above dyn_get function.
static ib_status_t dyn_get_cached(
    const ib_field_t *f,
    void *out_value,
    const void *arg,
    size_t alen,
    void *data
)
{
    /* Call the get function */
    const char* cval;
    dyn_get(f, &cval, arg, alen, data);

    /* Cache the value */
    /* Caching does not semantically change value, so we can safely ignore
     * the constness of f. */
    ib_field_make_static((ib_field_t *)f);
    ib_field_setv((ib_field_t *)f, ib_ftype_nulstr_in(cval));

    *reinterpret_cast<const char**>(out_value) = cval;

    return IB_OK;
}
Esempio n. 2
0
void Field::make_static() const
{
    throw_if_error(ib_field_make_static(ib()));
}