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

st_ret_t storage_get ( storage_t  st,
const char *  type,
const char *  owner,
const char *  filter,
os_t os 

get objects matching this filter

Definition at line 266 of file storage.c.

References storage_st::default_drv, st_driver_st::get, st_driver_st::name, st_NOTIMPL, st_SUCCESS, storage_add_type(), and storage_st::types.

Referenced by _roster_user_load().

    st_driver_t drv;
    st_ret_t ret;

    log_debug(ZONE, "storage_get: type=%s owner=%s filter=%s", type, owner, filter);

    /* find the handler for this type */
    drv = xhash_get(st->types, type);
    if(drv == NULL) {
        /* never seen it before, so it goes to the default driver */
        drv = st->default_drv;
        if(drv == NULL) {
            log_debug(ZONE, "no driver associated with type, and no default driver");

            return st_NOTIMPL;

        /* register the type */
        ret = storage_add_type(st, drv->name, type);
        if(ret != st_SUCCESS)
            return ret;

    return (drv->get)(drv, type, owner, filter, os);

Generated by  Doxygen 1.6.0   Back to index