esl_wrap.cpp 108 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.7
  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 SWIGLUA
  11. #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
  12. #define SWIG_LUA_MODULE_GLOBAL
  13. #ifdef __cplusplus
  14. /* SwigValueWrapper is described in swig.swg */
  15. template<typename T> class SwigValueWrapper {
  16. struct SwigMovePointer {
  17. T *ptr;
  18. SwigMovePointer(T *p) : ptr(p) { }
  19. ~SwigMovePointer() { delete ptr; }
  20. SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  21. } pointer;
  22. SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  23. SwigValueWrapper(const SwigValueWrapper<T>& rhs);
  24. public:
  25. SwigValueWrapper() : pointer(0) { }
  26. SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  27. operator T&() const { return *pointer.ptr; }
  28. T *operator&() { return pointer.ptr; }
  29. };
  30. template <typename T> T SwigValueInit() {
  31. return T();
  32. }
  33. #endif
  34. /* -----------------------------------------------------------------------------
  35. * This section contains generic SWIG labels for method/variable
  36. * declarations/attributes, and other compiler dependent labels.
  37. * ----------------------------------------------------------------------------- */
  38. /* template workaround for compilers that cannot correctly implement the C++ standard */
  39. #ifndef SWIGTEMPLATEDISAMBIGUATOR
  40. # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  41. # define SWIGTEMPLATEDISAMBIGUATOR template
  42. # elif defined(__HP_aCC)
  43. /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  44. /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  45. # define SWIGTEMPLATEDISAMBIGUATOR template
  46. # else
  47. # define SWIGTEMPLATEDISAMBIGUATOR
  48. # endif
  49. #endif
  50. /* inline attribute */
  51. #ifndef SWIGINLINE
  52. # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  53. # define SWIGINLINE inline
  54. # else
  55. # define SWIGINLINE
  56. # endif
  57. #endif
  58. /* attribute recognised by some compilers to avoid 'unused' warnings */
  59. #ifndef SWIGUNUSED
  60. # if defined(__GNUC__)
  61. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  62. # define SWIGUNUSED __attribute__ ((__unused__))
  63. # else
  64. # define SWIGUNUSED
  65. # endif
  66. # elif defined(__ICC)
  67. # define SWIGUNUSED __attribute__ ((__unused__))
  68. # else
  69. # define SWIGUNUSED
  70. # endif
  71. #endif
  72. #ifndef SWIG_MSC_UNSUPPRESS_4505
  73. # if defined(_MSC_VER)
  74. # pragma warning(disable : 4505) /* unreferenced local function has been removed */
  75. # endif
  76. #endif
  77. #ifndef SWIGUNUSEDPARM
  78. # ifdef __cplusplus
  79. # define SWIGUNUSEDPARM(p)
  80. # else
  81. # define SWIGUNUSEDPARM(p) p SWIGUNUSED
  82. # endif
  83. #endif
  84. /* internal SWIG method */
  85. #ifndef SWIGINTERN
  86. # define SWIGINTERN static SWIGUNUSED
  87. #endif
  88. /* internal inline SWIG method */
  89. #ifndef SWIGINTERNINLINE
  90. # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  91. #endif
  92. /* exporting methods */
  93. #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  94. # ifndef GCC_HASCLASSVISIBILITY
  95. # define GCC_HASCLASSVISIBILITY
  96. # endif
  97. #endif
  98. #ifndef SWIGEXPORT
  99. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  100. # if defined(STATIC_LINKED)
  101. # define SWIGEXPORT
  102. # else
  103. # define SWIGEXPORT __declspec(dllexport)
  104. # endif
  105. # else
  106. # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  107. # define SWIGEXPORT __attribute__ ((visibility("default")))
  108. # else
  109. # define SWIGEXPORT
  110. # endif
  111. # endif
  112. #endif
  113. /* calling conventions for Windows */
  114. #ifndef SWIGSTDCALL
  115. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  116. # define SWIGSTDCALL __stdcall
  117. # else
  118. # define SWIGSTDCALL
  119. # endif
  120. #endif
  121. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  122. #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  123. # define _CRT_SECURE_NO_DEPRECATE
  124. #endif
  125. /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  126. #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  127. # define _SCL_SECURE_NO_DEPRECATE
  128. #endif
  129. /* -----------------------------------------------------------------------------
  130. * swigrun.swg
  131. *
  132. * This file contains generic C API SWIG runtime support for pointer
  133. * type checking.
  134. * ----------------------------------------------------------------------------- */
  135. /* This should only be incremented when either the layout of swig_type_info changes,
  136. or for whatever reason, the runtime changes incompatibly */
  137. #define SWIG_RUNTIME_VERSION "4"
  138. /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
  139. #ifdef SWIG_TYPE_TABLE
  140. # define SWIG_QUOTE_STRING(x) #x
  141. # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
  142. # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
  143. #else
  144. # define SWIG_TYPE_TABLE_NAME
  145. #endif
  146. /*
  147. You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  148. creating a static or dynamic library from the SWIG runtime code.
  149. In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  150. But only do this if strictly necessary, ie, if you have problems
  151. with your compiler or suchlike.
  152. */
  153. #ifndef SWIGRUNTIME
  154. # define SWIGRUNTIME SWIGINTERN
  155. #endif
  156. #ifndef SWIGRUNTIMEINLINE
  157. # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
  158. #endif
  159. /* Generic buffer size */
  160. #ifndef SWIG_BUFFER_SIZE
  161. # define SWIG_BUFFER_SIZE 1024
  162. #endif
  163. /* Flags for pointer conversions */
  164. #define SWIG_POINTER_DISOWN 0x1
  165. #define SWIG_CAST_NEW_MEMORY 0x2
  166. /* Flags for new pointer objects */
  167. #define SWIG_POINTER_OWN 0x1
  168. /*
  169. Flags/methods for returning states.
  170. The SWIG conversion methods, as ConvertPtr, return an integer
  171. that tells if the conversion was successful or not. And if not,
  172. an error code can be returned (see swigerrors.swg for the codes).
  173. Use the following macros/flags to set or process the returning
  174. states.
  175. In old versions of SWIG, code such as the following was usually written:
  176. if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
  177. // success code
  178. } else {
  179. //fail code
  180. }
  181. Now you can be more explicit:
  182. int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
  183. if (SWIG_IsOK(res)) {
  184. // success code
  185. } else {
  186. // fail code
  187. }
  188. which is the same really, but now you can also do
  189. Type *ptr;
  190. int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
  191. if (SWIG_IsOK(res)) {
  192. // success code
  193. if (SWIG_IsNewObj(res) {
  194. ...
  195. delete *ptr;
  196. } else {
  197. ...
  198. }
  199. } else {
  200. // fail code
  201. }
  202. I.e., now SWIG_ConvertPtr can return new objects and you can
  203. identify the case and take care of the deallocation. Of course that
  204. also requires SWIG_ConvertPtr to return new result values, such as
  205. int SWIG_ConvertPtr(obj, ptr,...) {
  206. if (<obj is ok>) {
  207. if (<need new object>) {
  208. *ptr = <ptr to new allocated object>;
  209. return SWIG_NEWOBJ;
  210. } else {
  211. *ptr = <ptr to old object>;
  212. return SWIG_OLDOBJ;
  213. }
  214. } else {
  215. return SWIG_BADOBJ;
  216. }
  217. }
  218. Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
  219. more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
  220. SWIG errors code.
  221. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
  222. allows to return the 'cast rank', for example, if you have this
  223. int food(double)
  224. int fooi(int);
  225. and you call
  226. food(1) // cast rank '1' (1 -> 1.0)
  227. fooi(1) // cast rank '0'
  228. just use the SWIG_AddCast()/SWIG_CheckState()
  229. */
  230. #define SWIG_OK (0)
  231. #define SWIG_ERROR (-1)
  232. #define SWIG_IsOK(r) (r >= 0)
  233. #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
  234. /* The CastRankLimit says how many bits are used for the cast rank */
  235. #define SWIG_CASTRANKLIMIT (1 << 8)
  236. /* The NewMask denotes the object was created (using new/malloc) */
  237. #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
  238. /* The TmpMask is for in/out typemaps that use temporal objects */
  239. #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
  240. /* Simple returning values */
  241. #define SWIG_BADOBJ (SWIG_ERROR)
  242. #define SWIG_OLDOBJ (SWIG_OK)
  243. #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
  244. #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
  245. /* Check, add and del mask methods */
  246. #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
  247. #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
  248. #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
  249. #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
  250. #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
  251. #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
  252. /* Cast-Rank Mode */
  253. #if defined(SWIG_CASTRANK_MODE)
  254. # ifndef SWIG_TypeRank
  255. # define SWIG_TypeRank unsigned long
  256. # endif
  257. # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
  258. # define SWIG_MAXCASTRANK (2)
  259. # endif
  260. # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
  261. # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
  262. SWIGINTERNINLINE int SWIG_AddCast(int r) {
  263. return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
  264. }
  265. SWIGINTERNINLINE int SWIG_CheckState(int r) {
  266. return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
  267. }
  268. #else /* no cast-rank mode */
  269. # define SWIG_AddCast
  270. # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
  271. #endif
  272. #include <string.h>
  273. #ifdef __cplusplus
  274. extern "C" {
  275. #endif
  276. typedef void *(*swig_converter_func)(void *, int *);
  277. typedef struct swig_type_info *(*swig_dycast_func)(void **);
  278. /* Structure to store information on one type */
  279. typedef struct swig_type_info {
  280. const char *name; /* mangled name of this type */
  281. const char *str; /* human readable name of this type */
  282. swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
  283. struct swig_cast_info *cast; /* linked list of types that can cast into this type */
  284. void *clientdata; /* language specific type data */
  285. int owndata; /* flag if the structure owns the clientdata */
  286. } swig_type_info;
  287. /* Structure to store a type and conversion function used for casting */
  288. typedef struct swig_cast_info {
  289. swig_type_info *type; /* pointer to type that is equivalent to this type */
  290. swig_converter_func converter; /* function to cast the void pointers */
  291. struct swig_cast_info *next; /* pointer to next cast in linked list */
  292. struct swig_cast_info *prev; /* pointer to the previous cast */
  293. } swig_cast_info;
  294. /* Structure used to store module information
  295. * Each module generates one structure like this, and the runtime collects
  296. * all of these structures and stores them in a circularly linked list.*/
  297. typedef struct swig_module_info {
  298. swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
  299. size_t size; /* Number of types in this module */
  300. struct swig_module_info *next; /* Pointer to next element in circularly linked list */
  301. swig_type_info **type_initial; /* Array of initially generated type structures */
  302. swig_cast_info **cast_initial; /* Array of initially generated casting structures */
  303. void *clientdata; /* Language specific module data */
  304. } swig_module_info;
  305. /*
  306. Compare two type names skipping the space characters, therefore
  307. "char*" == "char *" and "Class<int>" == "Class<int >", etc.
  308. Return 0 when the two name types are equivalent, as in
  309. strncmp, but skipping ' '.
  310. */
  311. SWIGRUNTIME int
  312. SWIG_TypeNameComp(const char *f1, const char *l1,
  313. const char *f2, const char *l2) {
  314. for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
  315. while ((*f1 == ' ') && (f1 != l1)) ++f1;
  316. while ((*f2 == ' ') && (f2 != l2)) ++f2;
  317. if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  318. }
  319. return (int)((l1 - f1) - (l2 - f2));
  320. }
  321. /*
  322. Check type equivalence in a name list like <name1>|<name2>|...
  323. Return 0 if not equal, 1 if equal
  324. */
  325. SWIGRUNTIME int
  326. SWIG_TypeEquiv(const char *nb, const char *tb) {
  327. int equiv = 0;
  328. const char* te = tb + strlen(tb);
  329. const char* ne = nb;
  330. while (!equiv && *ne) {
  331. for (nb = ne; *ne; ++ne) {
  332. if (*ne == '|') break;
  333. }
  334. equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  335. if (*ne) ++ne;
  336. }
  337. return equiv;
  338. }
  339. /*
  340. Check type equivalence in a name list like <name1>|<name2>|...
  341. Return 0 if equal, -1 if nb < tb, 1 if nb > tb
  342. */
  343. SWIGRUNTIME int
  344. SWIG_TypeCompare(const char *nb, const char *tb) {
  345. int equiv = 0;
  346. const char* te = tb + strlen(tb);
  347. const char* ne = nb;
  348. while (!equiv && *ne) {
  349. for (nb = ne; *ne; ++ne) {
  350. if (*ne == '|') break;
  351. }
  352. equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  353. if (*ne) ++ne;
  354. }
  355. return equiv;
  356. }
  357. /*
  358. Check the typename
  359. */
  360. SWIGRUNTIME swig_cast_info *
  361. SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  362. if (ty) {
  363. swig_cast_info *iter = ty->cast;
  364. while (iter) {
  365. if (strcmp(iter->type->name, c) == 0) {
  366. if (iter == ty->cast)
  367. return iter;
  368. /* Move iter to the top of the linked list */
  369. iter->prev->next = iter->next;
  370. if (iter->next)
  371. iter->next->prev = iter->prev;
  372. iter->next = ty->cast;
  373. iter->prev = 0;
  374. if (ty->cast) ty->cast->prev = iter;
  375. ty->cast = iter;
  376. return iter;
  377. }
  378. iter = iter->next;
  379. }
  380. }
  381. return 0;
  382. }
  383. /*
  384. Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
  385. */
  386. SWIGRUNTIME swig_cast_info *
  387. SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  388. if (ty) {
  389. swig_cast_info *iter = ty->cast;
  390. while (iter) {
  391. if (iter->type == from) {
  392. if (iter == ty->cast)
  393. return iter;
  394. /* Move iter to the top of the linked list */
  395. iter->prev->next = iter->next;
  396. if (iter->next)
  397. iter->next->prev = iter->prev;
  398. iter->next = ty->cast;
  399. iter->prev = 0;
  400. if (ty->cast) ty->cast->prev = iter;
  401. ty->cast = iter;
  402. return iter;
  403. }
  404. iter = iter->next;
  405. }
  406. }
  407. return 0;
  408. }
  409. /*
  410. Cast a pointer up an inheritance hierarchy
  411. */
  412. SWIGRUNTIMEINLINE void *
  413. SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  414. return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
  415. }
  416. /*
  417. Dynamic pointer casting. Down an inheritance hierarchy
  418. */
  419. SWIGRUNTIME swig_type_info *
  420. SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  421. swig_type_info *lastty = ty;
  422. if (!ty || !ty->dcast) return ty;
  423. while (ty && (ty->dcast)) {
  424. ty = (*ty->dcast)(ptr);
  425. if (ty) lastty = ty;
  426. }
  427. return lastty;
  428. }
  429. /*
  430. Return the name associated with this type
  431. */
  432. SWIGRUNTIMEINLINE const char *
  433. SWIG_TypeName(const swig_type_info *ty) {
  434. return ty->name;
  435. }
  436. /*
  437. Return the pretty name associated with this type,
  438. that is an unmangled type name in a form presentable to the user.
  439. */
  440. SWIGRUNTIME const char *
  441. SWIG_TypePrettyName(const swig_type_info *type) {
  442. /* The "str" field contains the equivalent pretty names of the
  443. type, separated by vertical-bar characters. We choose
  444. to print the last name, as it is often (?) the most
  445. specific. */
  446. if (!type) return NULL;
  447. if (type->str != NULL) {
  448. const char *last_name = type->str;
  449. const char *s;
  450. for (s = type->str; *s; s++)
  451. if (*s == '|') last_name = s+1;
  452. return last_name;
  453. }
  454. else
  455. return type->name;
  456. }
  457. /*
  458. Set the clientdata field for a type
  459. */
  460. SWIGRUNTIME void
  461. SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  462. swig_cast_info *cast = ti->cast;
  463. /* if (ti->clientdata == clientdata) return; */
  464. ti->clientdata = clientdata;
  465. while (cast) {
  466. if (!cast->converter) {
  467. swig_type_info *tc = cast->type;
  468. if (!tc->clientdata) {
  469. SWIG_TypeClientData(tc, clientdata);
  470. }
  471. }
  472. cast = cast->next;
  473. }
  474. }
  475. SWIGRUNTIME void
  476. SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  477. SWIG_TypeClientData(ti, clientdata);
  478. ti->owndata = 1;
  479. }
  480. /*
  481. Search for a swig_type_info structure only by mangled name
  482. Search is a O(log #types)
  483. We start searching at module start, and finish searching when start == end.
  484. Note: if start == end at the beginning of the function, we go all the way around
  485. the circular list.
  486. */
  487. SWIGRUNTIME swig_type_info *
  488. SWIG_MangledTypeQueryModule(swig_module_info *start,
  489. swig_module_info *end,
  490. const char *name) {
  491. swig_module_info *iter = start;
  492. do {
  493. if (iter->size) {
  494. register size_t l = 0;
  495. register size_t r = iter->size - 1;
  496. do {
  497. /* since l+r >= 0, we can (>> 1) instead (/ 2) */
  498. register size_t i = (l + r) >> 1;
  499. const char *iname = iter->types[i]->name;
  500. if (iname) {
  501. register int compare = strcmp(name, iname);
  502. if (compare == 0) {
  503. return iter->types[i];
  504. } else if (compare < 0) {
  505. if (i) {
  506. r = i - 1;
  507. } else {
  508. break;
  509. }
  510. } else if (compare > 0) {
  511. l = i + 1;
  512. }
  513. } else {
  514. break; /* should never happen */
  515. }
  516. } while (l <= r);
  517. }
  518. iter = iter->next;
  519. } while (iter != end);
  520. return 0;
  521. }
  522. /*
  523. Search for a swig_type_info structure for either a mangled name or a human readable name.
  524. It first searches the mangled names of the types, which is a O(log #types)
  525. If a type is not found it then searches the human readable names, which is O(#types).
  526. We start searching at module start, and finish searching when start == end.
  527. Note: if start == end at the beginning of the function, we go all the way around
  528. the circular list.
  529. */
  530. SWIGRUNTIME swig_type_info *
  531. SWIG_TypeQueryModule(swig_module_info *start,
  532. swig_module_info *end,
  533. const char *name) {
  534. /* STEP 1: Search the name field using binary search */
  535. swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  536. if (ret) {
  537. return ret;
  538. } else {
  539. /* STEP 2: If the type hasn't been found, do a complete search
  540. of the str field (the human readable name) */
  541. swig_module_info *iter = start;
  542. do {
  543. register size_t i = 0;
  544. for (; i < iter->size; ++i) {
  545. if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
  546. return iter->types[i];
  547. }
  548. iter = iter->next;
  549. } while (iter != end);
  550. }
  551. /* neither found a match */
  552. return 0;
  553. }
  554. /*
  555. Pack binary data into a string
  556. */
  557. SWIGRUNTIME char *
  558. SWIG_PackData(char *c, void *ptr, size_t sz) {
  559. static const char hex[17] = "0123456789abcdef";
  560. register const unsigned char *u = (unsigned char *) ptr;
  561. register const unsigned char *eu = u + sz;
  562. for (; u != eu; ++u) {
  563. register unsigned char uu = *u;
  564. *(c++) = hex[(uu & 0xf0) >> 4];
  565. *(c++) = hex[uu & 0xf];
  566. }
  567. return c;
  568. }
  569. /*
  570. Unpack binary data from a string
  571. */
  572. SWIGRUNTIME const char *
  573. SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  574. register unsigned char *u = (unsigned char *) ptr;
  575. register const unsigned char *eu = u + sz;
  576. for (; u != eu; ++u) {
  577. register char d = *(c++);
  578. register unsigned char uu;
  579. if ((d >= '0') && (d <= '9'))
  580. uu = ((d - '0') << 4);
  581. else if ((d >= 'a') && (d <= 'f'))
  582. uu = ((d - ('a'-10)) << 4);
  583. else
  584. return (char *) 0;
  585. d = *(c++);
  586. if ((d >= '0') && (d <= '9'))
  587. uu |= (d - '0');
  588. else if ((d >= 'a') && (d <= 'f'))
  589. uu |= (d - ('a'-10));
  590. else
  591. return (char *) 0;
  592. *u = uu;
  593. }
  594. return c;
  595. }
  596. /*
  597. Pack 'void *' into a string buffer.
  598. */
  599. SWIGRUNTIME char *
  600. SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  601. char *r = buff;
  602. if ((2*sizeof(void *) + 2) > bsz) return 0;
  603. *(r++) = '_';
  604. r = SWIG_PackData(r,&ptr,sizeof(void *));
  605. if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  606. strcpy(r,name);
  607. return buff;
  608. }
  609. SWIGRUNTIME const char *
  610. SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  611. if (*c != '_') {
  612. if (strcmp(c,"NULL") == 0) {
  613. *ptr = (void *) 0;
  614. return name;
  615. } else {
  616. return 0;
  617. }
  618. }
  619. return SWIG_UnpackData(++c,ptr,sizeof(void *));
  620. }
  621. SWIGRUNTIME char *
  622. SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  623. char *r = buff;
  624. size_t lname = (name ? strlen(name) : 0);
  625. if ((2*sz + 2 + lname) > bsz) return 0;
  626. *(r++) = '_';
  627. r = SWIG_PackData(r,ptr,sz);
  628. if (lname) {
  629. strncpy(r,name,lname+1);
  630. } else {
  631. *r = 0;
  632. }
  633. return buff;
  634. }
  635. SWIGRUNTIME const char *
  636. SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  637. if (*c != '_') {
  638. if (strcmp(c,"NULL") == 0) {
  639. memset(ptr,0,sz);
  640. return name;
  641. } else {
  642. return 0;
  643. }
  644. }
  645. return SWIG_UnpackData(++c,ptr,sz);
  646. }
  647. #ifdef __cplusplus
  648. }
  649. #endif
  650. /* -----------------------------------------------------------------------------
  651. * luarun.swg
  652. *
  653. * This file contains the runtime support for Lua modules
  654. * and includes code for managing global variables and pointer
  655. * type checking.
  656. * ----------------------------------------------------------------------------- */
  657. #ifdef __cplusplus
  658. extern "C" {
  659. #endif
  660. #include "lua.h"
  661. #include "lauxlib.h"
  662. #include <stdlib.h> /* for malloc */
  663. #include <assert.h> /* for a few sanity tests */
  664. /* -----------------------------------------------------------------------------
  665. * Lua flavors
  666. * ----------------------------------------------------------------------------- */
  667. #define SWIG_LUA_FLAVOR_LUA 1
  668. #define SWIG_LUA_FLAVOR_ELUA 2
  669. #define SWIG_LUA_FLAVOR_ELUAC 3
  670. #if !defined(SWIG_LUA_TARGET)
  671. # error SWIG_LUA_TARGET not defined
  672. #endif
  673. #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
  674. # define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
  675. # define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
  676. # define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
  677. # define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
  678. #else /* SWIG_LUA_FLAVOR_LUA */
  679. # define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
  680. # define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
  681. # define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
  682. # define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
  683. #endif
  684. #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
  685. # define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
  686. # define LSTRVAL LRO_STRVAL
  687. #endif
  688. /* -----------------------------------------------------------------------------
  689. * compatibility defines
  690. * ----------------------------------------------------------------------------- */
  691. /* History of Lua C API length functions: In Lua 5.0 (and before?)
  692. there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen",
  693. but a compatibility define of "lua_strlen" was added. In Lua 5.2,
  694. this function was again renamed, to "lua_rawlen" (to emphasize that
  695. it doesn't call the "__len" metamethod), and the compatibility
  696. define of lua_strlen was removed. All SWIG uses have been updated
  697. to "lua_rawlen", and we add our own defines of that here for older
  698. versions of Lua. */
  699. #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
  700. # define lua_rawlen lua_strlen
  701. #elif LUA_VERSION_NUM == 501
  702. # define lua_rawlen lua_objlen
  703. #endif
  704. /* lua_pushglobaltable is the recommended "future-proof" way to get
  705. the global table for Lua 5.2 and later. Here we define
  706. lua_pushglobaltable ourselves for Lua versions before 5.2. */
  707. #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
  708. # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
  709. #endif
  710. /* -----------------------------------------------------------------------------
  711. * global swig types
  712. * ----------------------------------------------------------------------------- */
  713. /* Constant table */
  714. #define SWIG_LUA_INT 1
  715. #define SWIG_LUA_FLOAT 2
  716. #define SWIG_LUA_STRING 3
  717. #define SWIG_LUA_POINTER 4
  718. #define SWIG_LUA_BINARY 5
  719. #define SWIG_LUA_CHAR 6
  720. /* Structure for variable linking table */
  721. typedef struct {
  722. const char *name;
  723. lua_CFunction get;
  724. lua_CFunction set;
  725. } swig_lua_var_info;
  726. /* Constant information structure */
  727. typedef struct {
  728. int type;
  729. char *name;
  730. long lvalue;
  731. double dvalue;
  732. void *pvalue;
  733. swig_type_info **ptype;
  734. } swig_lua_const_info;
  735. typedef struct {
  736. const char *name;
  737. lua_CFunction method;
  738. } swig_lua_method;
  739. typedef struct {
  740. const char *name;
  741. lua_CFunction getmethod;
  742. lua_CFunction setmethod;
  743. } swig_lua_attribute;
  744. typedef struct swig_lua_class {
  745. const char *name;
  746. swig_type_info **type;
  747. lua_CFunction constructor;
  748. void (*destructor)(void *);
  749. swig_lua_method *methods;
  750. swig_lua_attribute *attributes;
  751. struct swig_lua_class **bases;
  752. const char **base_names;
  753. } swig_lua_class;
  754. /* this is the struct for wrappering all pointers in SwigLua
  755. */
  756. typedef struct {
  757. swig_type_info *type;
  758. int own; /* 1 if owned & must be destroyed */
  759. void *ptr;
  760. } swig_lua_userdata;
  761. /* this is the struct for wrapping arbitary packed binary data
  762. (currently it is only used for member function pointers)
  763. the data ordering is similar to swig_lua_userdata, but it is currently not possible
  764. to tell the two structures apart within SWIG, other than by looking at the type
  765. */
  766. typedef struct {
  767. swig_type_info *type;
  768. int own; /* 1 if owned & must be destroyed */
  769. char data[1]; /* arbitary amount of data */
  770. } swig_lua_rawdata;
  771. /* Common SWIG API */
  772. #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
  773. #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
  774. #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
  775. /* for C++ member pointers, ie, member methods */
  776. #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
  777. #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
  778. /* Runtime API */
  779. #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
  780. #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
  781. #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
  782. /* Contract support */
  783. #define SWIG_contract_assert(expr, msg) \
  784. if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
  785. /* helper #defines */
  786. #define SWIG_fail {goto fail;}
  787. #define SWIG_fail_arg(func_name,argnum,type) \
  788. {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
  789. func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
  790. goto fail;}
  791. #define SWIG_fail_ptr(func_name,argnum,type) \
  792. SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
  793. #define SWIG_check_num_args(func_name,a,b) \
  794. if (lua_gettop(L)<a || lua_gettop(L)>b) \
  795. {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
  796. goto fail;}
  797. #define SWIG_Lua_get_table(L,n) \
  798. (lua_pushstring(L, n), lua_rawget(L,-2))
  799. #define SWIG_Lua_add_function(L,n,f) \
  800. (lua_pushstring(L, n), \
  801. lua_pushcfunction(L, f), \
  802. lua_rawset(L,-3))
  803. /* special helper for allowing 'nil' for usertypes */
  804. #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
  805. #ifdef __cplusplus
  806. /* Special helper for member function pointers
  807. it gets the address, casts it, then dereferences it */
  808. //#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a)))
  809. #endif
  810. /* storing/access of swig_module_info */
  811. SWIGRUNTIME swig_module_info *
  812. SWIG_Lua_GetModule(lua_State* L) {
  813. swig_module_info *ret = 0;
  814. lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  815. lua_rawget(L,LUA_REGISTRYINDEX);
  816. if (lua_islightuserdata(L,-1))
  817. ret=(swig_module_info*)lua_touserdata(L,-1);
  818. lua_pop(L,1); /* tidy */
  819. return ret;
  820. }
  821. SWIGRUNTIME void
  822. SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
  823. /* add this all into the Lua registry: */
  824. lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  825. lua_pushlightuserdata(L,(void*)module);
  826. lua_rawset(L,LUA_REGISTRYINDEX);
  827. }
  828. /* -----------------------------------------------------------------------------
  829. * global variable support code: modules
  830. * ----------------------------------------------------------------------------- */
  831. /* this function is called when trying to set an immutable.
  832. default value is to print an error.
  833. This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
  834. SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
  835. {
  836. /* there should be 1 param passed in: the new value */
  837. #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
  838. lua_pop(L,1); /* remove it */
  839. lua_pushstring(L,"This variable is immutable");
  840. lua_error(L);
  841. #endif
  842. return 0; /* should not return anything */
  843. }
  844. /* the module.get method used for getting linked data */
  845. SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
  846. {
  847. /* there should be 2 params passed in
  848. (1) table (not the meta table)
  849. (2) string name of the attribute
  850. printf("SWIG_Lua_module_get %p(%s) '%s'\n",
  851. lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
  852. lua_tostring(L,2));
  853. */
  854. /* get the metatable */
  855. #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  856. assert(lua_isrotable(L,1)); /* just in case */
  857. #else
  858. assert(lua_istable(L,1)); /* default Lua action */
  859. #endif
  860. lua_getmetatable(L,1); /* get the metatable */
  861. #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  862. assert(lua_isrotable(L,-1)); /* just in case */
  863. #else
  864. assert(lua_istable(L,-1));
  865. #endif
  866. SWIG_Lua_get_table(L,".get"); /* get the .get table */
  867. lua_remove(L,3); /* remove metatable */
  868. #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  869. if (lua_isrotable(L,-1))
  870. #else
  871. if (lua_istable(L,-1))
  872. #endif
  873. {
  874. /* look for the key in the .get table */
  875. lua_pushvalue(L,2); /* key */
  876. lua_rawget(L,-2);
  877. lua_remove(L,3); /* remove .get */
  878. if (lua_iscfunction(L,-1))
  879. { /* found it so call the fn & return its value */
  880. lua_call(L,0,1);
  881. return 1;
  882. }
  883. lua_pop(L,1); /* remove the top */
  884. }
  885. lua_pop(L,1); /* remove the .get */
  886. lua_pushnil(L); /* return a nil */
  887. return 1;
  888. }
  889. /* the module.set method used for setting linked data */
  890. SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
  891. {
  892. /* there should be 3 params passed in
  893. (1) table (not the meta table)
  894. (2) string name of the attribute
  895. (3) any for the new value
  896. */
  897. /* get the metatable */
  898. #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  899. assert(lua_isrotable(L,1)); /* just in case */
  900. #else
  901. assert(lua_istable(L,1)); /* default Lua action */
  902. #endif
  903. lua_getmetatable(L,1); /* get the metatable */
  904. #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  905. assert(lua_isrotable(L,-1)); /* just in case */
  906. #else
  907. assert(lua_istable(L,-1));
  908. #endif
  909. SWIG_Lua_get_table(L,".set"); /* get the .set table */
  910. lua_remove(L,4); /* remove metatable */
  911. #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  912. if (lua_isrotable(L,-1))
  913. #else
  914. if (lua_istable(L,-1))
  915. #endif
  916. {
  917. /* look for the key in the .set table */
  918. lua_pushvalue(L,2); /* key */
  919. lua_rawget(L,-2);
  920. lua_remove(L,4); /* remove .set */
  921. if (lua_iscfunction(L,-1))
  922. { /* found it so call the fn & return its value */
  923. lua_pushvalue(L,3); /* value */
  924. lua_call(L,1,0);
  925. return 0;
  926. }
  927. #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA)
  928. else {
  929. return 0; // Exits stoically if an invalid key is initialized.
  930. }
  931. #endif
  932. }
  933. lua_settop(L,3); /* reset back to start */
  934. /* we now have the table, key & new value, so just set directly */
  935. lua_rawset(L,1); /* add direct */
  936. return 0;
  937. }
  938. #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
  939. /* registering a module in lua. Pushes the module table on the stack. */
  940. SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name)
  941. {
  942. assert(lua_istable(L,-1)); /* just in case */
  943. lua_pushstring(L,name);
  944. lua_newtable(L); /* the table */
  945. /* add meta table */
  946. lua_newtable(L); /* the meta table */
  947. SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
  948. SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
  949. lua_pushstring(L,".get");
  950. lua_newtable(L); /* the .get table */
  951. lua_rawset(L,-3); /* add .get into metatable */
  952. lua_pushstring(L,".set");
  953. lua_newtable(L); /* the .set table */
  954. lua_rawset(L,-3); /* add .set into metatable */
  955. lua_setmetatable(L,-2); /* sets meta table in module */
  956. #ifdef SWIG_LUA_MODULE_GLOBAL
  957. /* If requested, install the module directly into the global namespace. */
  958. lua_rawset(L,-3); /* add module into parent */
  959. SWIG_Lua_get_table(L,name); /* get the table back out */
  960. #else
  961. /* Do not install the module table as global name. The stack top has
  962. the module table with the name below. We pop the top and replace
  963. the name with it. */
  964. lua_replace(L,-2);
  965. #endif
  966. }
  967. /* ending the register */
  968. SWIGINTERN void SWIG_Lua_module_end(lua_State* L)
  969. {
  970. lua_pop(L,1); /* tidy stack (remove module) */
  971. }
  972. /* adding a linked variable to the module */
  973. SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
  974. {
  975. assert(lua_istable(L,-1)); /* just in case */
  976. lua_getmetatable(L,-1); /* get the metatable */
  977. assert(lua_istable(L,-1)); /* just in case */
  978. SWIG_Lua_get_table(L,".get"); /* find the .get table */
  979. assert(lua_istable(L,-1)); /* should be a table: */
  980. SWIG_Lua_add_function(L,name,getFn);
  981. lua_pop(L,1); /* tidy stack (remove table) */
  982. if (setFn) /* if there is a set fn */
  983. {
  984. SWIG_Lua_get_table(L,".set"); /* find the .set table */
  985. assert(lua_istable(L,-1)); /* should be a table: */
  986. SWIG_Lua_add_function(L,name,setFn);
  987. lua_pop(L,1); /* tidy stack (remove table) */
  988. }
  989. lua_pop(L,1); /* tidy stack (remove meta) */
  990. }
  991. #endif
  992. /* adding a function module */
  993. SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
  994. {
  995. SWIG_Lua_add_function(L,name,fn);
  996. }
  997. /* -----------------------------------------------------------------------------
  998. * global variable support code: classes
  999. * ----------------------------------------------------------------------------- */
  1000. /* the class.get method, performs the lookup of class attributes */
  1001. SWIGINTERN int SWIG_Lua_class_get(lua_State* L)
  1002. {
  1003. /* there should be 2 params passed in
  1004. (1) userdata (not the meta table)
  1005. (2) string name of the attribute
  1006. */
  1007. assert(lua_isuserdata(L,-2)); /* just in case */
  1008. lua_getmetatable(L,-2); /* get the meta table */
  1009. assert(lua_istable(L,-1)); /* just in case */
  1010. SWIG_Lua_get_table(L,".get"); /* find the .get table */
  1011. assert(lua_istable(L,-1)); /* just in case */
  1012. /* look for the key in the .get table */
  1013. lua_pushvalue(L,2); /* key */
  1014. lua_rawget(L,-2);
  1015. lua_remove(L,-2); /* stack tidy, remove .get table */
  1016. if (lua_iscfunction(L,-1))
  1017. { /* found it so call the fn & return its value */
  1018. lua_pushvalue(L,1); /* the userdata */
  1019. lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */
  1020. lua_remove(L,-2); /* stack tidy, remove metatable */
  1021. return 1;
  1022. }
  1023. lua_pop(L,1); /* remove whatever was there */
  1024. /* ok, so try the .fn table */
  1025. SWIG_Lua_get_table(L,".fn"); /* find the .get table */
  1026. assert(lua_istable(L,-1)); /* just in case */
  1027. lua_pushvalue(L,2); /* key */
  1028. lua_rawget(L,-2); /* look for the fn */
  1029. lua_remove(L,-2); /* stack tidy, remove .fn table */
  1030. if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
  1031. { /* found it so return the fn & let lua call it */
  1032. lua_remove(L,-2); /* stack tidy, remove metatable */
  1033. return 1;
  1034. }
  1035. lua_pop(L,1); /* remove whatever was there */
  1036. /* NEW: looks for the __getitem() fn
  1037. this is a user provided get fn */
  1038. SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
  1039. if (lua_iscfunction(L,-1)) /* if its there */
  1040. { /* found it so call the fn & return its value */
  1041. lua_pushvalue(L,1); /* the userdata */
  1042. lua_pushvalue(L,2); /* the parameter */
  1043. lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */
  1044. lua_remove(L,-2); /* stack tidy, remove metatable */
  1045. return 1;
  1046. }
  1047. return 0; /* sorry not known */
  1048. }
  1049. /* the class.set method, performs the lookup of class attributes */
  1050. SWIGINTERN int SWIG_Lua_class_set(lua_State* L)
  1051. {
  1052. /* there should be 3 params passed in
  1053. (1) table (not the meta table)
  1054. (2) string name of the attribute
  1055. (3) any for the new value
  1056. printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
  1057. lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
  1058. lua_tostring(L,2),
  1059. lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/
  1060. assert(lua_isuserdata(L,1)); /* just in case */
  1061. lua_getmetatable(L,1); /* get the meta table */
  1062. assert(lua_istable(L,-1)); /* just in case */
  1063. SWIG_Lua_get_table(L,".set"); /* find the .set table */
  1064. if (lua_istable(L,-1))
  1065. {
  1066. /* look for the key in the .set table */
  1067. lua_pushvalue(L,2); /* key */
  1068. lua_rawget(L,-2);
  1069. if (lua_iscfunction(L,-1))
  1070. { /* found it so call the fn & return its value */
  1071. lua_pushvalue(L,1); /* userdata */
  1072. lua_pushvalue(L,3); /* value */
  1073. lua_call(L,2,0);
  1074. return 0;
  1075. }
  1076. lua_pop(L,1); /* remove the value */
  1077. }
  1078. lua_pop(L,1); /* remove the value .set table */
  1079. /* NEW: looks for the __setitem() fn
  1080. this is a user provided set fn */
  1081. SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
  1082. if (lua_iscfunction(L,-1)) /* if its there */
  1083. { /* found it so call the fn & return its value */
  1084. lua_pushvalue(L,1); /* the userdata */
  1085. lua_pushvalue(L,2); /* the parameter */
  1086. lua_pushvalue(L,3); /* the value */
  1087. lua_call(L,3,0); /* 3 values in ,0 out */
  1088. lua_remove(L,-2); /* stack tidy, remove metatable */
  1089. return 1;
  1090. }
  1091. return 0;
  1092. }
  1093. /* the class.destruct method called by the interpreter */
  1094. SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L)
  1095. {
  1096. /* there should be 1 params passed in
  1097. (1) userdata (not the meta table) */
  1098. swig_lua_userdata* usr;
  1099. swig_lua_class* clss;
  1100. assert(lua_isuserdata(L,-1)); /* just in case */
  1101. usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
  1102. /* if must be destroyed & has a destructor */
  1103. if (usr->own) /* if must be destroyed */
  1104. {
  1105. clss=(swig_lua_class*)usr->type->clientdata; /* get the class */
  1106. if (clss && clss->destructor) /* there is a destroy fn */
  1107. {
  1108. clss->destructor(usr->ptr); /* bye bye */
  1109. }
  1110. }
  1111. return 0;
  1112. }
  1113. /* the class.__tostring method called by the interpreter and print */
  1114. SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L)
  1115. {
  1116. /* there should be 1 param passed in
  1117. (1) userdata (not the metatable) */
  1118. assert(lua_isuserdata(L,1)); /* just in case */
  1119. unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */
  1120. lua_getmetatable(L,1); /* get the meta table */
  1121. assert(lua_istable(L,-1)); /* just in case */
  1122. lua_getfield(L, -1, ".type");
  1123. const char* className = lua_tostring(L, -1);
  1124. char output[256];
  1125. sprintf(output, "<%s userdata: %lX>", className, userData);
  1126. lua_pushstring(L, (const char*)output);
  1127. return 1;
  1128. }
  1129. /* to manually disown some userdata */
  1130. SWIGINTERN int SWIG_Lua_class_disown(lua_State* L)
  1131. {
  1132. /* there should be 1 params passed in
  1133. (1) userdata (not the meta table) */
  1134. swig_lua_userdata* usr;
  1135. assert(lua_isuserdata(L,-1)); /* just in case */
  1136. usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
  1137. usr->own = 0; /* clear our ownership */
  1138. return 0;
  1139. }
  1140. /* gets the swig class registry (or creates it) */
  1141. SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L)
  1142. {
  1143. /* add this all into the swig registry: */
  1144. lua_pushstring(L,"SWIG");
  1145. lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */
  1146. if (!lua_istable(L,-1)) /* not there */
  1147. { /* must be first time, so add it */
  1148. lua_pop(L,1); /* remove the result */
  1149. lua_pushstring(L,"SWIG");
  1150. lua_newtable(L);
  1151. lua_rawset(L,LUA_REGISTRYINDEX);
  1152. /* then get it */
  1153. lua_pushstring(L,"SWIG");
  1154. lua_rawget(L,LUA_REGISTRYINDEX);
  1155. }
  1156. }
  1157. /* helper fn to get the classes metatable from the register */
  1158. SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
  1159. {
  1160. SWIG_Lua_get_class_registry(L); /* get the registry */
  1161. lua_pushstring(L,cname); /* get the name */
  1162. lua_rawget(L,-2); /* get it */
  1163. lua_remove(L,-2); /* tidy up (remove registry) */
  1164. }
  1165. /* helper add a variable to a registered class */
  1166. SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
  1167. {
  1168. assert(lua_istable(L,-1)); /* just in case */
  1169. SWIG_Lua_get_table(L,".get"); /* find the .get table */
  1170. assert(lua_istable(L,-1)); /* just in case */
  1171. SWIG_Lua_add_function(L,name,getFn);
  1172. lua_pop(L,1); /* tidy stack (remove table) */
  1173. if (setFn)
  1174. {
  1175. SWIG_Lua_get_table(L,".set"); /* find the .set table */
  1176. assert(lua_istable(L,-1)); /* just in case */
  1177. SWIG_Lua_add_function(L,name,setFn);
  1178. lua_pop(L,1); /* tidy stack (remove table) */
  1179. }
  1180. }
  1181. /* helper to recursively add class details (attributes & operations) */
  1182. SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
  1183. {
  1184. int i;
  1185. /* call all the base classes first: we can then override these later: */
  1186. for(i=0;clss->bases[i];i++)
  1187. {
  1188. SWIG_Lua_add_class_details(L,clss->bases[i]);
  1189. }
  1190. /* add fns */
  1191. for(i=0;clss->attributes[i].name;i++){
  1192. SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
  1193. }
  1194. /* add methods to the metatable */
  1195. SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  1196. assert(lua_istable(L,-1)); /* just in case */
  1197. for(i=0;clss->methods[i].name;i++){
  1198. SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
  1199. }
  1200. lua_pop(L,1); /* tidy stack (remove table) */
  1201. /* add operator overloads
  1202. these look ANY method which start with "__" and assume they
  1203. are operator overloads & add them to the metatable
  1204. (this might mess up is someone defines a method __gc (the destructor)*/
  1205. for(i=0;clss->methods[i].name;i++){
  1206. if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
  1207. SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
  1208. }
  1209. }
  1210. }
  1211. /* set up the base classes pointers.
  1212. Each class structure has a list of pointers to the base class structures.
  1213. This function fills them.
  1214. It cannot be done at compile time, as this will not work with hireachies
  1215. spread over more than one swig file.
  1216. Therefore it must be done at runtime, querying the SWIG type system.
  1217. */
  1218. SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
  1219. {
  1220. int i=0;
  1221. swig_module_info* module=SWIG_GetModule(L);
  1222. for(i=0;clss->base_names[i];i++)
  1223. {
  1224. if (clss->bases[i]==0) /* not found yet */
  1225. {
  1226. /* lookup and cache the base class */
  1227. swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
  1228. if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
  1229. }
  1230. }
  1231. }
  1232. /* performs the entire class registration process */
  1233. SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
  1234. {
  1235. /* add its constructor to module with the name of the class
  1236. so you can do MyClass(...) as well as new_MyClass(...)
  1237. BUT only if a constructor is defined
  1238. (this overcomes the problem of pure virtual classes without constructors)*/
  1239. if (clss->constructor)
  1240. SWIG_Lua_add_function(L,clss->name,clss->constructor);
  1241. SWIG_Lua_get_class_registry(L); /* get the registry */
  1242. lua_pushstring(L,clss->name); /* get the name */
  1243. lua_newtable(L); /* create the metatable */
  1244. /* add string of class name called ".type" */
  1245. lua_pushstring(L,".type");
  1246. lua_pushstring(L,clss->name);
  1247. lua_rawset(L,-3);
  1248. /* add a table called ".get" */
  1249. lua_pushstring(L,".get");
  1250. lua_newtable(L);
  1251. lua_rawset(L,-3);
  1252. /* add a table called ".set" */
  1253. lua_pushstring(L,".set");
  1254. lua_newtable(L);
  1255. lua_rawset(L,-3);
  1256. /* add a table called ".fn" */
  1257. lua_pushstring(L,".fn");
  1258. lua_newtable(L);
  1259. /* add manual disown method */
  1260. SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
  1261. lua_rawset(L,-3);
  1262. /* add accessor fns for using the .get,.set&.fn */
  1263. SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
  1264. SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
  1265. SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
  1266. /* add tostring method for better output */
  1267. SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring);
  1268. /* add it */
  1269. lua_rawset(L,-3); /* metatable into registry */
  1270. lua_pop(L,1); /* tidy stack (remove registry) */
  1271. SWIG_Lua_get_class_metatable(L,clss->name);
  1272. SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */
  1273. lua_pop(L,1); /* tidy stack (remove class metatable) */
  1274. }
  1275. /* -----------------------------------------------------------------------------
  1276. * Class/structure conversion fns
  1277. * ----------------------------------------------------------------------------- */
  1278. /* helper to add metatable to new lua object */
  1279. SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
  1280. {
  1281. if (type->clientdata) /* there is clientdata: so add the metatable */
  1282. {
  1283. SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
  1284. if (lua_istable(L,-1))
  1285. {
  1286. lua_setmetatable(L,-2);
  1287. }
  1288. else
  1289. {
  1290. lua_pop(L,1);
  1291. }
  1292. }
  1293. }
  1294. /* pushes a new object into the lua stack */
  1295. SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
  1296. {
  1297. swig_lua_userdata* usr;
  1298. if (!ptr){
  1299. lua_pushnil(L);
  1300. return;
  1301. }
  1302. usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */
  1303. usr->ptr=ptr; /* set the ptr */
  1304. usr->type=type;
  1305. usr->own=own;
  1306. #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  1307. _SWIG_Lua_AddMetatable(L,type); /* add metatable */
  1308. #endif
  1309. }
  1310. /* takes a object from the lua stack & converts it into an object of the correct type
  1311. (if possible) */
  1312. SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
  1313. {
  1314. swig_lua_userdata* usr;
  1315. swig_cast_info *cast;
  1316. if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */
  1317. usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
  1318. if (usr)
  1319. {
  1320. if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
  1321. {
  1322. usr->own=0;
  1323. }
  1324. if (!type) /* special cast void*, no casting fn */
  1325. {
  1326. *ptr=usr->ptr;
  1327. return SWIG_OK; /* ok */
  1328. }
  1329. cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
  1330. if (cast)
  1331. {
  1332. int newmemory = 0;
  1333. *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
  1334. assert(!newmemory); /* newmemory handling not yet implemented */
  1335. return SWIG_OK; /* ok */
  1336. }
  1337. }
  1338. return SWIG_ERROR; /* error */
  1339. }
  1340. SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
  1341. int argnum,const char* func_name){
  1342. void* result;
  1343. if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
  1344. lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
  1345. func_name,(type && type->str)?type->str:"void*",argnum);
  1346. lua_error(L);
  1347. }
  1348. return result;
  1349. }
  1350. /* pushes a packed userdata. user for member fn pointers only */
  1351. SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
  1352. {
  1353. swig_lua_rawdata* raw;
  1354. assert(ptr); /* not acceptable to pass in a NULL value */
  1355. raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */
  1356. raw->type=type;
  1357. raw->own=0;
  1358. memcpy(raw->data,ptr,size); /* copy the data */
  1359. _SWIG_Lua_AddMetatable(L,type); /* add metatable */
  1360. }
  1361. /* converts a packed userdata. user for member fn pointers only */
  1362. SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
  1363. {
  1364. swig_lua_rawdata* raw;
  1365. raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */
  1366. if (!raw) return SWIG_ERROR; /* error */
  1367. if (type==0 || type==raw->type) /* void* or identical type */
  1368. {
  1369. memcpy(ptr,raw->data,size); /* copy it */
  1370. return SWIG_OK; /* ok */
  1371. }
  1372. return SWIG_ERROR; /* error */
  1373. }
  1374. /* a function to get the typestring of a piece of data */
  1375. SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
  1376. {
  1377. swig_lua_userdata* usr;
  1378. if (lua_isuserdata(L,tp))
  1379. {
  1380. usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */
  1381. if (usr && usr->type && usr->type->str)
  1382. return usr->type->str;
  1383. return "userdata (unknown type)";
  1384. }
  1385. return lua_typename(L,lua_type(L,tp));
  1386. }
  1387. /* lua callable function to get the userdata's type */
  1388. SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
  1389. {
  1390. lua_pushstring(L,SWIG_Lua_typename(L,1));
  1391. return 1;
  1392. }
  1393. /* lua callable function to compare userdata's value
  1394. the issue is that two userdata may point to the same thing
  1395. but to lua, they are different objects */
  1396. SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
  1397. {
  1398. int result;
  1399. swig_lua_userdata *usr1,*usr2;
  1400. if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */
  1401. return 0; /* nil reply */
  1402. usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
  1403. usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */
  1404. /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
  1405. result=(usr1->ptr==usr2->ptr);
  1406. lua_pushboolean(L,result);
  1407. return 1;
  1408. }
  1409. /* -----------------------------------------------------------------------------
  1410. * global variable support code: class/struct typemap functions
  1411. * ----------------------------------------------------------------------------- */
  1412. #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
  1413. /* Install Constants */
  1414. SWIGINTERN void
  1415. SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
  1416. int i;
  1417. for (i = 0; constants[i].type; i++) {
  1418. switch(constants[i].type) {
  1419. case SWIG_LUA_INT:
  1420. lua_pushstring(L,constants[i].name);
  1421. lua_pushnumber(L,(lua_Number)constants[i].lvalue);
  1422. lua_rawset(L,-3);
  1423. break;
  1424. case SWIG_LUA_FLOAT:
  1425. lua_pushstring(L,constants[i].name);
  1426. lua_pushnumber(L,(lua_Number)constants[i].dvalue);
  1427. lua_rawset(L,-3);
  1428. break;
  1429. case SWIG_LUA_CHAR:
  1430. lua_pushstring(L,constants[i].name);
  1431. lua_pushfstring(L,"%c",(char)constants[i].lvalue);
  1432. lua_rawset(L,-3);
  1433. break;
  1434. case SWIG_LUA_STRING:
  1435. lua_pushstring(L,constants[i].name);
  1436. lua_pushstring(L,(char *) constants[i].pvalue);
  1437. lua_rawset(L,-3);
  1438. break;
  1439. case SWIG_LUA_POINTER:
  1440. lua_pushstring(L,constants[i].name);
  1441. SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
  1442. lua_rawset(L,-3);
  1443. break;
  1444. case SWIG_LUA_BINARY:
  1445. lua_pushstring(L,constants[i].name);
  1446. SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
  1447. lua_rawset(L,-3);
  1448. break;
  1449. default:
  1450. break;
  1451. }
  1452. }
  1453. }
  1454. #endif
  1455. /* -----------------------------------------------------------------------------
  1456. * executing lua code from within the wrapper
  1457. * ----------------------------------------------------------------------------- */
  1458. #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
  1459. #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
  1460. #endif
  1461. /* Executes a C string in Lua a really simple way of calling lua from C
  1462. Unfortunately lua keeps changing its API's, so we need a conditional compile
  1463. In lua 5.0.X its lua_dostring()
  1464. In lua 5.1.X its luaL_dostring()
  1465. */
  1466. SWIGINTERN int
  1467. SWIG_Lua_dostring(lua_State *L, const char* str) {
  1468. int ok,top;
  1469. if (str==0 || str[0]==0) return 0; /* nothing to do */
  1470. top=lua_gettop(L); /* save stack */
  1471. #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
  1472. ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */
  1473. #else
  1474. ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */
  1475. #endif
  1476. if (ok!=0) {
  1477. SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
  1478. }
  1479. lua_settop(L,top); /* restore the stack */
  1480. return ok;
  1481. }
  1482. #ifdef __cplusplus
  1483. }
  1484. #endif
  1485. /* ------------------------------ end luarun.swg ------------------------------ */
  1486. /* -------- TYPES TABLE (BEGIN) -------- */
  1487. #define SWIGTYPE_p_ESLconnection swig_types[0]
  1488. #define SWIGTYPE_p_ESLevent swig_types[1]
  1489. #define SWIGTYPE_p_esl_event_t swig_types[2]
  1490. #define SWIGTYPE_p_esl_priority_t swig_types[3]
  1491. static swig_type_info *swig_types[5];
  1492. static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0};
  1493. #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
  1494. #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
  1495. /* -------- TYPES TABLE (END) -------- */
  1496. #define SWIG_name "ESL"
  1497. #define SWIG_init luaopen_ESL
  1498. #define SWIG_init_user luaopen_ESL_user
  1499. #define SWIG_LUACODE luaopen_ESL_luacode
  1500. namespace swig {
  1501. typedef struct{} LANGUAGE_OBJ;
  1502. }
  1503. #include "esl.h"
  1504. #include "esl_oop.h"
  1505. SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
  1506. int ret = lua_isstring(L, idx);
  1507. if (!ret)
  1508. ret = lua_isnil(L, idx);
  1509. return ret;
  1510. }
  1511. #ifdef __cplusplus
  1512. extern "C" {
  1513. #endif
  1514. static int _wrap_ESLevent_event_set(lua_State* L) {
  1515. int SWIG_arg = 0;
  1516. ESLevent *arg1 = (ESLevent *) 0 ;
  1517. esl_event_t *arg2 = (esl_event_t *) 0 ;
  1518. SWIG_check_num_args("ESLevent::event",2,2)
  1519. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::event",1,"ESLevent *");
  1520. if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("ESLevent::event",2,"esl_event_t *");
  1521. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1522. SWIG_fail_ptr("ESLevent_event_set",1,SWIGTYPE_p_ESLevent);
  1523. }
  1524. if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_esl_event_t,SWIG_POINTER_DISOWN))){
  1525. SWIG_fail_ptr("ESLevent_event_set",2,SWIGTYPE_p_esl_event_t);
  1526. }
  1527. if (arg1) (arg1)->event = arg2;
  1528. return SWIG_arg;
  1529. if(0) SWIG_fail;
  1530. fail:
  1531. lua_error(L);
  1532. return SWIG_arg;
  1533. }
  1534. static int _wrap_ESLevent_event_get(lua_State* L) {
  1535. int SWIG_arg = 0;
  1536. ESLevent *arg1 = (ESLevent *) 0 ;
  1537. esl_event_t *result = 0 ;
  1538. SWIG_check_num_args("ESLevent::event",1,1)
  1539. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::event",1,"ESLevent *");
  1540. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1541. SWIG_fail_ptr("ESLevent_event_get",1,SWIGTYPE_p_ESLevent);
  1542. }
  1543. result = (esl_event_t *) ((arg1)->event);
  1544. SWIG_NewPointerObj(L,result,SWIGTYPE_p_esl_event_t,0); SWIG_arg++;
  1545. return SWIG_arg;
  1546. if(0) SWIG_fail;
  1547. fail:
  1548. lua_error(L);
  1549. return SWIG_arg;
  1550. }
  1551. static int _wrap_ESLevent_serialized_string_set(lua_State* L) {
  1552. int SWIG_arg = 0;
  1553. ESLevent *arg1 = (ESLevent *) 0 ;
  1554. char *arg2 = (char *) 0 ;
  1555. SWIG_check_num_args("ESLevent::serialized_string",2,2)
  1556. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::serialized_string",1,"ESLevent *");
  1557. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::serialized_string",2,"char *");
  1558. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1559. SWIG_fail_ptr("ESLevent_serialized_string_set",1,SWIGTYPE_p_ESLevent);
  1560. }
  1561. arg2 = (char *)lua_tostring(L, 2);
  1562. {
  1563. delete [] arg1->serialized_string;
  1564. if (arg2) {
  1565. arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
  1566. strcpy((char *)arg1->serialized_string, (const char *)arg2);
  1567. } else {
  1568. arg1->serialized_string = 0;
  1569. }
  1570. }
  1571. return SWIG_arg;
  1572. if(0) SWIG_fail;
  1573. fail:
  1574. lua_error(L);
  1575. return SWIG_arg;
  1576. }
  1577. static int _wrap_ESLevent_serialized_string_get(lua_State* L) {
  1578. int SWIG_arg = 0;
  1579. ESLevent *arg1 = (ESLevent *) 0 ;
  1580. char *result = 0 ;
  1581. SWIG_check_num_args("ESLevent::serialized_string",1,1)
  1582. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::serialized_string",1,"ESLevent *");
  1583. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1584. SWIG_fail_ptr("ESLevent_serialized_string_get",1,SWIGTYPE_p_ESLevent);
  1585. }
  1586. result = (char *) ((arg1)->serialized_string);
  1587. lua_pushstring(L,(const char *)result); SWIG_arg++;
  1588. return SWIG_arg;
  1589. if(0) SWIG_fail;
  1590. fail:
  1591. lua_error(L);
  1592. return SWIG_arg;
  1593. }
  1594. static int _wrap_ESLevent_mine_set(lua_State* L) {
  1595. int SWIG_arg = 0;
  1596. ESLevent *arg1 = (ESLevent *) 0 ;
  1597. int arg2 ;
  1598. SWIG_check_num_args("ESLevent::mine",2,2)
  1599. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::mine",1,"ESLevent *");
  1600. if(!lua_isnumber(L,2)) SWIG_fail_arg("ESLevent::mine",2,"int");
  1601. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1602. SWIG_fail_ptr("ESLevent_mine_set",1,SWIGTYPE_p_ESLevent);
  1603. }
  1604. arg2 = (int)lua_tonumber(L, 2);
  1605. if (arg1) (arg1)->mine = arg2;
  1606. return SWIG_arg;
  1607. if(0) SWIG_fail;
  1608. fail:
  1609. lua_error(L);
  1610. return SWIG_arg;
  1611. }
  1612. static int _wrap_ESLevent_mine_get(lua_State* L) {
  1613. int SWIG_arg = 0;
  1614. ESLevent *arg1 = (ESLevent *) 0 ;
  1615. int result;
  1616. SWIG_check_num_args("ESLevent::mine",1,1)
  1617. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::mine",1,"ESLevent *");
  1618. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1619. SWIG_fail_ptr("ESLevent_mine_get",1,SWIGTYPE_p_ESLevent);
  1620. }
  1621. result = (int) ((arg1)->mine);
  1622. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  1623. return SWIG_arg;
  1624. if(0) SWIG_fail;
  1625. fail:
  1626. lua_error(L);
  1627. return SWIG_arg;
  1628. }
  1629. static int _wrap_new_ESLevent__SWIG_0(lua_State* L) {
  1630. int SWIG_arg = 0;
  1631. char *arg1 = (char *) 0 ;
  1632. char *arg2 = (char *) NULL ;
  1633. ESLevent *result = 0 ;
  1634. SWIG_check_num_args("ESLevent::ESLevent",1,2)
  1635. if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("ESLevent::ESLevent",1,"char const *");
  1636. if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::ESLevent",2,"char const *");
  1637. arg1 = (char *)lua_tostring(L, 1);
  1638. if(lua_gettop(L)>=2){
  1639. arg2 = (char *)lua_tostring(L, 2);
  1640. }
  1641. result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
  1642. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  1643. return SWIG_arg;
  1644. if(0) SWIG_fail;
  1645. fail:
  1646. lua_error(L);
  1647. return SWIG_arg;
  1648. }
  1649. static int _wrap_new_ESLevent__SWIG_1(lua_State* L) {
  1650. int SWIG_arg = 0;
  1651. esl_event_t *arg1 = (esl_event_t *) 0 ;
  1652. int arg2 = (int) 0 ;
  1653. ESLevent *result = 0 ;
  1654. SWIG_check_num_args("ESLevent::ESLevent",1,2)
  1655. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::ESLevent",1,"esl_event_t *");
  1656. if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("ESLevent::ESLevent",2,"int");
  1657. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_esl_event_t,0))){
  1658. SWIG_fail_ptr("new_ESLevent",1,SWIGTYPE_p_esl_event_t);
  1659. }
  1660. if(lua_gettop(L)>=2){
  1661. arg2 = (int)lua_tonumber(L, 2);
  1662. }
  1663. result = (ESLevent *)new ESLevent(arg1,arg2);
  1664. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  1665. return SWIG_arg;
  1666. if(0) SWIG_fail;
  1667. fail:
  1668. lua_error(L);
  1669. return SWIG_arg;
  1670. }
  1671. static int _wrap_new_ESLevent__SWIG_2(lua_State* L) {
  1672. int SWIG_arg = 0;
  1673. ESLevent *arg1 = (ESLevent *) 0 ;
  1674. ESLevent *result = 0 ;
  1675. SWIG_check_num_args("ESLevent::ESLevent",1,1)
  1676. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::ESLevent",1,"ESLevent *");
  1677. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1678. SWIG_fail_ptr("new_ESLevent",1,SWIGTYPE_p_ESLevent);
  1679. }
  1680. result = (ESLevent *)new ESLevent(arg1);
  1681. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  1682. return SWIG_arg;
  1683. if(0) SWIG_fail;
  1684. fail:
  1685. lua_error(L);
  1686. return SWIG_arg;
  1687. }
  1688. static int _wrap_new_ESLevent(lua_State* L) {
  1689. int argc;
  1690. int argv[3]={
  1691. 1,2,3
  1692. };
  1693. argc = lua_gettop(L);
  1694. if ((argc >= 1) && (argc <= 2)) {
  1695. int _v;
  1696. {
  1697. void *ptr;
  1698. if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_esl_event_t, 0)) {
  1699. _v = 0;
  1700. } else {
  1701. _v = 1;
  1702. }
  1703. }
  1704. if (_v) {
  1705. if (argc <= 1) {
  1706. return _wrap_new_ESLevent__SWIG_1(L);
  1707. }
  1708. {
  1709. _v = lua_isnumber(L,argv[1]);
  1710. }
  1711. if (_v) {
  1712. return _wrap_new_ESLevent__SWIG_1(L);
  1713. }
  1714. }
  1715. }
  1716. if (argc == 1) {
  1717. int _v;
  1718. {
  1719. void *ptr;
  1720. if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_ESLevent, 0)) {
  1721. _v = 0;
  1722. } else {
  1723. _v = 1;
  1724. }
  1725. }
  1726. if (_v) {
  1727. return _wrap_new_ESLevent__SWIG_2(L);
  1728. }
  1729. }
  1730. if ((argc >= 1) && (argc <= 2)) {
  1731. int _v;
  1732. {
  1733. _v = SWIG_lua_isnilstring(L,argv[0]);
  1734. }
  1735. if (_v) {
  1736. if (argc <= 1) {
  1737. return _wrap_new_ESLevent__SWIG_0(L);
  1738. }
  1739. {
  1740. _v = SWIG_lua_isnilstring(L,argv[1]);
  1741. }
  1742. if (_v) {
  1743. return _wrap_new_ESLevent__SWIG_0(L);
  1744. }
  1745. }
  1746. }
  1747. lua_pushstring(L,"Wrong arguments for overloaded function 'new_ESLevent'\n"
  1748. " Possible C/C++ prototypes are:\n"
  1749. " ESLevent::ESLevent(char const *,char const *)\n"
  1750. " ESLevent::ESLevent(esl_event_t *,int)\n"
  1751. " ESLevent::ESLevent(ESLevent *)\n");
  1752. lua_error(L);return 0;
  1753. }
  1754. static int _wrap_ESLevent_serialize(lua_State* L) {
  1755. int SWIG_arg = 0;
  1756. ESLevent *arg1 = (ESLevent *) 0 ;
  1757. char *arg2 = (char *) NULL ;
  1758. char *result = 0 ;
  1759. SWIG_check_num_args("ESLevent::serialize",1,2)
  1760. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::serialize",1,"ESLevent *");
  1761. if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::serialize",2,"char const *");
  1762. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1763. SWIG_fail_ptr("ESLevent_serialize",1,SWIGTYPE_p_ESLevent);
  1764. }
  1765. if(lua_gettop(L)>=2){
  1766. arg2 = (char *)lua_tostring(L, 2);
  1767. }
  1768. result = (char *)(arg1)->serialize((char const *)arg2);
  1769. lua_pushstring(L,(const char *)result); SWIG_arg++;
  1770. return SWIG_arg;
  1771. if(0) SWIG_fail;
  1772. fail:
  1773. lua_error(L);
  1774. return SWIG_arg;
  1775. }
  1776. static int _wrap_ESLevent_setPriority(lua_State* L) {
  1777. int SWIG_arg = 0;
  1778. ESLevent *arg1 = (ESLevent *) 0 ;
  1779. esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
  1780. esl_priority_t *argp2 ;
  1781. bool result;
  1782. SWIG_check_num_args("ESLevent::setPriority",1,2)
  1783. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::setPriority",1,"ESLevent *");
  1784. if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("ESLevent::setPriority",2,"esl_priority_t");
  1785. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1786. SWIG_fail_ptr("ESLevent_setPriority",1,SWIGTYPE_p_ESLevent);
  1787. }
  1788. if(lua_gettop(L)>=2){
  1789. if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_esl_priority_t,0))){
  1790. SWIG_fail_ptr("ESLevent_setPriority",2,SWIGTYPE_p_esl_priority_t);
  1791. }
  1792. arg2 = *argp2;
  1793. }
  1794. result = (bool)(arg1)->setPriority(arg2);
  1795. lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  1796. return SWIG_arg;
  1797. if(0) SWIG_fail;
  1798. fail:
  1799. lua_error(L);
  1800. return SWIG_arg;
  1801. }
  1802. static int _wrap_ESLevent_getHeader(lua_State* L) {
  1803. int SWIG_arg = 0;
  1804. ESLevent *arg1 = (ESLevent *) 0 ;
  1805. char *arg2 = (char *) 0 ;
  1806. int arg3 = (int) -1 ;
  1807. char *result = 0 ;
  1808. SWIG_check_num_args("ESLevent::getHeader",2,3)
  1809. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::getHeader",1,"ESLevent *");
  1810. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::getHeader",2,"char const *");
  1811. if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("ESLevent::getHeader",3,"int");
  1812. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1813. SWIG_fail_ptr("ESLevent_getHeader",1,SWIGTYPE_p_ESLevent);
  1814. }
  1815. arg2 = (char *)lua_tostring(L, 2);
  1816. if(lua_gettop(L)>=3){
  1817. arg3 = (int)lua_tonumber(L, 3);
  1818. }
  1819. result = (char *)(arg1)->getHeader((char const *)arg2,arg3);
  1820. lua_pushstring(L,(const char *)result); SWIG_arg++;
  1821. return SWIG_arg;
  1822. if(0) SWIG_fail;
  1823. fail:
  1824. lua_error(L);
  1825. return SWIG_arg;
  1826. }
  1827. static int _wrap_ESLevent_getBody(lua_State* L) {
  1828. int SWIG_arg = 0;
  1829. ESLevent *arg1 = (ESLevent *) 0 ;
  1830. char *result = 0 ;
  1831. SWIG_check_num_args("ESLevent::getBody",1,1)
  1832. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::getBody",1,"ESLevent *");
  1833. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1834. SWIG_fail_ptr("ESLevent_getBody",1,SWIGTYPE_p_ESLevent);
  1835. }
  1836. result = (char *)(arg1)->getBody();
  1837. lua_pushstring(L,(const char *)result); SWIG_arg++;
  1838. return SWIG_arg;
  1839. if(0) SWIG_fail;
  1840. fail:
  1841. lua_error(L);
  1842. return SWIG_arg;
  1843. }
  1844. static int _wrap_ESLevent_getType(lua_State* L) {
  1845. int SWIG_arg = 0;
  1846. ESLevent *arg1 = (ESLevent *) 0 ;
  1847. char *result = 0 ;
  1848. SWIG_check_num_args("ESLevent::getType",1,1)
  1849. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::getType",1,"ESLevent *");
  1850. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1851. SWIG_fail_ptr("ESLevent_getType",1,SWIGTYPE_p_ESLevent);
  1852. }
  1853. result = (char *)(arg1)->getType();
  1854. lua_pushstring(L,(const char *)result); SWIG_arg++;
  1855. return SWIG_arg;
  1856. if(0) SWIG_fail;
  1857. fail:
  1858. lua_error(L);
  1859. return SWIG_arg;
  1860. }
  1861. static int _wrap_ESLevent_addBody(lua_State* L) {
  1862. int SWIG_arg = 0;
  1863. ESLevent *arg1 = (ESLevent *) 0 ;
  1864. char *arg2 = (char *) 0 ;
  1865. bool result;
  1866. SWIG_check_num_args("ESLevent::addBody",2,2)
  1867. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::addBody",1,"ESLevent *");
  1868. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::addBody",2,"char const *");
  1869. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1870. SWIG_fail_ptr("ESLevent_addBody",1,SWIGTYPE_p_ESLevent);
  1871. }
  1872. arg2 = (char *)lua_tostring(L, 2);
  1873. result = (bool)(arg1)->addBody((char const *)arg2);
  1874. lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  1875. return SWIG_arg;
  1876. if(0) SWIG_fail;
  1877. fail:
  1878. lua_error(L);
  1879. return SWIG_arg;
  1880. }
  1881. static int _wrap_ESLevent_addHeader(lua_State* L) {
  1882. int SWIG_arg = 0;
  1883. ESLevent *arg1 = (ESLevent *) 0 ;
  1884. char *arg2 = (char *) 0 ;
  1885. char *arg3 = (char *) 0 ;
  1886. bool result;
  1887. SWIG_check_num_args("ESLevent::addHeader",3,3)
  1888. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::addHeader",1,"ESLevent *");
  1889. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::addHeader",2,"char const *");
  1890. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLevent::addHeader",3,"char const *");
  1891. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1892. SWIG_fail_ptr("ESLevent_addHeader",1,SWIGTYPE_p_ESLevent);
  1893. }
  1894. arg2 = (char *)lua_tostring(L, 2);
  1895. arg3 = (char *)lua_tostring(L, 3);
  1896. result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
  1897. lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  1898. return SWIG_arg;
  1899. if(0) SWIG_fail;
  1900. fail:
  1901. lua_error(L);
  1902. return SWIG_arg;
  1903. }
  1904. static int _wrap_ESLevent_pushHeader(lua_State* L) {
  1905. int SWIG_arg = 0;
  1906. ESLevent *arg1 = (ESLevent *) 0 ;
  1907. char *arg2 = (char *) 0 ;
  1908. char *arg3 = (char *) 0 ;
  1909. bool result;
  1910. SWIG_check_num_args("ESLevent::pushHeader",3,3)
  1911. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::pushHeader",1,"ESLevent *");
  1912. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::pushHeader",2,"char const *");
  1913. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLevent::pushHeader",3,"char const *");
  1914. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1915. SWIG_fail_ptr("ESLevent_pushHeader",1,SWIGTYPE_p_ESLevent);
  1916. }
  1917. arg2 = (char *)lua_tostring(L, 2);
  1918. arg3 = (char *)lua_tostring(L, 3);
  1919. result = (bool)(arg1)->pushHeader((char const *)arg2,(char const *)arg3);
  1920. lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  1921. return SWIG_arg;
  1922. if(0) SWIG_fail;
  1923. fail:
  1924. lua_error(L);
  1925. return SWIG_arg;
  1926. }
  1927. static int _wrap_ESLevent_unshiftHeader(lua_State* L) {
  1928. int SWIG_arg = 0;
  1929. ESLevent *arg1 = (ESLevent *) 0 ;
  1930. char *arg2 = (char *) 0 ;
  1931. char *arg3 = (char *) 0 ;
  1932. bool result;
  1933. SWIG_check_num_args("ESLevent::unshiftHeader",3,3)
  1934. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::unshiftHeader",1,"ESLevent *");
  1935. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::unshiftHeader",2,"char const *");
  1936. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLevent::unshiftHeader",3,"char const *");
  1937. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1938. SWIG_fail_ptr("ESLevent_unshiftHeader",1,SWIGTYPE_p_ESLevent);
  1939. }
  1940. arg2 = (char *)lua_tostring(L, 2);
  1941. arg3 = (char *)lua_tostring(L, 3);
  1942. result = (bool)(arg1)->unshiftHeader((char const *)arg2,(char const *)arg3);
  1943. lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  1944. return SWIG_arg;
  1945. if(0) SWIG_fail;
  1946. fail:
  1947. lua_error(L);
  1948. return SWIG_arg;
  1949. }
  1950. static int _wrap_ESLevent_delHeader(lua_State* L) {
  1951. int SWIG_arg = 0;
  1952. ESLevent *arg1 = (ESLevent *) 0 ;
  1953. char *arg2 = (char *) 0 ;
  1954. bool result;
  1955. SWIG_check_num_args("ESLevent::delHeader",2,2)
  1956. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::delHeader",1,"ESLevent *");
  1957. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLevent::delHeader",2,"char const *");
  1958. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1959. SWIG_fail_ptr("ESLevent_delHeader",1,SWIGTYPE_p_ESLevent);
  1960. }
  1961. arg2 = (char *)lua_tostring(L, 2);
  1962. result = (bool)(arg1)->delHeader((char const *)arg2);
  1963. lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  1964. return SWIG_arg;
  1965. if(0) SWIG_fail;
  1966. fail:
  1967. lua_error(L);
  1968. return SWIG_arg;
  1969. }
  1970. static int _wrap_ESLevent_firstHeader(lua_State* L) {
  1971. int SWIG_arg = 0;
  1972. ESLevent *arg1 = (ESLevent *) 0 ;
  1973. char *result = 0 ;
  1974. SWIG_check_num_args("ESLevent::firstHeader",1,1)
  1975. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::firstHeader",1,"ESLevent *");
  1976. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1977. SWIG_fail_ptr("ESLevent_firstHeader",1,SWIGTYPE_p_ESLevent);
  1978. }
  1979. result = (char *)(arg1)->firstHeader();
  1980. lua_pushstring(L,(const char *)result); SWIG_arg++;
  1981. return SWIG_arg;
  1982. if(0) SWIG_fail;
  1983. fail:
  1984. lua_error(L);
  1985. return SWIG_arg;
  1986. }
  1987. static int _wrap_ESLevent_nextHeader(lua_State* L) {
  1988. int SWIG_arg = 0;
  1989. ESLevent *arg1 = (ESLevent *) 0 ;
  1990. char *result = 0 ;
  1991. SWIG_check_num_args("ESLevent::nextHeader",1,1)
  1992. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLevent::nextHeader",1,"ESLevent *");
  1993. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
  1994. SWIG_fail_ptr("ESLevent_nextHeader",1,SWIGTYPE_p_ESLevent);
  1995. }
  1996. result = (char *)(arg1)->nextHeader();
  1997. lua_pushstring(L,(const char *)result); SWIG_arg++;
  1998. return SWIG_arg;
  1999. if(0) SWIG_fail;
  2000. fail:
  2001. lua_error(L);
  2002. return SWIG_arg;
  2003. }
  2004. static void swig_delete_ESLevent(void *obj) {
  2005. ESLevent *arg1 = (ESLevent *) obj;
  2006. delete arg1;
  2007. }
  2008. static swig_lua_method swig_ESLevent_methods[] = {
  2009. {"serialize", _wrap_ESLevent_serialize},
  2010. {"setPriority", _wrap_ESLevent_setPriority},
  2011. {"getHeader", _wrap_ESLevent_getHeader},
  2012. {"getBody", _wrap_ESLevent_getBody},
  2013. {"getType", _wrap_ESLevent_getType},
  2014. {"addBody", _wrap_ESLevent_addBody},
  2015. {"addHeader", _wrap_ESLevent_addHeader},
  2016. {"pushHeader", _wrap_ESLevent_pushHeader},
  2017. {"unshiftHeader", _wrap_ESLevent_unshiftHeader},
  2018. {"delHeader", _wrap_ESLevent_delHeader},
  2019. {"firstHeader", _wrap_ESLevent_firstHeader},
  2020. {"nextHeader", _wrap_ESLevent_nextHeader},
  2021. {0,0}
  2022. };
  2023. static swig_lua_attribute swig_ESLevent_attributes[] = {
  2024. { "event", _wrap_ESLevent_event_get, _wrap_ESLevent_event_set},
  2025. { "serialized_string", _wrap_ESLevent_serialized_string_get, _wrap_ESLevent_serialized_string_set},
  2026. { "mine", _wrap_ESLevent_mine_get, _wrap_ESLevent_mine_set},
  2027. {0,0,0}
  2028. };
  2029. static swig_lua_class *swig_ESLevent_bases[] = {0};
  2030. static const char *swig_ESLevent_base_names[] = {0};
  2031. static swig_lua_class _wrap_class_ESLevent = { "ESLevent", &SWIGTYPE_p_ESLevent,_wrap_new_ESLevent, swig_delete_ESLevent, swig_ESLevent_methods, swig_ESLevent_attributes, swig_ESLevent_bases, swig_ESLevent_base_names };
  2032. static int _wrap_new_ESLconnection__SWIG_0(lua_State* L) {
  2033. int SWIG_arg = 0;
  2034. char *arg1 = (char *) 0 ;
  2035. int arg2 ;
  2036. char *arg3 = (char *) 0 ;
  2037. char *arg4 = (char *) 0 ;
  2038. ESLconnection *result = 0 ;
  2039. SWIG_check_num_args("ESLconnection::ESLconnection",4,4)
  2040. if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("ESLconnection::ESLconnection",1,"char const *");
  2041. if(!lua_isnumber(L,2)) SWIG_fail_arg("ESLconnection::ESLconnection",2,"int const");
  2042. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::ESLconnection",3,"char const *");
  2043. if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("ESLconnection::ESLconnection",4,"char const *");
  2044. arg1 = (char *)lua_tostring(L, 1);
  2045. arg2 = (int const)lua_tonumber(L, 2);
  2046. arg3 = (char *)lua_tostring(L, 3);
  2047. arg4 = (char *)lua_tostring(L, 4);
  2048. result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
  2049. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLconnection,1); SWIG_arg++;
  2050. return SWIG_arg;
  2051. if(0) SWIG_fail;
  2052. fail:
  2053. lua_error(L);
  2054. return SWIG_arg;
  2055. }
  2056. static int _wrap_new_ESLconnection__SWIG_1(lua_State* L) {
  2057. int SWIG_arg = 0;
  2058. char *arg1 = (char *) 0 ;
  2059. int arg2 ;
  2060. char *arg3 = (char *) 0 ;
  2061. ESLconnection *result = 0 ;
  2062. SWIG_check_num_args("ESLconnection::ESLconnection",3,3)
  2063. if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("ESLconnection::ESLconnection",1,"char const *");
  2064. if(!lua_isnumber(L,2)) SWIG_fail_arg("ESLconnection::ESLconnection",2,"int const");
  2065. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::ESLconnection",3,"char const *");
  2066. arg1 = (char *)lua_tostring(L, 1);
  2067. arg2 = (int const)lua_tonumber(L, 2);
  2068. arg3 = (char *)lua_tostring(L, 3);
  2069. result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
  2070. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLconnection,1); SWIG_arg++;
  2071. return SWIG_arg;
  2072. if(0) SWIG_fail;
  2073. fail:
  2074. lua_error(L);
  2075. return SWIG_arg;
  2076. }
  2077. static int _wrap_new_ESLconnection__SWIG_2(lua_State* L) {
  2078. int SWIG_arg = 0;
  2079. char *arg1 = (char *) 0 ;
  2080. char *arg2 = (char *) 0 ;
  2081. char *arg3 = (char *) 0 ;
  2082. char *arg4 = (char *) 0 ;
  2083. ESLconnection *result = 0 ;
  2084. SWIG_check_num_args("ESLconnection::ESLconnection",4,4)
  2085. if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("ESLconnection::ESLconnection",1,"char const *");
  2086. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::ESLconnection",2,"char const *");
  2087. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::ESLconnection",3,"char const *");
  2088. if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("ESLconnection::ESLconnection",4,"char const *");
  2089. arg1 = (char *)lua_tostring(L, 1);
  2090. arg2 = (char *)lua_tostring(L, 2);
  2091. arg3 = (char *)lua_tostring(L, 3);
  2092. arg4 = (char *)lua_tostring(L, 4);
  2093. result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
  2094. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLconnection,1); SWIG_arg++;
  2095. return SWIG_arg;
  2096. if(0) SWIG_fail;
  2097. fail:
  2098. lua_error(L);
  2099. return SWIG_arg;
  2100. }
  2101. static int _wrap_new_ESLconnection__SWIG_3(lua_State* L) {
  2102. int SWIG_arg = 0;
  2103. char *arg1 = (char *) 0 ;
  2104. char *arg2 = (char *) 0 ;
  2105. char *arg3 = (char *) 0 ;
  2106. ESLconnection *result = 0 ;
  2107. SWIG_check_num_args("ESLconnection::ESLconnection",3,3)
  2108. if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("ESLconnection::ESLconnection",1,"char const *");
  2109. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::ESLconnection",2,"char const *");
  2110. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::ESLconnection",3,"char const *");
  2111. arg1 = (char *)lua_tostring(L, 1);
  2112. arg2 = (char *)lua_tostring(L, 2);
  2113. arg3 = (char *)lua_tostring(L, 3);
  2114. result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
  2115. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLconnection,1); SWIG_arg++;
  2116. return SWIG_arg;
  2117. if(0) SWIG_fail;
  2118. fail:
  2119. lua_error(L);
  2120. return SWIG_arg;
  2121. }
  2122. static int _wrap_new_ESLconnection__SWIG_4(lua_State* L) {
  2123. int SWIG_arg = 0;
  2124. int arg1 ;
  2125. ESLconnection *result = 0 ;
  2126. SWIG_check_num_args("ESLconnection::ESLconnection",1,1)
  2127. if(!lua_isnumber(L,1)) SWIG_fail_arg("ESLconnection::ESLconnection",1,"int");
  2128. arg1 = (int)lua_tonumber(L, 1);
  2129. result = (ESLconnection *)new ESLconnection(arg1);
  2130. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLconnection,1); SWIG_arg++;
  2131. return SWIG_arg;
  2132. if(0) SWIG_fail;
  2133. fail:
  2134. lua_error(L);
  2135. return SWIG_arg;
  2136. }
  2137. static int _wrap_new_ESLconnection(lua_State* L) {
  2138. int argc;
  2139. int argv[5]={
  2140. 1,2,3,4,5
  2141. };
  2142. argc = lua_gettop(L);
  2143. if (argc == 1) {
  2144. int _v;
  2145. {
  2146. _v = lua_isnumber(L,argv[0]);
  2147. }
  2148. if (_v) {
  2149. return _wrap_new_ESLconnection__SWIG_4(L);
  2150. }
  2151. }
  2152. if (argc == 3) {
  2153. int _v;
  2154. {
  2155. _v = SWIG_lua_isnilstring(L,argv[0]);
  2156. }
  2157. if (_v) {
  2158. {
  2159. _v = lua_isnumber(L,argv[1]);
  2160. }
  2161. if (_v) {
  2162. {
  2163. _v = SWIG_lua_isnilstring(L,argv[2]);
  2164. }
  2165. if (_v) {
  2166. return _wrap_new_ESLconnection__SWIG_1(L);
  2167. }
  2168. }
  2169. }
  2170. }
  2171. if (argc == 3) {
  2172. int _v;
  2173. {
  2174. _v = SWIG_lua_isnilstring(L,argv[0]);
  2175. }
  2176. if (_v) {
  2177. {
  2178. _v = SWIG_lua_isnilstring(L,argv[1]);
  2179. }
  2180. if (_v) {
  2181. {
  2182. _v = SWIG_lua_isnilstring(L,argv[2]);
  2183. }
  2184. if (_v) {
  2185. return _wrap_new_ESLconnection__SWIG_3(L);
  2186. }
  2187. }
  2188. }
  2189. }
  2190. if (argc == 4) {
  2191. int _v;
  2192. {
  2193. _v = SWIG_lua_isnilstring(L,argv[0]);
  2194. }
  2195. if (_v) {
  2196. {
  2197. _v = lua_isnumber(L,argv[1]);
  2198. }
  2199. if (_v) {
  2200. {
  2201. _v = SWIG_lua_isnilstring(L,argv[2]);
  2202. }
  2203. if (_v) {
  2204. {
  2205. _v = SWIG_lua_isnilstring(L,argv[3]);
  2206. }
  2207. if (_v) {
  2208. return _wrap_new_ESLconnection__SWIG_0(L);
  2209. }
  2210. }
  2211. }
  2212. }
  2213. }
  2214. if (argc == 4) {
  2215. int _v;
  2216. {
  2217. _v = SWIG_lua_isnilstring(L,argv[0]);
  2218. }
  2219. if (_v) {
  2220. {
  2221. _v = SWIG_lua_isnilstring(L,argv[1]);
  2222. }
  2223. if (_v) {
  2224. {
  2225. _v = SWIG_lua_isnilstring(L,argv[2]);
  2226. }
  2227. if (_v) {
  2228. {
  2229. _v = SWIG_lua_isnilstring(L,argv[3]);
  2230. }
  2231. if (_v) {
  2232. return _wrap_new_ESLconnection__SWIG_2(L);
  2233. }
  2234. }
  2235. }
  2236. }
  2237. }
  2238. lua_pushstring(L,"Wrong arguments for overloaded function 'new_ESLconnection'\n"
  2239. " Possible C/C++ prototypes are:\n"
  2240. " ESLconnection::ESLconnection(char const *,int const,char const *,char const *)\n"
  2241. " ESLconnection::ESLconnection(char const *,int const,char const *)\n"
  2242. " ESLconnection::ESLconnection(char const *,char const *,char const *,char const *)\n"
  2243. " ESLconnection::ESLconnection(char const *,char const *,char const *)\n"
  2244. " ESLconnection::ESLconnection(int)\n");
  2245. lua_error(L);return 0;
  2246. }
  2247. static int _wrap_ESLconnection_socketDescriptor(lua_State* L) {
  2248. int SWIG_arg = 0;
  2249. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2250. int result;
  2251. SWIG_check_num_args("ESLconnection::socketDescriptor",1,1)
  2252. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::socketDescriptor",1,"ESLconnection *");
  2253. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2254. SWIG_fail_ptr("ESLconnection_socketDescriptor",1,SWIGTYPE_p_ESLconnection);
  2255. }
  2256. result = (int)(arg1)->socketDescriptor();
  2257. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2258. return SWIG_arg;
  2259. if(0) SWIG_fail;
  2260. fail:
  2261. lua_error(L);
  2262. return SWIG_arg;
  2263. }
  2264. static int _wrap_ESLconnection_connected(lua_State* L) {
  2265. int SWIG_arg = 0;
  2266. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2267. int result;
  2268. SWIG_check_num_args("ESLconnection::connected",1,1)
  2269. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::connected",1,"ESLconnection *");
  2270. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2271. SWIG_fail_ptr("ESLconnection_connected",1,SWIGTYPE_p_ESLconnection);
  2272. }
  2273. result = (int)(arg1)->connected();
  2274. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2275. return SWIG_arg;
  2276. if(0) SWIG_fail;
  2277. fail:
  2278. lua_error(L);
  2279. return SWIG_arg;
  2280. }
  2281. static int _wrap_ESLconnection_getInfo(lua_State* L) {
  2282. int SWIG_arg = 0;
  2283. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2284. ESLevent *result = 0 ;
  2285. SWIG_check_num_args("ESLconnection::getInfo",1,1)
  2286. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::getInfo",1,"ESLconnection *");
  2287. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2288. SWIG_fail_ptr("ESLconnection_getInfo",1,SWIGTYPE_p_ESLconnection);
  2289. }
  2290. result = (ESLevent *)(arg1)->getInfo();
  2291. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2292. return SWIG_arg;
  2293. if(0) SWIG_fail;
  2294. fail:
  2295. lua_error(L);
  2296. return SWIG_arg;
  2297. }
  2298. static int _wrap_ESLconnection_send(lua_State* L) {
  2299. int SWIG_arg = 0;
  2300. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2301. char *arg2 = (char *) 0 ;
  2302. int result;
  2303. SWIG_check_num_args("ESLconnection::send",2,2)
  2304. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::send",1,"ESLconnection *");
  2305. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::send",2,"char const *");
  2306. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2307. SWIG_fail_ptr("ESLconnection_send",1,SWIGTYPE_p_ESLconnection);
  2308. }
  2309. arg2 = (char *)lua_tostring(L, 2);
  2310. result = (int)(arg1)->send((char const *)arg2);
  2311. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2312. return SWIG_arg;
  2313. if(0) SWIG_fail;
  2314. fail:
  2315. lua_error(L);
  2316. return SWIG_arg;
  2317. }
  2318. static int _wrap_ESLconnection_sendRecv(lua_State* L) {
  2319. int SWIG_arg = 0;
  2320. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2321. char *arg2 = (char *) 0 ;
  2322. ESLevent *result = 0 ;
  2323. SWIG_check_num_args("ESLconnection::sendRecv",2,2)
  2324. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::sendRecv",1,"ESLconnection *");
  2325. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::sendRecv",2,"char const *");
  2326. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2327. SWIG_fail_ptr("ESLconnection_sendRecv",1,SWIGTYPE_p_ESLconnection);
  2328. }
  2329. arg2 = (char *)lua_tostring(L, 2);
  2330. result = (ESLevent *)(arg1)->sendRecv((char const *)arg2);
  2331. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2332. return SWIG_arg;
  2333. if(0) SWIG_fail;
  2334. fail:
  2335. lua_error(L);
  2336. return SWIG_arg;
  2337. }
  2338. static int _wrap_ESLconnection_api(lua_State* L) {
  2339. int SWIG_arg = 0;
  2340. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2341. char *arg2 = (char *) 0 ;
  2342. char *arg3 = (char *) NULL ;
  2343. ESLevent *result = 0 ;
  2344. SWIG_check_num_args("ESLconnection::api",2,3)
  2345. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::api",1,"ESLconnection *");
  2346. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::api",2,"char const *");
  2347. if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::api",3,"char const *");
  2348. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2349. SWIG_fail_ptr("ESLconnection_api",1,SWIGTYPE_p_ESLconnection);
  2350. }
  2351. arg2 = (char *)lua_tostring(L, 2);
  2352. if(lua_gettop(L)>=3){
  2353. arg3 = (char *)lua_tostring(L, 3);
  2354. }
  2355. result = (ESLevent *)(arg1)->api((char const *)arg2,(char const *)arg3);
  2356. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2357. return SWIG_arg;
  2358. if(0) SWIG_fail;
  2359. fail:
  2360. lua_error(L);
  2361. return SWIG_arg;
  2362. }
  2363. static int _wrap_ESLconnection_bgapi(lua_State* L) {
  2364. int SWIG_arg = 0;
  2365. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2366. char *arg2 = (char *) 0 ;
  2367. char *arg3 = (char *) NULL ;
  2368. char *arg4 = (char *) NULL ;
  2369. ESLevent *result = 0 ;
  2370. SWIG_check_num_args("ESLconnection::bgapi",2,4)
  2371. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::bgapi",1,"ESLconnection *");
  2372. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::bgapi",2,"char const *");
  2373. if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::bgapi",3,"char const *");
  2374. if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("ESLconnection::bgapi",4,"char const *");
  2375. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2376. SWIG_fail_ptr("ESLconnection_bgapi",1,SWIGTYPE_p_ESLconnection);
  2377. }
  2378. arg2 = (char *)lua_tostring(L, 2);
  2379. if(lua_gettop(L)>=3){
  2380. arg3 = (char *)lua_tostring(L, 3);
  2381. }
  2382. if(lua_gettop(L)>=4){
  2383. arg4 = (char *)lua_tostring(L, 4);
  2384. }
  2385. result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
  2386. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2387. return SWIG_arg;
  2388. if(0) SWIG_fail;
  2389. fail:
  2390. lua_error(L);
  2391. return SWIG_arg;
  2392. }
  2393. static int _wrap_ESLconnection_sendEvent(lua_State* L) {
  2394. int SWIG_arg = 0;
  2395. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2396. ESLevent *arg2 = (ESLevent *) 0 ;
  2397. ESLevent *result = 0 ;
  2398. SWIG_check_num_args("ESLconnection::sendEvent",2,2)
  2399. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::sendEvent",1,"ESLconnection *");
  2400. if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("ESLconnection::sendEvent",2,"ESLevent *");
  2401. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2402. SWIG_fail_ptr("ESLconnection_sendEvent",1,SWIGTYPE_p_ESLconnection);
  2403. }
  2404. if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_ESLevent,0))){
  2405. SWIG_fail_ptr("ESLconnection_sendEvent",2,SWIGTYPE_p_ESLevent);
  2406. }
  2407. result = (ESLevent *)(arg1)->sendEvent(arg2);
  2408. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2409. return SWIG_arg;
  2410. if(0) SWIG_fail;
  2411. fail:
  2412. lua_error(L);
  2413. return SWIG_arg;
  2414. }
  2415. static int _wrap_ESLconnection_sendMSG(lua_State* L) {
  2416. int SWIG_arg = 0;
  2417. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2418. ESLevent *arg2 = (ESLevent *) 0 ;
  2419. char *arg3 = (char *) NULL ;
  2420. int result;
  2421. SWIG_check_num_args("ESLconnection::sendMSG",2,3)
  2422. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::sendMSG",1,"ESLconnection *");
  2423. if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("ESLconnection::sendMSG",2,"ESLevent *");
  2424. if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::sendMSG",3,"char const *");
  2425. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2426. SWIG_fail_ptr("ESLconnection_sendMSG",1,SWIGTYPE_p_ESLconnection);
  2427. }
  2428. if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_ESLevent,0))){
  2429. SWIG_fail_ptr("ESLconnection_sendMSG",2,SWIGTYPE_p_ESLevent);
  2430. }
  2431. if(lua_gettop(L)>=3){
  2432. arg3 = (char *)lua_tostring(L, 3);
  2433. }
  2434. result = (int)(arg1)->sendMSG(arg2,(char const *)arg3);
  2435. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2436. return SWIG_arg;
  2437. if(0) SWIG_fail;
  2438. fail:
  2439. lua_error(L);
  2440. return SWIG_arg;
  2441. }
  2442. static int _wrap_ESLconnection_recvEvent(lua_State* L) {
  2443. int SWIG_arg = 0;
  2444. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2445. ESLevent *result = 0 ;
  2446. SWIG_check_num_args("ESLconnection::recvEvent",1,1)
  2447. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::recvEvent",1,"ESLconnection *");
  2448. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2449. SWIG_fail_ptr("ESLconnection_recvEvent",1,SWIGTYPE_p_ESLconnection);
  2450. }
  2451. result = (ESLevent *)(arg1)->recvEvent();
  2452. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2453. return SWIG_arg;
  2454. if(0) SWIG_fail;
  2455. fail:
  2456. lua_error(L);
  2457. return SWIG_arg;
  2458. }
  2459. static int _wrap_ESLconnection_recvEventTimed(lua_State* L) {
  2460. int SWIG_arg = 0;
  2461. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2462. int arg2 ;
  2463. ESLevent *result = 0 ;
  2464. SWIG_check_num_args("ESLconnection::recvEventTimed",2,2)
  2465. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::recvEventTimed",1,"ESLconnection *");
  2466. if(!lua_isnumber(L,2)) SWIG_fail_arg("ESLconnection::recvEventTimed",2,"int");
  2467. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2468. SWIG_fail_ptr("ESLconnection_recvEventTimed",1,SWIGTYPE_p_ESLconnection);
  2469. }
  2470. arg2 = (int)lua_tonumber(L, 2);
  2471. result = (ESLevent *)(arg1)->recvEventTimed(arg2);
  2472. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2473. return SWIG_arg;
  2474. if(0) SWIG_fail;
  2475. fail:
  2476. lua_error(L);
  2477. return SWIG_arg;
  2478. }
  2479. static int _wrap_ESLconnection_filter(lua_State* L) {
  2480. int SWIG_arg = 0;
  2481. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2482. char *arg2 = (char *) 0 ;
  2483. char *arg3 = (char *) 0 ;
  2484. ESLevent *result = 0 ;
  2485. SWIG_check_num_args("ESLconnection::filter",3,3)
  2486. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::filter",1,"ESLconnection *");
  2487. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::filter",2,"char const *");
  2488. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::filter",3,"char const *");
  2489. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2490. SWIG_fail_ptr("ESLconnection_filter",1,SWIGTYPE_p_ESLconnection);
  2491. }
  2492. arg2 = (char *)lua_tostring(L, 2);
  2493. arg3 = (char *)lua_tostring(L, 3);
  2494. result = (ESLevent *)(arg1)->filter((char const *)arg2,(char const *)arg3);
  2495. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2496. return SWIG_arg;
  2497. if(0) SWIG_fail;
  2498. fail:
  2499. lua_error(L);
  2500. return SWIG_arg;
  2501. }
  2502. static int _wrap_ESLconnection_events(lua_State* L) {
  2503. int SWIG_arg = 0;
  2504. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2505. char *arg2 = (char *) 0 ;
  2506. char *arg3 = (char *) 0 ;
  2507. int result;
  2508. SWIG_check_num_args("ESLconnection::events",3,3)
  2509. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::events",1,"ESLconnection *");
  2510. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::events",2,"char const *");
  2511. if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::events",3,"char const *");
  2512. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2513. SWIG_fail_ptr("ESLconnection_events",1,SWIGTYPE_p_ESLconnection);
  2514. }
  2515. arg2 = (char *)lua_tostring(L, 2);
  2516. arg3 = (char *)lua_tostring(L, 3);
  2517. result = (int)(arg1)->events((char const *)arg2,(char const *)arg3);
  2518. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2519. return SWIG_arg;
  2520. if(0) SWIG_fail;
  2521. fail:
  2522. lua_error(L);
  2523. return SWIG_arg;
  2524. }
  2525. static int _wrap_ESLconnection_execute(lua_State* L) {
  2526. int SWIG_arg = 0;
  2527. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2528. char *arg2 = (char *) 0 ;
  2529. char *arg3 = (char *) NULL ;
  2530. char *arg4 = (char *) NULL ;
  2531. ESLevent *result = 0 ;
  2532. SWIG_check_num_args("ESLconnection::execute",2,4)
  2533. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::execute",1,"ESLconnection *");
  2534. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::execute",2,"char const *");
  2535. if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::execute",3,"char const *");
  2536. if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("ESLconnection::execute",4,"char const *");
  2537. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2538. SWIG_fail_ptr("ESLconnection_execute",1,SWIGTYPE_p_ESLconnection);
  2539. }
  2540. arg2 = (char *)lua_tostring(L, 2);
  2541. if(lua_gettop(L)>=3){
  2542. arg3 = (char *)lua_tostring(L, 3);
  2543. }
  2544. if(lua_gettop(L)>=4){
  2545. arg4 = (char *)lua_tostring(L, 4);
  2546. }
  2547. result = (ESLevent *)(arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
  2548. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2549. return SWIG_arg;
  2550. if(0) SWIG_fail;
  2551. fail:
  2552. lua_error(L);
  2553. return SWIG_arg;
  2554. }
  2555. static int _wrap_ESLconnection_executeAsync(lua_State* L) {
  2556. int SWIG_arg = 0;
  2557. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2558. char *arg2 = (char *) 0 ;
  2559. char *arg3 = (char *) NULL ;
  2560. char *arg4 = (char *) NULL ;
  2561. ESLevent *result = 0 ;
  2562. SWIG_check_num_args("ESLconnection::executeAsync",2,4)
  2563. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::executeAsync",1,"ESLconnection *");
  2564. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::executeAsync",2,"char const *");
  2565. if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("ESLconnection::executeAsync",3,"char const *");
  2566. if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("ESLconnection::executeAsync",4,"char const *");
  2567. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2568. SWIG_fail_ptr("ESLconnection_executeAsync",1,SWIGTYPE_p_ESLconnection);
  2569. }
  2570. arg2 = (char *)lua_tostring(L, 2);
  2571. if(lua_gettop(L)>=3){
  2572. arg3 = (char *)lua_tostring(L, 3);
  2573. }
  2574. if(lua_gettop(L)>=4){
  2575. arg4 = (char *)lua_tostring(L, 4);
  2576. }
  2577. result = (ESLevent *)(arg1)->executeAsync((char const *)arg2,(char const *)arg3,(char const *)arg4);
  2578. SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
  2579. return SWIG_arg;
  2580. if(0) SWIG_fail;
  2581. fail:
  2582. lua_error(L);
  2583. return SWIG_arg;
  2584. }
  2585. static int _wrap_ESLconnection_setAsyncExecute(lua_State* L) {
  2586. int SWIG_arg = 0;
  2587. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2588. char *arg2 = (char *) 0 ;
  2589. int result;
  2590. SWIG_check_num_args("ESLconnection::setAsyncExecute",2,2)
  2591. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::setAsyncExecute",1,"ESLconnection *");
  2592. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::setAsyncExecute",2,"char const *");
  2593. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2594. SWIG_fail_ptr("ESLconnection_setAsyncExecute",1,SWIGTYPE_p_ESLconnection);
  2595. }
  2596. arg2 = (char *)lua_tostring(L, 2);
  2597. result = (int)(arg1)->setAsyncExecute((char const *)arg2);
  2598. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2599. return SWIG_arg;
  2600. if(0) SWIG_fail;
  2601. fail:
  2602. lua_error(L);
  2603. return SWIG_arg;
  2604. }
  2605. static int _wrap_ESLconnection_setEventLock(lua_State* L) {
  2606. int SWIG_arg = 0;
  2607. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2608. char *arg2 = (char *) 0 ;
  2609. int result;
  2610. SWIG_check_num_args("ESLconnection::setEventLock",2,2)
  2611. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::setEventLock",1,"ESLconnection *");
  2612. if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("ESLconnection::setEventLock",2,"char const *");
  2613. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2614. SWIG_fail_ptr("ESLconnection_setEventLock",1,SWIGTYPE_p_ESLconnection);
  2615. }
  2616. arg2 = (char *)lua_tostring(L, 2);
  2617. result = (int)(arg1)->setEventLock((char const *)arg2);
  2618. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2619. return SWIG_arg;
  2620. if(0) SWIG_fail;
  2621. fail:
  2622. lua_error(L);
  2623. return SWIG_arg;
  2624. }
  2625. static int _wrap_ESLconnection_disconnect(lua_State* L) {
  2626. int SWIG_arg = 0;
  2627. ESLconnection *arg1 = (ESLconnection *) 0 ;
  2628. int result;
  2629. SWIG_check_num_args("ESLconnection::disconnect",1,1)
  2630. if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ESLconnection::disconnect",1,"ESLconnection *");
  2631. if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
  2632. SWIG_fail_ptr("ESLconnection_disconnect",1,SWIGTYPE_p_ESLconnection);
  2633. }
  2634. result = (int)(arg1)->disconnect();
  2635. lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  2636. return SWIG_arg;
  2637. if(0) SWIG_fail;
  2638. fail:
  2639. lua_error(L);
  2640. return SWIG_arg;
  2641. }
  2642. static void swig_delete_ESLconnection(void *obj) {
  2643. ESLconnection *arg1 = (ESLconnection *) obj;
  2644. delete arg1;
  2645. }
  2646. static swig_lua_method swig_ESLconnection_methods[] = {
  2647. {"socketDescriptor", _wrap_ESLconnection_socketDescriptor},
  2648. {"connected", _wrap_ESLconnection_connected},
  2649. {"getInfo", _wrap_ESLconnection_getInfo},
  2650. {"send", _wrap_ESLconnection_send},
  2651. {"sendRecv", _wrap_ESLconnection_sendRecv},
  2652. {"api", _wrap_ESLconnection_api},
  2653. {"bgapi", _wrap_ESLconnection_bgapi},
  2654. {"sendEvent", _wrap_ESLconnection_sendEvent},
  2655. {"sendMSG", _wrap_ESLconnection_sendMSG},
  2656. {"recvEvent", _wrap_ESLconnection_recvEvent},
  2657. {"recvEventTimed", _wrap_ESLconnection_recvEventTimed},
  2658. {"filter", _wrap_ESLconnection_filter},
  2659. {"events", _wrap_ESLconnection_events},
  2660. {"execute", _wrap_ESLconnection_execute},
  2661. {"executeAsync", _wrap_ESLconnection_executeAsync},
  2662. {"setAsyncExecute", _wrap_ESLconnection_setAsyncExecute},
  2663. {"setEventLock", _wrap_ESLconnection_setEventLock},
  2664. {"disconnect", _wrap_ESLconnection_disconnect},
  2665. {0,0}
  2666. };
  2667. static swig_lua_attribute swig_ESLconnection_attributes[] = {
  2668. {0,0,0}
  2669. };
  2670. static swig_lua_class *swig_ESLconnection_bases[] = {0};
  2671. static const char *swig_ESLconnection_base_names[] = {0};
  2672. static swig_lua_class _wrap_class_ESLconnection = { "ESLconnection", &SWIGTYPE_p_ESLconnection,_wrap_new_ESLconnection, swig_delete_ESLconnection, swig_ESLconnection_methods, swig_ESLconnection_attributes, swig_ESLconnection_bases, swig_ESLconnection_base_names };
  2673. static int _wrap_eslSetLogLevel(lua_State* L) {
  2674. int SWIG_arg = 0;
  2675. int arg1 ;
  2676. SWIG_check_num_args("eslSetLogLevel",1,1)
  2677. if(!lua_isnumber(L,1)) SWIG_fail_arg("eslSetLogLevel",1,"int");
  2678. arg1 = (int)lua_tonumber(L, 1);
  2679. eslSetLogLevel(arg1);
  2680. return SWIG_arg;
  2681. if(0) SWIG_fail;
  2682. fail:
  2683. lua_error(L);
  2684. return SWIG_arg;
  2685. }
  2686. #ifdef __cplusplus
  2687. }
  2688. #endif
  2689. static const struct luaL_Reg swig_commands[] = {
  2690. { "eslSetLogLevel", _wrap_eslSetLogLevel},
  2691. {0,0}
  2692. };
  2693. static swig_lua_var_info swig_variables[] = {
  2694. {0,0,0}
  2695. };
  2696. static swig_lua_const_info swig_constants[] = {
  2697. {0,0,0,0,0,0}
  2698. };
  2699. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
  2700. static swig_type_info _swigt__p_ESLconnection = {"_p_ESLconnection", "ESLconnection *", 0, 0, (void*)&_wrap_class_ESLconnection, 0};
  2701. static swig_type_info _swigt__p_ESLevent = {"_p_ESLevent", "ESLevent *", 0, 0, (void*)&_wrap_class_ESLevent, 0};
  2702. static swig_type_info _swigt__p_esl_event_t = {"_p_esl_event_t", "esl_event_t *", 0, 0, (void*)0, 0};
  2703. static swig_type_info _swigt__p_esl_priority_t = {"_p_esl_priority_t", "esl_priority_t *", 0, 0, (void*)0, 0};
  2704. static swig_type_info *swig_type_initial[] = {
  2705. &_swigt__p_ESLconnection,
  2706. &_swigt__p_ESLevent,
  2707. &_swigt__p_esl_event_t,
  2708. &_swigt__p_esl_priority_t,
  2709. };
  2710. static swig_cast_info _swigc__p_ESLconnection[] = { {&_swigt__p_ESLconnection, 0, 0, 0},{0, 0, 0, 0}};
  2711. static swig_cast_info _swigc__p_ESLevent[] = { {&_swigt__p_ESLevent, 0, 0, 0},{0, 0, 0, 0}};
  2712. static swig_cast_info _swigc__p_esl_event_t[] = { {&_swigt__p_esl_event_t, 0, 0, 0},{0, 0, 0, 0}};
  2713. static swig_cast_info _swigc__p_esl_priority_t[] = { {&_swigt__p_esl_priority_t, 0, 0, 0},{0, 0, 0, 0}};
  2714. static swig_cast_info *swig_cast_initial[] = {
  2715. _swigc__p_ESLconnection,
  2716. _swigc__p_ESLevent,
  2717. _swigc__p_esl_event_t,
  2718. _swigc__p_esl_priority_t,
  2719. };
  2720. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
  2721. /* -----------------------------------------------------------------------------
  2722. * Type initialization:
  2723. * This problem is tough by the requirement that no dynamic
  2724. * memory is used. Also, since swig_type_info structures store pointers to
  2725. * swig_cast_info structures and swig_cast_info structures store pointers back
  2726. * to swig_type_info structures, we need some lookup code at initialization.
  2727. * The idea is that swig generates all the structures that are needed.
  2728. * The runtime then collects these partially filled structures.
  2729. * The SWIG_InitializeModule function takes these initial arrays out of
  2730. * swig_module, and does all the lookup, filling in the swig_module.types
  2731. * array with the correct data and linking the correct swig_cast_info
  2732. * structures together.
  2733. *
  2734. * The generated swig_type_info structures are assigned staticly to an initial
  2735. * array. We just loop through that array, and handle each type individually.
  2736. * First we lookup if this type has been already loaded, and if so, use the
  2737. * loaded structure instead of the generated one. Then we have to fill in the
  2738. * cast linked list. The cast data is initially stored in something like a
  2739. * two-dimensional array. Each row corresponds to a type (there are the same
  2740. * number of rows as there are in the swig_type_initial array). Each entry in
  2741. * a column is one of the swig_cast_info structures for that type.
  2742. * The cast_initial array is actually an array of arrays, because each row has
  2743. * a variable number of columns. So to actually build the cast linked list,
  2744. * we find the array of casts associated with the type, and loop through it
  2745. * adding the casts to the list. The one last trick we need to do is making
  2746. * sure the type pointer in the swig_cast_info struct is correct.
  2747. *
  2748. * First off, we lookup the cast->type name to see if it is already loaded.
  2749. * There are three cases to handle:
  2750. * 1) If the cast->type has already been loaded AND the type we are adding
  2751. * casting info to has not been loaded (it is in this module), THEN we
  2752. * replace the cast->type pointer with the type pointer that has already
  2753. * been loaded.
  2754. * 2) If BOTH types (the one we are adding casting info to, and the
  2755. * cast->type) are loaded, THEN the cast info has already been loaded by
  2756. * the previous module so we just ignore it.
  2757. * 3) Finally, if cast->type has not already been loaded, then we add that
  2758. * swig_cast_info to the linked list (because the cast->type) pointer will
  2759. * be correct.
  2760. * ----------------------------------------------------------------------------- */
  2761. #ifdef __cplusplus
  2762. extern "C" {
  2763. #if 0
  2764. } /* c-mode */
  2765. #endif
  2766. #endif
  2767. #if 0
  2768. #define SWIGRUNTIME_DEBUG
  2769. #endif
  2770. SWIGRUNTIME void
  2771. SWIG_InitializeModule(void *clientdata) {
  2772. size_t i;
  2773. swig_module_info *module_head, *iter;
  2774. int found, init;
  2775. clientdata = clientdata;
  2776. /* check to see if the circular list has been setup, if not, set it up */
  2777. if (swig_module.next==0) {
  2778. /* Initialize the swig_module */
  2779. swig_module.type_initial = swig_type_initial;
  2780. swig_module.cast_initial = swig_cast_initial;
  2781. swig_module.next = &swig_module;
  2782. init = 1;
  2783. } else {
  2784. init = 0;
  2785. }
  2786. /* Try and load any already created modules */
  2787. module_head = SWIG_GetModule(clientdata);
  2788. if (!module_head) {
  2789. /* This is the first module loaded for this interpreter */
  2790. /* so set the swig module into the interpreter */
  2791. SWIG_SetModule(clientdata, &swig_module);
  2792. module_head = &swig_module;
  2793. } else {
  2794. /* the interpreter has loaded a SWIG module, but has it loaded this one? */
  2795. found=0;
  2796. iter=module_head;
  2797. do {
  2798. if (iter==&swig_module) {
  2799. found=1;
  2800. break;
  2801. }
  2802. iter=iter->next;
  2803. } while (iter!= module_head);
  2804. /* if the is found in the list, then all is done and we may leave */
  2805. if (found) return;
  2806. /* otherwise we must add out module into the list */
  2807. swig_module.next = module_head->next;
  2808. module_head->next = &swig_module;
  2809. }
  2810. /* When multiple interpeters are used, a module could have already been initialized in
  2811. a different interpreter, but not yet have a pointer in this interpreter.
  2812. In this case, we do not want to continue adding types... everything should be
  2813. set up already */
  2814. if (init == 0) return;
  2815. /* Now work on filling in swig_module.types */
  2816. #ifdef SWIGRUNTIME_DEBUG
  2817. printf("SWIG_InitializeModule: size %d\n", swig_module.size);
  2818. #endif
  2819. for (i = 0; i < swig_module.size; ++i) {
  2820. swig_type_info *type = 0;
  2821. swig_type_info *ret;
  2822. swig_cast_info *cast;
  2823. #ifdef SWIGRUNTIME_DEBUG
  2824. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  2825. #endif
  2826. /* if there is another module already loaded */
  2827. if (swig_module.next != &swig_module) {
  2828. type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
  2829. }
  2830. if (type) {
  2831. /* Overwrite clientdata field */
  2832. #ifdef SWIGRUNTIME_DEBUG
  2833. printf("SWIG_InitializeModule: found type %s\n", type->name);
  2834. #endif
  2835. if (swig_module.type_initial[i]->clientdata) {
  2836. type->clientdata = swig_module.type_initial[i]->clientdata;
  2837. #ifdef SWIGRUNTIME_DEBUG
  2838. printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
  2839. #endif
  2840. }
  2841. } else {
  2842. type = swig_module.type_initial[i];
  2843. }
  2844. /* Insert casting types */
  2845. cast = swig_module.cast_initial[i];
  2846. while (cast->type) {
  2847. /* Don't need to add information already in the list */
  2848. ret = 0;
  2849. #ifdef SWIGRUNTIME_DEBUG
  2850. printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
  2851. #endif
  2852. if (swig_module.next != &swig_module) {
  2853. ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
  2854. #ifdef SWIGRUNTIME_DEBUG
  2855. if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
  2856. #endif
  2857. }
  2858. if (ret) {
  2859. if (type == swig_module.type_initial[i]) {
  2860. #ifdef SWIGRUNTIME_DEBUG
  2861. printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
  2862. #endif
  2863. cast->type = ret;
  2864. ret = 0;
  2865. } else {
  2866. /* Check for casting already in the list */
  2867. swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
  2868. #ifdef SWIGRUNTIME_DEBUG
  2869. if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
  2870. #endif
  2871. if (!ocast) ret = 0;
  2872. }
  2873. }
  2874. if (!ret) {
  2875. #ifdef SWIGRUNTIME_DEBUG
  2876. printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
  2877. #endif
  2878. if (type->cast) {
  2879. type->cast->prev = cast;
  2880. cast->next = type->cast;
  2881. }
  2882. type->cast = cast;
  2883. }
  2884. cast++;
  2885. }
  2886. /* Set entry in modules->types array equal to the type */
  2887. swig_module.types[i] = type;
  2888. }
  2889. swig_module.types[i] = 0;
  2890. #ifdef SWIGRUNTIME_DEBUG
  2891. printf("**** SWIG_InitializeModule: Cast List ******\n");
  2892. for (i = 0; i < swig_module.size; ++i) {
  2893. int j = 0;
  2894. swig_cast_info *cast = swig_module.cast_initial[i];
  2895. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  2896. while (cast->type) {
  2897. printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
  2898. cast++;
  2899. ++j;
  2900. }
  2901. printf("---- Total casts: %d\n",j);
  2902. }
  2903. printf("**** SWIG_InitializeModule: Cast List ******\n");
  2904. #endif
  2905. }
  2906. /* This function will propagate the clientdata field of type to
  2907. * any new swig_type_info structures that have been added into the list
  2908. * of equivalent types. It is like calling
  2909. * SWIG_TypeClientData(type, clientdata) a second time.
  2910. */
  2911. SWIGRUNTIME void
  2912. SWIG_PropagateClientData(void) {
  2913. size_t i;
  2914. swig_cast_info *equiv;
  2915. static int init_run = 0;
  2916. if (init_run) return;
  2917. init_run = 1;
  2918. for (i = 0; i < swig_module.size; i++) {
  2919. if (swig_module.types[i]->clientdata) {
  2920. equiv = swig_module.types[i]->cast;
  2921. while (equiv) {
  2922. if (!equiv->converter) {
  2923. if (equiv->type && !equiv->type->clientdata)
  2924. SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
  2925. }
  2926. equiv = equiv->next;
  2927. }
  2928. }
  2929. }
  2930. }
  2931. #ifdef __cplusplus
  2932. #if 0
  2933. { /* c-mode */
  2934. #endif
  2935. }
  2936. #endif
  2937. /* Forward declaration of where the user's %init{} gets inserted */
  2938. void SWIG_init_user(lua_State* L );
  2939. #ifdef __cplusplus
  2940. extern "C" {
  2941. #endif
  2942. /* this is the initialization function
  2943. added at the very end of the code
  2944. the function is always called SWIG_init, but an earlier #define will rename it
  2945. */
  2946. #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  2947. LUALIB_API int SWIG_init(lua_State* L)
  2948. #else
  2949. SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
  2950. #endif
  2951. {
  2952. #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
  2953. int i;
  2954. /* start with global table */
  2955. lua_pushglobaltable (L);
  2956. /* SWIG's internal initalisation */
  2957. SWIG_InitializeModule((void*)L);
  2958. SWIG_PropagateClientData();
  2959. #endif
  2960. #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
  2961. /* add a global fn */
  2962. SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
  2963. SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
  2964. /* begin the module (its a table with the same name as the module) */
  2965. SWIG_Lua_module_begin(L,SWIG_name);
  2966. /* add commands/functions */
  2967. for (i = 0; swig_commands[i].name; i++){
  2968. SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
  2969. }
  2970. /* add variables */
  2971. for (i = 0; swig_variables[i].name; i++){
  2972. SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
  2973. }
  2974. #endif
  2975. #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  2976. /* set up base class pointers (the hierarchy) */
  2977. for (i = 0; swig_types[i]; i++){
  2978. if (swig_types[i]->clientdata){
  2979. SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
  2980. }
  2981. }
  2982. /* additional registration structs & classes in lua */
  2983. for (i = 0; swig_types[i]; i++){
  2984. if (swig_types[i]->clientdata){
  2985. SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
  2986. }
  2987. }
  2988. #endif
  2989. #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
  2990. /* constants */
  2991. SWIG_Lua_InstallConstants(L,swig_constants);
  2992. #endif
  2993. #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  2994. /* invoke user-specific initialization */
  2995. SWIG_init_user(L);
  2996. /* end module */
  2997. /* Note: We do not clean up the stack here (Lua will do this for us). At this
  2998. point, we have the globals table and out module table on the stack. Returning
  2999. one value makes the module table the result of the require command. */
  3000. return 1;
  3001. #else
  3002. return 0;
  3003. #endif
  3004. }
  3005. #ifdef __cplusplus
  3006. }
  3007. #endif
  3008. const char* SWIG_LUACODE=
  3009. "";
  3010. void SWIG_init_user(lua_State* L)
  3011. {
  3012. /* exec Lua code if applicable */
  3013. SWIG_Lua_dostring(L,SWIG_LUACODE);
  3014. }