]> git.sur5r.net Git - cc65/blob - src/ld65/extsyms.h
Merge remote-tracking branch 'upstream/master' into a5200
[cc65] / src / ld65 / extsyms.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 extsyms.h                                 */
4 /*                                                                           */
5 /*      Handle program external symbols for relocatable output formats       */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1999-2001 Ullrich von Bassewitz                                       */
10 /*               Wacholderweg 14                                             */
11 /*               D-70597 Stuttgart                                           */
12 /* EMail:        uz@musoftware.de                                            */
13 /*                                                                           */
14 /*                                                                           */
15 /* This software is provided 'as-is', without any expressed or implied       */
16 /* warranty.  In no event will the authors be held liable for any damages    */
17 /* arising from the use of this software.                                    */
18 /*                                                                           */
19 /* Permission is granted to anyone to use this software for any purpose,     */
20 /* including commercial applications, and to alter it and redistribute it    */
21 /* freely, subject to the following restrictions:                            */
22 /*                                                                           */
23 /* 1. The origin of this software must not be misrepresented; you must not   */
24 /*    claim that you wrote the original software. If you use this software   */
25 /*    in a product, an acknowledgment in the product documentation would be  */
26 /*    appreciated but is not required.                                       */
27 /* 2. Altered source versions must be plainly marked as such, and must not   */
28 /*    be misrepresented as being the original software.                      */
29 /* 3. This notice may not be removed or altered from any source              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef EXTSYMS_H
37 #define EXTSYMS_H
38
39
40
41 /*****************************************************************************/
42 /*                                   Data                                    */
43 /*****************************************************************************/
44
45
46
47 /* Forward decl for structure holding an external symbol */
48 typedef struct ExtSym ExtSym;
49
50 /* External symbol table structure */
51 typedef struct ExtSymTab ExtSymTab;
52
53
54
55 /*****************************************************************************/
56 /*                                   Code                                    */
57 /*****************************************************************************/
58
59
60
61 ExtSym* NewExtSym (ExtSymTab* Tab, unsigned Name);
62 /* Create a new external symbol and insert it into the list */
63
64 ExtSymTab* NewExtSymTab (void);
65 /* Create a new external symbol table */
66
67 void FreeExtSymTab (ExtSymTab* Tab);
68 /* Free an external symbol structure */
69
70 ExtSym* GetExtSym (const ExtSymTab* Tab, unsigned Name);
71 /* Return the entry for the external symbol with the given name. Return NULL
72  * if there is no such symbol.
73  */
74
75 unsigned ExtSymCount (const ExtSymTab* Tab);
76 /* Return the number of symbols in the table */
77
78 const ExtSym* ExtSymList (const ExtSymTab* Tab);
79 /* Return the start of the symbol list sorted by symbol number. Call
80  * ExtSymNext for the next symbol.
81  */
82
83 unsigned ExtSymNum (const ExtSym* E);
84 /* Return the number of an external symbol */
85
86 unsigned ExtSymName (const ExtSym* E);
87 /* Return the symbol name index */
88
89 const ExtSym* ExtSymNext (const ExtSym* E);
90 /* Return the next symbol in the list */
91
92
93
94 /* End of extsyms.h */
95
96 #endif