2
0

esl_wrap.cpp 128 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 3.0.2
  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 SWIGRUBY
  11. #ifdef __cplusplus
  12. /* SwigValueWrapper is described in swig.swg */
  13. template<typename T> class SwigValueWrapper {
  14. struct SwigMovePointer {
  15. T *ptr;
  16. SwigMovePointer(T *p) : ptr(p) { }
  17. ~SwigMovePointer() { delete ptr; }
  18. SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  19. } pointer;
  20. SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  21. SwigValueWrapper(const SwigValueWrapper<T>& rhs);
  22. public:
  23. SwigValueWrapper() : pointer(0) { }
  24. SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  25. operator T&() const { return *pointer.ptr; }
  26. T *operator&() { return pointer.ptr; }
  27. };
  28. template <typename T> T SwigValueInit() {
  29. return T();
  30. }
  31. #endif
  32. /* -----------------------------------------------------------------------------
  33. * This section contains generic SWIG labels for method/variable
  34. * declarations/attributes, and other compiler dependent labels.
  35. * ----------------------------------------------------------------------------- */
  36. /* template workaround for compilers that cannot correctly implement the C++ standard */
  37. #ifndef SWIGTEMPLATEDISAMBIGUATOR
  38. # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  39. # define SWIGTEMPLATEDISAMBIGUATOR template
  40. # elif defined(__HP_aCC)
  41. /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  42. /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  43. # define SWIGTEMPLATEDISAMBIGUATOR template
  44. # else
  45. # define SWIGTEMPLATEDISAMBIGUATOR
  46. # endif
  47. #endif
  48. /* inline attribute */
  49. #ifndef SWIGINLINE
  50. # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  51. # define SWIGINLINE inline
  52. # else
  53. # define SWIGINLINE
  54. # endif
  55. #endif
  56. /* attribute recognised by some compilers to avoid 'unused' warnings */
  57. #ifndef SWIGUNUSED
  58. # if defined(__GNUC__)
  59. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  60. # define SWIGUNUSED __attribute__ ((__unused__))
  61. # else
  62. # define SWIGUNUSED
  63. # endif
  64. # elif defined(__ICC)
  65. # define SWIGUNUSED __attribute__ ((__unused__))
  66. # else
  67. # define SWIGUNUSED
  68. # endif
  69. #endif
  70. #ifndef SWIG_MSC_UNSUPPRESS_4505
  71. # if defined(_MSC_VER)
  72. # pragma warning(disable : 4505) /* unreferenced local function has been removed */
  73. # endif
  74. #endif
  75. #ifndef SWIGUNUSEDPARM
  76. # ifdef __cplusplus
  77. # define SWIGUNUSEDPARM(p)
  78. # else
  79. # define SWIGUNUSEDPARM(p) p SWIGUNUSED
  80. # endif
  81. #endif
  82. /* internal SWIG method */
  83. #ifndef SWIGINTERN
  84. # define SWIGINTERN static SWIGUNUSED
  85. #endif
  86. /* internal inline SWIG method */
  87. #ifndef SWIGINTERNINLINE
  88. # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  89. #endif
  90. /* exporting methods */
  91. #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  92. # ifndef GCC_HASCLASSVISIBILITY
  93. # define GCC_HASCLASSVISIBILITY
  94. # endif
  95. #endif
  96. #ifndef SWIGEXPORT
  97. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  98. # if defined(STATIC_LINKED)
  99. # define SWIGEXPORT
  100. # else
  101. # define SWIGEXPORT __declspec(dllexport)
  102. # endif
  103. # else
  104. # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  105. # define SWIGEXPORT __attribute__ ((visibility("default")))
  106. # else
  107. # define SWIGEXPORT
  108. # endif
  109. # endif
  110. #endif
  111. /* calling conventions for Windows */
  112. #ifndef SWIGSTDCALL
  113. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  114. # define SWIGSTDCALL __stdcall
  115. # else
  116. # define SWIGSTDCALL
  117. # endif
  118. #endif
  119. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  120. #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  121. # define _CRT_SECURE_NO_DEPRECATE
  122. #endif
  123. /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  124. #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  125. # define _SCL_SECURE_NO_DEPRECATE
  126. #endif
  127. /* -----------------------------------------------------------------------------
  128. * This section contains generic SWIG labels for method/variable
  129. * declarations/attributes, and other compiler dependent labels.
  130. * ----------------------------------------------------------------------------- */
  131. /* template workaround for compilers that cannot correctly implement the C++ standard */
  132. #ifndef SWIGTEMPLATEDISAMBIGUATOR
  133. # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  134. # define SWIGTEMPLATEDISAMBIGUATOR template
  135. # elif defined(__HP_aCC)
  136. /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  137. /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  138. # define SWIGTEMPLATEDISAMBIGUATOR template
  139. # else
  140. # define SWIGTEMPLATEDISAMBIGUATOR
  141. # endif
  142. #endif
  143. /* inline attribute */
  144. #ifndef SWIGINLINE
  145. # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  146. # define SWIGINLINE inline
  147. # else
  148. # define SWIGINLINE
  149. # endif
  150. #endif
  151. /* attribute recognised by some compilers to avoid 'unused' warnings */
  152. #ifndef SWIGUNUSED
  153. # if defined(__GNUC__)
  154. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  155. # define SWIGUNUSED __attribute__ ((__unused__))
  156. # else
  157. # define SWIGUNUSED
  158. # endif
  159. # elif defined(__ICC)
  160. # define SWIGUNUSED __attribute__ ((__unused__))
  161. # else
  162. # define SWIGUNUSED
  163. # endif
  164. #endif
  165. #ifndef SWIG_MSC_UNSUPPRESS_4505
  166. # if defined(_MSC_VER)
  167. # pragma warning(disable : 4505) /* unreferenced local function has been removed */
  168. # endif
  169. #endif
  170. #ifndef SWIGUNUSEDPARM
  171. # ifdef __cplusplus
  172. # define SWIGUNUSEDPARM(p)
  173. # else
  174. # define SWIGUNUSEDPARM(p) p SWIGUNUSED
  175. # endif
  176. #endif
  177. /* internal SWIG method */
  178. #ifndef SWIGINTERN
  179. # define SWIGINTERN static SWIGUNUSED
  180. #endif
  181. /* internal inline SWIG method */
  182. #ifndef SWIGINTERNINLINE
  183. # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  184. #endif
  185. /* exporting methods */
  186. #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  187. # ifndef GCC_HASCLASSVISIBILITY
  188. # define GCC_HASCLASSVISIBILITY
  189. # endif
  190. #endif
  191. #ifndef SWIGEXPORT
  192. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  193. # if defined(STATIC_LINKED)
  194. # define SWIGEXPORT
  195. # else
  196. # define SWIGEXPORT __declspec(dllexport)
  197. # endif
  198. # else
  199. # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  200. # define SWIGEXPORT __attribute__ ((visibility("default")))
  201. # else
  202. # define SWIGEXPORT
  203. # endif
  204. # endif
  205. #endif
  206. /* calling conventions for Windows */
  207. #ifndef SWIGSTDCALL
  208. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  209. # define SWIGSTDCALL __stdcall
  210. # else
  211. # define SWIGSTDCALL
  212. # endif
  213. #endif
  214. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  215. #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  216. # define _CRT_SECURE_NO_DEPRECATE
  217. #endif
  218. /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  219. #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  220. # define _SCL_SECURE_NO_DEPRECATE
  221. #endif
  222. /* -----------------------------------------------------------------------------
  223. * swigrun.swg
  224. *
  225. * This file contains generic C API SWIG runtime support for pointer
  226. * type checking.
  227. * ----------------------------------------------------------------------------- */
  228. /* This should only be incremented when either the layout of swig_type_info changes,
  229. or for whatever reason, the runtime changes incompatibly */
  230. #define SWIG_RUNTIME_VERSION "4"
  231. /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
  232. #ifdef SWIG_TYPE_TABLE
  233. # define SWIG_QUOTE_STRING(x) #x
  234. # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
  235. # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
  236. #else
  237. # define SWIG_TYPE_TABLE_NAME
  238. #endif
  239. /*
  240. You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  241. creating a static or dynamic library from the SWIG runtime code.
  242. In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  243. But only do this if strictly necessary, ie, if you have problems
  244. with your compiler or suchlike.
  245. */
  246. #ifndef SWIGRUNTIME
  247. # define SWIGRUNTIME SWIGINTERN
  248. #endif
  249. #ifndef SWIGRUNTIMEINLINE
  250. # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
  251. #endif
  252. /* Generic buffer size */
  253. #ifndef SWIG_BUFFER_SIZE
  254. # define SWIG_BUFFER_SIZE 1024
  255. #endif
  256. /* Flags for pointer conversions */
  257. #define SWIG_POINTER_DISOWN 0x1
  258. #define SWIG_CAST_NEW_MEMORY 0x2
  259. /* Flags for new pointer objects */
  260. #define SWIG_POINTER_OWN 0x1
  261. /*
  262. Flags/methods for returning states.
  263. The SWIG conversion methods, as ConvertPtr, return an integer
  264. that tells if the conversion was successful or not. And if not,
  265. an error code can be returned (see swigerrors.swg for the codes).
  266. Use the following macros/flags to set or process the returning
  267. states.
  268. In old versions of SWIG, code such as the following was usually written:
  269. if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
  270. // success code
  271. } else {
  272. //fail code
  273. }
  274. Now you can be more explicit:
  275. int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
  276. if (SWIG_IsOK(res)) {
  277. // success code
  278. } else {
  279. // fail code
  280. }
  281. which is the same really, but now you can also do
  282. Type *ptr;
  283. int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
  284. if (SWIG_IsOK(res)) {
  285. // success code
  286. if (SWIG_IsNewObj(res) {
  287. ...
  288. delete *ptr;
  289. } else {
  290. ...
  291. }
  292. } else {
  293. // fail code
  294. }
  295. I.e., now SWIG_ConvertPtr can return new objects and you can
  296. identify the case and take care of the deallocation. Of course that
  297. also requires SWIG_ConvertPtr to return new result values, such as
  298. int SWIG_ConvertPtr(obj, ptr,...) {
  299. if (<obj is ok>) {
  300. if (<need new object>) {
  301. *ptr = <ptr to new allocated object>;
  302. return SWIG_NEWOBJ;
  303. } else {
  304. *ptr = <ptr to old object>;
  305. return SWIG_OLDOBJ;
  306. }
  307. } else {
  308. return SWIG_BADOBJ;
  309. }
  310. }
  311. Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
  312. more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
  313. SWIG errors code.
  314. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
  315. allows to return the 'cast rank', for example, if you have this
  316. int food(double)
  317. int fooi(int);
  318. and you call
  319. food(1) // cast rank '1' (1 -> 1.0)
  320. fooi(1) // cast rank '0'
  321. just use the SWIG_AddCast()/SWIG_CheckState()
  322. */
  323. #define SWIG_OK (0)
  324. #define SWIG_ERROR (-1)
  325. #define SWIG_IsOK(r) (r >= 0)
  326. #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
  327. /* The CastRankLimit says how many bits are used for the cast rank */
  328. #define SWIG_CASTRANKLIMIT (1 << 8)
  329. /* The NewMask denotes the object was created (using new/malloc) */
  330. #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
  331. /* The TmpMask is for in/out typemaps that use temporal objects */
  332. #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
  333. /* Simple returning values */
  334. #define SWIG_BADOBJ (SWIG_ERROR)
  335. #define SWIG_OLDOBJ (SWIG_OK)
  336. #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
  337. #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
  338. /* Check, add and del mask methods */
  339. #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
  340. #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
  341. #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
  342. #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
  343. #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
  344. #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
  345. /* Cast-Rank Mode */
  346. #if defined(SWIG_CASTRANK_MODE)
  347. # ifndef SWIG_TypeRank
  348. # define SWIG_TypeRank unsigned long
  349. # endif
  350. # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
  351. # define SWIG_MAXCASTRANK (2)
  352. # endif
  353. # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
  354. # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
  355. SWIGINTERNINLINE int SWIG_AddCast(int r) {
  356. return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
  357. }
  358. SWIGINTERNINLINE int SWIG_CheckState(int r) {
  359. return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
  360. }
  361. #else /* no cast-rank mode */
  362. # define SWIG_AddCast(r) (r)
  363. # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
  364. #endif
  365. #include <string.h>
  366. #ifdef __cplusplus
  367. extern "C" {
  368. #endif
  369. typedef void *(*swig_converter_func)(void *, int *);
  370. typedef struct swig_type_info *(*swig_dycast_func)(void **);
  371. /* Structure to store information on one type */
  372. typedef struct swig_type_info {
  373. const char *name; /* mangled name of this type */
  374. const char *str; /* human readable name of this type */
  375. swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
  376. struct swig_cast_info *cast; /* linked list of types that can cast into this type */
  377. void *clientdata; /* language specific type data */
  378. int owndata; /* flag if the structure owns the clientdata */
  379. } swig_type_info;
  380. /* Structure to store a type and conversion function used for casting */
  381. typedef struct swig_cast_info {
  382. swig_type_info *type; /* pointer to type that is equivalent to this type */
  383. swig_converter_func converter; /* function to cast the void pointers */
  384. struct swig_cast_info *next; /* pointer to next cast in linked list */
  385. struct swig_cast_info *prev; /* pointer to the previous cast */
  386. } swig_cast_info;
  387. /* Structure used to store module information
  388. * Each module generates one structure like this, and the runtime collects
  389. * all of these structures and stores them in a circularly linked list.*/
  390. typedef struct swig_module_info {
  391. swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
  392. size_t size; /* Number of types in this module */
  393. struct swig_module_info *next; /* Pointer to next element in circularly linked list */
  394. swig_type_info **type_initial; /* Array of initially generated type structures */
  395. swig_cast_info **cast_initial; /* Array of initially generated casting structures */
  396. void *clientdata; /* Language specific module data */
  397. } swig_module_info;
  398. /*
  399. Compare two type names skipping the space characters, therefore
  400. "char*" == "char *" and "Class<int>" == "Class<int >", etc.
  401. Return 0 when the two name types are equivalent, as in
  402. strncmp, but skipping ' '.
  403. */
  404. SWIGRUNTIME int
  405. SWIG_TypeNameComp(const char *f1, const char *l1,
  406. const char *f2, const char *l2) {
  407. for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
  408. while ((*f1 == ' ') && (f1 != l1)) ++f1;
  409. while ((*f2 == ' ') && (f2 != l2)) ++f2;
  410. if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  411. }
  412. return (int)((l1 - f1) - (l2 - f2));
  413. }
  414. /*
  415. Check type equivalence in a name list like <name1>|<name2>|...
  416. Return 0 if equal, -1 if nb < tb, 1 if nb > tb
  417. */
  418. SWIGRUNTIME int
  419. SWIG_TypeCmp(const char *nb, const char *tb) {
  420. int equiv = 1;
  421. const char* te = tb + strlen(tb);
  422. const char* ne = nb;
  423. while (equiv != 0 && *ne) {
  424. for (nb = ne; *ne; ++ne) {
  425. if (*ne == '|') break;
  426. }
  427. equiv = SWIG_TypeNameComp(nb, ne, tb, te);
  428. if (*ne) ++ne;
  429. }
  430. return equiv;
  431. }
  432. /*
  433. Check type equivalence in a name list like <name1>|<name2>|...
  434. Return 0 if not equal, 1 if equal
  435. */
  436. SWIGRUNTIME int
  437. SWIG_TypeEquiv(const char *nb, const char *tb) {
  438. return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
  439. }
  440. /*
  441. Check the typename
  442. */
  443. SWIGRUNTIME swig_cast_info *
  444. SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  445. if (ty) {
  446. swig_cast_info *iter = ty->cast;
  447. while (iter) {
  448. if (strcmp(iter->type->name, c) == 0) {
  449. if (iter == ty->cast)
  450. return iter;
  451. /* Move iter to the top of the linked list */
  452. iter->prev->next = iter->next;
  453. if (iter->next)
  454. iter->next->prev = iter->prev;
  455. iter->next = ty->cast;
  456. iter->prev = 0;
  457. if (ty->cast) ty->cast->prev = iter;
  458. ty->cast = iter;
  459. return iter;
  460. }
  461. iter = iter->next;
  462. }
  463. }
  464. return 0;
  465. }
  466. /*
  467. Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
  468. */
  469. SWIGRUNTIME swig_cast_info *
  470. SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  471. if (ty) {
  472. swig_cast_info *iter = ty->cast;
  473. while (iter) {
  474. if (iter->type == from) {
  475. if (iter == ty->cast)
  476. return iter;
  477. /* Move iter to the top of the linked list */
  478. iter->prev->next = iter->next;
  479. if (iter->next)
  480. iter->next->prev = iter->prev;
  481. iter->next = ty->cast;
  482. iter->prev = 0;
  483. if (ty->cast) ty->cast->prev = iter;
  484. ty->cast = iter;
  485. return iter;
  486. }
  487. iter = iter->next;
  488. }
  489. }
  490. return 0;
  491. }
  492. /*
  493. Cast a pointer up an inheritance hierarchy
  494. */
  495. SWIGRUNTIMEINLINE void *
  496. SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  497. return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
  498. }
  499. /*
  500. Dynamic pointer casting. Down an inheritance hierarchy
  501. */
  502. SWIGRUNTIME swig_type_info *
  503. SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  504. swig_type_info *lastty = ty;
  505. if (!ty || !ty->dcast) return ty;
  506. while (ty && (ty->dcast)) {
  507. ty = (*ty->dcast)(ptr);
  508. if (ty) lastty = ty;
  509. }
  510. return lastty;
  511. }
  512. /*
  513. Return the name associated with this type
  514. */
  515. SWIGRUNTIMEINLINE const char *
  516. SWIG_TypeName(const swig_type_info *ty) {
  517. return ty->name;
  518. }
  519. /*
  520. Return the pretty name associated with this type,
  521. that is an unmangled type name in a form presentable to the user.
  522. */
  523. SWIGRUNTIME const char *
  524. SWIG_TypePrettyName(const swig_type_info *type) {
  525. /* The "str" field contains the equivalent pretty names of the
  526. type, separated by vertical-bar characters. We choose
  527. to print the last name, as it is often (?) the most
  528. specific. */
  529. if (!type) return NULL;
  530. if (type->str != NULL) {
  531. const char *last_name = type->str;
  532. const char *s;
  533. for (s = type->str; *s; s++)
  534. if (*s == '|') last_name = s+1;
  535. return last_name;
  536. }
  537. else
  538. return type->name;
  539. }
  540. /*
  541. Set the clientdata field for a type
  542. */
  543. SWIGRUNTIME void
  544. SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  545. swig_cast_info *cast = ti->cast;
  546. /* if (ti->clientdata == clientdata) return; */
  547. ti->clientdata = clientdata;
  548. while (cast) {
  549. if (!cast->converter) {
  550. swig_type_info *tc = cast->type;
  551. if (!tc->clientdata) {
  552. SWIG_TypeClientData(tc, clientdata);
  553. }
  554. }
  555. cast = cast->next;
  556. }
  557. }
  558. SWIGRUNTIME void
  559. SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  560. SWIG_TypeClientData(ti, clientdata);
  561. ti->owndata = 1;
  562. }
  563. /*
  564. Search for a swig_type_info structure only by mangled name
  565. Search is a O(log #types)
  566. We start searching at module start, and finish searching when start == end.
  567. Note: if start == end at the beginning of the function, we go all the way around
  568. the circular list.
  569. */
  570. SWIGRUNTIME swig_type_info *
  571. SWIG_MangledTypeQueryModule(swig_module_info *start,
  572. swig_module_info *end,
  573. const char *name) {
  574. swig_module_info *iter = start;
  575. do {
  576. if (iter->size) {
  577. size_t l = 0;
  578. size_t r = iter->size - 1;
  579. do {
  580. /* since l+r >= 0, we can (>> 1) instead (/ 2) */
  581. size_t i = (l + r) >> 1;
  582. const char *iname = iter->types[i]->name;
  583. if (iname) {
  584. int compare = strcmp(name, iname);
  585. if (compare == 0) {
  586. return iter->types[i];
  587. } else if (compare < 0) {
  588. if (i) {
  589. r = i - 1;
  590. } else {
  591. break;
  592. }
  593. } else if (compare > 0) {
  594. l = i + 1;
  595. }
  596. } else {
  597. break; /* should never happen */
  598. }
  599. } while (l <= r);
  600. }
  601. iter = iter->next;
  602. } while (iter != end);
  603. return 0;
  604. }
  605. /*
  606. Search for a swig_type_info structure for either a mangled name or a human readable name.
  607. It first searches the mangled names of the types, which is a O(log #types)
  608. If a type is not found it then searches the human readable names, which is O(#types).
  609. We start searching at module start, and finish searching when start == end.
  610. Note: if start == end at the beginning of the function, we go all the way around
  611. the circular list.
  612. */
  613. SWIGRUNTIME swig_type_info *
  614. SWIG_TypeQueryModule(swig_module_info *start,
  615. swig_module_info *end,
  616. const char *name) {
  617. /* STEP 1: Search the name field using binary search */
  618. swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  619. if (ret) {
  620. return ret;
  621. } else {
  622. /* STEP 2: If the type hasn't been found, do a complete search
  623. of the str field (the human readable name) */
  624. swig_module_info *iter = start;
  625. do {
  626. size_t i = 0;
  627. for (; i < iter->size; ++i) {
  628. if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
  629. return iter->types[i];
  630. }
  631. iter = iter->next;
  632. } while (iter != end);
  633. }
  634. /* neither found a match */
  635. return 0;
  636. }
  637. /*
  638. Pack binary data into a string
  639. */
  640. SWIGRUNTIME char *
  641. SWIG_PackData(char *c, void *ptr, size_t sz) {
  642. static const char hex[17] = "0123456789abcdef";
  643. const unsigned char *u = (unsigned char *) ptr;
  644. const unsigned char *eu = u + sz;
  645. for (; u != eu; ++u) {
  646. unsigned char uu = *u;
  647. *(c++) = hex[(uu & 0xf0) >> 4];
  648. *(c++) = hex[uu & 0xf];
  649. }
  650. return c;
  651. }
  652. /*
  653. Unpack binary data from a string
  654. */
  655. SWIGRUNTIME const char *
  656. SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  657. unsigned char *u = (unsigned char *) ptr;
  658. const unsigned char *eu = u + sz;
  659. for (; u != eu; ++u) {
  660. char d = *(c++);
  661. unsigned char uu;
  662. if ((d >= '0') && (d <= '9'))
  663. uu = ((d - '0') << 4);
  664. else if ((d >= 'a') && (d <= 'f'))
  665. uu = ((d - ('a'-10)) << 4);
  666. else
  667. return (char *) 0;
  668. d = *(c++);
  669. if ((d >= '0') && (d <= '9'))
  670. uu |= (d - '0');
  671. else if ((d >= 'a') && (d <= 'f'))
  672. uu |= (d - ('a'-10));
  673. else
  674. return (char *) 0;
  675. *u = uu;
  676. }
  677. return c;
  678. }
  679. /*
  680. Pack 'void *' into a string buffer.
  681. */
  682. SWIGRUNTIME char *
  683. SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  684. char *r = buff;
  685. if ((2*sizeof(void *) + 2) > bsz) return 0;
  686. *(r++) = '_';
  687. r = SWIG_PackData(r,&ptr,sizeof(void *));
  688. if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  689. strcpy(r,name);
  690. return buff;
  691. }
  692. SWIGRUNTIME const char *
  693. SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  694. if (*c != '_') {
  695. if (strcmp(c,"NULL") == 0) {
  696. *ptr = (void *) 0;
  697. return name;
  698. } else {
  699. return 0;
  700. }
  701. }
  702. return SWIG_UnpackData(++c,ptr,sizeof(void *));
  703. }
  704. SWIGRUNTIME char *
  705. SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  706. char *r = buff;
  707. size_t lname = (name ? strlen(name) : 0);
  708. if ((2*sz + 2 + lname) > bsz) return 0;
  709. *(r++) = '_';
  710. r = SWIG_PackData(r,ptr,sz);
  711. if (lname) {
  712. strncpy(r,name,lname+1);
  713. } else {
  714. *r = 0;
  715. }
  716. return buff;
  717. }
  718. SWIGRUNTIME const char *
  719. SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  720. if (*c != '_') {
  721. if (strcmp(c,"NULL") == 0) {
  722. memset(ptr,0,sz);
  723. return name;
  724. } else {
  725. return 0;
  726. }
  727. }
  728. return SWIG_UnpackData(++c,ptr,sz);
  729. }
  730. #ifdef __cplusplus
  731. }
  732. #endif
  733. /* Errors in SWIG */
  734. #define SWIG_UnknownError -1
  735. #define SWIG_IOError -2
  736. #define SWIG_RuntimeError -3
  737. #define SWIG_IndexError -4
  738. #define SWIG_TypeError -5
  739. #define SWIG_DivisionByZero -6
  740. #define SWIG_OverflowError -7
  741. #define SWIG_SyntaxError -8
  742. #define SWIG_ValueError -9
  743. #define SWIG_SystemError -10
  744. #define SWIG_AttributeError -11
  745. #define SWIG_MemoryError -12
  746. #define SWIG_NullReferenceError -13
  747. #include <ruby.h>
  748. /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
  749. * breaks using rb_intern as an lvalue, as SWIG does. We work around this
  750. * issue for now by disabling this.
  751. * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
  752. */
  753. #ifdef rb_intern
  754. # undef rb_intern
  755. #endif
  756. /* Remove global macros defined in Ruby's win32.h */
  757. #ifdef write
  758. # undef write
  759. #endif
  760. #ifdef read
  761. # undef read
  762. #endif
  763. #ifdef bind
  764. # undef bind
  765. #endif
  766. #ifdef close
  767. # undef close
  768. #endif
  769. #ifdef connect
  770. # undef connect
  771. #endif
  772. /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
  773. #ifndef NUM2LL
  774. #define NUM2LL(x) NUM2LONG((x))
  775. #endif
  776. #ifndef LL2NUM
  777. #define LL2NUM(x) INT2NUM((long) (x))
  778. #endif
  779. #ifndef ULL2NUM
  780. #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
  781. #endif
  782. /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
  783. #ifndef NUM2ULL
  784. #ifdef HAVE_LONG_LONG
  785. #define NUM2ULL(x) rb_num2ull((x))
  786. #else
  787. #define NUM2ULL(x) NUM2ULONG(x)
  788. #endif
  789. #endif
  790. /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
  791. /* Define these for older versions so we can just write code the new way */
  792. #ifndef RSTRING_LEN
  793. # define RSTRING_LEN(x) RSTRING(x)->len
  794. #endif
  795. #ifndef RSTRING_PTR
  796. # define RSTRING_PTR(x) RSTRING(x)->ptr
  797. #endif
  798. #ifndef RSTRING_END
  799. # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
  800. #endif
  801. #ifndef RARRAY_LEN
  802. # define RARRAY_LEN(x) RARRAY(x)->len
  803. #endif
  804. #ifndef RARRAY_PTR
  805. # define RARRAY_PTR(x) RARRAY(x)->ptr
  806. #endif
  807. #ifndef RFLOAT_VALUE
  808. # define RFLOAT_VALUE(x) RFLOAT(x)->value
  809. #endif
  810. #ifndef DOUBLE2NUM
  811. # define DOUBLE2NUM(x) rb_float_new(x)
  812. #endif
  813. #ifndef RHASH_TBL
  814. # define RHASH_TBL(x) (RHASH(x)->tbl)
  815. #endif
  816. #ifndef RHASH_ITER_LEV
  817. # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
  818. #endif
  819. #ifndef RHASH_IFNONE
  820. # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
  821. #endif
  822. #ifndef RHASH_SIZE
  823. # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
  824. #endif
  825. #ifndef RHASH_EMPTY_P
  826. # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
  827. #endif
  828. #ifndef RSTRUCT_LEN
  829. # define RSTRUCT_LEN(x) RSTRUCT(x)->len
  830. #endif
  831. #ifndef RSTRUCT_PTR
  832. # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
  833. #endif
  834. /*
  835. * Need to be very careful about how these macros are defined, especially
  836. * when compiling C++ code or C code with an ANSI C compiler.
  837. *
  838. * VALUEFUNC(f) is a macro used to typecast a C function that implements
  839. * a Ruby method so that it can be passed as an argument to API functions
  840. * like rb_define_method() and rb_define_singleton_method().
  841. *
  842. * VOIDFUNC(f) is a macro used to typecast a C function that implements
  843. * either the "mark" or "free" stuff for a Ruby Data object, so that it
  844. * can be passed as an argument to API functions like Data_Wrap_Struct()
  845. * and Data_Make_Struct().
  846. */
  847. #ifdef __cplusplus
  848. # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
  849. # define PROTECTFUNC(f) ((VALUE (*)()) f)
  850. # define VALUEFUNC(f) ((VALUE (*)()) f)
  851. # define VOIDFUNC(f) ((void (*)()) f)
  852. # else
  853. # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
  854. # define PROTECTFUNC(f) ((VALUE (*)()) f)
  855. # define VALUEFUNC(f) ((VALUE (*)()) f)
  856. # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
  857. # else /* These definitions should work for Ruby 1.7+ */
  858. # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
  859. # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
  860. # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
  861. # endif
  862. # endif
  863. #else
  864. # define VALUEFUNC(f) (f)
  865. # define VOIDFUNC(f) (f)
  866. #endif
  867. /* Don't use for expressions have side effect */
  868. #ifndef RB_STRING_VALUE
  869. #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
  870. #endif
  871. #ifndef StringValue
  872. #define StringValue(s) RB_STRING_VALUE(s)
  873. #endif
  874. #ifndef StringValuePtr
  875. #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
  876. #endif
  877. #ifndef StringValueLen
  878. #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
  879. #endif
  880. #ifndef SafeStringValue
  881. #define SafeStringValue(v) do {\
  882. StringValue(v);\
  883. rb_check_safe_str(v);\
  884. } while (0)
  885. #endif
  886. #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  887. #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
  888. #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
  889. #endif
  890. static VALUE _mSWIG = Qnil;
  891. /* -----------------------------------------------------------------------------
  892. * error manipulation
  893. * ----------------------------------------------------------------------------- */
  894. /* Define some additional error types */
  895. #define SWIG_ObjectPreviouslyDeletedError -100
  896. /* Define custom exceptions for errors that do not map to existing Ruby
  897. exceptions. Note this only works for C++ since a global cannot be
  898. initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
  899. SWIGINTERN VALUE
  900. getNullReferenceError(void) {
  901. static int init = 0;
  902. static VALUE rb_eNullReferenceError ;
  903. if (!init) {
  904. init = 1;
  905. rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
  906. }
  907. return rb_eNullReferenceError;
  908. }
  909. SWIGINTERN VALUE
  910. getObjectPreviouslyDeletedError(void) {
  911. static int init = 0;
  912. static VALUE rb_eObjectPreviouslyDeleted ;
  913. if (!init) {
  914. init = 1;
  915. rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
  916. }
  917. return rb_eObjectPreviouslyDeleted;
  918. }
  919. SWIGINTERN VALUE
  920. SWIG_Ruby_ErrorType(int SWIG_code) {
  921. VALUE type;
  922. switch (SWIG_code) {
  923. case SWIG_MemoryError:
  924. type = rb_eNoMemError;
  925. break;
  926. case SWIG_IOError:
  927. type = rb_eIOError;
  928. break;
  929. case SWIG_RuntimeError:
  930. type = rb_eRuntimeError;
  931. break;
  932. case SWIG_IndexError:
  933. type = rb_eIndexError;
  934. break;
  935. case SWIG_TypeError:
  936. type = rb_eTypeError;
  937. break;
  938. case SWIG_DivisionByZero:
  939. type = rb_eZeroDivError;
  940. break;
  941. case SWIG_OverflowError:
  942. type = rb_eRangeError;
  943. break;
  944. case SWIG_SyntaxError:
  945. type = rb_eSyntaxError;
  946. break;
  947. case SWIG_ValueError:
  948. type = rb_eArgError;
  949. break;
  950. case SWIG_SystemError:
  951. type = rb_eFatal;
  952. break;
  953. case SWIG_AttributeError:
  954. type = rb_eRuntimeError;
  955. break;
  956. case SWIG_NullReferenceError:
  957. type = getNullReferenceError();
  958. break;
  959. case SWIG_ObjectPreviouslyDeletedError:
  960. type = getObjectPreviouslyDeletedError();
  961. break;
  962. case SWIG_UnknownError:
  963. type = rb_eRuntimeError;
  964. break;
  965. default:
  966. type = rb_eRuntimeError;
  967. }
  968. return type;
  969. }
  970. /* This function is called when a user inputs a wrong argument to
  971. a method.
  972. */
  973. SWIGINTERN
  974. const char* Ruby_Format_TypeError( const char* msg,
  975. const char* type,
  976. const char* name,
  977. const int argn,
  978. VALUE input )
  979. {
  980. char buf[128];
  981. VALUE str;
  982. VALUE asStr;
  983. if ( msg && *msg )
  984. {
  985. str = rb_str_new2(msg);
  986. }
  987. else
  988. {
  989. str = rb_str_new(NULL, 0);
  990. }
  991. str = rb_str_cat2( str, "Expected argument " );
  992. sprintf( buf, "%d of type ", argn-1 );
  993. str = rb_str_cat2( str, buf );
  994. str = rb_str_cat2( str, type );
  995. str = rb_str_cat2( str, ", but got " );
  996. str = rb_str_cat2( str, rb_obj_classname(input) );
  997. str = rb_str_cat2( str, " " );
  998. asStr = rb_inspect(input);
  999. if ( RSTRING_LEN(asStr) > 30 )
  1000. {
  1001. str = rb_str_cat( str, StringValuePtr(asStr), 30 );
  1002. str = rb_str_cat2( str, "..." );
  1003. }
  1004. else
  1005. {
  1006. str = rb_str_append( str, asStr );
  1007. }
  1008. if ( name )
  1009. {
  1010. str = rb_str_cat2( str, "\n\tin SWIG method '" );
  1011. str = rb_str_cat2( str, name );
  1012. str = rb_str_cat2( str, "'" );
  1013. }
  1014. return StringValuePtr( str );
  1015. }
  1016. /* This function is called when an overloaded method fails */
  1017. SWIGINTERN
  1018. void Ruby_Format_OverloadedError(
  1019. const int argc,
  1020. const int maxargs,
  1021. const char* method,
  1022. const char* prototypes
  1023. )
  1024. {
  1025. const char* msg = "Wrong # of arguments";
  1026. if ( argc <= maxargs ) msg = "Wrong arguments";
  1027. rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
  1028. "Possible C/C++ prototypes are:\n%s",
  1029. msg, method, prototypes);
  1030. }
  1031. /* -----------------------------------------------------------------------------
  1032. * rubytracking.swg
  1033. *
  1034. * This file contains support for tracking mappings from
  1035. * Ruby objects to C++ objects. This functionality is needed
  1036. * to implement mark functions for Ruby's mark and sweep
  1037. * garbage collector.
  1038. * ----------------------------------------------------------------------------- */
  1039. #ifdef __cplusplus
  1040. extern "C" {
  1041. #endif
  1042. /* Ruby 1.8 actually assumes the first case. */
  1043. #if SIZEOF_VOIDP == SIZEOF_LONG
  1044. # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
  1045. # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
  1046. #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
  1047. # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
  1048. # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
  1049. #else
  1050. # error sizeof(void*) is not the same as long or long long
  1051. #endif
  1052. /* Global Ruby hash table to store Trackings from C/C++
  1053. structs to Ruby Objects.
  1054. */
  1055. static VALUE swig_ruby_trackings = Qnil;
  1056. /* Global variable that stores a reference to the ruby
  1057. hash table delete function. */
  1058. static ID swig_ruby_hash_delete;
  1059. /* Setup a Ruby hash table to store Trackings */
  1060. SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
  1061. /* Create a ruby hash table to store Trackings from C++
  1062. objects to Ruby objects. */
  1063. /* Try to see if some other .so has already created a
  1064. tracking hash table, which we keep hidden in an instance var
  1065. in the SWIG module.
  1066. This is done to allow multiple DSOs to share the same
  1067. tracking table.
  1068. */
  1069. ID trackings_id = rb_intern( "@__trackings__" );
  1070. VALUE verbose = rb_gv_get("VERBOSE");
  1071. rb_gv_set("VERBOSE", Qfalse);
  1072. swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
  1073. rb_gv_set("VERBOSE", verbose);
  1074. /* No, it hasn't. Create one ourselves */
  1075. if ( swig_ruby_trackings == Qnil )
  1076. {
  1077. swig_ruby_trackings = rb_hash_new();
  1078. rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
  1079. }
  1080. /* Now store a reference to the hash table delete function
  1081. so that we only have to look it up once.*/
  1082. swig_ruby_hash_delete = rb_intern("delete");
  1083. }
  1084. /* Get a Ruby number to reference a pointer */
  1085. SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
  1086. /* We cast the pointer to an unsigned long
  1087. and then store a reference to it using
  1088. a Ruby number object. */
  1089. /* Convert the pointer to a Ruby number */
  1090. return SWIG2NUM(ptr);
  1091. }
  1092. /* Get a Ruby number to reference an object */
  1093. SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
  1094. /* We cast the object to an unsigned long
  1095. and then store a reference to it using
  1096. a Ruby number object. */
  1097. /* Convert the Object to a Ruby number */
  1098. return SWIG2NUM(object);
  1099. }
  1100. /* Get a Ruby object from a previously stored reference */
  1101. SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
  1102. /* The provided Ruby number object is a reference
  1103. to the Ruby object we want.*/
  1104. /* Convert the Ruby number to a Ruby object */
  1105. return NUM2SWIG(reference);
  1106. }
  1107. /* Add a Tracking from a C/C++ struct to a Ruby object */
  1108. SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
  1109. /* In a Ruby hash table we store the pointer and
  1110. the associated Ruby object. The trick here is
  1111. that we cannot store the Ruby object directly - if
  1112. we do then it cannot be garbage collected. So
  1113. instead we typecast it as a unsigned long and
  1114. convert it to a Ruby number object.*/
  1115. /* Get a reference to the pointer as a Ruby number */
  1116. VALUE key = SWIG_RubyPtrToReference(ptr);
  1117. /* Get a reference to the Ruby object as a Ruby number */
  1118. VALUE value = SWIG_RubyObjectToReference(object);
  1119. /* Store the mapping to the global hash table. */
  1120. rb_hash_aset(swig_ruby_trackings, key, value);
  1121. }
  1122. /* Get the Ruby object that owns the specified C/C++ struct */
  1123. SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
  1124. /* Get a reference to the pointer as a Ruby number */
  1125. VALUE key = SWIG_RubyPtrToReference(ptr);
  1126. /* Now lookup the value stored in the global hash table */
  1127. VALUE value = rb_hash_aref(swig_ruby_trackings, key);
  1128. if (value == Qnil) {
  1129. /* No object exists - return nil. */
  1130. return Qnil;
  1131. }
  1132. else {
  1133. /* Convert this value to Ruby object */
  1134. return SWIG_RubyReferenceToObject(value);
  1135. }
  1136. }
  1137. /* Remove a Tracking from a C/C++ struct to a Ruby object. It
  1138. is very important to remove objects once they are destroyed
  1139. since the same memory address may be reused later to create
  1140. a new object. */
  1141. SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
  1142. /* Get a reference to the pointer as a Ruby number */
  1143. VALUE key = SWIG_RubyPtrToReference(ptr);
  1144. /* Delete the object from the hash table by calling Ruby's
  1145. do this we need to call the Hash.delete method.*/
  1146. rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
  1147. }
  1148. /* This is a helper method that unlinks a Ruby object from its
  1149. underlying C++ object. This is needed if the lifetime of the
  1150. Ruby object is longer than the C++ object */
  1151. SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
  1152. VALUE object = SWIG_RubyInstanceFor(ptr);
  1153. if (object != Qnil) {
  1154. DATA_PTR(object) = 0;
  1155. }
  1156. }
  1157. #ifdef __cplusplus
  1158. }
  1159. #endif
  1160. /* -----------------------------------------------------------------------------
  1161. * Ruby API portion that goes into the runtime
  1162. * ----------------------------------------------------------------------------- */
  1163. #ifdef __cplusplus
  1164. extern "C" {
  1165. #endif
  1166. SWIGINTERN VALUE
  1167. SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
  1168. if (NIL_P(target)) {
  1169. target = o;
  1170. } else {
  1171. if (TYPE(target) != T_ARRAY) {
  1172. VALUE o2 = target;
  1173. target = rb_ary_new();
  1174. rb_ary_push(target, o2);
  1175. }
  1176. rb_ary_push(target, o);
  1177. }
  1178. return target;
  1179. }
  1180. /* For ruby1.8.4 and earlier. */
  1181. #ifndef RUBY_INIT_STACK
  1182. RUBY_EXTERN void Init_stack(VALUE* addr);
  1183. # define RUBY_INIT_STACK \
  1184. VALUE variable_in_this_stack_frame; \
  1185. Init_stack(&variable_in_this_stack_frame);
  1186. #endif
  1187. #ifdef __cplusplus
  1188. }
  1189. #endif
  1190. /* -----------------------------------------------------------------------------
  1191. * rubyrun.swg
  1192. *
  1193. * This file contains the runtime support for Ruby modules
  1194. * and includes code for managing global variables and pointer
  1195. * type checking.
  1196. * ----------------------------------------------------------------------------- */
  1197. /* For backward compatibility only */
  1198. #define SWIG_POINTER_EXCEPTION 0
  1199. /* for raw pointers */
  1200. #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
  1201. #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
  1202. #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
  1203. #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
  1204. #define swig_owntype ruby_owntype
  1205. /* for raw packed data */
  1206. #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
  1207. #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
  1208. /* for class or struct pointers */
  1209. #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
  1210. #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
  1211. /* for C or C++ function pointers */
  1212. #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
  1213. #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
  1214. /* for C++ member pointers, ie, member methods */
  1215. #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
  1216. #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
  1217. /* Runtime API */
  1218. #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata)
  1219. #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
  1220. /* Error manipulation */
  1221. #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
  1222. #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
  1223. #define SWIG_fail goto fail
  1224. /* Ruby-specific SWIG API */
  1225. #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
  1226. #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
  1227. #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
  1228. #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
  1229. #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
  1230. #include "assert.h"
  1231. /* -----------------------------------------------------------------------------
  1232. * pointers/data manipulation
  1233. * ----------------------------------------------------------------------------- */
  1234. #ifdef __cplusplus
  1235. extern "C" {
  1236. #endif
  1237. typedef struct {
  1238. VALUE klass;
  1239. VALUE mImpl;
  1240. void (*mark)(void *);
  1241. void (*destroy)(void *);
  1242. int trackObjects;
  1243. } swig_class;
  1244. /* Global pointer used to keep some internal SWIG stuff */
  1245. static VALUE _cSWIG_Pointer = Qnil;
  1246. static VALUE swig_runtime_data_type_pointer = Qnil;
  1247. /* Global IDs used to keep some internal SWIG stuff */
  1248. static ID swig_arity_id = 0;
  1249. static ID swig_call_id = 0;
  1250. /*
  1251. If your swig extension is to be run within an embedded ruby and has
  1252. director callbacks, you should set -DRUBY_EMBEDDED during compilation.
  1253. This will reset ruby's stack frame on each entry point from the main
  1254. program the first time a virtual director function is invoked (in a
  1255. non-recursive way).
  1256. If this is not done, you run the risk of Ruby trashing the stack.
  1257. */
  1258. #ifdef RUBY_EMBEDDED
  1259. # define SWIG_INIT_STACK \
  1260. if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
  1261. ++swig_virtual_calls;
  1262. # define SWIG_RELEASE_STACK --swig_virtual_calls;
  1263. # define Ruby_DirectorTypeMismatchException(x) \
  1264. rb_raise( rb_eTypeError, "%s", x ); return c_result;
  1265. static unsigned int swig_virtual_calls = 0;
  1266. #else /* normal non-embedded extension */
  1267. # define SWIG_INIT_STACK
  1268. # define SWIG_RELEASE_STACK
  1269. # define Ruby_DirectorTypeMismatchException(x) \
  1270. throw Swig::DirectorTypeMismatchException( x );
  1271. #endif /* RUBY_EMBEDDED */
  1272. SWIGRUNTIME VALUE
  1273. getExceptionClass(void) {
  1274. static int init = 0;
  1275. static VALUE rubyExceptionClass ;
  1276. if (!init) {
  1277. init = 1;
  1278. rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
  1279. }
  1280. return rubyExceptionClass;
  1281. }
  1282. /* This code checks to see if the Ruby object being raised as part
  1283. of an exception inherits from the Ruby class Exception. If so,
  1284. the object is simply returned. If not, then a new Ruby exception
  1285. object is created and that will be returned to Ruby.*/
  1286. SWIGRUNTIME VALUE
  1287. SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
  1288. VALUE exceptionClass = getExceptionClass();
  1289. if (rb_obj_is_kind_of(obj, exceptionClass)) {
  1290. return obj;
  1291. } else {
  1292. return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
  1293. }
  1294. }
  1295. /* Initialize Ruby runtime support */
  1296. SWIGRUNTIME void
  1297. SWIG_Ruby_InitRuntime(void)
  1298. {
  1299. if (_mSWIG == Qnil) {
  1300. _mSWIG = rb_define_module("SWIG");
  1301. swig_call_id = rb_intern("call");
  1302. swig_arity_id = rb_intern("arity");
  1303. }
  1304. }
  1305. /* Define Ruby class for C type */
  1306. SWIGRUNTIME void
  1307. SWIG_Ruby_define_class(swig_type_info *type)
  1308. {
  1309. char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
  1310. sprintf(klass_name, "TYPE%s", type->name);
  1311. if (NIL_P(_cSWIG_Pointer)) {
  1312. _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
  1313. rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
  1314. }
  1315. rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
  1316. free((void *) klass_name);
  1317. }
  1318. /* Create a new pointer object */
  1319. SWIGRUNTIME VALUE
  1320. SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
  1321. {
  1322. int own = flags & SWIG_POINTER_OWN;
  1323. int track;
  1324. char *klass_name;
  1325. swig_class *sklass;
  1326. VALUE klass;
  1327. VALUE obj;
  1328. if (!ptr)
  1329. return Qnil;
  1330. if (type->clientdata) {
  1331. sklass = (swig_class *) type->clientdata;
  1332. /* Are we tracking this class and have we already returned this Ruby object? */
  1333. track = sklass->trackObjects;
  1334. if (track) {
  1335. obj = SWIG_RubyInstanceFor(ptr);
  1336. /* Check the object's type and make sure it has the correct type.
  1337. It might not in cases where methods do things like
  1338. downcast methods. */
  1339. if (obj != Qnil) {
  1340. VALUE value = rb_iv_get(obj, "@__swigtype__");
  1341. const char* type_name = RSTRING_PTR(value);
  1342. if (strcmp(type->name, type_name) == 0) {
  1343. return obj;
  1344. }
  1345. }
  1346. }
  1347. /* Create a new Ruby object */
  1348. obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
  1349. ( own ? VOIDFUNC(sklass->destroy) :
  1350. (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
  1351. ), ptr);
  1352. /* If tracking is on for this class then track this object. */
  1353. if (track) {
  1354. SWIG_RubyAddTracking(ptr, obj);
  1355. }
  1356. } else {
  1357. klass_name = (char *) malloc(4 + strlen(type->name) + 1);
  1358. sprintf(klass_name, "TYPE%s", type->name);
  1359. klass = rb_const_get(_mSWIG, rb_intern(klass_name));
  1360. free((void *) klass_name);
  1361. obj = Data_Wrap_Struct(klass, 0, 0, ptr);
  1362. }
  1363. rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
  1364. return obj;
  1365. }
  1366. /* Create a new class instance (always owned) */
  1367. SWIGRUNTIME VALUE
  1368. SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
  1369. {
  1370. VALUE obj;
  1371. swig_class *sklass = (swig_class *) type->clientdata;
  1372. obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
  1373. rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
  1374. return obj;
  1375. }
  1376. /* Get type mangle from class name */
  1377. SWIGRUNTIMEINLINE char *
  1378. SWIG_Ruby_MangleStr(VALUE obj)
  1379. {
  1380. VALUE stype = rb_iv_get(obj, "@__swigtype__");
  1381. return StringValuePtr(stype);
  1382. }
  1383. /* Acquire a pointer value */
  1384. typedef void (*ruby_owntype)(void*);
  1385. SWIGRUNTIME ruby_owntype
  1386. SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
  1387. if (obj) {
  1388. ruby_owntype oldown = RDATA(obj)->dfree;
  1389. RDATA(obj)->dfree = own;
  1390. return oldown;
  1391. } else {
  1392. return 0;
  1393. }
  1394. }
  1395. /* Convert a pointer value */
  1396. SWIGRUNTIME int
  1397. SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
  1398. {
  1399. char *c;
  1400. swig_cast_info *tc;
  1401. void *vptr = 0;
  1402. /* Grab the pointer */
  1403. if (NIL_P(obj)) {
  1404. *ptr = 0;
  1405. return SWIG_OK;
  1406. } else {
  1407. if (TYPE(obj) != T_DATA) {
  1408. return SWIG_ERROR;
  1409. }
  1410. Data_Get_Struct(obj, void, vptr);
  1411. }
  1412. if (own) *own = RDATA(obj)->dfree;
  1413. /* Check to see if the input object is giving up ownership
  1414. of the underlying C struct or C++ object. If so then we
  1415. need to reset the destructor since the Ruby object no
  1416. longer owns the underlying C++ object.*/
  1417. if (flags & SWIG_POINTER_DISOWN) {
  1418. /* Is tracking on for this class? */
  1419. int track = 0;
  1420. if (ty && ty->clientdata) {
  1421. swig_class *sklass = (swig_class *) ty->clientdata;
  1422. track = sklass->trackObjects;
  1423. }
  1424. if (track) {
  1425. /* We are tracking objects for this class. Thus we change the destructor
  1426. * to SWIG_RubyRemoveTracking. This allows us to
  1427. * remove the mapping from the C++ to Ruby object
  1428. * when the Ruby object is garbage collected. If we don't
  1429. * do this, then it is possible we will return a reference
  1430. * to a Ruby object that no longer exists thereby crashing Ruby. */
  1431. RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
  1432. } else {
  1433. RDATA(obj)->dfree = 0;
  1434. }
  1435. }
  1436. /* Do type-checking if type info was provided */
  1437. if (ty) {
  1438. if (ty->clientdata) {
  1439. if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
  1440. if (vptr == 0) {
  1441. /* The object has already been deleted */
  1442. return SWIG_ObjectPreviouslyDeletedError;
  1443. }
  1444. *ptr = vptr;
  1445. return SWIG_OK;
  1446. }
  1447. }
  1448. if ((c = SWIG_MangleStr(obj)) == NULL) {
  1449. return SWIG_ERROR;
  1450. }
  1451. tc = SWIG_TypeCheck(c, ty);
  1452. if (!tc) {
  1453. return SWIG_ERROR;
  1454. } else {
  1455. int newmemory = 0;
  1456. *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
  1457. assert(!newmemory); /* newmemory handling not yet implemented */
  1458. }
  1459. } else {
  1460. *ptr = vptr;
  1461. }
  1462. return SWIG_OK;
  1463. }
  1464. /* Check convert */
  1465. SWIGRUNTIMEINLINE int
  1466. SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
  1467. {
  1468. char *c = SWIG_MangleStr(obj);
  1469. if (!c) return 0;
  1470. return SWIG_TypeCheck(c,ty) != 0;
  1471. }
  1472. SWIGRUNTIME VALUE
  1473. SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
  1474. char result[1024];
  1475. char *r = result;
  1476. if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
  1477. *(r++) = '_';
  1478. r = SWIG_PackData(r, ptr, sz);
  1479. strcpy(r, type->name);
  1480. return rb_str_new2(result);
  1481. }
  1482. /* Convert a packed value value */
  1483. SWIGRUNTIME int
  1484. SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
  1485. swig_cast_info *tc;
  1486. const char *c;
  1487. if (TYPE(obj) != T_STRING) goto type_error;
  1488. c = StringValuePtr(obj);
  1489. /* Pointer values must start with leading underscore */
  1490. if (*c != '_') goto type_error;
  1491. c++;
  1492. c = SWIG_UnpackData(c, ptr, sz);
  1493. if (ty) {
  1494. tc = SWIG_TypeCheck(c, ty);
  1495. if (!tc) goto type_error;
  1496. }
  1497. return SWIG_OK;
  1498. type_error:
  1499. return SWIG_ERROR;
  1500. }
  1501. SWIGRUNTIME swig_module_info *
  1502. SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata))
  1503. {
  1504. VALUE pointer;
  1505. swig_module_info *ret = 0;
  1506. VALUE verbose = rb_gv_get("VERBOSE");
  1507. /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
  1508. rb_gv_set("VERBOSE", Qfalse);
  1509. /* first check if pointer already created */
  1510. pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  1511. if (pointer != Qnil) {
  1512. Data_Get_Struct(pointer, swig_module_info, ret);
  1513. }
  1514. /* reinstate warnings */
  1515. rb_gv_set("VERBOSE", verbose);
  1516. return ret;
  1517. }
  1518. SWIGRUNTIME void
  1519. SWIG_Ruby_SetModule(swig_module_info *pointer)
  1520. {
  1521. /* register a new class */
  1522. VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
  1523. /* create and store the structure pointer to a global variable */
  1524. swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
  1525. rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
  1526. }
  1527. /* This function can be used to check whether a proc or method or similarly
  1528. callable function has been passed. Usually used in a %typecheck, like:
  1529. %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
  1530. $result = SWIG_Ruby_isCallable( $input );
  1531. }
  1532. */
  1533. SWIGINTERN
  1534. int SWIG_Ruby_isCallable( VALUE proc )
  1535. {
  1536. if ( rb_respond_to( proc, swig_call_id ) )
  1537. return 1;
  1538. return 0;
  1539. }
  1540. /* This function can be used to check the arity (number of arguments)
  1541. a proc or method can take. Usually used in a %typecheck.
  1542. Valid arities will be that equal to minimal or those < 0
  1543. which indicate a variable number of parameters at the end.
  1544. */
  1545. SWIGINTERN
  1546. int SWIG_Ruby_arity( VALUE proc, int minimal )
  1547. {
  1548. if ( rb_respond_to( proc, swig_arity_id ) )
  1549. {
  1550. VALUE num = rb_funcall( proc, swig_arity_id, 0 );
  1551. int arity = NUM2INT(num);
  1552. if ( arity < 0 && (arity+1) < -minimal ) return 1;
  1553. if ( arity == minimal ) return 1;
  1554. return 1;
  1555. }
  1556. return 0;
  1557. }
  1558. #ifdef __cplusplus
  1559. }
  1560. #endif
  1561. #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
  1562. #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
  1563. /* -------- TYPES TABLE (BEGIN) -------- */
  1564. #define SWIGTYPE_p_ESLconnection swig_types[0]
  1565. #define SWIGTYPE_p_ESLevent swig_types[1]
  1566. #define SWIGTYPE_p_char swig_types[2]
  1567. #define SWIGTYPE_p_esl_event_t swig_types[3]
  1568. #define SWIGTYPE_p_esl_priority_t swig_types[4]
  1569. static swig_type_info *swig_types[6];
  1570. static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
  1571. #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
  1572. #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
  1573. /* -------- TYPES TABLE (END) -------- */
  1574. #define SWIG_init Init_ESL
  1575. #define SWIG_name "ESL"
  1576. static VALUE mESL;
  1577. #define SWIG_RUBY_THREAD_BEGIN_BLOCK
  1578. #define SWIG_RUBY_THREAD_END_BLOCK
  1579. #define SWIGVERSION 0x030002
  1580. #define SWIG_VERSION SWIGVERSION
  1581. #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
  1582. #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
  1583. #include <stdexcept>
  1584. #include "esl.h"
  1585. #include "esl_oop.h"
  1586. SWIGINTERN swig_type_info*
  1587. SWIG_pchar_descriptor(void)
  1588. {
  1589. static int init = 0;
  1590. static swig_type_info* info = 0;
  1591. if (!init) {
  1592. info = SWIG_TypeQuery("_p_char");
  1593. init = 1;
  1594. }
  1595. return info;
  1596. }
  1597. SWIGINTERN int
  1598. SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
  1599. {
  1600. if (TYPE(obj) == T_STRING) {
  1601. char *cstr = StringValuePtr(obj);
  1602. size_t size = RSTRING_LEN(obj) + 1;
  1603. if (cptr) {
  1604. if (alloc) {
  1605. if (*alloc == SWIG_NEWOBJ) {
  1606. *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
  1607. } else {
  1608. *cptr = cstr;
  1609. *alloc = SWIG_OLDOBJ;
  1610. }
  1611. }
  1612. }
  1613. if (psize) *psize = size;
  1614. return SWIG_OK;
  1615. } else {
  1616. swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
  1617. if (pchar_descriptor) {
  1618. void* vptr = 0;
  1619. if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
  1620. if (cptr) *cptr = (char *)vptr;
  1621. if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
  1622. if (alloc) *alloc = SWIG_OLDOBJ;
  1623. return SWIG_OK;
  1624. }
  1625. }
  1626. }
  1627. return SWIG_TypeError;
  1628. }
  1629. SWIGINTERNINLINE VALUE
  1630. SWIG_FromCharPtrAndSize(const char* carray, size_t size)
  1631. {
  1632. if (carray) {
  1633. if (size > LONG_MAX) {
  1634. swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
  1635. return pchar_descriptor ?
  1636. SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
  1637. } else {
  1638. return rb_str_new(carray, static_cast< long >(size));
  1639. }
  1640. } else {
  1641. return Qnil;
  1642. }
  1643. }
  1644. SWIGINTERNINLINE VALUE
  1645. SWIG_FromCharPtr(const char *cptr)
  1646. {
  1647. return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
  1648. }
  1649. #include <limits.h>
  1650. #if !defined(SWIG_NO_LLONG_MAX)
  1651. # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
  1652. # define LLONG_MAX __LONG_LONG_MAX__
  1653. # define LLONG_MIN (-LLONG_MAX - 1LL)
  1654. # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
  1655. # endif
  1656. #endif
  1657. SWIGINTERN VALUE
  1658. SWIG_ruby_failed(void)
  1659. {
  1660. return Qnil;
  1661. }
  1662. /*@SWIG:/usr/share/swig3.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
  1663. SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
  1664. {
  1665. VALUE obj = args[0];
  1666. VALUE type = TYPE(obj);
  1667. long *res = (long *)(args[1]);
  1668. *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
  1669. return obj;
  1670. }
  1671. /*@SWIG@*/
  1672. SWIGINTERN int
  1673. SWIG_AsVal_long (VALUE obj, long* val)
  1674. {
  1675. VALUE type = TYPE(obj);
  1676. if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
  1677. long v;
  1678. VALUE a[2];
  1679. a[0] = obj;
  1680. a[1] = (VALUE)(&v);
  1681. if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
  1682. if (val) *val = v;
  1683. return SWIG_OK;
  1684. }
  1685. }
  1686. return SWIG_TypeError;
  1687. }
  1688. SWIGINTERN int
  1689. SWIG_AsVal_int (VALUE obj, int *val)
  1690. {
  1691. long v;
  1692. int res = SWIG_AsVal_long (obj, &v);
  1693. if (SWIG_IsOK(res)) {
  1694. if ((v < INT_MIN || v > INT_MAX)) {
  1695. return SWIG_OverflowError;
  1696. } else {
  1697. if (val) *val = static_cast< int >(v);
  1698. }
  1699. }
  1700. return res;
  1701. }
  1702. #define SWIG_From_long LONG2NUM
  1703. SWIGINTERNINLINE VALUE
  1704. SWIG_From_int (int value)
  1705. {
  1706. return SWIG_From_long (value);
  1707. }
  1708. SWIGINTERNINLINE VALUE
  1709. SWIG_From_bool (bool value)
  1710. {
  1711. return value ? Qtrue : Qfalse;
  1712. }
  1713. static swig_class SwigClassESLevent;
  1714. SWIGINTERN VALUE
  1715. _wrap_ESLevent_event_set(int argc, VALUE *argv, VALUE self) {
  1716. ESLevent *arg1 = (ESLevent *) 0 ;
  1717. esl_event_t *arg2 = (esl_event_t *) 0 ;
  1718. void *argp1 = 0 ;
  1719. int res1 = 0 ;
  1720. void *argp2 = 0 ;
  1721. int res2 = 0 ;
  1722. if ((argc < 1) || (argc > 1)) {
  1723. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  1724. }
  1725. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  1726. if (!SWIG_IsOK(res1)) {
  1727. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","event", 1, self ));
  1728. }
  1729. arg1 = reinterpret_cast< ESLevent * >(argp1);
  1730. res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_esl_event_t, SWIG_POINTER_DISOWN | 0 );
  1731. if (!SWIG_IsOK(res2)) {
  1732. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "esl_event_t *","event", 2, argv[0] ));
  1733. }
  1734. arg2 = reinterpret_cast< esl_event_t * >(argp2);
  1735. if (arg1) (arg1)->event = arg2;
  1736. return Qnil;
  1737. fail:
  1738. return Qnil;
  1739. }
  1740. SWIGINTERN VALUE
  1741. _wrap_ESLevent_event_get(int argc, VALUE *argv, VALUE self) {
  1742. ESLevent *arg1 = (ESLevent *) 0 ;
  1743. void *argp1 = 0 ;
  1744. int res1 = 0 ;
  1745. esl_event_t *result = 0 ;
  1746. VALUE vresult = Qnil;
  1747. if ((argc < 0) || (argc > 0)) {
  1748. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  1749. }
  1750. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  1751. if (!SWIG_IsOK(res1)) {
  1752. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","event", 1, self ));
  1753. }
  1754. arg1 = reinterpret_cast< ESLevent * >(argp1);
  1755. result = (esl_event_t *) ((arg1)->event);
  1756. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_esl_event_t, 0 | 0 );
  1757. return vresult;
  1758. fail:
  1759. return Qnil;
  1760. }
  1761. SWIGINTERN VALUE
  1762. _wrap_ESLevent_serialized_string_set(int argc, VALUE *argv, VALUE self) {
  1763. ESLevent *arg1 = (ESLevent *) 0 ;
  1764. char *arg2 = (char *) 0 ;
  1765. void *argp1 = 0 ;
  1766. int res1 = 0 ;
  1767. int res2 ;
  1768. char *buf2 = 0 ;
  1769. int alloc2 = 0 ;
  1770. if ((argc < 1) || (argc > 1)) {
  1771. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  1772. }
  1773. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  1774. if (!SWIG_IsOK(res1)) {
  1775. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","serialized_string", 1, self ));
  1776. }
  1777. arg1 = reinterpret_cast< ESLevent * >(argp1);
  1778. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  1779. if (!SWIG_IsOK(res2)) {
  1780. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","serialized_string", 2, argv[0] ));
  1781. }
  1782. arg2 = reinterpret_cast< char * >(buf2);
  1783. if (arg1->serialized_string) delete[] arg1->serialized_string;
  1784. if (arg2) {
  1785. size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1;
  1786. arg1->serialized_string = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size)));
  1787. } else {
  1788. arg1->serialized_string = 0;
  1789. }
  1790. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1791. return Qnil;
  1792. fail:
  1793. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1794. return Qnil;
  1795. }
  1796. SWIGINTERN VALUE
  1797. _wrap_ESLevent_serialized_string_get(int argc, VALUE *argv, VALUE self) {
  1798. ESLevent *arg1 = (ESLevent *) 0 ;
  1799. void *argp1 = 0 ;
  1800. int res1 = 0 ;
  1801. char *result = 0 ;
  1802. VALUE vresult = Qnil;
  1803. if ((argc < 0) || (argc > 0)) {
  1804. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  1805. }
  1806. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  1807. if (!SWIG_IsOK(res1)) {
  1808. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","serialized_string", 1, self ));
  1809. }
  1810. arg1 = reinterpret_cast< ESLevent * >(argp1);
  1811. result = (char *) ((arg1)->serialized_string);
  1812. vresult = SWIG_FromCharPtr((const char *)result);
  1813. return vresult;
  1814. fail:
  1815. return Qnil;
  1816. }
  1817. SWIGINTERN VALUE
  1818. _wrap_ESLevent_mine_set(int argc, VALUE *argv, VALUE self) {
  1819. ESLevent *arg1 = (ESLevent *) 0 ;
  1820. int arg2 ;
  1821. void *argp1 = 0 ;
  1822. int res1 = 0 ;
  1823. int val2 ;
  1824. int ecode2 = 0 ;
  1825. if ((argc < 1) || (argc > 1)) {
  1826. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  1827. }
  1828. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  1829. if (!SWIG_IsOK(res1)) {
  1830. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","mine", 1, self ));
  1831. }
  1832. arg1 = reinterpret_cast< ESLevent * >(argp1);
  1833. ecode2 = SWIG_AsVal_int(argv[0], &val2);
  1834. if (!SWIG_IsOK(ecode2)) {
  1835. SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","mine", 2, argv[0] ));
  1836. }
  1837. arg2 = static_cast< int >(val2);
  1838. if (arg1) (arg1)->mine = arg2;
  1839. return Qnil;
  1840. fail:
  1841. return Qnil;
  1842. }
  1843. SWIGINTERN VALUE
  1844. _wrap_ESLevent_mine_get(int argc, VALUE *argv, VALUE self) {
  1845. ESLevent *arg1 = (ESLevent *) 0 ;
  1846. void *argp1 = 0 ;
  1847. int res1 = 0 ;
  1848. int result;
  1849. VALUE vresult = Qnil;
  1850. if ((argc < 0) || (argc > 0)) {
  1851. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  1852. }
  1853. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  1854. if (!SWIG_IsOK(res1)) {
  1855. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","mine", 1, self ));
  1856. }
  1857. arg1 = reinterpret_cast< ESLevent * >(argp1);
  1858. result = (int) ((arg1)->mine);
  1859. vresult = SWIG_From_int(static_cast< int >(result));
  1860. return vresult;
  1861. fail:
  1862. return Qnil;
  1863. }
  1864. SWIGINTERN VALUE
  1865. _wrap_new_ESLevent__SWIG_0(int argc, VALUE *argv, VALUE self) {
  1866. char *arg1 = (char *) 0 ;
  1867. char *arg2 = (char *) NULL ;
  1868. int res1 ;
  1869. char *buf1 = 0 ;
  1870. int alloc1 = 0 ;
  1871. int res2 ;
  1872. char *buf2 = 0 ;
  1873. int alloc2 = 0 ;
  1874. ESLevent *result = 0 ;
  1875. if ((argc < 1) || (argc > 2)) {
  1876. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  1877. }
  1878. res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  1879. if (!SWIG_IsOK(res1)) {
  1880. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLevent", 1, argv[0] ));
  1881. }
  1882. arg1 = reinterpret_cast< char * >(buf1);
  1883. if (argc > 1) {
  1884. res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  1885. if (!SWIG_IsOK(res2)) {
  1886. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","ESLevent", 2, argv[1] ));
  1887. }
  1888. arg2 = reinterpret_cast< char * >(buf2);
  1889. }
  1890. result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
  1891. DATA_PTR(self) = result;
  1892. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  1893. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1894. return self;
  1895. fail:
  1896. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  1897. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  1898. return Qnil;
  1899. }
  1900. SWIGINTERN VALUE
  1901. _wrap_new_ESLevent__SWIG_1(int argc, VALUE *argv, VALUE self) {
  1902. esl_event_t *arg1 = (esl_event_t *) 0 ;
  1903. int arg2 = (int) 0 ;
  1904. void *argp1 = 0 ;
  1905. int res1 = 0 ;
  1906. int val2 ;
  1907. int ecode2 = 0 ;
  1908. ESLevent *result = 0 ;
  1909. if ((argc < 1) || (argc > 2)) {
  1910. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  1911. }
  1912. res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_esl_event_t, 0 | 0 );
  1913. if (!SWIG_IsOK(res1)) {
  1914. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "esl_event_t *","ESLevent", 1, argv[0] ));
  1915. }
  1916. arg1 = reinterpret_cast< esl_event_t * >(argp1);
  1917. if (argc > 1) {
  1918. ecode2 = SWIG_AsVal_int(argv[1], &val2);
  1919. if (!SWIG_IsOK(ecode2)) {
  1920. SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ESLevent", 2, argv[1] ));
  1921. }
  1922. arg2 = static_cast< int >(val2);
  1923. }
  1924. result = (ESLevent *)new ESLevent(arg1,arg2);
  1925. DATA_PTR(self) = result;
  1926. return self;
  1927. fail:
  1928. return Qnil;
  1929. }
  1930. #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
  1931. SWIGINTERN VALUE
  1932. _wrap_ESLevent_allocate(VALUE self) {
  1933. #else
  1934. SWIGINTERN VALUE
  1935. _wrap_ESLevent_allocate(int argc, VALUE *argv, VALUE self) {
  1936. #endif
  1937. VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ESLevent);
  1938. #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  1939. rb_obj_call_init(vresult, argc, argv);
  1940. #endif
  1941. return vresult;
  1942. }
  1943. SWIGINTERN VALUE
  1944. _wrap_new_ESLevent__SWIG_2(int argc, VALUE *argv, VALUE self) {
  1945. ESLevent *arg1 = (ESLevent *) 0 ;
  1946. void *argp1 = 0 ;
  1947. int res1 = 0 ;
  1948. ESLevent *result = 0 ;
  1949. if ((argc < 1) || (argc > 1)) {
  1950. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  1951. }
  1952. res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  1953. if (!SWIG_IsOK(res1)) {
  1954. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","ESLevent", 1, argv[0] ));
  1955. }
  1956. arg1 = reinterpret_cast< ESLevent * >(argp1);
  1957. result = (ESLevent *)new ESLevent(arg1);
  1958. DATA_PTR(self) = result;
  1959. return self;
  1960. fail:
  1961. return Qnil;
  1962. }
  1963. SWIGINTERN VALUE _wrap_new_ESLevent(int nargs, VALUE *args, VALUE self) {
  1964. int argc;
  1965. VALUE argv[2];
  1966. int ii;
  1967. argc = nargs;
  1968. if (argc > 2) SWIG_fail;
  1969. for (ii = 0; (ii < argc); ++ii) {
  1970. argv[ii] = args[ii];
  1971. }
  1972. if ((argc >= 1) && (argc <= 2)) {
  1973. int _v;
  1974. void *vptr = 0;
  1975. int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_esl_event_t, 0);
  1976. _v = SWIG_CheckState(res);
  1977. if (_v) {
  1978. if (argc <= 1) {
  1979. return _wrap_new_ESLevent__SWIG_1(nargs, args, self);
  1980. }
  1981. {
  1982. int res = SWIG_AsVal_int(argv[1], NULL);
  1983. _v = SWIG_CheckState(res);
  1984. }
  1985. if (_v) {
  1986. return _wrap_new_ESLevent__SWIG_1(nargs, args, self);
  1987. }
  1988. }
  1989. }
  1990. if (argc == 1) {
  1991. int _v;
  1992. void *vptr = 0;
  1993. int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ESLevent, 0);
  1994. _v = SWIG_CheckState(res);
  1995. if (_v) {
  1996. return _wrap_new_ESLevent__SWIG_2(nargs, args, self);
  1997. }
  1998. }
  1999. if ((argc >= 1) && (argc <= 2)) {
  2000. int _v;
  2001. int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
  2002. _v = SWIG_CheckState(res);
  2003. if (_v) {
  2004. if (argc <= 1) {
  2005. return _wrap_new_ESLevent__SWIG_0(nargs, args, self);
  2006. }
  2007. int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
  2008. _v = SWIG_CheckState(res);
  2009. if (_v) {
  2010. return _wrap_new_ESLevent__SWIG_0(nargs, args, self);
  2011. }
  2012. }
  2013. }
  2014. fail:
  2015. Ruby_Format_OverloadedError( argc, 2, "ESLevent.new",
  2016. " ESLevent.new(char const *type, char const *subclass_name)\n"
  2017. " ESLevent.new(esl_event_t *wrap_me, int free_me)\n"
  2018. " ESLevent.new(ESLevent *me)\n");
  2019. return Qnil;
  2020. }
  2021. SWIGINTERN void
  2022. free_ESLevent(ESLevent *arg1) {
  2023. delete arg1;
  2024. }
  2025. SWIGINTERN VALUE
  2026. _wrap_ESLevent_serialize(int argc, VALUE *argv, VALUE self) {
  2027. ESLevent *arg1 = (ESLevent *) 0 ;
  2028. char *arg2 = (char *) NULL ;
  2029. void *argp1 = 0 ;
  2030. int res1 = 0 ;
  2031. int res2 ;
  2032. char *buf2 = 0 ;
  2033. int alloc2 = 0 ;
  2034. char *result = 0 ;
  2035. VALUE vresult = Qnil;
  2036. if ((argc < 0) || (argc > 1)) {
  2037. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2038. }
  2039. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2040. if (!SWIG_IsOK(res1)) {
  2041. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","serialize", 1, self ));
  2042. }
  2043. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2044. if (argc > 0) {
  2045. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2046. if (!SWIG_IsOK(res2)) {
  2047. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","serialize", 2, argv[0] ));
  2048. }
  2049. arg2 = reinterpret_cast< char * >(buf2);
  2050. }
  2051. result = (char *)(arg1)->serialize((char const *)arg2);
  2052. vresult = SWIG_FromCharPtr((const char *)result);
  2053. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2054. return vresult;
  2055. fail:
  2056. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2057. return Qnil;
  2058. }
  2059. SWIGINTERN VALUE
  2060. _wrap_ESLevent_setPriority(int argc, VALUE *argv, VALUE self) {
  2061. ESLevent *arg1 = (ESLevent *) 0 ;
  2062. esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
  2063. void *argp1 = 0 ;
  2064. int res1 = 0 ;
  2065. void *argp2 ;
  2066. int res2 = 0 ;
  2067. bool result;
  2068. VALUE vresult = Qnil;
  2069. if ((argc < 0) || (argc > 1)) {
  2070. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2071. }
  2072. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2073. if (!SWIG_IsOK(res1)) {
  2074. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","setPriority", 1, self ));
  2075. }
  2076. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2077. if (argc > 0) {
  2078. {
  2079. res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_esl_priority_t, 0 );
  2080. if (!SWIG_IsOK(res2)) {
  2081. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "esl_priority_t","setPriority", 2, argv[0] ));
  2082. }
  2083. if (!argp2) {
  2084. SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "esl_priority_t","setPriority", 2, argv[0]));
  2085. } else {
  2086. arg2 = *(reinterpret_cast< esl_priority_t * >(argp2));
  2087. }
  2088. }
  2089. }
  2090. result = (bool)(arg1)->setPriority(arg2);
  2091. vresult = SWIG_From_bool(static_cast< bool >(result));
  2092. return vresult;
  2093. fail:
  2094. return Qnil;
  2095. }
  2096. SWIGINTERN VALUE
  2097. _wrap_ESLevent_getHeader(int argc, VALUE *argv, VALUE self) {
  2098. ESLevent *arg1 = (ESLevent *) 0 ;
  2099. char *arg2 = (char *) 0 ;
  2100. int arg3 = (int) -1 ;
  2101. void *argp1 = 0 ;
  2102. int res1 = 0 ;
  2103. int res2 ;
  2104. char *buf2 = 0 ;
  2105. int alloc2 = 0 ;
  2106. int val3 ;
  2107. int ecode3 = 0 ;
  2108. char *result = 0 ;
  2109. VALUE vresult = Qnil;
  2110. if ((argc < 1) || (argc > 2)) {
  2111. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2112. }
  2113. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2114. if (!SWIG_IsOK(res1)) {
  2115. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","getHeader", 1, self ));
  2116. }
  2117. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2118. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2119. if (!SWIG_IsOK(res2)) {
  2120. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","getHeader", 2, argv[0] ));
  2121. }
  2122. arg2 = reinterpret_cast< char * >(buf2);
  2123. if (argc > 1) {
  2124. ecode3 = SWIG_AsVal_int(argv[1], &val3);
  2125. if (!SWIG_IsOK(ecode3)) {
  2126. SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","getHeader", 3, argv[1] ));
  2127. }
  2128. arg3 = static_cast< int >(val3);
  2129. }
  2130. result = (char *)(arg1)->getHeader((char const *)arg2,arg3);
  2131. vresult = SWIG_FromCharPtr((const char *)result);
  2132. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2133. return vresult;
  2134. fail:
  2135. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2136. return Qnil;
  2137. }
  2138. SWIGINTERN VALUE
  2139. _wrap_ESLevent_getBody(int argc, VALUE *argv, VALUE self) {
  2140. ESLevent *arg1 = (ESLevent *) 0 ;
  2141. void *argp1 = 0 ;
  2142. int res1 = 0 ;
  2143. char *result = 0 ;
  2144. VALUE vresult = Qnil;
  2145. if ((argc < 0) || (argc > 0)) {
  2146. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2147. }
  2148. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2149. if (!SWIG_IsOK(res1)) {
  2150. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","getBody", 1, self ));
  2151. }
  2152. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2153. result = (char *)(arg1)->getBody();
  2154. vresult = SWIG_FromCharPtr((const char *)result);
  2155. return vresult;
  2156. fail:
  2157. return Qnil;
  2158. }
  2159. SWIGINTERN VALUE
  2160. _wrap_ESLevent_getType(int argc, VALUE *argv, VALUE self) {
  2161. ESLevent *arg1 = (ESLevent *) 0 ;
  2162. void *argp1 = 0 ;
  2163. int res1 = 0 ;
  2164. char *result = 0 ;
  2165. VALUE vresult = Qnil;
  2166. if ((argc < 0) || (argc > 0)) {
  2167. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2168. }
  2169. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2170. if (!SWIG_IsOK(res1)) {
  2171. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","getType", 1, self ));
  2172. }
  2173. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2174. result = (char *)(arg1)->getType();
  2175. vresult = SWIG_FromCharPtr((const char *)result);
  2176. return vresult;
  2177. fail:
  2178. return Qnil;
  2179. }
  2180. SWIGINTERN VALUE
  2181. _wrap_ESLevent_addBody(int argc, VALUE *argv, VALUE self) {
  2182. ESLevent *arg1 = (ESLevent *) 0 ;
  2183. char *arg2 = (char *) 0 ;
  2184. void *argp1 = 0 ;
  2185. int res1 = 0 ;
  2186. int res2 ;
  2187. char *buf2 = 0 ;
  2188. int alloc2 = 0 ;
  2189. bool result;
  2190. VALUE vresult = Qnil;
  2191. if ((argc < 1) || (argc > 1)) {
  2192. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2193. }
  2194. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2195. if (!SWIG_IsOK(res1)) {
  2196. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","addBody", 1, self ));
  2197. }
  2198. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2199. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2200. if (!SWIG_IsOK(res2)) {
  2201. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addBody", 2, argv[0] ));
  2202. }
  2203. arg2 = reinterpret_cast< char * >(buf2);
  2204. result = (bool)(arg1)->addBody((char const *)arg2);
  2205. vresult = SWIG_From_bool(static_cast< bool >(result));
  2206. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2207. return vresult;
  2208. fail:
  2209. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2210. return Qnil;
  2211. }
  2212. SWIGINTERN VALUE
  2213. _wrap_ESLevent_addHeader(int argc, VALUE *argv, VALUE self) {
  2214. ESLevent *arg1 = (ESLevent *) 0 ;
  2215. char *arg2 = (char *) 0 ;
  2216. char *arg3 = (char *) 0 ;
  2217. void *argp1 = 0 ;
  2218. int res1 = 0 ;
  2219. int res2 ;
  2220. char *buf2 = 0 ;
  2221. int alloc2 = 0 ;
  2222. int res3 ;
  2223. char *buf3 = 0 ;
  2224. int alloc3 = 0 ;
  2225. bool result;
  2226. VALUE vresult = Qnil;
  2227. if ((argc < 2) || (argc > 2)) {
  2228. rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  2229. }
  2230. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2231. if (!SWIG_IsOK(res1)) {
  2232. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","addHeader", 1, self ));
  2233. }
  2234. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2235. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2236. if (!SWIG_IsOK(res2)) {
  2237. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
  2238. }
  2239. arg2 = reinterpret_cast< char * >(buf2);
  2240. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  2241. if (!SWIG_IsOK(res3)) {
  2242. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
  2243. }
  2244. arg3 = reinterpret_cast< char * >(buf3);
  2245. result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
  2246. vresult = SWIG_From_bool(static_cast< bool >(result));
  2247. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2248. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2249. return vresult;
  2250. fail:
  2251. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2252. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2253. return Qnil;
  2254. }
  2255. SWIGINTERN VALUE
  2256. _wrap_ESLevent_pushHeader(int argc, VALUE *argv, VALUE self) {
  2257. ESLevent *arg1 = (ESLevent *) 0 ;
  2258. char *arg2 = (char *) 0 ;
  2259. char *arg3 = (char *) 0 ;
  2260. void *argp1 = 0 ;
  2261. int res1 = 0 ;
  2262. int res2 ;
  2263. char *buf2 = 0 ;
  2264. int alloc2 = 0 ;
  2265. int res3 ;
  2266. char *buf3 = 0 ;
  2267. int alloc3 = 0 ;
  2268. bool result;
  2269. VALUE vresult = Qnil;
  2270. if ((argc < 2) || (argc > 2)) {
  2271. rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  2272. }
  2273. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2274. if (!SWIG_IsOK(res1)) {
  2275. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","pushHeader", 1, self ));
  2276. }
  2277. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2278. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2279. if (!SWIG_IsOK(res2)) {
  2280. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","pushHeader", 2, argv[0] ));
  2281. }
  2282. arg2 = reinterpret_cast< char * >(buf2);
  2283. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  2284. if (!SWIG_IsOK(res3)) {
  2285. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","pushHeader", 3, argv[1] ));
  2286. }
  2287. arg3 = reinterpret_cast< char * >(buf3);
  2288. result = (bool)(arg1)->pushHeader((char const *)arg2,(char const *)arg3);
  2289. vresult = SWIG_From_bool(static_cast< bool >(result));
  2290. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2291. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2292. return vresult;
  2293. fail:
  2294. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2295. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2296. return Qnil;
  2297. }
  2298. SWIGINTERN VALUE
  2299. _wrap_ESLevent_unshiftHeader(int argc, VALUE *argv, VALUE self) {
  2300. ESLevent *arg1 = (ESLevent *) 0 ;
  2301. char *arg2 = (char *) 0 ;
  2302. char *arg3 = (char *) 0 ;
  2303. void *argp1 = 0 ;
  2304. int res1 = 0 ;
  2305. int res2 ;
  2306. char *buf2 = 0 ;
  2307. int alloc2 = 0 ;
  2308. int res3 ;
  2309. char *buf3 = 0 ;
  2310. int alloc3 = 0 ;
  2311. bool result;
  2312. VALUE vresult = Qnil;
  2313. if ((argc < 2) || (argc > 2)) {
  2314. rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  2315. }
  2316. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2317. if (!SWIG_IsOK(res1)) {
  2318. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","unshiftHeader", 1, self ));
  2319. }
  2320. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2321. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2322. if (!SWIG_IsOK(res2)) {
  2323. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","unshiftHeader", 2, argv[0] ));
  2324. }
  2325. arg2 = reinterpret_cast< char * >(buf2);
  2326. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  2327. if (!SWIG_IsOK(res3)) {
  2328. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","unshiftHeader", 3, argv[1] ));
  2329. }
  2330. arg3 = reinterpret_cast< char * >(buf3);
  2331. result = (bool)(arg1)->unshiftHeader((char const *)arg2,(char const *)arg3);
  2332. vresult = SWIG_From_bool(static_cast< bool >(result));
  2333. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2334. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2335. return vresult;
  2336. fail:
  2337. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2338. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2339. return Qnil;
  2340. }
  2341. SWIGINTERN VALUE
  2342. _wrap_ESLevent_delHeader(int argc, VALUE *argv, VALUE self) {
  2343. ESLevent *arg1 = (ESLevent *) 0 ;
  2344. char *arg2 = (char *) 0 ;
  2345. void *argp1 = 0 ;
  2346. int res1 = 0 ;
  2347. int res2 ;
  2348. char *buf2 = 0 ;
  2349. int alloc2 = 0 ;
  2350. bool result;
  2351. VALUE vresult = Qnil;
  2352. if ((argc < 1) || (argc > 1)) {
  2353. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2354. }
  2355. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2356. if (!SWIG_IsOK(res1)) {
  2357. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","delHeader", 1, self ));
  2358. }
  2359. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2360. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2361. if (!SWIG_IsOK(res2)) {
  2362. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","delHeader", 2, argv[0] ));
  2363. }
  2364. arg2 = reinterpret_cast< char * >(buf2);
  2365. result = (bool)(arg1)->delHeader((char const *)arg2);
  2366. vresult = SWIG_From_bool(static_cast< bool >(result));
  2367. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2368. return vresult;
  2369. fail:
  2370. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2371. return Qnil;
  2372. }
  2373. SWIGINTERN VALUE
  2374. _wrap_ESLevent_firstHeader(int argc, VALUE *argv, VALUE self) {
  2375. ESLevent *arg1 = (ESLevent *) 0 ;
  2376. void *argp1 = 0 ;
  2377. int res1 = 0 ;
  2378. char *result = 0 ;
  2379. VALUE vresult = Qnil;
  2380. if ((argc < 0) || (argc > 0)) {
  2381. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2382. }
  2383. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2384. if (!SWIG_IsOK(res1)) {
  2385. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","firstHeader", 1, self ));
  2386. }
  2387. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2388. result = (char *)(arg1)->firstHeader();
  2389. vresult = SWIG_FromCharPtr((const char *)result);
  2390. return vresult;
  2391. fail:
  2392. return Qnil;
  2393. }
  2394. SWIGINTERN VALUE
  2395. _wrap_ESLevent_nextHeader(int argc, VALUE *argv, VALUE self) {
  2396. ESLevent *arg1 = (ESLevent *) 0 ;
  2397. void *argp1 = 0 ;
  2398. int res1 = 0 ;
  2399. char *result = 0 ;
  2400. VALUE vresult = Qnil;
  2401. if ((argc < 0) || (argc > 0)) {
  2402. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2403. }
  2404. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
  2405. if (!SWIG_IsOK(res1)) {
  2406. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","nextHeader", 1, self ));
  2407. }
  2408. arg1 = reinterpret_cast< ESLevent * >(argp1);
  2409. result = (char *)(arg1)->nextHeader();
  2410. vresult = SWIG_FromCharPtr((const char *)result);
  2411. return vresult;
  2412. fail:
  2413. return Qnil;
  2414. }
  2415. static swig_class SwigClassESLconnection;
  2416. SWIGINTERN VALUE
  2417. _wrap_new_ESLconnection__SWIG_0(int argc, VALUE *argv, VALUE self) {
  2418. char *arg1 = (char *) 0 ;
  2419. int arg2 ;
  2420. char *arg3 = (char *) 0 ;
  2421. char *arg4 = (char *) 0 ;
  2422. int res1 ;
  2423. char *buf1 = 0 ;
  2424. int alloc1 = 0 ;
  2425. int val2 ;
  2426. int ecode2 = 0 ;
  2427. int res3 ;
  2428. char *buf3 = 0 ;
  2429. int alloc3 = 0 ;
  2430. int res4 ;
  2431. char *buf4 = 0 ;
  2432. int alloc4 = 0 ;
  2433. ESLconnection *result = 0 ;
  2434. if ((argc < 4) || (argc > 4)) {
  2435. rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  2436. }
  2437. res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  2438. if (!SWIG_IsOK(res1)) {
  2439. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLconnection", 1, argv[0] ));
  2440. }
  2441. arg1 = reinterpret_cast< char * >(buf1);
  2442. ecode2 = SWIG_AsVal_int(argv[1], &val2);
  2443. if (!SWIG_IsOK(ecode2)) {
  2444. SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ESLconnection", 2, argv[1] ));
  2445. }
  2446. arg2 = static_cast< int >(val2);
  2447. res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  2448. if (!SWIG_IsOK(res3)) {
  2449. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","ESLconnection", 3, argv[2] ));
  2450. }
  2451. arg3 = reinterpret_cast< char * >(buf3);
  2452. res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  2453. if (!SWIG_IsOK(res4)) {
  2454. SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","ESLconnection", 4, argv[3] ));
  2455. }
  2456. arg4 = reinterpret_cast< char * >(buf4);
  2457. result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
  2458. DATA_PTR(self) = result;
  2459. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2460. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2461. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  2462. return self;
  2463. fail:
  2464. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2465. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2466. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  2467. return Qnil;
  2468. }
  2469. SWIGINTERN VALUE
  2470. _wrap_new_ESLconnection__SWIG_1(int argc, VALUE *argv, VALUE self) {
  2471. char *arg1 = (char *) 0 ;
  2472. int arg2 ;
  2473. char *arg3 = (char *) 0 ;
  2474. int res1 ;
  2475. char *buf1 = 0 ;
  2476. int alloc1 = 0 ;
  2477. int val2 ;
  2478. int ecode2 = 0 ;
  2479. int res3 ;
  2480. char *buf3 = 0 ;
  2481. int alloc3 = 0 ;
  2482. ESLconnection *result = 0 ;
  2483. if ((argc < 3) || (argc > 3)) {
  2484. rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  2485. }
  2486. res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  2487. if (!SWIG_IsOK(res1)) {
  2488. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLconnection", 1, argv[0] ));
  2489. }
  2490. arg1 = reinterpret_cast< char * >(buf1);
  2491. ecode2 = SWIG_AsVal_int(argv[1], &val2);
  2492. if (!SWIG_IsOK(ecode2)) {
  2493. SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ESLconnection", 2, argv[1] ));
  2494. }
  2495. arg2 = static_cast< int >(val2);
  2496. res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  2497. if (!SWIG_IsOK(res3)) {
  2498. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","ESLconnection", 3, argv[2] ));
  2499. }
  2500. arg3 = reinterpret_cast< char * >(buf3);
  2501. result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
  2502. DATA_PTR(self) = result;
  2503. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2504. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2505. return self;
  2506. fail:
  2507. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2508. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2509. return Qnil;
  2510. }
  2511. SWIGINTERN VALUE
  2512. _wrap_new_ESLconnection__SWIG_2(int argc, VALUE *argv, VALUE self) {
  2513. char *arg1 = (char *) 0 ;
  2514. char *arg2 = (char *) 0 ;
  2515. char *arg3 = (char *) 0 ;
  2516. char *arg4 = (char *) 0 ;
  2517. int res1 ;
  2518. char *buf1 = 0 ;
  2519. int alloc1 = 0 ;
  2520. int res2 ;
  2521. char *buf2 = 0 ;
  2522. int alloc2 = 0 ;
  2523. int res3 ;
  2524. char *buf3 = 0 ;
  2525. int alloc3 = 0 ;
  2526. int res4 ;
  2527. char *buf4 = 0 ;
  2528. int alloc4 = 0 ;
  2529. ESLconnection *result = 0 ;
  2530. if ((argc < 4) || (argc > 4)) {
  2531. rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  2532. }
  2533. res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  2534. if (!SWIG_IsOK(res1)) {
  2535. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLconnection", 1, argv[0] ));
  2536. }
  2537. arg1 = reinterpret_cast< char * >(buf1);
  2538. res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  2539. if (!SWIG_IsOK(res2)) {
  2540. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","ESLconnection", 2, argv[1] ));
  2541. }
  2542. arg2 = reinterpret_cast< char * >(buf2);
  2543. res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  2544. if (!SWIG_IsOK(res3)) {
  2545. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","ESLconnection", 3, argv[2] ));
  2546. }
  2547. arg3 = reinterpret_cast< char * >(buf3);
  2548. res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  2549. if (!SWIG_IsOK(res4)) {
  2550. SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","ESLconnection", 4, argv[3] ));
  2551. }
  2552. arg4 = reinterpret_cast< char * >(buf4);
  2553. result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
  2554. DATA_PTR(self) = result;
  2555. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2556. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2557. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2558. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  2559. return self;
  2560. fail:
  2561. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2562. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2563. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2564. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  2565. return Qnil;
  2566. }
  2567. SWIGINTERN VALUE
  2568. _wrap_new_ESLconnection__SWIG_3(int argc, VALUE *argv, VALUE self) {
  2569. char *arg1 = (char *) 0 ;
  2570. char *arg2 = (char *) 0 ;
  2571. char *arg3 = (char *) 0 ;
  2572. int res1 ;
  2573. char *buf1 = 0 ;
  2574. int alloc1 = 0 ;
  2575. int res2 ;
  2576. char *buf2 = 0 ;
  2577. int alloc2 = 0 ;
  2578. int res3 ;
  2579. char *buf3 = 0 ;
  2580. int alloc3 = 0 ;
  2581. ESLconnection *result = 0 ;
  2582. if ((argc < 3) || (argc > 3)) {
  2583. rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  2584. }
  2585. res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  2586. if (!SWIG_IsOK(res1)) {
  2587. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ESLconnection", 1, argv[0] ));
  2588. }
  2589. arg1 = reinterpret_cast< char * >(buf1);
  2590. res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  2591. if (!SWIG_IsOK(res2)) {
  2592. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","ESLconnection", 2, argv[1] ));
  2593. }
  2594. arg2 = reinterpret_cast< char * >(buf2);
  2595. res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  2596. if (!SWIG_IsOK(res3)) {
  2597. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","ESLconnection", 3, argv[2] ));
  2598. }
  2599. arg3 = reinterpret_cast< char * >(buf3);
  2600. result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
  2601. DATA_PTR(self) = result;
  2602. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2603. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2604. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2605. return self;
  2606. fail:
  2607. if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  2608. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2609. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2610. return Qnil;
  2611. }
  2612. #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
  2613. SWIGINTERN VALUE
  2614. _wrap_ESLconnection_allocate(VALUE self) {
  2615. #else
  2616. SWIGINTERN VALUE
  2617. _wrap_ESLconnection_allocate(int argc, VALUE *argv, VALUE self) {
  2618. #endif
  2619. VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ESLconnection);
  2620. #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  2621. rb_obj_call_init(vresult, argc, argv);
  2622. #endif
  2623. return vresult;
  2624. }
  2625. SWIGINTERN VALUE
  2626. _wrap_new_ESLconnection__SWIG_4(int argc, VALUE *argv, VALUE self) {
  2627. int arg1 ;
  2628. int val1 ;
  2629. int ecode1 = 0 ;
  2630. ESLconnection *result = 0 ;
  2631. if ((argc < 1) || (argc > 1)) {
  2632. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2633. }
  2634. ecode1 = SWIG_AsVal_int(argv[0], &val1);
  2635. if (!SWIG_IsOK(ecode1)) {
  2636. SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","ESLconnection", 1, argv[0] ));
  2637. }
  2638. arg1 = static_cast< int >(val1);
  2639. result = (ESLconnection *)new ESLconnection(arg1);
  2640. DATA_PTR(self) = result;
  2641. return self;
  2642. fail:
  2643. return Qnil;
  2644. }
  2645. SWIGINTERN VALUE _wrap_new_ESLconnection(int nargs, VALUE *args, VALUE self) {
  2646. int argc;
  2647. VALUE argv[4];
  2648. int ii;
  2649. argc = nargs;
  2650. if (argc > 4) SWIG_fail;
  2651. for (ii = 0; (ii < argc); ++ii) {
  2652. argv[ii] = args[ii];
  2653. }
  2654. if (argc == 1) {
  2655. int _v;
  2656. {
  2657. int res = SWIG_AsVal_int(argv[0], NULL);
  2658. _v = SWIG_CheckState(res);
  2659. }
  2660. if (_v) {
  2661. return _wrap_new_ESLconnection__SWIG_4(nargs, args, self);
  2662. }
  2663. }
  2664. if (argc == 3) {
  2665. int _v;
  2666. int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
  2667. _v = SWIG_CheckState(res);
  2668. if (_v) {
  2669. {
  2670. int res = SWIG_AsVal_int(argv[1], NULL);
  2671. _v = SWIG_CheckState(res);
  2672. }
  2673. if (_v) {
  2674. int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
  2675. _v = SWIG_CheckState(res);
  2676. if (_v) {
  2677. return _wrap_new_ESLconnection__SWIG_1(nargs, args, self);
  2678. }
  2679. }
  2680. }
  2681. }
  2682. if (argc == 3) {
  2683. int _v;
  2684. int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
  2685. _v = SWIG_CheckState(res);
  2686. if (_v) {
  2687. int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
  2688. _v = SWIG_CheckState(res);
  2689. if (_v) {
  2690. int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
  2691. _v = SWIG_CheckState(res);
  2692. if (_v) {
  2693. return _wrap_new_ESLconnection__SWIG_3(nargs, args, self);
  2694. }
  2695. }
  2696. }
  2697. }
  2698. if (argc == 4) {
  2699. int _v;
  2700. int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
  2701. _v = SWIG_CheckState(res);
  2702. if (_v) {
  2703. {
  2704. int res = SWIG_AsVal_int(argv[1], NULL);
  2705. _v = SWIG_CheckState(res);
  2706. }
  2707. if (_v) {
  2708. int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
  2709. _v = SWIG_CheckState(res);
  2710. if (_v) {
  2711. int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
  2712. _v = SWIG_CheckState(res);
  2713. if (_v) {
  2714. return _wrap_new_ESLconnection__SWIG_0(nargs, args, self);
  2715. }
  2716. }
  2717. }
  2718. }
  2719. }
  2720. if (argc == 4) {
  2721. int _v;
  2722. int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
  2723. _v = SWIG_CheckState(res);
  2724. if (_v) {
  2725. int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
  2726. _v = SWIG_CheckState(res);
  2727. if (_v) {
  2728. int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
  2729. _v = SWIG_CheckState(res);
  2730. if (_v) {
  2731. int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
  2732. _v = SWIG_CheckState(res);
  2733. if (_v) {
  2734. return _wrap_new_ESLconnection__SWIG_2(nargs, args, self);
  2735. }
  2736. }
  2737. }
  2738. }
  2739. }
  2740. fail:
  2741. Ruby_Format_OverloadedError( argc, 4, "ESLconnection.new",
  2742. " ESLconnection.new(char const *host, int const port, char const *user, char const *password)\n"
  2743. " ESLconnection.new(char const *host, int const port, char const *password)\n"
  2744. " ESLconnection.new(char const *host, char const *port, char const *user, char const *password)\n"
  2745. " ESLconnection.new(char const *host, char const *port, char const *password)\n"
  2746. " ESLconnection.new(int socket)\n");
  2747. return Qnil;
  2748. }
  2749. SWIGINTERN void
  2750. free_ESLconnection(ESLconnection *arg1) {
  2751. delete arg1;
  2752. }
  2753. SWIGINTERN VALUE
  2754. _wrap_ESLconnection_socketDescriptor(int argc, VALUE *argv, VALUE self) {
  2755. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2756. void *argp1 = 0 ;
  2757. int res1 = 0 ;
  2758. int result;
  2759. VALUE vresult = Qnil;
  2760. if ((argc < 0) || (argc > 0)) {
  2761. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2762. }
  2763. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2764. if (!SWIG_IsOK(res1)) {
  2765. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","socketDescriptor", 1, self ));
  2766. }
  2767. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  2768. result = (int)(arg1)->socketDescriptor();
  2769. vresult = SWIG_From_int(static_cast< int >(result));
  2770. return vresult;
  2771. fail:
  2772. return Qnil;
  2773. }
  2774. SWIGINTERN VALUE
  2775. _wrap_ESLconnection_connected(int argc, VALUE *argv, VALUE self) {
  2776. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2777. void *argp1 = 0 ;
  2778. int res1 = 0 ;
  2779. int result;
  2780. VALUE vresult = Qnil;
  2781. if ((argc < 0) || (argc > 0)) {
  2782. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2783. }
  2784. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2785. if (!SWIG_IsOK(res1)) {
  2786. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","connected", 1, self ));
  2787. }
  2788. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  2789. result = (int)(arg1)->connected();
  2790. vresult = SWIG_From_int(static_cast< int >(result));
  2791. return vresult;
  2792. fail:
  2793. return Qnil;
  2794. }
  2795. SWIGINTERN VALUE
  2796. _wrap_ESLconnection_getInfo(int argc, VALUE *argv, VALUE self) {
  2797. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2798. void *argp1 = 0 ;
  2799. int res1 = 0 ;
  2800. ESLevent *result = 0 ;
  2801. VALUE vresult = Qnil;
  2802. if ((argc < 0) || (argc > 0)) {
  2803. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  2804. }
  2805. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2806. if (!SWIG_IsOK(res1)) {
  2807. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","getInfo", 1, self ));
  2808. }
  2809. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  2810. result = (ESLevent *)(arg1)->getInfo();
  2811. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  2812. return vresult;
  2813. fail:
  2814. return Qnil;
  2815. }
  2816. SWIGINTERN VALUE
  2817. _wrap_ESLconnection_send(int argc, VALUE *argv, VALUE self) {
  2818. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2819. char *arg2 = (char *) 0 ;
  2820. void *argp1 = 0 ;
  2821. int res1 = 0 ;
  2822. int res2 ;
  2823. char *buf2 = 0 ;
  2824. int alloc2 = 0 ;
  2825. int result;
  2826. VALUE vresult = Qnil;
  2827. if ((argc < 1) || (argc > 1)) {
  2828. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2829. }
  2830. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2831. if (!SWIG_IsOK(res1)) {
  2832. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","send", 1, self ));
  2833. }
  2834. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  2835. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2836. if (!SWIG_IsOK(res2)) {
  2837. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","send", 2, argv[0] ));
  2838. }
  2839. arg2 = reinterpret_cast< char * >(buf2);
  2840. result = (int)(arg1)->send((char const *)arg2);
  2841. vresult = SWIG_From_int(static_cast< int >(result));
  2842. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2843. return vresult;
  2844. fail:
  2845. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2846. return Qnil;
  2847. }
  2848. SWIGINTERN VALUE
  2849. _wrap_ESLconnection_sendRecv(int argc, VALUE *argv, VALUE self) {
  2850. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2851. char *arg2 = (char *) 0 ;
  2852. void *argp1 = 0 ;
  2853. int res1 = 0 ;
  2854. int res2 ;
  2855. char *buf2 = 0 ;
  2856. int alloc2 = 0 ;
  2857. ESLevent *result = 0 ;
  2858. VALUE vresult = Qnil;
  2859. if ((argc < 1) || (argc > 1)) {
  2860. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2861. }
  2862. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2863. if (!SWIG_IsOK(res1)) {
  2864. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","sendRecv", 1, self ));
  2865. }
  2866. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  2867. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2868. if (!SWIG_IsOK(res2)) {
  2869. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","sendRecv", 2, argv[0] ));
  2870. }
  2871. arg2 = reinterpret_cast< char * >(buf2);
  2872. result = (ESLevent *)(arg1)->sendRecv((char const *)arg2);
  2873. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  2874. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2875. return vresult;
  2876. fail:
  2877. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2878. return Qnil;
  2879. }
  2880. SWIGINTERN VALUE
  2881. _wrap_ESLconnection_api(int argc, VALUE *argv, VALUE self) {
  2882. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2883. char *arg2 = (char *) 0 ;
  2884. char *arg3 = (char *) NULL ;
  2885. void *argp1 = 0 ;
  2886. int res1 = 0 ;
  2887. int res2 ;
  2888. char *buf2 = 0 ;
  2889. int alloc2 = 0 ;
  2890. int res3 ;
  2891. char *buf3 = 0 ;
  2892. int alloc3 = 0 ;
  2893. ESLevent *result = 0 ;
  2894. VALUE vresult = Qnil;
  2895. if ((argc < 1) || (argc > 2)) {
  2896. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2897. }
  2898. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2899. if (!SWIG_IsOK(res1)) {
  2900. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","api", 1, self ));
  2901. }
  2902. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  2903. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2904. if (!SWIG_IsOK(res2)) {
  2905. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","api", 2, argv[0] ));
  2906. }
  2907. arg2 = reinterpret_cast< char * >(buf2);
  2908. if (argc > 1) {
  2909. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  2910. if (!SWIG_IsOK(res3)) {
  2911. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","api", 3, argv[1] ));
  2912. }
  2913. arg3 = reinterpret_cast< char * >(buf3);
  2914. }
  2915. result = (ESLevent *)(arg1)->api((char const *)arg2,(char const *)arg3);
  2916. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  2917. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2918. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2919. return vresult;
  2920. fail:
  2921. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2922. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2923. return Qnil;
  2924. }
  2925. SWIGINTERN VALUE
  2926. _wrap_ESLconnection_bgapi(int argc, VALUE *argv, VALUE self) {
  2927. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2928. char *arg2 = (char *) 0 ;
  2929. char *arg3 = (char *) NULL ;
  2930. char *arg4 = (char *) NULL ;
  2931. void *argp1 = 0 ;
  2932. int res1 = 0 ;
  2933. int res2 ;
  2934. char *buf2 = 0 ;
  2935. int alloc2 = 0 ;
  2936. int res3 ;
  2937. char *buf3 = 0 ;
  2938. int alloc3 = 0 ;
  2939. int res4 ;
  2940. char *buf4 = 0 ;
  2941. int alloc4 = 0 ;
  2942. ESLevent *result = 0 ;
  2943. VALUE vresult = Qnil;
  2944. if ((argc < 1) || (argc > 3)) {
  2945. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2946. }
  2947. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2948. if (!SWIG_IsOK(res1)) {
  2949. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","bgapi", 1, self ));
  2950. }
  2951. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  2952. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  2953. if (!SWIG_IsOK(res2)) {
  2954. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","bgapi", 2, argv[0] ));
  2955. }
  2956. arg2 = reinterpret_cast< char * >(buf2);
  2957. if (argc > 1) {
  2958. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  2959. if (!SWIG_IsOK(res3)) {
  2960. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","bgapi", 3, argv[1] ));
  2961. }
  2962. arg3 = reinterpret_cast< char * >(buf3);
  2963. }
  2964. if (argc > 2) {
  2965. res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  2966. if (!SWIG_IsOK(res4)) {
  2967. SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","bgapi", 4, argv[2] ));
  2968. }
  2969. arg4 = reinterpret_cast< char * >(buf4);
  2970. }
  2971. result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
  2972. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  2973. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2974. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2975. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  2976. return vresult;
  2977. fail:
  2978. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  2979. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  2980. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  2981. return Qnil;
  2982. }
  2983. SWIGINTERN VALUE
  2984. _wrap_ESLconnection_sendEvent(int argc, VALUE *argv, VALUE self) {
  2985. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2986. ESLevent *arg2 = (ESLevent *) 0 ;
  2987. void *argp1 = 0 ;
  2988. int res1 = 0 ;
  2989. void *argp2 = 0 ;
  2990. int res2 = 0 ;
  2991. ESLevent *result = 0 ;
  2992. VALUE vresult = Qnil;
  2993. if ((argc < 1) || (argc > 1)) {
  2994. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  2995. }
  2996. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  2997. if (!SWIG_IsOK(res1)) {
  2998. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","sendEvent", 1, self ));
  2999. }
  3000. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3001. res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_ESLevent, 0 | 0 );
  3002. if (!SWIG_IsOK(res2)) {
  3003. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "ESLevent *","sendEvent", 2, argv[0] ));
  3004. }
  3005. arg2 = reinterpret_cast< ESLevent * >(argp2);
  3006. result = (ESLevent *)(arg1)->sendEvent(arg2);
  3007. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  3008. return vresult;
  3009. fail:
  3010. return Qnil;
  3011. }
  3012. SWIGINTERN VALUE
  3013. _wrap_ESLconnection_sendMSG(int argc, VALUE *argv, VALUE self) {
  3014. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3015. ESLevent *arg2 = (ESLevent *) 0 ;
  3016. char *arg3 = (char *) NULL ;
  3017. void *argp1 = 0 ;
  3018. int res1 = 0 ;
  3019. void *argp2 = 0 ;
  3020. int res2 = 0 ;
  3021. int res3 ;
  3022. char *buf3 = 0 ;
  3023. int alloc3 = 0 ;
  3024. int result;
  3025. VALUE vresult = Qnil;
  3026. if ((argc < 1) || (argc > 2)) {
  3027. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  3028. }
  3029. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3030. if (!SWIG_IsOK(res1)) {
  3031. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","sendMSG", 1, self ));
  3032. }
  3033. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3034. res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_ESLevent, 0 | 0 );
  3035. if (!SWIG_IsOK(res2)) {
  3036. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "ESLevent *","sendMSG", 2, argv[0] ));
  3037. }
  3038. arg2 = reinterpret_cast< ESLevent * >(argp2);
  3039. if (argc > 1) {
  3040. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  3041. if (!SWIG_IsOK(res3)) {
  3042. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","sendMSG", 3, argv[1] ));
  3043. }
  3044. arg3 = reinterpret_cast< char * >(buf3);
  3045. }
  3046. result = (int)(arg1)->sendMSG(arg2,(char const *)arg3);
  3047. vresult = SWIG_From_int(static_cast< int >(result));
  3048. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3049. return vresult;
  3050. fail:
  3051. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3052. return Qnil;
  3053. }
  3054. SWIGINTERN VALUE
  3055. _wrap_ESLconnection_recvEvent(int argc, VALUE *argv, VALUE self) {
  3056. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3057. void *argp1 = 0 ;
  3058. int res1 = 0 ;
  3059. ESLevent *result = 0 ;
  3060. VALUE vresult = Qnil;
  3061. if ((argc < 0) || (argc > 0)) {
  3062. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  3063. }
  3064. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3065. if (!SWIG_IsOK(res1)) {
  3066. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","recvEvent", 1, self ));
  3067. }
  3068. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3069. result = (ESLevent *)(arg1)->recvEvent();
  3070. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  3071. return vresult;
  3072. fail:
  3073. return Qnil;
  3074. }
  3075. SWIGINTERN VALUE
  3076. _wrap_ESLconnection_recvEventTimed(int argc, VALUE *argv, VALUE self) {
  3077. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3078. int arg2 ;
  3079. void *argp1 = 0 ;
  3080. int res1 = 0 ;
  3081. int val2 ;
  3082. int ecode2 = 0 ;
  3083. ESLevent *result = 0 ;
  3084. VALUE vresult = Qnil;
  3085. if ((argc < 1) || (argc > 1)) {
  3086. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  3087. }
  3088. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3089. if (!SWIG_IsOK(res1)) {
  3090. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","recvEventTimed", 1, self ));
  3091. }
  3092. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3093. ecode2 = SWIG_AsVal_int(argv[0], &val2);
  3094. if (!SWIG_IsOK(ecode2)) {
  3095. SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","recvEventTimed", 2, argv[0] ));
  3096. }
  3097. arg2 = static_cast< int >(val2);
  3098. result = (ESLevent *)(arg1)->recvEventTimed(arg2);
  3099. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  3100. return vresult;
  3101. fail:
  3102. return Qnil;
  3103. }
  3104. SWIGINTERN VALUE
  3105. _wrap_ESLconnection_filter(int argc, VALUE *argv, VALUE self) {
  3106. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3107. char *arg2 = (char *) 0 ;
  3108. char *arg3 = (char *) 0 ;
  3109. void *argp1 = 0 ;
  3110. int res1 = 0 ;
  3111. int res2 ;
  3112. char *buf2 = 0 ;
  3113. int alloc2 = 0 ;
  3114. int res3 ;
  3115. char *buf3 = 0 ;
  3116. int alloc3 = 0 ;
  3117. ESLevent *result = 0 ;
  3118. VALUE vresult = Qnil;
  3119. if ((argc < 2) || (argc > 2)) {
  3120. rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  3121. }
  3122. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3123. if (!SWIG_IsOK(res1)) {
  3124. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","filter", 1, self ));
  3125. }
  3126. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3127. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  3128. if (!SWIG_IsOK(res2)) {
  3129. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","filter", 2, argv[0] ));
  3130. }
  3131. arg2 = reinterpret_cast< char * >(buf2);
  3132. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  3133. if (!SWIG_IsOK(res3)) {
  3134. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","filter", 3, argv[1] ));
  3135. }
  3136. arg3 = reinterpret_cast< char * >(buf3);
  3137. result = (ESLevent *)(arg1)->filter((char const *)arg2,(char const *)arg3);
  3138. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  3139. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3140. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3141. return vresult;
  3142. fail:
  3143. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3144. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3145. return Qnil;
  3146. }
  3147. SWIGINTERN VALUE
  3148. _wrap_ESLconnection_events(int argc, VALUE *argv, VALUE self) {
  3149. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3150. char *arg2 = (char *) 0 ;
  3151. char *arg3 = (char *) 0 ;
  3152. void *argp1 = 0 ;
  3153. int res1 = 0 ;
  3154. int res2 ;
  3155. char *buf2 = 0 ;
  3156. int alloc2 = 0 ;
  3157. int res3 ;
  3158. char *buf3 = 0 ;
  3159. int alloc3 = 0 ;
  3160. int result;
  3161. VALUE vresult = Qnil;
  3162. if ((argc < 2) || (argc > 2)) {
  3163. rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  3164. }
  3165. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3166. if (!SWIG_IsOK(res1)) {
  3167. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","events", 1, self ));
  3168. }
  3169. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3170. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  3171. if (!SWIG_IsOK(res2)) {
  3172. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","events", 2, argv[0] ));
  3173. }
  3174. arg2 = reinterpret_cast< char * >(buf2);
  3175. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  3176. if (!SWIG_IsOK(res3)) {
  3177. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","events", 3, argv[1] ));
  3178. }
  3179. arg3 = reinterpret_cast< char * >(buf3);
  3180. result = (int)(arg1)->events((char const *)arg2,(char const *)arg3);
  3181. vresult = SWIG_From_int(static_cast< int >(result));
  3182. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3183. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3184. return vresult;
  3185. fail:
  3186. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3187. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3188. return Qnil;
  3189. }
  3190. SWIGINTERN VALUE
  3191. _wrap_ESLconnection_execute(int argc, VALUE *argv, VALUE self) {
  3192. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3193. char *arg2 = (char *) 0 ;
  3194. char *arg3 = (char *) NULL ;
  3195. char *arg4 = (char *) NULL ;
  3196. void *argp1 = 0 ;
  3197. int res1 = 0 ;
  3198. int res2 ;
  3199. char *buf2 = 0 ;
  3200. int alloc2 = 0 ;
  3201. int res3 ;
  3202. char *buf3 = 0 ;
  3203. int alloc3 = 0 ;
  3204. int res4 ;
  3205. char *buf4 = 0 ;
  3206. int alloc4 = 0 ;
  3207. ESLevent *result = 0 ;
  3208. VALUE vresult = Qnil;
  3209. if ((argc < 1) || (argc > 3)) {
  3210. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  3211. }
  3212. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3213. if (!SWIG_IsOK(res1)) {
  3214. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","execute", 1, self ));
  3215. }
  3216. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3217. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  3218. if (!SWIG_IsOK(res2)) {
  3219. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","execute", 2, argv[0] ));
  3220. }
  3221. arg2 = reinterpret_cast< char * >(buf2);
  3222. if (argc > 1) {
  3223. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  3224. if (!SWIG_IsOK(res3)) {
  3225. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","execute", 3, argv[1] ));
  3226. }
  3227. arg3 = reinterpret_cast< char * >(buf3);
  3228. }
  3229. if (argc > 2) {
  3230. res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  3231. if (!SWIG_IsOK(res4)) {
  3232. SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","execute", 4, argv[2] ));
  3233. }
  3234. arg4 = reinterpret_cast< char * >(buf4);
  3235. }
  3236. result = (ESLevent *)(arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
  3237. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  3238. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3239. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3240. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  3241. return vresult;
  3242. fail:
  3243. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3244. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3245. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  3246. return Qnil;
  3247. }
  3248. SWIGINTERN VALUE
  3249. _wrap_ESLconnection_executeAsync(int argc, VALUE *argv, VALUE self) {
  3250. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3251. char *arg2 = (char *) 0 ;
  3252. char *arg3 = (char *) NULL ;
  3253. char *arg4 = (char *) NULL ;
  3254. void *argp1 = 0 ;
  3255. int res1 = 0 ;
  3256. int res2 ;
  3257. char *buf2 = 0 ;
  3258. int alloc2 = 0 ;
  3259. int res3 ;
  3260. char *buf3 = 0 ;
  3261. int alloc3 = 0 ;
  3262. int res4 ;
  3263. char *buf4 = 0 ;
  3264. int alloc4 = 0 ;
  3265. ESLevent *result = 0 ;
  3266. VALUE vresult = Qnil;
  3267. if ((argc < 1) || (argc > 3)) {
  3268. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  3269. }
  3270. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3271. if (!SWIG_IsOK(res1)) {
  3272. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","executeAsync", 1, self ));
  3273. }
  3274. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3275. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  3276. if (!SWIG_IsOK(res2)) {
  3277. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","executeAsync", 2, argv[0] ));
  3278. }
  3279. arg2 = reinterpret_cast< char * >(buf2);
  3280. if (argc > 1) {
  3281. res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  3282. if (!SWIG_IsOK(res3)) {
  3283. SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","executeAsync", 3, argv[1] ));
  3284. }
  3285. arg3 = reinterpret_cast< char * >(buf3);
  3286. }
  3287. if (argc > 2) {
  3288. res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  3289. if (!SWIG_IsOK(res4)) {
  3290. SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","executeAsync", 4, argv[2] ));
  3291. }
  3292. arg4 = reinterpret_cast< char * >(buf4);
  3293. }
  3294. result = (ESLevent *)(arg1)->executeAsync((char const *)arg2,(char const *)arg3,(char const *)arg4);
  3295. vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
  3296. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3297. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3298. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  3299. return vresult;
  3300. fail:
  3301. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3302. if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  3303. if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  3304. return Qnil;
  3305. }
  3306. SWIGINTERN VALUE
  3307. _wrap_ESLconnection_setAsyncExecute(int argc, VALUE *argv, VALUE self) {
  3308. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3309. char *arg2 = (char *) 0 ;
  3310. void *argp1 = 0 ;
  3311. int res1 = 0 ;
  3312. int res2 ;
  3313. char *buf2 = 0 ;
  3314. int alloc2 = 0 ;
  3315. int result;
  3316. VALUE vresult = Qnil;
  3317. if ((argc < 1) || (argc > 1)) {
  3318. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  3319. }
  3320. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3321. if (!SWIG_IsOK(res1)) {
  3322. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","setAsyncExecute", 1, self ));
  3323. }
  3324. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3325. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  3326. if (!SWIG_IsOK(res2)) {
  3327. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setAsyncExecute", 2, argv[0] ));
  3328. }
  3329. arg2 = reinterpret_cast< char * >(buf2);
  3330. result = (int)(arg1)->setAsyncExecute((char const *)arg2);
  3331. vresult = SWIG_From_int(static_cast< int >(result));
  3332. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3333. return vresult;
  3334. fail:
  3335. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3336. return Qnil;
  3337. }
  3338. SWIGINTERN VALUE
  3339. _wrap_ESLconnection_setEventLock(int argc, VALUE *argv, VALUE self) {
  3340. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3341. char *arg2 = (char *) 0 ;
  3342. void *argp1 = 0 ;
  3343. int res1 = 0 ;
  3344. int res2 ;
  3345. char *buf2 = 0 ;
  3346. int alloc2 = 0 ;
  3347. int result;
  3348. VALUE vresult = Qnil;
  3349. if ((argc < 1) || (argc > 1)) {
  3350. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  3351. }
  3352. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3353. if (!SWIG_IsOK(res1)) {
  3354. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","setEventLock", 1, self ));
  3355. }
  3356. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3357. res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  3358. if (!SWIG_IsOK(res2)) {
  3359. SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setEventLock", 2, argv[0] ));
  3360. }
  3361. arg2 = reinterpret_cast< char * >(buf2);
  3362. result = (int)(arg1)->setEventLock((char const *)arg2);
  3363. vresult = SWIG_From_int(static_cast< int >(result));
  3364. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3365. return vresult;
  3366. fail:
  3367. if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  3368. return Qnil;
  3369. }
  3370. SWIGINTERN VALUE
  3371. _wrap_ESLconnection_disconnect(int argc, VALUE *argv, VALUE self) {
  3372. ESLconnection *arg1 = (ESLconnection *) 0 ;
  3373. void *argp1 = 0 ;
  3374. int res1 = 0 ;
  3375. int result;
  3376. VALUE vresult = Qnil;
  3377. if ((argc < 0) || (argc > 0)) {
  3378. rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  3379. }
  3380. res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
  3381. if (!SWIG_IsOK(res1)) {
  3382. SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","disconnect", 1, self ));
  3383. }
  3384. arg1 = reinterpret_cast< ESLconnection * >(argp1);
  3385. result = (int)(arg1)->disconnect();
  3386. vresult = SWIG_From_int(static_cast< int >(result));
  3387. return vresult;
  3388. fail:
  3389. return Qnil;
  3390. }
  3391. SWIGINTERN VALUE
  3392. _wrap_eslSetLogLevel(int argc, VALUE *argv, VALUE self) {
  3393. int arg1 ;
  3394. int val1 ;
  3395. int ecode1 = 0 ;
  3396. if ((argc < 1) || (argc > 1)) {
  3397. rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  3398. }
  3399. ecode1 = SWIG_AsVal_int(argv[0], &val1);
  3400. if (!SWIG_IsOK(ecode1)) {
  3401. SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","eslSetLogLevel", 1, argv[0] ));
  3402. }
  3403. arg1 = static_cast< int >(val1);
  3404. eslSetLogLevel(arg1);
  3405. return Qnil;
  3406. fail:
  3407. return Qnil;
  3408. }
  3409. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
  3410. static swig_type_info _swigt__p_ESLconnection = {"_p_ESLconnection", "ESLconnection *", 0, 0, (void*)0, 0};
  3411. static swig_type_info _swigt__p_ESLevent = {"_p_ESLevent", "ESLevent *", 0, 0, (void*)0, 0};
  3412. static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
  3413. static swig_type_info _swigt__p_esl_event_t = {"_p_esl_event_t", "esl_event_t *", 0, 0, (void*)0, 0};
  3414. static swig_type_info _swigt__p_esl_priority_t = {"_p_esl_priority_t", "esl_priority_t *", 0, 0, (void*)0, 0};
  3415. static swig_type_info *swig_type_initial[] = {
  3416. &_swigt__p_ESLconnection,
  3417. &_swigt__p_ESLevent,
  3418. &_swigt__p_char,
  3419. &_swigt__p_esl_event_t,
  3420. &_swigt__p_esl_priority_t,
  3421. };
  3422. static swig_cast_info _swigc__p_ESLconnection[] = { {&_swigt__p_ESLconnection, 0, 0, 0},{0, 0, 0, 0}};
  3423. static swig_cast_info _swigc__p_ESLevent[] = { {&_swigt__p_ESLevent, 0, 0, 0},{0, 0, 0, 0}};
  3424. static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
  3425. static swig_cast_info _swigc__p_esl_event_t[] = { {&_swigt__p_esl_event_t, 0, 0, 0},{0, 0, 0, 0}};
  3426. static swig_cast_info _swigc__p_esl_priority_t[] = { {&_swigt__p_esl_priority_t, 0, 0, 0},{0, 0, 0, 0}};
  3427. static swig_cast_info *swig_cast_initial[] = {
  3428. _swigc__p_ESLconnection,
  3429. _swigc__p_ESLevent,
  3430. _swigc__p_char,
  3431. _swigc__p_esl_event_t,
  3432. _swigc__p_esl_priority_t,
  3433. };
  3434. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
  3435. /* -----------------------------------------------------------------------------
  3436. * Type initialization:
  3437. * This problem is tough by the requirement that no dynamic
  3438. * memory is used. Also, since swig_type_info structures store pointers to
  3439. * swig_cast_info structures and swig_cast_info structures store pointers back
  3440. * to swig_type_info structures, we need some lookup code at initialization.
  3441. * The idea is that swig generates all the structures that are needed.
  3442. * The runtime then collects these partially filled structures.
  3443. * The SWIG_InitializeModule function takes these initial arrays out of
  3444. * swig_module, and does all the lookup, filling in the swig_module.types
  3445. * array with the correct data and linking the correct swig_cast_info
  3446. * structures together.
  3447. *
  3448. * The generated swig_type_info structures are assigned statically to an initial
  3449. * array. We just loop through that array, and handle each type individually.
  3450. * First we lookup if this type has been already loaded, and if so, use the
  3451. * loaded structure instead of the generated one. Then we have to fill in the
  3452. * cast linked list. The cast data is initially stored in something like a
  3453. * two-dimensional array. Each row corresponds to a type (there are the same
  3454. * number of rows as there are in the swig_type_initial array). Each entry in
  3455. * a column is one of the swig_cast_info structures for that type.
  3456. * The cast_initial array is actually an array of arrays, because each row has
  3457. * a variable number of columns. So to actually build the cast linked list,
  3458. * we find the array of casts associated with the type, and loop through it
  3459. * adding the casts to the list. The one last trick we need to do is making
  3460. * sure the type pointer in the swig_cast_info struct is correct.
  3461. *
  3462. * First off, we lookup the cast->type name to see if it is already loaded.
  3463. * There are three cases to handle:
  3464. * 1) If the cast->type has already been loaded AND the type we are adding
  3465. * casting info to has not been loaded (it is in this module), THEN we
  3466. * replace the cast->type pointer with the type pointer that has already
  3467. * been loaded.
  3468. * 2) If BOTH types (the one we are adding casting info to, and the
  3469. * cast->type) are loaded, THEN the cast info has already been loaded by
  3470. * the previous module so we just ignore it.
  3471. * 3) Finally, if cast->type has not already been loaded, then we add that
  3472. * swig_cast_info to the linked list (because the cast->type) pointer will
  3473. * be correct.
  3474. * ----------------------------------------------------------------------------- */
  3475. #ifdef __cplusplus
  3476. extern "C" {
  3477. #if 0
  3478. } /* c-mode */
  3479. #endif
  3480. #endif
  3481. #if 0
  3482. #define SWIGRUNTIME_DEBUG
  3483. #endif
  3484. SWIGRUNTIME void
  3485. SWIG_InitializeModule(void *clientdata) {
  3486. size_t i;
  3487. swig_module_info *module_head, *iter;
  3488. int found, init;
  3489. /* check to see if the circular list has been setup, if not, set it up */
  3490. if (swig_module.next==0) {
  3491. /* Initialize the swig_module */
  3492. swig_module.type_initial = swig_type_initial;
  3493. swig_module.cast_initial = swig_cast_initial;
  3494. swig_module.next = &swig_module;
  3495. init = 1;
  3496. } else {
  3497. init = 0;
  3498. }
  3499. /* Try and load any already created modules */
  3500. module_head = SWIG_GetModule(clientdata);
  3501. if (!module_head) {
  3502. /* This is the first module loaded for this interpreter */
  3503. /* so set the swig module into the interpreter */
  3504. SWIG_SetModule(clientdata, &swig_module);
  3505. module_head = &swig_module;
  3506. } else {
  3507. /* the interpreter has loaded a SWIG module, but has it loaded this one? */
  3508. found=0;
  3509. iter=module_head;
  3510. do {
  3511. if (iter==&swig_module) {
  3512. found=1;
  3513. break;
  3514. }
  3515. iter=iter->next;
  3516. } while (iter!= module_head);
  3517. /* if the is found in the list, then all is done and we may leave */
  3518. if (found) return;
  3519. /* otherwise we must add out module into the list */
  3520. swig_module.next = module_head->next;
  3521. module_head->next = &swig_module;
  3522. }
  3523. /* When multiple interpreters are used, a module could have already been initialized in
  3524. a different interpreter, but not yet have a pointer in this interpreter.
  3525. In this case, we do not want to continue adding types... everything should be
  3526. set up already */
  3527. if (init == 0) return;
  3528. /* Now work on filling in swig_module.types */
  3529. #ifdef SWIGRUNTIME_DEBUG
  3530. printf("SWIG_InitializeModule: size %d\n", swig_module.size);
  3531. #endif
  3532. for (i = 0; i < swig_module.size; ++i) {
  3533. swig_type_info *type = 0;
  3534. swig_type_info *ret;
  3535. swig_cast_info *cast;
  3536. #ifdef SWIGRUNTIME_DEBUG
  3537. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  3538. #endif
  3539. /* if there is another module already loaded */
  3540. if (swig_module.next != &swig_module) {
  3541. type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
  3542. }
  3543. if (type) {
  3544. /* Overwrite clientdata field */
  3545. #ifdef SWIGRUNTIME_DEBUG
  3546. printf("SWIG_InitializeModule: found type %s\n", type->name);
  3547. #endif
  3548. if (swig_module.type_initial[i]->clientdata) {
  3549. type->clientdata = swig_module.type_initial[i]->clientdata;
  3550. #ifdef SWIGRUNTIME_DEBUG
  3551. printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
  3552. #endif
  3553. }
  3554. } else {
  3555. type = swig_module.type_initial[i];
  3556. }
  3557. /* Insert casting types */
  3558. cast = swig_module.cast_initial[i];
  3559. while (cast->type) {
  3560. /* Don't need to add information already in the list */
  3561. ret = 0;
  3562. #ifdef SWIGRUNTIME_DEBUG
  3563. printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
  3564. #endif
  3565. if (swig_module.next != &swig_module) {
  3566. ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
  3567. #ifdef SWIGRUNTIME_DEBUG
  3568. if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
  3569. #endif
  3570. }
  3571. if (ret) {
  3572. if (type == swig_module.type_initial[i]) {
  3573. #ifdef SWIGRUNTIME_DEBUG
  3574. printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
  3575. #endif
  3576. cast->type = ret;
  3577. ret = 0;
  3578. } else {
  3579. /* Check for casting already in the list */
  3580. swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
  3581. #ifdef SWIGRUNTIME_DEBUG
  3582. if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
  3583. #endif
  3584. if (!ocast) ret = 0;
  3585. }
  3586. }
  3587. if (!ret) {
  3588. #ifdef SWIGRUNTIME_DEBUG
  3589. printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
  3590. #endif
  3591. if (type->cast) {
  3592. type->cast->prev = cast;
  3593. cast->next = type->cast;
  3594. }
  3595. type->cast = cast;
  3596. }
  3597. cast++;
  3598. }
  3599. /* Set entry in modules->types array equal to the type */
  3600. swig_module.types[i] = type;
  3601. }
  3602. swig_module.types[i] = 0;
  3603. #ifdef SWIGRUNTIME_DEBUG
  3604. printf("**** SWIG_InitializeModule: Cast List ******\n");
  3605. for (i = 0; i < swig_module.size; ++i) {
  3606. int j = 0;
  3607. swig_cast_info *cast = swig_module.cast_initial[i];
  3608. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  3609. while (cast->type) {
  3610. printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
  3611. cast++;
  3612. ++j;
  3613. }
  3614. printf("---- Total casts: %d\n",j);
  3615. }
  3616. printf("**** SWIG_InitializeModule: Cast List ******\n");
  3617. #endif
  3618. }
  3619. /* This function will propagate the clientdata field of type to
  3620. * any new swig_type_info structures that have been added into the list
  3621. * of equivalent types. It is like calling
  3622. * SWIG_TypeClientData(type, clientdata) a second time.
  3623. */
  3624. SWIGRUNTIME void
  3625. SWIG_PropagateClientData(void) {
  3626. size_t i;
  3627. swig_cast_info *equiv;
  3628. static int init_run = 0;
  3629. if (init_run) return;
  3630. init_run = 1;
  3631. for (i = 0; i < swig_module.size; i++) {
  3632. if (swig_module.types[i]->clientdata) {
  3633. equiv = swig_module.types[i]->cast;
  3634. while (equiv) {
  3635. if (!equiv->converter) {
  3636. if (equiv->type && !equiv->type->clientdata)
  3637. SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
  3638. }
  3639. equiv = equiv->next;
  3640. }
  3641. }
  3642. }
  3643. }
  3644. #ifdef __cplusplus
  3645. #if 0
  3646. { /* c-mode */
  3647. #endif
  3648. }
  3649. #endif
  3650. /*
  3651. */
  3652. #ifdef __cplusplus
  3653. extern "C"
  3654. #endif
  3655. SWIGEXPORT void Init_ESL(void) {
  3656. size_t i;
  3657. SWIG_InitRuntime();
  3658. mESL = rb_define_module("ESL");
  3659. SWIG_InitializeModule(0);
  3660. for (i = 0; i < swig_module.size; i++) {
  3661. SWIG_define_class(swig_module.types[i]);
  3662. }
  3663. SWIG_RubyInitializeTrackings();
  3664. SwigClassESLevent.klass = rb_define_class_under(mESL, "ESLevent", rb_cObject);
  3665. SWIG_TypeClientData(SWIGTYPE_p_ESLevent, (void *) &SwigClassESLevent);
  3666. rb_define_alloc_func(SwigClassESLevent.klass, _wrap_ESLevent_allocate);
  3667. rb_define_method(SwigClassESLevent.klass, "initialize", VALUEFUNC(_wrap_new_ESLevent), -1);
  3668. rb_define_method(SwigClassESLevent.klass, "event=", VALUEFUNC(_wrap_ESLevent_event_set), -1);
  3669. rb_define_method(SwigClassESLevent.klass, "event", VALUEFUNC(_wrap_ESLevent_event_get), -1);
  3670. rb_define_method(SwigClassESLevent.klass, "serialized_string=", VALUEFUNC(_wrap_ESLevent_serialized_string_set), -1);
  3671. rb_define_method(SwigClassESLevent.klass, "serialized_string", VALUEFUNC(_wrap_ESLevent_serialized_string_get), -1);
  3672. rb_define_method(SwigClassESLevent.klass, "mine=", VALUEFUNC(_wrap_ESLevent_mine_set), -1);
  3673. rb_define_method(SwigClassESLevent.klass, "mine", VALUEFUNC(_wrap_ESLevent_mine_get), -1);
  3674. rb_define_method(SwigClassESLevent.klass, "serialize", VALUEFUNC(_wrap_ESLevent_serialize), -1);
  3675. rb_define_method(SwigClassESLevent.klass, "setPriority", VALUEFUNC(_wrap_ESLevent_setPriority), -1);
  3676. rb_define_method(SwigClassESLevent.klass, "getHeader", VALUEFUNC(_wrap_ESLevent_getHeader), -1);
  3677. rb_define_method(SwigClassESLevent.klass, "getBody", VALUEFUNC(_wrap_ESLevent_getBody), -1);
  3678. rb_define_method(SwigClassESLevent.klass, "getType", VALUEFUNC(_wrap_ESLevent_getType), -1);
  3679. rb_define_method(SwigClassESLevent.klass, "addBody", VALUEFUNC(_wrap_ESLevent_addBody), -1);
  3680. rb_define_method(SwigClassESLevent.klass, "addHeader", VALUEFUNC(_wrap_ESLevent_addHeader), -1);
  3681. rb_define_method(SwigClassESLevent.klass, "pushHeader", VALUEFUNC(_wrap_ESLevent_pushHeader), -1);
  3682. rb_define_method(SwigClassESLevent.klass, "unshiftHeader", VALUEFUNC(_wrap_ESLevent_unshiftHeader), -1);
  3683. rb_define_method(SwigClassESLevent.klass, "delHeader", VALUEFUNC(_wrap_ESLevent_delHeader), -1);
  3684. rb_define_method(SwigClassESLevent.klass, "firstHeader", VALUEFUNC(_wrap_ESLevent_firstHeader), -1);
  3685. rb_define_method(SwigClassESLevent.klass, "nextHeader", VALUEFUNC(_wrap_ESLevent_nextHeader), -1);
  3686. SwigClassESLevent.mark = 0;
  3687. SwigClassESLevent.destroy = (void (*)(void *)) free_ESLevent;
  3688. SwigClassESLevent.trackObjects = 0;
  3689. SwigClassESLconnection.klass = rb_define_class_under(mESL, "ESLconnection", rb_cObject);
  3690. SWIG_TypeClientData(SWIGTYPE_p_ESLconnection, (void *) &SwigClassESLconnection);
  3691. rb_define_alloc_func(SwigClassESLconnection.klass, _wrap_ESLconnection_allocate);
  3692. rb_define_method(SwigClassESLconnection.klass, "initialize", VALUEFUNC(_wrap_new_ESLconnection), -1);
  3693. rb_define_method(SwigClassESLconnection.klass, "socketDescriptor", VALUEFUNC(_wrap_ESLconnection_socketDescriptor), -1);
  3694. rb_define_method(SwigClassESLconnection.klass, "connected", VALUEFUNC(_wrap_ESLconnection_connected), -1);
  3695. rb_define_method(SwigClassESLconnection.klass, "getInfo", VALUEFUNC(_wrap_ESLconnection_getInfo), -1);
  3696. rb_define_method(SwigClassESLconnection.klass, "send", VALUEFUNC(_wrap_ESLconnection_send), -1);
  3697. rb_define_method(SwigClassESLconnection.klass, "sendRecv", VALUEFUNC(_wrap_ESLconnection_sendRecv), -1);
  3698. rb_define_method(SwigClassESLconnection.klass, "api", VALUEFUNC(_wrap_ESLconnection_api), -1);
  3699. rb_define_method(SwigClassESLconnection.klass, "bgapi", VALUEFUNC(_wrap_ESLconnection_bgapi), -1);
  3700. rb_define_method(SwigClassESLconnection.klass, "sendEvent", VALUEFUNC(_wrap_ESLconnection_sendEvent), -1);
  3701. rb_define_method(SwigClassESLconnection.klass, "sendMSG", VALUEFUNC(_wrap_ESLconnection_sendMSG), -1);
  3702. rb_define_method(SwigClassESLconnection.klass, "recvEvent", VALUEFUNC(_wrap_ESLconnection_recvEvent), -1);
  3703. rb_define_method(SwigClassESLconnection.klass, "recvEventTimed", VALUEFUNC(_wrap_ESLconnection_recvEventTimed), -1);
  3704. rb_define_method(SwigClassESLconnection.klass, "filter", VALUEFUNC(_wrap_ESLconnection_filter), -1);
  3705. rb_define_method(SwigClassESLconnection.klass, "events", VALUEFUNC(_wrap_ESLconnection_events), -1);
  3706. rb_define_method(SwigClassESLconnection.klass, "execute", VALUEFUNC(_wrap_ESLconnection_execute), -1);
  3707. rb_define_method(SwigClassESLconnection.klass, "executeAsync", VALUEFUNC(_wrap_ESLconnection_executeAsync), -1);
  3708. rb_define_method(SwigClassESLconnection.klass, "setAsyncExecute", VALUEFUNC(_wrap_ESLconnection_setAsyncExecute), -1);
  3709. rb_define_method(SwigClassESLconnection.klass, "setEventLock", VALUEFUNC(_wrap_ESLconnection_setEventLock), -1);
  3710. rb_define_method(SwigClassESLconnection.klass, "disconnect", VALUEFUNC(_wrap_ESLconnection_disconnect), -1);
  3711. SwigClassESLconnection.mark = 0;
  3712. SwigClassESLconnection.destroy = (void (*)(void *)) free_ESLconnection;
  3713. SwigClassESLconnection.trackObjects = 0;
  3714. rb_define_module_function(mESL, "eslSetLogLevel", VALUEFUNC(_wrap_eslSetLogLevel), -1);
  3715. }