2
0

scgi_wrap.cpp 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 1.3.35
  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. #define SWIGPERL
  11. #define SWIG_CASTRANK_MODE
  12. #ifdef __cplusplus
  13. template<typename T> class SwigValueWrapper {
  14. T *tt;
  15. public:
  16. SwigValueWrapper() : tt(0) { }
  17. SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
  18. SwigValueWrapper(const T& t) : tt(new T(t)) { }
  19. ~SwigValueWrapper() { delete tt; }
  20. SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
  21. operator T&() const { return *tt; }
  22. T *operator&() { return tt; }
  23. private:
  24. SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  25. };
  26. template <typename T> T SwigValueInit() {
  27. return T();
  28. }
  29. #endif
  30. /* -----------------------------------------------------------------------------
  31. * This section contains generic SWIG labels for method/variable
  32. * declarations/attributes, and other compiler dependent labels.
  33. * ----------------------------------------------------------------------------- */
  34. /* template workaround for compilers that cannot correctly implement the C++ standard */
  35. #ifndef SWIGTEMPLATEDISAMBIGUATOR
  36. # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  37. # define SWIGTEMPLATEDISAMBIGUATOR template
  38. # elif defined(__HP_aCC)
  39. /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  40. /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  41. # define SWIGTEMPLATEDISAMBIGUATOR template
  42. # else
  43. # define SWIGTEMPLATEDISAMBIGUATOR
  44. # endif
  45. #endif
  46. /* inline attribute */
  47. #ifndef SWIGINLINE
  48. # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  49. # define SWIGINLINE inline
  50. # else
  51. # define SWIGINLINE
  52. # endif
  53. #endif
  54. /* attribute recognised by some compilers to avoid 'unused' warnings */
  55. #ifndef SWIGUNUSED
  56. # if defined(__GNUC__)
  57. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  58. # define SWIGUNUSED __attribute__ ((__unused__))
  59. # else
  60. # define SWIGUNUSED
  61. # endif
  62. # elif defined(__ICC)
  63. # define SWIGUNUSED __attribute__ ((__unused__))
  64. # else
  65. # define SWIGUNUSED
  66. # endif
  67. #endif
  68. #ifndef SWIGUNUSEDPARM
  69. # ifdef __cplusplus
  70. # define SWIGUNUSEDPARM(p)
  71. # else
  72. # define SWIGUNUSEDPARM(p) p SWIGUNUSED
  73. # endif
  74. #endif
  75. /* internal SWIG method */
  76. #ifndef SWIGINTERN
  77. # define SWIGINTERN static SWIGUNUSED
  78. #endif
  79. /* internal inline SWIG method */
  80. #ifndef SWIGINTERNINLINE
  81. # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  82. #endif
  83. /* exporting methods */
  84. #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  85. # ifndef GCC_HASCLASSVISIBILITY
  86. # define GCC_HASCLASSVISIBILITY
  87. # endif
  88. #endif
  89. #ifndef SWIGEXPORT
  90. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  91. # if defined(STATIC_LINKED)
  92. # define SWIGEXPORT
  93. # else
  94. # define SWIGEXPORT __declspec(dllexport)
  95. # endif
  96. # else
  97. # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  98. # define SWIGEXPORT __attribute__ ((visibility("default")))
  99. # else
  100. # define SWIGEXPORT
  101. # endif
  102. # endif
  103. #endif
  104. /* calling conventions for Windows */
  105. #ifndef SWIGSTDCALL
  106. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  107. # define SWIGSTDCALL __stdcall
  108. # else
  109. # define SWIGSTDCALL
  110. # endif
  111. #endif
  112. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  113. #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  114. # define _CRT_SECURE_NO_DEPRECATE
  115. #endif
  116. /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  117. #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  118. # define _SCL_SECURE_NO_DEPRECATE
  119. #endif
  120. /* -----------------------------------------------------------------------------
  121. * swigrun.swg
  122. *
  123. * This file contains generic CAPI SWIG runtime support for pointer
  124. * type checking.
  125. * ----------------------------------------------------------------------------- */
  126. /* This should only be incremented when either the layout of swig_type_info changes,
  127. or for whatever reason, the runtime changes incompatibly */
  128. #define SWIG_RUNTIME_VERSION "4"
  129. /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
  130. #ifdef SWIG_TYPE_TABLE
  131. # define SWIG_QUOTE_STRING(x) #x
  132. # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
  133. # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
  134. #else
  135. # define SWIG_TYPE_TABLE_NAME
  136. #endif
  137. /*
  138. You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  139. creating a static or dynamic library from the swig runtime code.
  140. In 99.9% of the cases, swig just needs to declare them as 'static'.
  141. But only do this if is strictly necessary, ie, if you have problems
  142. with your compiler or so.
  143. */
  144. #ifndef SWIGRUNTIME
  145. # define SWIGRUNTIME SWIGINTERN
  146. #endif
  147. #ifndef SWIGRUNTIMEINLINE
  148. # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
  149. #endif
  150. /* Generic buffer size */
  151. #ifndef SWIG_BUFFER_SIZE
  152. # define SWIG_BUFFER_SIZE 1024
  153. #endif
  154. /* Flags for pointer conversions */
  155. #define SWIG_POINTER_DISOWN 0x1
  156. #define SWIG_CAST_NEW_MEMORY 0x2
  157. /* Flags for new pointer objects */
  158. #define SWIG_POINTER_OWN 0x1
  159. /*
  160. Flags/methods for returning states.
  161. The swig conversion methods, as ConvertPtr, return and integer
  162. that tells if the conversion was successful or not. And if not,
  163. an error code can be returned (see swigerrors.swg for the codes).
  164. Use the following macros/flags to set or process the returning
  165. states.
  166. In old swig versions, you usually write code as:
  167. if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
  168. // success code
  169. } else {
  170. //fail code
  171. }
  172. Now you can be more explicit as:
  173. int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
  174. if (SWIG_IsOK(res)) {
  175. // success code
  176. } else {
  177. // fail code
  178. }
  179. that seems to be the same, but now you can also do
  180. Type *ptr;
  181. int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
  182. if (SWIG_IsOK(res)) {
  183. // success code
  184. if (SWIG_IsNewObj(res) {
  185. ...
  186. delete *ptr;
  187. } else {
  188. ...
  189. }
  190. } else {
  191. // fail code
  192. }
  193. I.e., now SWIG_ConvertPtr can return new objects and you can
  194. identify the case and take care of the deallocation. Of course that
  195. requires also to SWIG_ConvertPtr to return new result values, as
  196. int SWIG_ConvertPtr(obj, ptr,...) {
  197. if (<obj is ok>) {
  198. if (<need new object>) {
  199. *ptr = <ptr to new allocated object>;
  200. return SWIG_NEWOBJ;
  201. } else {
  202. *ptr = <ptr to old object>;
  203. return SWIG_OLDOBJ;
  204. }
  205. } else {
  206. return SWIG_BADOBJ;
  207. }
  208. }
  209. Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
  210. more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
  211. swig errors code.
  212. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
  213. allows to return the 'cast rank', for example, if you have this
  214. int food(double)
  215. int fooi(int);
  216. and you call
  217. food(1) // cast rank '1' (1 -> 1.0)
  218. fooi(1) // cast rank '0'
  219. just use the SWIG_AddCast()/SWIG_CheckState()
  220. */
  221. #define SWIG_OK (0)
  222. #define SWIG_ERROR (-1)
  223. #define SWIG_IsOK(r) (r >= 0)
  224. #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
  225. /* The CastRankLimit says how many bits are used for the cast rank */
  226. #define SWIG_CASTRANKLIMIT (1 << 8)
  227. /* The NewMask denotes the object was created (using new/malloc) */
  228. #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
  229. /* The TmpMask is for in/out typemaps that use temporal objects */
  230. #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
  231. /* Simple returning values */
  232. #define SWIG_BADOBJ (SWIG_ERROR)
  233. #define SWIG_OLDOBJ (SWIG_OK)
  234. #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
  235. #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
  236. /* Check, add and del mask methods */
  237. #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
  238. #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
  239. #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
  240. #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
  241. #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
  242. #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
  243. /* Cast-Rank Mode */
  244. #if defined(SWIG_CASTRANK_MODE)
  245. # ifndef SWIG_TypeRank
  246. # define SWIG_TypeRank unsigned long
  247. # endif
  248. # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
  249. # define SWIG_MAXCASTRANK (2)
  250. # endif
  251. # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
  252. # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
  253. SWIGINTERNINLINE int SWIG_AddCast(int r) {
  254. return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
  255. }
  256. SWIGINTERNINLINE int SWIG_CheckState(int r) {
  257. return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
  258. }
  259. #else /* no cast-rank mode */
  260. # define SWIG_AddCast
  261. # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
  262. #endif
  263. #include <string.h>
  264. #ifdef __cplusplus
  265. extern "C" {
  266. #endif
  267. typedef void *(*swig_converter_func)(void *, int *);
  268. typedef struct swig_type_info *(*swig_dycast_func)(void **);
  269. /* Structure to store information on one type */
  270. typedef struct swig_type_info {
  271. const char *name; /* mangled name of this type */
  272. const char *str; /* human readable name of this type */
  273. swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
  274. struct swig_cast_info *cast; /* linked list of types that can cast into this type */
  275. void *clientdata; /* language specific type data */
  276. int owndata; /* flag if the structure owns the clientdata */
  277. } swig_type_info;
  278. /* Structure to store a type and conversion function used for casting */
  279. typedef struct swig_cast_info {
  280. swig_type_info *type; /* pointer to type that is equivalent to this type */
  281. swig_converter_func converter; /* function to cast the void pointers */
  282. struct swig_cast_info *next; /* pointer to next cast in linked list */
  283. struct swig_cast_info *prev; /* pointer to the previous cast */
  284. } swig_cast_info;
  285. /* Structure used to store module information
  286. * Each module generates one structure like this, and the runtime collects
  287. * all of these structures and stores them in a circularly linked list.*/
  288. typedef struct swig_module_info {
  289. swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
  290. size_t size; /* Number of types in this module */
  291. struct swig_module_info *next; /* Pointer to next element in circularly linked list */
  292. swig_type_info **type_initial; /* Array of initially generated type structures */
  293. swig_cast_info **cast_initial; /* Array of initially generated casting structures */
  294. void *clientdata; /* Language specific module data */
  295. } swig_module_info;
  296. /*
  297. Compare two type names skipping the space characters, therefore
  298. "char*" == "char *" and "Class<int>" == "Class<int >", etc.
  299. Return 0 when the two name types are equivalent, as in
  300. strncmp, but skipping ' '.
  301. */
  302. SWIGRUNTIME int
  303. SWIG_TypeNameComp(const char *f1, const char *l1,
  304. const char *f2, const char *l2) {
  305. for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
  306. while ((*f1 == ' ') && (f1 != l1)) ++f1;
  307. while ((*f2 == ' ') && (f2 != l2)) ++f2;
  308. if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  309. }
  310. return (int)((l1 - f1) - (l2 - f2));
  311. }
  312. /*
  313. Check type equivalence in a name list like <name1>|<name2>|...
  314. Return 0 if not equal, 1 if equal
  315. */
  316. SWIGRUNTIME int
  317. SWIG_TypeEquiv(const char *nb, const char *tb) {
  318. int equiv = 0;
  319. const char* te = tb + strlen(tb);
  320. const char* ne = nb;
  321. while (!equiv && *ne) {
  322. for (nb = ne; *ne; ++ne) {
  323. if (*ne == '|') break;
  324. }
  325. equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  326. if (*ne) ++ne;
  327. }
  328. return equiv;
  329. }
  330. /*
  331. Check type equivalence in a name list like <name1>|<name2>|...
  332. Return 0 if equal, -1 if nb < tb, 1 if nb > tb
  333. */
  334. SWIGRUNTIME int
  335. SWIG_TypeCompare(const char *nb, const char *tb) {
  336. int equiv = 0;
  337. const char* te = tb + strlen(tb);
  338. const char* ne = nb;
  339. while (!equiv && *ne) {
  340. for (nb = ne; *ne; ++ne) {
  341. if (*ne == '|') break;
  342. }
  343. equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  344. if (*ne) ++ne;
  345. }
  346. return equiv;
  347. }
  348. /* think of this as a c++ template<> or a scheme macro */
  349. #define SWIG_TypeCheck_Template(comparison, ty) \
  350. if (ty) { \
  351. swig_cast_info *iter = ty->cast; \
  352. while (iter) { \
  353. if (comparison) { \
  354. if (iter == ty->cast) return iter; \
  355. /* Move iter to the top of the linked list */ \
  356. iter->prev->next = iter->next; \
  357. if (iter->next) \
  358. iter->next->prev = iter->prev; \
  359. iter->next = ty->cast; \
  360. iter->prev = 0; \
  361. if (ty->cast) ty->cast->prev = iter; \
  362. ty->cast = iter; \
  363. return iter; \
  364. } \
  365. iter = iter->next; \
  366. } \
  367. } \
  368. return 0
  369. /*
  370. Check the typename
  371. */
  372. SWIGRUNTIME swig_cast_info *
  373. SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  374. SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
  375. }
  376. /* Same as previous function, except strcmp is replaced with a pointer comparison */
  377. SWIGRUNTIME swig_cast_info *
  378. SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
  379. SWIG_TypeCheck_Template(iter->type == from, into);
  380. }
  381. /*
  382. Cast a pointer up an inheritance hierarchy
  383. */
  384. SWIGRUNTIMEINLINE void *
  385. SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  386. return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
  387. }
  388. /*
  389. Dynamic pointer casting. Down an inheritance hierarchy
  390. */
  391. SWIGRUNTIME swig_type_info *
  392. SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  393. swig_type_info *lastty = ty;
  394. if (!ty || !ty->dcast) return ty;
  395. while (ty && (ty->dcast)) {
  396. ty = (*ty->dcast)(ptr);
  397. if (ty) lastty = ty;
  398. }
  399. return lastty;
  400. }
  401. /*
  402. Return the name associated with this type
  403. */
  404. SWIGRUNTIMEINLINE const char *
  405. SWIG_TypeName(const swig_type_info *ty) {
  406. return ty->name;
  407. }
  408. /*
  409. Return the pretty name associated with this type,
  410. that is an unmangled type name in a form presentable to the user.
  411. */
  412. SWIGRUNTIME const char *
  413. SWIG_TypePrettyName(const swig_type_info *type) {
  414. /* The "str" field contains the equivalent pretty names of the
  415. type, separated by vertical-bar characters. We choose
  416. to print the last name, as it is often (?) the most
  417. specific. */
  418. if (!type) return NULL;
  419. if (type->str != NULL) {
  420. const char *last_name = type->str;
  421. const char *s;
  422. for (s = type->str; *s; s++)
  423. if (*s == '|') last_name = s+1;
  424. return last_name;
  425. }
  426. else
  427. return type->name;
  428. }
  429. /*
  430. Set the clientdata field for a type
  431. */
  432. SWIGRUNTIME void
  433. SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  434. swig_cast_info *cast = ti->cast;
  435. /* if (ti->clientdata == clientdata) return; */
  436. ti->clientdata = clientdata;
  437. while (cast) {
  438. if (!cast->converter) {
  439. swig_type_info *tc = cast->type;
  440. if (!tc->clientdata) {
  441. SWIG_TypeClientData(tc, clientdata);
  442. }
  443. }
  444. cast = cast->next;
  445. }
  446. }
  447. SWIGRUNTIME void
  448. SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  449. SWIG_TypeClientData(ti, clientdata);
  450. ti->owndata = 1;
  451. }
  452. /*
  453. Search for a swig_type_info structure only by mangled name
  454. Search is a O(log #types)
  455. We start searching at module start, and finish searching when start == end.
  456. Note: if start == end at the beginning of the function, we go all the way around
  457. the circular list.
  458. */
  459. SWIGRUNTIME swig_type_info *
  460. SWIG_MangledTypeQueryModule(swig_module_info *start,
  461. swig_module_info *end,
  462. const char *name) {
  463. swig_module_info *iter = start;
  464. do {
  465. if (iter->size) {
  466. register size_t l = 0;
  467. register size_t r = iter->size - 1;
  468. do {
  469. /* since l+r >= 0, we can (>> 1) instead (/ 2) */
  470. register size_t i = (l + r) >> 1;
  471. const char *iname = iter->types[i]->name;
  472. if (iname) {
  473. register int compare = strcmp(name, iname);
  474. if (compare == 0) {
  475. return iter->types[i];
  476. } else if (compare < 0) {
  477. if (i) {
  478. r = i - 1;
  479. } else {
  480. break;
  481. }
  482. } else if (compare > 0) {
  483. l = i + 1;
  484. }
  485. } else {
  486. break; /* should never happen */
  487. }
  488. } while (l <= r);
  489. }
  490. iter = iter->next;
  491. } while (iter != end);
  492. return 0;
  493. }
  494. /*
  495. Search for a swig_type_info structure for either a mangled name or a human readable name.
  496. It first searches the mangled names of the types, which is a O(log #types)
  497. If a type is not found it then searches the human readable names, which is O(#types).
  498. We start searching at module start, and finish searching when start == end.
  499. Note: if start == end at the beginning of the function, we go all the way around
  500. the circular list.
  501. */
  502. SWIGRUNTIME swig_type_info *
  503. SWIG_TypeQueryModule(swig_module_info *start,
  504. swig_module_info *end,
  505. const char *name) {
  506. /* STEP 1: Search the name field using binary search */
  507. swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  508. if (ret) {
  509. return ret;
  510. } else {
  511. /* STEP 2: If the type hasn't been found, do a complete search
  512. of the str field (the human readable name) */
  513. swig_module_info *iter = start;
  514. do {
  515. register size_t i = 0;
  516. for (; i < iter->size; ++i) {
  517. if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
  518. return iter->types[i];
  519. }
  520. iter = iter->next;
  521. } while (iter != end);
  522. }
  523. /* neither found a match */
  524. return 0;
  525. }
  526. /*
  527. Pack binary data into a string
  528. */
  529. SWIGRUNTIME char *
  530. SWIG_PackData(char *c, void *ptr, size_t sz) {
  531. static const char hex[17] = "0123456789abcdef";
  532. register const unsigned char *u = (unsigned char *) ptr;
  533. register const unsigned char *eu = u + sz;
  534. for (; u != eu; ++u) {
  535. register unsigned char uu = *u;
  536. *(c++) = hex[(uu & 0xf0) >> 4];
  537. *(c++) = hex[uu & 0xf];
  538. }
  539. return c;
  540. }
  541. /*
  542. Unpack binary data from a string
  543. */
  544. SWIGRUNTIME const char *
  545. SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  546. register unsigned char *u = (unsigned char *) ptr;
  547. register const unsigned char *eu = u + sz;
  548. for (; u != eu; ++u) {
  549. register char d = *(c++);
  550. register unsigned char uu;
  551. if ((d >= '0') && (d <= '9'))
  552. uu = ((d - '0') << 4);
  553. else if ((d >= 'a') && (d <= 'f'))
  554. uu = ((d - ('a'-10)) << 4);
  555. else
  556. return (char *) 0;
  557. d = *(c++);
  558. if ((d >= '0') && (d <= '9'))
  559. uu |= (d - '0');
  560. else if ((d >= 'a') && (d <= 'f'))
  561. uu |= (d - ('a'-10));
  562. else
  563. return (char *) 0;
  564. *u = uu;
  565. }
  566. return c;
  567. }
  568. /*
  569. Pack 'void *' into a string buffer.
  570. */
  571. SWIGRUNTIME char *
  572. SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  573. char *r = buff;
  574. if ((2*sizeof(void *) + 2) > bsz) return 0;
  575. *(r++) = '_';
  576. r = SWIG_PackData(r,&ptr,sizeof(void *));
  577. if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  578. strcpy(r,name);
  579. return buff;
  580. }
  581. SWIGRUNTIME const char *
  582. SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  583. if (*c != '_') {
  584. if (strcmp(c,"NULL") == 0) {
  585. *ptr = (void *) 0;
  586. return name;
  587. } else {
  588. return 0;
  589. }
  590. }
  591. return SWIG_UnpackData(++c,ptr,sizeof(void *));
  592. }
  593. SWIGRUNTIME char *
  594. SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  595. char *r = buff;
  596. size_t lname = (name ? strlen(name) : 0);
  597. if ((2*sz + 2 + lname) > bsz) return 0;
  598. *(r++) = '_';
  599. r = SWIG_PackData(r,ptr,sz);
  600. if (lname) {
  601. strncpy(r,name,lname+1);
  602. } else {
  603. *r = 0;
  604. }
  605. return buff;
  606. }
  607. SWIGRUNTIME const char *
  608. SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  609. if (*c != '_') {
  610. if (strcmp(c,"NULL") == 0) {
  611. memset(ptr,0,sz);
  612. return name;
  613. } else {
  614. return 0;
  615. }
  616. }
  617. return SWIG_UnpackData(++c,ptr,sz);
  618. }
  619. #ifdef __cplusplus
  620. }
  621. #endif
  622. /* Errors in SWIG */
  623. #define SWIG_UnknownError -1
  624. #define SWIG_IOError -2
  625. #define SWIG_RuntimeError -3
  626. #define SWIG_IndexError -4
  627. #define SWIG_TypeError -5
  628. #define SWIG_DivisionByZero -6
  629. #define SWIG_OverflowError -7
  630. #define SWIG_SyntaxError -8
  631. #define SWIG_ValueError -9
  632. #define SWIG_SystemError -10
  633. #define SWIG_AttributeError -11
  634. #define SWIG_MemoryError -12
  635. #define SWIG_NullReferenceError -13
  636. #ifdef __cplusplus
  637. /* Needed on some windows machines---since MS plays funny games with the header files under C++ */
  638. #include <math.h>
  639. #include <stdlib.h>
  640. extern "C" {
  641. #endif
  642. #include "EXTERN.h"
  643. #include "perl.h"
  644. #include "XSUB.h"
  645. /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
  646. /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
  647. #ifndef PERL_REVISION
  648. # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
  649. # define PERL_PATCHLEVEL_H_IMPLICIT
  650. # include <patchlevel.h>
  651. # endif
  652. # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
  653. # include <could_not_find_Perl_patchlevel.h>
  654. # endif
  655. # ifndef PERL_REVISION
  656. # define PERL_REVISION (5)
  657. # define PERL_VERSION PATCHLEVEL
  658. # define PERL_SUBVERSION SUBVERSION
  659. # endif
  660. #endif
  661. #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
  662. #define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
  663. #endif
  664. #ifndef SvIOK_UV
  665. # define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
  666. #endif
  667. #ifndef SvUOK
  668. # define SvUOK(sv) SvIOK_UV(sv)
  669. #endif
  670. #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
  671. # define PL_sv_undef sv_undef
  672. # define PL_na na
  673. # define PL_errgv errgv
  674. # define PL_sv_no sv_no
  675. # define PL_sv_yes sv_yes
  676. # define PL_markstack_ptr markstack_ptr
  677. #endif
  678. #ifndef IVSIZE
  679. # ifdef LONGSIZE
  680. # define IVSIZE LONGSIZE
  681. # else
  682. # define IVSIZE 4 /* A bold guess, but the best we can make. */
  683. # endif
  684. #endif
  685. #ifndef INT2PTR
  686. # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
  687. # define PTRV UV
  688. # define INT2PTR(any,d) (any)(d)
  689. # else
  690. # if PTRSIZE == LONGSIZE
  691. # define PTRV unsigned long
  692. # else
  693. # define PTRV unsigned
  694. # endif
  695. # define INT2PTR(any,d) (any)(PTRV)(d)
  696. # endif
  697. # define NUM2PTR(any,d) (any)(PTRV)(d)
  698. # define PTR2IV(p) INT2PTR(IV,p)
  699. # define PTR2UV(p) INT2PTR(UV,p)
  700. # define PTR2NV(p) NUM2PTR(NV,p)
  701. # if PTRSIZE == LONGSIZE
  702. # define PTR2ul(p) (unsigned long)(p)
  703. # else
  704. # define PTR2ul(p) INT2PTR(unsigned long,p)
  705. # endif
  706. #endif /* !INT2PTR */
  707. #ifndef SvPV_nolen
  708. # define SvPV_nolen(x) SvPV(x,PL_na)
  709. #endif
  710. #ifndef get_sv
  711. # define get_sv perl_get_sv
  712. #endif
  713. #ifndef ERRSV
  714. # define ERRSV get_sv("@",FALSE)
  715. #endif
  716. #ifndef pTHX_
  717. #define pTHX_
  718. #endif
  719. #include <string.h>
  720. #ifdef __cplusplus
  721. }
  722. #endif
  723. /* -----------------------------------------------------------------------------
  724. * error manipulation
  725. * ----------------------------------------------------------------------------- */
  726. SWIGINTERN const char*
  727. SWIG_Perl_ErrorType(int code) {
  728. const char* type = 0;
  729. switch(code) {
  730. case SWIG_MemoryError:
  731. type = "MemoryError";
  732. break;
  733. case SWIG_IOError:
  734. type = "IOError";
  735. break;
  736. case SWIG_RuntimeError:
  737. type = "RuntimeError";
  738. break;
  739. case SWIG_IndexError:
  740. type = "IndexError";
  741. break;
  742. case SWIG_TypeError:
  743. type = "TypeError";
  744. break;
  745. case SWIG_DivisionByZero:
  746. type = "ZeroDivisionError";
  747. break;
  748. case SWIG_OverflowError:
  749. type = "OverflowError";
  750. break;
  751. case SWIG_SyntaxError:
  752. type = "SyntaxError";
  753. break;
  754. case SWIG_ValueError:
  755. type = "ValueError";
  756. break;
  757. case SWIG_SystemError:
  758. type = "SystemError";
  759. break;
  760. case SWIG_AttributeError:
  761. type = "AttributeError";
  762. break;
  763. default:
  764. type = "RuntimeError";
  765. }
  766. return type;
  767. }
  768. /* -----------------------------------------------------------------------------
  769. * perlrun.swg
  770. *
  771. * This file contains the runtime support for Perl modules
  772. * and includes code for managing global variables and pointer
  773. * type checking.
  774. * ----------------------------------------------------------------------------- */
  775. #ifdef PERL_OBJECT
  776. #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
  777. #define SWIG_PERL_OBJECT_CALL pPerl,
  778. #else
  779. #define SWIG_PERL_OBJECT_DECL
  780. #define SWIG_PERL_OBJECT_CALL
  781. #endif
  782. /* Common SWIG API */
  783. /* for raw pointers */
  784. #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
  785. #define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
  786. /* for raw packed data */
  787. #define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
  788. #define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
  789. /* for class or struct pointers */
  790. #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
  791. #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
  792. /* for C or C++ function pointers */
  793. #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
  794. #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
  795. /* for C++ member pointers, ie, member methods */
  796. #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty)
  797. #define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type)
  798. /* Runtime API */
  799. #define SWIG_GetModule(clientdata) SWIG_Perl_GetModule()
  800. #define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
  801. /* Error manipulation */
  802. #define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
  803. #define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
  804. #define SWIG_fail goto fail
  805. /* Perl-specific SWIG API */
  806. #define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
  807. #define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
  808. #define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str)
  809. #define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1)
  810. #define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1)
  811. #define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2)
  812. #define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2)
  813. /* -----------------------------------------------------------------------------
  814. * pointers/data manipulation
  815. * ----------------------------------------------------------------------------- */
  816. /* For backward compatibility only */
  817. #define SWIG_POINTER_EXCEPTION 0
  818. #ifdef __cplusplus
  819. extern "C" {
  820. #endif
  821. #define SWIG_OWNER SWIG_POINTER_OWN
  822. #define SWIG_SHADOW SWIG_OWNER << 1
  823. #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
  824. /* SWIG Perl macros */
  825. /* Macro to declare an XS function */
  826. #ifndef XSPROTO
  827. # define XSPROTO(name) void name(pTHX_ CV* cv)
  828. #endif
  829. /* Macro to call an XS function */
  830. #ifdef PERL_OBJECT
  831. # define SWIG_CALLXS(_name) _name(cv,pPerl)
  832. #else
  833. # ifndef MULTIPLICITY
  834. # define SWIG_CALLXS(_name) _name(cv)
  835. # else
  836. # define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
  837. # endif
  838. #endif
  839. #ifdef PERL_OBJECT
  840. #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
  841. #ifdef __cplusplus
  842. extern "C" {
  843. #endif
  844. typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
  845. #ifdef __cplusplus
  846. }
  847. #endif
  848. #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
  849. #define SWIGCLASS_STATIC
  850. #else /* PERL_OBJECT */
  851. #define MAGIC_PPERL
  852. #define SWIGCLASS_STATIC static SWIGUNUSED
  853. #ifndef MULTIPLICITY
  854. #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
  855. #ifdef __cplusplus
  856. extern "C" {
  857. #endif
  858. typedef int (*SwigMagicFunc)(SV *, MAGIC *);
  859. #ifdef __cplusplus
  860. }
  861. #endif
  862. #else /* MULTIPLICITY */
  863. #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
  864. #ifdef __cplusplus
  865. extern "C" {
  866. #endif
  867. typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
  868. #ifdef __cplusplus
  869. }
  870. #endif
  871. #endif /* MULTIPLICITY */
  872. #endif /* PERL_OBJECT */
  873. /* Workaround for bug in perl 5.6.x croak and earlier */
  874. #if (PERL_VERSION < 8)
  875. # ifdef PERL_OBJECT
  876. # define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
  877. static void SWIG_Perl_croak_null(CPerlObj *pPerl)
  878. # else
  879. static void SWIG_croak_null()
  880. # endif
  881. {
  882. SV *err=ERRSV;
  883. # if (PERL_VERSION < 6)
  884. croak("%_", err);
  885. # else
  886. if (SvOK(err) && !SvROK(err)) croak("%_", err);
  887. croak(Nullch);
  888. # endif
  889. }
  890. #else
  891. # define SWIG_croak_null() croak(Nullch)
  892. #endif
  893. /*
  894. Define how strict is the cast between strings and integers/doubles
  895. when overloading between these types occurs.
  896. The default is making it as strict as possible by using SWIG_AddCast
  897. when needed.
  898. You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
  899. disable the SWIG_AddCast, making the casting between string and
  900. numbers less strict.
  901. In the end, we try to solve the overloading between strings and
  902. numerical types in the more natural way, but if you can avoid it,
  903. well, avoid it using %rename, for example.
  904. */
  905. #ifndef SWIG_PERL_NO_STRICT_STR2NUM
  906. # ifndef SWIG_PERL_STRICT_STR2NUM
  907. # define SWIG_PERL_STRICT_STR2NUM
  908. # endif
  909. #endif
  910. #ifdef SWIG_PERL_STRICT_STR2NUM
  911. /* string takes precedence */
  912. #define SWIG_Str2NumCast(x) SWIG_AddCast(x)
  913. #else
  914. /* number takes precedence */
  915. #define SWIG_Str2NumCast(x) x
  916. #endif
  917. #include <stdlib.h>
  918. SWIGRUNTIME const char *
  919. SWIG_Perl_TypeProxyName(const swig_type_info *type) {
  920. if (!type) return NULL;
  921. if (type->clientdata != NULL) {
  922. return (const char*) type->clientdata;
  923. }
  924. else {
  925. return type->name;
  926. }
  927. }
  928. SWIGRUNTIME swig_cast_info *
  929. SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
  930. SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0))
  931. || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
  932. }
  933. /* Function for getting a pointer value */
  934. SWIGRUNTIME int
  935. SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
  936. swig_cast_info *tc;
  937. void *voidptr = (void *)0;
  938. SV *tsv = 0;
  939. /* If magical, apply more magic */
  940. if (SvGMAGICAL(sv))
  941. mg_get(sv);
  942. /* Check to see if this is an object */
  943. if (sv_isobject(sv)) {
  944. IV tmp = 0;
  945. tsv = (SV*) SvRV(sv);
  946. if ((SvTYPE(tsv) == SVt_PVHV)) {
  947. MAGIC *mg;
  948. if (SvMAGICAL(tsv)) {
  949. mg = mg_find(tsv,'P');
  950. if (mg) {
  951. sv = mg->mg_obj;
  952. if (sv_isobject(sv)) {
  953. tsv = (SV*)SvRV(sv);
  954. tmp = SvIV(tsv);
  955. }
  956. }
  957. } else {
  958. return SWIG_ERROR;
  959. }
  960. } else {
  961. tmp = SvIV(tsv);
  962. }
  963. voidptr = INT2PTR(void *,tmp);
  964. } else if (! SvOK(sv)) { /* Check for undef */
  965. *(ptr) = (void *) 0;
  966. return SWIG_OK;
  967. } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
  968. if (!SvROK(sv)) {
  969. *(ptr) = (void *) 0;
  970. return SWIG_OK;
  971. } else {
  972. return SWIG_ERROR;
  973. }
  974. } else { /* Don't know what it is */
  975. return SWIG_ERROR;
  976. }
  977. if (_t) {
  978. /* Now see if the types match */
  979. char *_c = HvNAME(SvSTASH(SvRV(sv)));
  980. tc = SWIG_TypeProxyCheck(_c,_t);
  981. if (!tc) {
  982. return SWIG_ERROR;
  983. }
  984. {
  985. int newmemory = 0;
  986. *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
  987. assert(!newmemory); /* newmemory handling not yet implemented */
  988. }
  989. } else {
  990. *ptr = voidptr;
  991. }
  992. /*
  993. * DISOWN implementation: we need a perl guru to check this one.
  994. */
  995. if (tsv && (flags & SWIG_POINTER_DISOWN)) {
  996. /*
  997. * almost copy paste code from below SWIG_POINTER_OWN setting
  998. */
  999. SV *obj = sv;
  1000. HV *stash = SvSTASH(SvRV(obj));
  1001. GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
  1002. if (isGV(gv)) {
  1003. HV *hv = GvHVn(gv);
  1004. /*
  1005. * To set ownership (see below), a newSViv(1) entry is added.
  1006. * Hence, to remove ownership, we delete the entry.
  1007. */
  1008. if (hv_exists_ent(hv, obj, 0)) {
  1009. hv_delete_ent(hv, obj, 0, 0);
  1010. }
  1011. }
  1012. }
  1013. return SWIG_OK;
  1014. }
  1015. SWIGRUNTIME void
  1016. SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
  1017. if (ptr && (flags & SWIG_SHADOW)) {
  1018. SV *self;
  1019. SV *obj=newSV(0);
  1020. HV *hash=newHV();
  1021. HV *stash;
  1022. sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
  1023. stash=SvSTASH(SvRV(obj));
  1024. if (flags & SWIG_POINTER_OWN) {
  1025. HV *hv;
  1026. GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
  1027. if (!isGV(gv))
  1028. gv_init(gv, stash, "OWNER", 5, FALSE);
  1029. hv=GvHVn(gv);
  1030. hv_store_ent(hv, obj, newSViv(1), 0);
  1031. }
  1032. sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
  1033. SvREFCNT_dec(obj);
  1034. self=newRV_noinc((SV *)hash);
  1035. sv_setsv(sv, self);
  1036. SvREFCNT_dec((SV *)self);
  1037. sv_bless(sv, stash);
  1038. }
  1039. else {
  1040. sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
  1041. }
  1042. }
  1043. SWIGRUNTIMEINLINE SV *
  1044. SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
  1045. SV *result = sv_newmortal();
  1046. SWIG_MakePtr(result, ptr, t, flags);
  1047. return result;
  1048. }
  1049. SWIGRUNTIME void
  1050. SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
  1051. char result[1024];
  1052. char *r = result;
  1053. if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
  1054. *(r++) = '_';
  1055. r = SWIG_PackData(r,ptr,sz);
  1056. strcpy(r,SWIG_Perl_TypeProxyName(type));
  1057. sv_setpv(sv, result);
  1058. }
  1059. SWIGRUNTIME SV *
  1060. SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
  1061. SV *result = sv_newmortal();
  1062. SWIG_Perl_MakePackedObj(result, ptr, sz, type);
  1063. return result;
  1064. }
  1065. /* Convert a packed value value */
  1066. SWIGRUNTIME int
  1067. SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
  1068. swig_cast_info *tc;
  1069. const char *c = 0;
  1070. if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
  1071. c = SvPV_nolen(obj);
  1072. /* Pointer values must start with leading underscore */
  1073. if (*c != '_') return SWIG_ERROR;
  1074. c++;
  1075. c = SWIG_UnpackData(c,ptr,sz);
  1076. if (ty) {
  1077. tc = SWIG_TypeCheck(c,ty);
  1078. if (!tc) return SWIG_ERROR;
  1079. }
  1080. return SWIG_OK;
  1081. }
  1082. /* Macros for low-level exception handling */
  1083. #define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
  1084. typedef XSPROTO(SwigPerlWrapper);
  1085. typedef SwigPerlWrapper *SwigPerlWrapperPtr;
  1086. /* Structure for command table */
  1087. typedef struct {
  1088. const char *name;
  1089. SwigPerlWrapperPtr wrapper;
  1090. } swig_command_info;
  1091. /* Information for constant table */
  1092. #define SWIG_INT 1
  1093. #define SWIG_FLOAT 2
  1094. #define SWIG_STRING 3
  1095. #define SWIG_POINTER 4
  1096. #define SWIG_BINARY 5
  1097. /* Constant information structure */
  1098. typedef struct swig_constant_info {
  1099. int type;
  1100. const char *name;
  1101. long lvalue;
  1102. double dvalue;
  1103. void *pvalue;
  1104. swig_type_info **ptype;
  1105. } swig_constant_info;
  1106. /* Structure for variable table */
  1107. typedef struct {
  1108. const char *name;
  1109. SwigMagicFunc set;
  1110. SwigMagicFunc get;
  1111. swig_type_info **type;
  1112. } swig_variable_info;
  1113. /* Magic variable code */
  1114. #ifndef PERL_OBJECT
  1115. #define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
  1116. #ifndef MULTIPLICITY
  1117. SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
  1118. #else
  1119. SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
  1120. #endif
  1121. #else
  1122. # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
  1123. SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
  1124. #endif
  1125. {
  1126. MAGIC *mg;
  1127. sv_magic(sv,sv,'U',(char *) name,strlen(name));
  1128. mg = mg_find(sv,'U');
  1129. mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
  1130. mg->mg_virtual->svt_get = (SwigMagicFunc) get;
  1131. mg->mg_virtual->svt_set = (SwigMagicFunc) set;
  1132. mg->mg_virtual->svt_len = 0;
  1133. mg->mg_virtual->svt_clear = 0;
  1134. mg->mg_virtual->svt_free = 0;
  1135. }
  1136. SWIGRUNTIME swig_module_info *
  1137. SWIG_Perl_GetModule(void) {
  1138. static void *type_pointer = (void *)0;
  1139. SV *pointer;
  1140. /* first check if pointer already created */
  1141. if (!type_pointer) {
  1142. pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
  1143. if (pointer && SvOK(pointer)) {
  1144. type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
  1145. }
  1146. }
  1147. return (swig_module_info *) type_pointer;
  1148. }
  1149. SWIGRUNTIME void
  1150. SWIG_Perl_SetModule(swig_module_info *module) {
  1151. SV *pointer;
  1152. /* create a new pointer */
  1153. pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
  1154. sv_setiv(pointer, PTR2IV(module));
  1155. }
  1156. #ifdef __cplusplus
  1157. }
  1158. #endif
  1159. /* Workaround perl5 global namespace pollution. Note that undefining library
  1160. * functions like fopen will not solve the problem on all platforms as fopen
  1161. * might be a macro on Windows but not necessarily on other operating systems. */
  1162. #ifdef do_open
  1163. #undef do_open
  1164. #endif
  1165. #ifdef do_close
  1166. #undef do_close
  1167. #endif
  1168. #ifdef scalar
  1169. #undef scalar
  1170. #endif
  1171. #ifdef list
  1172. #undef list
  1173. #endif
  1174. #ifdef apply
  1175. #undef apply
  1176. #endif
  1177. #ifdef convert
  1178. #undef convert
  1179. #endif
  1180. #ifdef Error
  1181. #undef Error
  1182. #endif
  1183. #ifdef form
  1184. #undef form
  1185. #endif
  1186. #ifdef vform
  1187. #undef vform
  1188. #endif
  1189. #ifdef LABEL
  1190. #undef LABEL
  1191. #endif
  1192. #ifdef METHOD
  1193. #undef METHOD
  1194. #endif
  1195. #ifdef Move
  1196. #undef Move
  1197. #endif
  1198. #ifdef yylex
  1199. #undef yylex
  1200. #endif
  1201. #ifdef yyparse
  1202. #undef yyparse
  1203. #endif
  1204. #ifdef yyerror
  1205. #undef yyerror
  1206. #endif
  1207. #ifdef invert
  1208. #undef invert
  1209. #endif
  1210. #ifdef ref
  1211. #undef ref
  1212. #endif
  1213. #ifdef read
  1214. #undef read
  1215. #endif
  1216. #ifdef write
  1217. #undef write
  1218. #endif
  1219. #ifdef eof
  1220. #undef eof
  1221. #endif
  1222. #ifdef bool
  1223. #undef bool
  1224. #endif
  1225. #ifdef close
  1226. #undef close
  1227. #endif
  1228. #ifdef rewind
  1229. #undef rewind
  1230. #endif
  1231. #ifdef free
  1232. #undef free
  1233. #endif
  1234. #ifdef malloc
  1235. #undef malloc
  1236. #endif
  1237. #ifdef calloc
  1238. #undef calloc
  1239. #endif
  1240. #ifdef Stat
  1241. #undef Stat
  1242. #endif
  1243. #ifdef check
  1244. #undef check
  1245. #endif
  1246. #ifdef seekdir
  1247. #undef seekdir
  1248. #endif
  1249. #ifdef open
  1250. #undef open
  1251. #endif
  1252. #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
  1253. #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
  1254. /* -------- TYPES TABLE (BEGIN) -------- */
  1255. #define SWIGTYPE_p_SCGIhandle swig_types[0]
  1256. #define SWIGTYPE_p_char swig_types[1]
  1257. static swig_type_info *swig_types[3];
  1258. static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0};
  1259. #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
  1260. #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
  1261. /* -------- TYPES TABLE (END) -------- */
  1262. #define SWIG_init boot_FSSCGI
  1263. #define SWIG_name "FSSCGIc::boot_FSSCGI"
  1264. #define SWIG_prefix "FSSCGIc::"
  1265. #define SWIGVERSION 0x010335
  1266. #define SWIG_VERSION SWIGVERSION
  1267. #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
  1268. #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
  1269. #include <stdexcept>
  1270. #ifdef __cplusplus
  1271. extern "C"
  1272. #endif
  1273. #ifndef PERL_OBJECT
  1274. #ifndef MULTIPLICITY
  1275. SWIGEXPORT void SWIG_init (CV* cv);
  1276. #else
  1277. SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
  1278. #endif
  1279. #else
  1280. SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
  1281. #endif
  1282. #include "scgi.h"
  1283. #include "scgi_oop.h"
  1284. SWIGINTERNINLINE SV *
  1285. SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value)
  1286. {
  1287. SV *obj = sv_newmortal();
  1288. sv_setiv(obj, (IV) value);
  1289. return obj;
  1290. }
  1291. SWIGINTERNINLINE SV *
  1292. SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value)
  1293. {
  1294. return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value);
  1295. }
  1296. SWIGINTERN swig_type_info*
  1297. SWIG_pchar_descriptor(void)
  1298. {
  1299. static int init = 0;
  1300. static swig_type_info* info = 0;
  1301. if (!init) {
  1302. info = SWIG_TypeQuery("_p_char");
  1303. init = 1;
  1304. }
  1305. return info;
  1306. }
  1307. SWIGINTERN int
  1308. SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
  1309. {
  1310. if (SvPOK(obj)) {
  1311. STRLEN len = 0;
  1312. char *cstr = SvPV(obj, len);
  1313. size_t size = len + 1;
  1314. if (cptr) {
  1315. if (alloc) {
  1316. if (*alloc == SWIG_NEWOBJ) {
  1317. *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
  1318. } else {
  1319. *cptr = cstr;
  1320. *alloc = SWIG_OLDOBJ;
  1321. }
  1322. }
  1323. }
  1324. if (psize) *psize = size;
  1325. return SWIG_OK;
  1326. } else {
  1327. swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
  1328. if (pchar_descriptor) {
  1329. char* vptr = 0;
  1330. if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
  1331. if (cptr) *cptr = vptr;
  1332. if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
  1333. if (alloc) *alloc = SWIG_OLDOBJ;
  1334. return SWIG_OK;
  1335. }
  1336. }
  1337. }
  1338. return SWIG_TypeError;
  1339. }
  1340. SWIGINTERNINLINE SV *
  1341. SWIG_FromCharPtrAndSize(const char* carray, size_t size)
  1342. {
  1343. SV *obj = sv_newmortal();
  1344. if (carray) {
  1345. sv_setpvn(obj, carray, size);
  1346. } else {
  1347. sv_setsv(obj, &PL_sv_undef);
  1348. }
  1349. return obj;
  1350. }
  1351. SWIGINTERNINLINE SV *
  1352. SWIG_FromCharPtr(const char *cptr)
  1353. {
  1354. return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
  1355. }
  1356. #include <limits.h>
  1357. #if !defined(SWIG_NO_LLONG_MAX)
  1358. # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
  1359. # define LLONG_MAX __LONG_LONG_MAX__
  1360. # define LLONG_MIN (-LLONG_MAX - 1LL)
  1361. # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
  1362. # endif
  1363. #endif
  1364. SWIGINTERN int
  1365. SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
  1366. {
  1367. if (SvNIOK(obj)) {
  1368. if (val) *val = SvNV(obj);
  1369. return SWIG_OK;
  1370. } else if (SvIOK(obj)) {
  1371. if (val) *val = (double) SvIV(obj);
  1372. return SWIG_AddCast(SWIG_OK);
  1373. } else {
  1374. const char *nptr = SvPV_nolen(obj);
  1375. if (nptr) {
  1376. char *endptr;
  1377. double v = strtod(nptr, &endptr);
  1378. if (errno == ERANGE) {
  1379. errno = 0;
  1380. return SWIG_OverflowError;
  1381. } else {
  1382. if (*endptr == '\0') {
  1383. if (val) *val = v;
  1384. return SWIG_Str2NumCast(SWIG_OK);
  1385. }
  1386. }
  1387. }
  1388. }
  1389. return SWIG_TypeError;
  1390. }
  1391. #include <float.h>
  1392. #include <math.h>
  1393. SWIGINTERNINLINE int
  1394. SWIG_CanCastAsInteger(double *d, double min, double max) {
  1395. double x = *d;
  1396. if ((min <= x && x <= max)) {
  1397. double fx = floor(x);
  1398. double cx = ceil(x);
  1399. double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
  1400. if ((errno == EDOM) || (errno == ERANGE)) {
  1401. errno = 0;
  1402. } else {
  1403. double summ, reps, diff;
  1404. if (rd < x) {
  1405. diff = x - rd;
  1406. } else if (rd > x) {
  1407. diff = rd - x;
  1408. } else {
  1409. return 1;
  1410. }
  1411. summ = rd + x;
  1412. reps = diff/summ;
  1413. if (reps < 8*DBL_EPSILON) {
  1414. *d = rd;
  1415. return 1;
  1416. }
  1417. }
  1418. }
  1419. return 0;
  1420. }
  1421. SWIGINTERN int
  1422. SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
  1423. {
  1424. if (SvIOK(obj)) {
  1425. if (val) *val = SvIV(obj);
  1426. return SWIG_OK;
  1427. } else {
  1428. int dispatch = 0;
  1429. const char *nptr = SvPV_nolen(obj);
  1430. if (nptr) {
  1431. char *endptr;
  1432. long v;
  1433. errno = 0;
  1434. v = strtol(nptr, &endptr,0);
  1435. if (errno == ERANGE) {
  1436. errno = 0;
  1437. return SWIG_OverflowError;
  1438. } else {
  1439. if (*endptr == '\0') {
  1440. if (val) *val = v;
  1441. return SWIG_Str2NumCast(SWIG_OK);
  1442. }
  1443. }
  1444. }
  1445. if (!dispatch) {
  1446. double d;
  1447. int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
  1448. if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
  1449. if (val) *val = (long)(d);
  1450. return res;
  1451. }
  1452. }
  1453. }
  1454. return SWIG_TypeError;
  1455. }
  1456. SWIGINTERN int
  1457. SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
  1458. {
  1459. long v;
  1460. int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
  1461. if (SWIG_IsOK(res)) {
  1462. if ((v < INT_MIN || v > INT_MAX)) {
  1463. return SWIG_OverflowError;
  1464. } else {
  1465. if (val) *val = static_cast< int >(v);
  1466. }
  1467. }
  1468. return res;
  1469. }
  1470. #ifdef __cplusplus
  1471. extern "C" {
  1472. #endif
  1473. #ifdef PERL_OBJECT
  1474. #define MAGIC_CLASS _wrap_FSSCGI_var::
  1475. class _wrap_FSSCGI_var : public CPerlObj {
  1476. public:
  1477. #else
  1478. #define MAGIC_CLASS
  1479. #endif
  1480. SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
  1481. MAGIC_PPERL
  1482. croak("Value is read-only.");
  1483. return 0;
  1484. }
  1485. #ifdef PERL_OBJECT
  1486. };
  1487. #endif
  1488. #ifdef __cplusplus
  1489. }
  1490. #endif
  1491. #ifdef __cplusplus
  1492. extern "C" {
  1493. #endif
  1494. XS(_wrap_new_SCGIhandle) {
  1495. {
  1496. SCGIhandle *result = 0 ;
  1497. int argvi = 0;
  1498. dXSARGS;
  1499. if ((items < 0) || (items > 0)) {
  1500. SWIG_croak("Usage: new_SCGIhandle();");
  1501. }
  1502. result = (SCGIhandle *)new SCGIhandle();
  1503. ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SCGIhandle, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
  1504. XSRETURN(argvi);
  1505. fail:
  1506. SWIG_croak_null();
  1507. }
  1508. }
  1509. XS(_wrap_delete_SCGIhandle) {
  1510. {
  1511. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1512. void *argp1 = 0 ;
  1513. int res1 = 0 ;
  1514. int argvi = 0;
  1515. dXSARGS;
  1516. if ((items < 1) || (items > 1)) {
  1517. SWIG_croak("Usage: delete_SCGIhandle(self);");
  1518. }
  1519. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, SWIG_POINTER_DISOWN | 0 );
  1520. if (!SWIG_IsOK(res1)) {
  1521. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SCGIhandle" "', argument " "1"" of type '" "SCGIhandle *""'");
  1522. }
  1523. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1524. delete arg1;
  1525. XSRETURN(argvi);
  1526. fail:
  1527. SWIG_croak_null();
  1528. }
  1529. }
  1530. XS(_wrap_SCGIhandle_connected) {
  1531. {
  1532. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1533. int result;
  1534. void *argp1 = 0 ;
  1535. int res1 = 0 ;
  1536. int argvi = 0;
  1537. dXSARGS;
  1538. if ((items < 1) || (items > 1)) {
  1539. SWIG_croak("Usage: SCGIhandle_connected(self);");
  1540. }
  1541. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1542. if (!SWIG_IsOK(res1)) {
  1543. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_connected" "', argument " "1"" of type '" "SCGIhandle *""'");
  1544. }
  1545. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1546. result = (int)(arg1)->connected();
  1547. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1548. XSRETURN(argvi);
  1549. fail:
  1550. SWIG_croak_null();
  1551. }
  1552. }
  1553. XS(_wrap_SCGIhandle_socketDescriptor) {
  1554. {
  1555. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1556. int result;
  1557. void *argp1 = 0 ;
  1558. int res1 = 0 ;
  1559. int argvi = 0;
  1560. dXSARGS;
  1561. if ((items < 1) || (items > 1)) {
  1562. SWIG_croak("Usage: SCGIhandle_socketDescriptor(self);");
  1563. }
  1564. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1565. if (!SWIG_IsOK(res1)) {
  1566. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_socketDescriptor" "', argument " "1"" of type '" "SCGIhandle *""'");
  1567. }
  1568. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1569. result = (int)(arg1)->socketDescriptor();
  1570. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1571. XSRETURN(argvi);
  1572. fail:
  1573. SWIG_croak_null();
  1574. }
  1575. }
  1576. XS(_wrap_SCGIhandle_disconnect) {
  1577. {
  1578. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1579. int result;
  1580. void *argp1 = 0 ;
  1581. int res1 = 0 ;
  1582. int argvi = 0;
  1583. dXSARGS;
  1584. if ((items < 1) || (items > 1)) {
  1585. SWIG_croak("Usage: SCGIhandle_disconnect(self);");
  1586. }
  1587. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1588. if (!SWIG_IsOK(res1)) {
  1589. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_disconnect" "', argument " "1"" of type '" "SCGIhandle *""'");
  1590. }
  1591. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1592. result = (int)(arg1)->disconnect();
  1593. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1594. XSRETURN(argvi);
  1595. fail:
  1596. SWIG_croak_null();
  1597. }
  1598. }
  1599. XS(_wrap_SCGIhandle_addParam) {
  1600. {
  1601. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1602. char *arg2 = (char *) 0 ;
  1603. char *arg3 = (char *) 0 ;
  1604. int result;
  1605. void *argp1 = 0 ;
  1606. int res1 = 0 ;
  1607. int res2 ;
  1608. char *buf2 = 0 ;
  1609. int alloc2 = 0 ;
  1610. int res3 ;
  1611. char *buf3 = 0 ;
  1612. int alloc3 = 0 ;
  1613. int argvi = 0;
  1614. dXSARGS;
  1615. if ((items < 3) || (items > 3)) {
  1616. SWIG_croak("Usage: SCGIhandle_addParam(self,name,value);");
  1617. }
  1618. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1619. if (!SWIG_IsOK(res1)) {
  1620. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_addParam" "', argument " "1"" of type '" "SCGIhandle *""'");
  1621. }
  1622. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1623. res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
  1624. if (!SWIG_IsOK(res2)) {
  1625. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_addParam" "', argument " "2"" of type '" "char const *""'");
  1626. }
  1627. arg2 = reinterpret_cast< char * >(buf2);
  1628. res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
  1629. if (!SWIG_IsOK(res3)) {
  1630. SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SCGIhandle_addParam" "', argument " "3"" of type '" "char const *""'");
  1631. }
  1632. arg3 = reinterpret_cast< char * >(buf3);
  1633. result = (int)(arg1)->addParam((char const *)arg2,(char const *)arg3);
  1634. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1635. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1636. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  1637. XSRETURN(argvi);
  1638. fail:
  1639. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1640. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  1641. SWIG_croak_null();
  1642. }
  1643. }
  1644. XS(_wrap_SCGIhandle_addBody) {
  1645. {
  1646. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1647. char *arg2 = (char *) 0 ;
  1648. int result;
  1649. void *argp1 = 0 ;
  1650. int res1 = 0 ;
  1651. int res2 ;
  1652. char *buf2 = 0 ;
  1653. int alloc2 = 0 ;
  1654. int argvi = 0;
  1655. dXSARGS;
  1656. if ((items < 2) || (items > 2)) {
  1657. SWIG_croak("Usage: SCGIhandle_addBody(self,value);");
  1658. }
  1659. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1660. if (!SWIG_IsOK(res1)) {
  1661. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_addBody" "', argument " "1"" of type '" "SCGIhandle *""'");
  1662. }
  1663. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1664. res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
  1665. if (!SWIG_IsOK(res2)) {
  1666. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_addBody" "', argument " "2"" of type '" "char const *""'");
  1667. }
  1668. arg2 = reinterpret_cast< char * >(buf2);
  1669. result = (int)(arg1)->addBody((char const *)arg2);
  1670. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1671. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1672. XSRETURN(argvi);
  1673. fail:
  1674. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1675. SWIG_croak_null();
  1676. }
  1677. }
  1678. XS(_wrap_SCGIhandle_getBody) {
  1679. {
  1680. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1681. char *result = 0 ;
  1682. void *argp1 = 0 ;
  1683. int res1 = 0 ;
  1684. int argvi = 0;
  1685. dXSARGS;
  1686. if ((items < 1) || (items > 1)) {
  1687. SWIG_croak("Usage: SCGIhandle_getBody(self);");
  1688. }
  1689. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1690. if (!SWIG_IsOK(res1)) {
  1691. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_getBody" "', argument " "1"" of type '" "SCGIhandle *""'");
  1692. }
  1693. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1694. result = (char *)(arg1)->getBody();
  1695. ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
  1696. XSRETURN(argvi);
  1697. fail:
  1698. SWIG_croak_null();
  1699. }
  1700. }
  1701. XS(_wrap_SCGIhandle_getParam) {
  1702. {
  1703. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1704. char *arg2 = (char *) 0 ;
  1705. char *result = 0 ;
  1706. void *argp1 = 0 ;
  1707. int res1 = 0 ;
  1708. int res2 ;
  1709. char *buf2 = 0 ;
  1710. int alloc2 = 0 ;
  1711. int argvi = 0;
  1712. dXSARGS;
  1713. if ((items < 2) || (items > 2)) {
  1714. SWIG_croak("Usage: SCGIhandle_getParam(self,name);");
  1715. }
  1716. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1717. if (!SWIG_IsOK(res1)) {
  1718. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_getParam" "', argument " "1"" of type '" "SCGIhandle *""'");
  1719. }
  1720. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1721. res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
  1722. if (!SWIG_IsOK(res2)) {
  1723. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_getParam" "', argument " "2"" of type '" "char const *""'");
  1724. }
  1725. arg2 = reinterpret_cast< char * >(buf2);
  1726. result = (char *)(arg1)->getParam((char const *)arg2);
  1727. ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
  1728. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1729. XSRETURN(argvi);
  1730. fail:
  1731. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1732. SWIG_croak_null();
  1733. }
  1734. }
  1735. XS(_wrap_SCGIhandle_sendRequest) {
  1736. {
  1737. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1738. char *arg2 = (char *) 0 ;
  1739. int arg3 ;
  1740. int arg4 ;
  1741. char *result = 0 ;
  1742. void *argp1 = 0 ;
  1743. int res1 = 0 ;
  1744. int res2 ;
  1745. char *buf2 = 0 ;
  1746. int alloc2 = 0 ;
  1747. int val3 ;
  1748. int ecode3 = 0 ;
  1749. int val4 ;
  1750. int ecode4 = 0 ;
  1751. int argvi = 0;
  1752. dXSARGS;
  1753. if ((items < 4) || (items > 4)) {
  1754. SWIG_croak("Usage: SCGIhandle_sendRequest(self,host,port,timeout);");
  1755. }
  1756. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1757. if (!SWIG_IsOK(res1)) {
  1758. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_sendRequest" "', argument " "1"" of type '" "SCGIhandle *""'");
  1759. }
  1760. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1761. res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
  1762. if (!SWIG_IsOK(res2)) {
  1763. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_sendRequest" "', argument " "2"" of type '" "char const *""'");
  1764. }
  1765. arg2 = reinterpret_cast< char * >(buf2);
  1766. ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
  1767. if (!SWIG_IsOK(ecode3)) {
  1768. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SCGIhandle_sendRequest" "', argument " "3"" of type '" "int""'");
  1769. }
  1770. arg3 = static_cast< int >(val3);
  1771. ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
  1772. if (!SWIG_IsOK(ecode4)) {
  1773. SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "SCGIhandle_sendRequest" "', argument " "4"" of type '" "int""'");
  1774. }
  1775. arg4 = static_cast< int >(val4);
  1776. result = (char *)(arg1)->sendRequest((char const *)arg2,arg3,arg4);
  1777. ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
  1778. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1779. XSRETURN(argvi);
  1780. fail:
  1781. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1782. SWIG_croak_null();
  1783. }
  1784. }
  1785. XS(_wrap_SCGIhandle_respond) {
  1786. {
  1787. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1788. char *arg2 = (char *) 0 ;
  1789. int result;
  1790. void *argp1 = 0 ;
  1791. int res1 = 0 ;
  1792. int res2 ;
  1793. char *buf2 = 0 ;
  1794. int alloc2 = 0 ;
  1795. int argvi = 0;
  1796. dXSARGS;
  1797. if ((items < 2) || (items > 2)) {
  1798. SWIG_croak("Usage: SCGIhandle_respond(self,msg);");
  1799. }
  1800. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1801. if (!SWIG_IsOK(res1)) {
  1802. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_respond" "', argument " "1"" of type '" "SCGIhandle *""'");
  1803. }
  1804. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1805. res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
  1806. if (!SWIG_IsOK(res2)) {
  1807. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_respond" "', argument " "2"" of type '" "char *""'");
  1808. }
  1809. arg2 = reinterpret_cast< char * >(buf2);
  1810. result = (int)(arg1)->respond(arg2);
  1811. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1812. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1813. XSRETURN(argvi);
  1814. fail:
  1815. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1816. SWIG_croak_null();
  1817. }
  1818. }
  1819. XS(_wrap_SCGIhandle_bind) {
  1820. {
  1821. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1822. char *arg2 = (char *) 0 ;
  1823. int arg3 ;
  1824. int result;
  1825. void *argp1 = 0 ;
  1826. int res1 = 0 ;
  1827. int res2 ;
  1828. char *buf2 = 0 ;
  1829. int alloc2 = 0 ;
  1830. int val3 ;
  1831. int ecode3 = 0 ;
  1832. int argvi = 0;
  1833. dXSARGS;
  1834. if ((items < 3) || (items > 3)) {
  1835. SWIG_croak("Usage: SCGIhandle_bind(self,host,port);");
  1836. }
  1837. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1838. if (!SWIG_IsOK(res1)) {
  1839. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_bind" "', argument " "1"" of type '" "SCGIhandle *""'");
  1840. }
  1841. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1842. res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
  1843. if (!SWIG_IsOK(res2)) {
  1844. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SCGIhandle_bind" "', argument " "2"" of type '" "char const *""'");
  1845. }
  1846. arg2 = reinterpret_cast< char * >(buf2);
  1847. ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
  1848. if (!SWIG_IsOK(ecode3)) {
  1849. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SCGIhandle_bind" "', argument " "3"" of type '" "int""'");
  1850. }
  1851. arg3 = static_cast< int >(val3);
  1852. result = (int)(arg1)->bind((char const *)arg2,arg3);
  1853. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1854. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1855. XSRETURN(argvi);
  1856. fail:
  1857. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1858. SWIG_croak_null();
  1859. }
  1860. }
  1861. XS(_wrap_SCGIhandle_accept) {
  1862. {
  1863. SCGIhandle *arg1 = (SCGIhandle *) 0 ;
  1864. int result;
  1865. void *argp1 = 0 ;
  1866. int res1 = 0 ;
  1867. int argvi = 0;
  1868. dXSARGS;
  1869. if ((items < 1) || (items > 1)) {
  1870. SWIG_croak("Usage: SCGIhandle_accept(self);");
  1871. }
  1872. res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_SCGIhandle, 0 | 0 );
  1873. if (!SWIG_IsOK(res1)) {
  1874. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SCGIhandle_accept" "', argument " "1"" of type '" "SCGIhandle *""'");
  1875. }
  1876. arg1 = reinterpret_cast< SCGIhandle * >(argp1);
  1877. result = (int)(arg1)->accept();
  1878. ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
  1879. XSRETURN(argvi);
  1880. fail:
  1881. SWIG_croak_null();
  1882. }
  1883. }
  1884. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
  1885. static swig_type_info _swigt__p_SCGIhandle = {"_p_SCGIhandle", "SCGIhandle *", 0, 0, (void*)"FSSCGI::SCGIhandle", 0};
  1886. static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
  1887. static swig_type_info *swig_type_initial[] = {
  1888. &_swigt__p_SCGIhandle,
  1889. &_swigt__p_char,
  1890. };
  1891. static swig_cast_info _swigc__p_SCGIhandle[] = { {&_swigt__p_SCGIhandle, 0, 0, 0},{0, 0, 0, 0}};
  1892. static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
  1893. static swig_cast_info *swig_cast_initial[] = {
  1894. _swigc__p_SCGIhandle,
  1895. _swigc__p_char,
  1896. };
  1897. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
  1898. static swig_constant_info swig_constants[] = {
  1899. {0,0,0,0,0,0}
  1900. };
  1901. #ifdef __cplusplus
  1902. }
  1903. #endif
  1904. static swig_variable_info swig_variables[] = {
  1905. {0,0,0,0}
  1906. };
  1907. static swig_command_info swig_commands[] = {
  1908. {"FSSCGIc::new_SCGIhandle", _wrap_new_SCGIhandle},
  1909. {"FSSCGIc::delete_SCGIhandle", _wrap_delete_SCGIhandle},
  1910. {"FSSCGIc::SCGIhandle_connected", _wrap_SCGIhandle_connected},
  1911. {"FSSCGIc::SCGIhandle_socketDescriptor", _wrap_SCGIhandle_socketDescriptor},
  1912. {"FSSCGIc::SCGIhandle_disconnect", _wrap_SCGIhandle_disconnect},
  1913. {"FSSCGIc::SCGIhandle_addParam", _wrap_SCGIhandle_addParam},
  1914. {"FSSCGIc::SCGIhandle_addBody", _wrap_SCGIhandle_addBody},
  1915. {"FSSCGIc::SCGIhandle_getBody", _wrap_SCGIhandle_getBody},
  1916. {"FSSCGIc::SCGIhandle_getParam", _wrap_SCGIhandle_getParam},
  1917. {"FSSCGIc::SCGIhandle_sendRequest", _wrap_SCGIhandle_sendRequest},
  1918. {"FSSCGIc::SCGIhandle_respond", _wrap_SCGIhandle_respond},
  1919. {"FSSCGIc::SCGIhandle_bind", _wrap_SCGIhandle_bind},
  1920. {"FSSCGIc::SCGIhandle_accept", _wrap_SCGIhandle_accept},
  1921. {0,0}
  1922. };
  1923. /* -----------------------------------------------------------------------------
  1924. * Type initialization:
  1925. * This problem is tough by the requirement that no dynamic
  1926. * memory is used. Also, since swig_type_info structures store pointers to
  1927. * swig_cast_info structures and swig_cast_info structures store pointers back
  1928. * to swig_type_info structures, we need some lookup code at initialization.
  1929. * The idea is that swig generates all the structures that are needed.
  1930. * The runtime then collects these partially filled structures.
  1931. * The SWIG_InitializeModule function takes these initial arrays out of
  1932. * swig_module, and does all the lookup, filling in the swig_module.types
  1933. * array with the correct data and linking the correct swig_cast_info
  1934. * structures together.
  1935. *
  1936. * The generated swig_type_info structures are assigned staticly to an initial
  1937. * array. We just loop through that array, and handle each type individually.
  1938. * First we lookup if this type has been already loaded, and if so, use the
  1939. * loaded structure instead of the generated one. Then we have to fill in the
  1940. * cast linked list. The cast data is initially stored in something like a
  1941. * two-dimensional array. Each row corresponds to a type (there are the same
  1942. * number of rows as there are in the swig_type_initial array). Each entry in
  1943. * a column is one of the swig_cast_info structures for that type.
  1944. * The cast_initial array is actually an array of arrays, because each row has
  1945. * a variable number of columns. So to actually build the cast linked list,
  1946. * we find the array of casts associated with the type, and loop through it
  1947. * adding the casts to the list. The one last trick we need to do is making
  1948. * sure the type pointer in the swig_cast_info struct is correct.
  1949. *
  1950. * First off, we lookup the cast->type name to see if it is already loaded.
  1951. * There are three cases to handle:
  1952. * 1) If the cast->type has already been loaded AND the type we are adding
  1953. * casting info to has not been loaded (it is in this module), THEN we
  1954. * replace the cast->type pointer with the type pointer that has already
  1955. * been loaded.
  1956. * 2) If BOTH types (the one we are adding casting info to, and the
  1957. * cast->type) are loaded, THEN the cast info has already been loaded by
  1958. * the previous module so we just ignore it.
  1959. * 3) Finally, if cast->type has not already been loaded, then we add that
  1960. * swig_cast_info to the linked list (because the cast->type) pointer will
  1961. * be correct.
  1962. * ----------------------------------------------------------------------------- */
  1963. #ifdef __cplusplus
  1964. extern "C" {
  1965. #if 0
  1966. } /* c-mode */
  1967. #endif
  1968. #endif
  1969. #if 0
  1970. #define SWIGRUNTIME_DEBUG
  1971. #endif
  1972. SWIGRUNTIME void
  1973. SWIG_InitializeModule(void *clientdata) {
  1974. size_t i;
  1975. swig_module_info *module_head, *iter;
  1976. int found, init;
  1977. clientdata = clientdata;
  1978. /* check to see if the circular list has been setup, if not, set it up */
  1979. if (swig_module.next==0) {
  1980. /* Initialize the swig_module */
  1981. swig_module.type_initial = swig_type_initial;
  1982. swig_module.cast_initial = swig_cast_initial;
  1983. swig_module.next = &swig_module;
  1984. init = 1;
  1985. } else {
  1986. init = 0;
  1987. }
  1988. /* Try and load any already created modules */
  1989. module_head = SWIG_GetModule(clientdata);
  1990. if (!module_head) {
  1991. /* This is the first module loaded for this interpreter */
  1992. /* so set the swig module into the interpreter */
  1993. SWIG_SetModule(clientdata, &swig_module);
  1994. module_head = &swig_module;
  1995. } else {
  1996. /* the interpreter has loaded a SWIG module, but has it loaded this one? */
  1997. found=0;
  1998. iter=module_head;
  1999. do {
  2000. if (iter==&swig_module) {
  2001. found=1;
  2002. break;
  2003. }
  2004. iter=iter->next;
  2005. } while (iter!= module_head);
  2006. /* if the is found in the list, then all is done and we may leave */
  2007. if (found) return;
  2008. /* otherwise we must add out module into the list */
  2009. swig_module.next = module_head->next;
  2010. module_head->next = &swig_module;
  2011. }
  2012. /* When multiple interpeters are used, a module could have already been initialized in
  2013. a different interpreter, but not yet have a pointer in this interpreter.
  2014. In this case, we do not want to continue adding types... everything should be
  2015. set up already */
  2016. if (init == 0) return;
  2017. /* Now work on filling in swig_module.types */
  2018. #ifdef SWIGRUNTIME_DEBUG
  2019. printf("SWIG_InitializeModule: size %d\n", swig_module.size);
  2020. #endif
  2021. for (i = 0; i < swig_module.size; ++i) {
  2022. swig_type_info *type = 0;
  2023. swig_type_info *ret;
  2024. swig_cast_info *cast;
  2025. #ifdef SWIGRUNTIME_DEBUG
  2026. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  2027. #endif
  2028. /* if there is another module already loaded */
  2029. if (swig_module.next != &swig_module) {
  2030. type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
  2031. }
  2032. if (type) {
  2033. /* Overwrite clientdata field */
  2034. #ifdef SWIGRUNTIME_DEBUG
  2035. printf("SWIG_InitializeModule: found type %s\n", type->name);
  2036. #endif
  2037. if (swig_module.type_initial[i]->clientdata) {
  2038. type->clientdata = swig_module.type_initial[i]->clientdata;
  2039. #ifdef SWIGRUNTIME_DEBUG
  2040. printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
  2041. #endif
  2042. }
  2043. } else {
  2044. type = swig_module.type_initial[i];
  2045. }
  2046. /* Insert casting types */
  2047. cast = swig_module.cast_initial[i];
  2048. while (cast->type) {
  2049. /* Don't need to add information already in the list */
  2050. ret = 0;
  2051. #ifdef SWIGRUNTIME_DEBUG
  2052. printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
  2053. #endif
  2054. if (swig_module.next != &swig_module) {
  2055. ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
  2056. #ifdef SWIGRUNTIME_DEBUG
  2057. if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
  2058. #endif
  2059. }
  2060. if (ret) {
  2061. if (type == swig_module.type_initial[i]) {
  2062. #ifdef SWIGRUNTIME_DEBUG
  2063. printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
  2064. #endif
  2065. cast->type = ret;
  2066. ret = 0;
  2067. } else {
  2068. /* Check for casting already in the list */
  2069. swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
  2070. #ifdef SWIGRUNTIME_DEBUG
  2071. if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
  2072. #endif
  2073. if (!ocast) ret = 0;
  2074. }
  2075. }
  2076. if (!ret) {
  2077. #ifdef SWIGRUNTIME_DEBUG
  2078. printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
  2079. #endif
  2080. if (type->cast) {
  2081. type->cast->prev = cast;
  2082. cast->next = type->cast;
  2083. }
  2084. type->cast = cast;
  2085. }
  2086. cast++;
  2087. }
  2088. /* Set entry in modules->types array equal to the type */
  2089. swig_module.types[i] = type;
  2090. }
  2091. swig_module.types[i] = 0;
  2092. #ifdef SWIGRUNTIME_DEBUG
  2093. printf("**** SWIG_InitializeModule: Cast List ******\n");
  2094. for (i = 0; i < swig_module.size; ++i) {
  2095. int j = 0;
  2096. swig_cast_info *cast = swig_module.cast_initial[i];
  2097. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  2098. while (cast->type) {
  2099. printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
  2100. cast++;
  2101. ++j;
  2102. }
  2103. printf("---- Total casts: %d\n",j);
  2104. }
  2105. printf("**** SWIG_InitializeModule: Cast List ******\n");
  2106. #endif
  2107. }
  2108. /* This function will propagate the clientdata field of type to
  2109. * any new swig_type_info structures that have been added into the list
  2110. * of equivalent types. It is like calling
  2111. * SWIG_TypeClientData(type, clientdata) a second time.
  2112. */
  2113. SWIGRUNTIME void
  2114. SWIG_PropagateClientData(void) {
  2115. size_t i;
  2116. swig_cast_info *equiv;
  2117. static int init_run = 0;
  2118. if (init_run) return;
  2119. init_run = 1;
  2120. for (i = 0; i < swig_module.size; i++) {
  2121. if (swig_module.types[i]->clientdata) {
  2122. equiv = swig_module.types[i]->cast;
  2123. while (equiv) {
  2124. if (!equiv->converter) {
  2125. if (equiv->type && !equiv->type->clientdata)
  2126. SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
  2127. }
  2128. equiv = equiv->next;
  2129. }
  2130. }
  2131. }
  2132. }
  2133. #ifdef __cplusplus
  2134. #if 0
  2135. {
  2136. /* c-mode */
  2137. #endif
  2138. }
  2139. #endif
  2140. #ifdef __cplusplus
  2141. extern "C"
  2142. #endif
  2143. XS(SWIG_init) {
  2144. dXSARGS;
  2145. int i;
  2146. SWIG_InitializeModule(0);
  2147. /* Install commands */
  2148. for (i = 0; swig_commands[i].name; i++) {
  2149. newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
  2150. }
  2151. /* Install variables */
  2152. for (i = 0; swig_variables[i].name; i++) {
  2153. SV *sv;
  2154. sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
  2155. if (swig_variables[i].type) {
  2156. SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
  2157. } else {
  2158. sv_setiv(sv,(IV) 0);
  2159. }
  2160. swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
  2161. }
  2162. /* Install constant */
  2163. for (i = 0; swig_constants[i].type; i++) {
  2164. SV *sv;
  2165. sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
  2166. switch(swig_constants[i].type) {
  2167. case SWIG_INT:
  2168. sv_setiv(sv, (IV) swig_constants[i].lvalue);
  2169. break;
  2170. case SWIG_FLOAT:
  2171. sv_setnv(sv, (double) swig_constants[i].dvalue);
  2172. break;
  2173. case SWIG_STRING:
  2174. sv_setpv(sv, (char *) swig_constants[i].pvalue);
  2175. break;
  2176. case SWIG_POINTER:
  2177. SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
  2178. break;
  2179. case SWIG_BINARY:
  2180. SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
  2181. break;
  2182. default:
  2183. break;
  2184. }
  2185. SvREADONLY_on(sv);
  2186. }
  2187. SWIG_TypeClientData(SWIGTYPE_p_SCGIhandle, (void*) "FSSCGI::SCGIhandle");
  2188. ST(0) = &PL_sv_yes;
  2189. XSRETURN(1);
  2190. }