PageRenderTime 43ms CodeModel.GetById 18ms 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. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #include "object.h"
  14. #include "program.h"
  15. #ifdef __cplusplus
  16. }
  17. #endif
  18. /* Stores information about a wrapped object */
  19. typedef struct swig_object_wrapper {
  20. void *self;
  21. swig_type_info *type;
  22. } swig_object_wrapper;
  23. #ifdef THIS
  24. #undef THIS
  25. #endif
  26. #define THIS (((swig_object_wrapper *) Pike_fp->current_storage)->self)
  27. #define SWIG_ConvertPtr SWIG_Pike_ConvertPtr
  28. #define SWIG_NewPointerObj SWIG_Pike_NewPointerObj
  29. #define SWIG_GetModule(clientdata) SWIG_Pike_GetModule()
  30. #define SWIG_SetModule(clientdata, pointer) SWIG_Pike_SetModule(pointer)
  31. /* These need to be filled in before type sharing between modules will work */
  32. static swig_module_info *SWIG_Pike_GetModule() {
  33. return 0;
  34. }
  35. static void SWIG_Pike_SetModule(swig_module_info *pointer) {
  36. }
  37. /* Convert a pointer value */
  38. static int
  39. SWIG_Pike_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) {
  40. struct program *pr;
  41. swig_cast_info *tc;
  42. swig_object_wrapper *obj_wrapper;
  43. if (ty) {
  44. pr = (struct program *) ty->clientdata;
  45. obj_wrapper = (swig_object_wrapper *) get_storage(obj, pr);
  46. if (obj_wrapper && obj_wrapper->type) {
  47. tc = SWIG_TypeCheckStruct(obj_wrapper->type, ty);
  48. if (tc) {
  49. *ptr = SWIG_TypeCast(tc, obj_wrapper->self);
  50. return 0;
  51. }
  52. }
  53. }
  54. return -1;
  55. }
  56. /* Create a new pointer object */
  57. static struct object *
  58. SWIG_Pike_NewPointerObj(void *ptr, swig_type_info *type, int own) {
  59. return 0;
  60. }