예제 #1
0
static void
check_drange_sanity(stnode_t *st)
{
	struct check_drange_sanity_args	args;

	args.st = st;
	args.err = FALSE;

	drange_foreach_drange_node(sttype_range_drange(st),
	    check_drange_node_sanity, &args);

	if (args.err) {
		THROW(TypeError);
	}
}
예제 #2
0
파일: ftypes.c 프로젝트: flaub/HotFuzz
/* Returns a new FT_BYTES fvalue_t* if possible, otherwise NULL */
fvalue_t*
fvalue_slice(fvalue_t *fv, drange *d_range)
{
	slice_data_t	slice_data;
	fvalue_t	*new_fv;

	slice_data.fv = fv;
	slice_data.bytes = g_byte_array_new();
	slice_data.slice_failure = FALSE;

	/* XXX - We could make some optimizations here based on
	 * drange_has_total_length() and
	 * drange_get_max_offset().
	 */

	drange_foreach_drange_node(d_range, slice_func, &slice_data);

	new_fv = fvalue_new(FT_BYTES);
	fvalue_set(new_fv, slice_data.bytes, TRUE);
	return new_fv;
}