1. /* ----------------------------------------------------------------------------
  2.  * This file was automatically generated by SWIG (http://www.swig.org).
  3.  * Version 2.0.0
  4.  *
  5.  * This file is not intended to be easily readable and contains a number of
  6.  * coding conventions designed to improve portability and efficiency. Do not make
  7.  * changes to this file unless you know what you are doing--modify the SWIG
  8.  * interface file instead.
  9.  * ----------------------------------------------------------------------------- */
  10.  
  11. #define SWIGPHP
  12.  
  13. #define SWIG_DIRECTORS
  14.  
  15. #ifdef __cplusplus
  16. /* SwigValueWrapper is described in swig.swg */
  17. template<typename T> class SwigValueWrapper {
  18.   struct SwigMovePointer {
  19.     T *ptr;
  20.     SwigMovePointer(T *p) : ptr(p) { }
  21.     ~SwigMovePointer() { delete ptr; }
  22.     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  23.   } pointer;
  24.   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  25.   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
  26. public:
  27.   SwigValueWrapper() : pointer(0) { }
  28.   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  29.   operator T&() const { return *pointer.ptr; }
  30.   T *operator&() { return pointer.ptr; }
  31. };
  32.  
  33. template <typename T> T SwigValueInit() {
  34.   return T();
  35. }
  36. #endif
  37.  
  38. /* -----------------------------------------------------------------------------
  39.  *  This section contains generic SWIG labels for method/variable
  40.  *  declarations/attributes, and other compiler dependent labels.
  41.  * ----------------------------------------------------------------------------- */
  42.  
  43. /* template workaround for compilers that cannot correctly implement the C++ standard */
  44. #ifndef SWIGTEMPLATEDISAMBIGUATOR
  45. # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  46. #  define SWIGTEMPLATEDISAMBIGUATOR template
  47. # elif defined(__HP_aCC)
  48. /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  49. /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  50. #  define SWIGTEMPLATEDISAMBIGUATOR template
  51. # else
  52. #  define SWIGTEMPLATEDISAMBIGUATOR
  53. # endif
  54. #endif
  55.  
  56. /* inline attribute */
  57. #ifndef SWIGINLINE
  58. # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  59. #   define SWIGINLINE inline
  60. # else
  61. #   define SWIGINLINE
  62. # endif
  63. #endif
  64.  
  65. /* attribute recognised by some compilers to avoid 'unused' warnings */
  66. #ifndef SWIGUNUSED
  67. # if defined(__GNUC__)
  68. #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  69. #     define SWIGUNUSED __attribute__ ((__unused__))
  70. #   else
  71. #     define SWIGUNUSED
  72. #   endif
  73. # elif defined(__ICC)
  74. #   define SWIGUNUSED __attribute__ ((__unused__))
  75. # else
  76. #   define SWIGUNUSED
  77. # endif
  78. #endif
  79.  
  80. #ifndef SWIG_MSC_UNSUPPRESS_4505
  81. # if defined(_MSC_VER)
  82. #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
  83. # endif
  84. #endif
  85.  
  86. #ifndef SWIGUNUSEDPARM
  87. # ifdef __cplusplus
  88. #   define SWIGUNUSEDPARM(p)
  89. # else
  90. #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
  91. # endif
  92. #endif
  93.  
  94. /* internal SWIG method */
  95. #ifndef SWIGINTERN
  96. # define SWIGINTERN static SWIGUNUSED
  97. #endif
  98.  
  99. /* internal inline SWIG method */
  100. #ifndef SWIGINTERNINLINE
  101. # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  102. #endif
  103.  
  104. /* exporting methods */
  105. #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  106. #  ifndef GCC_HASCLASSVISIBILITY
  107. #    define GCC_HASCLASSVISIBILITY
  108. #  endif
  109. #endif
  110.  
  111. #ifndef SWIGEXPORT
  112. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  113. #   if defined(STATIC_LINKED)
  114. #     define SWIGEXPORT
  115. #   else
  116. #     define SWIGEXPORT __declspec(dllexport)
  117. #   endif
  118. # else
  119. #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  120. #     define SWIGEXPORT __attribute__ ((visibility("default")))
  121. #   else
  122. #     define SWIGEXPORT
  123. #   endif
  124. # endif
  125. #endif
  126.  
  127. /* calling conventions for Windows */
  128. #ifndef SWIGSTDCALL
  129. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  130. #   define SWIGSTDCALL __stdcall
  131. # else
  132. #   define SWIGSTDCALL
  133. # endif
  134. #endif
  135.  
  136. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  137. #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  138. # define _CRT_SECURE_NO_DEPRECATE
  139. #endif
  140.  
  141. /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  142. #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  143. # define _SCL_SECURE_NO_DEPRECATE
  144. #endif
  145.  
  146.  
  147. /* -----------------------------------------------------------------------------
  148.  * swigrun.swg
  149.  *
  150.  * This file contains generic C API SWIG runtime support for pointer
  151.  * type checking.
  152.  * ----------------------------------------------------------------------------- */
  153.  
  154. /* This should only be incremented when either the layout of swig_type_info changes,
  155.    or for whatever reason, the runtime changes incompatibly */
  156. #define SWIG_RUNTIME_VERSION "4"
  157.  
  158. /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
  159. #ifdef SWIG_TYPE_TABLE
  160. # define SWIG_QUOTE_STRING(x) #x
  161. # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
  162. # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
  163. #else
  164. # define SWIG_TYPE_TABLE_NAME
  165. #endif
  166.  
  167. /*
  168.   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  169.   creating a static or dynamic library from the SWIG runtime code.
  170.   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  171.  
  172.   But only do this if strictly necessary, ie, if you have problems
  173.   with your compiler or suchlike.
  174. */
  175.  
  176. #ifndef SWIGRUNTIME
  177. # define SWIGRUNTIME SWIGINTERN
  178. #endif
  179.  
  180. #ifndef SWIGRUNTIMEINLINE
  181. # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
  182. #endif
  183.  
  184. /*  Generic buffer size */
  185. #ifndef SWIG_BUFFER_SIZE
  186. # define SWIG_BUFFER_SIZE 1024
  187. #endif
  188.  
  189. /* Flags for pointer conversions */
  190. #define SWIG_POINTER_DISOWN        0x1
  191. #define SWIG_CAST_NEW_MEMORY       0x2
  192.  
  193. /* Flags for new pointer objects */
  194. #define SWIG_POINTER_OWN           0x1
  195.  
  196.  
  197. /*
  198.    Flags/methods for returning states.
  199.    
  200.    The SWIG conversion methods, as ConvertPtr, return and integer
  201.    that tells if the conversion was successful or not. And if not,
  202.    an error code can be returned (see swigerrors.swg for the codes).
  203.    
  204.    Use the following macros/flags to set or process the returning
  205.    states.
  206.    
  207.    In old versions of SWIG, code such as the following was usually written:
  208.  
  209.      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
  210.        // success code
  211.      } else {
  212.        //fail code
  213.      }
  214.  
  215.    Now you can be more explicit:
  216.  
  217.     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
  218.     if (SWIG_IsOK(res)) {
  219.       // success code
  220.     } else {
  221.       // fail code
  222.     }
  223.  
  224.    which is the same really, but now you can also do
  225.  
  226.     Type *ptr;
  227.     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
  228.     if (SWIG_IsOK(res)) {
  229.       // success code
  230.       if (SWIG_IsNewObj(res) {
  231.         ...
  232.     delete *ptr;
  233.       } else {
  234.         ...
  235.       }
  236.     } else {
  237.       // fail code
  238.     }
  239.    
  240.    I.e., now SWIG_ConvertPtr can return new objects and you can
  241.    identify the case and take care of the deallocation. Of course that
  242.    also requires SWIG_ConvertPtr to return new result values, such as
  243.  
  244.       int SWIG_ConvertPtr(obj, ptr,...) {        
  245.         if (<obj is ok>) {                 
  246.           if (<need new object>) {             
  247.             *ptr = <ptr to new allocated object>;
  248.             return SWIG_NEWOBJ;            
  249.           } else {                     
  250.             *ptr = <ptr to old object>;        
  251.             return SWIG_OLDOBJ;            
  252.           }                        
  253.         } else {                       
  254.           return SWIG_BADOBJ;              
  255.         }                          
  256.       }
  257.  
  258.    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
  259.    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
  260.    SWIG errors code.
  261.  
  262.    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
  263.    allows to return the 'cast rank', for example, if you have this
  264.  
  265.        int food(double)
  266.        int fooi(int);
  267.  
  268.    and you call
  269.  
  270.       food(1)   // cast rank '1'  (1 -> 1.0)
  271.       fooi(1)   // cast rank '0'
  272.  
  273.    just use the SWIG_AddCast()/SWIG_CheckState()
  274. */
  275.  
  276. #define SWIG_OK                    (0)
  277. #define SWIG_ERROR                 (-1)
  278. #define SWIG_IsOK(r)               (r >= 0)
  279. #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
  280.  
  281. /* The CastRankLimit says how many bits are used for the cast rank */
  282. #define SWIG_CASTRANKLIMIT         (1 << 8)
  283. /* The NewMask denotes the object was created (using new/malloc) */
  284. #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
  285. /* The TmpMask is for in/out typemaps that use temporal objects */
  286. #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
  287. /* Simple returning values */
  288. #define SWIG_BADOBJ                (SWIG_ERROR)
  289. #define SWIG_OLDOBJ                (SWIG_OK)
  290. #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
  291. #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
  292. /* Check, add and del mask methods */
  293. #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
  294. #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
  295. #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
  296. #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
  297. #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
  298. #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
  299.  
  300. /* Cast-Rank Mode */
  301. #if defined(SWIG_CASTRANK_MODE)
  302. #  ifndef SWIG_TypeRank
  303. #    define SWIG_TypeRank             unsigned long
  304. #  endif
  305. #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
  306. #    define SWIG_MAXCASTRANK          (2)
  307. #  endif
  308. #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
  309. #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
  310. SWIGINTERNINLINE int SWIG_AddCast(int r) {
  311.   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
  312. }
  313. SWIGINTERNINLINE int SWIG_CheckState(int r) {
  314.   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
  315. }
  316. #else /* no cast-rank mode */
  317. #  define SWIG_AddCast
  318. #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
  319. #endif
  320.  
  321.  
  322. #include <string.h>
  323.  
  324. #ifdef __cplusplus
  325. extern "C" {
  326. #endif
  327.  
  328. typedef void *(*swig_converter_func)(void *, int *);
  329. typedef struct swig_type_info *(*swig_dycast_func)(void **);
  330.  
  331. /* Structure to store information on one type */
  332. typedef struct swig_type_info {
  333.   const char             *name;         /* mangled name of this type */
  334.   const char             *str;          /* human readable name of this type */
  335.   swig_dycast_func        dcast;        /* dynamic cast function down a hierarchy */
  336.   struct swig_cast_info  *cast;         /* linked list of types that can cast into this type */
  337.   void                   *clientdata;       /* language specific type data */
  338.   int                    owndata;       /* flag if the structure owns the clientdata */
  339. } swig_type_info;
  340.  
  341. /* Structure to store a type and conversion function used for casting */
  342. typedef struct swig_cast_info {
  343.   swig_type_info         *type;         /* pointer to type that is equivalent to this type */
  344.   swig_converter_func     converter;        /* function to cast the void pointers */
  345.   struct swig_cast_info  *next;         /* pointer to next cast in linked list */
  346.   struct swig_cast_info  *prev;         /* pointer to the previous cast */
  347. } swig_cast_info;
  348.  
  349. /* Structure used to store module information
  350.  * Each module generates one structure like this, and the runtime collects
  351.  * all of these structures and stores them in a circularly linked list.*/
  352. typedef struct swig_module_info {
  353.   swig_type_info         **types;       /* Array of pointers to swig_type_info structures that are in this module */
  354.   size_t                 size;              /* Number of types in this module */
  355.   struct swig_module_info *next;        /* Pointer to next element in circularly linked list */
  356.   swig_type_info         **type_initial;    /* Array of initially generated type structures */
  357.   swig_cast_info         **cast_initial;    /* Array of initially generated casting structures */
  358.   void                    *clientdata;      /* Language specific module data */
  359. } swig_module_info;
  360.  
  361. /*
  362.   Compare two type names skipping the space characters, therefore
  363.   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
  364.  
  365.   Return 0 when the two name types are equivalent, as in
  366.   strncmp, but skipping ' '.
  367. */
  368. SWIGRUNTIME int
  369. SWIG_TypeNameComp(const char *f1, const char *l1,
  370.           const char *f2, const char *l2) {
  371.   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
  372.     while ((*f1 == ' ') && (f1 != l1)) ++f1;
  373.     while ((*f2 == ' ') && (f2 != l2)) ++f2;
  374.     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  375.   }
  376.   return (int)((l1 - f1) - (l2 - f2));
  377. }
  378.  
  379. /*
  380.   Check type equivalence in a name list like <name1>|<name2>|...
  381.   Return 0 if not equal, 1 if equal
  382. */
  383. SWIGRUNTIME int
  384. SWIG_TypeEquiv(const char *nb, const char *tb) {
  385.   int equiv = 0;
  386.   const char* te = tb + strlen(tb);
  387.   const char* ne = nb;
  388.   while (!equiv && *ne) {
  389.     for (nb = ne; *ne; ++ne) {
  390.       if (*ne == '|') break;
  391.     }
  392.     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  393.     if (*ne) ++ne;
  394.   }
  395.   return equiv;
  396. }
  397.  
  398. /*
  399.   Check type equivalence in a name list like <name1>|<name2>|...
  400.   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
  401. */
  402. SWIGRUNTIME int
  403. SWIG_TypeCompare(const char *nb, const char *tb) {
  404.   int equiv = 0;
  405.   const char* te = tb + strlen(tb);
  406.   const char* ne = nb;
  407.   while (!equiv && *ne) {
  408.     for (nb = ne; *ne; ++ne) {
  409.       if (*ne == '|') break;
  410.     }
  411.     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  412.     if (*ne) ++ne;
  413.   }
  414.   return equiv;
  415. }
  416.  
  417.  
  418. /*
  419.   Check the typename
  420. */
  421. SWIGRUNTIME swig_cast_info *
  422. SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  423.   if (ty) {
  424.     swig_cast_info *iter = ty->cast;
  425.     while (iter) {
  426.       if (strcmp(iter->type->name, c) == 0) {
  427.         if (iter == ty->cast)
  428.           return iter;
  429.         /* Move iter to the top of the linked list */
  430.         iter->prev->next = iter->next;
  431.         if (iter->next)
  432.           iter->next->prev = iter->prev;
  433.         iter->next = ty->cast;
  434.         iter->prev = 0;
  435.         if (ty->cast) ty->cast->prev = iter;
  436.         ty->cast = iter;
  437.         return iter;
  438.       }
  439.       iter = iter->next;
  440.     }
  441.   }
  442.   return 0;
  443. }
  444.  
  445. /*
  446.   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
  447. */
  448. SWIGRUNTIME swig_cast_info *
  449. SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  450.   if (ty) {
  451.     swig_cast_info *iter = ty->cast;
  452.     while (iter) {
  453.       if (iter->type == from) {
  454.         if (iter == ty->cast)
  455.           return iter;
  456.         /* Move iter to the top of the linked list */
  457.         iter->prev->next = iter->next;
  458.         if (iter->next)
  459.           iter->next->prev = iter->prev;
  460.         iter->next = ty->cast;
  461.         iter->prev = 0;
  462.         if (ty->cast) ty->cast->prev = iter;
  463.         ty->cast = iter;
  464.         return iter;
  465.       }
  466.       iter = iter->next;
  467.     }
  468.   }
  469.   return 0;
  470. }
  471.  
  472. /*
  473.   Cast a pointer up an inheritance hierarchy
  474. */
  475. SWIGRUNTIMEINLINE void *
  476. SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  477.   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
  478. }
  479.  
  480. /*
  481.    Dynamic pointer casting. Down an inheritance hierarchy
  482. */
  483. SWIGRUNTIME swig_type_info *
  484. SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  485.   swig_type_info *lastty = ty;
  486.   if (!ty || !ty->dcast) return ty;
  487.   while (ty && (ty->dcast)) {
  488.     ty = (*ty->dcast)(ptr);
  489.     if (ty) lastty = ty;
  490.   }
  491.   return lastty;
  492. }
  493.  
  494. /*
  495.   Return the name associated with this type
  496. */
  497. SWIGRUNTIMEINLINE const char *
  498. SWIG_TypeName(const swig_type_info *ty) {
  499.   return ty->name;
  500. }
  501.  
  502. /*
  503.   Return the pretty name associated with this type,
  504.   that is an unmangled type name in a form presentable to the user.
  505. */
  506. SWIGRUNTIME const char *
  507. SWIG_TypePrettyName(const swig_type_info *type) {
  508.   /* The "str" field contains the equivalent pretty names of the
  509.      type, separated by vertical-bar characters.  We choose
  510.      to print the last name, as it is often (?) the most
  511.      specific. */
  512.   if (!type) return NULL;
  513.   if (type->str != NULL) {
  514.     const char *last_name = type->str;
  515.     const char *s;
  516.     for (s = type->str; *s; s++)
  517.       if (*s == '|') last_name = s+1;
  518.     return last_name;
  519.   }
  520.   else
  521.     return type->name;
  522. }
  523.  
  524. /*
  525.    Set the clientdata field for a type
  526. */
  527. SWIGRUNTIME void
  528. SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  529.   swig_cast_info *cast = ti->cast;
  530.   /* if (ti->clientdata == clientdata) return; */
  531.   ti->clientdata = clientdata;
  532.  
  533.   while (cast) {
  534.     if (!cast->converter) {
  535.       swig_type_info *tc = cast->type;
  536.       if (!tc->clientdata) {
  537.     SWIG_TypeClientData(tc, clientdata);
  538.       }
  539.     }    
  540.     cast = cast->next;
  541.   }
  542. }
  543. SWIGRUNTIME void
  544. SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  545.   SWIG_TypeClientData(ti, clientdata);
  546.   ti->owndata = 1;
  547. }
  548.  
  549. /*
  550.   Search for a swig_type_info structure only by mangled name
  551.   Search is a O(log #types)
  552.  
  553.   We start searching at module start, and finish searching when start == end.  
  554.   Note: if start == end at the beginning of the function, we go all the way around
  555.   the circular list.
  556. */
  557. SWIGRUNTIME swig_type_info *
  558. SWIG_MangledTypeQueryModule(swig_module_info *start,
  559.                             swig_module_info *end,
  560.                     const char *name) {
  561.   swig_module_info *iter = start;
  562.   do {
  563.     if (iter->size) {
  564.       register size_t l = 0;
  565.       register size_t r = iter->size - 1;
  566.       do {
  567.     /* since l+r >= 0, we can (>> 1) instead (/ 2) */
  568.     register size_t i = (l + r) >> 1;
  569.     const char *iname = iter->types[i]->name;
  570.     if (iname) {
  571.       register int compare = strcmp(name, iname);
  572.       if (compare == 0) {      
  573.         return iter->types[i];
  574.       } else if (compare < 0) {
  575.         if (i) {
  576.           r = i - 1;
  577.         } else {
  578.           break;
  579.         }
  580.       } else if (compare > 0) {
  581.         l = i + 1;
  582.       }
  583.     } else {
  584.       break; /* should never happen */
  585.     }
  586.       } while (l <= r);
  587.     }
  588.     iter = iter->next;
  589.   } while (iter != end);
  590.   return 0;
  591. }
  592.  
  593. /*
  594.   Search for a swig_type_info structure for either a mangled name or a human readable name.
  595.   It first searches the mangled names of the types, which is a O(log #types)
  596.   If a type is not found it then searches the human readable names, which is O(#types).
  597.  
  598.   We start searching at module start, and finish searching when start == end.  
  599.   Note: if start == end at the beginning of the function, we go all the way around
  600.   the circular list.
  601. */
  602. SWIGRUNTIME swig_type_info *
  603. SWIG_TypeQueryModule(swig_module_info *start,
  604.                      swig_module_info *end,
  605.              const char *name) {
  606.   /* STEP 1: Search the name field using binary search */
  607.   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  608.   if (ret) {
  609.     return ret;
  610.   } else {
  611.     /* STEP 2: If the type hasn't been found, do a complete search
  612.        of the str field (the human readable name) */
  613.     swig_module_info *iter = start;
  614.     do {
  615.       register size_t i = 0;
  616.       for (; i < iter->size; ++i) {
  617.     if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
  618.       return iter->types[i];
  619.       }
  620.       iter = iter->next;
  621.     } while (iter != end);
  622.   }
  623.  
  624.   /* neither found a match */
  625.   return 0;
  626. }
  627.  
  628. /*
  629.    Pack binary data into a string
  630. */
  631. SWIGRUNTIME char *
  632. SWIG_PackData(char *c, void *ptr, size_t sz) {
  633.   static const char hex[17] = "0123456789abcdef";
  634.   register const unsigned char *u = (unsigned char *) ptr;
  635.   register const unsigned char *eu =  u + sz;
  636.   for (; u != eu; ++u) {
  637.     register unsigned char uu = *u;
  638.     *(c++) = hex[(uu & 0xf0) >> 4];
  639.     *(c++) = hex[uu & 0xf];
  640.   }
  641.   return c;
  642. }
  643.  
  644. /*
  645.    Unpack binary data from a string
  646. */
  647. SWIGRUNTIME const char *
  648. SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  649.   register unsigned char *u = (unsigned char *) ptr;
  650.   register const unsigned char *eu = u + sz;
  651.   for (; u != eu; ++u) {
  652.     register char d = *(c++);
  653.     register unsigned char uu;
  654.     if ((d >= '0') && (d <= '9'))
  655.       uu = ((d - '0') << 4);
  656.     else if ((d >= 'a') && (d <= 'f'))
  657.       uu = ((d - ('a'-10)) << 4);
  658.     else
  659.       return (char *) 0;
  660.     d = *(c++);
  661.     if ((d >= '0') && (d <= '9'))
  662.       uu |= (d - '0');
  663.     else if ((d >= 'a') && (d <= 'f'))
  664.       uu |= (d - ('a'-10));
  665.     else
  666.       return (char *) 0;
  667.     *u = uu;
  668.   }
  669.   return c;
  670. }
  671.  
  672. /*
  673.    Pack 'void *' into a string buffer.
  674. */
  675. SWIGRUNTIME char *
  676. SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  677.   char *r = buff;
  678.   if ((2*sizeof(void *) + 2) > bsz) return 0;
  679.   *(r++) = '_';
  680.   r = SWIG_PackData(r,&ptr,sizeof(void *));
  681.   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  682.   strcpy(r,name);
  683.   return buff;
  684. }
  685.  
  686. SWIGRUNTIME const char *
  687. SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  688.   if (*c != '_') {
  689.     if (strcmp(c,"NULL") == 0) {
  690.       *ptr = (void *) 0;
  691.       return name;
  692.     } else {
  693.       return 0;
  694.     }
  695.   }
  696.   return SWIG_UnpackData(++c,ptr,sizeof(void *));
  697. }
  698.  
  699. SWIGRUNTIME char *
  700. SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  701.   char *r = buff;
  702.   size_t lname = (name ? strlen(name) : 0);
  703.   if ((2*sz + 2 + lname) > bsz) return 0;
  704.   *(r++) = '_';
  705.   r = SWIG_PackData(r,ptr,sz);
  706.   if (lname) {
  707.     strncpy(r,name,lname+1);
  708.   } else {
  709.     *r = 0;
  710.   }
  711.   return buff;
  712. }
  713.  
  714. SWIGRUNTIME const char *
  715. SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  716.   if (*c != '_') {
  717.     if (strcmp(c,"NULL") == 0) {
  718.       memset(ptr,0,sz);
  719.       return name;
  720.     } else {
  721.       return 0;
  722.     }
  723.   }
  724.   return SWIG_UnpackData(++c,ptr,sz);
  725. }
  726.  
  727. #ifdef __cplusplus
  728. }
  729. #endif
  730.  
  731. /* -----------------------------------------------------------------------------
  732.  * phprun.swg
  733.  *
  734.  * PHP runtime library
  735.  * ----------------------------------------------------------------------------- */
  736.  
  737. #ifdef __cplusplus
  738. extern "C" {
  739. #endif
  740. #include "zend.h"
  741. #include "zend_API.h"
  742. #include "zend_exceptions.h"
  743. #include "php.h"
  744. #include "ext/standard/php_string.h"
  745.  
  746. #ifdef ZEND_RAW_FENTRY
  747. /* ZEND_RAW_FENTRY was added somewhere between 5.2.0 and 5.2.3 */
  748. # define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_RAW_FENTRY((char*)#ZN, N, A, 0)
  749. #else
  750. /* This causes warnings from GCC >= 4.2 (assigning a string literal to char*).
  751.  * But this seems to be unavoidable without directly assuming knowledge of
  752.  * the structure, which changed between PHP4 and PHP5. */
  753. # define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A)
  754. #endif
  755.  
  756. #ifndef Z_SET_ISREF_P
  757. // For PHP < 5.3
  758. # define Z_SET_ISREF_P(z) (z)->is_ref = 1
  759. #endif
  760. #ifndef Z_SET_REFCOUNT_P
  761. // For PHP < 5.3
  762. # define Z_SET_REFCOUNT_P(z, rc) (z)->refcount = (rc)
  763. #endif
  764.  
  765. #define SWIG_LONG_CONSTANT(N, V) zend_register_long_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
  766. #define SWIG_DOUBLE_CONSTANT(N, V) zend_register_double_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
  767. #define SWIG_STRING_CONSTANT(N, V) zend_register_stringl_constant((char*)#N, sizeof(#N), (char*)(V), strlen(V), CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
  768. #define SWIG_CHAR_CONSTANT(N, V) do {\
  769.     static char swig_char = (V);\
  770.     zend_register_stringl_constant((char*)#N, sizeof(#N), &swig_char, 1, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);\
  771. } while (0)
  772.  
  773. /* These TSRMLS_ stuff should already be defined now, but with older php under
  774.    redhat are not... */
  775. #ifndef TSRMLS_D
  776. #define TSRMLS_D
  777. #endif
  778. #ifndef TSRMLS_DC
  779. #define TSRMLS_DC
  780. #endif
  781. #ifndef TSRMLS_C
  782. #define TSRMLS_C
  783. #endif
  784. #ifndef TSRMLS_CC
  785. #define TSRMLS_CC
  786. #endif
  787.  
  788. #ifdef __cplusplus
  789. }
  790. #endif
  791.  
  792. /* But in fact SWIG_ConvertPtr is the native interface for getting typed
  793.    pointer values out of zvals.  We need the TSRMLS_ macros for when we
  794.    make PHP type calls later as we handle php resources */
  795. #define SWIG_ConvertPtr(obj,pp,type,flags) SWIG_ZTS_ConvertPtr(obj,pp,type,flags TSRMLS_CC)
  796.  
  797.  
  798. #define SWIG_fail goto fail
  799.  
  800. static const char *default_error_msg = "Unknown error occurred";
  801. static int default_error_code = E_ERROR;
  802.  
  803. #define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg
  804.  
  805. #define SWIG_PHP_Error(code,msg) do { SWIG_ErrorCode() = code; SWIG_ErrorMsg() = msg; SWIG_fail; } while (0)
  806.  
  807. #define SWIG_contract_assert(expr,msg) \
  808.   if (!(expr) ) { zend_printf("Contract Assert Failed %s\n",msg ); } else
  809.  
  810. /* Standard SWIG API */
  811. #define SWIG_GetModule(clientdata) SWIG_Php_GetModule()
  812. #define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer)
  813.  
  814. /* used to wrap returned objects in so we know whether they are newobject
  815.    and need freeing, or not */
  816. typedef struct {
  817.   void * ptr;
  818.   int newobject;
  819. } swig_object_wrapper;
  820.  
  821. /* empty zend destructor for types without one */
  822. static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) { (void)rsrc; }
  823.  
  824. #define SWIG_SetPointerZval(a,b,c,d) SWIG_ZTS_SetPointerZval(a,b,c,d TSRMLS_CC)
  825. #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
  826.  
  827. static void
  828. SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject TSRMLS_DC) {
  829.   swig_object_wrapper *value=NULL;
  830.   /*
  831.    * First test for Null pointers.  Return those as PHP native NULL
  832.    */
  833.   if (!ptr ) {
  834.     ZVAL_NULL(z);
  835.     return;
  836.   }
  837.   if (type->clientdata) {
  838.     if (! (*(int *)(type->clientdata)))
  839.       zend_error(E_ERROR, "Type: %s failed to register with zend",type->name);
  840.     value=(swig_object_wrapper *)emalloc(sizeof(swig_object_wrapper));
  841.     value->ptr=ptr;
  842.     value->newobject=newobject;
  843.     if (newobject <= 1) {
  844.       /* Just register the pointer as a resource. */
  845.       ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata));
  846.     } else {
  847.       /*
  848.        * Wrap the resource in an object, the resource will be accessible
  849.        * via the "_cPtr" member. This is currently only used by
  850.        * directorin typemaps.
  851.        */
  852.       value->newobject = 0;
  853.       zval *resource;
  854.       MAKE_STD_ZVAL(resource);
  855.       ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata));
  856.       zend_class_entry **ce = NULL;
  857.       zval *classname;
  858.       MAKE_STD_ZVAL(classname);
  859.       /* _p_Foo -> Foo */
  860.       ZVAL_STRING(classname, (char*)type->name+3, 1);
  861.       /* class names are stored in lowercase */
  862.       php_strtolower(Z_STRVAL_PP(&classname), Z_STRLEN_PP(&classname));
  863.       if (zend_lookup_class(Z_STRVAL_P(classname), Z_STRLEN_P(classname), &ce TSRMLS_CC) != SUCCESS) {
  864.         /* class does not exist */
  865.         object_init(z);
  866.       } else {
  867.         object_init_ex(z, *ce);
  868.       }
  869.       Z_SET_REFCOUNT_P(z, 1);
  870.       Z_SET_ISREF_P(z);
  871.       zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL);
  872.       FREE_ZVAL(classname);
  873.     }
  874.     return;
  875.   }
  876.   zend_error(E_ERROR, "Type: %s not registered with zend",type->name);
  877. }
  878.  
  879. /* This pointer conversion routine takes the native pointer p (along with
  880.    its type name) and converts it by calling appropriate casting functions
  881.    according to ty.  The resultant pointer is returned, or NULL is returned
  882.    if the pointer can't be cast.
  883.  
  884.    Sadly PHP has no API to find a type name from a type id, only from an
  885.    instance of a resource of the type id, so we have to pass type_name as well.
  886.  
  887.    The two functions which might call this are:
  888.    SWIG_ZTS_ConvertResourcePtr which gets the type name from the resource
  889.    and the registered zend destructors for which we have one per type each
  890.    with the type name hard wired in. */
  891. static void *
  892. SWIG_ZTS_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty TSRMLS_DC) {
  893.   swig_cast_info *tc;
  894.   void *result = 0;
  895.  
  896.   if (!ty) {
  897.     /* They don't care about the target type, so just pass on the pointer! */
  898.     return p;
  899.   }
  900.  
  901.   if (! type_name) {  
  902.     /* can't convert p to ptr type ty if we don't know what type p is */
  903.     return NULL;
  904.   }
  905.  
  906.   /* convert and cast p from type_name to ptr as ty. */
  907.   tc = SWIG_TypeCheck(type_name, ty);
  908.   if (tc) {
  909.     int newmemory = 0;
  910.     result = SWIG_TypeCast(tc, p, &newmemory);
  911.     assert(!newmemory); /* newmemory handling not yet implemented */
  912.   }
  913.   return result;
  914. }
  915.  
  916. /* This function returns a pointer of type ty by extracting the pointer
  917.    and type info from the resource in z.  z must be a resource.
  918.    If it fails, NULL is returned.
  919.    It uses SWIG_ZTS_ConvertResourceData to do the real work. */
  920. static void *
  921. SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) {
  922.   swig_object_wrapper *value;
  923.   void *p;
  924.   int type;
  925.   char *type_name;
  926.  
  927.   value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
  928.   if ( flags & SWIG_POINTER_DISOWN ) {
  929.     value->newobject = 0;
  930.   }
  931.   p = value->ptr;
  932.   if (type==-1) return NULL;
  933.  
  934.   type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);
  935.  
  936.   return SWIG_ZTS_ConvertResourceData(p, type_name, ty TSRMLS_CC);
  937. }
  938.  
  939. /* We allow passing of a RESOURCE pointing to the object or an OBJECT whose
  940.    _cPtr is a resource pointing to the object */
  941. static int
  942. SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC) {
  943.   if (z == NULL) {
  944.     *ptr = 0;
  945.     return 0;
  946.   }
  947.  
  948.   switch (z->type) {
  949.     case IS_OBJECT: {
  950.       zval ** _cPtr;
  951.       if (zend_hash_find(HASH_OF(z),(char*)"_cPtr",sizeof("_cPtr"),(void**)&_cPtr)==SUCCESS) {
  952.     if ((*_cPtr)->type==IS_RESOURCE) {
  953.       *ptr = SWIG_ZTS_ConvertResourcePtr(*_cPtr, ty, flags TSRMLS_CC);
  954.       return (*ptr == NULL ? -1 : 0);
  955.     }
  956.       }
  957.       break;
  958.     }
  959.     case IS_RESOURCE:
  960.       *ptr = SWIG_ZTS_ConvertResourcePtr(z, ty, flags TSRMLS_CC);
  961.       return (*ptr == NULL ? -1 : 0);
  962.     case IS_NULL:
  963.       *ptr = 0;
  964.       return 0;
  965.   }
  966.  
  967.   return -1;
  968. }
  969.  
  970. static char const_name[] = "swig_runtime_data_type_pointer";
  971. static swig_module_info *SWIG_Php_GetModule() {
  972.   zval *pointer;
  973.   swig_module_info *ret = 0;
  974.  
  975.   MAKE_STD_ZVAL(pointer);
  976.  
  977.   TSRMLS_FETCH();
  978.  
  979.   if (zend_get_constant(const_name, sizeof(const_name), pointer TSRMLS_CC)) {
  980.     if (pointer->type == IS_LONG) {
  981.       ret = (swig_module_info *) pointer->value.lval;
  982.     }
  983.   }
  984.   FREE_ZVAL(pointer);
  985.   return ret;
  986. }
  987.  
  988. static void SWIG_Php_SetModule(swig_module_info *pointer) {
  989.   TSRMLS_FETCH();
  990.   REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0);
  991. }
  992.  
  993. #define SWIG_MEMBER_PTR ((char*)"CLASS::*")
  994.  
  995. static void member_ptr_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
  996.   efree(rsrc->ptr);
  997. }
  998.  
  999. static int le_member_ptr;
  1000.  
  1001.  
  1002.  
  1003. /* -------- TYPES TABLE (BEGIN) -------- */
  1004.  
  1005. #define SWIGTYPE_p_Client swig_types[0]
  1006. #define SWIGTYPE_p_ProcedureCallback swig_types[1]
  1007. #define SWIGTYPE_p_std__vectorT_int_t swig_types[2]
  1008. static swig_type_info *swig_types[4];
  1009. static swig_module_info swig_module = {swig_types, 3, 0, 0, 0, 0};
  1010. #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
  1011. #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
  1012.  
  1013. /* -------- TYPES TABLE (END) -------- */
  1014.  
  1015. /* header section */
  1016. ZEND_BEGIN_MODULE_GLOBALS(debugasync)
  1017. const char *error_msg;
  1018. int error_code;
  1019. ZEND_END_MODULE_GLOBALS(debugasync)
  1020. ZEND_DECLARE_MODULE_GLOBALS(debugasync)
  1021. #ifdef ZTS
  1022. #define SWIG_ErrorMsg() TSRMG(debugasync_globals_id, zend_debugasync_globals *, error_msg )
  1023. #define SWIG_ErrorCode() TSRMG(debugasync_globals_id, zend_debugasync_globals *, error_code )
  1024. #else
  1025. #define SWIG_ErrorMsg() (debugasync_globals.error_msg)
  1026. #define SWIG_ErrorCode() (debugasync_globals.error_code)
  1027. #endif
  1028.  
  1029. static void debugasync_init_globals(zend_debugasync_globals *globals ) {
  1030.   globals->error_msg = default_error_msg;
  1031.   globals->error_code = default_error_code;
  1032. }
  1033. static void debugasync_destroy_globals(zend_debugasync_globals * globals) { (void)globals; }
  1034.  
  1035. static void SWIG_ResetError() {
  1036.   TSRMLS_FETCH();
  1037.   SWIG_ErrorMsg() = default_error_msg;
  1038.   SWIG_ErrorCode() = default_error_code;
  1039. }
  1040.  
  1041. ZEND_NAMED_FUNCTION(_wrap_swig_debugasync_alter_newobject) {
  1042.   zval **args[2];
  1043.   swig_object_wrapper *value;
  1044.   int type;
  1045.   int thisown;
  1046.  
  1047.   SWIG_ResetError();
  1048.   if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
  1049.     WRONG_PARAM_COUNT;
  1050.   }
  1051.  
  1052.   value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type);
  1053.   value->newobject = zval_is_true(*args[1]);
  1054.  
  1055.   return;
  1056. }
  1057. ZEND_NAMED_FUNCTION(_wrap_swig_debugasync_get_newobject) {
  1058.   zval **args[1];
  1059.   swig_object_wrapper *value;
  1060.   int type;
  1061.  
  1062.   SWIG_ResetError();
  1063.   if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
  1064.     WRONG_PARAM_COUNT;
  1065.   }
  1066.  
  1067.   value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type);
  1068.   RETVAL_LONG(value->newobject);
  1069.  
  1070.   return;
  1071. }
  1072. #define SWIG_name  "debugasync"
  1073. #ifdef __cplusplus
  1074. extern "C" {
  1075. #endif
  1076. #include "php.h"
  1077. #include "php_ini.h"
  1078. #include "ext/standard/info.h"
  1079. #include "php_debugasync.h"
  1080. #ifdef __cplusplus
  1081. }
  1082. #endif
  1083.  
  1084. /* -----------------------------------------------------------------------------
  1085.  * director.swg
  1086.  *
  1087.  * This file contains support for director classes that proxy
  1088.  * method calls from C++ to PHP extensions.
  1089.  * ----------------------------------------------------------------------------- */
  1090.  
  1091. #ifndef SWIG_DIRECTOR_PHP_HEADER_
  1092. #define SWIG_DIRECTOR_PHP_HEADER_
  1093.  
  1094. #ifdef __cplusplus
  1095.  
  1096. #include <string>
  1097. #include <map>
  1098.  
  1099. /*
  1100.   Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
  1101.   'Swig' namespace. This could be useful for multi-modules projects.
  1102. */
  1103. #ifdef SWIG_DIRECTOR_STATIC
  1104. /* Force anonymous (static) namespace */
  1105. #define Swig
  1106. #endif
  1107.  
  1108. namespace Swig {
  1109.   /* memory handler */
  1110.   struct GCItem
  1111.   {
  1112.     virtual ~GCItem() {}
  1113.  
  1114.     virtual int get_own() const
  1115.     {
  1116.       return 0;
  1117.     }
  1118.   };
  1119.  
  1120.   struct GCItem_var
  1121.   {
  1122.     GCItem_var(GCItem *item = 0) : _item(item)
  1123.     {
  1124.     }
  1125.  
  1126.     GCItem_var& operator=(GCItem *item)
  1127.     {
  1128.       GCItem *tmp = _item;
  1129.       _item = item;
  1130.       delete tmp;
  1131.       return *this;
  1132.     }
  1133.  
  1134.     ~GCItem_var()
  1135.     {
  1136.       delete _item;
  1137.     }
  1138.  
  1139.     GCItem * operator->() const
  1140.     {
  1141.       return _item;
  1142.     }
  1143.  
  1144.     private:
  1145.     GCItem *_item;
  1146.   };
  1147.  
  1148.   struct GCItem_Object : GCItem
  1149.   {
  1150.     GCItem_Object(int own) : _own(own)
  1151.     {
  1152.     }
  1153.  
  1154.     virtual ~GCItem_Object()
  1155.     {
  1156.     }
  1157.  
  1158.     int get_own() const
  1159.     {
  1160.       return _own;
  1161.     }
  1162.  
  1163.     private:
  1164.     int _own;
  1165.   };
  1166.  
  1167.   template <typename Type>
  1168.   struct GCItem_T : GCItem
  1169.   {
  1170.     GCItem_T(Type *ptr) : _ptr(ptr)
  1171.     {
  1172.     }
  1173.  
  1174.     virtual ~GCItem_T()
  1175.     {
  1176.       delete _ptr;
  1177.     }
  1178.  
  1179.     private:
  1180.     Type *_ptr;
  1181.   };
  1182.  
  1183.   class Director {
  1184.     protected:
  1185.       zval *swig_self;
  1186.       typedef std::map<void*, GCItem_var> swig_ownership_map;
  1187.       mutable swig_ownership_map swig_owner;
  1188.     public:
  1189.       Director(zval* self) : swig_self(self) {
  1190.       }
  1191.  
  1192.       ~Director() {
  1193.         for (swig_ownership_map::iterator i = swig_owner.begin(); i != swig_owner.end(); i++) {
  1194.           swig_owner.erase(i);
  1195.         }
  1196.       }
  1197.  
  1198.       bool swig_is_overridden_method(char *cname, char *lc_fname) {
  1199.         zval classname;
  1200.         zend_class_entry **ce;
  1201.         zend_function *mptr;
  1202.         int name_len = strlen(lc_fname);
  1203.        
  1204.         ZVAL_STRING(&classname, cname, 0);
  1205.         if (zend_lookup_class(Z_STRVAL_P(&classname), Z_STRLEN_P(&classname), &ce TSRMLS_CC) != SUCCESS) {
  1206.           return false;
  1207.         }
  1208.         if (zend_hash_find(&(*ce)->function_table, lc_fname, name_len + 1, (void**) &mptr) != SUCCESS) {
  1209.           return false;
  1210.         }
  1211.         // common.scope points to the declaring class
  1212.         return strcmp(mptr->common.scope->name, cname);
  1213.       }
  1214.  
  1215.       template <typename Type>
  1216.       void swig_acquire_ownership(Type *vptr) const
  1217.       {
  1218.         if (vptr) {
  1219.           swig_owner[vptr] = new GCItem_T<Type>(vptr);
  1220.         }
  1221.       }
  1222.   };
  1223.  
  1224.   /* base class for director exceptions */
  1225.   class DirectorException {
  1226.   protected:
  1227.     std::string swig_msg;
  1228.   public:
  1229.     DirectorException(int code, const char *hdr, const char* msg)
  1230.       : swig_msg(hdr)
  1231.     {
  1232.       if (strlen(msg)) {
  1233.         swig_msg += " ";
  1234.         swig_msg += msg;
  1235.       }
  1236.       SWIG_ErrorCode() = code;
  1237.       SWIG_ErrorMsg() = swig_msg.c_str();
  1238.     }
  1239.  
  1240.     static void raise(int code, const char *hdr, const char* msg)
  1241.     {
  1242.       throw DirectorException(code, hdr, msg);
  1243.     }
  1244.   };
  1245.  
  1246.   /* attempt to call a pure virtual method via a director method */
  1247.   class DirectorPureVirtualException : public Swig::DirectorException
  1248.   {
  1249.   public:
  1250.     DirectorPureVirtualException(const char* msg)
  1251.       : DirectorException(E_ERROR, "SWIG director pure virtual method called", msg)
  1252.     {
  1253.     }
  1254.  
  1255.     static void raise(const char *msg)
  1256.     {
  1257.       throw DirectorPureVirtualException(msg);
  1258.     }
  1259.   };
  1260.   /* any php exception that occurs during a director method call */
  1261.   class DirectorMethodException : public Swig::DirectorException
  1262.   {
  1263.   public:
  1264.     DirectorMethodException(const char* msg = "")
  1265.       : DirectorException(E_ERROR, "SWIG director method error", msg)
  1266.     {
  1267.     }
  1268.  
  1269.     static void raise(const char *msg)
  1270.     {
  1271.       throw DirectorMethodException(msg);
  1272.     }
  1273.   };
  1274. }
  1275.  
  1276. #endif /* __cplusplus */
  1277.  
  1278. #endif
  1279.  
  1280. #include "Client.hpp"
  1281. #include "ProcedureCallback.hpp"
  1282.  
  1283.  
  1284. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
  1285.  
  1286. static swig_type_info _swigt__p_Client = {"_p_Client", "Client *", 0, 0, (void*)0, 0};
  1287. static swig_type_info _swigt__p_ProcedureCallback = {"_p_ProcedureCallback", "ProcedureCallback *", 0, 0, (void*)0, 0};
  1288. static swig_type_info _swigt__p_std__vectorT_int_t = {"_p_std__vectorT_int_t", "std::vector< int > *", 0, 0, (void*)0, 0};
  1289.  
  1290. static swig_type_info *swig_type_initial[] = {
  1291.   &_swigt__p_Client,
  1292.   &_swigt__p_ProcedureCallback,
  1293.   &_swigt__p_std__vectorT_int_t,
  1294. };
  1295.  
  1296. static swig_cast_info _swigc__p_Client[] = {  {&_swigt__p_Client, 0, 0, 0},{0, 0, 0, 0}};
  1297. static swig_cast_info _swigc__p_ProcedureCallback[] = {  {&_swigt__p_ProcedureCallback, 0, 0, 0},{0, 0, 0, 0}};
  1298. static swig_cast_info _swigc__p_std__vectorT_int_t[] = {  {&_swigt__p_std__vectorT_int_t, 0, 0, 0},{0, 0, 0, 0}};
  1299.  
  1300. static swig_cast_info *swig_cast_initial[] = {
  1301.   _swigc__p_Client,
  1302.   _swigc__p_ProcedureCallback,
  1303.   _swigc__p_std__vectorT_int_t,
  1304. };
  1305.  
  1306.  
  1307. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
  1308.  
  1309. /* end header section */
  1310.  
  1311. #include "debugasync_wrap.h"
  1312.  
  1313. SwigDirector_ProcedureCallback::SwigDirector_ProcedureCallback(zval *self): ProcedureCallback(), Swig::Director(self) {
  1314.  
  1315. }
  1316.  
  1317.  
  1318.  
  1319. void SwigDirector_ProcedureCallback::callback(std::vector< int > arg0) {
  1320.   zval *args[1];
  1321.   zval *result, funcname;
  1322.   MAKE_STD_ZVAL(result);
  1323.   ZVAL_STRING(&funcname, (char *)"callback", 0);
  1324.   if (!swig_self) {
  1325.     SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  1326.   }
  1327.  
  1328.   zval obj0;
  1329.   args[0] = &obj0;
  1330.   {
  1331.     SWIG_SetPointerZval(&obj0, SWIG_as_voidptr(&arg0), SWIGTYPE_p_std__vectorT_int_t, 2);
  1332.   }
  1333.   call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
  1334.     result, 1, args TSRMLS_CC);
  1335.   FREE_ZVAL(result);
  1336.   return;
  1337. fail:
  1338.   zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
  1339. }
  1340.  
  1341.  
  1342. /* vdecl subsection */
  1343. static int le_swig__p_Client=0; /* handle for Client */
  1344. static int le_swig__p_std__vectorT_int_t=0; /* handle for _p_std__vectorT_int_t */
  1345. static int le_swig__p_ProcedureCallback=0; /* handle for ProcedureCallback */
  1346. /* end vdecl subsection */
  1347. /* wrapper section */
  1348. ZEND_NAMED_FUNCTION(_wrap_Client_invoke) {
  1349.   Client *arg1 = (Client *) 0 ;
  1350.   ProcedureCallback *arg2 = (ProcedureCallback *) 0 ;
  1351.   zval **args[2];
  1352.  
  1353.   SWIG_ResetError();
  1354.   if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
  1355.     WRONG_PARAM_COUNT;
  1356.   }
  1357.  
  1358.   {
  1359.     if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Client, 0) < 0) {
  1360.       SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Client_invoke. Expected SWIGTYPE_p_Client");
  1361.     }
  1362.   }
  1363.   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  1364.   {
  1365.     if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_ProcedureCallback, 0) < 0) {
  1366.       SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Client_invoke. Expected SWIGTYPE_p_ProcedureCallback");
  1367.     }
  1368.   }
  1369.   (arg1)->invoke(arg2);
  1370.  
  1371.   return;
  1372. fail:
  1373.   zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
  1374. }
  1375.  
  1376.  
  1377. ZEND_NAMED_FUNCTION(_wrap_new_Client) {
  1378.   Client *result = 0 ;
  1379.  
  1380.   SWIG_ResetError();
  1381.   if(ZEND_NUM_ARGS() != 0) {
  1382.     WRONG_PARAM_COUNT;
  1383.   }
  1384.  
  1385.   result = (Client *)new Client();
  1386.  
  1387.   SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Client, 1);
  1388.  
  1389.   return;
  1390. fail:
  1391.   zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
  1392. }
  1393.  
  1394.  
  1395. /* This function is designed to be called by the zend list destructors */
  1396. /* to typecast and do the actual destruction */
  1397. static void __wrap_delete_Client(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  1398.   swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  1399.   void *ptr=value->ptr ;
  1400.   int newobject=value->newobject ;
  1401.   Client *arg1 = (Client *) 0 ;
  1402.  
  1403.   efree(value);
  1404.   if (! newobject) return; /* can't delete it! */
  1405.   arg1 = (Client *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Client TSRMLS_CC);
  1406.   if (! arg1) zend_error(E_ERROR, "Client resource already free'd");
  1407.   delete arg1;
  1408.   return;
  1409. fail:
  1410.   zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
  1411. }
  1412.  
  1413.  
  1414. ZEND_NAMED_FUNCTION(_wrap_ProcedureCallback_callback) {
  1415.   ProcedureCallback *arg1 = (ProcedureCallback *) 0 ;
  1416.   std::vector< int > arg2 ;
  1417.   std::vector< int > *tmp2 ;
  1418.   zval **args[2];
  1419.   Swig::Director *director = 0;
  1420.   bool upcall = false;
  1421.  
  1422.   director = dynamic_cast<Swig::Director*>(arg1);
  1423.   upcall = !director->swig_is_overridden_method((char *)"ProcedureCallback", (char *)"callback");
  1424.   SWIG_ResetError();
  1425.   if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
  1426.     WRONG_PARAM_COUNT;
  1427.   }
  1428.  
  1429.   {
  1430.     if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ProcedureCallback, 0) < 0) {
  1431.       SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ProcedureCallback_callback. Expected SWIGTYPE_p_ProcedureCallback");
  1432.     }
  1433.   }
  1434.   if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  1435.   {
  1436.     if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_std__vectorT_int_t, 0) < 0 || tmp2 == NULL) {
  1437.       SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ProcedureCallback_callback. Expected SWIGTYPE_p_std__vectorT_int_t");
  1438.     }
  1439.     arg2 = *tmp2;
  1440.   }
  1441.   if (upcall) {
  1442.     Swig::DirectorPureVirtualException::raise("ProcedureCallback::callback");
  1443.   } else {
  1444.     (arg1)->callback(arg2);
  1445.   }
  1446.  
  1447.   return;
  1448. fail:
  1449.   zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
  1450. }
  1451.  
  1452.  
  1453. ZEND_NAMED_FUNCTION(_wrap_new_ProcedureCallback) {
  1454.   zval *arg0;
  1455.   zval **args[1];
  1456.   ProcedureCallback *result = 0 ;
  1457.  
  1458.   SWIG_ResetError();
  1459.   if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
  1460.     WRONG_PARAM_COUNT;
  1461.   }
  1462.  
  1463.   arg0 = *args[0];
  1464.  
  1465.   if ( arg0->type == IS_NULL ) {
  1466.     /* not subclassed */
  1467.     SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
  1468.   } else {
  1469.     result = (ProcedureCallback *)new SwigDirector_ProcedureCallback(arg0);
  1470.   }
  1471.  
  1472.  
  1473.   SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ProcedureCallback, 1);
  1474.  
  1475.   return;
  1476. fail:
  1477.   zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
  1478. }
  1479.  
  1480.  
  1481. /* This function is designed to be called by the zend list destructors */
  1482. /* to typecast and do the actual destruction */
  1483. static void __wrap_delete_ProcedureCallback(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  1484.   swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  1485.   void *ptr=value->ptr ;
  1486.   int newobject=value->newobject ;
  1487.   ProcedureCallback *arg1 = (ProcedureCallback *) 0 ;
  1488.  
  1489.   efree(value);
  1490.   if (! newobject) return; /* can't delete it! */
  1491.   arg1 = (ProcedureCallback *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_ProcedureCallback TSRMLS_CC);
  1492.   if (! arg1) zend_error(E_ERROR, "ProcedureCallback resource already free'd");
  1493.   delete arg1;
  1494.   return;
  1495. fail:
  1496.   zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
  1497. }
  1498.  
  1499.  
  1500. static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Client) {
  1501.   __wrap_delete_Client(rsrc, SWIGTYPE_p_Client->name TSRMLS_CC);
  1502. }
  1503. static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_std__vectorT_int_t) {
  1504.   /* No destructor for simple type _p_std__vectorT_int_t */
  1505.   efree(rsrc->ptr);
  1506. }
  1507. static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_ProcedureCallback) {
  1508.   __wrap_delete_ProcedureCallback(rsrc, SWIGTYPE_p_ProcedureCallback->name TSRMLS_CC);
  1509. }
  1510. /* end wrapper section */
  1511. /* class entry subsection */
  1512.  
  1513.  
  1514. /* entry subsection */
  1515. /* Every non-class user visible function must have an entry here */
  1516. static zend_function_entry debugasync_functions[] = {
  1517.  SWIG_ZEND_NAMED_FE(client_invoke,_wrap_Client_invoke,NULL)
  1518.  SWIG_ZEND_NAMED_FE(new_client,_wrap_new_Client,NULL)
  1519.  SWIG_ZEND_NAMED_FE(procedurecallback_callback,_wrap_ProcedureCallback_callback,NULL)
  1520.  SWIG_ZEND_NAMED_FE(new_procedurecallback,_wrap_new_ProcedureCallback,NULL)
  1521.  SWIG_ZEND_NAMED_FE(swig_debugasync_alter_newobject,_wrap_swig_debugasync_alter_newobject,NULL)
  1522.  SWIG_ZEND_NAMED_FE(swig_debugasync_get_newobject,_wrap_swig_debugasync_get_newobject,NULL)
  1523. {NULL, NULL, NULL}
  1524. };
  1525.  
  1526. /* init section */
  1527. #if ZEND_MODULE_API_NO <= 20090626
  1528. #undef ZEND_MODULE_BUILD_ID
  1529. #define ZEND_MODULE_BUILD_ID (char*)"API" ZEND_TOSTR(ZEND_MODULE_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA
  1530. #endif
  1531. zend_module_entry debugasync_module_entry = {
  1532. #if ZEND_MODULE_API_NO > 20010900
  1533.     STANDARD_MODULE_HEADER,
  1534. #endif
  1535.     (char*)"debugasync",
  1536.     debugasync_functions,
  1537.     PHP_MINIT(debugasync),
  1538.     PHP_MSHUTDOWN(debugasync),
  1539.     PHP_RINIT(debugasync),
  1540.     PHP_RSHUTDOWN(debugasync),
  1541.     PHP_MINFO(debugasync),
  1542. #if ZEND_MODULE_API_NO > 20010900
  1543.     NO_VERSION_YET,
  1544. #endif
  1545.     STANDARD_MODULE_PROPERTIES
  1546. };
  1547. zend_module_entry* SWIG_module_entry = &debugasync_module_entry;
  1548.  
  1549. #ifdef __cplusplus
  1550. extern "C" {
  1551. #endif
  1552. SWIGEXPORT zend_module_entry *get_module(void) { return &debugasync_module_entry; }
  1553. #ifdef __cplusplus
  1554. }
  1555. #endif
  1556.  
  1557. #define SWIG_php_minit PHP_MINIT_FUNCTION(debugasync)
  1558. /* -----------------------------------------------------------------------------
  1559.  * Type initialization:
  1560.  * This problem is tough by the requirement that no dynamic
  1561.  * memory is used. Also, since swig_type_info structures store pointers to
  1562.  * swig_cast_info structures and swig_cast_info structures store pointers back
  1563.  * to swig_type_info structures, we need some lookup code at initialization.
  1564.  * The idea is that swig generates all the structures that are needed.
  1565.  * The runtime then collects these partially filled structures.
  1566.  * The SWIG_InitializeModule function takes these initial arrays out of
  1567.  * swig_module, and does all the lookup, filling in the swig_module.types
  1568.  * array with the correct data and linking the correct swig_cast_info
  1569.  * structures together.
  1570.  *
  1571.  * The generated swig_type_info structures are assigned staticly to an initial
  1572.  * array. We just loop through that array, and handle each type individually.
  1573.  * First we lookup if this type has been already loaded, and if so, use the
  1574.  * loaded structure instead of the generated one. Then we have to fill in the
  1575.  * cast linked list. The cast data is initially stored in something like a
  1576.  * two-dimensional array. Each row corresponds to a type (there are the same
  1577.  * number of rows as there are in the swig_type_initial array). Each entry in
  1578.  * a column is one of the swig_cast_info structures for that type.
  1579.  * The cast_initial array is actually an array of arrays, because each row has
  1580.  * a variable number of columns. So to actually build the cast linked list,
  1581.  * we find the array of casts associated with the type, and loop through it
  1582.  * adding the casts to the list. The one last trick we need to do is making
  1583.  * sure the type pointer in the swig_cast_info struct is correct.
  1584.  *
  1585.  * First off, we lookup the cast->type name to see if it is already loaded.
  1586.  * There are three cases to handle:
  1587.  *  1) If the cast->type has already been loaded AND the type we are adding
  1588.  *     casting info to has not been loaded (it is in this module), THEN we
  1589.  *     replace the cast->type pointer with the type pointer that has already
  1590.  *     been loaded.
  1591.  *  2) If BOTH types (the one we are adding casting info to, and the
  1592.  *     cast->type) are loaded, THEN the cast info has already been loaded by
  1593.  *     the previous module so we just ignore it.
  1594.  *  3) Finally, if cast->type has not already been loaded, then we add that
  1595.  *     swig_cast_info to the linked list (because the cast->type) pointer will
  1596.  *     be correct.
  1597.  * ----------------------------------------------------------------------------- */
  1598.  
  1599. #ifdef __cplusplus
  1600. extern "C" {
  1601. #if 0
  1602. } /* c-mode */
  1603. #endif
  1604. #endif
  1605.  
  1606. #if 0
  1607. #define SWIGRUNTIME_DEBUG
  1608. #endif
  1609.  
  1610.  
  1611. SWIGRUNTIME void
  1612. SWIG_InitializeModule(void *clientdata) {
  1613.   size_t i;
  1614.   swig_module_info *module_head, *iter;
  1615.   int found, init;
  1616.  
  1617.   clientdata = clientdata;
  1618.  
  1619.   /* check to see if the circular list has been setup, if not, set it up */
  1620.   if (swig_module.next==0) {
  1621.     /* Initialize the swig_module */
  1622.     swig_module.type_initial = swig_type_initial;
  1623.     swig_module.cast_initial = swig_cast_initial;
  1624.     swig_module.next = &swig_module;
  1625.     init = 1;
  1626.   } else {
  1627.     init = 0;
  1628.   }
  1629.  
  1630.   /* Try and load any already created modules */
  1631.   module_head = SWIG_GetModule(clientdata);
  1632.   if (!module_head) {
  1633.     /* This is the first module loaded for this interpreter */
  1634.     /* so set the swig module into the interpreter */
  1635.     SWIG_SetModule(clientdata, &swig_module);
  1636.     module_head = &swig_module;
  1637.   } else {
  1638.     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
  1639.     found=0;
  1640.     iter=module_head;
  1641.     do {
  1642.       if (iter==&swig_module) {
  1643.         found=1;
  1644.         break;
  1645.       }
  1646.       iter=iter->next;
  1647.     } while (iter!= module_head);
  1648.  
  1649.     /* if the is found in the list, then all is done and we may leave */
  1650.     if (found) return;
  1651.     /* otherwise we must add out module into the list */
  1652.     swig_module.next = module_head->next;
  1653.     module_head->next = &swig_module;
  1654.   }
  1655.  
  1656.   /* When multiple interpeters are used, a module could have already been initialized in
  1657.      a different interpreter, but not yet have a pointer in this interpreter.
  1658.      In this case, we do not want to continue adding types... everything should be
  1659.      set up already */
  1660.   if (init == 0) return;
  1661.  
  1662.   /* Now work on filling in swig_module.types */
  1663. #ifdef SWIGRUNTIME_DEBUG
  1664.   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
  1665. #endif
  1666.   for (i = 0; i < swig_module.size; ++i) {
  1667.     swig_type_info *type = 0;
  1668.     swig_type_info *ret;
  1669.     swig_cast_info *cast;
  1670.  
  1671. #ifdef SWIGRUNTIME_DEBUG
  1672.     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  1673. #endif
  1674.  
  1675.     /* if there is another module already loaded */
  1676.     if (swig_module.next != &swig_module) {
  1677.       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
  1678.     }
  1679.     if (type) {
  1680.       /* Overwrite clientdata field */
  1681. #ifdef SWIGRUNTIME_DEBUG
  1682.       printf("SWIG_InitializeModule: found type %s\n", type->name);
  1683. #endif
  1684.       if (swig_module.type_initial[i]->clientdata) {
  1685.     type->clientdata = swig_module.type_initial[i]->clientdata;
  1686. #ifdef SWIGRUNTIME_DEBUG
  1687.       printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
  1688. #endif
  1689.       }
  1690.     } else {
  1691.       type = swig_module.type_initial[i];
  1692.     }
  1693.  
  1694.     /* Insert casting types */
  1695.     cast = swig_module.cast_initial[i];
  1696.     while (cast->type) {
  1697.    
  1698.       /* Don't need to add information already in the list */
  1699.       ret = 0;
  1700. #ifdef SWIGRUNTIME_DEBUG
  1701.       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
  1702. #endif
  1703.       if (swig_module.next != &swig_module) {
  1704.         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
  1705. #ifdef SWIGRUNTIME_DEBUG
  1706.     if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
  1707. #endif
  1708.       }
  1709.       if (ret) {
  1710.     if (type == swig_module.type_initial[i]) {
  1711. #ifdef SWIGRUNTIME_DEBUG
  1712.       printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
  1713. #endif
  1714.       cast->type = ret;
  1715.       ret = 0;
  1716.     } else {
  1717.       /* Check for casting already in the list */
  1718.       swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
  1719. #ifdef SWIGRUNTIME_DEBUG
  1720.       if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
  1721. #endif
  1722.       if (!ocast) ret = 0;
  1723.     }
  1724.       }
  1725.  
  1726.       if (!ret) {
  1727. #ifdef SWIGRUNTIME_DEBUG
  1728.     printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
  1729. #endif
  1730.         if (type->cast) {
  1731.           type->cast->prev = cast;
  1732.           cast->next = type->cast;
  1733.         }
  1734.         type->cast = cast;
  1735.       }
  1736.       cast++;
  1737.     }
  1738.     /* Set entry in modules->types array equal to the type */
  1739.     swig_module.types[i] = type;
  1740.   }
  1741.   swig_module.types[i] = 0;
  1742.  
  1743. #ifdef SWIGRUNTIME_DEBUG
  1744.   printf("**** SWIG_InitializeModule: Cast List ******\n");
  1745.   for (i = 0; i < swig_module.size; ++i) {
  1746.     int j = 0;
  1747.     swig_cast_info *cast = swig_module.cast_initial[i];
  1748.     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  1749.     while (cast->type) {
  1750.       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
  1751.       cast++;
  1752.       ++j;
  1753.     }
  1754.   printf("---- Total casts: %d\n",j);
  1755.   }
  1756.   printf("**** SWIG_InitializeModule: Cast List ******\n");
  1757. #endif
  1758. }
  1759.  
  1760. /* This function will propagate the clientdata field of type to
  1761. * any new swig_type_info structures that have been added into the list
  1762. * of equivalent types.  It is like calling
  1763. * SWIG_TypeClientData(type, clientdata) a second time.
  1764. */
  1765. SWIGRUNTIME void
  1766. SWIG_PropagateClientData(void) {
  1767.   size_t i;
  1768.   swig_cast_info *equiv;
  1769.   static int init_run = 0;
  1770.  
  1771.   if (init_run) return;
  1772.   init_run = 1;
  1773.  
  1774.   for (i = 0; i < swig_module.size; i++) {
  1775.     if (swig_module.types[i]->clientdata) {
  1776.       equiv = swig_module.types[i]->cast;
  1777.       while (equiv) {
  1778.         if (!equiv->converter) {
  1779.           if (equiv->type && !equiv->type->clientdata)
  1780.             SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
  1781.         }
  1782.         equiv = equiv->next;
  1783.       }
  1784.     }
  1785.   }
  1786. }
  1787.  
  1788. #ifdef __cplusplus
  1789. #if 0
  1790. { /* c-mode */
  1791. #endif
  1792. }
  1793. #endif
  1794.  
  1795.  
  1796.   SWIG_php_minit {
  1797.     SWIG_InitializeModule(0);
  1798.     le_member_ptr = zend_register_list_destructors_ex(member_ptr_dtor, NULL, SWIG_MEMBER_PTR, module_number);
  1799.  
  1800. /* oinit subsection */
  1801. ZEND_INIT_MODULE_GLOBALS(debugasync, debugasync_init_globals, debugasync_destroy_globals);
  1802.  
  1803. /* Register resource destructors for pointer types */
  1804. le_swig__p_Client=zend_register_list_destructors_ex(_wrap_destroy_p_Client,NULL,(char *)(SWIGTYPE_p_Client->name),module_number);
  1805. SWIG_TypeClientData(SWIGTYPE_p_Client,&le_swig__p_Client);
  1806. le_swig__p_std__vectorT_int_t=zend_register_list_destructors_ex(_wrap_destroy_p_std__vectorT_int_t,NULL,(char *)(SWIGTYPE_p_std__vectorT_int_t->name),module_number);
  1807. SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_int_t,&le_swig__p_std__vectorT_int_t);
  1808. le_swig__p_ProcedureCallback=zend_register_list_destructors_ex(_wrap_destroy_p_ProcedureCallback,NULL,(char *)(SWIGTYPE_p_ProcedureCallback->name),module_number);
  1809. SWIG_TypeClientData(SWIGTYPE_p_ProcedureCallback,&le_swig__p_ProcedureCallback);
  1810. CG(active_class_entry) = NULL;
  1811. /* end oinit subsection */
  1812.  
  1813. /* cinit subsection */
  1814. /* end cinit subsection */
  1815.  
  1816.     return SUCCESS;
  1817. }
  1818.  
  1819. PHP_RINIT_FUNCTION(debugasync)
  1820. {
  1821. /* rinit section */
  1822.  
  1823. /* vinit subsection */
  1824. /* end vinit subsection */
  1825.  
  1826.     return SUCCESS;
  1827. }
  1828.  
  1829. PHP_MSHUTDOWN_FUNCTION(debugasync)
  1830. {
  1831. /* shutdown section */
  1832. #ifdef ZTS
  1833.     ts_free_id(debugasync_globals_id);
  1834. #endif
  1835.     return SUCCESS;
  1836. }
  1837.  
  1838. PHP_RSHUTDOWN_FUNCTION(debugasync)
  1839. {
  1840. /* rshutdown section */
  1841.  
  1842.     return SUCCESS;
  1843. }
  1844.  
  1845. PHP_MINFO_FUNCTION(debugasync)
  1846. {
  1847. }
  1848. /* end init section */