Пример #1
0
int rdl_accumulator_add (struct rdl_accumulator *a, struct resource *r)
{
    size_t n = rdl_resource_available (r);
    if (n <= 0) {
        VERR (a->rdl->rl, "accumulator_add: Insufficient capacity in resource");
        return (-1);
    }
    return rdl_accumulator_add_n (a, r, n);
}
Пример #2
0
void print_resource (struct resource *r, int pad)
{
    struct resource *c;

    fprintf (stdout, "%*s/%s=%d/%d\n", pad, "", rdl_resource_name (r),
            (int) rdl_resource_available (r),
            (int) rdl_resource_size (r));

    rdl_resource_iterator_reset (r);
    while ((c = rdl_resource_next_child (r))) {
        print_resource (c, pad+1);
        rdl_resource_destroy (c);
    }
}