summaryrefslogtreecommitdiff
path: root/example.c
blob: 0a30d199a0c7c46a8225be9fdaadd3f782127f5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include "invoke.h"

int
main ()
{
    Type arg_types[2] = { TYPE_POINTER, TYPE_POINTER };
    Arg args[2] = {
	{ .v_pointer = "hej %s" },
	{ .v_pointer = "verden\n" },
    };
    Arg ret;
    
    FunDef *def = fun_def_new ((Function)printf, TYPE_INT, 2, arg_types);

    ret = fun_def_invoke (def, args);

    printf ("returned: %d\n", ret.v_int);
    
    return 0;
}