- Improve the runtime type sytesm

- Update all languages to new type system
- Add DohSortList function
- Fix mzscheme Examples/Makefile


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6930 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
John Lenz 2005-02-01 00:08:24 +00:00
commit c3338b1a16
48 changed files with 1383 additions and 1021 deletions

View file

@ -2,6 +2,8 @@
* The start of the Python initialization function
* ------------------------------------------------------------ */
%insert(init) "swiginit.swg"
%init %{
#ifdef __cplusplus
@ -263,33 +265,6 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o)
}
#endif
static swig_type_info **
SWIG_Python_SetTypeListHandle(swig_type_info **type_list_handle) {
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
swig_empty_runtime_method_table);
PyObject *pointer = PyCObject_FromVoidPtr((void *) type_list_handle, NULL);
if (pointer && module) {
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
}
return type_list_handle;
}
static swig_type_info **
SWIG_Python_LookupTypePointer(swig_type_info **type_list_handle) {
swig_type_info **type_pointer;
/* first check if module already created */
type_pointer = SWIG_Python_GetTypeListHandle();
if (type_pointer) {
return type_pointer;
} else {
/* create a new module and variable */
return SWIG_Python_SetTypeListHandle(type_list_handle);
}
}
#ifdef __cplusplus
}
#endif
@ -298,42 +273,22 @@ SWIG_Python_LookupTypePointer(swig_type_info **type_list_handle) {
* Partial Init method
* -----------------------------------------------------------------------------*/
#ifdef SWIG_LINK_RUNTIME
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void *) SWIG_ReturnGlobalTypeList(void *);
#endif
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) SWIG_init(void) {
static PyObject *SWIG_globals = 0;
static int typeinit = 0;
PyObject *m, *d;
int i;
if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
/* Fix SwigMethods to carry the callback ptrs when needed */
SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_types_initial);
SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
m = Py_InitModule((char *) SWIG_name, SwigMethods);
d = PyModule_GetDict(m);
if (!typeinit) {
#ifdef SWIG_LINK_RUNTIME
swig_type_list_handle = (swig_type_info **) SWIG_ReturnGlobalTypeList(swig_type_list_handle);
#else
# ifndef SWIG_STATIC_RUNTIME
swig_type_list_handle = SWIG_Python_LookupTypePointer(swig_type_list_handle);
# endif
#endif
for (i = 0; swig_types_initial[i]; i++) {
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
}
typeinit = 1;
}
SWIG_InitializeModule(0);
SWIG_InstallConstants(d,swig_const_table);
%}

View file

@ -18,6 +18,9 @@
#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags)
#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
/* -----------------------------------------------------------------------------
* Pointer declarations
@ -522,7 +525,7 @@ SWIG_Python_ArgFail(int argnum)
/* Convert a pointer value */
SWIGRUNTIME int
SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
swig_type_info *tc;
swig_cast_info *tc;
const char *c = 0;
static PyObject *SWIG_this = 0;
int newref = 0;
@ -629,7 +632,7 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
/* Convert a packed value value */
SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) {
swig_type_info *tc;
swig_cast_info *tc;
const char *c = 0;
#if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
@ -720,8 +723,8 @@ SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
void *SWIG_ReturnGlobalTypeList(void *);
#endif
SWIGRUNTIME swig_type_info **
SWIG_Python_GetTypeListHandle() {
SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule() {
static void *type_pointer = (void *)0;
/* first check if module already created */
if (!type_pointer) {
@ -736,19 +739,21 @@ SWIG_Python_GetTypeListHandle() {
}
}
#endif
return (swig_type_info **) type_pointer;
return (swig_module_info *) type_pointer;
}
/*
Search for a swig_type_info structure
*/
SWIGRUNTIMEINLINE swig_type_info *
SWIG_Python_GetTypeList() {
swig_type_info **tlh = SWIG_Python_GetTypeListHandle();
return tlh ? *tlh : (swig_type_info*)0;
}
static void
SWIG_Python_SetModule(swig_module_info *swig_module) {
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
swig_empty_runtime_method_table);
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, NULL);
if (pointer && module) {
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
}
}
#define SWIG_Runtime_GetTypeList SWIG_Python_GetTypeList
#ifdef __cplusplus
}

View file

@ -4,6 +4,5 @@
%}
%insert(runtime) "swigrun.swg"; /* Common C API type-checking code */
%insert(runtime) "common.swg"; /* Common type-checking code */
%insert(runtime) "pyapi.swg"; /* SWIG/Pyton API */
%insert(runtime) "pyrun.swg"; /* Python run-time code */