Skip to content

Commit

Permalink
ANSI-fication and Py_PROTO extermination.
Browse files Browse the repository at this point in the history
  • Loading branch information
freddrake committed Jul 9, 2000
1 parent ea9cb5a commit 3cf4d2b
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 173 deletions.
22 changes: 11 additions & 11 deletions Include/moduleobject.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#ifndef Py_MODULEOBJECT_H
#define Py_MODULEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
Expand All @@ -16,15 +10,21 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.

/* Module object interface */

#ifndef Py_MODULEOBJECT_H
#define Py_MODULEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

extern DL_IMPORT(PyTypeObject) PyModule_Type;

#define PyModule_Check(op) ((op)->ob_type == &PyModule_Type)

extern DL_IMPORT(PyObject *) PyModule_New Py_PROTO((char *));
extern DL_IMPORT(PyObject *) PyModule_GetDict Py_PROTO((PyObject *));
extern DL_IMPORT(char *) PyModule_GetName Py_PROTO((PyObject *));
extern DL_IMPORT(char *) PyModule_GetFilename Py_PROTO((PyObject *));
extern DL_IMPORT(void) _PyModule_Clear Py_PROTO((PyObject *));
extern DL_IMPORT(PyObject *) PyModule_New(char *);
extern DL_IMPORT(PyObject *) PyModule_GetDict(PyObject *);
extern DL_IMPORT(char *) PyModule_GetName(PyObject *);
extern DL_IMPORT(char *) PyModule_GetFilename(PyObject *);
extern DL_IMPORT(void) _PyModule_Clear(PyObject *);

#ifdef __cplusplus
}
Expand Down
33 changes: 17 additions & 16 deletions Include/objimpl.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#ifndef Py_OBJIMPL_H
#define Py_OBJIMPL_H
#ifdef __cplusplus
extern "C" {
#endif

/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
Expand All @@ -14,6 +8,12 @@ See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/

#ifndef Py_OBJIMPL_H
#define Py_OBJIMPL_H
#ifdef __cplusplus
extern "C" {
#endif

#include "mymalloc.h"

/*
Expand Down Expand Up @@ -137,9 +137,9 @@ extern void PyCore_OBJECT_FREE_FUNC PyCore_OBJECT_FREE_PROTO;
as Python. These wrappers *do not* make sure that allocating 0
bytes returns a non-NULL pointer. Returned pointers must be checked
for NULL explicitly; no action is performed on failure. */
extern DL_IMPORT(ANY *) PyObject_Malloc Py_PROTO((size_t));
extern DL_IMPORT(ANY *) PyObject_Realloc Py_PROTO((ANY *, size_t));
extern DL_IMPORT(void) PyObject_Free Py_PROTO((ANY *));
extern DL_IMPORT(ANY *) PyObject_Malloc(size_t);
extern DL_IMPORT(ANY *) PyObject_Realloc(ANY *, size_t);
extern DL_IMPORT(void) PyObject_Free(ANY *);

/* Macros */
#define PyObject_MALLOC(n) PyCore_OBJECT_MALLOC(n)
Expand All @@ -152,11 +152,12 @@ extern DL_IMPORT(void) PyObject_Free Py_PROTO((ANY *));
*/

/* Functions */
extern DL_IMPORT(PyObject *) PyObject_Init Py_PROTO((PyObject *, PyTypeObject *));
extern DL_IMPORT(PyVarObject *) PyObject_InitVar Py_PROTO((PyVarObject *, PyTypeObject *, int));
extern DL_IMPORT(PyObject *) _PyObject_New Py_PROTO((PyTypeObject *));
extern DL_IMPORT(PyVarObject *) _PyObject_NewVar Py_PROTO((PyTypeObject *, int));
extern DL_IMPORT(void) _PyObject_Del Py_PROTO((PyObject *));
extern DL_IMPORT(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
extern DL_IMPORT(PyVarObject *) PyObject_InitVar(PyVarObject *,
PyTypeObject *, int);
extern DL_IMPORT(PyObject *) _PyObject_New(PyTypeObject *);
extern DL_IMPORT(PyVarObject *) _PyObject_NewVar(PyTypeObject *, int);
extern DL_IMPORT(void) _PyObject_Del(PyObject *);

#define PyObject_New(type, typeobj) \
( (type *) _PyObject_New(typeobj) )
Expand Down Expand Up @@ -240,10 +241,10 @@ extern DL_IMPORT(void) _PyObject_Del Py_PROTO((PyObject *));
#else

/* Add the object into the container set */
extern DL_IMPORT(void) _PyGC_Insert Py_PROTO((PyObject *));
extern DL_IMPORT(void) _PyGC_Insert(PyObject *);

/* Remove the object from the container set */
extern DL_IMPORT(void) _PyGC_Remove Py_PROTO((PyObject *));
extern DL_IMPORT(void) _PyGC_Remove(PyObject *);

#define PyObject_GC_Init(op) _PyGC_Insert((PyObject *)op)
#define PyObject_GC_Fini(op) _PyGC_Remove((PyObject *)op)
Expand Down
112 changes: 56 additions & 56 deletions Include/pythonrun.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#ifndef Py_PYTHONRUN_H
#define Py_PYTHONRUN_H
#ifdef __cplusplus
extern "C" {
#endif

/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
Expand All @@ -16,77 +10,83 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.

/* Interfaces to parse and execute pieces of python code */

DL_IMPORT(void) Py_SetProgramName Py_PROTO((char *));
DL_IMPORT(char *) Py_GetProgramName Py_PROTO((void));
#ifndef Py_PYTHONRUN_H
#define Py_PYTHONRUN_H
#ifdef __cplusplus
extern "C" {
#endif

DL_IMPORT(void) Py_SetProgramName(char *);
DL_IMPORT(char *) Py_GetProgramName(void);

DL_IMPORT(void) Py_SetPythonHome Py_PROTO((char *));
DL_IMPORT(char *) Py_GetPythonHome Py_PROTO((void));
DL_IMPORT(void) Py_SetPythonHome(char *);
DL_IMPORT(char *) Py_GetPythonHome(void);

DL_IMPORT(void) Py_Initialize Py_PROTO((void));
DL_IMPORT(void) Py_Finalize Py_PROTO((void));
DL_IMPORT(int) Py_IsInitialized Py_PROTO((void));
DL_IMPORT(PyThreadState *) Py_NewInterpreter Py_PROTO((void));
DL_IMPORT(void) Py_EndInterpreter Py_PROTO((PyThreadState *));
DL_IMPORT(void) Py_Initialize(void);
DL_IMPORT(void) Py_Finalize(void);
DL_IMPORT(int) Py_IsInitialized(void);
DL_IMPORT(PyThreadState *) Py_NewInterpreter(void);
DL_IMPORT(void) Py_EndInterpreter(PyThreadState *);

DL_IMPORT(int) PyRun_AnyFile Py_PROTO((FILE *, char *));
DL_IMPORT(int) PyRun_AnyFile(FILE *, char *);

DL_IMPORT(int) PyRun_SimpleString Py_PROTO((char *));
DL_IMPORT(int) PyRun_SimpleFile Py_PROTO((FILE *, char *));
DL_IMPORT(int) PyRun_InteractiveOne Py_PROTO((FILE *, char *));
DL_IMPORT(int) PyRun_InteractiveLoop Py_PROTO((FILE *, char *));
DL_IMPORT(int) PyRun_SimpleString(char *);
DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *);
DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *);
DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *);

DL_IMPORT(struct _node *) PyParser_SimpleParseString Py_PROTO((char *, int));
DL_IMPORT(struct _node *) PyParser_SimpleParseFile Py_PROTO((FILE *, char *, int));
DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int);
DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);

DL_IMPORT(PyObject *) PyRun_String Py_PROTO((char *, int, PyObject *, PyObject *));
DL_IMPORT(PyObject *) PyRun_File Py_PROTO((FILE *, char *, int, PyObject *, PyObject *));
DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);
DL_IMPORT(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *);

DL_IMPORT(PyObject *) Py_CompileString Py_PROTO((char *, char *, int));
DL_IMPORT(PyObject *) Py_CompileString(char *, char *, int);

DL_IMPORT(void) PyErr_Print Py_PROTO((void));
DL_IMPORT(void) PyErr_PrintEx Py_PROTO((int));
DL_IMPORT(void) PyErr_Print(void);
DL_IMPORT(void) PyErr_PrintEx(int);

DL_IMPORT(int) Py_AtExit Py_PROTO((void (*func) Py_PROTO((void))));
DL_IMPORT(int) Py_AtExit(void (*func)(void));

DL_IMPORT(void) Py_Exit Py_PROTO((int));
DL_IMPORT(void) Py_Exit(int);

DL_IMPORT(int) Py_FdIsInteractive Py_PROTO((FILE *, char *));
DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *);

/* In getpath.c */
DL_IMPORT(char *) Py_GetProgramFullPath Py_PROTO((void));
DL_IMPORT(char *) Py_GetPrefix Py_PROTO((void));
DL_IMPORT(char *) Py_GetExecPrefix Py_PROTO((void));
DL_IMPORT(char *) Py_GetPath Py_PROTO((void));
DL_IMPORT(char *) Py_GetProgramFullPath(void);
DL_IMPORT(char *) Py_GetPrefix(void);
DL_IMPORT(char *) Py_GetExecPrefix(void);
DL_IMPORT(char *) Py_GetPath(void);

/* In their own files */
DL_IMPORT(const char *) Py_GetVersion Py_PROTO((void));
DL_IMPORT(const char *) Py_GetPlatform Py_PROTO((void));
DL_IMPORT(const char *) Py_GetCopyright Py_PROTO((void));
DL_IMPORT(const char *) Py_GetCompiler Py_PROTO((void));
DL_IMPORT(const char *) Py_GetBuildInfo Py_PROTO((void));
DL_IMPORT(const char *) Py_GetVersion(void);
DL_IMPORT(const char *) Py_GetPlatform(void);
DL_IMPORT(const char *) Py_GetCopyright(void);
DL_IMPORT(const char *) Py_GetCompiler(void);
DL_IMPORT(const char *) Py_GetBuildInfo(void);

/* Internal -- various one-time initializations */
DL_IMPORT(PyObject *) _PyBuiltin_Init Py_PROTO((void));
DL_IMPORT(PyObject *) _PySys_Init Py_PROTO((void));
DL_IMPORT(void) _PyImport_Init Py_PROTO((void));
DL_IMPORT(void) init_exceptions Py_PROTO((void));
DL_IMPORT(PyObject *) _PyBuiltin_Init(void);
DL_IMPORT(PyObject *) _PySys_Init(void);
DL_IMPORT(void) _PyImport_Init(void);
DL_IMPORT(void) init_exceptions(void);

/* Various internal finalizers */
DL_IMPORT(void) fini_exceptions Py_PROTO((void));
DL_IMPORT(void) _PyImport_Fini Py_PROTO((void));
DL_IMPORT(void) PyMethod_Fini Py_PROTO((void));
DL_IMPORT(void) PyFrame_Fini Py_PROTO((void));
DL_IMPORT(void) PyCFunction_Fini Py_PROTO((void));
DL_IMPORT(void) PyTuple_Fini Py_PROTO((void));
DL_IMPORT(void) PyString_Fini Py_PROTO((void));
DL_IMPORT(void) PyInt_Fini Py_PROTO((void));
DL_IMPORT(void) PyFloat_Fini Py_PROTO((void));
DL_IMPORT(void) PyOS_FiniInterrupts Py_PROTO((void));
DL_IMPORT(void) fini_exceptions(void);
DL_IMPORT(void) _PyImport_Fini(void);
DL_IMPORT(void) PyMethod_Fini(void);
DL_IMPORT(void) PyFrame_Fini(void);
DL_IMPORT(void) PyCFunction_Fini(void);
DL_IMPORT(void) PyTuple_Fini(void);
DL_IMPORT(void) PyString_Fini(void);
DL_IMPORT(void) PyInt_Fini(void);
DL_IMPORT(void) PyFloat_Fini(void);
DL_IMPORT(void) PyOS_FiniInterrupts(void);

/* Stuff with no proper home (yet) */
DL_IMPORT(char *) PyOS_Readline Py_PROTO((char *));
extern DL_IMPORT(int) (*PyOS_InputHook) Py_PROTO((void));
extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer) Py_PROTO((char *));
DL_IMPORT(char *) PyOS_Readline(char *);
extern DL_IMPORT(int) (*PyOS_InputHook)(void);
extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *);

#ifdef __cplusplus
}
Expand Down
52 changes: 22 additions & 30 deletions Include/pythread.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef Py_PYTHREAD_H
#define Py_PYTHREAD_H

/***********************************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
Expand All @@ -11,53 +8,48 @@ See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/

#ifndef Py_PYTHREAD_H
#define Py_PYTHREAD_H

#define NO_EXIT_PROG /* don't define PyThread_exit_prog() */
/* (the result is no use of signals on SGI) */

#ifndef Py_PROTO
#if defined(__STDC__) || defined(__cplusplus)
#define Py_PROTO(args) args
#else
#define Py_PROTO(args) ()
#endif
#endif

typedef void *PyThread_type_lock;
typedef void *PyThread_type_sema;

#ifdef __cplusplus
extern "C" {
#endif

DL_IMPORT(void) PyThread_init_thread Py_PROTO((void));
DL_IMPORT(int) PyThread_start_new_thread Py_PROTO((void (*)(void *), void *));
DL_IMPORT(void) PyThread_exit_thread Py_PROTO((void));
DL_IMPORT(void) PyThread__PyThread_exit_thread Py_PROTO((void));
DL_IMPORT(long) PyThread_get_thread_ident Py_PROTO((void));
DL_IMPORT(void) PyThread_init_thread(void);
DL_IMPORT(int) PyThread_start_new_thread(void (*)(void *), void *);
DL_IMPORT(void) PyThread_exit_thread(void);
DL_IMPORT(void) PyThread__PyThread_exit_thread(void);
DL_IMPORT(long) PyThread_get_thread_ident(void);

DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock Py_PROTO((void));
DL_IMPORT(void) PyThread_free_lock Py_PROTO((PyThread_type_lock));
DL_IMPORT(int) PyThread_acquire_lock Py_PROTO((PyThread_type_lock, int));
DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock(void);
DL_IMPORT(void) PyThread_free_lock(PyThread_type_lock);
DL_IMPORT(int) PyThread_acquire_lock(PyThread_type_lock, int);
#define WAIT_LOCK 1
#define NOWAIT_LOCK 0
DL_IMPORT(void) PyThread_release_lock Py_PROTO((PyThread_type_lock));
DL_IMPORT(void) PyThread_release_lock(PyThread_type_lock);

DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema Py_PROTO((int));
DL_IMPORT(void) PyThread_free_sema Py_PROTO((PyThread_type_sema));
DL_IMPORT(int) PyThread_down_sema Py_PROTO((PyThread_type_sema, int));
DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema(int);
DL_IMPORT(void) PyThread_free_sema(PyThread_type_sema);
DL_IMPORT(int) PyThread_down_sema(PyThread_type_sema, int);
#define WAIT_SEMA 1
#define NOWAIT_SEMA 0
DL_IMPORT(void) PyThread_up_sema Py_PROTO((PyThread_type_sema));
DL_IMPORT(void) PyThread_up_sema(PyThread_type_sema);

#ifndef NO_EXIT_PROG
DL_IMPORT(void) PyThread_exit_prog Py_PROTO((int));
DL_IMPORT(void) PyThread__PyThread_exit_prog Py_PROTO((int));
DL_IMPORT(void) PyThread_exit_prog(int);
DL_IMPORT(void) PyThread__PyThread_exit_prog(int);
#endif

DL_IMPORT(int) PyThread_create_key Py_PROTO((void));
DL_IMPORT(void) PyThread_delete_key Py_PROTO((int));
DL_IMPORT(int) PyThread_set_key_value Py_PROTO((int, void *));
DL_IMPORT(void *) PyThread_get_key_value Py_PROTO((int));
DL_IMPORT(int) PyThread_create_key(void);
DL_IMPORT(void) PyThread_delete_key(int);
DL_IMPORT(int) PyThread_set_key_value(int, void *);
DL_IMPORT(void *) PyThread_get_key_value(int);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion Include/rangeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ extern DL_IMPORT(PyTypeObject) PyRange_Type;

#define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)

extern DL_IMPORT(PyObject *) PyRange_New Py_PROTO((long, long, long, int));
extern DL_IMPORT(PyObject *) PyRange_New(long, long, long, int);
12 changes: 6 additions & 6 deletions Include/sliceobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ let these be any arbitrary python type.
*/

typedef struct {
PyObject_HEAD
PyObject *start, *stop, *step;
PyObject_HEAD
PyObject *start, *stop, *step;
} PySliceObject;

extern DL_IMPORT(PyTypeObject) PySlice_Type;

#define PySlice_Check(op) ((op)->ob_type == &PySlice_Type)

DL_IMPORT(PyObject *) PySlice_New Py_PROTO((
PyObject* start, PyObject* stop, PyObject* step));
DL_IMPORT(int) PySlice_GetIndices Py_PROTO((
PySliceObject *r, int length, int *start, int *stop, int *step));
DL_IMPORT(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* step);
DL_IMPORT(int) PySlice_GetIndices(PySliceObject *r, int length,
int *start, int *stop, int *step);

#ifdef __cplusplus
}
Expand Down
Loading

0 comments on commit 3cf4d2b

Please sign in to comment.