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

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

store objects in this set

Definition at line 240 of file storage.c.

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

    st_driver_t drv;
    st_ret_t ret;

    log_debug(ZONE, "storage_put: type=%s owner=%s os=%X", type, owner, os);

    /* 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->put)(drv, type, owner, os);

Generated by  Doxygen 1.6.0   Back to index