Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2a9034d3
Commit
2a9034d3
authored
Jul 09, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ANSI-fication and Py_PROTO extermination.
parent
2cf370be
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
340 additions
and
338 deletions
+340
-338
Include/abstract.h
Include/abstract.h
+61
-59
Include/bufferobject.h
Include/bufferobject.h
+14
-12
Include/classobject.h
Include/classobject.h
+33
-32
Include/cobject.h
Include/cobject.h
+12
-12
Include/compile.h
Include/compile.h
+24
-24
Include/complexobject.h
Include/complexobject.h
+17
-17
Include/fileobject.h
Include/fileobject.h
+16
-16
Include/floatobject.h
Include/floatobject.h
+11
-11
Include/frameobject.h
Include/frameobject.h
+34
-35
Include/funcobject.h
Include/funcobject.h
+17
-17
Include/grammar.h
Include/grammar.h
+45
-45
Include/intobject.h
Include/intobject.h
+15
-15
Include/listobject.h
Include/listobject.h
+19
-19
Include/methodobject.h
Include/methodobject.h
+22
-24
No files found.
Include/abstract.h
View file @
2a9034d3
This diff is collapsed.
Click to expand it.
Include/bufferobject.h
View file @
2a9034d3
#ifndef Py_BUFFEROBJECT_H
#define Py_BUFFEROBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -18,6 +12,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Note: the object's structure is private */
#ifndef Py_BUFFEROBJECT_H
#define Py_BUFFEROBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
extern
DL_IMPORT
(
PyTypeObject
)
PyBuffer_Type
;
...
...
@@ -25,16 +25,18 @@ extern DL_IMPORT(PyTypeObject) PyBuffer_Type;
#define Py_END_OF_BUFFER (-1)
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromObject
Py_PROTO
((
PyObject
*
base
,
int
offset
,
int
size
));
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromReadWriteObject
Py_PROTO
((
PyObject
*
base
,
int
offset
,
int
size
));
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromObject
(
PyObject
*
base
,
int
offset
,
int
size
);
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromReadWriteObject
(
PyObject
*
base
,
int
offset
,
int
size
);
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromMemory
Py_PROTO
((
void
*
ptr
,
int
size
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromReadWriteMemory
Py_PROTO
((
void
*
ptr
,
int
size
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromMemory
(
void
*
ptr
,
int
size
);
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_FromReadWriteMemory
(
void
*
ptr
,
int
size
);
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_New
Py_PROTO
((
int
size
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyBuffer_New
(
int
size
);
#ifdef __cplusplus
}
#endif
#endif
/* !Py_BUFFEROBJECT_H */
Include/classobject.h
View file @
2a9034d3
#ifndef Py_CLASSOBJECT_H
#define Py_CLASSOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -18,6 +12,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Revealing some structures (not for general use) */
#ifndef Py_CLASSOBJECT_H
#define Py_CLASSOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
PyObject_HEAD
PyObject
*
cl_bases
;
/* A tuple of class objects */
...
...
@@ -48,13 +48,14 @@ extern DL_IMPORT(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type;
#define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type)
#define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
extern
DL_IMPORT
(
PyObject
*
)
PyClass_New
Py_PROTO
((
PyObject
*
,
PyObject
*
,
PyObject
*
));
extern
DL_IMPORT
(
PyObject
*
)
PyInstance_New
Py_PROTO
((
PyObject
*
,
PyObject
*
,
PyObject
*
));
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_New
Py_PROTO
((
PyObject
*
,
PyObject
*
,
PyObject
*
));
extern
DL_IMPORT
(
PyObject
*
)
PyClass_New
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyInstance_New
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_New
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_Function
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_Self
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_Class
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_Function
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_Self
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyMethod_Class
(
PyObject
*
);
/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
...
...
@@ -65,12 +66,12 @@ extern DL_IMPORT(PyObject *) PyMethod_Class Py_PROTO((PyObject *));
#define PyMethod_GET_CLASS(meth) \
(((PyMethodObject *)meth) -> im_class)
extern
DL_IMPORT
(
int
)
PyClass_IsSubclass
Py_PROTO
((
PyObject
*
,
PyObject
*
)
);
extern
DL_IMPORT
(
int
)
PyClass_IsSubclass
(
PyObject
*
,
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyInstance_DoBinOp
Py_PROTO
((
PyObject
*
,
PyObject
*
,
extern
DL_IMPORT
(
PyObject
*
)
PyInstance_DoBinOp
(
PyObject
*
,
PyObject
*
,
char
*
,
char
*
,
PyObject
*
(
*
)
Py_PROTO
((
PyObject
*
,
PyObject
*
))
));
PyObject
*
(
*
)(
PyObject
*
,
PyObject
*
));
#ifdef __cplusplus
}
...
...
Include/cobject.h
View file @
2a9034d3
#ifndef Py_COBJECT_H
#define Py_COBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -23,6 +17,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef Py_COBJECT_H
#define Py_COBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
extern
DL_IMPORT
(
PyTypeObject
)
PyCObject_Type
;
#define PyCObject_Check(op) ((op)->ob_type == &PyCObject_Type)
...
...
@@ -34,7 +34,7 @@ extern DL_IMPORT(PyTypeObject) PyCObject_Type;
*/
extern
DL_IMPORT
(
PyObject
*
)
PyCObject_FromVoidPtr
Py_PROTO
((
void
*
cobj
,
void
(
*
destruct
)(
void
*
)
));
PyCObject_FromVoidPtr
(
void
*
cobj
,
void
(
*
destruct
)(
void
*
));
/* Create a PyCObject from a pointer to a C object, a description object,
...
...
@@ -43,20 +43,20 @@ PyCObject_FromVoidPtr Py_PROTO((void *cobj, void (*destruct)(void*)));
the PyCObject is destroyed.
*/
extern
DL_IMPORT
(
PyObject
*
)
PyCObject_FromVoidPtrAndDesc
Py_PROTO
(
(
void
*
cobj
,
void
*
desc
,
void
(
*
destruct
)(
void
*
,
void
*
)
));
PyCObject_FromVoidPtrAndDesc
(
void
*
cobj
,
void
*
desc
,
void
(
*
destruct
)(
void
*
,
void
*
));
/* Retrieve a pointer to a C object from a PyCObject. */
extern
DL_IMPORT
(
void
*
)
PyCObject_AsVoidPtr
Py_PROTO
((
PyObject
*
)
);
PyCObject_AsVoidPtr
(
PyObject
*
);
/* Retrieve a pointer to a description object from a PyCObject. */
extern
DL_IMPORT
(
void
*
)
PyCObject_GetDesc
Py_PROTO
((
PyObject
*
)
);
PyCObject_GetDesc
(
PyObject
*
);
/* Import a pointer to a C object from a module using a PyCObject. */
extern
DL_IMPORT
(
void
*
)
PyCObject_Import
Py_PROTO
((
char
*
module_name
,
char
*
cobject_name
)
);
PyCObject_Import
(
char
*
module_name
,
char
*
cobject_name
);
#ifdef __cplusplus
}
...
...
Include/compile.h
View file @
2a9034d3
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Definitions for bytecode */
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
#ifdef __cplusplus
extern
"C"
{
#endif
/* Bytecode object */
typedef
struct
{
PyObject_HEAD
...
...
@@ -48,11 +48,11 @@ extern DL_IMPORT(PyTypeObject) PyCode_Type;
/* Public interface */
struct
_node
;
/* Declare the existence of this type */
DL_IMPORT
(
PyCodeObject
*
)
PyNode_Compile
Py_PROTO
((
struct
_node
*
,
char
*
)
);
DL_IMPORT
(
PyCodeObject
*
)
PyCode_New
Py_PROTO
(
(
DL_IMPORT
(
PyCodeObject
*
)
PyNode_Compile
(
struct
_node
*
,
char
*
);
DL_IMPORT
(
PyCodeObject
*
)
PyCode_New
(
int
,
int
,
int
,
int
,
PyObject
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
,
int
,
PyObject
*
)
)
;
/* same as struct above */
DL_IMPORT
(
int
)
PyCode_Addr2Line
Py_PROTO
((
PyCodeObject
*
,
int
)
);
PyObject
*
,
PyObject
*
,
int
,
PyObject
*
);
/* same as struct above */
DL_IMPORT
(
int
)
PyCode_Addr2Line
(
PyCodeObject
*
,
int
);
/* for internal use only */
#define _PyCode_GETCODEPTR(co, pp) \
...
...
Include/complexobject.h
View file @
2a9034d3
/* Complex number structure */
#ifndef COMPLEXOBJECT_H
#define COMPLEXOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/* Complex number structure */
typedef
struct
{
double
real
;
double
imag
;
...
...
@@ -20,12 +20,12 @@ typedef struct {
#define c_quot _Py_c_quot
#define c_pow _Py_c_pow
extern
DL_IMPORT
(
Py_complex
)
c_sum
Py_PROTO
((
Py_complex
,
Py_complex
)
);
extern
DL_IMPORT
(
Py_complex
)
c_diff
Py_PROTO
((
Py_complex
,
Py_complex
)
);
extern
DL_IMPORT
(
Py_complex
)
c_neg
Py_PROTO
((
Py_complex
)
);
extern
DL_IMPORT
(
Py_complex
)
c_prod
Py_PROTO
((
Py_complex
,
Py_complex
)
);
extern
DL_IMPORT
(
Py_complex
)
c_quot
Py_PROTO
((
Py_complex
,
Py_complex
)
);
extern
DL_IMPORT
(
Py_complex
)
c_pow
Py_PROTO
((
Py_complex
,
Py_complex
)
);
extern
DL_IMPORT
(
Py_complex
)
c_sum
(
Py_complex
,
Py_complex
);
extern
DL_IMPORT
(
Py_complex
)
c_diff
(
Py_complex
,
Py_complex
);
extern
DL_IMPORT
(
Py_complex
)
c_neg
(
Py_complex
);
extern
DL_IMPORT
(
Py_complex
)
c_prod
(
Py_complex
,
Py_complex
);
extern
DL_IMPORT
(
Py_complex
)
c_quot
(
Py_complex
,
Py_complex
);
extern
DL_IMPORT
(
Py_complex
)
c_pow
(
Py_complex
,
Py_complex
);
/* Complex object interface */
...
...
@@ -44,12 +44,12 @@ extern DL_IMPORT(PyTypeObject) PyComplex_Type;
#define PyComplex_Check(op) ((op)->ob_type == &PyComplex_Type)
extern
DL_IMPORT
(
PyObject
*
)
PyComplex_FromCComplex
Py_PROTO
((
Py_complex
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyComplex_FromDoubles
Py_PROTO
((
double
real
,
double
imag
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyComplex_FromCComplex
(
Py_complex
);
extern
DL_IMPORT
(
PyObject
*
)
PyComplex_FromDoubles
(
double
real
,
double
imag
);
extern
DL_IMPORT
(
double
)
PyComplex_RealAsDouble
Py_PROTO
((
PyObject
*
op
)
);
extern
DL_IMPORT
(
double
)
PyComplex_ImagAsDouble
Py_PROTO
((
PyObject
*
op
)
);
extern
DL_IMPORT
(
Py_complex
)
PyComplex_AsCComplex
Py_PROTO
((
PyObject
*
op
)
);
extern
DL_IMPORT
(
double
)
PyComplex_RealAsDouble
(
PyObject
*
op
);
extern
DL_IMPORT
(
double
)
PyComplex_ImagAsDouble
(
PyObject
*
op
);
extern
DL_IMPORT
(
Py_complex
)
PyComplex_AsCComplex
(
PyObject
*
op
);
#ifdef __cplusplus
}
...
...
Include/fileobject.h
View file @
2a9034d3
#ifndef Py_FILEOBJECT_H
#define Py_FILEOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -16,20 +10,26 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* File object interface */
#ifndef Py_FILEOBJECT_H
#define Py_FILEOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
extern
DL_IMPORT
(
PyTypeObject
)
PyFile_Type
;
#define PyFile_Check(op) ((op)->ob_type == &PyFile_Type)
extern
DL_IMPORT
(
PyObject
*
)
PyFile_FromString
Py_PROTO
((
char
*
,
char
*
)
);
extern
DL_IMPORT
(
void
)
PyFile_SetBufSize
Py_PROTO
((
PyObject
*
,
int
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFile_FromFile
Py_PROTO
((
FILE
*
,
char
*
,
char
*
,
int
(
*
)
Py_FPROTO
((
FILE
*
))
));
extern
DL_IMPORT
(
FILE
*
)
PyFile_AsFile
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFile_Name
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFile_GetLine
Py_PROTO
((
PyObject
*
,
int
)
);
extern
DL_IMPORT
(
int
)
PyFile_WriteObject
Py_PROTO
((
PyObject
*
,
PyObject
*
,
int
)
);
extern
DL_IMPORT
(
int
)
PyFile_SoftSpace
Py_PROTO
((
PyObject
*
,
int
)
);
extern
DL_IMPORT
(
int
)
PyFile_WriteString
Py_PROTO
((
char
*
,
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFile_FromString
(
char
*
,
char
*
);
extern
DL_IMPORT
(
void
)
PyFile_SetBufSize
(
PyObject
*
,
int
);
extern
DL_IMPORT
(
PyObject
*
)
PyFile_FromFile
(
FILE
*
,
char
*
,
char
*
,
int
(
*
)(
FILE
*
));
extern
DL_IMPORT
(
FILE
*
)
PyFile_AsFile
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyFile_Name
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyFile_GetLine
(
PyObject
*
,
int
);
extern
DL_IMPORT
(
int
)
PyFile_WriteObject
(
PyObject
*
,
PyObject
*
,
int
);
extern
DL_IMPORT
(
int
)
PyFile_SoftSpace
(
PyObject
*
,
int
);
extern
DL_IMPORT
(
int
)
PyFile_WriteString
(
char
*
,
PyObject
*
);
#ifdef __cplusplus
}
...
...
Include/floatobject.h
View file @
2a9034d3
#ifndef Py_FLOATOBJECT_H
#define Py_FLOATOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -20,6 +14,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
PyFloatObject represents a (double precision) floating point number.
*/
#ifndef Py_FLOATOBJECT_H
#define Py_FLOATOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
PyObject_HEAD
double
ob_fval
;
...
...
@@ -29,9 +29,9 @@ extern DL_IMPORT(PyTypeObject) PyFloat_Type;
#define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type)
extern
DL_IMPORT
(
PyObject
*
)
PyFloat_FromString
Py_PROTO
((
PyObject
*
,
char
**
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFloat_FromDouble
Py_PROTO
((
double
)
);
extern
DL_IMPORT
(
double
)
PyFloat_AsDouble
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFloat_FromString
(
PyObject
*
,
char
**
);
extern
DL_IMPORT
(
PyObject
*
)
PyFloat_FromDouble
(
double
);
extern
DL_IMPORT
(
double
)
PyFloat_AsDouble
(
PyObject
*
);
/* Macro, trading safety for speed */
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
...
...
Include/frameobject.h
View file @
2a9034d3
#ifndef Py_FRAMEOBJECT_H
#define Py_FRAMEOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Frame object interface */
#ifndef Py_FRAMEOBJECT_H
#define Py_FRAMEOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
int
b_type
;
/* what kind of block this is */
int
b_handler
;
/* where to jump to find handler */
...
...
@@ -51,9 +51,8 @@ extern DL_IMPORT(PyTypeObject) PyFrame_Type;
#define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type)
DL_IMPORT
(
PyFrameObject
*
)
PyFrame_New
Py_PROTO
((
PyThreadState
*
,
PyCodeObject
*
,
PyObject
*
,
PyObject
*
));
DL_IMPORT
(
PyFrameObject
*
)
PyFrame_New
(
PyThreadState
*
,
PyCodeObject
*
,
PyObject
*
,
PyObject
*
);
/* The rest of the interface is specific for frame objects */
...
...
@@ -80,17 +79,17 @@ DL_IMPORT(PyFrameObject *) PyFrame_New
/* Block management functions */
DL_IMPORT
(
void
)
PyFrame_BlockSetup
Py_PROTO
((
PyFrameObject
*
,
int
,
int
,
int
)
);
DL_IMPORT
(
PyTryBlock
*
)
PyFrame_BlockPop
Py_PROTO
((
PyFrameObject
*
)
);
DL_IMPORT
(
void
)
PyFrame_BlockSetup
(
PyFrameObject
*
,
int
,
int
,
int
);
DL_IMPORT
(
PyTryBlock
*
)
PyFrame_BlockPop
(
PyFrameObject
*
);
/* Extend the value stack */
DL_IMPORT
(
PyObject
**
)
PyFrame_ExtendStack
Py_PROTO
((
PyFrameObject
*
,
int
,
int
)
);
DL_IMPORT
(
PyObject
**
)
PyFrame_ExtendStack
(
PyFrameObject
*
,
int
,
int
);
/* Conversions between "fast locals" and locals in dictionary */
DL_IMPORT
(
void
)
PyFrame_LocalsToFast
Py_PROTO
((
PyFrameObject
*
,
int
)
);
DL_IMPORT
(
void
)
PyFrame_FastToLocals
Py_PROTO
((
PyFrameObject
*
)
);
DL_IMPORT
(
void
)
PyFrame_LocalsToFast
(
PyFrameObject
*
,
int
);
DL_IMPORT
(
void
)
PyFrame_FastToLocals
(
PyFrameObject
*
);
#ifdef __cplusplus
}
...
...
Include/funcobject.h
View file @
2a9034d3
#ifndef Py_FUNCOBJECT_H
#define Py_FUNCOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Function object interface */
#ifndef Py_FUNCOBJECT_H
#define Py_FUNCOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
PyObject_HEAD
PyObject
*
func_code
;
...
...
@@ -29,11 +29,11 @@ extern DL_IMPORT(PyTypeObject) PyFunction_Type;
#define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type)
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_New
Py_PROTO
((
PyObject
*
,
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_GetCode
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_GetGlobals
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_GetDefaults
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
int
)
PyFunction_SetDefaults
Py_PROTO
((
PyObject
*
,
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_New
(
PyObject
*
,
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_GetCode
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_GetGlobals
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyFunction_GetDefaults
(
PyObject
*
);
extern
DL_IMPORT
(
int
)
PyFunction_SetDefaults
(
PyObject
*
,
PyObject
*
);
/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
...
...
Include/grammar.h
View file @
2a9034d3
#ifndef Py_GRAMMAR_H
#define Py_GRAMMAR_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Grammar interface */
#ifndef Py_GRAMMAR_H
#define Py_GRAMMAR_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include "bitset.h"
/* Sigh... */
/* A label of an arc */
...
...
@@ -77,25 +77,25 @@ typedef struct {
/* FUNCTIONS */
grammar
*
newgrammar
Py_PROTO
((
int
start
)
);
dfa
*
adddfa
Py_PROTO
((
grammar
*
g
,
int
type
,
char
*
name
)
);
int
addstate
Py_PROTO
((
dfa
*
d
)
);
void
addarc
Py_PROTO
((
dfa
*
d
,
int
from
,
int
to
,
int
lbl
)
);
dfa
*
PyGrammar_FindDFA
Py_PROTO
((
grammar
*
g
,
int
type
)
);
char
*
typename
Py_PROTO
((
grammar
*
g
,
int
lbl
)
);
grammar
*
newgrammar
(
int
start
);
dfa
*
adddfa
(
grammar
*
g
,
int
type
,
char
*
name
);
int
addstate
(
dfa
*
d
);
void
addarc
(
dfa
*
d
,
int
from
,
int
to
,
int
lbl
);
dfa
*
PyGrammar_FindDFA
(
grammar
*
g
,
int
type
);
char
*
typename
(
grammar
*
g
,
int
lbl
);
int
addlabel
Py_PROTO
((
labellist
*
ll
,
int
type
,
char
*
str
)
);
int
findlabel
Py_PROTO
((
labellist
*
ll
,
int
type
,
char
*
str
)
);
char
*
PyGrammar_LabelRepr
Py_PROTO
((
label
*
lb
)
);
void
translatelabels
Py_PROTO
((
grammar
*
g
)
);
int
addlabel
(
labellist
*
ll
,
int
type
,
char
*
str
);
int
findlabel
(
labellist
*
ll
,
int
type
,
char
*
str
);
char
*
PyGrammar_LabelRepr
(
label
*
lb
);
void
translatelabels
(
grammar
*
g
);
void
addfirstsets
Py_PROTO
((
grammar
*
g
)
);
void
addfirstsets
(
grammar
*
g
);
void
PyGrammar_AddAccelerators
Py_PROTO
((
grammar
*
g
)
);
void
PyGrammar_RemoveAccelerators
Py_PROTO
((
grammar
*
)
);
void
PyGrammar_AddAccelerators
(
grammar
*
g
);
void
PyGrammar_RemoveAccelerators
(
grammar
*
);
void
printgrammar
Py_PROTO
((
grammar
*
g
,
FILE
*
fp
)
);
void
printnonterminals
Py_PROTO
((
grammar
*
g
,
FILE
*
fp
)
);
void
printgrammar
(
grammar
*
g
,
FILE
*
fp
);
void
printnonterminals
(
grammar
*
g
,
FILE
*
fp
);
#ifdef __cplusplus
}
...
...
Include/intobject.h
View file @
2a9034d3
#ifndef Py_INTOBJECT_H
#define Py_INTOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -29,6 +23,12 @@ The type PyIntObject is (unfortunately) exposed here so we can declare
_Py_TrueStruct and _Py_ZeroStruct below; don't use this.
*/
#ifndef Py_INTOBJECT_H
#define Py_INTOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
PyObject_HEAD
long
ob_ival
;
...
...
@@ -38,11 +38,11 @@ extern DL_IMPORT(PyTypeObject) PyInt_Type;
#define PyInt_Check(op) ((op)->ob_type == &PyInt_Type)
extern
DL_IMPORT
(
PyObject
*
)
PyInt_FromString
Py_PROTO
((
char
*
,
char
**
,
int
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyInt_FromUnicode
Py_PROTO
((
Py_UNICODE
*
,
int
,
int
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyInt_FromLong
Py_PROTO
((
long
)
);
extern
DL_IMPORT
(
long
)
PyInt_AsLong
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
long
)
PyInt_GetMax
Py_PROTO
((
void
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyInt_FromString
(
char
*
,
char
**
,
int
);
extern
DL_IMPORT
(
PyObject
*
)
PyInt_FromUnicode
(
Py_UNICODE
*
,
int
,
int
);
extern
DL_IMPORT
(
PyObject
*
)
PyInt_FromLong
(
long
);
extern
DL_IMPORT
(
long
)
PyInt_AsLong
(
PyObject
*
);
extern
DL_IMPORT
(
long
)
PyInt_GetMax
(
void
);
/*
...
...
@@ -68,8 +68,8 @@ extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; /* Don't use these
* into the main Python shared library/DLL. Guido thinks I'm weird for
* building it this way. :-) [cjh]
*/
extern
DL_IMPORT
(
unsigned
long
)
PyOS_strtoul
Py_PROTO
((
char
*
,
char
**
,
int
)
);
extern
DL_IMPORT
(
long
)
PyOS_strtol
Py_PROTO
((
char
*
,
char
**
,
int
)
);
extern
DL_IMPORT
(
unsigned
long
)
PyOS_strtoul
(
char
*
,
char
**
,
int
);
extern
DL_IMPORT
(
long
)
PyOS_strtol
(
char
*
,
char
**
,
int
);
#ifdef __cplusplus
}
...
...
Include/listobject.h
View file @
2a9034d3
#ifndef Py_LISTOBJECT_H
#define Py_LISTOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -28,6 +22,12 @@ inserted in the list. Similarly, PyList_GetItem does not increment the
returned item's reference count.
*/
#ifndef Py_LISTOBJECT_H
#define Py_LISTOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
{
PyObject_VAR_HEAD
PyObject
**
ob_item
;
...
...
@@ -37,17 +37,17 @@ extern DL_IMPORT(PyTypeObject) PyList_Type;
#define PyList_Check(op) ((op)->ob_type == &PyList_Type)
extern
DL_IMPORT
(
PyObject
*
)
PyList_New
Py_PROTO
((
int
size
)
);
extern
DL_IMPORT
(
int
)
PyList_Size
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyList_GetItem
Py_PROTO
((
PyObject
*
,
int
)
);
extern
DL_IMPORT
(
int
)
PyList_SetItem
Py_PROTO
((
PyObject
*
,
int
,
PyObject
*
)
);
extern
DL_IMPORT
(
int
)
PyList_Insert
Py_PROTO
((
PyObject
*
,
int
,
PyObject
*
)
);
extern
DL_IMPORT
(
int
)
PyList_Append
Py_PROTO
((
PyObject
*
,
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyList_GetSlice
Py_PROTO
((
PyObject
*
,
int
,
int
)
);
extern
DL_IMPORT
(
int
)
PyList_SetSlice
Py_PROTO
((
PyObject
*
,
int
,
int
,
PyObject
*
)
);
extern
DL_IMPORT
(
int
)
PyList_Sort
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
int
)
PyList_Reverse
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyList_AsTuple
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyList_New
(
int
size
);
extern
DL_IMPORT
(
int
)
PyList_Size
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyList_GetItem
(
PyObject
*
,
int
);
extern
DL_IMPORT
(
int
)
PyList_SetItem
(
PyObject
*
,
int
,
PyObject
*
);
extern
DL_IMPORT
(
int
)
PyList_Insert
(
PyObject
*
,
int
,
PyObject
*
);
extern
DL_IMPORT
(
int
)
PyList_Append
(
PyObject
*
,
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyList_GetSlice
(
PyObject
*
,
int
,
int
);
extern
DL_IMPORT
(
int
)
PyList_SetSlice
(
PyObject
*
,
int
,
int
,
PyObject
*
);
extern
DL_IMPORT
(
int
)
PyList_Sort
(
PyObject
*
);
extern
DL_IMPORT
(
int
)
PyList_Reverse
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyList_AsTuple
(
PyObject
*
);
/* Macro, trading safety for speed */
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
...
...
Include/methodobject.h
View file @
2a9034d3
#ifndef Py_METHODOBJECT_H
#define Py_METHODOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
...
...
@@ -16,6 +10,12 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Method object interface */
#ifndef Py_METHODOBJECT_H
#define Py_METHODOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
extern
DL_IMPORT
(
PyTypeObject
)
PyCFunction_Type
;
#define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type)
...
...
@@ -24,9 +24,9 @@ typedef PyObject *(*PyCFunction) Py_FPROTO((PyObject *, PyObject *));
typedef
PyObject
*
(
*
PyCFunctionWithKeywords
)
Py_FPROTO
((
PyObject
*
,
PyObject
*
,
PyObject
*
));
extern
DL_IMPORT
(
PyCFunction
)
PyCFunction_GetFunction
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
PyCFunction_GetSelf
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
int
)
PyCFunction_GetFlags
Py_PROTO
((
PyObject
*
)
);
extern
DL_IMPORT
(
PyCFunction
)
PyCFunction_GetFunction
(
PyObject
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyCFunction_GetSelf
(
PyObject
*
);
extern
DL_IMPORT
(
int
)
PyCFunction_GetFlags
(
PyObject
*
);
/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
...
...
@@ -45,11 +45,9 @@ struct PyMethodDef {
};
typedef
struct
PyMethodDef
PyMethodDef
;
extern
DL_IMPORT
(
PyObject
*
)
Py_FindMethod
Py_PROTO
((
PyMethodDef
[],
PyObject
*
,
char
*
));
extern
DL_IMPORT
(
PyObject
*
)
Py_FindMethod
(
PyMethodDef
[],
PyObject
*
,
char
*
);
extern
DL_IMPORT
(
PyObject
*
)
PyCFunction_New
Py_PROTO
((
PyMethodDef
*
,
PyObject
*
));
extern
DL_IMPORT
(
PyObject
*
)
PyCFunction_New
(
PyMethodDef
*
,
PyObject
*
);
/* Flag passed to newmethodobject */
#define METH_VARARGS 0x0001
...
...
@@ -60,8 +58,8 @@ typedef struct PyMethodChain {
struct
PyMethodChain
*
link
;
/* NULL or base type */
}
PyMethodChain
;
extern
DL_IMPORT
(
PyObject
*
)
Py_FindMethodInChain
Py_PROTO
((
PyMethodChain
*
,
PyObject
*
,
char
*
)
);
extern
DL_IMPORT
(
PyObject
*
)
Py_FindMethodInChain
(
PyMethodChain
*
,
PyObject
*
,
char
*
);
typedef
struct
{
PyObject_HEAD
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment