Exemple #1
0
/* Add the entry to the hash. */
int _os_report_add_tostore(char *key, OSStore *top, void *data)
{
    OSList *top_list;

    /* Adding data to the hash. */
    top_list = OSStore_Get(top, key);
    if(top_list)
    {
        OSList_AddData(top_list, data);
    }
    else
    {
        top_list = OSList_Create();
        if(!top_list)
        {
            merror(MEM_ERROR, __local_name);
            return(0);
        }
        OSList_AddData(top_list, data);

        OSStore_Put(top, key, top_list);
    }

    return(1);
}
Exemple #2
0
static int addDecoder2list(const char *name)
{
    if (os_decoder_store == NULL) {
        os_decoder_store = OSStore_Create();
        if (os_decoder_store == NULL) {
            merror(LIST_ERROR, ARGV0);
            return (0);
        }
    }

    /* Store data */
    if (!OSStore_Put(os_decoder_store, name, NULL)) {
        merror(LIST_ADD_ERROR, ARGV0);
        return (0);
    }

    return (1);
}
/* Add the entry to the hash */
static int _os_report_add_tostore(const char *key, OSStore *top, void *data)
{
    OSList *top_list;

    /* Add data to the hash */
    top_list = (OSList *) OSStore_Get(top, key);
    if (top_list) {
        OSList_AddData(top_list, data);
    } else {
        top_list = OSList_Create();
        if (!top_list) {
            merror(MEM_ERROR, __local_name, errno, strerror(errno));
            return (0);
        }
        OSList_AddData(top_list, data);

        OSStore_Put(top, key, top_list);
    }

    return (1);
}