Commit graph

51 commits

Author SHA1 Message Date
Zackery Spytz
4ca7cd7b27 [OCaml] Eliminate use of -Wno-write-strings
Don't convert string literals to char * in the strings_test example.

In constantWrapper(), use SwigType_str() instead of SwigType_lstr()
in order to keep const qualifiers.
2019-01-24 05:32:35 -07:00
Zackery Spytz
a641966e0b [OCaml] Add a callback example
It is based on the the Python and Go examples.
2019-01-16 00:53:13 -07:00
Zackery Spytz
a851e0a9ac [OCaml] Re-enable the using_protected unit test
Use the [member-variable] syntax in using_protected_runme.ml as
required by the OCaml module's documentation and implementation.

Fix the return type for vec_write() in example.h in the OCaml stl
example.
2019-01-11 17:59:23 -07:00
Zackery Spytz
96c5a95878 [OCaml] Add a class example
It is based on the Python class example. The Makefile is based on the
Makefile used in the OCaml shapes example.
2019-01-11 17:53:38 -07:00
Zackery Spytz
8d9d4cc5f1 [OCaml] Improve "make clean" and similar
When cleaning, remove the runme file and generated *.mli files.
Remove unneeded MLFILE variables from Makefiles.
2019-01-07 14:24:58 -07:00
Zackery Spytz
8f7bc4cc10 [OCaml] Rename example_prog.ml to runme.ml in the OCaml examples
Name the output executable "runme" in the examples.
Replace use of "foolib" in the string_from_ptr example.
Fix a warning in the std_vector example.
Add strings_test to Examples/ocaml/check.list.
Disable two tests that were causing the OCaml test suite to fail.
2019-01-07 11:59:07 -07:00
Zackery Spytz
1be9f5fec3 [OCaml] Fix some of the OCaml examples
Update some of the OCaml examples so that they run successfully with
`make check-ocaml-examples` (important for the CI). Some of the
examples were written to depend on passed arguments.

Temporarily disable the broken std_string example.
2019-01-03 07:34:25 -07:00
Zackery Spytz
9973628268 [OCaml] Update OCaml for out-of-source builds
This is one of the steps needed to fix the OCaml test suite.

In addition, disable the creation of toplevels by default in the OCaml
examples (toplevels are currently broken).
2018-12-29 08:24:24 -07:00
Guerin
77a9907dd9 Update ocaml documentation (#885)
Update ocaml simple example documentation

Replaced python references by ocaml ones.
2017-02-01 10:46:17 +13:00
William S Fulton
8e2bc595c6 Remove use of preinst-swig script
Complete the prototype removal in ca1431.

The script prevents SWIGTOOL=gdb from working as gdb can't be used to
debug a shell script, it requires a binary.

Add support for SWIGTOOL in all the examples.

SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.

See issue #473.
2015-08-21 22:43:17 +01:00
Karl Wette
f574a34155 Allow examples and test-suite to be built out of source tree
- Examples/Makefile.in rules use SRCDIR as the relative source directory

- ./config.status replicates Examples/ source directory tree in build
  directory, and copies each Makefile to build directory, prefixed with
  a header which sets SRCDIR to source directory

- Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir

- Examples/test-suite/errors/Makefile.in needs to filter out source
  directory from SWIG error messages

- Lua: embedded interpreters are passed location of run-time test

- Python: copy run-time scripts to build directory because of 2to3
  conversion; import_packages example copies __init__.py from source
  directory; test-suite sets SCRIPTDIR to location of run-time tests

- Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir
  can be substituted with SRCDIR; removed './' from require() statements
  so that NODE_PATH can be used to point Node.js to build directory
2014-05-11 23:21:10 +02:00
Karl Wette
3aacde4f5f Whitespace cleanup of Example Makefiles 2014-04-16 12:06:02 +02:00
William S Fulton
280cd16b7e Ocaml example makefiles tweaks for consistency with other languages. Attempt to add runtime tests to 'make check' - untested. 2013-04-19 22:47:28 +01:00
William S Fulton
1fab53b204 [Ocaml] Apply patch #3151788 from Joel Reymont. Brings Ocaml support a up to date (ver 3.11 and 3.12), including std::string.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12460 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-14 07:22:06 +00:00
William S Fulton
ede8b8c87a Remove cvs $Header$
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10007 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-10-17 21:56:11 +00:00
Marcelo Matus
d5122e2a9c force examples to use preinst-swig, as is done in the test-suite
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7880 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-27 02:17:20 +00:00
William S Fulton
c47c930f59 fix extern declarations
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7321 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-06-28 21:14:24 +00:00
Art Yerkes
a71a80a975 Removed unneeded constructor for shape class.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6645 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-03 17:11:20 +00:00
William S Fulton
3ef946d2d1 html fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6632 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-02 22:13:39 +00:00
Art Yerkes
3cfd2c7fee String from ptr example. Demonstrates use of out typemap and handling of
return value with argout.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5490 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 22:59:42 +00:00
Art Yerkes
4639f09df5 Added string-from-ptr example.
-- Response to a question asked by Thaddeus L. Olczyk


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5489 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 22:58:56 +00:00
Art Yerkes
b2fa1eab8b Added checklist entry and corrected warning.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5479 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-04 06:59:49 +00:00
Art Yerkes
35e21e1c68 This example both shows the new enum literal facility, and is a regression
test against the enum scoping problem I had.

Ocaml.cxx: Accidentally reintroduced the enum scoping problem, so I added
an example that will fail if this is ever broken again.

I encountered the actual problem in avifile.h


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5478 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-04 06:57:57 +00:00
Art Yerkes
e0dca0ec65 shapes example: slight correction to depth map.
makedebugtop: include swig.cmo
Lib: factored out more common code, slightly reorganized class type.
     added director define and exceptions.
     std_string: length from the original ocaml string (no longer depends on
      null termination)
     ocamldec.swg/ocaml.swg: added caml_string_len
Examples/Makefile.in: quiet about checking out files.
Ocaml.cxx:
     Fixed abstract director test case.
     Include/exclude director.swg based on directors being enabled.
Final edits for 1.3.20, barring bugs being discovered.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5477 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-04 06:15:07 +00:00
Art Yerkes
2e96036cdb Added contract example.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5375 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-23 12:55:53 +00:00
Art Yerkes
314a5fc85e Removed useless C_list.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5304 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-12 04:33:18 +00:00
Art Yerkes
71ce7cb69a Removed needless C_list.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5303 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-12 04:30:09 +00:00
Art Yerkes
cb69624de9 swigp4-ify.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5236 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-01 08:20:26 +00:00
Art Yerkes
febd13ea89 swip4-ify.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5235 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-01 08:16:42 +00:00
Art Yerkes
5ffff2d4a7 swigp4-ified.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5234 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-01 07:57:55 +00:00
Art Yerkes
25d0e88ee7 swigp4-ified examples.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5232 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-01 07:53:48 +00:00
Art Yerkes
b770c69ebc Examples updated.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5206 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-10-25 06:24:43 +00:00
Art Yerkes
785eb794d0 Updated example for new Swig module.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5205 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-10-25 06:22:06 +00:00
Art Yerkes
476fcbf76a Added noarg item to example to show director default constructor.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5203 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-10-25 06:19:26 +00:00
Art Yerkes
dff2895809 Director related changes, other edits.
director_wombat testcase, as well as all others except director_abstract
compile.
Four test cases fail.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5196 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-10-22 04:01:27 +00:00
Art Yerkes
6c13321878 Added a usage message.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4914 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-06-19 21:29:08 +00:00
Art Yerkes
bcde82d45c Added defines to enable possibly-conflicting extras provided by ocaml module.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4869 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-06-06 04:34:27 +00:00
William S Fulton
1258b3e91a This shouldn't be here!
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4814 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-05-21 21:29:10 +00:00
Art Yerkes
3acd792de3 Strings test, tests in, out, inout string and char * types.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4687 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-04-16 05:18:57 +00:00
Art Yerkes
9361880b56 Added namespace qualification.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4628 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-26 03:10:35 +00:00
Art Yerkes
6418b0c755 Added example.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4603 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-21 16:26:52 +00:00
Art Yerkes
7d2accbca7 Added stl example.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4602 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-21 16:25:30 +00:00
Art Yerkes
4b2da49eb3 Added:
Type registration.  Correct support for casting.  Proper type safety.
Changed:
ocaml.swg: Correct casts, declaration order for C
ocamldec.swg: Removed problematic forward declarations without array index.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4573 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-19 16:24:47 +00:00
Art Yerkes
92ff18c46e Shapes example small correction.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4488 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-10 04:13:06 +00:00
Art Yerkes
0749cef9e3 Added overloading example.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4487 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-10 04:09:14 +00:00
Art Yerkes
a1fa5ec2c1 Added info about dynamic linking to doc
Added dynamic targets to example makefiles
Added ocaml_dynamic and ocaml_dynamic_cpp targets to Examples/Makefile.in
Added OCAMLFIND and OCAMLDLGEN AC_SUBST lines in configure.in
Currently, dynamic linking relies on ocamlfind and Gerd Stolpmann's Dl package,
as well as some tricky elf linking.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4413 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-27 09:25:00 +00:00
Art Yerkes
b8490f9c18 Added to typemaps: reference type in/out
Strings <=> std::string by value
std::wstring accessible from Ocaml.  The string example converts a multibyte
japanese EUC sequence to a single wchar_t sequence if you have the ja_JP.EUC-JP
locale, or similar.
Better handling of reference in types
Corrected problems with & * mismatch in type verifier.
Type verifier now really functional.  No more type errors in places they
wouldn't be allowed in C++, unless you work at it.
Added argout_ref example for argout_ref.
Init code now effective (called from let _ = f_<module>_init ())


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4412 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-27 07:09:12 +00:00
Art Yerkes
b117a28c99 Fixed example makefiles and put extra -gs in the Examples Makefile.in
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4384 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-25 01:19:25 +00:00
Art Yerkes
5b0895e0d8 std::string and std::wstring example.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4324 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-16 13:32:08 +00:00
Art Yerkes
3a6a6d6a70 Added needed files.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4322 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-16 07:37:15 +00:00