# PaCkAgE DaTaStReAm swig 1 13217 # end of header 0707010008e75c000081a40000000000000000000000014caec29c00000109000000b600010002ffffffffffffffff0000000d00000000swig/pkginfoPKG=swig NAME=swig 2.0.1 i86pc Solaris 11 VERSION=2.0.1 PSTAMP=6th October 2010 VENDOR=The SWIG Project EMAIL=http://www.swig.org/ DESC=Simplified Wrapper and Interface Generator ARCH=i386 CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 0707010008e75b000081a40000000000000000000000014caec29c0000cda2000000b600010002ffffffffffffffff0000000c00000000swig/pkgmap: 1 13217 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/bin 0755 root root 1 f none /usr/local/bin/ccache-swig 0755 root root 140216 41494 1286521482 1 f none /usr/local/bin/swig 0755 root root 2142784 9800 1286521476 1 d none /usr/local/share 0755 root root 1 d none /usr/local/share/man 0755 root root 1 d none /usr/local/share/man/man1 0755 root root 1 f none /usr/local/share/man/man1/ccache-swig.1 0644 root root 17284 66 1286521482 1 d none /usr/local/share/swig 0755 root root 1 d none /usr/local/share/swig/2.0.1 0755 root root 1 d none /usr/local/share/swig/2.0.1/allegrocl 0755 root root 1 f none /usr/local/share/swig/2.0.1/allegrocl/allegrocl.swg 0644 root root 24016 6532 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/inout_typemaps.i 0644 root root 4443 29467 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/longlongs.i 0644 root root 1252 32360 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/std_list.i 0644 root root 4849 17161 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/std_string.i 0644 root root 6749 64728 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/typemaps.i 0644 root root 87 7436 1286521481 1 f none /usr/local/share/swig/2.0.1/allkw.swg 0644 root root 684 59951 1286521476 1 f none /usr/local/share/swig/2.0.1/attribute.i 0644 root root 493 35024 1286521476 1 f none /usr/local/share/swig/2.0.1/carrays.i 0644 root root 2648 58589 1286521476 1 f none /usr/local/share/swig/2.0.1/cdata.i 0644 root root 2205 26821 1286521476 1 d none /usr/local/share/swig/2.0.1/cffi 0755 root root 1 f none /usr/local/share/swig/2.0.1/cffi/cffi.swg 0644 root root 9689 1584 1286521481 1 d none /usr/local/share/swig/2.0.1/chicken 0755 root root 1 f none /usr/local/share/swig/2.0.1/chicken/chicken.swg 0644 root root 22182 5708 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/chickenkw.swg 0644 root root 678 51496 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/chickenrun.swg 0644 root root 11024 32650 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/multi-generic.scm 0644 root root 6028 52965 1286521481 1 f none /usr/local/share/swig/2.0.1/chicken/std_string.i 0644 root root 2393 43905 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/swigclosprefix.scm 0644 root root 1166 14353 1286521481 1 f none /usr/local/share/swig/2.0.1/chicken/tinyclos-multi-generic.patch 0644 root root 5707 20698 1286521481 1 f none /usr/local/share/swig/2.0.1/chicken/typemaps.i 0644 root root 11823 26231 1286521480 1 d none /usr/local/share/swig/2.0.1/clisp 0755 root root 1 f none /usr/local/share/swig/2.0.1/clisp/clisp.swg 0644 root root 927 6054 1286521481 1 f none /usr/local/share/swig/2.0.1/cmalloc.i 0644 root root 2354 46082 1286521476 1 f none /usr/local/share/swig/2.0.1/constraints.i 0644 root root 7047 27504 1286521476 1 f none /usr/local/share/swig/2.0.1/cpointer.i 0644 root root 3559 51965 1286521476 1 d none /usr/local/share/swig/2.0.1/csharp 0755 root root 1 f none /usr/local/share/swig/2.0.1/csharp/arrays_csharp.i 0644 root root 4978 7435 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/boost_shared_ptr.i 0644 root root 9983 55226 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/csharp.swg 0644 root root 35838 23659 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/csharphead.swg 0644 root root 15876 12738 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/csharpkw.swg 0644 root root 1671 63731 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/director.swg 0644 root root 1158 25321 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/enums.swg 0644 root root 2933 36429 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/enumsimple.swg 0644 root root 2876 31607 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/enumtypesafe.swg 0644 root root 4781 3107 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_common.i 0644 root root 102 9003 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_deque.i 0644 root root 28 2523 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_except.i 0644 root root 2123 50269 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_map.i 0644 root root 10623 17014 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_pair.i 0644 root root 703 44055 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_shared_ptr.i 0644 root root 68 5802 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_string.i 0644 root root 3179 139 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_vector.i 0644 root root 14679 57357 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_wstring.i 0644 root root 3490 28408 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/stl.i 0644 root root 357 23881 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/typemaps.i 0644 root root 11684 62512 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/wchar.i 0644 root root 3247 62970 1286521481 1 f none /usr/local/share/swig/2.0.1/cstring.i 0644 root root 324 20333 1286521476 1 f none /usr/local/share/swig/2.0.1/cwstring.i 0644 root root 265 15477 1286521476 1 f none /usr/local/share/swig/2.0.1/exception.i 0644 root root 7221 53005 1286521476 1 d none /usr/local/share/swig/2.0.1/gcj 0755 root root 1 f none /usr/local/share/swig/2.0.1/gcj/cni.i 0644 root root 1041 27280 1286521476 1 f none /usr/local/share/swig/2.0.1/gcj/cni.swg 0644 root root 287 16883 1286521476 1 f none /usr/local/share/swig/2.0.1/gcj/javaprims.i 0644 root root 11716 30508 1286521476 1 d none /usr/local/share/swig/2.0.1/go 0755 root root 1 f none /usr/local/share/swig/2.0.1/go/cdata.i 0644 root root 3023 43430 1286521481 1 f none /usr/local/share/swig/2.0.1/go/exception.i 0644 root root 173 14973 1286521481 1 f none /usr/local/share/swig/2.0.1/go/go.swg 0644 root root 12243 6535 1286521482 1 f none /usr/local/share/swig/2.0.1/go/gokw.swg 0644 root root 555 42965 1286521482 1 f none /usr/local/share/swig/2.0.1/go/goruntime.swg 0644 root root 4344 43773 1286521482 1 f none /usr/local/share/swig/2.0.1/go/std_common.i 0644 root root 101 8993 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_deque.i 0644 root root 28 2523 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_except.i 0644 root root 1207 34448 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_map.i 0644 root root 1754 47040 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_pair.i 0644 root root 712 45010 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_string.i 0644 root root 1372 43137 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_vector.i 0644 root root 2498 41521 1286521481 1 f none /usr/local/share/swig/2.0.1/go/stl.i 0644 root root 290 18221 1286521481 1 f none /usr/local/share/swig/2.0.1/go/typemaps.i 0644 root root 10800 39130 1286521482 1 d none /usr/local/share/swig/2.0.1/guile 0755 root root 1 f none /usr/local/share/swig/2.0.1/guile/common.scm 0644 root root 2384 55224 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/cplusplus.i 0644 root root 749 55748 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/ghinterface.i 0644 root root 1685 14433 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile.i 0644 root root 1076 19467 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_gh.swg 0644 root root 2093 22547 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_gh_run.swg 0644 root root 6801 12180 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_scm.swg 0644 root root 1390 36465 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_scm_run.swg 0644 root root 13677 64006 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guilemain.i 0644 root root 1052 15603 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/interpreter.i 0644 root root 1421 42466 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/list-vector.i 0644 root root 18124 40935 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/pointer-in-out.i 0644 root root 3325 57702 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/ports.i 0644 root root 1347 30080 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_common.i 0644 root root 574 40402 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_deque.i 0644 root root 28 2523 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_except.i 0644 root root 182 15552 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_map.i 0644 root root 60055 13573 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_pair.i 0644 root root 40125 54692 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_string.i 0644 root root 2325 33357 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_vector.i 0644 root root 16742 29571 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/stl.i 0644 root root 357 23881 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/swigrun.i 0644 root root 965 18949 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/typemaps.i 0644 root root 15091 37454 1286521478 1 f none /usr/local/share/swig/2.0.1/intrusive_ptr.i 0644 root root 2896 33252 1286521476 1 f none /usr/local/share/swig/2.0.1/inttypes.i 0644 root root 2634 15084 1286521476 1 d none /usr/local/share/swig/2.0.1/java 0755 root root 1 f none /usr/local/share/swig/2.0.1/java/arrays_java.i 0644 root root 13525 14217 1286521478 1 f none /usr/local/share/swig/2.0.1/java/boost_intrusive_ptr.i 0644 root root 19825 11376 1286521479 1 f none /usr/local/share/swig/2.0.1/java/boost_shared_ptr.i 0644 root root 8339 54448 1286521479 1 f none /usr/local/share/swig/2.0.1/java/director.swg 0644 root root 6014 6209 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enums.swg 0644 root root 4580 53932 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enumsimple.swg 0644 root root 2586 10237 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enumtypesafe.swg 0644 root root 4690 63354 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enumtypeunsafe.swg 0644 root root 2734 23585 1286521479 1 f none /usr/local/share/swig/2.0.1/java/java.swg 0644 root root 45351 49517 1286521479 1 f none /usr/local/share/swig/2.0.1/java/javahead.swg 0644 root root 4181 10499 1286521479 1 f none /usr/local/share/swig/2.0.1/java/javakw.swg 0644 root root 1270 32017 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_common.i 0644 root root 102 9003 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_deque.i 0644 root root 28 2523 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_except.i 0644 root root 1924 31812 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_map.i 0644 root root 2337 33047 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_pair.i 0644 root root 712 45010 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_shared_ptr.i 0644 root root 68 5802 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_string.i 0644 root root 3427 19493 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_vector.i 0644 root root 2644 54781 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_wstring.i 0644 root root 4933 8259 1286521479 1 f none /usr/local/share/swig/2.0.1/java/stl.i 0644 root root 291 18231 1286521479 1 f none /usr/local/share/swig/2.0.1/java/typemaps.i 0644 root root 17965 27675 1286521479 1 f none /usr/local/share/swig/2.0.1/java/various.i 0644 root root 4369 12775 1286521479 1 d none /usr/local/share/swig/2.0.1/lua 0755 root root 1 f none /usr/local/share/swig/2.0.1/lua/_std_common.i 0644 root root 2554 5987 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/carrays.i 0644 root root 261 22612 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/lua.swg 0644 root root 8898 41663 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/lua_fnptr.i 0644 root root 4279 8070 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/luarun.swg 0644 root root 26716 34099 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/luaruntime.swg 0644 root root 2333 58088 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/luatypemaps.swg 0644 root root 13468 41319 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_common.i 0644 root root 102 9003 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_deque.i 0644 root root 28 2523 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_except.i 0644 root root 1873 23635 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_map.i 0644 root root 1754 47040 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_pair.i 0644 root root 771 56241 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_string.i 0644 root root 4374 35261 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_vector.i 0644 root root 3082 44877 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/stl.i 0644 root root 291 18231 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/typemaps.i 0644 root root 19181 48337 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/wchar.i 0644 root root 1076 16835 1286521481 1 f none /usr/local/share/swig/2.0.1/math.i 0644 root root 2086 23257 1286521476 1 d none /usr/local/share/swig/2.0.1/modula3 0755 root root 1 f none /usr/local/share/swig/2.0.1/modula3/modula3.swg 0644 root root 34237 227 1286521481 1 f none /usr/local/share/swig/2.0.1/modula3/modula3head.swg 0644 root root 2022 37271 1286521481 1 f none /usr/local/share/swig/2.0.1/modula3/typemaps.i 0644 root root 4305 34919 1286521481 1 d none /usr/local/share/swig/2.0.1/mzscheme 0755 root root 1 f none /usr/local/share/swig/2.0.1/mzscheme/mzrun.swg 0644 root root 15093 7126 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/mzscheme.swg 0644 root root 1844 6809 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_common.i 0644 root root 511 37133 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_deque.i 0644 root root 28 2523 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_map.i 0644 root root 64500 19533 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_pair.i 0644 root root 43787 57307 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_string.i 0644 root root 1437 34435 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_vector.i 0644 root root 17811 7444 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/stl.i 0644 root root 356 23871 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/typemaps.i 0644 root root 10203 12994 1286521479 1 d none /usr/local/share/swig/2.0.1/ocaml 0755 root root 1 f none /usr/local/share/swig/2.0.1/ocaml/carray.i 0644 root root 3252 64846 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/class.swg 0644 root root 1718 60783 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/cstring.i 0644 root root 6071 6721 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/director.swg 0644 root root 3009 43951 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocaml.i 0644 root root 1450 48522 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocaml.swg 0644 root root 14358 53460 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocamldec.swg 0644 root root 5328 17014 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocamlkw.swg 0644 root root 1066 16127 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/preamble.swg 0644 root root 473 43605 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_common.i 0644 root root 531 37792 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_complex.i 0644 root root 1548 53904 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_deque.i 0644 root root 722 54040 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_list.i 0644 root root 4324 37994 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_map.i 0644 root root 2200 22076 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_pair.i 0644 root root 712 45010 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_string.i 0644 root root 5134 4591 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_vector.i 0644 root root 2754 9896 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/stl.i 0644 root root 357 23881 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/swig.ml 0644 root root 4684 49506 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/swig.mli 0644 root root 1696 7289 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/swigp4.ml 0644 root root 5942 415 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/typecheck.i 0644 root root 4703 15051 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/typemaps.i 0644 root root 8770 54879 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/typeregister.swg 0644 root root 55 4471 1286521480 1 d none /usr/local/share/swig/2.0.1/octave 0755 root root 1 f none /usr/local/share/swig/2.0.1/octave/attribute.i 0644 root root 34 3234 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/boost_shared_ptr.i 0644 root root 15720 9633 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/carrays.i 0644 root root 129 11317 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/cdata.i 0644 root root 30 2763 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/cmalloc.i 0644 root root 32 2985 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/director.swg 0644 root root 59 4806 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/exception.i 0644 root root 139 11771 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/factory.i 0644 root root 32 3014 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/implicit.i 0644 root root 287 25966 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octave.swg 0644 root root 222 20476 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octcomplex.swg 0644 root root 2337 54363 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octcontainer.swg 0644 root root 16300 10557 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octfragments.swg 0644 root root 1 10 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octiterators.swg 0644 root root 9076 27310 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octopers.swg 0644 root root 2671 2970 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octprimtypes.swg 0644 root root 5471 40961 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octrun.swg 0644 root root 43807 8764 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octruntime.swg 0644 root root 3263 23323 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octstdcommon.swg 0644 root root 6186 50378 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octtypemaps.swg 0644 root root 2562 16463 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octuserdir.swg 0644 root root 1814 367 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_alloc.i 0644 root root 27 2419 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_basic_string.i 0644 root root 2317 56739 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_carray.i 0644 root root 1589 1004 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_char_traits.i 0644 root root 33 3068 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_common.i 0644 root root 1051 22886 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_complex.i 0644 root root 470 40700 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_container.i 0644 root root 59 5472 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_deque.i 0644 root root 679 57722 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_except.i 0644 root root 35 3329 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_map.i 0644 root root 4548 48845 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_pair.i 0644 root root 3132 44137 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_string.i 0644 root root 35 3343 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_vector.i 0644 root root 700 59814 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/stl.i 0644 root root 181 16041 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/typemaps.i 0644 root root 33 3137 1286521480 1 d none /usr/local/share/swig/2.0.1/perl5 0755 root root 1 f none /usr/local/share/swig/2.0.1/perl5/Makefile.pl 0644 root root 691 54613 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/attribute.i 0644 root root 34 3234 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/carrays.i 0644 root root 33 3021 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cdata.i 0644 root root 30 2763 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cmalloc.i 0644 root root 32 2985 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cni.i 0644 root root 150 11847 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cpointer.i 0644 root root 33 3122 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cstring.i 0644 root root 32 3016 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/exception.i 0644 root root 138 11761 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/factory.i 0644 root root 32 3014 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/jstring.i 0644 root root 1046 14649 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/noembed.h 0644 root root 1411 52974 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perl5.swg 0644 root root 1476 17970 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlerrors.swg 0644 root root 1033 10010 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlfragments.swg 0644 root root 556 45634 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlhead.swg 0644 root root 2614 59584 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlinit.swg 0644 root root 1817 13662 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlkw.swg 0644 root root 3870 39244 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlmacros.swg 0644 root root 36 3351 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlmain.i 0644 root root 1986 28108 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlopers.swg 0644 root root 1872 14999 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlprimtypes.swg 0644 root root 7182 14431 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlrun.swg 0644 root root 14436 55129 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlruntime.swg 0644 root root 326 26426 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlstrings.swg 0644 root root 1425 40113 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perltypemaps.swg 0644 root root 2796 10575 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perluserdir.swg 0644 root root 36 2935 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/reference.i 0644 root root 7230 13105 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_common.i 0644 root root 617 44263 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_deque.i 0644 root root 28 2523 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_except.i 0644 root root 35 3329 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_list.i 0644 root root 14149 54503 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_map.i 0644 root root 2201 22086 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_pair.i 0644 root root 703 44055 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_string.i 0644 root root 62 5880 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_vector.i 0644 root root 22489 47847 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/stl.i 0644 root root 356 23871 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/typemaps.i 0644 root root 12783 15707 1286521477 1 d none /usr/local/share/swig/2.0.1/php 0755 root root 1 f none /usr/local/share/swig/2.0.1/php/const.i 0644 root root 1680 49870 1286521480 1 f none /usr/local/share/swig/2.0.1/php/director.swg 0644 root root 4154 53635 1286521480 1 f none /usr/local/share/swig/2.0.1/php/factory.i 0644 root root 3109 34276 1286521480 1 f none /usr/local/share/swig/2.0.1/php/globalvar.i 0644 root root 9070 25676 1286521480 1 f none /usr/local/share/swig/2.0.1/php/php.swg 0644 root root 12827 65131 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phpinit.swg 0644 root root 706 56045 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phpkw.swg 0644 root root 10886 42266 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phppointers.i 0644 root root 1491 48022 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phprun.swg 0644 root root 8555 34856 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_common.i 0644 root root 290 17843 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_deque.i 0644 root root 28 2523 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_map.i 0644 root root 2261 25602 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_pair.i 0644 root root 712 45010 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_string.i 0644 root root 2448 49713 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_vector.i 0644 root root 2747 10202 1286521480 1 f none /usr/local/share/swig/2.0.1/php/stl.i 0644 root root 357 23881 1286521480 1 f none /usr/local/share/swig/2.0.1/php/typemaps.i 0644 root root 8740 34694 1286521480 1 f none /usr/local/share/swig/2.0.1/php/utils.i 0644 root root 2589 63681 1286521480 1 d none /usr/local/share/swig/2.0.1/pike 0755 root root 1 f none /usr/local/share/swig/2.0.1/pike/pike.swg 0644 root root 9328 28322 1286521480 1 f none /usr/local/share/swig/2.0.1/pike/pikekw.swg 0644 root root 849 201 1286521480 1 f none /usr/local/share/swig/2.0.1/pike/pikerun.swg 0644 root root 2007 29673 1286521480 1 f none /usr/local/share/swig/2.0.1/pike/std_string.i 0644 root root 1621 55381 1286521480 1 f none /usr/local/share/swig/2.0.1/pointer.i 0644 root root 294 17909 1286521476 1 d none /usr/local/share/swig/2.0.1/python 0755 root root 1 f none /usr/local/share/swig/2.0.1/python/argcargv.i 0644 root root 2642 64999 1286521477 1 f none /usr/local/share/swig/2.0.1/python/attribute.i 0644 root root 34 3234 1286521477 1 f none /usr/local/share/swig/2.0.1/python/boost_shared_ptr.i 0644 root root 16140 44125 1286521477 1 f none /usr/local/share/swig/2.0.1/python/carrays.i 0644 root root 132 11283 1286521477 1 f none /usr/local/share/swig/2.0.1/python/ccomplex.i 0644 root root 763 58269 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cdata.i 0644 root root 30 2763 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cmalloc.i 0644 root root 32 2985 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cni.i 0644 root root 42 3622 1286521478 1 f none /usr/local/share/swig/2.0.1/python/complex.i 0644 root root 80 7052 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cpointer.i 0644 root root 33 3122 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cstring.i 0644 root root 32 3016 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cwstring.i 0644 root root 60 5599 1286521478 1 f none /usr/local/share/swig/2.0.1/python/defarg.swg 0644 root root 1154 28508 1286521478 1 f none /usr/local/share/swig/2.0.1/python/director.swg 0644 root root 10732 51925 1286521478 1 f none /usr/local/share/swig/2.0.1/python/embed.i 0644 root root 2703 38511 1286521478 1 f none /usr/local/share/swig/2.0.1/python/embed15.i 0644 root root 2866 45637 1286521478 1 f none /usr/local/share/swig/2.0.1/python/exception.i 0644 root root 139 11771 1286521478 1 f none /usr/local/share/swig/2.0.1/python/factory.i 0644 root root 32 3014 1286521478 1 f none /usr/local/share/swig/2.0.1/python/file.i 0644 root root 1035 8723 1286521478 1 f none /usr/local/share/swig/2.0.1/python/implicit.i 0644 root root 287 25966 1286521478 1 f none /usr/local/share/swig/2.0.1/python/jstring.i 0644 root root 1759 4912 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyabc.i 0644 root root 417 38391 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyapi.swg 0644 root root 1265 20581 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pybackward.swg 0644 root root 1162 26171 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pybuffer.i 0644 root root 2782 15357 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyclasses.swg 0644 root root 3056 45521 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pycomplex.swg 0644 root root 2242 51270 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pycontainer.swg 0644 root root 21871 61430 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pydocs.swg 0644 root root 733 59349 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyerrors.swg 0644 root root 1618 59094 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyfragments.swg 0644 root root 551 45181 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyhead.swg 0644 root root 3689 41527 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyinit.swg 0644 root root 10437 45201 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyiterators.swg 0644 root root 10222 47533 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pymacros.swg 0644 root root 38 3371 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyname_compat.i 0644 root root 4247 1552 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyopers.swg 0644 root root 4468 43953 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyprimtypes.swg 0644 root root 6705 52691 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyrun.swg 0644 root root 44385 38022 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyruntime.swg 0644 root root 517 40543 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pystdcommon.swg 0644 root root 6871 29891 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pystrings.swg 0644 root root 2951 30133 1286521478 1 f none /usr/local/share/swig/2.0.1/python/python.swg 0644 root root 2035 49800 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pythonkw.swg 0644 root root 2353 53233 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pythreads.swg 0644 root root 2864 23206 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pytuplehlp.swg 0644 root root 308 27585 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pytypemaps.swg 0644 root root 2907 21413 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyuserdir.swg 0644 root root 6283 16402 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pywstrings.swg 0644 root root 1892 16030 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_alloc.i 0644 root root 27 2419 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_basic_string.i 0644 root root 2817 27302 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_carray.i 0644 root root 1583 806 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_char_traits.i 0644 root root 33 3068 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_common.i 0644 root root 1049 22005 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_complex.i 0644 root root 469 40607 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_container.i 0644 root root 58 5379 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_deque.i 0644 root root 678 56986 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_except.i 0644 root root 35 3329 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_ios.i 0644 root root 66 5850 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_iostream.i 0644 root root 107 8990 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_list.i 0644 root root 668 56048 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_map.i 0644 root root 8154 822 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_multimap.i 0644 root root 2488 7849 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_multiset.i 0644 root root 1085 25284 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_pair.i 0644 root root 3851 39160 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_set.i 0644 root root 1363 45455 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_shared_ptr.i 0644 root root 68 5802 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_sstream.i 0644 root root 29 2663 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_streambuf.i 0644 root root 31 2865 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_string.i 0644 root root 35 3343 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_vector.i 0644 root root 691 58447 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_vectora.i 0644 root root 829 4993 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wios.i 0644 root root 26 2346 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wiostream.i 0644 root root 166 14556 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wsstream.i 0644 root root 30 2782 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wstreambuf.i 0644 root root 32 2984 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wstring.i 0644 root root 63 5926 1286521478 1 f none /usr/local/share/swig/2.0.1/python/stl.i 0644 root root 182 16051 1286521478 1 f none /usr/local/share/swig/2.0.1/python/typemaps.i 0644 root root 4453 10239 1286521478 1 f none /usr/local/share/swig/2.0.1/python/wchar.i 0644 root root 186 15021 1286521478 1 d none /usr/local/share/swig/2.0.1/r 0755 root root 1 f none /usr/local/share/swig/2.0.1/r/cdata.i 0644 root root 30 2763 1286521481 1 f none /usr/local/share/swig/2.0.1/r/exception.i 0644 root root 225 19250 1286521481 1 f none /usr/local/share/swig/2.0.1/r/r.swg 0644 root root 5858 90 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rcontainer.swg 0644 root root 5476 54325 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rfragments.swg 0644 root root 4674 47473 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rkw.swg 0644 root root 528 41565 1286521481 1 f none /usr/local/share/swig/2.0.1/r/ropers.swg 0644 root root 2196 52455 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rrun.swg 0644 root root 8643 42901 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rstdcommon.swg 0644 root root 5453 42961 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rtype.swg 0644 root root 5334 17335 1286521481 1 f none /usr/local/share/swig/2.0.1/r/srun.swg 0644 root root 3901 40940 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_alloc.i 0644 root root 26 2409 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_common.i 0644 root root 54 4963 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_container.i 0644 root root 57 5260 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_deque.i 0644 root root 25 2386 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_except.i 0644 root root 35 3329 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_map.i 0644 root root 67 5559 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_pair.i 0644 root root 68 5747 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_string.i 0644 root root 35 3343 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_vector.i 0644 root root 218 19616 1286521481 1 f none /usr/local/share/swig/2.0.1/r/stl.i 0644 root root 136 11933 1286521481 1 f none /usr/local/share/swig/2.0.1/r/typemaps.i 0644 root root 33 3137 1286521481 1 d none /usr/local/share/swig/2.0.1/ruby 0755 root root 1 f none /usr/local/share/swig/2.0.1/ruby/Makefile.swig 0644 root root 943 6854 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/argcargv.i 0644 root root 1221 15218 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/attribute.i 0644 root root 34 3234 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/carrays.i 0644 root root 129 11253 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cdata.i 0644 root root 30 2763 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cmalloc.i 0644 root root 32 2985 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cni.i 0644 root root 42 3622 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cpointer.i 0644 root root 33 3122 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cstring.i 0644 root root 32 3016 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/director.swg 0644 root root 8308 63949 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/embed.i 0644 root root 169 12819 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/exception.i 0644 root root 126 10817 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/extconf.rb 0644 root root 234 20334 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/factory.i 0644 root root 32 3014 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/file.i 0644 root root 639 49189 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/jstring.i 0644 root root 952 8162 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/progargcargv.i 0644 root root 770 57045 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/ruby.swg 0644 root root 2653 41571 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyapi.swg 0644 root root 801 57509 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyautodoc.swg 0644 root root 4367 35703 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyclasses.swg 0644 root root 9008 4103 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubycomplex.swg 0644 root root 3316 1449 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubycontainer.swg 0644 root root 27085 13204 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubycontainer_extended.swg 0644 root root 3601 28715 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubydef.swg 0644 root root 42 3520 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyerrors.swg 0644 root root 3714 29065 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyfragments.swg 0644 root root 552 45188 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyhead.swg 0644 root root 4281 8942 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyinit.swg 0644 root root 39 3641 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyiterators.swg 0644 root root 22750 62385 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubykw.swg 0644 root root 1177 24075 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubymacros.swg 0644 root root 456 39715 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyopers.swg 0644 root root 1852 12606 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyprimtypes.swg 0644 root root 5216 64729 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyrun.swg 0644 root root 13529 23573 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyruntime.swg 0644 root root 423 34615 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystdautodoc.swg 0644 root root 1819 16721 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystdcommon.swg 0644 root root 6607 60485 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystdfunctors.swg 0644 root root 4164 56590 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystrings.swg 0644 root root 1657 60576 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubytracking.swg 0644 root root 5156 29245 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubytypemaps.swg 0644 root root 1807 3611 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/rubyuserdir.swg 0644 root root 409 34531 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/rubywstrings.swg 0644 root root 2459 52771 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/std_alloc.i 0644 root root 27 2419 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_basic_string.i 0644 root root 2640 15879 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_char_traits.i 0644 root root 33 3068 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_common.i 0644 root root 1072 24146 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_complex.i 0644 root root 471 40824 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_container.i 0644 root root 60 5596 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_deque.i 0644 root root 732 61603 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_except.i 0644 root root 35 3329 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_functors.i 0644 root root 768 56857 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_ios.i 0644 root root 380 30590 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_iostream.i 0644 root root 227 19235 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_list.i 0644 root root 1037 20419 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_map.i 0644 root root 11150 7686 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_multimap.i 0644 root root 6084 8511 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_multiset.i 0644 root root 1403 51021 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_pair.i 0644 root root 5339 11430 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_queue.i 0644 root root 851 3761 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_set.i 0644 root root 5962 26108 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_sstream.i 0644 root root 30 2673 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_stack.i 0644 root root 853 3541 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_streambuf.i 0644 root root 31 2865 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_string.i 0644 root root 190 16332 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_vector.i 0644 root root 1218 36788 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_vectora.i 0644 root root 950 15363 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_wstring.i 0644 root root 65 6143 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/stl.i 0644 root root 357 23881 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/timeval.i 0644 root root 1028 16921 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/typemaps.i 0644 root root 11314 45213 1286521479 1 f none /usr/local/share/swig/2.0.1/runtime.swg 0644 root root 1236 33789 1286521476 1 f none /usr/local/share/swig/2.0.1/shared_ptr.i 0644 root root 2148 44436 1286521476 1 d none /usr/local/share/swig/2.0.1/std 0755 root root 1 f none /usr/local/share/swig/2.0.1/std/_std_deque.i 0644 root root 4213 22416 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_alloc.i 0644 root root 2015 26420 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_basic_string.i 0644 root root 6494 15063 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_carray.swg 0644 root root 1416 47705 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_char_traits.i 0644 root root 3190 977 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_common.i 0644 root root 4951 15360 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_container.i 0644 root root 2523 23212 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_deque.i 0644 root root 3504 23168 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_except.i 0644 root root 1130 29429 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_ios.i 0644 root root 5146 22031 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_iostream.i 0644 root root 8853 4040 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_list.i 0644 root root 3864 50968 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_map.i 0644 root root 3565 25709 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_multimap.i 0644 root root 2842 35456 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_multiset.i 0644 root root 2527 9083 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_pair.i 0644 root root 3681 22320 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_queue.i 0644 root root 3510 21107 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_set.i 0644 root root 3201 63661 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_sstream.i 0644 root root 5323 47990 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_stack.i 0644 root root 3484 18333 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_streambuf.i 0644 root root 1741 9865 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_string.i 0644 root root 219 19522 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_vector.i 0644 root root 6130 45595 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_vectora.i 0644 root root 147 12902 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wios.i 0644 root root 90 7429 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wiostream.i 0644 root root 100 8503 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wsstream.i 0644 root root 98 8301 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wstreambuf.i 0644 root root 102 8705 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wstring.i 0644 root root 249 22387 1286521482 1 f none /usr/local/share/swig/2.0.1/std_except.i 0644 root root 1981 33145 1286521476 1 f none /usr/local/share/swig/2.0.1/stdint.i 0644 root root 2368 64545 1286521476 1 f none /usr/local/share/swig/2.0.1/stl.i 0644 root root 249 14312 1286521476 1 f none /usr/local/share/swig/2.0.1/swig.swg 0644 root root 24317 43057 1286521476 1 f none /usr/local/share/swig/2.0.1/swigarch.i 0644 root root 1580 53263 1286521476 1 f none /usr/local/share/swig/2.0.1/swigerrors.swg 0644 root root 509 36777 1286521476 1 f none /usr/local/share/swig/2.0.1/swiginit.swg 0644 root root 8098 12676 1286521476 1 f none /usr/local/share/swig/2.0.1/swiglabels.swg 0644 root root 3182 47435 1286521476 1 f none /usr/local/share/swig/2.0.1/swigrun.i 0644 root root 256 14947 1286521476 1 f none /usr/local/share/swig/2.0.1/swigrun.swg 0644 root root 17115 56027 1286521476 1 f none /usr/local/share/swig/2.0.1/swigwarn.swg 0644 root root 12520 33344 1286521476 1 f none /usr/local/share/swig/2.0.1/swigwarnings.swg 0644 root root 6990 64149 1286521476 1 d none /usr/local/share/swig/2.0.1/tcl 0755 root root 1 f none /usr/local/share/swig/2.0.1/tcl/attribute.i 0644 root root 34 3234 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/carrays.i 0644 root root 35 3041 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cdata.i 0644 root root 30 2763 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cmalloc.i 0644 root root 32 2985 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cni.i 0644 root root 42 3622 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cpointer.i 0644 root root 33 3122 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cstring.i 0644 root root 32 3016 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cwstring.i 0644 root root 60 5679 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/exception.i 0644 root root 145 12338 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/factory.i 0644 root root 32 3014 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/jstring.i 0644 root root 1000 13352 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_common.i 0644 root root 467 33565 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_deque.i 0644 root root 28 2523 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_except.i 0644 root root 35 3329 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_map.i 0644 root root 2082 18372 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_pair.i 0644 root root 707 44632 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_string.i 0644 root root 36 3353 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_vector.i 0644 root root 15613 18402 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_wstring.i 0644 root root 63 6006 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/stl.i 0644 root root 357 23965 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tcl8.swg 0644 root root 1500 18324 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclapi.swg 0644 root root 3067 39096 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclerrors.swg 0644 root root 1695 65464 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclfragments.swg 0644 root root 555 45869 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclinit.swg 0644 root root 3366 62332 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclinterp.i 0644 root root 617 46503 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclkw.swg 0644 root root 247 21054 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclmacros.swg 0644 root root 38 3371 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclopers.swg 0644 root root 1512 45064 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclprimtypes.swg 0644 root root 5606 35874 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclresult.i 0644 root root 684 44896 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclrun.swg 0644 root root 22006 2458 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclruntime.swg 0644 root root 484 38494 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclsh.i 0644 root root 1871 11795 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclstrings.swg 0644 root root 793 59022 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tcltypemaps.swg 0644 root root 2774 9048 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tcluserdir.swg 0644 root root 195 9756 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclwstrings.swg 0644 root root 1836 5884 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/typemaps.i 0644 root root 16058 10064 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/wish.i 0644 root root 3436 1785 1286521477 1 d none /usr/local/share/swig/2.0.1/typemaps 0755 root root 1 f none /usr/local/share/swig/2.0.1/typemaps/attribute.swg 0644 root root 9475 60085 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/carrays.swg 0644 root root 2691 60264 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cdata.swg 0644 root root 1872 1924 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cmalloc.swg 0644 root root 2438 55249 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cpointer.swg 0644 root root 3266 26430 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cstring.swg 0644 root root 167 13755 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cstrings.swg 0644 root root 8222 26333 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cwstring.swg 0644 root root 207 17588 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/enumint.swg 0644 root root 906 2013 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/exception.swg 0644 root root 2710 17186 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/factory.swg 0644 root root 2441 43983 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/fragments.swg 0644 root root 6744 6303 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/implicit.swg 0644 root root 4825 59403 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/inoutlist.swg 0644 root root 9481 45216 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/misctypes.swg 0644 root root 467 34147 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/primtypes.swg 0644 root root 8581 700 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/ptrtypes.swg 0644 root root 6584 55254 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/std_except.swg 0644 root root 2186 55163 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/std_string.swg 0644 root root 350 29267 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/std_strings.swg 0644 root root 2058 32618 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/std_wstring.swg 0644 root root 395 34138 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/string.swg 0644 root root 547 45598 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/strings.swg 0644 root root 16964 308 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigmacros.swg 0644 root root 8135 1308 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigobject.swg 0644 root root 898 1582 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigtype.swg 0644 root root 19400 5118 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigtypemaps.swg 0644 root root 4987 4033 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/traits.swg 0644 root root 7549 20160 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/typemaps.swg 0644 root root 4564 18913 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/valtypes.swg 0644 root root 7168 47041 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/void.swg 0644 root root 2077 28579 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/wstring.swg 0644 root root 567 47346 1286521477 1 d none /usr/local/share/swig/2.0.1/uffi 0755 root root 1 f none /usr/local/share/swig/2.0.1/uffi/uffi.swg 0644 root root 3214 62483 1286521481 1 f none /usr/local/share/swig/2.0.1/wchar.i 0644 root root 309 19276 1286521476 1 f none /usr/local/share/swig/2.0.1/windows.i 0644 root root 4143 8697 1286521476 1 i checkinstall 790 2505 1286521516 1 i pkginfo 265 20374 1286521500 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!0707010008e75c000081a40000000000000000000000014caec29c00000109000000b600010002ffffffffffffffff0000000800000000pkginfoPKG=swig NAME=swig 2.0.1 i86pc Solaris 11 VERSION=2.0.1 PSTAMP=6th October 2010 VENDOR=The SWIG Project EMAIL=http://www.swig.org/ DESC=Simplified Wrapper and Interface Generator ARCH=i386 CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 0707010008e75b000081a40000000000000000000000014caec29c0000cda2000000b600010002ffffffffffffffff0000000700000000pkgmap: 1 13217 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/bin 0755 root root 1 f none /usr/local/bin/ccache-swig 0755 root root 140216 41494 1286521482 1 f none /usr/local/bin/swig 0755 root root 2142784 9800 1286521476 1 d none /usr/local/share 0755 root root 1 d none /usr/local/share/man 0755 root root 1 d none /usr/local/share/man/man1 0755 root root 1 f none /usr/local/share/man/man1/ccache-swig.1 0644 root root 17284 66 1286521482 1 d none /usr/local/share/swig 0755 root root 1 d none /usr/local/share/swig/2.0.1 0755 root root 1 d none /usr/local/share/swig/2.0.1/allegrocl 0755 root root 1 f none /usr/local/share/swig/2.0.1/allegrocl/allegrocl.swg 0644 root root 24016 6532 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/inout_typemaps.i 0644 root root 4443 29467 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/longlongs.i 0644 root root 1252 32360 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/std_list.i 0644 root root 4849 17161 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/std_string.i 0644 root root 6749 64728 1286521481 1 f none /usr/local/share/swig/2.0.1/allegrocl/typemaps.i 0644 root root 87 7436 1286521481 1 f none /usr/local/share/swig/2.0.1/allkw.swg 0644 root root 684 59951 1286521476 1 f none /usr/local/share/swig/2.0.1/attribute.i 0644 root root 493 35024 1286521476 1 f none /usr/local/share/swig/2.0.1/carrays.i 0644 root root 2648 58589 1286521476 1 f none /usr/local/share/swig/2.0.1/cdata.i 0644 root root 2205 26821 1286521476 1 d none /usr/local/share/swig/2.0.1/cffi 0755 root root 1 f none /usr/local/share/swig/2.0.1/cffi/cffi.swg 0644 root root 9689 1584 1286521481 1 d none /usr/local/share/swig/2.0.1/chicken 0755 root root 1 f none /usr/local/share/swig/2.0.1/chicken/chicken.swg 0644 root root 22182 5708 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/chickenkw.swg 0644 root root 678 51496 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/chickenrun.swg 0644 root root 11024 32650 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/multi-generic.scm 0644 root root 6028 52965 1286521481 1 f none /usr/local/share/swig/2.0.1/chicken/std_string.i 0644 root root 2393 43905 1286521480 1 f none /usr/local/share/swig/2.0.1/chicken/swigclosprefix.scm 0644 root root 1166 14353 1286521481 1 f none /usr/local/share/swig/2.0.1/chicken/tinyclos-multi-generic.patch 0644 root root 5707 20698 1286521481 1 f none /usr/local/share/swig/2.0.1/chicken/typemaps.i 0644 root root 11823 26231 1286521480 1 d none /usr/local/share/swig/2.0.1/clisp 0755 root root 1 f none /usr/local/share/swig/2.0.1/clisp/clisp.swg 0644 root root 927 6054 1286521481 1 f none /usr/local/share/swig/2.0.1/cmalloc.i 0644 root root 2354 46082 1286521476 1 f none /usr/local/share/swig/2.0.1/constraints.i 0644 root root 7047 27504 1286521476 1 f none /usr/local/share/swig/2.0.1/cpointer.i 0644 root root 3559 51965 1286521476 1 d none /usr/local/share/swig/2.0.1/csharp 0755 root root 1 f none /usr/local/share/swig/2.0.1/csharp/arrays_csharp.i 0644 root root 4978 7435 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/boost_shared_ptr.i 0644 root root 9983 55226 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/csharp.swg 0644 root root 35838 23659 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/csharphead.swg 0644 root root 15876 12738 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/csharpkw.swg 0644 root root 1671 63731 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/director.swg 0644 root root 1158 25321 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/enums.swg 0644 root root 2933 36429 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/enumsimple.swg 0644 root root 2876 31607 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/enumtypesafe.swg 0644 root root 4781 3107 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_common.i 0644 root root 102 9003 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_deque.i 0644 root root 28 2523 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_except.i 0644 root root 2123 50269 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_map.i 0644 root root 10623 17014 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_pair.i 0644 root root 703 44055 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_shared_ptr.i 0644 root root 68 5802 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_string.i 0644 root root 3179 139 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_vector.i 0644 root root 14679 57357 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/std_wstring.i 0644 root root 3490 28408 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/stl.i 0644 root root 357 23881 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/typemaps.i 0644 root root 11684 62512 1286521481 1 f none /usr/local/share/swig/2.0.1/csharp/wchar.i 0644 root root 3247 62970 1286521481 1 f none /usr/local/share/swig/2.0.1/cstring.i 0644 root root 324 20333 1286521476 1 f none /usr/local/share/swig/2.0.1/cwstring.i 0644 root root 265 15477 1286521476 1 f none /usr/local/share/swig/2.0.1/exception.i 0644 root root 7221 53005 1286521476 1 d none /usr/local/share/swig/2.0.1/gcj 0755 root root 1 f none /usr/local/share/swig/2.0.1/gcj/cni.i 0644 root root 1041 27280 1286521476 1 f none /usr/local/share/swig/2.0.1/gcj/cni.swg 0644 root root 287 16883 1286521476 1 f none /usr/local/share/swig/2.0.1/gcj/javaprims.i 0644 root root 11716 30508 1286521476 1 d none /usr/local/share/swig/2.0.1/go 0755 root root 1 f none /usr/local/share/swig/2.0.1/go/cdata.i 0644 root root 3023 43430 1286521481 1 f none /usr/local/share/swig/2.0.1/go/exception.i 0644 root root 173 14973 1286521481 1 f none /usr/local/share/swig/2.0.1/go/go.swg 0644 root root 12243 6535 1286521482 1 f none /usr/local/share/swig/2.0.1/go/gokw.swg 0644 root root 555 42965 1286521482 1 f none /usr/local/share/swig/2.0.1/go/goruntime.swg 0644 root root 4344 43773 1286521482 1 f none /usr/local/share/swig/2.0.1/go/std_common.i 0644 root root 101 8993 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_deque.i 0644 root root 28 2523 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_except.i 0644 root root 1207 34448 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_map.i 0644 root root 1754 47040 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_pair.i 0644 root root 712 45010 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_string.i 0644 root root 1372 43137 1286521481 1 f none /usr/local/share/swig/2.0.1/go/std_vector.i 0644 root root 2498 41521 1286521481 1 f none /usr/local/share/swig/2.0.1/go/stl.i 0644 root root 290 18221 1286521481 1 f none /usr/local/share/swig/2.0.1/go/typemaps.i 0644 root root 10800 39130 1286521482 1 d none /usr/local/share/swig/2.0.1/guile 0755 root root 1 f none /usr/local/share/swig/2.0.1/guile/common.scm 0644 root root 2384 55224 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/cplusplus.i 0644 root root 749 55748 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/ghinterface.i 0644 root root 1685 14433 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile.i 0644 root root 1076 19467 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_gh.swg 0644 root root 2093 22547 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_gh_run.swg 0644 root root 6801 12180 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_scm.swg 0644 root root 1390 36465 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guile_scm_run.swg 0644 root root 13677 64006 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/guilemain.i 0644 root root 1052 15603 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/interpreter.i 0644 root root 1421 42466 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/list-vector.i 0644 root root 18124 40935 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/pointer-in-out.i 0644 root root 3325 57702 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/ports.i 0644 root root 1347 30080 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_common.i 0644 root root 574 40402 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_deque.i 0644 root root 28 2523 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_except.i 0644 root root 182 15552 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_map.i 0644 root root 60055 13573 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_pair.i 0644 root root 40125 54692 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_string.i 0644 root root 2325 33357 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/std_vector.i 0644 root root 16742 29571 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/stl.i 0644 root root 357 23881 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/swigrun.i 0644 root root 965 18949 1286521478 1 f none /usr/local/share/swig/2.0.1/guile/typemaps.i 0644 root root 15091 37454 1286521478 1 f none /usr/local/share/swig/2.0.1/intrusive_ptr.i 0644 root root 2896 33252 1286521476 1 f none /usr/local/share/swig/2.0.1/inttypes.i 0644 root root 2634 15084 1286521476 1 d none /usr/local/share/swig/2.0.1/java 0755 root root 1 f none /usr/local/share/swig/2.0.1/java/arrays_java.i 0644 root root 13525 14217 1286521478 1 f none /usr/local/share/swig/2.0.1/java/boost_intrusive_ptr.i 0644 root root 19825 11376 1286521479 1 f none /usr/local/share/swig/2.0.1/java/boost_shared_ptr.i 0644 root root 8339 54448 1286521479 1 f none /usr/local/share/swig/2.0.1/java/director.swg 0644 root root 6014 6209 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enums.swg 0644 root root 4580 53932 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enumsimple.swg 0644 root root 2586 10237 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enumtypesafe.swg 0644 root root 4690 63354 1286521479 1 f none /usr/local/share/swig/2.0.1/java/enumtypeunsafe.swg 0644 root root 2734 23585 1286521479 1 f none /usr/local/share/swig/2.0.1/java/java.swg 0644 root root 45351 49517 1286521479 1 f none /usr/local/share/swig/2.0.1/java/javahead.swg 0644 root root 4181 10499 1286521479 1 f none /usr/local/share/swig/2.0.1/java/javakw.swg 0644 root root 1270 32017 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_common.i 0644 root root 102 9003 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_deque.i 0644 root root 28 2523 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_except.i 0644 root root 1924 31812 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_map.i 0644 root root 2337 33047 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_pair.i 0644 root root 712 45010 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_shared_ptr.i 0644 root root 68 5802 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_string.i 0644 root root 3427 19493 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_vector.i 0644 root root 2644 54781 1286521479 1 f none /usr/local/share/swig/2.0.1/java/std_wstring.i 0644 root root 4933 8259 1286521479 1 f none /usr/local/share/swig/2.0.1/java/stl.i 0644 root root 291 18231 1286521479 1 f none /usr/local/share/swig/2.0.1/java/typemaps.i 0644 root root 17965 27675 1286521479 1 f none /usr/local/share/swig/2.0.1/java/various.i 0644 root root 4369 12775 1286521479 1 d none /usr/local/share/swig/2.0.1/lua 0755 root root 1 f none /usr/local/share/swig/2.0.1/lua/_std_common.i 0644 root root 2554 5987 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/carrays.i 0644 root root 261 22612 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/lua.swg 0644 root root 8898 41663 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/lua_fnptr.i 0644 root root 4279 8070 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/luarun.swg 0644 root root 26716 34099 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/luaruntime.swg 0644 root root 2333 58088 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/luatypemaps.swg 0644 root root 13468 41319 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_common.i 0644 root root 102 9003 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_deque.i 0644 root root 28 2523 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_except.i 0644 root root 1873 23635 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_map.i 0644 root root 1754 47040 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_pair.i 0644 root root 771 56241 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_string.i 0644 root root 4374 35261 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/std_vector.i 0644 root root 3082 44877 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/stl.i 0644 root root 291 18231 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/typemaps.i 0644 root root 19181 48337 1286521481 1 f none /usr/local/share/swig/2.0.1/lua/wchar.i 0644 root root 1076 16835 1286521481 1 f none /usr/local/share/swig/2.0.1/math.i 0644 root root 2086 23257 1286521476 1 d none /usr/local/share/swig/2.0.1/modula3 0755 root root 1 f none /usr/local/share/swig/2.0.1/modula3/modula3.swg 0644 root root 34237 227 1286521481 1 f none /usr/local/share/swig/2.0.1/modula3/modula3head.swg 0644 root root 2022 37271 1286521481 1 f none /usr/local/share/swig/2.0.1/modula3/typemaps.i 0644 root root 4305 34919 1286521481 1 d none /usr/local/share/swig/2.0.1/mzscheme 0755 root root 1 f none /usr/local/share/swig/2.0.1/mzscheme/mzrun.swg 0644 root root 15093 7126 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/mzscheme.swg 0644 root root 1844 6809 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_common.i 0644 root root 511 37133 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_deque.i 0644 root root 28 2523 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_map.i 0644 root root 64500 19533 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_pair.i 0644 root root 43787 57307 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_string.i 0644 root root 1437 34435 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/std_vector.i 0644 root root 17811 7444 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/stl.i 0644 root root 356 23871 1286521479 1 f none /usr/local/share/swig/2.0.1/mzscheme/typemaps.i 0644 root root 10203 12994 1286521479 1 d none /usr/local/share/swig/2.0.1/ocaml 0755 root root 1 f none /usr/local/share/swig/2.0.1/ocaml/carray.i 0644 root root 3252 64846 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/class.swg 0644 root root 1718 60783 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/cstring.i 0644 root root 6071 6721 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/director.swg 0644 root root 3009 43951 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocaml.i 0644 root root 1450 48522 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocaml.swg 0644 root root 14358 53460 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocamldec.swg 0644 root root 5328 17014 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/ocamlkw.swg 0644 root root 1066 16127 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/preamble.swg 0644 root root 473 43605 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_common.i 0644 root root 531 37792 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_complex.i 0644 root root 1548 53904 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_deque.i 0644 root root 722 54040 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_list.i 0644 root root 4324 37994 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_map.i 0644 root root 2200 22076 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_pair.i 0644 root root 712 45010 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_string.i 0644 root root 5134 4591 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/std_vector.i 0644 root root 2754 9896 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/stl.i 0644 root root 357 23881 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/swig.ml 0644 root root 4684 49506 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/swig.mli 0644 root root 1696 7289 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/swigp4.ml 0644 root root 5942 415 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/typecheck.i 0644 root root 4703 15051 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/typemaps.i 0644 root root 8770 54879 1286521480 1 f none /usr/local/share/swig/2.0.1/ocaml/typeregister.swg 0644 root root 55 4471 1286521480 1 d none /usr/local/share/swig/2.0.1/octave 0755 root root 1 f none /usr/local/share/swig/2.0.1/octave/attribute.i 0644 root root 34 3234 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/boost_shared_ptr.i 0644 root root 15720 9633 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/carrays.i 0644 root root 129 11317 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/cdata.i 0644 root root 30 2763 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/cmalloc.i 0644 root root 32 2985 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/director.swg 0644 root root 59 4806 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/exception.i 0644 root root 139 11771 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/factory.i 0644 root root 32 3014 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/implicit.i 0644 root root 287 25966 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octave.swg 0644 root root 222 20476 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octcomplex.swg 0644 root root 2337 54363 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octcontainer.swg 0644 root root 16300 10557 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octfragments.swg 0644 root root 1 10 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octiterators.swg 0644 root root 9076 27310 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octopers.swg 0644 root root 2671 2970 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octprimtypes.swg 0644 root root 5471 40961 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octrun.swg 0644 root root 43807 8764 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octruntime.swg 0644 root root 3263 23323 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octstdcommon.swg 0644 root root 6186 50378 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octtypemaps.swg 0644 root root 2562 16463 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/octuserdir.swg 0644 root root 1814 367 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_alloc.i 0644 root root 27 2419 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_basic_string.i 0644 root root 2317 56739 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_carray.i 0644 root root 1589 1004 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_char_traits.i 0644 root root 33 3068 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_common.i 0644 root root 1051 22886 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_complex.i 0644 root root 470 40700 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_container.i 0644 root root 59 5472 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_deque.i 0644 root root 679 57722 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_except.i 0644 root root 35 3329 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_map.i 0644 root root 4548 48845 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_pair.i 0644 root root 3132 44137 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_string.i 0644 root root 35 3343 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/std_vector.i 0644 root root 700 59814 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/stl.i 0644 root root 181 16041 1286521480 1 f none /usr/local/share/swig/2.0.1/octave/typemaps.i 0644 root root 33 3137 1286521480 1 d none /usr/local/share/swig/2.0.1/perl5 0755 root root 1 f none /usr/local/share/swig/2.0.1/perl5/Makefile.pl 0644 root root 691 54613 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/attribute.i 0644 root root 34 3234 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/carrays.i 0644 root root 33 3021 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cdata.i 0644 root root 30 2763 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cmalloc.i 0644 root root 32 2985 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cni.i 0644 root root 150 11847 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cpointer.i 0644 root root 33 3122 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/cstring.i 0644 root root 32 3016 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/exception.i 0644 root root 138 11761 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/factory.i 0644 root root 32 3014 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/jstring.i 0644 root root 1046 14649 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/noembed.h 0644 root root 1411 52974 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perl5.swg 0644 root root 1476 17970 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlerrors.swg 0644 root root 1033 10010 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlfragments.swg 0644 root root 556 45634 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlhead.swg 0644 root root 2614 59584 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlinit.swg 0644 root root 1817 13662 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlkw.swg 0644 root root 3870 39244 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlmacros.swg 0644 root root 36 3351 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlmain.i 0644 root root 1986 28108 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlopers.swg 0644 root root 1872 14999 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlprimtypes.swg 0644 root root 7182 14431 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlrun.swg 0644 root root 14436 55129 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlruntime.swg 0644 root root 326 26426 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perlstrings.swg 0644 root root 1425 40113 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perltypemaps.swg 0644 root root 2796 10575 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/perluserdir.swg 0644 root root 36 2935 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/reference.i 0644 root root 7230 13105 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_common.i 0644 root root 617 44263 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_deque.i 0644 root root 28 2523 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_except.i 0644 root root 35 3329 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_list.i 0644 root root 14149 54503 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_map.i 0644 root root 2201 22086 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_pair.i 0644 root root 703 44055 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_string.i 0644 root root 62 5880 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/std_vector.i 0644 root root 22489 47847 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/stl.i 0644 root root 356 23871 1286521477 1 f none /usr/local/share/swig/2.0.1/perl5/typemaps.i 0644 root root 12783 15707 1286521477 1 d none /usr/local/share/swig/2.0.1/php 0755 root root 1 f none /usr/local/share/swig/2.0.1/php/const.i 0644 root root 1680 49870 1286521480 1 f none /usr/local/share/swig/2.0.1/php/director.swg 0644 root root 4154 53635 1286521480 1 f none /usr/local/share/swig/2.0.1/php/factory.i 0644 root root 3109 34276 1286521480 1 f none /usr/local/share/swig/2.0.1/php/globalvar.i 0644 root root 9070 25676 1286521480 1 f none /usr/local/share/swig/2.0.1/php/php.swg 0644 root root 12827 65131 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phpinit.swg 0644 root root 706 56045 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phpkw.swg 0644 root root 10886 42266 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phppointers.i 0644 root root 1491 48022 1286521480 1 f none /usr/local/share/swig/2.0.1/php/phprun.swg 0644 root root 8555 34856 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_common.i 0644 root root 290 17843 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_deque.i 0644 root root 28 2523 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_map.i 0644 root root 2261 25602 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_pair.i 0644 root root 712 45010 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_string.i 0644 root root 2448 49713 1286521480 1 f none /usr/local/share/swig/2.0.1/php/std_vector.i 0644 root root 2747 10202 1286521480 1 f none /usr/local/share/swig/2.0.1/php/stl.i 0644 root root 357 23881 1286521480 1 f none /usr/local/share/swig/2.0.1/php/typemaps.i 0644 root root 8740 34694 1286521480 1 f none /usr/local/share/swig/2.0.1/php/utils.i 0644 root root 2589 63681 1286521480 1 d none /usr/local/share/swig/2.0.1/pike 0755 root root 1 f none /usr/local/share/swig/2.0.1/pike/pike.swg 0644 root root 9328 28322 1286521480 1 f none /usr/local/share/swig/2.0.1/pike/pikekw.swg 0644 root root 849 201 1286521480 1 f none /usr/local/share/swig/2.0.1/pike/pikerun.swg 0644 root root 2007 29673 1286521480 1 f none /usr/local/share/swig/2.0.1/pike/std_string.i 0644 root root 1621 55381 1286521480 1 f none /usr/local/share/swig/2.0.1/pointer.i 0644 root root 294 17909 1286521476 1 d none /usr/local/share/swig/2.0.1/python 0755 root root 1 f none /usr/local/share/swig/2.0.1/python/argcargv.i 0644 root root 2642 64999 1286521477 1 f none /usr/local/share/swig/2.0.1/python/attribute.i 0644 root root 34 3234 1286521477 1 f none /usr/local/share/swig/2.0.1/python/boost_shared_ptr.i 0644 root root 16140 44125 1286521477 1 f none /usr/local/share/swig/2.0.1/python/carrays.i 0644 root root 132 11283 1286521477 1 f none /usr/local/share/swig/2.0.1/python/ccomplex.i 0644 root root 763 58269 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cdata.i 0644 root root 30 2763 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cmalloc.i 0644 root root 32 2985 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cni.i 0644 root root 42 3622 1286521478 1 f none /usr/local/share/swig/2.0.1/python/complex.i 0644 root root 80 7052 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cpointer.i 0644 root root 33 3122 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cstring.i 0644 root root 32 3016 1286521478 1 f none /usr/local/share/swig/2.0.1/python/cwstring.i 0644 root root 60 5599 1286521478 1 f none /usr/local/share/swig/2.0.1/python/defarg.swg 0644 root root 1154 28508 1286521478 1 f none /usr/local/share/swig/2.0.1/python/director.swg 0644 root root 10732 51925 1286521478 1 f none /usr/local/share/swig/2.0.1/python/embed.i 0644 root root 2703 38511 1286521478 1 f none /usr/local/share/swig/2.0.1/python/embed15.i 0644 root root 2866 45637 1286521478 1 f none /usr/local/share/swig/2.0.1/python/exception.i 0644 root root 139 11771 1286521478 1 f none /usr/local/share/swig/2.0.1/python/factory.i 0644 root root 32 3014 1286521478 1 f none /usr/local/share/swig/2.0.1/python/file.i 0644 root root 1035 8723 1286521478 1 f none /usr/local/share/swig/2.0.1/python/implicit.i 0644 root root 287 25966 1286521478 1 f none /usr/local/share/swig/2.0.1/python/jstring.i 0644 root root 1759 4912 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyabc.i 0644 root root 417 38391 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyapi.swg 0644 root root 1265 20581 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pybackward.swg 0644 root root 1162 26171 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pybuffer.i 0644 root root 2782 15357 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyclasses.swg 0644 root root 3056 45521 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pycomplex.swg 0644 root root 2242 51270 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pycontainer.swg 0644 root root 21871 61430 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pydocs.swg 0644 root root 733 59349 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyerrors.swg 0644 root root 1618 59094 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyfragments.swg 0644 root root 551 45181 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyhead.swg 0644 root root 3689 41527 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyinit.swg 0644 root root 10437 45201 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyiterators.swg 0644 root root 10222 47533 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pymacros.swg 0644 root root 38 3371 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyname_compat.i 0644 root root 4247 1552 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyopers.swg 0644 root root 4468 43953 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyprimtypes.swg 0644 root root 6705 52691 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyrun.swg 0644 root root 44385 38022 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyruntime.swg 0644 root root 517 40543 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pystdcommon.swg 0644 root root 6871 29891 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pystrings.swg 0644 root root 2951 30133 1286521478 1 f none /usr/local/share/swig/2.0.1/python/python.swg 0644 root root 2035 49800 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pythonkw.swg 0644 root root 2353 53233 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pythreads.swg 0644 root root 2864 23206 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pytuplehlp.swg 0644 root root 308 27585 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pytypemaps.swg 0644 root root 2907 21413 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pyuserdir.swg 0644 root root 6283 16402 1286521478 1 f none /usr/local/share/swig/2.0.1/python/pywstrings.swg 0644 root root 1892 16030 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_alloc.i 0644 root root 27 2419 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_basic_string.i 0644 root root 2817 27302 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_carray.i 0644 root root 1583 806 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_char_traits.i 0644 root root 33 3068 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_common.i 0644 root root 1049 22005 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_complex.i 0644 root root 469 40607 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_container.i 0644 root root 58 5379 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_deque.i 0644 root root 678 56986 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_except.i 0644 root root 35 3329 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_ios.i 0644 root root 66 5850 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_iostream.i 0644 root root 107 8990 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_list.i 0644 root root 668 56048 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_map.i 0644 root root 8154 822 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_multimap.i 0644 root root 2488 7849 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_multiset.i 0644 root root 1085 25284 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_pair.i 0644 root root 3851 39160 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_set.i 0644 root root 1363 45455 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_shared_ptr.i 0644 root root 68 5802 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_sstream.i 0644 root root 29 2663 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_streambuf.i 0644 root root 31 2865 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_string.i 0644 root root 35 3343 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_vector.i 0644 root root 691 58447 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_vectora.i 0644 root root 829 4993 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wios.i 0644 root root 26 2346 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wiostream.i 0644 root root 166 14556 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wsstream.i 0644 root root 30 2782 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wstreambuf.i 0644 root root 32 2984 1286521478 1 f none /usr/local/share/swig/2.0.1/python/std_wstring.i 0644 root root 63 5926 1286521478 1 f none /usr/local/share/swig/2.0.1/python/stl.i 0644 root root 182 16051 1286521478 1 f none /usr/local/share/swig/2.0.1/python/typemaps.i 0644 root root 4453 10239 1286521478 1 f none /usr/local/share/swig/2.0.1/python/wchar.i 0644 root root 186 15021 1286521478 1 d none /usr/local/share/swig/2.0.1/r 0755 root root 1 f none /usr/local/share/swig/2.0.1/r/cdata.i 0644 root root 30 2763 1286521481 1 f none /usr/local/share/swig/2.0.1/r/exception.i 0644 root root 225 19250 1286521481 1 f none /usr/local/share/swig/2.0.1/r/r.swg 0644 root root 5858 90 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rcontainer.swg 0644 root root 5476 54325 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rfragments.swg 0644 root root 4674 47473 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rkw.swg 0644 root root 528 41565 1286521481 1 f none /usr/local/share/swig/2.0.1/r/ropers.swg 0644 root root 2196 52455 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rrun.swg 0644 root root 8643 42901 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rstdcommon.swg 0644 root root 5453 42961 1286521481 1 f none /usr/local/share/swig/2.0.1/r/rtype.swg 0644 root root 5334 17335 1286521481 1 f none /usr/local/share/swig/2.0.1/r/srun.swg 0644 root root 3901 40940 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_alloc.i 0644 root root 26 2409 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_common.i 0644 root root 54 4963 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_container.i 0644 root root 57 5260 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_deque.i 0644 root root 25 2386 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_except.i 0644 root root 35 3329 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_map.i 0644 root root 67 5559 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_pair.i 0644 root root 68 5747 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_string.i 0644 root root 35 3343 1286521481 1 f none /usr/local/share/swig/2.0.1/r/std_vector.i 0644 root root 218 19616 1286521481 1 f none /usr/local/share/swig/2.0.1/r/stl.i 0644 root root 136 11933 1286521481 1 f none /usr/local/share/swig/2.0.1/r/typemaps.i 0644 root root 33 3137 1286521481 1 d none /usr/local/share/swig/2.0.1/ruby 0755 root root 1 f none /usr/local/share/swig/2.0.1/ruby/Makefile.swig 0644 root root 943 6854 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/argcargv.i 0644 root root 1221 15218 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/attribute.i 0644 root root 34 3234 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/carrays.i 0644 root root 129 11253 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cdata.i 0644 root root 30 2763 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cmalloc.i 0644 root root 32 2985 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cni.i 0644 root root 42 3622 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cpointer.i 0644 root root 33 3122 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/cstring.i 0644 root root 32 3016 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/director.swg 0644 root root 8308 63949 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/embed.i 0644 root root 169 12819 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/exception.i 0644 root root 126 10817 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/extconf.rb 0644 root root 234 20334 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/factory.i 0644 root root 32 3014 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/file.i 0644 root root 639 49189 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/jstring.i 0644 root root 952 8162 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/progargcargv.i 0644 root root 770 57045 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/ruby.swg 0644 root root 2653 41571 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyapi.swg 0644 root root 801 57509 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyautodoc.swg 0644 root root 4367 35703 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyclasses.swg 0644 root root 9008 4103 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubycomplex.swg 0644 root root 3316 1449 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubycontainer.swg 0644 root root 27085 13204 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubycontainer_extended.swg 0644 root root 3601 28715 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubydef.swg 0644 root root 42 3520 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyerrors.swg 0644 root root 3714 29065 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyfragments.swg 0644 root root 552 45188 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyhead.swg 0644 root root 4281 8942 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyinit.swg 0644 root root 39 3641 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyiterators.swg 0644 root root 22750 62385 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubykw.swg 0644 root root 1177 24075 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubymacros.swg 0644 root root 456 39715 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyopers.swg 0644 root root 1852 12606 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyprimtypes.swg 0644 root root 5216 64729 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyrun.swg 0644 root root 13529 23573 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubyruntime.swg 0644 root root 423 34615 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystdautodoc.swg 0644 root root 1819 16721 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystdcommon.swg 0644 root root 6607 60485 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystdfunctors.swg 0644 root root 4164 56590 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubystrings.swg 0644 root root 1657 60576 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubytracking.swg 0644 root root 5156 29245 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/rubytypemaps.swg 0644 root root 1807 3611 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/rubyuserdir.swg 0644 root root 409 34531 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/rubywstrings.swg 0644 root root 2459 52771 1286521480 1 f none /usr/local/share/swig/2.0.1/ruby/std_alloc.i 0644 root root 27 2419 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_basic_string.i 0644 root root 2640 15879 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_char_traits.i 0644 root root 33 3068 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_common.i 0644 root root 1072 24146 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_complex.i 0644 root root 471 40824 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_container.i 0644 root root 60 5596 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_deque.i 0644 root root 732 61603 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_except.i 0644 root root 35 3329 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_functors.i 0644 root root 768 56857 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_ios.i 0644 root root 380 30590 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_iostream.i 0644 root root 227 19235 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_list.i 0644 root root 1037 20419 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_map.i 0644 root root 11150 7686 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_multimap.i 0644 root root 6084 8511 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_multiset.i 0644 root root 1403 51021 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_pair.i 0644 root root 5339 11430 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_queue.i 0644 root root 851 3761 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_set.i 0644 root root 5962 26108 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_sstream.i 0644 root root 30 2673 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_stack.i 0644 root root 853 3541 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_streambuf.i 0644 root root 31 2865 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_string.i 0644 root root 190 16332 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_vector.i 0644 root root 1218 36788 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_vectora.i 0644 root root 950 15363 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/std_wstring.i 0644 root root 65 6143 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/stl.i 0644 root root 357 23881 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/timeval.i 0644 root root 1028 16921 1286521479 1 f none /usr/local/share/swig/2.0.1/ruby/typemaps.i 0644 root root 11314 45213 1286521479 1 f none /usr/local/share/swig/2.0.1/runtime.swg 0644 root root 1236 33789 1286521476 1 f none /usr/local/share/swig/2.0.1/shared_ptr.i 0644 root root 2148 44436 1286521476 1 d none /usr/local/share/swig/2.0.1/std 0755 root root 1 f none /usr/local/share/swig/2.0.1/std/_std_deque.i 0644 root root 4213 22416 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_alloc.i 0644 root root 2015 26420 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_basic_string.i 0644 root root 6494 15063 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_carray.swg 0644 root root 1416 47705 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_char_traits.i 0644 root root 3190 977 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_common.i 0644 root root 4951 15360 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_container.i 0644 root root 2523 23212 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_deque.i 0644 root root 3504 23168 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_except.i 0644 root root 1130 29429 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_ios.i 0644 root root 5146 22031 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_iostream.i 0644 root root 8853 4040 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_list.i 0644 root root 3864 50968 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_map.i 0644 root root 3565 25709 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_multimap.i 0644 root root 2842 35456 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_multiset.i 0644 root root 2527 9083 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_pair.i 0644 root root 3681 22320 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_queue.i 0644 root root 3510 21107 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_set.i 0644 root root 3201 63661 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_sstream.i 0644 root root 5323 47990 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_stack.i 0644 root root 3484 18333 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_streambuf.i 0644 root root 1741 9865 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_string.i 0644 root root 219 19522 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_vector.i 0644 root root 6130 45595 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_vectora.i 0644 root root 147 12902 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wios.i 0644 root root 90 7429 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wiostream.i 0644 root root 100 8503 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wsstream.i 0644 root root 98 8301 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wstreambuf.i 0644 root root 102 8705 1286521482 1 f none /usr/local/share/swig/2.0.1/std/std_wstring.i 0644 root root 249 22387 1286521482 1 f none /usr/local/share/swig/2.0.1/std_except.i 0644 root root 1981 33145 1286521476 1 f none /usr/local/share/swig/2.0.1/stdint.i 0644 root root 2368 64545 1286521476 1 f none /usr/local/share/swig/2.0.1/stl.i 0644 root root 249 14312 1286521476 1 f none /usr/local/share/swig/2.0.1/swig.swg 0644 root root 24317 43057 1286521476 1 f none /usr/local/share/swig/2.0.1/swigarch.i 0644 root root 1580 53263 1286521476 1 f none /usr/local/share/swig/2.0.1/swigerrors.swg 0644 root root 509 36777 1286521476 1 f none /usr/local/share/swig/2.0.1/swiginit.swg 0644 root root 8098 12676 1286521476 1 f none /usr/local/share/swig/2.0.1/swiglabels.swg 0644 root root 3182 47435 1286521476 1 f none /usr/local/share/swig/2.0.1/swigrun.i 0644 root root 256 14947 1286521476 1 f none /usr/local/share/swig/2.0.1/swigrun.swg 0644 root root 17115 56027 1286521476 1 f none /usr/local/share/swig/2.0.1/swigwarn.swg 0644 root root 12520 33344 1286521476 1 f none /usr/local/share/swig/2.0.1/swigwarnings.swg 0644 root root 6990 64149 1286521476 1 d none /usr/local/share/swig/2.0.1/tcl 0755 root root 1 f none /usr/local/share/swig/2.0.1/tcl/attribute.i 0644 root root 34 3234 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/carrays.i 0644 root root 35 3041 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cdata.i 0644 root root 30 2763 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cmalloc.i 0644 root root 32 2985 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cni.i 0644 root root 42 3622 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cpointer.i 0644 root root 33 3122 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cstring.i 0644 root root 32 3016 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/cwstring.i 0644 root root 60 5679 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/exception.i 0644 root root 145 12338 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/factory.i 0644 root root 32 3014 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/jstring.i 0644 root root 1000 13352 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_common.i 0644 root root 467 33565 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_deque.i 0644 root root 28 2523 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_except.i 0644 root root 35 3329 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_map.i 0644 root root 2082 18372 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_pair.i 0644 root root 707 44632 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_string.i 0644 root root 36 3353 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_vector.i 0644 root root 15613 18402 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/std_wstring.i 0644 root root 63 6006 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/stl.i 0644 root root 357 23965 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tcl8.swg 0644 root root 1500 18324 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclapi.swg 0644 root root 3067 39096 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclerrors.swg 0644 root root 1695 65464 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclfragments.swg 0644 root root 555 45869 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclinit.swg 0644 root root 3366 62332 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclinterp.i 0644 root root 617 46503 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclkw.swg 0644 root root 247 21054 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclmacros.swg 0644 root root 38 3371 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclopers.swg 0644 root root 1512 45064 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclprimtypes.swg 0644 root root 5606 35874 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclresult.i 0644 root root 684 44896 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclrun.swg 0644 root root 22006 2458 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclruntime.swg 0644 root root 484 38494 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclsh.i 0644 root root 1871 11795 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclstrings.swg 0644 root root 793 59022 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tcltypemaps.swg 0644 root root 2774 9048 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tcluserdir.swg 0644 root root 195 9756 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/tclwstrings.swg 0644 root root 1836 5884 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/typemaps.i 0644 root root 16058 10064 1286521477 1 f none /usr/local/share/swig/2.0.1/tcl/wish.i 0644 root root 3436 1785 1286521477 1 d none /usr/local/share/swig/2.0.1/typemaps 0755 root root 1 f none /usr/local/share/swig/2.0.1/typemaps/attribute.swg 0644 root root 9475 60085 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/carrays.swg 0644 root root 2691 60264 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cdata.swg 0644 root root 1872 1924 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cmalloc.swg 0644 root root 2438 55249 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cpointer.swg 0644 root root 3266 26430 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cstring.swg 0644 root root 167 13755 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cstrings.swg 0644 root root 8222 26333 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/cwstring.swg 0644 root root 207 17588 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/enumint.swg 0644 root root 906 2013 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/exception.swg 0644 root root 2710 17186 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/factory.swg 0644 root root 2441 43983 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/fragments.swg 0644 root root 6744 6303 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/implicit.swg 0644 root root 4825 59403 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/inoutlist.swg 0644 root root 9481 45216 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/misctypes.swg 0644 root root 467 34147 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/primtypes.swg 0644 root root 8581 700 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/ptrtypes.swg 0644 root root 6584 55254 1286521476 1 f none /usr/local/share/swig/2.0.1/typemaps/std_except.swg 0644 root root 2186 55163 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/std_string.swg 0644 root root 350 29267 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/std_strings.swg 0644 root root 2058 32618 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/std_wstring.swg 0644 root root 395 34138 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/string.swg 0644 root root 547 45598 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/strings.swg 0644 root root 16964 308 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigmacros.swg 0644 root root 8135 1308 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigobject.swg 0644 root root 898 1582 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigtype.swg 0644 root root 19400 5118 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/swigtypemaps.swg 0644 root root 4987 4033 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/traits.swg 0644 root root 7549 20160 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/typemaps.swg 0644 root root 4564 18913 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/valtypes.swg 0644 root root 7168 47041 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/void.swg 0644 root root 2077 28579 1286521477 1 f none /usr/local/share/swig/2.0.1/typemaps/wstring.swg 0644 root root 567 47346 1286521477 1 d none /usr/local/share/swig/2.0.1/uffi 0755 root root 1 f none /usr/local/share/swig/2.0.1/uffi/uffi.swg 0644 root root 3214 62483 1286521481 1 f none /usr/local/share/swig/2.0.1/wchar.i 0644 root root 309 19276 1286521476 1 f none /usr/local/share/swig/2.0.1/windows.i 0644 root root 4143 8697 1286521476 1 i checkinstall 790 2505 1286521516 1 i pkginfo 265 20374 1286521500 0707010008e9ad000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000000800000000install0707010008e9ae000081ed0000000000000000000000014caec2ac00000316000000b600010002ffffffffffffffff0000001500000000install/checkinstall#!/bin/sh # expected_bits="64" expected_release="5.11" expected_platform="i386" # release=`uname -r` platform=`uname -p` bits=`isainfo -b` # if [ ${platform} != ${expected_platform} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n" echo "\tAborting installation.\n\n\n" exit 1 fi if [ ${release} != ${expected_release} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n" echo "\tAborting installation.\n\n\n" exit 1 fi #if [ ${bits} != ${expected_bits} ]; then # echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n" # echo "\tYour machine is running a ${bits} bit O.S. currently\n" # echo "\tAborting installation.\n\n\n" # exit 1 #fi exit 0 0707010008e75d000041ed0000000000000000000000034caec29c00000000000000b600010002ffffffffffffffff0000000500000000root0707010008e75e000041ed0000000000000000000000034caec29c00000000000000b600010002ffffffffffffffff0000000900000000root/usr0707010008e75f000041ed0000000000000000000000044caec29c00000000000000b600010002ffffffffffffffff0000000f00000000root/usr/local0707010008e763000041ed0000000000000000000000044caec29c00000000000000b600010002ffffffffffffffff0000001500000000root/usr/local/share0707010008e764000041ed0000000000000000000000034caec29c00000000000000b600010002ffffffffffffffff0000001900000000root/usr/local/share/man0707010008e765000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000001e00000000root/usr/local/share/man/man10707010008e766000081a40000000000000000000000014caec28a00004384000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/man/man1/ccache-swig.1.TH "ccache-swig" "1" "" "" "" .PP .SH "NAME" ccache-swig \- a fast compiler cache .PP .SH "SYNOPSIS" .PP ccache-swig [OPTION] .PP ccache-swig [COMPILER OPTIONS] .PP [COMPILER OPTIONS] .PP .SH "DESCRIPTION" .PP ccache-swig is a compiler cache\&. It speeds up re-compilation of C/C++/SWIG code by caching previous compiles and detecting when the same compile is being done again\&. ccache-swig is ccache plus support for SWIG\&. ccache and ccache-swig are used interchangeably in this document\&. .PP .SH "OPTIONS SUMMARY" .PP Here is a summary of the options to ccache-swig\&. .PP .nf -s show statistics summary -z zero statistics -c run a cache cleanup -C clear the cache completely -F set maximum files in cache -M set maximum size of cache (use G, M or K) -h this help page -V print version number .fi .PP .SH "OPTIONS" .PP These options only apply when you invoke ccache as "ccache-swig"\&. When invoked as a compiler none of these options apply\&. In that case your normal compiler options apply and you should refer to your compilers documentation\&. .PP .IP "\fB-h\fP" Print a options summary page .IP .IP "\fB-s\fP" Print the current statistics summary for the cache\&. The statistics are stored spread across the subdirectories of the cache\&. Using "ccache-swig -s" adds up the statistics across all subdirectories and prints the totals\&. .IP .IP "\fB-z\fP" Zero the cache statistics\&. .IP .IP "\fB-V\fP" Print the ccache version number .IP .IP "\fB-c\fP" Clean the cache and re-calculate the cache file count and size totals\&. Normally the -c option should not be necessary as ccache keeps the cache below the specified limits at runtime and keeps statistics up to date on each compile\&. This option is mostly useful if you manually modify the cache contents or believe that the cache size statistics may be inaccurate\&. .IP .IP "\fB-C\fP" Clear the entire cache, removing all cached files\&. .IP .IP "\fB-F \fP" This sets the maximum number of files allowed in the cache\&. The value is stored inside the cache directory and applies to all future compiles\&. Due to the way the value is stored the actual value used is always rounded down to the nearest multiple of 16\&. .IP .IP "\fB-M \fP" This sets the maximum cache size\&. You can specify a value in gigabytes, megabytes or kilobytes by appending a G, M or K to the value\&. The default is gigabytes\&. The actual value stored is rounded down to the nearest multiple of 16 kilobytes\&. .IP .SH "INSTALLATION" .PP There are two ways to use ccache\&. You can either prefix your compile commands with "ccache-swig" or you can create a symbolic link between ccache-swig and the names of your compilers\&. The first method is most convenient if you just want to try out ccache or wish to use it for some specific projects\&. The second method is most useful for when you wish to use ccache for all your compiles\&. .PP To install for usage by the first method just copy ccache-swig to somewhere in your path\&. .PP To install for the second method do something like this: .nf cp ccache-swig /usr/local/bin/ ln -s /usr/local/bin/ccache-swig /usr/local/bin/gcc ln -s /usr/local/bin/ccache-swig /usr/local/bin/g++ ln -s /usr/local/bin/ccache-swig /usr/local/bin/cc ln -s /usr/local/bin/ccache-swig /usr/local/bin/swig .fi This will work as long as /usr/local/bin comes before the path to gcc (which is usually in /usr/bin)\&. After installing you may wish to run "which gcc" to make sure that the correct link is being used\&. .PP Note! Do not use a hard link, use a symbolic link\&. A hardlink will cause "interesting" problems\&. .PP .SH "EXTRA OPTIONS" .PP When run as a compiler front end ccache usually just takes the same command line options as the compiler you are using\&. The only exception to this is the option \&'--ccache-skip\&'\&. That option can be used to tell ccache that the next option is definitely not a input filename, and should be passed along to the compiler as-is\&. .PP The reason this can be important is that ccache does need to parse the command line and determine what is an input filename and what is a compiler option, as it needs the input filename to determine the name of the resulting object file (among other things)\&. The heuristic ccache uses in this parse is that any string on the command line that exists as a file is treated as an input file name (usually a C file)\&. By using --ccache-skip you can force an option to not be treated as an input file name and instead be passed along to the compiler as a command line option\&. .PP .SH "ENVIRONMENT VARIABLES" .PP ccache uses a number of environment variables to control operation\&. In most cases you won\&'t need any of these as the defaults will be fine\&. .PP .IP "\fBCCACHE_DIR\fP" the CCACHE_DIR environment variable specifies where ccache will keep its cached compiler output\&. The default is "$HOME/\&.ccache"\&. .IP .IP "\fBCCACHE_TEMPDIR\fP" the CCACHE_TEMPDIR environment variable specifies where ccache will put temporary files\&. The default is the same as CCACHE_DIR\&. Note that the CCACHE_TEMPDIR path must be on the same filesystem as the CCACHE_DIR path, so that renames of files between the two directories can work\&. .IP .IP "\fBCCACHE_LOGFILE\fP" If you set the CCACHE_LOGFILE environment variable then ccache will write some log information on cache hits and misses in that file\&. This is useful for tracking down problems\&. .IP .IP "\fBCCACHE_VERBOSE\fP" If you set the CCACHE_VERBOSE environment variable then ccache will display on stdout all the compiler invocations that it makes\&. This can useful for debugging unexpected problems\&. .IP .IP "\fBCCACHE_PATH\fP" You can optionally set CCACHE_PATH to a colon separated path where ccache will look for the real compilers\&. If you don\&'t do this then ccache will look for the first executable matching the compiler name in the normal PATH that isn\&'t a symbolic link to ccache itself\&. .IP .IP "\fBCCACHE_CC\fP" You can optionally set CCACHE_CC to force the name of the compiler to use\&. If you don\&'t do this then ccache works it out from the command line\&. .IP .IP "\fBCCACHE_PREFIX\fP" This option adds a prefix to the command line that ccache runs when invoking the compiler\&. Also see the section below on using ccache with distcc\&. .IP .IP "\fBCCACHE_DISABLE\fP" If you set the environment variable CCACHE_DISABLE then ccache will just call the real compiler, bypassing the cache completely\&. .IP .IP "\fBCCACHE_READONLY\fP" the CCACHE_READONLY environment variable tells ccache to attempt to use existing cached object files, but not to try to add anything new to the cache\&. If you are using this because your CCACHE_DIR is read-only, then you may find that you also need to set CCACHE_TEMPDIR as otherwise ccache will fail to create the temporary files\&. .IP .IP "\fBCCACHE_CPP2\fP" If you set the environment variable CCACHE_CPP2 then ccache will not use the optimisation of avoiding the 2nd call to the pre-processor by compiling the pre-processed output that was used for finding the hash in the case of a cache miss\&. This is primarily a debugging option, although it is possible that some unusual compilers will have problems with the intermediate filename extensions used in this optimisation, in which case this option could allow ccache to be used\&. .IP .IP "\fBCCACHE_NOCOMPRESS\fP" If you set the environment variable CCACHE_NOCOMPRESS then there is no compression used on files that go into the cache\&. However, this setting has no effect on how files are retrieved from the cache, compressed results will still be usable\&. .IP .IP "\fBCCACHE_NOSTATS\fP" If you set the environment variable CCACHE_NOSTATS then ccache will not update the statistics files on each compile\&. .IP .IP "\fBCCACHE_NLEVELS\fP" The environment variable CCACHE_NLEVELS allows you to choose the number of levels of hash in the cache directory\&. The default is 2\&. The minimum is 1 and the maximum is 8\&. .IP .IP "\fBCCACHE_HARDLINK\fP" If you set the environment variable CCACHE_HARDLINK then ccache will attempt to use hard links from the cache directory when creating the compiler output rather than using a file copy\&. Using hard links is faster, but can confuse programs like \&'make\&' that rely on modification times\&. Hard links are never made for compressed cache files\&. .IP .IP "\fBCCACHE_RECACHE\fP" This forces ccache to not use any cached results, even if it finds them\&. New results are still cached, but existing cache entries are ignored\&. .IP .IP "\fBCCACHE_UMASK\fP" This sets the umask for ccache and all child processes (such as the compiler)\&. This is mostly useful when you wish to share your cache with other users\&. Note that this also affects the file permissions set on the object files created from your compilations\&. .IP .IP "\fBCCACHE_HASHDIR\fP" This tells ccache to hash the current working directory when calculating the hash that is used to distinguish two compiles\&. This prevents a problem with the storage of the current working directory in the debug info of a object file, which can lead ccache to give a cached object file that has the working directory in the debug info set incorrectly\&. This option is off by default as the incorrect setting of this debug info rarely causes problems\&. If you strike problems with gdb not using the correct directory then enable this option\&. .IP .IP "\fBCCACHE_UNIFY\fP" If you set the environment variable CCACHE_UNIFY then ccache will use the C/C++ unifier when hashing the pre-processor output if -g is not used in the compile\&. The unifier is slower than a normal hash, so setting this environment variable loses a little bit of speed, but it means that ccache can take advantage of not recompiling when the changes to the source code consist of reformatting only\&. Note that using CCACHE_UNIFY changes the hash, so cached compiles with CCACHE_UNIFY set cannot be used when CCACHE_UNIFY is not set and vice versa\&. The reason the unifier is off by default is that it can give incorrect line number information in compiler warning messages\&. .IP .IP "\fBCCACHE_EXTENSION\fP" Normally ccache tries to automatically determine the extension to use for intermediate C pre-processor files based on the type of file being compiled\&. Unfortunately this sometimes doesn\&'t work, for example when using the aCC compiler on HP-UX\&. On systems like this you can use the CCACHE_EXTENSION option to override the default\&. On HP-UX set this environment variable to "i" if you use the aCC compiler\&. .IP .IP "\fBCCACHE_STRIPC\fP" If you set the environment variable CCACHE_STRIPC then ccache will strip the -c option when invoking the preprocessor\&. This option is primarily for the Sun Workshop C++ compiler as without this option an unwarranted warning is displayed: CC: Warning: "-E" redefines product from "object" to "source (stdout)" when -E and -c is used together\&. .IP .IP "\fBCCACHE_SWIG\fP" When using SWIG as the compiler and it does not have \&'swig\&' in the executable name, then the CCACHE_SWIG environment variable needs to be set in order for ccache to work correctly with SWIG\&. The use of CCACHE_CPP2 is also recommended for SWIG due to some preprocessor quirks, however, use of CCACHE_CPP2 can often be skipped -- check your generated code with and without this option set\&. Known problems are using preprocessor directives within %inline blocks and the use of \&'#pragma SWIG\&'\&. .IP .SH "CACHE SIZE MANAGEMENT" .PP By default ccache has a one gigabyte limit on the cache size and no maximum number of files\&. You can set a different limit using the "ccache -M" and "ccache -F" options, which set the size and number of files limits\&. .PP When these limits are reached ccache will reduce the cache to 20% below the numbers you specified in order to avoid doing the cache clean operation too often\&. .PP .SH "CACHE COMPRESSION" .PP By default on most platforms ccache will compress all files it puts into the cache using the zlib compression\&. While this involves a negligible performance slowdown, it significantly increases the number of files that fit in the cache\&. You can turn off compression setting the CCACHE_NOCOMPRESS environment variable\&. .PP .SH "HOW IT WORKS" .PP The basic idea is to detect when you are compiling exactly the same code a 2nd time and use the previously compiled output\&. You detect that it is the same code by forming a hash of: .PP .IP o the pre-processor output from running the compiler with -E .IP o the command line options .IP o the real compilers size and modification time .IP o any stderr output generated by the compiler .PP These are hashed using md4 (a strong hash) and a cache file is formed based on that hash result\&. When the same compilation is done a second time ccache is able to supply the correct compiler output (including all warnings etc) from the cache\&. .PP ccache has been carefully written to always produce exactly the same compiler output that you would get without the cache\&. If you ever discover a case where ccache changes the output of your compiler then please let me know\&. .PP .SH "USING CCACHE WITH DISTCC" .PP distcc is a very useful program for distributing compilation across a range of compiler servers\&. It is often useful to combine distcc with ccache, so that compiles that are done are sped up by distcc, but that ccache avoids the compile completely where possible\&. .PP To use distcc with ccache I recommend using the CCACHE_PREFIX option\&. You just need to set the environment variable CCACHE_PREFIX to \&'distcc\&' and ccache will prefix the command line used with the compiler with the command \&'distcc\&'\&. .PP .SH "SHARING A CACHE" .PP A group of developers can increase the cache hit rate by sharing a cache directory\&. The hard links however cause unwanted side effects, as all links to a cached file share the file\&'s modification timestamp\&. This results in false dependencies to be triggered by timestamp-based build systems whenever another user links to an existing file\&. Typically, users will see that their libraries and binaries are relinked without reason\&. To share a cache without side effects, the following conditions need to be met: .PP .IP o Use the same \fBCCACHE_DIR\fP environment variable setting .IP o Unset the \fBCCACHE_HARDLINK\fP environment variable .IP o Make sure everyone sets the CCACHE_UMASK environment variable to 002, this ensures that cached files are accessible to everyone in the group\&. .IP o Make sure that all users have write permission in the entire cache directory (and that you trust all users of the shared cache)\&. .IP o Make sure that the setgid bit is set on all directories in the cache\&. This tells the filesystem to inherit group ownership for new directories\&. The command "chmod g+s `find $CCACHE_DIR -type d`" might be useful for this\&. .IP o Set \fBCCACHE_NOCOMPRESS\fP for all users, if there are users with versions of ccache that do not support compression\&. .PP .SH "HISTORY" .PP ccache was inspired by the compilercache shell script script written by Erik Thiele and I would like to thank him for an excellent piece of work\&. See http://www\&.erikyyy\&.de/compilercache/ for the Erik\&'s scripts\&. ccache-swig is a port of the original ccache with support added for use with SWIG\&. .PP I wrote ccache because I wanted to get a bit more speed out of a compiler cache and I wanted to remove some of the limitations of the shell-script version\&. .PP .SH "DIFFERENCES FROM COMPILERCACHE" .PP The biggest differences between Erik\&'s compilercache script and ccache are: .IP o ccache is written in C, which makes it a bit faster (calling out to external programs is mostly what slowed down the scripts)\&. .IP o ccache can automatically find the real compiler .IP o ccache keeps statistics on hits/misses .IP o ccache can do automatic cache management .IP o ccache can cache compiler output that includes warnings\&. In many cases this gives ccache a much higher cache hit rate\&. .IP o ccache can handle a much wider ranger of compiler options .IP o ccache avoids a double call to cpp on a cache miss .PP .SH "CREDITS" .PP Thanks to the following people for their contributions to ccache .IP o Erik Thiele for the original compilercache script .IP o Luciano Rocha for the idea of compiling the pre-processor output to avoid a 2nd cpp pass .IP o Paul Russell for many suggestions and the debian packaging .PP .SH "AUTHOR" .PP ccache was written by Andrew Tridgell http://samba\&.org/~tridge/\&. ccache was adapted to create ccache-swig for use with SWIG by William Fulton\&. .PP If you wish to report a problem or make a suggestion then please email the SWIG developers on the swig-devel mailing list, see http://www\&.swig\&.org/mail\&.html .PP ccache is released under the GNU General Public License version 2 or later\&. Please see the file COPYING for license details\&. .PP 0707010008e767000041ed0000000000000000000000034caec29c00000000000000b600010002ffffffffffffffff0000001a00000000root/usr/local/share/swig0707010008e768000041ed00000000000000000000001a4caec29c00000000000000b600010002ffffffffffffffff0000002000000000root/usr/local/share/swig/2.0.10707010008e954000081a40000000000000000000000014caec28400000940000000b600010002ffffffffffffffff0000002900000000root/usr/local/share/swig/2.0.1/stdint.i/* ----------------------------------------------------------------------------- * stdint.i * * SWIG library file for ISO C99 types: 7.18 Integer types * ----------------------------------------------------------------------------- */ %{ #include // Use the C99 official header %} %include /* Exact integral types. */ /* Signed. */ typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; #if defined(SWIGWORDSIZE64) typedef long int int64_t; #else typedef long long int int64_t; #endif /* Unsigned. */ typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; #if defined(SWIGWORDSIZE64) typedef unsigned long int uint64_t; #else typedef unsigned long long int uint64_t; #endif /* Small types. */ /* Signed. */ typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; #if defined(SWIGWORDSIZE64) typedef long int int_least64_t; #else typedef long long int int_least64_t; #endif /* Unsigned. */ typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; #if defined(SWIGWORDSIZE64) typedef unsigned long int uint_least64_t; #else typedef unsigned long long int uint_least64_t; #endif /* Fast types. */ /* Signed. */ typedef signed char int_fast8_t; #if defined(SWIGWORDSIZE64) typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; #else typedef int int_fast16_t; typedef int int_fast32_t; typedef long long int int_fast64_t; #endif /* Unsigned. */ typedef unsigned char uint_fast8_t; #if defined(SWIGWORDSIZE64) typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; #else typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; typedef unsigned long long int uint_fast64_t; #endif /* Types for `void *' pointers. */ #if defined(SWIGWORDSIZE64) typedef long int intptr_t; typedef unsigned long int uintptr_t; #else typedef int intptr_t; typedef unsigned int uintptr_t; #endif /* Largest integral types. */ #if defined(SWIGWORDSIZE64) typedef long int intmax_t; typedef unsigned long int uintmax_t; #else typedef long long int intmax_t; typedef unsigned long long int uintmax_t; #endif 0707010008e869000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002400000000root/usr/local/share/swig/2.0.1/php0707010008e86e000081a40000000000000000000000014caec2880000321b000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/php/php.swg/* ----------------------------------------------------------------------------- * php.swg * * PHP configuration file * ----------------------------------------------------------------------------- */ %runtime "swigrun.swg" // Common C API type-checking code %runtime "phprun.swg" // PHP runtime functions %include // PHP initialization routine. %include // Global variables. %include // use %init %{ "/*code goes here*/ " %} // or %minit %{ "/* code goes here*/ " %} to // insert code in the PHP_MINIT_FUNCTION #define %minit %insert("init") // use %rinit %{ "/* code goes here*/ " %} to // insert code in the PHP_RINIT_FUNCTION #define %rinit %insert("rinit") // use %shutdown %{ " /*code goes here*/ " %} to // insert code in the PHP_MSHUTDOWN_FUNCTION #define %shutdown %insert("shutdown") #define %mshutdown %insert("shutdown") // use %rshutdown %{ " /*code goes here*/" %} to // insert code in the PHP_RSHUTDOWN_FUNCTION #define %rshutdown %insert("rshutdown") /* Typemaps for input parameters by value */ %include %pass_by_val(bool,CONVERT_BOOL_IN); %pass_by_val(size_t, CONVERT_INT_IN); %pass_by_val(enum SWIGTYPE, CONVERT_INT_IN); %pass_by_val(signed int, CONVERT_INT_IN); %pass_by_val(int,CONVERT_INT_IN); %pass_by_val(unsigned int,CONVERT_INT_IN); %pass_by_val(signed short, CONVERT_INT_IN); %pass_by_val(short,CONVERT_INT_IN); %pass_by_val(unsigned short, CONVERT_INT_IN); %pass_by_val(signed long, CONVERT_INT_IN); %pass_by_val(long, CONVERT_INT_IN); %pass_by_val(unsigned long, CONVERT_INT_IN); %pass_by_val(signed long long, CONVERT_LONG_LONG_IN); %pass_by_val(long long, CONVERT_LONG_LONG_IN); %pass_by_val(unsigned long long, CONVERT_UNSIGNED_LONG_LONG_IN); %pass_by_val(signed char, CONVERT_INT_IN); %pass_by_val(char, CONVERT_CHAR_IN); %pass_by_val(unsigned char, CONVERT_INT_IN); %pass_by_val(float, CONVERT_FLOAT_IN); %pass_by_val(double, CONVERT_FLOAT_IN); %pass_by_val(char *, CONVERT_STRING_IN); %typemap(in) char *& = const char *&; %typemap(directorout) char *& = const char *&; // char array can be in/out, though the passed string may not be big enough... // so we have to size it %typemap(in) char[ANY] { convert_to_string_ex($input); $1 = ($1_ltype) Z_STRVAL_PP($input); } %typemap(in) (char *STRING, int LENGTH) { convert_to_string_ex($input); $1 = ($1_ltype) Z_STRVAL_PP($input); $2 = ($2_ltype) Z_STRLEN_PP($input); } /* Object passed by value. Convert to a pointer */ %typemap(in) SWIGTYPE ($&1_ltype tmp) { if(SWIG_ConvertPtr(*$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); } $1 = *tmp; } %typemap(directorout) SWIGTYPE ($&1_ltype tmp) { if(SWIG_ConvertPtr(*$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) { SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); } $result = *tmp; } %typemap(in) SWIGTYPE *, SWIGTYPE [] { if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) { SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); } } %typemap(in) SWIGTYPE & { if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0 || $1 == NULL) { SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); } } %typemap(in) SWIGTYPE *const& ($*ltype temp) { if(SWIG_ConvertPtr(*$input, (void **) &temp, $*1_descriptor, 0) < 0) { SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $*1_descriptor"); } $1 = ($1_ltype)&temp; } %typemap(in) SWIGTYPE *DISOWN { if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN ) < 0) { SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); } } %typemap(argout) SWIGTYPE *, SWIGTYPE [], SWIGTYPE&; %typemap(in) void * { if(SWIG_ConvertPtr(*$input, (void **) &$1, 0, 0) < 0) { /* Allow NULL from php for void* */ if ((*$input)->type==IS_NULL) $1=0; else SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor"); } } /* Special case when void* is passed by reference so it can be made to point to opaque api structs */ %typemap(in) void ** ($*1_ltype ptr, int force), void *& ($*1_ltype ptr, int force) { /* If they pass NULL by reference, make it into a void* This bit should go in arginit if arginit support init-ing scripting args */ if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) { /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ if (!((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input))) { /* wasn't a pre/ref/thing, OR anything like an int thing */ SWIG_PHP_Error(E_ERROR, "Type error in argument $arg of $symname."); } } force=0; if (arg1==NULL) { #ifdef __cplusplus ptr=new $*1_ltype; #else ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); #endif $1=&ptr; /* have to passback arg$arg too */ force=1; } } %typemap(argout) void **, void *& { if (force$argnum) { SWIG_SetPointerZval( *$input, (void*) ptr$argnum, $*1_descriptor, 1); } } /* Typemap for output values */ %typemap(out) int, unsigned int, short, unsigned short, long, unsigned long, signed char, unsigned char, bool, size_t, enum SWIGTYPE { ZVAL_LONG(return_value,$1); } %typemap(out) long long %{ if ((long long)LONG_MIN <= $1 && $1 <= (long long)LONG_MAX) { return_value->value.lval = (long)($1); return_value->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%lld", $1); ZVAL_STRING(return_value, temp, 1); } %} %typemap(out) unsigned long long %{ if ($1 <= (unsigned long long)LONG_MAX) { return_value->value.lval = (long)($1); return_value->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%llu", $1); ZVAL_STRING(return_value, temp, 1); } %} %typemap(out) const int &, const unsigned int &, const short &, const unsigned short &, const long &, const unsigned long &, const signed char &, const unsigned char &, const bool &, const size_t &, const enum SWIGTYPE & { ZVAL_LONG(return_value,*$1); } %typemap(out) const long long & %{ if ((long long)LONG_MIN <= *$1 && *$1 <= (long long)LONG_MAX) { return_value->value.lval = (long)(*$1); return_value->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%lld", *$1); ZVAL_STRING(return_value, temp, 1); } %} %typemap(out) const unsigned long long & %{ if (*$1 <= (unsigned long long)LONG_MAX) { return_value->value.lval = (long)(*$1); return_value->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%llu", *$1); ZVAL_STRING(return_value, temp, 1); } %} %typemap(directorin) int, unsigned int, short, unsigned short, long, unsigned long, signed char, unsigned char, size_t, enum SWIGTYPE { ZVAL_LONG($input,$1_name); } %typemap(out) bool { ZVAL_BOOL(return_value,($1)?1:0); } %typemap(out) const bool & { ZVAL_BOOL(return_value,(*$1)?1:0); } %typemap(directorin) bool { ZVAL_BOOL($input,($1_name)?1:0); } %typemap(out) float, double { ZVAL_DOUBLE(return_value,$1); } %typemap(out) const float &, const double & { ZVAL_DOUBLE(return_value,*$1); } %typemap(directorin) float, double { ZVAL_DOUBLE($input,$1_name); } %typemap(out) char { ZVAL_STRINGL(return_value,&$1, 1, 1); } %typemap(out) const char & { ZVAL_STRINGL(return_value,&*$1, 1, 1); } %typemap(out) char *, char [] { if(!$1) { ZVAL_NULL(return_value); } else { ZVAL_STRING(return_value, (char *)$1, 1); } } %typemap(out) char *& { if(!*$1) { ZVAL_NULL(return_value); } else { ZVAL_STRING(return_value, (char *)*$1, 1); } } %typemap(out) SWIGTYPE *, SWIGTYPE [], SWIGTYPE & %{ SWIG_SetPointerZval(return_value, (void *)$1, $1_descriptor, $owner); %} %typemap(out) SWIGTYPE *const& %{ SWIG_SetPointerZval(return_value, (void *)*$1, $*1_descriptor, $owner); %} %typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE & %{ SWIG_SetPointerZval($input, (void *)&$1_name, $1_descriptor, $owner); %} %typemap(out, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*) { void * p = emalloc(sizeof($1)); memcpy(p, &$1, sizeof($1)); zval * resource; MAKE_STD_ZVAL(resource); ZEND_REGISTER_RESOURCE(resource, p, swig_member_ptr); SWIG_SetPointerZval(return_value, (void *)&$1, $1_descriptor, $owner); } %typemap(in, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*) { void * p = (void*)zend_fetch_resource($input TSRMLS_CC, -1, SWIG_MEMBER_PTR, NULL, 1, swig_member_ptr); memcpy(&$1, p, sizeof($1)); } %typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); SWIG_SetPointerZval(return_value, (void *)$1, ty, $owner); } %typemap(out) SWIGTYPE #ifdef __cplusplus { $&1_ltype resultobj = new $1_ltype((const $1_ltype &) $1); SWIG_SetPointerZval(return_value, (void *)resultobj, $&1_descriptor, 1); } #else { $&1_ltype resultobj = ($&1_ltype) emalloc(sizeof($1_type)); memcpy(resultobj, &$1, sizeof($1_type)); SWIG_SetPointerZval(return_value, (void *)resultobj, $&1_descriptor, 1); } #endif %typemap(directorin) SWIGTYPE { SWIG_SetPointerZval($input, SWIG_as_voidptr(&$1_name), $&1_descriptor, 2); } %typemap(out) void ""; %typemap(out) char [ANY] { int len = 0; while (len < $1_dim0 && $1[len]) ++len; RETVAL_STRINGL($1, len, 1); } // This typecheck does hard checking for proper argument type. If you want // an argument to be converted from a different PHP type, you must convert // it yourself before passing it (e.g. (string)4.7 or (int)"6"). %define %php_typecheck(_type,_prec,is) %typemap(typecheck,precedence=_prec) _type, const _type & " $1 = (Z_TYPE_PP($input) == is); " %enddef %php_typecheck(int,SWIG_TYPECHECK_INTEGER,IS_LONG) %php_typecheck(unsigned int,SWIG_TYPECHECK_UINT32,IS_LONG) %php_typecheck(short,SWIG_TYPECHECK_INT16,IS_LONG) %php_typecheck(unsigned short,SWIG_TYPECHECK_UINT16,IS_LONG) %php_typecheck(long,SWIG_TYPECHECK_INT64,IS_LONG) %php_typecheck(unsigned long,SWIG_TYPECHECK_UINT64,IS_LONG) %php_typecheck(long long,SWIG_TYPECHECK_INT64,IS_LONG) %php_typecheck(unsigned long long,SWIG_TYPECHECK_UINT64,IS_LONG) %php_typecheck(signed char,SWIG_TYPECHECK_INT8,IS_LONG) %php_typecheck(unsigned char,SWIG_TYPECHECK_UINT8,IS_LONG) %php_typecheck(size_t,SWIG_TYPECHECK_INT16,IS_LONG) %php_typecheck(enum SWIGTYPE,SWIG_TYPECHECK_INT8,IS_LONG) %php_typecheck(bool,SWIG_TYPECHECK_BOOL,IS_BOOL) %php_typecheck(float,SWIG_TYPECHECK_FLOAT,IS_DOUBLE) %php_typecheck(double,SWIG_TYPECHECK_BOOL,IS_DOUBLE) %php_typecheck(char,SWIG_TYPECHECK_CHAR,IS_STRING) %typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) char *, char *&, char [] " $1 = (Z_TYPE_PP($input) == IS_STRING); " %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *tmp; _v = (SWIG_ConvertPtr(*$input, (void **)&tmp, $&1_descriptor, 0) >= 0); } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE *const& { void *tmp; _v = (SWIG_ConvertPtr(*$input, (void**)&tmp, $1_descriptor, 0) >= 0); } %typecheck(SWIG_TYPECHECK_VOIDPTR) void * { void *tmp; _v = (SWIG_ConvertPtr(*$input, (void**)&tmp, 0, 0) >= 0); } /* Exception handling */ %typemap(throws) int, long, short, unsigned int, unsigned long, unsigned short { zend_throw_exception(NULL, const_cast("C++ $1_type exception thrown"), $1 TSRMLS_CC); return; } %typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] %{ (void)$1; zend_throw_exception(NULL, const_cast("C++ $1_type exception thrown"), 0 TSRMLS_CC); return; %} %typemap(throws) char * %{ zend_throw_exception(NULL, const_cast($1), 0 TSRMLS_CC); return; %} /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } /* php keywords */ %include 0707010008e87a000081a40000000000000000000000014caec28800002224000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/php/typemaps.i/* ----------------------------------------------------------------------------- * typemaps.i. * * SWIG Typemap library for PHP. * * This library provides standard typemaps for modifying SWIG's behavior. * With enough entries in this file, I hope that very few people actually * ever need to write a typemap. * * Define macros to define the following typemaps: * * TYPE *INPUT. Argument is passed in as native variable by value. * TYPE *OUTPUT. Argument is returned as an array from the function call. * TYPE *INOUT. Argument is passed in by value, and out as part of returned list * TYPE *REFERENCE. Argument is passed in as native variable with value * semantics. Variable value is changed with result. * Use like this: * int foo(int *REFERENCE); * * $a = 0; * $rc = foo($a); * * Even though $a looks like it's passed by value, * its value can be changed by foo(). * ----------------------------------------------------------------------------- */ %define double_typemap(TYPE) %typemap(in) TYPE *INPUT(TYPE temp) %{ convert_to_double_ex($input); temp = (TYPE) Z_DVAL_PP($input); $1 = &temp; %} %typemap(argout) TYPE *INPUT ""; %typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp) "$1 = &temp;"; %typemap(argout,fragment="t_output_helper") TYPE *OUTPUT { zval *o; MAKE_STD_ZVAL(o); ZVAL_DOUBLE(o,temp$argnum); t_output_helper( &$result, o ); } %typemap(in) TYPE *REFERENCE (TYPE dvalue) %{ convert_to_double_ex($input); dvalue = (TYPE) (*$input)->value.dval; $1 = &dvalue; %} %typemap(argout) TYPE *REFERENCE %{ $1->value.dval = (double)(lvalue$argnum); $1->type = IS_DOUBLE; %} %enddef %define int_typemap(TYPE) %typemap(in) TYPE *INPUT(TYPE temp) %{ convert_to_long_ex($input); temp = (TYPE) Z_LVAL_PP($input); $1 = &temp; %} %typemap(argout) TYPE *INPUT ""; %typemap(in,numinputs=0) TYPE *OUTPUT(TYPE temp) "$1 = &temp;"; %typemap(argout,fragment="t_output_helper") TYPE *OUTPUT { zval *o; MAKE_STD_ZVAL(o); ZVAL_LONG(o,temp$argnum); t_output_helper( &$result, o ); } %typemap(in) TYPE *REFERENCE (TYPE lvalue) %{ convert_to_long_ex($input); lvalue = (TYPE) (*$input)->value.lval; $1 = &lvalue; %} %typemap(argout) TYPE *REFERENCE %{ (*$arg)->value.lval = (long)(lvalue$argnum); (*$arg)->type = IS_LONG; %} %enddef double_typemap(float); double_typemap(double); int_typemap(int); int_typemap(short); int_typemap(long); int_typemap(unsigned int); int_typemap(unsigned short); int_typemap(unsigned long); int_typemap(unsigned char); int_typemap(long long); %typemap(argout,fragment="t_output_helper") long long *OUTPUT { zval *o; MAKE_STD_ZVAL(o); if ((long long)LONG_MIN <= temp$argnum && temp$argnum <= (long long)LONG_MAX) { ZVAL_LONG(o, temp$argnum); } else { char temp[256]; sprintf(temp, "%lld", temp$argnum); ZVAL_STRING(o, temp, 1); } t_output_helper( &$result, o ); } %typemap(in) TYPE *REFERENCE (long long lvalue) %{ CONVERT_LONG_LONG_IN(lvalue, long long, $input) $1 = &lvalue; %} %typemap(argout) long long *REFERENCE %{ if ((long long)LONG_MIN <= lvalue$argnum && lvalue$argnum <= (long long)LONG_MAX) { (*$arg)->value.lval = (long)(lvalue$argnum); (*$arg)->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%lld", lvalue$argnum); ZVAL_STRING((*$arg), temp, 1); } %} %typemap(argout) long long &OUTPUT %{ if ((long long)LONG_MIN <= *arg$argnum && *arg$argnum <= (long long)LONG_MAX) { ($result)->value.lval = (long)(*arg$argnum); ($result)->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%lld", *arg$argnum); ZVAL_STRING($result, temp, 1); } %} int_typemap(unsigned long long); %typemap(argout,fragment="t_output_helper") unsigned long long *OUTPUT { zval *o; MAKE_STD_ZVAL(o); if (temp$argnum <= (unsigned long long)LONG_MAX) { ZVAL_LONG(o, temp$argnum); } else { char temp[256]; sprintf(temp, "%llu", temp$argnum); ZVAL_STRING(o, temp, 1); } t_output_helper( &$result, o ); } %typemap(in) TYPE *REFERENCE (unsigned long long lvalue) %{ CONVERT_UNSIGNED_LONG_LONG_IN(lvalue, unsigned long long, $input) $1 = &lvalue; %} %typemap(argout) unsigned long long *REFERENCE %{ if (lvalue$argnum <= (unsigned long long)LONG_MAX) { (*$arg)->value.lval = (long)(lvalue$argnum); (*$arg)->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%llu", lvalue$argnum); ZVAL_STRING((*$arg), temp, 1); } %} %typemap(argout) unsigned long long &OUTPUT %{ if (*arg$argnum <= (unsigned long long)LONG_MAX) { ($result)->value.lval = (long)(*arg$argnum); ($result)->type = IS_LONG; } else { char temp[256]; sprintf(temp, "%llu", *arg$argnum); ZVAL_STRING($result, temp, 1); } %} %typemap(in) float *INOUT = float *INPUT; %typemap(in) double *INOUT = double *INPUT; %typemap(in) int *INOUT = int *INPUT; %typemap(in) short *INOUT = short *INPUT; %typemap(in) long *INOUT = long *INPUT; %typemap(in) long long *INOUT = long long *INPUT; %typemap(in) unsigned *INOUT = unsigned *INPUT; %typemap(in) unsigned short *INOUT = unsigned short *INPUT; %typemap(in) unsigned long *INOUT = unsigned long *INPUT; %typemap(in) unsigned char *INOUT = unsigned char *INPUT; %typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; %typemap(in) float &INOUT = float *INPUT; %typemap(in) double &INOUT = double *INPUT; %typemap(in) int &INOUT = int *INPUT; %typemap(in) short &INOUT = short *INPUT; %typemap(in) long &INOUT = long *INPUT; %typemap(in) long long &INOUT = long long *INPUT; %typemap(in) long long &INPUT = long long *INPUT; %typemap(in) unsigned &INOUT = unsigned *INPUT; %typemap(in) unsigned short &INOUT = unsigned short *INPUT; %typemap(in) unsigned long &INOUT = unsigned long *INPUT; %typemap(in) unsigned char &INOUT = unsigned char *INPUT; %typemap(in) unsigned long long &INOUT = unsigned long long *INPUT; %typemap(in) unsigned long long &INPUT = unsigned long long *INPUT; %typemap(argout) float *INOUT = float *OUTPUT; %typemap(argout) double *INOUT= double *OUTPUT; %typemap(argout) int *INOUT = int *OUTPUT; %typemap(argout) short *INOUT = short *OUTPUT; %typemap(argout) long *INOUT= long *OUTPUT; %typemap(argout) long long *INOUT= long long *OUTPUT; %typemap(argout) unsigned short *INOUT= unsigned short *OUTPUT; %typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; %typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; %typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; %typemap(argout) float &INOUT = float *OUTPUT; %typemap(argout) double &INOUT= double *OUTPUT; %typemap(argout) int &INOUT = int *OUTPUT; %typemap(argout) short &INOUT = short *OUTPUT; %typemap(argout) long &INOUT= long *OUTPUT; %typemap(argout) long long &INOUT= long long *OUTPUT; %typemap(argout) unsigned short &INOUT= unsigned short *OUTPUT; %typemap(argout) unsigned long &INOUT = unsigned long *OUTPUT; %typemap(argout) unsigned char &INOUT = unsigned char *OUTPUT; %typemap(argout) unsigned long long &INOUT = unsigned long long *OUTPUT; %typemap(in) char INPUT[ANY] ( char temp[$1_dim0] ) %{ convert_to_string_ex($input); strncpy(temp,Z_LVAL_PP($input),$1_dim0); $1 = temp; %} %typemap(in,numinputs=0) char OUTPUT[ANY] ( char temp[$1_dim0] ) "$1 = temp;"; %typemap(argout) char OUTPUT[ANY] { zval *o; MAKE_STD_ZVAL(o); ZVAL_STRINGL(o,temp$argnum,$1_dim0); t_output_helper( &$result, o ); } %typemap(in,numinputs=0) void **OUTPUT (int force), void *&OUTPUT (int force) %{ /* If they pass NULL by reference, make it into a void* This bit should go in arginit if arginit support init-ing scripting args */ if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) { /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ if (!((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input))) { /* wasn't a pre/ref/thing, OR anything like an int thing */ SWIG_PHP_Error(E_ERROR, "Type error in argument $arg of $symname."); } } force=0; if (arg1==NULL) { #ifdef __cplusplus ptr=new $*1_ltype; #else ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); #endif $1=&ptr; /* have to passback arg$arg too */ force=1; } %} %typemap(argout) void **OUTPUT, void *&OUTPUT %{ if (force$argnum) { /* pass back arg$argnum through params ($arg) if we can */ if (!PZVAL_IS_REF(*$arg)) { SWIG_PHP_Error(E_WARNING, "Parameter $argnum of $symname wasn't passed by reference"); } else { SWIG_SetPointerZval(*$arg, (void *) ptr$argnum, $*1_descriptor, 1); } } %} 0707010008e873000081a40000000000000000000000014caec28800000122000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/php/std_common.i/* ----------------------------------------------------------------------------- * std_common.i * * SWIG typemaps for STL - common utilities * ----------------------------------------------------------------------------- */ %include %apply size_t { std::size_t }; 0707010008e86d000081a40000000000000000000000014caec2880000236e000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/php/globalvar.i/* ----------------------------------------------------------------------------- * globalvar.i * * Global variables - add the variable to PHP * ----------------------------------------------------------------------------- */ %typemap(varinit) char *, char [] { zval *z_var; MAKE_STD_ZVAL(z_var); z_var->type = IS_STRING; if($1) { z_var->value.str.val = estrdup($1); z_var->value.str.len = strlen($1); } else { z_var->value.str.val = 0; z_var->value.str.len = 0; } zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void *)&z_var, sizeof(zval *), NULL); } %typemap(varinit) int, unsigned int, unsigned short, short, unsigned short, long, unsigned long, signed char, unsigned char, enum SWIGTYPE { zval *z_var; MAKE_STD_ZVAL(z_var); z_var->type = IS_LONG; z_var->value.lval = $1; zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void *)&z_var, sizeof(zval *), NULL); } %typemap(varinit) bool { zval *z_var; MAKE_STD_ZVAL(z_var); z_var->type = IS_BOOL; z_var->value.lval = ($1)?1:0; zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void *)&z_var, sizeof(zval *), NULL); } %typemap(varinit) float, double { zval *z_var; MAKE_STD_ZVAL(z_var); z_var->type = IS_DOUBLE; z_var->value.dval = $1; zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void *)&z_var, sizeof(zval *), NULL); } %typemap(varinit) char { zval *z_var; char c[2]; MAKE_STD_ZVAL(z_var); c[0] = $1; c[1] = 0; z_var->type = IS_STRING; z_var->value.str.val = estrndup(c, 1); z_var->value.str.len = 1; zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void *)&z_var, sizeof(zval *), NULL); } %typemap(varinit) SWIGTYPE *, SWIGTYPE [] { zval *z_var; MAKE_STD_ZVAL(z_var); SWIG_SetPointerZval(z_var, (void*)$1, $1_descriptor, 0); zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void *)&z_var, sizeof(zval *), NULL); } %typemap(varinit) SWIGTYPE, SWIGTYPE & { zval *z_var; MAKE_STD_ZVAL(z_var); SWIG_SetPointerZval(z_var, (void*)&$1, $&1_descriptor, 0); zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void*)&z_var, sizeof(zval *), NULL); } %typemap(varinit) char [ANY] { zval *z_var; MAKE_STD_ZVAL(z_var); z_var->type = IS_STRING; if ($1) { /* varinit char [ANY] */ ZVAL_STRINGL(z_var,(char*)$1, $1_dim0, 1); } zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void*)&z_var, sizeof(zval *), NULL); } %typemap(varinit, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*) { void * p = emalloc(sizeof($1)); memcpy(p, &$1, sizeof($1)); zval * resource; MAKE_STD_ZVAL(resource); ZEND_REGISTER_RESOURCE(resource, p, swig_member_ptr); zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void*)&resource, sizeof(zval *), NULL); } %typemap(varin) int, unsigned int, short, unsigned short, long, unsigned long, signed char, unsigned char, enum SWIGTYPE { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); convert_to_long_ex(z_var); if ($1 != ($1_ltype)((*z_var)->value.lval)) { $1 = Z_LVAL_PP(z_var); } } %typemap(varin) bool { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); convert_to_boolean_ex(z_var); if ($1 != ($1_ltype)((*z_var)->value.lval)) { $1 = Z_LVAL_PP(z_var); } } %typemap(varin) double,float { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); convert_to_double_ex(z_var); if ($1 != ($1_ltype)((*z_var)->value.dval)) { $1 = Z_DVAL_PP(z_var); } } %typemap(varin) char { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); convert_to_string_ex(z_var); if ($1 != *((*z_var)->value.str.val)) { $1 = *((*z_var)->value.str.val); } } %typemap(varin) char * { zval **z_var; char *s1; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); convert_to_string_ex(z_var); s1 = Z_STRVAL_PP(z_var); if ((s1 == NULL) || ($1 == NULL) || zend_binary_strcmp(s1, strlen(s1), $1, strlen($1))) { if (s1) $1 = estrdup(s1); else $1 = NULL; } } %typemap(varin) SWIGTYPE [] { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if($1) { SWIG_SetPointerZval(*z_var, (void*)$1, $1_descriptor, $owner); } } %typemap(varin) char [ANY] { zval **z_var; char *s1; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); s1 = Z_STRVAL_PP(z_var); if((s1 == NULL) || ($1 == NULL) || zend_binary_strcmp(s1, strlen(s1), $1, strlen($1))) { if(s1) strncpy($1, s1, $1_dim0); } } %typemap(varin) SWIGTYPE { zval **z_var; $&1_ltype _temp; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if (SWIG_ConvertPtr(*z_var, (void**)&_temp, $&1_descriptor, 0) < 0) { SWIG_PHP_Error(E_ERROR,"Type error in value of $symname. Expected $&1_descriptor"); } $1 = *($&1_ltype)_temp; } %typemap(varin) SWIGTYPE *, SWIGTYPE & { zval **z_var; $1_ltype _temp; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if (SWIG_ConvertPtr(*z_var, (void **)&_temp, $1_descriptor, 0) < 0) { SWIG_PHP_Error(E_ERROR,"Type error in value of $symname. Expected $&1_descriptor"); } $1 = ($1_ltype)_temp; } %typemap(varin, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*) { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); void * p = (void*)zend_fetch_resource(*z_var TSRMLS_CC, -1, SWIG_MEMBER_PTR, NULL, 1, swig_member_ptr); memcpy(&$1, p, sizeof($1)); } %typemap(varout) int, unsigned int, unsigned short, short, long, unsigned long, signed char, unsigned char, enum SWIGTYPE { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if($1 != ($1_ltype)((*z_var)->value.lval)) { (*z_var)->value.lval = (long)$1; } } //SAMFIX need to cast zval->type, what if zend-hash_find fails? etc? %typemap(varout) bool { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if($1 != ($1_ltype)((*z_var)->value.lval)) { (*z_var)->value.lval = (long)$1; } } %typemap(varout) double, float { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if($1 != ($1_ltype)((*z_var)->value.dval)) { (*z_var)->value.dval = (double)$1; } } %typemap(varout) char { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if($1 != *((*z_var)->value.str.val)) { char c[2]; efree((*z_var)->value.str.val); c[0] = $1; c[1] = 0; (*z_var)->value.str.val = estrdup(c); } } %typemap(varout) char * { zval **z_var; char *s1; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); s1 = Z_STRVAL_PP(z_var); if((s1 == NULL) || ($1 == NULL) || zend_binary_strcmp(s1, strlen(s1), $1, strlen($1) )) { if(s1) efree(s1); if($1) { (*z_var)->value.str.val = estrdup($1); (*z_var)->value.str.len = strlen($1) +1; } else { (*z_var)->value.str.val = 0; (*z_var)->value.str.len = 0; } } } %typemap(varout) SWIGTYPE { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); SWIG_SetPointerZval(*z_var, (void*)&$1, $&1_descriptor, 0); } %typemap(varout) SWIGTYPE [] { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); if($1) SWIG_SetPointerZval(*z_var, (void*)$1, $1_descriptor, 0); } %typemap(varout) char [ANY] { zval **z_var; char *s1; deliberate error cos this code looks bogus to me zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); s1 = Z_STRVAL_PP(z_var); if((s1 == NULL) || zend_binary_strcmp(s1, strlen(s1), $1, strlen($1))) { if($1) { (*z_var)->value.str.val = estrdup($1); (*z_var)->value.str.len = strlen($1)+1; } else { (*z_var)->value.str.val = 0; (*z_var)->value.str.len = 0; } } } %typemap(varout) SWIGTYPE *, SWIGTYPE & { zval **z_var; zend_hash_find(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void**)&z_var); SWIG_SetPointerZval(*z_var, (void*)$1, $1_descriptor, 0); } %typemap(varout, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*) { void * p = emalloc(sizeof($1)); memcpy(p, &$1, sizeof($1)); zval * resource; MAKE_STD_ZVAL(resource); ZEND_REGISTER_RESOURCE(resource, p, swig_member_ptr); zend_hash_add(&EG(symbol_table), (char*)"$1", sizeof("$1"), (void*)&resource, sizeof(zval *), NULL); } 0707010008e872000081a40000000000000000000000014caec2880000216b000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/php/phprun.swg/* ----------------------------------------------------------------------------- * phprun.swg * * PHP runtime library * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif #include "zend.h" #include "zend_API.h" #include "zend_exceptions.h" #include "php.h" #include "ext/standard/php_string.h" #ifdef ZEND_RAW_FENTRY /* ZEND_RAW_FENTRY was added somewhere between 5.2.0 and 5.2.3 */ # define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_RAW_FENTRY((char*)#ZN, N, A, 0) #else /* This causes warnings from GCC >= 4.2 (assigning a string literal to char*). * But this seems to be unavoidable without directly assuming knowledge of * the structure, which changed between PHP4 and PHP5. */ # define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A) #endif #ifndef Z_SET_ISREF_P /* For PHP < 5.3 */ # define Z_SET_ISREF_P(z) (z)->is_ref = 1 #endif #ifndef Z_SET_REFCOUNT_P /* For PHP < 5.3 */ # define Z_SET_REFCOUNT_P(z, rc) (z)->refcount = (rc) #endif #define SWIG_LONG_CONSTANT(N, V) zend_register_long_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC) #define SWIG_DOUBLE_CONSTANT(N, V) zend_register_double_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC) #define SWIG_STRING_CONSTANT(N, V) zend_register_stringl_constant((char*)#N, sizeof(#N), (char*)(V), strlen(V), CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC) #define SWIG_CHAR_CONSTANT(N, V) do {\ static char swig_char = (V);\ zend_register_stringl_constant((char*)#N, sizeof(#N), &swig_char, 1, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);\ } while (0) /* These TSRMLS_ stuff should already be defined now, but with older php under redhat are not... */ #ifndef TSRMLS_D #define TSRMLS_D #endif #ifndef TSRMLS_DC #define TSRMLS_DC #endif #ifndef TSRMLS_C #define TSRMLS_C #endif #ifndef TSRMLS_CC #define TSRMLS_CC #endif #ifdef __cplusplus } #endif /* But in fact SWIG_ConvertPtr is the native interface for getting typed pointer values out of zvals. We need the TSRMLS_ macros for when we make PHP type calls later as we handle php resources */ #define SWIG_ConvertPtr(obj,pp,type,flags) SWIG_ZTS_ConvertPtr(obj,pp,type,flags TSRMLS_CC) #define SWIG_fail goto fail static const char *default_error_msg = "Unknown error occurred"; static int default_error_code = E_ERROR; #define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg #define SWIG_PHP_Error(code,msg) do { SWIG_ErrorCode() = code; SWIG_ErrorMsg() = msg; SWIG_fail; } while (0) #define SWIG_contract_assert(expr,msg) \ if (!(expr) ) { zend_printf("Contract Assert Failed %s\n",msg ); } else /* Standard SWIG API */ #define SWIG_GetModule(clientdata) SWIG_Php_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer) /* used to wrap returned objects in so we know whether they are newobject and need freeing, or not */ typedef struct { void * ptr; int newobject; } swig_object_wrapper; /* empty zend destructor for types without one */ static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) { (void)rsrc; } #define SWIG_SetPointerZval(a,b,c,d) SWIG_ZTS_SetPointerZval(a,b,c,d TSRMLS_CC) #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) static void SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject TSRMLS_DC) { swig_object_wrapper *value=NULL; /* * First test for Null pointers. Return those as PHP native NULL */ if (!ptr ) { ZVAL_NULL(z); return; } if (type->clientdata) { if (! (*(int *)(type->clientdata))) zend_error(E_ERROR, "Type: %s failed to register with zend",type->name); value=(swig_object_wrapper *)emalloc(sizeof(swig_object_wrapper)); value->ptr=ptr; value->newobject=newobject; if (newobject <= 1) { /* Just register the pointer as a resource. */ ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata)); } else { /* * Wrap the resource in an object, the resource will be accessible * via the "_cPtr" member. This is currently only used by * directorin typemaps. */ value->newobject = 0; zval *resource; MAKE_STD_ZVAL(resource); ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata)); zend_class_entry **ce = NULL; zval *classname; MAKE_STD_ZVAL(classname); /* _p_Foo -> Foo */ ZVAL_STRING(classname, (char*)type->name+3, 1); /* class names are stored in lowercase */ php_strtolower(Z_STRVAL_PP(&classname), Z_STRLEN_PP(&classname)); if (zend_lookup_class(Z_STRVAL_P(classname), Z_STRLEN_P(classname), &ce TSRMLS_CC) != SUCCESS) { /* class does not exist */ object_init(z); } else { object_init_ex(z, *ce); } Z_SET_REFCOUNT_P(z, 1); Z_SET_ISREF_P(z); zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL); FREE_ZVAL(classname); } return; } zend_error(E_ERROR, "Type: %s not registered with zend",type->name); } /* This pointer conversion routine takes the native pointer p (along with its type name) and converts it by calling appropriate casting functions according to ty. The resultant pointer is returned, or NULL is returned if the pointer can't be cast. Sadly PHP has no API to find a type name from a type id, only from an instance of a resource of the type id, so we have to pass type_name as well. The two functions which might call this are: SWIG_ZTS_ConvertResourcePtr which gets the type name from the resource and the registered zend destructors for which we have one per type each with the type name hard wired in. */ static void * SWIG_ZTS_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty TSRMLS_DC) { swig_cast_info *tc; void *result = 0; if (!ty) { /* They don't care about the target type, so just pass on the pointer! */ return p; } if (! type_name) { /* can't convert p to ptr type ty if we don't know what type p is */ return NULL; } /* convert and cast p from type_name to ptr as ty. */ tc = SWIG_TypeCheck(type_name, ty); if (tc) { int newmemory = 0; result = SWIG_TypeCast(tc, p, &newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ } return result; } /* This function returns a pointer of type ty by extracting the pointer and type info from the resource in z. z must be a resource. If it fails, NULL is returned. It uses SWIG_ZTS_ConvertResourceData to do the real work. */ static void * SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) { swig_object_wrapper *value; void *p; int type; char *type_name; value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type); if ( flags & SWIG_POINTER_DISOWN ) { value->newobject = 0; } p = value->ptr; if (type==-1) return NULL; type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC); return SWIG_ZTS_ConvertResourceData(p, type_name, ty TSRMLS_CC); } /* We allow passing of a RESOURCE pointing to the object or an OBJECT whose _cPtr is a resource pointing to the object */ static int SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC) { if (z == NULL) { *ptr = 0; return 0; } switch (z->type) { case IS_OBJECT: { zval ** _cPtr; if (zend_hash_find(HASH_OF(z),(char*)"_cPtr",sizeof("_cPtr"),(void**)&_cPtr)==SUCCESS) { if ((*_cPtr)->type==IS_RESOURCE) { *ptr = SWIG_ZTS_ConvertResourcePtr(*_cPtr, ty, flags TSRMLS_CC); return (*ptr == NULL ? -1 : 0); } } break; } case IS_RESOURCE: *ptr = SWIG_ZTS_ConvertResourcePtr(z, ty, flags TSRMLS_CC); return (*ptr == NULL ? -1 : 0); case IS_NULL: *ptr = 0; return 0; } return -1; } static char const_name[] = "swig_runtime_data_type_pointer"; static swig_module_info *SWIG_Php_GetModule() { zval *pointer; swig_module_info *ret = 0; MAKE_STD_ZVAL(pointer); TSRMLS_FETCH(); if (zend_get_constant(const_name, sizeof(const_name), pointer TSRMLS_CC)) { if (pointer->type == IS_LONG) { ret = (swig_module_info *) pointer->value.lval; } } FREE_ZVAL(pointer); return ret; } static void SWIG_Php_SetModule(swig_module_info *pointer) { TSRMLS_FETCH(); REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0); } 0707010008e879000081a40000000000000000000000014caec28800000165000000b600010002ffffffffffffffff0000002a00000000root/usr/local/share/swig/2.0.1/php/stl.i/* ----------------------------------------------------------------------------- * stl.i * * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include %include %include %include %include 0707010008e870000081a40000000000000000000000014caec28800002a86000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/php/phpkw.swg/* ----------------------------------------------------------------------------- * phpkw.swg * ----------------------------------------------------------------------------- */ #define PHPKW(x) %keywordwarn("'" `x` "' is a PHP keyword, renamed as 'c_" `x` "'",sourcefmt="%(lower)s",rename="c_%s") `x` #define PHPCN(x) %keywordwarn("'" `x` "' is a PHP reserved class name, class renamed as 'c_" `x` "'",%$isclass,sourcefmt="%(lower)s",rename="c_%s") `x` #define PHPBN1(x) %builtinwarn("'" `x` "' conflicts with a built-in name in PHP",sourcefmt="%(lower)s") `x` #define PHPBN2(x) %builtinwarn("'" `x` "' conflicts with a built-in name in PHP") "::" `x` #define PHPFN(x) %keywordwarn("'" `x` "' is a PHP built-in function, renamed as 'c_" `x` "'",sourcefmt="%(lower)s",%$isfunction,%$not %$ismember,rename="c_%s") `x` /* From http://aspn.activestate.com/ASPN/docs/PHP/reserved.html http://php.net/manual/en/reserved.keywords.php and reviewed by Olly Betts. Further updates from the PHP manual on php.net. */ /* We classify these as kw since PHP will not run if used globally. */ /* "You cannot use any of the following words as constants, class names, * function or method names. Using them as variable names is generally OK, but * could lead to confusion." */ /* case insensitive */ PHPKW(__halt_compiler); PHPKW(abstract); PHPKW(and); PHPKW(array); PHPKW(as); PHPKW(break); PHPKW(case); PHPKW(catch); PHPKW(class); PHPKW(clone); PHPKW(const); PHPKW(continue); PHPKW(declare); PHPKW(default); PHPKW(die); // "Language construct" PHPKW(do); PHPKW(echo); // "Language construct" PHPKW(else); PHPKW(elseif); PHPKW(empty); // "Language construct" PHPKW(enddeclare); PHPKW(endfor); PHPKW(endforeach); PHPKW(endif); PHPKW(endswitch); PHPKW(endwhile); PHPKW(eval); // "Language construct" PHPKW(exit); // "Language construct" PHPKW(extends); PHPKW(final); PHPKW(for); PHPKW(foreach); PHPKW(function); PHPKW(global); PHPKW(goto); // As of PHP5.3 PHPKW(if); PHPKW(implements); PHPKW(include); // "Language construct" PHPKW(include_once); // "Language construct" PHPKW(instanceof); PHPKW(interface); PHPKW(isset); // "Language construct" PHPKW(list); // "Language construct" PHPKW(namespace); // As of PHP5.3 PHPKW(new); PHPKW(or); PHPKW(print); // "Language construct" PHPKW(private); PHPKW(protected); PHPKW(public); PHPKW(require); // "Language construct" PHPKW(require_once); // "Language construct" PHPKW(return); // "Language construct" PHPKW(static); PHPKW(switch); PHPKW(throw); PHPKW(try); PHPKW(unset); // "Language construct" PHPKW(use); PHPKW(var); PHPKW(while); PHPKW(xor); // Compile-time constants PHPKW(__CLASS__); PHPKW(__DIR__); // As of PHP5.3 PHPKW(__FILE__); PHPKW(__FUNCTION__); PHPKW(__METHOD__); PHPKW(__NAMESPACE__); // As of PHP5.3 PHPKW(__LINE__); /* We classify these as built-in names since they conflict, but PHP still runs */ /* Type 1: case insensitive */ PHPBN1(__sleep); PHPBN1(__wakeup); PHPBN1(not); PHPBN1(parent); PHPBN1(virtual); PHPBN1(NULL); PHPBN1(TRUE); PHPBN1(FALSE); /* Type 2: case sensitive */ /* "Core Predefined Constants" from http://uk2.php.net/manual/en/reserved.constants.php */ PHPBN2(E_ALL); PHPBN2(E_ERROR); PHPBN2(E_PARSE); PHPBN2(E_WARNING); PHPBN2(E_NOTICE); PHPBN2(E_CORE_ERROR); PHPBN2(E_CORE_WARNING); PHPBN2(E_COMPILE_ERROR); PHPBN2(E_COMPILE_WARNING); PHPBN2(E_USER_ERROR); PHPBN2(E_USER_WARNING); PHPBN2(E_USER_NOTICE); PHPBN2(PHP_OS); PHPBN2(PHP_VERSION); PHPBN2(PHP_SAPI); PHPBN2(PHP_EOL); PHPBN2(PHP_INT_MAX); PHPBN2(PHP_INT_SIZE); PHPBN2(DEFAULT_INCLUDE_PATH); PHPBN2(PEAR_INSTALL_DIR); PHPBN2(PEAR_EXTENSION_DIR); PHPBN2(PHP_EXTENSION_DIR); PHPBN2(PHP_PREFIX); PHPBN2(PHP_BINDIR); PHPBN2(PHP_LIBDIR); PHPBN2(PHP_DATADIR); PHPBN2(PHP_SYSCONFDIR); PHPBN2(PHP_LOCALSTATEDIR); PHPBN2(PHP_CONFIG_FILE_PATH); PHPBN2(PHP_CONFIG_FILE_SCAN_DIR); PHPBN2(PHP_SHLIB_SUFFIX); PHPBN2(PHP_OUTPUT_HANDLER_START); PHPBN2(PHP_OUTPUT_HANDLER_CONT); PHPBN2(PHP_OUTPUT_HANDLER_END); /* "Standard Predefined Constants" from http://uk2.php.net/manual/en/reserved.constants.php */ PHPBN2(EXTR_OVERWRITE); PHPBN2(EXTR_SKIP); PHPBN2(EXTR_PREFIX_SAME); PHPBN2(EXTR_PREFIX_ALL); PHPBN2(EXTR_PREFIX_INVALID); PHPBN2(EXTR_PREFIX_IF_EXISTS); PHPBN2(EXTR_IF_EXISTS); PHPBN2(SORT_ASC); PHPBN2(SORT_DESC); PHPBN2(SORT_REGULAR); PHPBN2(SORT_NUMERIC); PHPBN2(SORT_STRING); PHPBN2(CASE_LOWER); PHPBN2(CASE_UPPER); PHPBN2(COUNT_NORMAL); PHPBN2(COUNT_RECURSIVE); PHPBN2(ASSERT_ACTIVE); PHPBN2(ASSERT_CALLBACK); PHPBN2(ASSERT_BAIL); PHPBN2(ASSERT_WARNING); PHPBN2(ASSERT_QUIET_EVAL); PHPBN2(CONNECTION_ABORTED); PHPBN2(CONNECTION_NORMAL); PHPBN2(CONNECTION_TIMEOUT); PHPBN2(INI_USER); PHPBN2(INI_PERDIR); PHPBN2(INI_SYSTEM); PHPBN2(INI_ALL); PHPBN2(M_E); PHPBN2(M_LOG2E); PHPBN2(M_LOG10E); PHPBN2(M_LN2); PHPBN2(M_LN10); PHPBN2(M_PI); PHPBN2(M_PI_2); PHPBN2(M_PI_4); PHPBN2(M_1_PI); PHPBN2(M_2_PI); PHPBN2(M_2_SQRTPI); PHPBN2(M_SQRT2); PHPBN2(M_SQRT1_2); PHPBN2(CRYPT_SALT_LENGTH); PHPBN2(CRYPT_STD_DES); PHPBN2(CRYPT_EXT_DES); PHPBN2(CRYPT_MD5); PHPBN2(CRYPT_BLOWFISH); PHPBN2(DIRECTORY_SEPARATOR); PHPBN2(SEEK_SET); PHPBN2(SEEK_CUR); PHPBN2(SEEK_END); PHPBN2(LOCK_SH); PHPBN2(LOCK_EX); PHPBN2(LOCK_UN); PHPBN2(LOCK_NB); PHPBN2(HTML_SPECIALCHARS); PHPBN2(HTML_ENTITIES); PHPBN2(ENT_COMPAT); PHPBN2(ENT_QUOTES); PHPBN2(ENT_NOQUOTES); PHPBN2(INFO_GENERAL); PHPBN2(INFO_CREDITS); PHPBN2(INFO_CONFIGURATION); PHPBN2(INFO_MODULES); PHPBN2(INFO_ENVIRONMENT); PHPBN2(INFO_VARIABLES); PHPBN2(INFO_LICENSE); PHPBN2(INFO_ALL); PHPBN2(CREDITS_GROUP); PHPBN2(CREDITS_GENERAL); PHPBN2(CREDITS_SAPI); PHPBN2(CREDITS_MODULES); PHPBN2(CREDITS_DOCS); PHPBN2(CREDITS_FULLPAGE); PHPBN2(CREDITS_QA); PHPBN2(CREDITS_ALL); PHPBN2(STR_PAD_LEFT); PHPBN2(STR_PAD_RIGHT); PHPBN2(STR_PAD_BOTH); PHPBN2(PATHINFO_DIRNAME); PHPBN2(PATHINFO_BASENAME); PHPBN2(PATHINFO_EXTENSION); PHPBN2(PATH_SEPARATOR); PHPBN2(CHAR_MAX); PHPBN2(LC_CTYPE); PHPBN2(LC_NUMERIC); PHPBN2(LC_TIME); PHPBN2(LC_COLLATE); PHPBN2(LC_MONETARY); PHPBN2(LC_ALL); PHPBN2(LC_MESSAGES); PHPBN2(ABDAY_1); PHPBN2(ABDAY_2); PHPBN2(ABDAY_3); PHPBN2(ABDAY_4); PHPBN2(ABDAY_5); PHPBN2(ABDAY_6); PHPBN2(ABDAY_7); PHPBN2(DAY_1); PHPBN2(DAY_2); PHPBN2(DAY_3); PHPBN2(DAY_4); PHPBN2(DAY_5); PHPBN2(DAY_6); PHPBN2(DAY_7); PHPBN2(ABMON_1); PHPBN2(ABMON_2); PHPBN2(ABMON_3); PHPBN2(ABMON_4); PHPBN2(ABMON_5); PHPBN2(ABMON_6); PHPBN2(ABMON_7); PHPBN2(ABMON_8); PHPBN2(ABMON_9); PHPBN2(ABMON_10); PHPBN2(ABMON_11); PHPBN2(ABMON_12); PHPBN2(MON_1); PHPBN2(MON_2); PHPBN2(MON_3); PHPBN2(MON_4); PHPBN2(MON_5); PHPBN2(MON_6); PHPBN2(MON_7); PHPBN2(MON_8); PHPBN2(MON_9); PHPBN2(MON_10); PHPBN2(MON_11); PHPBN2(MON_12); PHPBN2(AM_STR); PHPBN2(PM_STR); PHPBN2(D_T_FMT); PHPBN2(D_FMT); PHPBN2(T_FMT); PHPBN2(T_FMT_AMPM); PHPBN2(ERA); PHPBN2(ERA_YEAR); PHPBN2(ERA_D_T_FMT); PHPBN2(ERA_D_FMT); PHPBN2(ERA_T_FMT); PHPBN2(ALT_DIGITS); PHPBN2(INT_CURR_SYMBOL); PHPBN2(CURRENCY_SYMBOL); PHPBN2(CRNCYSTR); PHPBN2(MON_DECIMAL_POINT); PHPBN2(MON_THOUSANDS_SEP); PHPBN2(MON_GROUPING); PHPBN2(POSITIVE_SIGN); PHPBN2(NEGATIVE_SIGN); PHPBN2(INT_FRAC_DIGITS); PHPBN2(FRAC_DIGITS); PHPBN2(P_CS_PRECEDES); PHPBN2(P_SEP_BY_SPACE); PHPBN2(N_CS_PRECEDES); PHPBN2(N_SEP_BY_SPACE); PHPBN2(P_SIGN_POSN); PHPBN2(N_SIGN_POSN); PHPBN2(DECIMAL_POINT); PHPBN2(RADIXCHAR); PHPBN2(THOUSANDS_SEP); PHPBN2(THOUSEP); PHPBN2(GROUPING); PHPBN2(YESEXPR); PHPBN2(NOEXPR); PHPBN2(YESSTR); PHPBN2(NOSTR); PHPBN2(CODESET); PHPBN2(LOG_EMERG); PHPBN2(LOG_ALERT); PHPBN2(LOG_CRIT); PHPBN2(LOG_ERR); PHPBN2(LOG_WARNING); PHPBN2(LOG_NOTICE); PHPBN2(LOG_INFO); PHPBN2(LOG_DEBUG); PHPBN2(LOG_KERN); PHPBN2(LOG_USER); PHPBN2(LOG_MAIL); PHPBN2(LOG_DAEMON); PHPBN2(LOG_AUTH); PHPBN2(LOG_SYSLOG); PHPBN2(LOG_LPR); PHPBN2(LOG_NEWS); PHPBN2(LOG_UUCP); PHPBN2(LOG_CRON); PHPBN2(LOG_AUTHPRIV); PHPBN2(LOG_LOCAL0); PHPBN2(LOG_LOCAL1); PHPBN2(LOG_LOCAL2); PHPBN2(LOG_LOCAL3); PHPBN2(LOG_LOCAL4); PHPBN2(LOG_LOCAL5); PHPBN2(LOG_LOCAL6); PHPBN2(LOG_LOCAL7); PHPBN2(LOG_PID); PHPBN2(LOG_CONS); PHPBN2(LOG_ODELAY); PHPBN2(LOG_NDELAY); PHPBN2(LOG_NOWAIT); PHPBN2(LOG_PERROR); /* Added in PHP5 */ PHPBN2(E_STRICT); PHPBN2(__COMPILER_HALT_OFFSET__); /* Class names reserved by PHP */ /* case insensitive */ PHPCN(stdclass); PHPCN(__php_incomplete_class); PHPCN(directory); /* Added in PHP5 (this list apparently depends which extensions you load by default). */ PHPCN(parent); PHPCN(self); PHPCN(exception); PHPCN(php_user_filter); PHPCN(errorexception); PHPCN(xmlwriter); PHPCN(libxmlerror); PHPCN(simplexmlelement); PHPCN(soapclient); PHPCN(soapvar); PHPCN(soapserver); PHPCN(soapfault); PHPCN(soapparam); PHPCN(soapheader); PHPCN(recursiveiteratoriterator); PHPCN(filteriterator); PHPCN(recursivefilteriterator); PHPCN(parentiterator); PHPCN(limititerator); PHPCN(cachingiterator); PHPCN(recursivecachingiterator); PHPCN(iteratoriterator); PHPCN(norewinditerator); PHPCN(appenditerator); PHPCN(infiniteiterator); PHPCN(emptyiterator); PHPCN(arrayobject); PHPCN(arrayiterator); PHPCN(recursivearrayiterator); PHPCN(splfileinfo); PHPCN(directoryiterator); PHPCN(recursivedirectoryiterator); PHPCN(splfileobject); PHPCN(spltempfileobject); PHPCN(simplexmliterator); PHPCN(logicexception); PHPCN(badfunctioncallexception); PHPCN(badmethodcallexception); PHPCN(domainexception); PHPCN(invalidargumentexception); PHPCN(lengthexception); PHPCN(outofrangeexception); PHPCN(runtimeexception); PHPCN(outofboundsexception); PHPCN(overflowexception); PHPCN(rangeexception); PHPCN(underflowexception); PHPCN(unexpectedvalueexception); PHPCN(splobjectstorage); PHPCN(reflectionexception); PHPCN(reflection); PHPCN(reflectionfunction); PHPCN(reflectionparameter); PHPCN(reflectionmethod); PHPCN(reflectionclass); PHPCN(reflectionobject); PHPCN(reflectionproperty); PHPCN(reflectionextension); PHPCN(domexception); PHPCN(domstringlist); PHPCN(domnamelist); PHPCN(domimplementationlist); PHPCN(domimplementationsource); PHPCN(domimplementation); PHPCN(domnode); PHPCN(domnamespacenode); PHPCN(domdocumentfragment); PHPCN(domdocument); PHPCN(domnodelist); PHPCN(domnamednodemap); PHPCN(domcharacterdata); PHPCN(domattr); PHPCN(domelement); PHPCN(domtext); PHPCN(domcomment); PHPCN(domtypeinfo); PHPCN(domuserdatahandler); PHPCN(domdomerror); PHPCN(domerrorhandler); PHPCN(domlocator); PHPCN(domconfiguration); PHPCN(domcdatasection); PHPCN(domdocumenttype); PHPCN(domnotation); PHPCN(domentity); PHPCN(domentityreference); PHPCN(domprocessinginstruction); PHPCN(domstringextend); PHPCN(domxpath); PHPCN(xmlreader); PHPCN(sqlitedatabase); PHPCN(sqliteresult); PHPCN(sqliteunbuffered); PHPCN(sqliteexception); PHPCN(datetime); /* Built-in PHP functions (incomplete). */ PHPFN(cos); PHPFN(sin); PHPFN(tan); PHPFN(acos); PHPFN(asin); PHPFN(atan); PHPFN(atan2); PHPFN(cosh); PHPFN(sinh); PHPFN(tanh); PHPFN(exp); PHPFN(log); PHPFN(log10); PHPFN(pow); PHPFN(sqrt); PHPFN(ceil); PHPFN(floor); PHPFN(fmod); PHPFN(min); PHPFN(max); #undef PHPKW #undef PHPBN1 #undef PHPBN2 #undef PHPCN #undef PHPFN 0707010008e87b000081a40000000000000000000000014caec28800000a1d000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/php/utils.i %define CONVERT_BOOL_IN(lvar,t,invar) convert_to_boolean_ex(invar); lvar = (t) Z_LVAL_PP(invar); %enddef %define CONVERT_INT_IN(lvar,t,invar) convert_to_long_ex(invar); lvar = (t) Z_LVAL_PP(invar); %enddef %define CONVERT_LONG_LONG_IN(lvar,t,invar) switch ((*(invar))->type) { case IS_DOUBLE: lvar = (t) (*(invar))->value.dval; break; case IS_STRING: { char * endptr; errno = 0; lvar = (t) strtoll((*(invar))->value.str.val, &endptr, 10); if (*endptr && !errno) break; /* FALL THRU */ } default: convert_to_long_ex(invar); lvar = (t) (*(invar))->value.lval; } %enddef %define CONVERT_UNSIGNED_LONG_LONG_IN(lvar,t,invar) switch ((*(invar))->type) { case IS_DOUBLE: lvar = (t) (*(invar))->value.dval; break; case IS_STRING: { char * endptr; errno = 0; lvar = (t) strtoull((*(invar))->value.str.val, &endptr, 10); if (*endptr && !errno) break; /* FALL THRU */ } default: convert_to_long_ex(invar); lvar = (t) (*(invar))->value.lval; } %enddef %define CONVERT_INT_OUT(lvar,invar) lvar = (t) Z_LVAL_PP(invar); %enddef %define CONVERT_FLOAT_IN(lvar,t,invar) convert_to_double_ex(invar); lvar = (t) Z_DVAL_PP(invar); %enddef %define CONVERT_CHAR_IN(lvar,t,invar) convert_to_string_ex(invar); lvar = (t) *Z_STRVAL_PP(invar); %enddef %define CONVERT_STRING_IN(lvar,t,invar) if ((*invar)->type==IS_NULL) { lvar = (t) 0; } else { convert_to_string_ex(invar); lvar = (t) Z_STRVAL_PP(invar); } %enddef %define %pass_by_val( TYPE, CONVERT_IN ) %typemap(in) TYPE %{ CONVERT_IN($1,$1_ltype,$input); %} %typemap(in) const TYPE & ($*1_ltype temp) %{ CONVERT_IN(temp,$*1_ltype,$input); $1 = &temp; %} %typemap(directorout) TYPE %{ CONVERT_IN($result,$1_ltype,$input); %} %typemap(directorout) const TYPE & ($*1_ltype temp) %{ CONVERT_IN(temp,$*1_ltype,$input); $result = &temp; %} %enddef %fragment("t_output_helper","header") %{ static void t_output_helper( zval **target, zval *o) { if ( (*target)->type == IS_ARRAY ) { /* it's already an array, just append */ add_next_index_zval( *target, o ); return; } if ( (*target)->type == IS_NULL ) { REPLACE_ZVAL_VALUE(target,o,1); FREE_ZVAL(o); return; } zval *tmp; ALLOC_INIT_ZVAL(tmp); *tmp = **target; zval_copy_ctor(tmp); array_init(*target); add_next_index_zval( *target, tmp); add_next_index_zval( *target, o); } %} 0707010008e86f000081a40000000000000000000000014caec288000002c2000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/php/phpinit.swg /* ------------------------------------------------------------ * The start of the PHP initialization function * ------------------------------------------------------------ */ %insert(init) "swiginit.swg" %init %{ SWIG_php_minit { SWIG_InitializeModule(0); %} %fragment("swig_php_init_member_ptr2", "header") { #define SWIG_MEMBER_PTR ((char*)"CLASS::*") static void swig_member_ptr_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { efree(rsrc->ptr); } static int swig_member_ptr = 0; } %fragment("swig_php_init_member_ptr", "init", fragment="swig_php_init_member_ptr2") { swig_member_ptr = zend_register_list_destructors_ex(swig_member_ptr_dtor, NULL, SWIG_MEMBER_PTR, module_number); } 0707010008e877000081a40000000000000000000000014caec28800000990000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/php/std_string.i/* ----------------------------------------------------------------------------- * std_string.i * * SWIG typemaps for std::string types * ----------------------------------------------------------------------------- */ // ------------------------------------------------------------------------ // std::string is typemapped by value // This can prevent exporting methods which return a string // in order for the user to modify it. // However, I think I'll wait until someone asks for it... // ------------------------------------------------------------------------ %include %{ #include %} namespace std { %naturalvar string; class string; %typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) string, const string& %{ $1 = ( Z_TYPE_PP($input) == IS_STRING ) ? 1 : 0; %} %typemap(in) string %{ convert_to_string_ex($input); $1.assign(Z_STRVAL_PP($input), Z_STRLEN_PP($input)); %} %typemap(directorout) string %{ convert_to_string_ex($input); $result.assign(Z_STRVAL_PP($input), Z_STRLEN_PP($input)); %} %typemap(out) string %{ ZVAL_STRINGL($result, const_cast($1.data()), $1.size(), 1); %} %typemap(directorin) string, const string& %{ ZVAL_STRINGL($input, const_cast($1_name.data()), $1_name.size(), 1); %} %typemap(out) const string & %{ ZVAL_STRINGL($result, const_cast($1->data()), $1->size(), 1); %} %typemap(throws) string, const string& %{ zend_throw_exception(NULL, const_cast($1.c_str()), 0 TSRMLS_CC); return; %} /* These next two handle a function which takes a non-const reference to * a std::string and modifies the string. */ %typemap(in) string & (std::string temp) %{ convert_to_string_ex($input); temp.assign(Z_STRVAL_PP($input), Z_STRLEN_PP($input)); $1 = &temp; %} %typemap(directorout) string & (std::string *temp) %{ convert_to_string_ex($input); temp = new std::string(Z_STRVAL_PP($input), Z_STRLEN_PP($input)); swig_acquire_ownership(temp); $result = temp; %} %typemap(argout) string & %{ ZVAL_STRINGL(*($input), const_cast($1->data()), $1->size(), 1); %} /* SWIG will apply the non-const typemap above to const string& without * this more specific typemap. */ %typemap(argout) const string & ""; } 0707010008e874000081a40000000000000000000000014caec2880000001c000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/php/std_deque.i%include 0707010008e871000081a40000000000000000000000014caec288000005d3000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/php/phppointers.i%define %pass_by_ref( TYPE, CONVERT_IN, CONVERT_OUT ) %typemap(in) TYPE *REF ($*1_ltype tmp), TYPE &REF ($*1_ltype tmp) %{ /* First Check for SWIG wrapped type */ if ( ZVAL_IS_NULL( *$input ) ) { $1 = 0; } else if ( PZVAL_IS_REF( *$input ) ) { /* Not swig wrapped type, so we check if it's a PHP reference type */ CONVERT_IN( tmp, $*1_ltype, $input ); $1 = &tmp; } else { SWIG_PHP_Error( E_ERROR, SWIG_PHP_Arg_Error_Msg($argnum, Expected a reference) ); } %} %typemap(argout) TYPE *REF, TYPE &REF "CONVERT_OUT(*$input, tmp$argnum );"; %enddef %pass_by_ref( size_t, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( signed int, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( int, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( unsigned int, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( signed short, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( short, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( unsigned short, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( signed long, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( long, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( unsigned long, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( signed char, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( char, CONVERT_CHAR_IN, ZVAL_STRING ); %pass_by_ref( unsigned char, CONVERT_INT_IN, ZVAL_LONG ); %pass_by_ref( float, CONVERT_FLOAT_IN, ZVAL_DOUBLE ); %pass_by_ref( double, CONVERT_FLOAT_IN, ZVAL_DOUBLE ); %pass_by_ref( char *, CONVERT_CHAR_IN, ZVAL_STRING ); 0707010008e86a000081a40000000000000000000000014caec28800000690000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/php/const.i/* ----------------------------------------------------------------------------- * const.i * * Typemaps for constants * ----------------------------------------------------------------------------- */ %typemap(consttab) int, unsigned int, short, unsigned short, long, unsigned long, unsigned char, signed char, bool, enum SWIGTYPE "SWIG_LONG_CONSTANT($symname, $value);"; %typemap(consttab) float, double "SWIG_DOUBLE_CONSTANT($symname, $value);"; %typemap(consttab) char "SWIG_CHAR_CONSTANT($symname, $value);"; %typemap(consttab) char *, const char *, char [], const char [] "SWIG_STRING_CONSTANT($symname, $value);"; %typemap(consttab) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { /* This actually registers it as a global variable and constant. I don't * like it, but I can't figure out the zend_constant code... */ zval *z_var; MAKE_STD_ZVAL(z_var); SWIG_SetPointerZval(z_var, (void*)$value, $1_descriptor, 0); /* zend_hash_add(&EG(symbol_table), "$1", sizeof("$1"), (void *)&z_var,sizeof(zval *), NULL); */ zend_constant c; c.value = *z_var; zval_copy_ctor(&c.value); size_t len = sizeof("$1") - 1; c.name = zend_strndup("$1", len); c.name_len = len+1; c.flags = CONST_CS | CONST_PERSISTENT; c.module_number = module_number; zend_register_constant( &c TSRMLS_CC ); } /* Handled as a global variable. */ %typemap(consttab) SWIGTYPE (CLASS::*) ""; 0707010008e878000081a40000000000000000000000014caec28800000abb000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/php/std_vector.i/* ----------------------------------------------------------------------------- * std_vector.i * ----------------------------------------------------------------------------- */ %include %{ #include #include %} namespace std { template class vector { public: typedef size_t size_type; typedef T value_type; typedef const value_type& const_reference; vector(); vector(size_type n); size_type size() const; size_type capacity() const; void reserve(size_type n); void clear(); %rename(push) push_back; void push_back(const value_type& x); %extend { bool is_empty() const { return $self->empty(); } T pop() throw (std::out_of_range) { if (self->size() == 0) throw std::out_of_range("pop from empty vector"); T x = self->back(); self->pop_back(); return x; } const_reference get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i class vector { public: typedef size_t size_type; typedef bool value_type; typedef bool const_reference; vector(); vector(size_type n); size_type size() const; size_type capacity() const; void reserve(size_type n); void clear(); %rename(push) push_back; void push_back(const value_type& x); %extend { bool is_empty() const { return $self->empty(); } bool pop() throw (std::out_of_range) { if (self->size() == 0) throw std::out_of_range("pop from empty vector"); bool x = self->back(); self->pop_back(); return x; } const_reference get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i %include // ------------------------------------------------------------------------ // std::pair // ------------------------------------------------------------------------ %{ #include %} namespace std { template struct pair { pair(); pair(T first, U second); pair(const pair& p); template pair(const pair &p); T first; U second; }; // add specializations here } 0707010008e86b000081a40000000000000000000000014caec2880000103a000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/php/director.swg/* ----------------------------------------------------------------------------- * director.swg * * This file contains support for director classes that proxy * method calls from C++ to PHP extensions. * ----------------------------------------------------------------------------- */ #ifndef SWIG_DIRECTOR_PHP_HEADER_ #define SWIG_DIRECTOR_PHP_HEADER_ #ifdef __cplusplus #include #include /* Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the 'Swig' namespace. This could be useful for multi-modules projects. */ #ifdef SWIG_DIRECTOR_STATIC /* Force anonymous (static) namespace */ #define Swig #endif namespace Swig { /* memory handler */ struct GCItem { virtual ~GCItem() {} virtual int get_own() const { return 0; } }; struct GCItem_var { GCItem_var(GCItem *item = 0) : _item(item) { } GCItem_var& operator=(GCItem *item) { GCItem *tmp = _item; _item = item; delete tmp; return *this; } ~GCItem_var() { delete _item; } GCItem * operator->() const { return _item; } private: GCItem *_item; }; struct GCItem_Object : GCItem { GCItem_Object(int own) : _own(own) { } virtual ~GCItem_Object() { } int get_own() const { return _own; } private: int _own; }; template struct GCItem_T : GCItem { GCItem_T(Type *ptr) : _ptr(ptr) { } virtual ~GCItem_T() { delete _ptr; } private: Type *_ptr; }; class Director { protected: zval *swig_self; typedef std::map swig_ownership_map; mutable swig_ownership_map swig_owner; public: Director(zval* self) : swig_self(self) { } ~Director() { for (swig_ownership_map::iterator i = swig_owner.begin(); i != swig_owner.end(); i++) { swig_owner.erase(i); } } bool swig_is_overridden_method(char *cname, char *lc_fname) { zval classname; zend_class_entry **ce; zend_function *mptr; int name_len = strlen(lc_fname); ZVAL_STRING(&classname, cname, 0); if (zend_lookup_class(Z_STRVAL_P(&classname), Z_STRLEN_P(&classname), &ce TSRMLS_CC) != SUCCESS) { return false; } if (zend_hash_find(&(*ce)->function_table, lc_fname, name_len + 1, (void**) &mptr) != SUCCESS) { return false; } // common.scope points to the declaring class return strcmp(mptr->common.scope->name, cname); } template void swig_acquire_ownership(Type *vptr) const { if (vptr) { swig_owner[vptr] = new GCItem_T(vptr); } } }; /* base class for director exceptions */ class DirectorException { protected: std::string swig_msg; public: DirectorException(int code, const char *hdr, const char* msg) : swig_msg(hdr) { if (strlen(msg)) { swig_msg += " "; swig_msg += msg; } SWIG_ErrorCode() = code; SWIG_ErrorMsg() = swig_msg.c_str(); } static void raise(int code, const char *hdr, const char* msg) { throw DirectorException(code, hdr, msg); } }; /* attempt to call a pure virtual method via a director method */ class DirectorPureVirtualException : public Swig::DirectorException { public: DirectorPureVirtualException(const char* msg) : DirectorException(E_ERROR, "SWIG director pure virtual method called", msg) { } static void raise(const char *msg) { throw DirectorPureVirtualException(msg); } }; /* any php exception that occurs during a director method call */ class DirectorMethodException : public Swig::DirectorException { public: DirectorMethodException(const char* msg = "") : DirectorException(E_ERROR, "SWIG director method error", msg) { } static void raise(const char *msg) { throw DirectorMethodException(msg); } }; } #endif /* __cplusplus */ #endif 0707010008e86c000081a40000000000000000000000014caec28800000c25000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/php/factory.i/* Implement a more natural wrap for factory methods, for example, if you have: ---- geometry.h -------- struct Geometry { enum GeomType{ POINT, CIRCLE }; virtual ~Geometry() {} virtual int draw() = 0; // // Factory method for all the Geometry objects // static Geometry *create(GeomType i); }; struct Point : Geometry { int draw() { return 1; } double width() { return 1.0; } }; struct Circle : Geometry { int draw() { return 2; } double radius() { return 1.5; } }; // // Factory method for all the Geometry objects // Geometry *Geometry::create(GeomType type) { switch (type) { case POINT: return new Point(); case CIRCLE: return new Circle(); default: return 0; } } ---- geometry.h -------- You can use the %factory with the Geometry::create method as follows: %newobject Geometry::create; %factory(Geometry *Geometry::create, Point, Circle); %include "geometry.h" and Geometry::create will return a 'Point' or 'Circle' instance instead of the plain 'Geometry' type. For example, in python: circle = Geometry.create(Geometry.CIRCLE) r = circle.radius() where circle is a Circle proxy instance. NOTES: remember to fully qualify all the type names and don't use %factory inside a namespace declaration, ie, instead of namespace Foo { %factory(Geometry *Geometry::create, Point, Circle); } use %factory(Foo::Geometry *Foo::Geometry::create, Foo::Point, Foo::Circle); */ /* for loop for macro with one argument */ %define %_formacro_1(macro, arg1,...)macro(arg1) #if #__VA_ARGS__ != "__fordone__" %_formacro_1(macro, __VA_ARGS__) #endif %enddef /* for loop for macro with one argument */ %define %formacro_1(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef %define %formacro(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef /* for loop for macro with two arguments */ %define %_formacro_2(macro, arg1, arg2, ...)macro(arg1, arg2) #if #__VA_ARGS__ != "__fordone__" %_formacro_2(macro, __VA_ARGS__) #endif %enddef /* for loop for macro with two arguments */ %define %formacro_2(macro,...)%_formacro_2(macro, __VA_ARGS__, __fordone__)%enddef %define %_factory_dispatch(Type) if (!dcast) { Type *dobj = dynamic_cast($1); if (dobj) { dcast = 1; SWIG_SetPointerZval(return_value, SWIG_as_voidptr(dobj),$descriptor(Type *), $owner); } }%enddef %define %factory(Method,Types...) %typemap(out) Method { int dcast = 0; %formacro(%_factory_dispatch, Types) if (!dcast) { SWIG_SetPointerZval(return_value, SWIG_as_voidptr($1),$descriptor, $owner); } }%enddef 0707010008e875000081a40000000000000000000000014caec288000008d5000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/php/std_map.i/* ----------------------------------------------------------------------------- * std_map.i * * SWIG typemaps for std::map * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::map // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class map { // add typemaps here public: map(); map(const map &); unsigned int size() const; void clear(); %extend { const T& get(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { (*self)[key] = x; } void del(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(const K& key) { std::map::iterator i = self->find(key); return i != self->end(); } bool is_empty() const { return self->empty(); } } }; // Legacy macros (deprecated) %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) #warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" %enddef } 0707010008e771000081a40000000000000000000000014caec284000001ed000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/attribute.i/* ----------------------------------------------------------------------------- * attribute.i * * SWIG library file for implementing attributes. * ----------------------------------------------------------------------------- */ /* we use a simple exception warning here */ %{ #include %} #define %attribute_exception(code,msg) printf("%s\n",msg) #ifndef %arg #define %arg(x) x #endif #ifndef %mangle #define %mangle(Type...) #@Type #endif %include 0707010008e7ca000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002500000000root/usr/local/share/swig/2.0.1/java0707010008e7d2000081a40000000000000000000000014caec28700000aae000000b600010002ffffffffffffffff0000003800000000root/usr/local/share/swig/2.0.1/java/enumtypeunsafe.swg/* ----------------------------------------------------------------------------- * enumtypeunsafe.swg * * Include this file in order for C/C++ enums to be wrapped by integers values. * Each enum has an equivalent class named after the enum and the enum items are * wrapped by constant integers within this class. The enum items are not * typesafe as they are all integers. * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps %typemap(jni) const enum SWIGTYPE & "jint" %typemap(jtype) const enum SWIGTYPE & "int" %typemap(jstype) const enum SWIGTYPE & "int" %typemap(in) const enum SWIGTYPE & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1_name;" %typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" %typemap(javadirectorout) const enum SWIGTYPE & "$javacall" %typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" %typemap(throws) const enum SWIGTYPE & %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) const enum SWIGTYPE & "$javainput" %typemap(javaout) const enum SWIGTYPE & { return $jnicall; } // enum SWIGTYPE typemaps %typemap(jni) enum SWIGTYPE "jint" %typemap(jtype) enum SWIGTYPE "int" %typemap(jstype) enum SWIGTYPE "int" %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} %typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} %typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} %typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" %typemap(javadirectorin) enum SWIGTYPE "$jniinput" %typemap(javadirectorout) enum SWIGTYPE "$javacall" %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" %typemap(throws) enum SWIGTYPE %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) enum SWIGTYPE "$javainput" %typemap(javaout) enum SWIGTYPE { return $jnicall; } // '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not %typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" %typemap(javabase) enum SWIGTYPE "" %typemap(javacode) enum SWIGTYPE "" %typemap(javaimports) enum SWIGTYPE "" %typemap(javainterfaces) enum SWIGTYPE "" %typemap(javabody) enum SWIGTYPE "" %javaenum(typeunsafe); 0707010008e7dd000081a40000000000000000000000014caec28700000a54000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/java/std_vector.i/* ----------------------------------------------------------------------------- * std_vector.i * ----------------------------------------------------------------------------- */ %include %{ #include #include %} namespace std { template class vector { public: typedef size_t size_type; typedef T value_type; typedef const value_type& const_reference; vector(); vector(size_type n); size_type size() const; size_type capacity() const; void reserve(size_type n); %rename(isEmpty) empty; bool empty() const; void clear(); %rename(add) push_back; void push_back(const value_type& x); %extend { const_reference get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i class vector { public: typedef size_t size_type; typedef bool value_type; typedef bool const_reference; vector(); vector(size_type n); size_type size() const; size_type capacity() const; void reserve(size_type n); %rename(isEmpty) empty; bool empty() const; void clear(); %rename(add) push_back; void push_back(const value_type& x); %extend { const_reference get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && ifunc() # define JCALL1(func, jenv, ar1) jenv->func(ar1) # define JCALL2(func, jenv, ar1, ar2) jenv->func(ar1, ar2) # define JCALL3(func, jenv, ar1, ar2, ar3) jenv->func(ar1, ar2, ar3) # define JCALL4(func, jenv, ar1, ar2, ar3, ar4) jenv->func(ar1, ar2, ar3, ar4) # define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) jenv->func(ar1, ar2, ar3, ar4, ar5) # define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6) # define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) jenv->func(ar1, ar2, ar3, ar4, ar5, ar6, ar7) #else # define JCALL0(func, jenv) (*jenv)->func(jenv) # define JCALL1(func, jenv, ar1) (*jenv)->func(jenv, ar1) # define JCALL2(func, jenv, ar1, ar2) (*jenv)->func(jenv, ar1, ar2) # define JCALL3(func, jenv, ar1, ar2, ar3) (*jenv)->func(jenv, ar1, ar2, ar3) # define JCALL4(func, jenv, ar1, ar2, ar3, ar4) (*jenv)->func(jenv, ar1, ar2, ar3, ar4) # define JCALL5(func, jenv, ar1, ar2, ar3, ar4, ar5) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5) # define JCALL6(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6) # define JCALL7(func, jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) (*jenv)->func(jenv, ar1, ar2, ar3, ar4, ar5, ar6, ar7) #endif %insert(runtime) %{ /* Fix for jlong on some versions of gcc on Windows */ #if defined(__GNUC__) && !defined(__INTEL_COMPILER) typedef long long __int64; #endif /* Fix for jlong on 64-bit x86 Solaris */ #if defined(__x86_64) # ifdef _LP64 # undef _LP64 # endif #endif #include #include #include %} %insert(runtime) %{ /* Support for throwing Java exceptions */ typedef enum { SWIG_JavaOutOfMemoryError = 1, SWIG_JavaIOException, SWIG_JavaRuntimeException, SWIG_JavaIndexOutOfBoundsException, SWIG_JavaArithmeticException, SWIG_JavaIllegalArgumentException, SWIG_JavaNullPointerException, SWIG_JavaDirectorPureVirtual, SWIG_JavaUnknownError } SWIG_JavaExceptionCodes; typedef struct { SWIG_JavaExceptionCodes code; const char *java_exception; } SWIG_JavaExceptions_t; %} %insert(runtime) { static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { jclass excep; static const SWIG_JavaExceptions_t java_exceptions[] = { { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, { SWIG_JavaIOException, "java/io/IOException" }, { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, { SWIG_JavaUnknownError, "java/lang/UnknownError" }, { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } }; const SWIG_JavaExceptions_t *except_ptr = java_exceptions; while (except_ptr->code != code && except_ptr->code) except_ptr++; JCALL0(ExceptionClear, jenv); excep = JCALL1(FindClass, jenv, except_ptr->java_exception); if (excep) JCALL2(ThrowNew, jenv, excep, msg); } } %insert(runtime) %{ /* Contract support */ #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else %} 0707010008e7d7000081a40000000000000000000000014caec2870000001c000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/java/std_deque.i%include 0707010008e7d0000081a40000000000000000000000014caec28700000a1a000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/java/enumsimple.swg/* ----------------------------------------------------------------------------- * enumsimple.swg * * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 * and earlier wrapped global enums with constant integers in the module class * or Constants interface. Enums declared within a C++ class were wrapped by * constant integers in the Java proxy class. * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps %typemap(jni) const enum SWIGTYPE & "jint" %typemap(jtype) const enum SWIGTYPE & "int" %typemap(jstype) const enum SWIGTYPE & "int" %typemap(in) const enum SWIGTYPE & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1_name;" %typemap(javadirectorin) const enum SWIGTYPE & "$jniinput" %typemap(javadirectorout) const enum SWIGTYPE & "$javacall" %typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" %typemap(throws) const enum SWIGTYPE & %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) const enum SWIGTYPE & "$javainput" %typemap(javaout) const enum SWIGTYPE & { return $jnicall; } // enum SWIGTYPE typemaps %typemap(jni) enum SWIGTYPE "jint" %typemap(jtype) enum SWIGTYPE "int" %typemap(jstype) enum SWIGTYPE "int" %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} %typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} %typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} %typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;" %typemap(javadirectorin) enum SWIGTYPE "$jniinput" %typemap(javadirectorout) enum SWIGTYPE "$javacall" %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" %typemap(throws) enum SWIGTYPE %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) enum SWIGTYPE "$javainput" %typemap(javaout) enum SWIGTYPE { return $jnicall; } %typemap(javaclassmodifiers) enum SWIGTYPE "" %typemap(javabase) enum SWIGTYPE "" %typemap(javacode) enum SWIGTYPE "" %typemap(javaimports) enum SWIGTYPE "" %typemap(javainterfaces) enum SWIGTYPE "" %typemap(javabody) enum SWIGTYPE "" %javaenum(simple); 0707010008e7db000081a40000000000000000000000014caec28700000044000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/java/std_shared_ptr.i#define SWIG_SHARED_PTR_NAMESPACE std %include 0707010008e7d3000081a40000000000000000000000014caec2870000b127000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/java/java.swg/* ----------------------------------------------------------------------------- * java.swg * * Java typemaps * ----------------------------------------------------------------------------- */ %include /* The jni, jtype and jstype typemaps work together and so there should be one of each. * The jni typemap contains the JNI type used in the JNI (C/C++) code. * The jtype typemap contains the Java type used in the JNI intermediary class. * The jstype typemap contains the Java type used in the Java proxy classes, type wrapper classes and module class. */ /* Fragments */ %fragment("SWIG_PackData", "header") { /* Pack binary data into a string */ SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; register const unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } } %fragment("SWIG_UnPackData", "header") { /* Unpack binary data from a string */ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { register unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register char d = *(c++); register unsigned char uu; if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; } return c; } } /* Primitive types */ %typemap(jni) bool, const bool & "jboolean" %typemap(jni) char, const char & "jchar" %typemap(jni) signed char, const signed char & "jbyte" %typemap(jni) unsigned char, const unsigned char & "jshort" %typemap(jni) short, const short & "jshort" %typemap(jni) unsigned short, const unsigned short & "jint" %typemap(jni) int, const int & "jint" %typemap(jni) unsigned int, const unsigned int & "jlong" %typemap(jni) long, const long & "jint" %typemap(jni) unsigned long, const unsigned long & "jlong" %typemap(jni) long long, const long long & "jlong" %typemap(jni) unsigned long long, const unsigned long long & "jobject" %typemap(jni) float, const float & "jfloat" %typemap(jni) double, const double & "jdouble" %typemap(jni) void "void" %typemap(jtype) bool, const bool & "boolean" %typemap(jtype) char, const char & "char" %typemap(jtype) signed char, const signed char & "byte" %typemap(jtype) unsigned char, const unsigned char & "short" %typemap(jtype) short, const short & "short" %typemap(jtype) unsigned short, const unsigned short & "int" %typemap(jtype) int, const int & "int" %typemap(jtype) unsigned int, const unsigned int & "long" %typemap(jtype) long, const long & "int" %typemap(jtype) unsigned long, const unsigned long & "long" %typemap(jtype) long long, const long long & "long" %typemap(jtype) unsigned long long, const unsigned long long & "java.math.BigInteger" %typemap(jtype) float, const float & "float" %typemap(jtype) double, const double & "double" %typemap(jtype) void "void" %typemap(jstype) bool, const bool & "boolean" %typemap(jstype) char, const char & "char" %typemap(jstype) signed char, const signed char & "byte" %typemap(jstype) unsigned char, const unsigned char & "short" %typemap(jstype) short, const short & "short" %typemap(jstype) unsigned short, const unsigned short & "int" %typemap(jstype) int, const int & "int" %typemap(jstype) unsigned int, const unsigned int & "long" %typemap(jstype) long, const long & "int" %typemap(jstype) unsigned long, const unsigned long & "long" %typemap(jstype) long long, const long long & "long" %typemap(jstype) unsigned long long, const unsigned long long & "java.math.BigInteger" %typemap(jstype) float, const float & "float" %typemap(jstype) double, const double & "double" %typemap(jstype) void "void" %typemap(jni) char *, char *&, char[ANY], char[] "jstring" %typemap(jtype) char *, char *&, char[ANY], char[] "String" %typemap(jstype) char *, char *&, char[ANY], char[] "String" /* JNI types */ %typemap(jni) jboolean "jboolean" %typemap(jni) jchar "jchar" %typemap(jni) jbyte "jbyte" %typemap(jni) jshort "jshort" %typemap(jni) jint "jint" %typemap(jni) jlong "jlong" %typemap(jni) jfloat "jfloat" %typemap(jni) jdouble "jdouble" %typemap(jni) jstring "jstring" %typemap(jni) jobject "jobject" %typemap(jni) jbooleanArray "jbooleanArray" %typemap(jni) jcharArray "jcharArray" %typemap(jni) jbyteArray "jbyteArray" %typemap(jni) jshortArray "jshortArray" %typemap(jni) jintArray "jintArray" %typemap(jni) jlongArray "jlongArray" %typemap(jni) jfloatArray "jfloatArray" %typemap(jni) jdoubleArray "jdoubleArray" %typemap(jni) jobjectArray "jobjectArray" %typemap(jtype) jboolean "boolean" %typemap(jtype) jchar "char" %typemap(jtype) jbyte "byte" %typemap(jtype) jshort "short" %typemap(jtype) jint "int" %typemap(jtype) jlong "long" %typemap(jtype) jfloat "float" %typemap(jtype) jdouble "double" %typemap(jtype) jstring "String" %typemap(jtype) jobject "Object" %typemap(jtype) jbooleanArray "boolean[]" %typemap(jtype) jcharArray "char[]" %typemap(jtype) jbyteArray "byte[]" %typemap(jtype) jshortArray "short[]" %typemap(jtype) jintArray "int[]" %typemap(jtype) jlongArray "long[]" %typemap(jtype) jfloatArray "float[]" %typemap(jtype) jdoubleArray "double[]" %typemap(jtype) jobjectArray "Object[]" %typemap(jstype) jboolean "boolean" %typemap(jstype) jchar "char" %typemap(jstype) jbyte "byte" %typemap(jstype) jshort "short" %typemap(jstype) jint "int" %typemap(jstype) jlong "long" %typemap(jstype) jfloat "float" %typemap(jstype) jdouble "double" %typemap(jstype) jstring "String" %typemap(jstype) jobject "Object" %typemap(jstype) jbooleanArray "boolean[]" %typemap(jstype) jcharArray "char[]" %typemap(jstype) jbyteArray "byte[]" %typemap(jstype) jshortArray "short[]" %typemap(jstype) jintArray "int[]" %typemap(jstype) jlongArray "long[]" %typemap(jstype) jfloatArray "float[]" %typemap(jstype) jdoubleArray "double[]" %typemap(jstype) jobjectArray "Object[]" /* Non primitive types */ %typemap(jni) SWIGTYPE "jlong" %typemap(jtype) SWIGTYPE "long" %typemap(jstype) SWIGTYPE "$&javaclassname" %typemap(jni) SWIGTYPE [] "jlong" %typemap(jtype) SWIGTYPE [] "long" %typemap(jstype) SWIGTYPE [] "$javaclassname" %typemap(jni) SWIGTYPE * "jlong" %typemap(jtype) SWIGTYPE * "long" %typemap(jstype) SWIGTYPE * "$javaclassname" %typemap(jni) SWIGTYPE & "jlong" %typemap(jtype) SWIGTYPE & "long" %typemap(jstype) SWIGTYPE & "$javaclassname" /* pointer to a class member */ %typemap(jni) SWIGTYPE (CLASS::*) "jstring" %typemap(jtype) SWIGTYPE (CLASS::*) "String" %typemap(jstype) SWIGTYPE (CLASS::*) "$javaclassname" /* The following are the in, out, freearg, argout typemaps. These are the JNI code generating typemaps for converting from Java to C and visa versa. */ /* primitive types */ %typemap(in) bool %{ $1 = $input ? true : false; %} %typemap(directorout) bool %{ $result = $input ? true : false; %} %typemap(javadirectorin) bool "$jniinput" %typemap(javadirectorout) bool "$javacall" %typemap(in) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, float, double %{ $1 = ($1_ltype)$input; %} %typemap(directorout) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, float, double %{ $result = ($1_ltype)$input; %} %typemap(directorin, descriptor="Z") bool "$input = (jboolean) $1;" %typemap(directorin, descriptor="C") char "$input = (jint) $1;" %typemap(directorin, descriptor="B") signed char "$input = (jbyte) $1;" %typemap(directorin, descriptor="S") unsigned char "$input = (jshort) $1;" %typemap(directorin, descriptor="S") short "$input = (jshort) $1;" %typemap(directorin, descriptor="I") unsigned short "$input = (jint) $1;" %typemap(directorin, descriptor="I") int "$input = (jint) $1;" %typemap(directorin, descriptor="J") unsigned int "$input = (jlong) $1;" %typemap(directorin, descriptor="I") long "$input = (jint) $1;" %typemap(directorin, descriptor="J") unsigned long "$input = (jlong) $1;" %typemap(directorin, descriptor="J") long long "$input = (jlong) $1;" %typemap(directorin, descriptor="F") float "$input = (jfloat) $1;" %typemap(directorin, descriptor="D") double "$input = (jdouble) $1;" %typemap(javadirectorin) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, float, double "$jniinput" %typemap(javadirectorout) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, float, double "$javacall" %typemap(out) bool %{ $result = (jboolean)$1; %} %typemap(out) char %{ $result = (jchar)$1; %} %typemap(out) signed char %{ $result = (jbyte)$1; %} %typemap(out) unsigned char %{ $result = (jshort)$1; %} %typemap(out) short %{ $result = (jshort)$1; %} %typemap(out) unsigned short %{ $result = (jint)$1; %} %typemap(out) int %{ $result = (jint)$1; %} %typemap(out) unsigned int %{ $result = (jlong)$1; %} %typemap(out) long %{ $result = (jint)$1; %} %typemap(out) unsigned long %{ $result = (jlong)$1; %} %typemap(out) long long %{ $result = (jlong)$1; %} %typemap(out) float %{ $result = (jfloat)$1; %} %typemap(out) double %{ $result = (jdouble)$1; %} /* unsigned long long */ /* Convert from BigInteger using the toByteArray member function */ %typemap(in) unsigned long long { jclass clazz; jmethodID mid; jbyteArray ba; jbyte* bae; jsize sz; int i; if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); return $null; } clazz = JCALL1(GetObjectClass, jenv, $input); mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); bae = JCALL2(GetByteArrayElements, jenv, ba, 0); sz = JCALL1(GetArrayLength, jenv, ba); $1 = 0; for(i=0; i", "([B)V"); jobject bigint; int i; bae[0] = 0; for(i=1; i<9; i++ ) { bae[i] = (jbyte)($1>>8*(8-i)); } JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); bigint = JCALL3(NewObject, jenv, clazz, mid, ba); $result = bigint; } /* Convert to BigInteger (see out typemap) */ %typemap(directorin, descriptor="Ljava/math/BigInteger;") unsigned long long, const unsigned long long & { jbyteArray ba = JCALL1(NewByteArray, jenv, 9); jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0); jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger"); jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); jobject bigint; int swig_i; bae[0] = 0; for(swig_i=1; swig_i<9; swig_i++ ) { bae[swig_i] = (jbyte)($1>>8*(8-swig_i)); } JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); bigint = JCALL3(NewObject, jenv, clazz, mid, ba); $input = bigint; } %typemap(javadirectorin) unsigned long long "$jniinput" %typemap(javadirectorout) unsigned long long "$javacall" /* char * - treat as String */ %typemap(in, noblock=1) char * { $1 = 0; if ($input) { $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); if (!$1) return $null; } } %typemap(directorout, noblock=1, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * { $1 = 0; if ($input) { $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); if (!$result) return $null; } } %typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char * { $input = 0; if ($1) { $input = JCALL1(NewStringUTF, jenv, (const char *)$1); if (!$input) return $null; } } %typemap(freearg, noblock=1) char * { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } %typemap(out, noblock=1) char * { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } %typemap(javadirectorin) char * "$jniinput" %typemap(javadirectorout) char * "$javacall" /* char *& - treat as String */ %typemap(in, noblock=1) char *& ($*1_ltype temp = 0) { $1 = 0; if ($input) { temp = ($*1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); if (!temp) return $null; } $1 = &temp; } %typemap(freearg, noblock=1) char *& { if ($1 && *$1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)*$1); } %typemap(out, noblock=1) char *& { if (*$1) $result = JCALL1(NewStringUTF, jenv, (const char *)*$1); } %typemap(out) void "" %typemap(javadirectorin) void "$jniinput" %typemap(javadirectorout) void "$javacall" %typemap(directorin, descriptor="V") void "" /* primitive types by reference */ %typemap(in) const bool & ($*1_ltype temp) %{ temp = $input ? true : false; $1 = &temp; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & %{ static $*1_ltype temp; temp = $input ? true : false; $result = &temp; %} %typemap(javadirectorin) const bool & "$jniinput" %typemap(javadirectorout) const bool & "$javacall" %typemap(in) const char & ($*1_ltype temp), const signed char & ($*1_ltype temp), const unsigned char & ($*1_ltype temp), const short & ($*1_ltype temp), const unsigned short & ($*1_ltype temp), const int & ($*1_ltype temp), const unsigned int & ($*1_ltype temp), const long & ($*1_ltype temp), const unsigned long & ($*1_ltype temp), const long long & ($*1_ltype temp), const float & ($*1_ltype temp), const double & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, const signed char &, const unsigned char &, const short &, const unsigned short &, const int &, const unsigned int &, const long &, const unsigned long &, const long long &, const float &, const double & %{ static $*1_ltype temp; temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin, descriptor="Z") const bool & "$input = (jboolean)$1_name;" %typemap(directorin, descriptor="C") const char & "$input = (jchar)$1_name;" %typemap(directorin, descriptor="B") const signed char & "$input = (jbyte)$1_name;" %typemap(directorin, descriptor="S") const unsigned char & "$input = (jshort)$1_name;" %typemap(directorin, descriptor="S") const short & "$input = (jshort)$1_name;" %typemap(directorin, descriptor="I") const unsigned short & "$input = (jint)$1_name;" %typemap(directorin, descriptor="I") const int & "$input = (jint)$1_name;" %typemap(directorin, descriptor="J") const unsigned int & "$input = (jlong)$1_name;" %typemap(directorin, descriptor="I") const long & "$input = (jint)$1_name;" %typemap(directorin, descriptor="J") const unsigned long & "$input = (jlong)$1_name;" %typemap(directorin, descriptor="J") const long long & "$input = (jlong)$1_name;" %typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1_name;" %typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1_name;" %typemap(javadirectorin) const char & ($*1_ltype temp), const signed char & ($*1_ltype temp), const unsigned char & ($*1_ltype temp), const short & ($*1_ltype temp), const unsigned short & ($*1_ltype temp), const int & ($*1_ltype temp), const unsigned int & ($*1_ltype temp), const long & ($*1_ltype temp), const unsigned long & ($*1_ltype temp), const long long & ($*1_ltype temp), const float & ($*1_ltype temp), const double & ($*1_ltype temp) "$jniinput" %typemap(javadirectorout) const char & ($*1_ltype temp), const signed char & ($*1_ltype temp), const unsigned char & ($*1_ltype temp), const short & ($*1_ltype temp), const unsigned short & ($*1_ltype temp), const int & ($*1_ltype temp), const unsigned int & ($*1_ltype temp), const long & ($*1_ltype temp), const unsigned long & ($*1_ltype temp), const long long & ($*1_ltype temp), const float & ($*1_ltype temp), const double & ($*1_ltype temp) "$javacall" %typemap(out) const bool & %{ $result = (jboolean)*$1; %} %typemap(out) const char & %{ $result = (jchar)*$1; %} %typemap(out) const signed char & %{ $result = (jbyte)*$1; %} %typemap(out) const unsigned char & %{ $result = (jshort)*$1; %} %typemap(out) const short & %{ $result = (jshort)*$1; %} %typemap(out) const unsigned short & %{ $result = (jint)*$1; %} %typemap(out) const int & %{ $result = (jint)*$1; %} %typemap(out) const unsigned int & %{ $result = (jlong)*$1; %} %typemap(out) const long & %{ $result = (jint)*$1; %} %typemap(out) const unsigned long & %{ $result = (jlong)*$1; %} %typemap(out) const long long & %{ $result = (jlong)*$1; %} %typemap(out) const float & %{ $result = (jfloat)*$1; %} %typemap(out) const double & %{ $result = (jdouble)*$1; %} /* const unsigned long long & */ /* Similar to unsigned long long */ %typemap(in) const unsigned long long & ($*1_ltype temp) { jclass clazz; jmethodID mid; jbyteArray ba; jbyte* bae; jsize sz; int i; if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); return $null; } clazz = JCALL1(GetObjectClass, jenv, $input); mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); bae = JCALL2(GetByteArrayElements, jenv, ba, 0); sz = JCALL1(GetArrayLength, jenv, ba); $1 = &temp; temp = 0; for(i=0; i", "([B)V"); jobject bigint; int i; bae[0] = 0; for(i=1; i<9; i++ ) { bae[i] = (jbyte)(*$1>>8*(8-i)); } JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); bigint = JCALL3(NewObject, jenv, clazz, mid, ba); $result = bigint; } %typemap(javadirectorin) const unsigned long long & "$jniinput" %typemap(javadirectorout) const unsigned long long & "$javacall" /* Default handling. Object passed by value. Convert to a pointer */ %typemap(in) SWIGTYPE ($&1_type argp) %{ argp = *($&1_ltype*)&$input; if (!argp) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); return $null; } $1 = *argp; %} %typemap(directorout) SWIGTYPE ($&1_type argp) %{ argp = *($&1_ltype*)&$input; if (!argp) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); return $null; } $result = *argp; %} %typemap(out) SWIGTYPE #ifdef __cplusplus %{ *($&1_ltype*)&$result = new $1_ltype((const $1_ltype &)$1); %} #else { $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); memmove($1ptr, &$1, sizeof($1_type)); *($&1_ltype*)&$result = $1ptr; } #endif %typemap(directorin,descriptor="L$packagepath/$&javaclassname;") SWIGTYPE %{ $input = 0; *(($&1_ltype*)&$input) = &$1; %} %typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, false)" %typemap(javadirectorout) SWIGTYPE "$&javaclassname.getCPtr($javacall)" /* Generic pointers and references */ %typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %} %typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) { const char *temp = 0; if ($input) { temp = JCALL2(GetStringUTFChars, jenv, $input, 0); if (!temp) return $null; } SWIG_UnpackData(temp, (void *)&$1, sizeof($1)); } %typemap(in) SWIGTYPE & %{ $1 = *($&1_ltype)&$input; if (!$1) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); return $null; } %} %typemap(out) SWIGTYPE * %{ *($&1_ltype)&$result = $1; %} %typemap(out, fragment="SWIG_PackData", noblock=1) SWIGTYPE (CLASS::*) { char buf[128]; char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); *data = '\0'; $result = JCALL1(NewStringUTF, jenv, buf); } %typemap(out) SWIGTYPE & %{ *($&1_ltype)&$result = $1; %} %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * %{ $result = *($&1_ltype)&$input; %} %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) %{ $result = *($&1_ltype)&$input; %} %typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE * %{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} %typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE (CLASS::*) %{ *(($&1_ltype)&$input) = ($1_ltype) $1; %} %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & %{ if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); return $null; } $result = *($&1_ltype)&$input; %} %typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE & %{ *($&1_ltype)&$input = ($1_ltype) &$1; %} %typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($jniinput == 0) ? null : new $javaclassname($jniinput, false)" %typemap(javadirectorin) SWIGTYPE & "new $javaclassname($jniinput, false)" %typemap(javadirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE & "$javaclassname.getCPtr($javacall)" /* Default array handling */ %typemap(in) SWIGTYPE [] %{ $1 = *($&1_ltype)&$input; %} %typemap(out) SWIGTYPE [] %{ *($&1_ltype)&$result = $1; %} %typemap(freearg) SWIGTYPE [ANY], SWIGTYPE [] "" /* char arrays - treat as String */ %typemap(in, noblock=1) char[ANY], char[] { $1 = 0; if ($input) { $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); if (!$1) return $null; } } %typemap(directorout, noblock=1) char[ANY], char[] { $1 = 0; if ($input) { $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0); if (!$result) return $null; } } %typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char[ANY], char[] { $input = 0; if ($1) { $input = JCALL1(NewStringUTF, jenv, (const char *)$1); if (!$input) return $null; } } %typemap(argout) char[ANY], char[] "" %typemap(freearg, noblock=1) char[ANY], char[] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); } %typemap(out, noblock=1) char[ANY], char[] { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); } %typemap(javadirectorin) char[ANY], char[] "$jniinput" %typemap(javadirectorout) char[ANY], char[] "$javacall" /* JNI types */ %typemap(in) jboolean, jchar, jbyte, jshort, jint, jlong, jfloat, jdouble, jstring, jobject, jbooleanArray, jcharArray, jbyteArray, jshortArray, jintArray, jlongArray, jfloatArray, jdoubleArray, jobjectArray %{ $1 = $input; %} %typemap(directorout) jboolean, jchar, jbyte, jshort, jint, jlong, jfloat, jdouble, jstring, jobject, jbooleanArray, jcharArray, jbyteArray, jshortArray, jintArray, jlongArray, jfloatArray, jdoubleArray, jobjectArray %{ $result = $input; %} %typemap(out) jboolean, jchar, jbyte, jshort, jint, jlong, jfloat, jdouble, jstring, jobject, jbooleanArray, jcharArray, jbyteArray, jshortArray, jintArray, jlongArray, jfloatArray, jdoubleArray, jobjectArray %{ $result = $1; %} %typemap(directorin,descriptor="Z") jboolean "$input = $1;" %typemap(directorin,descriptor="C") jchar "$input = $1;" %typemap(directorin,descriptor="B") jbyte "$input = $1;" %typemap(directorin,descriptor="S") jshort "$input = $1;" %typemap(directorin,descriptor="I") jint "$input = $1;" %typemap(directorin,descriptor="J") jlong "$input = $1;" %typemap(directorin,descriptor="F") jfloat "$input = $1;" %typemap(directorin,descriptor="D") jdouble "$input = $1;" %typemap(directorin,descriptor="Ljava/lang/String;") jstring "$input = $1;" %typemap(directorin,descriptor="Ljava/lang/Object;",nouse="1") jobject "$input = $1;" %typemap(directorin,descriptor="[Z") jbooleanArray "$input = $1;" %typemap(directorin,descriptor="[C") jcharArray "$input = $1;" %typemap(directorin,descriptor="[B") jbyteArray "$input = $1;" %typemap(directorin,descriptor="[S") jshortArray "$input = $1;" %typemap(directorin,descriptor="[I") jintArray "$input = $1;" %typemap(directorin,descriptor="[J") jlongArray "$input = $1;" %typemap(directorin,descriptor="[F") jfloatArray "$input = $1;" %typemap(directorin,descriptor="[D") jdoubleArray "$input = $1;" %typemap(directorin,descriptor="[Ljava/lang/Object;",nouse="1") jobjectArray "$input = $1;" %typemap(javadirectorin) jboolean, jchar, jbyte, jshort, jint, jlong, jfloat, jdouble, jstring, jobject, jbooleanArray, jcharArray, jbyteArray, jshortArray, jintArray, jlongArray, jfloatArray, jdoubleArray, jobjectArray "$jniinput" %typemap(javadirectorout) jboolean, jchar, jbyte, jshort, jint, jlong, jfloat, jdouble, jstring, jobject, jbooleanArray, jcharArray, jbyteArray, jshortArray, jintArray, jlongArray, jfloatArray, jdoubleArray, jobjectArray "$javacall" /* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions * that cannot be overloaded in Java as more than one C++ type maps to a single Java type */ %typecheck(SWIG_TYPECHECK_BOOL) /* Java boolean */ jboolean, bool, const bool & "" %typecheck(SWIG_TYPECHECK_CHAR) /* Java char */ jchar, char, const char & "" %typecheck(SWIG_TYPECHECK_INT8) /* Java byte */ jbyte, signed char, const signed char & "" %typecheck(SWIG_TYPECHECK_INT16) /* Java short */ jshort, unsigned char, short, const unsigned char &, const short & "" %typecheck(SWIG_TYPECHECK_INT32) /* Java int */ jint, unsigned short, int, long, const unsigned short &, const int &, const long & "" %typecheck(SWIG_TYPECHECK_INT64) /* Java long */ jlong, unsigned int, unsigned long, long long, const unsigned int &, const unsigned long &, const long long & "" %typecheck(SWIG_TYPECHECK_INT128) /* Java BigInteger */ unsigned long long, const unsigned long long & "" %typecheck(SWIG_TYPECHECK_FLOAT) /* Java float */ jfloat, float, const float & "" %typecheck(SWIG_TYPECHECK_DOUBLE) /* Java double */ jdouble, double, const double & "" %typecheck(SWIG_TYPECHECK_STRING) /* Java String */ jstring, char *, char *&, char[ANY], char [] "" %typecheck(SWIG_TYPECHECK_BOOL_ARRAY) /* Java boolean[] */ jbooleanArray "" %typecheck(SWIG_TYPECHECK_CHAR_ARRAY) /* Java char[] */ jcharArray "" %typecheck(SWIG_TYPECHECK_INT8_ARRAY) /* Java byte[] */ jbyteArray "" %typecheck(SWIG_TYPECHECK_INT16_ARRAY) /* Java short[] */ jshortArray "" %typecheck(SWIG_TYPECHECK_INT32_ARRAY) /* Java int[] */ jintArray "" %typecheck(SWIG_TYPECHECK_INT64_ARRAY) /* Java long[] */ jlongArray "" %typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) /* Java float[] */ jfloatArray "" %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) /* Java double[] */ jdoubleArray "" %typecheck(SWIG_TYPECHECK_OBJECT_ARRAY) /* Java jobject[] */ jobjectArray "" %typecheck(SWIG_TYPECHECK_POINTER) /* Default */ SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE *const&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" /* Exception handling */ %typemap(throws) int, long, short, unsigned int, unsigned long, unsigned short %{ char error_msg[256]; sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg); return $null; %} %typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY] %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); return $null; %} %typemap(throws) char * %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1); return $null; %} /* Typemaps for code generation in proxy classes and Java type wrapper classes */ /* The javain typemap is used for converting function parameter types from the type * used in the proxy, module or type wrapper class to the type used in the JNI class. */ %typemap(javain) bool, const bool &, char, const char &, signed char, const signed char &, unsigned char, const unsigned char &, short, const short &, unsigned short, const unsigned short &, int, const int &, unsigned int, const unsigned int &, long, const long &, unsigned long, const unsigned long &, long long, const long long &, unsigned long long, const unsigned long long &, float, const float &, double, const double & "$javainput" %typemap(javain) char *, char *&, char[ANY], char[] "$javainput" %typemap(javain) jboolean, jchar, jbyte, jshort, jint, jlong, jfloat, jdouble, jstring, jobject, jbooleanArray, jcharArray, jbyteArray, jshortArray, jintArray, jlongArray, jfloatArray, jdoubleArray, jobjectArray "$javainput" %typemap(javain) SWIGTYPE "$&javaclassname.getCPtr($javainput)" %typemap(javain) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$javaclassname.getCPtr($javainput)" %typemap(javain) SWIGTYPE (CLASS::*) "$javaclassname.getCMemberPtr($javainput)" /* The javaout typemap is used for converting function return types from the return type * used in the JNI class to the type returned by the proxy, module or type wrapper class. */ %typemap(javaout) bool, const bool &, char, const char &, signed char, const signed char &, unsigned char, const unsigned char &, short, const short &, unsigned short, const unsigned short &, int, const int &, unsigned int, const unsigned int &, long, const long &, unsigned long, const unsigned long &, long long, const long long &, unsigned long long, const unsigned long long &, float, const float &, double, const double & { return $jnicall; } %typemap(javaout) char *, char *&, char[ANY], char[] { return $jnicall; } %typemap(javaout) jboolean, jchar, jbyte, jshort, jint, jlong, jfloat, jdouble, jstring, jobject, jbooleanArray, jcharArray, jbyteArray, jshortArray, jintArray, jlongArray, jfloatArray, jdoubleArray, jobjectArray { return $jnicall; } %typemap(javaout) void { $jnicall; } %typemap(javaout) SWIGTYPE { return new $&javaclassname($jnicall, true); } %typemap(javaout) SWIGTYPE & { return new $javaclassname($jnicall, $owner); } %typemap(javaout) SWIGTYPE *, SWIGTYPE [] { long cPtr = $jnicall; return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner); } %typemap(javaout) SWIGTYPE (CLASS::*) { String cMemberPtr = $jnicall; return (cMemberPtr == null) ? null : new $javaclassname(cMemberPtr, $owner); } /* Pointer reference typemaps */ %typemap(jni) SWIGTYPE *const& "jlong" %typemap(jtype) SWIGTYPE *const& "long" %typemap(jstype) SWIGTYPE *const& "$*javaclassname" %typemap(javain) SWIGTYPE *const& "$*javaclassname.getCPtr($javainput)" %typemap(javaout) SWIGTYPE *const& { long cPtr = $jnicall; return (cPtr == 0) ? null : new $*javaclassname(cPtr, $owner); } %typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) %{ temp = *($1_ltype)&$input; $1 = ($1_ltype)&temp; %} %typemap(out) SWIGTYPE *const& %{ *($1_ltype)&$result = *$1; %} /* Typemaps used for the generation of proxy and type wrapper class code */ %typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" %typemap(javaclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" %typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" %typemap(javaimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" %typemap(javainterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" /* javabody typemaps */ %define SWIG_JAVABODY_METHODS(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPENAME...) // Base proxy classes %typemap(javabody) TYPENAME %{ private long swigCPtr; protected boolean swigCMemOwn; PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } CPTR_VISIBILITY static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} // Derived proxy classes %typemap(javabody_derived) TYPENAME %{ private long swigCPtr; PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) { super($imclassname.$javaclazznameSWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } CPTR_VISIBILITY static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} %enddef /* Set the default for SWIGTYPE: pointer constructor is protected, getCPtr is protected. Season to your own taste! */ SWIG_JAVABODY_METHODS(public, public, SWIGTYPE) // Typewrapper classes %typemap(javabody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] %{ private long swigCPtr; protected $javaclassname(long cPtr, boolean futureUse) { swigCPtr = cPtr; } protected $javaclassname() { swigCPtr = 0; } protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} %typemap(javabody) SWIGTYPE (CLASS::*) %{ private String swigCMemberPtr; protected $javaclassname(String cMemberPtr, boolean futureUse) { swigCMemberPtr = cMemberPtr; } protected $javaclassname() { swigCMemberPtr = null; } protected static String getCMemberPtr($javaclassname obj) { return obj.swigCMemberPtr; } %} %typemap(javafinalize) SWIGTYPE %{ protected void finalize() { delete(); } %} /* * Java constructor typemaps: * * The javaconstruct typemap is inserted when a proxy class's constructor is generated. * This typemap allows control over what code is executed in the constructor as * well as specifying who owns the underlying C/C++ object. Normally, Java has * ownership and the underlying C/C++ object is deallocated when the Java object * is finalized (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is * ultimately responsible for deallocating the underlying object's memory. * * The SWIG_PROXY_CONSTRUCTOR macro defines the javaconstruct typemap for a proxy * class for a particular TYPENAME. OWNERSHIP is passed as the value of * swigCMemOwn to the pointer constructor method. WEAKREF determines which kind * of Java object reference will be used by the C++ director class (WeakGlobalRef * vs. GlobalRef.) * * The SWIG_DIRECTOR_OWNED macro sets the ownership of director-based proxy * classes and the weak reference flag to false, meaning that the underlying C++ * object will be reclaimed by C++. */ %define SWIG_PROXY_CONSTRUCTOR(OWNERSHIP, WEAKREF, TYPENAME...) %typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, swigCMemOwn, WEAKREF);") TYPENAME { this($imcall, OWNERSHIP);$directorconnect } %enddef %define SWIG_DIRECTOR_OWNED(TYPENAME...) SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME) %enddef // Set the default for SWIGTYPE: Java owns the C/C++ object. SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE) %typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; $jnicall; } swigCPtr = 0; } } %typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; $jnicall; } swigCPtr = 0; } super.delete(); } %typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ protected void $methodname() { swigCMemOwn = false; $jnicall; } %} %typemap(directorowner_release, methodname="swigReleaseOwnership") SWIGTYPE %{ public void $methodname() { swigCMemOwn = false; $jnicall; } %} %typemap(directorowner_take, methodname="swigTakeOwnership") SWIGTYPE %{ public void $methodname() { swigCMemOwn = true; $jnicall; } %} /* Java specific directives */ #define %javaconst(flag) %feature("java:const","flag") #define %javaconstvalue(value) %feature("java:constvalue",value) #define %javaenum(wrapapproach) %feature("java:enum","wrapapproach") #define %javamethodmodifiers %feature("java:methodmodifiers") #define %javaexception(exceptionclasses) %feature("except",throws=exceptionclasses) #define %nojavaexception %feature("except","0",throws="") #define %clearjavaexception %feature("except","",throws="") %pragma(java) jniclassclassmodifiers="public class" %pragma(java) moduleclassmodifiers="public class" /* Some ANSI C typemaps */ %apply unsigned long { size_t }; %apply const unsigned long & { const size_t & }; /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } /* java keywords */ %include // Default enum handling %include 0707010008e7d1000081a40000000000000000000000014caec28700001252000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/java/enumtypesafe.swg/* ----------------------------------------------------------------------------- * enumtypesafe.swg * * Include this file in order for C/C++ enums to be wrapped by the so called * typesafe enum pattern. Each enum has an equivalent Java class named after the * enum and each enum item is a static instance of this class. * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps %typemap(jni) const enum SWIGTYPE & "jint" %typemap(jtype) const enum SWIGTYPE & "int" %typemap(jstype) const enum SWIGTYPE & "$*javaclassname" %typemap(in) const enum SWIGTYPE & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1_name;" %typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" %typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" %typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" %typemap(throws) const enum SWIGTYPE & %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" %typemap(javaout) const enum SWIGTYPE & { return $*javaclassname.swigToEnum($jnicall); } // enum SWIGTYPE typemaps %typemap(jni) enum SWIGTYPE "jint" %typemap(jtype) enum SWIGTYPE "int" %typemap(jstype) enum SWIGTYPE "$javaclassname" %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} %typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} %typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} %typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" %typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" %typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" %typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" %typemap(throws) enum SWIGTYPE %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) enum SWIGTYPE "$javainput.swigValue()" %typemap(javaout) enum SWIGTYPE { return $javaclassname.swigToEnum($jnicall); } // '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not %typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" %typemap(javabase) enum SWIGTYPE "" %typemap(javacode) enum SWIGTYPE "" %typemap(javaimports) enum SWIGTYPE "" %typemap(javainterfaces) enum SWIGTYPE "" %typemap(javabody) enum SWIGTYPE "" /* * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. */ %typemap(javabody) enum SWIGTYPE %{ public final int swigValue() { return swigValue; } public String toString() { return swigName; } public static $javaclassname swigToEnum(int swigValue) { if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (int i = 0; i < swigValues.length; i++) if (swigValues[i].swigValue == swigValue) return swigValues[i]; throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); } private $javaclassname(String swigName) { this.swigName = swigName; this.swigValue = swigNext++; } private $javaclassname(String swigName, int swigValue) { this.swigName = swigName; this.swigValue = swigValue; swigNext = swigValue+1; } private $javaclassname(String swigName, $javaclassname swigEnum) { this.swigName = swigName; this.swigValue = swigEnum.swigValue; swigNext = this.swigValue+1; } private static $javaclassname[] swigValues = { $enumvalues }; private static int swigNext = 0; private final int swigValue; private final String swigName; %} %javaenum(typesafe); 0707010008e7e1000081a40000000000000000000000014caec28700001111000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/java/various.i/* ----------------------------------------------------------------------------- * various.i * * SWIG Typemap library for Java. * Various useful typemaps. * ----------------------------------------------------------------------------- */ /* * char **STRING_ARRAY typemaps. * These typemaps are for C String arrays which are NULL terminated. * char *values[] = { "one", "two", "three", NULL }; // note NULL * char ** is mapped to a Java String[]. * * Example usage wrapping: * %apply char **STRING_ARRAY { char **input }; * char ** foo(char **input); * * Java usage: * String numbers[] = { "one", "two", "three" }; * String[] ret = modulename.foo( numbers }; */ %typemap(jni) char **STRING_ARRAY "jobjectArray" %typemap(jtype) char **STRING_ARRAY "String[]" %typemap(jstype) char **STRING_ARRAY "String[]" %typemap(in) char **STRING_ARRAY (jint size) { int i = 0; size = JCALL1(GetArrayLength, jenv, $input); #ifdef __cplusplus $1 = new char*[size+1]; #else $1 = (char **)calloc(size+1, sizeof(char *)); #endif for (i = 0; i #endif namespace Swig { /* Java object wrapper */ class JObjectWrapper { public: JObjectWrapper() : jthis_(NULL), weak_global_(true) { } ~JObjectWrapper() { jthis_ = NULL; weak_global_ = true; } bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) { if (!jthis_) { weak_global_ = weak_global; if (jobj) jthis_ = ((weak_global_ || !mem_own) ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj)); #if defined(DEBUG_DIRECTOR_OWNED) std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl; #endif return true; } else { #if defined(DEBUG_DIRECTOR_OWNED) std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl; #endif return false; } } jobject get(JNIEnv *jenv) const { #if defined(DEBUG_DIRECTOR_OWNED) std::cout << "JObjectWrapper::get("; if (jthis_) std::cout << jthis_; else std::cout << "null"; std::cout << ") -> return new local ref" << std::endl; #endif return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_); } void release(JNIEnv *jenv) { #if defined(DEBUG_DIRECTOR_OWNED) std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl; #endif if (jthis_) { if (weak_global_) { if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) jenv->DeleteWeakGlobalRef((jweak)jthis_); } else jenv->DeleteGlobalRef(jthis_); } jthis_ = NULL; weak_global_ = true; } jobject peek() { return jthis_; } /* Java proxy releases ownership of C++ object, C++ object is now responsible for destruction (creates NewGlobalRef to pin Java proxy) */ void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */ if (!weak_global_) { jenv->DeleteGlobalRef(jthis_); jthis_ = jenv->NewWeakGlobalRef(jself); weak_global_ = true; } } else { /* Java releases ownership of C++ object's lifetime */ if (weak_global_) { jenv->DeleteWeakGlobalRef((jweak)jthis_); jthis_ = jenv->NewGlobalRef(jself); weak_global_ = false; } } } private: /* pointer to Java object */ jobject jthis_; /* Local or global reference flag */ bool weak_global_; }; /* director base class */ class Director { /* pointer to Java virtual machine */ JavaVM *swig_jvm_; protected: #if defined (_MSC_VER) && (_MSC_VER<1300) class JNIEnvWrapper; friend class JNIEnvWrapper; #endif /* Utility class for managing the JNI environment */ class JNIEnvWrapper { const Director *director_; JNIEnv *jenv_; public: JNIEnvWrapper(const Director *director) : director_(director), jenv_(0) { #if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) // Attach a daemon thread to the JVM. Useful when the JVM should not wait for // the thread to exit upon shutdown. Only for jdk-1.4 and later. director_->swig_jvm_->AttachCurrentThreadAsDaemon((void **) &jenv_, NULL); #else director_->swig_jvm_->AttachCurrentThread((void **) &jenv_, NULL); #endif } ~JNIEnvWrapper() { #if !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD) // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call. // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak. director_->swig_jvm_->DetachCurrentThread(); #endif } JNIEnv *getJNIEnv() const { return jenv_; } }; /* Java object wrapper */ JObjectWrapper swig_self_; /* Disconnect director from Java object */ void swig_disconnect_director_self(const char *disconn_method) { JNIEnvWrapper jnienv(this) ; JNIEnv *jenv = jnienv.getJNIEnv() ; jobject jobj = swig_self_.peek(); #if defined(DEBUG_DIRECTOR_OWNED) std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl; #endif if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) { jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V"); if (disconn_meth) { #if defined(DEBUG_DIRECTOR_OWNED) std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl; #endif jenv->CallVoidMethod(jobj, disconn_meth); } } } public: Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() { /* Acquire the Java VM pointer */ jenv->GetJavaVM(&swig_jvm_); } virtual ~Director() { JNIEnvWrapper jnienv(this) ; JNIEnv *jenv = jnienv.getJNIEnv() ; swig_self_.release(jenv); } bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) { return swig_self_.set(jenv, jself, mem_own, weak_global); } jobject swig_get_self(JNIEnv *jenv) const { return swig_self_.get(jenv); } // Change C++ object's ownership, relative to Java void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { swig_self_.java_change_ownership(jenv, jself, take_or_release); } }; } #endif /* __cplusplus */ 0707010008e7dc000081a40000000000000000000000014caec28700000d63000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/java/std_string.i/* ----------------------------------------------------------------------------- * std_string.i * * Typemaps for std::string and const std::string& * These are mapped to a Java String and are passed around by value. * * To use non-const std::string references use the following %apply. Note * that they are passed by value. * %apply const std::string & {std::string &}; * ----------------------------------------------------------------------------- */ %{ #include %} namespace std { %naturalvar string; class string; // string %typemap(jni) string "jstring" %typemap(jtype) string "String" %typemap(jstype) string "String" %typemap(javadirectorin) string "$jniinput" %typemap(javadirectorout) string "$javacall" %typemap(in) string %{ if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::string"); return $null; } const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); if (!$1_pstr) return $null; $1.assign($1_pstr); jenv->ReleaseStringUTFChars($input, $1_pstr); %} %typemap(directorout) string %{ if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::string"); return $null; } const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); if (!$1_pstr) return $null; $result.assign($1_pstr); jenv->ReleaseStringUTFChars($input, $1_pstr); %} %typemap(directorin,descriptor="Ljava/lang/String;") string %{ $input = jenv->NewStringUTF($1.c_str()); %} %typemap(out) string %{ $result = jenv->NewStringUTF($1.c_str()); %} %typemap(javain) string "$javainput" %typemap(javaout) string { return $jnicall; } %typemap(typecheck) string = char *; %typemap(throws) string %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); return $null; %} // const string & %typemap(jni) const string & "jstring" %typemap(jtype) const string & "String" %typemap(jstype) const string & "String" %typemap(javadirectorin) const string & "$jniinput" %typemap(javadirectorout) const string & "$javacall" %typemap(in) const string & %{ if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::string"); return $null; } const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); if (!$1_pstr) return $null; std::string $1_str($1_pstr); $1 = &$1_str; jenv->ReleaseStringUTFChars($input, $1_pstr); %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & %{ if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::string"); return $null; } const char *$1_pstr = (const char *)jenv->GetStringUTFChars($input, 0); if (!$1_pstr) return $null; /* possible thread/reentrant code problem */ static std::string $1_str; $1_str = $1_pstr; $result = &$1_str; jenv->ReleaseStringUTFChars($input, $1_pstr); %} %typemap(directorin,descriptor="Ljava/lang/String;") const string & %{ $input = jenv->NewStringUTF($1.c_str()); %} %typemap(out) const string & %{ $result = jenv->NewStringUTF($1->c_str()); %} %typemap(javain) const string & "$javainput" %typemap(javaout) const string & { return $jnicall; } %typemap(typecheck) const string & = char *; %typemap(throws) const string & %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); return $null; %} } 0707010008e7cb000081a40000000000000000000000014caec286000034d5000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/java/arrays_java.i/* ----------------------------------------------------------------------------- * arrays_java.i * * These typemaps give more natural support for arrays. The typemaps are not efficient * as there is a lot of copying of the array values whenever the array is passed to C/C++ * from Java and vice versa. The Java array is expected to be the same size as the C array. * An exception is thrown if they are not. * * Example usage: * Wrapping: * * %include * %inline %{ * short FiddleSticks[3]; * %} * * Use from Java like this: * * short[] fs = new short[] {10, 11, 12}; * example.setFiddleSticks(fs); * fs = example.getFiddleSticks(); * ----------------------------------------------------------------------------- */ /* Primitive array support is a combination of SWIG macros and functions in order to reduce * code bloat and aid maintainability. The SWIG preprocessor expands the macros into functions * for inclusion in the generated code. */ /* Array support functions declarations macro */ %define JAVA_ARRAYS_DECL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) %{ int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input); void SWIG_JavaArrayArgout##JFUNCNAME (JNIEnv *jenv, JNITYPE *jarr, CTYPE *carr, JNITYPE##Array input); JNITYPE##Array SWIG_JavaArrayOut##JFUNCNAME (JNIEnv *jenv, CTYPE *result, jsize sz); %} %enddef /* Array support functions macro */ %define JAVA_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JFUNCNAME) %{ /* CTYPE[] support */ int SWIG_JavaArrayIn##JFUNCNAME (JNIEnv *jenv, JNITYPE **jarr, CTYPE **carr, JNITYPE##Array input) { int i; jsize sz; if (!input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); return 0; } sz = JCALL1(GetArrayLength, jenv, input); *jarr = JCALL2(Get##JAVATYPE##ArrayElements, jenv, input, 0); if (!*jarr) return 0; %} #ifdef __cplusplus %{ *carr = new CTYPE[sz]; %} #else %{ *carr = (CTYPE*) calloc(sz, sizeof(CTYPE)); %} #endif %{ if (!*carr) { SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); return 0; } for (i=0; i // Language specific macro implementing all the customisations for handling the smart pointer %define SWIG_INTRUSIVE_PTR_TYPEMAPS(CONST, TYPE...) // %naturalvar is as documented for member variables %naturalvar TYPE; %naturalvar SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; // destructor wrapper customisation %feature("unref") TYPE "(void)arg1; delete smartarg1;" // Typemap customisations... %typemap(in) CONST TYPE ($&1_type argp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ // plain value argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; if (!argp) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); return $null; } $1 = *argp; %} %typemap(out, fragment="SWIG_intrusive_deleter") CONST TYPE %{ //plain value(out) $1_ltype* resultp = new $1_ltype(($1_ltype &)$1); intrusive_ptr_add_ref(resultp); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(resultp, SWIG_intrusive_deleter< CONST TYPE >()); %} %typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ // plain pointer smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} %typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE * %{ //plain pointer(out) #if ($owner) if ($1) { intrusive_ptr_add_ref($1); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); } else { *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; } #else *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; #endif %} %typemap(in) CONST TYPE & (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ // plain reference $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); if(!$1) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); return $null; } %} %typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") CONST TYPE & %{ //plain reference(out) #if ($owner) if ($1) { intrusive_ptr_add_ref($1); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1, SWIG_intrusive_deleter< CONST TYPE >()); } else { *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; } #else *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; #endif %} %typemap(in) TYPE *CONST& ($*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ // plain pointer by reference temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); $1 = &temp; %} %typemap(out, fragment="SWIG_intrusive_deleter,SWIG_null_deleter") TYPE *CONST& %{ // plain pointer by reference(out) #if ($owner) if (*$1) { intrusive_ptr_add_ref(*$1); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1, SWIG_intrusive_deleter< CONST TYPE >()); } else { *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; } #else *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_0); #endif %} %typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > ($&1_type argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ // intrusive_ptr by value smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; if (smartarg) { $1 = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); } %} %typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{ if ($1) { intrusive_ptr_add_ref(result.get()); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(result.get(), SWIG_intrusive_deleter< CONST TYPE >()); } else { *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; } %} %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ // shared_ptr by value smartarg = *($&1_ltype*)&$input; if (smartarg) $1 = *smartarg; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; %} %typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ // intrusive_ptr by reference if ( $input ) { smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); $1 = &temp; } else { $1 = &tempnull; } %} %typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ delete &($1); if ($self) { SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * temp = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); $1 = *temp; } %} %typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & %{ if (*$1) { intrusive_ptr_add_ref($1->get()); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); } else { *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; } %} %typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * ($*1_ltype tempnull, $*1_ltype temp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ // intrusive_ptr by pointer if ( $input ) { smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); $1 = &temp; } else { $1 = &tempnull; } %} %typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ delete $1; if ($self) $1 = new SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(*$input); %} %typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * %{ if ($1 && *$1) { intrusive_ptr_add_ref($1->get()); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1->get(), SWIG_intrusive_deleter< CONST TYPE >()); } else { *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; } if ($owner) delete $1; %} %typemap(in) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& (SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > temp, $*1_ltype tempp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * smartarg) %{ // intrusive_ptr by pointer reference smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >**)&$input; if ($input) { temp = SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >(smartarg->get(), true); } tempp = &temp; $1 = &tempp; %} %typemap(memberin) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ if ($self) $1 = *$input; %} %typemap(out, fragment="SWIG_intrusive_deleter") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& %{ if (*$1 && **$1) { intrusive_ptr_add_ref((*$1)->get()); *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >((*$1)->get(), SWIG_intrusive_deleter< CONST TYPE >()); } else { *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = 0; } %} // various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug %typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap (jni) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "jlong" %typemap (jtype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "long" %typemap (jstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" %typemap(javain) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *, SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" %typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) CONST TYPE { return new $typemap(jstype, TYPE)($jnicall, true); } %typemap(javaout) CONST TYPE & { return new $typemap(jstype, TYPE)($jnicall, true); } %typemap(javaout) CONST TYPE * { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) TYPE *CONST& { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } // Base proxy classes %typemap(javabody) TYPE %{ private long swigCPtr; private boolean swigCMemOwnBase; public $javaclassname(long cPtr, boolean cMemoryOwn) { swigCMemOwnBase = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} // Derived proxy classes %typemap(javabody_derived) TYPE %{ private long swigCPtr; private boolean swigCMemOwnDerived; public $javaclassname(long cPtr, boolean cMemoryOwn) { super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); swigCMemOwnDerived = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} %typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { if(swigCPtr != 0 && swigCMemOwnBase) { swigCMemOwnBase = false; $jnicall; } swigCPtr = 0; } %typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { if(swigCPtr != 0 && swigCMemOwnDerived) { swigCMemOwnDerived = false; $jnicall; } swigCPtr = 0; super.delete(); } // CONST version needed ???? also for C# %typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" %typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" %template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; %template() SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >; %enddef ///////////////////////////////////////////////////////////////////// %include %define SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(CONST, TYPE...) %naturalvar TYPE; %naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; // destructor mods %feature("unref") TYPE "(void)arg1; delete smartarg1;" // plain value %typemap(in) CONST TYPE ($&1_type argp = 0) %{ argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; if (!argp) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); return $null; } $1 = *argp; %} %typemap(out) CONST TYPE %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(($1_ltype &)$1)); %} // plain pointer %typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} %typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; %} // plain reference %typemap(in) CONST TYPE & %{ $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); if (!$1) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); return $null; } %} %typemap(out, fragment="SWIG_null_deleter") CONST TYPE & %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} // plain pointer by reference %typemap(in) TYPE *CONST& ($*1_ltype temp = 0) %{ temp = ($*1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); $1 = &temp; %} %typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast ($&1_type smartarg) %{ // shared_ptr by value smartarg = *($&1_ltype*)&$input; if (smartarg) $1 = *smartarg; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ANY_TYPE_SWIGSharedPtrUpcast %{ *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; %} // various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug %typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "jlong" %typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "long" %typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE)" %typemap (javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(jstype, TYPE).getCPtr($javainput)" %typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) CONST TYPE { return new $typemap(jstype, TYPE)($jnicall, true); } %typemap(javaout) CONST TYPE & { return new $typemap(jstype, TYPE)($jnicall, true); } %typemap(javaout) CONST TYPE * { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) TYPE *CONST& { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } // Base proxy classes %typemap(javabody) TYPE %{ private long swigCPtr; private boolean swigCMemOwnBase; public $javaclassname(long cPtr, boolean cMemoryOwn) { swigCMemOwnBase = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} // Derived proxy classes %typemap(javabody_derived) TYPE %{ private long swigCPtr; private boolean swigCMemOwnDerived; public $javaclassname(long cPtr, boolean cMemoryOwn) { super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); swigCMemOwnDerived = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} %typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { if (swigCPtr != 0) { if (swigCMemOwnBase) { swigCMemOwnBase = false; $jnicall; } swigCPtr = 0; } } %typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { if (swigCPtr != 0) { if (swigCMemOwnDerived) { swigCMemOwnDerived = false; $jnicall; } swigCPtr = 0; } super.delete(); } // CONST version needed ???? also for C# %typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "long" %typemap(jtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "long" %template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; %enddef 0707010008e7e0000081a40000000000000000000000014caec2870000462d000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/java/typemaps.i/* ----------------------------------------------------------------------------- * typemaps.i * * Pointer and reference handling typemap library * * These mappings provide support for input/output arguments and common * uses for C/C++ pointers and C++ references. * ----------------------------------------------------------------------------- */ /* INPUT typemaps -------------- These typemaps remap a C pointer or C++ reference to be an "INPUT" value which is passed by value instead of reference. The following typemaps can be applied to turn a pointer or reference into a simple input value. That is, instead of passing a pointer or reference to an object, you would use a real value instead. bool *INPUT, bool &INPUT signed char *INPUT, signed char &INPUT unsigned char *INPUT, unsigned char &INPUT short *INPUT, short &INPUT unsigned short *INPUT, unsigned short &INPUT int *INPUT, int &INPUT unsigned int *INPUT, unsigned int &INPUT long *INPUT, long &INPUT unsigned long *INPUT, unsigned long &INPUT long long *INPUT, long long &INPUT unsigned long long *INPUT, unsigned long long &INPUT float *INPUT, float &INPUT double *INPUT, double &INPUT To use these, suppose you had a C function like this : double fadd(double *a, double *b) { return *a+*b; } You could wrap it with SWIG as follows : %include double fadd(double *INPUT, double *INPUT); or you can use the %apply directive : %include %apply double *INPUT { double *a, double *b }; double fadd(double *a, double *b); In Java you could then use it like this: double answer = modulename.fadd(10.0, 20.0); There are no char *INPUT typemaps, however you can apply the signed char * typemaps instead: %include %apply signed char *INPUT {char *input}; void f(char *input); */ %define INPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JNIDESC) %typemap(jni) TYPE *INPUT, TYPE &INPUT "JNITYPE" %typemap(jtype) TYPE *INPUT, TYPE &INPUT "JTYPE" %typemap(jstype) TYPE *INPUT, TYPE &INPUT "JTYPE" %typemap(javain) TYPE *INPUT, TYPE &INPUT "$javainput" %typemap(javadirectorin) TYPE *INPUT, TYPE &INPUT "$jniinput" %typemap(javadirectorout) TYPE *INPUT, TYPE &INPUT "$javacall" %typemap(in) TYPE *INPUT, TYPE &INPUT %{ $1 = ($1_ltype)&$input; %} %typemap(freearg) TYPE *INPUT, TYPE &INPUT "" %typemap(directorout) TYPE *INPUT, TYPE &INPUT %{ $result = ($1_ltype)&$input; %} %typemap(directorin,descriptor=JNIDESC) TYPE &INPUT %{ *(($&1_ltype) $input) = (JNITYPE *) &$1; %} %typemap(directorin,descriptor=JNIDESC) TYPE *INPUT %{ *(($&1_ltype) $input) = (JNITYPE *) $1; %} %typemap(typecheck) TYPE *INPUT = TYPE; %typemap(typecheck) TYPE &INPUT = TYPE; %enddef INPUT_TYPEMAP(bool, jboolean, boolean, "Z"); INPUT_TYPEMAP(signed char, jbyte, byte, "B"); INPUT_TYPEMAP(unsigned char, jshort, short, "S"); INPUT_TYPEMAP(short, jshort, short, "S"); INPUT_TYPEMAP(unsigned short, jint, int, "I"); INPUT_TYPEMAP(int, jint, int, "I"); INPUT_TYPEMAP(unsigned int, jlong, long, "J"); INPUT_TYPEMAP(long, jint, int, "I"); INPUT_TYPEMAP(unsigned long, jlong, long, "J"); INPUT_TYPEMAP(long long, jlong, long, "J"); INPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, "Ljava/math/BigInteger;"); INPUT_TYPEMAP(float, jfloat, float, "F"); INPUT_TYPEMAP(double, jdouble, double, "D"); #undef INPUT_TYPEMAP /* Convert from BigInteger using the toByteArray member function */ /* Overrides the typemap in the INPUT_TYPEMAP macro */ %typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { jclass clazz; jmethodID mid; jbyteArray ba; jbyte* bae; jsize sz; int i; if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); return $null; } clazz = JCALL1(GetObjectClass, jenv, $input); mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid); bae = JCALL2(GetByteArrayElements, jenv, ba, 0); sz = JCALL1(GetArrayLength, jenv, ba); temp = 0; for(i=0; i double modf(double x, double *OUTPUT); or you can use the %apply directive : %include %apply double *OUTPUT { double *ip }; double modf(double x, double *ip); The Java output of the function would be the function return value and the value in the single element array. In Java you would use it like this: double[] ptr = {0.0}; double fraction = modulename.modf(5.0,ptr); There are no char *OUTPUT typemaps, however you can apply the signed char * typemaps instead: %include %apply signed char *OUTPUT {char *output}; void f(char *output); */ /* Java BigInteger[] */ %typecheck(SWIG_TYPECHECK_INT128_ARRAY) SWIGBIGINTEGERARRAY "" %define OUTPUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) %typemap(jni) TYPE *OUTPUT, TYPE &OUTPUT %{JNITYPE##Array%} %typemap(jtype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" %typemap(jstype) TYPE *OUTPUT, TYPE &OUTPUT "JTYPE[]" %typemap(javain) TYPE *OUTPUT, TYPE &OUTPUT "$javainput" %typemap(javadirectorin) TYPE *OUTPUT, TYPE &OUTPUT "$jniinput" %typemap(javadirectorout) TYPE *OUTPUT, TYPE &OUTPUT "$javacall" %typemap(in) TYPE *OUTPUT($*1_ltype temp), TYPE &OUTPUT($*1_ltype temp) { if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); return $null; } if (JCALL1(GetArrayLength, jenv, $input) == 0) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); return $null; } $1 = &temp; } %typemap(freearg) TYPE *OUTPUT, TYPE &OUTPUT "" %typemap(argout) TYPE *OUTPUT, TYPE &OUTPUT { JNITYPE jvalue = (JNITYPE)temp$argnum; JCALL4(Set##JAVATYPE##ArrayRegion, jenv, $input, 0, 1, &jvalue); } %typemap(directorout,warning="Need to provide TYPE *OUTPUT directorout typemap") TYPE *OUTPUT, TYPE &OUTPUT { } %typemap(directorin,descriptor=JNIDESC) TYPE &OUTPUT %{ *(($&1_ltype) $input = &$1; %} %typemap(directorin,descriptor=JNIDESC,warning="Need to provide TYPE *OUTPUT directorin typemap, TYPE array length is unknown") TYPE *OUTPUT { } %typemap(typecheck) TYPE *INOUT = TYPECHECKTYPE; %typemap(typecheck) TYPE &INOUT = TYPECHECKTYPE; %enddef OUTPUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Ljava/lang/Boolean;", jbooleanArray); OUTPUT_TYPEMAP(signed char, jbyte, byte, Byte, "[Ljava/lang/Byte;", jbyteArray); OUTPUT_TYPEMAP(unsigned char, jshort, short, Short, "[Ljava/lang/Short;", jshortArray); OUTPUT_TYPEMAP(short, jshort, short, Short, "[Ljava/lang/Short;", jshortArray); OUTPUT_TYPEMAP(unsigned short, jint, int, Int, "[Ljava/lang/Integer;", jintArray); OUTPUT_TYPEMAP(int, jint, int, Int, "[Ljava/lang/Integer;", jintArray); OUTPUT_TYPEMAP(unsigned int, jlong, long, Long, "[Ljava/lang/Long;", jlongArray); OUTPUT_TYPEMAP(long, jint, int, Int, "[Ljava/lang/Integer;", jintArray); OUTPUT_TYPEMAP(unsigned long, jlong, long, Long, "[Ljava/lang/Long;", jlongArray); OUTPUT_TYPEMAP(long long, jlong, long, Long, "[Ljava/lang/Long;", jlongArray); OUTPUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, NOTUSED, "[Ljava/lang/BigInteger;", SWIGBIGINTEGERARRAY); OUTPUT_TYPEMAP(float, jfloat, float, Float, "[Ljava/lang/Float;", jfloatArray); OUTPUT_TYPEMAP(double, jdouble, double, Double, "[Ljava/lang/Double;", jdoubleArray); #undef OUTPUT_TYPEMAP /* Convert to BigInteger - byte array holds number in 2's complement big endian format */ /* Use first element in BigInteger array for output */ /* Overrides the typemap in the OUTPUT_TYPEMAP macro */ %typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { jbyteArray ba = JCALL1(NewByteArray, jenv, 9); jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0); jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger"); jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "", "([B)V"); jobject bigint; int i; bae[0] = 0; for(i=1; i<9; i++ ) { bae[i] = (jbyte)(temp$argnum>>8*(8-i)); } JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0); bigint = JCALL3(NewObject, jenv, clazz, mid, ba); JCALL3(SetObjectArrayElement, jenv, $input, 0, bigint); } /* INOUT typemaps -------------- Mappings for a parameter that is both an input and an output parameter The following typemaps can be applied to make a function parameter both an input and output value. This combines the behavior of both the "INPUT" and "OUTPUT" typemaps described earlier. Output values are returned as an element in a Java array. bool *INOUT, bool &INOUT signed char *INOUT, signed char &INOUT unsigned char *INOUT, unsigned char &INOUT short *INOUT, short &INOUT unsigned short *INOUT, unsigned short &INOUT int *INOUT, int &INOUT unsigned int *INOUT, unsigned int &INOUT long *INOUT, long &INOUT unsigned long *INOUT, unsigned long &INOUT long long *INOUT, long long &INOUT unsigned long long *INOUT, unsigned long long &INOUT float *INOUT, float &INOUT double *INOUT, double &INOUT For example, suppose you were trying to wrap the following function : void neg(double *x) { *x = -(*x); } You could wrap it with SWIG as follows : %include void neg(double *INOUT); or you can use the %apply directive : %include %apply double *INOUT { double *x }; void neg(double *x); This works similarly to C in that the mapping directly modifies the input value - the input must be an array with a minimum of one element. The element in the array is the input and the output is the element in the array. double x[] = {5.0}; neg(x); The implementation of the OUTPUT and INOUT typemaps is different to other languages in that other languages will return the output value as part of the function return value. This difference is due to Java being a typed language. There are no char *INOUT typemaps, however you can apply the signed char * typemaps instead: %include %apply signed char *INOUT {char *inout}; void f(char *inout); */ %define INOUT_TYPEMAP(TYPE, JNITYPE, JTYPE, JAVATYPE, JNIDESC, TYPECHECKTYPE) %typemap(jni) TYPE *INOUT, TYPE &INOUT %{JNITYPE##Array%} %typemap(jtype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" %typemap(jstype) TYPE *INOUT, TYPE &INOUT "JTYPE[]" %typemap(javain) TYPE *INOUT, TYPE &INOUT "$javainput" %typemap(javadirectorin) TYPE *INOUT, TYPE &INOUT "$jniinput" %typemap(javadirectorout) TYPE *INOUT, TYPE &INOUT "$javacall" %typemap(in) TYPE *INOUT, TYPE &INOUT { if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); return $null; } if (JCALL1(GetArrayLength, jenv, $input) == 0) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); return $null; } $1 = ($1_ltype) JCALL2(Get##JAVATYPE##ArrayElements, jenv, $input, 0); } %typemap(freearg) TYPE *INOUT, TYPE &INOUT "" %typemap(argout) TYPE *INOUT, TYPE &INOUT { JCALL3(Release##JAVATYPE##ArrayElements, jenv, $input, (JNITYPE *)$1, 0); } %typemap(directorout,warning="Need to provide TYPE *INOUT directorout typemap") TYPE *INOUT, TYPE &INOUT { } %typemap(directorin,descriptor=JNIDESC) TYPE &INOUT %{ *(($&1_ltype)&$input) = &$1; %} %typemap(directorin,descriptor=JNIDESC,warning="Need to provide TYPE *INOUT directorin typemap, TYPE array length is unknown") TYPE *INOUT, TYPE &INOUT { } %typemap(typecheck) TYPE *INOUT = TYPECHECKTYPE; %typemap(typecheck) TYPE &INOUT = TYPECHECKTYPE; %enddef INOUT_TYPEMAP(bool, jboolean, boolean, Boolean, "[Ljava/lang/Boolean;", jbooleanArray); INOUT_TYPEMAP(signed char, jbyte, byte, Byte, "[Ljava/lang/Byte;", jbyteArray); INOUT_TYPEMAP(unsigned char, jshort, short, Short, "[Ljava/lang/Short;", jshortArray); INOUT_TYPEMAP(short, jshort, short, Short, "[Ljava/lang/Short;", jshortArray); INOUT_TYPEMAP(unsigned short, jint, int, Int, "[Ljava/lang/Integer;", jintArray); INOUT_TYPEMAP(int, jint, int, Int, "[Ljava/lang/Integer;", jintArray); INOUT_TYPEMAP(unsigned int, jlong, long, Long, "[Ljava/lang/Long;", jlongArray); INOUT_TYPEMAP(long, jint, int, Int, "[Ljava/lang/Integer;", jintArray); INOUT_TYPEMAP(unsigned long, jlong, long, Long, "[Ljava/lang/Long;", jlongArray); INOUT_TYPEMAP(long long, jlong, long, Long, "[Ljava/lang/Long;", jlongArray); INOUT_TYPEMAP(unsigned long long, jobject, java.math.BigInteger, NOTUSED, "[Ljava.math.BigInteger;", SWIGBIGINTEGERARRAY); INOUT_TYPEMAP(float, jfloat, float, Float, "[Ljava/lang/Float;", jfloatArray); INOUT_TYPEMAP(double, jdouble, double, Double, "[Ljava/lang/Double;", jdoubleArray); #undef INOUT_TYPEMAP /* Override typemaps in the INOUT_TYPEMAP macro for booleans to fix casts as a jboolean isn't always the same size as a bool */ %typemap(in) bool *INOUT (bool btemp, jboolean *jbtemp), bool &INOUT (bool btemp, jboolean *jbtemp) { if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); return $null; } if (JCALL1(GetArrayLength, jenv, $input) == 0) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); return $null; } jbtemp = JCALL2(GetBooleanArrayElements, jenv, $input, 0); btemp = (*jbtemp) ? true : false; $1 = &btemp; } %typemap(argout) bool *INOUT, bool &INOUT { *jbtemp$argnum = btemp$argnum ? (jboolean)1 : (jboolean)0; JCALL3(ReleaseBooleanArrayElements, jenv, $input , (jboolean *)jbtemp$argnum, 0); } /* Override the typemap in the INOUT_TYPEMAP macro for unsigned long long */ %typemap(in) unsigned long long *INOUT ($*1_ltype temp), unsigned long long &INOUT ($*1_ltype temp) { jobject bigint; jclass clazz; jmethodID mid; jbyteArray ba; jbyte* bae; jsize sz; int i; if (!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); return $null; } if (JCALL1(GetArrayLength, jenv, $input) == 0) { SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); return $null; } bigint = JCALL2(GetObjectArrayElement, jenv, $input, 0); if (!bigint) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array element null"); return $null; } clazz = JCALL1(GetObjectClass, jenv, bigint); mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B"); ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, bigint, mid); bae = JCALL2(GetByteArrayElements, jenv, ba, 0); sz = JCALL1(GetArrayLength, jenv, ba); temp = 0; for(i=0; i %} namespace std { %ignore exception; struct exception {}; } %typemap(throws) std::bad_exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" %typemap(throws) std::domain_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" %typemap(throws) std::exception "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" %typemap(throws) std::invalid_argument "SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, $1.what());\n return $null;" %typemap(throws) std::length_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" %typemap(throws) std::logic_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" %typemap(throws) std::out_of_range "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" %typemap(throws) std::overflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" %typemap(throws) std::range_error "SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, $1.what());\n return $null;" %typemap(throws) std::runtime_error "SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.what());\n return $null;" %typemap(throws) std::underflow_error "SWIG_JavaThrowException(jenv, SWIG_JavaArithmeticException, $1.what());\n return $null;" 0707010008e7da000081a40000000000000000000000014caec287000002c8000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/java/std_pair.i/* ----------------------------------------------------------------------------- * std_pair.i * * SWIG typemaps for std::pair * ----------------------------------------------------------------------------- */ %include %include // ------------------------------------------------------------------------ // std::pair // ------------------------------------------------------------------------ %{ #include %} namespace std { template struct pair { pair(); pair(T first, U second); pair(const pair& p); template pair(const pair &p); T first; U second; }; // add specializations here } 0707010008e7cd000081a40000000000000000000000014caec28700002093000000b600010002ffffffffffffffff0000003800000000root/usr/local/share/swig/2.0.1/java/boost_shared_ptr.i%include // Language specific macro implementing all the customisations for handling the smart pointer %define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) // %naturalvar is as documented for member variables %naturalvar TYPE; %naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; // destructor wrapper customisation %feature("unref") TYPE //"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" "(void)arg1; delete smartarg1;" // Typemap customisations... // plain value %typemap(in) CONST TYPE ($&1_type argp = 0) %{ argp = (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0; if (!argp) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); return $null; } $1 = *argp; %} %typemap(out) CONST TYPE %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(($1_ltype &)$1)); %} // plain pointer %typemap(in) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ smartarg = *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input; $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} %typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; %} // plain reference %typemap(in) CONST TYPE & %{ $1 = ($1_ltype)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); if (!$1) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null"); return $null; } %} %typemap(out, fragment="SWIG_null_deleter") CONST TYPE & %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} // plain pointer by reference %typemap(in) TYPE *CONST& ($*1_ltype temp = 0) %{ temp = (TYPE *)((*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input) ? (*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$input)->get() : 0); $1 = &temp; %} %typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& %{ *(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > **)&$result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} // shared_ptr by value %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > ($&1_type argp) %{ argp = *($&1_ltype*)&$input; if (argp) $1 = *argp; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > %{ *($&1_ltype*)&$result = $1 ? new $1_ltype($1) : 0; %} // shared_ptr by reference %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) %{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ *($&1_ltype)&$result = *$1 ? new $*1_ltype(*$1) : 0; %} // shared_ptr by pointer %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) %{ $1 = $input ? *($&1_ltype)&$input : &tempnull; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ *($&1_ltype)&$result = ($1 && *$1) ? new $*1_ltype(*$1) : 0; if ($owner) delete $1; %} // shared_ptr by pointer reference %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) %{ temp = $input ? *($1_ltype)&$input : &tempnull; $1 = &temp; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} // various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug %typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap (jni) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "jlong" %typemap (jtype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "long" %typemap (jstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE)" %typemap(javain) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(jstype, TYPE).getCPtr($javainput)" %typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) CONST TYPE { return new $typemap(jstype, TYPE)($jnicall, true); } %typemap(javaout) CONST TYPE & { return new $typemap(jstype, TYPE)($jnicall, true); } %typemap(javaout) CONST TYPE * { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } %typemap(javaout) TYPE *CONST& { long cPtr = $jnicall; return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } // Base proxy classes %typemap(javabody) TYPE %{ private long swigCPtr; private boolean swigCMemOwnBase; public $javaclassname(long cPtr, boolean cMemoryOwn) { swigCMemOwnBase = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} // Derived proxy classes %typemap(javabody_derived) TYPE %{ private long swigCPtr; private boolean swigCMemOwnDerived; public $javaclassname(long cPtr, boolean cMemoryOwn) { super($imclassname.$javaclazznameSWIGSmartPtrUpcast(cPtr), true); swigCMemOwnDerived = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr($javaclassname obj) { return (obj == null) ? 0 : obj.swigCPtr; } %} %typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") TYPE { if (swigCPtr != 0) { if (swigCMemOwnBase) { swigCMemOwnBase = false; $jnicall; } swigCPtr = 0; } } %typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") TYPE { if (swigCPtr != 0) { if (swigCMemOwnDerived) { swigCMemOwnDerived = false; $jnicall; } swigCPtr = 0; } super.delete(); } %template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; %enddef 0707010008e7df000081a40000000000000000000000014caec28700000123000000b600010002ffffffffffffffff0000002b00000000root/usr/local/share/swig/2.0.1/java/stl.i/* ----------------------------------------------------------------------------- * stl.i * ----------------------------------------------------------------------------- */ %include %include %include %include %include 0707010008e7d9000081a40000000000000000000000014caec28700000921000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/java/std_map.i/* ----------------------------------------------------------------------------- * std_map.i * * SWIG typemaps for std::map * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::map // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class map { // add typemaps here public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef K key_type; typedef T mapped_type; map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { const T& get(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { (*self)[key] = x; } void del(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(const K& key) { std::map::iterator i = self->find(key); return i != self->end(); } } }; // Legacy macros (deprecated) %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) #warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" %enddef } 0707010008e7cf000081a40000000000000000000000014caec287000011e4000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/java/enums.swg/* ----------------------------------------------------------------------------- * enums.swg * * Include this file in order for C/C++ enums to be wrapped by proper Java enums. * Note that the JNI layer handles the enum as an int. The Java enum has extra * code generated to store the C++ int value. This is required for C++ enums that * specify a value for the enum item, as native Java enums do not support this. * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps %typemap(jni) const enum SWIGTYPE & "jint" %typemap(jtype) const enum SWIGTYPE & "int" %typemap(jstype) const enum SWIGTYPE & "$*javaclassname" %typemap(in) const enum SWIGTYPE & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin, descriptor="L$packagepath/$*javaclassname;") const enum SWIGTYPE & "$input = (jint)$1_name;" %typemap(javadirectorin) const enum SWIGTYPE & "$*javaclassname.swigToEnum($jniinput)" %typemap(javadirectorout) const enum SWIGTYPE & "($javacall).swigValue()" %typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" %typemap(throws) const enum SWIGTYPE & %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) const enum SWIGTYPE & "$javainput.swigValue()" %typemap(javaout) const enum SWIGTYPE & { return $*javaclassname.swigToEnum($jnicall); } // enum SWIGTYPE typemaps %typemap(jni) enum SWIGTYPE "jint" %typemap(jtype) enum SWIGTYPE "int" %typemap(jstype) enum SWIGTYPE "$javaclassname" %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} %typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %} %typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} %typemap(directorin, descriptor="L$packagepath/$javaclassname;") enum SWIGTYPE "$input = (jint) $1;" %typemap(javadirectorin) enum SWIGTYPE "$javaclassname.swigToEnum($jniinput)" %typemap(javadirectorout) enum SWIGTYPE "($javacall).swigValue()" %typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" %typemap(throws) enum SWIGTYPE %{ (void)$1; SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %} %typemap(javain) enum SWIGTYPE "$javainput.swigValue()" %typemap(javaout) enum SWIGTYPE { return $javaclassname.swigToEnum($jnicall); } %typemap(javaclassmodifiers) enum SWIGTYPE "public enum" %typemap(javabase) enum SWIGTYPE "" %typemap(javacode) enum SWIGTYPE "" %typemap(javaimports) enum SWIGTYPE "" %typemap(javainterfaces) enum SWIGTYPE "" %typemap(javabody) enum SWIGTYPE "" /* * SwigNext static inner class used instead of a static int as static fields cannot be accessed from enum initialisers. * The swigToEnum method is used to find the Java enum from a C++ enum integer value. The default one here takes * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. */ %typemap(javabody) enum SWIGTYPE %{ public final int swigValue() { return swigValue; } public static $javaclassname swigToEnum(int swigValue) { $javaclassname[] swigValues = $javaclassname.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for ($javaclassname swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + $javaclassname.class + " with value " + swigValue); } @SuppressWarnings("unused") private $javaclassname() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private $javaclassname(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private $javaclassname($javaclassname swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } %} %javaenum(proper); 0707010008e7d6000081a40000000000000000000000014caec28700000066000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/java/std_common.i%include %apply size_t { std::size_t }; %apply const size_t& { const std::size_t& }; 0707010008e7de000081a40000000000000000000000014caec28700001345000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/java/std_wstring.i/* ----------------------------------------------------------------------------- * std_wstring.i * * Typemaps for std::wstring and const std::wstring& * * These are mapped to a Java String and are passed around by value. * Warning: Unicode / multibyte characters are handled differently on different * OSs so the std::wstring typemaps may not always work as intended. * * To use non-const std::wstring references use the following %apply. Note * that they are passed by value. * %apply const std::wstring & {std::wstring &}; * ----------------------------------------------------------------------------- */ namespace std { %naturalvar wstring; class wstring; // wstring %typemap(jni) wstring "jstring" %typemap(jtype) wstring "String" %typemap(jstype) wstring "String" %typemap(javadirectorin) wstring "$jniinput" %typemap(javadirectorout) wstring "$javacall" %typemap(in) wstring %{if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); return $null; } const jchar *$1_pstr = jenv->GetStringChars($input, 0); if (!$1_pstr) return $null; jsize $1_len = jenv->GetStringLength($input); if ($1_len) { $1.reserve($1_len); for (jsize i = 0; i < $1_len; ++i) { $1.push_back((wchar_t)$1_pstr[i]); } } jenv->ReleaseStringChars($input, $1_pstr); %} %typemap(directorout) wstring %{if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); return $null; } const jchar *$1_pstr = jenv->GetStringChars($input, 0); if (!$1_pstr) return $null; jsize $1_len = jenv->GetStringLength($input); if ($1_len) { $result.reserve($1_len); for (jsize i = 0; i < $1_len; ++i) { $result.push_back((wchar_t)$1_pstr[i]); } } jenv->ReleaseStringChars($input, $1_pstr); %} %typemap(directorin,descriptor="Ljava/lang/String;") wstring { jsize $1_len = $1.length(); jchar *conv_buf = new jchar[$1_len]; for (jsize i = 0; i < $1_len; ++i) { conv_buf[i] = (jchar)$1[i]; } $input = jenv->NewString(conv_buf, $1_len); delete [] conv_buf; } %typemap(out) wstring %{jsize $1_len = $1.length(); jchar *conv_buf = new jchar[$1_len]; for (jsize i = 0; i < $1_len; ++i) { conv_buf[i] = (jchar)$1[i]; } $result = jenv->NewString(conv_buf, $1_len); delete [] conv_buf; %} %typemap(javain) wstring "$javainput" %typemap(javaout) wstring { return $jnicall; } //%typemap(typecheck) wstring = wchar_t *; %typemap(throws) wstring %{ std::string message($1.begin(), $1.end()); SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); return $null; %} // const wstring & %typemap(jni) const wstring & "jstring" %typemap(jtype) const wstring & "String" %typemap(jstype) const wstring & "String" %typemap(javadirectorin) const wstring & "$jniinput" %typemap(javadirectorout) const wstring & "$javacall" %typemap(in) const wstring & %{if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); return $null; } const jchar *$1_pstr = jenv->GetStringChars($input, 0); if (!$1_pstr) return $null; jsize $1_len = jenv->GetStringLength($input); std::wstring $1_str; if ($1_len) { $1_str.reserve($1_len); for (jsize i = 0; i < $1_len; ++i) { $1_str.push_back((wchar_t)$1_pstr[i]); } } $1 = &$1_str; jenv->ReleaseStringChars($input, $1_pstr); %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & %{if(!$input) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring"); return $null; } const jchar *$1_pstr = jenv->GetStringChars($input, 0); if (!$1_pstr) return $null; jsize $1_len = jenv->GetStringLength($input); /* possible thread/reentrant code problem */ static std::wstring $1_str; if ($1_len) { $1_str.reserve($1_len); for (jsize i = 0; i < $1_len; ++i) { $1_str.push_back((wchar_t)$1_pstr[i]); } } $result = &$1_str; jenv->ReleaseStringChars($input, $1_pstr); %} %typemap(directorin,descriptor="Ljava/lang/String;") const wstring & { jsize $1_len = $1.length(); jchar *conv_buf = new jchar[$1_len]; for (jsize i = 0; i < $1_len; ++i) { conv_buf[i] = (jchar)($1)[i]; } $input = jenv->NewString(conv_buf, $1_len); delete [] conv_buf; } %typemap(out) const wstring & %{jsize $1_len = $1->length(); jchar *conv_buf = new jchar[$1_len]; for (jsize i = 0; i < $1_len; ++i) { conv_buf[i] = (jchar)(*$1)[i]; } $result = jenv->NewString(conv_buf, $1_len); delete [] conv_buf; %} %typemap(javain) const wstring & "$javainput" %typemap(javaout) const wstring & { return $jnicall; } //%typemap(typecheck) const wstring & = wchar_t *; %typemap(throws) const wstring & %{ std::string message($1.begin(), $1.end()); SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str()); return $null; %} } 0707010008e804000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002600000000root/usr/local/share/swig/2.0.1/ocaml0707010008e811000081a40000000000000000000000014caec288000010e4000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/ocaml/std_list.i/* ----------------------------------------------------------------------------- * std_list.i * * SWIG typemaps for std::list types * ----------------------------------------------------------------------------- */ %include %module std_list %{ #include #include %} namespace std{ template class list { public: typedef T &reference; typedef const T& const_reference; typedef T &iterator; typedef const T& const_iterator; list(); list(unsigned int size, const T& value = T()); list(const list &); ~list(); void assign(unsigned int n, const T& value); void swap(list &x); const_reference front(); const_reference back(); const_iterator begin(); const_iterator end(); void resize(unsigned int n, T c = T()); bool empty() const; void push_front(const T& x); void push_back(const T& x); void pop_front(); void pop_back(); void clear(); unsigned int size() const; unsigned int max_size() const; void resize(unsigned int n, const T& value); void remove(const T& value); void unique(); void reverse(); void sort(); %extend { const_reference __getitem__(int i) throw (std::out_of_range) { std::list::iterator first = self->begin(); int size = int(self->size()); if (i<0) i += size; if (i>=0 && i::iterator first = self->begin(); int size = int(self->size()); if (i<0) i += size; if (i>=0 && i::iterator first = self->begin(); int size = int(self->size()); if (i<0) i += size; if (i>=0 && ierase(first); } else throw std::out_of_range("list index out of range"); } std::list __getslice__(int i,int j) { std::list::iterator first = self->begin(); std::list::iterator end = self->end(); int size = int(self->size()); if (i<0) i += size; if (j<0) j += size; if (i<0) i = 0; if (j>size) j = size; if (i>=j) i=j; if (i>=0 && i=0) { for (int k=0;k tmp(j-i); if (j>i) std::copy(first,end,tmp.begin()); return tmp; } else throw std::out_of_range("list index out of range"); } void __delslice__(int i,int j) { std::list::iterator first = self->begin(); std::list::iterator end = self->end(); int size = int(self->size()); if (i<0) i += size; if (j<0) j += size; if (i<0) i = 0; if (j>size) j = size; for (int k=0;kerase(first,end); } void __setslice__(int i,int j, const std::list& v) { std::list::iterator first = self->begin(); std::list::iterator end = self->end(); int size = int(self->size()); if (i<0) i += size; if (j<0) j += size; if (i<0) i = 0; if (j>size) j = size; for (int k=0;kerase(first,end); if (i+1 <= int(self->size())) { first = self->begin(); for (int k=0;kinsert(first,v.begin(),v.end()); } else self->insert(self->end(),v.begin(),v.end()); } } unsigned int __len__() { return self->size(); } bool __nonzero__() { return !(self->empty()); } void append(const T& x) { self->push_back(x); } void pop() { self->pop_back(); } }; }; } 0707010008e80f000081a40000000000000000000000014caec2880000060c000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/ocaml/std_complex.i// -*- C++ -*- #ifndef SWIG_STD_COMPLEX_I_ #define SWIG_STD_COMPLEX_I_ #ifdef SWIG %{ #include %} namespace std { template class complex; %define specialize_std_complex(T) %typemap(in) complex { if (PyComplex_Check($input)) { $1 = std::complex(PyComplex_RealAsDouble($input), PyComplex_ImagAsDouble($input)); } else if (PyFloat_Check($input)) { $1 = std::complex(PyFloat_AsDouble($input), 0); } else if (PyInt_Check($input)) { $1 = std::complex(PyInt_AsLong($input), 0); } else { PyErr_SetString(PyExc_TypeError,"Expected a complex"); SWIG_fail; } } %typemap(in) const complex& (std::complex temp) { if (PyComplex_Check($input)) { temp = std::complex(PyComplex_RealAsDouble($input), PyComplex_ImagAsDouble($input)); $1 = &temp; } else if (PyFloat_Check($input)) { temp = std::complex(PyFloat_AsDouble($input), 0); $1 = &temp; } else if (PyInt_Check($input)) { temp = std::complex(PyInt_AsLong($input), 0); $1 = &temp; } else { PyErr_SetString(PyExc_TypeError,"Expected a complex"); SWIG_fail; } } %typemap(out) complex { $result = PyComplex_FromDoubles($1.real(), $1.imag()); } %typemap(out) const complex & { $result = PyComplex_FromDoubles($1->real(), $1->imag()); } %enddef specialize_std_complex(double); specialize_std_complex(float); } #endif // SWIG #endif //SWIG_STD_COMPLEX_I_ 0707010008e810000081a40000000000000000000000014caec288000002d2000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/ocaml/std_deque.i/* ----------------------------------------------------------------------------- * std_deque.i * * Default std_deque wrapper * ----------------------------------------------------------------------------- */ %module std_deque %rename(__getitem__) std::deque::getitem; %rename(__setitem__) std::deque::setitem; %rename(__delitem__) std::deque::delitem; %rename(__getslice__) std::deque::getslice; %rename(__setslice__) std::deque::setslice; %rename(__delslice__) std::deque::delslice; %extend std::deque { int __len__() { return (int) self->size(); } int __nonzero__() { return ! self->empty(); } void append(const T &x) { self->push_back(x); } }; %include 0707010008e806000081a40000000000000000000000014caec288000006b6000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/ocaml/class.swg(*Stream:class_ctors*) let create_$classname_from_ptr raw_ptr = C_obj begin let h = Hashtbl.create 20 in List.iter (fun (nm,fn) -> Hashtbl.replace h nm fn) [ "nop", (fun args -> C_void) ; $classbody "&", (fun args -> raw_ptr) ; ":parents", (fun args -> C_list (let out = ref [] in Hashtbl.iter (fun x y -> out := (x,y) :: !out) h ; (List.map (fun (x,y) -> C_string (String.sub x 2 ((String.length x) - 2))) (List.filter (fun (x,y) -> ((String.length x) > 2) && x.[0] == ':' && x.[1] == ':') !out)))) ; ":classof", (fun args -> C_string "$realname") ; ":methods", (fun args -> C_list (let out = ref [] in Hashtbl.iter (fun x y -> out := (C_string x) :: !out) h ; !out)) ] ; let rec invoke_inner raw_ptr mth arg = begin try let application = Hashtbl.find h mth in application (match arg with C_list l -> (C_list (raw_ptr :: l)) | C_void -> (C_list [ raw_ptr ]) | v -> (C_list [ raw_ptr ; v ])) with Not_found -> (* Try parent classes *) begin let parent_classes = [ $baselist ] in let rec try_parent plist raw_ptr = match plist with p :: tl -> begin try (invoke (p raw_ptr)) mth arg with (BadMethodName (p,m,s)) -> try_parent tl raw_ptr end | [] -> raise (BadMethodName (raw_ptr,mth,"$realname")) in try_parent parent_classes raw_ptr end end in (fun mth arg -> invoke_inner raw_ptr mth arg) end let _ = Callback.register "create_$normalized_from_ptr" create_$classname_from_ptr (*Stream:mli*) val create_$classname_from_ptr : c_obj -> c_obj 0707010008e813000081a40000000000000000000000014caec288000002c8000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/ocaml/std_pair.i/* ----------------------------------------------------------------------------- * std_pair.i * * SWIG typemaps for std::pair * ----------------------------------------------------------------------------- */ %include %include // ------------------------------------------------------------------------ // std::pair // ------------------------------------------------------------------------ %{ #include %} namespace std { template struct pair { pair(); pair(T first, U second); pair(const pair& p); template pair(const pair &p); T first; U second; }; // add specializations here } 0707010008e818000081a40000000000000000000000014caec288000006a0000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/ocaml/swig.mli(* -*- tuareg -*- *) type enum = [ `Int of int ] type 'a c_obj_t = C_void | C_bool of bool | C_char of char | C_uchar of char | C_short of int | C_ushort of int | C_int of int | C_uint of int32 | C_int32 of int32 | C_int64 of int64 | C_float of float | C_double of float | C_ptr of int64 * int64 | C_array of 'a c_obj_t array | C_list of 'a c_obj_t list | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) | C_string of string | C_enum of 'a | C_director_core of 'a c_obj_t * 'a c_obj_t option ref type c_obj = enum c_obj_t exception InvalidDirectorCall of c_obj exception NoSuchClass of string val invoke : ('a c_obj_t) -> (string -> 'a c_obj_t -> 'a c_obj_t) val fnhelper : 'a c_obj_t -> 'a c_obj_t list val get_int : 'a c_obj_t -> int val get_float : 'a c_obj_t -> float val get_string : 'a c_obj_t -> string val get_char : 'a c_obj_t -> char val get_bool : 'a c_obj_t -> bool val make_float : float -> 'a c_obj_t val make_double : float -> 'a c_obj_t val make_string : string -> 'a c_obj_t val make_bool : bool -> 'a c_obj_t val make_char : char -> 'a c_obj_t val make_char_i : int -> 'a c_obj_t val make_uchar : char -> 'a c_obj_t val make_uchar_i : int -> 'a c_obj_t val make_short : int -> 'a c_obj_t val make_ushort : int -> 'a c_obj_t val make_int : int -> 'a c_obj_t val make_uint : int -> 'a c_obj_t val make_int32 : int -> 'a c_obj_t val make_int64 : int -> 'a c_obj_t val new_derived_object: ('a c_obj_t -> 'a c_obj_t) -> ('a c_obj_t -> string -> 'a c_obj_t -> 'a c_obj_t) -> 'a c_obj_t -> 'a c_obj_t val register_class_byname : string -> ('a c_obj_t -> 'a c_obj_t) -> unit val create_class : string -> 'a c_obj_t -> 'a c_obj_t 0707010008e81a000081a40000000000000000000000014caec2880000125f000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/ocaml/typecheck.i/* ----------------------------------------------------------------------------- * typecheck.i * * Typechecking rules * ----------------------------------------------------------------------------- */ %typecheck(SWIG_TYPECHECK_INTEGER) char, signed char, const char &, const signed char & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_char: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_INTEGER) unsigned char, const unsigned char & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_uchar: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_INTEGER) short, signed short, const short &, const signed short &, wchar_t { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_short: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_INTEGER) unsigned short, const unsigned short & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_ushort: $1 = 1; break; default: $1 = 0; break; } } } // XXX arty // Will move enum SWIGTYPE later when I figure out what to do with it... %typecheck(SWIG_TYPECHECK_INTEGER) int, signed int, const int &, const signed int &, enum SWIGTYPE { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_int: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_INTEGER) unsigned int, const unsigned int & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_uint: $1 = 1; break; case C_int32: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_INTEGER) long, signed long, unsigned long, long long, signed long long, unsigned long long, const long &, const signed long &, const unsigned long &, const long long &, const signed long long &, const unsigned long long & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_int64: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_INTEGER) bool, oc_bool, BOOL, const bool &, const oc_bool &, const BOOL & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_bool: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_DOUBLE) float, const float & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_float: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_DOUBLE) double, const double & { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_double: $1 = 1; break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_STRING) char * { if( !Is_block($input) ) $1 = 0; else { switch( SWIG_Tag_val($input) ) { case C_string: $1 = 1; break; case C_ptr: { swig_type_info *typeinfo = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field($input,1)); $1 = SWIG_TypeCheck("char *",typeinfo) || SWIG_TypeCheck("signed char *",typeinfo) || SWIG_TypeCheck("unsigned char *",typeinfo) || SWIG_TypeCheck("const char *",typeinfo) || SWIG_TypeCheck("const signed char *",typeinfo) || SWIG_TypeCheck("const unsigned char *",typeinfo) || SWIG_TypeCheck("std::string",typeinfo); } break; default: $1 = 0; break; } } } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { void *ptr; $1 = !caml_ptr_val_internal($input, &ptr,$descriptor); } #if 0 %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *ptr; $1 = !caml_ptr_val_internal($input, &ptr, $&1_descriptor); } #endif %typecheck(SWIG_TYPECHECK_VOIDPTR) void * { void *ptr; $1 = !caml_ptr_val_internal($input, &ptr, 0); } /* ------------------------------------------------------------ * Exception handling * ------------------------------------------------------------ */ %typemap(throws) int, long, short, unsigned int, unsigned long, unsigned short { SWIG_exception($1,"Thrown exception from C++ (int)"); } %typemap(throws) SWIGTYPE CLASS { $&1_ltype temp = new $1_ltype($1); SWIG_exception((int)temp,"Thrown exception from C++ (object)"); } %typemap(throws) SWIGTYPE { (void)$1; SWIG_exception(0,"Thrown exception from C++ (unknown)"); } %typemap(throws) char * { SWIG_exception(0,$1); } 0707010008e819000081a40000000000000000000000014caec28800001736000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/ocaml/swigp4.mlopen Pcaml ;; let lap x y = x :: y let c_ify e loc = match e with <:expr< $int:_$ >> -> <:expr< (C_int $e$) >> | <:expr< $str:_$ >> -> <:expr< (C_string $e$) >> | <:expr< $chr:_$ >> -> <:expr< (C_char $e$) >> | <:expr< $flo:_$ >> -> <:expr< (C_double $e$) >> | <:expr< True >> -> <:expr< (C_bool $e$) >> | <:expr< False >> -> <:expr< (C_bool $e$) >> | _ -> <:expr< $e$ >> let mk_list args loc f = let rec mk_list_inner args loc f = match args with [] -> <:expr< [] >> | x :: xs -> (let loc = MLast.loc_of_expr x in <:expr< [ ($f x loc$) ] @ ($mk_list_inner xs loc f$) >>) in match args with [] -> <:expr< (Obj.magic C_void) >> | [ a ] -> <:expr< (Obj.magic $f a loc$) >> | _ -> <:expr< (Obj.magic (C_list ($mk_list_inner args loc f$))) >> EXTEND expr: [ [ e1 = expr ; "'" ; "[" ; e2 = expr ; "]" -> <:expr< (invoke $e1$) "[]" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< (invoke $e1$) $str:l$ ($mk_list args loc c_ify$) >> | e1 = expr ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< (invoke $e1$) $str:u$ ($mk_list args loc c_ify$) >> | e1 = expr ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< (invoke $e1$) $s$ ($mk_list args loc c_ify$) >> | e1 = expr ; "'" ; "." ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< (invoke $e1$) "()" ($mk_list args loc c_ify$) >> | e1 = expr ; "'" ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:l$ ($mk_list args loc c_ify$) >> | e1 = expr ; "'" ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< (invoke ((invoke $e1$) "->" C_void)) $str:u$ ($mk_list args loc c_ify$) >> | e1 = expr ; "'" ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< (invoke ((invoke $e1$) "->" C_void)) $s$ ($mk_list args loc c_ify$) >> | e1 = expr ; "'" ; "++" -> <:expr< (invoke $e1$) "++" C_void >> | e1 = expr ; "'" ; "--" -> <:expr< (invoke $e1$) "--" C_void >> | e1 = expr ; "'" ; "-" ; e2 = expr -> <:expr< (invoke $e1$) "-" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "+" ; e2 = expr -> <:expr< (invoke $e1$) "+" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "*" ; e2 = expr -> <:expr< (invoke $e1$) "*" (C_list [ $c_ify e2 loc$ ]) >> | "'" ; "&" ; e1 = expr -> <:expr< (invoke $e1$) "&" C_void >> | "'" ; "!" ; e1 = expr -> <:expr< (invoke $e1$) "!" C_void >> | "'" ; "~" ; e1 = expr -> <:expr< (invoke $e1$) "~" C_void >> | e1 = expr ; "'" ; "/" ; e2 = expr -> <:expr< (invoke $e1$) "/" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "%" ; e2 = expr -> <:expr< (invoke $e1$) "%" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "lsl" ; e2 = expr -> <:expr< (invoke $e1$) ("<" ^ "<") (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "lsr" ; e2 = expr -> <:expr< (invoke $e1$) (">" ^ ">") (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "<" ; e2 = expr -> <:expr< (invoke $e1$) "<" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "<=" ; e2 = expr -> <:expr< (invoke $e1$) "<=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; ">" ; e2 = expr -> <:expr< (invoke $e1$) ">" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; ">=" ; e2 = expr -> <:expr< (invoke $e1$) ">=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "==" ; e2 = expr -> <:expr< (invoke $e1$) "==" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "!=" ; e2 = expr -> <:expr< (invoke $e1$) "!=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "&" ; e2 = expr -> <:expr< (invoke $e1$) "&" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "^" ; e2 = expr -> <:expr< (invoke $e1$) "^" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "|" ; e2 = expr -> <:expr< (invoke $e1$) "|" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "&&" ; e2 = expr -> <:expr< (invoke $e1$) "&&" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "||" ; e2 = expr -> <:expr< (invoke $e1$) "||" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "=" ; e2 = expr -> <:expr< (invoke $e1$) "=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "+=" ; e2 = expr -> <:expr< (invoke $e1$) "+=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "-=" ; e2 = expr -> <:expr< (invoke $e1$) "-=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "*=" ; e2 = expr -> <:expr< (invoke $e1$) "*=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "/=" ; e2 = expr -> <:expr< (invoke $e1$) "/=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "%=" ; e2 = expr -> <:expr< (invoke $e1$) "%=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "lsl" ; "=" ; e2 = expr -> <:expr< (invoke $e1$) ("<" ^ "<=") (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "lsr" ; "=" ; e2 = expr -> <:expr< (invoke $e1$) (">" ^ ">=") (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "&=" ; e2 = expr -> <:expr< (invoke $e1$) "&=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "^=" ; e2 = expr -> <:expr< (invoke $e1$) "^=" (C_list [ $c_ify e2 loc$ ]) >> | e1 = expr ; "'" ; "|=" ; e2 = expr -> <:expr< (invoke $e1$) "|=" (C_list [ $c_ify e2 loc$ ]) >> | "'" ; e = expr -> c_ify e loc | c = expr ; "as" ; id = LIDENT -> <:expr< $lid:"get_" ^ id$ $c$ >> | c = expr ; "to" ; id = LIDENT -> <:expr< $uid:"C_" ^ id$ $c$ >> | "`" ; "`" ; l = LIDENT -> <:expr< C_enum `$lid:l$ >> | "`" ; "`" ; u = UIDENT -> <:expr< C_enum `$uid:u$ >> | f = expr ; "'" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> <:expr< $f$ ($mk_list args loc c_ify$) >> ] ] ; END ;; 0707010008e80e000081a40000000000000000000000014caec28800000213000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/ocaml/std_common.i/* ----------------------------------------------------------------------------- * std_common.i * * SWIG typemaps for STL - common utilities * ----------------------------------------------------------------------------- */ %include %apply size_t { std::size_t }; %{ #include CAML_VALUE SwigString_FromString(const std::string& s) { return caml_val_string((char *)s.c_str()); } std::string SwigString_AsString(CAML_VALUE o) { return std::string((char *)caml_ptr_val(o,0)); } %} 0707010008e809000081a40000000000000000000000014caec288000005aa000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/ocaml/ocaml.i/* ----------------------------------------------------------------------------- * ocaml.i * * SWIG Configuration File for Ocaml * ----------------------------------------------------------------------------- */ %runtime %{ #define SWIGSTATIC static %} /* Insert common stuff */ %insert(runtime) "swigrun.swg" /* Include headers */ %insert(runtime) "ocamldec.swg" /* Type registration */ %insert(init) "swiginit.swg" %insert(init) "typeregister.swg" %insert(mlitail) %{ val swig_val : c_enum_type -> c_obj -> Swig.c_obj %} %insert(mltail) %{ let rec swig_val t v = match v with C_enum e -> enum_to_int t v | C_list l -> Swig.C_list (List.map (swig_val t) l) | C_array a -> Swig.C_array (Array.map (swig_val t) a) | _ -> Obj.magic v %} /*#ifndef SWIG_NOINCLUDE*/ %insert(runtime) "ocaml.swg" /*#endif*/ %insert(classtemplate) "class.swg" /* Definitions */ #define SWIG_malloc(size) swig_malloc(size, FUNC_NAME) #define SWIG_free(mem) free(mem) /* Read in standard typemaps. */ %include %include %include %include %include /* ocaml keywords */ /* There's no need to use this, because of my rewriting machinery. C++ * words never collide with ocaml keywords */ /* still we include the file, but the warning says that the offending name will be properly renamed. Just to let the user to know about it. */ %include 0707010008e816000081a40000000000000000000000014caec28800000165000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/ocaml/stl.i/* ----------------------------------------------------------------------------- * stl.i * * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include %include %include %include %include 0707010008e80a000081a40000000000000000000000014caec28800003816000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/ocaml/ocaml.swg/* -*-c-*- */ /* SWIG pointer structure */ #include #include #ifdef __cplusplus extern "C" { #endif #define C_bool 0 #define C_char 1 #define C_uchar 2 #define C_short 3 #define C_ushort 4 #define C_int 5 #define C_uint 6 #define C_int32 7 #define C_int64 8 #define C_float 9 #define C_double 10 #define C_ptr 11 #define C_array 12 #define C_list 13 #define C_obj 14 #define C_string 15 #define C_enum 16 #define C_director_core 17 /* Cast a pointer if possible; returns 1 if successful */ SWIGSTATIC int SWIG_Cast (void *source, swig_type_info *source_type, void **ptr, swig_type_info *dest_type) { if( !source ) { // Special case for NULL. This is a popular question // for other modules on the list, so I want an easy way out... *ptr = 0; return 0; } #ifdef TYPE_CAST_VERBOSE fprintf( stderr, "Trying to cast %s to %s\n", source_type ? source_type->str : "", dest_type ? dest_type->str : "" ); #endif if (dest_type != source_type) { /* We have a type mismatch. Will have to look through our type mapping table to figure out whether or not we can accept this datatype. -- Ignore typechecks for void *. Allow any conversion. */ if( !dest_type || !source_type || !strcmp(dest_type->name,"_p_void") || !strcmp(source_type->name,"_p_void") ) { *ptr = source; return 0; } else { swig_cast_info *tc = SWIG_TypeCheckStruct(source_type, dest_type ); #ifdef TYPE_CAST_VERBOSE fprintf( stderr, "Typecheck -> %s\n", tc ? tc->str : "" ); #endif if( tc ) { int newmemory = 0; *ptr = SWIG_TypeCast(tc, source, &newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ return 0; } else return -1; } } else { *ptr = source; return 0; } } /* Return 0 if successful. */ SWIGSTATIC int SWIG_GetPtr(void *inptr, void **outptr, swig_type_info *intype, swig_type_info *outtype) { if (intype) { return SWIG_Cast(inptr, intype, outptr, outtype) == -1; } else { *outptr = inptr; return 0; } } SWIGSTATIC void caml_print_list( CAML_VALUE v ); SWIGSTATIC void caml_print_val( CAML_VALUE v ) { switch( SWIG_Tag_val(v) ) { case C_bool: if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " ); else fprintf( stderr, "false " ); break; case C_char: case C_uchar: fprintf( stderr, "'%c' (\\%03d) ", (Int_val(SWIG_Field(v,0)) >= ' ' && Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.', Int_val(SWIG_Field(v,0)) ); break; case C_short: case C_ushort: case C_int: fprintf( stderr, "%d ", (int)caml_long_val(v) ); break; case C_uint: case C_int32: fprintf( stderr, "%ud ", (unsigned int)caml_long_val(v) ); break; case C_int64: fprintf( stderr, "%ld ", caml_long_val(v) ); break; case C_float: case C_double: fprintf( stderr, "%f ", caml_double_val(v) ); break; case C_ptr: { void *vout = 0; swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); caml_ptr_val_internal(v,&vout,0); fprintf( stderr, "PTR(%p,%s) ", vout, ty ? ty->name : "(null)" ); } break; case C_array: { unsigned int i; for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) caml_print_val( SWIG_Field(SWIG_Field(v,0),i) ); } break; case C_list: caml_print_list( SWIG_Field(v,0) ); break; case C_obj: fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) ); break; case C_string: { void *cout; caml_ptr_val_internal(v,&cout,0); fprintf( stderr, "'%s' ", (char *)cout ); } break; } } SWIGSTATIC void caml_print_list( CAML_VALUE v ) { CAMLparam1(v); while( v && Is_block(v) ) { fprintf( stderr, "[ " ); caml_print_val( SWIG_Field(v,0) ); fprintf( stderr, "]\n" ); v = SWIG_Field(v,1); } CAMLreturn0; } SWIGSTATIC CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) { CAMLparam1(lst); int i = 0; while( i < n && lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); } if( lst == Val_unit ) CAMLreturn(Val_unit); else CAMLreturn(SWIG_Field(lst,0)); } SWIGSTATIC CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) { CAMLparam2(lst,elt); SWIG_CAMLlocal3(v,vt,lh); lh = Val_unit; v = Val_unit; /* Appending C_void should have no effect */ if( !Is_block(elt) ) return lst; while( lst && Is_block(lst) ) { if( v && v != Val_unit ) { vt = alloc_tuple(2); SWIG_Store_field(v,1,vt); v = vt; } else { v = lh = alloc_tuple(2); } SWIG_Store_field(v,0,SWIG_Field(lst,0)); lst = SWIG_Field(lst,1); } if( v && Is_block(v) ) { vt = alloc_tuple(2); SWIG_Store_field(v,1,vt); v = vt; } else { v = lh = alloc_tuple(2); } SWIG_Store_field(v,0,elt); SWIG_Store_field(v,1,Val_unit); CAMLreturn(lh); } SWIGSTATIC int caml_list_length( CAML_VALUE lst ) { CAMLparam1(lst); int i = 0; while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); } CAMLreturn(i); } SWIGSTATIC void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) { CAMLparam2(arr,item); SWIG_Store_field(SWIG_Field(arr,0),n,item); CAMLreturn0; } SWIGSTATIC value caml_array_nth( CAML_VALUE arr, int n ) { CAMLparam1(arr); if( SWIG_Tag_val(arr) == C_array ) CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n)); else if( SWIG_Tag_val(arr) == C_list ) CAMLreturn(caml_list_nth(arr,0)); else failwith("Need array or list"); } SWIGSTATIC int caml_array_len( CAML_VALUE arr ) { CAMLparam1(arr); if( SWIG_Tag_val(arr) == C_array ) CAMLreturn(Wosize_val(SWIG_Field(arr,0))); else if( SWIG_Tag_val(arr) == C_list ) CAMLreturn(caml_list_length(arr)); else failwith("Need array or list"); } SWIGSTATIC CAML_VALUE caml_swig_alloc(int x,int y) { return caml_alloc(x,y); } SWIGSTATIC value caml_array_new( int n ) { CAMLparam0(); SWIG_CAMLlocal1(vv); vv = caml_swig_alloc(1,C_array); SWIG_Store_field(vv,0,alloc_tuple(n)); CAMLreturn(vv); } SWIGSTATIC CAML_VALUE caml_val_bool( int b ) { CAMLparam0(); SWIG_CAMLlocal1(bv); bv = caml_swig_alloc(1,C_bool); SWIG_Store_field(bv,0,Val_bool(b)); CAMLreturn(bv); } SWIGSTATIC CAML_VALUE caml_val_char( char c ) { CAMLparam0(); SWIG_CAMLlocal1(cv); cv = caml_swig_alloc(1,C_char); SWIG_Store_field(cv,0,Val_int(c)); CAMLreturn(cv); } SWIGSTATIC CAML_VALUE caml_val_uchar( unsigned char uc ) { CAMLparam0(); SWIG_CAMLlocal1(ucv); ucv = caml_swig_alloc(1,C_uchar); SWIG_Store_field(ucv,0,Val_int(uc)); CAMLreturn(ucv); } SWIGSTATIC CAML_VALUE caml_val_short( short s ) { CAMLparam0(); SWIG_CAMLlocal1(sv); sv = caml_swig_alloc(1,C_short); SWIG_Store_field(sv,0,Val_int(s)); CAMLreturn(sv); } SWIGSTATIC CAML_VALUE caml_val_ushort( unsigned short us ) { CAMLparam0(); SWIG_CAMLlocal1(usv); usv = caml_swig_alloc(1,C_ushort); SWIG_Store_field(usv,0,Val_int(us)); CAMLreturn(usv); } SWIGSTATIC CAML_VALUE caml_val_int( int i ) { CAMLparam0(); SWIG_CAMLlocal1(iv); iv = caml_swig_alloc(1,C_int); SWIG_Store_field(iv,0,Val_int(i)); CAMLreturn(iv); } SWIGSTATIC CAML_VALUE caml_val_uint( unsigned int ui ) { CAMLparam0(); SWIG_CAMLlocal1(uiv); uiv = caml_swig_alloc(1,C_int); SWIG_Store_field(uiv,0,Val_int(ui)); CAMLreturn(uiv); } SWIGSTATIC CAML_VALUE caml_val_long( long l ) { CAMLparam0(); SWIG_CAMLlocal1(lv); lv = caml_swig_alloc(1,C_int64); SWIG_Store_field(lv,0,copy_int64(l)); CAMLreturn(lv); } SWIGSTATIC CAML_VALUE caml_val_ulong( unsigned long ul ) { CAMLparam0(); SWIG_CAMLlocal1(ulv); ulv = caml_swig_alloc(1,C_int64); SWIG_Store_field(ulv,0,copy_int64(ul)); CAMLreturn(ulv); } SWIGSTATIC CAML_VALUE caml_val_float( float f ) { CAMLparam0(); SWIG_CAMLlocal1(fv); fv = caml_swig_alloc(1,C_float); SWIG_Store_field(fv,0,copy_double((double)f)); CAMLreturn(fv); } SWIGSTATIC CAML_VALUE caml_val_double( double d ) { CAMLparam0(); SWIG_CAMLlocal1(fv); fv = caml_swig_alloc(1,C_double); SWIG_Store_field(fv,0,copy_double(d)); CAMLreturn(fv); } SWIGSTATIC CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) { CAMLparam0(); SWIG_CAMLlocal1(vv); vv = caml_swig_alloc(2,C_ptr); SWIG_Store_field(vv,0,copy_int64((long)p)); SWIG_Store_field(vv,1,copy_int64((long)info)); CAMLreturn(vv); } SWIGSTATIC CAML_VALUE caml_val_string( const char *p ) { CAMLparam0(); SWIG_CAMLlocal1(vv); if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); vv = caml_swig_alloc(1,C_string); SWIG_Store_field(vv,0,copy_string(p)); CAMLreturn(vv); } SWIGSTATIC CAML_VALUE caml_val_string_len( const char *p, int len ) { CAMLparam0(); SWIG_CAMLlocal1(vv); if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 )); vv = caml_swig_alloc(1,C_string); SWIG_Store_field(vv,0,alloc_string(len)); memcpy(String_val(SWIG_Field(vv,0)),p,len); CAMLreturn(vv); } #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name) SWIGSTATIC CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) { CAMLparam0(); CAMLreturn(callback2(*caml_named_value("caml_create_object_fn"), caml_val_ptr(v,type), copy_string(name))); } SWIGSTATIC long caml_long_val_full( CAML_VALUE v, char *name ) { CAMLparam1(v); if( !Is_block(v) ) return 0; switch( SWIG_Tag_val(v) ) { case C_bool: case C_char: case C_uchar: case C_short: case C_ushort: case C_int: CAMLreturn(Int_val(SWIG_Field(v,0))); case C_uint: case C_int32: CAMLreturn(Int32_val(SWIG_Field(v,0))); case C_int64: CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0))); case C_float: case C_double: CAMLreturn((long)Double_val(SWIG_Field(v,0))); case C_string: CAMLreturn((long)String_val(SWIG_Field(v,0))); case C_ptr: CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0))); case C_enum: { SWIG_CAMLlocal1(ret); CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); if( !name ) failwith( "Not an enum conversion" ); ret = callback2(*enum_to_int,*caml_named_value(name),v); CAMLreturn(caml_long_val(ret)); } default: failwith("No conversion to int"); } } SWIGSTATIC long caml_long_val( CAML_VALUE v ) { return caml_long_val_full(v,0); } SWIGSTATIC double caml_double_val( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0.0; switch( SWIG_Tag_val(v) ) { case C_bool: case C_char: case C_uchar: case C_short: case C_ushort: case C_int: CAMLreturn_type(Int_val(SWIG_Field(v,0))); case C_uint: case C_int32: CAMLreturn_type(Int32_val(SWIG_Field(v,0))); case C_int64: CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0))); case C_float: case C_double: CAMLreturn_type(Double_val(SWIG_Field(v,0))); default: fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) ); failwith("No conversion to double"); } } SWIGSTATIC int caml_ptr_val_internal( CAML_VALUE v, void **out, swig_type_info *descriptor ) { CAMLparam1(v); void *outptr = NULL; swig_type_info *outdescr = NULL; if( v == Val_unit ) { *out = 0; CAMLreturn(0); } if( !Is_block(v) ) return -1; switch( SWIG_Tag_val(v) ) { case C_int: if( !caml_long_val( v ) ) { *out = 0; CAMLreturn(0); } else { *out = 0; CAMLreturn(1); } break; case C_obj: CAMLreturn (caml_ptr_val_internal (callback(*caml_named_value("caml_obj_ptr"),v), out,descriptor)); case C_string: outptr = (void *)String_val(SWIG_Field(v,0)); break; case C_ptr: outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0)); outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1)); break; default: *out = 0; CAMLreturn(1); break; } CAMLreturn(SWIG_GetPtr(outptr,out,outdescr,descriptor)); } SWIGSTATIC void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) { CAMLparam0(); #ifdef TYPE_CAST_VERBOSE caml_print_val( v ); #endif void *out = NULL; if( !caml_ptr_val_internal( v, &out, descriptor ) ) CAMLreturn_type(out); else failwith( "No appropriate conversion found." ); } SWIGSTATIC char *caml_string_val( CAML_VALUE v ) { return (char *)caml_ptr_val( v, 0 ); } SWIGSTATIC int caml_string_len( CAML_VALUE v ) { switch( SWIG_Tag_val(v) ) { case C_string: return string_length(SWIG_Field(v,0)); default: return strlen((char *)caml_ptr_val(v,0)); } } SWIGSTATIC int caml_bool_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; switch( SWIG_Tag_val(v) ) { case C_bool: case C_ptr: case C_string: CAMLreturn(1); default: CAMLreturn(0); } } SWIGSTATIC int caml_int_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; switch( SWIG_Tag_val(v) ) { case C_char: case C_uchar: case C_short: case C_ushort: case C_int: case C_uint: case C_int32: case C_int64: CAMLreturn(1); default: CAMLreturn(0); } } SWIGSTATIC int caml_float_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; switch( SWIG_Tag_val(v) ) { case C_float: case C_double: CAMLreturn(1); default: CAMLreturn(0); } } SWIGSTATIC int caml_ptr_check( CAML_VALUE v ) { CAMLparam1(v); if( !Is_block(v) ) return 0; switch( SWIG_Tag_val(v) ) { case C_string: case C_ptr: case C_int64: CAMLreturn(1); default: CAMLreturn(0); } } static swig_module_info *SWIG_Ocaml_GetModule() { CAML_VALUE pointer; pointer = callback(*caml_named_value("swig_find_type_info"), caml_val_int(0)); if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) { return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0)); } return 0; } static void SWIG_Ocaml_SetModule(swig_module_info *pointer) { CAML_VALUE mod_pointer; mod_pointer = caml_val_ptr(pointer, NULL); callback(*caml_named_value("swig_set_type_info"), mod_pointer); } #ifdef __cplusplus } #endif #undef value 0707010008e805000081a40000000000000000000000014caec28800000cb4000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/ocaml/carray.i%insert(mli) %{ type _value = c_obj %} %insert(ml) %{ type _value = c_obj %} %define %array_tmap_out(type,what,out_f) %typemap(type) what [ANY] { int i; /* $*1_type */ $result = caml_array_new($1_dim0); for( i = 0; i < $1_dim0; i++ ) { caml_array_set($result,i,out_f($1[i])); } } %enddef %define %array_tmap_in(type,what,in_f) %typemap(type) what [ANY] { int i; /* $*1_type */ $1 = ($*1_type *)malloc( $1_size ); for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = in_f(caml_array_nth($input,i)); } } %typemap(free) what [ANY] { free( (void *)$1 ); } %enddef %define %make_simple_array_typemap(type,out_f,in_f) %array_tmap_out(out,type,out_f); %array_tmap_out(varout,type,out_f); %array_tmap_out(directorin,type,out_f); %array_tmap_in(in,type,in_f); %array_tmap_in(varin,type,in_f); %array_tmap_in(directorout,type,in_f); %enddef %make_simple_array_typemap(bool,caml_val_bool,caml_long_val); %make_simple_array_typemap(short,caml_val_short,caml_long_val); %make_simple_array_typemap(unsigned short,caml_val_ushort,caml_long_val); %make_simple_array_typemap(int,caml_val_int,caml_long_val); %make_simple_array_typemap(unsigned int,caml_val_uint,caml_long_val); %make_simple_array_typemap(long,caml_val_long,caml_long_val); %make_simple_array_typemap(unsigned long,caml_val_ulong,caml_long_val); %make_simple_array_typemap(size_t,caml_val_int,caml_long_val); %make_simple_array_typemap(float,caml_val_float,caml_double_val); %make_simple_array_typemap(double,caml_val_double,caml_double_val); #ifdef __cplusplus %typemap(in) SWIGTYPE [] { int i; /* $*1_type */ $1 = new $*1_type [$1_dim0]; for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = *(($*1_ltype *) caml_ptr_val(caml_array_nth($input,i), $*1_descriptor)) ; } } #else %typemap(in) SWIGTYPE [] { int i; /* $*1_type */ $1 = ($*1_type *)malloc( $1_size ); for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = *(($*1_ltype) caml_ptr_val(caml_array_nth($input), $*1_descriptor)); } } #endif %typemap(out) SWIGTYPE [] { int i; CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); $result = caml_array_new($1_dim0); for( i = 0; i < $1_dim0; i++ ) { if( fromval ) { caml_array_set ($result, i, callback(*fromval,caml_val_ptr((void *)&$1[i],$*1_descriptor))); } else { caml_array_set ($result, i, caml_val_ptr ((void *)&$1[i],$&1_descriptor)); } } } %typemap(in) enum SWIGTYPE [] { int i; /* $*1_type */ $1 = ($*1_type *)malloc( $1_size ); for( i = 0; i < $1_dim0 && i < caml_array_len($input); i++ ) { $1[i] = ($type) caml_long_val_full(caml_array_nth($input), "$type_marker"); } } %typemap(out) enum SWIGTYPE [] { int i; $result = caml_array_new($1_dim0); for( i = 0; i < $1_dim0; i++ ) { caml_array_set ($result, i, callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"), *caml_named_value("$type_marker"), Val_int($1[i]))); } } #ifdef __cplusplus %typemap(freearg) SWIGTYPE [ANY] { delete [] $1; } #else %typemap(freearg) SWIGTYPE [ANY] { free( (void *)$1 ); } #endif 0707010008e80c000081a40000000000000000000000014caec2880000042a000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/ocaml/ocamlkw.swg#ifndef OCAML_OCAMLKW_SWG_ #define OCAML_OCAMLKW_SWG_ /* Warnings for Ocaml keywords */ #define OCAMLKW(x) %namewarn("314: '" #x "' is an ocaml keyword and it will be appropriately renamed") #x /* from http://caml.inria.fr/ocaml/htmlman/manual044.html */ OCAMLKW(and); OCAMLKW(as); OCAMLKW(assert); OCAMLKW(begin); OCAMLKW(class); OCAMLKW(constraint); OCAMLKW(do); OCAMLKW(done); OCAMLKW(downto); OCAMLKW(else); OCAMLKW(end); OCAMLKW(exception); OCAMLKW(external); OCAMLKW(false); OCAMLKW(for); OCAMLKW(fun); OCAMLKW(function); OCAMLKW(functor); OCAMLKW(if); OCAMLKW(in); OCAMLKW(include); OCAMLKW(inherit); OCAMLKW(initializer); OCAMLKW(lazy); OCAMLKW(let); OCAMLKW(match); OCAMLKW(method); OCAMLKW(module); OCAMLKW(mutable); OCAMLKW(new); OCAMLKW(object); OCAMLKW(of); OCAMLKW(open); OCAMLKW(or); OCAMLKW(private); OCAMLKW(rec); OCAMLKW(sig); OCAMLKW(struct); OCAMLKW(then); OCAMLKW(to); OCAMLKW(true); OCAMLKW(try); OCAMLKW(type); OCAMLKW(val); OCAMLKW(virtual); OCAMLKW(when); OCAMLKW(while); OCAMLKW(with); #undef OCAMLKW #endif //OCAML_OCAMLKW_SWG_ 0707010008e812000081a40000000000000000000000014caec28800000898000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/ocaml/std_map.i/* ----------------------------------------------------------------------------- * std_map.i * * SWIG typemaps for std::map * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::map // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class map { // add typemaps here public: map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { const T& get(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { (*self)[key] = x; } void del(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(const K& key) { std::map::iterator i = self->find(key); return i != self->end(); } } }; // Legacy macros (deprecated) %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) #warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" %enddef } 0707010008e808000081a40000000000000000000000014caec28800000bc1000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/ocaml/director.swg/* ----------------------------------------------------------------------------- * director.swg * * This file contains support for director classes that proxy * method calls from C++ to Ocaml extensions. * * ----------------------------------------------------------------------------- */ #ifdef __cplusplus #include # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) namespace Swig { /* base class for director exceptions */ class DirectorException { protected: std::string swig_msg; public: DirectorException(const char* msg="") { } const char *getMessage() const { return swig_msg.c_str(); } virtual ~DirectorException() {} }; /* type mismatch in the return value from a python method call */ class DirectorTypeMismatchException : public Swig::DirectorException { public: DirectorTypeMismatchException(const char* msg="") { } }; /* any python exception that occurs during a director method call */ class DirectorMethodException : public Swig::DirectorException {}; /* attempt to call a pure virtual method via a director method */ class DirectorPureVirtualException : public Swig::DirectorException { public: DirectorPureVirtualException(const char* msg="") { } static void raise(const char *msg) { throw DirectorPureVirtualException(msg); } }; /* simple thread abstraction for pthreads on win32 */ #ifdef __THREAD__ #define __PTHREAD__ #if defined(_WIN32) || defined(__WIN32__) #define pthread_mutex_lock EnterCriticalSection #define pthread_mutex_unlock LeaveCriticalSection #define pthread_mutex_t CRITICAL_SECTION #define MUTEX_INIT(var) CRITICAL_SECTION var #else #include #define MUTEX_INIT(var) pthread_mutex_t var = PTHREAD_MUTEX_INITIALIZER #endif #endif /* director base class */ class Director { private: /* pointer to the wrapped ocaml object */ CAML_VALUE swig_self; /* flag indicating whether the object is owned by ocaml or c++ */ mutable bool swig_disown_flag; public: /* wrap a ocaml object, optionally taking ownership */ Director(CAML_VALUE self) : swig_self(self), swig_disown_flag(false) { register_global_root(&swig_self); } /* discard our reference at destruction */ virtual ~Director() { remove_global_root(&swig_self); swig_disown(); // Disown is safe here because we're just divorcing a reference that // points to us. } /* return a pointer to the wrapped ocaml object */ CAML_VALUE swig_get_self() const { return swig_self; } /* acquire ownership of the wrapped ocaml object (the sense of "disown" * is from ocaml) */ void swig_disown() const { if (!swig_disown_flag) { swig_disown_flag=true; callback(*caml_named_value("caml_obj_disown"),swig_self); } } }; } #endif /* __cplusplus */ 0707010008e807000081a40000000000000000000000014caec288000017b7000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/ocaml/cstring.i/* ----------------------------------------------------------------------------- * cstring.i * * This file provides typemaps and macros for dealing with various forms * of C character string handling. The primary use of this module * is in returning character data that has been allocated or changed in * some way. * ----------------------------------------------------------------------------- */ /* %cstring_input_binary(TYPEMAP, SIZE) * * Macro makes a function accept binary string data along with * a size. */ %define %cstring_input_binary(TYPEMAP, SIZE) %apply (char *STRING, int LENGTH) { (TYPEMAP, SIZE) }; %enddef /* * %cstring_bounded_output(TYPEMAP, MAX) * * This macro is used to return a NULL-terminated output string of * some maximum length. For example: * * %cstring_bounded_output(char *outx, 512); * void foo(char *outx) { * sprintf(outx,"blah blah\n"); * } * */ %define %cstring_bounded_output(TYPEMAP,MAX) %typemap(ignore) TYPEMAP(char temp[MAX+1]) { $1 = ($1_ltype) temp; } %typemap(argout) TYPEMAP { $1[MAX] = 0; $result = caml_list_append($result,caml_val_string(str)); } %enddef /* * %cstring_chunk_output(TYPEMAP, SIZE) * * This macro is used to return a chunk of binary string data. * Embedded NULLs are okay. For example: * * %cstring_chunk_output(char *outx, 512); * void foo(char *outx) { * memmove(outx, somedata, 512); * } * */ %define %cstring_chunk_output(TYPEMAP,SIZE) %typemap(ignore) TYPEMAP(char temp[SIZE]) { $1 = ($1_ltype) temp; } %typemap(argout) TYPEMAP { $result = caml_list_append($result,caml_val_string_len($1,SIZE)); } %enddef /* * %cstring_bounded_mutable(TYPEMAP, SIZE) * * This macro is used to wrap a string that's going to mutate. * * %cstring_bounded_mutable(char *in, 512); * void foo(in *x) { * while (*x) { * *x = toupper(*x); * x++; * } * } * */ %define %cstring_bounded_mutable(TYPEMAP,MAX) %typemap(in) TYPEMAP(char temp[MAX+1]) { char *t = (char *)caml_ptr_val($input); strncpy(temp,t,MAX); $1 = ($1_ltype) temp; } %typemap(argout) TYPEMAP { $result = caml_list_append($result,caml_val_string_len($1,MAX)); } %enddef /* * %cstring_mutable(TYPEMAP [, expansion]) * * This macro is used to wrap a string that will mutate in place. * It may change size up to a user-defined expansion. * * %cstring_mutable(char *in); * void foo(in *x) { * while (*x) { * *x = toupper(*x); * x++; * } * } * */ %define %cstring_mutable(TYPEMAP,...) %typemap(in) TYPEMAP { char *t = String_val($input); int n = string_length($input); $1 = ($1_ltype) t; #if #__VA_ARGS__ == "" #ifdef __cplusplus $1 = ($1_ltype) new char[n+1]; #else $1 = ($1_ltype) malloc(n+1); #endif #else #ifdef __cplusplus $1 = ($1_ltype) new char[n+1+__VA_ARGS__]; #else $1 = ($1_ltype) malloc(n+1+__VA_ARGS__); #endif #endif memmove($1,t,n); $1[n] = 0; } %typemap(argout) TYPEMAP { $result = caml_list_append($result,caml_val_string($1)); #ifdef __cplusplus delete[] $1; #else free($1); #endif } %enddef /* * %cstring_output_maxsize(TYPEMAP, SIZE) * * This macro returns data in a string of some user-defined size. * * %cstring_output_maxsize(char *outx, int max) { * void foo(char *outx, int max) { * sprintf(outx,"blah blah\n"); * } */ %define %cstring_output_maxsize(TYPEMAP, SIZE) %typemap(in) (TYPEMAP, SIZE) { $2 = caml_val_long($input); #ifdef __cplusplus $1 = ($1_ltype) new char[$2+1]; #else $1 = ($1_ltype) malloc($2+1); #endif } %typemap(argout) (TYPEMAP,SIZE) { $result = caml_list_append($result,caml_val_string($1)); #ifdef __cplusplus delete [] $1; #else free($1); #endif } %enddef /* * %cstring_output_withsize(TYPEMAP, SIZE) * * This macro is used to return character data along with a size * parameter. * * %cstring_output_maxsize(char *outx, int *max) { * void foo(char *outx, int *max) { * sprintf(outx,"blah blah\n"); * *max = strlen(outx); * } */ %define %cstring_output_withsize(TYPEMAP, SIZE) %typemap(in) (TYPEMAP, SIZE) { int n = caml_val_long($input); #ifdef __cplusplus $1 = ($1_ltype) new char[n+1]; $2 = ($2_ltype) new $*1_ltype; #else $1 = ($1_ltype) malloc(n+1); $2 = ($2_ltype) malloc(sizeof($*1_ltype)); #endif *$2 = n; } %typemap(argout) (TYPEMAP,SIZE) { $result = caml_list_append($result,caml_val_string_len($1,$2)); #ifdef __cplusplus delete [] $1; delete $2; #else free($1); free($2); #endif } %enddef /* * %cstring_output_allocate(TYPEMAP, RELEASE) * * This macro is used to return character data that was * allocated with new or malloc. * * %cstring_output_allocated(char **outx, free($1)); * void foo(char **outx) { * *outx = (char *) malloc(512); * sprintf(outx,"blah blah\n"); * } */ %define %cstring_output_allocate(TYPEMAP, RELEASE) %typemap(ignore) TYPEMAP($*1_ltype temp = 0) { $1 = &temp; } %typemap(argout) TYPEMAP { if (*$1) { $result = caml_list_append($result,caml_val_string($1)); RELEASE; } else { $result = caml_list_append($result,caml_val_ptr($1)); } } %enddef /* * %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) * * This macro is used to return character data that was * allocated with new or malloc. * * %cstring_output_allocated(char **outx, int *sz, free($1)); * void foo(char **outx, int *sz) { * *outx = (char *) malloc(512); * sprintf(outx,"blah blah\n"); * *sz = strlen(outx); * } */ %define %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) %typemap(ignore) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { $1 = &temp; $2 = &tempn; } %typemap(argout)(TYPEMAP,SIZE) { if (*$1) { $result = caml_list_append($result,caml_val_string_len($1,$2)); RELEASE; } else $result = caml_list_append($result,caml_val_ptr($1)); } %enddef 0707010008e817000081a40000000000000000000000014caec2880000124c000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/ocaml/swig.ml(* -*- tuareg -*- *) open Int32 open Int64 type enum = [ `Int of int ] type 'a c_obj_t = C_void | C_bool of bool | C_char of char | C_uchar of char | C_short of int | C_ushort of int | C_int of int | C_uint of int32 | C_int32 of int32 | C_int64 of int64 | C_float of float | C_double of float | C_ptr of int64 * int64 | C_array of 'a c_obj_t array | C_list of 'a c_obj_t list | C_obj of (string -> 'a c_obj_t -> 'a c_obj_t) | C_string of string | C_enum of 'a | C_director_core of 'a c_obj_t * 'a c_obj_t option ref type c_obj = enum c_obj_t exception BadArgs of string exception BadMethodName of string * string exception NotObject of c_obj exception NotEnumType of c_obj exception LabelNotFromThisEnum of c_obj exception InvalidDirectorCall of c_obj exception NoSuchClass of string let rec invoke obj = match obj with C_obj o -> o | C_director_core (o,r) -> invoke o | _ -> raise (NotObject (Obj.magic obj)) let _ = Callback.register "swig_runmethod" invoke let fnhelper arg = match arg with C_list l -> l | C_void -> [] | _ -> [ arg ] let rec get_int x = match x with C_bool b -> if b then 1 else 0 | C_char c | C_uchar c -> (int_of_char c) | C_short s | C_ushort s | C_int s -> s | C_uint u | C_int32 u -> (Int32.to_int u) | C_int64 u -> (Int64.to_int u) | C_float f -> (int_of_float f) | C_double d -> (int_of_float d) | C_ptr (p,q) -> (Int64.to_int p) | C_obj o -> (try (get_int (o "int" C_void)) with _ -> (get_int (o "&" C_void))) | _ -> raise (Failure "Can't convert to int") let rec get_float x = match x with C_char c | C_uchar c -> (float_of_int (int_of_char c)) | C_short s -> (float_of_int s) | C_ushort s -> (float_of_int s) | C_int s -> (float_of_int s) | C_uint u | C_int32 u -> (float_of_int (Int32.to_int u)) | C_int64 u -> (float_of_int (Int64.to_int u)) | C_float f -> f | C_double d -> d | C_obj o -> (try (get_float (o "float" C_void)) with _ -> (get_float (o "double" C_void))) | _ -> raise (Failure "Can't convert to float") let rec get_char x = (char_of_int (get_int x)) let rec get_string x = match x with C_string str -> str | _ -> raise (Failure "Can't convert to string") let rec get_bool x = match x with C_bool b -> b | _ -> (try if get_int x != 0 then true else false with _ -> raise (Failure "Can't convert to bool")) let disown_object obj = match obj with C_director_core (o,r) -> r := None | _ -> raise (Failure "Not a director core object") let _ = Callback.register "caml_obj_disown" disown_object let addr_of obj = match obj with C_obj _ -> (invoke obj) "&" C_void | C_director_core (self,r) -> (invoke self) "&" C_void | C_ptr _ -> obj | _ -> raise (Failure "Not a pointer.") let _ = Callback.register "caml_obj_ptr" addr_of let make_float f = C_float f let make_double f = C_double f let make_string s = C_string s let make_bool b = C_bool b let make_char c = C_char c let make_char_i c = C_char (char_of_int c) let make_uchar c = C_uchar c let make_uchar_i c = C_uchar (char_of_int c) let make_short i = C_short i let make_ushort i = C_ushort i let make_int i = C_int i let make_uint i = C_uint (Int32.of_int i) let make_int32 i = C_int32 (Int32.of_int i) let make_int64 i = C_int64 (Int64.of_int i) let new_derived_object cfun x_class args = begin let get_object ob = match !ob with None -> raise (NotObject C_void) | Some o -> o in let ob_ref = ref None in let class_fun class_f ob_r = (fun meth args -> class_f (get_object ob_r) meth args) in let new_class = class_fun x_class ob_ref in let dircore = C_director_core (C_obj new_class,ob_ref) in let obj = cfun (match args with C_list argl -> (C_list ((dircore :: argl))) | C_void -> (C_list [ dircore ]) | a -> (C_list [ dircore ; a ])) in ob_ref := Some obj ; obj end let swig_current_type_info = ref C_void let find_type_info obj = !swig_current_type_info let _ = Callback.register "swig_find_type_info" find_type_info let set_type_info obj = match obj with C_ptr _ -> swig_current_type_info := obj ; obj | _ -> raise (Failure "Internal error: passed non pointer to set_type_info") let _ = Callback.register "swig_set_type_info" set_type_info let class_master_list = Hashtbl.create 20 let register_class_byname nm co = Hashtbl.replace class_master_list nm (Obj.magic co) let create_class nm arg = try (Obj.magic (Hashtbl.find class_master_list nm)) arg with _ -> raise (NoSuchClass nm) 0707010008e815000081a40000000000000000000000014caec28800000ac2000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/ocaml/std_vector.i/* ----------------------------------------------------------------------------- * std_vector.i * * SWIG typemaps for std::vector types * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::vector // // The aim of all that follows would be to integrate std::vector with // Python as much as possible, namely, to allow the user to pass and // be returned Python tuples or lists. // const declarations are used to guess the intent of the function being // exported; therefore, the following rationale is applied: // // -- f(std::vector), f(const std::vector&), f(const std::vector*): // the parameter being read-only, either a Python sequence or a // previously wrapped std::vector can be passed. // -- f(std::vector&), f(std::vector*): // the parameter must be modified; therefore, only a wrapped std::vector // can be passed. // -- std::vector f(): // the vector is returned by copy; therefore, a Python sequence of T:s // is returned which is most easily used in other Python functions // -- std::vector& f(), std::vector* f(), const std::vector& f(), // const std::vector* f(): // the vector is returned by reference; therefore, a wrapped std::vector // is returned // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class vector { public: vector(unsigned int size = 0); vector(unsigned int size, const T& value); vector(const vector&); unsigned int size() const; bool empty() const; void clear(); void push_back(const T& x); T operator [] ( int f ); vector &operator = ( vector &other ); %extend { void set( int i, const T &x ) { self->resize(i+1); (*self)[i] = x; } }; %extend { T *to_array() { T *array = new T[self->size() + 1]; for( int i = 0; i < self->size(); i++ ) array[i] = (*self)[i]; return array; } }; }; }; %insert(ml) %{ let array_to_vector v argcons array = for i = 0 to (Array.length array) - 1 do (invoke v) "set" (C_list [ C_int i ; (argcons array.(i)) ]) done ; v let vector_to_array v argcons array = for i = 0; to (get_int ((invoke v) "size" C_void)) - 1 do array.(i) <- argcons ((invoke v) "[]" (C_int i)) done ; v %} %insert(mli) %{ val array_to_vector : c_obj -> ('a -> c_obj) -> 'a array -> c_obj val vector_to_array : c_obj -> (c_obj -> 'a) -> 'a array -> c_obj %} 0707010008e81c000081a40000000000000000000000014caec28800000037000000b600010002ffffffffffffffff0000003700000000root/usr/local/share/swig/2.0.1/ocaml/typeregister.swgSWIGEXT void SWIG_init() { SWIG_InitializeModule(0); 0707010008e80b000081a40000000000000000000000014caec288000014d0000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/ocaml/ocamldec.swg/* ----------------------------------------------------------------------------- * ocamldec.swg * * Ocaml runtime code -- declarations * ----------------------------------------------------------------------------- */ #include #include #include #ifdef __cplusplus #define SWIGEXT extern "C" SWIGEXT { #else #define SWIGEXT #endif #define value caml_value_t #define CAML_VALUE caml_value_t #include #include #include #include #include #include #include #define caml_array_set swig_caml_array_set // Adapted from memory.h and mlvalues.h #define SWIG_CAMLlocal1(x) \ caml_value_t x = 0; \ CAMLxparam1 (x) #define SWIG_CAMLlocal2(x, y) \ caml_value_t x = 0, y = 0; \ CAMLxparam2 (x, y) #define SWIG_CAMLlocal3(x, y, z) \ caml_value_t x = 0, y = 0, z = 0; \ CAMLxparam3 (x, y, z) #define SWIG_CAMLlocal4(x, y, z, t) \ caml_value_t x = 0, y = 0, z = 0, t = 0; \ CAMLxparam4 (x, y, z, t) #define SWIG_CAMLlocal5(x, y, z, t, u) \ caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \ CAMLxparam5 (x, y, z, t, u) #define SWIG_CAMLlocalN(x, size) \ caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \ CAMLxparamN (x, (size)) #define SWIG_Field(x, i) (((caml_value_t *)(x)) [i]) /* Also an l-value. */ #define SWIG_Store_field(block, offset, val) do{ \ mlsize_t caml__temp_offset = (offset); \ caml_value_t caml__temp_val = (val); \ modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \ }while(0) #define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1)) #ifdef ARCH_BIG_ENDIAN #define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1]) /* Also an l-value. */ #define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1]) /* Also an l-value. */ #else #define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)]) /* Also an l-value. */ #define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0]) /* Also an l-value. */ #endif #ifdef CAMLreturn0 #undef CAMLreturn0 #endif #define CAMLreturn0 do{ \ caml_local_roots = caml__frame; \ return; \ }while (0) #ifdef CAMLreturn #undef CAMLreturn #endif #define CAMLreturn(result) do{ \ caml_value_t caml__temp_result = (result); \ caml_local_roots = caml__frame; \ return (caml__temp_result); \ }while(0) #define CAMLreturn_type(result) do{ \ caml_local_roots = caml__frame; \ return result; \ }while(0) #ifdef CAMLnoreturn #undef CAMLnoreturn #endif #define CAMLnoreturn ((void) caml__frame) #ifndef ARCH_ALIGN_INT64 #define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v))) #else CAMLextern int64 Int64_val(caml_value_t v); #define SWIG_Int64_val(v) Int64_val(v) #endif #define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type) #define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer) #define SWIG_contract_assert(expr, msg) if(!(expr)) {failwith(msg);} else SWIGSTATIC int SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type); SWIGSTATIC void * SWIG_MustGetPtr (CAML_VALUE v, swig_type_info *type); SWIGSTATIC CAML_VALUE _wrap_delete_void( CAML_VALUE ); SWIGSTATIC int enum_to_int( char *name, CAML_VALUE v ); SWIGSTATIC CAML_VALUE int_to_enum( char *name, int v ); SWIGSTATIC CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ); SWIGSTATIC CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ); SWIGSTATIC int caml_list_length( CAML_VALUE lst ); SWIGSTATIC CAML_VALUE caml_array_new( int n ); SWIGSTATIC void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ); SWIGSTATIC CAML_VALUE caml_array_nth( CAML_VALUE arr, int n ); SWIGSTATIC int caml_array_length( CAML_VALUE arr ); SWIGSTATIC CAML_VALUE caml_val_char( char c ); SWIGSTATIC CAML_VALUE caml_val_uchar( unsigned char c ); SWIGSTATIC CAML_VALUE caml_val_short( short s ); SWIGSTATIC CAML_VALUE caml_val_ushort( unsigned short s ); SWIGSTATIC CAML_VALUE caml_val_int( int x ); SWIGSTATIC CAML_VALUE caml_val_uint( unsigned int x ); SWIGSTATIC CAML_VALUE caml_val_long( long x ); SWIGSTATIC CAML_VALUE caml_val_ulong( unsigned long x ); SWIGSTATIC CAML_VALUE caml_val_float( float f ); SWIGSTATIC CAML_VALUE caml_val_double( double d ); SWIGSTATIC CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor ); SWIGSTATIC CAML_VALUE caml_val_string( const char *str ); SWIGSTATIC CAML_VALUE caml_val_string_len( const char *str, int len ); SWIGSTATIC long caml_long_val( CAML_VALUE v ); SWIGSTATIC double caml_double_val( CAML_VALUE v ); SWIGSTATIC int caml_ptr_val_internal( CAML_VALUE v, void **out, swig_type_info *descriptor ); SWIGSTATIC void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ); SWIGSTATIC char *caml_string_val( CAML_VALUE v ); SWIGSTATIC int caml_string_len( CAML_VALUE v ); #ifdef __cplusplus } #endif /* mzschemedec.swg ends here */ 0707010008e814000081a40000000000000000000000014caec2880000140e000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/ocaml/std_string.i/* ----------------------------------------------------------------------------- * std_string.i * * SWIG typemaps for std::string * ----------------------------------------------------------------------------- */ // ------------------------------------------------------------------------ // std::string is typemapped by value // This can prevent exporting methods which return a string // in order for the user to modify it. // However, I think I'll wait until someone asks for it... // ------------------------------------------------------------------------ %include %{ #include #include using std::string; using std::vector; %} %include %naturalvar std::string; %naturalvar std::wstring; namespace std { template class basic_string { public: typedef charT *pointer; typedef charT &reference; typedef const charT &const_reference; typedef size_t size_type; typedef ptrdiff_t difference_type; basic_string(); basic_string( charT *str ); size_t size(); charT operator []( int pos ) const; charT *c_str() const; basic_string &operator = ( const basic_string &ws ); basic_string &operator = ( const charT *str ); basic_string &append( const basic_string &other ); basic_string &append( const charT *str ); void push_back( charT c ); void clear(); void reserve( size_type t ); void resize( size_type n, charT c = charT() ); int compare( const basic_string &other ) const; int compare( const charT *str ) const; basic_string &insert( size_type pos, const basic_string &str ); size_type find( const basic_string &other, int pos = 0 ) const; size_type find( charT c, int pos = 0 ) const; %extend { bool operator == ( const basic_string &other ) const { return self->compare( other ) == 0; } bool operator != ( const basic_string &other ) const { return self->compare( other ) != 0; } bool operator < ( const basic_string &other ) const { return self->compare( other ) == -1; } bool operator > ( const basic_string &other ) const { return self->compare( other ) == 1; } bool operator <= ( const basic_string &other ) const { return self->compare( other ) != 1; } bool operator >= ( const basic_string &other ) const { return self->compare( other ) != -1; } } }; %template(string) basic_string; %template(wstring) basic_string; typedef basic_string string; typedef basic_string wstring; /* Overloading check */ %typemap(in) string { if (caml_ptr_check($input)) $1.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); else SWIG_exception(SWIG_TypeError, "string expected"); } %typemap(in) const string & (std::string temp) { if (caml_ptr_check($input)) { temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); $1 = &temp; } else { SWIG_exception(SWIG_TypeError, "string expected"); } } %typemap(in) string & (std::string temp) { if (caml_ptr_check($input)) { temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); $1 = &temp; } else { SWIG_exception(SWIG_TypeError, "string expected"); } } %typemap(in) string * (std::string *temp) { if (caml_ptr_check($input)) { temp = new std::string((char *)caml_ptr_val($input,0), caml_string_len($input)); $1 = temp; } else { SWIG_exception(SWIG_TypeError, "string expected"); } } %typemap(free) string * (std::string *temp) { delete temp; } %typemap(argout) string & { caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size())); } %typemap(directorout) string { $result.assign((char *)caml_ptr_val($input,0), caml_string_len($input)); } %typemap(out) string { $result = caml_val_string_len($1.c_str(),$1.size()); } %typemap(out) string * { $result = caml_val_string_len((*$1).c_str(),(*$1).size()); } } #ifdef ENABLE_CHARPTR_ARRAY char **c_charptr_array( const std::vector &str_v ); %{ SWIGEXT char **c_charptr_array( const std::vector &str_v ) { char **out = new char *[str_v.size() + 1]; out[str_v.size()] = 0; for( int i = 0; i < str_v.size(); i++ ) { out[i] = (char *)str_v[i].c_str(); } return out; } %} #endif #ifdef ENABLE_STRING_VECTOR %template (StringVector) std::vector; %insert(ml) %{ (* Some STL convenience items *) let string_array_to_vector sa = let nv = _new_StringVector C_void in array_to_vector nv (fun x -> C_string x) sa ; nv let c_string_array ar = _c_charptr_array (string_array_to_vector ar) %} %insert(mli) %{ val c_string_array: string array -> c_obj %} #endif 0707010008e81b000081a40000000000000000000000014caec28800002242000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/ocaml/typemaps.i/* ----------------------------------------------------------------------------- * typemaps.i * * The Ocaml module handles all types uniformly via typemaps. Here * are the definitions. * ----------------------------------------------------------------------------- */ /* Pointers */ %typemap(in) void "" %typemap(out) void "$result = Val_int(0);" %typemap(in) void * { $1 = caml_ptr_val($input,$descriptor); } %typemap(varin) void * { $1 = ($ltype)caml_ptr_val($input,$descriptor); } %typemap(out) void * { $result = caml_val_ptr($1,$descriptor); } %typemap(varout) void * { $result = caml_val_ptr($1,$descriptor); } #ifdef __cplusplus %typemap(in) SWIGTYPE & { /* %typemap(in) SWIGTYPE & */ $1 = ($ltype) caml_ptr_val($input,$1_descriptor); } %typemap(varin) SWIGTYPE & { /* %typemap(varin) SWIGTYPE & */ $1 = *(($ltype) caml_ptr_val($input,$1_descriptor)); } %typemap(out) SWIGTYPE & { /* %typemap(out) SWIGTYPE & */ CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *) &$1,$1_descriptor)); } else { $result = caml_val_ptr ((void *) &$1,$1_descriptor); } } #if 0 %typemap(argout) SWIGTYPE & { CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { swig_result = caml_list_append(swig_result, callback(*fromval,caml_val_ptr((void *) $1, $1_descriptor))); } else { swig_result = caml_list_append(swig_result, caml_val_ptr ((void *) $1,$1_descriptor)); } } #endif %typemap(argout) const SWIGTYPE & { } %typemap(in) SWIGTYPE { $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ; } %typemap(out) SWIGTYPE { /* %typemap(out) SWIGTYPE */ $&1_ltype temp = new $ltype((const $1_ltype &) $1); CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *)temp,$&1_descriptor)); } else { $result = caml_val_ptr ((void *)temp,$&1_descriptor); } } #else %typemap(in) SWIGTYPE { $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ; } %typemap(out) SWIGTYPE { /* %typemap(out) SWIGTYPE */ void *temp = calloc(1,sizeof($ltype)); CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); memmove( temp, &$1, sizeof( $1_type ) ); if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *)temp,$&1_descriptor)); } else { $result = caml_val_ptr ((void *)temp,$&1_descriptor); } } %apply SWIGTYPE { const SWIGTYPE & }; #endif /* The SIMPLE_MAP macro below defines the whole set of typemaps needed for simple types. */ %define SIMPLE_MAP(C_NAME, C_TO_MZ, MZ_TO_C) /* In */ %typemap(in) C_NAME { $1 = MZ_TO_C($input); } %typemap(varin) C_NAME { $1 = MZ_TO_C($input); } %typemap(in) C_NAME & ($*1_ltype temp) { temp = ($*1_ltype) MZ_TO_C($input); $1 = &temp; } %typemap(varin) C_NAME & { $1 = MZ_TO_C($input); } %typemap(directorout) C_NAME { $1 = MZ_TO_C($input); } %typemap(in) C_NAME *INPUT ($*1_ltype temp) { temp = ($*1_ltype) MZ_TO_C($input); $1 = &temp; } %typemap(in,numinputs=0) C_NAME *OUTPUT ($*1_ltype temp) { $1 = &temp; } /* Out */ %typemap(out) C_NAME { $result = C_TO_MZ($1); } %typemap(varout) C_NAME { $result = C_TO_MZ($1); } %typemap(varout) C_NAME & { /* %typemap(varout) C_NAME & (generic) */ $result = C_TO_MZ($1); } %typemap(argout) C_NAME *OUTPUT { swig_result = caml_list_append(swig_result,C_TO_MZ((long)*$1)); } %typemap(out) C_NAME & { /* %typemap(out) C_NAME & (generic) */ $result = C_TO_MZ(*$1); } %typemap(argout) C_NAME & { swig_result = caml_list_append(swig_result,C_TO_MZ((long)*$1)); } %typemap(directorin) C_NAME { args = caml_list_append(args,C_TO_MZ($1_name)); } %enddef SIMPLE_MAP(bool, caml_val_bool, caml_long_val); SIMPLE_MAP(oc_bool, caml_val_bool, caml_long_val); SIMPLE_MAP(char, caml_val_char, caml_long_val); SIMPLE_MAP(signed char, caml_val_char, caml_long_val); SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val); SIMPLE_MAP(int, caml_val_int, caml_long_val); SIMPLE_MAP(short, caml_val_short, caml_long_val); SIMPLE_MAP(wchar_t, caml_val_short, caml_long_val); SIMPLE_MAP(long, caml_val_long, caml_long_val); SIMPLE_MAP(ptrdiff_t, caml_val_int, caml_long_val); SIMPLE_MAP(unsigned int, caml_val_uint, caml_long_val); SIMPLE_MAP(unsigned short, caml_val_ushort, caml_long_val); SIMPLE_MAP(unsigned long, caml_val_ulong, caml_long_val); SIMPLE_MAP(size_t, caml_val_int, caml_long_val); SIMPLE_MAP(float, caml_val_float, caml_double_val); SIMPLE_MAP(double, caml_val_double, caml_double_val); SIMPLE_MAP(long long,caml_val_ulong,caml_long_val); SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); /* Void */ %typemap(out) void "$result = Val_unit;"; /* Pass through value */ %typemap (in) value,caml::value,CAML_VALUE "$1=$input;"; %typemap (out) value,caml::value,CAML_VALUE "$result=$1;"; /* Arrays */ %typemap(in) ArrayCarrier * { $1 = ($ltype)caml_ptr_val($input,$1_descriptor); } %typemap(out) ArrayCarrier * { CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *)$1,$1_descriptor)); } else { $result = caml_val_ptr ((void *)$1,$1_descriptor); } } #if 0 %include #endif /* Handle char arrays as strings */ %define %char_ptr_in(how) %typemap(how) char *, signed char *, unsigned char * { /* %typemap(how) char * ... */ $1 = ($ltype)caml_string_val($input); } /* Again work around the empty array bound bug */ %typemap(how) char [ANY], signed char [ANY], unsigned char [ANY] { /* %typemap(how) char [ANY] ... */ char *temp = caml_string_val($input); strcpy((char *)$1,temp); /* strncpy would be better but we might not have an array size */ } %enddef %char_ptr_in(in); %char_ptr_in(varin); %char_ptr_in(directorout); %define %char_ptr_out(how) %typemap(how) char *, signed char *, unsigned char *, const char *, const signed char *, const unsigned char * { $result = caml_val_string((char *)$1); } /* I'd like to use the length here but can't because it might be empty */ %typemap(how) char [ANY], signed char [ANY], unsigned char [ANY], const char [ANY], const signed char [ANY], const unsigned char [ANY] { $result = caml_val_string((char *)$1); } %enddef %char_ptr_out(out); %char_ptr_out(varout); %char_ptr_out(directorin); %define %swigtype_ptr_in(how) %typemap(how) SWIGTYPE * { /* %typemap(how) SWIGTYPE * */ $1 = ($ltype)caml_ptr_val($input,$1_descriptor); } %typemap(how) SWIGTYPE (CLASS::*) { /* %typemap(how) SWIGTYPE (CLASS::*) */ void *v = caml_ptr_val($input,$1_descriptor); memcpy(& $1, &v, sizeof(v)); } %enddef %define %swigtype_ptr_out(how) %typemap(out) SWIGTYPE * { /* %typemap(how) SWIGTYPE *, SWIGTYPE (CLASS::*) */ CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *)$1,$1_descriptor)); } else { $result = caml_val_ptr ((void *)$1,$1_descriptor); } } %typemap(how) SWIGTYPE (CLASS::*) { /* %typemap(how) SWIGTYPE *, SWIGTYPE (CLASS::*) */ void *v; memcpy(&v,& $1, sizeof(void *)); $result = caml_val_ptr (v,$1_descriptor); } %enddef %swigtype_ptr_in(in); %swigtype_ptr_in(varin); %swigtype_ptr_in(directorout); %swigtype_ptr_out(out); %swigtype_ptr_out(varout); %swigtype_ptr_out(directorin); %define %swigtype_array_fail(how,msg) %typemap(how) SWIGTYPE [] { failwith(msg); } %enddef %swigtype_array_fail(in,"Array arguments for arbitrary types need a typemap"); %swigtype_array_fail(varin,"Assignment to global arrays for arbitrary types need a typemap"); %swigtype_array_fail(out,"Array arguments for arbitrary types need a typemap"); %swigtype_array_fail(varout,"Array variables need a typemap"); %swigtype_array_fail(directorin,"Array results with arbitrary types need a typemap"); %swigtype_array_fail(directorout,"Array arguments with arbitrary types need a typemap"); /* C++ References */ /* Enums */ %define %swig_enum_in(how) %typemap(how) enum SWIGTYPE { $1 = ($type)caml_long_val_full($input,"$type_marker"); } %enddef %define %swig_enum_out(how) %typemap(how) enum SWIGTYPE { $result = callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1)); } %enddef %swig_enum_in(in) %swig_enum_in(varin) %swig_enum_in(directorout) %swig_enum_out(out) %swig_enum_out(varout) %swig_enum_out(directorin) /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } 0707010008e80d000081a40000000000000000000000014caec288000001d9000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/ocaml/preamble.swg%insert(mli) %{ exception BadArgs of string exception BadMethodName of c_obj * string * string exception NotObject of c_obj exception NotEnumType of c_obj exception LabelNotFromThisEnum of c_obj exception InvalidDirectorCall of c_obj %} %insert(ml) %{ exception BadArgs of string exception BadMethodName of c_obj * string * string exception NotObject of c_obj exception NotEnumType of c_obj exception LabelNotFromThisEnum of c_obj exception InvalidDirectorCall of c_obj %}0707010008e95d000081a40000000000000000000000014caec284000030e8000000b600010002ffffffffffffffff0000002d00000000root/usr/local/share/swig/2.0.1/swigwarn.swg/* Automatically generated file containing all the swig warning codes. */ /* Do not modify this file by hand, change 'Source/Include/swigwarn.h' */ /* and use the command 'make Lib/swigwarn.swg' instead. */ /* ----------------------------------------------------------------------------- * This file is part of SWIG, which is licensed as a whole under version 3 * (or any later version) of the GNU General Public License. Some additional * terms also apply to certain portions of SWIG. The full details of the SWIG * license and copyrights can be found in the LICENSE and COPYRIGHT files * included with the SWIG source code as distributed by the SWIG developers * and at http://www.swig.org/legal.html. * * swigwarn.h * * SWIG warning message numbers * This file serves as the main registry of warning message numbers. Some of these * numbers are used internally in the C/C++ source code of SWIG. However, some * of the numbers are used in SWIG configuration files (swig.swg and others). * * The numbers are roughly organized into a few different classes by functionality. * * Even though symbolic constants are used in the SWIG source, this is * not always the case in SWIG interface files. Do not change the * numbers in this file. * ----------------------------------------------------------------------------- */ %define SWIGWARN_NONE 0 %enddef /* -- Deprecated features -- */ %define SWIGWARN_DEPRECATED_EXTERN 101 %enddef %define SWIGWARN_DEPRECATED_VAL 102 %enddef %define SWIGWARN_DEPRECATED_OUT 103 %enddef %define SWIGWARN_DEPRECATED_DISABLEDOC 104 %enddef %define SWIGWARN_DEPRECATED_ENABLEDOC 105 %enddef %define SWIGWARN_DEPRECATED_DOCONLY 106 %enddef %define SWIGWARN_DEPRECATED_STYLE 107 %enddef %define SWIGWARN_DEPRECATED_LOCALSTYLE 108 %enddef %define SWIGWARN_DEPRECATED_TITLE 109 %enddef %define SWIGWARN_DEPRECATED_SECTION 110 %enddef %define SWIGWARN_DEPRECATED_SUBSECTION 111 %enddef %define SWIGWARN_DEPRECATED_SUBSUBSECTION 112 %enddef %define SWIGWARN_DEPRECATED_ADDMETHODS 113 %enddef %define SWIGWARN_DEPRECATED_READONLY 114 %enddef %define SWIGWARN_DEPRECATED_READWRITE 115 %enddef %define SWIGWARN_DEPRECATED_EXCEPT 116 %enddef %define SWIGWARN_DEPRECATED_NEW 117 %enddef %define SWIGWARN_DEPRECATED_EXCEPT_TM 118 %enddef %define SWIGWARN_DEPRECATED_IGNORE_TM 119 %enddef %define SWIGWARN_DEPRECATED_OPTC 120 %enddef %define SWIGWARN_DEPRECATED_NAME 121 %enddef %define SWIGWARN_DEPRECATED_NOEXTERN 122 %enddef %define SWIGWARN_DEPRECATED_NODEFAULT 123 %enddef %define SWIGWARN_DEPRECATED_TYPEMAP_LANG 124 %enddef %define SWIGWARN_DEPRECATED_INPUT_FILE 125 %enddef /* -- Preprocessor -- */ %define SWIGWARN_PP_MISSING_FILE 201 %enddef %define SWIGWARN_PP_EVALUATION 202 %enddef %define SWIGWARN_PP_INCLUDEALL_IMPORTALL 203 %enddef %define SWIGWARN_PP_CPP_WARNING 204 %enddef %define SWIGWARN_PP_CPP_ERROR 205 %enddef /* -- C/C++ Parser -- */ %define SWIGWARN_PARSE_CLASS_KEYWORD 301 %enddef %define SWIGWARN_PARSE_REDEFINED 302 %enddef %define SWIGWARN_PARSE_EXTEND_UNDEF 303 %enddef %define SWIGWARN_PARSE_UNSUPPORTED_VALUE 304 %enddef %define SWIGWARN_PARSE_BAD_VALUE 305 %enddef %define SWIGWARN_PARSE_PRIVATE 306 %enddef %define SWIGWARN_PARSE_BAD_DEFAULT 307 %enddef %define SWIGWARN_PARSE_NAMESPACE_ALIAS 308 %enddef %define SWIGWARN_PARSE_PRIVATE_INHERIT 309 %enddef %define SWIGWARN_PARSE_TEMPLATE_REPEAT 310 %enddef %define SWIGWARN_PARSE_TEMPLATE_PARTIAL 311 %enddef %define SWIGWARN_PARSE_UNNAMED_NESTED_CLASS 312 %enddef %define SWIGWARN_PARSE_UNDEFINED_EXTERN 313 %enddef %define SWIGWARN_PARSE_KEYWORD 314 %enddef %define SWIGWARN_PARSE_USING_UNDEF 315 %enddef %define SWIGWARN_PARSE_MODULE_REPEAT 316 %enddef %define SWIGWARN_PARSE_TEMPLATE_SP_UNDEF 317 %enddef %define SWIGWARN_PARSE_TEMPLATE_AMBIG 318 %enddef %define SWIGWARN_PARSE_NO_ACCESS 319 %enddef %define SWIGWARN_PARSE_EXPLICIT_TEMPLATE 320 %enddef %define SWIGWARN_PARSE_BUILTIN_NAME 321 %enddef %define SWIGWARN_PARSE_REDUNDANT 322 %enddef %define SWIGWARN_PARSE_REC_INHERITANCE 323 %enddef %define SWIGWARN_PARSE_NESTED_TEMPLATE 324 %enddef %define SWIGWARN_PARSE_NAMED_NESTED_CLASS 325 %enddef %define SWIGWARN_IGNORE_OPERATOR_NEW 350 %enddef /* new */ %define SWIGWARN_IGNORE_OPERATOR_DELETE 351 %enddef /* delete */ %define SWIGWARN_IGNORE_OPERATOR_PLUS 352 %enddef /* + */ %define SWIGWARN_IGNORE_OPERATOR_MINUS 353 %enddef /* - */ %define SWIGWARN_IGNORE_OPERATOR_MUL 354 %enddef /* * */ %define SWIGWARN_IGNORE_OPERATOR_DIV 355 %enddef /* / */ %define SWIGWARN_IGNORE_OPERATOR_MOD 356 %enddef /* % */ %define SWIGWARN_IGNORE_OPERATOR_XOR 357 %enddef /* ^ */ %define SWIGWARN_IGNORE_OPERATOR_AND 358 %enddef /* & */ %define SWIGWARN_IGNORE_OPERATOR_OR 359 %enddef /* | */ %define SWIGWARN_IGNORE_OPERATOR_NOT 360 %enddef /* ~ */ %define SWIGWARN_IGNORE_OPERATOR_LNOT 361 %enddef /* ! */ %define SWIGWARN_IGNORE_OPERATOR_EQ 362 %enddef /* = */ %define SWIGWARN_IGNORE_OPERATOR_LT 363 %enddef /* < */ %define SWIGWARN_IGNORE_OPERATOR_GT 364 %enddef /* > */ %define SWIGWARN_IGNORE_OPERATOR_PLUSEQ 365 %enddef /* += */ %define SWIGWARN_IGNORE_OPERATOR_MINUSEQ 366 %enddef /* -= */ %define SWIGWARN_IGNORE_OPERATOR_MULEQ 367 %enddef /* *= */ %define SWIGWARN_IGNORE_OPERATOR_DIVEQ 368 %enddef /* /= */ %define SWIGWARN_IGNORE_OPERATOR_MODEQ 369 %enddef /* %= */ %define SWIGWARN_IGNORE_OPERATOR_XOREQ 370 %enddef /* ^= */ %define SWIGWARN_IGNORE_OPERATOR_ANDEQ 371 %enddef /* &= */ %define SWIGWARN_IGNORE_OPERATOR_OREQ 372 %enddef /* |= */ %define SWIGWARN_IGNORE_OPERATOR_LSHIFT 373 %enddef /* << */ %define SWIGWARN_IGNORE_OPERATOR_RSHIFT 374 %enddef /* >> */ %define SWIGWARN_IGNORE_OPERATOR_LSHIFTEQ 375 %enddef /* <<= */ %define SWIGWARN_IGNORE_OPERATOR_RSHIFTEQ 376 %enddef /* >>= */ %define SWIGWARN_IGNORE_OPERATOR_EQUALTO 377 %enddef /* == */ %define SWIGWARN_IGNORE_OPERATOR_NOTEQUAL 378 %enddef /* != */ %define SWIGWARN_IGNORE_OPERATOR_LTEQUAL 379 %enddef /* <= */ %define SWIGWARN_IGNORE_OPERATOR_GTEQUAL 380 %enddef /* >= */ %define SWIGWARN_IGNORE_OPERATOR_LAND 381 %enddef /* && */ %define SWIGWARN_IGNORE_OPERATOR_LOR 382 %enddef /* || */ %define SWIGWARN_IGNORE_OPERATOR_PLUSPLUS 383 %enddef /* ++ */ %define SWIGWARN_IGNORE_OPERATOR_MINUSMINUS 384 %enddef /* -- */ %define SWIGWARN_IGNORE_OPERATOR_COMMA 385 %enddef /* , */ %define SWIGWARN_IGNORE_OPERATOR_ARROWSTAR 386 %enddef /* ->* */ %define SWIGWARN_IGNORE_OPERATOR_ARROW 387 %enddef /* -> */ %define SWIGWARN_IGNORE_OPERATOR_CALL 388 %enddef /* () */ %define SWIGWARN_IGNORE_OPERATOR_INDEX 389 %enddef /* [] */ %define SWIGWARN_IGNORE_OPERATOR_UPLUS 390 %enddef /* + */ %define SWIGWARN_IGNORE_OPERATOR_UMINUS 391 %enddef /* - */ %define SWIGWARN_IGNORE_OPERATOR_UMUL 392 %enddef /* * */ %define SWIGWARN_IGNORE_OPERATOR_UAND 393 %enddef /* & */ %define SWIGWARN_IGNORE_OPERATOR_NEWARR 394 %enddef /* new [] */ %define SWIGWARN_IGNORE_OPERATOR_DELARR 395 %enddef /* delete [] */ %define SWIGWARN_IGNORE_OPERATOR_REF 396 %enddef /* operator *() */ /* 394-399 are reserved */ /* -- Type system and typemaps -- */ %define SWIGWARN_TYPE_UNDEFINED_CLASS 401 %enddef %define SWIGWARN_TYPE_INCOMPLETE 402 %enddef %define SWIGWARN_TYPE_ABSTRACT 403 %enddef %define SWIGWARN_TYPE_REDEFINED 404 %enddef %define SWIGWARN_TYPEMAP_SOURCETARGET 450 %enddef %define SWIGWARN_TYPEMAP_CHARLEAK 451 %enddef %define SWIGWARN_TYPEMAP_SWIGTYPE 452 %enddef %define SWIGWARN_TYPEMAP_APPLY_UNDEF 453 %enddef %define SWIGWARN_TYPEMAP_SWIGTYPELEAK 454 %enddef %define SWIGWARN_TYPEMAP_IN_UNDEF 460 %enddef %define SWIGWARN_TYPEMAP_OUT_UNDEF 461 %enddef %define SWIGWARN_TYPEMAP_VARIN_UNDEF 462 %enddef %define SWIGWARN_TYPEMAP_VAROUT_UNDEF 463 %enddef %define SWIGWARN_TYPEMAP_CONST_UNDEF 464 %enddef %define SWIGWARN_TYPEMAP_UNDEF 465 %enddef %define SWIGWARN_TYPEMAP_VAR_UNDEF 466 %enddef %define SWIGWARN_TYPEMAP_TYPECHECK 467 %enddef %define SWIGWARN_TYPEMAP_THROW 468 %enddef %define SWIGWARN_TYPEMAP_DIRECTORIN_UNDEF 469 %enddef %define SWIGWARN_TYPEMAP_THREAD_UNSAFE 470 %enddef /* mostly used in directorout typemaps */ %define SWIGWARN_TYPEMAP_DIRECTOROUT_UNDEF 471 %enddef %define SWIGWARN_TYPEMAP_TYPECHECK_UNDEF 472 %enddef %define SWIGWARN_TYPEMAP_DIRECTOROUT_PTR 473 %enddef %define SWIGWARN_TYPEMAP_OUT_OPTIMAL_IGNORED 474 %enddef %define SWIGWARN_TYPEMAP_OUT_OPTIMAL_MULTIPLE 475 %enddef /* -- Fragments -- */ %define SWIGWARN_FRAGMENT_NOT_FOUND 490 %enddef /* -- General code generation -- */ %define SWIGWARN_LANG_OVERLOAD_DECL 501 %enddef %define SWIGWARN_LANG_OVERLOAD_CONSTRUCT 502 %enddef %define SWIGWARN_LANG_IDENTIFIER 503 %enddef %define SWIGWARN_LANG_RETURN_TYPE 504 %enddef %define SWIGWARN_LANG_VARARGS 505 %enddef %define SWIGWARN_LANG_VARARGS_KEYWORD 506 %enddef %define SWIGWARN_LANG_NATIVE_UNIMPL 507 %enddef %define SWIGWARN_LANG_DEREF_SHADOW 508 %enddef %define SWIGWARN_LANG_OVERLOAD_SHADOW 509 %enddef %define SWIGWARN_LANG_FRIEND_IGNORE 510 %enddef %define SWIGWARN_LANG_OVERLOAD_KEYWORD 511 %enddef %define SWIGWARN_LANG_OVERLOAD_CONST 512 %enddef %define SWIGWARN_LANG_CLASS_UNNAMED 513 %enddef %define SWIGWARN_LANG_DIRECTOR_VDESTRUCT 514 %enddef %define SWIGWARN_LANG_DISCARD_CONST 515 %enddef %define SWIGWARN_LANG_OVERLOAD_IGNORED 516 %enddef %define SWIGWARN_LANG_DIRECTOR_ABSTRACT 517 %enddef %define SWIGWARN_LANG_PORTABILITY_FILENAME 518 %enddef %define SWIGWARN_LANG_TEMPLATE_METHOD_IGNORE 519 %enddef /* -- Reserved (600-799) -- */ /* -- Language module specific warnings (700 - 899) -- */ /* Feel free to claim any number in this space that's not currently being used. Just make sure you add an entry here */ %define SWIGWARN_RUBY_WRONG_NAME 801 %enddef %define SWIGWARN_RUBY_MULTIPLE_INHERITANCE 802 %enddef /* please leave 800-809 free for Ruby */ %define SWIGWARN_JAVA_TYPEMAP_JNI_UNDEF 810 %enddef %define SWIGWARN_JAVA_TYPEMAP_JTYPE_UNDEF 811 %enddef %define SWIGWARN_JAVA_TYPEMAP_JSTYPE_UNDEF 812 %enddef %define SWIGWARN_JAVA_MULTIPLE_INHERITANCE 813 %enddef %define SWIGWARN_JAVA_TYPEMAP_GETCPTR_UNDEF 814 %enddef %define SWIGWARN_JAVA_TYPEMAP_CLASSMOD_UNDEF 815 %enddef %define SWIGWARN_JAVA_TYPEMAP_JAVABODY_UNDEF 816 %enddef %define SWIGWARN_JAVA_TYPEMAP_JAVAOUT_UNDEF 817 %enddef %define SWIGWARN_JAVA_TYPEMAP_JAVAIN_UNDEF 818 %enddef %define SWIGWARN_JAVA_TYPEMAP_JAVADIRECTORIN_UNDEF 819 %enddef %define SWIGWARN_JAVA_TYPEMAP_JAVADIRECTOROUT_UNDEF 820 %enddef %define SWIGWARN_JAVA_COVARIANT_RET 822 %enddef %define SWIGWARN_JAVA_TYPEMAP_JAVACONSTRUCT_UNDEF 823 %enddef %define SWIGWARN_JAVA_TYPEMAP_DIRECTORIN_NODESC 824 %enddef %define SWIGWARN_JAVA_NO_DIRECTORCONNECT_ATTR 825 %enddef /* please leave 810-829 free for Java */ %define SWIGWARN_CSHARP_TYPEMAP_CTYPE_UNDEF 830 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSTYPE_UNDEF 831 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSWTYPE_UNDEF 832 %enddef %define SWIGWARN_CSHARP_MULTIPLE_INHERITANCE 833 %enddef %define SWIGWARN_CSHARP_TYPEMAP_GETCPTR_UNDEF 834 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CLASSMOD_UNDEF 835 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSBODY_UNDEF 836 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSOUT_UNDEF 837 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSIN_UNDEF 838 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSDIRECTORIN_UNDEF 839 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSDIRECTOROUT_UNDEF 840 %enddef %define SWIGWARN_CSHARP_COVARIANT_RET 842 %enddef %define SWIGWARN_CSHARP_TYPEMAP_CSCONSTRUCT_UNDEF 843 %enddef %define SWIGWARN_CSHARP_EXCODE 844 %enddef %define SWIGWARN_CSHARP_CANTHROW 845 %enddef %define SWIGWARN_CSHARP_NO_DIRECTORCONNECT_ATTR 846 %enddef %define SWIGWARN_MODULA3_TYPEMAP_TYPE_UNDEF 850 %enddef %define SWIGWARN_MODULA3_TYPEMAP_GETCPTR_UNDEF 851 %enddef %define SWIGWARN_MODULA3_TYPEMAP_CLASSMOD_UNDEF 852 %enddef %define SWIGWARN_MODULA3_TYPEMAP_PTRCONSTMOD_UNDEF 853 %enddef %define SWIGWARN_MODULA3_TYPEMAP_MULTIPLE_RETURN 854 %enddef %define SWIGWARN_MODULA3_MULTIPLE_INHERITANCE 855 %enddef %define SWIGWARN_MODULA3_TYPECONSTRUCTOR_UNKNOWN 856 %enddef %define SWIGWARN_MODULA3_UNKNOWN_PRAGMA 857 %enddef %define SWIGWARN_MODULA3_BAD_ENUMERATION 858 %enddef %define SWIGWARN_MODULA3_DOUBLE_ID 859 %enddef %define SWIGWARN_MODULA3_BAD_IMPORT 860 %enddef /* please leave 850-869 free for Modula 3 */ %define SWIGWARN_PHP_MULTIPLE_INHERITANCE 870 %enddef %define SWIGWARN_PHP_UNKNOWN_PRAGMA 871 %enddef %define SWIGWARN_PHP_PUBLIC_BASE 872 %enddef /* please leave 870-889 free for PHP */ %define SWIGWARN_GO_NAME_CONFLICT 890 %enddef /* please leave 890-899 free for Go */ /* -- User defined warnings (900 - 999) -- */ 0707010008e955000081a40000000000000000000000014caec284000000f9000000b600010002ffffffffffffffff0000002600000000root/usr/local/share/swig/2.0.1/stl.i/* ----------------------------------------------------------------------------- * stl.i * ----------------------------------------------------------------------------- */ #warning "stl.i not implemented for this target" #define SWIG_STL_UNIMPL 0707010008e784000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002700000000root/usr/local/share/swig/2.0.1/csharp0707010008e796000081a40000000000000000000000014caec28900000da2000000b600010002ffffffffffffffff0000003500000000root/usr/local/share/swig/2.0.1/csharp/std_wstring.i/* ----------------------------------------------------------------------------- * std_wstring.i * * Typemaps for std::wstring and const std::wstring& * These are mapped to a C# String and are passed around by value. * * To use non-const std::wstring references use the following %apply. Note * that they are passed by value. * %apply const std::wstring & {std::wstring &}; * ----------------------------------------------------------------------------- */ %include %{ #include %} namespace std { %naturalvar wstring; class wstring; // wstring %typemap(ctype, out="void *") wstring "wchar_t *" %typemap(imtype, inattributes="[MarshalAs(UnmanagedType.LPWStr)]") wstring "string" %typemap(cstype) wstring "string" %typemap(csdirectorin) wstring "$iminput" %typemap(csdirectorout) wstring "$cscall" %typemap(in, canthrow=1) wstring %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); return $null; } $1.assign($input); %} %typemap(out) wstring %{ $result = SWIG_csharp_wstring_callback($1.c_str()); %} %typemap(directorout, canthrow=1) wstring %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); return $null; } $result.assign($input); %} %typemap(directorin) wstring %{ $input = SWIG_csharp_wstring_callback($1.c_str()); %} %typemap(csin) wstring "$csinput" %typemap(csout, excode=SWIGEXCODE) wstring { string ret = $imcall;$excode return ret; } %typemap(typecheck) wstring = wchar_t *; %typemap(throws, canthrow=1) wstring %{ std::string message($1.begin(), $1.end()); SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, message.c_str()); return $null; %} // const wstring & %typemap(ctype, out="void *") const wstring & "wchar_t *" %typemap(imtype, inattributes="[MarshalAs(UnmanagedType.LPWStr)]") const wstring & "string" %typemap(cstype) const wstring & "string" %typemap(csdirectorin) const wstring & "$iminput" %typemap(csdirectorout) const wstring & "$cscall" %typemap(in, canthrow=1) const wstring & %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); return $null; } std::wstring $1_str($input); $1 = &$1_str; %} %typemap(out) const wstring & %{ $result = SWIG_csharp_wstring_callback($1->c_str()); %} %typemap(csin) const wstring & "$csinput" %typemap(csout, excode=SWIGEXCODE) const wstring & { string ret = $imcall;$excode return ret; } %typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring & %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0); return $null; } /* possible thread/reentrant code problem */ static std::wstring $1_str; $1_str = $input; $result = &$1_str; %} %typemap(directorin) const wstring & %{ $input = SWIG_csharp_wstring_callback($1.c_str()); %} %typemap(csvarin, excode=SWIGEXCODE2) const wstring & %{ set { $imcall;$excode } %} %typemap(csvarout, excode=SWIGEXCODE2) const wstring & %{ get { string ret = $imcall;$excode return ret; } %} %typemap(typecheck) const wstring & = wchar_t *; %typemap(throws, canthrow=1) const wstring & %{ std::string message($1.begin(), $1.end()); SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, message.c_str()); return $null; %} } 0707010008e788000081a40000000000000000000000014caec28900003e04000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/csharp/csharphead.swg/* ----------------------------------------------------------------------------- * csharphead.swg * * Support code for exceptions if the SWIG_CSHARP_NO_EXCEPTION_HELPER is not defined * Support code for strings if the SWIG_CSHARP_NO_STRING_HELPER is not defined * ----------------------------------------------------------------------------- */ %insert(runtime) %{ #include #include #include %} #if !defined(SWIG_CSHARP_NO_EXCEPTION_HELPER) %insert(runtime) %{ /* Support for throwing C# exceptions from C/C++. There are two types: * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */ typedef enum { SWIG_CSharpApplicationException, SWIG_CSharpArithmeticException, SWIG_CSharpDivideByZeroException, SWIG_CSharpIndexOutOfRangeException, SWIG_CSharpInvalidCastException, SWIG_CSharpInvalidOperationException, SWIG_CSharpIOException, SWIG_CSharpNullReferenceException, SWIG_CSharpOutOfMemoryException, SWIG_CSharpOverflowException, SWIG_CSharpSystemException } SWIG_CSharpExceptionCodes; typedef enum { SWIG_CSharpArgumentException, SWIG_CSharpArgumentNullException, SWIG_CSharpArgumentOutOfRangeException } SWIG_CSharpExceptionArgumentCodes; typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *); typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *); typedef struct { SWIG_CSharpExceptionCodes code; SWIG_CSharpExceptionCallback_t callback; } SWIG_CSharpException_t; typedef struct { SWIG_CSharpExceptionArgumentCodes code; SWIG_CSharpExceptionArgumentCallback_t callback; } SWIG_CSharpExceptionArgument_t; static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { { SWIG_CSharpApplicationException, NULL }, { SWIG_CSharpArithmeticException, NULL }, { SWIG_CSharpDivideByZeroException, NULL }, { SWIG_CSharpIndexOutOfRangeException, NULL }, { SWIG_CSharpInvalidCastException, NULL }, { SWIG_CSharpInvalidOperationException, NULL }, { SWIG_CSharpIOException, NULL }, { SWIG_CSharpNullReferenceException, NULL }, { SWIG_CSharpOutOfMemoryException, NULL }, { SWIG_CSharpOverflowException, NULL }, { SWIG_CSharpSystemException, NULL } }; static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { { SWIG_CSharpArgumentException, NULL }, { SWIG_CSharpArgumentNullException, NULL }, { SWIG_CSharpArgumentOutOfRangeException, NULL } }; static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) { callback = SWIG_csharp_exceptions[code].callback; } callback(msg); } static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { callback = SWIG_csharp_exceptions_argument[code].callback; } callback(msg, param_name); } %} %insert(runtime) %{ #ifdef __cplusplus extern "C" #endif SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_$module( SWIG_CSharpExceptionCallback_t applicationCallback, SWIG_CSharpExceptionCallback_t arithmeticCallback, SWIG_CSharpExceptionCallback_t divideByZeroCallback, SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, SWIG_CSharpExceptionCallback_t invalidCastCallback, SWIG_CSharpExceptionCallback_t invalidOperationCallback, SWIG_CSharpExceptionCallback_t ioCallback, SWIG_CSharpExceptionCallback_t nullReferenceCallback, SWIG_CSharpExceptionCallback_t outOfMemoryCallback, SWIG_CSharpExceptionCallback_t overflowCallback, SWIG_CSharpExceptionCallback_t systemCallback) { SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback; SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback; SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback; SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback; SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback; SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback; SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback; SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback; SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback; SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback; SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback; } #ifdef __cplusplus extern "C" #endif SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( SWIG_CSharpExceptionArgumentCallback_t argumentCallback, SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback, SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) { SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback; SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback; SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback; } %} %pragma(csharp) imclasscode=%{ protected class SWIGExceptionHelper { public delegate void ExceptionDelegate(string message); public delegate void ExceptionArgumentDelegate(string message, string paramName); static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException); static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException); static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException); static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException); static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException); static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); [DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionCallbacks_$module")] public static extern void SWIGRegisterExceptionCallbacks_$module( ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate); [DllImport("$dllimport", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_$module")] public static extern void SWIGRegisterExceptionCallbacksArgument_$module( ExceptionArgumentDelegate argumentDelegate, ExceptionArgumentDelegate argumentNullDelegate, ExceptionArgumentDelegate argumentOutOfRangeDelegate); static void SetPendingApplicationException(string message) { SWIGPendingException.Set(new System.ApplicationException(message, SWIGPendingException.Retrieve())); } static void SetPendingArithmeticException(string message) { SWIGPendingException.Set(new System.ArithmeticException(message, SWIGPendingException.Retrieve())); } static void SetPendingDivideByZeroException(string message) { SWIGPendingException.Set(new System.DivideByZeroException(message, SWIGPendingException.Retrieve())); } static void SetPendingIndexOutOfRangeException(string message) { SWIGPendingException.Set(new System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); } static void SetPendingInvalidCastException(string message) { SWIGPendingException.Set(new System.InvalidCastException(message, SWIGPendingException.Retrieve())); } static void SetPendingInvalidOperationException(string message) { SWIGPendingException.Set(new System.InvalidOperationException(message, SWIGPendingException.Retrieve())); } static void SetPendingIOException(string message) { SWIGPendingException.Set(new System.IO.IOException(message, SWIGPendingException.Retrieve())); } static void SetPendingNullReferenceException(string message) { SWIGPendingException.Set(new System.NullReferenceException(message, SWIGPendingException.Retrieve())); } static void SetPendingOutOfMemoryException(string message) { SWIGPendingException.Set(new System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); } static void SetPendingOverflowException(string message) { SWIGPendingException.Set(new System.OverflowException(message, SWIGPendingException.Retrieve())); } static void SetPendingSystemException(string message) { SWIGPendingException.Set(new System.SystemException(message, SWIGPendingException.Retrieve())); } static void SetPendingArgumentException(string message, string paramName) { SWIGPendingException.Set(new System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); } static void SetPendingArgumentNullException(string message, string paramName) { Exception e = SWIGPendingException.Retrieve(); if (e != null) message = message + " Inner Exception: " + e.Message; SWIGPendingException.Set(new System.ArgumentNullException(paramName, message)); } static void SetPendingArgumentOutOfRangeException(string message, string paramName) { Exception e = SWIGPendingException.Retrieve(); if (e != null) message = message + " Inner Exception: " + e.Message; SWIGPendingException.Set(new System.ArgumentOutOfRangeException(paramName, message)); } static SWIGExceptionHelper() { SWIGRegisterExceptionCallbacks_$module( applicationDelegate, arithmeticDelegate, divideByZeroDelegate, indexOutOfRangeDelegate, invalidCastDelegate, invalidOperationDelegate, ioDelegate, nullReferenceDelegate, outOfMemoryDelegate, overflowDelegate, systemDelegate); SWIGRegisterExceptionCallbacksArgument_$module( argumentDelegate, argumentNullDelegate, argumentOutOfRangeDelegate); } } protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); public class SWIGPendingException { [ThreadStatic] private static Exception pendingException = null; private static int numExceptionsPending = 0; public static bool Pending { get { bool pending = false; if (numExceptionsPending > 0) if (pendingException != null) pending = true; return pending; } } public static void Set(Exception e) { if (pendingException != null) throw new ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); pendingException = e; lock(typeof($imclassname)) { numExceptionsPending++; } } public static Exception Retrieve() { Exception e = null; if (numExceptionsPending > 0) { if (pendingException != null) { e = pendingException; pendingException = null; lock(typeof($imclassname)) { numExceptionsPending--; } } } return e; } } %} #endif // SWIG_CSHARP_NO_EXCEPTION_HELPER #if !defined(SWIG_CSHARP_NO_STRING_HELPER) %insert(runtime) %{ /* Callback for returning strings to C# without leaking memory */ typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *); static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL; %} %pragma(csharp) imclasscode=%{ protected class SWIGStringHelper { public delegate string SWIGStringDelegate(string message); static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); [DllImport("$dllimport", EntryPoint="SWIGRegisterStringCallback_$module")] public static extern void SWIGRegisterStringCallback_$module(SWIGStringDelegate stringDelegate); static string CreateString(string cString) { return cString; } static SWIGStringHelper() { SWIGRegisterStringCallback_$module(stringDelegate); } } static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); %} %insert(runtime) %{ #ifdef __cplusplus extern "C" #endif SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_$module(SWIG_CSharpStringHelperCallback callback) { SWIG_csharp_string_callback = callback; } %} #endif // SWIG_CSHARP_NO_STRING_HELPER #if !defined(SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR) // Ensure the class is not marked beforefieldinit %pragma(csharp) imclasscode=%{ static $imclassname() { } %} #endif %insert(runtime) %{ /* Contract support */ #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else %} 0707010008e78e000081a40000000000000000000000014caec28900000066000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/csharp/std_common.i%include %apply size_t { std::size_t }; %apply const size_t& { const std::size_t& }; 0707010008e78c000081a40000000000000000000000014caec28900000b3c000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/csharp/enumsimple.swg/* ----------------------------------------------------------------------------- * enumsimple.swg * * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21 * and earlier wrapped global enums with constant integers in the module * class. Enums declared within a C++ class were wrapped by constant integers * in the C# proxy class. * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps %typemap(ctype) const enum SWIGTYPE & "int" %typemap(imtype) const enum SWIGTYPE & "int" %typemap(cstype) const enum SWIGTYPE & "int" %typemap(in) const enum SWIGTYPE & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = *$1; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin) const enum SWIGTYPE & "$input = $1_name;" %typemap(csdirectorin) const enum SWIGTYPE & "$iminput" %typemap(csdirectorout) const enum SWIGTYPE & "$cscall" %typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & "" %typemap(throws, canthrow=1) const enum SWIGTYPE & %{ (void)$1; SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); return $null; %} %typemap(csin) const enum SWIGTYPE & "$csinput" %typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { int ret = $imcall;$excode return ret; } %typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ get { int ret = $imcall;$excode return ret; } %} // enum SWIGTYPE typemaps %typemap(ctype) enum SWIGTYPE "int" %typemap(imtype) enum SWIGTYPE "int" %typemap(cstype) enum SWIGTYPE "int" %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} %typemap(out) enum SWIGTYPE %{ $result = $1; %} %typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} %typemap(directorin) enum SWIGTYPE "$input = $1;" %typemap(csdirectorin) enum SWIGTYPE "$iminput" %typemap(csdirectorout) enum SWIGTYPE "$cscall" %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" %typemap(throws, canthrow=1) enum SWIGTYPE %{ (void)$1; SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); return $null; %} %typemap(csin) enum SWIGTYPE "$csinput" %typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { int ret = $imcall;$excode return ret; } %typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ get { int ret = $imcall;$excode return ret; } %} %typemap(csbase) enum SWIGTYPE "" %typemap(csclassmodifiers) enum SWIGTYPE "" %typemap(cscode) enum SWIGTYPE "" %typemap(csimports) enum SWIGTYPE "" %typemap(csinterfaces) enum SWIGTYPE "" %typemap(csbody) enum SWIGTYPE "" %csenum(simple); 0707010008e78f000081a40000000000000000000000014caec2890000001c000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/csharp/std_deque.i%include 0707010008e798000081a40000000000000000000000014caec28900002da4000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/csharp/typemaps.i/* ----------------------------------------------------------------------------- * typemaps.i * * Pointer and reference handling typemap library * * These mappings provide support for input/output arguments and common * uses for C/C++ pointers and C++ references. * ----------------------------------------------------------------------------- */ /* INPUT typemaps -------------- These typemaps are used for pointer/reference parameters that are input only and are mapped to a C# input parameter. The following typemaps can be applied to turn a pointer or reference into a simple input value. That is, instead of passing a pointer or reference to an object, you would use a real value instead. bool *INPUT, bool &INPUT signed char *INPUT, signed char &INPUT unsigned char *INPUT, unsigned char &INPUT short *INPUT, short &INPUT unsigned short *INPUT, unsigned short &INPUT int *INPUT, int &INPUT unsigned int *INPUT, unsigned int &INPUT long *INPUT, long &INPUT unsigned long *INPUT, unsigned long &INPUT long long *INPUT, long long &INPUT unsigned long long *INPUT, unsigned long long &INPUT float *INPUT, float &INPUT double *INPUT, double &INPUT To use these, suppose you had a C function like this : double fadd(double *a, double *b) { return *a+*b; } You could wrap it with SWIG as follows : %include double fadd(double *INPUT, double *INPUT); or you can use the %apply directive : %include %apply double *INPUT { double *a, double *b }; double fadd(double *a, double *b); In C# you could then use it like this: double answer = modulename.fadd(10.0, 20.0); */ %define INPUT_TYPEMAP(TYPE, CTYPE, CSTYPE) %typemap(ctype) TYPE *INPUT, TYPE &INPUT "CTYPE" %typemap(imtype) TYPE *INPUT, TYPE &INPUT "CSTYPE" %typemap(cstype) TYPE *INPUT, TYPE &INPUT "CSTYPE" %typemap(csin) TYPE *INPUT, TYPE &INPUT "$csinput" %typemap(csdirectorin) TYPE *INPUT, TYPE &INPUT "$iminput" %typemap(csdirectorout) TYPE *INPUT, TYPE &INPUT "$cscall" %typemap(in) TYPE *INPUT, TYPE &INPUT %{ $1 = ($1_ltype)&$input; %} %typemap(directorout) TYPE *INPUT, TYPE &INPUT %{ $result = ($1_ltype)&$input; %} %typemap(directorin) TYPE &INPUT %{ $input = (CTYPE *)$1; %} %typemap(directorin) TYPE *INPUT %{ $input = (CTYPE *)$1; %} %typemap(typecheck) TYPE *INPUT = TYPE; %typemap(typecheck) TYPE &INPUT = TYPE; %enddef INPUT_TYPEMAP(bool, unsigned int, bool) //INPUT_TYPEMAP(char, char, char) INPUT_TYPEMAP(signed char, signed char, sbyte) INPUT_TYPEMAP(unsigned char, unsigned char, byte) INPUT_TYPEMAP(short, short, short) INPUT_TYPEMAP(unsigned short, unsigned short, ushort) INPUT_TYPEMAP(int, int, int) INPUT_TYPEMAP(unsigned int, unsigned int, uint) INPUT_TYPEMAP(long, long, int) INPUT_TYPEMAP(unsigned long, unsigned long, uint) INPUT_TYPEMAP(long long, long long, long) INPUT_TYPEMAP(unsigned long long, unsigned long long, ulong) INPUT_TYPEMAP(float, float, float) INPUT_TYPEMAP(double, double, double) #undef INPUT_TYPEMAP /* OUTPUT typemaps --------------- These typemaps are used for pointer/reference parameters that are output only and are mapped to a C# output parameter. The following typemaps can be applied to turn a pointer or reference into an "output" value. When calling a function, no input value would be given for a parameter, but an output value would be returned. In C#, the 'out' keyword is used when passing the parameter to a function that takes an output parameter. bool *OUTPUT, bool &OUTPUT signed char *OUTPUT, signed char &OUTPUT unsigned char *OUTPUT, unsigned char &OUTPUT short *OUTPUT, short &OUTPUT unsigned short *OUTPUT, unsigned short &OUTPUT int *OUTPUT, int &OUTPUT unsigned int *OUTPUT, unsigned int &OUTPUT long *OUTPUT, long &OUTPUT unsigned long *OUTPUT, unsigned long &OUTPUT long long *OUTPUT, long long &OUTPUT unsigned long long *OUTPUT, unsigned long long &OUTPUT float *OUTPUT, float &OUTPUT double *OUTPUT, double &OUTPUT For example, suppose you were trying to wrap the modf() function in the C math library which splits x into integral and fractional parts (and returns the integer part in one of its parameters): double modf(double x, double *ip); You could wrap it with SWIG as follows : %include double modf(double x, double *OUTPUT); or you can use the %apply directive : %include %apply double *OUTPUT { double *ip }; double modf(double x, double *ip); The C# output of the function would be the function return value and the value returned in the second output parameter. In C# you would use it like this: double dptr; double fraction = modulename.modf(5, out dptr); */ %define OUTPUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) %typemap(ctype) TYPE *OUTPUT, TYPE &OUTPUT "CTYPE *" %typemap(imtype) TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" %typemap(cstype) TYPE *OUTPUT, TYPE &OUTPUT "out CSTYPE" %typemap(csin) TYPE *OUTPUT, TYPE &OUTPUT "out $csinput" %typemap(csdirectorin) TYPE *OUTPUT, TYPE &OUTPUT "$iminput" %typemap(csdirectorout) TYPE *OUTPUT, TYPE &OUTPUT "$cscall" %typemap(in) TYPE *OUTPUT, TYPE &OUTPUT %{ $1 = ($1_ltype)$input; %} %typemap(directorout,warning="Need to provide TYPE *OUTPUT directorout typemap") TYPE *OUTPUT, TYPE &OUTPUT { } %typemap(directorin) TYPE &OUTPUT %{ $input = &$1; %} %typemap(directorin,warning="Need to provide TYPE *OUTPUT directorin typemap, TYPE array length is unknown") TYPE *OUTPUT { } %typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *OUTPUT, TYPE &OUTPUT "" %enddef OUTPUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) //OUTPUT_TYPEMAP(char, char, char, CHAR_PTR) OUTPUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) OUTPUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) OUTPUT_TYPEMAP(short, short, short, INT16_PTR) OUTPUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) OUTPUT_TYPEMAP(int, int, int, INT32_PTR) OUTPUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) OUTPUT_TYPEMAP(long, long, int, INT32_PTR) OUTPUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) OUTPUT_TYPEMAP(long long, long long, long, INT64_PTR) OUTPUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) OUTPUT_TYPEMAP(float, float, float, FLOAT_PTR) OUTPUT_TYPEMAP(double, double, double, DOUBLE_PTR) #undef OUTPUT_TYPEMAP %typemap(in) bool *OUTPUT, bool &OUTPUT %{ *$input = 0; $1 = ($1_ltype)$input; %} /* INOUT typemaps -------------- These typemaps are for pointer/reference parameters that are both input and output and are mapped to a C# reference parameter. The following typemaps can be applied to turn a pointer or reference into a reference parameters, that is the parameter is both an input and an output. In C#, the 'ref' keyword is used for reference parameters. bool *INOUT, bool &INOUT signed char *INOUT, signed char &INOUT unsigned char *INOUT, unsigned char &INOUT short *INOUT, short &INOUT unsigned short *INOUT, unsigned short &INOUT int *INOUT, int &INOUT unsigned int *INOUT, unsigned int &INOUT long *INOUT, long &INOUT unsigned long *INOUT, unsigned long &INOUT long long *INOUT, long long &INOUT unsigned long long *INOUT, unsigned long long &INOUT float *INOUT, float &INOUT double *INOUT, double &INOUT For example, suppose you were trying to wrap the following function : void neg(double *x) { *x = -(*x); } You could wrap it with SWIG as follows : %include void neg(double *INOUT); or you can use the %apply directive : %include %apply double *INOUT { double *x }; void neg(double *x); The C# output of the function would be the new value returned by the reference parameter. In C# you would use it like this: double x = 5.0; neg(ref x); The implementation of the OUTPUT and INOUT typemaps is different to the scripting languages in that the scripting languages will return the output value as part of the function return value. */ %define INOUT_TYPEMAP(TYPE, CTYPE, CSTYPE, TYPECHECKPRECEDENCE) %typemap(ctype) TYPE *INOUT, TYPE &INOUT "CTYPE *" %typemap(imtype) TYPE *INOUT, TYPE &INOUT "ref CSTYPE" %typemap(cstype) TYPE *INOUT, TYPE &INOUT "ref CSTYPE" %typemap(csin) TYPE *INOUT, TYPE &INOUT "ref $csinput" %typemap(csdirectorin) TYPE *INOUT, TYPE &INOUT "$iminput" %typemap(csdirectorout) TYPE *INOUT, TYPE &INOUT "$cscall" %typemap(in) TYPE *INOUT, TYPE &INOUT %{ $1 = ($1_ltype)$input; %} %typemap(directorout,warning="Need to provide TYPE *INOUT directorout typemap") TYPE *INOUT, TYPE &INOUT { } %typemap(directorin) TYPE &INOUT %{ $input = &$1; %} %typemap(directorin,warning="Need to provide TYPE *INOUT directorin typemap, TYPE array length is unknown") TYPE *INOUT, TYPE &INOUT { } %typecheck(SWIG_TYPECHECK_##TYPECHECKPRECEDENCE) TYPE *INOUT, TYPE &INOUT "" %enddef INOUT_TYPEMAP(bool, unsigned int, bool, BOOL_PTR) //INOUT_TYPEMAP(char, char, char, CHAR_PTR) INOUT_TYPEMAP(signed char, signed char, sbyte, INT8_PTR) INOUT_TYPEMAP(unsigned char, unsigned char, byte, UINT8_PTR) INOUT_TYPEMAP(short, short, short, INT16_PTR) INOUT_TYPEMAP(unsigned short, unsigned short, ushort, UINT16_PTR) INOUT_TYPEMAP(int, int, int, INT32_PTR) INOUT_TYPEMAP(unsigned int, unsigned int, uint, UINT32_PTR) INOUT_TYPEMAP(long, long, int, INT32_PTR) INOUT_TYPEMAP(unsigned long, unsigned long, uint, UINT32_PTR) INOUT_TYPEMAP(long long, long long, long, INT64_PTR) INOUT_TYPEMAP(unsigned long long, unsigned long long, ulong, UINT64_PTR) INOUT_TYPEMAP(float, float, float, FLOAT_PTR) INOUT_TYPEMAP(double, double, double, DOUBLE_PTR) #undef INOUT_TYPEMAP 0707010008e799000081a40000000000000000000000014caec28900000caf000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/csharp/wchar.i/* ----------------------------------------------------------------------------- * wchar.i * * Typemaps for the wchar_t type * These are mapped to a C# String and are passed around by value. * * Support code for wide strings can be turned off by defining SWIG_CSHARP_NO_WSTRING_HELPER * * ----------------------------------------------------------------------------- */ #if !defined(SWIG_CSHARP_NO_WSTRING_HELPER) #if !defined(SWIG_CSHARP_WSTRING_HELPER_) #define SWIG_CSHARP_WSTRING_HELPER_ %insert(runtime) %{ /* Callback for returning strings to C# without leaking memory */ typedef void * (SWIGSTDCALL* SWIG_CSharpWStringHelperCallback)(const wchar_t *); static SWIG_CSharpWStringHelperCallback SWIG_csharp_wstring_callback = NULL; %} %pragma(csharp) imclasscode=%{ protected class SWIGWStringHelper { public delegate string SWIGWStringDelegate(IntPtr message); static SWIGWStringDelegate wstringDelegate = new SWIGWStringDelegate(CreateWString); [DllImport("$dllimport", EntryPoint="SWIGRegisterWStringCallback_$module")] public static extern void SWIGRegisterWStringCallback_$module(SWIGWStringDelegate wstringDelegate); static string CreateWString([MarshalAs(UnmanagedType.LPWStr)]IntPtr cString) { return System.Runtime.InteropServices.Marshal.PtrToStringUni(cString); } static SWIGWStringHelper() { SWIGRegisterWStringCallback_$module(wstringDelegate); } } static protected SWIGWStringHelper swigWStringHelper = new SWIGWStringHelper(); %} %insert(runtime) %{ #ifdef __cplusplus extern "C" #endif SWIGEXPORT void SWIGSTDCALL SWIGRegisterWStringCallback_$module(SWIG_CSharpWStringHelperCallback callback) { SWIG_csharp_wstring_callback = callback; } %} #endif // SWIG_CSHARP_WSTRING_HELPER_ #endif // SWIG_CSHARP_NO_WSTRING_HELPER // wchar_t %typemap(ctype) wchar_t "wchar_t" %typemap(imtype) wchar_t "char" %typemap(cstype) wchar_t "char" %typemap(csin) wchar_t "$csinput" %typemap(csout, excode=SWIGEXCODE) wchar_t { char ret = $imcall;$excode return ret; } %typemap(csvarin, excode=SWIGEXCODE2) wchar_t %{ set { $imcall;$excode } %} %typemap(csvarout, excode=SWIGEXCODE2) wchar_t %{ get { char ret = $imcall;$excode return ret; } %} %typemap(in) wchar_t %{ $1 = ($1_ltype)$input; %} %typemap(out) wchar_t %{ $result = (wchar_t)$1; %} %typemap(typecheck) wchar_t = char; // wchar_t * %typemap(ctype) wchar_t * "wchar_t *" %typemap(imtype, inattributes="[MarshalAs(UnmanagedType.LPWStr)]", out="IntPtr" ) wchar_t * "string" %typemap(cstype) wchar_t * "string" %typemap(csin) wchar_t * "$csinput" %typemap(csout, excode=SWIGEXCODE) wchar_t * { string ret = System.Runtime.InteropServices.Marshal.PtrToStringUni($imcall);$excode return ret; } %typemap(csvarin, excode=SWIGEXCODE2) wchar_t * %{ set { $imcall;$excode } %} %typemap(csvarout, excode=SWIGEXCODE2) wchar_t * %{ get { string ret = $imcall;$excode return ret; } %} %typemap(in) wchar_t * %{ $1 = ($1_ltype)$input; %} %typemap(out) wchar_t * %{ $result = (wchar_t *)$1; %} %typemap(typecheck) wchar_t * = char *; 0707010008e790000081a40000000000000000000000014caec2890000084b000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/csharp/std_except.i/* ----------------------------------------------------------------------------- * std_except.i * * Typemaps used by the STL wrappers that throw exceptions. These typemaps are * used when methods are declared with an STL exception specification, such as * size_t at() const throw (std::out_of_range); * ----------------------------------------------------------------------------- */ %{ #include %} namespace std { %ignore exception; struct exception {}; } %typemap(throws, canthrow=1) std::bad_exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::domain_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::exception "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::invalid_argument "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentException, $1.what(), \"\");\n return $null;" %typemap(throws, canthrow=1) std::length_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::logic_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::out_of_range "SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::overflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::range_error "SWIG_CSharpSetPendingException(SWIG_CSharpIndexOutOfRangeException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::runtime_error "SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.what());\n return $null;" %typemap(throws, canthrow=1) std::underflow_error "SWIG_CSharpSetPendingException(SWIG_CSharpOverflowException, $1.what());\n return $null;" 0707010008e78b000081a40000000000000000000000014caec28900000b75000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/csharp/enums.swg/* ----------------------------------------------------------------------------- * enums.swg * * Include this file in order for C/C++ enums to be wrapped by proper C# enums. * Note that the PINVOKE layer handles the enum as an int. * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps %typemap(ctype) const enum SWIGTYPE & "int" %typemap(imtype) const enum SWIGTYPE & "int" %typemap(cstype) const enum SWIGTYPE & "$*csclassname" %typemap(in) const enum SWIGTYPE & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = *$1; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin) const enum SWIGTYPE & "$input = $1_name;" %typemap(csdirectorin) const enum SWIGTYPE & "($*csclassname)$iminput" %typemap(csdirectorout) const enum SWIGTYPE & "(int)$cscall" %typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" %typemap(throws, canthrow=1) const enum SWIGTYPE & %{ (void)$1; SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); return $null; %} %typemap(csin) const enum SWIGTYPE & "(int)$csinput" %typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { $*csclassname ret = ($*csclassname)$imcall;$excode return ret; } %typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ get { $*csclassname ret = ($*csclassname)$imcall;$excode return ret; } %} // enum SWIGTYPE typemaps %typemap(ctype) enum SWIGTYPE "int" %typemap(imtype) enum SWIGTYPE "int" %typemap(cstype) enum SWIGTYPE "$csclassname" %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} %typemap(out) enum SWIGTYPE %{ $result = $1; %} %typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} %typemap(directorin) enum SWIGTYPE "$input = $1;" %typemap(csdirectorin) enum SWIGTYPE "($csclassname)$iminput" %typemap(csdirectorout) enum SWIGTYPE "(int)$cscall" %typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" %typemap(throws, canthrow=1) enum SWIGTYPE %{ (void)$1; SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); return $null; %} %typemap(csin) enum SWIGTYPE "(int)$csinput" %typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { $csclassname ret = ($csclassname)$imcall;$excode return ret; } %typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ get { $csclassname ret = ($csclassname)$imcall;$excode return ret; } %} %typemap(csbase) enum SWIGTYPE "" %typemap(csclassmodifiers) enum SWIGTYPE "public enum" %typemap(cscode) enum SWIGTYPE "" %typemap(csimports) enum SWIGTYPE "" %typemap(csinterfaces) enum SWIGTYPE "" %typemap(csbody) enum SWIGTYPE "" %csenum(proper); 0707010008e792000081a40000000000000000000000014caec289000002bf000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/csharp/std_pair.i/* ----------------------------------------------------------------------------- * std_pair.i * * SWIG typemaps for std::pair * ----------------------------------------------------------------------------- */ %include %include // ------------------------------------------------------------------------ // std::pair // ------------------------------------------------------------------------ %{ #include %} namespace std { template struct pair { pair(); pair(T t, U u); pair(const pair& p); template pair(const pair &p); T first; U second; }; // add specializations here } 0707010008e786000081a40000000000000000000000014caec289000026ff000000b600010002ffffffffffffffff0000003a00000000root/usr/local/share/swig/2.0.1/csharp/boost_shared_ptr.i%include // Language specific macro implementing all the customisations for handling the smart pointer %define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) // %naturalvar is as documented for member variables %naturalvar TYPE; %naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; // destructor mods %feature("unref") TYPE //"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" "(void)arg1; delete smartarg1;" // Typemap customisations... // plain value %typemap(in, canthrow=1) CONST TYPE ($&1_type argp = 0) %{ argp = ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0; if (!argp) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); return $null; } $1 = *argp; %} %typemap(out) CONST TYPE %{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(($1_ltype &)$1)); %} // plain pointer %typemap(in, canthrow=1) CONST TYPE * (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ smartarg = (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input; $1 = (TYPE *)(smartarg ? smartarg->get() : 0); %} %typemap(out, fragment="SWIG_null_deleter") CONST TYPE * %{ $result = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; %} // plain reference %typemap(in, canthrow=1) CONST TYPE & %{ $1 = ($1_ltype)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); if (!$1) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type reference is null", 0); return $null; } %} %typemap(out, fragment="SWIG_null_deleter") CONST TYPE & %{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %} // plain pointer by reference %typemap(in) TYPE *CONST& ($*1_ltype temp = 0) %{ temp = (TYPE *)(((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input) ? ((SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)$input)->get() : 0); $1 = &temp; %} %typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& %{ $result = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %} // shared_ptr by value %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > %{ if ($input) $1 = *($&1_ltype)$input; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > %{ $result = $1 ? new $1_ltype($1) : 0; %} // shared_ptr by reference %typemap(in, canthrow=1) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & ($*1_ltype tempnull) %{ $1 = $input ? ($1_ltype)$input : &tempnull; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ $result = *$1 ? new $*1_ltype(*$1) : 0; %} // shared_ptr by pointer %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * ($*1_ltype tempnull) %{ $1 = $input ? ($1_ltype)$input : &tempnull; %} %typemap(out, fragment="SWIG_null_deleter") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ $result = ($1 && *$1) ? new $*1_ltype(*($1_ltype)$1) : 0; if ($owner) delete $1; %} // shared_ptr by pointer reference %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempnull, $*1_ltype temp = 0) %{ temp = $input ? *($1_ltype)&$input : &tempnull; $1 = &temp; %} %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ *($1_ltype)&$result = (*$1 && **$1) ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %} // various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug %typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap (ctype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "void *" %typemap (imtype, out="IntPtr") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "HandleRef" %typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE)" %typemap(csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)" %typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) CONST TYPE { $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) CONST TYPE & { $typemap(cstype, TYPE) ret = new $typemap(cstype, TYPE)($imcall, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) CONST TYPE * { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) TYPE *CONST& { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE & %{ get { $csclassname ret = new $csclassname($imcall, true);$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) CONST TYPE * %{ get { IntPtr cPtr = $imcall; $csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, true);$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ get { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ get { IntPtr cPtr = $imcall; $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode return ret; } %} // Proxy classes (base classes, ie, not derived classes) %typemap(csbody) TYPE %{ private HandleRef swigCPtr; private bool swigCMemOwnBase; internal $csclassname(IntPtr cPtr, bool cMemoryOwn) { swigCMemOwnBase = cMemoryOwn; swigCPtr = new HandleRef(this, cPtr); } internal static HandleRef getCPtr($csclassname obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } %} // Derived proxy classes %typemap(csbody_derived) TYPE %{ private HandleRef swigCPtr; private bool swigCMemOwnDerived; internal $csclassname(IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) { swigCMemOwnDerived = cMemoryOwn; swigCPtr = new HandleRef(this, cPtr); } internal static HandleRef getCPtr($csclassname obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } %} %typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE { lock(this) { if (swigCPtr.Handle != IntPtr.Zero) { if (swigCMemOwnBase) { swigCMemOwnBase = false; $imcall; } swigCPtr = new HandleRef(null, IntPtr.Zero); } GC.SuppressFinalize(this); } } %typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE { lock(this) { if (swigCPtr.Handle != IntPtr.Zero) { if (swigCMemOwnDerived) { swigCMemOwnDerived = false; $imcall; } swigCPtr = new HandleRef(null, IntPtr.Zero); } GC.SuppressFinalize(this); base.Dispose(); } } %template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; %enddef 0707010008e794000081a40000000000000000000000014caec28900000c6b000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/csharp/std_string.i/* ----------------------------------------------------------------------------- * std_string.i * * Typemaps for std::string and const std::string& * These are mapped to a C# String and are passed around by value. * * To use non-const std::string references use the following %apply. Note * that they are passed by value. * %apply const std::string & {std::string &}; * ----------------------------------------------------------------------------- */ %{ #include %} namespace std { %naturalvar string; class string; // string %typemap(ctype) string "char *" %typemap(imtype) string "string" %typemap(cstype) string "string" %typemap(csdirectorin) string "$iminput" %typemap(csdirectorout) string "$cscall" %typemap(in, canthrow=1) string %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); return $null; } $1.assign($input); %} %typemap(out) string %{ $result = SWIG_csharp_string_callback($1.c_str()); %} %typemap(directorout, canthrow=1) string %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); return $null; } $result.assign($input); %} %typemap(directorin) string %{ $input = SWIG_csharp_string_callback($1.c_str()); %} %typemap(csin) string "$csinput" %typemap(csout, excode=SWIGEXCODE) string { string ret = $imcall;$excode return ret; } %typemap(typecheck) string = char *; %typemap(throws, canthrow=1) string %{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); return $null; %} // const string & %typemap(ctype) const string & "char *" %typemap(imtype) const string & "string" %typemap(cstype) const string & "string" %typemap(csdirectorin) const string & "$iminput" %typemap(csdirectorout) const string & "$cscall" %typemap(in, canthrow=1) const string & %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); return $null; } std::string $1_str($input); $1 = &$1_str; %} %typemap(out) const string & %{ $result = SWIG_csharp_string_callback($1->c_str()); %} %typemap(csin) const string & "$csinput" %typemap(csout, excode=SWIGEXCODE) const string & { string ret = $imcall;$excode return ret; } %typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string & %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); return $null; } /* possible thread/reentrant code problem */ static std::string $1_str; $1_str = $input; $result = &$1_str; %} %typemap(directorin) const string & %{ $input = SWIG_csharp_string_callback($1.c_str()); %} %typemap(csvarin, excode=SWIGEXCODE2) const string & %{ set { $imcall;$excode } %} %typemap(csvarout, excode=SWIGEXCODE2) const string & %{ get { string ret = $imcall;$excode return ret; } %} %typemap(typecheck) const string & = char *; %typemap(throws, canthrow=1) const string & %{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str()); return $null; %} } 0707010008e789000081a40000000000000000000000014caec28900000687000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/csharp/csharpkw.swg#ifndef CSHARP_CSHARPKW_SWG_ #define CSHARP_CSHARPKW_SWG_ /* Warnings for C# keywords */ #define CSHARPKW(x) %keywordwarn("'" `x` "' is a C# keyword, renaming to '_" `x` "'",rename="_%s") `x` /* from http://www.jaggersoft.com/csharp_grammar.html#1.7%20Keywords */ CSHARPKW(abstract); CSHARPKW(as); CSHARPKW(base); CSHARPKW(bool); CSHARPKW(break); CSHARPKW(byte); CSHARPKW(case); CSHARPKW(catch); CSHARPKW(char); CSHARPKW(checked); CSHARPKW(class); CSHARPKW(const); CSHARPKW(continue); CSHARPKW(decimal); CSHARPKW(default); CSHARPKW(delegate); CSHARPKW(do); CSHARPKW(double); CSHARPKW(else); CSHARPKW(enum); CSHARPKW(event); CSHARPKW(explicit); CSHARPKW(extern); CSHARPKW(false); CSHARPKW(finally); CSHARPKW(fixed); CSHARPKW(float); CSHARPKW(for); CSHARPKW(foreach); CSHARPKW(goto); CSHARPKW(if); CSHARPKW(implicit); CSHARPKW(in); CSHARPKW(int); CSHARPKW(interface); CSHARPKW(internal); CSHARPKW(is); CSHARPKW(lock); CSHARPKW(long); CSHARPKW(namespace); CSHARPKW(new); CSHARPKW(null); CSHARPKW(object); CSHARPKW(operator); CSHARPKW(out); CSHARPKW(override); CSHARPKW(params); CSHARPKW(private); CSHARPKW(protected); CSHARPKW(public); CSHARPKW(readonly); CSHARPKW(ref); CSHARPKW(return); CSHARPKW(sbyte); CSHARPKW(sealed); CSHARPKW(short); CSHARPKW(sizeof); CSHARPKW(stackalloc); CSHARPKW(static); CSHARPKW(struct); CSHARPKW(string); CSHARPKW(switch); CSHARPKW(this); CSHARPKW(throw); CSHARPKW(true); CSHARPKW(try); CSHARPKW(typeof); CSHARPKW(uint); CSHARPKW(ulong); CSHARPKW(unchecked); CSHARPKW(unsafe); CSHARPKW(ushort); CSHARPKW(using); CSHARPKW(virtual); CSHARPKW(void); CSHARPKW(volatile); CSHARPKW(while); #undef CSHARPKW #endif //CSHARP_CSHARPKW_SWG_ 0707010008e787000081a40000000000000000000000014caec28900008bfe000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/csharp/csharp.swg/* ----------------------------------------------------------------------------- * csharp.swg * * C# typemaps * ----------------------------------------------------------------------------- */ %include /* The ctype, imtype and cstype typemaps work together and so there should be one of each. * The ctype typemap contains the PInvoke type used in the PInvoke (C/C++) code. * The imtype typemap contains the C# type used in the intermediary class. * The cstype typemap contains the C# type used in the C# proxy classes, type wrapper classes and module class. */ /* Fragments */ %fragment("SWIG_PackData", "header") { /* Pack binary data into a string */ SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; register const unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } } %fragment("SWIG_UnPackData", "header") { /* Unpack binary data from a string */ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { register unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register char d = *(c++); register unsigned char uu; if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; } return c; } } /* Primitive types */ %typemap(ctype) bool, const bool & "unsigned int" %typemap(ctype) char, const char & "char" %typemap(ctype) signed char, const signed char & "signed char" %typemap(ctype) unsigned char, const unsigned char & "unsigned char" %typemap(ctype) short, const short & "short" %typemap(ctype) unsigned short, const unsigned short & "unsigned short" %typemap(ctype) int, const int & "int" %typemap(ctype) unsigned int, const unsigned int & "unsigned int" %typemap(ctype) long, const long & "long" %typemap(ctype) unsigned long, const unsigned long & "unsigned long" %typemap(ctype) long long, const long long & "long long" %typemap(ctype) unsigned long long, const unsigned long long & "unsigned long long" %typemap(ctype) float, const float & "float" %typemap(ctype) double, const double & "double" %typemap(ctype) void "void" %typemap(imtype) bool, const bool & "bool" %typemap(imtype) char, const char & "char" %typemap(imtype) signed char, const signed char & "sbyte" %typemap(imtype) unsigned char, const unsigned char & "byte" %typemap(imtype) short, const short & "short" %typemap(imtype) unsigned short, const unsigned short & "ushort" %typemap(imtype) int, const int & "int" %typemap(imtype) unsigned int, const unsigned int & "uint" %typemap(imtype) long, const long & "int" %typemap(imtype) unsigned long, const unsigned long & "uint" %typemap(imtype) long long, const long long & "long" %typemap(imtype) unsigned long long, const unsigned long long & "ulong" %typemap(imtype) float, const float & "float" %typemap(imtype) double, const double & "double" %typemap(imtype) void "void" %typemap(cstype) bool, const bool & "bool" %typemap(cstype) char, const char & "char" %typemap(cstype) signed char, const signed char & "sbyte" %typemap(cstype) unsigned char, const unsigned char & "byte" %typemap(cstype) short, const short & "short" %typemap(cstype) unsigned short, const unsigned short & "ushort" %typemap(cstype) int, const int & "int" %typemap(cstype) unsigned int, const unsigned int & "uint" %typemap(cstype) long, const long & "int" %typemap(cstype) unsigned long, const unsigned long & "uint" %typemap(cstype) long long, const long long & "long" %typemap(cstype) unsigned long long, const unsigned long long & "ulong" %typemap(cstype) float, const float & "float" %typemap(cstype) double, const double & "double" %typemap(cstype) void "void" %typemap(ctype) char *, char *&, char[ANY], char[] "char *" %typemap(imtype) char *, char *&, char[ANY], char[] "string" %typemap(cstype) char *, char *&, char[ANY], char[] "string" /* Non primitive types */ %typemap(ctype) SWIGTYPE "void *" %typemap(imtype, out="IntPtr") SWIGTYPE "HandleRef" %typemap(cstype) SWIGTYPE "$&csclassname" %typemap(ctype) SWIGTYPE [] "void *" %typemap(imtype, out="IntPtr") SWIGTYPE [] "HandleRef" %typemap(cstype) SWIGTYPE [] "$csclassname" %typemap(ctype) SWIGTYPE * "void *" %typemap(imtype, out="IntPtr") SWIGTYPE * "HandleRef" %typemap(cstype) SWIGTYPE * "$csclassname" %typemap(ctype) SWIGTYPE & "void *" %typemap(imtype, out="IntPtr") SWIGTYPE & "HandleRef" %typemap(cstype) SWIGTYPE & "$csclassname" /* pointer to a class member */ %typemap(ctype) SWIGTYPE (CLASS::*) "char *" %typemap(imtype) SWIGTYPE (CLASS::*) "string" %typemap(cstype) SWIGTYPE (CLASS::*) "$csclassname" /* The following are the in and out typemaps. These are the PInvoke code generating typemaps for converting from C# to C and visa versa. */ /* primitive types */ %typemap(in) bool %{ $1 = $input ? true : false; %} %typemap(directorout) bool %{ $result = $input ? true : false; %} %typemap(csdirectorin) bool "$iminput" %typemap(csdirectorout) bool "$cscall" %typemap(in) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double %{ $1 = ($1_ltype)$input; %} %typemap(directorout) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double %{ $result = ($1_ltype)$input; %} %typemap(directorin) bool "$input = $1;" %typemap(directorin) char "$input = $1;" %typemap(directorin) signed char "$input = $1;" %typemap(directorin) unsigned char "$input = $1;" %typemap(directorin) short "$input = $1;" %typemap(directorin) unsigned short "$input = $1;" %typemap(directorin) int "$input = $1;" %typemap(directorin) unsigned int "$input = $1;" %typemap(directorin) long "$input = $1;" %typemap(directorin) unsigned long "$input = $1;" %typemap(directorin) long long "$input = $1;" %typemap(directorin) unsigned long long "$input = $1;" %typemap(directorin) float "$input = $1;" %typemap(directorin) double "$input = $1;" %typemap(csdirectorin) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double "$iminput" %typemap(csdirectorout) char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double "$cscall" %typemap(out) bool %{ $result = $1; %} %typemap(out) char %{ $result = $1; %} %typemap(out) signed char %{ $result = $1; %} %typemap(out) unsigned char %{ $result = $1; %} %typemap(out) short %{ $result = $1; %} %typemap(out) unsigned short %{ $result = $1; %} %typemap(out) int %{ $result = $1; %} %typemap(out) unsigned int %{ $result = $1; %} %typemap(out) long %{ $result = $1; %} %typemap(out) unsigned long %{ $result = (unsigned long)$1; %} %typemap(out) long long %{ $result = $1; %} %typemap(out) unsigned long long %{ $result = $1; %} %typemap(out) float %{ $result = $1; %} %typemap(out) double %{ $result = $1; %} /* char * - treat as String */ %typemap(in) char * %{ $1 = ($1_ltype)$input; %} %typemap(out) char * %{ $result = SWIG_csharp_string_callback((const char *)$1); %} %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * %{ $result = ($1_ltype)$input; %} %typemap(directorin) char * %{ $input = SWIG_csharp_string_callback((const char *)$1); %} %typemap(csdirectorin) char * "$iminput" %typemap(csdirectorout) char * "$cscall" /* char *& - treat as String */ %typemap(in) char *& ($*1_ltype temp = 0) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) char *& %{ if ($1) $result = SWIG_csharp_string_callback((const char *)*$1); %} %typemap(out, null="") void "" %typemap(csdirectorin) void "$iminput" %typemap(csdirectorout) void "$cscall" %typemap(directorin) void "" /* primitive types by const reference */ %typemap(in) const bool & ($*1_ltype temp) %{ temp = $input ? true : false; $1 = &temp; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool & %{ static $*1_ltype temp; temp = $input ? true : false; $result = &temp; %} %typemap(csdirectorin) const bool & "$iminput" %typemap(csdirectorout) const bool & "$cscall" %typemap(in) const char & ($*1_ltype temp), const signed char & ($*1_ltype temp), const unsigned char & ($*1_ltype temp), const short & ($*1_ltype temp), const unsigned short & ($*1_ltype temp), const int & ($*1_ltype temp), const unsigned int & ($*1_ltype temp), const long & ($*1_ltype temp), const unsigned long & ($*1_ltype temp), const long long & ($*1_ltype temp), const unsigned long long & ($*1_ltype temp), const float & ($*1_ltype temp), const double & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &, const signed char &, const unsigned char &, const short &, const unsigned short &, const int &, const unsigned int &, const long &, const unsigned long &, const long long &, const float &, const double & %{ static $*1_ltype temp; temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin) const bool & "$input = $1_name;" %typemap(directorin) const char & "$input = $1_name;" %typemap(directorin) const signed char & "$input = $1_name;" %typemap(directorin) const unsigned char & "$input = $1_name;" %typemap(directorin) const short & "$input = $1_name;" %typemap(directorin) const unsigned short & "$input = $1_name;" %typemap(directorin) const int & "$input = $1_name;" %typemap(directorin) const unsigned int & "$input = $1_name;" %typemap(directorin) const long & "$input = $1_name;" %typemap(directorin) const unsigned long & "$input = $1_name;" %typemap(directorin) const long long & "$input = $1_name;" %typemap(directorin) const float & "$input = $1_name;" %typemap(directorin) const double & "$input = $1_name;" %typemap(csdirectorin) const char & ($*1_ltype temp), const signed char & ($*1_ltype temp), const unsigned char & ($*1_ltype temp), const short & ($*1_ltype temp), const unsigned short & ($*1_ltype temp), const int & ($*1_ltype temp), const unsigned int & ($*1_ltype temp), const long & ($*1_ltype temp), const unsigned long & ($*1_ltype temp), const long long & ($*1_ltype temp), const float & ($*1_ltype temp), const double & ($*1_ltype temp) "$iminput" %typemap(csdirectorout) const char & ($*1_ltype temp), const signed char & ($*1_ltype temp), const unsigned char & ($*1_ltype temp), const short & ($*1_ltype temp), const unsigned short & ($*1_ltype temp), const int & ($*1_ltype temp), const unsigned int & ($*1_ltype temp), const long & ($*1_ltype temp), const unsigned long & ($*1_ltype temp), const long long & ($*1_ltype temp), const float & ($*1_ltype temp), const double & ($*1_ltype temp) "$cscall" %typemap(out) const bool & %{ $result = *$1; %} %typemap(out) const char & %{ $result = *$1; %} %typemap(out) const signed char & %{ $result = *$1; %} %typemap(out) const unsigned char & %{ $result = *$1; %} %typemap(out) const short & %{ $result = *$1; %} %typemap(out) const unsigned short & %{ $result = *$1; %} %typemap(out) const int & %{ $result = *$1; %} %typemap(out) const unsigned int & %{ $result = *$1; %} %typemap(out) const long & %{ $result = *$1; %} %typemap(out) const unsigned long & %{ $result = (unsigned long)*$1; %} %typemap(out) const long long & %{ $result = *$1; %} %typemap(out) const unsigned long long & %{ $result = *$1; %} %typemap(out) const float & %{ $result = *$1; %} %typemap(out) const double & %{ $result = *$1; %} /* Default handling. Object passed by value. Convert to a pointer */ %typemap(in, canthrow=1) SWIGTYPE ($&1_type argp) %{ argp = ($&1_ltype)$input; if (!argp) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0); return $null; } $1 = *argp; %} %typemap(directorout) SWIGTYPE %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); return $null; } $result = *($&1_ltype)$input; %} %typemap(out) SWIGTYPE #ifdef __cplusplus %{ $result = new $1_ltype((const $1_ltype &)$1); %} #else { $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype)); memmove($1ptr, &$1, sizeof($1_type)); $result = $1ptr; } #endif %typemap(directorin) SWIGTYPE %{ $input = (void *)&$1; %} %typemap(csdirectorin) SWIGTYPE "new $&csclassname($iminput, false)" %typemap(csdirectorout) SWIGTYPE "$&csclassname.getCPtr($cscall).Handle" /* Generic pointers and references */ %typemap(in) SWIGTYPE * %{ $1 = ($1_ltype)$input; %} %typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) %{ SWIG_UnpackData($input, (void *)&$1, sizeof($1)); %} %typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input; if (!$1) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type type is null", 0); return $null; } %} %typemap(out) SWIGTYPE * %{ $result = (void *)$1; %} %typemap(out, fragment="SWIG_PackData") SWIGTYPE (CLASS::*) %{ char buf[128]; char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1)); *data = '\0'; $result = SWIG_csharp_string_callback(buf); %} %typemap(out) SWIGTYPE & %{ $result = (void *)$1; %} %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE * %{ $result = ($1_ltype)$input; %} %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*) %{ $result = ($1_ltype)$input; %} %typemap(directorin) SWIGTYPE * %{ $input = (void *) $1; %} %typemap(directorin) SWIGTYPE (CLASS::*) %{ $input = (void *) $1; %} %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE & %{ if (!$input) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Unexpected null return for type $1_type", 0); return $null; } $result = ($1_ltype)$input; %} %typemap(directorin) SWIGTYPE & %{ $input = ($1_ltype) &$1; %} %typemap(csdirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($iminput == IntPtr.Zero) ? null : new $csclassname($iminput, false)" %typemap(csdirectorin) SWIGTYPE & "new $csclassname($iminput, false)" %typemap(csdirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE & "$csclassname.getCPtr($cscall).Handle" /* Default array handling */ %typemap(in) SWIGTYPE [] %{ $1 = ($1_ltype)$input; %} %typemap(out) SWIGTYPE [] %{ $result = $1; %} /* char arrays - treat as String */ %typemap(in) char[ANY], char[] %{ $1 = ($1_ltype)$input; %} %typemap(out) char[ANY], char[] %{ $result = SWIG_csharp_string_callback((const char *)$1); %} %typemap(directorout) char[ANY], char[] %{ $result = ($1_ltype)$input; %} %typemap(directorin) char[ANY], char[] %{ $input = SWIG_csharp_string_callback((const char *)$1); %} %typemap(csdirectorin) char[ANY], char[] "$iminput" %typemap(csdirectorout) char[ANY], char[] "$cscall" /* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions * that cannot be overloaded in C# as more than one C++ type maps to a single C# type */ %typecheck(SWIG_TYPECHECK_BOOL) bool, const bool & "" %typecheck(SWIG_TYPECHECK_CHAR) char, const char & "" %typecheck(SWIG_TYPECHECK_INT8) signed char, const signed char & "" %typecheck(SWIG_TYPECHECK_UINT8) unsigned char, const unsigned char & "" %typecheck(SWIG_TYPECHECK_INT16) short, const short & "" %typecheck(SWIG_TYPECHECK_UINT16) unsigned short, const unsigned short & "" %typecheck(SWIG_TYPECHECK_INT32) int, long, const int &, const long & "" %typecheck(SWIG_TYPECHECK_UINT32) unsigned int, unsigned long, const unsigned int &, const unsigned long & "" %typecheck(SWIG_TYPECHECK_INT64) long long, const long long & "" %typecheck(SWIG_TYPECHECK_UINT64) unsigned long long, const unsigned long long & "" %typecheck(SWIG_TYPECHECK_FLOAT) float, const float & "" %typecheck(SWIG_TYPECHECK_DOUBLE) double, const double & "" %typecheck(SWIG_TYPECHECK_STRING) char *, char *&, char[ANY], char[] "" %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE *const&, SWIGTYPE [], SWIGTYPE (CLASS::*) "" /* Exception handling */ %typemap(throws, canthrow=1) int, long, short, unsigned int, unsigned long, unsigned short %{ char error_msg[256]; sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1); SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, error_msg); return $null; %} %typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY] %{ (void)$1; SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); return $null; %} %typemap(throws, canthrow=1) char * %{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1); return $null; %} /* Typemaps for code generation in proxy classes and C# type wrapper classes */ /* The csin typemap is used for converting function parameter types from the type * used in the proxy, module or type wrapper class to the type used in the PInvoke class. */ %typemap(csin) bool, const bool &, char, const char &, signed char, const signed char &, unsigned char, const unsigned char &, short, const short &, unsigned short, const unsigned short &, int, const int &, unsigned int, const unsigned int &, long, const long &, unsigned long, const unsigned long &, long long, const long long &, unsigned long long, const unsigned long long &, float, const float &, double, const double & "$csinput" %typemap(csin) char *, char *&, char[ANY], char[] "$csinput" %typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)" %typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$csclassname.getCPtr($csinput)" %typemap(csin) SWIGTYPE (CLASS::*) "$csclassname.getCMemberPtr($csinput)" /* The csout typemap is used for converting function return types from the return type * used in the PInvoke class to the type returned by the proxy, module or type wrapper class. * The $excode special variable is replaced by the excode typemap attribute code if the * method can throw any exceptions from unmanaged code, otherwise replaced by nothing. */ // Macro used by the $excode special variable %define SWIGEXCODE "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef %define SWIGEXCODE2 "\n if ($imclassname.SWIGPendingException.Pending) throw $imclassname.SWIGPendingException.Retrieve();" %enddef %typemap(csout, excode=SWIGEXCODE) bool, const bool & { bool ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) char, const char & { char ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) signed char, const signed char & { sbyte ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) unsigned char, const unsigned char & { byte ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) short, const short & { short ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) unsigned short, const unsigned short & { ushort ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) int, const int & { int ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) unsigned int, const unsigned int & { uint ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) long, const long & { int ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) unsigned long, const unsigned long & { uint ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) long long, const long long & { long ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) unsigned long long, const unsigned long long & { ulong ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) float, const float & { float ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) double, const double & { double ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) char *, char *&, char[ANY], char[] { string ret = $imcall;$excode return ret; } %typemap(csout, excode=SWIGEXCODE) void { $imcall;$excode } %typemap(csout, excode=SWIGEXCODE) SWIGTYPE { $&csclassname ret = new $&csclassname($imcall, true);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) SWIGTYPE & { $csclassname ret = new $csclassname($imcall, $owner);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) SWIGTYPE *, SWIGTYPE [] { IntPtr cPtr = $imcall; $csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode return ret; } %typemap(csout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) { string cMemberPtr = $imcall; $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode return ret; } /* Properties */ %typemap(csvarin, excode=SWIGEXCODE2) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{ set { $imcall;$excode } %} %typemap(csvarin, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ set { $imcall;$excode } %} %typemap(csvarout, excode=SWIGEXCODE2) bool, const bool & %{ get { bool ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) char, const char & %{ get { char ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) signed char, const signed char & %{ get { sbyte ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) unsigned char, const unsigned char & %{ get { byte ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) short, const short & %{ get { short ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) unsigned short, const unsigned short & %{ get { ushort ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) int, const int & %{ get { int ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) unsigned int, const unsigned int & %{ get { uint ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) long, const long & %{ get { int ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) unsigned long, const unsigned long & %{ get { uint ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) long long, const long long & %{ get { long ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) unsigned long long, const unsigned long long & %{ get { ulong ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) float, const float & %{ get { float ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) double, const double & %{ get { double ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) char *, char *&, char[ANY], char[] %{ get { string ret = $imcall;$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) void %{ get { $imcall;$excode } %} %typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE %{ get { $&csclassname ret = new $&csclassname($imcall, true);$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE & %{ get { $csclassname ret = new $csclassname($imcall, $owner);$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE *, SWIGTYPE [] %{ get { IntPtr cPtr = $imcall; $csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode return ret; } %} %typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE (CLASS::*) %{ get { string cMemberPtr = $imcall; $csclassname ret = (cMemberPtr == null) ? null : new $csclassname(cMemberPtr, $owner);$excode return ret; } %} /* Pointer reference typemaps */ %typemap(ctype) SWIGTYPE *const& "void *" %typemap(imtype, out="IntPtr") SWIGTYPE *const& "HandleRef" %typemap(cstype) SWIGTYPE *const& "$*csclassname" %typemap(csin) SWIGTYPE *const& "$*csclassname.getCPtr($csinput)" %typemap(csout, excode=SWIGEXCODE) SWIGTYPE *const& { IntPtr cPtr = $imcall; $*csclassname ret = (cPtr == IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode return ret; } %typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) %{ temp = ($*1_ltype)$input; $1 = ($1_ltype)&temp; %} %typemap(out) SWIGTYPE *const& %{ $result = (void *)*$1; %} /* Marshal C/C++ pointer to IntPtr */ %typemap(ctype) void *VOID_INT_PTR "void *" %typemap(imtype) void *VOID_INT_PTR "IntPtr" %typemap(cstype) void *VOID_INT_PTR "IntPtr" %typemap(in) void *VOID_INT_PTR %{ $1 = ($1_ltype)$input; %} %typemap(out) void *VOID_INT_PTR %{ $result = (void *)$1; %} %typemap(csin) void *VOID_INT_PTR "$csinput" %typemap(csout, excode=SWIGEXCODE) void *VOID_INT_PTR { IntPtr ret = $imcall;$excode return ret; } /* Typemaps used for the generation of proxy and type wrapper class code */ %typemap(csbase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" %typemap(csclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class" %typemap(cscode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" %typemap(csimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "\nusing System;\nusing System.Runtime.InteropServices;\n" %typemap(csinterfaces) SWIGTYPE "IDisposable" %typemap(csinterfaces) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" %typemap(csinterfaces_derived) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "" // Proxy classes (base classes, ie, not derived classes) %typemap(csbody) SWIGTYPE %{ private HandleRef swigCPtr; protected bool swigCMemOwn; internal $csclassname(IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new HandleRef(this, cPtr); } internal static HandleRef getCPtr($csclassname obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } %} // Derived proxy classes %typemap(csbody_derived) SWIGTYPE %{ private HandleRef swigCPtr; internal $csclassname(IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new HandleRef(this, cPtr); } internal static HandleRef getCPtr($csclassname obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } %} // Typewrapper classes %typemap(csbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] %{ private HandleRef swigCPtr; internal $csclassname(IntPtr cPtr, bool futureUse) { swigCPtr = new HandleRef(this, cPtr); } protected $csclassname() { swigCPtr = new HandleRef(null, IntPtr.Zero); } internal static HandleRef getCPtr($csclassname obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } %} %typemap(csbody) SWIGTYPE (CLASS::*) %{ private string swigCMemberPtr; internal $csclassname(string cMemberPtr, bool futureUse) { swigCMemberPtr = cMemberPtr; } protected $csclassname() { swigCMemberPtr = null; } internal static string getCMemberPtr($csclassname obj) { return obj.swigCMemberPtr; } %} %typemap(csfinalize) SWIGTYPE %{ ~$csclassname() { Dispose(); } %} %typemap(csconstruct, excode=SWIGEXCODE,directorconnect="\n SwigDirectorConnect();") SWIGTYPE %{: this($imcall, true) {$excode$directorconnect } %} %typemap(csdestruct, methodname="Dispose", methodmodifiers="public") SWIGTYPE { lock(this) { if (swigCPtr.Handle != IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; $imcall; } swigCPtr = new HandleRef(null, IntPtr.Zero); } GC.SuppressFinalize(this); } } %typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") SWIGTYPE { lock(this) { if (swigCPtr.Handle != IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; $imcall; } swigCPtr = new HandleRef(null, IntPtr.Zero); } GC.SuppressFinalize(this); base.Dispose(); } } %typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{ protected void $methodname() { swigCMemOwn = false; $imcall; } %} /* C# specific directives */ #define %csconst(flag) %feature("cs:const","flag") #define %csconstvalue(value) %feature("cs:constvalue",value) #define %csenum(wrapapproach) %feature("cs:enum","wrapapproach") #define %csmethodmodifiers %feature("cs:methodmodifiers") #define %csnothrowexception %feature("except") #define %csattributes %feature("cs:attributes") %pragma(csharp) imclassclassmodifiers="class" %pragma(csharp) moduleclassmodifiers="public class" %pragma(csharp) moduleimports=%{ using System; using System.Runtime.InteropServices; %} %pragma(csharp) imclassimports=%{ using System; using System.Runtime.InteropServices; %} /* Some ANSI C typemaps */ %apply unsigned long { size_t }; %apply const unsigned long & { const size_t & }; /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } /* csharp keywords */ %include // Default enum handling %include // For vararg handling in macros, from swigmacros.swg #define %arg(X...) X /* // Alternative char * typemaps. %pragma(csharp) imclasscode=%{ public class SWIGStringMarshal : IDisposable { public readonly HandleRef swigCPtr; public SWIGStringMarshal(string str) { swigCPtr = new HandleRef(this, System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(str)); } public virtual void Dispose() { System.Runtime.InteropServices.Marshal.FreeHGlobal(swigCPtr.Handle); GC.SuppressFinalize(this); } } %} %typemap(imtype, out="IntPtr") char *, char[ANY], char[] "HandleRef" %typemap(out) char *, char[ANY], char[] %{ $result = $1; %} %typemap(csin) char *, char[ANY], char[] "new $imclassname.SWIGStringMarshal($csinput).swigCPtr" %typemap(csout, excode=SWIGEXCODE) char *, char[ANY], char[] { string ret = System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode return ret; } %typemap(csvarin, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ set { $imcall;$excode } %} %typemap(csvarout, excode=SWIGEXCODE2) char *, char[ANY], char[] %{ get { string ret = System.Runtime.InteropServices.Marshal.PtrToStringAnsi($imcall);$excode return ret; } %} */ 0707010008e791000081a40000000000000000000000014caec2890000297f000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/csharp/std_map.i/* ----------------------------------------------------------------------------- * std_map.i * * SWIG typemaps for std::map< K, T > * * The C# wrapper is made to look and feel like a C# System.Collections.Generic.IDictionary<>. * * Using this wrapper is fairly simple. For example, to create a map from integers to doubles use: * * %include * %template(MapIntDouble) std::map * * Notes: * 1) For .NET 1 compatibility, define SWIG_DOTNET_1 when compiling the C# code. In this case * the C# wrapper has only basic functionality. * 2) IEnumerable<> is implemented in the proxy class which is useful for using LINQ with * C++ std::map wrappers. * * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! * ----------------------------------------------------------------------------- */ %{ #include #include #include %} /* K is the C++ key type, T is the C++ value type */ %define SWIG_STD_MAP_INTERNAL(K, T) %typemap(csinterfaces) std::map< K, T > "IDisposable \n#if !SWIG_DOTNET_1\n , System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n#endif\n"; %typemap(cscode) std::map %{ public $typemap(cstype, T) this[$typemap(cstype, K) key] { get { return getitem(key); } set { setitem(key, value); } } public bool TryGetValue($typemap(cstype, K) key, out $typemap(cstype, T) value) { if (this.ContainsKey(key)) { value = this[key]; return true; } value = default($typemap(cstype, T)); return false; } public int Count { get { return (int)size(); } } public bool IsReadOnly { get { return false; } } #if !SWIG_DOTNET_1 public System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys { get { System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new System.Collections.Generic.List<$typemap(cstype, K)>(); int size = this.Count; if (size > 0) { IntPtr iter = create_iterator_begin(); for (int i = 0; i < size; i++) { keys.Add(get_next_key(iter)); } destroy_iterator(iter); } return keys; } } public System.Collections.Generic.ICollection<$typemap(cstype, T)> Values { get { System.Collections.Generic.ICollection<$typemap(cstype, T)> vals = new System.Collections.Generic.List<$typemap(cstype, T)>(); foreach (System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> pair in this) { vals.Add(pair.Value); } return vals; } } public void Add(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { Add(item.Key, item.Value); } public bool Remove(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { if (Contains(item)) { return Remove(item.Key); } else { return false; } } public bool Contains(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> item) { if (this[item.Key] == item.Value) { return true; } else { return false; } } public void CopyTo(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array) { CopyTo(array, 0); } public void CopyTo(System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>[] array, int arrayIndex) { if (array == null) throw new ArgumentNullException("array"); if (arrayIndex < 0) throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); if (array.Rank > 1) throw new ArgumentException("Multi dimensional array.", "array"); if (arrayIndex+this.Count > array.Length) throw new ArgumentException("Number of elements to copy is too large."); System.Collections.Generic.IList<$typemap(cstype, K)> keyList = new System.Collections.Generic.List<$typemap(cstype, K)>(this.Keys); for (int i = 0; i < keyList.Count; i++) { $typemap(cstype, K) currentKey = keyList[i]; array.SetValue(new System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, this[currentKey]), arrayIndex+i); } } System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { return new $csclassnameEnumerator(this); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return new $csclassnameEnumerator(this); } public $csclassnameEnumerator GetEnumerator() { return new $csclassnameEnumerator(this); } // Type-safe enumerator /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown /// whenever the collection is modified. This has been done for changes in the size of the /// collection but not when one of the elements of the collection is modified as it is a bit /// tricky to detect unmanaged code that modifies the collection under our feet. public sealed class $csclassnameEnumerator : System.Collections.IEnumerator, System.Collections.Generic.IEnumerator> { private $csclassname collectionRef; private System.Collections.Generic.IList<$typemap(cstype, K)> keyCollection; private int currentIndex; private object currentObject; private int currentSize; public $csclassnameEnumerator($csclassname collection) { collectionRef = collection; keyCollection = new System.Collections.Generic.List<$typemap(cstype, K)>(collection.Keys); currentIndex = -1; currentObject = null; currentSize = collectionRef.Count; } // Type-safe iterator Current public System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)> Current { get { if (currentIndex == -1) throw new InvalidOperationException("Enumeration not started."); if (currentIndex > currentSize - 1) throw new InvalidOperationException("Enumeration finished."); if (currentObject == null) throw new InvalidOperationException("Collection modified."); return (System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>)currentObject; } } // Type-unsafe IEnumerator.Current object System.Collections.IEnumerator.Current { get { return Current; } } public bool MoveNext() { int size = collectionRef.Count; bool moveOkay = (currentIndex+1 < size) && (size == currentSize); if (moveOkay) { currentIndex++; $typemap(cstype, K) currentKey = keyCollection[currentIndex]; currentObject = new System.Collections.Generic.KeyValuePair<$typemap(cstype, K), $typemap(cstype, T)>(currentKey, collectionRef[currentKey]); } else { currentObject = null; } return moveOkay; } public void Reset() { currentIndex = -1; currentObject = null; if (collectionRef.Count != currentSize) { throw new InvalidOperationException("Collection modified."); } } public void Dispose() { currentIndex = -1; currentObject = null; } } #endif %} public: map(); map(const map< K, T > &other); typedef K key_type; typedef T mapped_type; typedef size_t size_type; size_type size() const; bool empty() const; %rename(Clear) clear; void clear(); %extend { const mapped_type& getitem(const key_type& key) throw (std::out_of_range) { std::map< K,T >::iterator iter = $self->find(key); if (iter != $self->end()) return iter->second; else throw std::out_of_range("key not found"); } void setitem(const key_type& key, const mapped_type& x) { (*$self)[key] = x; } bool ContainsKey(const key_type& key) { std::map< K, T >::iterator iter = $self->find(key); return iter != $self->end(); } void Add(const key_type& key, const mapped_type& val) throw (std::out_of_range) { std::map< K, T >::iterator iter = $self->find(key); if (iter != $self->end()) throw std::out_of_range("key already exists"); $self->insert(std::pair< K, T >(key, val)); } bool Remove(const key_type& key) { std::map< K, T >::iterator iter = $self->find(key); if (iter != $self->end()) { $self->erase(iter); return true; } return false; } // create_iterator_begin(), get_next_key() and destroy_iterator work together to provide a collection of keys to C# %apply void *VOID_INT_PTR { std::map< K, T >::iterator *create_iterator_begin } %apply void *VOID_INT_PTR { std::map< K, T >::iterator *swigiterator } std::map< K, T >::iterator *create_iterator_begin() { return new std::map< K, T >::iterator($self->begin()); } const key_type& get_next_key(std::map< K, T >::iterator *swigiterator) { std::map< K, T >::iterator iter = *swigiterator; swigiterator++; return (*iter).first; } void destroy_iterator(std::map< K, T >::iterator *swigiterator) { delete swigiterator; } } %enddef %csmethodmodifiers std::map::size "private" %csmethodmodifiers std::map::getitem "private" %csmethodmodifiers std::map::setitem "private" %csmethodmodifiers std::map::create_iterator_begin "private" %csmethodmodifiers std::map::get_next_key "private" %csmethodmodifiers std::map::destroy_iterator "private" // Default implementation namespace std { template class map { SWIG_STD_MAP_INTERNAL(K, T) }; } // Legacy macros (deprecated) %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) #warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" %enddef 0707010008e797000081a40000000000000000000000014caec28900000165000000b600010002ffffffffffffffff0000002d00000000root/usr/local/share/swig/2.0.1/csharp/stl.i/* ----------------------------------------------------------------------------- * stl.i * * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include %include %include %include %include 0707010008e78a000081a40000000000000000000000014caec28900000486000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/csharp/director.swg/* ----------------------------------------------------------------------------- * director.swg * * This file contains support for director classes so that C# proxy * methods can be called from C++. * ----------------------------------------------------------------------------- */ #ifdef __cplusplus #if defined(DEBUG_DIRECTOR_OWNED) #include #endif #include namespace Swig { /* Director base class - not currently used in C# directors */ class Director { }; /* Base class for director exceptions */ class DirectorException { protected: std::string swig_msg; public: DirectorException(const char* msg) : swig_msg(msg) { } DirectorException(const std::string &msg) : swig_msg(msg) { } const std::string& what() const { return swig_msg; } virtual ~DirectorException() { } }; /* Pure virtual method exception */ class DirectorPureVirtualException : public Swig::DirectorException { public: DirectorPureVirtualException(const char* msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) { } }; } #endif /* __cplusplus */ 0707010008e78d000081a40000000000000000000000014caec289000012ad000000b600010002ffffffffffffffff0000003800000000root/usr/local/share/swig/2.0.1/csharp/enumtypesafe.swg/* ----------------------------------------------------------------------------- * enumtypesafe.swg * * Include this file in order for C/C++ enums to be wrapped by the so called * typesafe enum pattern. Each enum has an equivalent C# class named after the * enum and each enum item is a static instance of this class. * ----------------------------------------------------------------------------- */ // const enum SWIGTYPE & typemaps %typemap(ctype) const enum SWIGTYPE & "int" %typemap(imtype) const enum SWIGTYPE & "int" %typemap(cstype) const enum SWIGTYPE & "$*csclassname" %typemap(in) const enum SWIGTYPE & ($*1_ltype temp) %{ temp = ($*1_ltype)$input; $1 = &temp; %} %typemap(out) const enum SWIGTYPE & %{ $result = *$1; %} %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE & %{ static $*1_ltype temp = ($*1_ltype)$input; $result = &temp; %} %typemap(directorin) const enum SWIGTYPE & "$input = $1_name;" %typemap(csdirectorin) const enum SWIGTYPE & "$*csclassname.swigToEnum($iminput)" %typemap(csdirectorout) const enum SWIGTYPE & "$cscall.swigValue" %typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & "" %typemap(throws, canthrow=1) const enum SWIGTYPE & %{ (void)$1; SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); return $null; %} %typemap(csin) const enum SWIGTYPE & "$csinput.swigValue" %typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & { $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode return ret; } %typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{ get { $*csclassname ret = $*csclassname.swigToEnum($imcall);$excode return ret; } %} // enum SWIGTYPE typemaps %typemap(ctype) enum SWIGTYPE "int" %typemap(imtype) enum SWIGTYPE "int" %typemap(cstype) enum SWIGTYPE "$csclassname" %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %} %typemap(out) enum SWIGTYPE %{ $result = $1; %} %typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %} %typemap(directorin) enum SWIGTYPE "$input = $1;" %typemap(csdirectorin) enum SWIGTYPE "$csclassname.swigToEnum($iminput)" %typemap(csdirectorout) enum SWIGTYPE "$cscall.swigValue" %typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE "" %typemap(throws, canthrow=1) enum SWIGTYPE %{ (void)$1; SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown"); return $null; %} %typemap(csin) enum SWIGTYPE "$csinput.swigValue" %typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE { $csclassname ret = $csclassname.swigToEnum($imcall);$excode return ret; } %typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{ get { $csclassname ret = $csclassname.swigToEnum($imcall);$excode return ret; } %} %typemap(csbase) enum SWIGTYPE "" %typemap(csclassmodifiers) enum SWIGTYPE "public sealed class" %typemap(cscode) enum SWIGTYPE "" %typemap(csimports) enum SWIGTYPE "" %typemap(csinterfaces) enum SWIGTYPE "" /* * The swigToEnum method is used to find the C# enum from a C++ enum integer value. The default one here takes * advantage of the fact that most enums do not have initial values specified, so the lookup is fast. If initial * values are specified then a lengthy linear search through all possible enums might occur. Specific typemaps could be * written to possibly optimise this lookup by taking advantage of characteristics peculiar to the targeted enum. * The special variable, $enumvalues, is replaced with a comma separated list of all the enum values. */ %typemap(csbody) enum SWIGTYPE %{ public readonly int swigValue; public static $csclassname swigToEnum(int swigValue) { if (swigValue < swigValues.Length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (int i = 0; i < swigValues.Length; i++) if (swigValues[i].swigValue == swigValue) return swigValues[i]; throw new System.ArgumentOutOfRangeException("No enum $csclassname with value " + swigValue); } public override string ToString() { return swigName; } private $csclassname(string swigName) { this.swigName = swigName; this.swigValue = swigNext++; } private $csclassname(string swigName, int swigValue) { this.swigName = swigName; this.swigValue = swigValue; swigNext = swigValue+1; } private $csclassname(string swigName, $csclassname swigEnum) { this.swigName = swigName; this.swigValue = swigEnum.swigValue; swigNext = this.swigValue+1; } private static $csclassname[] swigValues = { $enumvalues }; private static int swigNext = 0; private readonly string swigName; %} %csenum(typesafe); 0707010008e795000081a40000000000000000000000014caec28900003957000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/csharp/std_vector.i/* ----------------------------------------------------------------------------- * std_vector.i * * SWIG typemaps for std::vector * C# implementation * The C# wrapper is made to look and feel like a C# System.Collections.Generic.List<> collection. * For .NET 1 compatibility, define SWIG_DOTNET_1 when compiling the C# code; then the C# wrapper is * made to look and feel like a typesafe C# System.Collections.ArrayList. * * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with * C++ std::vector wrappers. The IList<> interface is also implemented to provide enhanced functionality * whenever we are confident that the required C++ operator== is available. This is the case for when * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_VECTOR_ENHANCED * macro to obtain this enhanced functionality, for example: * * SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass) * %template(VectKlass) std::vector; * * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! * ----------------------------------------------------------------------------- */ // Warning: Use the typemaps here in the expectation that the macros they are in will change name. %include // MACRO for use within the std::vector class body %define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CSINTERFACE, CONST_REFERENCE, CTYPE...) %typemap(csinterfaces) std::vector< CTYPE > "IDisposable, System.Collections.IEnumerable\n#if !SWIG_DOTNET_1\n , System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n#endif\n"; %typemap(cscode) std::vector< CTYPE > %{ public $csclassname(System.Collections.ICollection c) : this() { if (c == null) throw new ArgumentNullException("c"); foreach ($typemap(cstype, CTYPE) element in c) { this.Add(element); } } public bool IsFixedSize { get { return false; } } public bool IsReadOnly { get { return false; } } public $typemap(cstype, CTYPE) this[int index] { get { return getitem(index); } set { setitem(index, value); } } public int Capacity { get { return (int)capacity(); } set { if (value < size()) throw new ArgumentOutOfRangeException("Capacity"); reserve((uint)value); } } public int Count { get { return (int)size(); } } public bool IsSynchronized { get { return false; } } #if SWIG_DOTNET_1 public void CopyTo(System.Array array) #else public void CopyTo($typemap(cstype, CTYPE)[] array) #endif { CopyTo(0, array, 0, this.Count); } #if SWIG_DOTNET_1 public void CopyTo(System.Array array, int arrayIndex) #else public void CopyTo($typemap(cstype, CTYPE)[] array, int arrayIndex) #endif { CopyTo(0, array, arrayIndex, this.Count); } #if SWIG_DOTNET_1 public void CopyTo(int index, System.Array array, int arrayIndex, int count) #else public void CopyTo(int index, $typemap(cstype, CTYPE)[] array, int arrayIndex, int count) #endif { if (array == null) throw new ArgumentNullException("array"); if (index < 0) throw new ArgumentOutOfRangeException("index", "Value is less than zero"); if (arrayIndex < 0) throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); if (count < 0) throw new ArgumentOutOfRangeException("count", "Value is less than zero"); if (array.Rank > 1) throw new ArgumentException("Multi dimensional array.", "array"); if (index+count > this.Count || arrayIndex+count > array.Length) throw new ArgumentException("Number of elements to copy is too large."); for (int i=0; i System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { return new $csclassnameEnumerator(this); } #endif System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return new $csclassnameEnumerator(this); } public $csclassnameEnumerator GetEnumerator() { return new $csclassnameEnumerator(this); } // Type-safe enumerator /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown /// whenever the collection is modified. This has been done for changes in the size of the /// collection but not when one of the elements of the collection is modified as it is a bit /// tricky to detect unmanaged code that modifies the collection under our feet. public sealed class $csclassnameEnumerator : System.Collections.IEnumerator #if !SWIG_DOTNET_1 , System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> #endif { private $csclassname collectionRef; private int currentIndex; private object currentObject; private int currentSize; public $csclassnameEnumerator($csclassname collection) { collectionRef = collection; currentIndex = -1; currentObject = null; currentSize = collectionRef.Count; } // Type-safe iterator Current public $typemap(cstype, CTYPE) Current { get { if (currentIndex == -1) throw new InvalidOperationException("Enumeration not started."); if (currentIndex > currentSize - 1) throw new InvalidOperationException("Enumeration finished."); if (currentObject == null) throw new InvalidOperationException("Collection modified."); return ($typemap(cstype, CTYPE))currentObject; } } // Type-unsafe IEnumerator.Current object System.Collections.IEnumerator.Current { get { return Current; } } public bool MoveNext() { int size = collectionRef.Count; bool moveOkay = (currentIndex+1 < size) && (size == currentSize); if (moveOkay) { currentIndex++; currentObject = collectionRef[currentIndex]; } else { currentObject = null; } return moveOkay; } public void Reset() { currentIndex = -1; currentObject = null; if (collectionRef.Count != currentSize) { throw new InvalidOperationException("Collection modified."); } } #if !SWIG_DOTNET_1 public void Dispose() { currentIndex = -1; currentObject = null; } #endif } %} public: typedef size_t size_type; typedef CTYPE value_type; typedef CONST_REFERENCE const_reference; %rename(Clear) clear; void clear(); %rename(Add) push_back; void push_back(CTYPE const& x); size_type size() const; size_type capacity() const; void reserve(size_type n); %newobject GetRange(int index, int count); %newobject Repeat(CTYPE const& value, int count); vector(); vector(const vector &other); %extend { vector(int capacity) throw (std::out_of_range) { std::vector< CTYPE >* pv = 0; if (capacity >= 0) { pv = new std::vector< CTYPE >(); pv->reserve(capacity); } else { throw std::out_of_range("capacity"); } return pv; } CTYPE getitemcopy(int index) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()) return (*$self)[index]; else throw std::out_of_range("index"); } const_reference getitem(int index) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()) return (*$self)[index]; else throw std::out_of_range("index"); } void setitem(int index, CTYPE const& val) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()) (*$self)[index] = val; else throw std::out_of_range("index"); } // Takes a deep copy of the elements unlike ArrayList.AddRange void AddRange(const std::vector< CTYPE >& values) { $self->insert($self->end(), values.begin(), values.end()); } // Takes a deep copy of the elements unlike ArrayList.GetRange std::vector< CTYPE > *GetRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { if (index < 0) throw std::out_of_range("index"); if (count < 0) throw std::out_of_range("count"); if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) throw std::invalid_argument("invalid range"); return new std::vector< CTYPE >($self->begin()+index, $self->begin()+index+count); } void Insert(int index, CTYPE const& x) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()+1) $self->insert($self->begin()+index, x); else throw std::out_of_range("index"); } // Takes a deep copy of the elements unlike ArrayList.InsertRange void InsertRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()+1) $self->insert($self->begin()+index, values.begin(), values.end()); else throw std::out_of_range("index"); } void RemoveAt(int index) throw (std::out_of_range) { if (index>=0 && index<(int)$self->size()) $self->erase($self->begin() + index); else throw std::out_of_range("index"); } void RemoveRange(int index, int count) throw (std::out_of_range, std::invalid_argument) { if (index < 0) throw std::out_of_range("index"); if (count < 0) throw std::out_of_range("count"); if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) throw std::invalid_argument("invalid range"); $self->erase($self->begin()+index, $self->begin()+index+count); } static std::vector< CTYPE > *Repeat(CTYPE const& value, int count) throw (std::out_of_range) { if (count < 0) throw std::out_of_range("count"); return new std::vector< CTYPE >(count, value); } void Reverse() { std::reverse($self->begin(), $self->end()); } void Reverse(int index, int count) throw (std::out_of_range, std::invalid_argument) { if (index < 0) throw std::out_of_range("index"); if (count < 0) throw std::out_of_range("count"); if (index >= (int)$self->size()+1 || index+count > (int)$self->size()) throw std::invalid_argument("invalid range"); std::reverse($self->begin()+index, $self->begin()+index+count); } // Takes a deep copy of the elements unlike ArrayList.SetRange void SetRange(int index, const std::vector< CTYPE >& values) throw (std::out_of_range) { if (index < 0) throw std::out_of_range("index"); if (index+values.size() > $self->size()) throw std::out_of_range("index"); std::copy(values.begin(), values.end(), $self->begin()+index); } } %enddef // Extra methods added to the collection class if operator== is defined for the class being wrapped // The class will then implement IList<>, which adds extra functionality %define SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE...) %extend { bool Contains(CTYPE const& value) { return std::find($self->begin(), $self->end(), value) != $self->end(); } int IndexOf(CTYPE const& value) { int index = -1; std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); if (it != $self->end()) index = (int)(it - $self->begin()); return index; } int LastIndexOf(CTYPE const& value) { int index = -1; std::vector< CTYPE >::reverse_iterator rit = std::find($self->rbegin(), $self->rend(), value); if (rit != $self->rend()) index = (int)($self->rend() - 1 - rit); return index; } bool Remove(CTYPE const& value) { std::vector< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value); if (it != $self->end()) { $self->erase(it); return true; } return false; } } %enddef // Macros for std::vector class specializations/enhancements %define SWIG_STD_VECTOR_ENHANCED(CTYPE...) namespace std { template<> class vector< CTYPE > { SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, %arg(CTYPE const&), %arg(CTYPE)) SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE) }; } %enddef // Legacy macros %define SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE...) #warning SWIG_STD_VECTOR_SPECIALIZE macro deprecated, please see csharp/std_vector.i and switch to SWIG_STD_VECTOR_ENHANCED SWIG_STD_VECTOR_ENHANCED(CTYPE) %enddef %define SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE...) #warning SWIG_STD_VECTOR_SPECIALIZE_MINIMUM macro deprecated, it is no longer required %enddef %{ #include #include #include %} %csmethodmodifiers std::vector::getitemcopy "private" %csmethodmodifiers std::vector::getitem "private" %csmethodmodifiers std::vector::setitem "private" %csmethodmodifiers std::vector::size "private" %csmethodmodifiers std::vector::capacity "private" %csmethodmodifiers std::vector::reserve "private" namespace std { // primary (unspecialized) class template for std::vector // does not require operator== to be defined template class vector { SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, T const&, T) }; // specialization for pointers template class vector { SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, T *const&, T *) SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *) }; // bool is specialized in the C++ standard - const_reference in particular template<> class vector { SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, bool, bool) SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(bool) }; } // template specializations for std::vector // these provide extra collections methods as operator== is defined SWIG_STD_VECTOR_ENHANCED(char) SWIG_STD_VECTOR_ENHANCED(signed char) SWIG_STD_VECTOR_ENHANCED(unsigned char) SWIG_STD_VECTOR_ENHANCED(short) SWIG_STD_VECTOR_ENHANCED(unsigned short) SWIG_STD_VECTOR_ENHANCED(int) SWIG_STD_VECTOR_ENHANCED(unsigned int) SWIG_STD_VECTOR_ENHANCED(long) SWIG_STD_VECTOR_ENHANCED(unsigned long) SWIG_STD_VECTOR_ENHANCED(long long) SWIG_STD_VECTOR_ENHANCED(unsigned long long) SWIG_STD_VECTOR_ENHANCED(float) SWIG_STD_VECTOR_ENHANCED(double) SWIG_STD_VECTOR_ENHANCED(std::string) // also requires a %include 0707010008e793000081a40000000000000000000000014caec28900000044000000b600010002ffffffffffffffff0000003800000000root/usr/local/share/swig/2.0.1/csharp/std_shared_ptr.i#define SWIG_SHARED_PTR_NAMESPACE std %include 0707010008e785000081a40000000000000000000000014caec28900001372000000b600010002ffffffffffffffff0000003700000000root/usr/local/share/swig/2.0.1/csharp/arrays_csharp.i/* ----------------------------------------------------------------------------- * arrays_csharp.i * * This file contains a two approaches to marshaling arrays. The first uses * default p/invoke marshaling and the second uses pinning of the arrays. * * Default marshaling approach * ---------------------------- * Array typemaps using default p/invoke marshaling. The data is copied to a separately * allocated buffer when passing over the managed-native boundary. * * There are separate typemaps for in, out and inout arrays to enable avoiding * unnecessary copying. * * Example usage: * * %include "arrays_csharp.i" * %apply int INPUT[] { int* sourceArray } * %apply int OUTPUT[] { int* targetArray } * void myArrayCopy( int* sourceArray, int* targetArray, int nitems ); * * %apply int INOUT[] { int* array1, int *array2 } * void myArraySwap( int* array1, int* array2, int nitems ); * * If handling large arrays you should consider using the pinning array typemaps * described next. * * Pinning approach * ---------------- * Array typemaps using pinning. These typemaps pin the managed array given * as parameter and pass a pointer to it to the c/c++ side. This is very * efficient as no copying is done (unlike in the default array marshaling), * but it makes garbage collection more difficult. When considering using * these typemaps, think carefully whether you have callbacks that may cause * the control to re-enter the managed side from within the call (and produce * garbage for the gc) or whether other threads may produce enough garbage to * trigger gc while the call is being executed. In those cases it may be * wiser to use the default marshaling typemaps. * * Please note that when using fixed arrays, you have to mark your corresponding * module class method unsafe using * %csmethodmodifiers "public unsafe" * (the visibility of the method is up to you). * * Example usage: * * %include "arrays_csharp.i" * %apply int FIXED[] { int* sourceArray, int *targetArray } * %csmethodmodifiers myArrayCopy "public unsafe"; * void myArrayCopy( int *sourceArray, int* targetArray, int nitems ); * * ----------------------------------------------------------------------------- */ %define CSHARP_ARRAYS( CTYPE, CSTYPE ) // input only arrays %typemap(ctype) CTYPE INPUT[] "CTYPE*" %typemap(cstype) CTYPE INPUT[] "CSTYPE[]" %typemap(imtype, inattributes="[In, MarshalAs(UnmanagedType.LPArray)]") CTYPE INPUT[] "CSTYPE[]" %typemap(csin) CTYPE INPUT[] "$csinput" %typemap(in) CTYPE INPUT[] "$1 = $input;" %typemap(freearg) CTYPE INPUT[] "" %typemap(argout) CTYPE INPUT[] "" // output only arrays %typemap(ctype) CTYPE OUTPUT[] "CTYPE*" %typemap(cstype) CTYPE OUTPUT[] "CSTYPE[]" %typemap(imtype, inattributes="[Out, MarshalAs(UnmanagedType.LPArray)]") CTYPE OUTPUT[] "CSTYPE[]" %typemap(csin) CTYPE OUTPUT[] "$csinput" %typemap(in) CTYPE OUTPUT[] "$1 = $input;" %typemap(freearg) CTYPE OUTPUT[] "" %typemap(argout) CTYPE OUTPUT[] "" // inout arrays %typemap(ctype) CTYPE INOUT[] "CTYPE*" %typemap(cstype) CTYPE INOUT[] "CSTYPE[]" %typemap(imtype, inattributes="[In, Out, MarshalAs(UnmanagedType.LPArray)]") CTYPE INOUT[] "CSTYPE[]" %typemap(csin) CTYPE INOUT[] "$csinput" %typemap(in) CTYPE INOUT[] "$1 = $input;" %typemap(freearg) CTYPE INOUT[] "" %typemap(argout) CTYPE INOUT[] "" %enddef // CSHARP_ARRAYS CSHARP_ARRAYS(signed char, sbyte) CSHARP_ARRAYS(unsigned char, byte) CSHARP_ARRAYS(short, short) CSHARP_ARRAYS(unsigned short, ushort) CSHARP_ARRAYS(int, int) CSHARP_ARRAYS(unsigned int, uint) // FIXME - on Unix 64 bit, long is 8 bytes but is 4 bytes on Windows 64 bit. // How can this be handled sensibly? // See e.g. http://www.xml.com/ldd/chapter/book/ch10.html CSHARP_ARRAYS(long, int) CSHARP_ARRAYS(unsigned long, uint) CSHARP_ARRAYS(long long, long) CSHARP_ARRAYS(unsigned long long, ulong) CSHARP_ARRAYS(float, float) CSHARP_ARRAYS(double, double) %define CSHARP_ARRAYS_FIXED( CTYPE, CSTYPE ) %typemap(ctype) CTYPE FIXED[] "CTYPE*" %typemap(imtype) CTYPE FIXED[] "IntPtr" %typemap(cstype) CTYPE FIXED[] "CSTYPE[]" %typemap(csin, pre= " fixed ( CSTYPE* swig_ptrTo_$csinput = $csinput ) {", terminator=" }") CTYPE FIXED[] "(IntPtr)swig_ptrTo_$csinput" %typemap(in) CTYPE FIXED[] "$1 = $input;" %typemap(freearg) CTYPE FIXED[] "" %typemap(argout) CTYPE FIXED[] "" %enddef // CSHARP_ARRAYS_FIXED CSHARP_ARRAYS_FIXED(signed char, sbyte) CSHARP_ARRAYS_FIXED(unsigned char, byte) CSHARP_ARRAYS_FIXED(short, short) CSHARP_ARRAYS_FIXED(unsigned short, ushort) CSHARP_ARRAYS_FIXED(int, int) CSHARP_ARRAYS_FIXED(unsigned int, uint) CSHARP_ARRAYS_FIXED(long, int) CSHARP_ARRAYS_FIXED(unsigned long, uint) CSHARP_ARRAYS_FIXED(long long, long) CSHARP_ARRAYS_FIXED(unsigned long long, ulong) CSHARP_ARRAYS_FIXED(float, float) CSHARP_ARRAYS_FIXED(double, double) 0707010008e772000081a40000000000000000000000014caec28400000a58000000b600010002ffffffffffffffff0000002a00000000root/usr/local/share/swig/2.0.1/carrays.i/* ----------------------------------------------------------------------------- * carrays.i * * SWIG library file containing macros that can be used to manipulate simple * pointers as arrays. * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * %array_functions(TYPE,NAME) * * Generates functions for creating and accessing elements of a C array * (as pointers). Creates the following functions: * * TYPE *new_NAME(int nelements) * void delete_NAME(TYPE *); * TYPE NAME_getitem(TYPE *, int index); * void NAME_setitem(TYPE *, int index, TYPE value); * * ----------------------------------------------------------------------------- */ %define %array_functions(TYPE,NAME) %{ static TYPE *new_##NAME(int nelements) { %} #ifdef __cplusplus %{ return new TYPE[nelements]; %} #else %{ return (TYPE *) calloc(nelements,sizeof(TYPE)); %} #endif %{} static void delete_##NAME(TYPE *ary) { %} #ifdef __cplusplus %{ delete [] ary; %} #else %{ free(ary); %} #endif %{} static TYPE NAME##_getitem(TYPE *ary, int index) { return ary[index]; } static void NAME##_setitem(TYPE *ary, int index, TYPE value) { ary[index] = value; } %} TYPE *new_##NAME(int nelements); void delete_##NAME(TYPE *ary); TYPE NAME##_getitem(TYPE *ary, int index); void NAME##_setitem(TYPE *ary, int index, TYPE value); %enddef /* ----------------------------------------------------------------------------- * %array_class(TYPE,NAME) * * Generates a class wrapper around a C array. The class has the following * interface: * * struct NAME { * NAME(int nelements); * ~NAME(); * TYPE getitem(int index); * void setitem(int index, TYPE value); * TYPE * cast(); * static NAME *frompointer(TYPE *t); * } * * ----------------------------------------------------------------------------- */ %define %array_class(TYPE,NAME) %{ typedef TYPE NAME; %} typedef struct NAME { /* Put language specific enhancements here */ } NAME; %extend NAME { #ifdef __cplusplus NAME(int nelements) { return new TYPE[nelements]; } ~NAME() { delete [] self; } #else NAME(int nelements) { return (TYPE *) calloc(nelements,sizeof(TYPE)); } ~NAME() { free(self); } #endif TYPE getitem(int index) { return self[index]; } void setitem(int index, TYPE value) { self[index] = value; } TYPE * cast() { return self; } static NAME *frompointer(TYPE *t) { return (NAME *) t; } }; %types(NAME = TYPE); %enddef 0707010008e7e2000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002400000000root/usr/local/share/swig/2.0.1/lua0707010008e7f0000081a40000000000000000000000014caec28900000c0a000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/lua/std_vector.i/* ----------------------------------------------------------------------------- * std_vector.i * * std::vector typemaps for LUA * ----------------------------------------------------------------------------- */ %{ #include %} %include // the general exepctions /* A really cut down version of the vector class. Note: this does not match the true std::vector class but instead is an approximate, so that SWIG knows how to wrapper it. (Eg, all access is by value, not ref, as SWIG turns refs to pointers) And no support for iterators & insert/erase It would be useful to have a vector<->Lua table conversion routine */ namespace std { template class vector { public: vector(); vector(unsigned int); vector(const vector&); vector(unsigned int,T); unsigned int size() const; unsigned int max_size() const; bool empty() const; void clear(); void push_back(T val); void pop_back(); T front()const; // only read front & back T back()const; // not write to them // operator [] given later: %extend // this is a extra bit of SWIG code { // [] is replaced by __getitem__ & __setitem__ // simply throws a string, which causes a lua error T __getitem__(unsigned int idx) throw (std::out_of_range) { if (idx>=self->size()) throw std::out_of_range("in vector::__getitem__()"); return (*self)[idx]; } void __setitem__(unsigned int idx,T val) throw (std::out_of_range) { if (idx>=self->size()) throw std::out_of_range("in vector::__setitem__()"); (*self)[idx]=val; } }; }; } /* Vector<->LuaTable fns These look a bit like the array<->LuaTable fns but are templated, not %defined (you must have template support for STL) */ /* %{ // reads a table into a vector of numbers // lua numbers will be cast into the type required (rounding may occur) // return 0 if non numbers found in the table // returns new'ed ptr if ok template std::vector* SWIG_read_number_vector(lua_State* L,int index) { int i=0; std::vector* vec=new std::vector(); while(1) { lua_rawgeti(L,index,i+1); if (!lua_isnil(L,-1)) { lua_pop(L,1); break; // finished } if (!lua_isnumber(L,-1)) { lua_pop(L,1); delete vec; return 0; // error } vec->push_back((T)lua_tonumber(L,-1)); lua_pop(L,1); ++i; } return vec; // ok } // writes a vector of numbers out as a lua table template int SWIG_write_number_vector(lua_State* L,std::vector *vec) { lua_newtable(L); for(int i=0;isize();++i) { lua_pushnumber(L,(double)((*vec)[i])); lua_rawseti(L,-2,i+1);// -1 is the number, -2 is the table } } %} // then the typemaps %define SWIG_TYPEMAP_NUM_VECTOR(T) // in %typemap(in) std::vector *INPUT %{ $1 = SWIG_read_number_vector(L,$input); if (!$1) SWIG_fail;%} %typemap(freearg) std::vector *INPUT %{ delete $1;%} // out %typemap(argout) std::vector *OUTPUT %{ SWIG_write_number_vector(L,$1); SWIG_arg++; %} %enddef */ 0707010008e7e6000081a40000000000000000000000014caec289000010b7000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/lua/lua_fnptr.i/* ----------------------------------------------------------------------------- * lua_fnptr.i * * SWIG Library file containing the main typemap code to support Lua modules. * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * Basic function pointer support * ----------------------------------------------------------------------------- */ /* The structure: SWIGLUA_FN provides a simple (local only) wrappering for a function. For example if you wanted to have a C/C++ function take a lua function as a parameter. You could declare it as: int my_func(int a, int b, SWIGLUA_FN fn); note: it should be passed by value, not byref or as a pointer. The SWIGLUA_FN holds a pointer to the lua_State, and the stack index where the function is held. The macro SWIGLUA_FN_GET() will put a copy of the lua function at the top of the stack. After that its fairly simple to write the rest of the code (assuming know how to use lua), just push the parameters, call the function and return the result. int my_func(int a, int b, SWIGLUA_FN fn) { SWIGLUA_FN_GET(fn); lua_pushnumber(fn.L,a); lua_pushnumber(fn.L,b); lua_call(fn.L,2,1); // 2 in, 1 out return luaL_checknumber(fn.L,-1); } SWIG will automatically performs the wrappering of the arguments in and out. However: if you wish to store the function between calls, look to the SWIGLUA_REF below. */ // this is for the C code only, we don't want SWIG to wrapper it for us. %{ typedef struct{ lua_State* L; /* the state */ int idx; /* the index on the stack */ }SWIGLUA_FN; #define SWIGLUA_FN_GET(fn) {lua_pushvalue(fn.L,fn.idx);} %} // the actual typemap %typemap(in,checkfn="lua_isfunction") SWIGLUA_FN %{ $1.L=L; $1.idx=$input; %} /* ----------------------------------------------------------------------------- * Storing lua object support * ----------------------------------------------------------------------------- */ /* The structure: SWIGLUA_REF provides a mechanism to store object (usually functions) between calls to the interpreter. For example if you wanted to have a C/C++ function take a lua function as a parameter. Then call it later, You could declare it as: SWIGLUA_REF myref; void set_func(SWIGLUA_REF ref); SWIGLUA_REF get_func(); void call_func(int val); note: it should be passed by value, not byref or as a pointer. The SWIGLUA_REF holds a pointer to the lua_State, and an integer reference to the object. Because it holds a permenet ref to an object, the SWIGLUA_REF must be handled with a bit more care. It should be initalised to {0,0}. The function swiglua_ref_set() should be used to set it. swiglua_ref_clear() should be used to clear it when not in use, and swiglua_ref_get() to get the data back. Note: the typemap does not check that the object is in fact a function, if you need that you must add it yourself. int my_func(int a, int b, SWIGLUA_FN fn) { SWIGLUA_FN_GET(fn); lua_pushnumber(fn.L,a); lua_pushnumber(fn.L,b); lua_call(fn.L,2,1); // 2 in, 1 out return luaL_checknumber(fn.L,-1); } SWIG will automatically performs the wrappering of the arguments in and out. However: if you wish to store the function between calls, look to the SWIGLUA_REF below. */ %{ typedef struct{ lua_State* L; /* the state */ int ref; /* a ref in the lua global index */ }SWIGLUA_REF; void swiglua_ref_clear(SWIGLUA_REF* pref){ if (pref->L!=0 && pref->ref!=LUA_NOREF && pref->ref!=LUA_REFNIL){ luaL_unref(pref->L,LUA_REGISTRYINDEX,pref->ref); } pref->L=0; pref->ref=0; } void swiglua_ref_set(SWIGLUA_REF* pref,lua_State* L,int idx){ // swiglua_ref_clear(pref); /* just in case */ pref->L=L; lua_pushvalue(L,idx); /* copy obj to top */ pref->ref=luaL_ref(L,LUA_REGISTRYINDEX); /* remove obj from top & put into registry */ } void swiglua_ref_get(SWIGLUA_REF* pref){ if (pref->L!=0) lua_rawgeti(pref->L,LUA_REGISTRYINDEX,pref->ref); } %} %typemap(in) SWIGLUA_REF %{ swiglua_ref_set(&$1,L,$input); %} %typemap(out) SWIGLUA_REF %{ if ($1.L!=0) {swiglua_ref_get(&$1);} else {lua_pushnil(L);} SWIG_arg++; %} 0707010008e7eb000081a40000000000000000000000014caec2890000001c000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/lua/std_deque.i%include 0707010008e7e7000081a40000000000000000000000014caec2890000685c000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/lua/luarun.swg/* ----------------------------------------------------------------------------- * luarun.swg * * This file contains the runtime support for Lua modules * and includes code for managing global variables and pointer * type checking. * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif #include "lua.h" #include "lauxlib.h" #include /* for malloc */ #include /* for a few sanity tests */ /* ----------------------------------------------------------------------------- * global swig types * ----------------------------------------------------------------------------- */ /* Constant table */ #define SWIG_LUA_INT 1 #define SWIG_LUA_FLOAT 2 #define SWIG_LUA_STRING 3 #define SWIG_LUA_POINTER 4 #define SWIG_LUA_BINARY 5 #define SWIG_LUA_CHAR 6 /* Structure for variable linking table */ typedef struct { const char *name; lua_CFunction get; lua_CFunction set; } swig_lua_var_info; /* Constant information structure */ typedef struct { int type; char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_lua_const_info; typedef struct { const char *name; lua_CFunction method; } swig_lua_method; typedef struct { const char *name; lua_CFunction getmethod; lua_CFunction setmethod; } swig_lua_attribute; typedef struct swig_lua_class { const char *name; swig_type_info **type; lua_CFunction constructor; void (*destructor)(void *); swig_lua_method *methods; swig_lua_attribute *attributes; struct swig_lua_class **bases; const char **base_names; } swig_lua_class; /* this is the struct for wrappering all pointers in SwigLua */ typedef struct { swig_type_info *type; int own; /* 1 if owned & must be destroyed */ void *ptr; } swig_lua_userdata; /* this is the struct for wrapping arbitary packed binary data (currently it is only used for member function pointers) the data ordering is similar to swig_lua_userdata, but it is currently not possible to tell the two structures apart within SWIG, other than by looking at the type */ typedef struct { swig_type_info *type; int own; /* 1 if owned & must be destroyed */ char data[1]; /* arbitary amount of data */ } swig_lua_rawdata; /* Common SWIG API */ #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) /* for C++ member pointers, ie, member methods */ #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) #define SWIG_MODULE_CLIENTDATA_TYPE lua_State* /* Contract support */ #define SWIG_contract_assert(expr, msg) \ if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else /* helper #defines */ #define SWIG_fail {goto fail;} #define SWIG_fail_arg(func_name,argnum,type) \ {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ goto fail;} #define SWIG_fail_ptr(func_name,argnum,type) \ SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") #define SWIG_check_num_args(func_name,a,b) \ if (lua_gettop(L)b) \ {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ goto fail;} #define SWIG_Lua_get_table(L,n) \ (lua_pushstring(L, n), lua_rawget(L,-2)) #define SWIG_Lua_add_function(L,n,f) \ (lua_pushstring(L, n), \ lua_pushcfunction(L, f), \ lua_rawset(L,-3)) /* special helper for allowing 'nil' for usertypes */ #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) #ifdef __cplusplus /* Special helper for member function pointers it gets the address, casts it, then dereferences it */ //#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) #endif /* storing/access of swig_module_info */ SWIGRUNTIME swig_module_info * SWIG_Lua_GetModule(lua_State* L) { swig_module_info *ret = 0; lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); lua_rawget(L,LUA_REGISTRYINDEX); if (lua_islightuserdata(L,-1)) ret=(swig_module_info*)lua_touserdata(L,-1); lua_pop(L,1); /* tidy */ return ret; } SWIGRUNTIME void SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { /* add this all into the Lua registry: */ lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); lua_pushlightuserdata(L,(void*)module); lua_rawset(L,LUA_REGISTRYINDEX); } /* ----------------------------------------------------------------------------- * global variable support code: modules * ----------------------------------------------------------------------------- */ /* this function is called when trying to set an immutable. default value is to print an error. This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) { /* there should be 1 param passed in: the new value */ #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE lua_pop(L,1); /* remove it */ lua_pushstring(L,"This variable is immutable"); lua_error(L); #endif return 0; /* should not return anything */ } /* the module.get method used for getting linked data */ SWIGINTERN int SWIG_Lua_module_get(lua_State* L) { /* there should be 2 params passed in (1) table (not the meta table) (2) string name of the attribute printf("SWIG_Lua_module_get %p(%s) '%s'\n", lua_topointer(L,1),lua_typename(L,lua_type(L,1)), lua_tostring(L,2)); */ /* get the metatable */ assert(lua_istable(L,1)); /* just in case */ lua_getmetatable(L,1); /* get the metatable */ assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".get"); /* get the .get table */ lua_remove(L,3); /* remove metatable */ if (lua_istable(L,-1)) { /* look for the key in the .get table */ lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); lua_remove(L,3); /* remove .get */ if (lua_iscfunction(L,-1)) { /* found it so call the fn & return its value */ lua_call(L,0,1); return 1; } lua_pop(L,1); /* remove the top */ } lua_pop(L,1); /* remove the .get */ lua_pushnil(L); /* return a nil */ return 1; } /* the module.set method used for setting linked data */ SWIGINTERN int SWIG_Lua_module_set(lua_State* L) { /* there should be 3 params passed in (1) table (not the meta table) (2) string name of the attribute (3) any for the new value */ /* get the metatable */ assert(lua_istable(L,1)); /* just in case */ lua_getmetatable(L,1); /* get the metatable */ assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".set"); /* get the .set table */ lua_remove(L,4); /* remove metatable */ if (lua_istable(L,-1)) { /* look for the key in the .set table */ lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); lua_remove(L,4); /* remove .set */ if (lua_iscfunction(L,-1)) { /* found it so call the fn & return its value */ lua_pushvalue(L,3); /* value */ lua_call(L,1,0); return 0; } } lua_settop(L,3); /* reset back to start */ /* we now have the table, key & new value, so just set directly */ lua_rawset(L,1); /* add direct */ return 0; } /* registering a module in lua */ SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) { assert(lua_istable(L,-1)); /* just in case */ lua_pushstring(L,name); lua_newtable(L); /* the table */ /* add meta table */ lua_newtable(L); /* the meta table */ SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); lua_pushstring(L,".get"); lua_newtable(L); /* the .get table */ lua_rawset(L,-3); /* add .get into metatable */ lua_pushstring(L,".set"); lua_newtable(L); /* the .set table */ lua_rawset(L,-3); /* add .set into metatable */ lua_setmetatable(L,-2); /* sets meta table in module */ lua_rawset(L,-3); /* add module into parent */ SWIG_Lua_get_table(L,name); /* get the table back out */ } /* ending the register */ SWIGINTERN void SWIG_Lua_module_end(lua_State* L) { lua_pop(L,1); /* tidy stack (remove module) */ } /* adding a linked variable to the module */ SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) { assert(lua_istable(L,-1)); /* just in case */ lua_getmetatable(L,-1); /* get the metatable */ assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".get"); /* find the .get table */ assert(lua_istable(L,-1)); /* should be a table: */ SWIG_Lua_add_function(L,name,getFn); lua_pop(L,1); /* tidy stack (remove table) */ if (setFn) /* if there is a set fn */ { SWIG_Lua_get_table(L,".set"); /* find the .set table */ assert(lua_istable(L,-1)); /* should be a table: */ SWIG_Lua_add_function(L,name,setFn); lua_pop(L,1); /* tidy stack (remove table) */ } lua_pop(L,1); /* tidy stack (remove meta) */ } /* adding a function module */ SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) { SWIG_Lua_add_function(L,name,fn); } /* ----------------------------------------------------------------------------- * global variable support code: classes * ----------------------------------------------------------------------------- */ /* the class.get method, performs the lookup of class attributes */ SWIGINTERN int SWIG_Lua_class_get(lua_State* L) { /* there should be 2 params passed in (1) userdata (not the meta table) (2) string name of the attribute */ assert(lua_isuserdata(L,-2)); /* just in case */ lua_getmetatable(L,-2); /* get the meta table */ assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".get"); /* find the .get table */ assert(lua_istable(L,-1)); /* just in case */ /* look for the key in the .get table */ lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); lua_remove(L,-2); /* stack tidy, remove .get table */ if (lua_iscfunction(L,-1)) { /* found it so call the fn & return its value */ lua_pushvalue(L,1); /* the userdata */ lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ lua_remove(L,-2); /* stack tidy, remove metatable */ return 1; } lua_pop(L,1); /* remove whatever was there */ /* ok, so try the .fn table */ SWIG_Lua_get_table(L,".fn"); /* find the .get table */ assert(lua_istable(L,-1)); /* just in case */ lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); /* look for the fn */ lua_remove(L,-2); /* stack tidy, remove .fn table */ if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */ { /* found it so return the fn & let lua call it */ lua_remove(L,-2); /* stack tidy, remove metatable */ return 1; } lua_pop(L,1); /* remove whatever was there */ /* NEW: looks for the __getitem() fn this is a user provided get fn */ SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ if (lua_iscfunction(L,-1)) /* if its there */ { /* found it so call the fn & return its value */ lua_pushvalue(L,1); /* the userdata */ lua_pushvalue(L,2); /* the parameter */ lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ lua_remove(L,-2); /* stack tidy, remove metatable */ return 1; } return 0; /* sorry not known */ } /* the class.set method, performs the lookup of class attributes */ SWIGINTERN int SWIG_Lua_class_set(lua_State* L) { /* there should be 3 params passed in (1) table (not the meta table) (2) string name of the attribute (3) any for the new value printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", lua_topointer(L,1),lua_typename(L,lua_type(L,1)), lua_tostring(L,2), lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ assert(lua_isuserdata(L,1)); /* just in case */ lua_getmetatable(L,1); /* get the meta table */ assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".set"); /* find the .set table */ if (lua_istable(L,-1)) { /* look for the key in the .set table */ lua_pushvalue(L,2); /* key */ lua_rawget(L,-2); if (lua_iscfunction(L,-1)) { /* found it so call the fn & return its value */ lua_pushvalue(L,1); /* userdata */ lua_pushvalue(L,3); /* value */ lua_call(L,2,0); return 0; } lua_pop(L,1); /* remove the value */ } lua_pop(L,1); /* remove the value .set table */ /* NEW: looks for the __setitem() fn this is a user provided set fn */ SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ if (lua_iscfunction(L,-1)) /* if its there */ { /* found it so call the fn & return its value */ lua_pushvalue(L,1); /* the userdata */ lua_pushvalue(L,2); /* the parameter */ lua_pushvalue(L,3); /* the value */ lua_call(L,3,0); /* 3 values in ,0 out */ lua_remove(L,-2); /* stack tidy, remove metatable */ return 1; } return 0; } /* the class.destruct method called by the interpreter */ SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) { /* there should be 1 params passed in (1) userdata (not the meta table) */ swig_lua_userdata* usr; swig_lua_class* clss; assert(lua_isuserdata(L,-1)); /* just in case */ usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ /* if must be destroyed & has a destructor */ if (usr->own) /* if must be destroyed */ { clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ if (clss && clss->destructor) /* there is a destroy fn */ { clss->destructor(usr->ptr); /* bye bye */ } } return 0; } /* gets the swig class registry (or creates it) */ SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) { /* add this all into the swig registry: */ lua_pushstring(L,"SWIG"); lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ if (!lua_istable(L,-1)) /* not there */ { /* must be first time, so add it */ lua_pop(L,1); /* remove the result */ lua_pushstring(L,"SWIG"); lua_newtable(L); lua_rawset(L,LUA_REGISTRYINDEX); /* then get it */ lua_pushstring(L,"SWIG"); lua_rawget(L,LUA_REGISTRYINDEX); } } /* helper fn to get the classes metatable from the register */ SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) { SWIG_Lua_get_class_registry(L); /* get the registry */ lua_pushstring(L,cname); /* get the name */ lua_rawget(L,-2); /* get it */ lua_remove(L,-2); /* tidy up (remove registry) */ } /* helper add a variable to a registered class */ SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) { assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".get"); /* find the .get table */ assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_add_function(L,name,getFn); lua_pop(L,1); /* tidy stack (remove table) */ if (setFn) { SWIG_Lua_get_table(L,".set"); /* find the .set table */ assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_add_function(L,name,setFn); lua_pop(L,1); /* tidy stack (remove table) */ } } /* helper to recursively add class details (attributes & operations) */ SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) { int i; /* call all the base classes first: we can then override these later: */ for(i=0;clss->bases[i];i++) { SWIG_Lua_add_class_details(L,clss->bases[i]); } /* add fns */ for(i=0;clss->attributes[i].name;i++){ SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); } /* add methods to the metatable */ SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ assert(lua_istable(L,-1)); /* just in case */ for(i=0;clss->methods[i].name;i++){ SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); } lua_pop(L,1); /* tidy stack (remove table) */ /* add operator overloads these look ANY method which start with "__" and assume they are operator overloads & add them to the metatable (this might mess up is someone defines a method __gc (the destructor)*/ for(i=0;clss->methods[i].name;i++){ if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); } } } /* set up the base classes pointers. Each class structure has a list of pointers to the base class structures. This function fills them. It cannot be done at compile time, as this will not work with hireachies spread over more than one swig file. Therefore it must be done at runtime, querying the SWIG type system. */ SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) { int i=0; swig_module_info* module=SWIG_GetModule(L); for(i=0;clss->base_names[i];i++) { if (clss->bases[i]==0) /* not found yet */ { /* lookup and cache the base class */ swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; } } } /* performs the entire class registration process */ SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) { /* add its constructor to module with the name of the class so you can do MyClass(...) as well as new_MyClass(...) BUT only if a constructor is defined (this overcomes the problem of pure virtual classes without constructors)*/ if (clss->constructor) SWIG_Lua_add_function(L,clss->name,clss->constructor); SWIG_Lua_get_class_registry(L); /* get the registry */ lua_pushstring(L,clss->name); /* get the name */ lua_newtable(L); /* create the metatable */ /* add string of class name called ".type" */ lua_pushstring(L,".type"); lua_pushstring(L,clss->name); lua_rawset(L,-3); /* add a table called ".get" */ lua_pushstring(L,".get"); lua_newtable(L); lua_rawset(L,-3); /* add a table called ".set" */ lua_pushstring(L,".set"); lua_newtable(L); lua_rawset(L,-3); /* add a table called ".fn" */ lua_pushstring(L,".fn"); lua_newtable(L); lua_rawset(L,-3); /* add accessor fns for using the .get,.set&.fn */ SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); /* add it */ lua_rawset(L,-3); /* metatable into registry */ lua_pop(L,1); /* tidy stack (remove registry) */ SWIG_Lua_get_class_metatable(L,clss->name); SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ lua_pop(L,1); /* tidy stack (remove class metatable) */ } /* ----------------------------------------------------------------------------- * Class/structure conversion fns * ----------------------------------------------------------------------------- */ /* helper to add metatable to new lua object */ SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) { if (type->clientdata) /* there is clientdata: so add the metatable */ { SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); if (lua_istable(L,-1)) { lua_setmetatable(L,-2); } else { lua_pop(L,1); } } } /* pushes a new object into the lua stack */ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) { swig_lua_userdata* usr; if (!ptr){ lua_pushnil(L); return; } usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ usr->ptr=ptr; /* set the ptr */ usr->type=type; usr->own=own; _SWIG_Lua_AddMetatable(L,type); /* add metatable */ } /* takes a object from the lua stack & converts it into an object of the correct type (if possible) */ SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) { swig_lua_userdata* usr; swig_cast_info *cast; if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ if (usr) { if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ { usr->own=0; } if (!type) /* special cast void*, no casting fn */ { *ptr=usr->ptr; return SWIG_OK; /* ok */ } cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ if (cast) { int newmemory = 0; *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ return SWIG_OK; /* ok */ } } return SWIG_ERROR; /* error */ } SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, int argnum,const char* func_name){ void* result; if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n", func_name,(type && type->str)?type->str:"void*",argnum); lua_error(L); } return result; } /* pushes a packed userdata. user for member fn pointers only */ SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) { swig_lua_rawdata* raw; assert(ptr); /* not acceptable to pass in a NULL value */ raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ raw->type=type; raw->own=0; memcpy(raw->data,ptr,size); /* copy the data */ _SWIG_Lua_AddMetatable(L,type); /* add metatable */ } /* converts a packed userdata. user for member fn pointers only */ SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) { swig_lua_rawdata* raw; raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ if (!raw) return SWIG_ERROR; /* error */ if (type==0 || type==raw->type) /* void* or identical type */ { memcpy(ptr,raw->data,size); /* copy it */ return SWIG_OK; /* ok */ } return SWIG_ERROR; /* error */ } /* a function to get the typestring of a piece of data */ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) { swig_lua_userdata* usr; if (lua_isuserdata(L,tp)) { usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ if (usr && usr->type && usr->type->str) return usr->type->str; return "userdata (unknown type)"; } return lua_typename(L,lua_type(L,tp)); } /* lua callable function to get the userdata's type */ SWIGRUNTIME int SWIG_Lua_type(lua_State* L) { lua_pushstring(L,SWIG_Lua_typename(L,1)); return 1; } /* lua callable function to compare userdata's value the issue is that two userdata may point to the same thing but to lua, they are different objects */ SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) { int result; swig_lua_userdata *usr1,*usr2; if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ return 0; /* nil reply */ usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ result=(usr1->ptr==usr2->ptr); lua_pushboolean(L,result); return 1; } /* ----------------------------------------------------------------------------- * global variable support code: class/struct typemap functions * ----------------------------------------------------------------------------- */ /* Install Constants */ SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { int i; for (i = 0; constants[i].type; i++) { switch(constants[i].type) { case SWIG_LUA_INT: lua_pushstring(L,constants[i].name); lua_pushnumber(L,(lua_Number)constants[i].lvalue); lua_rawset(L,-3); break; case SWIG_LUA_FLOAT: lua_pushstring(L,constants[i].name); lua_pushnumber(L,(lua_Number)constants[i].dvalue); lua_rawset(L,-3); break; case SWIG_LUA_CHAR: lua_pushstring(L,constants[i].name); lua_pushfstring(L,"%c",(char)constants[i].lvalue); lua_rawset(L,-3); break; case SWIG_LUA_STRING: lua_pushstring(L,constants[i].name); lua_pushstring(L,(char *) constants[i].pvalue); lua_rawset(L,-3); break; case SWIG_LUA_POINTER: lua_pushstring(L,constants[i].name); SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); lua_rawset(L,-3); break; case SWIG_LUA_BINARY: lua_pushstring(L,constants[i].name); SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); lua_rawset(L,-3); break; default: break; } } } /* ----------------------------------------------------------------------------- * executing lua code from within the wrapper * ----------------------------------------------------------------------------- */ #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) #endif /* Executes a C string in Lua a really simple way of calling lua from C Unfortunately lua keeps changing its API's, so we need a conditional compile In lua 5.0.X its lua_dostring() In lua 5.1.X its luaL_dostring() */ SWIGINTERN int SWIG_Lua_dostring(lua_State *L, const char* str) { int ok,top; if (str==0 || str[0]==0) return 0; /* nothing to do */ top=lua_gettop(L); /* save stack */ #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ #else ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ #endif if (ok!=0) { SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); } lua_settop(L,top); /* restore the stack */ return ok; } #ifdef __cplusplus } #endif /* ------------------------------ end luarun.swg ------------------------------ */ 0707010008e7e4000081a40000000000000000000000014caec28900000105000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/lua/carrays.i/* Small change to the standard carrays.i renaming the field to __getitem__ & __setitem__ for operator[] access */ %rename(__getitem) *::getitem; // the v=X[i] (get operator) %rename(__setitem) *::setitem; // the X[i]=v (set operator) %include <../carrays.i> 0707010008e7ef000081a40000000000000000000000014caec28900001116000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/lua/std_string.i/* ----------------------------------------------------------------------------- * std_string.i * * std::string typemaps for LUA * ----------------------------------------------------------------------------- */ %{ #include %} /* Only std::string and const std::string& are typemaped they are converted to the Lua strings automatically std::string& and std::string* are not they must be explicitly managed (see below) eg. std::string test_value(std::string x) { return x; } can be used as s="hello world" s2=test_value(s) assert(s==s2) */ %naturalvar std::string; /* Bug report #1526022 by neomantra Lua strings and std::string can contain embeded zero's Therefore a standard out typemap should not be: lua_pushstring(L,$1.c_str()); but lua_pushlstring(L,$1.data(),$1.size()); Similarly for getting the string $1 = (char*)lua_tostring(L, $input); becomes $1.assign(lua_tostring(L,$input),lua_strlen(L,$input)); Not using: lua_tolstring() as this is only found in Lua 5.1 & not 5.0.2 */ %typemap(in,checkfn="lua_isstring") std::string %{$1.assign(lua_tostring(L,$input),lua_strlen(L,$input));%} %typemap(out) std::string %{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%} %typemap(in,checkfn="lua_isstring") const std::string& (std::string temp) %{temp.assign(lua_tostring(L,$input),lua_strlen(L,$input)); $1=&temp;%} %typemap(out) const std::string& %{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} // for throwing of any kind of string, string ref's and string pointers // we convert all to lua strings %typemap(throws) std::string,std::string&,const std::string& %{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_fail;%} %typemap(throws) std::string*,const std::string* %{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_fail;%} // and the typechecks %typecheck(SWIG_TYPECHECK_STRING) std::string,const std::string& { $1 = lua_isstring(L,$input); } /* std::string& can be wrappered, but you must inform SWIG if it is in or out eg: void fn(std::string& str); Is this an in/out/inout value? Therefore you need the usual %apply (std::string& INOUT) {(std::string& str)}; or %apply std::string& INOUT {std::string& str}; typemaps to tell SWIG what to do. */ %typemap(in) std::string &INPUT=const std::string &; %typemap(in, numinputs=0) std::string &OUTPUT (std::string temp) %{ $1 = &temp; %} %typemap(argout) std::string &OUTPUT %{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} %typemap(in) std::string &INOUT =const std::string &; %typemap(argout) std::string &INOUT = std::string &OUTPUT; /* For const std::string* and std::string* is not clear is this a pointer or an array? Therefore just leaving it as is (there is some rough code below which could be used if needed // SWIG wraps const ref's as pointer // typemaps to deal with this and const ptrs %typemap(in,checkfn="lua_isstring") const std::string& INPUT(std::string temp), const std::string* INPUT(std::string temp) %{temp=(char*)lua_tostring(L, $input); $1=&temp;%} %typemap(out) const std::string&, const std::string* %{ lua_pushstring(L,$1->c_str()); SWIG_arg++;%} // the non-const pointer version %typemap(in) std::string *INPUT=const std::string *INPUT; %typemap(in, numinputs=0) std::string *OUTPUT (std::string temp) %{ $1 = &temp; %} %typemap(argout) std::string *OUTPUT %{ lua_pushstring(L,$1->c_str()); SWIG_arg++;%} %typemap(in) std::string *INOUT = std::string *INPUT; %typemap(argout) std::string *INOUT = std::string *OUTPUT; */ /* A really cut down version of the string class This provides basic mapping of lua strings <-> std::string and little else (the std::string has a lot of unneeded functions anyway) note: no fn's taking the const string& as this is overloaded by the const char* version */ namespace std { class string { public: string(); string(const char*); //string(const string&); unsigned int size() const; unsigned int length() const; bool empty() const; // no support for operator[] const char* c_str()const; const char* data()const; // assign does not return a copy of this object // (no point in a scripting language) void assign(const char*); //void assign(const string&); // no support for all the other features // its probably better to do it in lua }; } 0707010008e7ec000081a40000000000000000000000014caec28900000751000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/lua/std_except.i/* ----------------------------------------------------------------------------- * Typemaps used by the STL wrappers that throw exceptions. * These typemaps are used when methods are declared with an STL exception * specification, such as: * size_t at() const throw (std::out_of_range); * * std_except.i * ----------------------------------------------------------------------------- */ %{ #include %} %include namespace std { %ignore exception; // not sure if I should ignore this... class exception { public: exception() throw() { } virtual ~exception() throw(); virtual const char* what() const throw(); }; } // normally object which are thrown are returned to interpreter as errors // (which potentally may have problems if they are not copied) // therefore all classes based upon std::exception are converted to their strings & returned as errors %typemap(throws) std::bad_exception "SWIG_exception(SWIG_RuntimeError, $1.what());" %typemap(throws) std::domain_error "SWIG_exception(SWIG_ValueError, $1.what());" %typemap(throws) std::exception "SWIG_exception(SWIG_SystemError, $1.what());" %typemap(throws) std::invalid_argument "SWIG_exception(SWIG_ValueError, $1.what());" %typemap(throws) std::length_error "SWIG_exception(SWIG_IndexError, $1.what());" %typemap(throws) std::logic_error "SWIG_exception(SWIG_RuntimeError, $1.what());" %typemap(throws) std::out_of_range "SWIG_exception(SWIG_IndexError, $1.what());" %typemap(throws) std::overflow_error "SWIG_exception(SWIG_OverflowError, $1.what());" %typemap(throws) std::range_error "SWIG_exception(SWIG_IndexError, $1.what());" %typemap(throws) std::runtime_error "SWIG_exception(SWIG_RuntimeError, $1.what());" %typemap(throws) std::underflow_error "SWIG_exception(SWIG_RuntimeError, $1.what());" 0707010008e7ee000081a40000000000000000000000014caec28900000303000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/lua/std_pair.i/* ----------------------------------------------------------------------------- * std_pair.i * * std::pair typemaps for LUA * ----------------------------------------------------------------------------- */ %{ #include %} /* A really cut down version of the pair class. this is not useful on its owns is it needs a %template definition with it eg. namespace std { %template(IntPair) pair; %template(make_IntPair) make_pair; } */ namespace std { template struct pair { typedef T first_type; typedef U second_type; pair(); pair(T first, U second); pair(const pair& p); T first; U second; }; template pair make_pair(const T&,const U&); } 0707010008e7f1000081a40000000000000000000000014caec28900000123000000b600010002ffffffffffffffff0000002a00000000root/usr/local/share/swig/2.0.1/lua/stl.i/* ----------------------------------------------------------------------------- * stl.i * ----------------------------------------------------------------------------- */ %include %include %include %include %include 0707010008e7ed000081a40000000000000000000000014caec289000006da000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/lua/std_map.i/* ----------------------------------------------------------------------------- * std_map.i * * SWIG typemaps for std::map * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::map // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class map { // add typemaps here public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef K key_type; typedef T mapped_type; map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { const T& get(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { (*self)[key] = x; } void del(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(const K& key) { std::map::iterator i = self->find(key); return i != self->end(); } } }; } 0707010008e7e5000081a40000000000000000000000014caec289000022c2000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/lua/lua.swg/* ----------------------------------------------------------------------------- * lua.swg * * SWIG Configuration File for Lua. * This file is parsed by SWIG before reading any other interface file. * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * includes * ----------------------------------------------------------------------------- */ %include /* The typemaps */ %include /* The runtime stuff */ //%include /* ----------------------------------------------------------------------------- * constants typemaps * ----------------------------------------------------------------------------- */ // this basically adds to a table of constants %typemap(consttab) int, unsigned int, short, unsigned short, long, unsigned long, unsigned char, signed char, bool, enum SWIGTYPE { SWIG_LUA_INT, (char *)"$symname", (long) $value, 0, 0, 0} %typemap(consttab) float, double { SWIG_LUA_FLOAT, (char *)"$symname", 0, (double) $value, 0, 0} %typemap(consttab) long long, unsigned long long, signed long long { SWIG_LUA_FLOAT, (char *)"$symname", 0, (double) $value, 0, 0} %typemap(consttab) const long long&, const unsigned long long&, const signed long long& { SWIG_LUA_FLOAT, (char *)"$symname", 0, (double) *$value, 0, 0} %typemap(consttab) char *, const char *, char [], const char [] { SWIG_LUA_STRING, (char *)"$symname", 0, 0, (void *)$value, 0} // note: char is treated as a seperate special type // signed char & unsigned char are numbers %typemap(consttab) char { SWIG_LUA_CHAR, (char *)"$symname", (long)$value, 0, 0, 0} %typemap(consttab) long long, unsigned long long { SWIG_LUA_STRING, (char *) "$symname", 0, 0, (void *)"$value", 0} %typemap(consttab) SWIGTYPE *, SWIGTYPE *const, SWIGTYPE &, SWIGTYPE [] { SWIG_LUA_POINTER, (char *)"$symname", 0, 0, (void *)$value, &$1_descriptor} // member function pointers %typemap(consttab) SWIGTYPE (CLASS::*) { SWIG_LUA_BINARY, (char *)"$symname", sizeof($type), 0, (void *)&$value, &$1_descriptor} /* ----------------------------------------------------------------------------- * Overloaded operator support * ----------------------------------------------------------------------------- */ // lua calls the + operator '__add' // python likes to call it '__add__' // Assuming most SWIGers will probably use the __add__ if they extend their classes // we have two sets of renames // one to rename the operator+() to __add() // (this lets SWIG rename the operator overloads) // another is to rename __add__() to __add() // (this means that people who wrote SWIG code to do that add will also work) #ifdef __cplusplus // this is extra renaming for lua // not all operators are supported, so only those that are, are listed %rename(__add) *::operator+; %rename(__sub) *::operator-; %rename(__mul) *::operator*; %rename(__div) *::operator/; %rename(__unm) *::operator-(); %rename(__unm) *::operator-() const; %rename(__eq) *::operator==; %ignore *::operator!=; // note: Lua does not have a notequal operator // it just uses 'not (a==b)' %rename(__lt) *::operator<; %ignore *::operator>; // ditto less than vs greater than %rename(__le) *::operator<=; %ignore *::operator>=; // ditto less than vs greater than %ignore *::operator!; // does not support not %rename(__call) *::operator(); // the fn call operator // lua does not support overloading of: // logical/bitwise operators // assign operator // +=,-=,*=, etc // therefore ignoring them for now // it also doesn't support non class operators // eg friends or XX operator+(XX,XX) // also ignoring // note: some of these might be better to rename, but not doing that for now %ignore *::operator&&; %ignore operator&&; %ignore *::operator||; %ignore operator||; %ignore *::operator+=; %ignore *::operator-=; %ignore *::operator*=; %ignore *::operator/=; %ignore *::operator%=; %ignore *::operator++; %ignore *::operator--; %ignore *::operator=; // note: this might be better to rename to assign() or similar %ignore operator+; %ignore operator-; %ignore operator*; %ignore operator/; %ignore operator%; %ignore operator[]; %ignore operator>; %ignore operator>=; %ignore operator<; %ignore operator<=; %ignore operator==; %ignore operator!=; // renaming the python operators to be compatible with lua // this means that if a developer has written a fn __add__() // it will be used for the lua + %rename(__add) *::__add__; %rename(__sub) *::__sub__; %rename(__mul) *::__mul__; %rename(__div) *::__div__; %rename(__unm) *::__neg__; // lua calls unary minus,'unm' not 'neg' %rename(__tostring) *::__str__; // both map to __tostring %rename(__tostring) *::__repr__; // both map to __tostring %rename(__pow) *::__pow__; // lua power '^' operator %rename(__concat) *::__concat__; // lua concat '..' operator %rename(__eq) *::__eq__; %rename(__lt) *::__lt__; %rename(__le) *::__le__; %rename(__call) *::__call__; // the fn call operator() // the [] operator has two parts, the get & the set %rename(__getitem) *::__getitem__; // the v=X[i] (get operator) %rename(__setitem) *::__setitem__; // the X[i]=v (set operator) #endif /* ------------------------------------------------------------ * Exceptions * ------------------------------------------------------------ */ /* Confession: I dont really like C++ exceptions The python/lua ones are great, but C++ ones I dont like (mainly because I cannot get the stack trace out of it) Therefore I have not bothered to try doing much in this Therefore currently its just enough to get a few test cases running ok note: if you wish to throw anything related to std::exception use %include instead */ // number as number+error %typemap(throws) int,unsigned int,signed int, long,unsigned long,signed long, short,unsigned short,signed short, float,double, long long,unsigned long long, unsigned char, signed char, int&,unsigned int&,signed int&, long&,unsigned long&,signed long&, short&,unsigned short&,signed short&, float&,double&, long long&,unsigned long long&, unsigned char&, signed char& %{lua_pushnumber(L,(lua_Number)$1);SWIG_fail; %} %typemap(throws) bool,bool& %{lua_pushboolean(L,(int)($1==true));SWIG_fail; %} // enum as number+error %typemap(throws) enum SWIGTYPE %{lua_pushnumber(L,(lua_Number)(int)$1);SWIG_fail; %} // strings are just sent as errors %typemap(throws) char *, const char * %{lua_pushstring(L,$1);SWIG_fail;%} // char is changed to a string %typemap(throws) char %{lua_pushfstring(L,"%c",$1);SWIG_fail;%} /* Throwing object is a serious problem: Assuming some code throws a 'FooBar' There are a few options: - return a pointer to it: but its unclear how long this will last for. - return a copy of it: but not all objects are copyable (see exception_partial_info in the test suite for a case where you cannot do this) - convert to a string & throw that its not so useful, but it works (this is more lua like). The third option (though not nice) is used For a more useful solution: see std_except for more details */ // basic typemap for structs, classes, pointers & references // convert to string and error %typemap(throws) SWIGTYPE %{(void)$1; /* ignore it */ lua_pushfstring(L,"object exception:%s",SWIG_TypePrettyName($1_descriptor)); SWIG_fail;%} // code to make a copy of the object and return this // if you have a function which throws a FooBar & you want SWIG to return a copy of the object as its error // then use one of the below // %apply SWIGTYPE EXCEPTION_BY_VAL {FooBar}; // %apply SWIGTYPE& EXCEPTION_BY_VAL {FooBar&}; // note: need & twice %typemap(throws) SWIGTYPE EXCEPTION_BY_VAL %{SWIG_NewPointerObj(L,(void *)new $1_ltype(($1_ltype &) $1),$&1_descriptor,1); SWIG_fail;%} // similar for object reference // note: swig typemaps seem a little confused around here, therefore we use $basetype %typemap(throws) SWIGTYPE& EXCEPTION_BY_VAL %{SWIG_NewPointerObj(L,(void *)new $basetype($1),$1_descriptor,1); SWIG_fail;%} // note: no support for object pointers // its not clear how long the pointer is valid for, therefore not supporting it /* ----------------------------------------------------------------------------- * extras * ----------------------------------------------------------------------------- */ // this %define is to allow insertion of lua source code into the wrapper file #define %luacode %insert("luacode") /* ------------------------------ end lua.swg ------------------------------ */ 0707010008e7e9000081a40000000000000000000000014caec2890000349c000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/lua/luatypemaps.swg/* ----------------------------------------------------------------------------- * luatypemaps.swg * * basic typemaps for Lua. * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * standard typemaps * ----------------------------------------------------------------------------- */ /* NEW LANGUAGE NOTE: the 'checkfn' param is something that I added for typemap(in) it is an optional fn call to check the type of the lua object the fn call must be of the form int checkfn(lua_State *L, int index); and return 1/0 depending upon if this is the correct type For the typemap(out), an additional SWIG_arg parmeter must be incremented to reflect the number of values returned (normally SWIG_arg++; will do) */ // numbers %typemap(in,checkfn="lua_isnumber") int, short, long, signed char, float, double %{$1 = ($type)lua_tonumber(L, $input);%} // additional check for unsigned numbers, to not permit negative input %typemap(in,checkfn="lua_isnumber") unsigned int, unsigned short, unsigned long, unsigned char %{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative") $1 = ($type)lua_tonumber(L, $input);%} %typemap(out) int,short,long, unsigned int,unsigned short,unsigned long, signed char,unsigned char, float,double %{ lua_pushnumber(L, (lua_Number) $1); SWIG_arg++;%} // we must also provide typemaps for privitives by const reference: // given a function: // int intbyref(const int& i); // SWIG assumes that this code will need a pointer to int to be passed in // (this might be ok for objects by const ref, but not for numeric primitives) // therefore we add a set of typemaps to fix this (for both in & out) %typemap(in,checkfn="lua_isnumber") const int&($basetype temp) %{ temp=($basetype)lua_tonumber(L,$input); $1=&temp;%} %typemap(in,checkfn="lua_isnumber") const unsigned int&($basetype temp) %{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative") temp=($basetype)lua_tonumber(L,$input); $1=&temp;%} %typemap(out) const int&, const unsigned int& %{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} // for the other numbers we can just use an apply statement to cover them %apply const int & {const short&,const long&,const signed char&, const float&,const double&}; %apply const unsigned int & {const unsigned short&,const unsigned long&, const unsigned char&}; /* enums have to be handled slightly differently VC++ .net will not allow a cast from lua_Number(double) to enum directly. */ %typemap(in,checkfn="lua_isnumber") enum SWIGTYPE %{$1 = ($type)(int)lua_tonumber(L, $input);%} %typemap(out) enum SWIGTYPE %{ lua_pushnumber(L, (lua_Number)(int)($1)); SWIG_arg++;%} // and const refs %typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &($basetype temp) %{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} %typemap(out) const enum SWIGTYPE & %{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} // boolean (which is a special type in lua) // note: lua_toboolean() returns 1 or 0 // note: 1 & 0 are not booleans in lua, only true & false %typemap(in,checkfn="lua_isboolean") bool %{$1 = (lua_toboolean(L, $input)!=0);%} %typemap(out) bool %{ lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%} // for const bool&, SWIG treats this as a const bool* so we must dereference it %typemap(in,checkfn="lua_isboolean") const bool& (bool temp) %{temp=(lua_toboolean(L, $input)!=0); $1=&temp;%} %typemap(out) const bool& %{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%} // strings (char * and char[]) %fragment("SWIG_lua_isnilstring", "header") { SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { int ret = lua_isstring(L, idx); if (!ret) ret = lua_isnil(L, idx); return ret; } } %typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char *, char * %{$1 = ($ltype)lua_tostring(L, $input);%} %typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char[ANY], char[ANY] %{$1 = ($ltype)lua_tostring(L, $input);%} %typemap(out) const char *, char * %{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} %typemap(out) const char[ANY], char[ANY] %{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} // char's // currently treating chars as small strings, not as numbers // (however signed & unsigned char's are numbers...) %typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") char %{$1 = (lua_tostring(L, $input))[0];%} %typemap(out) char %{ lua_pushfstring(L,"%c",$1); SWIG_arg++;%} // by const ref %typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char& (char temp) %{temp = (lua_tostring(L, $input))[0]; $1=&temp;%} %typemap(out) const char& %{ lua_pushfstring(L,"%c",*$1); SWIG_arg++;%} // pointers and references // under SWIG rules, it is ok, to have a pass in a lua nil, // it should be converted to a SWIG NULL. // This will only be allowed for pointers & arrays, not refs or by value // the checkfn lua_isuserdata will only work for userdata // the checkfn SWIG_isptrtype will work for both userdata and nil's %typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE*,SWIGTYPE[] %{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ SWIG_fail_ptr("$symname",$argnum,$descriptor); } %} %typemap(in,checkfn="lua_isuserdata") SWIGTYPE& %{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ SWIG_fail_ptr("$symname",$argnum,$descriptor); } %} // out is simple %typemap(out) SWIGTYPE*,SWIGTYPE& %{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} // dynamic casts // this uses the SWIG_TypeDynamicCast() which relies on RTTI to find out what the pointer really is // the we return it as the correct type %typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); SWIG_NewPointerObj(L,(void*)$1,ty,$owner); SWIG_arg++; } // passing objects by value // SWIG_ConvertPtr wants an object pointer (the $<ype argp) // then dereferences it to get the object %typemap(in,checkfn="lua_isuserdata") SWIGTYPE ($<ype argp) %{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&argp,$&descriptor,0))){ SWIG_fail_ptr("$symname",$argnum,$&descriptor); } $1 = *argp; %} // Also needed for object ptrs by const ref // eg A* const& ref_pointer(A* const& a); // found in mixed_types.i %typemap(in,checkfn="lua_isuserdata") SWIGTYPE *const&($*ltype temp) %{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname"); $1=($1_ltype)&temp;%} %typemap(out) SWIGTYPE *const& %{SWIG_NewPointerObj(L,*$1,$*descriptor,$owner); SWIG_arg++; %} // DISOWN-ing typemaps // if you have an object pointer which must be disowned, use this typemap // eg. for void destroy_foo(Foo* toDie); // use %apply SWIGTYPE* DISOWN {Foo* toDie}; // you could just use %delobject, but this is more flexible %typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE* DISOWN,SWIGTYPE DISOWN[] %{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,SWIG_POINTER_DISOWN))){ SWIG_fail_ptr("$symname",$argnum,$descriptor); } %} // Primitive types--return by value // must make a new object, copy the data & return the new object // Note: the brackets are {...} and not %{..%}, because we want them to be included in the wrapper // this is because typemap(out) does not support local variables, like in typemap(in) does // and we need the $&1_ltype resultptr; to be declared #ifdef __cplusplus %typemap(out) SWIGTYPE { $&1_ltype resultptr = new $1_ltype((const $1_ltype &) $1); SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; } #else %typemap(out) SWIGTYPE { $&1_ltype resultptr; resultptr = ($&1_ltype) malloc(sizeof($1_type)); memmove(resultptr, &$1, sizeof($1_type)); SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; } #endif // member function pointer // a member fn ptr is not 4 bytes like a normal pointer, but 8 bytes (at least on mingw) // so the standard wrappering cannot be done // nor can you cast a member function pointer to a void* (obviously) // therefore a special wrappering functions SWIG_ConvertMember() & SWIG_NewMemberObj() were written #ifdef __cplusplus %typemap(in,checkfn="lua_isuserdata") SWIGTYPE (CLASS::*) %{ if (!SWIG_IsOK(SWIG_ConvertMember(L,$input,(void*)(&$1),sizeof($type),$descriptor))) SWIG_fail_ptr("$symname",$argnum,$descriptor); %} %typemap(out) SWIGTYPE (CLASS::*) %{ SWIG_NewMemberObj(L,(void*)(&$1),sizeof($type),$descriptor); SWIG_arg++; %} #endif // void (must be empty without the SWIG_arg++) %typemap(out) void ""; /* void* is a special case A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does) but if its an output, then it should be wrappered like any other SWIG object (using default typemap) */ %typemap(in,checkfn="SWIG_isptrtype") void* %{$1=($1_ltype)SWIG_MustGetPtr(L,$input,0,0,$argnum,"$symname");%} /* long long is another special case: as lua only supports one numeric type (lua_Number), we will just cast it to that & accept the loss of precision. An alternative solution would be a long long struct or class with the relevant operators. */ %apply long {long long, signed long long, unsigned long long}; %apply const long& {const long long&, const signed long long&, const unsigned long long&}; /* It is possible to also pass a lua_State* into a function, so void fn(int a, float b, lua_State* s) is wrappable as > fn(1,4.3) -- note: the state is implicitly passed in */ %typemap(in, numinputs=0) lua_State* %{$1 = L;%} /* ----------------------------------------------------------------------------- * typecheck rules * ----------------------------------------------------------------------------- */ /* These are needed for the overloaded functions These define the detection routines which will spot what parmeters match which function */ // unfortunately lua only considers one type of number // so all numbers (int,float,double) match // you could add an advanced fn to get type & check if its integral %typecheck(SWIG_TYPECHECK_INTEGER) int, short, long, unsigned int, unsigned short, unsigned long, signed char, unsigned char, long long, unsigned long long, signed long long, const int &, const short &, const long &, const unsigned int &, const unsigned short &, const unsigned long &, const signed char&, const unsigned char&, const long long &, const unsigned long long &, enum SWIGTYPE, const enum SWIGTYPE&, float, double, const float &, const double& { $1 = lua_isnumber(L,$input); } %typecheck(SWIG_TYPECHECK_BOOL) bool, const bool & { $1 = lua_isboolean(L,$input); } // special check for a char (string of length 1) %typecheck(SWIG_TYPECHECK_CHAR,fragment="SWIG_lua_isnilstring") char, const char& { $1 = SWIG_lua_isnilstring(L,$input) && (lua_strlen(L,$input)==1); } %typecheck(SWIG_TYPECHECK_STRING,fragment="SWIG_lua_isnilstring") char *, char[] { $1 = SWIG_lua_isnilstring(L,$input); } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { void *ptr; if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { $1 = 0; } else { $1 = 1; } } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE & { void *ptr; if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { $1 = 0; } else { $1 = 1; } } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *ptr; if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $&1_descriptor, 0)) { $1 = 0; } else { $1 = 1; } } %typecheck(SWIG_TYPECHECK_VOIDPTR) void * { void *ptr; if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, 0, 0)) { $1 = 0; } else { $1 = 1; } } // Also needed for object ptrs by const ref // eg const A* ref_pointer(A* const& a); // found in mixed_types.i %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& { void *ptr; if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) { $1 = 0; } else { $1 = 1; } } /* ----------------------------------------------------------------------------- * Others * ----------------------------------------------------------------------------- */ // Array reference typemaps %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } // size_t (which is just a unsigned long) %apply unsigned long { size_t }; %apply const unsigned long & { const size_t & }; /* ----------------------------------------------------------------------------- * Specials * ----------------------------------------------------------------------------- */ // swig::LANGUAGE_OBJ was added to allow containers of native objects // however its rather difficult to do this in lua, as you cannot hold pointers // to native objects (they are held in the interpreter) // therefore for now: just ignoring this feature #ifdef __cplusplus %ignore swig::LANGUAGE_OBJ; //%inline %{ %{ namespace swig { typedef struct{} LANGUAGE_OBJ; } %} #endif // __cplusplus 0707010008e7f2000081a40000000000000000000000014caec28900004aed000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/lua/typemaps.i/* ----------------------------------------------------------------------------- * typemaps.swg * * SWIG Library file containing the main typemap code to support Lua modules. * ----------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * Basic inout typemaps * ----------------------------------------------------------------------------- */ /* These provide the basic ability for passing in & out of standard numeric data types (int,long,float,double, etc) The basic code looks like this: %typemap(in,checkfn="lua_isnumber") int *INPUT(int temp), int &INPUT(int temp) %{ temp = (int)lua_tonumber(L,$input); $1 = &temp; %} %typemap(in, numinputs=0) int *OUTPUT (int temp) %{ $1 = &temp; %} %typemap(argout) int *OUTPUT %{ lua_pushnumber(L, (double) *$1); SWIG_arg++;%} %typemap(in) int *INOUT = int *INPUT; %typemap(argout) int *INOUT = int *OUTPUT; However the code below is a mixture of #defines & such, so nowhere as easy to read To make you code work correctly its not just a matter of %including this file You also have to give SWIG the hints on which to use where eg extern int add_pointer(int* a1,int* a2); // a1 & a2 are pointer values to be added extern void swap(int* s1, int* s2); // does the swap You will need to either change the argument names extern int add_pointer(int* INPUT,int* INPUT); or provide a %apply statement %apply int* INOUT{ int *s1, int *s2 }; // if SWIG sees int* s1, int* s2, assume they are inout params */ %define SWIG_NUMBER_TYPEMAP(TYPE) %typemap(in,checkfn="lua_isnumber") TYPE *INPUT($*ltype temp), TYPE &INPUT($*ltype temp) %{ temp = ($*ltype)lua_tonumber(L,$input); $1 = &temp; %} %typemap(in, numinputs=0) TYPE *OUTPUT ($*ltype temp) %{ $1 = &temp; %} %typemap(argout) TYPE *OUTPUT %{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} %typemap(in) TYPE *INOUT = TYPE *INPUT; %typemap(argout) TYPE *INOUT = TYPE *OUTPUT; %typemap(in) TYPE &OUTPUT = TYPE *OUTPUT; %typemap(argout) TYPE &OUTPUT = TYPE *OUTPUT; %typemap(in) TYPE &INOUT = TYPE *INPUT; %typemap(argout) TYPE &INOUT = TYPE *OUTPUT; // const version (the $*ltype is the basic number without ptr or const's) %typemap(in,checkfn="lua_isnumber") const TYPE *INPUT($*ltype temp) %{ temp = ($*ltype)lua_tonumber(L,$input); $1 = &temp; %} %enddef // now the code SWIG_NUMBER_TYPEMAP(int); SWIG_NUMBER_TYPEMAP(unsigned int); SWIG_NUMBER_TYPEMAP(signed int); SWIG_NUMBER_TYPEMAP(short); SWIG_NUMBER_TYPEMAP(unsigned short); SWIG_NUMBER_TYPEMAP(signed short); SWIG_NUMBER_TYPEMAP(long); SWIG_NUMBER_TYPEMAP(unsigned long); SWIG_NUMBER_TYPEMAP(signed long); SWIG_NUMBER_TYPEMAP(float); SWIG_NUMBER_TYPEMAP(double); SWIG_NUMBER_TYPEMAP(enum SWIGTYPE); // also for long longs's SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NUMBER_TYPEMAP(signed long long); // note we dont do char, as a char* is probably a string not a ptr to a single char // similar for booleans %typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp) %{ temp = (lua_toboolean(L,$input)!=0); $1 = &temp; %} %typemap(in, numinputs=0) bool *OUTPUT (bool temp),bool &OUTPUT (bool temp) %{ $1 = &temp; %} %typemap(argout) bool *OUTPUT,bool &OUTPUT %{ lua_pushboolean(L, (int)((*$1)!=0)); SWIG_arg++;%} %typemap(in) bool *INOUT = bool *INPUT; %typemap(argout) bool *INOUT = bool *OUTPUT; %typemap(in) bool &INOUT = bool &INPUT; %typemap(argout) bool &INOUT = bool &OUTPUT; /* ----------------------------------------------------------------------------- * Basic Array typemaps * ----------------------------------------------------------------------------- */ /* I have no idea why this kind of code does not exist in SWIG as standard, but here is it. This code will convert to/from 1D numeric arrays. In order to reduce code bloat, there are a few macros and quite a few functions defined (unfortunately this makes it a lot less clear) assuming we have functions void process_array(int arr[3]); // nice fixed size array void process_var_array(float arr[],int len); // variable sized array void process_var_array_inout(double* arr,int len); // variable sized array // data passed in & out void process_enum_inout_array_var(enum Days *arrinout, int len); // using enums void return_array_5(int arrout[5]); // out array only in order to wrap them correctly requires a typemap // inform SWIG of the correct typemap // For fixed length, you must specify it as INPUT[ANY] %apply (int INPUT[ANY]) {(int arr[3])}; // variable length arrays are just the same %apply (float INPUT[],int) {(float arr[],int len)}; // it is also ok, to map the TYPE* instead of a TYPE[] %apply (double *INOUT,int) {(double arr*,int len)}; // for the enum's you must use enum SWIGTYPE %apply (enum SWIGTYPE *INOUT,int) {(enum Days *arrinout, int len)}; // fixed length out if also fine %apply (int OUTPUT[ANY]) {(int arrout[5])}; Generally, you could use %typemap(...)=... but the %apply is neater & easier a few things of note: * all Lua tables are indexed from 1, all C/C++ arrays are indexed from 0 therefore t={6,5,3} -- t[1]==6, t[2]==5, t[3]==3 when passed to process_array(int arr[3]) becomes arr[0]==6, arr[1]==5, arr[2]==3 * for OUTPUT arrays, no array need be passed in, the fn will return a Lua table so for the above mentioned return_array_5() would look like arr=return_array_5() -- no parameters passed in * for INOUT arrays, a table must be passed in, and a new table will be returned (this is consistant with the way that numbers are processed) if you want just use arr={...} arr=process_var_array_inout(arr) -- arr is replaced by the new version The following are not yet supported: * variable length output only array (inout's work ok) * multidimentional arrays * arrays of objects/structs * arrays of pointers */ /* The internals of the array managment stuff helper fns/macros SWIG_ALLOC_ARRAY(TYPE,LEN) // returns a typed array TYPE[LEN] SWIG_FREE_ARRAY(PTR) // delete the ptr (if not zero) // counts the specified table & gets the size // integer version int SWIG_itable_size(lua_State* L, int index); // other version int SWIG_table_size(lua_State* L, int index); SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE) // this fn declares up 4 functions for helping to read/write tables // these can then be called by the macros ... // all assume the table is an integer indexes from 1 // but the C array is a indexed from 0 // created a fixed size array, reads the specified table // and then fills the array with numbers // returns ptr to the array if ok, or 0 for error // (also pushes a error message to the stack) TYPE* SWIG_get_NAME_num_array_fixed(lua_State* L, int index, int size); // as per SWIG_get_NAME_num_array_fixed() // but reads the entire table & creates an array of the correct size // (if the table is empty, it returns an error rather than a zero length array) TYPE* SWIG_get_NAME_num_array_var(lua_State* L, int index, int* size); // writes a table to Lua with all the specified numbers void SWIG_write_NAME_num_array(lua_State* L,TYPE *array,int size); // read the specified table, and fills the array with numbers // returns 1 of ok (only fails if it doesnt find numbers) // helper fn (called by SWIG_get_NAME_num_array_*() fns) int SWIG_read_NAME_num_array(lua_State* L,int index,TYPE *array,int size); */ /* Reported that you don't need to check for NULL for delete & free There probably is some compiler that its not true for, so the code is left here just in case. #ifdef __cplusplus #define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] #define SWIG_FREE_ARRAY(PTR) if(PTR){delete[] PTR;} #else #define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) #define SWIG_FREE_ARRAY(PTR) if(PTR){free(PTR);} #endif */ %{ #ifdef __cplusplus /* generic alloc/dealloc fns*/ #define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] #define SWIG_FREE_ARRAY(PTR) delete[] PTR #else #define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) #define SWIG_FREE_ARRAY(PTR) free(PTR) #endif /* counting the size of arrays:*/ SWIGINTERN int SWIG_itable_size(lua_State* L, int index) { int n=0; while(1){ lua_rawgeti(L,index,n+1); if (lua_isnil(L,-1))break; ++n; lua_pop(L,1); } lua_pop(L,1); return n; } SWIGINTERN int SWIG_table_size(lua_State* L, int index) { int n=0; lua_pushnil(L); /* first key*/ while (lua_next(L, index) != 0) { ++n; lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/ } return n; } /* super macro to declare array typemap helper fns */ #define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\ SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\ int i;\ for (i = 0; i < size; i++) {\ lua_rawgeti(L,index,i+1);\ if (lua_isnumber(L,-1)){\ array[i] = (TYPE)lua_tonumber(L,-1);\ } else {\ lua_pop(L,1);\ return 0;\ }\ lua_pop(L,1);\ }\ return 1;\ }\ SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\ TYPE *array;\ if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\ lua_pushfstring(L,"expected a table of size %d",size);\ return 0;\ }\ array=SWIG_ALLOC_ARRAY(TYPE,size);\ if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\ lua_pushstring(L,"table must contain numbers");\ SWIG_FREE_ARRAY(array);\ return 0;\ }\ return array;\ }\ SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\ {\ TYPE *array;\ if (!lua_istable(L,index)) {\ lua_pushstring(L,"expected a table");\ return 0;\ }\ *size=SWIG_itable_size(L,index);\ if (*size<1){\ lua_pushstring(L,"table appears to be empty");\ return 0;\ }\ array=SWIG_ALLOC_ARRAY(TYPE,*size);\ if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\ lua_pushstring(L,"table must contain numbers");\ SWIG_FREE_ARRAY(array);\ return 0;\ }\ return array;\ }\ SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\ int i;\ lua_newtable(L);\ for (i = 0; i < size; i++){\ lua_pushnumber(L,(lua_Number)array[i]);\ lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \ }\ } %} /* This is one giant macro to define the typemaps & the helpers for array handling */ %define SWIG_TYPEMAP_NUM_ARR(NAME,TYPE) %{SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE);%} // fixed size array's %typemap(in) TYPE INPUT[ANY] %{ $1 = SWIG_get_##NAME##_num_array_fixed(L,$input,$1_dim0); if (!$1) SWIG_fail;%} %typemap(freearg) TYPE INPUT[ANY] %{ SWIG_FREE_ARRAY($1);%} // variable size array's %typemap(in) (TYPE *INPUT,int) %{ $1 = SWIG_get_##NAME##_num_array_var(L,$input,&$2); if (!$1) SWIG_fail;%} %typemap(freearg) (TYPE *INPUT,int) %{ SWIG_FREE_ARRAY($1);%} // out fixed arrays %typemap(in,numinputs=0) TYPE OUTPUT[ANY] %{ $1 = SWIG_ALLOC_ARRAY(TYPE,$1_dim0); %} %typemap(argout) TYPE OUTPUT[ANY] %{ SWIG_write_##NAME##_num_array(L,$1,$1_dim0); SWIG_arg++; %} %typemap(freearg) TYPE OUTPUT[ANY] %{ SWIG_FREE_ARRAY($1); %} // inout fixed arrays %typemap(in) TYPE INOUT[ANY]=TYPE INPUT[ANY]; %typemap(argout) TYPE INOUT[ANY]=TYPE OUTPUT[ANY]; %typemap(freearg) TYPE INOUT[ANY]=TYPE INPUT[ANY]; // inout variable arrays %typemap(in) (TYPE *INOUT,int)=(TYPE *INPUT,int); %typemap(argout) (TYPE *INOUT,int) %{ SWIG_write_##NAME##_num_array(L,$1,$2); SWIG_arg++; %} %typemap(freearg) (TYPE *INOUT,int)=(TYPE *INPUT,int); // TODO out variable arrays (is there a standard form for such things?) // referencing so that (int *INPUT,int) and (int INPUT[],int) are the same %typemap(in) (TYPE INPUT[],int)=(TYPE *INPUT,int); %typemap(freearg) (TYPE INPUT[],int)=(TYPE *INPUT,int); %enddef // the following line of code // declares the C helper fns for the array typemaps // as well as defining typemaps for // fixed len arrays in & out, & variable length arrays in SWIG_TYPEMAP_NUM_ARR(int,int); SWIG_TYPEMAP_NUM_ARR(uint,unsigned int); SWIG_TYPEMAP_NUM_ARR(short,short); SWIG_TYPEMAP_NUM_ARR(ushort,unsigned short); SWIG_TYPEMAP_NUM_ARR(long,long); SWIG_TYPEMAP_NUM_ARR(ulong,unsigned long); SWIG_TYPEMAP_NUM_ARR(float,float); SWIG_TYPEMAP_NUM_ARR(double,double); // again enums are a problem so they need their own type // we use the int conversion routine & recast it %typemap(in) enum SWIGTYPE INPUT[ANY] %{ $1 = ($ltype)SWIG_get_int_num_array_fixed(L,$input,$1_dim0); if (!$1) SWIG_fail;%} %typemap(freearg) enum SWIGTYPE INPUT[ANY] %{ SWIG_FREE_ARRAY($1);%} // variable size array's %typemap(in) (enum SWIGTYPE *INPUT,int) %{ $1 = ($ltype)SWIG_get_int_num_array_var(L,$input,&$2); if (!$1) SWIG_fail;%} %typemap(freearg) (enum SWIGTYPE *INPUT,int) %{ SWIG_FREE_ARRAY($1);%} // out fixed arrays %typemap(in,numinputs=0) enum SWIGTYPE OUTPUT[ANY] %{ $1 = SWIG_ALLOC_ARRAY(enum SWIGTYPE,$1_dim0); %} %typemap(argout) enum SWIGTYPE OUTPUT[ANY] %{ SWIG_write_int_num_array(L,(int*)$1,$1_dim0); SWIG_arg++; %} %typemap(freearg) enum SWIGTYPE OUTPUT[ANY] %{ SWIG_FREE_ARRAY($1); %} // inout fixed arrays %typemap(in) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; %typemap(argout) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE OUTPUT[ANY]; %typemap(freearg) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; // inout variable arrays %typemap(in) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); %typemap(argout) (enum SWIGTYPE *INOUT,int) %{ SWIG_write_int_num_array(L,(int*)$1,$2); SWIG_arg++; %} %typemap(freearg) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); /* Surprisingly pointer arrays are easier: this is because all ptr arrays become void** so only a few fns are needed & a few casts The function defined are // created a fixed size array, reads the specified table // and then fills the array with pointers (checking the type) // returns ptr to the array if ok, or 0 for error // (also pushes a error message to the stack) void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type); // as per SWIG_get_ptr_array_fixed() // but reads the entire table & creates an array of the correct size // (if the table is empty, it returns an error rather than a zero length array) void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type); // writes a table to Lua with all the specified pointers // all pointers have the ownership value 'own' (normally 0) void SWIG_write_ptr_array(lua_State* L,void **array,int size,int own); // read the specified table, and fills the array with ptrs // returns 1 of ok (only fails if it doesnt find correct type of ptrs) // helper fn (called by SWIG_get_ptr_array_*() fns) int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type); The key thing to remember is that it is assumed that there is no modification of pointers ownership in the arrays eg A fn: void pointers_in(TYPE* arr[],int len); will make copies of the pointer into a temp array and then pass it into the fn Lua does not remeber that this fn held the pointers, so it is not safe to keep these pointers until later eg A fn: void pointers_out(TYPE* arr[3]); will return a table containing three pointers however these pointers are NOT owned by Lua, merely borrowed so if the C/C++ frees then Lua is not aware */ %{ SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){ int i; for (i = 0; i < size; i++) { lua_rawgeti(L,index,i+1); if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){ lua_pop(L,1); return 0; } lua_pop(L,1); } return 1; } SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){ void **array; if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) { lua_pushfstring(L,"expected a table of size %d",size); return 0; } array=SWIG_ALLOC_ARRAY(void*,size); if (!SWIG_read_ptr_array(L,index,array,size,type)){ lua_pushfstring(L,"table must contain pointers of type %s",type->name); SWIG_FREE_ARRAY(array); return 0; } return array; } SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){ void **array; if (!lua_istable(L,index)) { lua_pushstring(L,"expected a table"); return 0; } *size=SWIG_itable_size(L,index); if (*size<1){ lua_pushstring(L,"table appears to be empty"); return 0; } array=SWIG_ALLOC_ARRAY(void*,*size); if (!SWIG_read_ptr_array(L,index,array,*size,type)){ lua_pushfstring(L,"table must contain pointers of type %s",type->name); SWIG_FREE_ARRAY(array); return 0; } return array; } SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){ int i; lua_newtable(L); for (i = 0; i < size; i++){ SWIG_NewPointerObj(L,array[i],type,own); lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ } } %} // fixed size array's %typemap(in) SWIGTYPE* INPUT[ANY] %{ $1 = ($ltype)SWIG_get_ptr_array_fixed(L,$input,$1_dim0,$*1_descriptor); if (!$1) SWIG_fail;%} %typemap(freearg) SWIGTYPE* INPUT[ANY] %{ SWIG_FREE_ARRAY($1);%} // variable size array's %typemap(in) (SWIGTYPE **INPUT,int) %{ $1 = ($ltype)SWIG_get_ptr_array_var(L,$input,&$2,$*1_descriptor); if (!$1) SWIG_fail;%} %typemap(freearg) (SWIGTYPE **INPUT,int) %{ SWIG_FREE_ARRAY($1);%} // out fixed arrays %typemap(in,numinputs=0) SWIGTYPE* OUTPUT[ANY] %{ $1 = SWIG_ALLOC_ARRAY($*1_type,$1_dim0); %} %typemap(argout) SWIGTYPE* OUTPUT[ANY] %{ SWIG_write_ptr_array(L,(void**)$1,$1_dim0,$*1_descriptor,0); SWIG_arg++; %} %typemap(freearg) SWIGTYPE* OUTPUT[ANY] %{ SWIG_FREE_ARRAY($1); %} // inout fixed arrays %typemap(in) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; %typemap(argout) SWIGTYPE* INOUT[ANY]=SWIGTYPE* OUTPUT[ANY]; %typemap(freearg) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; // inout variable arrays %typemap(in) (SWIGTYPE** INOUT,int)=(SWIGTYPE** INPUT,int); %typemap(argout) (SWIGTYPE** INOUT,int) %{ SWIG_write_ptr_array(L,(void**)$1,$2,$*1_descriptor,0); SWIG_arg++; %} %typemap(freearg) (SWIGTYPE**INOUT,int)=(SWIGTYPE**INPUT,int); /* ----------------------------------------------------------------------------- * Pointer-Pointer typemaps * ----------------------------------------------------------------------------- */ /* This code is to deal with the issue for pointer-pointer's In particular for factory methods. for example take the following code segment: struct iMath; // some structure int Create_Math(iMath** pptr); // its factory (assume it mallocs) to use it you might have the following C code: iMath* ptr; int ok; ok=Create_Math(&ptr); // do things with ptr //... free(ptr); With the following SWIG code %apply SWIGTYPE** OUTPUT{iMath **pptr }; You can get natural wrappering in Lua as follows: ok,ptr=Create_Math() -- ptr is a iMath* which is returned with the int ptr=nil -- the iMath* will be GC'ed as normal */ %typemap(in,numinputs=0) SWIGTYPE** OUTPUT ($*ltype temp) %{ $1 = &temp; %} %typemap(argout) SWIGTYPE** OUTPUT %{SWIG_NewPointerObj(L,*$1,$*descriptor,1); SWIG_arg++; %} 0707010008e7f3000081a40000000000000000000000014caec28900000434000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/lua/wchar.i/* ----------------------------------------------------------------------------- * wchar.i * * Typemaps for the wchar_t type * These are mapped to a Lua string and are passed around by value. * ----------------------------------------------------------------------------- */ // note: only support for pointer right now, not fixed length strings // TODO: determine how long a const wchar_t* is so we can write wstr2str() // & do the output typemap %{ #include wchar_t* str2wstr(const char *str, int len) { wchar_t* p; if (str==0 || len<1) return 0; p=(wchar *)malloc((len+1)*sizeof(wchar_t)); if (p==0) return 0; if (mbstowcs(p, str, len)==-1) { free(p); return 0; } p[len]=0; return p; } %} %typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t * %{ $1 = str2wstr(lua_tostring( L, $input ),lua_strlen( L, $input )); if ($1==0) {lua_pushfstring(L,"Error in converting to wchar (arg %d)",$input);goto fail;} %} %typemap(freearg) wchar_t * %{ free($1); %} %typemap(typecheck) wchar_t * = char *; 0707010008e7ea000081a40000000000000000000000014caec28900000066000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/lua/std_common.i%include %apply size_t { std::size_t }; %apply const size_t& { const std::size_t& }; 0707010008e7e3000081a40000000000000000000000014caec289000009fa000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/lua/_std_common.i/* ----------------------------------------------------------------------------- * _std_common.i * * std::helpers for LUA * ----------------------------------------------------------------------------- */ %include // the general exepctions /* The basic idea here, is instead of trying to feed SWIG all the horribly templated STL code, to give it a neatened version. These %defines cover some of the more common methods so the class declarations become just a set of %defines */ /* #define for basic container features note: I allow front(), back() & pop_back() to throw execptions upon empty containers, rather than coredump (as we have'nt defined the methods, we can use %extend to add with new features) */ %define %STD_CONTAINER_METHODS(CLASS,T) public: CLASS(); CLASS(const CLASS&); unsigned int size() const; unsigned int max_size() const; bool empty() const; void clear(); %extend { // the extra stuff which must be checked T front()const throw (std::out_of_range){ // only read front & back if (self->empty()) throw std::out_of_range("in "#CLASS"::front()"); return self->front(); } T back()const throw (std::out_of_range){ // not write to them if (self->empty()) throw std::out_of_range("in "#CLASS"::back()"); return self->back(); } } %enddef /* push/pop for front/back also note: front & back are read only methods, not used for writing */ %define %STD_FRONT_ACCESS_METHODS(CLASS,T) public: void push_front(const T& val); %extend { // must check this void pop_front() throw (std::out_of_range){ if (self->empty()) throw std::out_of_range("in "#CLASS"::pop_front()"); self->pop_back(); } } %enddef %define %STD_BACK_ACCESS_METHODS(CLASS,T) public: void push_back(const T& val); %extend { // must check this void pop_back() throw (std::out_of_range){ if (self->empty()) throw std::out_of_range("in "#CLASS"::pop_back()"); self->pop_back(); } } %enddef /* Random access methods */ %define %STD_RANDOM_ACCESS_METHODS(CLASS,T) %extend // this is a extra bit of SWIG code { // [] is replaced by __getitem__ & __setitem__ // simply throws a string, which causes a lua error T __getitem__(unsigned int idx) throw (std::out_of_range){ if (idx>=self->size()) throw std::out_of_range("in "#CLASS"::__getitem__()"); return (*self)[idx]; } void __setitem__(unsigned int idx,const T& val) throw (std::out_of_range){ if (idx>=self->size()) throw std::out_of_range("in "#CLASS"::__setitem__()"); (*self)[idx]=val; } }; %enddef 0707010008e7e8000081a40000000000000000000000014caec2890000091d000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/lua/luaruntime.swg/* ----------------------------------------------------------------------------- * luaruntime.swg * * all the runtime code for . * ----------------------------------------------------------------------------- */ %runtime "swigrun.swg"; /* Common C API type-checking code */ %runtime "luarun.swg"; /* Lua runtime stuff */ %insert(initbeforefunc) "swiginit.swg" %insert(initbeforefunc) %{ /* Forward declaration of where the user's %init{} gets inserted */ void SWIG_init_user(lua_State* L ); #ifdef __cplusplus extern "C" { #endif /* this is the initialization function added at the very end of the code the function is always called SWIG_init, but an eariler #define will rename it */ SWIGEXPORT int SWIG_init(lua_State* L) { int i; /* start with global table */ lua_pushvalue(L,LUA_GLOBALSINDEX); /* SWIG's internal initalisation */ SWIG_InitializeModule((void*)L); SWIG_PropagateClientData(); /* add a global fn */ SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); /* begin the module (its a table with the same name as the module) */ SWIG_Lua_module_begin(L,SWIG_name); /* add commands/functions */ for (i = 0; swig_commands[i].name; i++){ SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); } /* add variables */ for (i = 0; swig_variables[i].name; i++){ SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); } /* set up base class pointers (the hierachy) */ for (i = 0; swig_types[i]; i++){ if (swig_types[i]->clientdata){ SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); } } /* additional registration structs & classes in lua */ for (i = 0; swig_types[i]; i++){ if (swig_types[i]->clientdata){ SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); } } /* constants */ SWIG_Lua_InstallConstants(L,swig_constants); /* invoke user-specific initialization */ SWIG_init_user(L); /* end module */ lua_pop(L,1); /* tidy stack (remove module table)*/ lua_pop(L,1); /* tidy stack (remove global table)*/ return 1; } #ifdef __cplusplus } #endif %} /* Note: the initialization function is closed after all code is generated */ 0707010008e842000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002600000000root/usr/local/share/swig/2.0.1/perl50707010008e850000081a40000000000000000000000014caec28500000409000000b600010002ffffffffffffffff0000003500000000root/usr/local/share/swig/2.0.1/perl5/perlerrors.swg/* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ SWIGINTERN const char* SWIG_Perl_ErrorType(int code) { const char* type = 0; switch(code) { case SWIG_MemoryError: type = "MemoryError"; break; case SWIG_IOError: type = "IOError"; break; case SWIG_RuntimeError: type = "RuntimeError"; break; case SWIG_IndexError: type = "IndexError"; break; case SWIG_TypeError: type = "TypeError"; break; case SWIG_DivisionByZero: type = "ZeroDivisionError"; break; case SWIG_OverflowError: type = "OverflowError"; break; case SWIG_SyntaxError: type = "SyntaxError"; break; case SWIG_ValueError: type = "ValueError"; break; case SWIG_SystemError: type = "SystemError"; break; case SWIG_AttributeError: type = "AttributeError"; break; default: type = "RuntimeError"; } return type; } 0707010008e852000081a40000000000000000000000014caec28500000a36000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/perl5/perlhead.swg#ifdef __cplusplus /* Needed on some windows machines---since MS plays funny games with the header files under C++ */ #include #include extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */ /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */ #ifndef PERL_REVISION # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) # define PERL_PATCHLEVEL_H_IMPLICIT # include # endif # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) # include # endif # ifndef PERL_REVISION # define PERL_REVISION (5) # define PERL_VERSION PATCHLEVEL # define PERL_SUBVERSION SUBVERSION # endif #endif #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) #define PerlIO_exportFILE(fh,fl) (FILE*)(fh) #endif #ifndef SvIOK_UV # define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) #endif #ifndef SvUOK # define SvUOK(sv) SvIOK_UV(sv) #endif #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))) # define PL_sv_undef sv_undef # define PL_na na # define PL_errgv errgv # define PL_sv_no sv_no # define PL_sv_yes sv_yes # define PL_markstack_ptr markstack_ptr #endif #ifndef IVSIZE # ifdef LONGSIZE # define IVSIZE LONGSIZE # else # define IVSIZE 4 /* A bold guess, but the best we can make. */ # endif #endif #ifndef INT2PTR # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) # define PTRV UV # define INT2PTR(any,d) (any)(d) # else # if PTRSIZE == LONGSIZE # define PTRV unsigned long # else # define PTRV unsigned # endif # define INT2PTR(any,d) (any)(PTRV)(d) # endif # define NUM2PTR(any,d) (any)(PTRV)(d) # define PTR2IV(p) INT2PTR(IV,p) # define PTR2UV(p) INT2PTR(UV,p) # define PTR2NV(p) NUM2PTR(NV,p) # if PTRSIZE == LONGSIZE # define PTR2ul(p) (unsigned long)(p) # else # define PTR2ul(p) INT2PTR(unsigned long,p) # endif #endif /* !INT2PTR */ #ifndef SvPV_nolen # define SvPV_nolen(x) SvPV(x,PL_na) #endif #ifndef get_sv # define get_sv perl_get_sv #endif #ifndef ERRSV # define ERRSV get_sv("@",FALSE) #endif #ifndef pTHX_ #define pTHX_ #endif #include #ifdef __cplusplus } #endif 0707010008e851000081a40000000000000000000000014caec2850000022c000000b600010002ffffffffffffffff0000003800000000root/usr/local/share/swig/2.0.1/perl5/perlfragments.swg/* Create a file with this name, 'perlfragments.swg', in your working directory and add all the %fragments you want to take precedence over the ones defined by default by swig. For example, if you add: %fragment(SWIG_AsVal_frag(int),"header") { SWIGINTERNINLINE int SWIG_AsVal(int)(PyObject *obj, int *val) { ; } } this will replace the code used to retrieve an integer value for all the typemaps that need it, including: int, std::vector, std::list >, etc. */ 0707010008e84b000081a40000000000000000000000014caec2850000008a000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/perl5/exception.i%include %insert("runtime") { %define_as(SWIG_exception(code, msg), %block(%error(code, msg); SWIG_fail; )) } 0707010008e857000081a40000000000000000000000014caec28500000750000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/perl5/perlopers.swg/* ------------------------------------------------------------ * Overloaded operator support * ------------------------------------------------------------ */ #ifdef __cplusplus // These are auto-supported by the Perl-module %rename(__plusplus__) *::operator++; %rename(__minmin__) *::operator--; %rename(__add__) *::operator+; %rename(__sub__) *::operator-; %rename(__neg__) *::operator-(); %rename(__neg__) *::operator-() const; %rename(__mul__) *::operator*; %rename(__div__) *::operator/; %rename(__eq__) *::operator==; %rename(__ne__) *::operator!=; %rename(__mod__) *::operator%; %rename(__gt__) *::operator>; %rename(__lt__) *::operator<; %rename(__not__) *::operator!; %rename(__le__) *::operator<=; %rename(__ge__) *::operator>=; %rename(__and__) *::operator&; %rename(__or__) *::operator|; %rename(__iadd__) *::operator+=; %rename(__isub__) *::operator-=; // These are renamed, but no test exists in operator_overload_runme.pl %ignoreoperator(EQ) operator=; // These are renamed, but no 'use overload...' is added %rename(__lshift__) *::operator<<; %rename(__rshift__) *::operator>>; %rename(__xor__) *::operator^; %rename(__invert__) *::operator~; %rename(__call__) *::operator(); /* Ignored operators */ %ignoreoperator(LAND) operator&&; %ignoreoperator(LOR) operator||; %ignoreoperator(MULEQ) operator*=; %ignoreoperator(DIVEQ) operator/=; %ignoreoperator(MODEQ) operator%=; %ignoreoperator(LSHIFTEQ) operator<<=; %ignoreoperator(RSHIFTEQ) operator>>=; %ignoreoperator(ANDEQ) operator&=; %ignoreoperator(OREQ) operator|=; %ignoreoperator(XOREQ) operator^=; %ignoreoperator(ARROWSTAR) operator->*; %ignoreoperator(INDEX) operator[]; #endif /* __cplusplus */ 0707010008e84d000081a40000000000000000000000014caec28500000416000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/jstring.i%include %fragment(SWIG_AsVal_frag(jstring),"header") { SWIGINTERN int SWIG_AsVal_dec(jstring)(SV *obj, jstring *val) { if (SvPOK(obj)) { if (val) { STRLEN len = 0; char *cstr = SvPV(obj, len); *val = JvNewStringLatin1(cstr, len); } return SWIG_OK; } return SWIG_ERROR; } } %fragment(SWIG_From_frag(jstring),"header") { SWIGINTERNINLINE SV * SWIG_From_dec(jstring)(jstring val) { SV *obj = sv_newmortal(); if (!val) { sv_setsv(obj, &PL_sv_undef); } else { jsize len = JvGetStringUTFLength(val); if (!len) { sv_setsv(obj, &PL_sv_undef); } else { char *tmp = %new_array(len, char); JvGetStringUTFRegion(val, 0, len, tmp); sv_setpvn(obj, tmp, len); SvUTF8_on(obj); %delete_array(tmp); } } return obj; } } %typemaps_asvalfrom(%checkcode(STRING), %arg(SWIG_AsVal(jstring)), %arg(SWIG_From(jstring)), %arg(SWIG_AsVal_frag(jstring)), %arg(SWIG_From_frag(jstring)), java::lang::String *); 0707010008e846000081a40000000000000000000000014caec2850000001e000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/perl5/cdata.i%include 0707010008e859000081a40000000000000000000000014caec28500003864000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/perl5/perlrun.swg/* ----------------------------------------------------------------------------- * perlrun.swg * * This file contains the runtime support for Perl modules * and includes code for managing global variables and pointer * type checking. * ----------------------------------------------------------------------------- */ #ifdef PERL_OBJECT #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl), #define SWIG_PERL_OBJECT_CALL pPerl, #else #define SWIG_PERL_OBJECT_DECL #define SWIG_PERL_OBJECT_CALL #endif /* Common SWIG API */ /* for raw pointers */ #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) #define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own) #define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) /* for raw packed data */ #define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) #define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) /* for class or struct pointers */ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) /* for C or C++ function pointers */ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) /* for C++ member pointers, ie, member methods */ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) #define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) /* Error manipulation */ #define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) #define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg) #define SWIG_fail goto fail /* Perl-specific SWIG API */ #define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) #define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) #define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) #define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) #define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) #define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) #define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) /* ----------------------------------------------------------------------------- * pointers/data manipulation * ----------------------------------------------------------------------------- */ /* For backward compatibility only */ #define SWIG_POINTER_EXCEPTION 0 #ifdef __cplusplus extern "C" { #endif #define SWIG_OWNER SWIG_POINTER_OWN #define SWIG_SHADOW SWIG_OWNER << 1 #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL /* SWIG Perl macros */ /* Macro to declare an XS function */ #ifndef XSPROTO # define XSPROTO(name) void name(pTHX_ CV* cv) #endif /* Macro to call an XS function */ #ifdef PERL_OBJECT # define SWIG_CALLXS(_name) _name(cv,pPerl) #else # ifndef MULTIPLICITY # define SWIG_CALLXS(_name) _name(cv) # else # define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) # endif #endif #ifdef PERL_OBJECT #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; #ifdef __cplusplus extern "C" { #endif typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); #ifdef __cplusplus } #endif #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) #define SWIGCLASS_STATIC #else /* PERL_OBJECT */ #define MAGIC_PPERL #define SWIGCLASS_STATIC static SWIGUNUSED #ifndef MULTIPLICITY #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) #ifdef __cplusplus extern "C" { #endif typedef int (*SwigMagicFunc)(SV *, MAGIC *); #ifdef __cplusplus } #endif #else /* MULTIPLICITY */ #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) #ifdef __cplusplus extern "C" { #endif typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); #ifdef __cplusplus } #endif #endif /* MULTIPLICITY */ #endif /* PERL_OBJECT */ /* Workaround for bug in perl 5.6.x croak and earlier */ #if (PERL_VERSION < 8) # ifdef PERL_OBJECT # define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) static void SWIG_Perl_croak_null(CPerlObj *pPerl) # else static void SWIG_croak_null() # endif { SV *err=ERRSV; # if (PERL_VERSION < 6) croak("%_", err); # else if (SvOK(err) && !SvROK(err)) croak("%_", err); croak(Nullch); # endif } #else # define SWIG_croak_null() croak(Nullch) #endif /* Define how strict is the cast between strings and integers/doubles when overloading between these types occurs. The default is making it as strict as possible by using SWIG_AddCast when needed. You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to disable the SWIG_AddCast, making the casting between string and numbers less strict. In the end, we try to solve the overloading between strings and numerical types in the more natural way, but if you can avoid it, well, avoid it using %rename, for example. */ #ifndef SWIG_PERL_NO_STRICT_STR2NUM # ifndef SWIG_PERL_STRICT_STR2NUM # define SWIG_PERL_STRICT_STR2NUM # endif #endif #ifdef SWIG_PERL_STRICT_STR2NUM /* string takes precedence */ #define SWIG_Str2NumCast(x) SWIG_AddCast(x) #else /* number takes precedence */ #define SWIG_Str2NumCast(x) x #endif #include SWIGRUNTIME const char * SWIG_Perl_TypeProxyName(const swig_type_info *type) { if (!type) return NULL; if (type->clientdata != NULL) { return (const char*) type->clientdata; } else { return type->name; } } /* Identical to SWIG_TypeCheck, except for strcmp comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ iter->prev->next = iter->next; if (iter->next) iter->next->prev = iter->prev; iter->next = ty->cast; iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; return iter; } iter = iter->next; } } return 0; } /* Function for getting a pointer value */ SWIGRUNTIME int SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) { swig_cast_info *tc; void *voidptr = (void *)0; SV *tsv = 0; if (own) *own = 0; /* If magical, apply more magic */ if (SvGMAGICAL(sv)) mg_get(sv); /* Check to see if this is an object */ if (sv_isobject(sv)) { IV tmp = 0; tsv = (SV*) SvRV(sv); if ((SvTYPE(tsv) == SVt_PVHV)) { MAGIC *mg; if (SvMAGICAL(tsv)) { mg = mg_find(tsv,'P'); if (mg) { sv = mg->mg_obj; if (sv_isobject(sv)) { tsv = (SV*)SvRV(sv); tmp = SvIV(tsv); } } } else { return SWIG_ERROR; } } else { tmp = SvIV(tsv); } voidptr = INT2PTR(void *,tmp); } else if (! SvOK(sv)) { /* Check for undef */ *(ptr) = (void *) 0; return SWIG_OK; } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ if (!SvROK(sv)) { *(ptr) = (void *) 0; return SWIG_OK; } else { return SWIG_ERROR; } } else { /* Don't know what it is */ return SWIG_ERROR; } if (_t) { /* Now see if the types match */ char *_c = HvNAME(SvSTASH(SvRV(sv))); tc = SWIG_TypeProxyCheck(_c,_t); if (!tc) { return SWIG_ERROR; } { int newmemory = 0; *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); if (newmemory == SWIG_CAST_NEW_MEMORY) { assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ if (own) *own = *own | SWIG_CAST_NEW_MEMORY; } } } else { *ptr = voidptr; } /* * DISOWN implementation: we need a perl guru to check this one. */ if (tsv && (flags & SWIG_POINTER_DISOWN)) { /* * almost copy paste code from below SWIG_POINTER_OWN setting */ SV *obj = sv; HV *stash = SvSTASH(SvRV(obj)); GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); if (isGV(gv)) { HV *hv = GvHVn(gv); /* * To set ownership (see below), a newSViv(1) entry is added. * Hence, to remove ownership, we delete the entry. */ if (hv_exists_ent(hv, obj, 0)) { hv_delete_ent(hv, obj, 0, 0); } } } return SWIG_OK; } SWIGRUNTIME int SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0); } SWIGRUNTIME void SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) { SV *self; SV *obj=newSV(0); HV *hash=newHV(); HV *stash; sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr); stash=SvSTASH(SvRV(obj)); if (flags & SWIG_POINTER_OWN) { HV *hv; GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); if (!isGV(gv)) gv_init(gv, stash, "OWNER", 5, FALSE); hv=GvHVn(gv); hv_store_ent(hv, obj, newSViv(1), 0); } sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); SvREFCNT_dec(obj); self=newRV_noinc((SV *)hash); sv_setsv(sv, self); SvREFCNT_dec((SV *)self); sv_bless(sv, stash); } else { sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr); } } SWIGRUNTIMEINLINE SV * SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { SV *result = sv_newmortal(); SWIG_MakePtr(result, ptr, t, flags); return result; } SWIGRUNTIME void SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { char result[1024]; char *r = result; if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; *(r++) = '_'; r = SWIG_PackData(r,ptr,sz); strcpy(r,SWIG_Perl_TypeProxyName(type)); sv_setpv(sv, result); } SWIGRUNTIME SV * SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { SV *result = sv_newmortal(); SWIG_Perl_MakePackedObj(result, ptr, sz, type); return result; } /* Convert a packed value value */ SWIGRUNTIME int SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { swig_cast_info *tc; const char *c = 0; if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; c = SvPV_nolen(obj); /* Pointer values must start with leading underscore */ if (*c != '_') return SWIG_ERROR; c++; c = SWIG_UnpackData(c,ptr,sz); if (ty) { tc = SWIG_TypeCheck(c,ty); if (!tc) return SWIG_ERROR; } return SWIG_OK; } /* Macros for low-level exception handling */ #define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } typedef XSPROTO(SwigPerlWrapper); typedef SwigPerlWrapper *SwigPerlWrapperPtr; /* Structure for command table */ typedef struct { const char *name; SwigPerlWrapperPtr wrapper; } swig_command_info; /* Information for constant table */ #define SWIG_INT 1 #define SWIG_FLOAT 2 #define SWIG_STRING 3 #define SWIG_POINTER 4 #define SWIG_BINARY 5 /* Constant information structure */ typedef struct swig_constant_info { int type; const char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_constant_info; /* Structure for variable table */ typedef struct { const char *name; SwigMagicFunc set; SwigMagicFunc get; swig_type_info **type; } swig_variable_info; /* Magic variable code */ #ifndef PERL_OBJECT #define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) #ifndef MULTIPLICITY SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) #else SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) #endif #else # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) #endif { MAGIC *mg; sv_magic(sv,sv,'U',(char *) name,strlen(name)); mg = mg_find(sv,'U'); mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); mg->mg_virtual->svt_get = (SwigMagicFunc) get; mg->mg_virtual->svt_set = (SwigMagicFunc) set; mg->mg_virtual->svt_len = 0; mg->mg_virtual->svt_clear = 0; mg->mg_virtual->svt_free = 0; } SWIGRUNTIME swig_module_info * SWIG_Perl_GetModule(void) { static void *type_pointer = (void *)0; SV *pointer; /* first check if pointer already created */ if (!type_pointer) { pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); if (pointer && SvOK(pointer)) { type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); } } return (swig_module_info *) type_pointer; } SWIGRUNTIME void SWIG_Perl_SetModule(swig_module_info *module) { SV *pointer; /* create a new pointer */ pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); sv_setiv(pointer, PTR2IV(module)); } #ifdef __cplusplus } #endif 0707010008e844000081a40000000000000000000000014caec28500000022000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/perl5/attribute.i%include 0707010008e84f000081a40000000000000000000000014caec285000005c4000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/perl5.swg/* ------------------------------------------------------------ * perl.swg * * Perl configuration module. * ------------------------------------------------------------ */ /* ------------------------------------------------------------ * Inner macros * ------------------------------------------------------------ */ %include /* ------------------------------------------------------------ * The runtime part * ------------------------------------------------------------ */ %include /* ------------------------------------------------------------ * Special user directives * ------------------------------------------------------------ */ %include /* ------------------------------------------------------------ * Typemap specializations * ------------------------------------------------------------ */ %include /* ------------------------------------------------------------ * Overloaded operator support * ------------------------------------------------------------ */ %include /* ------------------------------------------------------------ * Warnings for Perl keywords * ------------------------------------------------------------ */ %include /* ------------------------------------------------------------ * The Perl initialization function * ------------------------------------------------------------ */ %include 0707010008e855000081a40000000000000000000000014caec28500000024000000b600010002ffffffffffffffff0000003500000000root/usr/local/share/swig/2.0.1/perl5/perlmacros.swg%include 0707010008e84a000081a40000000000000000000000014caec28500000020000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/cstring.i%include 0707010008e849000081a40000000000000000000000014caec28500000021000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/perl5/cpointer.i%include 0707010008e860000081a40000000000000000000000014caec2850000001c000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/perl5/std_deque.i%include 0707010008e85f000081a40000000000000000000000014caec28500000269000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/perl5/std_common.i/* ----------------------------------------------------------------------------- * std_common.i * * SWIG typemaps for STL - common utilities * ----------------------------------------------------------------------------- */ %include %apply size_t { std::size_t }; %{ #include double SwigSvToNumber(SV* sv) { return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv); } std::string SwigSvToString(SV* sv) { STRLEN len; char *ptr = SvPV(sv, len); return std::string(ptr, len); } void SwigSvFromString(SV* sv, const std::string& s) { sv_setpvn(sv,s.data(),s.size()); } %} 0707010008e868000081a40000000000000000000000014caec285000031ef000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/perl5/typemaps.i/* ----------------------------------------------------------------------------- * typemaps.i * * The SWIG typemap library provides a language independent mechanism for * supporting output arguments, input values, and other C function * calling mechanisms. The primary use of the library is to provide a * better interface to certain C function--especially those involving * pointers. * ----------------------------------------------------------------------------- */ #if !defined(SWIG_USE_OLD_TYPEMAPS) %include #else // INPUT typemaps. // These remap a C pointer to be an "INPUT" value which is passed by value // instead of reference. /* The following methods can be applied to turn a pointer into a simple "input" value. That is, instead of passing a pointer to an object, you would use a real value instead. int *INPUT short *INPUT long *INPUT long long *INPUT unsigned int *INPUT unsigned short *INPUT unsigned long *INPUT unsigned long long *INPUT unsigned char *INPUT bool *INPUT float *INPUT double *INPUT To use these, suppose you had a C function like this : double fadd(double *a, double *b) { return *a+*b; } You could wrap it with SWIG as follows : %include typemaps.i double fadd(double *INPUT, double *INPUT); or you can use the %apply directive : %include typemaps.i %apply double *INPUT { double *a, double *b }; double fadd(double *a, double *b); */ %define INPUT_TYPEMAP(type, converter) %typemap(in) type *INPUT(type temp), type &INPUT(type temp) { temp = (type) converter($input); $1 = &temp; } %typemap(typecheck) type *INPUT = type; %typemap(typecheck) type &INPUT = type; %enddef INPUT_TYPEMAP(float, SvNV); INPUT_TYPEMAP(double, SvNV); INPUT_TYPEMAP(int, SvIV); INPUT_TYPEMAP(long, SvIV); INPUT_TYPEMAP(short, SvIV); INPUT_TYPEMAP(signed char, SvIV); INPUT_TYPEMAP(unsigned int, SvUV); INPUT_TYPEMAP(unsigned long, SvUV); INPUT_TYPEMAP(unsigned short, SvUV); INPUT_TYPEMAP(unsigned char, SvUV); %typemap(in) bool *INPUT(bool temp), bool &INPUT(bool temp) { temp = SvIV($input) ? true : false; $1 = &temp; } %typemap(typecheck) bool *INPUT = bool; %typemap(typecheck) bool &INPUT = bool; %typemap(in) long long *INPUT($*1_ltype temp), long long &INPUT($*1_ltype temp) { temp = strtoll(SvPV_nolen($input), 0, 0); $1 = &temp; } %typemap(typecheck) long long *INPUT = long long; %typemap(typecheck) long long &INPUT = long long; %typemap(in) unsigned long long *INPUT($*1_ltype temp), unsigned long long &INPUT($*1_ltype temp) { temp = strtoull(SvPV_nolen($input), 0, 0); $1 = &temp; } %typemap(typecheck) unsigned long long *INPUT = unsigned long long; %typemap(typecheck) unsigned long long &INPUT = unsigned long long; #undef INPUT_TYPEMAP // OUTPUT typemaps. These typemaps are used for parameters that // are output only. The output value is appended to the result as // a list element. /* The following methods can be applied to turn a pointer into an "output" value. When calling a function, no input value would be given for a parameter, but an output value would be returned. In the case of multiple output values, functions will return a Perl array. int *OUTPUT short *OUTPUT long *OUTPUT long long *OUTPUT unsigned int *OUTPUT unsigned short *OUTPUT unsigned long *OUTPUT unsigned long long *OUTPUT unsigned char *OUTPUT bool *OUTPUT float *OUTPUT double *OUTPUT For example, suppose you were trying to wrap the modf() function in the C math library which splits x into integral and fractional parts (and returns the integer part in one of its parameters).: double modf(double x, double *ip); You could wrap it with SWIG as follows : %include typemaps.i double modf(double x, double *OUTPUT); or you can use the %apply directive : %include typemaps.i %apply double *OUTPUT { double *ip }; double modf(double x, double *ip); The Perl output of the function would be an array containing both output values. */ // Force the argument to be ignored. %typemap(in,numinputs=0) int *OUTPUT(int temp), int &OUTPUT(int temp), short *OUTPUT(short temp), short &OUTPUT(short temp), long *OUTPUT(long temp), long &OUTPUT(long temp), unsigned int *OUTPUT(unsigned int temp), unsigned int &OUTPUT(unsigned int temp), unsigned short *OUTPUT(unsigned short temp), unsigned short &OUTPUT(unsigned short temp), unsigned long *OUTPUT(unsigned long temp), unsigned long &OUTPUT(unsigned long temp), unsigned char *OUTPUT(unsigned char temp), unsigned char &OUTPUT(unsigned char temp), signed char *OUTPUT(signed char temp), signed char &OUTPUT(signed char temp), bool *OUTPUT(bool temp), bool &OUTPUT(bool temp), float *OUTPUT(float temp), float &OUTPUT(float temp), double *OUTPUT(double temp), double &OUTPUT(double temp), long long *OUTPUT($*1_ltype temp), long long &OUTPUT($*1_ltype temp), unsigned long long *OUTPUT($*1_ltype temp), unsigned long long &OUTPUT($*1_ltype temp) "$1 = &temp;"; %typemap(argout) int *OUTPUT, int &OUTPUT, short *OUTPUT, short &OUTPUT, long *OUTPUT, long &OUTPUT, signed char *OUTPUT, signed char &OUTPUT, bool *OUTPUT, bool &OUTPUT { if (argvi >= items) { EXTEND(sp,1); } $result = sv_newmortal(); sv_setiv($result,(IV) *($1)); argvi++; } %typemap(argout) unsigned int *OUTPUT, unsigned int &OUTPUT, unsigned short *OUTPUT, unsigned short &OUTPUT, unsigned long *OUTPUT, unsigned long &OUTPUT, unsigned char *OUTPUT, unsigned char &OUTPUT { if (argvi >= items) { EXTEND(sp,1); } $result = sv_newmortal(); sv_setuv($result,(UV) *($1)); argvi++; } %typemap(argout) float *OUTPUT, float &OUTPUT, double *OUTPUT, double &OUTPUT { if (argvi >= items) { EXTEND(sp,1); } $result = sv_newmortal(); sv_setnv($result,(double) *($1)); argvi++; } %typemap(argout) long long *OUTPUT, long long &OUTPUT { char temp[256]; if (argvi >= items) { EXTEND(sp,1); } sprintf(temp,"%lld", (long long)*($1)); $result = sv_newmortal(); sv_setpv($result,temp); argvi++; } %typemap(argout) unsigned long long *OUTPUT, unsigned long long &OUTPUT { char temp[256]; if (argvi >= items) { EXTEND(sp,1); } sprintf(temp,"%llu", (unsigned long long)*($1)); $result = sv_newmortal(); sv_setpv($result,temp); argvi++; } // INOUT // Mappings for an argument that is both an input and output // parameter /* The following methods can be applied to make a function parameter both an input and output value. This combines the behavior of both the "INPUT" and "OUTPUT" methods described earlier. Output values are returned in the form of a Perl array. int *INOUT short *INOUT long *INOUT long long *INOUT unsigned int *INOUT unsigned short *INOUT unsigned long *INOUT unsigned long long *INOUT unsigned char *INOUT bool *INOUT float *INOUT double *INOUT For example, suppose you were trying to wrap the following function : void neg(double *x) { *x = -(*x); } You could wrap it with SWIG as follows : %include typemaps.i void neg(double *INOUT); or you can use the %apply directive : %include typemaps.i %apply double *INOUT { double *x }; void neg(double *x); Unlike C, this mapping does not directly modify the input value. Rather, the modified input value shows up as the return value of the function. Thus, to apply this function to a Perl variable you might do this : $x = neg($x); */ %typemap(in) int *INOUT = int *INPUT; %typemap(in) short *INOUT = short *INPUT; %typemap(in) long *INOUT = long *INPUT; %typemap(in) unsigned *INOUT = unsigned *INPUT; %typemap(in) unsigned short *INOUT = unsigned short *INPUT; %typemap(in) unsigned long *INOUT = unsigned long *INPUT; %typemap(in) unsigned char *INOUT = unsigned char *INPUT; %typemap(in) signed char *INOUT = signed char *INPUT; %typemap(in) bool *INOUT = bool *INPUT; %typemap(in) float *INOUT = float *INPUT; %typemap(in) double *INOUT = double *INPUT; %typemap(in) long long *INOUT = long long *INPUT; %typemap(in) unsigned long long *INOUT = unsigned long long *INPUT; %typemap(in) int &INOUT = int &INPUT; %typemap(in) short &INOUT = short &INPUT; %typemap(in) long &INOUT = long &INPUT; %typemap(in) unsigned &INOUT = unsigned &INPUT; %typemap(in) unsigned short &INOUT = unsigned short &INPUT; %typemap(in) unsigned long &INOUT = unsigned long &INPUT; %typemap(in) unsigned char &INOUT = unsigned char &INPUT; %typemap(in) signed char &INOUT = signed char &INPUT; %typemap(in) bool &INOUT = bool &INPUT; %typemap(in) float &INOUT = float &INPUT; %typemap(in) double &INOUT = double &INPUT; %typemap(in) long long &INOUT = long long &INPUT; %typemap(in) unsigned long long &INOUT = unsigned long long &INPUT; %typemap(argout) int *INOUT = int *OUTPUT; %typemap(argout) short *INOUT = short *OUTPUT; %typemap(argout) long *INOUT = long *OUTPUT; %typemap(argout) unsigned *INOUT = unsigned *OUTPUT; %typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT; %typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT; %typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT; %typemap(argout) signed char *INOUT = signed char *OUTPUT; %typemap(argout) bool *INOUT = bool *OUTPUT; %typemap(argout) float *INOUT = float *OUTPUT; %typemap(argout) double *INOUT = double *OUTPUT; %typemap(argout) long long *INOUT = long long *OUTPUT; %typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT; %typemap(argout) int &INOUT = int &OUTPUT; %typemap(argout) short &INOUT = short &OUTPUT; %typemap(argout) long &INOUT = long &OUTPUT; %typemap(argout) unsigned &INOUT = unsigned &OUTPUT; %typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT; %typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT; %typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT; %typemap(argout) signed char &INOUT = signed char &OUTPUT; %typemap(argout) bool &INOUT = bool &OUTPUT; %typemap(argout) float &INOUT = float &OUTPUT; %typemap(argout) double &INOUT = double &OUTPUT; %typemap(argout) long long &INOUT = long long &OUTPUT; %typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT; /* Overloading information */ %typemap(typecheck) double *INOUT = double; %typemap(typecheck) bool *INOUT = bool; %typemap(typecheck) signed char *INOUT = signed char; %typemap(typecheck) unsigned char *INOUT = unsigned char; %typemap(typecheck) unsigned long *INOUT = unsigned long; %typemap(typecheck) unsigned short *INOUT = unsigned short; %typemap(typecheck) unsigned int *INOUT = unsigned int; %typemap(typecheck) long *INOUT = long; %typemap(typecheck) short *INOUT = short; %typemap(typecheck) int *INOUT = int; %typemap(typecheck) float *INOUT = float; %typemap(typecheck) long long *INOUT = long long; %typemap(typecheck) unsigned long long *INOUT = unsigned long long; %typemap(typecheck) double &INOUT = double; %typemap(typecheck) bool &INOUT = bool; %typemap(typecheck) signed char &INOUT = signed char; %typemap(typecheck) unsigned char &INOUT = unsigned char; %typemap(typecheck) unsigned long &INOUT = unsigned long; %typemap(typecheck) unsigned short &INOUT = unsigned short; %typemap(typecheck) unsigned int &INOUT = unsigned int; %typemap(typecheck) long &INOUT = long; %typemap(typecheck) short &INOUT = short; %typemap(typecheck) int &INOUT = int; %typemap(typecheck) float &INOUT = float; %typemap(typecheck) long long &INOUT = long long; %typemap(typecheck) unsigned long long &INOUT = unsigned long long; #endif // -------------------------------------------------------------------- // Special types // -------------------------------------------------------------------- %include 0707010008e845000081a40000000000000000000000014caec28500000021000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/carrays.i%include 0707010008e848000081a40000000000000000000000014caec28500000096000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/perl5/cni.i%warnfilter(SWIGWARN_PARSE_KEYWORD) java::lang::ref; %{ #undef STATIC %} %include %{ #undef TRUE #define TRUE 1 %} %include 0707010008e85c000081a40000000000000000000000014caec28500000aec000000b600010002ffffffffffffffff0000003700000000root/usr/local/share/swig/2.0.1/perl5/perltypemaps.swg/* ------------------------------------------------------------ * Typemap specializations for Perl * ------------------------------------------------------------ */ /* ------------------------------------------------------------ * Fragment section * ------------------------------------------------------------ */ /* in Perl we need to pass the CPerlObj value, sometimes, so, we define the decl/call macros as needed. */ #define SWIG_AS_DECL_ARGS SWIG_PERL_DECL_ARGS_2 #define SWIG_AS_CALL_ARGS SWIG_PERL_CALL_ARGS_2 #define SWIG_FROM_DECL_ARGS SWIG_PERL_DECL_ARGS_1 #define SWIG_FROM_CALL_ARGS SWIG_PERL_CALL_ARGS_1 /* Include fundamental fragemt definitions */ %include /* Look for user fragments file. */ %include /* Perl fragments for primitive types */ %include /* Perl fragments for char* strings */ %include /* ------------------------------------------------------------ * Unified typemap section * ------------------------------------------------------------ */ /* No director supported in Perl */ #ifdef SWIG_DIRECTOR_TYPEMAPS #undef SWIG_DIRECTOR_TYPEMAPS #endif /* Perl types */ #define SWIG_Object SV * #define VOID_Object sv_newmortal() /* Perl $shadow flag */ #define %newpointer_flags $shadow #define %newinstance_flags $shadow /* Complete overload of the output/constant/exception macros */ /* output */ %define %set_output(obj) $result = obj; argvi++ %enddef /* append output */ %define %append_output(obj) if (argvi >= items) EXTEND(sp,1); %set_output(obj) %enddef /* variable output */ %define %set_varoutput(obj) sv_setsv($result,obj) %enddef /* constant */ %define %set_constant(name, obj) %begin_block SV *sv = get_sv((char*) SWIG_prefix name, TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, obj); SvREADONLY_on(sv); %end_block %enddef /* raise exception */ %define %raise(obj, type, desc) sv_setsv(GvSV(PL_errgv), obj); SWIG_fail %enddef /* Include the unified typemap library */ %include /* ------------------------------------------------------------ * Perl extra typemaps / typemap overrides * ------------------------------------------------------------ */ %typemap(varout,type="$1_descriptor") SWIGTYPE *, SWIGTYPE [] "sv_setiv(SvRV($result),PTR2IV($1));"; %typemap(varout,type="$1_descriptor") SWIGTYPE & "sv_setiv(SvRV($result),PTR2IV(&$1));"; %typemap(varout,type="$&1_descriptor") SWIGTYPE "sv_setiv(SvRV($result), PTR2IV(&$1));"; %typemap(varout,type="$1_descriptor") SWIGTYPE (CLASS::*) { SWIG_MakePackedObj($result, (void *) &$1, sizeof($1_type), $1_descriptor); } %typemap(varout) SWIGTYPE *const = SWIGTYPE *; 0707010008e866000081a40000000000000000000000014caec285000057d9000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/perl5/std_vector.i/* ----------------------------------------------------------------------------- * std_vector.i * * SWIG typemaps for std::vector types * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::vector // // The aim of all that follows would be to integrate std::vector with // Perl as much as possible, namely, to allow the user to pass and // be returned Perl arrays. // const declarations are used to guess the intent of the function being // exported; therefore, the following rationale is applied: // // -- f(std::vector), f(const std::vector&), f(const std::vector*): // the parameter being read-only, either a Perl sequence or a // previously wrapped std::vector can be passed. // -- f(std::vector&), f(std::vector*): // the parameter must be modified; therefore, only a wrapped std::vector // can be passed. // -- std::vector f(): // the vector is returned by copy; therefore, a Perl sequence of T:s // is returned which is most easily used in other Perl functions // -- std::vector& f(), std::vector* f(), const std::vector& f(), // const std::vector* f(): // the vector is returned by reference; therefore, a wrapped std::vector // is returned // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class vector { %typemap(in) vector (std::vector* v) { if (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,1) != -1) { $1 = *v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; T* obj; for (int i=0; i& (std::vector temp, std::vector* v), const vector* (std::vector temp, std::vector* v) { if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,1) != -1) { $1 = v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; T* obj; for (int i=0; i { size_t len = $1.size(); SV **svs = new SV*[len]; for (size_t i=0; i { { /* wrapped vector? */ std::vector* v; if (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* obj; SV **tv = av_fetch(av, 0, 0); if (SWIG_ConvertPtr(*tv, (void **)&obj, $descriptor(T *),0) != -1) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, const vector* { { /* wrapped vector? */ std::vector* v; if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* obj; SV **tv = av_fetch(av, 0, 0); if (SWIG_ConvertPtr(*tv, (void **)&obj, $descriptor(T *),0) != -1) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } public: vector(unsigned int size = 0); vector(unsigned int size, const T& value); vector(const vector &); unsigned int size() const; bool empty() const; void clear(); %rename(push) push_back; void push_back(const T& x); %extend { T pop() throw (std::out_of_range) { if (self->size() == 0) throw std::out_of_range("pop from empty vector"); T x = self->back(); self->pop_back(); return x; } T& get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i class vector { %typemap(in) vector (std::vector* v) { int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); if (SWIG_IsOK(res)){ $1 = *v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); I32 len = av_len(av) + 1; for (int i=0; i& (std::vector temp,std::vector* v), const vector* (std::vector temp,std::vector* v) { int res = SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0); if (SWIG_IsOK(res)) { $1 = v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); I32 len = av_len(av) + 1; for (int i=0; i { size_t len = $1.size(); SV **svs = new SV*[len]; for (size_t i=0; i { { /* wrapped vector? */ std::vector* v; int res = SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0); if (SWIG_IsOK(res)) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ void *v; SV **tv = av_fetch(av, 0, 0); int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); if (SWIG_IsOK(res)) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } %typecheck(SWIG_TYPECHECK_VECTOR) const vector&,const vector* { { /* wrapped vector? */ std::vector *v; int res = SWIG_ConvertPtr($input,%as_voidptrptr(&v), $1_descriptor,0); if (SWIG_IsOK(res)) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ void *v; SV **tv = av_fetch(av, 0, 0); int res = SWIG_ConvertPtr(*tv, &v, $descriptor(T *),0); if (SWIG_IsOK(res)) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } public: vector(unsigned int size = 0); vector(unsigned int size, T *value); vector(const vector &); unsigned int size() const; bool empty() const; void clear(); %rename(push) push_back; void push_back(T *x); %extend { T *pop() throw (std::out_of_range) { if (self->size() == 0) throw std::out_of_range("pop from empty vector"); T *x = self->back(); self->pop_back(); return x; } T *get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i class vector { %typemap(in) vector (std::vector* v) { if (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,1) != -1){ $1 = *v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; for (int i=0; i& (std::vector temp, std::vector* v), const vector* (std::vector temp, std::vector* v) { if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,1) != -1) { $1 = v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; for (int i=0; i { size_t len = $1.size(); SV **svs = new SV*[len]; for (size_t i=0; i { { /* wrapped vector? */ std::vector* v; if (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ SV **tv = av_fetch(av, 0, 0); if (CHECK_T(*tv)) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, const vector* { { /* wrapped vector? */ std::vector* v; if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ SV **tv = av_fetch(av, 0, 0); if (CHECK_T(*tv)) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } public: vector(unsigned int size = 0); vector(unsigned int size, T value); vector(const vector &); unsigned int size() const; bool empty() const; void clear(); %rename(push) push_back; void push_back(T x); %extend { T pop() throw (std::out_of_range) { if (self->size() == 0) throw std::out_of_range("pop from empty vector"); T x = self->back(); self->pop_back(); return x; } T get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i %include %include %include %include 0707010008e862000081a40000000000000000000000014caec28500003745000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/perl5/std_list.i/* ----------------------------------------------------------------------------- * std_list.i * * SWIG typemaps for std::list types * ----------------------------------------------------------------------------- */ %include %include // containers // ------------------------------------------------------------------------ // std::list // // The aim of all that follows would be to integrate std::list with // Perl as much as possible, namely, to allow the user to pass and // be returned Perl arrays. // const declarations are used to guess the intent of the function being // exported; therefore, the following rationale is applied: // // -- f(std::list), f(const std::list&), f(const std::list*): // the parameter being read-only, either a Perl sequence or a // previously wrapped std::list can be passed. // -- f(std::list&), f(std::list*): // the parameter must be modified; therefore, only a wrapped std::list // can be passed. // -- std::list f(): // the list is returned by copy; therefore, a Perl sequence of T:s // is returned which is most easily used in other Perl functions // -- std::list& f(), std::list* f(), const std::list& f(), // const std::list* f(): // the list is returned by reference; therefore, a wrapped std::list // is returned // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class list { %typemap(in) list (std::list* v) { if (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,1) != -1) { $1 = *v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; T* obj; for (int i=0; i& (std::list temp, std::list* v), const list* (std::list temp, std::list* v) { if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,1) != -1) { $1 = v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; T* obj; for (int i=0; i { std::list::const_iterator i; unsigned int j; int len = $1.size(); SV **svs = new SV*[len]; for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { T* ptr = new T(*i); svs[j] = sv_newmortal(); SWIG_MakePtr(svs[j], (void*) ptr, $descriptor(T *), $shadow|$owner); } AV *myav = av_make(len, svs); delete[] svs; $result = newRV_noinc((SV*) myav); sv_2mortal($result); argvi++; } %typecheck(SWIG_TYPECHECK_LIST) list { { /* wrapped list? */ std::list* v; if (SWIG_ConvertPtr($input,(void **) &v, $1_&descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { SV **tv; I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* obj; tv = av_fetch(av, 0, 0); if (SWIG_ConvertPtr(*tv, (void **)&obj, $descriptor(T *),0) != -1) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } %typecheck(SWIG_TYPECHECK_LIST) const list&, const list* { { /* wrapped list? */ std::list* v; if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { SV **tv; I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* obj; tv = av_fetch(av, 0, 0); if (SWIG_ConvertPtr(*tv, (void **)&obj, $descriptor(T *),0) != -1) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } public: list(); list(const list &); unsigned int size() const; bool empty() const; void clear(); %rename(push) push_back; void push_back(const T& x); }; // specializations for built-ins %define specialize_std_list(T,CHECK_T,TO_T,FROM_T) template<> class list { %typemap(in) list (std::list* v) { if (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor,1) != -1){ $1 = *v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; for (int i=0; i& (std::list temp, std::list* v), const list* (std::list temp, std::list* v) { if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,1) != -1) { $1 = v; } else if (SvROK($input)) { AV *av = (AV *)SvRV($input); if (SvTYPE(av) != SVt_PVAV) SWIG_croak("Type error in argument $argnum of $symname. " "Expected an array of " #T); SV **tv; I32 len = av_len(av) + 1; T* obj; for (int i=0; i { std::list::const_iterator i; unsigned int j; int len = $1.size(); SV **svs = new SV*[len]; for (i=$1.begin(), j=0; i!=$1.end(); i++, j++) { svs[j] = sv_newmortal(); FROM_T(svs[j], *i); } AV *myav = av_make(len, svs); delete[] svs; $result = newRV_noinc((SV*) myav); sv_2mortal($result); argvi++; } %typecheck(SWIG_TYPECHECK_LIST) list { { /* wrapped list? */ std::list* v; if (SWIG_ConvertPtr($input,(void **) &v, $1_&descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { SV **tv; I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ tv = av_fetch(av, 0, 0); if (CHECK_T(*tv)) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } %typecheck(SWIG_TYPECHECK_LIST) const list&, const list* { { /* wrapped list? */ std::list* v; if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor,0) != -1) { $1 = 1; } else if (SvROK($input)) { /* native sequence? */ AV *av = (AV *)SvRV($input); if (SvTYPE(av) == SVt_PVAV) { SV **tv; I32 len = av_len(av) + 1; if (len == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ tv = av_fetch(av, 0, 0); if (CHECK_T(*tv)) $1 = 1; else $1 = 0; } } } else { $1 = 0; } } } public: list(); list(const list &); unsigned int size() const; bool empty() const; void clear(); %rename(push) push_back; void push_back(T x); }; %enddef specialize_std_list(bool,SvIOK,SvIVX,sv_setiv); specialize_std_list(char,SvIOK,SvIVX,sv_setiv); specialize_std_list(int,SvIOK,SvIVX,sv_setiv); specialize_std_list(short,SvIOK,SvIVX,sv_setiv); specialize_std_list(long,SvIOK,SvIVX,sv_setiv); specialize_std_list(unsigned char,SvIOK,SvIVX,sv_setiv); specialize_std_list(unsigned int,SvIOK,SvIVX,sv_setiv); specialize_std_list(unsigned short,SvIOK,SvIVX,sv_setiv); specialize_std_list(unsigned long,SvIOK,SvIVX,sv_setiv); specialize_std_list(float,SvNIOK,SwigSvToNumber,sv_setnv); specialize_std_list(double,SvNIOK,SwigSvToNumber,sv_setnv); specialize_std_list(std::string,SvPOK,SvPVX,SwigSvFromString); } 0707010008e863000081a40000000000000000000000014caec28500000899000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/std_map.i/* ----------------------------------------------------------------------------- * std_map.i * * SWIG typemaps for std::map * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::map // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class map { // add typemaps here public: map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { const T& get(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void set(const K& key, const T& x) { (*self)[key] = x; } void del(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(const K& key) { std::map::iterator i = self->find(key); return i != self->end(); } } }; // Legacy macros (deprecated) %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_key ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) #warning "specialize_std_map_on_value ignored - macro is deprecated and no longer necessary" %enddef %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) #warning "specialize_std_map_on_both ignored - macro is deprecated and no longer necessary" %enddef } 0707010008e84e000081a40000000000000000000000014caec28500000583000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/noembed.h/* Workaround perl5 global namespace pollution. Note that undefining library * functions like fopen will not solve the problem on all platforms as fopen * might be a macro on Windows but not necessarily on other operating systems. */ #ifdef do_open #undef do_open #endif #ifdef do_close #undef do_close #endif #ifdef do_exec #undef do_exec #endif #ifdef scalar #undef scalar #endif #ifdef list #undef list #endif #ifdef apply #undef apply #endif #ifdef convert #undef convert #endif #ifdef Error #undef Error #endif #ifdef form #undef form #endif #ifdef vform #undef vform #endif #ifdef LABEL #undef LABEL #endif #ifdef METHOD #undef METHOD #endif #ifdef Move #undef Move #endif #ifdef yylex #undef yylex #endif #ifdef yyparse #undef yyparse #endif #ifdef yyerror #undef yyerror #endif #ifdef invert #undef invert #endif #ifdef ref #undef ref #endif #ifdef read #undef read #endif #ifdef write #undef write #endif #ifdef eof #undef eof #endif #ifdef bool #undef bool #endif #ifdef close #undef close #endif #ifdef rewind #undef rewind #endif #ifdef free #undef free #endif #ifdef malloc #undef malloc #endif #ifdef calloc #undef calloc #endif #ifdef Stat #undef Stat #endif #ifdef check #undef check #endif #ifdef seekdir #undef seekdir #endif #ifdef open #undef open #endif #ifdef readdir #undef readdir #endif #ifdef bind #undef bind #endif 0707010008e853000081a40000000000000000000000014caec28500000719000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/perl5/perlinit.swg /* Export the SWIG initialization function */ %header %{ #ifdef __cplusplus extern "C" #endif #ifndef PERL_OBJECT #ifndef MULTIPLICITY SWIGEXPORT void SWIG_init (CV* cv); #else SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); #endif #else SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); #endif %} /* Module initialization function */ %insert(init) "swiginit.swg" %init %{ #ifdef __cplusplus extern "C" #endif XS(SWIG_init) { dXSARGS; int i; SWIG_InitializeModule(0); /* Install commands */ for (i = 0; swig_commands[i].name; i++) { newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); } /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { sv_setiv(sv,(IV) 0); } swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); } /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); break; case SWIG_FLOAT: sv_setnv(sv, (double) swig_constants[i].dvalue); break; case SWIG_STRING: sv_setpv(sv, (char *) swig_constants[i].pvalue); break; case SWIG_POINTER: SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); break; case SWIG_BINARY: SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); break; default: break; } SvREADONLY_on(sv); } %} 0707010008e843000081a40000000000000000000000014caec285000002b3000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/perl5/Makefile.pl# File : Makefile.pl # MakeMaker file for a SWIG module. Use this file if you are # producing a module for general use or distribution. # # 1. Modify the file as appropriate. Replace $module with the # real name of your module and wrapper file. # 2. Run perl as 'perl Makefile.pl' # 3. Type 'make' to build your module # 4. Type 'make install' to install your module. # # See "Programming Perl", 2nd. Ed, for more gory details than # you ever wanted to know. use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => '$module', # Name of your module 'LIBS' => [''], # Custom libraries (if any) 'OBJECT' => '$module_wrap.o' # Object files ); 0707010008e858000081a40000000000000000000000014caec28500001c0e000000b600010002ffffffffffffffff0000003800000000root/usr/local/share/swig/2.0.1/perl5/perlprimtypes.swg/* ------------------------------------------------------------ * Primitive Types * ------------------------------------------------------------ */ /* bool */ %fragment(SWIG_From_frag(bool),"header") { SWIGINTERNINLINE SV * SWIG_From_dec(bool)(bool value) { SV *obj = sv_newmortal(); if (value) { sv_setsv(obj, &PL_sv_yes); } else { sv_setsv(obj, &PL_sv_no); } return obj; } } %fragment(SWIG_AsVal_frag(bool),"header", fragment="SWIG_CanCastAsInteger") { SWIGINTERN int SWIG_AsVal_dec(bool)(SV *obj, bool* val) { if (obj == &PL_sv_yes) { if (val) *val = true; return SWIG_OK; } else if (obj == &PL_sv_no) { if (val) *val = false; return SWIG_OK; } else { if (val) *val = SvTRUE(obj) ? true: false; return SWIG_AddCast(SWIG_OK); } return SWIG_TypeError; } } /* long */ %fragment(SWIG_From_frag(long),"header") { SWIGINTERNINLINE SV * SWIG_From_dec(long)(long value) { SV *obj = sv_newmortal(); sv_setiv(obj, (IV) value); return obj; } } %fragment(SWIG_AsVal_frag(long),"header", fragment="SWIG_CanCastAsInteger") { SWIGINTERN int SWIG_AsVal_dec(long)(SV *obj, long* val) { if (SvIOK(obj)) { if (val) *val = SvIV(obj); return SWIG_OK; } else { int dispatch = 0; const char *nptr = SvPV_nolen(obj); if (nptr) { char *endptr; long v; errno = 0; v = strtol(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; return SWIG_OverflowError; } else { if (*endptr == '\0') { if (val) *val = v; return SWIG_Str2NumCast(SWIG_OK); } } } if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { if (val) *val = (long)(d); return res; } } } return SWIG_TypeError; } } /* unsigned long */ %fragment(SWIG_From_frag(unsigned long),"header", fragment=SWIG_AsVal_frag(double)) { SWIGINTERNINLINE SV * SWIG_From_dec(unsigned long)(unsigned long value) { SV *obj = sv_newmortal(); sv_setuv(obj, (UV) value); return obj; } } %fragment(SWIG_AsVal_frag(unsigned long),"header", fragment="SWIG_CanCastAsInteger") { SWIGINTERN int SWIG_AsVal_dec(unsigned long)(SV *obj, unsigned long *val) { if (SvUOK(obj)) { if (val) *val = SvUV(obj); return SWIG_OK; } else if (SvIOK(obj)) { long v = SvIV(obj); if (v >= 0) { if (val) *val = v; return SWIG_OK; } else { return SWIG_OverflowError; } } else { int dispatch = 0; const char *nptr = SvPV_nolen(obj); if (nptr) { char *endptr; unsigned long v; errno = 0; v = strtoul(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; return SWIG_OverflowError; } else { if (*endptr == '\0') { if (val) *val = v; return SWIG_Str2NumCast(SWIG_OK); } } } if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { if (val) *val = (unsigned long)(d); return res; } } } return SWIG_TypeError; } } /* long long */ %fragment(SWIG_From_frag(long long),"header", fragment=SWIG_From_frag(long), fragment="", fragment="") { SWIGINTERNINLINE SV * SWIG_From_dec(long long)(long long value) { if (((long long) LONG_MIN <= value) && (value <= (long long) LONG_MAX)) { return SWIG_From(long)(%numeric_cast(value,long)); } else { char temp[256]; SV *obj = sv_newmortal(); sprintf(temp, "%lld", value); sv_setpv(obj, temp); return obj; } } } %fragment(SWIG_AsVal_frag(long long),"header", fragment="", fragment="", fragment="SWIG_CanCastAsInteger") { SWIGINTERN int SWIG_AsVal_dec(long long)(SV *obj, long long *val) { if (SvIOK(obj)) { if (val) *val = SvIV(obj); return SWIG_OK; } else { int dispatch = 0; const char *nptr = SvPV_nolen(obj); if (nptr) { char *endptr; long long v; errno = 0; v = strtoll(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; return SWIG_OverflowError; } else { if (*endptr == '\0') { if (val) *val = v; return SWIG_Str2NumCast(SWIG_OK); } } } if (!dispatch) { const double mant_max = 1LL << DBL_MANT_DIG; const double mant_min = -mant_max; double d; int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { if (val) *val = (long long)(d); return res; } } } return SWIG_TypeError; } } /* unsigned long long */ %fragment(SWIG_From_frag(unsigned long long),"header", fragment=SWIG_From_frag(long long), fragment="", fragment="") { SWIGINTERNINLINE SV * SWIG_From_dec(unsigned long long)(unsigned long long value) { if (value < (unsigned long long) LONG_MAX) { return SWIG_From(long long)(%numeric_cast(value, long long)); } else { char temp[256]; SV *obj = sv_newmortal(); sprintf(temp, "%llu", value); sv_setpv(obj, temp); return obj; } } } %fragment(SWIG_AsVal_frag(unsigned long long),"header", fragment="", fragment="", fragment="SWIG_CanCastAsInteger") { SWIGINTERN int SWIG_AsVal_dec(unsigned long long)(SV *obj, unsigned long long *val) { if (SvUOK(obj)) { if (val) *val = SvUV(obj); return SWIG_OK; } else if (SvIOK(obj)) { long v = SvIV(obj); if (v >= 0) { if (val) *val = v; return SWIG_OK; } else { return SWIG_OverflowError; } } else { int dispatch = 0; const char *nptr = SvPV_nolen(obj); if (nptr) { char *endptr; unsigned long long v; errno = 0; v = strtoull(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; return SWIG_OverflowError; } else { if (*endptr == '\0') { if (val) *val = v; return SWIG_Str2NumCast(SWIG_OK); } } } if (!dispatch) { const double mant_max = 1LL << DBL_MANT_DIG; double d; int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { if (val) *val = (unsigned long long)(d); return res; } } } return SWIG_TypeError; } } /* double */ %fragment(SWIG_From_frag(double),"header") { SWIGINTERNINLINE SV * SWIG_From_dec(double)(double value) { SV *obj = sv_newmortal(); sv_setnv(obj, value); return obj; } } %fragment(SWIG_AsVal_frag(double),"header") { SWIGINTERN int SWIG_AsVal_dec(double)(SV *obj, double *val) { if (SvNIOK(obj)) { if (val) *val = SvNV(obj); return SWIG_OK; } else if (SvIOK(obj)) { if (val) *val = (double) SvIV(obj); return SWIG_AddCast(SWIG_OK); } else { const char *nptr = SvPV_nolen(obj); if (nptr) { char *endptr; double v; errno = 0; v = strtod(nptr, &endptr); if (errno == ERANGE) { errno = 0; return SWIG_OverflowError; } else { if (*endptr == '\0') { if (val) *val = v; return SWIG_Str2NumCast(SWIG_OK); } } } } return SWIG_TypeError; } } 0707010008e864000081a40000000000000000000000014caec285000002bf000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/perl5/std_pair.i/* ----------------------------------------------------------------------------- * std_pair.i * * SWIG typemaps for std::pair * ----------------------------------------------------------------------------- */ %include %include // ------------------------------------------------------------------------ // std::pair // ------------------------------------------------------------------------ %{ #include %} namespace std { template struct pair { pair(); pair(T t, U u); pair(const pair& p); template pair(const pair &p); T first; U second; }; // add specializations here } 0707010008e84c000081a40000000000000000000000014caec28500000020000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/factory.i%include 0707010008e85a000081a40000000000000000000000014caec28500000146000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/perl5/perlruntime.swg %runtime "swigrun.swg" // Common C API type-checking code %runtime "swigerrors.swg" // SWIG errors %runtime "perlhead.swg" // Perl includes and fixes %runtime "perlerrors.swg" // Perl errors %runtime "perlrun.swg" // Perl runtime functions %runtime "noembed.h" // undefine Perl5 macros 0707010008e854000081a40000000000000000000000014caec28500000f1e000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/perl5/perlkw.swg/* Warnings for Perl keywords */ #define PERLKW(x) %keywordwarn("'" `x` "' is a perl keyword") `x` #define PERLBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in perl") "::" `x` /* From http://www.rocketaware.com/perl/perlfunc/ */ /* Functions for SCALARs or strings*/ PERLBN(chomp); PERLBN(chop); PERLBN(chr); PERLBN(crypt); PERLBN(hex); PERLBN(index); PERLBN(lc); PERLBN(lcfirst); PERLBN(length); PERLBN(oct); PERLBN(ord); PERLBN(pack); PERLBN(reverse); PERLBN(rindex); PERLBN(sprintf); PERLBN(substr); PERLBN(uc); PERLBN(ucfirst); /* Regular expressions and pattern matching */ PERLBN(m); PERLBN(pos); PERLBN(quotemeta); PERLBN(split); PERLBN(study); /* Numeric functions */ PERLBN(abs); PERLBN(atan2); PERLBN(cos); PERLBN(exp); PERLBN(hex); PERLBN(int); PERLBN(log); PERLBN(oct); PERLBN(rand); PERLBN(sin); PERLBN(sqrt); PERLBN(srand); /* Functions for real @ARRAYs*/ PERLBN(pop); PERLBN(push); PERLBN(shift); PERLBN(splice); PERLBN(unshift); /* Functions for list data*/ PERLBN(grep); PERLBN(join); PERLBN(map); PERLBN(qw); PERLBN(reverse); PERLBN(sort); PERLBN(unpack); /* Functions for real %HASHes*/ PERLBN(delete); PERLBN(each); PERLBN(exists); PERLBN(keys); PERLBN(values); /* Input and output functions*/ PERLBN(binmode); PERLBN(close); PERLBN(closedir); PERLBN(dbmclose); PERLBN(dbmopen); PERLBN(die); PERLBN(eof); PERLBN(fileno); PERLBN(flock); PERLBN(format); PERLBN(getc); PERLBN(print); PERLBN(printf); PERLBN(read); PERLBN(readdir); PERLBN(rewinddir); PERLBN(seek); PERLBN(seekdir); PERLBN(select); PERLBN(syscall); PERLBN(sysread); PERLBN(sysseek); PERLBN(syswrite); PERLBN(tell); PERLBN(telldir); PERLBN(truncate); PERLBN(warn); PERLBN(write); /* Functions for fixed length data or records*/ PERLBN(pack); PERLBN(read); PERLBN(syscall); PERLBN(sysread); PERLBN(syswrite); PERLBN(unpack); PERLBN(vec); /* Functions for filehandles, files, or directories */ PERLBN(chdir); PERLBN(chmod); PERLBN(chown); PERLBN(chroot); PERLBN(fcntl); PERLBN(glob); PERLBN(ioctl); PERLBN(link); PERLBN(lstat); PERLBN(mkdir); PERLBN(open); PERLBN(opendir); PERLBN(readlink); PERLBN(rename); PERLBN(rmdir); PERLBN(stat); PERLBN(symlink); PERLBN(umask); PERLBN(unlink); PERLBN(utime); /* Keywords related to the control flow of your perl program */ PERLKW(caller); PERLKW(continue); PERLKW(die); PERLKW(do); PERLKW(dump); PERLKW(eval); PERLKW(exit); PERLKW(goto); PERLKW(last); PERLKW(next); PERLKW(redo); PERLKW(return); PERLKW(sub); PERLKW(wantarray); /* Keywords related to scoping */ PERLKW(caller); PERLKW(import); PERLKW(local); PERLKW(my); PERLKW(package); PERLKW(use); /* Miscellaneous functions */ PERLBN("defined"); PERLBN(dump); PERLBN(eval); PERLBN(formline); PERLBN(local); PERLBN(my); PERLBN(reset); PERLBN(scalar); PERLBN(undef); PERLBN(wantarray); /* Functions for processes and process groups */ PERLBN(alarm); PERLBN(exec); PERLBN(fork); PERLBN(getpgrp); PERLBN(getppid); PERLBN(getpriority); PERLBN(kill); PERLBN(pipe); PERLBN(setpgrp); PERLBN(setpriority); PERLBN(sleep); PERLBN(system); PERLBN(times); PERLBN(wait); PERLBN(waitpid); /* Keywords related to perl modules */ PERLKW(do); PERLKW(import); PERLKW(no); PERLKW(package); PERLKW(require); PERLKW(use); /* Keywords related to classes and object-orientedness */ PERLKW(bless); PERLKW(dbmclose); PERLKW(dbmopen); PERLKW(package); PERLKW(ref); PERLKW(tie); PERLKW(tied); PERLKW(untie); PERLKW(use); /* Functions new in perl5 */ PERLBN(abs); PERLBN(bless); PERLBN(chomp); PERLBN(chr); PERLBN(exists); PERLBN(formline); PERLBN(glob); PERLBN(import); PERLBN(lc); PERLBN(lcfirst); PERLBN(map); PERLBN(my); PERLBN(no); PERLBN(prototype); PERLBN(qx); PERLBN(qw); PERLBN(readline); PERLBN(readpipe); PERLBN(ref); PERLBN(sub); PERLBN(sysopen); PERLBN(tie); PERLBN(tied); PERLBN(uc); PERLBN(ucfirst); PERLBN(untie); PERLBN(use); #undef PERLKW #undef PERLBN 0707010008e85b000081a40000000000000000000000014caec28500000591000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/perl5/perlstrings.swg/* ------------------------------------------------------------ * utility methods for char strings * ------------------------------------------------------------ */ %fragment("SWIG_AsCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { SWIGINTERN int SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) { if (SvMAGICAL(obj)) { SV *tmp = sv_newmortal(); SvSetSV(tmp, obj); obj = tmp; } if (SvPOK(obj)) { STRLEN len = 0; char *cstr = SvPV(obj, len); size_t size = len + 1; if (cptr) { if (alloc) { if (*alloc == SWIG_NEWOBJ) { *cptr = %new_copy_array(cstr, size, char); } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; } } } if (psize) *psize = size; return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); if (pchar_descriptor) { char* vptr = 0; if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { if (cptr) *cptr = vptr; if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; if (alloc) *alloc = SWIG_OLDOBJ; return SWIG_OK; } } } return SWIG_TypeError; } } %fragment("SWIG_FromCharPtrAndSize","header") { SWIGINTERNINLINE SV * SWIG_FromCharPtrAndSize(const char* carray, size_t size) { SV *obj = sv_newmortal(); if (carray) { sv_setpvn(obj, carray, size); } else { sv_setsv(obj, &PL_sv_undef); } return obj; } } 0707010008e85e000081a40000000000000000000000014caec28500001c3e000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/perl5/reference.i/* ----------------------------------------------------------------------------- * reference.i * * Accept Perl references as pointers * ----------------------------------------------------------------------------- */ /* The following methods make Perl references work like simple C pointers. References can only be used for simple input/output values, not C arrays however. It should also be noted that REFERENCES are specific to Perl and not supported in other scripting languages at this time. int *REFERENCE short *REFERENCE long *REFERENCE unsigned int *REFERENCE unsigned short *REFERENCE unsigned long *REFERENCE unsigned char *REFERENCE float *REFERENCE double *REFERENCE For example, suppose you were trying to wrap the following function : void neg(double *x) { *x = -(*x); } You could wrap it with SWIG as follows : %include reference.i void neg(double *REFERENCE); or you can use the %apply directive : %include reference.i %apply double *REFERENCE { double *x }; void neg(double *x); Unlike the INOUT mapping described in typemaps.i, this approach directly modifies the value of a Perl reference. Thus, you could use it as follows : $x = 3; neg(\$x); print "$x\n"; # Should print out -3. */ %typemap(in) double *REFERENCE (double dvalue), double &REFERENCE(double dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { printf("Received %d\n", SvTYPE(tempsv)); SWIG_croak("Expected a double reference."); } dvalue = SvNV(tempsv); $1 = &dvalue; } %typemap(in) float *REFERENCE (float dvalue), float &REFERENCE(float dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { SWIG_croak("expected a double reference"); } dvalue = (float) SvNV(tempsv); $1 = &dvalue; } %typemap(in) int *REFERENCE (int dvalue), int &REFERENCE (int dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = SvIV(tempsv); $1 = &dvalue; } %typemap(in) short *REFERENCE (short dvalue), short &REFERENCE(short dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (short) SvIV(tempsv); $1 = &dvalue; } %typemap(in) long *REFERENCE (long dvalue), long &REFERENCE(long dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (long) SvIV(tempsv); $1 = &dvalue; } %typemap(in) unsigned int *REFERENCE (unsigned int dvalue), unsigned int &REFERENCE(unsigned int dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (unsigned int) SvUV(tempsv); $1 = &dvalue; } %typemap(in) unsigned short *REFERENCE (unsigned short dvalue), unsigned short &REFERENCE(unsigned short dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (unsigned short) SvUV(tempsv); $1 = &dvalue; } %typemap(in) unsigned long *REFERENCE (unsigned long dvalue), unsigned long &REFERENCE(unsigned long dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (unsigned long) SvUV(tempsv); $1 = &dvalue; } %typemap(in) unsigned char *REFERENCE (unsigned char dvalue), unsigned char &REFERENCE(unsigned char dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (unsigned char) SvUV(tempsv); $1 = &dvalue; } %typemap(in) signed char *REFERENCE (signed char dvalue), signed char &REFERENCE(signed char dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (signed char) SvIV(tempsv); $1 = &dvalue; } %typemap(in) bool *REFERENCE (bool dvalue), bool &REFERENCE(bool dvalue) { SV *tempsv; if (!SvROK($input)) { SWIG_croak("expected a reference"); } tempsv = SvRV($input); if (!SvIOK(tempsv)) { SWIG_croak("expected a integer reference"); } dvalue = (bool) SvIV(tempsv); $1 = &dvalue; } %typemap(typecheck) int *REFERENCE, int &REFERENCE, short *REFERENCE, short &REFERENCE, long *REFERENCE, long &REFERENCE, signed char *REFERENCE, signed char &REFERENCE, bool *REFERENCE, bool &REFERENCE { $1 = SvROK($input) && SvIOK(SvRV($input)); } %typemap(typecheck) double *REFERENCE, double &REFERENCE, float *REFERENCE, float &REFERENCE { $1 = SvROK($input); if($1) { SV *tmpsv = SvRV($input); $1 = SvNOK(tmpsv) || SvIOK(tmpsv); } } %typemap(typecheck) unsigned int *REFERENCE, unsigned int &REFERENCE, unsigned short *REFERENCE, unsigned short &REFERENCE, unsigned long *REFERENCE, unsigned long &REFERENCE, unsigned char *REFERENCE, unsigned char &REFERENCE { $1 = SvROK($input); if($1) { SV *tmpsv = SvRV($input); $1 = SvUOK(tmpsv) || SvIOK(tmpsv); } } %typemap(argout) double *REFERENCE, double &REFERENCE, float *REFERENCE, float &REFERENCE { SV *tempsv; tempsv = SvRV($arg); if (!$1) SWIG_croak("expected a reference"); sv_setnv(tempsv, (double) *$1); } %typemap(argout) int *REFERENCE, int &REFERENCE, short *REFERENCE, short &REFERENCE, long *REFERENCE, long &REFERENCE, signed char *REFERENCE, signed char &REFERENCE, bool *REFERENCE, bool &REFERENCE { SV *tempsv; tempsv = SvRV($input); if (!$1) SWIG_croak("expected a reference"); sv_setiv(tempsv, (IV) *$1); } %typemap(argout) unsigned int *REFERENCE, unsigned int &REFERENCE, unsigned short *REFERENCE, unsigned short &REFERENCE, unsigned long *REFERENCE, unsigned long &REFERENCE, unsigned char *REFERENCE, unsigned char &REFERENCE { SV *tempsv; tempsv = SvRV($input); if (!$1) SWIG_croak("expected a reference"); sv_setuv(tempsv, (UV) *$1); } 0707010008e865000081a40000000000000000000000014caec2850000003e000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/perl5/std_string.i%include %include 0707010008e847000081a40000000000000000000000014caec28500000020000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/perl5/cmalloc.i%include 0707010008e85d000081a40000000000000000000000014caec28500000024000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/perl5/perluserdir.swg#define %perlcode %insert("perl") 0707010008e861000081a40000000000000000000000014caec28500000023000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/perl5/std_except.i%include 0707010008e856000081a40000000000000000000000014caec285000007c2000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/perl5/perlmain.i/* ----------------------------------------------------------------------------- * perlmain.i * * Code to statically rebuild perl5. * ----------------------------------------------------------------------------- */ #ifdef AUTODOC %subsection "perlmain.i" %text %{ This module provides support for building a new version of the Perl executable. This will be necessary on systems that do not support shared libraries and may be necessary with C++ extensions. This module may only build a stripped down version of the Perl executable. Thus, it may be necessary (or desirable) to hand-edit this file for your particular application. To do this, simply copy this file from swig_lib/perl5/perlmain.i to your working directory and make the appropriate modifications. This library file works with Perl 5.003. It may work with earlier versions, but it hasn't been tested. As far as I know, this library is C++ safe. %} #endif %{ static void xs_init _((pTHX)); static PerlInterpreter *my_perl; int perl_eval(char *string) { char *argv[2]; argv[0] = string; argv[1] = (char *) 0; return perl_call_argv("eval",0,argv); } int main(int argc, char **argv, char **env) { int exitstatus; my_perl = perl_alloc(); if (!my_perl) exit(1); perl_construct( my_perl ); exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL ); if (exitstatus) exit( exitstatus ); /* Initialize all of the module variables */ exitstatus = perl_run( my_perl ); perl_destruct( my_perl ); perl_free( my_perl ); exit( exitstatus ); } /* Register any extra external extensions */ /* Do not delete this line--writemain depends on it */ /* EXTERN_C void boot_DynaLoader _((CV* cv)); */ static void xs_init(pTHX) { /* dXSUB_SYS; */ char *file = __FILE__; { /* newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); */ newXS(SWIG_name, SWIG_init, file); #ifdef SWIGMODINIT SWIGMODINIT #endif } } %} 0707010008e87c000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002500000000root/usr/local/share/swig/2.0.1/pike0707010008e880000081a40000000000000000000000014caec28800000655000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/pike/std_string.i/* ----------------------------------------------------------------------------- * std_string.i * * SWIG typemaps for std::string * ----------------------------------------------------------------------------- */ %{ #include %} namespace std { %naturalvar string; class string; /* Overloading check */ %typemap(typecheck) string = char *; %typemap(typecheck) const string & = char *; %typemap(in, pikedesc="tStr") string { if ($input.type != T_STRING) Pike_error("Bad argument: Expected a string.\n"); $1.assign(STR0($input.u.string)); } %typemap(in, pikedesc="tStr") const string & (std::string temp) { if ($input.type != T_STRING) Pike_error("Bad argument: Expected a string.\n"); temp.assign(STR0($input.u.string)); $1 = &temp; } %typemap(out, pikedesc="tStr") string "push_text($1.c_str());"; %typemap(out, pikedesc="tStr") const string & "push_text($1->c_str());"; %typemap(directorin) string, const string &, string & "$1_name.c_str()"; %typemap(directorin) string *, const string * "$1_name->c_str()"; %typemap(directorout) string { if ($input.type == T_STRING) $result.assign(STR0($input.u.string)); else throw Swig::DirectorTypeMismatchException("string expected"); } %typemap(directorout) const string & (std::string temp) { if ($input.type == T_STRING) { temp.assign(STR0($input.u.string)); $result = &temp; } else { throw Swig::DirectorTypeMismatchException("string expected"); } } } 0707010008e87f000081a40000000000000000000000014caec288000007d7000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/pike/pikerun.swg/* ----------------------------------------------------------------------------- * pikerun.swg * * This file contains the runtime support for Pike modules * and includes code for managing global variables and pointer * type checking. * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif #include "object.h" #include "program.h" #ifdef __cplusplus } #endif /* Stores information about a wrapped object */ typedef struct swig_object_wrapper { void *self; swig_type_info *type; } swig_object_wrapper; #ifdef THIS #undef THIS #endif #define THIS (((swig_object_wrapper *) Pike_fp->current_storage)->self) #define SWIG_ConvertPtr SWIG_Pike_ConvertPtr #define SWIG_NewPointerObj SWIG_Pike_NewPointerObj #define SWIG_GetModule(clientdata) SWIG_Pike_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Pike_SetModule(pointer) /* These need to be filled in before type sharing between modules will work */ static swig_module_info *SWIG_Pike_GetModule() { return 0; } static void SWIG_Pike_SetModule(swig_module_info *pointer) { } /* Convert a pointer value */ static int SWIG_Pike_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) { struct program *pr; swig_cast_info *tc; swig_object_wrapper *obj_wrapper; if (ty) { pr = (struct program *) ty->clientdata; obj_wrapper = (swig_object_wrapper *) get_storage(obj, pr); if (obj_wrapper && obj_wrapper->type) { tc = SWIG_TypeCheckStruct(obj_wrapper->type, ty); if (tc) { int newmemory = 0; *ptr = SWIG_TypeCast(tc, obj_wrapper->self, &newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ return 0; } } } return -1; } /* Create a new pointer object */ static struct object * SWIG_Pike_NewPointerObj(void *ptr, swig_type_info *type, int own) { return 0; } 0707010008e87d000081a40000000000000000000000014caec28800002470000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/pike/pike.swg/* ----------------------------------------------------------------------------- * pike.swg * * Pike configuration module. * ----------------------------------------------------------------------------- */ %insert(runtime) "swigrun.swg"; // Common C API type-checking code %insert(runtime) "pikerun.swg"; // Pike run-time code %insert(runtime) %{ #ifdef __cplusplus extern "C" { #endif #include #include #include #ifdef __cplusplus } #endif %} /* ----------------------------------------------------------------------------- * standard typemaps * ----------------------------------------------------------------------------- */ /* --- Input arguments --- */ /* Primitive datatypes. */ %typemap(in, pikedesc="tInt") int, unsigned int, short, unsigned short, long, unsigned long, char, signed char, unsigned char, bool, enum SWIGTYPE, long long, unsigned long long { if ($input.type != T_INT) Pike_error("Bad argument: Expected an integer.\n"); $1 = ($1_ltype) $input.u.integer; } %typemap(in, pikedesc="tFloat") float, double { if ($input.type != T_FLOAT) Pike_error("Bad argument: Expected a float.\n"); $1 = ($1_ltype) $input.u.float_number; } %typemap(in, pikedesc="tStr") char *, char [ANY] { if ($input.type != T_STRING) Pike_error("Bad argument: Expected a string.\n"); $1 = ($1_ltype) STR0($input.u.string); } /* Pointers, references and arrays */ %typemap(in) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "SWIG_ConvertPtr($input.u.object, (void **) &$1, $1_descriptor, 1);" /* Void pointer. Accepts any kind of pointer */ %typemap(in) void * "/* FIXME */"; /* Object passed by value. Convert to a pointer */ %typemap(in) SWIGTYPE ($&1_ltype argp) "/* FIXME */"; /* Pointer to a class member */ %typemap(in) SWIGTYPE (CLASS::*) "/* FIXME */"; /* Const primitive references. Passed by value */ %typemap(in, pikedesc="tInt") const int & (int temp), const short & (short temp), const long & (long temp), const unsigned int & (unsigned int temp), const unsigned short & (unsigned short temp), const unsigned long & (unsigned long temp), const char & (char temp), const signed char & (signed char temp), const unsigned char & (unsigned char temp), const bool & (bool temp), const long long & ($*1_ltype temp), const unsigned long long & ($*1_ltype temp), const enum SWIGTYPE & ($*1_ltype temp) { if ($input.type != T_INT) Pike_error("Bad argument: Expected an integer.\n"); temp = ($*1_ltype) $input.u.integer; $1 = &temp; } %typemap(in, pikedesc="tFloat") const float & (float temp), const double & (double temp) { if ($input.type != T_FLOAT) Pike_error("Bad argument: Expected a float.\n"); temp = ($*1_ltype) $input.u.float_number; $1 = &temp; } /* ----------------------------------------------------------------------------- * Output Typemaps * ----------------------------------------------------------------------------- */ %typemap(out, pikedesc="tInt") int, unsigned int, short, unsigned short, long, unsigned long, char, signed char, unsigned char, bool, enum SWIGTYPE "push_int($1);"; %typemap(out, pikedesc="tInt") long long "push_int64($1);"; %typemap(out, pikedesc="tInt") unsigned long long "push_int64($1);"; %typemap(out, pikedesc="tFloat") float, double "push_float($1);"; %typemap(out, pikedesc="tStr") char * "push_text($1);"; /* Pointers, references, and arrays */ %typemap(out, pikedesc="tObj") SWIGTYPE*, SWIGTYPE &, SWIGTYPE [] "push_object(SWIG_NewPointerObj((void *) $1, $1_descriptor, $owner));"; /* Void return value; don't push anything */ %typemap(out, pikedesc="tVoid") void ""; /* Dynamic casts */ %typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC "/* FIXME */"; /* Member pointer */ %typemap(out) SWIGTYPE (CLASS::*) "/* FIXME */"; /* Special typemap for character array return values */ %typemap(out, pikedesc="tStr") char [ANY], const char [ANY] "push_text($1);"; /* Primitive types--return by value */ %typemap(out, pikedesc="tObj") SWIGTYPE #ifdef __cplusplus { $&1_ltype resultptr; resultptr = new $1_ltype((const $1_ltype &) $1); push_object(SWIG_NewPointerObj((void *) resultptr, $&1_descriptor, 1)); } #else { $&1_ltype resultptr; resultptr = ($&1_ltype) malloc(sizeof($1_type)); memmove(resultptr, &$1, sizeof($1_type)); push_object(SWIG_NewPointerObj((void *) resultptr, $&1_descriptor, 1)); } #endif /* References to primitive types. Return by value */ %typemap(out, pikedesc="tInt") const int &, const unsigned int &, const short &, const unsigned short &, const long &, const unsigned long &, const char &, const signed char &, const unsigned char &, const bool &, const long long &, const unsigned long long &, const enum SWIGTYPE & ($*1_ltype temp) "push_int(*($1));"; %typemap(out, pikedesc="tFloat") const float &, const double & "push_float(*($1));"; /************************ Constant Typemaps *****************************/ %typemap(constant) int, unsigned int, short, unsigned short, long, unsigned long, signed char, unsigned char, bool, enum SWIGTYPE, long long, unsigned long long "add_integer_constant(\"$symname\", $1, 0);"; %typemap(constant) char "add_integer_constant(\"$symname\", '$1', 0);"; %typemap(constant) long long, unsigned long long "add_integer_constant(\"$symname\", $1, 0);"; %typemap(constant) float, double "add_float_constant(\"$symname\", $1, 0);"; %typemap(constant) char * "add_string_constant(\"$symname\", \"$1\", 0);"; /* ------------------------------------------------------------ * String & length * ------------------------------------------------------------ */ %typemap(in, pikedesc="tStr") (char *STRING, int LENGTH) { if ($input.type != T_STRING) Pike_error("Bad argument: Expected a string.\n"); $1 = ($1_ltype) STR0($input.u.string); $2 = ($2_ltype) $input.u.string->length; } /* ------------------------------------------------------------ * ANSI C typemaps * ------------------------------------------------------------ */ %typemap(in, pikedesc="tInt") size_t { if ($input.type != T_INT) Pike_error("Bad argument: Expected an integer.\n"); $1 = ($1_ltype) $input.u.integer; } %typemap(out) size_t = long; /* ------------------------------------------------------------ * Typechecking rules * ------------------------------------------------------------ */ %typecheck(SWIG_TYPECHECK_INTEGER) int, short, long, unsigned int, unsigned short, unsigned long, signed char, unsigned char, long long, unsigned long long, const int &, const short &, const long &, const unsigned int &, const unsigned short &, const unsigned long &, const long long &, const unsigned long long &, enum SWIGTYPE, enum SWIGTYPE &, bool, const bool & { $1 = ($input.type == T_INT) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_DOUBLE) float, double, const float &, const double & { $1 = (($input.type == T_FLOAT) || ($input.type == T_INT)) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_CHAR) char { $1 = ($input.type == T_INT) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_STRING) char * { $1 = ($input.type == T_STRING) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { void *ptr; if (SWIG_ConvertPtr($input.u.object, (void **) &ptr, $1_descriptor, 0) == -1) { $1 = 0; } else { $1 = 1; } } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *ptr; if (SWIG_ConvertPtr($input.u.object, (void **) &ptr, $&1_descriptor, 0) == -1) { $1 = 0; } else { $1 = 1; } } %typecheck(SWIG_TYPECHECK_VOIDPTR) void * { void *ptr; if (SWIG_ConvertPtr($input.u.object, (void **) &ptr, 0, 0) == -1) { $1 = 0; } else { $1 = 1; } } /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } /* ------------------------------------------------------------ * Overloaded operator support * ------------------------------------------------------------ */ #ifdef __cplusplus %rename("`+") *::operator+; %rename("`-") *::operator-; %rename("`*") *::operator*; %rename("`/") *::operator/; %rename("`%") *::operator%; %rename("`<<") *::operator<<; %rename("`>>") *::operator>>; %rename("`&") *::operator&; %rename("`|") *::operator|; %rename("`^") *::operator^; %rename("`~") *::operator~; %rename("`<") *::operator<; %rename("`>") *::operator>; %rename("`==") *::operator==; /* Special cases */ %rename("`()") *::operator(); #endif /* ------------------------------------------------------------ * The start of the Pike initialization function * ------------------------------------------------------------ */ %init "swiginit.swg" %init %{ #ifdef __cplusplus extern "C" #endif PIKE_MODULE_EXIT {} #ifdef __cplusplus extern "C" #endif PIKE_MODULE_INIT { struct program *pr; SWIG_InitializeModule(0); %} /* pike keywords */ %include 0707010008e87e000081a40000000000000000000000014caec28800000351000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/pike/pikekw.swg#ifndef PIKE_PIKEKW_SWG_ #define PIKE_PIKEKW_SWG_ /* Warnings for Pike keywords */ #define PIKEKW(x) %namewarn("314: '" #x "' is a pike keyword") #x /* from http://www.http://docs.linux.cz/pike/tutorial_C.html */ PIKEKW(array); PIKEKW(break); PIKEKW(case); PIKEKW(catch); PIKEKW(continue); PIKEKW(default); PIKEKW(do); PIKEKW(else); PIKEKW(float); PIKEKW(for); PIKEKW(foreach); PIKEKW(function); PIKEKW(gauge); PIKEKW(if); PIKEKW(inherit); PIKEKW(inline); PIKEKW(int); PIKEKW(lambda); PIKEKW(mapping); PIKEKW(mixed); PIKEKW(multiset); PIKEKW(nomask); PIKEKW(object); PIKEKW(predef); PIKEKW(private); PIKEKW(program); PIKEKW(protected); PIKEKW(public); PIKEKW(return); PIKEKW(sscanf); PIKEKW(static); PIKEKW(string); PIKEKW(switch); PIKEKW(typeof); PIKEKW(varargs); PIKEKW(void); PIKEKW(while); #undef PIKEKW #endif //PIKE_PIKEKW_SWG_ 0707010008e95b000081a40000000000000000000000014caec28400000100000000b600010002ffffffffffffffff0000002a00000000root/usr/local/share/swig/2.0.1/swigrun.i/* ----------------------------------------------------------------------------- * swigrun.i * * Empty module (for now). Placeholder for runtime libs * ----------------------------------------------------------------------------- */ %module swigrun 0707010008e7b0000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002600000000root/usr/local/share/swig/2.0.1/guile0707010008e7b2000081a40000000000000000000000014caec286000002ed000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/guile/cplusplus.i/* ----------------------------------------------------------------------------- * cplusplus.i * * SWIG typemaps for C++ * ----------------------------------------------------------------------------- */ %typemap(guile,out) string, std::string { $result = gh_str02scm(const_cast($1.c_str())); } %typemap(guile,in) string, std::string { $1 = SWIG_scm2str($input); } %typemap(guile,out) complex, complex, std::complex { $result = scm_make_rectangular( gh_double2scm ($1.real ()), gh_double2scm ($1.imag ()) ); } %typemap(guile,in) complex, complex, std::complex { $1 = std::complex( gh_scm2double (scm_real_part ($input)), gh_scm2double (scm_imag_part ($input)) ); } 0707010008e7c1000081a40000000000000000000000014caec2860000ea97000000b600010002ffffffffffffffff0000003000000000root/usr/local/share/swig/2.0.1/guile/std_map.i/* ----------------------------------------------------------------------------- * std_map.i * * SWIG typemaps for std::map * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::map // // The aim of all that follows would be to integrate std::map with // Guile as much as possible, namely, to allow the user to pass and // be returned Scheme association lists. // const declarations are used to guess the intent of the function being // exported; therefore, the following rationale is applied: // // -- f(std::map), f(const std::map&), f(const std::map*): // the parameter being read-only, either a Scheme alist or a // previously wrapped std::map can be passed. // -- f(std::map&), f(std::map*): // the parameter must be modified; therefore, only a wrapped std::map // can be passed. // -- std::map f(): // the map is returned by copy; therefore, a Scheme alist // is returned which is most easily used in other Scheme functions // -- std::map& f(), std::map* f(), const std::map& f(), // const std::map* f(): // the map is returned by reference; therefore, a wrapped std::map // is returned // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class map { %typemap(in) map (std::map* m) { if (gh_null_p($input)) { $1 = std::map(); } else if (gh_pair_p($input)) { $1 = std::map(); SCM alist = $input; while (!gh_null_p(alist)) { K* k; T* x; SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) != 0) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); } (($1_type &)$1)[*k] = *x; alist = gh_cdr(alist); } } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const map& (std::map temp, std::map* m), const map* (std::map temp, std::map* m) { if (gh_null_p($input)) { temp = std::map(); $1 = &temp; } else if (gh_pair_p($input)) { temp = std::map(); $1 = &temp; SCM alist = $input; while (!gh_null_p(alist)) { K* k; T* x; SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) != 0) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); } temp[*k] = *x; alist = gh_cdr(alist); } } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) map { SCM alist = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { K* key = new K(i->first); T* val = new T(i->second); SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); SCM entry = gh_cons(k,x); alist = gh_cons(entry,alist); } $result = alist; } %typecheck(SWIG_TYPECHECK_MAP) map { /* native sequence? */ if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { /* check the first element only */ K* k; T* x; SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (SWIG_ConvertPtr(key,(void**) &k, $descriptor(K *), 0) != 0) { $1 = 0; } else { if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { /* wrapped map? */ std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_MAP) const map&, const map* { /* native sequence? */ if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { /* check the first element only */ K* k; T* x; SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (SWIG_ConvertPtr(key,(void**) &k, $descriptor(K *), 0) != 0) { $1 = 0; } else { if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { /* wrapped map? */ std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %rename("length") size; %rename("null?") empty; %rename("clear!") clear; %rename("ref") __getitem__; %rename("set!") __setitem__; %rename("delete!") __delitem__; %rename("has-key?") has_key; public: map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { const T& __getitem__(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void __setitem__(const K& key, const T& x) { (*self)[key] = x; } void __delitem__(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(const K& key) { std::map::iterator i = self->find(key); return i != self->end(); } SCM keys() { SCM result = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { K* key = new K(i->first); SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); result = gh_cons(k,result); } return result; } } }; // specializations for built-ins %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO) template class map { %typemap(in) map (std::map* m) { if (gh_null_p($input)) { $1 = std::map(); } else if (gh_pair_p($input)) { $1 = std::map(); SCM alist = $input; while (!gh_null_p(alist)) { T* x; SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); if (!CHECK(key)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) != 0) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); } (($1_type &)$1)[CONVERT_FROM(key)] = *x; alist = gh_cdr(alist); } } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const map& (std::map temp, std::map* m), const map* (std::map temp, std::map* m) { if (gh_null_p($input)) { temp = std::map(); $1 = &temp; } else if (gh_pair_p($input)) { temp = std::map(); $1 = &temp; SCM alist = $input; while (!gh_null_p(alist)) { T* x; SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); if (!CHECK(key)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) != 0) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0); } temp[CONVERT_FROM(key)] = *x; alist = gh_cdr(alist); } } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) map { SCM alist = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { T* val = new T(i->second); SCM k = CONVERT_TO(i->first); SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1); SCM entry = gh_cons(k,x); alist = gh_cons(entry,alist); } $result = alist; } %typecheck(SWIG_TYPECHECK_MAP) map { // native sequence? if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { // check the first element only T* x; SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (!CHECK(key)) { $1 = 0; } else { if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { // wrapped map? std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_MAP) const map&, const map* { // native sequence? if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { // check the first element only T* x; SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (!CHECK(key)) { $1 = 0; } else { if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (SWIG_ConvertPtr(val,(void**) &x, $descriptor(T *), 0) == 0) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { // wrapped map? std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %rename("length") size; %rename("null?") empty; %rename("clear!") clear; %rename("ref") __getitem__; %rename("set!") __setitem__; %rename("delete!") __delitem__; %rename("has-key?") has_key; public: map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { T& __getitem__(K key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void __setitem__(K key, const T& x) { (*self)[key] = x; } void __delitem__(K key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(K key) { std::map::iterator i = self->find(key); return i != self->end(); } SCM keys() { SCM result = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { SCM k = CONVERT_TO(i->first); result = gh_cons(k,result); } return result; } } }; %enddef %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO) template class map { %typemap(in) map (std::map* m) { if (gh_null_p($input)) { $1 = std::map(); } else if (gh_pair_p($input)) { $1 = std::map(); SCM alist = $input; while (!gh_null_p(alist)) { K* k; SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); if (!CHECK(val)) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); if (!CHECK(val)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); } (($1_type &)$1)[*k] = CONVERT_FROM(val); alist = gh_cdr(alist); } } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const map& (std::map temp, std::map* m), const map* (std::map temp, std::map* m) { if (gh_null_p($input)) { temp = std::map(); $1 = &temp; } else if (gh_pair_p($input)) { temp = std::map(); $1 = &temp; SCM alist = $input; while (!gh_null_p(alist)) { K* k; SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0); if (!CHECK(val)) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); if (!CHECK(val)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); } temp[*k] = CONVERT_FROM(val); alist = gh_cdr(alist); } } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) map { SCM alist = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { K* key = new K(i->first); SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); SCM x = CONVERT_TO(i->second); SCM entry = gh_cons(k,x); alist = gh_cons(entry,alist); } $result = alist; } %typecheck(SWIG_TYPECHECK_MAP) map { // native sequence? if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { // check the first element only K* k; SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (SWIG_ConvertPtr(val,(void **) &k, $descriptor(K *), 0) != 0) { $1 = 0; } else { if (CHECK(val)) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (CHECK(val)) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { // wrapped map? std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_MAP) const map&, const map* { // native sequence? if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { // check the first element only K* k; SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (SWIG_ConvertPtr(val,(void **) &k, $descriptor(K *), 0) != 0) { $1 = 0; } else { if (CHECK(val)) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (CHECK(val)) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { // wrapped map? std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %rename("length") size; %rename("null?") empty; %rename("clear!") clear; %rename("ref") __getitem__; %rename("set!") __setitem__; %rename("delete!") __delitem__; %rename("has-key?") has_key; public: map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { T __getitem__(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void __setitem__(const K& key, T x) { (*self)[key] = x; } void __delitem__(const K& key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(const K& key) { std::map::iterator i = self->find(key); return i != self->end(); } SCM keys() { SCM result = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { K* key = new K(i->first); SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1); result = gh_cons(k,result); } return result; } } }; %enddef %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO, T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO) template<> class map { %typemap(in) map (std::map* m) { if (gh_null_p($input)) { $1 = std::map(); } else if (gh_pair_p($input)) { $1 = std::map(); SCM alist = $input; while (!gh_null_p(alist)) { SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); if (!CHECK_K(key)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); if (!CHECK_T(val)) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); if (!CHECK_T(val)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); } (($1_type &)$1)[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); alist = gh_cdr(alist); } } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const map& (std::map temp, std::map* m), const map* (std::map temp, std::map* m) { if (gh_null_p($input)) { temp = std::map(); $1 = &temp; } else if (gh_pair_p($input)) { temp = std::map(); $1 = &temp; SCM alist = $input; while (!gh_null_p(alist)) { SCM entry, key, val; entry = gh_car(alist); if (!gh_pair_p(entry)) SWIG_exception(SWIG_TypeError,"alist expected"); key = gh_car(entry); val = gh_cdr(entry); if (!CHECK_K(key)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); if (!CHECK_T(val)) { if (!gh_pair_p(val)) SWIG_exception(SWIG_TypeError,"alist expected"); val = gh_car(val); if (!CHECK_T(val)) SWIG_exception(SWIG_TypeError, "map<" #K "," #T "> expected"); } temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val); alist = gh_cdr(alist); } } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) map { SCM alist = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { SCM k = CONVERT_K_TO(i->first); SCM x = CONVERT_T_TO(i->second); SCM entry = gh_cons(k,x); alist = gh_cons(entry,alist); } $result = alist; } %typecheck(SWIG_TYPECHECK_MAP) map { // native sequence? if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { // check the first element only SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (!CHECK_K(key)) { $1 = 0; } else { if (CHECK_T(val)) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (CHECK_T(val)) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { // wrapped map? std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_MAP) const map&, const map* { // native sequence? if (gh_null_p($input)) { /* an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { // check the first element only SCM head = gh_car($input); if (gh_pair_p(head)) { SCM key = gh_car(head); SCM val = gh_cdr(head); if (!CHECK_K(key)) { $1 = 0; } else { if (CHECK_T(val)) { $1 = 1; } else if (gh_pair_p(val)) { val = gh_car(val); if (CHECK_T(val)) $1 = 1; else $1 = 0; } else { $1 = 0; } } } else { $1 = 0; } } else { // wrapped map? std::map* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %rename("length") size; %rename("null?") empty; %rename("clear!") clear; %rename("ref") __getitem__; %rename("set!") __setitem__; %rename("delete!") __delitem__; %rename("has-key?") has_key; public: map(); map(const map &); unsigned int size() const; bool empty() const; void clear(); %extend { T __getitem__(K key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) return i->second; else throw std::out_of_range("key not found"); } void __setitem__(K key, T x) { (*self)[key] = x; } void __delitem__(K key) throw (std::out_of_range) { std::map::iterator i = self->find(key); if (i != self->end()) self->erase(i); else throw std::out_of_range("key not found"); } bool has_key(K key) { std::map::iterator i = self->find(key); return i != self->end(); } SCM keys() { SCM result = SCM_EOL; for (std::map::reverse_iterator i=$1.rbegin(); i!=$1.rend(); ++i) { SCM k = CONVERT_K_TO(i->first); result = gh_cons(k,result); } return result; } } }; %enddef specialize_std_map_on_key(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_key(int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_key(short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_key(long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_key(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_key(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_key(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_key(double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_key(float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_key(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_value(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_value(int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_value(short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_value(long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_value(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_value(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_value(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_value(double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_value(float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_value(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_map_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); } 0707010008e7c3000081a40000000000000000000000014caec28600000915000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/guile/std_string.i/* ----------------------------------------------------------------------------- * std_string.i * * SWIG typemaps for std::string * ----------------------------------------------------------------------------- */ // ------------------------------------------------------------------------ // std::string is typemapped by value // This can prevent exporting methods which return a string // in order for the user to modify it. // However, I think I'll wait until someone asks for it... // ------------------------------------------------------------------------ %include %{ #include %} namespace std { %naturalvar string; class string; %typemap(typecheck) string = char *; %typemap(typecheck) const string & = char *; %typemap(in) string (char * tempptr) { if (gh_string_p($input)) { tempptr = SWIG_scm2str($input); $1.assign(tempptr); if (tempptr) SWIG_free(tempptr); } else { SWIG_exception(SWIG_TypeError, "string expected"); } } %typemap(in) const string & (std::string temp, char *tempptr) { if (gh_string_p($input)) { tempptr = SWIG_scm2str($input); temp.assign(tempptr); if (tempptr) SWIG_free(tempptr); $1 = &temp; } else { SWIG_exception(SWIG_TypeError, "string expected"); } } %typemap(in) string * (char *tempptr) { if (gh_string_p($input)) { tempptr = SWIG_scm2str($input); $1 = new std::string(tempptr); if (tempptr) SWIG_free(tempptr); } else { SWIG_exception(SWIG_TypeError, "string expected"); } } %typemap(out) string { $result = gh_str02scm($1.c_str()); } %typemap(out) const string & { $result = gh_str02scm($1->c_str()); } %typemap(out) string * { $result = gh_str02scm($1->c_str()); } %typemap(varin) string { if (gh_string_p($input)) { char *tempptr = SWIG_scm2str($input); $1.assign(tempptr); if (tempptr) SWIG_free(tempptr); } else { SWIG_exception(SWIG_TypeError, "string expected"); } } %typemap(varout) string { $result = gh_str02scm($1.c_str()); } } 0707010008e7bb000081a40000000000000000000000014caec286000046cc000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/guile/list-vector.i/* ----------------------------------------------------------------------------- * list_vector.i * * Guile typemaps for converting between arrays and Scheme lists or vectors * ----------------------------------------------------------------------------- */ /* Here is a macro that will define typemaps for converting between C arrays and Scheme lists or vectors when passing arguments to the C function. TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) Supported calling conventions: func(int VECTORLENINPUT, [const] C_TYPE *VECTORINPUT) Scheme wrapper will take one argument, a vector. A temporary C array of elements of type C_TYPE will be allocated and filled with the elements of the vectors, converted to C with the SCM_TO_C function. Length and address of the array are passed to the C function. SCM_TYPE is used to describe the Scheme type of the elements in the Guile procedure documentation. func(int LISTLENINPUT, [const] C_TYPE *LISTINPUT) Likewise, but the Scheme wrapper will take one argument, a list. func(int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) Scheme wrapper will take no arguments. Addresses of an integer and a C_TYPE * variable will be passed to the C function. The C function is expected to return address and length of a freshly allocated array of elements of type C_TYPE through these pointers. The elements of this array are converted to Scheme with the C_TO_SCM function and returned as a Scheme vector. If the function has a void return value, the vector constructed by this typemap becomes the return value of the Scheme wrapper. Otherwise, the function returns multiple values. (See the documentation on how to deal with multiple values.) func(int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) Likewise, but the Scheme wrapper will return a list instead of a vector. It is also allowed to use "size_t LISTLENINPUT" rather than "int LISTLENINPUT". */ %define TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) /* input */ /* We make use of the new multi-dispatch typemaps here. */ %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") (int VECTORLENINPUT, C_TYPE *VECTORINPUT), (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT) { SCM_VALIDATE_VECTOR($argnum, $input); $1 = gh_vector_length($input); if ($1 > 0) { $1_ltype i; $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); for (i = 0; i<$1; i++) { SCM swig_scm_value = gh_vector_ref($input, gh_int2scm(i)); $2[i] = SCM_TO_C_EXPR; } } else $2 = NULL; } %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") (int LISTLENINPUT, C_TYPE *LISTINPUT), (size_t LISTLENINPUT, C_TYPE *LISTINPUT) { SCM_VALIDATE_LIST($argnum, $input); $1 = gh_length($input); if ($1 > 0) { $1_ltype i; SCM rest; $2 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * $1); for (i = 0, rest = $input; i<$1; i++, rest = gh_cdr(rest)) { SCM swig_scm_value = gh_car(rest); $2[i] = SCM_TO_C_EXPR; } } else $2 = NULL; } /* Do not check for NULL pointers (override checks). */ %typemap(check) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), (int LISTLENINPUT, C_TYPE *LISTINPUT), (size_t LISTLENINPUT, C_TYPE *LISTINPUT) "/* no check for NULL pointer */"; /* Discard the temporary array after the call. */ %typemap(freearg) (int VECTORLENINPUT, C_TYPE *VECTORINPUT), (size_t VECTORLENINPUT, C_TYPE *VECTORINPUT), (int LISTLENINPUT, C_TYPE *LISTINPUT), (size_t LISTLENINPUT, C_TYPE *LISTINPUT) {if ($2!=NULL) SWIG_free($2);} %enddef /* output */ %define TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) /* First we make temporary variables ARRAYLENTEMP and ARRAYTEMP, whose addresses we pass to the C function. We ignore both arguments for Scheme. */ %typemap(in,numinputs=0) (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) (int arraylentemp, C_TYPE *arraytemp), (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) (int arraylentemp, C_TYPE *arraytemp), (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) (size_t arraylentemp, C_TYPE *arraytemp), (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) (size_t arraylentemp, C_TYPE *arraytemp) %{ $1 = &arraylentemp; $2 = &arraytemp; %} /* In the ARGOUT typemaps, we convert the array into a vector or a list and append it to the results. */ %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT) { $*1_ltype i; SCM res = gh_make_vector(gh_int2scm(*$1), SCM_BOOL_F); for (i = 0; i<*$1; i++) { C_TYPE swig_c_value = (*$2)[i]; SCM elt = C_TO_SCM_EXPR; gh_vector_set_x(res, gh_int2scm(i), elt); } SWIG_APPEND_VALUE(res); } %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) { int i; SCM res = SCM_EOL; for (i = ((int)(*$1)) - 1; i>=0; i--) { C_TYPE swig_c_value = (*$2)[i]; SCM elt = C_TO_SCM_EXPR; res = gh_cons(elt, res); } SWIG_APPEND_VALUE(res); } /* In the FREEARG typemaps, get rid of the C vector. (This can be overridden if you want to keep the C vector.) */ %typemap(freearg) (int *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), (size_t *VECTORLENOUTPUT, C_TYPE **VECTOROUTPUT), (int *LISTLENOUTPUT, C_TYPE **LISTOUTPUT), (size_t *LISTLENOUTPUT, C_TYPE **LISTOUTPUT) { if ((*$2)!=NULL) free(*$2); } %enddef %define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) %enddef %define TYPEMAP_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) TYPEMAP_LIST_VECTOR_INPUT_WITH_EXPR (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) %enddef %define TYPEMAP_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) TYPEMAP_LIST_VECTOR_OUTPUT_WITH_EXPR (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) %enddef %define TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) TYPEMAP_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) %enddef /* We use the macro to define typemaps for some standard types. */ TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(bool, gh_scm2bool, gh_bool2scm, boolean); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char, gh_scm2char, gh_char2scm, char); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned char, gh_scm2char, gh_char2scm, char); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(int, gh_scm2int, gh_int2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(short, gh_scm2int, gh_int2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(long, gh_scm2long, gh_long2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, gh_scm2long, gh_long2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned int, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned short, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(unsigned long, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(size_t, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(float, gh_scm2double, gh_double2scm, real); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(double, gh_scm2double, gh_double2scm, real); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, gh_str02scm, string); TYPEMAP_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, gh_str02scm, string); /* For the char *, free all strings after converting */ %typemap(freearg) (int *VECTORLENOUTPUT, char ***VECTOROUTPUT), (size_t *VECTORLENOUTPUT, char ***VECTOROUTPUT), (int *LISTLENOUTPUT, char ***LISTOUTPUT), (size_t *LISTLENOUTPUT, char ***LISTOUTPUT), (int *VECTORLENOUTPUT, const char ***VECTOROUTPUT), (size_t *VECTORLENOUTPUT, const char ***VECTOROUTPUT), (int *LISTLENOUTPUT, const char ***LISTOUTPUT), (size_t *LISTLENOUTPUT, const char ***LISTOUTPUT) { if ((*$2)!=NULL) { int i; for (i = 0; i < *$1; i++) { if ((*$2)[i] != NULL) free((*$2)[i]); } free(*$2); } } %typemap(freearg) (int VECTORLENINPUT, char **VECTORINPUT), (size_t VECTORLENINPUT, char **VECTORINPUT), (int LISTLENINPUT, char **LISTINPUT), (size_t LISTLENINPUT, char **LISTINPUT), (int VECTORLENINPUT, const char **VECTORINPUT), (size_t VECTORLENINPUT, const char **VECTORINPUT), (int LISTLENINPUT, const char **LISTINPUT), (size_t LISTLENINPUT, const char **LISTINPUT) { if (($2)!=NULL) { int i; for (i = 0; i< $1; i++) if (($2)[i] != NULL) free(($2)[i]); free($2); } } /* Following is a macro that emits typemaps that are much more flexible. (They are also messier.) It supports multiple parallel lists and vectors (sharing one length argument each). TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) Supported calling conventions: func(int PARALLEL_VECTORLENINPUT, [const] C_TYPE *PARALLEL_VECTORINPUT, ...) or func([const] C_TYPE *PARALLEL_VECTORINPUT, ..., int PARALLEL_VECTORLENINPUT) func(int PARALLEL_LISTLENINPUT, [const] C_TYPE *PARALLEL_LISTINPUT, ...) or func([const] C_TYPE *PARALLEL_LISTINPUT, ..., int PARALLEL_LISTLENINPUT) func(int *PARALLEL_VECTORLENOUTPUT, C_TYPE **PARALLEL_VECTOROUTPUT, ...) or func(C_TYPE **PARALLEL_VECTOROUTPUT, int *PARALLEL_VECTORLENOUTPUT, ...) func(int *PARALLEL_LISTLENOUTPUT, C_TYPE **PARALLEL_LISTOUTPUT) or func(C_TYPE **PARALLEL_LISTOUTPUT, int *PARALLEL_LISTLENOUTPUT) It is also allowed to use "size_t PARALLEL_LISTLENINPUT" rather than "int PARALLEL_LISTLENINPUT". */ %define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) /* input */ /* Passing data is a little complicated here; just remember: IGNORE typemaps come first, then IN, then CHECK. But if IGNORE is given, IN won't be used for this type. We need to "ignore" one of the parameters because there shall be only one argument on the Scheme side. Here we only initialize the array length to 0 but save its address for a later change. */ %typemap(in,numinputs=0) int PARALLEL_VECTORLENINPUT (int *_global_vector_length), size_t PARALLEL_VECTORLENINPUT (size_t *_global_vector_length) { $1 = 0; _global_vector_length = &$1; } %typemap(in,numinputs=0) int PARALLEL_LISTLENINPUT (int *_global_list_length), size_t PARALLEL_LISTLENINPUT (size_t *_global_list_length) { $1 = 0; _global_list_length = &$1; } /* All the work is done in IN. */ %typemap(in, doc="$NAME is a vector of " #SCM_TYPE " values") C_TYPE *PARALLEL_VECTORINPUT, const C_TYPE *PARALLEL_VECTORINPUT { SCM_VALIDATE_VECTOR($argnum, $input); *_global_vector_length = gh_vector_length($input); if (*_global_vector_length > 0) { int i; $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * (*_global_vector_length)); for (i = 0; i<*_global_vector_length; i++) { SCM swig_scm_value = gh_vector_ref($input, gh_int2scm(i)); $1[i] = SCM_TO_C_EXPR; } } else $1 = NULL; } %typemap(in, doc="$NAME is a list of " #SCM_TYPE " values") C_TYPE *PARALLEL_LISTINPUT, const C_TYPE *PARALLEL_LISTINPUT { SCM_VALIDATE_LIST($argnum, $input); *_global_list_length = gh_length($input); if (*_global_list_length > 0) { int i; SCM rest; $1 = (C_TYPE *) SWIG_malloc(sizeof(C_TYPE) * (*_global_list_length)); for (i = 0, rest = $input; i<*_global_list_length; i++, rest = gh_cdr(rest)) { SCM swig_scm_value = gh_car(rest); $1[i] = SCM_TO_C_EXPR; } } else $1 = NULL; } /* Don't check for NULL pointers (override checks). */ %typemap(check) C_TYPE *PARALLEL_VECTORINPUT, const C_TYPE *PARALLEL_VECTORINPUT, C_TYPE *PARALLEL_LISTINPUT, const C_TYPE *PARALLEL_LISTINPUT "/* no check for NULL pointer */"; /* Discard the temporary array after the call. */ %typemap(freearg) C_TYPE *PARALLEL_VECTORINPUT, const C_TYPE *PARALLEL_VECTORINPUT, C_TYPE *PARALLEL_LISTINPUT, const C_TYPE *PARALLEL_LISTINPUT {if ($1!=NULL) SWIG_free($1);} %enddef %define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) /* output */ /* First we make a temporary variable ARRAYLENTEMP, use its address as the ...LENOUTPUT argument for the C function and "ignore" the ...LENOUTPUT argument for Scheme. */ %typemap(in,numinputs=0) int *PARALLEL_VECTORLENOUTPUT (int _global_arraylentemp), size_t *PARALLEL_VECTORLENOUTPUT (size_t _global_arraylentemp), int *PARALLEL_LISTLENOUTPUT (int _global_arraylentemp), size_t *PARALLEL_LISTLENOUTPUT (size_t _global_arraylentemp) "$1 = &_global_arraylentemp;"; /* We also need to ignore the ...OUTPUT argument. */ %typemap(in,numinputs=0) C_TYPE **PARALLEL_VECTOROUTPUT (C_TYPE *arraytemp), C_TYPE **PARALLEL_LISTOUTPUT (C_TYPE *arraytemp) "$1 = &arraytemp;"; /* In the ARGOUT typemaps, we convert the array into a vector or a list and append it to the results. */ %typemap(argout, doc="$NAME (a vector of " #SCM_TYPE " values)") C_TYPE **PARALLEL_VECTOROUTPUT { int i; SCM res = gh_make_vector(gh_int2scm(_global_arraylentemp), SCM_BOOL_F); for (i = 0; i<_global_arraylentemp; i++) { C_TYPE swig_c_value = (*$1)[i]; SCM elt = C_TO_SCM_EXPR; gh_vector_set_x(res, gh_int2scm(i), elt); } SWIG_APPEND_VALUE(res); } %typemap(argout, doc="$NAME (a list of " #SCM_TYPE " values)") C_TYPE **PARALLEL_LISTOUTPUT { int i; SCM res = SCM_EOL; if (_global_arraylentemp > 0) { for (i = _global_arraylentemp - 1; i>=0; i--) { C_TYPE swig_c_value = (*$1)[i]; SCM elt = C_TO_SCM_EXPR; res = gh_cons(elt, res); } } SWIG_APPEND_VALUE(res); } /* In the FREEARG typemaps, get rid of the C vector. (This can be overridden if you want to keep the C vector.) */ %typemap(freearg) C_TYPE **PARALLEL_VECTOROUTPUT, C_TYPE **PARALLEL_LISTOUTPUT { if ((*$1)!=NULL) free(*$1); } %enddef %define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_TYPE) TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR(C_TYPE, SCM_TO_C_EXPR, SCM_TYPE) TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR(C_TYPE, C_TO_SCM_EXPR, SCM_TYPE) %enddef %define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT(C_TYPE, SCM_TO_C, SCM_TYPE) TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_WITH_EXPR (C_TYPE, SCM_TO_C(swig_scm_value), SCM_TYPE) %enddef %define TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT(C_TYPE, C_TO_SCM, SCM_TYPE) TYPEMAP_PARALLEL_LIST_VECTOR_OUTPUT_WITH_EXPR (C_TYPE, C_TO_SCM(swig_c_value), SCM_TYPE) %enddef %define TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(C_TYPE, SCM_TO_C, C_TO_SCM, SCM_TYPE) TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT_WITH_EXPR (C_TYPE, SCM_TO_C(swig_scm_value), C_TO_SCM(swig_c_value), SCM_TYPE) %enddef /* We use the macro to define typemaps for some standard types. */ TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(bool, gh_scm2bool, gh_bool2scm, boolean); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char, gh_scm2char, gh_char2scm, char); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned char, gh_scm2char, gh_char2scm, char); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(int, gh_scm2int, gh_int2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(short, gh_scm2int, gh_int2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(long, gh_scm2long, gh_long2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(ptrdiff_t, gh_scm2long, gh_long2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned int, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned short, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(unsigned long, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(size_t, gh_scm2ulong, gh_ulong2scm, integer); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(float, gh_scm2double, gh_double2scm, real); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(double, gh_scm2double, gh_double2scm, real); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(char *, SWIG_scm2str, gh_str02scm, string); TYPEMAP_PARALLEL_LIST_VECTOR_INPUT_OUTPUT(const char *, SWIG_scm2str, gh_str02scm, string); %typemap(freearg) char **PARALLEL_LISTINPUT, char **PARALLEL_VECTORINPUT, const char **PARALLEL_LISTINPUT, const char **PARALLEL_VECTORINPUT { if (($1)!=NULL) { int i; for (i = 0; i<*_global_list_length; i++) if (($1)[i] != NULL) SWIG_free(($1)[i]); SWIG_free($1); } } %typemap(freearg) char ***PARALLEL_LISTOUTPUT, char ***PARALLEL_VECTOROUTPUT, const char ***PARALLEL_LISTOUTPUT, const char ***PARALLEL_VECTOROUTPUT { if ((*$1)!=NULL) { int i; for (i = 0; i<_global_arraylentemp; i++) if ((*$1)[i] != NULL) free((*$1)[i]); free(*$1); } } 0707010008e7ba000081a40000000000000000000000014caec2860000058d000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/guile/interpreter.i/* ----------------------------------------------------------------------------- * interpreter.i * * SWIG file for a simple Guile interpreter * ----------------------------------------------------------------------------- */ %{ #include GSCM_status guile_init(); int main(int argc, char **argv) { GSCM_status status; GSCM_top_level toplev; char *eval_answer; char input_str[16384]; int done; /* start a scheme interpreter */ status = gscm_run_scm(argc, argv, 0, stdout, stderr, guile_init, 0, "#t"); if (status != GSCM_OK) { fputs(gscm_error_msg(status), stderr); fputc('\n', stderr); printf("Error in startup.\n"); exit(1); } /* create the top level environment */ status = gscm_create_top_level(&toplev); if (status != GSCM_OK) { fputs(gscm_error_msg(status), stderr); fputc('\n', stderr); exit(1); } /* now sit in a scheme eval loop: I input the expressions, have guile * evaluate them, and then get another expression. */ done = 0; fprintf(stdout,"Guile > "); while (!done) { if (fgets(input_str,16384,stdin) == NULL) { exit(1); } else { if (strncmp(input_str,"quit",4) == 0) exit(1); status = gscm_eval_str(&eval_answer, toplev, input_str); fprintf(stdout,"%s\n", eval_answer); fprintf(stdout,"Guile > "); } } /* now clean up and quit */ gscm_destroy_top_level(toplev); } %} 0707010008e7c0000081a40000000000000000000000014caec286000000b6000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/guile/std_except.i// TODO: STL exception handling // Note that the generic std_except.i file did not work %{ #include %} namespace std { %ignore exception; struct exception { }; } 0707010008e7b6000081a40000000000000000000000014caec28600001a91000000b600010002ffffffffffffffff0000003700000000root/usr/local/share/swig/2.0.1/guile/guile_gh_run.swg/* ----------------------------------------------------------------------------- * guile_gh_run.swg * * Guile GH runtime file * ----------------------------------------------------------------------------- */ #define SWIGGUILE #include "guile/gh.h" #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef SCM (*swig_guile_proc)(); #define SWIG_malloc(size) \ SCM_MUST_MALLOC(size) #define SWIG_free(mem) \ scm_must_free(mem) #define SWIG_ConvertPtr(s, result, type, flags) \ SWIG_Guile_ConvertPtr(&swig_module, s, result, type, flags) #define SWIG_MustGetPtr(s, type, argnum, flags) \ SWIG_Guile_MustGetPtr(&swig_module, s, type, argnum, flags, FUNC_NAME) #define SWIG_NewPointerObj(ptr, type, owner) \ SWIG_Guile_NewPointerObj(&swig_module, (void*)ptr, type, owner) #define SWIG_GetModule(clientdata) SWIG_Guile_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer) /* Ignore object-ownership changes in gh mode */ #define SWIG_Guile_MarkPointerNoncollectable(s) (s) #define SWIG_Guile_MarkPointerDestroyed(s) (s) #define SWIG_contract_assert(expr, msg) \ if (!(expr)) \ scm_error(gh_symbol2scm("swig-contract-assertion-failed"), \ (char *) FUNC_NAME, (char *) msg, \ SCM_EOL, SCM_BOOL_F); else /* SCM_CHAR and SCM_CHARP were introduced in Guile 1.4; the following is for 1.3.4 compatibility. */ #ifndef SCM_CHAR # define SCM_CHAR SCM_ICHR #endif #ifndef SCM_CHARP # define SCM_CHARP SCM_ICHRP #endif /* This function replaces gh_scm2char, which is broken in Guile 1.4 */ SWIGINTERN char GSWIG_scm2char (SCM s) { if (SCM_CHARP(s)) return SCM_CHAR(s); scm_wrong_type_arg(NULL, 0, s); } #define gh_scm2char GSWIG_scm2char /* Interface function */ #define SWIG_scm2str(x) gh_scm2newstr(x, NULL) /* More 1.3.4 compatibility */ #ifndef SCM_INPUT_PORT_P # define SCM_INPUT_PORT_P SCM_INPORTP # define SCM_OUTPUT_PORT_P SCM_OUTPORTP #endif SWIGINTERN long SWIG_convert_integer(SCM o, long lower_bound, long upper_bound, const char *func_name, int argnum) { long value = gh_scm2long(o); if (value < lower_bound || value > upper_bound) scm_wrong_type_arg((char *) func_name, argnum, o); return value; } SWIGINTERN unsigned long SWIG_convert_unsigned_integer(SCM o, unsigned long lower_bound, unsigned long upper_bound, const char *func_name, int argnum) { unsigned long value = gh_scm2ulong(o); if (value < lower_bound || value > upper_bound) scm_wrong_type_arg((char *) func_name, argnum, o); return value; } SWIGINTERN swig_type_info * SWIG_Guile_LookupType(swig_module_info *module, SCM s, int normal) { swig_module_info *iter; if (!module) return 0; iter = module; do { if ((normal && (unsigned long) SCM_TYP16(s) == *((int *)iter->clientdata))) { return iter->types[(long) SCM_CAR(s) >> 16]; } iter = iter->next; } while (iter != module); return 0; } #ifdef SWIG_GLOBAL #define SWIG_GUILE_MODULE_STATIC #elif !defined(SWIG_NOINCLUDE) #define SWIG_GUILE_MODULE_STATIC static #endif #ifdef SWIG_GUILE_MODULE_STATIC static swig_module_info *swig_guile_module = 0; SWIG_GUILE_MODULE_STATIC swig_module_info *SWIG_Guile_GetModule(void) { return swig_guile_module; } SWIG_GUILE_MODULE_STATIC void SWIG_Guile_SetModule(swig_module_info *pointer) { swig_guile_module = pointer; } #else SWIGEXPORT swig_module_info * SWIG_Guile_GetModule(void); SWIGEXPORT void SWIG_Guile_SetModule(swig_module_info *pointer); #endif SWIGINTERN SCM SWIG_Guile_NewPointerObj(swig_module_info *module, void *ptr, swig_type_info *type, int owner) { unsigned long tag; if (ptr==NULL) return SCM_EOL; if (!module) return SCM_EOL; for (tag = 0; tag < module->size; ++tag) { if (module->types[tag] == type) break; } if (tag >= module->size) return SCM_EOL; SCM_RETURN_NEWSMOB( ((tag << 16) | *((int *)module->clientdata)), ptr); } /* Return 0 if successful. */ SWIGINTERN int SWIG_Guile_ConvertPtr(swig_module_info *module, SCM s, void **result, swig_type_info *type, int flags) { swig_cast_info *cast; swig_type_info *from; if (SCM_NULLP(s)) { *result = NULL; return SWIG_OK; } else if (SCM_NIMP(s)) { from = SWIG_Guile_LookupType(module, s, 1); if (!from) return SWIG_ERROR; if (type) { cast = SWIG_TypeCheckStruct(from, type); if (cast) { int newmemory = 0; *result = SWIG_TypeCast(cast, (void *) SCM_CDR(s), &newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ return SWIG_OK; } else { return SWIG_ERROR; } } else { *result = (void *) SCM_CDR(s); return SWIG_OK; } } return SWIG_ERROR; } SWIGINTERN void * SWIG_Guile_MustGetPtr (swig_module_info *module, SCM s, swig_type_info *type, int argnum, int flags, const char *func_name) { void *result; int res = SWIG_Guile_ConvertPtr(module, s, &result, type, flags); if (!SWIG_IsOK(res)) { /* type mismatch */ scm_wrong_type_arg((char *) func_name, argnum, s); } return result; } /* Init */ SWIGINTERN int print_swig (SCM swig_smob, SCM port, scm_print_state *pstate) { swig_type_info *type = SWIG_Guile_LookupType(0, swig_smob, 1); if (type) { scm_puts((char *) "#str != NULL) scm_puts((char *) type->str, port); else scm_puts((char *) type->name, port); scm_puts((char *) " ", port); scm_intprint((long) SCM_CDR(swig_smob), 16, port); scm_puts((char *) ">", port); /* non-zero means success */ return 1; } else { return 0; } } SWIGINTERN SCM equalp_swig (SCM A, SCM B) { if (SCM_CAR(A) == SCM_CAR(B) && SCM_CDR(A) == SCM_CDR(B)) return SCM_BOOL_T; else return SCM_BOOL_F; } SWIGINTERN void SWIG_Guile_Init (swig_module_info *module) { *((int *)module->clientdata) = scm_make_smob_type_mfpe((char *) "swig", 0, NULL, NULL, print_swig, equalp_swig); } SWIGINTERN int SWIG_Guile_GetArgs (SCM *dest, SCM rest, int reqargs, int optargs, const char *procname) { int i; int num_args_passed = 0; for (i = 0; i %include // ------------------------------------------------------------------------ // std::pair // // See std_vector.i for the rationale of typemap application // ------------------------------------------------------------------------ %{ #include %} // exported class namespace std { template struct pair { %typemap(in) pair (std::pair* m) { if (gh_pair_p($input)) { T* x; U* y; SCM first, second; first = gh_car($input); second = gh_cdr($input); x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); $1 = std::make_pair(*x,*y); } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const pair& (std::pair temp, std::pair* m), const pair* (std::pair temp, std::pair* m) { if (gh_pair_p($input)) { T* x; U* y; SCM first, second; first = gh_car($input); second = gh_cdr($input); x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); temp = std::make_pair(*x,*y); $1 = &temp; } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) pair { T* x = new T($1.first); U* y = new U($1.second); SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); $result = gh_cons(first,second); } %typecheck(SWIG_TYPECHECK_PAIR) pair { /* native pair? */ if (gh_pair_p($input)) { T* x; U* y; SCM first = gh_car($input); SCM second = gh_cdr($input); if (SWIG_ConvertPtr(first,(void**) &x, $descriptor(T *), 0) == 0 && SWIG_ConvertPtr(second,(void**) &y, $descriptor(U *), 0) == 0) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_PAIR) const pair&, const pair* { /* native pair? */ if (gh_pair_p($input)) { T* x; U* y; SCM first = gh_car($input); SCM second = gh_cdr($input); if (SWIG_ConvertPtr(first,(void**) &x, $descriptor(T *), 0) == 0 && SWIG_ConvertPtr(second,(void**) &y, $descriptor(U *), 0) == 0) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } pair(); pair(T first, U second); pair(const pair& p); template pair(const pair &p); T first; U second; }; // specializations for built-ins %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO) template struct pair { %typemap(in) pair (std::pair* m) { if (gh_pair_p($input)) { U* y; SCM first, second; first = gh_car($input); second = gh_cdr($input); if (!CHECK(first)) SWIG_exception(SWIG_TypeError, "map<" #T "," #U "> expected"); y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); $1 = std::make_pair(CONVERT_FROM(first),*y); } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const pair& (std::pair temp, std::pair* m), const pair* (std::pair temp, std::pair* m) { if (gh_pair_p($input)) { U* y; SCM first, second; first = gh_car($input); second = gh_cdr($input); if (!CHECK(first)) SWIG_exception(SWIG_TypeError, "map<" #T "," #U "> expected"); y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0); temp = std::make_pair(CONVERT_FROM(first),*y); $1 = &temp; } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) pair { U* y = new U($1.second); SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1); $result = gh_cons(CONVERT_TO($1.first),second); } %typecheck(SWIG_TYPECHECK_PAIR) pair { /* native pair? */ if (gh_pair_p($input)) { U* y; SCM first = gh_car($input); SCM second = gh_cdr($input); if (CHECK(first) && SWIG_ConvertPtr(second,(void**) &y, $descriptor(U *), 0) == 0) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_PAIR) const pair&, const pair* { /* native pair? */ if (gh_pair_p($input)) { U* y; SCM first = gh_car($input); SCM second = gh_cdr($input); if (CHECK(first) && SWIG_ConvertPtr(second,(void**) &y, $descriptor(U *), 0) == 0) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } pair(); pair(T first, U second); pair(const pair& p); template pair(const pair &p); T first; U second; }; %enddef %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO) template struct pair { %typemap(in) pair (std::pair* m) { if (gh_pair_p($input)) { T* x; SCM first, second; first = gh_car($input); second = gh_cdr($input); x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); if (!CHECK(second)) SWIG_exception(SWIG_TypeError, "map<" #T "," #U "> expected"); $1 = std::make_pair(*x,CONVERT_FROM(second)); } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const pair& (std::pair temp, std::pair* m), const pair* (std::pair temp, std::pair* m) { if (gh_pair_p($input)) { T* x; SCM first, second; first = gh_car($input); second = gh_cdr($input); x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0); if (!CHECK(second)) SWIG_exception(SWIG_TypeError, "map<" #T "," #U "> expected"); temp = std::make_pair(*x,CONVERT_FROM(second)); $1 = &temp; } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) pair { T* x = new T($1.first); SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1); $result = gh_cons(first,CONVERT_TO($1.second)); } %typecheck(SWIG_TYPECHECK_PAIR) pair { /* native pair? */ if (gh_pair_p($input)) { T* x; SCM first = gh_car($input); SCM second = gh_cdr($input); if (SWIG_ConvertPtr(first,(void**) &x, $descriptor(T *), 0) == 0 && CHECK(second)) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_PAIR) const pair&, const pair* { /* native pair? */ if (gh_pair_p($input)) { T* x; SCM first = gh_car($input); SCM second = gh_cdr($input); if (SWIG_ConvertPtr(first,(void**) &x, $descriptor(T *), 0) == 0 && CHECK(second)) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } pair(); pair(T first, U second); pair(const pair& p); template pair(const pair &p); T first; U second; }; %enddef %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO, U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO) template<> struct pair { %typemap(in) pair (std::pair* m) { if (gh_pair_p($input)) { SCM first, second; first = gh_car($input); second = gh_cdr($input); if (!CHECK_T(first) || !CHECK_U(second)) SWIG_exception(SWIG_TypeError, "map<" #T "," #U "> expected"); $1 = std::make_pair(CONVERT_T_FROM(first), CONVERT_U_FROM(second)); } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const pair& (std::pair temp, std::pair* m), const pair* (std::pair temp, std::pair* m) { if (gh_pair_p($input)) { SCM first, second; first = gh_car($input); second = gh_cdr($input); if (!CHECK_T(first) || !CHECK_U(second)) SWIG_exception(SWIG_TypeError, "map<" #T "," #U "> expected"); temp = std::make_pair(CONVERT_T_FROM(first), CONVERT_U_FROM(second)); $1 = &temp; } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) pair { $result = gh_cons(CONVERT_T_TO($1.first), CONVERT_U_TO($1.second)); } %typecheck(SWIG_TYPECHECK_PAIR) pair { /* native pair? */ if (gh_pair_p($input)) { SCM first = gh_car($input); SCM second = gh_cdr($input); if (CHECK_T(first) && CHECK_U(second)) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $&1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_PAIR) const pair&, const pair* { /* native pair? */ if (gh_pair_p($input)) { SCM first = gh_car($input); SCM second = gh_cdr($input); if (CHECK_T(first) && CHECK_U(second)) { $1 = 1; } else { $1 = 0; } } else { /* wrapped pair? */ std::pair* m; if (SWIG_ConvertPtr($input,(void **) &m, $1_descriptor, 0) == 0) $1 = 1; else $1 = 0; } } pair(); pair(T first, U second); pair(const pair& p); template pair(const pair &p); T first; U second; }; %enddef specialize_std_pair_on_first(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_first(int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_first(short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_first(long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_first(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_first(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_first(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_first(double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_first(float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_first(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_second(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_second(int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_second(short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_second(long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_second(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_second(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_second(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_second(double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_second(float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_second(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(int,gh_number_p, gh_scm2long,gh_long2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(short,gh_number_p, gh_scm2long,gh_long2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(long,gh_number_p, gh_scm2long,gh_long2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(double,gh_number_p, gh_scm2double,gh_double2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(float,gh_number_p, gh_scm2double,gh_double2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, bool,gh_boolean_p, gh_scm2bool,SWIG_bool2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, int,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, short,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, long,gh_number_p, gh_scm2long,gh_long2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, unsigned int,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, unsigned short,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, unsigned long,gh_number_p, gh_scm2ulong,gh_ulong2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, double,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, float,gh_number_p, gh_scm2double,gh_double2scm); specialize_std_pair_on_both(std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm, std::string,gh_string_p, SWIG_scm2string,SWIG_string2scm); } 0707010008e7bc000081a40000000000000000000000014caec28600000cfd000000b600010002ffffffffffffffff0000003700000000root/usr/local/share/swig/2.0.1/guile/pointer-in-out.i/* ----------------------------------------------------------------------------- * pointer-in-out.i * * Guile typemaps for passing pointers indirectly * ----------------------------------------------------------------------------- */ /* Here is a macro that will define typemaps for passing C pointers indirectly. TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) Supported calling conventions (in this example, PTRTYPE is int *): func(int **INPUT) Scheme wrapper will take one argument, a wrapped C pointer. The address of a variable containing this pointer will be passed to the function. func(int **INPUT_CONSUMED) Likewise, but mark the pointer object as not garbage collectable. func(int **INPUT_DESTROYED) Likewise, but mark the pointer object as destroyed. func(int **OUTPUT) Scheme wrapper will take no arguments. The address of an int * variable will be passed to the function. The function is expected to modify the variable; its value is wrapped and becomes an extra return value. (See the documentation on how to deal with multiple values.) func(int **OUTPUT_NONCOLLECTABLE) Likewise, but make the pointer object not garbage collectable. func(int **BOTH) func(int **INOUT) This annotation combines INPUT and OUTPUT. */ %define TYPEMAP_POINTER_INPUT_OUTPUT(PTRTYPE, SCM_TYPE) %typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE *INPUT(PTRTYPE temp) { if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { scm_wrong_type_arg(FUNC_NAME, $argnum, $input); } $1 = &temp; } %typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_CONSUMED(PTRTYPE temp) { if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { scm_wrong_type_arg(FUNC_NAME, $argnum, $input); } SWIG_Guile_MarkPointerNoncollectable($input); $1 = &temp; } %typemap(in, doc="$NAME is of type <" #SCM_TYPE "> and is consumed by the function") PTRTYPE *INPUT_DESTROYED(PTRTYPE temp) { if (SWIG_ConvertPtr($input, (void **) &temp, $*descriptor, 0)) { scm_wrong_type_arg(FUNC_NAME, $argnum, $input); } SWIG_Guile_MarkPointerDestroyed($input); $1 = &temp; } %typemap(in, numinputs=0) PTRTYPE *OUTPUT(PTRTYPE temp), PTRTYPE *OUTPUT_NONCOLLECTABLE(PTRTYPE temp) "$1 = &temp;"; %typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 1));"; %typemap(argout, doc="<" #SCM_TYPE ">") PTRTYPE *OUTPUT_NONCOLLECTABLE "SWIG_APPEND_VALUE(SWIG_NewPointerObj(*$1, $*descriptor, 0));"; %typemap(in) PTRTYPE *BOTH = PTRTYPE *INPUT; %typemap(argout) PTRTYPE *BOTH = PTRTYPE *OUTPUT; %typemap(in) PTRTYPE *INOUT = PTRTYPE *INPUT; %typemap(argout) PTRTYPE *INOUT = PTRTYPE *OUTPUT; /* As a special convenience measure, also attach docs involving SCM_TYPE to the standard pointer typemaps */ %typemap(in, doc="$NAME is of type <" #SCM_TYPE ">") PTRTYPE { if (SWIG_ConvertPtr($input, (void **) &$1, $descriptor, 0)) scm_wrong_type_arg(FUNC_NAME, $argnum, $input); } %typemap(out, doc="<" #SCM_TYPE ">") PTRTYPE { $result = SWIG_NewPointerObj ($1, $descriptor, $owner); } %enddef 0707010008e7b9000081a40000000000000000000000014caec2860000041c000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/guile/guilemain.i/* ----------------------------------------------------------------------------- * guilemain.i * * The main functions for a user augmented guile * version that can handle wrapped calls as generated by SWIG * ----------------------------------------------------------------------------- */ %{ #include #ifdef __cplusplus extern "C" { #endif /* Debugger interface (don't change the order of the following lines) */ #define GDB_TYPE SCM #include GDB_INTERFACE; static void inner_main(void *closure, int argc, char **argv) { #ifdef SWIGINIT SWIGINIT #else SWIG_init(); /* SWIG init function */ #endif scm_shell(argc, argv); /* scheme interpreter */ /* never reached: scm_shell will perform an exit */ } #ifdef __cplusplus } #endif int main(int argc, char **argv) { /* put any default initialisation code here: e.g. exit handlers */ scm_boot_guile(argc, argv, inner_main, 0); /* make a stack entry for the garbage collector */ return 0; /* never reached, but avoids a warning */ } %} 0707010008e7c4000081a40000000000000000000000014caec28600004166000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/guile/std_vector.i/* ----------------------------------------------------------------------------- * std_vector.i * * SWIG typemaps for std::vector * ----------------------------------------------------------------------------- */ %include // ------------------------------------------------------------------------ // std::vector // // The aim of all that follows would be to integrate std::vector with // Guile as much as possible, namely, to allow the user to pass and // be returned Guile vectors or lists. // const declarations are used to guess the intent of the function being // exported; therefore, the following rationale is applied: // // -- f(std::vector), f(const std::vector&), f(const std::vector*): // the parameter being read-only, either a Guile sequence or a // previously wrapped std::vector can be passed. // -- f(std::vector&), f(std::vector*): // the parameter must be modified; therefore, only a wrapped std::vector // can be passed. // -- std::vector f(): // the vector is returned by copy; therefore, a Guile vector of T:s // is returned which is most easily used in other Guile functions // -- std::vector& f(), std::vector* f(), const std::vector& f(), // const std::vector* f(): // the vector is returned by reference; therefore, a wrapped std::vector // is returned // ------------------------------------------------------------------------ %{ #include #include #include %} // exported class namespace std { template class vector { %typemap(in) vector { if (gh_vector_p($input)) { unsigned long size = gh_vector_length($input); $1 = std::vector(size); for (unsigned long i=0; i(); } else if (gh_pair_p($input)) { SCM head, tail; $1 = std::vector(); tail = $input; while (!gh_null_p(tail)) { head = gh_car(tail); tail = gh_cdr(tail); $1.push_back(*((T*)SWIG_MustGetPtr(head, $descriptor(T *), $argnum, 0))); } } else { $1 = *(($&1_type) SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); } } %typemap(in) const vector& (std::vector temp), const vector* (std::vector temp) { if (gh_vector_p($input)) { unsigned long size = gh_vector_length($input); temp = std::vector(size); $1 = &temp; for (unsigned long i=0; i(); $1 = &temp; } else if (gh_pair_p($input)) { temp = std::vector(); $1 = &temp; SCM head, tail; tail = $input; while (!gh_null_p(tail)) { head = gh_car(tail); tail = gh_cdr(tail); temp.push_back(*((T*) SWIG_MustGetPtr(head, $descriptor(T *), $argnum, 0))); } } else { $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); } } %typemap(out) vector { $result = gh_make_vector(gh_long2scm($1.size()),SCM_UNSPECIFIED); for (unsigned int i=0; i<$1.size(); i++) { T* x = new T((($1_type &)$1)[i]); gh_vector_set_x($result,gh_long2scm(i), SWIG_NewPointerObj(x, $descriptor(T *), 1)); } } %typecheck(SWIG_TYPECHECK_VECTOR) vector { /* native sequence? */ if (gh_vector_p($input)) { unsigned int size = gh_vector_length($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ SCM o = gh_vector_ref($input,gh_ulong2scm(0)); T* x; if (SWIG_ConvertPtr(o,(void**) &x, $descriptor(T *), 0) != -1) $1 = 1; else $1 = 0; } } else if (gh_null_p($input)) { /* again, an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { /* check the first element only */ T* x; SCM head = gh_car($input); if (SWIG_ConvertPtr(head,(void**) &x, $descriptor(T *), 0) != -1) $1 = 1; else $1 = 0; } else { /* wrapped vector? */ std::vector* v; if (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor, 0) != -1) $1 = 1; else $1 = 0; } } %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, const vector* { /* native sequence? */ if (gh_vector_p($input)) { unsigned int size = gh_vector_length($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; SCM o = gh_vector_ref($input,gh_ulong2scm(0)); if (SWIG_ConvertPtr(o,(void**) &x, $descriptor(T *), 0) != -1) $1 = 1; else $1 = 0; } } else if (gh_null_p($input)) { /* again, an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { /* check the first element only */ T* x; SCM head = gh_car($input); if (SWIG_ConvertPtr(head,(void**) &x, $descriptor(T *), 0) != -1) $1 = 1; else $1 = 0; } else { /* wrapped vector? */ std::vector* v; if (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor, 0) != -1) $1 = 1; else $1 = 0; } } public: vector(unsigned int size = 0); vector(unsigned int size, const T& value); vector(const vector&); %rename(length) size; unsigned int size() const; %rename("empty?") empty; bool empty() const; %rename("clear!") clear; void clear(); %rename("set!") set; %rename("pop!") pop; %rename("push!") push_back; void push_back(const T& x); %extend { T pop() throw (std::out_of_range) { if (self->size() == 0) throw std::out_of_range("pop from empty vector"); T x = self->back(); self->pop_back(); return x; } const T& ref(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i class vector { %typemap(in) vector { if (gh_vector_p($input)) { unsigned long size = gh_vector_length($input); $1 = std::vector(size); for (unsigned long i=0; i(); } else if (gh_pair_p($input)) { SCM v = gh_list_to_vector($input); unsigned long size = gh_vector_length(v); $1 = std::vector(size); for (unsigned long i=0; i& (std::vector temp), const vector* (std::vector temp) { if (gh_vector_p($input)) { unsigned long size = gh_vector_length($input); temp = std::vector(size); $1 = &temp; for (unsigned long i=0; i(); $1 = &temp; } else if (gh_pair_p($input)) { SCM v = gh_list_to_vector($input); unsigned long size = gh_vector_length(v); temp = std::vector(size); $1 = &temp; for (unsigned long i=0; i { $result = gh_make_vector(gh_long2scm($1.size()),SCM_UNSPECIFIED); for (unsigned int i=0; i<$1.size(); i++) { SCM x = CONVERT_TO((($1_type &)$1)[i]); gh_vector_set_x($result,gh_long2scm(i),x); } } %typecheck(SWIG_TYPECHECK_VECTOR) vector { /* native sequence? */ if (gh_vector_p($input)) { unsigned int size = gh_vector_length($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; SCM o = gh_vector_ref($input,gh_ulong2scm(0)); $1 = CHECK(o) ? 1 : 0; } } else if (gh_null_p($input)) { /* again, an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { /* check the first element only */ T* x; SCM head = gh_car($input); $1 = CHECK(head) ? 1 : 0; } else { /* wrapped vector? */ std::vector* v; $1 = (SWIG_ConvertPtr($input,(void **) &v, $&1_descriptor, 0) != -1) ? 1 : 0; } } %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, const vector* { /* native sequence? */ if (gh_vector_p($input)) { unsigned int size = gh_vector_length($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; SCM o = gh_vector_ref($input,gh_ulong2scm(0)); $1 = CHECK(o) ? 1 : 0; } } else if (gh_null_p($input)) { /* again, an empty sequence can be of any type */ $1 = 1; } else if (gh_pair_p($input)) { /* check the first element only */ T* x; SCM head = gh_car($input); $1 = CHECK(head) ? 1 : 0; } else { /* wrapped vector? */ std::vector* v; $1 = (SWIG_ConvertPtr($input,(void **) &v, $1_descriptor, 0) != -1) ? 1 : 0; } } public: vector(unsigned int size = 0); vector(unsigned int size, const T& value); vector(const vector&); %rename(length) size; unsigned int size() const; %rename("empty?") empty; bool empty() const; %rename("clear!") clear; void clear(); %rename("set!") set; %rename("pop!") pop; %rename("push!") push_back; void push_back(T x); %extend { T pop() throw (std::out_of_range) { if (self->size() == 0) throw std::out_of_range("pop from empty vector"); T x = self->back(); self->pop_back(); return x; } T ref(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i %include %runtime %{ #define GUILE_MAYBE_VALUES \ if (gswig_list_p) gswig_result = scm_values(gswig_result); #define GUILE_MAYBE_VECTOR \ if (gswig_list_p) gswig_result = scm_vector(gswig_result); #define SWIG_APPEND_VALUE(object) \ if (gswig_result == SCM_UNSPECIFIED) \ gswig_result = object; \ else { \ if (!gswig_list_p) { \ gswig_list_p = 1; \ gswig_result = scm_listify(gswig_result, object, SCM_UNDEFINED); \ } \ else \ gswig_result = scm_append(scm_listify(gswig_result, scm_listify(object, SCM_UNDEFINED), SCM_UNDEFINED)); \ } /* used by Lib/exception.i */ #define gh_symbol2scm scm_str2symbol /* useb by Lib/cdata.i */ #define gh_str2scm scm_mem2string %} %insert(init) "swiginit.swg" %init %{ SWIG_GUILE_INIT_STATIC void SWIG_init(void) { SWIG_InitializeModule(0); SWIG_PropagateClientData(); %} 0707010008e7c5000081a40000000000000000000000014caec28600000165000000b600010002ffffffffffffffff0000002c00000000root/usr/local/share/swig/2.0.1/guile/stl.i/* ----------------------------------------------------------------------------- * stl.i * * Initial STL definition. extended as needed in each language * ----------------------------------------------------------------------------- */ %include %include %include %include %include 0707010008e7b3000081a40000000000000000000000014caec28600000695000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/guile/ghinterface.i#define gh_append2(a, b) scm_append(scm_listify(a, b, SCM_UNDEFINED)) #define gh_apply(a, b) scm_apply(a, b, SCM_EOL) #define gh_bool2scm SCM_BOOL #define gh_boolean_p SCM_BOOLP #define gh_car SCM_CAR #define gh_cdr SCM_CDR #define gh_cons scm_cons #define gh_double2scm scm_make_real #define gh_int2scm scm_long2num #define gh_length(lst) scm_num2ulong(scm_length(lst), SCM_ARG1, FUNC_NAME) #define gh_list scm_listify #define gh_list_to_vector scm_vector #define gh_make_vector scm_make_vector #define gh_null_p SCM_NULLP #define gh_number_p SCM_NUMBERP #define gh_pair_p SCM_CONSP #define gh_scm2bool SCM_NFALSEP #define gh_scm2char SCM_CHAR #define gh_scm2double(a) scm_num2dbl(a, FUNC_NAME) #define gh_scm2int(a) scm_num2int(a, SCM_ARG1, FUNC_NAME) #define gh_scm2long(a) scm_num2long(a, SCM_ARG1, FUNC_NAME) #define gh_scm2short(a) scm_num2short(a, SCM_ARG1, FUNC_NAME) #define gh_scm2newstr SWIG_Guile_scm2newstr #define gh_scm2ulong(a) scm_num2ulong(a, SCM_ARG1, FUNC_NAME) #define gh_scm2ushort(a) scm_num2ushort(a, SCM_ARG1, FUNC_NAME) #define gh_scm2uint(a) scm_num2uint(a, SCM_ARG1, FUNC_NAME) #define gh_ulong2scm scm_ulong2num #define gh_long2scm scm_long2num #define gh_str02scm scm_makfrom0str #define gh_long_long2scm scm_long_long2num #define gh_scm2long_long(a) scm_num2long_long(a, SCM_ARG1, FUNC_NAME) #define gh_ulong_long2scm scm_ulong_long2num #define gh_scm2ulong_long(a) scm_num2ulong_long(a, SCM_ARG1, FUNC_NAME) #define gh_string_p SCM_STRINGP #define gh_vector_length SCM_VECTOR_LENGTH #define gh_vector_p SCM_VECTORP #define gh_vector_ref scm_vector_ref #define gh_vector_set_x scm_vector_set_x #define gh_char2scm SCM_MAKE_CHAR 0707010008e7bf000081a40000000000000000000000014caec2860000001c000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/guile/std_deque.i%include 0707010008e7b5000081a40000000000000000000000014caec2860000082d000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/guile/guile_gh.swg/* ----------------------------------------------------------------------------- * guile_gh.swg * * This SWIG interface file is processed if the Guile module is run * with gh_ flavor. * ----------------------------------------------------------------------------- */ #define SWIGGUILE_GH %runtime "swigrun.swg" %runtime "guile_gh_run.swg" #define SWIG_convert_short(o) \ SWIG_convert_integer(o, - (1 << (8 * sizeof(short) - 1)), \ (1 << (8 * sizeof(short) - 1)) - 1, \ FUNC_NAME, $argnum) #define SWIG_convert_unsigned_short(o) \ SWIG_convert_unsigned_integer(o, 0, \ (1 << (8 * sizeof(short))) - 1, \ FUNC_NAME, $argnum) #define SWIG_convert_unsigned_int(o) \ SWIG_convert_unsigned_integer(o, 0, UINT_MAX, \ FUNC_NAME, $argnum) #define gh_scm2short(a) SWIG_convert_short(a) #define gh_scm2ushort(a) SWIG_convert_unsigned_short(a) #define gh_scm2uint(a) SWIG_convert_unsigned_int(a) %include %runtime %{ /* scm_values was implemented on C level in 1.4.1, and the prototype is not included in libguile.h, so play safe and lookup `values'... */ #define GUILE_MAYBE_VALUES \ if (gswig_list_p) \ gswig_result = gh_apply(gh_lookup("values"), gswig_result); #define GUILE_MAYBE_VECTOR \ if (gswig_list_p) \ gswig_result = gh_list_to_vector(gswig_result); #define SWIG_APPEND_VALUE(object) \ if (gswig_result == SCM_UNSPECIFIED) { \ gswig_result = object; \ } else { \ if (!gswig_list_p) { \ gswig_list_p = 1; \ gswig_result = gh_list(gswig_result, object, SCM_UNDEFINED); \ } \ else \ gswig_result = gh_append2(gswig_result, \ gh_list(object, SCM_UNDEFINED)); \ } %} %init "swiginit.swg" %init %{ static int _swig_module_smob_tag; SWIG_GUILE_INIT_STATIC void SWIG_init(void) { SWIG_InitializeModule(0); swig_module.clientdata = (void *) &_swig_module_smob_tag; SWIG_Guile_Init(&swig_module); %} 0707010008e7be000081a40000000000000000000000014caec2860000023e000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/guile/std_common.i/* ----------------------------------------------------------------------------- * std_common.i * * SWIG typemaps for STL - common utilities * ----------------------------------------------------------------------------- */ %include %apply size_t { std::size_t }; #define SWIG_bool2scm(b) gh_bool2scm(b ? 1 : 0) #define SWIG_string2scm(s) gh_str02scm(s.c_str()) %{ #include inline std::string SWIG_scm2string(SCM x) { char* temp; temp = SWIG_scm2str(x); std::string s(temp); if (temp) SWIG_free(temp); return s; } %} 0707010008e7bd000081a40000000000000000000000014caec28600000543000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/guile/ports.i/* ----------------------------------------------------------------------------- * ports.i * * Guile typemaps for handling ports * ----------------------------------------------------------------------------- */ %{ #ifndef _POSIX_SOURCE /* This is needed on Solaris for fdopen(). */ # define _POSIX_SOURCE 199506L #endif #include #include #include %} /* This typemap for FILE * accepts (1) FILE * pointer objects, (2) Scheme file ports. In this case, it creates a temporary C stream which reads or writes from a dup'ed file descriptor. */ %typemap(in, doc="$NAME is a file port or a FILE * pointer") FILE * ( int closep ) { if (SWIG_ConvertPtr($input, (void**) &($1), $1_descriptor, 0) == 0) { closep = 0; } else if(!(SCM_FPORTP($input))) scm_wrong_type_arg("$name", $argnum, $input); else { int fd; if (SCM_OUTPUT_PORT_P($input)) scm_force_output($input); fd=dup(SCM_FPORT_FDES($input)); if(fd==-1) scm_misc_error("$name", strerror(errno), SCM_EOL); $1=fdopen(fd, SCM_OUTPUT_PORT_P($input) ? (SCM_INPUT_PORT_P($input) ? "r+" : "w") : "r"); if($1==NULL) scm_misc_error("$name", strerror(errno), SCM_EOL); closep = 1; } } %typemap(freearg) FILE* { if (closep$argnum) fclose($1); } 0707010008e7b1000081a40000000000000000000000014caec28600000950000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/guile/common.scm;;;************************************************************************ ;;;*common.scm ;;;* ;;;* This file contains generic SWIG GOOPS classes for generated ;;;* GOOPS file support ;;;************************************************************************ (define-module (Swig swigrun)) (define-module (Swig common) #:use-module (oop goops) #:use-module (Swig swigrun)) (define-class () (new-function #:init-value #f)) (define-method (initialize (class ) initargs) (slot-set! class 'new-function (get-keyword #:new-function initargs #f)) (next-method)) (define-class () (swig-smob #:init-value #f) #:metaclass ) (define-method (initialize (obj ) initargs) (next-method) (slot-set! obj 'swig-smob (let ((arg (get-keyword #:init-smob initargs #f))) (if arg arg (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) ;; if the class is registered with runtime environment, ;; new-Function will return a goops class. In that case, extract the smob ;; from that goops class and set it as the current smob. (if (slot-exists? ret 'swig-smob) (slot-ref ret 'swig-smob) ret)))))) (define (display-address o file) (display (number->string (object-address o) 16) file)) (define (display-pointer-address o file) ;; Don't fail if the function SWIG-PointerAddress is not present. (let ((address (false-if-exception (SWIG-PointerAddress o)))) (if address (begin (display " @ " file) (display (number->string address 16) file))))) (define-method (write (o ) file) ;; We display _two_ addresses to show the object's identity: ;; * first the address of the GOOPS proxy object, ;; * second the pointer address. ;; The reason is that proxy objects are created and discarded on the ;; fly, so different proxy objects for the same C object will appear. (let ((class (class-of o))) (if (slot-bound? class 'name) (begin (display "#<" file) (display (class-name class) file) (display #\space file) (display-address o file) (display-pointer-address o file) (display ">" file)) (next-method)))) (export ) ;;; common.scm ends here 0707010008e7b8000081a40000000000000000000000014caec2860000356d000000b600010002ffffffffffffffff0000003800000000root/usr/local/share/swig/2.0.1/guile/guile_scm_run.swg/* ----------------------------------------------------------------------------- * guile_scm_run.swg * ----------------------------------------------------------------------------- */ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef SCM (*swig_guile_proc)(); typedef SCM (*guile_destructor)(SCM); typedef struct swig_guile_clientdata { guile_destructor destroy; SCM goops_class; } swig_guile_clientdata; #define SWIG_scm2str(s) \ SWIG_Guile_scm2newstr(s, NULL) #define SWIG_malloc(size) \ SCM_MUST_MALLOC(size) #define SWIG_free(mem) \ scm_must_free(mem) #define SWIG_ConvertPtr(s, result, type, flags) \ SWIG_Guile_ConvertPtr(s, result, type, flags) #define SWIG_MustGetPtr(s, type, argnum, flags) \ SWIG_Guile_MustGetPtr(s, type, argnum, flags, FUNC_NAME) #define SWIG_NewPointerObj(ptr, type, owner) \ SWIG_Guile_NewPointerObj((void*)ptr, type, owner) #define SWIG_PointerAddress(object) \ SWIG_Guile_PointerAddress(object) #define SWIG_PointerType(object) \ SWIG_Guile_PointerType(object) #define SWIG_IsPointerOfType(object, type) \ SWIG_Guile_IsPointerOfType(object, type) #define SWIG_IsPointer(object) \ SWIG_Guile_IsPointer(object) #define SWIG_contract_assert(expr, msg) \ if (!(expr)) \ scm_error(scm_str2symbol("swig-contract-assertion-failed"), \ (char *) FUNC_NAME, (char *) msg, \ SCM_EOL, SCM_BOOL_F); else /* for C++ member pointers, ie, member methods */ #define SWIG_ConvertMember(obj, ptr, sz, ty) \ SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME) #define SWIG_NewMemberObj(ptr, sz, type) \ SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME) /* Runtime API */ static swig_module_info *SWIG_Guile_GetModule(void); #define SWIG_GetModule(clientdata) SWIG_Guile_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer) SWIGINTERN char * SWIG_Guile_scm2newstr(SCM str, size_t *len) { #define FUNC_NAME "SWIG_Guile_scm2newstr" char *ret; size_t l; SCM_ASSERT (SCM_STRINGP(str), str, 1, FUNC_NAME); l = SCM_STRING_LENGTH(str); ret = (char *) SWIG_malloc( (l + 1) * sizeof(char)); if (!ret) return NULL; memcpy(ret, SCM_STRING_CHARS(str), l); ret[l] = '\0'; if (len) *len = l; return ret; #undef FUNC_NAME } static int swig_initialized = 0; static scm_t_bits swig_tag = 0; static scm_t_bits swig_collectable_tag = 0; static scm_t_bits swig_destroyed_tag = 0; static scm_t_bits swig_member_function_tag = 0; static SCM swig_make_func = SCM_EOL; static SCM swig_keyword = SCM_EOL; static SCM swig_symbol = SCM_EOL; #define SWIG_Guile_GetSmob(x) \ ( SCM_NNULLP(x) && SCM_INSTANCEP(x) && SCM_NFALSEP(scm_slot_exists_p(x, swig_symbol)) \ ? scm_slot_ref(x, swig_symbol) : (x) ) SWIGINTERN SCM SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner) { if (ptr == NULL) return SCM_EOL; else { SCM smob; swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata; if (owner) SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type); else SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) { return smob; } else { /* the scm_make() C function only handles the creation of gf, methods and classes (no instances) the (make ...) function is later redefined in goops.scm. So we need to call that Scheme function. */ return scm_apply(swig_make_func, scm_list_3(cdata->goops_class, swig_keyword, smob), SCM_EOL); } } } SWIGINTERN unsigned long SWIG_Guile_PointerAddress(SCM object) { SCM smob = SWIG_Guile_GetSmob(object); if (SCM_NULLP(smob)) return 0; else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { return (unsigned long) (void *) SCM_CELL_WORD_1(smob); } else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object); } SWIGINTERN swig_type_info * SWIG_Guile_PointerType(SCM object) { SCM smob = SWIG_Guile_GetSmob(object); if (SCM_NULLP(smob)) return NULL; else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { return (swig_type_info *) SCM_CELL_WORD_2(smob); } else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object); } SWIGINTERN int SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags) { swig_cast_info *cast; swig_type_info *from; SCM smob = SWIG_Guile_GetSmob(s); if (SCM_NULLP(smob)) { *result = NULL; return SWIG_OK; } else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { /* we do not accept smobs representing destroyed pointers */ from = (swig_type_info *) SCM_CELL_WORD_2(smob); if (!from) return SWIG_ERROR; if (type) { cast = SWIG_TypeCheckStruct(from, type); if (cast) { int newmemory = 0; *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob), &newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ return SWIG_OK; } else { return SWIG_ERROR; } } else { *result = (void *) SCM_CELL_WORD_1(smob); return SWIG_OK; } } return SWIG_ERROR; } SWIGINTERNINLINE void * SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type, int argnum, int flags, const char *func_name) { void *result; int res = SWIG_Guile_ConvertPtr(s, &result, type, flags); if (!SWIG_IsOK(res)) { /* type mismatch */ scm_wrong_type_arg((char *) func_name, argnum, s); } return result; } SWIGINTERNINLINE int SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type) { void *result; if (SWIG_Guile_ConvertPtr(s, &result, type, 0)) { /* type mismatch */ return 0; } else return 1; } SWIGINTERNINLINE int SWIG_Guile_IsPointer (SCM s) { /* module might not be initialized yet, so initialize it */ SWIG_Guile_GetModule(); return SWIG_Guile_IsPointerOfType (s, NULL); } /* Mark a pointer object non-collectable */ SWIGINTERN void SWIG_Guile_MarkPointerNoncollectable(SCM s) { SCM smob = SWIG_Guile_GetSmob(s); if (!SCM_NULLP(smob)) { if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { SCM_SET_CELL_TYPE(smob, swig_tag); } else scm_wrong_type_arg(NULL, 0, s); } } /* Mark a pointer object destroyed */ SWIGINTERN void SWIG_Guile_MarkPointerDestroyed(SCM s) { SCM smob = SWIG_Guile_GetSmob(s); if (!SCM_NULLP(smob)) { if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); } else scm_wrong_type_arg(NULL, 0, s); } } /* Member functions */ SWIGINTERN SCM SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type, const char *func_name) { SCM smob; void *copy = malloc(sz); memcpy(copy, ptr, sz); SCM_NEWSMOB2(smob, swig_member_function_tag, copy, (void *) type); return smob; } SWIGINTERN int SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type, const char *func_name) { swig_cast_info *cast; swig_type_info *from; if (SCM_SMOB_PREDICATE(swig_member_function_tag, smob)) { from = (swig_type_info *) SCM_CELL_WORD_2(smob); if (!from) return SWIG_ERROR; if (type) { cast = SWIG_TypeCheckStruct(from, type); if (!cast) return SWIG_ERROR; } memcpy(ptr, (void *) SCM_CELL_WORD_1(smob), sz); return SWIG_OK; } return SWIG_ERROR; } /* Init */ SWIGINTERN int print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, const char *attribute) { swig_type_info *type; type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); if (type) { scm_puts((char *) "#<", port); scm_puts((char *) attribute, port); scm_puts((char *) "swig-pointer ", port); scm_puts((char *) SWIG_TypePrettyName(type), port); scm_puts((char *) " ", port); scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port); scm_puts((char *) ">", port); /* non-zero means success */ return 1; } else { return 0; } } SWIGINTERN int print_swig (SCM swig_smob, SCM port, scm_print_state *pstate) { return print_swig_aux(swig_smob, port, pstate, ""); } SWIGINTERN int print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate) { return print_swig_aux(swig_smob, port, pstate, "collectable-"); } SWIGINTERN int print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate) { return print_swig_aux(swig_smob, port, pstate, "destroyed-"); } SWIGINTERN int print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate) { swig_type_info *type; type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob); if (type) { scm_puts((char *) "#<", port); scm_puts((char *) "swig-member-function-pointer ", port); scm_puts((char *) SWIG_TypePrettyName(type), port); scm_puts((char *) " >", port); /* non-zero means success */ return 1; } else { return 0; } } SWIGINTERN SCM equalp_swig (SCM A, SCM B) { if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B) && SCM_CELL_WORD_2(A) == SCM_CELL_WORD_2(B)) return SCM_BOOL_T; else return SCM_BOOL_F; } SWIGINTERN size_t free_swig(SCM A) { swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A); if (type) { if (type->clientdata && ((swig_guile_clientdata *)type->clientdata)->destroy) ((swig_guile_clientdata *)type->clientdata)->destroy(A); } return 0; } SWIGINTERN size_t free_swig_member_function(SCM A) { free((swig_type_info *) SCM_CELL_WORD_1(A)); return 0; } SWIGINTERN int ensure_smob_tag(SCM swig_module, scm_t_bits *tag_variable, const char *smob_name, const char *scheme_variable_name) { SCM variable = scm_sym2var(scm_str2symbol(scheme_variable_name), scm_module_lookup_closure(swig_module), SCM_BOOL_T); if (SCM_UNBNDP(SCM_VARIABLE_REF(variable))) { *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0); SCM_VARIABLE_SET(variable, scm_ulong2num(*tag_variable)); return 1; } else { *tag_variable = scm_num2ulong(SCM_VARIABLE_REF(variable), 0, "SWIG_Guile_Init"); return 0; } } SWIGINTERN SCM SWIG_Guile_Init () { static SCM swig_module; if (swig_initialized) return swig_module; swig_initialized = 1; swig_module = scm_c_resolve_module("Swig swigrun"); if (ensure_smob_tag(swig_module, &swig_tag, "swig-pointer", "swig-pointer-tag")) { scm_set_smob_print(swig_tag, print_swig); scm_set_smob_equalp(swig_tag, equalp_swig); } if (ensure_smob_tag(swig_module, &swig_collectable_tag, "collectable-swig-pointer", "collectable-swig-pointer-tag")) { scm_set_smob_print(swig_collectable_tag, print_collectable_swig); scm_set_smob_equalp(swig_collectable_tag, equalp_swig); scm_set_smob_free(swig_collectable_tag, free_swig); } if (ensure_smob_tag(swig_module, &swig_destroyed_tag, "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) { scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig); scm_set_smob_equalp(swig_destroyed_tag, equalp_swig); } if (ensure_smob_tag(swig_module, &swig_member_function_tag, "swig-member-function-pointer", "swig-member-function-pointer-tag")) { scm_set_smob_print(swig_member_function_tag, print_member_function_swig); scm_set_smob_free(swig_member_function_tag, free_swig_member_function); } swig_make_func = scm_permanent_object( scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make"))); swig_keyword = scm_permanent_object(scm_c_make_keyword((char*) "init-smob")); swig_symbol = scm_permanent_object(scm_str2symbol("swig-smob")); #ifdef SWIG_INIT_RUNTIME_MODULE SWIG_INIT_RUNTIME_MODULE #endif return swig_module; } SWIGINTERN swig_module_info * SWIG_Guile_GetModule(void) { SCM module; SCM variable; module = SWIG_Guile_Init(); variable = scm_sym2var(scm_str2symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME), scm_module_lookup_closure(module), SCM_BOOL_T); if (SCM_UNBNDP(SCM_VARIABLE_REF(variable))) { return NULL; } else { return (swig_module_info *) scm_num2ulong(SCM_VARIABLE_REF(variable), 0, "SWIG_Guile_Init"); } } SWIGINTERN void SWIG_Guile_SetModule(swig_module_info *swig_module) { SCM module; SCM variable; module = SWIG_Guile_Init(); variable = scm_sym2var(scm_str2symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME), scm_module_lookup_closure(module), SCM_BOOL_T); SCM_VARIABLE_SET(variable, scm_ulong2num((unsigned long) swig_module)); } SWIGINTERN int SWIG_Guile_GetArgs (SCM *dest, SCM rest, int reqargs, int optargs, const char *procname) { int i; int num_args_passed = 0; for (i = 0; i #ifdef __cplusplus extern "C" #endif SCM scm_init_Swig_swigrun_module (void); #define SWIG_INIT_RUNTIME_MODULE scm_init_Swig_swigrun_module(); %} /* The runtime type system from common.swg */ typedef struct swig_type_info swig_type_info; const char * SWIG_TypeName(const swig_type_info *type); const char * SWIG_TypePrettyName(const swig_type_info *type); swig_type_info * SWIG_TypeQuery(const char *); /* Language-specific stuff */ %apply bool { int }; int SWIG_IsPointer(SCM object); int SWIG_IsPointerOfType(SCM object, swig_type_info *type); unsigned long SWIG_PointerAddress(SCM object); swig_type_info * SWIG_PointerType(SCM object); #endif 0707010008e7c7000081a40000000000000000000000014caec28600003af3000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/guile/typemaps.i/* ----------------------------------------------------------------------------- * typemaps.i * * Guile-specific typemaps * ----------------------------------------------------------------------------- */ /* Pointers */ %typemap(in) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); } %typemap(freearg) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] ""; %typemap(in) void * { $1 = ($1_ltype)SWIG_MustGetPtr($input, NULL, $argnum, 0); } %typemap(freearg) void * ""; %typemap(varin) SWIGTYPE * { $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0); } %typemap(varin) SWIGTYPE & { $1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0)); } %typemap(varin) SWIGTYPE [] { scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); } %typemap(varin) SWIGTYPE [ANY] { void *temp; int ii; $1_basetype *b = 0; temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0); b = ($1_basetype *) $1; for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii); } %typemap(varin) void * { $1 = SWIG_MustGetPtr($input, NULL, 1, 0); } %typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { $result = SWIG_NewPointerObj ($1, $descriptor, $owner); } %typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1); $result = SWIG_NewPointerObj ($1, ty, $owner); } %typemap(varout) SWIGTYPE *, SWIGTYPE [] { $result = SWIG_NewPointerObj ($1, $descriptor, 0); } %typemap(varout) SWIGTYPE & { $result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0); } %typemap(throws) SWIGTYPE { $<ype temp = new $ltype($1); scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(SWIG_NewPointerObj(temp, $&descriptor, 1), SCM_UNDEFINED)); } %typemap(throws) SWIGTYPE & { scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(SWIG_NewPointerObj(&$1, $descriptor, 1), SCM_UNDEFINED)); } %typemap(throws) SWIGTYPE * { scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(SWIG_NewPointerObj($1, $descriptor, 1), SCM_UNDEFINED)); } %typemap(throws) SWIGTYPE [] { scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(SWIG_NewPointerObj($1, $descriptor, 1), SCM_UNDEFINED)); } /* Change of object ownership, and interaction of destructor-like functions and the garbage-collector */ %typemap(in, doc="$NAME is of type <$type> and gets destroyed by the function") SWIGTYPE *DESTROYED { $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); } %typemap(freearg) SWIGTYPE *DESTROYED { SWIG_Guile_MarkPointerDestroyed($input); } %typemap(in, doc="$NAME is of type <$type> and is consumed by the function") SWIGTYPE *CONSUMED { $1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0); SWIG_Guile_MarkPointerNoncollectable($input); } /* Pass-by-value */ %typemap(in) SWIGTYPE($&1_ltype argp) { argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0); $1 = *argp; } %typemap(varin) SWIGTYPE { $&1_ltype argp; argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, 1, 0); $1 = *argp; } %typemap(out) SWIGTYPE #ifdef __cplusplus { $&1_ltype resultptr; resultptr = new $1_ltype((const $1_ltype &) $1); $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1); } #else { $&1_ltype resultptr; resultptr = ($&1_ltype) malloc(sizeof($1_type)); memmove(resultptr, &$1, sizeof($1_type)); $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1); } #endif %typemap(varout) SWIGTYPE #ifdef __cplusplus { $&1_ltype resultptr; resultptr = new $1_ltype((const $1_ltype&) $1); $result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0); } #else { $&1_ltype resultptr; resultptr = ($&1_ltype) malloc(sizeof($1_type)); memmove(resultptr, &$1, sizeof($1_type)); $result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0); } #endif /* Enums */ %typemap(in) enum SWIGTYPE { $1 = ($1_type) gh_scm2int($input); } /* The complicated construction below needed to deal with anonymous enums, which cannot be cast to. */ %typemap(varin) enum SWIGTYPE { if (sizeof(int) != sizeof($1)) { scm_error(scm_str2symbol("swig-error"), (char *) FUNC_NAME, (char *) "enum variable '$name' cannot be set", SCM_EOL, SCM_BOOL_F); } * (int *) &($1) = gh_scm2int($input); } %typemap(out) enum SWIGTYPE { $result = gh_int2scm($1); } %typemap(varout) enum SWIGTYPE { $result = gh_int2scm($1); } %typemap(throws) enum SWIGTYPE { scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(gh_int2scm($1), SCM_UNDEFINED)); } /* The SIMPLE_MAP_WITH_EXPR macro below defines the whole set of typemaps needed for simple types. -- SCM_TO_C_EXPR is a C expression that translates the Scheme value "swig_scm_value" to a C value. -- C_TO_SCM_EXPR is a C expression that translates the C value "swig_c_value" to a Scheme value. */ %define SIMPLE_MAP_WITH_EXPR(C_NAME, SCM_TO_C_EXPR, C_TO_SCM_EXPR, SCM_NAME) %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") C_NAME { SCM swig_scm_value = $input; $1 = SCM_TO_C_EXPR; } %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") C_NAME { SCM swig_scm_value = $input; $1 = SCM_TO_C_EXPR; } %typemap (out, doc="<" #SCM_NAME ">") C_NAME { C_NAME swig_c_value = $1; $result = C_TO_SCM_EXPR; } %typemap (varout, doc="<" #SCM_NAME ">") C_NAME { C_NAME swig_c_value = $1; $result = C_TO_SCM_EXPR; } /* INPUT and OUTPUT */ %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") C_NAME *INPUT(C_NAME temp) { SCM swig_scm_value = $input; temp = (C_NAME) SCM_TO_C_EXPR; $1 = &temp; } %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp) {$1 = &temp;} %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT { C_NAME swig_c_value = *$1; SWIG_APPEND_VALUE(C_TO_SCM_EXPR); } %typemap (in) C_NAME *BOTH = C_NAME *INPUT; %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; %typemap (in) C_NAME *INOUT = C_NAME *INPUT; %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; /* Const primitive references. Passed by value */ %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) { SCM swig_scm_value = $input; temp = SCM_TO_C_EXPR; $1 = &temp; } %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & { C_NAME swig_c_value = *$1; $result = C_TO_SCM_EXPR; } /* Throw typemap */ %typemap(throws) C_NAME { C_NAME swig_c_value = $1; scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(C_TO_SCM_EXPR, SCM_UNDEFINED)); } %enddef /* The SIMPLE_MAP macro below defines the whole set of typemaps needed for simple types. It generates slightly simpler code than the macro above, but it is only suitable for very simple conversion expressions. */ %define SIMPLE_MAP(C_NAME, SCM_TO_C, C_TO_SCM, SCM_NAME) %typemap (in, doc="$NAME is of type <" #SCM_NAME ">") C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} %typemap (varin, doc="NEW-VALUE is of type <" #SCM_NAME ">") C_NAME {$1 = ($1_ltype) SCM_TO_C($input);} %typemap (out, doc="<" #SCM_NAME ">") C_NAME {$result = C_TO_SCM($1);} %typemap (varout, doc="<" #SCM_NAME ">") C_NAME {$result = C_TO_SCM($1);} /* INPUT and OUTPUT */ %typemap (in, doc="$NAME is of type <" #SCM_NAME ">)") C_NAME *INPUT(C_NAME temp), C_NAME &INPUT(C_NAME temp) { temp = (C_NAME) SCM_TO_C($input); $1 = &temp; } %typemap (in,numinputs=0) C_NAME *OUTPUT (C_NAME temp), C_NAME &OUTPUT(C_NAME temp) {$1 = &temp;} %typemap (argout,doc="$name (of type <" #SCM_NAME ">)") C_NAME *OUTPUT, C_NAME &OUTPUT {SWIG_APPEND_VALUE(C_TO_SCM(*$1));} %typemap (in) C_NAME *BOTH = C_NAME *INPUT; %typemap (argout) C_NAME *BOTH = C_NAME *OUTPUT; %typemap (in) C_NAME *INOUT = C_NAME *INPUT; %typemap (argout) C_NAME *INOUT = C_NAME *OUTPUT; %typemap (in) C_NAME &INOUT = C_NAME &INPUT; %typemap (argout) C_NAME &INOUT = C_NAME &OUTPUT; /* Const primitive references. Passed by value */ %typemap(in, doc="$NAME is of type <" #SCM_NAME ">") const C_NAME & (C_NAME temp) { temp = SCM_TO_C($input); $1 = ($1_ltype) &temp; } %typemap(out, doc="<" #SCM_NAME ">") const C_NAME & { $result = C_TO_SCM(*$1); } /* Throw typemap */ %typemap(throws) C_NAME { scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(C_TO_SCM($1), SCM_UNDEFINED)); } %enddef SIMPLE_MAP(bool, gh_scm2bool, gh_bool2scm, boolean); SIMPLE_MAP(char, gh_scm2char, gh_char2scm, char); SIMPLE_MAP(unsigned char, gh_scm2char, gh_char2scm, char); SIMPLE_MAP(signed char, gh_scm2char, gh_char2scm, char); SIMPLE_MAP(int, gh_scm2int, gh_int2scm, integer); SIMPLE_MAP(short, gh_scm2short, gh_int2scm, integer); SIMPLE_MAP(long, gh_scm2long, gh_long2scm, integer); SIMPLE_MAP(ptrdiff_t, gh_scm2long, gh_long2scm, integer); SIMPLE_MAP(unsigned int, gh_scm2uint, gh_ulong2scm, integer); SIMPLE_MAP(unsigned short, gh_scm2ushort, gh_ulong2scm, integer); SIMPLE_MAP(unsigned long, gh_scm2ulong, gh_ulong2scm, integer); SIMPLE_MAP(size_t, gh_scm2ulong, gh_ulong2scm, integer); SIMPLE_MAP(float, gh_scm2double, gh_double2scm, real); SIMPLE_MAP(double, gh_scm2double, gh_double2scm, real); // SIMPLE_MAP(char *, SWIG_scm2str, gh_str02scm, string); // SIMPLE_MAP(const char *, SWIG_scm2str, gh_str02scm, string); /* Define long long typemaps -- uses functions that are only defined in recent versions of Guile, availability also depends on Guile's configuration. */ SIMPLE_MAP(long long, gh_scm2long_long, gh_long_long2scm, integer); SIMPLE_MAP(unsigned long long, gh_scm2ulong_long, gh_ulong_long2scm, integer); /* Strings */ %typemap (in, doc="$NAME is a string") char *(int must_free = 0) { $1 = ($1_ltype)SWIG_scm2str($input); must_free = 1; } %typemap (varin, doc="NEW-VALUE is a string") char * {$1 = ($1_ltype)SWIG_scm2str($input);} %typemap (out, doc="") char * {$result = gh_str02scm((const char *)$1);} %typemap (varout, doc="") char * {$result = gh_str02scm($1);} %typemap (in, doc="$NAME is a string") char * *INPUT(char * temp, int must_free = 0) { temp = (char *) SWIG_scm2str($input); $1 = &temp; must_free = 1; } %typemap (in,numinputs=0) char * *OUTPUT (char * temp) {$1 = &temp;} %typemap (argout,doc="$NAME (a string)") char * *OUTPUT {SWIG_APPEND_VALUE(gh_str02scm(*$1));} %typemap (in) char * *BOTH = char * *INPUT; %typemap (argout) char * *BOTH = char * *OUTPUT; %typemap (in) char * *INOUT = char * *INPUT; %typemap (argout) char * *INOUT = char * *OUTPUT; /* SWIG_scm2str makes a malloc'ed copy of the string, so get rid of it after the function call. */ %typemap (freearg) char * "if (must_free$argnum && $1) SWIG_free($1);"; %typemap (freearg) char **INPUT, char **BOTH "if (must_free$argnum && (*$1)) SWIG_free(*$1);" %typemap (freearg) char **OUTPUT "SWIG_free(*$1);" /* But this shall not apply if we try to pass a single char by reference. */ %typemap (freearg) char *OUTPUT, char *BOTH ""; /* If we set a string variable, delete the old result first, unless const. */ %typemap (varin) char * { if ($1) free($1); $1 = ($1_ltype) SWIG_scm2str($input); } %typemap (varin) const char * { $1 = ($1_ltype) SWIG_scm2str($input); } %typemap(throws) char * { scm_throw(gh_symbol2scm((char *) "swig-exception"), gh_list(gh_str02scm($1), SCM_UNDEFINED)); } /* Void */ %typemap (out,doc="") void "gswig_result = SCM_UNSPECIFIED;"; /* SCM is passed through */ typedef unsigned long SCM; %typemap (in) SCM "$1=$input;"; %typemap (out) SCM "$result=$1;"; %typecheck(SWIG_TYPECHECK_POINTER) SCM "$1=1;"; /* ------------------------------------------------------------ * String & length * ------------------------------------------------------------ */ %typemap(in) (char *STRING, int LENGTH) { size_t temp; $1 = ($1_ltype) gh_scm2newstr($input, &temp); $2 = ($2_ltype) temp; } /* ------------------------------------------------------------ * CLASS::* (member function pointer) typemaps * taken from typemaps/swigtype.swg * ------------------------------------------------------------ */ #define %set_output(obj) $result = obj #define %set_varoutput(obj) $result = obj #define %argument_fail(code, type, name, argn) scm_wrong_type_arg((char *) FUNC_NAME, argn, $input); #define %as_voidptr(ptr) (void*)(ptr) %typemap(in) SWIGTYPE (CLASS::*) { int res = SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($type),$descriptor); if (!SWIG_IsOK(res)) { %argument_fail(res,"$type",$symname, $argnum); } } %typemap(out,noblock=1) SWIGTYPE (CLASS::*) { %set_output(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($type), $descriptor)); } %typemap(varin) SWIGTYPE (CLASS::*) { int res = SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($type), $descriptor); if (!SWIG_IsOK(res)) { scm_wrong_type_arg((char *) FUNC_NAME, 1, $input); } } %typemap(varout,noblock=1) SWIGTYPE (CLASS::*) { %set_varoutput(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($type), $descriptor)); } /* ------------------------------------------------------------ * Typechecking rules * ------------------------------------------------------------ */ /* adapted from python.swg */ %typecheck(SWIG_TYPECHECK_INTEGER) int, short, long, unsigned int, unsigned short, unsigned long, signed char, unsigned char, long long, unsigned long long, size_t, ptrdiff_t, std::size_t, std::ptrdiff_t, const int &, const short &, const long &, const unsigned int &, const unsigned short &, const unsigned long &, const long long &, const unsigned long long &, const size_t &, const ptrdiff_t &, const std::size_t &, const std::ptrdiff_t &, enum SWIGTYPE { $1 = SCM_NFALSEP(scm_integer_p($input)) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_BOOL) bool, bool&, const bool& { $1 = SCM_BOOLP($input) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_DOUBLE) float, double, const float &, const double & { $1 = SCM_NFALSEP(scm_real_p($input)) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_CHAR) char { $1 = SCM_CHARP($input) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_STRING) char * { $1 = SCM_STRINGP($input) ? 1 : 0; } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { void *ptr; int res = SWIG_ConvertPtr($input, &ptr, $1_descriptor, 0); $1 = SWIG_CheckState(res); } %typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { void *ptr; int res = SWIG_ConvertPtr($input, &ptr, $&descriptor, 0); $1 = SWIG_CheckState(res); } %typecheck(SWIG_TYPECHECK_VOIDPTR) void * { void *ptr; int res = SWIG_ConvertPtr($input, &ptr, 0, 0); $1 = SWIG_CheckState(res); } /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } /* const pointers */ %apply SWIGTYPE * { SWIGTYPE *const } /* typemaps.i ends here */ 0707010008e7b4000081a40000000000000000000000014caec28600000434000000b600010002ffffffffffffffff0000002e00000000root/usr/local/share/swig/2.0.1/guile/guile.i/* ----------------------------------------------------------------------------- * guile.i * * SWIG Configuration File for Guile. * ----------------------------------------------------------------------------- */ /* Macro for inserting Scheme code into the stub */ #define %scheme %insert("scheme") #define %goops %insert("goops") /* Return-styles */ %pragma(guile) return_nothing_doc = "Returns unspecified." %pragma(guile) return_one_doc = "Returns $values." %define %values_as_list %pragma(guile) beforereturn = "" %pragma(guile) return_multi_doc = "Returns a list of $num_values values: $values." %enddef %values_as_list /* the default style */ %define %values_as_vector %pragma(guile) beforereturn = "GUILE_MAYBE_VECTOR" %pragma(guile) return_multi_doc = "Returns a vector of $num_values values: $values." %enddef %define %multiple_values %pragma(guile) beforereturn = "GUILE_MAYBE_VALUES" %pragma(guile) return_multi_doc = "Returns $num_values values: $values." %enddef #define GUILE_APPEND_RESULT SWIG_APPEND_VALUE %include 0707010008e95a000081a40000000000000000000000014caec28400000c6e000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/swiglabels.swg/* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- */ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # elif defined(__HP_aCC) /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif /* attribute recognised by some compilers to avoid 'unused' warnings */ #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif #endif #ifndef SWIG_MSC_UNSUPPRESS_4505 # if defined(_MSC_VER) # pragma warning(disable : 4505) /* unreferenced local function has been removed */ # endif #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else # define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif /* internal inline SWIG method */ #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* exporting methods */ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) # ifndef GCC_HASCLASSVISIBILITY # define GCC_HASCLASSVISIBILITY # endif #endif #ifndef SWIGEXPORT # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(STATIC_LINKED) # define SWIGEXPORT # else # define SWIGEXPORT __declspec(dllexport) # endif # else # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) # define SWIGEXPORT __attribute__ ((visibility("default"))) # else # define SWIGEXPORT # endif # endif #endif /* calling conventions for Windows */ #ifndef SWIGSTDCALL # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL # endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) # define _SCL_SECURE_NO_DEPRECATE #endif 0707010008e882000041ed0000000000000000000000024caec29c00000000000000b600010002ffffffffffffffff0000002700000000root/usr/local/share/swig/2.0.1/python0707010008e8b4000081a40000000000000000000000014caec2860000001b000000b600010002ffffffffffffffff0000003300000000root/usr/local/share/swig/2.0.1/python/std_alloc.i%include 0707010008e88c000081a40000000000000000000000014caec28600000021000000b600010002ffffffffffffffff0000003200000000root/usr/local/share/swig/2.0.1/python/cpointer.i%include 0707010008e892000081a40000000000000000000000014caec28600000b32000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/python/embed15.i/* ----------------------------------------------------------------------------- * embed15.i * * SWIG file embedding the Python interpreter in something else. * This file is based on Python-1.5. It will not work with * earlier versions. * * This file makes it possible to extend Python and all of its * built-in functions without having to hack its setup script. * ----------------------------------------------------------------------------- */ #ifdef AUTODOC %subsection "embed.i" %text %{ This module provides support for building a new version of the Python executable. This will be necessary on systems that do not support shared libraries and may be necessary with C++ extensions. This file contains everything you need to build a new version of Python from include files and libraries normally installed with the Python language. This module will automatically grab all of the Python modules present in your current Python executable (including any special purpose modules you have enabled such as Tkinter). Thus, you may need to provide additional link libraries when compiling. This library file only works with Python 1.5. A version compatible with Python 1.4 is available as embed14.i and a Python1.3 version is available as embed13.i. As far as I know, this module is C++ safe. %} #else %echo "embed.i : Using Python 1.5" #endif %wrapper %{ #include #ifdef __cplusplus extern "C" #endif void SWIG_init(); /* Forward reference */ #define _PyImport_Inittab swig_inittab /* Grab Python's inittab[] structure */ #ifdef __cplusplus extern "C" { #endif #include #undef _PyImport_Inittab /* Now define our own version of it. Hopefully someone does not have more than 1000 built-in modules */ struct _inittab SWIG_Import_Inittab[1000]; static int swig_num_modules = 0; /* Function for adding modules to Python */ static void swig_add_module(char *name, void (*initfunc)()) { SWIG_Import_Inittab[swig_num_modules].name = name; SWIG_Import_Inittab[swig_num_modules].initfunc = initfunc; swig_num_modules++; SWIG_Import_Inittab[swig_num_modules].name = (char *) 0; SWIG_Import_Inittab[swig_num_modules].initfunc = 0; } /* Function to add all of Python's build in modules to our interpreter */ static void swig_add_builtin() { int i = 0; while (swig_inittab[i].name) { swig_add_module(swig_inittab[i].name, swig_inittab[i].initfunc); i++; } #ifdef SWIGMODINIT SWIGMODINIT #endif /* Add SWIG builtin function */ swig_add_module(SWIG_name, SWIG_init); } #ifdef __cplusplus } #endif #ifdef __cplusplus extern "C" { #endif extern int Py_Main(int, char **); #ifdef __cplusplus } #endif extern struct _inittab *PyImport_Inittab; int main(int argc, char **argv) { swig_add_builtin(); PyImport_Inittab = SWIG_Import_Inittab; return Py_Main(argc,argv); } %} 0707010008e88a000081a40000000000000000000000014caec2860000002a000000b600010002ffffffffffffffff0000002d00000000root/usr/local/share/swig/2.0.1/python/cni.i%include %include 0707010008e89a000081a40000000000000000000000014caec2860000048a000000b600010002ffffffffffffffff0000003600000000root/usr/local/share/swig/2.0.1/python/pybackward.swg/* adding backward compatibility macros */ #define SWIG_arg(x...) %arg(x) #define SWIG_Mangle(x...) %mangle(x) #define SWIG_As_frag(Type...) %fragment_name(As, Type) #define SWIG_As_name(Type...) %symbol_name(As, Type) #define SWIG_As(Type...) SWIG_As_name(Type) SWIG_AS_CALL_ARGS #define SWIG_Check_frag(Type...) %fragment_name(Check, Type) #define SWIG_Check_name(Type...) %symbol_name(Check, Type) #define SWIG_Check(Type...) SWIG_Check_name(Type) SWIG_AS_CALL_ARGS %define %ascheck_methods(Code, Type...) %fragment(SWIG_As_frag(Type),"header", fragment=SWIG_AsVal_frag(Type)) { SWIGINTERNINLINE Type SWIG_As(Type)(PyObject* obj) { Type v; int res = SWIG_AsVal(Type)(obj, &v); if (!SWIG_IsOK(res)) { /* this is needed to make valgrind/purify happier. */ memset((void*)&v, 0, sizeof(Type)); SWIG_Error(res, ""); } return v; } } %fragment(SWIG_Check_frag(Type),"header",fragment=SWIG_AsVal_frag(Type)) { SWIGINTERNINLINE int SWIG_Check(Type)(PyObject* obj) { int res = SWIG_AsVal(Type)(obj, (Type*)0); return SWIG_IsOK(res); } } %enddef %apply_checkctypes(%ascheck_methods) 0707010008e885000081a40000000000000000000000014caec28500003f0c000000b600010002ffffffffffffffff0000003a00000000root/usr/local/share/swig/2.0.1/python/boost_shared_ptr.i%include // Set SHARED_PTR_DISOWN to $disown if required, for example // #define SHARED_PTR_DISOWN $disown #if !defined(SHARED_PTR_DISOWN) #define SHARED_PTR_DISOWN 0 #endif // Language specific macro implementing all the customisations for handling the smart pointer %define SWIG_SHARED_PTR_TYPEMAPS(CONST, TYPE...) // %naturalvar is as documented for member variables %naturalvar TYPE; %naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; // destructor wrapper customisation %feature("unref") TYPE //"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n" "(void)arg1; delete smartarg1;" // Typemap customisations... // plain value %typemap(in) CONST TYPE (void *argp, int res = 0) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (!argp) { %argument_nullref("$type", $symname, $argnum); } else { $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); } } %typemap(out) CONST TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(($1_ltype &)$1)); %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } %typemap(varin) CONST TYPE { void *argp = 0; int newmem = 0; int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %variable_fail(res, "$type", "$name"); } if (!argp) { %argument_nullref("$type", $symname, $argnum); } else { $1 = *(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get()); if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); } } %typemap(varout) CONST TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(($1_ltype &)$1)); %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } // plain pointer // Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance %typemap(in) CONST TYPE * (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); $1 = %const_cast(tempshared.get(), $1_ltype); } else { smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); } } %typemap(out, fragment="SWIG_null_deleter") CONST TYPE * { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner) : 0; %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), $owner | SWIG_POINTER_OWN)); } %typemap(varin) CONST TYPE * { void *argp = 0; int newmem = 0; int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %variable_fail(res, "$type", "$name"); } SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0; if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); $1 = %const_cast(tempshared.get(), $1_ltype); } else { smartarg = %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); $1 = %const_cast((smartarg ? smartarg->get() : 0), $1_ltype); } } %typemap(varout, fragment="SWIG_null_deleter") CONST TYPE * { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_0) : 0; %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } // plain reference %typemap(in) CONST TYPE & (void *argp = 0, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (!argp) { %argument_nullref("$type", $symname, $argnum); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); $1 = %const_cast(tempshared.get(), $1_ltype); } else { $1 = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); } } %typemap(out, fragment="SWIG_null_deleter") CONST TYPE & { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1 SWIG_NO_NULL_DELETER_$owner); %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } %typemap(varin) CONST TYPE & { void *argp = 0; int newmem = 0; int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %variable_fail(res, "$type", "$name"); } SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared; if (!argp) { %argument_nullref("$type", $symname, $argnum); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); $1 = *%const_cast(tempshared.get(), $1_ltype); } else { $1 = *%const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $1_ltype); } } %typemap(varout, fragment="SWIG_null_deleter") CONST TYPE & { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(&$1 SWIG_NO_NULL_DELETER_0); %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } // plain pointer by reference // Note: $disown not implemented by default as it will lead to a memory leak of the shared_ptr instance %typemap(in) TYPE *CONST& (void *argp = 0, int res = 0, $*1_ltype temp = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SHARED_PTR_DISOWN | %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared = *%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); delete %reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *); temp = %const_cast(tempshared.get(), $*1_ltype); } else { temp = %const_cast(%reinterpret_cast(argp, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *)->get(), $*1_ltype); } $1 = &temp; } %typemap(out, fragment="SWIG_null_deleter") TYPE *CONST& { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1 SWIG_NO_NULL_DELETER_$owner); %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } %typemap(varin) TYPE *CONST& %{ #error "varin typemap not implemented" %} %typemap(varout) TYPE *CONST& %{ #error "varout typemap not implemented" %} // shared_ptr by value %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > (void *argp, int res = 0) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (argp) $1 = *(%reinterpret_cast(argp, $<ype)); if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); } %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } %typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { int newmem = 0; void *argp = 0; int res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %variable_fail(res, "$type", "$name"); } $1 = argp ? *(%reinterpret_cast(argp, $<ype)) : SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE >(); if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $<ype); } %typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >($1) : 0; %set_varoutput(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } // shared_ptr by reference %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & (void *argp, int res = 0, $*1_ltype tempshared) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (newmem & SWIG_CAST_NEW_MEMORY) { if (argp) tempshared = *%reinterpret_cast(argp, $ltype); delete %reinterpret_cast(argp, $ltype); $1 = &tempshared; } else { $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; } } %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } %typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ #error "varin typemap not implemented" %} %typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > & %{ #error "varout typemap not implemented" %} // shared_ptr by pointer %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * (void *argp, int res = 0, $*1_ltype tempshared) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (newmem & SWIG_CAST_NEW_MEMORY) { if (argp) tempshared = *%reinterpret_cast(argp, $ltype); delete %reinterpret_cast(argp, $ltype); $1 = &tempshared; } else { $1 = (argp) ? %reinterpret_cast(argp, $ltype) : &tempshared; } } %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = $1 && *$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(*$1) : 0; %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); if ($owner) delete $1; } %typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ #error "varin typemap not implemented" %} %typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > * %{ #error "varout typemap not implemented" %} // shared_ptr by pointer reference %typemap(in) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& (void *argp, int res = 0, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > tempshared, $*1_ltype temp = 0) { int newmem = 0; res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), %convertptr_flags, &newmem); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (argp) tempshared = *%reinterpret_cast(argp, $*ltype); if (newmem & SWIG_CAST_NEW_MEMORY) delete %reinterpret_cast(argp, $*ltype); temp = &tempshared; $1 = &temp; } %typemap(out) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartresult = *$1 && **$1 ? new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(**$1) : 0; %set_output(SWIG_NewPointerObj(%as_voidptr(smartresult), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN)); } %typemap(varin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ #error "varin typemap not implemented" %} %typemap(varout) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& %{ #error "varout typemap not implemented" %} // Typecheck typemaps // Note: SWIG_ConvertPtr with void ** parameter set to 0 instead of using SWIG_ConvertPtrAndOwn, so that the casting // function is not called thereby avoiding a possible smart pointer copy constructor call when casting up the inheritance chain. %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) TYPE CONST, TYPE CONST &, TYPE CONST *, TYPE *CONST&, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > &, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *, SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *& { int res = SWIG_ConvertPtr($input, 0, $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), 0); $1 = SWIG_CheckState(res); } // various missing typemaps - If ever used (unlikely) ensure compilation error rather than runtime bug %typemap(in) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %typemap(out) CONST TYPE[], CONST TYPE[ANY], CONST TYPE (CLASS::*) %{ #error "typemaps for $1_type not available" %} %template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >; %enddef 0707010008e8ae000081a40000000000000000000000014caec28600000931000000b600010002ffffffffffffffff0000003400000000root/usr/local/share/swig/2.0.1/python/pythonkw.swg/* Warnings for Python keywords, built-in names and bad names. */ #define PYTHONKW(x) %keywordwarn("'" `x` "' is a python keyword, renaming to '_" `x` "'", rename="_%s") `x` #define PYTHONBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in python") "::"`x` /* Warnings for Python keywords http://www.fnorb.org/docs/1.2/Fnorb-Guide/node62.html */ PYTHONKW(and); PYTHONKW(assert); PYTHONKW(break); PYTHONKW(class); PYTHONKW(continue); PYTHONKW(def); PYTHONKW(del); PYTHONKW(elif); PYTHONKW(else); PYTHONKW(except); PYTHONKW(exec); PYTHONKW(finally); PYTHONKW(for); PYTHONKW(from); PYTHONKW(global); PYTHONKW(if); PYTHONKW(import); PYTHONKW(in); PYTHONKW(is); PYTHONKW(lambda); PYTHONKW(not); PYTHONKW(or); PYTHONKW(pass); PYTHONKW(print); PYTHONKW(raise); PYTHONKW(return); PYTHONKW(try); PYTHONKW(while); PYTHONKW(yield); /* built-in functions http://www.zvon.org/other/python/doc21/lib/built-in-funcs.html */ PYTHONBN(abs); PYTHONBN(apply); PYTHONBN(bool); PYTHONBN(buffer); PYTHONBN(callable); PYTHONBN(chr); PYTHONBN(classmethod); PYTHONBN(cmp); PYTHONBN(coerce); PYTHONBN(compile); PYTHONBN(complex); PYTHONBN(delattr); PYTHONBN(dict); PYTHONBN(dir); PYTHONBN(divmod); PYTHONBN(enumerate); PYTHONBN(eval); PYTHONBN(execfile); PYTHONBN(file); PYTHONBN(filter); PYTHONBN(float); PYTHONBN(frozenset); PYTHONBN(getattr); PYTHONBN(globals); PYTHONBN(hasattr); PYTHONBN(hash); PYTHONBN(hex); PYTHONBN(id); PYTHONBN(input); PYTHONBN(int); PYTHONBN(intern); PYTHONBN(isinstance); PYTHONBN(issubclass); PYTHONBN(iter); PYTHONBN(len); PYTHONBN(list); PYTHONBN(locals); PYTHONBN(long); PYTHONBN(map); PYTHONBN(max); PYTHONBN(min); PYTHONBN(object); PYTHONBN(oct); PYTHONBN(open); PYTHONBN(ord); PYTHONBN(pow); PYTHONBN(property); PYTHONBN(range); PYTHONBN(raw_input); PYTHONBN(reduce); PYTHONBN(reload); PYTHONBN(repr); PYTHONBN(reversed); PYTHONBN(round); PYTHONBN(set); PYTHONBN(setattr); PYTHONBN(slice); PYTHONBN(sorted); PYTHONBN(staticmethod); PYTHONBN(staticmethod); PYTHONBN(str); PYTHONBN(sum); PYTHONBN(super); PYTHONBN(tuple); PYTHONBN(type); PYTHONBN(unichr); PYTHONBN(unicode); PYTHONBN(vars); PYTHONBN(xrange); PYTHONBN(zip); /* built-in names boolean type and None */ PYTHONBN(True); PYTHONBN(False); PYTHONBN(None); /* 'self' is also a bad Name */ PYTHONBN(self); #undef PYTHONBN #undef PYTHONKW 0707010008e8d2000081a40000000000000000000000014caec286000000ba000000b600010002ffffffffffffffff0000002f00000000root/usr/local/share/swig/2.0.1/python/wchar.i#ifdef __cplusplus %{ #include %} #else %{ #include %} #endif %types(wchar_t *); %include /* Enable swig wchar support. */ #define SWIG_WCHAR 0707010008e897000081a40000000000000000000000014caec286000006df000000b600010002ffffffffffffffff0000003100000000root/usr/local/share/swig/2.0.1/python/jstring.i%include %fragment(SWIG_AsVal_frag(jstring),"header") { SWIGINTERN int SWIG_AsVal(jstring)(PyObject *obj, jstring *val) { if (obj == Py_None) { if (val) *val = 0; return SWIG_OK; } PyObject *tmp = 0; int isunicode = PyUnicode_Check(obj); if (!isunicode && PyString_Check(obj)) { if (val) { obj = tmp = PyUnicode_FromObject(obj); } isunicode = 1; } if (isunicode) { if (val) { if (sizeof(Py_UNICODE) == sizeof(jchar)) { *val = JvNewString((const jchar *) PyUnicode_AS_UNICODE(obj),PyUnicode_GET_SIZE(obj)); return SWIG_NEWOBJ; } else { int len = PyUnicode_GET_SIZE(obj); Py_UNICODE *pchars = PyUnicode_AS_UNICODE(obj); *val = JvAllocString (len); jchar *jchars = JvGetStringChars (*val); for (int i = 0; i < len; ++i) { jchars[i] = pchars[i]; } return SWIG_NEWOBJ; } } Py_XDECREF(tmp); return SWIG_OK; } return SWIG_TypeError; } } %fragment(SWIG_From_frag(jstring),"header") { SWIGINTERNINLINE PyObject * SWIG_From(jstring)(jstring val) { if (!val) { return SWIG_Py_Void(); } if (sizeof(Py_UNICODE) == sizeof(jchar)) { return PyUnicode_FromUnicode((const Py_UNICODE *) JvGetStringChars(val), JvGetStringUTFLength(val)); } else { int len = JvGetStringUTFLength(val); Py_UNICODE pchars[len]; jchar *jchars = JvGetStringChars(val); for (int i = 0; i < len; i++) { pchars[i] = jchars[i]; } return PyUnicode_FromUnicode((const Py_UNICODE *) pchars, len); } } } %typemaps_asvalfrom(%checkcode(STRING), %arg(SWIG_AsVal(jstring)), %arg(SWIG_From(jstring)), %arg(SWIG_AsVal_frag(jstring)), %arg(SWIG_From_frag(jstring)), java::lang::String *); 0707010008e8ab000081a40000000000000000000000014caec28600001ad7000000b600010002ffffffffffffffff0000003700000000root/usr/local/share/swig/2.0.1/python/pystdcommon.swg%fragment("StdTraits","header",fragment="StdTraitsCommon") { namespace swig { /* Traits that provides the from method */ template struct traits_from_ptr { static PyObject *from(Type *val, int owner = 0) { return SWIG_NewPointerObj(val, type_info(), owner); } }; template struct traits_from { static PyObject *from(const Type& val) { return traits_from_ptr::from(new Type(val), 1); } }; template struct traits_from { static PyObject *from(Type* val) { return traits_from_ptr::from(val, 0); } }; template struct traits_from { static PyObject *from(const Type* val) { return traits_from_ptr::from(const_cast(val), 0); } }; template inline PyObject *from(const Type& val) { return traits_from::from(val); } template inline PyObject *from_ptr(Type* val, int owner) { return traits_from_ptr::from(val, owner); } /* Traits that provides the asval/as/check method */ template struct traits_asptr { static int asptr(PyObject *obj, Type **val) { Type *p; int res = SWIG_ConvertPtr(obj, (void**)&p, type_info(), 0); if (SWIG_IsOK(res)) { if (val) *val = p; } return res; } }; template inline int asptr(PyObject *obj, Type **vptr) { return traits_asptr::asptr(obj, vptr); } template struct traits_asval { static int asval(PyObject *obj, Type *val) { if (val) { Type *p = 0; int res = traits_asptr::asptr(obj, &p); if (!SWIG_IsOK(res)) return res; if (p) { typedef typename noconst_traits::noconst_type noconst_type; *(const_cast(val)) = *p; if (SWIG_IsNewObj(res)){ %delete(p); res = SWIG_DelNewMask(res); } return res; } else { return SWIG_ERROR; } } else { return traits_asptr::asptr(obj, (Type **)(0)); } } }; template struct traits_asval { static int asval(PyObject *obj, Type **val) { if (val) { typedef typename noconst_traits::noconst_type noconst_type; noconst_type *p = 0; int res = traits_asptr::asptr(obj, &p); if (SWIG_IsOK(res)) { *(const_cast(val)) = p; } return res; } else { return traits_asptr::asptr(obj, (Type **)(0)); } } }; template inline int as