Esempio n. 1
0
void rpmhookRegister(const char *name, rpmhookFunc func, void *data)
	/*@globals globalTable @*/
	/*@modifies globalTable @*/
{
    if (globalTable == NULL)
	globalTable = rpmhookTableNew(RPMHOOK_TABLE_INITSIZE);
    rpmhookTableAddItem(&globalTable, name, func, data);
}
Esempio n. 2
0
File: rpmhook.c Progetto: xrg/RPM
static void rpmhookTableRehash(rpmhookTable *table)
{
    rpmhookTable newtable = rpmhookTableNew((*table)->size*2);
    int n, i = 0;

    for (; i != (*table)->size; i++) {
	if ((*table)->bucket[i].name == NULL)
	    continue;
	n = rpmhookTableFindBucket(&newtable, (*table)->bucket[i].name);
	newtable->bucket[n].name = (*table)->bucket[i].name;
	newtable->bucket[n].item = (*table)->bucket[i].item;
    }
    newtable->used = (*table)->used;
    free(*table);
    *table = newtable;
}
Esempio n. 3
0
static void rpmhookTableRehash(rpmhookTable *table)
	/*@modifies *table @*/
{
    rpmhookTable newtable = rpmhookTableNew((*table)->size*2);
    int n, i = 0;

    for (; i != (*table)->size; i++) {
	if ((*table)->bucket[i].name == NULL)
	    continue;
	n = rpmhookTableFindBucket(&newtable, (*table)->bucket[i].name);
	newtable->bucket[n].name = (*table)->bucket[i].name;
	newtable->bucket[n].item = (*table)->bucket[i].item;
    }
    newtable->used = (*table)->used;
/*@-unqualifiedtrans@*/
    free(*table);
/*@=unqualifiedtrans@*/
    *table = newtable;
}