/* Look up the instance of a policy handle value in whose range of frames the specified frame falls.  */
static pol_value* find_pol_handle(e_ctx_hnd *policy_hnd, guint32 frame, pol_hash_value **valuep)
/* Look up the instance of a policy handle value in whose range of frames the specified frame falls.  */
static pol_value* find_pol_handle(e_ctx_hnd *policy_hnd, guint32 frame, pol_hash_value **valuep)
{
	pol_hash_key key;
	pol_value *pol;
	memcpy(&key.policy_hnd, policy_hnd, sizeof(key.policy_hnd));
	if ((*valuep = (pol_hash_value *)g_hash_table_lookup(pol_hash, &key))) {
		for (pol = (*valuep)->list; pol != NULL; pol = pol->next) {
			if (pol->first_frame <= frame &&
			    (pol->last_frame == 0 ||
			     pol->last_frame >= frame))
				break;
		}
		return pol;
	} else {
		return NULL;
	}
}