Ejemplo n.º 1
0
static Tag *find_tag(char *name)
/* look up a tag by name */
{
    int hash = tag_hash(name);
    Tag *tag;
    for (tag = table[hash]; tag; tag = tag->hash_next)
	if (tag->name == name)
	    return tag;
    tag = xcalloc(1, sizeof(Tag), "tag lookup");
    tag->name = name;
    tag->hash_next = table[hash];
    table[hash] = tag;
    tag->next = all_tags;
    all_tags = tag;
    return tag;
}
Ejemplo n.º 2
0
/*
 * Create a hash value based on a workfile_set_plan's signature.
 */
static workfile_set_hashkey_t
workfile_mgr_hash_key(workfile_set_plan *plan)
{
	int key_len = plan->serialized_plan_len;
	return tag_hash(plan->serialized_plan, key_len);
}