Exemplo n.º 1
0
/**
 * Returns TRUE if c can match anything in the set S (err. the connector table ct).
 */
static inline bool matches_S(connector_table *ct, Connector * c)
{
	Connector * e;

	for (e = ct[hash_S(c)]; e != NULL; e = e->tableNext)
	{
		if (easy_match(e->string, c->string)) return true;
	}
	return false;
}
Exemplo n.º 2
0
/**
 * This function puts connector c into the connector table
 * if one like it isn't already there.
 */
static void insert_connector(connector_table *ct, Connector * c)
{
	unsigned int h;
	Connector * e;

	h = hash_S(c);

	for (e = ct[h]; e != NULL; e = e->tableNext)
	{
		if (string_set_cmp(c->string, e->string))
			return;
	}
	c->tableNext = ct[h];
	ct[h] = c;
}
Exemplo n.º 3
0
/**
 * Returns TRUE if c can match anything in the set S (err. the connector table ct).
 */
static inline bool matches_S(connector_table *ct, Connector * c, char dir)
{
	Connector * e;
	unsigned int h = hash_S(c);

	if (dir == '-')
	{
		for (e = ct[h]; e != NULL; e = e->tableNext)
		{
			if (prune_match(e, c)) return true;
		}
		return false;
	}
	else
	{
		for (e = ct[h]; e != NULL; e = e->tableNext)
		{
			if (prune_match(c, e)) return true;
		}
		return false;
	}
}