1848b8605Smrg/*
2848b8605Smrg * Copyright © 2008 Intel Corporation
3848b8605Smrg *
4848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a
5848b8605Smrg * copy of this software and associated documentation files (the "Software"),
6848b8605Smrg * to deal in the Software without restriction, including without limitation
7848b8605Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8848b8605Smrg * and/or sell copies of the Software, and to permit persons to whom the
9848b8605Smrg * Software is furnished to do so, subject to the following conditions:
10848b8605Smrg *
11848b8605Smrg * The above copyright notice and this permission notice (including the next
12848b8605Smrg * paragraph) shall be included in all copies or substantial portions of the
13848b8605Smrg * Software.
14848b8605Smrg *
15848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16848b8605Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17848b8605Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18848b8605Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19848b8605Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20848b8605Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21848b8605Smrg * DEALINGS IN THE SOFTWARE.
22848b8605Smrg */
23848b8605Smrg#ifndef MESA_SYMBOL_TABLE_H
24848b8605Smrg#define MESA_SYMBOL_TABLE_H
25848b8605Smrg
26b8e80941Smrg#ifdef __cplusplus
27b8e80941Smrgextern "C" {
28b8e80941Smrg#endif
29b8e80941Smrg
30848b8605Smrgstruct _mesa_symbol_table;
31848b8605Smrg
32848b8605Smrgextern void _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table);
33848b8605Smrg
34848b8605Smrgextern void _mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table);
35848b8605Smrg
36848b8605Smrgextern int _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *symtab,
37b8e80941Smrg                                         const char *name, void *declaration);
38b8e80941Smrg
39b8e80941Smrgextern int _mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table,
40b8e80941Smrg                                             const char *name,
41b8e80941Smrg                                             void *declaration);
42848b8605Smrg
43b8e80941Smrgextern int
44b8e80941Smrg_mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *symtab,
45b8e80941Smrg                                     const char *name,
46b8e80941Smrg                                     void *declaration);
47848b8605Smrg
48848b8605Smrgextern int _mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table,
49b8e80941Smrg                                           const char *name);
50848b8605Smrg
51b8e80941Smrgextern void *_mesa_symbol_table_find_symbol(struct _mesa_symbol_table *symtab,
52b8e80941Smrg                                            const char *name);
53848b8605Smrg
54848b8605Smrgextern struct _mesa_symbol_table *_mesa_symbol_table_ctor(void);
55848b8605Smrg
56848b8605Smrgextern void _mesa_symbol_table_dtor(struct _mesa_symbol_table *);
57848b8605Smrg
58b8e80941Smrg#ifdef __cplusplus
59b8e80941Smrg}
60b8e80941Smrg#endif
61b8e80941Smrg
62848b8605Smrg#endif /* MESA_SYMBOL_TABLE_H */
63