Ejemplo 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);
}
Ejemplo n.º 2
0
Archivo: rpmhook.c Proyecto: 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;
}
Ejemplo 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;
}