Exemplo n.º 1
0
anon_octs_t*
anon_octs_new()
{
    anon_octs_t *a;

    a = (anon_octs_t *) malloc(sizeof(anon_octs_t));
    if (! a) {
        return NULL;
    }
    memset(a, 0, sizeof(anon_octs_t));

    a->hash_table = lh_new(LHASH_HASH_FN(anon_octs_hash),
                           LHASH_COMP_FN(anon_octs_cmp));
    a->state = INIT; /* we're initializing, so we don't want to do
		      * checks on previous state values
		      */

    /* initialize randomness - this might not be the best way to do it */
    while (! RAND_status()) {
        fprintf(stderr, "initializing randomness...");
        char buf;
        buf = rand();
        RAND_seed(&buf, 1);
        fprintf(stderr, "done\n");
    }

    return a;
}
Exemplo n.º 2
0
static int int_table_check(ENGINE_TABLE **t, int create)
	{
	LHASH *lh;
	if(*t) return 1;
	if(!create) return 0;
	if((lh = lh_new(LHASH_HASH_FN(engine_pile_hash),
			LHASH_COMP_FN(engine_pile_cmp))) == NULL)
		return 0;
	*t = (ENGINE_TABLE *)lh;
	return 1;
	}
Exemplo n.º 3
0
HashTable create_hash_table()
{
  return lh_new(LHASH_HASH_FN(RelocEntry_hash),
                LHASH_COMP_FN(RelocEntry_cmp));
}