PageRenderTime 20ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-26/SWIG/Lib/pike/pikerun.swg

#
Unknown | 70 lines | 60 code | 10 blank | 0 comment | 0 complexity | 7274627ed826bb10b6161b5d7a0c2d61 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1/***********************************************************************
 2 * pikerun.swg
 3 *
 4 *     This file contains the runtime support for Pike modules
 5 *     and includes code for managing global variables and pointer
 6 *     type checking.
 7 *
 8 * Author : Lyle Johnson (lyle@users.sourceforge.net)
 9 ************************************************************************/
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14#include "object.h"
15#include "program.h"
16#ifdef __cplusplus
17}
18#endif
19
20/* Stores information about a wrapped object */
21typedef struct swig_object_wrapper {
22    void *self;
23    swig_type_info *type;
24} swig_object_wrapper;
25
26#ifdef THIS
27#undef THIS
28#endif
29#define THIS (((swig_object_wrapper *) Pike_fp->current_storage)->self)
30
31#define SWIG_ConvertPtr SWIG_Pike_ConvertPtr
32#define SWIG_NewPointerObj SWIG_Pike_NewPointerObj
33#define SWIG_GetModule(clientdata) SWIG_Pike_GetModule()
34#define SWIG_SetModule(clientdata, pointer) SWIG_Pike_SetModule(pointer)
35
36/* These need to be filled in before type sharing between modules will work */
37static swig_module_info *SWIG_Pike_GetModule() {
38  return 0;
39}
40
41static void SWIG_Pike_SetModule(swig_module_info *pointer) {
42
43}
44
45/* Convert a pointer value */
46static int
47SWIG_Pike_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) {
48    struct program *pr;
49    swig_cast_info *tc;
50    swig_object_wrapper *obj_wrapper;
51    
52    if (ty) {
53        pr = (struct program *) ty->clientdata;
54        obj_wrapper = (swig_object_wrapper *) get_storage(obj, pr);
55        if (obj_wrapper && obj_wrapper->type) {
56            tc = SWIG_TypeCheckStruct(obj_wrapper->type, ty);
57            if (tc) {
58                *ptr = SWIG_TypeCast(tc, obj_wrapper->self);
59                return 0;
60            }
61        }
62    }
63    return -1;
64}
65
66/* Create a new pointer object */
67static struct object *
68SWIG_Pike_NewPointerObj(void *ptr, swig_type_info *type, int own) {
69    return 0;
70}