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