aboutsummaryrefslogtreecommitdiff
path: root/mod/util.c
blob: c9673494b08b3b0469f7af490ea81f64fc7d8f42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <fwd/mod.h>
#include <stdio.h>

long fwdpanic(fwd_extern_args_t args)
{
	assert(args.argc == 1);
	char *str = FWD_ARG_T(args, 0, char *);
	fprintf(stderr, "%s", str);
	exit(1);
	return 0;
}

int fwdopen(fwd_state_t *state)
{
	/** @todo passing around strings might be common enough to warrant its
	 * own type? */
	FWD_REGISTER(state, fwdpanic,
			FWD_VOID, FWD_PTR);
	return 0;
}