mortar-pygments.rb 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (472) hide show
  1. data/.gitignore +6 -0
  2. data/CHANGELOG.md +71 -0
  3. data/Gemfile +2 -0
  4. data/LICENSE +17 -0
  5. data/README.md +121 -0
  6. data/Rakefile +66 -0
  7. data/bench.rb +22 -0
  8. data/cache-lexers.rb +8 -0
  9. data/lexers +0 -0
  10. data/lib/pygments/lexer.rb +148 -0
  11. data/lib/pygments/mentos.py +351 -0
  12. data/lib/pygments/popen.rb +406 -0
  13. data/lib/pygments/version.rb +3 -0
  14. data/lib/pygments.rb +8 -0
  15. data/pygments.rb.gemspec +25 -0
  16. data/test/test_data.c +2581 -0
  17. data/test/test_data.py +514 -0
  18. data/test/test_data_generated +2582 -0
  19. data/test/test_pygments.rb +287 -0
  20. data/vendor/custom_lexers/github.py +565 -0
  21. data/vendor/pygments-main/AUTHORS +153 -0
  22. data/vendor/pygments-main/CHANGES +889 -0
  23. data/vendor/pygments-main/LICENSE +25 -0
  24. data/vendor/pygments-main/MANIFEST.in +6 -0
  25. data/vendor/pygments-main/Makefile +59 -0
  26. data/vendor/pygments-main/REVISION +1 -0
  27. data/vendor/pygments-main/TODO +15 -0
  28. data/vendor/pygments-main/docs/generate.py +472 -0
  29. data/vendor/pygments-main/docs/pygmentize.1 +94 -0
  30. data/vendor/pygments-main/docs/src/api.txt +270 -0
  31. data/vendor/pygments-main/docs/src/authors.txt +5 -0
  32. data/vendor/pygments-main/docs/src/changelog.txt +5 -0
  33. data/vendor/pygments-main/docs/src/cmdline.txt +147 -0
  34. data/vendor/pygments-main/docs/src/filterdevelopment.txt +70 -0
  35. data/vendor/pygments-main/docs/src/filters.txt +42 -0
  36. data/vendor/pygments-main/docs/src/formatterdevelopment.txt +169 -0
  37. data/vendor/pygments-main/docs/src/formatters.txt +48 -0
  38. data/vendor/pygments-main/docs/src/index.txt +69 -0
  39. data/vendor/pygments-main/docs/src/installation.txt +71 -0
  40. data/vendor/pygments-main/docs/src/integrate.txt +48 -0
  41. data/vendor/pygments-main/docs/src/java.txt +70 -0
  42. data/vendor/pygments-main/docs/src/lexerdevelopment.txt +603 -0
  43. data/vendor/pygments-main/docs/src/lexers.txt +67 -0
  44. data/vendor/pygments-main/docs/src/moinmoin.txt +39 -0
  45. data/vendor/pygments-main/docs/src/plugins.txt +93 -0
  46. data/vendor/pygments-main/docs/src/quickstart.txt +202 -0
  47. data/vendor/pygments-main/docs/src/rstdirective.txt +22 -0
  48. data/vendor/pygments-main/docs/src/styles.txt +143 -0
  49. data/vendor/pygments-main/docs/src/tokens.txt +349 -0
  50. data/vendor/pygments-main/docs/src/unicode.txt +49 -0
  51. data/vendor/pygments-main/external/autopygmentize +64 -0
  52. data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +144 -0
  53. data/vendor/pygments-main/external/markdown-processor.py +67 -0
  54. data/vendor/pygments-main/external/moin-parser.py +112 -0
  55. data/vendor/pygments-main/external/pygments.bashcomp +38 -0
  56. data/vendor/pygments-main/external/rst-directive-old.py +77 -0
  57. data/vendor/pygments-main/external/rst-directive.py +83 -0
  58. data/vendor/pygments-main/ez_setup.py +276 -0
  59. data/vendor/pygments-main/pygmentize +7 -0
  60. data/vendor/pygments-main/pygments/__init__.py +91 -0
  61. data/vendor/pygments-main/pygments/cmdline.py +441 -0
  62. data/vendor/pygments-main/pygments/console.py +74 -0
  63. data/vendor/pygments-main/pygments/filter.py +74 -0
  64. data/vendor/pygments-main/pygments/filters/__init__.py +356 -0
  65. data/vendor/pygments-main/pygments/formatter.py +95 -0
  66. data/vendor/pygments-main/pygments/formatters/__init__.py +68 -0
  67. data/vendor/pygments-main/pygments/formatters/_mapping.py +92 -0
  68. data/vendor/pygments-main/pygments/formatters/bbcode.py +109 -0
  69. data/vendor/pygments-main/pygments/formatters/html.py +821 -0
  70. data/vendor/pygments-main/pygments/formatters/img.py +553 -0
  71. data/vendor/pygments-main/pygments/formatters/latex.py +378 -0
  72. data/vendor/pygments-main/pygments/formatters/other.py +115 -0
  73. data/vendor/pygments-main/pygments/formatters/rtf.py +136 -0
  74. data/vendor/pygments-main/pygments/formatters/svg.py +154 -0
  75. data/vendor/pygments-main/pygments/formatters/terminal.py +112 -0
  76. data/vendor/pygments-main/pygments/formatters/terminal256.py +222 -0
  77. data/vendor/pygments-main/pygments/lexer.py +765 -0
  78. data/vendor/pygments-main/pygments/lexers/__init__.py +240 -0
  79. data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1645 -0
  80. data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +232 -0
  81. data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +5172 -0
  82. data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +249 -0
  83. data/vendor/pygments-main/pygments/lexers/_mapping.py +355 -0
  84. data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +562 -0
  85. data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +3787 -0
  86. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +233 -0
  87. data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +557 -0
  88. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +40 -0
  89. data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +1072 -0
  90. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +360 -0
  91. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +13 -0
  92. data/vendor/pygments-main/pygments/lexers/agile.py +2290 -0
  93. data/vendor/pygments-main/pygments/lexers/asm.py +398 -0
  94. data/vendor/pygments-main/pygments/lexers/compiled.py +3723 -0
  95. data/vendor/pygments-main/pygments/lexers/dalvik.py +104 -0
  96. data/vendor/pygments-main/pygments/lexers/dotnet.py +671 -0
  97. data/vendor/pygments-main/pygments/lexers/foxpro.py +428 -0
  98. data/vendor/pygments-main/pygments/lexers/functional.py +2731 -0
  99. data/vendor/pygments-main/pygments/lexers/github.py +565 -0
  100. data/vendor/pygments-main/pygments/lexers/hdl.py +356 -0
  101. data/vendor/pygments-main/pygments/lexers/jvm.py +1112 -0
  102. data/vendor/pygments-main/pygments/lexers/math.py +1918 -0
  103. data/vendor/pygments-main/pygments/lexers/other.py +3778 -0
  104. data/vendor/pygments-main/pygments/lexers/parsers.py +778 -0
  105. data/vendor/pygments-main/pygments/lexers/shell.py +424 -0
  106. data/vendor/pygments-main/pygments/lexers/special.py +100 -0
  107. data/vendor/pygments-main/pygments/lexers/sql.py +609 -0
  108. data/vendor/pygments-main/pygments/lexers/templates.py +1742 -0
  109. data/vendor/pygments-main/pygments/lexers/text.py +1893 -0
  110. data/vendor/pygments-main/pygments/lexers/web.py +4045 -0
  111. data/vendor/pygments-main/pygments/modeline.py +40 -0
  112. data/vendor/pygments-main/pygments/plugin.py +74 -0
  113. data/vendor/pygments-main/pygments/scanner.py +104 -0
  114. data/vendor/pygments-main/pygments/style.py +117 -0
  115. data/vendor/pygments-main/pygments/styles/__init__.py +70 -0
  116. data/vendor/pygments-main/pygments/styles/autumn.py +65 -0
  117. data/vendor/pygments-main/pygments/styles/borland.py +51 -0
  118. data/vendor/pygments-main/pygments/styles/bw.py +49 -0
  119. data/vendor/pygments-main/pygments/styles/colorful.py +81 -0
  120. data/vendor/pygments-main/pygments/styles/default.py +73 -0
  121. data/vendor/pygments-main/pygments/styles/emacs.py +72 -0
  122. data/vendor/pygments-main/pygments/styles/friendly.py +72 -0
  123. data/vendor/pygments-main/pygments/styles/fruity.py +42 -0
  124. data/vendor/pygments-main/pygments/styles/manni.py +75 -0
  125. data/vendor/pygments-main/pygments/styles/monokai.py +106 -0
  126. data/vendor/pygments-main/pygments/styles/murphy.py +80 -0
  127. data/vendor/pygments-main/pygments/styles/native.py +65 -0
  128. data/vendor/pygments-main/pygments/styles/pastie.py +75 -0
  129. data/vendor/pygments-main/pygments/styles/perldoc.py +69 -0
  130. data/vendor/pygments-main/pygments/styles/rrt.py +33 -0
  131. data/vendor/pygments-main/pygments/styles/tango.py +141 -0
  132. data/vendor/pygments-main/pygments/styles/trac.py +63 -0
  133. data/vendor/pygments-main/pygments/styles/vim.py +63 -0
  134. data/vendor/pygments-main/pygments/styles/vs.py +38 -0
  135. data/vendor/pygments-main/pygments/token.py +195 -0
  136. data/vendor/pygments-main/pygments/unistring.py +140 -0
  137. data/vendor/pygments-main/pygments/util.py +277 -0
  138. data/vendor/pygments-main/scripts/check_sources.py +242 -0
  139. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +32 -0
  140. data/vendor/pygments-main/scripts/epydoc.css +280 -0
  141. data/vendor/pygments-main/scripts/find_codetags.py +205 -0
  142. data/vendor/pygments-main/scripts/find_error.py +170 -0
  143. data/vendor/pygments-main/scripts/get_vimkw.py +43 -0
  144. data/vendor/pygments-main/scripts/pylintrc +301 -0
  145. data/vendor/pygments-main/scripts/reindent.py +291 -0
  146. data/vendor/pygments-main/scripts/vim2pygments.py +933 -0
  147. data/vendor/pygments-main/setup.cfg +7 -0
  148. data/vendor/pygments-main/setup.py +90 -0
  149. data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +37 -0
  150. data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +869 -0
  151. data/vendor/pygments-main/tests/dtds/HTML4.dcl +88 -0
  152. data/vendor/pygments-main/tests/dtds/HTML4.dtd +1092 -0
  153. data/vendor/pygments-main/tests/dtds/HTML4.soc +9 -0
  154. data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +195 -0
  155. data/vendor/pygments-main/tests/dtds/HTMLspec.ent +77 -0
  156. data/vendor/pygments-main/tests/dtds/HTMLsym.ent +241 -0
  157. data/vendor/pygments-main/tests/examplefiles/ANTLRv3.g +608 -0
  158. data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +209 -0
  159. data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +102 -0
  160. data/vendor/pygments-main/tests/examplefiles/BOM.js +1 -0
  161. data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +611 -0
  162. data/vendor/pygments-main/tests/examplefiles/Config.in.cache +1973 -0
  163. data/vendor/pygments-main/tests/examplefiles/Constants.mo +158 -0
  164. data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +411 -0
  165. data/vendor/pygments-main/tests/examplefiles/Deflate.fs +578 -0
  166. data/vendor/pygments-main/tests/examplefiles/Errors.scala +18 -0
  167. data/vendor/pygments-main/tests/examplefiles/File.hy +174 -0
  168. data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +66 -0
  169. data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +104 -0
  170. data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +671 -0
  171. data/vendor/pygments-main/tests/examplefiles/Intro.java +1660 -0
  172. data/vendor/pygments-main/tests/examplefiles/Makefile +1131 -0
  173. data/vendor/pygments-main/tests/examplefiles/Object.st +4394 -0
  174. data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +584 -0
  175. data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +23 -0
  176. data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +378 -0
  177. data/vendor/pygments-main/tests/examplefiles/Sorting.mod +470 -0
  178. data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +382 -0
  179. data/vendor/pygments-main/tests/examplefiles/addressbook.proto +30 -0
  180. data/vendor/pygments-main/tests/examplefiles/antlr_throws +1 -0
  181. data/vendor/pygments-main/tests/examplefiles/apache2.conf +393 -0
  182. data/vendor/pygments-main/tests/examplefiles/as3_test.as +143 -0
  183. data/vendor/pygments-main/tests/examplefiles/as3_test2.as +46 -0
  184. data/vendor/pygments-main/tests/examplefiles/as3_test3.as +3 -0
  185. data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +27 -0
  186. data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +25 -0
  187. data/vendor/pygments-main/tests/examplefiles/badcase.java +2 -0
  188. data/vendor/pygments-main/tests/examplefiles/batchfile.bat +49 -0
  189. data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +308 -0
  190. data/vendor/pygments-main/tests/examplefiles/boot-9.scm +1557 -0
  191. data/vendor/pygments-main/tests/examplefiles/ca65_example +284 -0
  192. data/vendor/pygments-main/tests/examplefiles/cbmbas_example +9 -0
  193. data/vendor/pygments-main/tests/examplefiles/cells.ps +515 -0
  194. data/vendor/pygments-main/tests/examplefiles/ceval.c +2604 -0
  195. data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +13 -0
  196. data/vendor/pygments-main/tests/examplefiles/classes.dylan +125 -0
  197. data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +10 -0
  198. data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +447 -0
  199. data/vendor/pygments-main/tests/examplefiles/database.pytb +20 -0
  200. data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +2461 -0
  201. data/vendor/pygments-main/tests/examplefiles/demo.ahk +181 -0
  202. data/vendor/pygments-main/tests/examplefiles/demo.cfm +38 -0
  203. data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +68 -0
  204. data/vendor/pygments-main/tests/examplefiles/dwarf.cw +17 -0
  205. data/vendor/pygments-main/tests/examplefiles/erl_session +10 -0
  206. data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +1 -0
  207. data/vendor/pygments-main/tests/examplefiles/evil_regex.js +48 -0
  208. data/vendor/pygments-main/tests/examplefiles/example.Rd +78 -0
  209. data/vendor/pygments-main/tests/examplefiles/example.bug +54 -0
  210. data/vendor/pygments-main/tests/examplefiles/example.c +2080 -0
  211. data/vendor/pygments-main/tests/examplefiles/example.ceylon +52 -0
  212. data/vendor/pygments-main/tests/examplefiles/example.clay +33 -0
  213. data/vendor/pygments-main/tests/examplefiles/example.cls +15 -0
  214. data/vendor/pygments-main/tests/examplefiles/example.cob +3556 -0
  215. data/vendor/pygments-main/tests/examplefiles/example.cpp +2363 -0
  216. data/vendor/pygments-main/tests/examplefiles/example.gs +106 -0
  217. data/vendor/pygments-main/tests/examplefiles/example.gst +7 -0
  218. data/vendor/pygments-main/tests/examplefiles/example.hx +142 -0
  219. data/vendor/pygments-main/tests/examplefiles/example.jag +48 -0
  220. data/vendor/pygments-main/tests/examplefiles/example.kt +47 -0
  221. data/vendor/pygments-main/tests/examplefiles/example.lagda +19 -0
  222. data/vendor/pygments-main/tests/examplefiles/example.lua +250 -0
  223. data/vendor/pygments-main/tests/examplefiles/example.monkey +152 -0
  224. data/vendor/pygments-main/tests/examplefiles/example.moo +26 -0
  225. data/vendor/pygments-main/tests/examplefiles/example.moon +629 -0
  226. data/vendor/pygments-main/tests/examplefiles/example.msc +43 -0
  227. data/vendor/pygments-main/tests/examplefiles/example.nim +1010 -0
  228. data/vendor/pygments-main/tests/examplefiles/example.ns2 +69 -0
  229. data/vendor/pygments-main/tests/examplefiles/example.p +34 -0
  230. data/vendor/pygments-main/tests/examplefiles/example.pas +2708 -0
  231. data/vendor/pygments-main/tests/examplefiles/example.prg +161 -0
  232. data/vendor/pygments-main/tests/examplefiles/example.rb +1852 -0
  233. data/vendor/pygments-main/tests/examplefiles/example.reg +19 -0
  234. data/vendor/pygments-main/tests/examplefiles/example.rexx +50 -0
  235. data/vendor/pygments-main/tests/examplefiles/example.rhtml +561 -0
  236. data/vendor/pygments-main/tests/examplefiles/example.rkt +95 -0
  237. data/vendor/pygments-main/tests/examplefiles/example.rpf +4 -0
  238. data/vendor/pygments-main/tests/examplefiles/example.sh-session +19 -0
  239. data/vendor/pygments-main/tests/examplefiles/example.shell-session +45 -0
  240. data/vendor/pygments-main/tests/examplefiles/example.sml +156 -0
  241. data/vendor/pygments-main/tests/examplefiles/example.snobol +15 -0
  242. data/vendor/pygments-main/tests/examplefiles/example.stan +108 -0
  243. data/vendor/pygments-main/tests/examplefiles/example.tea +34 -0
  244. data/vendor/pygments-main/tests/examplefiles/example.ts +28 -0
  245. data/vendor/pygments-main/tests/examplefiles/example.u +548 -0
  246. data/vendor/pygments-main/tests/examplefiles/example.weechatlog +9 -0
  247. data/vendor/pygments-main/tests/examplefiles/example.xhtml +376 -0
  248. data/vendor/pygments-main/tests/examplefiles/example.xtend +34 -0
  249. data/vendor/pygments-main/tests/examplefiles/example.yaml +302 -0
  250. data/vendor/pygments-main/tests/examplefiles/example2.aspx +29 -0
  251. data/vendor/pygments-main/tests/examplefiles/example2.msc +79 -0
  252. data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +363 -0
  253. data/vendor/pygments-main/tests/examplefiles/example_file.fy +128 -0
  254. data/vendor/pygments-main/tests/examplefiles/firefox.mak +586 -0
  255. data/vendor/pygments-main/tests/examplefiles/flipflop.sv +19 -0
  256. data/vendor/pygments-main/tests/examplefiles/foo.sce +6 -0
  257. data/vendor/pygments-main/tests/examplefiles/format.ml +1213 -0
  258. data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +77 -0
  259. data/vendor/pygments-main/tests/examplefiles/function.mu +1 -0
  260. data/vendor/pygments-main/tests/examplefiles/functional.rst +1472 -0
  261. data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +133 -0
  262. data/vendor/pygments-main/tests/examplefiles/genclass.clj +510 -0
  263. data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +193 -0
  264. data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +33 -0
  265. data/vendor/pygments-main/tests/examplefiles/glsl.frag +7 -0
  266. data/vendor/pygments-main/tests/examplefiles/glsl.vert +13 -0
  267. data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +22 -0
  268. data/vendor/pygments-main/tests/examplefiles/hello.smali +40 -0
  269. data/vendor/pygments-main/tests/examplefiles/hello.sp +9 -0
  270. data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +1 -0
  271. data/vendor/pygments-main/tests/examplefiles/http_request_example +15 -0
  272. data/vendor/pygments-main/tests/examplefiles/http_response_example +29 -0
  273. data/vendor/pygments-main/tests/examplefiles/import.hs +4 -0
  274. data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +71 -0
  275. data/vendor/pygments-main/tests/examplefiles/intro.ik +24 -0
  276. data/vendor/pygments-main/tests/examplefiles/ints.php +10 -0
  277. data/vendor/pygments-main/tests/examplefiles/intsyn.fun +675 -0
  278. data/vendor/pygments-main/tests/examplefiles/intsyn.sig +286 -0
  279. data/vendor/pygments-main/tests/examplefiles/irb_heredoc +8 -0
  280. data/vendor/pygments-main/tests/examplefiles/irc.lsp +214 -0
  281. data/vendor/pygments-main/tests/examplefiles/java.properties +16 -0
  282. data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +28 -0
  283. data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +45 -0
  284. data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +713 -0
  285. data/vendor/pygments-main/tests/examplefiles/json.lasso +301 -0
  286. data/vendor/pygments-main/tests/examplefiles/json.lasso9 +213 -0
  287. data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +13 -0
  288. data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +47 -0
  289. data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +41 -0
  290. data/vendor/pygments-main/tests/examplefiles/logos_example.xm +28 -0
  291. data/vendor/pygments-main/tests/examplefiles/ltmain.sh +2849 -0
  292. data/vendor/pygments-main/tests/examplefiles/main.cmake +42 -0
  293. data/vendor/pygments-main/tests/examplefiles/markdown.lsp +679 -0
  294. data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +3 -0
  295. data/vendor/pygments-main/tests/examplefiles/matlab_sample +30 -0
  296. data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +37 -0
  297. data/vendor/pygments-main/tests/examplefiles/metagrammar.treetop +455 -0
  298. data/vendor/pygments-main/tests/examplefiles/mg_sample.pro +73 -0
  299. data/vendor/pygments-main/tests/examplefiles/minehunt.qml +112 -0
  300. data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +4 -0
  301. data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +340 -0
  302. data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +38 -0
  303. data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +95 -0
  304. data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +96 -0
  305. data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +30 -0
  306. data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +87 -0
  307. data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +118 -0
  308. data/vendor/pygments-main/tests/examplefiles/numbers.c +12 -0
  309. data/vendor/pygments-main/tests/examplefiles/objc_example.m +32 -0
  310. data/vendor/pygments-main/tests/examplefiles/objc_example2.m +24 -0
  311. data/vendor/pygments-main/tests/examplefiles/perl_misc +62 -0
  312. data/vendor/pygments-main/tests/examplefiles/perl_perl5db +998 -0
  313. data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +120 -0
  314. data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +856 -0
  315. data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +163 -0
  316. data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +567 -0
  317. data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +1223 -0
  318. data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +47 -0
  319. data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +10 -0
  320. data/vendor/pygments-main/tests/examplefiles/psql_session.txt +122 -0
  321. data/vendor/pygments-main/tests/examplefiles/py3_test.txt +2 -0
  322. data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +4 -0
  323. data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +14 -0
  324. data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +2 -0
  325. data/vendor/pygments-main/tests/examplefiles/pytb_test3.pytb +4 -0
  326. data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +234 -0
  327. data/vendor/pygments-main/tests/examplefiles/qsort.prolog +13 -0
  328. data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +38 -0
  329. data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +280 -0
  330. data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +2 -0
  331. data/vendor/pygments-main/tests/examplefiles/regex.js +22 -0
  332. data/vendor/pygments-main/tests/examplefiles/reversi.lsp +427 -0
  333. data/vendor/pygments-main/tests/examplefiles/robotframework.txt +39 -0
  334. data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +11 -0
  335. data/vendor/pygments-main/tests/examplefiles/rust_example.rs +233 -0
  336. data/vendor/pygments-main/tests/examplefiles/scilab.sci +30 -0
  337. data/vendor/pygments-main/tests/examplefiles/session.dylan-console +9 -0
  338. data/vendor/pygments-main/tests/examplefiles/sibling.prolog +19 -0
  339. data/vendor/pygments-main/tests/examplefiles/simple.md +747 -0
  340. data/vendor/pygments-main/tests/examplefiles/smarty_example.html +209 -0
  341. data/vendor/pygments-main/tests/examplefiles/source.lgt +343 -0
  342. data/vendor/pygments-main/tests/examplefiles/sources.list +62 -0
  343. data/vendor/pygments-main/tests/examplefiles/sphere.pov +18 -0
  344. data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +27 -0
  345. data/vendor/pygments-main/tests/examplefiles/squid.conf +30 -0
  346. data/vendor/pygments-main/tests/examplefiles/string.jl +1031 -0
  347. data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +21 -0
  348. data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +3 -0
  349. data/vendor/pygments-main/tests/examplefiles/swig_java.swg +1329 -0
  350. data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +225 -0
  351. data/vendor/pygments-main/tests/examplefiles/test.R +153 -0
  352. data/vendor/pygments-main/tests/examplefiles/test.adb +211 -0
  353. data/vendor/pygments-main/tests/examplefiles/test.agda +102 -0
  354. data/vendor/pygments-main/tests/examplefiles/test.asy +131 -0
  355. data/vendor/pygments-main/tests/examplefiles/test.awk +121 -0
  356. data/vendor/pygments-main/tests/examplefiles/test.bas +29 -0
  357. data/vendor/pygments-main/tests/examplefiles/test.bb +95 -0
  358. data/vendor/pygments-main/tests/examplefiles/test.bmx +145 -0
  359. data/vendor/pygments-main/tests/examplefiles/test.boo +39 -0
  360. data/vendor/pygments-main/tests/examplefiles/test.bro +250 -0
  361. data/vendor/pygments-main/tests/examplefiles/test.cs +374 -0
  362. data/vendor/pygments-main/tests/examplefiles/test.css +54 -0
  363. data/vendor/pygments-main/tests/examplefiles/test.cu +36 -0
  364. data/vendor/pygments-main/tests/examplefiles/test.d +135 -0
  365. data/vendor/pygments-main/tests/examplefiles/test.dart +23 -0
  366. data/vendor/pygments-main/tests/examplefiles/test.dtd +89 -0
  367. data/vendor/pygments-main/tests/examplefiles/test.ebnf +31 -0
  368. data/vendor/pygments-main/tests/examplefiles/test.ec +605 -0
  369. data/vendor/pygments-main/tests/examplefiles/test.ecl +58 -0
  370. data/vendor/pygments-main/tests/examplefiles/test.eh +315 -0
  371. data/vendor/pygments-main/tests/examplefiles/test.erl +169 -0
  372. data/vendor/pygments-main/tests/examplefiles/test.evoque +33 -0
  373. data/vendor/pygments-main/tests/examplefiles/test.fan +818 -0
  374. data/vendor/pygments-main/tests/examplefiles/test.flx +57 -0
  375. data/vendor/pygments-main/tests/examplefiles/test.gdc +13 -0
  376. data/vendor/pygments-main/tests/examplefiles/test.groovy +97 -0
  377. data/vendor/pygments-main/tests/examplefiles/test.html +339 -0
  378. data/vendor/pygments-main/tests/examplefiles/test.ini +10 -0
  379. data/vendor/pygments-main/tests/examplefiles/test.java +653 -0
  380. data/vendor/pygments-main/tests/examplefiles/test.jsp +24 -0
  381. data/vendor/pygments-main/tests/examplefiles/test.maql +45 -0
  382. data/vendor/pygments-main/tests/examplefiles/test.mod +374 -0
  383. data/vendor/pygments-main/tests/examplefiles/test.moo +51 -0
  384. data/vendor/pygments-main/tests/examplefiles/test.myt +166 -0
  385. data/vendor/pygments-main/tests/examplefiles/test.nim +93 -0
  386. data/vendor/pygments-main/tests/examplefiles/test.opa +10 -0
  387. data/vendor/pygments-main/tests/examplefiles/test.p6 +252 -0
  388. data/vendor/pygments-main/tests/examplefiles/test.pas +743 -0
  389. data/vendor/pygments-main/tests/examplefiles/test.php +505 -0
  390. data/vendor/pygments-main/tests/examplefiles/test.plot +333 -0
  391. data/vendor/pygments-main/tests/examplefiles/test.ps1 +108 -0
  392. data/vendor/pygments-main/tests/examplefiles/test.pypylog +1839 -0
  393. data/vendor/pygments-main/tests/examplefiles/test.r3 +94 -0
  394. data/vendor/pygments-main/tests/examplefiles/test.rb +177 -0
  395. data/vendor/pygments-main/tests/examplefiles/test.rhtml +43 -0
  396. data/vendor/pygments-main/tests/examplefiles/test.scaml +8 -0
  397. data/vendor/pygments-main/tests/examplefiles/test.ssp +12 -0
  398. data/vendor/pygments-main/tests/examplefiles/test.tcsh +830 -0
  399. data/vendor/pygments-main/tests/examplefiles/test.vb +407 -0
  400. data/vendor/pygments-main/tests/examplefiles/test.vhdl +161 -0
  401. data/vendor/pygments-main/tests/examplefiles/test.xqy +138 -0
  402. data/vendor/pygments-main/tests/examplefiles/test.xsl +23 -0
  403. data/vendor/pygments-main/tests/examplefiles/test2.pypylog +120 -0
  404. data/vendor/pygments-main/tests/examplefiles/truncated.pytb +15 -0
  405. data/vendor/pygments-main/tests/examplefiles/type.lisp +1218 -0
  406. data/vendor/pygments-main/tests/examplefiles/underscore.coffee +603 -0
  407. data/vendor/pygments-main/tests/examplefiles/unicode.applescript +5 -0
  408. data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +11 -0
  409. data/vendor/pygments-main/tests/examplefiles/unix-io.lid +37 -0
  410. data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +3 -0
  411. data/vendor/pygments-main/tests/examplefiles/while.pov +13 -0
  412. data/vendor/pygments-main/tests/examplefiles/wiki.factor +384 -0
  413. data/vendor/pygments-main/tests/examplefiles/xml_example +1897 -0
  414. data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +798 -0
  415. data/vendor/pygments-main/tests/old_run.py +138 -0
  416. data/vendor/pygments-main/tests/run.py +49 -0
  417. data/vendor/pygments-main/tests/support/tags +36 -0
  418. data/vendor/pygments-main/tests/support.py +15 -0
  419. data/vendor/pygments-main/tests/test_basic_api.py +295 -0
  420. data/vendor/pygments-main/tests/test_clexer.py +31 -0
  421. data/vendor/pygments-main/tests/test_cmdline.py +105 -0
  422. data/vendor/pygments-main/tests/test_examplefiles.py +99 -0
  423. data/vendor/pygments-main/tests/test_html_formatter.py +178 -0
  424. data/vendor/pygments-main/tests/test_latex_formatter.py +55 -0
  425. data/vendor/pygments-main/tests/test_lexers_other.py +68 -0
  426. data/vendor/pygments-main/tests/test_perllexer.py +137 -0
  427. data/vendor/pygments-main/tests/test_regexlexer.py +47 -0
  428. data/vendor/pygments-main/tests/test_token.py +46 -0
  429. data/vendor/pygments-main/tests/test_using_api.py +40 -0
  430. data/vendor/pygments-main/tests/test_util.py +135 -0
  431. data/vendor/simplejson/.gitignore +10 -0
  432. data/vendor/simplejson/.travis.yml +5 -0
  433. data/vendor/simplejson/CHANGES.txt +291 -0
  434. data/vendor/simplejson/LICENSE.txt +19 -0
  435. data/vendor/simplejson/MANIFEST.in +5 -0
  436. data/vendor/simplejson/README.rst +19 -0
  437. data/vendor/simplejson/conf.py +179 -0
  438. data/vendor/simplejson/index.rst +628 -0
  439. data/vendor/simplejson/scripts/make_docs.py +18 -0
  440. data/vendor/simplejson/setup.py +104 -0
  441. data/vendor/simplejson/simplejson/__init__.py +510 -0
  442. data/vendor/simplejson/simplejson/_speedups.c +2745 -0
  443. data/vendor/simplejson/simplejson/decoder.py +425 -0
  444. data/vendor/simplejson/simplejson/encoder.py +567 -0
  445. data/vendor/simplejson/simplejson/ordered_dict.py +119 -0
  446. data/vendor/simplejson/simplejson/scanner.py +77 -0
  447. data/vendor/simplejson/simplejson/tests/__init__.py +67 -0
  448. data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +55 -0
  449. data/vendor/simplejson/simplejson/tests/test_check_circular.py +30 -0
  450. data/vendor/simplejson/simplejson/tests/test_decimal.py +66 -0
  451. data/vendor/simplejson/simplejson/tests/test_decode.py +83 -0
  452. data/vendor/simplejson/simplejson/tests/test_default.py +9 -0
  453. data/vendor/simplejson/simplejson/tests/test_dump.py +67 -0
  454. data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +46 -0
  455. data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +32 -0
  456. data/vendor/simplejson/simplejson/tests/test_errors.py +34 -0
  457. data/vendor/simplejson/simplejson/tests/test_fail.py +91 -0
  458. data/vendor/simplejson/simplejson/tests/test_float.py +19 -0
  459. data/vendor/simplejson/simplejson/tests/test_indent.py +86 -0
  460. data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +20 -0
  461. data/vendor/simplejson/simplejson/tests/test_namedtuple.py +121 -0
  462. data/vendor/simplejson/simplejson/tests/test_pass1.py +76 -0
  463. data/vendor/simplejson/simplejson/tests/test_pass2.py +14 -0
  464. data/vendor/simplejson/simplejson/tests/test_pass3.py +20 -0
  465. data/vendor/simplejson/simplejson/tests/test_recursion.py +67 -0
  466. data/vendor/simplejson/simplejson/tests/test_scanstring.py +117 -0
  467. data/vendor/simplejson/simplejson/tests/test_separators.py +42 -0
  468. data/vendor/simplejson/simplejson/tests/test_speedups.py +20 -0
  469. data/vendor/simplejson/simplejson/tests/test_tuple.py +49 -0
  470. data/vendor/simplejson/simplejson/tests/test_unicode.py +109 -0
  471. data/vendor/simplejson/simplejson/tool.py +39 -0
  472. metadata +566 -0
@@ -0,0 +1,1329 @@
1
+ /* -----------------------------------------------------------------------------
2
+ * java.swg
3
+ *
4
+ * Java typemaps
5
+ * ----------------------------------------------------------------------------- */
6
+
7
+ %include <javahead.swg>
8
+
9
+ /* The jni, jtype and jstype typemaps work together and so there should be one of each.
10
+ * The jni typemap contains the JNI type used in the JNI (C/C++) code.
11
+ * The jtype typemap contains the Java type used in the JNI intermediary class.
12
+ * The jstype typemap contains the Java type used in the Java proxy classes, type wrapper classes and module class. */
13
+
14
+ /* Fragments */
15
+ %fragment("SWIG_PackData", "header") {
16
+ /* Pack binary data into a string */
17
+ SWIGINTERN char * SWIG_PackData(char *c, void *ptr, size_t sz) {
18
+ static const char hex[17] = "0123456789abcdef";
19
+ register const unsigned char *u = (unsigned char *) ptr;
20
+ register const unsigned char *eu = u + sz;
21
+ for (; u != eu; ++u) {
22
+ register unsigned char uu = *u;
23
+ *(c++) = hex[(uu & 0xf0) >> 4];
24
+ *(c++) = hex[uu & 0xf];
25
+ }
26
+ return c;
27
+ }
28
+ }
29
+
30
+ %fragment("SWIG_UnPackData", "header") {
31
+ /* Unpack binary data from a string */
32
+ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
33
+ register unsigned char *u = (unsigned char *) ptr;
34
+ register const unsigned char *eu = u + sz;
35
+ for (; u != eu; ++u) {
36
+ register char d = *(c++);
37
+ register unsigned char uu;
38
+ if ((d >= '0') && (d <= '9'))
39
+ uu = ((d - '0') << 4);
40
+ else if ((d >= 'a') && (d <= 'f'))
41
+ uu = ((d - ('a'-10)) << 4);
42
+ else
43
+ return (char *) 0;
44
+ d = *(c++);
45
+ if ((d >= '0') && (d <= '9'))
46
+ uu |= (d - '0');
47
+ else if ((d >= 'a') && (d <= 'f'))
48
+ uu |= (d - ('a'-10));
49
+ else
50
+ return (char *) 0;
51
+ *u = uu;
52
+ }
53
+ return c;
54
+ }
55
+ }
56
+
57
+ /* Primitive types */
58
+ %typemap(jni) bool, const bool & "jboolean"
59
+ %typemap(jni) char, const char & "jchar"
60
+ %typemap(jni) signed char, const signed char & "jbyte"
61
+ %typemap(jni) unsigned char, const unsigned char & "jshort"
62
+ %typemap(jni) short, const short & "jshort"
63
+ %typemap(jni) unsigned short, const unsigned short & "jint"
64
+ %typemap(jni) int, const int & "jint"
65
+ %typemap(jni) unsigned int, const unsigned int & "jlong"
66
+ %typemap(jni) long, const long & "jint"
67
+ %typemap(jni) unsigned long, const unsigned long & "jlong"
68
+ %typemap(jni) long long, const long long & "jlong"
69
+ %typemap(jni) unsigned long long, const unsigned long long & "jobject"
70
+ %typemap(jni) float, const float & "jfloat"
71
+ %typemap(jni) double, const double & "jdouble"
72
+ %typemap(jni) void "void"
73
+
74
+ %typemap(jtype) bool, const bool & "boolean"
75
+ %typemap(jtype) char, const char & "char"
76
+ %typemap(jtype) signed char, const signed char & "byte"
77
+ %typemap(jtype) unsigned char, const unsigned char & "short"
78
+ %typemap(jtype) short, const short & "short"
79
+ %typemap(jtype) unsigned short, const unsigned short & "int"
80
+ %typemap(jtype) int, const int & "int"
81
+ %typemap(jtype) unsigned int, const unsigned int & "long"
82
+ %typemap(jtype) long, const long & "int"
83
+ %typemap(jtype) unsigned long, const unsigned long & "long"
84
+ %typemap(jtype) long long, const long long & "long"
85
+ %typemap(jtype) unsigned long long, const unsigned long long & "java.math.BigInteger"
86
+ %typemap(jtype) float, const float & "float"
87
+ %typemap(jtype) double, const double & "double"
88
+ %typemap(jtype) void "void"
89
+
90
+ %typemap(jstype) bool, const bool & "boolean"
91
+ %typemap(jstype) char, const char & "char"
92
+ %typemap(jstype) signed char, const signed char & "byte"
93
+ %typemap(jstype) unsigned char, const unsigned char & "short"
94
+ %typemap(jstype) short, const short & "short"
95
+ %typemap(jstype) unsigned short, const unsigned short & "int"
96
+ %typemap(jstype) int, const int & "int"
97
+ %typemap(jstype) unsigned int, const unsigned int & "long"
98
+ %typemap(jstype) long, const long & "int"
99
+ %typemap(jstype) unsigned long, const unsigned long & "long"
100
+ %typemap(jstype) long long, const long long & "long"
101
+ %typemap(jstype) unsigned long long, const unsigned long long & "java.math.BigInteger"
102
+ %typemap(jstype) float, const float & "float"
103
+ %typemap(jstype) double, const double & "double"
104
+ %typemap(jstype) void "void"
105
+
106
+ %typemap(jni) char *, char *&, char[ANY], char[] "jstring"
107
+ %typemap(jtype) char *, char *&, char[ANY], char[] "String"
108
+ %typemap(jstype) char *, char *&, char[ANY], char[] "String"
109
+
110
+ /* JNI types */
111
+ %typemap(jni) jboolean "jboolean"
112
+ %typemap(jni) jchar "jchar"
113
+ %typemap(jni) jbyte "jbyte"
114
+ %typemap(jni) jshort "jshort"
115
+ %typemap(jni) jint "jint"
116
+ %typemap(jni) jlong "jlong"
117
+ %typemap(jni) jfloat "jfloat"
118
+ %typemap(jni) jdouble "jdouble"
119
+ %typemap(jni) jstring "jstring"
120
+ %typemap(jni) jobject "jobject"
121
+ %typemap(jni) jbooleanArray "jbooleanArray"
122
+ %typemap(jni) jcharArray "jcharArray"
123
+ %typemap(jni) jbyteArray "jbyteArray"
124
+ %typemap(jni) jshortArray "jshortArray"
125
+ %typemap(jni) jintArray "jintArray"
126
+ %typemap(jni) jlongArray "jlongArray"
127
+ %typemap(jni) jfloatArray "jfloatArray"
128
+ %typemap(jni) jdoubleArray "jdoubleArray"
129
+ %typemap(jni) jobjectArray "jobjectArray"
130
+
131
+ %typemap(jtype) jboolean "boolean"
132
+ %typemap(jtype) jchar "char"
133
+ %typemap(jtype) jbyte "byte"
134
+ %typemap(jtype) jshort "short"
135
+ %typemap(jtype) jint "int"
136
+ %typemap(jtype) jlong "long"
137
+ %typemap(jtype) jfloat "float"
138
+ %typemap(jtype) jdouble "double"
139
+ %typemap(jtype) jstring "String"
140
+ %typemap(jtype) jobject "Object"
141
+ %typemap(jtype) jbooleanArray "boolean[]"
142
+ %typemap(jtype) jcharArray "char[]"
143
+ %typemap(jtype) jbyteArray "byte[]"
144
+ %typemap(jtype) jshortArray "short[]"
145
+ %typemap(jtype) jintArray "int[]"
146
+ %typemap(jtype) jlongArray "long[]"
147
+ %typemap(jtype) jfloatArray "float[]"
148
+ %typemap(jtype) jdoubleArray "double[]"
149
+ %typemap(jtype) jobjectArray "Object[]"
150
+
151
+ %typemap(jstype) jboolean "boolean"
152
+ %typemap(jstype) jchar "char"
153
+ %typemap(jstype) jbyte "byte"
154
+ %typemap(jstype) jshort "short"
155
+ %typemap(jstype) jint "int"
156
+ %typemap(jstype) jlong "long"
157
+ %typemap(jstype) jfloat "float"
158
+ %typemap(jstype) jdouble "double"
159
+ %typemap(jstype) jstring "String"
160
+ %typemap(jstype) jobject "Object"
161
+ %typemap(jstype) jbooleanArray "boolean[]"
162
+ %typemap(jstype) jcharArray "char[]"
163
+ %typemap(jstype) jbyteArray "byte[]"
164
+ %typemap(jstype) jshortArray "short[]"
165
+ %typemap(jstype) jintArray "int[]"
166
+ %typemap(jstype) jlongArray "long[]"
167
+ %typemap(jstype) jfloatArray "float[]"
168
+ %typemap(jstype) jdoubleArray "double[]"
169
+ %typemap(jstype) jobjectArray "Object[]"
170
+
171
+ /* Non primitive types */
172
+ %typemap(jni) SWIGTYPE "jlong"
173
+ %typemap(jtype) SWIGTYPE "long"
174
+ %typemap(jstype) SWIGTYPE "$&javaclassname"
175
+
176
+ %typemap(jni) SWIGTYPE [] "jlong"
177
+ %typemap(jtype) SWIGTYPE [] "long"
178
+ %typemap(jstype) SWIGTYPE [] "$javaclassname"
179
+
180
+ %typemap(jni) SWIGTYPE * "jlong"
181
+ %typemap(jtype) SWIGTYPE * "long"
182
+ %typemap(jstype) SWIGTYPE * "$javaclassname"
183
+
184
+ %typemap(jni) SWIGTYPE & "jlong"
185
+ %typemap(jtype) SWIGTYPE & "long"
186
+ %typemap(jstype) SWIGTYPE & "$javaclassname"
187
+
188
+ /* pointer to a class member */
189
+ %typemap(jni) SWIGTYPE (CLASS::*) "jstring"
190
+ %typemap(jtype) SWIGTYPE (CLASS::*) "String"
191
+ %typemap(jstype) SWIGTYPE (CLASS::*) "$javaclassname"
192
+
193
+ /* 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. */
194
+
195
+ /* primitive types */
196
+ %typemap(in) bool
197
+ %{ $1 = $input ? true : false; %}
198
+
199
+ %typemap(directorout) bool
200
+ %{ $result = $input ? true : false; %}
201
+
202
+ %typemap(javadirectorin) bool "$jniinput"
203
+ %typemap(javadirectorout) bool "$javacall"
204
+
205
+ %typemap(in) char,
206
+ signed char,
207
+ unsigned char,
208
+ short,
209
+ unsigned short,
210
+ int,
211
+ unsigned int,
212
+ long,
213
+ unsigned long,
214
+ long long,
215
+ float,
216
+ double
217
+ %{ $1 = ($1_ltype)$input; %}
218
+
219
+ %typemap(directorout) char,
220
+ signed char,
221
+ unsigned char,
222
+ short,
223
+ unsigned short,
224
+ int,
225
+ unsigned int,
226
+ long,
227
+ unsigned long,
228
+ long long,
229
+ float,
230
+ double
231
+ %{ $result = ($1_ltype)$input; %}
232
+
233
+ %typemap(directorin, descriptor="Z") bool "$input = (jboolean) $1;"
234
+ %typemap(directorin, descriptor="C") char "$input = (jint) $1;"
235
+ %typemap(directorin, descriptor="B") signed char "$input = (jbyte) $1;"
236
+ %typemap(directorin, descriptor="S") unsigned char "$input = (jshort) $1;"
237
+ %typemap(directorin, descriptor="S") short "$input = (jshort) $1;"
238
+ %typemap(directorin, descriptor="I") unsigned short "$input = (jint) $1;"
239
+ %typemap(directorin, descriptor="I") int "$input = (jint) $1;"
240
+ %typemap(directorin, descriptor="J") unsigned int "$input = (jlong) $1;"
241
+ %typemap(directorin, descriptor="I") long "$input = (jint) $1;"
242
+ %typemap(directorin, descriptor="J") unsigned long "$input = (jlong) $1;"
243
+ %typemap(directorin, descriptor="J") long long "$input = (jlong) $1;"
244
+ %typemap(directorin, descriptor="F") float "$input = (jfloat) $1;"
245
+ %typemap(directorin, descriptor="D") double "$input = (jdouble) $1;"
246
+
247
+ %typemap(javadirectorin) char,
248
+ signed char,
249
+ unsigned char,
250
+ short,
251
+ unsigned short,
252
+ int,
253
+ unsigned int,
254
+ long,
255
+ unsigned long,
256
+ long long,
257
+ float,
258
+ double
259
+ "$jniinput"
260
+
261
+ %typemap(javadirectorout) char,
262
+ signed char,
263
+ unsigned char,
264
+ short,
265
+ unsigned short,
266
+ int,
267
+ unsigned int,
268
+ long,
269
+ unsigned long,
270
+ long long,
271
+ float,
272
+ double
273
+ "$javacall"
274
+
275
+ %typemap(out) bool %{ $result = (jboolean)$1; %}
276
+ %typemap(out) char %{ $result = (jchar)$1; %}
277
+ %typemap(out) signed char %{ $result = (jbyte)$1; %}
278
+ %typemap(out) unsigned char %{ $result = (jshort)$1; %}
279
+ %typemap(out) short %{ $result = (jshort)$1; %}
280
+ %typemap(out) unsigned short %{ $result = (jint)$1; %}
281
+ %typemap(out) int %{ $result = (jint)$1; %}
282
+ %typemap(out) unsigned int %{ $result = (jlong)$1; %}
283
+ %typemap(out) long %{ $result = (jint)$1; %}
284
+ %typemap(out) unsigned long %{ $result = (jlong)$1; %}
285
+ %typemap(out) long long %{ $result = (jlong)$1; %}
286
+ %typemap(out) float %{ $result = (jfloat)$1; %}
287
+ %typemap(out) double %{ $result = (jdouble)$1; %}
288
+
289
+ /* unsigned long long */
290
+ /* Convert from BigInteger using the toByteArray member function */
291
+ %typemap(in) unsigned long long {
292
+ jclass clazz;
293
+ jmethodID mid;
294
+ jbyteArray ba;
295
+ jbyte* bae;
296
+ jsize sz;
297
+ int i;
298
+
299
+ if (!$input) {
300
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
301
+ return $null;
302
+ }
303
+ clazz = JCALL1(GetObjectClass, jenv, $input);
304
+ mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
305
+ ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
306
+ bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
307
+ sz = JCALL1(GetArrayLength, jenv, ba);
308
+ $1 = 0;
309
+ for(i=0; i<sz; i++) {
310
+ $1 = ($1 << 8) | ($1_type)(unsigned char)bae[i];
311
+ }
312
+ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
313
+ }
314
+
315
+ %typemap(directorout) unsigned long long {
316
+ jclass clazz;
317
+ jmethodID mid;
318
+ jbyteArray ba;
319
+ jbyte* bae;
320
+ jsize sz;
321
+ int i;
322
+
323
+ if (!$input) {
324
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
325
+ return $null;
326
+ }
327
+ clazz = JCALL1(GetObjectClass, jenv, $input);
328
+ mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
329
+ ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
330
+ bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
331
+ sz = JCALL1(GetArrayLength, jenv, ba);
332
+ $result = 0;
333
+ for(i=0; i<sz; i++) {
334
+ $result = ($result << 8) | ($1_type)(unsigned char)bae[i];
335
+ }
336
+ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
337
+ }
338
+
339
+
340
+ /* Convert to BigInteger - byte array holds number in 2's complement big endian format */
341
+ %typemap(out) unsigned long long {
342
+ jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
343
+ jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
344
+ jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
345
+ jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "<init>", "([B)V");
346
+ jobject bigint;
347
+ int i;
348
+
349
+ bae[0] = 0;
350
+ for(i=1; i<9; i++ ) {
351
+ bae[i] = (jbyte)($1>>8*(8-i));
352
+ }
353
+
354
+ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
355
+ bigint = JCALL3(NewObject, jenv, clazz, mid, ba);
356
+ $result = bigint;
357
+ }
358
+
359
+ /* Convert to BigInteger (see out typemap) */
360
+ %typemap(directorin, descriptor="Ljava/math/BigInteger;") unsigned long long, const unsigned long long & {
361
+ jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
362
+ jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
363
+ jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
364
+ jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "<init>", "([B)V");
365
+ jobject bigint;
366
+ int swig_i;
367
+
368
+ bae[0] = 0;
369
+ for(swig_i=1; swig_i<9; swig_i++ ) {
370
+ bae[swig_i] = (jbyte)($1>>8*(8-swig_i));
371
+ }
372
+
373
+ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
374
+ bigint = JCALL3(NewObject, jenv, clazz, mid, ba);
375
+ $input = bigint;
376
+ }
377
+
378
+ %typemap(javadirectorin) unsigned long long "$jniinput"
379
+ %typemap(javadirectorout) unsigned long long "$javacall"
380
+
381
+ /* char * - treat as String */
382
+ %typemap(in, noblock=1) char * {
383
+ $1 = 0;
384
+ if ($input) {
385
+ $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
386
+ if (!$1) return $null;
387
+ }
388
+ }
389
+
390
+ %typemap(directorout, noblock=1, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) char * {
391
+ $1 = 0;
392
+ if ($input) {
393
+ $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
394
+ if (!$result) return $null;
395
+ }
396
+ }
397
+
398
+ %typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char * {
399
+ $input = 0;
400
+ if ($1) {
401
+ $input = JCALL1(NewStringUTF, jenv, (const char *)$1);
402
+ if (!$input) return $null;
403
+ }
404
+ }
405
+
406
+ %typemap(freearg, noblock=1) char * { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); }
407
+ %typemap(out, noblock=1) char * { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); }
408
+ %typemap(javadirectorin) char * "$jniinput"
409
+ %typemap(javadirectorout) char * "$javacall"
410
+
411
+ /* char *& - treat as String */
412
+ %typemap(in, noblock=1) char *& ($*1_ltype temp = 0) {
413
+ $1 = 0;
414
+ if ($input) {
415
+ temp = ($*1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
416
+ if (!temp) return $null;
417
+ }
418
+ $1 = &temp;
419
+ }
420
+ %typemap(freearg, noblock=1) char *& { if ($1 && *$1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)*$1); }
421
+ %typemap(out, noblock=1) char *& { if (*$1) $result = JCALL1(NewStringUTF, jenv, (const char *)*$1); }
422
+
423
+ %typemap(out) void ""
424
+ %typemap(javadirectorin) void "$jniinput"
425
+ %typemap(javadirectorout) void "$javacall"
426
+ %typemap(directorin, descriptor="V") void ""
427
+
428
+ /* primitive types by reference */
429
+ %typemap(in) const bool & ($*1_ltype temp)
430
+ %{ temp = $input ? true : false;
431
+ $1 = &temp; %}
432
+
433
+ %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const bool &
434
+ %{ static $*1_ltype temp;
435
+ temp = $input ? true : false;
436
+ $result = &temp; %}
437
+
438
+ %typemap(javadirectorin) const bool & "$jniinput"
439
+ %typemap(javadirectorout) const bool & "$javacall"
440
+
441
+ %typemap(in) const char & ($*1_ltype temp),
442
+ const signed char & ($*1_ltype temp),
443
+ const unsigned char & ($*1_ltype temp),
444
+ const short & ($*1_ltype temp),
445
+ const unsigned short & ($*1_ltype temp),
446
+ const int & ($*1_ltype temp),
447
+ const unsigned int & ($*1_ltype temp),
448
+ const long & ($*1_ltype temp),
449
+ const unsigned long & ($*1_ltype temp),
450
+ const long long & ($*1_ltype temp),
451
+ const float & ($*1_ltype temp),
452
+ const double & ($*1_ltype temp)
453
+ %{ temp = ($*1_ltype)$input;
454
+ $1 = &temp; %}
455
+
456
+ %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const char &,
457
+ const signed char &,
458
+ const unsigned char &,
459
+ const short &,
460
+ const unsigned short &,
461
+ const int &,
462
+ const unsigned int &,
463
+ const long &,
464
+ const unsigned long &,
465
+ const long long &,
466
+ const float &,
467
+ const double &
468
+ %{ static $*1_ltype temp;
469
+ temp = ($*1_ltype)$input;
470
+ $result = &temp; %}
471
+
472
+ %typemap(directorin, descriptor="Z") const bool & "$input = (jboolean)$1;"
473
+ %typemap(directorin, descriptor="C") const char & "$input = (jchar)$1;"
474
+ %typemap(directorin, descriptor="B") const signed char & "$input = (jbyte)$1;"
475
+ %typemap(directorin, descriptor="S") const unsigned char & "$input = (jshort)$1;"
476
+ %typemap(directorin, descriptor="S") const short & "$input = (jshort)$1;"
477
+ %typemap(directorin, descriptor="I") const unsigned short & "$input = (jint)$1;"
478
+ %typemap(directorin, descriptor="I") const int & "$input = (jint)$1;"
479
+ %typemap(directorin, descriptor="J") const unsigned int & "$input = (jlong)$1;"
480
+ %typemap(directorin, descriptor="I") const long & "$input = (jint)$1;"
481
+ %typemap(directorin, descriptor="J") const unsigned long & "$input = (jlong)$1;"
482
+ %typemap(directorin, descriptor="J") const long long & "$input = (jlong)$1;"
483
+ %typemap(directorin, descriptor="F") const float & "$input = (jfloat)$1;"
484
+ %typemap(directorin, descriptor="D") const double & "$input = (jdouble)$1;"
485
+
486
+ %typemap(javadirectorin) const char & ($*1_ltype temp),
487
+ const signed char & ($*1_ltype temp),
488
+ const unsigned char & ($*1_ltype temp),
489
+ const short & ($*1_ltype temp),
490
+ const unsigned short & ($*1_ltype temp),
491
+ const int & ($*1_ltype temp),
492
+ const unsigned int & ($*1_ltype temp),
493
+ const long & ($*1_ltype temp),
494
+ const unsigned long & ($*1_ltype temp),
495
+ const long long & ($*1_ltype temp),
496
+ const float & ($*1_ltype temp),
497
+ const double & ($*1_ltype temp)
498
+ "$jniinput"
499
+
500
+ %typemap(javadirectorout) const char & ($*1_ltype temp),
501
+ const signed char & ($*1_ltype temp),
502
+ const unsigned char & ($*1_ltype temp),
503
+ const short & ($*1_ltype temp),
504
+ const unsigned short & ($*1_ltype temp),
505
+ const int & ($*1_ltype temp),
506
+ const unsigned int & ($*1_ltype temp),
507
+ const long & ($*1_ltype temp),
508
+ const unsigned long & ($*1_ltype temp),
509
+ const long long & ($*1_ltype temp),
510
+ const float & ($*1_ltype temp),
511
+ const double & ($*1_ltype temp)
512
+ "$javacall"
513
+
514
+
515
+ %typemap(out) const bool & %{ $result = (jboolean)*$1; %}
516
+ %typemap(out) const char & %{ $result = (jchar)*$1; %}
517
+ %typemap(out) const signed char & %{ $result = (jbyte)*$1; %}
518
+ %typemap(out) const unsigned char & %{ $result = (jshort)*$1; %}
519
+ %typemap(out) const short & %{ $result = (jshort)*$1; %}
520
+ %typemap(out) const unsigned short & %{ $result = (jint)*$1; %}
521
+ %typemap(out) const int & %{ $result = (jint)*$1; %}
522
+ %typemap(out) const unsigned int & %{ $result = (jlong)*$1; %}
523
+ %typemap(out) const long & %{ $result = (jint)*$1; %}
524
+ %typemap(out) const unsigned long & %{ $result = (jlong)*$1; %}
525
+ %typemap(out) const long long & %{ $result = (jlong)*$1; %}
526
+ %typemap(out) const float & %{ $result = (jfloat)*$1; %}
527
+ %typemap(out) const double & %{ $result = (jdouble)*$1; %}
528
+
529
+ /* const unsigned long long & */
530
+ /* Similar to unsigned long long */
531
+ %typemap(in) const unsigned long long & ($*1_ltype temp) {
532
+ jclass clazz;
533
+ jmethodID mid;
534
+ jbyteArray ba;
535
+ jbyte* bae;
536
+ jsize sz;
537
+ int i;
538
+
539
+ if (!$input) {
540
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
541
+ return $null;
542
+ }
543
+ clazz = JCALL1(GetObjectClass, jenv, $input);
544
+ mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
545
+ ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
546
+ bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
547
+ sz = JCALL1(GetArrayLength, jenv, ba);
548
+ $1 = &temp;
549
+ temp = 0;
550
+ for(i=0; i<sz; i++) {
551
+ temp = (temp << 8) | ($*1_ltype)(unsigned char)bae[i];
552
+ }
553
+ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
554
+ }
555
+
556
+ %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const unsigned long long & {
557
+ static $*1_ltype temp;
558
+ jclass clazz;
559
+ jmethodID mid;
560
+ jbyteArray ba;
561
+ jbyte* bae;
562
+ jsize sz;
563
+ int i;
564
+
565
+ if (!$input) {
566
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null");
567
+ return $null;
568
+ }
569
+ clazz = JCALL1(GetObjectClass, jenv, $input);
570
+ mid = JCALL3(GetMethodID, jenv, clazz, "toByteArray", "()[B");
571
+ ba = (jbyteArray)JCALL2(CallObjectMethod, jenv, $input, mid);
572
+ bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
573
+ sz = JCALL1(GetArrayLength, jenv, ba);
574
+ $result = &temp;
575
+ temp = 0;
576
+ for(i=0; i<sz; i++) {
577
+ temp = (temp << 8) | ($*1_ltype)(unsigned char)bae[i];
578
+ }
579
+ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
580
+ }
581
+
582
+ %typemap(out) const unsigned long long & {
583
+ jbyteArray ba = JCALL1(NewByteArray, jenv, 9);
584
+ jbyte* bae = JCALL2(GetByteArrayElements, jenv, ba, 0);
585
+ jclass clazz = JCALL1(FindClass, jenv, "java/math/BigInteger");
586
+ jmethodID mid = JCALL3(GetMethodID, jenv, clazz, "<init>", "([B)V");
587
+ jobject bigint;
588
+ int i;
589
+
590
+ bae[0] = 0;
591
+ for(i=1; i<9; i++ ) {
592
+ bae[i] = (jbyte)(*$1>>8*(8-i));
593
+ }
594
+
595
+ JCALL3(ReleaseByteArrayElements, jenv, ba, bae, 0);
596
+ bigint = JCALL3(NewObject, jenv, clazz, mid, ba);
597
+ $result = bigint;
598
+ }
599
+
600
+ %typemap(javadirectorin) const unsigned long long & "$jniinput"
601
+ %typemap(javadirectorout) const unsigned long long & "$javacall"
602
+
603
+ /* Default handling. Object passed by value. Convert to a pointer */
604
+ %typemap(in) SWIGTYPE ($&1_type argp)
605
+ %{ argp = *($&1_ltype*)&$input;
606
+ if (!argp) {
607
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type");
608
+ return $null;
609
+ }
610
+ $1 = *argp; %}
611
+
612
+ %typemap(directorout) SWIGTYPE ($&1_type argp)
613
+ %{ argp = *($&1_ltype*)&$input;
614
+ if (!argp) {
615
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type");
616
+ return $null;
617
+ }
618
+ $result = *argp; %}
619
+
620
+ %typemap(out) SWIGTYPE
621
+ #ifdef __cplusplus
622
+ %{ *($&1_ltype*)&$result = new $1_ltype((const $1_ltype &)$1); %}
623
+ #else
624
+ {
625
+ $&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype));
626
+ memmove($1ptr, &$1, sizeof($1_type));
627
+ *($&1_ltype*)&$result = $1ptr;
628
+ }
629
+ #endif
630
+
631
+ %typemap(directorin,descriptor="L$packagepath/$&javaclassname;") SWIGTYPE
632
+ %{ $input = 0;
633
+ *(($&1_ltype*)&$input) = &$1; %}
634
+ %typemap(javadirectorin) SWIGTYPE "new $&javaclassname($jniinput, false)"
635
+ %typemap(javadirectorout) SWIGTYPE "$&javaclassname.getCPtr($javacall)"
636
+
637
+ /* Generic pointers and references */
638
+ %typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %}
639
+ %typemap(in, fragment="SWIG_UnPackData") SWIGTYPE (CLASS::*) {
640
+ const char *temp = 0;
641
+ if ($input) {
642
+ temp = JCALL2(GetStringUTFChars, jenv, $input, 0);
643
+ if (!temp) return $null;
644
+ }
645
+ SWIG_UnpackData(temp, (void *)&$1, sizeof($1));
646
+ }
647
+ %typemap(in) SWIGTYPE & %{ $1 = *($&1_ltype)&$input;
648
+ if (!$1) {
649
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "$1_type reference is null");
650
+ return $null;
651
+ } %}
652
+ %typemap(out) SWIGTYPE *
653
+ %{ *($&1_ltype)&$result = $1; %}
654
+ %typemap(out, fragment="SWIG_PackData", noblock=1) SWIGTYPE (CLASS::*) {
655
+ char buf[128];
656
+ char *data = SWIG_PackData(buf, (void *)&$1, sizeof($1));
657
+ *data = '\0';
658
+ $result = JCALL1(NewStringUTF, jenv, buf);
659
+ }
660
+ %typemap(out) SWIGTYPE &
661
+ %{ *($&1_ltype)&$result = $1; %}
662
+
663
+ %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *
664
+ %{ $result = *($&1_ltype)&$input; %}
665
+ %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE (CLASS::*)
666
+ %{ $result = *($&1_ltype)&$input; %}
667
+
668
+ %typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE *
669
+ %{ *(($&1_ltype)&$input) = ($1_ltype) $1; %}
670
+ %typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE (CLASS::*)
671
+ %{ *(($&1_ltype)&$input) = ($1_ltype) $1; %}
672
+
673
+ %typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE &
674
+ %{ if (!$input) {
675
+ SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type");
676
+ return $null;
677
+ }
678
+ $result = *($&1_ltype)&$input; %}
679
+ %typemap(directorin,descriptor="L$packagepath/$javaclassname;") SWIGTYPE &
680
+ %{ *($&1_ltype)&$input = ($1_ltype) &$1; %}
681
+
682
+ %typemap(javadirectorin) SWIGTYPE *, SWIGTYPE (CLASS::*) "($jniinput == 0) ? null : new $javaclassname($jniinput, false)"
683
+ %typemap(javadirectorin) SWIGTYPE & "new $javaclassname($jniinput, false)"
684
+ %typemap(javadirectorout) SWIGTYPE *, SWIGTYPE (CLASS::*), SWIGTYPE & "$javaclassname.getCPtr($javacall)"
685
+
686
+ /* Default array handling */
687
+ %typemap(in) SWIGTYPE [] %{ $1 = *($&1_ltype)&$input; %}
688
+ %typemap(out) SWIGTYPE [] %{ *($&1_ltype)&$result = $1; %}
689
+ %typemap(freearg) SWIGTYPE [ANY], SWIGTYPE [] ""
690
+
691
+ /* char arrays - treat as String */
692
+ %typemap(in, noblock=1) char[ANY], char[] {
693
+ $1 = 0;
694
+ if ($input) {
695
+ $1 = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
696
+ if (!$1) return $null;
697
+ }
698
+ }
699
+
700
+ %typemap(directorout, noblock=1) char[ANY], char[] {
701
+ $1 = 0;
702
+ if ($input) {
703
+ $result = ($1_ltype)JCALL2(GetStringUTFChars, jenv, $input, 0);
704
+ if (!$result) return $null;
705
+ }
706
+ }
707
+
708
+ %typemap(directorin, descriptor="Ljava/lang/String;", noblock=1) char[ANY], char[] {
709
+ $input = 0;
710
+ if ($1) {
711
+ $input = JCALL1(NewStringUTF, jenv, (const char *)$1);
712
+ if (!$input) return $null;
713
+ }
714
+ }
715
+
716
+ %typemap(argout) char[ANY], char[] ""
717
+ %typemap(freearg, noblock=1) char[ANY], char[] { if ($1) JCALL2(ReleaseStringUTFChars, jenv, $input, (const char *)$1); }
718
+ %typemap(out, noblock=1) char[ANY], char[] { if ($1) $result = JCALL1(NewStringUTF, jenv, (const char *)$1); }
719
+ %typemap(javadirectorin) char[ANY], char[] "$jniinput"
720
+ %typemap(javadirectorout) char[ANY], char[] "$javacall"
721
+
722
+ /* JNI types */
723
+ %typemap(in) jboolean,
724
+ jchar,
725
+ jbyte,
726
+ jshort,
727
+ jint,
728
+ jlong,
729
+ jfloat,
730
+ jdouble,
731
+ jstring,
732
+ jobject,
733
+ jbooleanArray,
734
+ jcharArray,
735
+ jbyteArray,
736
+ jshortArray,
737
+ jintArray,
738
+ jlongArray,
739
+ jfloatArray,
740
+ jdoubleArray,
741
+ jobjectArray
742
+ %{ $1 = $input; %}
743
+
744
+ %typemap(directorout) jboolean,
745
+ jchar,
746
+ jbyte,
747
+ jshort,
748
+ jint,
749
+ jlong,
750
+ jfloat,
751
+ jdouble,
752
+ jstring,
753
+ jobject,
754
+ jbooleanArray,
755
+ jcharArray,
756
+ jbyteArray,
757
+ jshortArray,
758
+ jintArray,
759
+ jlongArray,
760
+ jfloatArray,
761
+ jdoubleArray,
762
+ jobjectArray
763
+ %{ $result = $input; %}
764
+
765
+ %typemap(out) jboolean,
766
+ jchar,
767
+ jbyte,
768
+ jshort,
769
+ jint,
770
+ jlong,
771
+ jfloat,
772
+ jdouble,
773
+ jstring,
774
+ jobject,
775
+ jbooleanArray,
776
+ jcharArray,
777
+ jbyteArray,
778
+ jshortArray,
779
+ jintArray,
780
+ jlongArray,
781
+ jfloatArray,
782
+ jdoubleArray,
783
+ jobjectArray
784
+ %{ $result = $1; %}
785
+
786
+ %typemap(directorin,descriptor="Z") jboolean "$input = $1;"
787
+ %typemap(directorin,descriptor="C") jchar "$input = $1;"
788
+ %typemap(directorin,descriptor="B") jbyte "$input = $1;"
789
+ %typemap(directorin,descriptor="S") jshort "$input = $1;"
790
+ %typemap(directorin,descriptor="I") jint "$input = $1;"
791
+ %typemap(directorin,descriptor="J") jlong "$input = $1;"
792
+ %typemap(directorin,descriptor="F") jfloat "$input = $1;"
793
+ %typemap(directorin,descriptor="D") jdouble "$input = $1;"
794
+ %typemap(directorin,descriptor="Ljava/lang/String;") jstring "$input = $1;"
795
+ %typemap(directorin,descriptor="Ljava/lang/Object;",nouse="1") jobject "$input = $1;"
796
+ %typemap(directorin,descriptor="[Z") jbooleanArray "$input = $1;"
797
+ %typemap(directorin,descriptor="[C") jcharArray "$input = $1;"
798
+ %typemap(directorin,descriptor="[B") jbyteArray "$input = $1;"
799
+ %typemap(directorin,descriptor="[S") jshortArray "$input = $1;"
800
+ %typemap(directorin,descriptor="[I") jintArray "$input = $1;"
801
+ %typemap(directorin,descriptor="[J") jlongArray "$input = $1;"
802
+ %typemap(directorin,descriptor="[F") jfloatArray "$input = $1;"
803
+ %typemap(directorin,descriptor="[D") jdoubleArray "$input = $1;"
804
+ %typemap(directorin,descriptor="[Ljava/lang/Object;",nouse="1") jobjectArray "$input = $1;"
805
+
806
+ %typemap(javadirectorin) jboolean,
807
+ jchar,
808
+ jbyte,
809
+ jshort,
810
+ jint,
811
+ jlong,
812
+ jfloat,
813
+ jdouble,
814
+ jstring,
815
+ jobject,
816
+ jbooleanArray,
817
+ jcharArray,
818
+ jbyteArray,
819
+ jshortArray,
820
+ jintArray,
821
+ jlongArray,
822
+ jfloatArray,
823
+ jdoubleArray,
824
+ jobjectArray
825
+ "$jniinput"
826
+
827
+ %typemap(javadirectorout) jboolean,
828
+ jchar,
829
+ jbyte,
830
+ jshort,
831
+ jint,
832
+ jlong,
833
+ jfloat,
834
+ jdouble,
835
+ jstring,
836
+ jobject,
837
+ jbooleanArray,
838
+ jcharArray,
839
+ jbyteArray,
840
+ jshortArray,
841
+ jintArray,
842
+ jlongArray,
843
+ jfloatArray,
844
+ jdoubleArray,
845
+ jobjectArray
846
+ "$javacall"
847
+
848
+ /* Typecheck typemaps - The purpose of these is merely to issue a warning for overloaded C++ functions
849
+ * that cannot be overloaded in Java as more than one C++ type maps to a single Java type */
850
+
851
+ %typecheck(SWIG_TYPECHECK_BOOL) /* Java boolean */
852
+ jboolean,
853
+ bool,
854
+ const bool &
855
+ ""
856
+
857
+ %typecheck(SWIG_TYPECHECK_CHAR) /* Java char */
858
+ jchar,
859
+ char,
860
+ const char &
861
+ ""
862
+
863
+ %typecheck(SWIG_TYPECHECK_INT8) /* Java byte */
864
+ jbyte,
865
+ signed char,
866
+ const signed char &
867
+ ""
868
+
869
+ %typecheck(SWIG_TYPECHECK_INT16) /* Java short */
870
+ jshort,
871
+ unsigned char,
872
+ short,
873
+ const unsigned char &,
874
+ const short &
875
+ ""
876
+
877
+ %typecheck(SWIG_TYPECHECK_INT32) /* Java int */
878
+ jint,
879
+ unsigned short,
880
+ int,
881
+ long,
882
+ const unsigned short &,
883
+ const int &,
884
+ const long &
885
+ ""
886
+
887
+ %typecheck(SWIG_TYPECHECK_INT64) /* Java long */
888
+ jlong,
889
+ unsigned int,
890
+ unsigned long,
891
+ long long,
892
+ const unsigned int &,
893
+ const unsigned long &,
894
+ const long long &
895
+ ""
896
+
897
+ %typecheck(SWIG_TYPECHECK_INT128) /* Java BigInteger */
898
+ unsigned long long,
899
+ const unsigned long long &
900
+ ""
901
+
902
+ %typecheck(SWIG_TYPECHECK_FLOAT) /* Java float */
903
+ jfloat,
904
+ float,
905
+ const float &
906
+ ""
907
+
908
+ %typecheck(SWIG_TYPECHECK_DOUBLE) /* Java double */
909
+ jdouble,
910
+ double,
911
+ const double &
912
+ ""
913
+
914
+ %typecheck(SWIG_TYPECHECK_STRING) /* Java String */
915
+ jstring,
916
+ char *,
917
+ char *&,
918
+ char[ANY],
919
+ char []
920
+ ""
921
+
922
+ %typecheck(SWIG_TYPECHECK_BOOL_ARRAY) /* Java boolean[] */
923
+ jbooleanArray
924
+ ""
925
+
926
+ %typecheck(SWIG_TYPECHECK_CHAR_ARRAY) /* Java char[] */
927
+ jcharArray
928
+ ""
929
+
930
+ %typecheck(SWIG_TYPECHECK_INT8_ARRAY) /* Java byte[] */
931
+ jbyteArray
932
+ ""
933
+
934
+ %typecheck(SWIG_TYPECHECK_INT16_ARRAY) /* Java short[] */
935
+ jshortArray
936
+ ""
937
+
938
+ %typecheck(SWIG_TYPECHECK_INT32_ARRAY) /* Java int[] */
939
+ jintArray
940
+ ""
941
+
942
+ %typecheck(SWIG_TYPECHECK_INT64_ARRAY) /* Java long[] */
943
+ jlongArray
944
+ ""
945
+
946
+ %typecheck(SWIG_TYPECHECK_FLOAT_ARRAY) /* Java float[] */
947
+ jfloatArray
948
+ ""
949
+
950
+ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY) /* Java double[] */
951
+ jdoubleArray
952
+ ""
953
+
954
+ %typecheck(SWIG_TYPECHECK_OBJECT_ARRAY) /* Java jobject[] */
955
+ jobjectArray
956
+ ""
957
+
958
+ %typecheck(SWIG_TYPECHECK_POINTER) /* Default */
959
+ SWIGTYPE,
960
+ SWIGTYPE *,
961
+ SWIGTYPE &,
962
+ SWIGTYPE *const&,
963
+ SWIGTYPE [],
964
+ SWIGTYPE (CLASS::*)
965
+ ""
966
+
967
+
968
+ /* Exception handling */
969
+
970
+ %typemap(throws) int,
971
+ long,
972
+ short,
973
+ unsigned int,
974
+ unsigned long,
975
+ unsigned short
976
+ %{ char error_msg[256];
977
+ sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1);
978
+ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, error_msg);
979
+ return $null; %}
980
+
981
+ %typemap(throws) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [], SWIGTYPE [ANY]
982
+ %{ (void)$1;
983
+ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
984
+ return $null; %}
985
+
986
+ %typemap(throws) char *
987
+ %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1);
988
+ return $null; %}
989
+
990
+
991
+ /* Typemaps for code generation in proxy classes and Java type wrapper classes */
992
+
993
+ /* The javain typemap is used for converting function parameter types from the type
994
+ * used in the proxy, module or type wrapper class to the type used in the JNI class. */
995
+ %typemap(javain) bool, const bool &,
996
+ char, const char &,
997
+ signed char, const signed char &,
998
+ unsigned char, const unsigned char &,
999
+ short, const short &,
1000
+ unsigned short, const unsigned short &,
1001
+ int, const int &,
1002
+ unsigned int, const unsigned int &,
1003
+ long, const long &,
1004
+ unsigned long, const unsigned long &,
1005
+ long long, const long long &,
1006
+ unsigned long long, const unsigned long long &,
1007
+ float, const float &,
1008
+ double, const double &
1009
+ "$javainput"
1010
+ %typemap(javain) char *, char *&, char[ANY], char[] "$javainput"
1011
+ %typemap(javain) jboolean,
1012
+ jchar,
1013
+ jbyte,
1014
+ jshort,
1015
+ jint,
1016
+ jlong,
1017
+ jfloat,
1018
+ jdouble,
1019
+ jstring,
1020
+ jobject,
1021
+ jbooleanArray,
1022
+ jcharArray,
1023
+ jbyteArray,
1024
+ jshortArray,
1025
+ jintArray,
1026
+ jlongArray,
1027
+ jfloatArray,
1028
+ jdoubleArray,
1029
+ jobjectArray
1030
+ "$javainput"
1031
+ %typemap(javain) SWIGTYPE "$&javaclassname.getCPtr($javainput)"
1032
+ %typemap(javain) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$javaclassname.getCPtr($javainput)"
1033
+ %typemap(javain) SWIGTYPE (CLASS::*) "$javaclassname.getCMemberPtr($javainput)"
1034
+
1035
+ /* The javaout typemap is used for converting function return types from the return type
1036
+ * used in the JNI class to the type returned by the proxy, module or type wrapper class. */
1037
+ %typemap(javaout) bool, const bool &,
1038
+ char, const char &,
1039
+ signed char, const signed char &,
1040
+ unsigned char, const unsigned char &,
1041
+ short, const short &,
1042
+ unsigned short, const unsigned short &,
1043
+ int, const int &,
1044
+ unsigned int, const unsigned int &,
1045
+ long, const long &,
1046
+ unsigned long, const unsigned long &,
1047
+ long long, const long long &,
1048
+ unsigned long long, const unsigned long long &,
1049
+ float, const float &,
1050
+ double, const double & {
1051
+ return $jnicall;
1052
+ }
1053
+ %typemap(javaout) char *, char *&, char[ANY], char[] {
1054
+ return $jnicall;
1055
+ }
1056
+ %typemap(javaout) jboolean,
1057
+ jchar,
1058
+ jbyte,
1059
+ jshort,
1060
+ jint,
1061
+ jlong,
1062
+ jfloat,
1063
+ jdouble,
1064
+ jstring,
1065
+ jobject,
1066
+ jbooleanArray,
1067
+ jcharArray,
1068
+ jbyteArray,
1069
+ jshortArray,
1070
+ jintArray,
1071
+ jlongArray,
1072
+ jfloatArray,
1073
+ jdoubleArray,
1074
+ jobjectArray {
1075
+ return $jnicall;
1076
+ }
1077
+ %typemap(javaout) void {
1078
+ $jnicall;
1079
+ }
1080
+ %typemap(javaout) SWIGTYPE {
1081
+ return new $&javaclassname($jnicall, true);
1082
+ }
1083
+ %typemap(javaout) SWIGTYPE & {
1084
+ return new $javaclassname($jnicall, $owner);
1085
+ }
1086
+ %typemap(javaout) SWIGTYPE *, SWIGTYPE [] {
1087
+ long cPtr = $jnicall;
1088
+ return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner);
1089
+ }
1090
+ %typemap(javaout) SWIGTYPE (CLASS::*) {
1091
+ String cMemberPtr = $jnicall;
1092
+ return (cMemberPtr == null) ? null : new $javaclassname(cMemberPtr, $owner);
1093
+ }
1094
+
1095
+ /* Pointer reference typemaps */
1096
+ %typemap(jni) SWIGTYPE *const& "jlong"
1097
+ %typemap(jtype) SWIGTYPE *const& "long"
1098
+ %typemap(jstype) SWIGTYPE *const& "$*javaclassname"
1099
+ %typemap(javain) SWIGTYPE *const& "$*javaclassname.getCPtr($javainput)"
1100
+ %typemap(javaout) SWIGTYPE *const& {
1101
+ long cPtr = $jnicall;
1102
+ return (cPtr == 0) ? null : new $*javaclassname(cPtr, $owner);
1103
+ }
1104
+ %typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0)
1105
+ %{ temp = *($1_ltype)&$input;
1106
+ $1 = ($1_ltype)&temp; %}
1107
+ %typemap(out) SWIGTYPE *const&
1108
+ %{ *($1_ltype)&$result = *$1; %}
1109
+
1110
+ /* Typemaps used for the generation of proxy and type wrapper class code */
1111
+ %typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
1112
+ %typemap(javaclassmodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "public class"
1113
+ %typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
1114
+ %typemap(javaimports) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
1115
+ %typemap(javainterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
1116
+
1117
+ /* javabody typemaps */
1118
+
1119
+ %define SWIG_JAVABODY_METHODS(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...) SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE) %enddef // legacy name
1120
+
1121
+ %define SWIG_JAVABODY_PROXY(PTRCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...)
1122
+ // Base proxy classes
1123
+ %typemap(javabody) TYPE %{
1124
+ private long swigCPtr;
1125
+ protected boolean swigCMemOwn;
1126
+
1127
+ PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) {
1128
+ swigCMemOwn = cMemoryOwn;
1129
+ swigCPtr = cPtr;
1130
+ }
1131
+
1132
+ CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
1133
+ return (obj == null) ? 0 : obj.swigCPtr;
1134
+ }
1135
+ %}
1136
+
1137
+ // Derived proxy classes
1138
+ %typemap(javabody_derived) TYPE %{
1139
+ private long swigCPtr;
1140
+
1141
+ PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean cMemoryOwn) {
1142
+ super($imclassname.$javaclazznameSWIGUpcast(cPtr), cMemoryOwn);
1143
+ swigCPtr = cPtr;
1144
+ }
1145
+
1146
+ CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
1147
+ return (obj == null) ? 0 : obj.swigCPtr;
1148
+ }
1149
+ %}
1150
+ %enddef
1151
+
1152
+ %define SWIG_JAVABODY_TYPEWRAPPER(PTRCTOR_VISIBILITY, DEFAULTCTOR_VISIBILITY, CPTR_VISIBILITY, TYPE...)
1153
+ // Typewrapper classes
1154
+ %typemap(javabody) TYPE *, TYPE &, TYPE [] %{
1155
+ private long swigCPtr;
1156
+
1157
+ PTRCTOR_VISIBILITY $javaclassname(long cPtr, boolean futureUse) {
1158
+ swigCPtr = cPtr;
1159
+ }
1160
+
1161
+ DEFAULTCTOR_VISIBILITY $javaclassname() {
1162
+ swigCPtr = 0;
1163
+ }
1164
+
1165
+ CPTR_VISIBILITY static long getCPtr($javaclassname obj) {
1166
+ return (obj == null) ? 0 : obj.swigCPtr;
1167
+ }
1168
+ %}
1169
+
1170
+ %typemap(javabody) TYPE (CLASS::*) %{
1171
+ private String swigCMemberPtr;
1172
+
1173
+ PTRCTOR_VISIBILITY $javaclassname(String cMemberPtr, boolean futureUse) {
1174
+ swigCMemberPtr = cMemberPtr;
1175
+ }
1176
+
1177
+ DEFAULTCTOR_VISIBILITY $javaclassname() {
1178
+ swigCMemberPtr = null;
1179
+ }
1180
+
1181
+ CPTR_VISIBILITY static String getCMemberPtr($javaclassname obj) {
1182
+ return obj.swigCMemberPtr;
1183
+ }
1184
+ %}
1185
+ %enddef
1186
+
1187
+ /* Set the default javabody typemaps to use protected visibility.
1188
+ Use the macros to change to public if using multiple modules. */
1189
+ SWIG_JAVABODY_PROXY(protected, protected, SWIGTYPE)
1190
+ SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE)
1191
+
1192
+ %typemap(javafinalize) SWIGTYPE %{
1193
+ protected void finalize() {
1194
+ delete();
1195
+ }
1196
+ %}
1197
+
1198
+ /*
1199
+ * Java constructor typemaps:
1200
+ *
1201
+ * The javaconstruct typemap is inserted when a proxy class's constructor is generated.
1202
+ * This typemap allows control over what code is executed in the constructor as
1203
+ * well as specifying who owns the underlying C/C++ object. Normally, Java has
1204
+ * ownership and the underlying C/C++ object is deallocated when the Java object
1205
+ * is finalized (swigCMemOwn is true.) If swigCMemOwn is false, C/C++ is
1206
+ * ultimately responsible for deallocating the underlying object's memory.
1207
+ *
1208
+ * The SWIG_PROXY_CONSTRUCTOR macro defines the javaconstruct typemap for a proxy
1209
+ * class for a particular TYPENAME. OWNERSHIP is passed as the value of
1210
+ * swigCMemOwn to the pointer constructor method. WEAKREF determines which kind
1211
+ * of Java object reference will be used by the C++ director class (WeakGlobalRef
1212
+ * vs. GlobalRef.)
1213
+ *
1214
+ * The SWIG_DIRECTOR_OWNED macro sets the ownership of director-based proxy
1215
+ * classes and the weak reference flag to false, meaning that the underlying C++
1216
+ * object will be reclaimed by C++.
1217
+ */
1218
+
1219
+ %define SWIG_PROXY_CONSTRUCTOR(OWNERSHIP, WEAKREF, TYPENAME...)
1220
+ %typemap(javaconstruct,directorconnect="\n $imclassname.$javaclazznamedirector_connect(this, swigCPtr, swigCMemOwn, WEAKREF);") TYPENAME {
1221
+ this($imcall, OWNERSHIP);$directorconnect
1222
+ }
1223
+ %enddef
1224
+
1225
+ %define SWIG_DIRECTOR_OWNED(TYPENAME...)
1226
+ SWIG_PROXY_CONSTRUCTOR(true, false, TYPENAME)
1227
+ %enddef
1228
+
1229
+ // Set the default for SWIGTYPE: Java owns the C/C++ object.
1230
+ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
1231
+
1232
+ %typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE {
1233
+ if (swigCPtr != 0) {
1234
+ if (swigCMemOwn) {
1235
+ swigCMemOwn = false;
1236
+ $jnicall;
1237
+ }
1238
+ swigCPtr = 0;
1239
+ }
1240
+ }
1241
+
1242
+ %typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE {
1243
+ if (swigCPtr != 0) {
1244
+ if (swigCMemOwn) {
1245
+ swigCMemOwn = false;
1246
+ $jnicall;
1247
+ }
1248
+ swigCPtr = 0;
1249
+ }
1250
+ super.delete();
1251
+ }
1252
+
1253
+ %typemap(directordisconnect, methodname="swigDirectorDisconnect") SWIGTYPE %{
1254
+ protected void $methodname() {
1255
+ swigCMemOwn = false;
1256
+ $jnicall;
1257
+ }
1258
+ %}
1259
+
1260
+ %typemap(directorowner_release, methodname="swigReleaseOwnership") SWIGTYPE %{
1261
+ public void $methodname() {
1262
+ swigCMemOwn = false;
1263
+ $jnicall;
1264
+ }
1265
+ %}
1266
+
1267
+ %typemap(directorowner_take, methodname="swigTakeOwnership") SWIGTYPE %{
1268
+ public void $methodname() {
1269
+ swigCMemOwn = true;
1270
+ $jnicall;
1271
+ }
1272
+ %}
1273
+
1274
+ /* Java specific directives */
1275
+ #define %javaconst(flag) %feature("java:const","flag")
1276
+ #define %javaconstvalue(value) %feature("java:constvalue",value)
1277
+ #define %javaenum(wrapapproach) %feature("java:enum","wrapapproach")
1278
+ #define %javamethodmodifiers %feature("java:methodmodifiers")
1279
+ #define %javaexception(exceptionclasses) %feature("except",throws=exceptionclasses)
1280
+ #define %nojavaexception %feature("except","0",throws="")
1281
+ #define %clearjavaexception %feature("except","",throws="")
1282
+
1283
+ %pragma(java) jniclassclassmodifiers="public class"
1284
+ %pragma(java) moduleclassmodifiers="public class"
1285
+
1286
+ /* Some ANSI C typemaps */
1287
+
1288
+ %apply unsigned long { size_t };
1289
+ %apply const unsigned long & { const size_t & };
1290
+
1291
+ /* Array reference typemaps */
1292
+ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) }
1293
+
1294
+ /* const pointers */
1295
+ %apply SWIGTYPE * { SWIGTYPE *const }
1296
+
1297
+ /* String & length */
1298
+ %typemap(jni) (char *STRING, size_t LENGTH) "jbyteArray"
1299
+ %typemap(jtype) (char *STRING, size_t LENGTH) "byte[]"
1300
+ %typemap(jstype) (char *STRING, size_t LENGTH) "byte[]"
1301
+ %typemap(javain) (char *STRING, size_t LENGTH) "$javainput"
1302
+ %typemap(freearg) (char *STRING, size_t LENGTH) ""
1303
+ %typemap(in) (char *STRING, size_t LENGTH) {
1304
+ if ($input) {
1305
+ $1 = (char *) JCALL2(GetByteArrayElements, jenv, $input, 0);
1306
+ $2 = (size_t) JCALL1(GetArrayLength, jenv, $input);
1307
+ } else {
1308
+ $1 = 0;
1309
+ $2 = 0;
1310
+ }
1311
+ }
1312
+ %typemap(argout) (char *STRING, size_t LENGTH) {
1313
+ if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
1314
+ }
1315
+ %typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
1316
+ jbyteArray jb = (jenv)->NewByteArray($2);
1317
+ (jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
1318
+ $input = jb;
1319
+ }
1320
+ %typemap(directorargout) (char *STRING, size_t LENGTH)
1321
+ %{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1); %}
1322
+ %apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }
1323
+
1324
+ /* java keywords */
1325
+ %include <javakw.swg>
1326
+
1327
+ // Default enum handling
1328
+ %include <enumtypesafe.swg>
1329
+