wut  1.0.0-beta9
Wii U Toolchain
dynload.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include "thread.h"
4 #include "time.h"
5 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef enum OSDynLoad_Error
17 {
29 
31 {
35 
36 typedef void *OSDynLoad_Module;
37 
38 typedef OSDynLoad_Error (*OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr);
39 typedef void (*OSDynLoadFreeFn)(void *addr);
40 
41 
49 OSDynLoad_Acquire(char const *name,
50  OSDynLoad_Module *outModule);
51 
52 
60  BOOL isData,
61  char const *name,
62  void **outAddr);
63 
64 
71 void
73 
74 
80  OSDynLoadFreeFn freeFn);
81 
82 
88  OSDynLoadFreeFn *outFreeFn);
89 
90 
96  OSDynLoadFreeFn freeFn);
97 
98 
104  OSDynLoadFreeFn *outFreeFn);
105 
106 
113  char * nameBuf,
114  int32_t * nameBufSize);
115 
121 int
123  OSDynLoad_EntryReason reason);
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
OSDynLoad_SetAllocator
OSDynLoad_Error OSDynLoad_SetAllocator(OSDynLoadAllocFn allocFn, OSDynLoadFreeFn freeFn)
Set the allocator functions to use for dynamic loading.
OS_DYNLOAD_INVALID_MODULE_NAME
@ OS_DYNLOAD_INVALID_MODULE_NAME
Definition: dynload.h:22
OSDynLoad_GetTLSAllocator
OSDynLoad_Error OSDynLoad_GetTLSAllocator(OSDynLoadAllocFn *outAllocFn, OSDynLoadFreeFn *outFreeFn)
Get the allocator functions used for thread local storage.
rpl_entry
int rpl_entry(OSDynLoad_Module module, OSDynLoad_EntryReason reason)
The prototype for an RPL entry point.
OS_DYNLOAD_INVALID_MODULE_NAME_PTR
@ OS_DYNLOAD_INVALID_MODULE_NAME_PTR
Definition: dynload.h:21
OS_DYNLOAD_INVALID_ACQUIRE_PTR
@ OS_DYNLOAD_INVALID_ACQUIRE_PTR
Definition: dynload.h:23
OS_DYNLOAD_OK
@ OS_DYNLOAD_OK
Definition: dynload.h:18
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.
OSDynLoad_Error
OSDynLoad_Error
Definition: dynload.h:16
OS_DYNLOAD_INVALID_NOTIFY_PTR
@ OS_DYNLOAD_INVALID_NOTIFY_PTR
Definition: dynload.h:20
wut.h
OS_DYNLOAD_EMPTY_MODULE_NAME
@ OS_DYNLOAD_EMPTY_MODULE_NAME
Definition: dynload.h:24
OSDynLoad_Module
void * OSDynLoad_Module
Definition: dynload.h:36
OSDynLoadAllocFn
OSDynLoad_Error(* OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr)
Definition: dynload.h:38
OS_DYNLOAD_INVALID_ALLOCATOR_PTR
@ OS_DYNLOAD_INVALID_ALLOCATOR_PTR
Definition: dynload.h:25
OS_DYNLOAD_UNLOADED
@ OS_DYNLOAD_UNLOADED
Definition: dynload.h:33
time.h
OSDynLoad_EntryReason
OSDynLoad_EntryReason
Definition: dynload.h:30
OSDynLoad_GetAllocator
OSDynLoad_Error OSDynLoad_GetAllocator(OSDynLoadAllocFn *outAllocFn, OSDynLoadFreeFn *outFreeFn)
Get the allocator functions used for dynamic loading.
OSDynLoadFreeFn
void(* OSDynLoadFreeFn)(void *addr)
Definition: dynload.h:39
OS_DYNLOAD_TLS_ALLOCATOR_LOCKED
@ OS_DYNLOAD_TLS_ALLOCATOR_LOCKED
Definition: dynload.h:27
OSDynLoad_Release
void OSDynLoad_Release(OSDynLoad_Module module)
Free a module handle returned from OSDynLoad_Acquire.
OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY
@ OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY
Definition: dynload.h:26
OSDynLoad_Acquire
OSDynLoad_Error OSDynLoad_Acquire(char const *name, OSDynLoad_Module *outModule)
Load a module.
OSDynLoad_GetModuleName
OSDynLoad_Error OSDynLoad_GetModuleName(OSDynLoad_Module module, char *nameBuf, int32_t *nameBufSize)
Gets the name for a given module handle.
BOOL
int32_t BOOL
Definition: wut_types.h:4
OS_DYNLOAD_LOADED
@ OS_DYNLOAD_LOADED
Definition: dynload.h:32
OSDynLoad_SetTLSAllocator
OSDynLoad_Error OSDynLoad_SetTLSAllocator(OSDynLoadAllocFn allocFn, OSDynLoadFreeFn freeFn)
Set the allocator functions to use for thread local storage.
thread.h
OS_DYNLOAD_OUT_OF_MEMORY
@ OS_DYNLOAD_OUT_OF_MEMORY
Definition: dynload.h:19