blob: aeeb1b98deef9309af2883d3785b8841ea8fd579 [file] [log] [blame]
Guido van Rossumcaa63801995-01-12 11:45:45 +00001#ifndef Py_OLDNAMES_H
2#define Py_OLDNAMES_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7/***********************************************************
8Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
9The 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 "old style" names (e.g. object) with the new style Python source
33 distribution. */
34
35#define True Py_True
36#define False Py_False
37#define None Py_None
38
39/* typedef ANY *PyUnivPtr; */
40#define methodlist PyMethodDef
Guido van Rossum69785031995-01-26 22:58:48 +000041#define methodchain PyMethodChain
Guido van Rossumcaa63801995-01-12 11:45:45 +000042
43#define None Py_None
44#define False Py_False
45#define True Py_True
46
47#define Accesstype PyAccess_Type
48#define is_accessobject PyAccess_Check
49#define newaccessobject PyAccess_FromValue
50#define getaccessvalue PyAccess_AsValue
51#define setaccessvalue PyAccess_SetValue
Guido van Rossum93817821995-01-17 16:01:01 +000052#define setaccessowner PyAccess_SetOwner
53#define cloneaccessobject PyAccess_Clone
54#define hasaccessvalue PyAccess_HasValue
55#define Anynumbertype PyAnyNumber_Type
56#define Anysequencetype PyAnySequence_Type
57#define Anymappingtype PyAnyMapping_Type
Guido van Rossumcaa63801995-01-12 11:45:45 +000058
59#ifdef Py_TRACE_REFS
60#define TRACE_REFS
61#endif
62
63#ifdef Py_REF_DEBUG
64#define REF_DEBUG
65#endif
66
67#define FalseObject _Py_ZeroStruct
68#define NoObject _Py_NoneStruct
69#define TrueObject _Py_TrueStruct
70#define debugging Py_DebugFlag
71#define gram _PyParser_Grammar
72#define sys_profile _PySys_ProfileFunc
73#define sys_trace _PySys_TraceFunc
74#define sys_checkinterval _PySys_CheckInterval
75#define threads_started _PyThread_Started
76#define tok_name _PyParser_TokenNames
77#define verbose Py_VerboseFlag
Guido van Rossum93817821995-01-17 16:01:01 +000078#define suppress_print Py_SuppressPrintingFlag
Guido van Rossumcaa63801995-01-12 11:45:45 +000079#define AccessError PyExc_AccessError
80#define AttributeError PyExc_AttributeError
81#define ConflictError PyExc_ConflictError
82#define EOFError PyExc_EOFError
83#define IOError PyExc_IOError
84#define ImportError PyExc_ImportError
85#define IndexError PyExc_IndexError
86#define KeyError PyExc_KeyError
87#define MemoryError PyExc_MemoryError
88#define NameError PyExc_NameError
89#define OverflowError PyExc_OverflowError
90#define RuntimeError PyExc_RuntimeError
91#define SyntaxError PyExc_SyntaxError
92#define SystemError PyExc_SystemError
93#define TypeError PyExc_TypeError
94#define ValueError PyExc_ValueError
95#define ZeroDivisionError PyExc_ZeroDivisionError
96#define KeyboardInterrupt PyExc_KeyboardInterrupt
97#define SystemExit PyExc_SystemExit
98#define Floattype PyFloat_Type
99#define Inttype PyInt_Type
100#define Longtype PyLong_Type
101#define Notype PyNothing_Type
102#define Stringtype PyString_Type
103#define Typetype PyType_Type
104#define Listtype PyList_Type
105#define Dicttype PyDict_Type
Guido van Rossum93817821995-01-17 16:01:01 +0000106#define Mappingtype PyDict_Type
Guido van Rossumcaa63801995-01-12 11:45:45 +0000107#define Tupletype PyTuple_Type
108#define Filetype PyFile_Type
109#define Classtype PyClass_Type
110#define Functype PyFunction_Type
111#define Instancemethodtype PyMethod_Type
112#define Instancetype PyInstance_Type
113#define Methodtype PyCFunction_Type
114#define Moduletype PyModule_Type
115#define Codetype PyCode_Type
116#define Frametype PyFrame_Type
Guido van Rossum93817821995-01-17 16:01:01 +0000117#define Rangetype PyRange_Type
Guido van Rossumcaa63801995-01-12 11:45:45 +0000118#define floatobject PyFloatObject
119#define intobject PyIntObject
120#define longobject PyLongObject
121#define noobject PyNothingObject
122#define object PyObject
123#define stringobject PyStringObject
124#define typeobject PyTypeObject
125#define listobject PyListObject
126#define dictobject PyDictObject
127#define tupleobject PyTupleObject
128#define fileobject PyFileObject
129#define classobject PyClassObject
130#define codeobject PyCodeObject
131#define frameobject PyFrameObject
132#define funcobject PyFunctionObject
133#define instancemethodobject PyMethodObject
134#define instanceobject PyInstanceObject
135#define methodobject PyCFunctionObject
136#define moduleobject PyModuleObject
137#define number_methods PyNumberMethods
138#define sequence_methods PySequenceMethods
139#define mapping_methods PyMappingMethods
140#define OB_HEAD PyObject_HEAD
141#define OB_VARHEAD PyObject_VAR_HEAD
142#define OB_HEAD_INIT PyObject_HEAD_INIT
143#define NEWOBJ PyObject_NEW
144#define NEWVAROBJ PyObject_NEW_VAR
145#define PROTO Py_PROTO
146#define FPROTO Py_FPROTO
147#define NEW PyMem_NEW
148#define RESIZE PyMem_RESIZE
149#define DEL PyMem_DEL
150#define XDEL PyMem_XDEL
151#define BGN_SAVE Py_BEGIN_ALLOW_THREADS
152#define RET_SAVE Py_BLOCK_THREADS
153#define RES_SAVE Py_UNBLOCK_THREADS
154#define END_SAVE Py_END_ALLOW_THREADS
Guido van Rossum9e89f0a1995-02-07 15:26:59 +0000155#define callable PyCallable_Check
Guido van Rossumcaa63801995-01-12 11:45:45 +0000156#define is_floatobject PyFloat_Check
157#define is_intobject PyInt_Check
158#define is_longobject PyLong_Check
159#define is_noobject PyNothing_Check
160#define is_stringobject PyString_Check
161#define is_typeobject PyType_Check
162#define is_listobject PyList_Check
163#define is_dictobject PyDict_Check
Guido van Rossum93817821995-01-17 16:01:01 +0000164#define is_mappingobject PyDict_Check
Guido van Rossumcaa63801995-01-12 11:45:45 +0000165#define is_tupleobject PyTuple_Check
166#define is_fileobject PyFile_Check
167#define is_classobject PyClass_Check
168#define is_codeobject PyCode_Check
169#define is_frameobject PyFrame_Check
170#define is_funcobject PyFunction_Check
171#define is_instancemethodobject PyMethod_Check
172#define is_instanceobject PyInstance_Check
173#define is_methodobject PyCFunction_Check
174#define is_moduleobject PyModule_Check
175#define INCREF Py_INCREF
176#define DECREF Py_DECREF
177#define XINCREF Py_XINCREF
178#define XDECREF Py_XDECREF
179#define NEWREF _Py_NewReference
180#define DELREF _Py_Dealloc
181#define UNREF _Py_ForgetReference
182#define cmpobject PyObject_Compare
183#define getattr PyObject_GetAttrString
184#define getattro PyObject_GetAttr
Guido van Rossum93817821995-01-17 16:01:01 +0000185#define hasattr PyObject_HasAttrString
186#define hasattro PyObject_HasAttr
Guido van Rossumcaa63801995-01-12 11:45:45 +0000187#define hashobject PyObject_Hash
188#define newobject _PyObject_New
189#define newvarobject _PyObject_NewVar
190#define printobject PyObject_Print
191#define reprobject PyObject_Repr
Guido van Rossum93817821995-01-17 16:01:01 +0000192#define strobject PyObject_Str
Guido van Rossumcaa63801995-01-12 11:45:45 +0000193#define setattr PyObject_SetAttrString
194#define setattro PyObject_SetAttr
195#define testbool PyObject_IsTrue
196#define PRINT_RAW Py_PRINT_RAW
197#define float_buf_repr PyFloat_AsString
198#define getfloatvalue PyFloat_AsDouble
199#define GETFLOATVALUE PyFloat_AS_DOUBLE
200#define newfloatobject PyFloat_FromDouble
201#define getintvalue PyInt_AsLong
202#define GETINTVALUE PyInt_AS_LONG
Guido van Rossum93817821995-01-17 16:01:01 +0000203#define getmaxint PyInt_GetMax
Guido van Rossumcaa63801995-01-12 11:45:45 +0000204#define newintobject PyInt_FromLong
205#define alloclongobject _PyLong_New
206#define dgetlongvalue PyLong_AsDouble
207#define dnewlongobject PyLong_FromDouble
208#define getlongvalue PyLong_AsLong
Guido van Rossum93817821995-01-17 16:01:01 +0000209#define long_escan PyLong_FromString
210#define long_scan(a, b) PyLong_FromString((a), (char **)0, (b))
Guido van Rossumcaa63801995-01-12 11:45:45 +0000211#define newlongobject PyLong_FromLong
212#define formatstring PyString_Format
213#define getstringsize PyString_Size
214#define getstringvalue PyString_AsString
215#define GETSTRINGVALUE PyString_AS_STRING
216#define joinstring PyString_Concat
Guido van Rossum93817821995-01-17 16:01:01 +0000217#define joinstring_decref PyString_ConcatAndDel
Guido van Rossumcaa63801995-01-12 11:45:45 +0000218#define newsizedstringobject PyString_FromStringAndSize
219#define newstringobject PyString_FromString
220#define resizestring _PyString_Resize
221#define addlistitem PyList_Append
222#define getlistitem PyList_GetItem
223#define GETLISTITEM PyList_GET_ITEM
224#define getlistsize PyList_Size
225#define getlistslice PyList_GetSlice
226#define inslistitem PyList_Insert
227#define newlistobject PyList_New
228#define setlistitem PyList_SetItem
229#define setlistslice PyList_SetSlice
230#define sortlist PyList_Sort
Guido van Rossum93817821995-01-17 16:01:01 +0000231#define reverselist PyList_Reverse
232#define listtuple PyList_AsTuple
Guido van Rossumcaa63801995-01-12 11:45:45 +0000233#define dictinsert PyDict_SetItemString
234#define dictlookup PyDict_GetItemString
235#define dictremove PyDict_DelItemString
236#define getmappingitems PyDict_Items
Guido van Rossum93817821995-01-17 16:01:01 +0000237#define getdictitems PyDict_Items
Guido van Rossumcaa63801995-01-12 11:45:45 +0000238#define getmappingkeys PyDict_Keys
Guido van Rossum93817821995-01-17 16:01:01 +0000239#define getdictkeys PyDict_Keys
Guido van Rossumcaa63801995-01-12 11:45:45 +0000240#define getmappingvalues PyDict_Values
Guido van Rossum93817821995-01-17 16:01:01 +0000241#define getdictvalues PyDict_Values
242#define getmappingsize PyDict_Size
243#define getdictsize PyDict_Size
Guido van Rossumcaa63801995-01-12 11:45:45 +0000244#define mappingclear PyDict_Clear
245#define mappinggetnext PyDict_Next
246#define mappinginsert PyDict_SetItem
Guido van Rossum93817821995-01-17 16:01:01 +0000247#define dict2insert PyDict_SetItem
Guido van Rossumcaa63801995-01-12 11:45:45 +0000248#define mappinglookup PyDict_GetItem
Guido van Rossum93817821995-01-17 16:01:01 +0000249#define dict2lookup PyDict_GetItem
Guido van Rossumcaa63801995-01-12 11:45:45 +0000250#define mappingremove PyDict_DelItem
Guido van Rossum93817821995-01-17 16:01:01 +0000251#define dict2remove PyDict_DelItem
Guido van Rossumcaa63801995-01-12 11:45:45 +0000252#define newmappingobject PyDict_New
Guido van Rossum93817821995-01-17 16:01:01 +0000253#define newdictobject PyDict_New
Guido van Rossumcaa63801995-01-12 11:45:45 +0000254#define gettupleitem PyTuple_GetItem
255#define GETTUPLEITEM PyTuple_GET_ITEM
256#define gettuplesize PyTuple_Size
257#define gettupleslice PyTuple_GetSlice
258#define newtupleobject PyTuple_New
259#define settupleitem PyTuple_SetItem
Guido van Rossum93817821995-01-17 16:01:01 +0000260#define resizetuple _PyTuple_Resize
Guido van Rossumcaa63801995-01-12 11:45:45 +0000261#define filegetline PyFile_GetLine
262#define getfilefile PyFile_AsFile
Guido van Rossum93817821995-01-17 16:01:01 +0000263#define getfilename PyFile_Name
264#define setfilebufsize PyFile_SetBufSize
Guido van Rossumcaa63801995-01-12 11:45:45 +0000265#define newfileobject PyFile_FromString
266#define newopenfileobject PyFile_FromFile
267#define softspace PyFile_SoftSpace
268#define writeobject PyFile_WriteObject
269#define writestring PyFile_WriteString
270#define instancemethodgetclass PyMethod_Class
271#define instancemethodgetfunc PyMethod_Function
272#define instancemethodgetself PyMethod_Self
273#define issubclass PyClass_IsSubclass
274#define newclassobject PyClass_New
275#define newinstancemethodobject PyMethod_New
276#define newinstanceobject PyInstance_New
Guido van Rossum93817821995-01-17 16:01:01 +0000277#define instancebinop PyInstance_DoBinOp
Guido van Rossumcaa63801995-01-12 11:45:45 +0000278#define block PyTryBlock
279#define extend_stack PyFrame_ExtendStack
280#define newframeobject PyFrame_New
281#define pop_block PyFrame_BlockPop
282#define setup_block PyFrame_BlockSetup
Guido van Rossum93817821995-01-17 16:01:01 +0000283#define fast_2_locals PyFrame_FastToLocals
284#define locals_2_fast PyFrame_LocalsToFast
Guido van Rossumcaa63801995-01-12 11:45:45 +0000285#define getfunccode PyFunction_GetCode
286#define getfuncglobals PyFunction_GetGlobals
Guido van Rossum93817821995-01-17 16:01:01 +0000287#define getfuncargstuff PyFunction_GetArgStuff
288#define setfuncargstuff PyFunction_SetArgStuff
289#define mystrtol PyOS_strtol
290#define mystrtoul PyOS_strtoul
Guido van Rossumcaa63801995-01-12 11:45:45 +0000291#define newfuncobject PyFunction_New
Guido van Rossum93817821995-01-17 16:01:01 +0000292#define newrangeobject PyRange_New
Guido van Rossumcaa63801995-01-12 11:45:45 +0000293#define method PyCFunction
294#define findmethod Py_FindMethod
Guido van Rossum69785031995-01-26 22:58:48 +0000295#define findmethodinchain Py_FindMethodInChain
Guido van Rossumcaa63801995-01-12 11:45:45 +0000296#define getmethod PyCFunction_GetFunction
297#define getself PyCFunction_GetSelf
298#define getvarargs PyCFunction_IsVarArgs
299#define newmethodobject PyCFunction_New
300#define getmoduledict PyModule_GetDict
301#define getmodulename PyModule_GetName
302#define newmoduleobject PyModule_New
303#define addaccelerators PyGrammar_AddAccelerators
304#define finddfa PyGrammar_FindDFA
305#define labelrepr PyGrammar_LabelRepr
306#define listtree PyNode_ListTree
307#define addchild PyNode_AddChild
308#define freetree PyNode_Free
309#define newtree PyNode_New
310#define addtoken PyParser_AddToken
311#define delparser PyParser_Delete
312#define newparser PyParser_New
313#define parsefile PyParser_ParseFile
314#define parsestring PyParser_ParseString
315#define tok_1char PyToken_OneChar
316#define tok_2char PyToken_TwoChars
317#define tok_free PyTokenizer_Free
318#define tok_get PyTokenizer_Get
319#define tok_setupf PyTokenizer_FromFile
320#define tok_setups PyTokenizer_FromString
321#define compile PyNode_Compile
322#define newcodeobject PyCode_New
323#define call_object PyEval_CallObject
324#define eval_code PyEval_EvalCode
325#define flushline Py_FlushLine
326#define getbuiltins PyEval_GetBuiltins
327#define getglobals PyEval_GetGlobals
328#define getlocals PyEval_GetLocals
329#define getowner PyEval_GetOwner
330#define getframe PyEval_GetFrame
331#define getrestricted PyEval_GetRestricted
332#define init_save_thread PyEval_InitThreads
333#define printtraceback PyErr_PrintTraceBack
334#define restore_thread PyEval_RestoreThread
335#define save_thread PyEval_SaveThread
336#define tb_fetch PyTraceBack_Fetch
337#define tb_here PyTraceBack_Here
338#define tb_print PyTraceBack_Print
339#define tb_store PyTraceBack_Store
340#define add_module PyImport_AddModule
341#define doneimport PyImport_Cleanup
342#define get_modules PyImport_GetModuleDict
Guido van Rossum93817821995-01-17 16:01:01 +0000343#define get_pyc_magic PyImport_GetMagicNumber
Jack Jansen3cfc8bd1995-02-15 22:55:45 +0000344#define exec_code_module PyImport_ExecCodeModule
Guido van Rossumcaa63801995-01-12 11:45:45 +0000345#define import_module PyImport_ImportModule
346#define init_frozen PyImport_ImportFrozenModule
347#define initimport PyImport_Init
348#define reload_module PyImport_ReloadModule
349#define coerce PyNumber_Coerce
350#define getbuiltin PyBuiltin_GetObject
351#define initbuiltin PyBuiltin_Init
352#define initmarshal PyMarshal_Init
353#define initmodule Py_InitModule
354#define initmodule4 Py_InitModule4
355#define rd_long PyMarshal_ReadLongFromFile
Guido van Rossum93817821995-01-17 16:01:01 +0000356#define rd_short PyMarshal_ReadShortFromFile
Guido van Rossumcaa63801995-01-12 11:45:45 +0000357#define rd_object PyMarshal_ReadObjectFromFile
358#define rds_object PyMarshal_ReadObjectFromString
359#define wr_long PyMarshal_WriteLongToFile
Guido van Rossum93817821995-01-17 16:01:01 +0000360#define wr_short PyMarshal_WriteShortToFile
Guido van Rossumcaa63801995-01-12 11:45:45 +0000361#define wr_object PyMarshal_WriteObjectToFile
362#define initsys PySys_Init
363#define setpythonargv PySys_SetArgv
364#define setpythonpath PySys_SetPath
365#define sysget PySys_GetObject
366#define sysgetfile PySys_GetFile
367#define sysset PySys_SetObject
368#define compile_string Py_CompileString
369#define fatal Py_FatalError
370#define goaway Py_Exit
Guido van Rossum93817821995-01-17 16:01:01 +0000371#define cleanup Py_Cleanup
Guido van Rossumcaa63801995-01-12 11:45:45 +0000372#define initall Py_Initialize
373#define print_error PyErr_Print
374#define parse_file PyParser_SimpleParseFile
375#define parse_string PyParser_SimpleParseString
376#define run PyRun_AnyFile
377#define run_script PyRun_SimpleFile
378#define run_command PyRun_SimpleString
379#define run_file PyRun_File
380#define run_string PyRun_String
381#define run_tty_1 PyRun_InteractiveOne
382#define run_tty_loop PyRun_InteractiveLoop
383#define getmember PyMember_Get
384#define setmember PyMember_Set
385#define mkvalue Py_BuildValue
386#define vmkvalue Py_VaBuildValue
387#define getargs PyArg_Parse
Guido van Rossum93817821995-01-17 16:01:01 +0000388#define vgetargs PyArgs_VaParse
Guido van Rossumcaa63801995-01-12 11:45:45 +0000389#define newgetargs PyArg_ParseTuple
390#define getichararg PyArg_GetChar
391#define getidoublearray PyArg_GetDoubleArray
392#define getifloatarg PyArg_GetFloat
393#define getifloatarray PyArg_GetFloatArray
394#define getnoarg(v) PyArg_NoArgs(v)
395#define getintarg(v,a) getargs((v),"i",(a))
396#define getlongarg(v,a) getargs((v),"l",(a))
397#define getstrarg(v,a) getargs((v),"s",(a))
398#define getilongarg PyArg_GetLong
399#define getilongarray PyArg_GetLongArray
400#define getilongarraysize PyArg_GetLongArraySize
401#define getiobjectarg PyArg_GetObject
402#define getishortarg PyArg_GetShort
403#define getishortarray PyArg_GetShortArray
404#define getishortarraysize PyArg_GetShortArraySize
405#define getistringarg PyArg_GetString
406#define err_badarg PyErr_BadArgument
407#define err_badcall PyErr_BadInternalCall
408#define err_input PyErr_Input
409#define err_nomem PyErr_NoMemory
410#define err_errno PyErr_SetFromErrno
411#define err_set PyErr_SetNone
412#define err_setstr PyErr_SetString
413#define err_setval PyErr_SetObject
414#define err_occurred PyErr_Occurred
415#define err_fetch PyErr_Fetch
416#define err_restore PyErr_Restore
417#define err_clear PyErr_Clear
418#define fgets_intr PyOS_InterruptableGetString
419#define initintr PyOS_InitInterrupts
420#define intrcheck PyOS_InterruptOccurred
421#define getmtime PyOS_GetLastModificationTime
Guido van Rossum93817821995-01-17 16:01:01 +0000422#define my_readline PyOS_Readline
423#define realmain Py_Main
424#define ref_total _Py_RefTotal
425#define sigcheck PyErr_CheckSignals
Guido van Rossumcaa63801995-01-12 11:45:45 +0000426
427#ifdef __cplusplus
428}
429#endif
430#endif /* !Py_OLDNAMES_H */