- 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@6930 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
58cd593dae
commit
f6964f285f
48 changed files with 1383 additions and 1021 deletions
|
|
@ -5,7 +5,6 @@
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%insert(runtime) "swigrun.swg"; // Common C API type-checking code
|
||||
%insert(runtime) "common.swg"; // Common type-checking code
|
||||
%insert(runtime) "pikerun.swg"; // Pike run-time code
|
||||
|
||||
%insert(runtime) %{
|
||||
|
|
@ -319,6 +318,8 @@ extern "C" {
|
|||
* The start of the Pike initialization function
|
||||
* ------------------------------------------------------------ */
|
||||
|
||||
%init "swiginit.swg"
|
||||
|
||||
%init %{
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
|
|
@ -331,10 +332,7 @@ extern "C"
|
|||
PIKE_MODULE_INIT
|
||||
{
|
||||
struct program *pr;
|
||||
int i;
|
||||
for (i = 0; swig_types_initial[i]; i++) {
|
||||
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
|
||||
}
|
||||
SWIG_InitializeModule(0);
|
||||
%}
|
||||
|
||||
/* pike keywords */
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ extern "C" {
|
|||
/* Stores information about a wrapped object */
|
||||
typedef struct swig_object_wrapper {
|
||||
void *self;
|
||||
swig_type_info *type;
|
||||
} swig_object_wrapper;
|
||||
|
||||
#ifdef THIS
|
||||
|
|
@ -29,18 +30,34 @@ typedef struct swig_object_wrapper {
|
|||
|
||||
#define SWIG_ConvertPtr SWIG_Pike_ConvertPtr
|
||||
#define SWIG_NewPointerObj SWIG_Pike_NewPointerObj
|
||||
#define SWIG_GetModule(clientdata) SWIG_Pike_GetModule()
|
||||
#define SWIG_SetModule(clientdata, pointer) SWIG_Pike_SetModule(pointer)
|
||||
|
||||
/* These need to be filled in before type sharing between modules will work */
|
||||
static swig_module_info *SWIG_Pike_GetModule() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void SWIG_Pike_SetModule(swig_module_info *pointer) {
|
||||
|
||||
}
|
||||
|
||||
/* Convert a pointer value */
|
||||
static int
|
||||
SWIG_Pike_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) {
|
||||
char *storage;
|
||||
struct program *pr;
|
||||
swig_cast_info *tc;
|
||||
swig_object_wrapper *obj_wrapper;
|
||||
|
||||
if (ty) {
|
||||
pr = (struct program *) ty->clientdata;
|
||||
storage = get_storage(obj, pr);
|
||||
if (storage) {
|
||||
*ptr = ((swig_object_wrapper *) storage)->self;
|
||||
return 0;
|
||||
obj_wrapper = (swig_object_wrapper *) get_storage(obj, pr);
|
||||
if (obj_wrapper && obj_wrapper->type) {
|
||||
tc = SWIG_TypeCheckStruct(obj_wrapper->type, ty);
|
||||
if (tc) {
|
||||
*ptr = SWIG_TypeCast(tc, obj_wrapper->self);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue