NAME

OADL_FindProc - query the OADL runtime for a callback

SYNOPSIS

    #include "oadlsys.h"

    int OADL_FindProc(void *ctx, const char *name, 
                      int version, OADLproc *rProc);

DESCRIPTION

OADL_FindProc is a C function used by the OADL runtime and foreign extensions to locate internal OADL runtime functions by name.

The ctx parameter must be a pointer to a valid OADL context (OadlCtx).

The name parameter is the name of the runtime function to find.

The version parameter must be set to OADL_SYS_VER to ensure that the calling code and the runtime are binary compatible.

If the function is found, its address is stored in the location pointed to by rProc.

RETURN VALUE

Returns 1 on success (function found and version compatible), or 0 on failure (function not found or version mismatch).

ERRORS

None. Failure is indicated by a return value of 0.

EXAMPLE

    OADLproc allocMach;
    if (OADL_FindProc(ctx, "OADL_AllocMach", OADL_SYS_VER, &allocMach)) {
        // Use allocMach to allocate a new machine
    }

SEE ALSO

OADL_AddExtern
OADL_AddProc