wut  1.0.0-beta9
Wii U Toolchain
Typedefs | Enumerations | Functions
Dynamic Loading

Typedefs

typedef enum OSDynLoad_Error OSDynLoad_Error
 
typedef enum OSDynLoad_EntryReason OSDynLoad_EntryReason
 
typedef void * OSDynLoad_Module
 
typedef OSDynLoad_Error(* OSDynLoadAllocFn) (int32_t size, int32_t align, void **outAddr)
 
typedef void(* OSDynLoadFreeFn) (void *addr)
 

Enumerations

enum  OSDynLoad_Error {
  OS_DYNLOAD_OK = 0,
  OS_DYNLOAD_OUT_OF_MEMORY = 0xBAD10002,
  OS_DYNLOAD_INVALID_NOTIFY_PTR = 0xBAD1000E,
  OS_DYNLOAD_INVALID_MODULE_NAME_PTR = 0xBAD1000F,
  OS_DYNLOAD_INVALID_MODULE_NAME = 0xBAD10010,
  OS_DYNLOAD_INVALID_ACQUIRE_PTR = 0xBAD10011,
  OS_DYNLOAD_EMPTY_MODULE_NAME = 0xBAD10012,
  OS_DYNLOAD_INVALID_ALLOCATOR_PTR = 0xBAD10017,
  OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY = 0xBAD1002F,
  OS_DYNLOAD_TLS_ALLOCATOR_LOCKED = 0xBAD10031
}
 
enum  OSDynLoad_EntryReason {
  OS_DYNLOAD_LOADED = 0,
  OS_DYNLOAD_UNLOADED = 1
}
 

Functions

OSDynLoad_Error OSDynLoad_Acquire (char const *name, OSDynLoad_Module *outModule)
 Load a module. More...
 
OSDynLoad_Error OSDynLoad_FindExport (OSDynLoad_Module module, BOOL isData, char const *name, void **outAddr)
 Retrieve the address of a function or data export from a module. More...
 
void OSDynLoad_Release (OSDynLoad_Module module)
 Free a module handle returned from OSDynLoad_Acquire. More...
 
OSDynLoad_Error OSDynLoad_SetAllocator (OSDynLoadAllocFn allocFn, OSDynLoadFreeFn freeFn)
 Set the allocator functions to use for dynamic loading. More...
 
OSDynLoad_Error OSDynLoad_GetAllocator (OSDynLoadAllocFn *outAllocFn, OSDynLoadFreeFn *outFreeFn)
 Get the allocator functions used for dynamic loading. More...
 
OSDynLoad_Error OSDynLoad_SetTLSAllocator (OSDynLoadAllocFn allocFn, OSDynLoadFreeFn freeFn)
 Set the allocator functions to use for thread local storage. More...
 
OSDynLoad_Error OSDynLoad_GetTLSAllocator (OSDynLoadAllocFn *outAllocFn, OSDynLoadFreeFn *outFreeFn)
 Get the allocator functions used for thread local storage. More...
 
OSDynLoad_Error OSDynLoad_GetModuleName (OSDynLoad_Module module, char *nameBuf, int32_t *nameBufSize)
 Gets the name for a given module handle. More...
 
int rpl_entry (OSDynLoad_Module module, OSDynLoad_EntryReason reason)
 The prototype for an RPL entry point. More...
 

Detailed Description

Typedef Documentation

◆ OSDynLoad_Error

◆ OSDynLoad_EntryReason

◆ OSDynLoad_Module

typedef void* OSDynLoad_Module

Definition at line 36 of file dynload.h.

◆ OSDynLoadAllocFn

typedef OSDynLoad_Error(* OSDynLoadAllocFn) (int32_t size, int32_t align, void **outAddr)

Definition at line 38 of file dynload.h.

◆ OSDynLoadFreeFn

typedef void(* OSDynLoadFreeFn) (void *addr)

Definition at line 39 of file dynload.h.

Enumeration Type Documentation

◆ OSDynLoad_Error

Enumerator
OS_DYNLOAD_OK 
OS_DYNLOAD_OUT_OF_MEMORY 
OS_DYNLOAD_INVALID_NOTIFY_PTR 
OS_DYNLOAD_INVALID_MODULE_NAME_PTR 
OS_DYNLOAD_INVALID_MODULE_NAME 
OS_DYNLOAD_INVALID_ACQUIRE_PTR 
OS_DYNLOAD_EMPTY_MODULE_NAME 
OS_DYNLOAD_INVALID_ALLOCATOR_PTR 
OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY 
OS_DYNLOAD_TLS_ALLOCATOR_LOCKED 

Definition at line 16 of file dynload.h.

◆ OSDynLoad_EntryReason

Enumerator
OS_DYNLOAD_LOADED 
OS_DYNLOAD_UNLOADED 

Definition at line 30 of file dynload.h.

Function Documentation

◆ OSDynLoad_Acquire()

OSDynLoad_Error OSDynLoad_Acquire ( char const *  name,
OSDynLoad_Module outModule 
)

Load a module.

If the module is already loaded, increase reference count. Similar to LoadLibrary on Windows.

◆ OSDynLoad_FindExport()

OSDynLoad_Error OSDynLoad_FindExport ( OSDynLoad_Module  module,
BOOL  isData,
char const *  name,
void **  outAddr 
)

Retrieve the address of a function or data export from a module.

Similar to GetProcAddress on Windows.

◆ OSDynLoad_Release()

void OSDynLoad_Release ( OSDynLoad_Module  module)

Free a module handle returned from OSDynLoad_Acquire.

Will decrease reference count and only unload the module if count reaches 0. Similar to FreeLibrary on Windows.

◆ OSDynLoad_SetAllocator()

OSDynLoad_Error OSDynLoad_SetAllocator ( OSDynLoadAllocFn  allocFn,
OSDynLoadFreeFn  freeFn 
)

Set the allocator functions to use for dynamic loading.

◆ OSDynLoad_GetAllocator()

OSDynLoad_Error OSDynLoad_GetAllocator ( OSDynLoadAllocFn outAllocFn,
OSDynLoadFreeFn outFreeFn 
)

Get the allocator functions used for dynamic loading.

◆ OSDynLoad_SetTLSAllocator()

OSDynLoad_Error OSDynLoad_SetTLSAllocator ( OSDynLoadAllocFn  allocFn,
OSDynLoadFreeFn  freeFn 
)

Set the allocator functions to use for thread local storage.

◆ OSDynLoad_GetTLSAllocator()

OSDynLoad_Error OSDynLoad_GetTLSAllocator ( OSDynLoadAllocFn outAllocFn,
OSDynLoadFreeFn outFreeFn 
)

Get the allocator functions used for thread local storage.

◆ OSDynLoad_GetModuleName()

OSDynLoad_Error OSDynLoad_GetModuleName ( OSDynLoad_Module  module,
char *  nameBuf,
int32_t *  nameBufSize 
)

Gets the name for a given module handle.

Using the value "-1" as module handle gets the name of the running main rpl

◆ rpl_entry()

int rpl_entry ( OSDynLoad_Module  module,
OSDynLoad_EntryReason  reason 
)

The prototype for an RPL entry point.

Use this instead of main when creating .rpl files