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

os_object_t os_object_new ( os_t  os  ) 

create a new object in this set

Definition at line 82 of file object.c.

References os_st::count, os_object_st::hash, os_st::head, os_object_st::next, os_object_st::os, os_st::p, os_object_st::prev, and os_st::tail.

Referenced by _privacy_in_sess(), and _template_roster_save_item().

                                   {
    os_object_t o;

    log_debug(ZONE, "creating new object");

    o = (os_object_t) pmalloco(os->p, sizeof(struct os_object_st));
    o->os = os;

    o->hash = xhash_new(51);

    /* make sure that the hash gets freed when the os pool gets freed */
    pool_cleanup(os->p, (pool_cleaner) pool_free, (void *) xhash_pool(o->hash));

    /* insert at the end, we have to preserve order */
    o->prev = os->tail;
    if(os->tail != NULL) os->tail->next = o;
    os->tail = o;
    if(os->head == NULL) os->head = o;
    
    os->count++;

    return o;
}


Generated by  Doxygen 1.6.0   Back to index