tinyWRAP_wrap.cxx 135 KB

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