|
1 | | -#ifndef Py_LIMITED_API |
2 | | -#ifndef Py_SYMTABLE_H |
3 | | -#define Py_SYMTABLE_H |
| 1 | +#ifndef Py_INTERNAL_SYMTABLE_H |
| 2 | +#define Py_INTERNAL_SYMTABLE_H |
4 | 3 | #ifdef __cplusplus |
5 | 4 | extern "C" { |
6 | 5 | #endif |
7 | 6 |
|
8 | | -#include "Python-ast.h" /* mod_ty */ |
| 7 | +#ifndef Py_BUILD_CORE |
| 8 | +# error "this header requires Py_BUILD_CORE define" |
| 9 | +#endif |
9 | 10 |
|
10 | | -/* XXX(ncoghlan): This is a weird mix of public names and interpreter internal |
11 | | - * names. |
12 | | - */ |
| 11 | +#include "Python-ast.h" /* mod_ty */ |
13 | 12 |
|
14 | 13 | typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } |
15 | 14 | _Py_block_ty; |
@@ -68,23 +67,19 @@ typedef struct _symtable_entry { |
68 | 67 | struct symtable *ste_table; |
69 | 68 | } PySTEntryObject; |
70 | 69 |
|
71 | | -PyAPI_DATA(PyTypeObject) PySTEntry_Type; |
| 70 | +extern PyTypeObject PySTEntry_Type; |
72 | 71 |
|
73 | 72 | #define PySTEntry_Check(op) Py_IS_TYPE(op, &PySTEntry_Type) |
74 | 73 |
|
75 | | -PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *); |
| 74 | +extern int _PyST_GetScope(PySTEntryObject *, PyObject *); |
76 | 75 |
|
77 | | -PyAPI_FUNC(struct symtable *) PySymtable_Build( |
78 | | - mod_ty mod, |
79 | | - const char *filename, /* decoded from the filesystem encoding */ |
80 | | - PyFutureFeatures *future); |
81 | | -PyAPI_FUNC(struct symtable *) PySymtable_BuildObject( |
| 76 | +extern struct symtable* _PySymtable_Build( |
82 | 77 | mod_ty mod, |
83 | 78 | PyObject *filename, |
84 | 79 | PyFutureFeatures *future); |
85 | 80 | PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); |
86 | 81 |
|
87 | | -PyAPI_FUNC(void) PySymtable_Free(struct symtable *); |
| 82 | +extern void _PySymtable_Free(struct symtable *); |
88 | 83 |
|
89 | 84 | /* Flags for def-use information */ |
90 | 85 |
|
@@ -117,8 +112,14 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *); |
117 | 112 | #define GENERATOR 1 |
118 | 113 | #define GENERATOR_EXPRESSION 2 |
119 | 114 |
|
| 115 | +// Used by symtablemodule.c |
| 116 | +extern struct symtable* _Py_SymtableStringObjectFlags( |
| 117 | + const char *str, |
| 118 | + PyObject *filename, |
| 119 | + int start, |
| 120 | + PyCompilerFlags *flags); |
| 121 | + |
120 | 122 | #ifdef __cplusplus |
121 | 123 | } |
122 | 124 | #endif |
123 | | -#endif /* !Py_SYMTABLE_H */ |
124 | | -#endif /* !Py_LIMITED_API */ |
| 125 | +#endif /* !Py_INTERNAL_SYMTABLE_H */ |
0 commit comments