home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Include / rename2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  14.9 KB  |  427 lines  |  [TEXT/R*ch]

  1. #ifndef Py_OLDNAMES_H
  2. #define Py_OLDNAMES_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /***********************************************************
  8. Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  9. The Netherlands.
  10.  
  11.                         All Rights Reserved
  12.  
  13. Permission to use, copy, modify, and distribute this software and its 
  14. documentation for any purpose and without fee is hereby granted, 
  15. provided that the above copyright notice appear in all copies and that
  16. both that copyright notice and this permission notice appear in 
  17. supporting documentation, and that the names of Stichting Mathematisch
  18. Centrum or CWI not be used in advertising or publicity pertaining to
  19. distribution of the software without specific, written prior permission.
  20.  
  21. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
  22. THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  23. FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
  24. FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  25. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  26. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  27. OF 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
  41. #define methodchain PyMethodChain
  42.  
  43. #define Accesstype PyAccess_Type
  44. #define is_accessobject PyAccess_Check
  45. #define newaccessobject PyAccess_FromValue
  46. #define getaccessvalue PyAccess_AsValue
  47. #define setaccessvalue PyAccess_SetValue
  48. #define setaccessowner PyAccess_SetOwner
  49. #define cloneaccessobject PyAccess_Clone
  50. #define hasaccessvalue PyAccess_HasValue
  51. #define Anynumbertype PyAnyNumber_Type
  52. #define Anysequencetype PyAnySequence_Type
  53. #define Anymappingtype PyAnyMapping_Type
  54.  
  55. #ifdef Py_TRACE_REFS
  56. #define TRACE_REFS
  57. #endif
  58.  
  59. #ifdef Py_REF_DEBUG
  60. #define REF_DEBUG
  61. #endif
  62.  
  63. #define FalseObject _Py_ZeroStruct
  64. #define NoObject _Py_NoneStruct
  65. #define TrueObject _Py_TrueStruct
  66. #define debugging Py_DebugFlag
  67. #define gram _PyParser_Grammar
  68. #define sys_profile _PySys_ProfileFunc
  69. #define sys_trace _PySys_TraceFunc
  70. #define sys_checkinterval _PySys_CheckInterval
  71. #define threads_started _PyThread_Started
  72. #define tok_name _PyParser_TokenNames
  73. #define verbose Py_VerboseFlag
  74. #define suppress_print Py_SuppressPrintingFlag
  75. #define AccessError PyExc_AccessError
  76. #define AttributeError PyExc_AttributeError
  77. #define ConflictError PyExc_ConflictError
  78. #define EOFError PyExc_EOFError
  79. #define IOError PyExc_IOError
  80. #define ImportError PyExc_ImportError
  81. #define IndexError PyExc_IndexError
  82. #define KeyError PyExc_KeyError
  83. #define MemoryError PyExc_MemoryError
  84. #define NameError PyExc_NameError
  85. #define OverflowError PyExc_OverflowError
  86. #define RuntimeError PyExc_RuntimeError
  87. #define SyntaxError PyExc_SyntaxError
  88. #define SystemError PyExc_SystemError
  89. #define TypeError PyExc_TypeError
  90. #define ValueError PyExc_ValueError
  91. #define ZeroDivisionError PyExc_ZeroDivisionError
  92. #define KeyboardInterrupt PyExc_KeyboardInterrupt
  93. #define SystemExit PyExc_SystemExit
  94. #define Floattype PyFloat_Type
  95. #define Inttype PyInt_Type
  96. #define Longtype PyLong_Type
  97. #define Notype PyNothing_Type
  98. #define Stringtype PyString_Type
  99. #define Typetype PyType_Type
  100. #define Listtype PyList_Type
  101. #define Dicttype PyDict_Type
  102. #define Mappingtype PyDict_Type
  103. #define Tupletype PyTuple_Type
  104. #define Filetype PyFile_Type
  105. #define Classtype PyClass_Type
  106. #define Functype PyFunction_Type
  107. #define Instancemethodtype PyMethod_Type
  108. #define Instancetype PyInstance_Type
  109. #define Methodtype PyCFunction_Type
  110. #define Moduletype PyModule_Type
  111. #define Codetype PyCode_Type
  112. #define Frametype PyFrame_Type
  113. #define Rangetype PyRange_Type
  114. #define floatobject PyFloatObject
  115. #define intobject PyIntObject
  116. #define longobject PyLongObject
  117. #define noobject PyNothingObject
  118. #define object PyObject
  119. #define stringobject PyStringObject
  120. #define typeobject PyTypeObject
  121. #define listobject PyListObject
  122. #define dictobject PyDictObject
  123. #define tupleobject PyTupleObject
  124. #define fileobject PyFileObject
  125. #define classobject PyClassObject
  126. #define codeobject PyCodeObject
  127. #define frameobject PyFrameObject
  128. #define funcobject PyFunctionObject
  129. #define instancemethodobject PyMethodObject
  130. #define instanceobject PyInstanceObject
  131. #define methodobject PyCFunctionObject
  132. #define moduleobject PyModuleObject
  133. #define number_methods PyNumberMethods
  134. #define sequence_methods PySequenceMethods
  135. #define mapping_methods PyMappingMethods
  136. #define OB_HEAD PyObject_HEAD
  137. #define OB_VARHEAD PyObject_VAR_HEAD
  138. #define OB_HEAD_INIT PyObject_HEAD_INIT
  139. #define NEWOBJ PyObject_NEW
  140. #define NEWVAROBJ PyObject_NEW_VAR
  141. #define PROTO Py_PROTO
  142. #define FPROTO Py_FPROTO
  143. #define NEW PyMem_NEW
  144. #define RESIZE PyMem_RESIZE
  145. #define DEL PyMem_DEL
  146. #define XDEL PyMem_XDEL
  147. #define BGN_SAVE Py_BEGIN_ALLOW_THREADS
  148. #define RET_SAVE Py_BLOCK_THREADS
  149. #define RES_SAVE Py_UNBLOCK_THREADS
  150. #define END_SAVE Py_END_ALLOW_THREADS
  151. #define callable PyCallable_Check
  152. #define is_floatobject PyFloat_Check
  153. #define is_intobject PyInt_Check
  154. #define is_longobject PyLong_Check
  155. #define is_stringobject PyString_Check
  156. #define is_typeobject PyType_Check
  157. #define is_listobject PyList_Check
  158. #define is_dictobject PyDict_Check
  159. #define is_mappingobject PyDict_Check
  160. #define is_tupleobject PyTuple_Check
  161. #define is_fileobject PyFile_Check
  162. #define is_classobject PyClass_Check
  163. #define is_codeobject PyCode_Check
  164. #define is_frameobject PyFrame_Check
  165. #define is_funcobject PyFunction_Check
  166. #define is_instancemethodobject PyMethod_Check
  167. #define is_instanceobject PyInstance_Check
  168. #define is_methodobject PyCFunction_Check
  169. #define is_moduleobject PyModule_Check
  170. #define INCREF Py_INCREF
  171. #define DECREF Py_DECREF
  172. #define XINCREF Py_XINCREF
  173. #define XDECREF Py_XDECREF
  174. #define NEWREF _Py_NewReference
  175. #define DELREF _Py_Dealloc
  176. #define UNREF _Py_ForgetReference
  177. #define cmpobject PyObject_Compare
  178. #define getattr PyObject_GetAttrString
  179. #define getattro PyObject_GetAttr
  180. #define hasattr PyObject_HasAttrString
  181. #define hasattro PyObject_HasAttr
  182. #define hashobject PyObject_Hash
  183. #define newobject _PyObject_New
  184. #define newvarobject _PyObject_NewVar
  185. #define printobject PyObject_Print
  186. #define reprobject PyObject_Repr
  187. #define strobject PyObject_Str
  188. #define setattr PyObject_SetAttrString
  189. #define setattro PyObject_SetAttr
  190. #define testbool PyObject_IsTrue
  191. #define PRINT_RAW Py_PRINT_RAW
  192. #define float_buf_repr PyFloat_AsString
  193. #define getfloatvalue PyFloat_AsDouble
  194. #define GETFLOATVALUE PyFloat_AS_DOUBLE
  195. #define newfloatobject PyFloat_FromDouble
  196. #define getintvalue PyInt_AsLong
  197. #define GETINTVALUE PyInt_AS_LONG
  198. #define getmaxint PyInt_GetMax
  199. #define newintobject PyInt_FromLong
  200. #define alloclongobject _PyLong_New
  201. #define dgetlongvalue PyLong_AsDouble
  202. #define dnewlongobject PyLong_FromDouble
  203. #define getlongvalue PyLong_AsLong
  204. #define long_escan PyLong_FromString
  205. #define long_scan(a, b) PyLong_FromString((a), (char **)0, (b))
  206. #define newlongobject PyLong_FromLong
  207. #define formatstring PyString_Format
  208. #define getstringsize PyString_Size
  209. #define getstringvalue PyString_AsString
  210. #define GETSTRINGVALUE PyString_AS_STRING
  211. #define joinstring PyString_Concat
  212. #define joinstring_decref PyString_ConcatAndDel
  213. #define newsizedstringobject PyString_FromStringAndSize
  214. #define newstringobject PyString_FromString
  215. #define resizestring _PyString_Resize
  216. #define addlistitem PyList_Append
  217. #define getlistitem PyList_GetItem
  218. #define GETLISTITEM PyList_GET_ITEM
  219. #define getlistsize PyList_Size
  220. #define getlistslice PyList_GetSlice
  221. #define inslistitem PyList_Insert
  222. #define newlistobject PyList_New
  223. #define setlistitem PyList_SetItem
  224. #define setlistslice PyList_SetSlice
  225. #define sortlist PyList_Sort
  226. #define reverselist PyList_Reverse
  227. #define listtuple PyList_AsTuple
  228. #define dictinsert PyDict_SetItemString
  229. #define dictlookup PyDict_GetItemString
  230. #define dictremove PyDict_DelItemString
  231. #define getmappingitems PyDict_Items
  232. #define getdictitems PyDict_Items
  233. #define getmappingkeys PyDict_Keys
  234. #define getdictkeys PyDict_Keys
  235. #define getmappingvalues PyDict_Values
  236. #define getdictvalues PyDict_Values
  237. #define getmappingsize PyDict_Size
  238. #define getdictsize PyDict_Size
  239. #define mappingclear PyDict_Clear
  240. #define mappinggetnext PyDict_Next
  241. #define mappinginsert PyDict_SetItem
  242. #define dict2insert PyDict_SetItem
  243. #define mappinglookup PyDict_GetItem
  244. #define dict2lookup PyDict_GetItem
  245. #define mappingremove PyDict_DelItem
  246. #define dict2remove PyDict_DelItem
  247. #define newmappingobject PyDict_New
  248. #define newdictobject PyDict_New
  249. #define gettupleitem PyTuple_GetItem
  250. #define GETTUPLEITEM PyTuple_GET_ITEM
  251. #define SETTUPLEITEM PyTuple_SET_ITEM
  252. #define gettuplesize PyTuple_Size
  253. #define gettupleslice PyTuple_GetSlice
  254. #define newtupleobject PyTuple_New
  255. #define settupleitem PyTuple_SetItem
  256. #define resizetuple _PyTuple_Resize
  257. #define filegetline PyFile_GetLine
  258. #define getfilefile PyFile_AsFile
  259. #define getfilename PyFile_Name
  260. #define setfilebufsize PyFile_SetBufSize
  261. #define newfileobject PyFile_FromString
  262. #define newopenfileobject PyFile_FromFile
  263. #define softspace PyFile_SoftSpace
  264. #define writeobject PyFile_WriteObject
  265. #define writestring PyFile_WriteString
  266. #define instancemethodgetclass PyMethod_Class
  267. #define instancemethodgetfunc PyMethod_Function
  268. #define instancemethodgetself PyMethod_Self
  269. #define issubclass PyClass_IsSubclass
  270. #define newclassobject PyClass_New
  271. #define newinstancemethodobject PyMethod_New
  272. #define newinstanceobject PyInstance_New
  273. #define instancebinop PyInstance_DoBinOp
  274. #define block PyTryBlock
  275. #define extend_stack PyFrame_ExtendStack
  276. #define newframeobject PyFrame_New
  277. #define pop_block PyFrame_BlockPop
  278. #define setup_block PyFrame_BlockSetup
  279. #define fast_2_locals PyFrame_FastToLocals
  280. #define locals_2_fast PyFrame_LocalsToFast
  281. #define getfunccode PyFunction_GetCode
  282. #define getfuncglobals PyFunction_GetGlobals
  283. #define getfuncargstuff PyFunction_GetArgStuff
  284. #define setfuncargstuff PyFunction_SetArgStuff
  285. #define mystrtol PyOS_strtol
  286. #define mystrtoul PyOS_strtoul
  287. #define newfuncobject PyFunction_New
  288. #define newrangeobject PyRange_New
  289. #define method PyCFunction
  290. #define findmethod Py_FindMethod
  291. #define findmethodinchain Py_FindMethodInChain
  292. #define getmethod PyCFunction_GetFunction
  293. #define getself PyCFunction_GetSelf
  294. #define getflags PyCFunction_GetFlags
  295. #define newmethodobject PyCFunction_New
  296. #define getmoduledict PyModule_GetDict
  297. #define getmodulename PyModule_GetName
  298. #define newmoduleobject PyModule_New
  299. #define addaccelerators PyGrammar_AddAccelerators
  300. #define finddfa PyGrammar_FindDFA
  301. #define labelrepr PyGrammar_LabelRepr
  302. #define listtree PyNode_ListTree
  303. #define addchild PyNode_AddChild
  304. #define freetree PyNode_Free
  305. #define newtree PyNode_New
  306. #define addtoken PyParser_AddToken
  307. #define delparser PyParser_Delete
  308. #define newparser PyParser_New
  309. #define parsefile PyParser_ParseFile
  310. #define parsestring PyParser_ParseString
  311. #define tok_1char PyToken_OneChar
  312. #define tok_2char PyToken_TwoChars
  313. #define tok_free PyTokenizer_Free
  314. #define tok_get PyTokenizer_Get
  315. #define tok_setupf PyTokenizer_FromFile
  316. #define tok_setups PyTokenizer_FromString
  317. #define compile PyNode_Compile
  318. #define newcodeobject PyCode_New
  319. #define call_object PyEval_CallObject
  320. #define eval_code PyEval_EvalCode
  321. #define flushline Py_FlushLine
  322. #define getbuiltins PyEval_GetBuiltins
  323. #define getglobals PyEval_GetGlobals
  324. #define getlocals PyEval_GetLocals
  325. #define getowner PyEval_GetOwner
  326. #define getframe PyEval_GetFrame
  327. #define getrestricted PyEval_GetRestricted
  328. #define init_save_thread PyEval_InitThreads
  329. #define printtraceback PyErr_PrintTraceBack
  330. #define restore_thread PyEval_RestoreThread
  331. #define save_thread PyEval_SaveThread
  332. #define tb_fetch PyTraceBack_Fetch
  333. #define tb_here PyTraceBack_Here
  334. #define tb_print PyTraceBack_Print
  335. #define tb_store PyTraceBack_Store
  336. #define add_module PyImport_AddModule
  337. #define doneimport PyImport_Cleanup
  338. #define get_modules PyImport_GetModuleDict
  339. #define get_pyc_magic PyImport_GetMagicNumber
  340. #define exec_code_module PyImport_ExecCodeModule
  341. #define import_module PyImport_ImportModule
  342. #define init_frozen PyImport_ImportFrozenModule
  343. #define initimport PyImport_Init
  344. #define reload_module PyImport_ReloadModule
  345. #define coerce PyNumber_Coerce
  346. #define getbuiltin PyBuiltin_GetObject
  347. #define initbuiltin PyBuiltin_Init
  348. #define initmarshal PyMarshal_Init
  349. #define initmodule Py_InitModule
  350. #define initmodule4 Py_InitModule4
  351. #define rd_long PyMarshal_ReadLongFromFile
  352. #define rd_short PyMarshal_ReadShortFromFile
  353. #define rd_object PyMarshal_ReadObjectFromFile
  354. #define rds_object PyMarshal_ReadObjectFromString
  355. #define wr_long PyMarshal_WriteLongToFile
  356. #define wr_short PyMarshal_WriteShortToFile
  357. #define wr_object PyMarshal_WriteObjectToFile
  358. #define initsys PySys_Init
  359. #define setpythonargv PySys_SetArgv
  360. #define setpythonpath PySys_SetPath
  361. #define sysget PySys_GetObject
  362. #define sysgetfile PySys_GetFile
  363. #define sysset PySys_SetObject
  364. #define compile_string Py_CompileString
  365. #define fatal Py_FatalError
  366. #define goaway Py_Exit
  367. #define cleanup Py_Cleanup
  368. #define initall Py_Initialize
  369. #define print_error PyErr_Print
  370. #define parse_file PyParser_SimpleParseFile
  371. #define parse_string PyParser_SimpleParseString
  372. #define run PyRun_AnyFile
  373. #define run_script PyRun_SimpleFile
  374. #define run_command PyRun_SimpleString
  375. #define run_file PyRun_File
  376. #define run_string PyRun_String
  377. #define run_tty_1 PyRun_InteractiveOne
  378. #define run_tty_loop PyRun_InteractiveLoop
  379. #define getmember PyMember_Get
  380. #define setmember PyMember_Set
  381. #define mkvalue Py_BuildValue
  382. #define vmkvalue Py_VaBuildValue
  383. #define getargs PyArg_Parse
  384. #define vgetargs PyArgs_VaParse
  385. #define newgetargs PyArg_ParseTuple
  386. #define getichararg PyArg_GetChar
  387. #define getidoublearray PyArg_GetDoubleArray
  388. #define getifloatarg PyArg_GetFloat
  389. #define getifloatarray PyArg_GetFloatArray
  390. #define getnoarg(v) PyArg_NoArgs(v)
  391. #define getintarg(v,a) getargs((v),"i",(a))
  392. #define getlongarg(v,a) getargs((v),"l",(a))
  393. #define getstrarg(v,a) getargs((v),"s",(a))
  394. #define getilongarg PyArg_GetLong
  395. #define getilongarray PyArg_GetLongArray
  396. #define getilongarraysize PyArg_GetLongArraySize
  397. #define getiobjectarg PyArg_GetObject
  398. #define getishortarg PyArg_GetShort
  399. #define getishortarray PyArg_GetShortArray
  400. #define getishortarraysize PyArg_GetShortArraySize
  401. #define getistringarg PyArg_GetString
  402. #define err_badarg PyErr_BadArgument
  403. #define err_badcall PyErr_BadInternalCall
  404. #define err_input PyErr_Input
  405. #define err_nomem PyErr_NoMemory
  406. #define err_errno PyErr_SetFromErrno
  407. #define err_set PyErr_SetNone
  408. #define err_setstr PyErr_SetString
  409. #define err_setval PyErr_SetObject
  410. #define err_occurred PyErr_Occurred
  411. #define err_fetch PyErr_Fetch
  412. #define err_restore PyErr_Restore
  413. #define err_clear PyErr_Clear
  414. #define fgets_intr PyOS_InterruptableGetString
  415. #define initintr PyOS_InitInterrupts
  416. #define intrcheck PyOS_InterruptOccurred
  417. #define getmtime PyOS_GetLastModificationTime
  418. #define my_readline PyOS_Readline
  419. #define realmain Py_Main
  420. #define ref_total _Py_RefTotal
  421. #define sigcheck PyErr_CheckSignals
  422.  
  423. #ifdef __cplusplus
  424. }
  425. #endif
  426. #endif /* !Py_OLDNAMES_H */
  427.