Logo Search packages:      
Sourcecode: jabberd2 version File versions  Download package

void os_object_iter_get ( os_object_t  o,
char **  key,
void **  val,
os_type_t type 
)

extract field values from field currently under the iterator

Definition at line 292 of file object.c.

References os_object_st::hash, os_type_BOOLEAN, os_type_INTEGER, os_type_NAD, os_type_STRING, xhashv::osf_val, os_field_st::type, os_field_st::val, and xhashv::val.

                                                                                {
    os_field_t osf;
    union xhashv xhv;

    xhv.osf_val = &osf;
    xhash_iter_get(o->hash, (const char **) key, xhv.val);

    if(*key == NULL) {
        *val = NULL;
        return;
    }

    *type = osf->type;

    switch(osf->type) {
        case os_type_BOOLEAN:
        case os_type_INTEGER:
            * (int *) val = * (int *) osf->val;
            break;

        case os_type_STRING:
        case os_type_NAD:
            *val = osf->val;
            break;

        default:
            *val = NULL;
    }
    
    log_debug(ZONE, "got iter field %s (val %x type %d) to object", *key, *val, *type);
}


Generated by  Doxygen 1.6.0   Back to index