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

int
main ()
{
    nul_type_t arg_types[2] = { NUL_TYPE_POINTER, NUL_TYPE_POINTER };
    nul_arg_t args[2] = {
	{ .v_pointer = "hej %s" },
	{ .v_pointer = "verden\n" },
    };
    nul_arg_t ret;
    nul_fun_def_t *def = nul_fun_def_new (NUL_TYPE_INT, 2, arg_types);

    ret = nul_fun_def_invoke (def, (nul_function_t)printf, args);

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