libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ld.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include<libtransistor/types.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef struct module_t module_t;
15 typedef struct ld_loader_t ld_loader_t;
16 
20 result_t ld_relocate_module_basic(uint8_t *module_base);
21 
22 typedef struct {
23  const char *name;
24  void *base;
25  ld_loader_t *loader;
26  void *loader_data;
27  bool is_global;
28  bool has_run_basic_relocations;
30 
37 
43 result_t ld_discover_module(const char *name, module_t **out, bool is_global);
44 
49 
54 
55 void ld_finalize();
56 
57 #ifdef __cplusplus
58 }
59 #endif
Various system types.
result_t ld_decref_module(module_t *module)
Decrements the module's reference count and finalizes, unloads, and destroys it if it has reached zer...
Definition: module.h:32
uint32_t result_t
Function result.
Definition: types.h:51
result_t ld_relocate_module_basic(uint8_t *module_base)
Perform basic relocations on a module.
Definition: ld.h:22
result_t ld_add_module(module_input_t input, module_t **out)
Adds a loaded module to the end of the processing queue.
result_t ld_process_modules()
Processes all modules in the queue.
Definition: loaders.h:14
result_t ld_discover_module(const char *name, module_t **out, bool is_global)
Discovers a module in the filesystem, loads it, and adds it to the processing queue.