NAME

OADL_xxx - System library entry point

SYNOPSIS

int OADL_xxx(void *ctx, OADL_FindProc_fp findProc)

DESCRIPTION

This function is the required entry point for every OADL system library implementation. Note that the xxx should be replaced with the name of the OADL system library as provided in a using extern statement. The ctx is an opaque OADL context pointer, to be provided to the findProc callback when obtaining callback pointers.

RETURN VALUE

The OADL_xxx() function should return 1 if it is successfully loaded and all required initialization performed. It should return 0 otherwise.

EXAMPLE

// foo.oad
using extern "libfoo";
namespace foo {
    extern bar;
}

// libfoo.c
int OADL_libfoo(void *ctx, OADL_FindProc_fp findProc)
{
    OADL_AddExtern_fp OADL_AddExtern;
    extern int foo_bar(void *ctx, OadlVar *pRes, int nargs, const OadlVar *args);

    if (!findProc(ctx, "OADL_AddExtern",
                   OADL_SYS_VER, (OADLproc *) &OADL_AddExtern))
    {
        return 0;
    }
    if (!OADL_AddExtern(ctx, "foo::bar", foo_bar)) {
        return 0;
    }
    return 1;
}

SEE ALSO

OADL_AddExtern
OADL_FindProc
OADL_xxx_term