PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
erl.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __ERL_H__
17#define __ERL_H__
18
19#include <tamtypes.h>
20
21struct htab;
22
24#define ERL_FLAG_STICKY 1
26#define ERL_FLAG_STATIC 2
28#define ERL_FLAG_CLEAR 4
29
31 u8 * bytes;
32 u32 fullsize;
33 char * name;
34 char ** dependancies;
35 u32 flags;
36
37 /* Private */
38 struct htab * symbols;
39 struct erl_record_t * next, * prev;
40}; // 32 bytes.
41
42struct symbol_t {
43 struct erl_record_t * provider;
44 u32 address;
45};
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51extern char _init_erl_prefix[];
52
53typedef struct erl_record_t * (*erl_loader_t)(char * erl_id);
54
55extern erl_loader_t _init_load_erl;
56
57struct erl_record_t * load_erl_from_mem(u8 * mem, int argc, char ** argv);
58struct erl_record_t * load_erl_from_file(const char * fname, int argc, char ** argv);
59struct erl_record_t * _init_load_erl_from_file(const char * fname, char * erl_id);
60
61/*
62 * By default, ERLs are relocated at a dynamic memory address -- a pointer
63 * returned by malloc(). The *_to_addr functions allow you to define a static
64 * address (must be different from ERL_DYN_ADDR) without allocating any memory.
65 */
66#define ERL_DYN_ADDR 0
67
68struct erl_record_t * load_erl_from_mem_to_addr(u8 * mem, u32 addr, int argc, char ** argv);
69struct erl_record_t * load_erl_from_file_to_addr(const char * fname, u32 addr, int argc, char ** argv);
70struct erl_record_t * _init_load_erl_from_file_to_addr(const char * fname, u32 addr, char * erl_id);
71
72int unload_erl(struct erl_record_t * erl);
73
74int erl_add_global_symbol(const char * symbol, u32 address);
75
76struct erl_record_t * find_erl(const char * name);
77struct erl_record_t * erl_resolve(u32 address);
78
79struct symbol_t * erl_find_local_symbol(const char * symbol, struct erl_record_t * erl);
80struct symbol_t * erl_find_symbol(const char * symbol);
81
82void erl_flush_symbols(struct erl_record_t * erl);
83
84#ifdef __cplusplus
85}
86#endif
87
88#endif /* __ERL_H__ */
Definition erl.h:42
Definition hashtab.h:56
Definition main.c:242