blob: f271c44b102e09480169e6560223462384a099d9 [file] [log] [blame]
Guido van Rossuma3309961993-07-28 09:05:47 +00001#ifndef Py_RENAME1_H
2#define Py_RENAME1_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7/***********************************************************
Guido van Rossumb6775db1994-08-01 11:34:53 +00008Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
Guido van Rossuma3309961993-07-28 09:05:47 +00009Amsterdam, The Netherlands.
10
11 All Rights Reserved
12
13Permission to use, copy, modify, and distribute this software and its
14documentation for any purpose and without fee is hereby granted,
15provided that the above copyright notice appear in all copies and that
16both that copyright notice and this permission notice appear in
17supporting documentation, and that the names of Stichting Mathematisch
18Centrum or CWI not be used in advertising or publicity pertaining to
19distribution of the software without specific, written prior permission.
20
21STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
22THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
23FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
24FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
26ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
27OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28
29******************************************************************/
30
31/* This file contains a bunch of #defines that make it possible to use
32 "new style" names (e.g. PyObject) with the old style Python source
33 distribution. */
34
Guido van Rossum95664081994-09-14 13:23:36 +000035/* Remove some symbols (these conflict with X11 symbols) */
36#undef True
37#undef False
38#undef None
39
Guido van Rossuma3309961993-07-28 09:05:47 +000040typedef ANY *PyUnivPtr;
Guido van Rossume025e311994-08-12 12:46:05 +000041typedef struct methodlist PyMethodDef;
Guido van Rossuma3309961993-07-28 09:05:47 +000042
43#define Py_NO_DEBUG NDEBUG
44#define Py_TRACE_REFS TRACE_REFS
45#define Py_REF_DEBUG REF_DEBUG
46#define Py_HAVE_PROTOTYPES HAVE_PROTOTYPES
47#define Py_HAVE_STDLIB HAVE_STDLIB
48#define _Py_ZeroStruct FalseObject
49#define _Py_NoneStruct NoObject
50#define _Py_TrueStruct TrueObject
51#define Py_DebugFlag debugging
52#define _PyParser_Grammar gram
53#define _PySys_ProfileFunc sys_profile
54#define _PySys_TraceFunc sys_trace
55#define _PyThread_Started threads_started
56#define _PyParser_TokenNames tok_name
57#define Py_VerboseFlag verbose
58#define PyExc_AttributeError AttributeError
59#define PyExc_EOFError EOFError
60#define PyExc_IOError IOError
61#define PyExc_ImportError ImportError
62#define PyExc_IndexError IndexError
63#define PyExc_KeyError KeyError
64#define PyExc_MemoryError MemoryError
65#define PyExc_NameError NameError
66#define PyExc_OverflowError OverflowError
67#define PyExc_RuntimeError RuntimeError
68#define PyExc_SyntaxError SyntaxError
69#define PyExc_SystemError SystemError
70#define PyExc_TypeError TypeError
71#define PyExc_ValueError ValueError
72#define PyExc_ZeroDivisionError ZeroDivisionError
73#define PyExc_KeyboardInterrupt KeyboardInterrupt
74#define PyExc_SystemExit SystemExit
75#define PyFloat_Type Floattype
76#define PyInt_Type Inttype
77#define PyLong_Type Longtype
78#define PyNothing_Type Notype
79#define PyString_Type Stringtype
80#define PyType_Type Typetype
81#define PyList_Type Listtype
82#define PyDict_Type Dicttype
83#define PyTuple_Type Tupletype
84#define PyFile_Type Filetype
85#define PyClass_Type Classtype
86#define PyFunction_Type Functype
87#define PyMethod_Type Instancemethodtype
88#define PyInstance_Type Instancetype
89#define PyCFunction_Type Methodtype
90#define PyModule_Type Moduletype
91#define PyCode_Type Codetype
92#define PyFrame_Type Frametype
93#define PyFloatObject floatobject
94#define PyIntObject intobject
95#define PyLongObject longobject
96#define PyNothingObject noobject
Guido van Rossume025e311994-08-12 12:46:05 +000097#define PyObject object
Guido van Rossuma3309961993-07-28 09:05:47 +000098#define PyStringObject stringobject
99#define PyTypeObject typeobject
100#define PyListObject listobject
101#define PyDictObject dictobject
102#define PyTupleObject tupleobject
103#define PyFileObject fileobject
104#define PyClassObject classobject
105#define PyCodeObject codeobject
106#define PyFrameObject frameobject
107#define PyFunctionObject funcobject
108#define PyMethodObject instancemethodobject
109#define PyInstanceObject instanceobject
110#define PyCFunctionObject methodobject
111#define PyModuleObject moduleobject
112#define PyNumberMethods number_methods
113#define PySequenceMethods sequence_methods
114#define PyMappingMethods mapping_methods
115#define PyObject_HEAD OB_HEAD
116#define PyObject_VAR_HEAD OB_VARHEAD
Guido van Rossum66cb3111994-12-30 15:33:50 +0000117#define PyObject_HEAD_INIT(x) OB_HEAD_INIT(x)
Guido van Rossuma3309961993-07-28 09:05:47 +0000118#define PyObject_NEW NEWOBJ
119#define PyObject_NEW_VAR NEWVAROBJ
120#define Py_PROTO PROTO
Guido van Rossuma3309961993-07-28 09:05:47 +0000121#define PyMem_NEW NEW
122#define PyMem_RESIZE RESIZE
123#define PyMem_DEL DEL
124#define PyMem_XDEL XDEL
125#define Py_BEGIN_ALLOW_THREADS BGN_SAVE
126#define Py_BLOCK_THREADS RET_SAVE
127#define Py_UNBLOCK_THREADS RES_SAVE
128#define Py_END_ALLOW_THREADS END_SAVE
129#define PyFloat_Check is_floatobject
130#define PyInt_Check is_intobject
131#define PyLong_Check is_longobject
132#define PyNothing_Check is_noobject
133#define PyString_Check is_stringobject
134#define PyType_Check is_typeobject
135#define PyList_Check is_listobject
136#define PyDict_Check is_dictobject
137#define PyTuple_Check is_tupleobject
138#define PyFile_Check is_fileobject
139#define PyClass_Check is_classobject
140#define PyCode_Check is_codeobject
141#define PyFrame_Check is_frameobject
142#define PyFunction_Check is_funcobject
143#define PyMethod_Check is_instancemethodobject
144#define PyInstance_Check is_instanceobject
145#define PyCFunction_Check is_methodobject
146#define PyModule_Check is_moduleobject
147#define Py_INCREF INCREF
148#define Py_DECREF DECREF
149#define Py_XINCREF XINCREF
150#define Py_XDECREF XDECREF
151#define _Py_NewReference NEWREF
152#define _Py_Dealloc DELREF
153#define _Py_ForgetReference UNREF
Guido van Rossum95664081994-09-14 13:23:36 +0000154#define Py_None (&_Py_NoneStruct)
155#define Py_False ((object *) &_Py_ZeroStruct)
156#define Py_True ((object *) &_Py_TrueStruct)
Guido van Rossuma3309961993-07-28 09:05:47 +0000157#define PyObject_Compare cmpobject
158#define PyObject_GetAttrString getattr
159#define PyObject_GetAttr getattro
160#define PyObject_Hash hashobject
161#define _PyObject_New newobject
162#define _PyObject_NewVar newvarobject
163#define PyObject_Print printobject
164#define PyObject_Repr reprobject
165#define PyObject_SetAttrString setattr
166#define PyObject_SetAttr setattro
167#define PyObject_IsTrue testbool
168#define Py_PRINT_RAW PRINT_RAW
169#define PyFloat_AsString float_buf_repr
170#define PyFloat_AsDouble getfloatvalue
171#define PyFloat_AS_DOUBLE GETFLOATVALUE
172#define PyFloat_FromDouble newfloatobject
173#define PyInt_AsLong getintvalue
174#define PyInt_AS_LONG GETINTVALUE
175#define PyInt_FromLong newintobject
176#define _PyLong_New alloclongobject
177#define PyLong_AsDouble dgetlongvalue
178#define PyLong_FromDouble dnewlongobject
179#define PyLong_AsLong getlongvalue
180#define PyLong_FromString long_scan
181#define PyLong_FromLong newlongobject
182#define PyString_Format formatstring
183#define PyString_Size getstringsize
184#define PyString_AsString getstringvalue
185#define PyString_AS_STRING GETSTRINGVALUE
186#define PyString_Concat joinstring
187#define PyString_FromStringAndSize newsizedstringobject
188#define PyString_FromString newstringobject
189#define _PyString_Resize resizestring
190#define PyList_Append addlistitem
191#define PyList_GetItem getlistitem
192#define PyList_GET_ITEM GETLISTITEM
193#define PyList_Size getlistsize
194#define PyList_GetSlice getlistslice
195#define PyList_Insert inslistitem
196#define PyList_New newlistobject
197#define PyList_SetItem setlistitem
198#define PyList_SetSlice setlistslice
199#define PyList_Sort sortlist
200#define PyDict_SetItemString dictinsert
201#define PyDict_GetItemString dictlookup
202#define PyDict_DelItemString dictremove
203#define PyDict_Items getmappingitems
204#define PyDict_Keys getmappingkeys
205#define PyDict_Values getmappingvalues
206#define PyDict_Clear mappingclear
207#define PyDict_Next mappinggetnext
208#define PyDict_SetItem mappinginsert
209#define PyDict_GetItem mappinglookup
210#define PyDict_DelItem mappingremove
211#define PyDict_New newmappingobject
212#define PyTuple_GetItem gettupleitem
213#define PyTuple_GET_ITEM GETTUPLEITEM
214#define PyTuple_Size gettuplesize
215#define PyTuple_GetSlice gettupleslice
216#define PyTuple_New newtupleobject
217#define PyTuple_SetItem settupleitem
218#define PyFile_GetLine filegetline
219#define PyFile_AsFile getfilefile
220#define PyFile_FromString newfileobject
221#define PyFile_FromFile newopenfileobject
222#define PyFile_SoftSpace softspace
223#define PyFile_WriteObject writeobject
224#define PyFile_WriteString writestring
225#define PyMethod_Class instancemethodgetclass
226#define PyMethod_Function instancemethodgetfunc
227#define PyMethod_Self instancemethodgetself
228#define PyClass_IsSubclass issubclass
229#define PyClass_New newclassobject
230#define PyMethod_New newinstancemethodobject
231#define PyInstance_New newinstanceobject
232#define PyTryBlock block
233#define PyFrame_ExtendStack extend_stack
234#define PyFrame_New newframeobject
235#define PyFrame_BlockPop pop_block
236#define PyFrame_BlockSetup setup_block
237#define PyFunction_GetCode getfunccode
238#define PyFunction_GetGlobals getfuncglobals
239#define PyFunction_New newfuncobject
240#define PyCFunction method
241#define Py_FindMethod findmethod
242#define PyCFunction_GetFunction getmethod
243#define PyCFunction_GetSelf getself
244#define PyCFunction_IsVarArgs getvarargs
245#define PyCFunction_New newmethodobject
246#define PyModule_GetDict getmoduledict
247#define PyModule_GetName getmodulename
248#define PyModule_New newmoduleobject
249#define PyGrammar_AddAccelerators addaccelerators
250#define PyGrammar_FindDFA finddfa
251#define PyGrammar_LabelRepr labelrepr
252#define PyNode_ListTree listtree
253#define PyNode_AddChild addchild
254#define PyNode_Free freetree
255#define PyNode_New newtree
256#define PyParser_AddToken addtoken
257#define PyParser_Delete delparser
258#define PyParser_New newparser
259#define PyParser_ParseFile parsefile
260#define PyParser_ParseString parsestring
261#define PyToken_OneChar tok_1char
262#define PyToken_TwoChars tok_2char
263#define PyTokenizer_Free tok_free
264#define PyTokenizer_Get tok_get
265#define PyTokenizer_FromFile tok_setupf
266#define PyTokenizer_FromString tok_setups
267#define PyNode_Compile compile
268#define PyCode_New newcodeobject
269#define PyEval_CallObject call_object
270#define PyEval_EvalCode eval_code
271#define Py_FlushLine flushline
272#define PyEval_GetGlobals getglobals
273#define PyEval_GetLocals getlocals
274#define PyEval_InitThreads init_save_thread
275#define PyErr_PrintTraceBack printtraceback
276#define PyEval_RestoreThread restore_thread
277#define PyEval_SaveThread save_thread
278#define PyTraceBack_Fetch tb_fetch
279#define PyTraceBack_Here tb_here
280#define PyTraceBack_Print tb_print
281#define PyTraceBack_Store tb_store
282#define PyImport_AddModule add_module
283#define PyImport_Cleanup doneimport
284#define PyImport_GetModuleDict get_modules
285#define PyImport_ImportModule import_module
286#define PyImport_ImportFrozenModule init_frozen
287#define PyImport_Init initimport
288#define PyImport_ReloadModule reload_module
289#define PyNumber_Coerce coerce
290#define PyBuiltin_GetObject getbuiltin
291#define PyBuiltin_Init initbuiltin
292#define PyMarshal_Init initmarshal
293#define PyMarshal_ReadLongFromFile rd_long
294#define PyMarshal_ReadObjectFromFile rd_object
295#define PyMarshal_ReadObjectFromString rds_object
296#define PyMarshal_WriteLongToFile wr_long
297#define PyMarshal_WriteObjectToFile wr_object
298#define PySys_Init initsys
299#define PySys_SetArgv setpythonargv
300#define PySys_SetPath setpythonpath
301#define PySys_GetObject sysget
302#define PySys_GetFile sysgetfile
303#define PySys_SetObject sysset
304#define Py_CompileString compile_string
305#define Py_FatalError fatal
306#define Py_Exit goaway
307#define Py_Initialize initall
308#define PyErr_Print print_error
309#define PyParser_SimpleParseFile parse_file
310#define PyParser_SimpleParseString parse_string
311#define PyRun_AnyFile run
312#define PyRun_SimpleFile run_script
313#define PyRun_SimpleString run_command
314#define PyRun_File run_file
315#define PyRun_String run_string
316#define PyRun_InteractiveOne run_tty_1
317#define PyRun_InteractiveLoop run_tty_loop
318#define PyMember_Get getmember
319#define PyMember_Set setmember
320#define Py_InitModule initmodule
321#define Py_BuildValue mkvalue
322#define Py_VaBuildValue vmkvalue
323#define PyArg_Parse getargs
Guido van Rossumf4838461994-11-10 22:29:04 +0000324#define PyArg_ParseTuple newgetargs
Guido van Rossumd2002c71994-08-29 10:55:31 +0000325#define PyArg_NoArgs(v) getargs(v, "")
Guido van Rossuma3309961993-07-28 09:05:47 +0000326#define PyArg_GetChar getichararg
327#define PyArg_GetDoubleArray getidoublearray
328#define PyArg_GetFloat getifloatarg
329#define PyArg_GetFloatArray getifloatarray
Guido van Rossumc6cf1dd1994-09-07 14:35:10 +0000330#define PyArg_GetInt getintarg
Guido van Rossuma3309961993-07-28 09:05:47 +0000331#define PyArg_GetLong getilongarg
332#define PyArg_GetLongArray getilongarray
333#define PyArg_GetLongArraySize getilongarraysize
334#define PyArg_GetObject getiobjectarg
335#define PyArg_GetShort getishortarg
336#define PyArg_GetShortArray getishortarray
337#define PyArg_GetShortArraySize getishortarraysize
338#define PyArg_GetString getistringarg
339#define PyErr_BadArgument err_badarg
340#define PyErr_BadInternalCall err_badcall
341#define PyErr_Input err_input
342#define PyErr_NoMemory err_nomem
343#define PyErr_SetFromErrno err_errno
344#define PyErr_SetNone err_set
345#define PyErr_SetString err_setstr
346#define PyErr_SetObject err_setval
347#define PyErr_Occurred err_occurred
Guido van Rossum66cb3111994-12-30 15:33:50 +0000348#define PyErr_Fetch err_fetch
349#define PyErr_Restore err_restore
Guido van Rossuma3309961993-07-28 09:05:47 +0000350#define PyErr_Clear err_clear
351#define PyOS_InterruptableGetString fgets_intr
352#define PyOS_InitInterrupts initintr
353#define PyOS_InterruptOccurred intrcheck
354#define PyOS_GetLastModificationTime getmtime
355
356#ifdef __cplusplus
357}
358#endif
359#endif /* !Py_RENAME1_H */