2 * Symbol handling for TCC
4 * Copyright (c) 2001-2004 Fabrice Bellard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 Sym
*__sym_malloc(void);
25 static inline Sym
*sym_malloc(void)
31 sym_free_first
= sym
->next
;
34 static inline void sym_free(Sym
*sym
)
36 sym
->next
= sym_free_first
;
40 /* structure lookup */
41 static inline Sym
*struct_find(int v
)
44 if ((unsigned)v
>= (unsigned)(tok_ident
- TOK_IDENT
))
46 return table_ident
[v
]->sym_struct
;
49 /* find an identifier */
50 static inline Sym
*sym_find(int v
)
53 if ((unsigned)v
>= (unsigned)(tok_ident
- TOK_IDENT
))
55 return table_ident
[v
]->sym_identifier
;
58 Sym
*sym_push(int v
, CType
*type
, int r
, int c
);
59 Sym
*sym_push2(Sym
**ps
, int v
, int t
, long c
);
60 Sym
*sym_find2(Sym
*s
, int v
);
61 Sym
*global_identifier_push(int v
, int t
, int c
);
62 Sym
*sym_push(int v
, CType
*type
, int r
, int c
);
63 void sym_pop(Sym
**ptop
, Sym
*b
);
64 void *resolve_sym(TCCState
*s1
, const char *symbol
);
66 #ifdef CONFIG_TCC_STATIC
68 #define RTLD_LAZY 0x001
69 #define RTLD_NOW 0x002
70 #define RTLD_GLOBAL 0x100
71 #define RTLD_DEFAULT NULL
73 /* dummy function for profiling */
74 void *dlopen(const char *filename
, int flag
);
75 void dlclose(void *p
);
76 const char *dlerror(void);
79 #define dlclose FreeLibrary
85 #endif /* __TCCSYM_H__ */