API to follow the naming convention SWIG_<language>_<function>. This should allow linking more than one interpreter into a program. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5242 626c5289-ae23-0410-ae9c-e8d60b6d4f22
62 lines
1.6 KiB
Text
62 lines
1.6 KiB
Text
/***********************************************************************
|
|
* pikerun.swg
|
|
*
|
|
* This file contains the runtime support for Pike modules
|
|
* and includes code for managing global variables and pointer
|
|
* type checking.
|
|
*
|
|
* Author : Lyle Johnson (lyle@users.sourceforge.net)
|
|
************************************************************************/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#include "object.h"
|
|
#include "program.h"
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/* Stores information about a wrapped object */
|
|
typedef struct swig_object_wrapper {
|
|
void *self;
|
|
} swig_object_wrapper;
|
|
|
|
#ifdef THIS
|
|
#undef THIS
|
|
#endif
|
|
#define THIS (((swig_object_wrapper *) Pike_fp->current_storage)->self)
|
|
|
|
#define SWIG_ConvertPtr SWIG_Pike_ConvertPtr
|
|
#define SWIG_NewPointerObj SWIG_Pike_NewPointerObj
|
|
|
|
#ifdef SWIG_NOINCLUDE
|
|
|
|
SWIGEXPORT(int) SWIG_Pike_ConvertPtr(struct object *, void **, swig_type_info *, int);
|
|
SWIGEXPORT(struct object *) SWIG_Pike_NewPointerObj(void *, swig_type_info *, int);
|
|
|
|
#else
|
|
|
|
/* Convert a pointer value */
|
|
SWIGRUNTIME(int)
|
|
SWIG_Pike_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) {
|
|
char *storage;
|
|
struct program *pr;
|
|
if (ty) {
|
|
pr = (struct program *) ty->clientdata;
|
|
storage = get_storage(obj, pr);
|
|
if (storage) {
|
|
*ptr = ((swig_object_wrapper *) storage)->self;
|
|
return 0;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
/* Create a new pointer object */
|
|
SWIGRUNTIME(struct object *)
|
|
SWIG_Pike_NewPointerObj(void *ptr, swig_type_info *type, int own) {
|
|
return 0;
|
|
}
|
|
|
|
#endif
|