PageRenderTime 54ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/trunk/Examples/xml/example_xml.expected-xml

#
Unknown | 1624 lines | 1575 code | 49 blank | 0 comment | 0 complexity | c43fd6d1b9a02f07f68194b07692e091 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. <swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" >
  2. <swig:top >
  3. <swigxml:child >
  4. <swig:file name="../../Lib/swig.swg" >
  5. <swigxml:type string="include" />
  6. </swig:file>
  7. <swig:file name="example_xml.i" >
  8. <swigxml:child >
  9. <swig:module name="my_example" />
  10. <c:enum name="color" >
  11. <swigxml:child >
  12. <c:enumvalue name="RED" >
  13. <swigxml:value string="RED" />
  14. </c:enumvalue>
  15. <c:enumvalue name="BLUE" />
  16. <c:enumvalue name="GREEN" />
  17. </swigxml:child>
  18. </c:enum>
  19. <c:class name="Foo" >
  20. <swigxml:child >
  21. <c:access name="public" />
  22. <c:function name="Foo" >
  23. <swigxml:code >
  24. { } </swigxml:code>
  25. <swigxml:type string="int" />
  26. </c:function>
  27. <c:enum name="speed" >
  28. <swigxml:child >
  29. <c:enumvalue name="IMPULSE" />
  30. <c:enumvalue name="WARP" />
  31. <c:enumvalue name="LUDICROUS" />
  32. </swigxml:child>
  33. </c:enum>
  34. <c:function name="enum_test" >
  35. <swigxml:parms >
  36. <swigxml:parm name="s" >
  37. <swigxml:type string="speed" />
  38. </swigxml:parm>
  39. </swigxml:parms>
  40. <swigxml:type string="void" />
  41. </c:function>
  42. </swigxml:child>
  43. <swigxml:classtype string="class" />
  44. <swigxml:namespace string="Foo" />
  45. </c:class>
  46. <c:function name="enum_test" >
  47. <swigxml:parms >
  48. <swigxml:parm name="c" >
  49. <swigxml:type string="color" />
  50. </swigxml:parm>
  51. <swigxml:parm name="s" >
  52. <swigxml:type string="Foo::speed" />
  53. </swigxml:parm>
  54. </swigxml:parms>
  55. <swigxml:type string="void" />
  56. </c:function>
  57. <swig:file name="../../Lib/pointer.i" >
  58. <swigxml:child >
  59. <swig:module name="pointer" />
  60. <swig:insert >
  61. <swigxml:code >
  62. %include pointer.i
  63. The pointer.i library provides run-time support for managing and
  64. manipulating a variety of C/C++ pointer values. In particular,
  65. you can create various kinds of objects and dereference common
  66. pointer types. This is done through a common set of functions:
  67. ptrvalue - Dereferences a pointer
  68. ptrset - Set the value of an object referenced by
  69. a pointer.
  70. ptrcreate - Create a new object and return a pointer.
  71. ptrfree - Free the memory allocated by ptrcreate.
  72. ptradd - Increment/decrement a pointer value.
  73. When creating, dereferencing, or setting the value of pointer
  74. variable, only the common C datatypes of int, short, long, float,
  75. double, char, and char * are currently supported. Other
  76. datatypes may generate an error.
  77. One of the more interesting aspects of this library is that
  78. it operates with a wide range of datatypes. For example,
  79. the "ptrvalue" function can dereference "double *", "int *",
  80. "long *", "char *", and other datatypes. Since SWIG encodes
  81. pointers with type information, this can be done transparently
  82. and in most cases, you can dereference a pointer without
  83. ever knowing what type it actually is.
  84. This library is primarily designed for utility, not high
  85. performance (the dynamic determination of pointer types takes
  86. more work than most normal wrapper functions). As a result,
  87. you may achieve better performance by writing customized
  88. "helper" functions if you're making lots of calls to these
  89. functions in inner loops or other intensive operations.
  90. </swigxml:code>
  91. <swigxml:section string="doc" />
  92. </swig:insert>
  93. <swig:types >
  94. <swigxml:parms >
  95. <swigxml:parm >
  96. <swigxml:type string="p.int" />
  97. </swigxml:parm>
  98. <swigxml:parm >
  99. <swigxml:type string="p.short" />
  100. </swigxml:parm>
  101. <swigxml:parm >
  102. <swigxml:type string="p.long" />
  103. </swigxml:parm>
  104. <swigxml:parm >
  105. <swigxml:type string="p.float" />
  106. </swigxml:parm>
  107. <swigxml:parm >
  108. <swigxml:type string="p.double" />
  109. </swigxml:parm>
  110. <swigxml:parm >
  111. <swigxml:type string="p.char" />
  112. </swigxml:parm>
  113. <swigxml:parm >
  114. <swigxml:type string="p.p.char" />
  115. </swigxml:parm>
  116. <swigxml:parm >
  117. <swigxml:type string="p.void" />
  118. </swigxml:parm>
  119. </swigxml:parms>
  120. </swig:types>
  121. <swig:file name="../../Lib/xml/ptrlang.i" >
  122. <swigxml:child >
  123. <swig:insert >
  124. <swigxml:code >
  125. #include &amp;lt;ctype.h>
  126. /* Types used by the library */
  127. static swig_type_info *SWIG_POINTER_int_p = 0;
  128. static swig_type_info *SWIG_POINTER_short_p =0;
  129. static swig_type_info *SWIG_POINTER_long_p = 0;
  130. static swig_type_info *SWIG_POINTER_float_p = 0;
  131. static swig_type_info *SWIG_POINTER_double_p = 0;
  132. static swig_type_info *SWIG_POINTER_char_p = 0;
  133. static swig_type_info *SWIG_POINTER_char_pp = 0;
  134. static swig_type_info *SWIG_POINTER_void_p = 0;
  135. </swigxml:code>
  136. </swig:insert>
  137. <swig:insert >
  138. <swigxml:code >
  139. SWIG_POINTER_int_p = SWIG_TypeQuery("int *");
  140. SWIG_POINTER_short_p = SWIG_TypeQuery("short *");
  141. SWIG_POINTER_long_p = SWIG_TypeQuery("long *");
  142. SWIG_POINTER_float_p = SWIG_TypeQuery("float *");
  143. SWIG_POINTER_double_p = SWIG_TypeQuery("double *");
  144. SWIG_POINTER_char_p = SWIG_TypeQuery("char *");
  145. SWIG_POINTER_char_pp = SWIG_TypeQuery("char **");
  146. SWIG_POINTER_void_p = SWIG_TypeQuery("void *");
  147. </swigxml:code>
  148. <swigxml:section string="init" />
  149. </swig:insert>
  150. <swig:insert >
  151. <swigxml:code >
  152. /* #ifdef WIN32
  153. #undef isspace
  154. #define isspace(c) (c == ' ')
  155. #endif
  156. */
  157. /*------------------------------------------------------------------
  158. ptrvalue(ptr,type = 0)
  159. Attempts to dereference a pointer value. If type is given, it
  160. will try to use that type. Otherwise, this function will attempt
  161. to "guess" the proper datatype by checking against all of the
  162. builtin C datatypes.
  163. ------------------------------------------------------------------ */
  164. #ifdef PERL_OBJECT
  165. static SV *_ptrvalue(CPerlObj *pPerl,SV *_PTRVALUE, int index, char *type) {
  166. #define ptrvalue(a,b,c) _ptrvalue(pPerl,a,b,c)
  167. #else
  168. static SV *_ptrvalue(SV *_PTRVALUE, int index, char *type) {
  169. #define ptrvalue(a,b,c) _ptrvalue(a,b,c)
  170. #endif
  171. void *ptr;
  172. SV *obj = 0;
  173. if (SWIG_ConvertPtr(_PTRVALUE, &amp;ptr, 0) &amp;lt; 0) {
  174. croak("Type error it ptrvalue. Argument is not a valid pointer value.");
  175. } else {
  176. /* If no datatype was passed, try a few common datatypes first */
  177. if (!type) {
  178. /* No datatype was passed. Type to figure out if it's a common one */
  179. if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_int_p) >= 0) {
  180. type = "int";
  181. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_double_p) >= 0) {
  182. type = "double";
  183. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_short_p) >= 0) {
  184. type = "short";
  185. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_long_p) >= 0) {
  186. type = "long";
  187. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_float_p) >= 0) {
  188. type = "float";
  189. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_char_p) >= 0) {
  190. type = "char";
  191. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_char_pp) >= 0) {
  192. type = "char *";
  193. } else {
  194. type = "unknown";
  195. }
  196. }
  197. if (!ptr) {
  198. croak("Unable to dereference NULL pointer.");
  199. return 0;
  200. }
  201. /* Now we have a datatype. Try to figure out what to do about it */
  202. if (strcmp(type,"int") == 0) {
  203. obj = sv_newmortal();
  204. sv_setiv(obj,(IV) *(((int *) ptr) + index));
  205. } else if (strcmp(type,"double") == 0) {
  206. obj = sv_newmortal();
  207. sv_setnv(obj,(double) *(((double *) ptr)+index));
  208. } else if (strcmp(type,"short") == 0) {
  209. obj = sv_newmortal();
  210. sv_setiv(obj,(IV) *(((short *) ptr) + index));
  211. } else if (strcmp(type,"long") == 0) {
  212. obj = sv_newmortal();
  213. sv_setiv(obj,(IV) *(((long *) ptr) + index));
  214. } else if (strcmp(type,"float") == 0) {
  215. obj = sv_newmortal();
  216. sv_setnv(obj,(double) *(((float *) ptr)+index));
  217. } else if (strcmp(type,"char") == 0) {
  218. obj = sv_newmortal();
  219. sv_setpv(obj,((char *) ptr)+index);
  220. } else if (strcmp(type,"char *") == 0) {
  221. char *c = *(((char **) ptr)+index);
  222. obj = sv_newmortal();
  223. if (c)
  224. sv_setpv(obj,c);
  225. else
  226. sv_setpv(obj,"NULL");
  227. } else {
  228. croak("Unable to dereference unsupported datatype.");
  229. obj = 0;
  230. }
  231. }
  232. return obj;
  233. }
  234. /*------------------------------------------------------------------
  235. ptrcreate(type,value = 0,numelements = 1)
  236. Attempts to create a new object of given type. Type must be
  237. a basic C datatype. Will not create complex objects.
  238. ------------------------------------------------------------------ */
  239. #ifdef PERL_OBJECT
  240. static SV *_ptrcreate(CPerlObj *pPerl, char *type, SV *value, int numelements) {
  241. #define ptrcreate(a,b,c) _ptrcreate(pPerl,a,b,c)
  242. #else
  243. static SV *_ptrcreate(char *type, SV *value, int numelements) {
  244. #define ptrcreate(a,b,c) _ptrcreate(a,b,c)
  245. #endif
  246. void *ptr;
  247. SV *obj;
  248. int sz;
  249. swig_type_info *cast = 0;
  250. /* Check the type string against a variety of possibilities */
  251. if (strcmp(type,"int") == 0) {
  252. sz = sizeof(int)*numelements;
  253. cast = SWIG_POINTER_int_p;
  254. } else if (strcmp(type,"short") == 0) {
  255. sz = sizeof(short)*numelements;
  256. cast = SWIG_POINTER_short_p;
  257. } else if (strcmp(type,"long") == 0) {
  258. sz = sizeof(long)*numelements;
  259. cast = SWIG_POINTER_long_p;
  260. } else if (strcmp(type,"double") == 0) {
  261. sz = sizeof(double)*numelements;
  262. cast = SWIG_POINTER_double_p;
  263. } else if (strcmp(type,"float") == 0) {
  264. sz = sizeof(float)*numelements;
  265. cast = SWIG_POINTER_float_p;
  266. } else if (strcmp(type,"char") == 0) {
  267. sz = sizeof(char)*numelements;
  268. cast = SWIG_POINTER_char_p;
  269. } else if (strcmp(type,"char *") == 0) {
  270. sz = sizeof(char *)*(numelements+1);
  271. cast = SWIG_POINTER_char_pp;
  272. } else if (strcmp(type,"void") == 0) {
  273. sz = numelements;
  274. cast = SWIG_POINTER_void_p;
  275. } else {
  276. croak("Unable to create unknown datatype.");
  277. return 0;
  278. }
  279. /* Create the new object */
  280. ptr = (void *) malloc(sz);
  281. if (!ptr) {
  282. croak("Out of memory in ptrcreate.");
  283. return 0;
  284. }
  285. /* Now try to set its default value */
  286. if (value) {
  287. if (strcmp(type,"int") == 0) {
  288. int *ip,i,ivalue;
  289. ivalue = (int) SvIV(value);
  290. ip = (int *) ptr;
  291. for (i = 0; i &amp;lt; numelements; i++)
  292. ip[i] = ivalue;
  293. } else if (strcmp(type,"short") == 0) {
  294. short *ip,ivalue;
  295. int i;
  296. ivalue = (short) SvIV(value);
  297. ip = (short *) ptr;
  298. for (i = 0; i &amp;lt; numelements; i++)
  299. ip[i] = ivalue;
  300. } else if (strcmp(type,"long") == 0) {
  301. long *ip,ivalue;
  302. int i;
  303. ivalue = (long) SvIV(value);
  304. ip = (long *) ptr;
  305. for (i = 0; i &amp;lt; numelements; i++)
  306. ip[i] = ivalue;
  307. } else if (strcmp(type,"double") == 0) {
  308. double *ip,ivalue;
  309. int i;
  310. ivalue = (double) SvNV(value);
  311. ip = (double *) ptr;
  312. for (i = 0; i &amp;lt; numelements; i++)
  313. ip[i] = ivalue;
  314. } else if (strcmp(type,"float") == 0) {
  315. float *ip,ivalue;
  316. int i;
  317. ivalue = (float) SvNV(value);
  318. ip = (float *) ptr;
  319. for (i = 0; i &amp;lt; numelements; i++)
  320. ip[i] = ivalue;
  321. } else if (strcmp(type,"char") == 0) {
  322. char *ip,*ivalue;
  323. ivalue = (char *) SvPV(value,PL_na);
  324. ip = (char *) ptr;
  325. strncpy(ip,ivalue,numelements-1);
  326. } else if (strcmp(type,"char *") == 0) {
  327. char **ip, *ivalue;
  328. int i;
  329. ivalue = (char *) SvPV(value,PL_na);
  330. ip = (char **) ptr;
  331. for (i = 0; i &amp;lt; numelements; i++) {
  332. if (ivalue) {
  333. ip[i] = (char *) malloc(strlen(ivalue)+1);
  334. strcpy(ip[i],ivalue);
  335. } else {
  336. ip[i] = 0;
  337. }
  338. }
  339. ip[numelements] = 0;
  340. }
  341. }
  342. /* Create the pointer value */
  343. obj = sv_newmortal();
  344. SWIG_MakePtr(obj,ptr,cast);
  345. return obj;
  346. }
  347. /*------------------------------------------------------------------
  348. ptrset(ptr,value,index = 0,type = 0)
  349. Attempts to set the value of a pointer variable. If type is
  350. given, we will use that type. Otherwise, we'll guess the datatype.
  351. ------------------------------------------------------------------ */
  352. #ifdef PERL_OBJECT
  353. static void _ptrset(CPerlObj *pPerl,SV *_PTRVALUE, SV *value, int index, char *type) {
  354. #define ptrset(a,b,c,d) _ptrset(pPerl,a,b,c,d)
  355. #else
  356. static void _ptrset(SV *_PTRVALUE, SV *value, int index, char *type) {
  357. #define ptrset(a,b,c,d) _ptrset(a,b,c,d)
  358. #endif
  359. void *ptr;
  360. SV *obj;
  361. if (SWIG_ConvertPtr(_PTRVALUE, &amp;ptr, 0) &amp;lt; 0) {
  362. croak("Type error it ptrvalue. Argument is not a valid pointer value.");
  363. } else {
  364. /* If no datatype was passed, try a few common datatypes first */
  365. if (!type) {
  366. /* No datatype was passed. Type to figure out if it's a common one */
  367. if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_int_p) >= 0) {
  368. type = "int";
  369. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_double_p) >= 0) {
  370. type = "double";
  371. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_short_p) >= 0) {
  372. type = "short";
  373. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_long_p) >= 0) {
  374. type = "long";
  375. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_float_p) >= 0) {
  376. type = "float";
  377. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_char_p) >= 0) {
  378. type = "char";
  379. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_char_pp) >= 0) {
  380. type = "char *";
  381. } else {
  382. type = "unknown";
  383. }
  384. }
  385. }
  386. if (!ptr) {
  387. croak("Unable to set NULL pointer.");
  388. return;
  389. }
  390. /* Now we have a datatype. Try to figure out what to do about it */
  391. if (strcmp(type,"int") == 0) {
  392. *(((int *) ptr)+index) = (int) SvIV(value);
  393. } else if (strcmp(type,"double") == 0) {
  394. *(((double *) ptr)+index) = (double) SvNV(value);
  395. } else if (strcmp(type,"short") == 0) {
  396. *(((short *) ptr)+index) = (short) SvIV(value);
  397. } else if (strcmp(type,"long") == 0) {
  398. *(((long *) ptr)+index) = (long) SvIV(value);
  399. } else if (strcmp(type,"float") == 0) {
  400. *(((float *) ptr)+index) = (float) SvNV(value);
  401. } else if (strcmp(type,"char") == 0) {
  402. char *c = SvPV(value,PL_na);
  403. strcpy(((char *) ptr)+index, c);
  404. } else if (strcmp(type,"char *") == 0) {
  405. char *c = SvPV(value,PL_na);
  406. char **ca = (char **) ptr;
  407. if (ca[index]) free(ca[index]);
  408. if (strcmp(c,"NULL") == 0) {
  409. ca[index] = 0;
  410. } else {
  411. ca[index] = (char *) malloc(strlen(c)+1);
  412. strcpy(ca[index],c);
  413. }
  414. } else {
  415. croak("Unable to set unsupported datatype.");
  416. return;
  417. }
  418. }
  419. /*------------------------------------------------------------------
  420. ptradd(ptr,offset)
  421. Adds a value to an existing pointer value. Will do a type-dependent
  422. add for basic datatypes. For other datatypes, will do a byte-add.
  423. ------------------------------------------------------------------ */
  424. #ifdef PERL_OBJECT
  425. static SV *_ptradd(CPerlObj *pPerl, SV *_PTRVALUE, int offset) {
  426. #define ptradd(a,b) _ptradd(pPerl,a,b)
  427. #else
  428. static SV *_ptradd(SV *_PTRVALUE, int offset) {
  429. #define ptradd(a,b) _ptradd(a,b)
  430. #endif
  431. void *ptr,*junk;
  432. SV *obj;
  433. swig_type_info *type;
  434. char *tname;
  435. /* Try to handle a few common datatypes first */
  436. if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_int_p) >= 0) {
  437. ptr = (void *) (((int *) ptr) + offset);
  438. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_double_p) >= 0) {
  439. ptr = (void *) (((double *) ptr) + offset);
  440. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_short_p) >= 0) {
  441. ptr = (void *) (((short *) ptr) + offset);
  442. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_long_p) >= 0) {
  443. ptr = (void *) (((long *) ptr) + offset);
  444. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_float_p) >= 0) {
  445. ptr = (void *) (((float *) ptr) + offset);
  446. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,SWIG_POINTER_char_p) >= 0) {
  447. ptr = (void *) (((char *) ptr) + offset);
  448. } else if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,0) >= 0) {
  449. ptr = (void *) (((char *) ptr) + offset);
  450. } else {
  451. croak("Type error in ptradd. Argument is not a valid pointer value.");
  452. return 0;
  453. }
  454. printf("ptradd = %x\n", ptr);
  455. tname = HvNAME(SvSTASH(SvRV(_PTRVALUE)));
  456. obj = sv_newmortal();
  457. sv_setref_pv(obj,tname,ptr);
  458. return obj;
  459. }
  460. /*------------------------------------------------------------------
  461. ptrfree(ptr)
  462. Destroys a pointer value
  463. ------------------------------------------------------------------ */
  464. #ifdef PERL_OBJECT
  465. void _ptrfree(CPerlObj *pPerl, SV *_PTRVALUE) {
  466. #define ptrfree(a) _ptrfree(pPerl, a)
  467. #else
  468. void _ptrfree(SV *_PTRVALUE) {
  469. #define ptrfree(a) _ptrfree(a)
  470. #endif
  471. void *ptr, *junk;
  472. if (SWIG_ConvertPtr(_PTRVALUE,&amp;ptr,0) &amp;lt; 0) {
  473. croak("Type error in ptrfree. Argument is not a valid pointer value.");
  474. return;
  475. }
  476. /* Check to see if this pointer is a char ** */
  477. if (SWIG_ConvertPtr(_PTRVALUE,&amp;junk,SWIG_POINTER_char_pp) >= 0) {
  478. char **c = (char **) ptr;
  479. if (c) {
  480. int i = 0;
  481. while (c[i]) {
  482. free(c[i]);
  483. i++;
  484. }
  485. }
  486. }
  487. if (ptr)
  488. free((char *) ptr);
  489. }
  490. </swigxml:code>
  491. </swig:insert>
  492. <swig:typemap name="ptr" >
  493. <swigxml:code >
  494. {
  495. $target = $source;
  496. } </swigxml:code>
  497. <swigxml:method string="in" />
  498. <swigxml:type string="p.SV" />
  499. <swigxml:lang string="perl5" />
  500. </swig:typemap>
  501. <swig:typemap name="value" >
  502. <swigxml:code >
  503. {
  504. $target = $source;
  505. } </swigxml:code>
  506. <swigxml:method string="in" />
  507. <swigxml:type string="p.SV" />
  508. <swigxml:lang string="perl5" />
  509. </swig:typemap>
  510. <swig:typemap name="ptrcast" >
  511. <swigxml:code >
  512. {
  513. $target = $source;
  514. argvi++;
  515. } </swigxml:code>
  516. <swigxml:method string="out" />
  517. <swigxml:type string="p.SV" />
  518. <swigxml:lang string="perl5" />
  519. </swig:typemap>
  520. <swig:typemap name="ptrvalue" >
  521. <swigxml:code >
  522. {
  523. $target = $source;
  524. argvi++;
  525. } </swigxml:code>
  526. <swigxml:method string="out" />
  527. <swigxml:type string="p.SV" />
  528. <swigxml:lang string="perl5" />
  529. </swig:typemap>
  530. <swig:typemap name="ptrcreate" >
  531. <swigxml:code >
  532. {
  533. $target = $source;
  534. argvi++;
  535. } </swigxml:code>
  536. <swigxml:method string="out" />
  537. <swigxml:type string="p.SV" />
  538. <swigxml:lang string="perl5" />
  539. </swig:typemap>
  540. <swig:typemap name="ptradd" >
  541. <swigxml:code >
  542. {
  543. $target = $source;
  544. argvi++;
  545. } </swigxml:code>
  546. <swigxml:method string="out" />
  547. <swigxml:type string="p.SV" />
  548. <swigxml:lang string="perl5" />
  549. </swig:typemap>
  550. <swig:typemap name="ptrset" >
  551. <swigxml:code >
  552. {
  553. if ($source == -1) return NULL;
  554. } </swigxml:code>
  555. <swigxml:method string="ret" />
  556. <swigxml:type string="int" />
  557. <swigxml:lang string="perl5" />
  558. </swig:typemap>
  559. <c:function name="ptrvalue" >
  560. <swigxml:parms >
  561. <swigxml:parm name="ptr" >
  562. <swigxml:type string="p.SV" />
  563. </swigxml:parm>
  564. <swigxml:parm name="index" >
  565. <swigxml:value string="0" />
  566. <swigxml:type string="int" />
  567. </swigxml:parm>
  568. <swigxml:parm name="type" >
  569. <swigxml:value string="0" />
  570. <swigxml:type string="p.char" />
  571. </swigxml:parm>
  572. </swigxml:parms>
  573. <swigxml:type string="p.SV" />
  574. </c:function>
  575. <c:function name="ptrset" >
  576. <swigxml:parms >
  577. <swigxml:parm name="ptr" >
  578. <swigxml:type string="p.SV" />
  579. </swigxml:parm>
  580. <swigxml:parm name="value" >
  581. <swigxml:type string="p.SV" />
  582. </swigxml:parm>
  583. <swigxml:parm name="index" >
  584. <swigxml:value string="0" />
  585. <swigxml:type string="int" />
  586. </swigxml:parm>
  587. <swigxml:parm name="type" >
  588. <swigxml:value string="0" />
  589. <swigxml:type string="p.char" />
  590. </swigxml:parm>
  591. </swigxml:parms>
  592. <swigxml:type string="void" />
  593. </c:function>
  594. <c:function name="ptrcreate" >
  595. <swigxml:parms >
  596. <swigxml:parm name="type" >
  597. <swigxml:type string="p.char" />
  598. </swigxml:parm>
  599. <swigxml:parm name="value" >
  600. <swigxml:value string="0" />
  601. <swigxml:type string="p.SV" />
  602. </swigxml:parm>
  603. <swigxml:parm name="nitems" >
  604. <swigxml:value string="1" />
  605. <swigxml:type string="int" />
  606. </swigxml:parm>
  607. </swigxml:parms>
  608. <swigxml:type string="p.SV" />
  609. </c:function>
  610. <c:function name="ptrfree" >
  611. <swigxml:parms >
  612. <swigxml:parm name="ptr" >
  613. <swigxml:type string="p.SV" />
  614. </swigxml:parm>
  615. </swigxml:parms>
  616. <swigxml:type string="void" />
  617. </c:function>
  618. <c:function name="ptradd" >
  619. <swigxml:parms >
  620. <swigxml:parm name="ptr" >
  621. <swigxml:type string="p.SV" />
  622. </swigxml:parm>
  623. <swigxml:parm name="offset" >
  624. <swigxml:type string="int" />
  625. </swigxml:parm>
  626. </swigxml:parms>
  627. <swigxml:type string="p.SV" />
  628. </c:function>
  629. </swigxml:child>
  630. <swigxml:type string="include" />
  631. </swig:file>
  632. </swigxml:child>
  633. <swigxml:type string="include" />
  634. </swig:file>
  635. <swig:file name="../../Lib/xml/typemaps.i" >
  636. <swigxml:child >
  637. <swig:typemap name="INPUT" >
  638. <swigxml:parms >
  639. <swigxml:parm name="temp" >
  640. <swigxml:type string="double" />
  641. </swigxml:parm>
  642. </swigxml:parms>
  643. <swigxml:code >
  644. {
  645. temp = (double) SvNV($source);
  646. $target = &amp;temp;
  647. } </swigxml:code>
  648. <swigxml:method string="in" />
  649. <swigxml:type string="p.double" />
  650. <swigxml:lang string="perl5" />
  651. </swig:typemap>
  652. <swig:typemap name="INPUT" >
  653. <swigxml:parms >
  654. <swigxml:parm name="temp" >
  655. <swigxml:type string="float" />
  656. </swigxml:parm>
  657. </swigxml:parms>
  658. <swigxml:code >
  659. {
  660. temp = (float) SvNV($source);
  661. $target = &amp;temp;
  662. } </swigxml:code>
  663. <swigxml:method string="in" />
  664. <swigxml:type string="p.float" />
  665. <swigxml:lang string="perl5" />
  666. </swig:typemap>
  667. <swig:typemap name="INPUT" >
  668. <swigxml:parms >
  669. <swigxml:parm name="temp" >
  670. <swigxml:type string="int" />
  671. </swigxml:parm>
  672. </swigxml:parms>
  673. <swigxml:code >
  674. {
  675. temp = (int) SvIV($source);
  676. $target = &amp;temp;
  677. } </swigxml:code>
  678. <swigxml:method string="in" />
  679. <swigxml:type string="p.int" />
  680. <swigxml:lang string="perl5" />
  681. </swig:typemap>
  682. <swig:typemap name="INPUT" >
  683. <swigxml:parms >
  684. <swigxml:parm name="temp" >
  685. <swigxml:type string="short" />
  686. </swigxml:parm>
  687. </swigxml:parms>
  688. <swigxml:code >
  689. {
  690. temp = (short) SvIV($source);
  691. $target = &amp;temp;
  692. } </swigxml:code>
  693. <swigxml:method string="in" />
  694. <swigxml:type string="p.short" />
  695. <swigxml:lang string="perl5" />
  696. </swig:typemap>
  697. <swig:typemap name="INPUT" >
  698. <swigxml:parms >
  699. <swigxml:parm name="temp" >
  700. <swigxml:type string="long" />
  701. </swigxml:parm>
  702. </swigxml:parms>
  703. <swigxml:code >
  704. {
  705. temp = (long) SvIV($source);
  706. $target = &amp;temp;
  707. } </swigxml:code>
  708. <swigxml:method string="in" />
  709. <swigxml:type string="p.long" />
  710. <swigxml:lang string="perl5" />
  711. </swig:typemap>
  712. <swig:typemap name="INPUT" >
  713. <swigxml:parms >
  714. <swigxml:parm name="temp" >
  715. <swigxml:type string="unsigned int" />
  716. </swigxml:parm>
  717. </swigxml:parms>
  718. <swigxml:code >
  719. {
  720. temp = (unsigned int) SvIV($source);
  721. $target = &amp;temp;
  722. } </swigxml:code>
  723. <swigxml:method string="in" />
  724. <swigxml:type string="p.unsigned int" />
  725. <swigxml:lang string="perl5" />
  726. </swig:typemap>
  727. <swig:typemap name="INPUT" >
  728. <swigxml:parms >
  729. <swigxml:parm name="temp" >
  730. <swigxml:type string="unsigned short" />
  731. </swigxml:parm>
  732. </swigxml:parms>
  733. <swigxml:code >
  734. {
  735. temp = (unsigned short) SvIV($source);
  736. $target = &amp;temp;
  737. } </swigxml:code>
  738. <swigxml:method string="in" />
  739. <swigxml:type string="p.unsigned short" />
  740. <swigxml:lang string="perl5" />
  741. </swig:typemap>
  742. <swig:typemap name="INPUT" >
  743. <swigxml:parms >
  744. <swigxml:parm name="temp" >
  745. <swigxml:type string="unsigned long" />
  746. </swigxml:parm>
  747. </swigxml:parms>
  748. <swigxml:code >
  749. {
  750. temp = (unsigned long) SvIV($source);
  751. $target = &amp;temp;
  752. } </swigxml:code>
  753. <swigxml:method string="in" />
  754. <swigxml:type string="p.unsigned long" />
  755. <swigxml:lang string="perl5" />
  756. </swig:typemap>
  757. <swig:typemap name="INPUT" >
  758. <swigxml:parms >
  759. <swigxml:parm name="temp" >
  760. <swigxml:type string="unsigned char" />
  761. </swigxml:parm>
  762. </swigxml:parms>
  763. <swigxml:code >
  764. {
  765. temp = (unsigned char) SvIV($source);
  766. $target = &amp;temp;
  767. } </swigxml:code>
  768. <swigxml:method string="in" />
  769. <swigxml:type string="p.unsigned char" />
  770. <swigxml:lang string="perl5" />
  771. </swig:typemap>
  772. <swig:typemap name="OUTPUT" >
  773. <swigxml:parms >
  774. <swigxml:parm name="temp" >
  775. <swigxml:type string="int" />
  776. </swigxml:parm>
  777. </swigxml:parms>
  778. <swigxml:code >
  779. {
  780. $target = &amp;temp;
  781. } </swigxml:code>
  782. <swigxml:method string="ignore" />
  783. <swigxml:type string="p.int" />
  784. <swigxml:lang string="perl5" />
  785. </swig:typemap>
  786. <swig:typemap name="OUTPUT" >
  787. <swigxml:parms >
  788. <swigxml:parm name="temp" >
  789. <swigxml:type string="short" />
  790. </swigxml:parm>
  791. </swigxml:parms>
  792. <swigxml:code >
  793. {
  794. $target = &amp;amp;temp;
  795. } </swigxml:code>
  796. <swigxml:method string="ignore" />
  797. <swigxml:type string="p.short" />
  798. <swigxml:lang string="perl5" />
  799. </swig:typemap>
  800. <swig:typemap name="OUTPUT" >
  801. <swigxml:parms >
  802. <swigxml:parm name="temp" >
  803. <swigxml:type string="long" />
  804. </swigxml:parm>
  805. </swigxml:parms>
  806. <swigxml:code >
  807. {
  808. $target = &amp;amp;amp;temp;
  809. } </swigxml:code>
  810. <swigxml:method string="ignore" />
  811. <swigxml:type string="p.long" />
  812. <swigxml:lang string="perl5" />
  813. </swig:typemap>
  814. <swig:typemap name="OUTPUT" >
  815. <swigxml:parms >
  816. <swigxml:parm name="temp" >
  817. <swigxml:type string="unsigned int" />
  818. </swigxml:parm>
  819. </swigxml:parms>
  820. <swigxml:code >
  821. {
  822. $target = &amp;amp;amp;amp;temp;
  823. } </swigxml:code>
  824. <swigxml:method string="ignore" />
  825. <swigxml:type string="p.unsigned int" />
  826. <swigxml:lang string="perl5" />
  827. </swig:typemap>
  828. <swig:typemap name="OUTPUT" >
  829. <swigxml:parms >
  830. <swigxml:parm name="temp" >
  831. <swigxml:type string="unsigned short" />
  832. </swigxml:parm>
  833. </swigxml:parms>
  834. <swigxml:code >
  835. {
  836. $target = &amp;amp;amp;amp;amp;temp;
  837. } </swigxml:code>
  838. <swigxml:method string="ignore" />
  839. <swigxml:type string="p.unsigned short" />
  840. <swigxml:lang string="perl5" />
  841. </swig:typemap>
  842. <swig:typemap name="OUTPUT" >
  843. <swigxml:parms >
  844. <swigxml:parm name="temp" >
  845. <swigxml:type string="unsigned long" />
  846. </swigxml:parm>
  847. </swigxml:parms>
  848. <swigxml:code >
  849. {
  850. $target = &amp;amp;amp;amp;amp;amp;temp;
  851. } </swigxml:code>
  852. <swigxml:method string="ignore" />
  853. <swigxml:type string="p.unsigned long" />
  854. <swigxml:lang string="perl5" />
  855. </swig:typemap>
  856. <swig:typemap name="OUTPUT" >
  857. <swigxml:parms >
  858. <swigxml:parm name="temp" >
  859. <swigxml:type string="unsigned char" />
  860. </swigxml:parm>
  861. </swigxml:parms>
  862. <swigxml:code >
  863. {
  864. $target = &amp;amp;amp;amp;amp;amp;amp;temp;
  865. } </swigxml:code>
  866. <swigxml:method string="ignore" />
  867. <swigxml:type string="p.unsigned char" />
  868. <swigxml:lang string="perl5" />
  869. </swig:typemap>
  870. <swig:typemap name="OUTPUT" >
  871. <swigxml:parms >
  872. <swigxml:parm name="temp" >
  873. <swigxml:type string="float" />
  874. </swigxml:parm>
  875. </swigxml:parms>
  876. <swigxml:code >
  877. {
  878. $target = &amp;amp;amp;amp;amp;amp;amp;amp;temp;
  879. } </swigxml:code>
  880. <swigxml:method string="ignore" />
  881. <swigxml:type string="p.float" />
  882. <swigxml:lang string="perl5" />
  883. </swig:typemap>
  884. <swig:typemap name="OUTPUT" >
  885. <swigxml:parms >
  886. <swigxml:parm name="temp" >
  887. <swigxml:type string="double" />
  888. </swigxml:parm>
  889. </swigxml:parms>
  890. <swigxml:code >
  891. {
  892. $target = &amp;amp;amp;amp;amp;amp;amp;amp;amp;temp;
  893. } </swigxml:code>
  894. <swigxml:method string="ignore" />
  895. <swigxml:type string="p.double" />
  896. <swigxml:lang string="perl5" />
  897. </swig:typemap>
  898. <swig:typemap name="OUTPUT" >
  899. <swigxml:code >
  900. {
  901. if (argvi >= items) {
  902. EXTEND(sp,1);
  903. }
  904. $target = sv_newmortal();
  905. sv_setiv($target,(IV) *($source));
  906. argvi++;
  907. } </swigxml:code>
  908. <swigxml:method string="argout" />
  909. <swigxml:type string="p.int" />
  910. <swigxml:lang string="perl5" />
  911. </swig:typemap>
  912. <swig:typemap name="OUTPUT" >
  913. <swigxml:code >
  914. {
  915. if (argvi >= items) {
  916. EXTEND(sp,1);
  917. }
  918. $target = sv_newmortal();
  919. sv_setiv($target,(IV) *($source));
  920. argvi++;
  921. } </swigxml:code>
  922. <swigxml:method string="argout" />
  923. <swigxml:type string="p.short" />
  924. <swigxml:lang string="perl5" />
  925. </swig:typemap>
  926. <swig:typemap name="OUTPUT" >
  927. <swigxml:code >
  928. {
  929. if (argvi >= items) {
  930. EXTEND(sp,1);
  931. }
  932. $target = sv_newmortal();
  933. sv_setiv($target,(IV) *($source));
  934. argvi++;
  935. } </swigxml:code>
  936. <swigxml:method string="argout" />
  937. <swigxml:type string="p.long" />
  938. <swigxml:lang string="perl5" />
  939. </swig:typemap>
  940. <swig:typemap name="OUTPUT" >
  941. <swigxml:code >
  942. {
  943. if (argvi >= items) {
  944. EXTEND(sp,1);
  945. }
  946. $target = sv_newmortal();
  947. sv_setiv($target,(IV) *($source));
  948. argvi++;
  949. } </swigxml:code>
  950. <swigxml:method string="argout" />
  951. <swigxml:type string="p.unsigned int" />
  952. <swigxml:lang string="perl5" />
  953. </swig:typemap>
  954. <swig:typemap name="OUTPUT" >
  955. <swigxml:code >
  956. {
  957. if (argvi >= items) {
  958. EXTEND(sp,1);
  959. }
  960. $target = sv_newmortal();
  961. sv_setiv($target,(IV) *($source));
  962. argvi++;
  963. } </swigxml:code>
  964. <swigxml:method string="argout" />
  965. <swigxml:type string="p.unsigned short" />
  966. <swigxml:lang string="perl5" />
  967. </swig:typemap>
  968. <swig:typemap name="OUTPUT" >
  969. <swigxml:code >
  970. {
  971. if (argvi >= items) {
  972. EXTEND(sp,1);
  973. }
  974. $target = sv_newmortal();
  975. sv_setiv($target,(IV) *($source));
  976. argvi++;
  977. } </swigxml:code>
  978. <swigxml:method string="argout" />
  979. <swigxml:type string="p.unsigned long" />
  980. <swigxml:lang string="perl5" />
  981. </swig:typemap>
  982. <swig:typemap name="OUTPUT" >
  983. <swigxml:code >
  984. {
  985. if (argvi >= items) {
  986. EXTEND(sp,1);
  987. }
  988. $target = sv_newmortal();
  989. sv_setiv($target,(IV) *($source));
  990. argvi++;
  991. } </swigxml:code>
  992. <swigxml:method string="argout" />
  993. <swigxml:type string="p.unsigned char" />
  994. <swigxml:lang string="perl5" />
  995. </swig:typemap>
  996. <swig:typemap name="OUTPUT" >
  997. <swigxml:code >
  998. {
  999. if (argvi >= items) {
  1000. EXTEND(sp,1);
  1001. }
  1002. $target = sv_newmortal();
  1003. sv_setnv($target,(double) *($source));
  1004. argvi++;
  1005. } </swigxml:code>
  1006. <swigxml:method string="argout" />
  1007. <swigxml:type string="p.float" />
  1008. <swigxml:lang string="perl5" />
  1009. </swig:typemap>
  1010. <swig:typemap name="OUTPUT" >
  1011. <swigxml:code >
  1012. {
  1013. if (argvi >= items) {
  1014. EXTEND(sp,1);
  1015. }
  1016. $target = sv_newmortal();
  1017. sv_setnv($target,(double) *($source));
  1018. argvi++;
  1019. } </swigxml:code>
  1020. <swigxml:method string="argout" />
  1021. <swigxml:type string="p.double" />
  1022. <swigxml:lang string="perl5" />
  1023. </swig:typemap>
  1024. <swig:typemap name="BOTH" >
  1025. <swigxml:srctype string="p.int" />
  1026. <swigxml:method string="in" />
  1027. <swigxml:type string="p.int" />
  1028. <swigxml:lang string="perl5" />
  1029. <swigxml:srcname string="INPUT" />
  1030. </swig:typemap>
  1031. <swig:typemap name="BOTH" >
  1032. <swigxml:srctype string="p.short" />
  1033. <swigxml:method string="in" />
  1034. <swigxml:type string="p.short" />
  1035. <swigxml:lang string="perl5" />
  1036. <swigxml:srcname string="INPUT" />
  1037. </swig:typemap>
  1038. <swig:typemap name="BOTH" >
  1039. <swigxml:srctype string="p.long" />
  1040. <swigxml:method string="in" />
  1041. <swigxml:type string="p.long" />
  1042. <swigxml:lang string="perl5" />
  1043. <swigxml:srcname string="INPUT" />
  1044. </swig:typemap>
  1045. <swig:typemap name="BOTH" >
  1046. <swigxml:srctype string="p.unsigned" />
  1047. <swigxml:method string="in" />
  1048. <swigxml:type string="p.unsigned" />
  1049. <swigxml:lang string="perl5" />
  1050. <swigxml:srcname string="INPUT" />
  1051. </swig:typemap>
  1052. <swig:typemap name="BOTH" >
  1053. <swigxml:srctype string="p.unsigned short" />
  1054. <swigxml:method string="in" />
  1055. <swigxml:type string="p.unsigned short" />
  1056. <swigxml:lang string="perl5" />
  1057. <swigxml:srcname string="INPUT" />
  1058. </swig:typemap>
  1059. <swig:typemap name="BOTH" >
  1060. <swigxml:srctype string="p.unsigned long" />
  1061. <swigxml:method string="in" />
  1062. <swigxml:type string="p.unsigned long" />
  1063. <swigxml:lang string="perl5" />
  1064. <swigxml:srcname string="INPUT" />
  1065. </swig:typemap>
  1066. <swig:typemap name="BOTH" >
  1067. <swigxml:srctype string="p.unsigned char" />
  1068. <swigxml:method string="in" />
  1069. <swigxml:type string="p.unsigned char" />
  1070. <swigxml:lang string="perl5" />
  1071. <swigxml:srcname string="INPUT" />
  1072. </swig:typemap>
  1073. <swig:typemap name="BOTH" >
  1074. <swigxml:srctype string="p.float" />
  1075. <swigxml:method string="in" />
  1076. <swigxml:type string="p.float" />
  1077. <swigxml:lang string="perl5" />
  1078. <swigxml:srcname string="INPUT" />
  1079. </swig:typemap>
  1080. <swig:typemap name="BOTH" >
  1081. <swigxml:srctype string="p.double" />
  1082. <swigxml:method string="in" />
  1083. <swigxml:type string="p.double" />
  1084. <swigxml:lang string="perl5" />
  1085. <swigxml:srcname string="INPUT" />
  1086. </swig:typemap>
  1087. <swig:typemap name="BOTH" >
  1088. <swigxml:srctype string="p.int" />
  1089. <swigxml:method string="argout" />
  1090. <swigxml:type string="p.int" />
  1091. <swigxml:lang string="perl5" />
  1092. <swigxml:srcname string="OUTPUT" />
  1093. </swig:typemap>
  1094. <swig:typemap name="BOTH" >
  1095. <swigxml:srctype string="p.short" />
  1096. <swigxml:method string="argout" />
  1097. <swigxml:type string="p.short" />
  1098. <swigxml:lang string="perl5" />
  1099. <swigxml:srcname string="OUTPUT" />
  1100. </swig:typemap>
  1101. <swig:typemap name="BOTH" >
  1102. <swigxml:srctype string="p.long" />
  1103. <swigxml:method string="argout" />
  1104. <swigxml:type string="p.long" />
  1105. <swigxml:lang string="perl5" />
  1106. <swigxml:srcname string="OUTPUT" />
  1107. </swig:typemap>
  1108. <swig:typemap name="BOTH" >
  1109. <swigxml:srctype string="p.unsigned" />
  1110. <swigxml:method string="argout" />
  1111. <swigxml:type string="p.unsigned" />
  1112. <swigxml:lang string="perl5" />
  1113. <swigxml:srcname string="OUTPUT" />
  1114. </swig:typemap>
  1115. <swig:typemap name="BOTH" >
  1116. <swigxml:srctype string="p.unsigned short" />
  1117. <swigxml:method string="argout" />
  1118. <swigxml:type string="p.unsigned short" />
  1119. <swigxml:lang string="perl5" />
  1120. <swigxml:srcname string="OUTPUT" />
  1121. </swig:typemap>
  1122. <swig:typemap name="BOTH" >
  1123. <swigxml:srctype string="p.unsigned long" />
  1124. <swigxml:method string="argout" />
  1125. <swigxml:type string="p.unsigned long" />
  1126. <swigxml:lang string="perl5" />
  1127. <swigxml:srcname string="OUTPUT" />
  1128. </swig:typemap>
  1129. <swig:typemap name="BOTH" >
  1130. <swigxml:srctype string="p.unsigned char" />
  1131. <swigxml:method string="argout" />
  1132. <swigxml:type string="p.unsigned char" />
  1133. <swigxml:lang string="perl5" />
  1134. <swigxml:srcname string="OUTPUT" />
  1135. </swig:typemap>
  1136. <swig:typemap name="BOTH" >
  1137. <swigxml:srctype string="p.float" />
  1138. <swigxml:method string="argout" />
  1139. <swigxml:type string="p.float" />
  1140. <swigxml:lang string="perl5" />
  1141. <swigxml:srcname string="OUTPUT" />
  1142. </swig:typemap>
  1143. <swig:typemap name="BOTH" >
  1144. <swigxml:srctype string="p.double" />
  1145. <swigxml:method string="argout" />
  1146. <swigxml:type string="p.double" />
  1147. <swigxml:lang string="perl5" />
  1148. <swigxml:srcname string="OUTPUT" />
  1149. </swig:typemap>
  1150. <swig:typemap name="REFERENCE" >
  1151. <swigxml:parms >
  1152. <swigxml:parm name="dvalue" >
  1153. <swigxml:type string="double" />
  1154. </swigxml:parm>
  1155. </swigxml:parms>
  1156. <swigxml:code >
  1157. {
  1158. SV *tempsv;
  1159. if (!SvROK($source)) {
  1160. croak("expected a reference");
  1161. }
  1162. tempsv = SvRV($source);
  1163. if ((!SvNOK(tempsv)) &amp;&amp; (!SvIOK(tempsv))) {
  1164. printf("Received %d\n", SvTYPE(tempsv));
  1165. croak("Expected a double reference.");
  1166. }
  1167. dvalue = SvNV(tempsv);
  1168. $target = &amp;dvalue;
  1169. } </swigxml:code>
  1170. <swigxml:method string="in" />
  1171. <swigxml:type string="p.double" />
  1172. <swigxml:lang string="perl5" />
  1173. </swig:typemap>
  1174. <swig:typemap name="REFERENCE" >
  1175. <swigxml:parms >
  1176. <swigxml:parm name="dvalue" >
  1177. <swigxml:type string="float" />
  1178. </swigxml:parm>
  1179. </swigxml:parms>
  1180. <swigxml:code >
  1181. {
  1182. SV *tempsv;
  1183. if (!SvROK($source)) {
  1184. croak("expected a reference");
  1185. }
  1186. tempsv = SvRV($source);
  1187. if ((!SvNOK(tempsv)) &amp;&amp; (!SvIOK(tempsv))) {
  1188. croak("expected a double reference");
  1189. }
  1190. dvalue = (float) SvNV(tempsv);
  1191. $target = &amp;dvalue;
  1192. } </swigxml:code>
  1193. <swigxml:method string="in" />
  1194. <swigxml:type string="p.float" />
  1195. <swigxml:lang string="perl5" />
  1196. </swig:typemap>
  1197. <swig:typemap name="REFERENCE" >
  1198. <swigxml:parms >
  1199. <swigxml:parm name="dvalue" >
  1200. <swigxml:type string="int" />
  1201. </swigxml:parm>
  1202. </swigxml:parms>
  1203. <swigxml:code >
  1204. {
  1205. SV *tempsv;
  1206. if (!SvROK($source)) {
  1207. croak("expected a reference");
  1208. }
  1209. tempsv = SvRV($source);
  1210. if (!SvIOK(tempsv)) {
  1211. croak("expected a integer reference");
  1212. }
  1213. dvalue = SvIV(tempsv);
  1214. $target = &amp;dvalue;
  1215. } </swigxml:code>
  1216. <swigxml:method string="in" />
  1217. <swigxml:type string="p.int" />
  1218. <swigxml:lang string="perl5" />
  1219. </swig:typemap>
  1220. <swig:typemap name="REFERENCE" >
  1221. <swigxml:parms >
  1222. <swigxml:parm name="dvalue" >
  1223. <swigxml:type string="short" />
  1224. </swigxml:parm>
  1225. </swigxml:parms>
  1226. <swigxml:code >
  1227. {
  1228. SV *tempsv;
  1229. if (!SvROK($source)) {
  1230. croak("expected a reference");
  1231. }
  1232. tempsv = SvRV($source);
  1233. if (!SvIOK(tempsv)) {
  1234. croak("expected a integer reference");
  1235. }
  1236. dvalue = (short) SvIV(tempsv);
  1237. $target = &amp;dvalue;
  1238. } </swigxml:code>
  1239. <swigxml:method string="in" />
  1240. <swigxml:type string="p.short" />
  1241. <swigxml:lang string="perl5" />
  1242. </swig:typemap>
  1243. <swig:typemap name="REFERENCE" >
  1244. <swigxml:parms >
  1245. <swigxml:parm name="dvalue" >
  1246. <swigxml:type string="long" />
  1247. </swigxml:parm>
  1248. </swigxml:parms>
  1249. <swigxml:code >
  1250. {
  1251. SV *tempsv;
  1252. if (!SvROK($source)) {
  1253. croak("expected a reference");
  1254. }
  1255. tempsv = SvRV($source);
  1256. if (!SvIOK(tempsv)) {
  1257. croak("expected a integer reference");
  1258. }
  1259. dvalue = (long) SvIV(tempsv);
  1260. $target = &amp;dvalue;
  1261. } </swigxml:code>
  1262. <swigxml:method string="in" />
  1263. <swigxml:type string="p.long" />
  1264. <swigxml:lang string="perl5" />
  1265. </swig:typemap>
  1266. <swig:typemap name="REFERENCE" >
  1267. <swigxml:parms >
  1268. <swigxml:parm name="dvalue" >
  1269. <swigxml:type string="unsigned int" />
  1270. </swigxml:parm>
  1271. </swigxml:parms>
  1272. <swigxml:code >
  1273. {
  1274. SV *tempsv;
  1275. if (!SvROK($source)) {
  1276. croak("expected a reference");
  1277. }
  1278. tempsv = SvRV($source);
  1279. if (!SvIOK(tempsv)) {
  1280. croak("expected a integer reference");
  1281. }
  1282. dvalue = (unsigned int) SvIV(tempsv);
  1283. $target = &amp;dvalue;
  1284. } </swigxml:code>
  1285. <swigxml:method string="in" />
  1286. <swigxml:type string="p.unsigned int" />
  1287. <swigxml:lang string="perl5" />
  1288. </swig:typemap>
  1289. <swig:typemap name="REFERENCE" >
  1290. <swigxml:parms >
  1291. <swigxml:parm name="dvalue" >
  1292. <swigxml:type string="unsigned short" />
  1293. </swigxml:parm>
  1294. </swigxml:parms>
  1295. <swigxml:code >
  1296. {
  1297. SV *tempsv;
  1298. if (!SvROK($source)) {
  1299. croak("expected a reference");
  1300. }
  1301. tempsv = SvRV($source);
  1302. if (!SvIOK(tempsv)) {
  1303. croak("expected a integer reference");
  1304. }
  1305. dvalue = (unsigned short) SvIV(tempsv);
  1306. $target = &amp;dvalue;
  1307. } </swigxml:code>
  1308. <swigxml:method string="in" />
  1309. <swigxml:type string="p.unsigned short" />
  1310. <swigxml:lang string="perl5" />
  1311. </swig:typemap>
  1312. <swig:typemap name="REFERENCE" >
  1313. <swigxml:parms >
  1314. <swigxml:parm name="dvalue" >
  1315. <swigxml:type string="unsigned long" />
  1316. </swigxml:parm>
  1317. </swigxml:parms>
  1318. <swigxml:code >
  1319. {
  1320. SV *tempsv;
  1321. if (!SvROK($source)) {
  1322. croak("expected a reference");
  1323. }
  1324. tempsv = SvRV($source);
  1325. if (!SvIOK(tempsv)) {
  1326. croak("expected a integer reference");
  1327. }
  1328. dvalue = (unsigned long) SvIV(tempsv);
  1329. $target = &amp;dvalue;
  1330. } </swigxml:code>
  1331. <swigxml:method string="in" />
  1332. <swigxml:type string="p.unsigned long" />
  1333. <swigxml:lang string="perl5" />
  1334. </swig:typemap>
  1335. <swig:typemap name="REFERENCE" >
  1336. <swigxml:code >
  1337. {
  1338. SV *tempsv;
  1339. tempsv = SvRV($arg);
  1340. sv_setnv(tempsv, (double) *$source);
  1341. } </swigxml:code>
  1342. <swigxml:method string="argout" />
  1343. <swigxml:type string="p.double" />
  1344. <swigxml:lang string="perl5" />
  1345. </swig:typemap>
  1346. <swig:typemap name="REFERENCE" >
  1347. <swigxml:code >
  1348. {
  1349. SV *tempsv;
  1350. tempsv = SvRV($arg);
  1351. sv_setnv(tempsv, (double) *$source);
  1352. } </swigxml:code>
  1353. <swigxml:method string="argout" />
  1354. <swigxml:type string="p.float" />
  1355. <swigxml:lang string="perl5" />
  1356. </swig:typemap>
  1357. <swig:typemap name="REFERENCE" >
  1358. <swigxml:code >
  1359. {
  1360. SV *tempsv;
  1361. tempsv = SvRV($arg);
  1362. sv_setiv(tempsv, (int) *$source);
  1363. } </swigxml:code>
  1364. <swigxml:method string="argout" />
  1365. <swigxml:type string="p.int" />
  1366. <swigxml:lang string="perl5" />
  1367. </swig:typemap>
  1368. <swig:typemap name="REFERENCE" >
  1369. <swigxml:code >
  1370. {
  1371. SV *tempsv;
  1372. tempsv = SvRV($arg);
  1373. sv_setiv(tempsv, (int) *$source);
  1374. } </swigxml:code>
  1375. <swigxml:method string="argout" />
  1376. <swigxml:type string="p.short" />
  1377. <swigxml:lang string="perl5" />
  1378. </swig:typemap>
  1379. <swig:typemap name="REFERENCE" >
  1380. <swigxml:code >
  1381. {
  1382. SV *tempsv;
  1383. tempsv = SvRV($arg);
  1384. sv_setiv(tempsv, (int) *$source);
  1385. } </swigxml:code>
  1386. <swigxml:method string="argout" />
  1387. <swigxml:type string="p.long" />
  1388. <swigxml:lang string="perl5" />
  1389. </swig:typemap>
  1390. <swig:typemap name="REFERENCE" >
  1391. <swigxml:code >
  1392. {
  1393. SV *tempsv;
  1394. tempsv = SvRV($arg);
  1395. sv_setiv(tempsv, (int) *$source);
  1396. } </swigxml:code>
  1397. <swigxml:method string="argout" />
  1398. <swigxml:type string="p.unsigned int" />
  1399. <swigxml:lang string="perl5" />
  1400. </swig:typemap>
  1401. <swig:typemap name="REFERENCE" >
  1402. <swigxml:code >
  1403. {
  1404. SV *tempsv;
  1405. tempsv = SvRV($arg);
  1406. sv_setiv(tempsv, (int) *$source);
  1407. } </swigxml:code>
  1408. <swigxml:method string="argout" />
  1409. <swigxml:type string="p.unsigned short" />
  1410. <swigxml:lang string="perl5" />
  1411. </swig:typemap>
  1412. <swig:typemap name="REFERENCE" >
  1413. <swigxml:code >
  1414. {
  1415. SV *tempsv;
  1416. tempsv = SvRV($arg);
  1417. sv_setiv(tempsv, (int) *$source);
  1418. } </swigxml:code>
  1419. <swigxml:method string="argout" />
  1420. <swigxml:type string="p.unsigned long" />
  1421. <swigxml:lang string="perl5" />
  1422. </swig:typemap>
  1423. </swigxml:child>
  1424. <swigxml:type string="include" />
  1425. </swig:file>
  1426. <swig:typemap >
  1427. <swigxml:code >
  1428. {
  1429. WHATEVER MAKES YOU HAPPY AS RESULT
  1430. } </swigxml:code>
  1431. <swigxml:method string="out" />
  1432. <swigxml:type string="p.int" />
  1433. </swig:typemap>
  1434. <swig:typemap >
  1435. <swigxml:code >
  1436. {
  1437. WHATEVER MAKES YOU HAPPY AS PARAMETER
  1438. } </swigxml:code>
  1439. <swigxml:method string="in" />
  1440. <swigxml:type string="p.int" />
  1441. </swig:typemap>
  1442. <swig:pragma name="DEBUG" >
  1443. <swigxml:value string="false" />
  1444. <swigxml:lang string="xml" />
  1445. </swig:pragma>
  1446. <c:function name="my_gcd" >
  1447. <swigxml:parms >
  1448. <swigxml:parm name="x" >
  1449. <swigxml:type string="p.q(const).char" />
  1450. </swigxml:parm>
  1451. <swigxml:parm name="y" >
  1452. <swigxml:type string="a().p.int" />
  1453. </swigxml:parm>
  1454. <swigxml:parm name="r" >
  1455. <swigxml:type string="p.int" />
  1456. </swigxml:parm>
  1457. <swigxml:parm name="op" >
  1458. <swigxml:type string="p.f(int,int).int" />
  1459. </swigxml:parm>
  1460. </swigxml:parms>
  1461. <swigxml:storage string="extern" />
  1462. <swigxml:type string="p.int" />
  1463. </c:function>
  1464. <c:variable name="my_foo" >
  1465. <swigxml:storage string="extern" />
  1466. <swigxml:type string="double" />
  1467. </c:variable>
  1468. <c:function name="my_void" >
  1469. <swigxml:type string="void" />
  1470. </c:function>
  1471. <c:function name="my_empty" >
  1472. <swigxml:type string="int" />
  1473. </c:function>
  1474. <c:variable name="my_dutch" >
  1475. <swigxml:value string="1.0" />
  1476. <swigxml:type string="q(const).double" />
  1477. </c:variable>
  1478. <c:class name="my_union" >
  1479. <swigxml:child >
  1480. <c:variable name="my_iii" >
  1481. <swigxml:type string="int" />
  1482. </c:variable>
  1483. <c:variable name="my_ccc" >
  1484. <swigxml:type string="char" />
  1485. </c:variable>
  1486. </swigxml:child>
  1487. <swigxml:classtype string="union" />
  1488. <swigxml:namespace string="my_union" />
  1489. </c:class>
  1490. <c:class name="my_struct" >
  1491. <swigxml:child >
  1492. <c:access name="public" />
  1493. <c:destructor name="my_struct" >
  1494. <swigxml:storage string="virtual" />
  1495. </c:destructor>
  1496. <c:function name="my_foo" >
  1497. <swigxml:type string="int" />
  1498. </c:function>
  1499. <c:access name="protected" />
  1500. <c:variable name="my_bar" >
  1501. <swigxml:type string="int" />
  1502. </c:variable>
  1503. <c:variable name="x" >
  1504. <swigxml:type string="double" />
  1505. </c:variable>
  1506. <c:variable name="y" >
  1507. <swigxml:type string="double" />
  1508. </c:variable>
  1509. <c:function name="area" >
  1510. <swigxml:abstract string="1" />
  1511. <swigxml:storage string="virtual" />
  1512. <swigxml:type string="double" />
  1513. </c:function>
  1514. <c:variable name="nshapes" >
  1515. <swigxml:storage string="static" />
  1516. <swigxml:type string="int" />
  1517. </c:variable>
  1518. </swigxml:child>
  1519. <swigxml:classtype string="struct" />
  1520. <swigxml:namespace string="my_struct" />
  1521. </c:class>
  1522. <c:class name="my_class" >
  1523. <swigxml:child >
  1524. <c:access name="public" />
  1525. <c:function name="my_class" >
  1526. <swigxml:parms >
  1527. <swigxml:parm name="c" >
  1528. <swigxml:type string="char" />
  1529. </swigxml:parm>
  1530. </swigxml:parms>
  1531. <swigxml:type string="int" />
  1532. </c:function>
  1533. <c:access name="private" />
  1534. <c:destructor name="my_class" />
  1535. <c:function name="my_func" >
  1536. <swigxml:parms >
  1537. <swigxml:parm >
  1538. <swigxml:type string="my_class" />
  1539. </swigxml:parm>
  1540. <swigxml:parm name="x" >
  1541. <swigxml:type string="p.p.char" />
  1542. </swigxml:parm>
  1543. <swigxml:parm name="y" >
  1544. <swigxml:type string="a().int" />
  1545. </swigxml:parm>
  1546. <swigxml:parm name="r" >
  1547. <swigxml:type string="r.q(const).int" />
  1548. </swigxml:parm>
  1549. </swigxml:parms>
  1550. <swigxml:storage string="virtual" />
  1551. <swigxml:type string="p.q(const).int" />
  1552. </c:function>
  1553. <c:variable name="my_foo" >
  1554. <swigxml:type string="a(128).double" />
  1555. </c:variable>
  1556. <c:variable name="i" >
  1557. <swigxml:type string="q(const).my_int" />
  1558. </c:variable>
  1559. </swigxml:child>
  1560. <swigxml:classtype string="class" />
  1561. <swigxml:bases >
  1562. <swigxml:item name="my_struct" />
  1563. <swigxml:item name="my_union" />
  1564. </swigxml:bases>
  1565. <swigxml:namespace string="my_class" />
  1566. </c:class>
  1567. <c:typedef name="my_int" >
  1568. <swigxml:type string="int" />
  1569. </c:typedef>
  1570. </swigxml:child>
  1571. <swigxml:type string="include" />
  1572. </swig:file>
  1573. </swigxml:child>
  1574. </swig:top>
  1575. </swigxml:swig>