void envGetRandomSeed(u64 out[2])
Retrieves the random seed provided by the environment.
Result envGetLastLoadResult(void)
Returns the Result from the last NRO.
@ EnvAppletFlags_ApplicationOverride
Use AppletType_Application instead of AppletType_SystemApplication.
Definition: env.h:43
void(* LoaderReturnFn)(int result_code)
Loader return function.
Definition: env.h:47
@ EntryType_OverrideService
Provides service override information.
Definition: env.h:29
u64 envGetLoaderInfoSize(void)
Returns the size of the loader information text.
AccountUid * envGetUserIdStorage(void)
Returns a pointer to the user id storage area (if present).
@ EntryType_EndOfList
Entry list terminator.
Definition: env.h:25
bool envHasRandomSeed(void)
Returns true if the environment provides a random seed.
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
bool envIsNso(void)
Returns true if the application is running as NSO, otherwise NRO.
bool envHasArgv(void)
Returns true if the environment has an argv array.
const char * envGetLoaderInfo(void)
Returns information text about the loader, if present.
u32 Key
Type of entry.
Definition: env.h:13
Account UserId.
Definition: acc.h:25
LoaderReturnFn envGetExitFuncPtr(void)
Returns the loader's return function, to be called on program exit.
@ EntryType_NextLoadPath
Provides a buffer containing information about the next homebrew application to load.
Definition: env.h:27
@ EntryType_AppletWorkaround
Indicates that APT is broken and should not be used.
Definition: env.h:33
@ EntryType_LastLoadResult
Provides the last load result.
Definition: env.h:36
u32 Flags
Entry flags.
Definition: env.h:14
bool envIsSyscallHinted(u8 svc)
Returns whether a syscall is hinted to be available.
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
u64 envGetHeapOverrideSize(void)
Returns the size of the overriden heap.
@ EntryType_AppletType
Provides APT applet type.
Definition: env.h:32
@ EntryFlag_IsMandatory
Specifies that the entry must be processed by the homebrew application.
Definition: env.h:20
@ EntryType_RandomSeed
Provides random data used to seed the pseudo-random number generator.
Definition: env.h:37
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u32 Result
Function error code result type.
Definition: types.h:44
void envSetup(void *ctx, Handle main_thread, LoaderReturnFn saved_lr)
Parses the homebrew loader environment block (internally called).
@ EntryType_MainThreadHandle
Provides the handle to the main thread.
Definition: env.h:26
@ EntryType_ProcessHandle
Provides the process handle.
Definition: env.h:35
void * envGetArgv(void)
Returns the pointer to the argv array.
bool envHasHeapOverride(void)
Returns true if the environment has a heap override.
void * envGetHeapOverrideAddr(void)
Returns the address of the overriden heap.
bool envHasNextLoad(void)
Returns true if the environment supports envSetNextLoad.
Structure representing an entry in the homebrew environment configuration.
Definition: env.h:12
Result envSetNextLoad(const char *path, const char *argv)
Configures the next homebrew application to load.
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:54
Handle envGetOwnProcessHandle(void)
Returns the handle to the running homebrew process.
#define NORETURN
Marks a function as not returning, for the purposes of compiler optimization.
Definition: types.h:64
void envSetExitFuncPtr(LoaderReturnFn addr)
Sets the return function to be called on program exit.
@ EntryType_Reserved9
Unused/reserved entry type, formerly used by StdioSockets.
Definition: env.h:34
@ EntryType_Argv
Provides argv.
Definition: env.h:30
@ EntryType_OverrideHeap
Provides heap override information.
Definition: env.h:28
Handle envGetMainThreadHandle(void)
Retrieves the handle to the main thread.
@ EntryType_HosVersion
Provides the currently running Horizon OS version.
Definition: env.h:39
@ EntryType_UserIdStorage
Provides persistent storage for the preselected user id.
Definition: env.h:38
u32 Handle
Kernel object handle.
Definition: types.h:43
@ EntryType_SyscallAvailableHint
Provides syscall availability hints.
Definition: env.h:31