summaryrefslogtreecommitdiff
path: root/Examples/ocaml
Commit message (Collapse)AuthorAgeFilesLines
* [OCaml] Fix reference typemaps for std::stringZackery Spytz2023-04-211-0/+1
| | | | | | | | | | | | | | | | | | | Fix warnings in the extend_template_method, li_std_string, and template_methods tests. std::string was missing a typecheck typemap. Add extend_template_method_runme.ml, li_std_string_runme.ml, and template_methods_runme.ml. Add INPUT, OUTPUT and INOUT typemaps for string & Use the INOUT typemap in the strings_test example. In the strings_test example, takes_and_gives_std_string() was relying on the silly fact that an argout typemap for string & was enabled by default. Remove the in, out, and typecheck typemaps for string &. Closes: #1439
* [S-EXP] Remove code for Common Lisp S-ExpOlly Betts2021-05-161-2/+0
| | | | | | | We dropped support for it in SWIG 4.0.0 and nobody has stepped forward to revive it in over 2 years. See #2009.
* Remove use of std::bind2nd which is removed in C++17William S Fulton2019-06-271-3/+2
|
* Correct ocaml dynamic targetsWilliam S Fulton2019-03-262-2/+2
|
* More ocaml parallel make fixesWilliam S Fulton2019-03-2612-0/+48
| | | | | | | The previous commit removed a pile of 'test -f' hacks which were sort of working for parallel builds and broke parallel test-suite builds. Now this is fixed properly - these files are safely created in the test-suite already. Now we create them safely in the examples.
* [OCaml] Fix race conds when running the examples with parallel makeZackery Spytz2019-03-193-3/+3
| | | | Race conditions could occur when running the examples with parallel make.
* [OCaml] Fix the wrapmacro testZackery Spytz2019-02-171-3/+3
| | | | | | | | | Add a typecheck typemap for size_t and const size_t &. Add the const qualifier to the typemaps for primitive reference types. Add multiple runtime tests.
* Merge pull request #1471 from ZackerySpytz/OCaml-segfaults-list-argsWilliam S Fulton2019-02-151-2/+2
|\ | | | | [OCaml] Fix segfaults when too few arguments are passed to a function
| * [OCaml] Fix segfaults when too few arguments are passed to a functionZackery Spytz2019-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Prevent segfaults when too few arguments are passed to a function. Length checks are not needed for the wrappers of overloaded functions -- the generated dispatch function already checks. Add default_args_runme.ml. Fix minor errors in some runtime tests. Extra args were being passed in some cases.
* | [OCaml] Don't use argout typemaps by default for some reference typesZackery Spytz2019-02-091-0/+5
|/ | | | | | | | | The OCaml module's typemaps.i supplied argout typemaps for some reference types (e.g. int &) by default, which was unintuitive and inconsistent when compared with other modules. The argout_ref example depended on this, so add a typemap to argout_ref/example.i. Add multiple runtime tests that deal with references.
* [OCaml] Fix toplevel creation for ocamlmktop versions >= 4.04.0Zackery Spytz2019-01-255-8/+8
| | | | | | | | | The -o and -c options of ocamlc/ocamlopt were modified to be stricter in 4.04.0. https://github.com/ocaml/ocaml/commit/da56cf6dfdc13c09905c2e07f1d4849c8346eec8 The changes in Examples/Makefile.in are compatible with earlier OCaml versions (at least back to 3.12.0).
* [OCaml] Eliminate use of -Wno-write-stringsZackery Spytz2019-01-244-19/+12
| | | | | | | 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.
* [OCaml] Add a callback exampleZackery Spytz2019-01-167-2/+95
| | | | It is based on the the Python and Go examples.
* [OCaml] Re-enable the using_protected unit testZackery Spytz2019-01-112-2/+2
| | | | | | | | 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.
* [OCaml] Add a class exampleZackery Spytz2019-01-116-4/+164
| | | | | It is based on the Python class example. The Makefile is based on the Makefile used in the OCaml shapes example.
* [OCaml] Improve "make clean" and similarZackery Spytz2019-01-076-29/+23
| | | | | When cleaning, remove the runme file and generated *.mli files. Remove unneeded MLFILE variables from Makefiles.
* [OCaml] Rename example_prog.ml to runme.ml in the OCaml examplesZackery Spytz2019-01-0715-17/+16
| | | | | | | | 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.
* [OCaml] Fix some of the OCaml examplesZackery Spytz2019-01-035-14/+12
| | | | | | | | 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.
* [OCaml] Update OCaml for out-of-source buildsZackery Spytz2018-12-293-3/+3
| | | | | | | 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).
* Update ocaml documentation (#885)Guerin2017-02-011-12/+12
| | | | | Update ocaml simple example documentation Replaced python references by ocaml ones.
* Remove use of preinst-swig scriptWilliam S Fulton2015-08-2110-38/+76
| | | | | | | | | | | | | 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.
* Allow examples and test-suite to be built out of source treeKarl Wette2014-05-1110-48/+48
| | | | | | | | | | | | | | | | | | | | | | | - 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
* Whitespace cleanup of Example MakefilesKarl Wette2014-04-168-11/+11
|
* Ocaml example makefiles tweaks for consistency with other languages. Attempt ↵William S Fulton2013-04-1910-68/+78
| | | | to add runtime tests to 'make check' - untested.
* [Ocaml] Apply patch #3151788 from Joel Reymont. Brings Ocaml support a up to ↵William S Fulton2011-02-145-8/+25
| | | | | | 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
* Remove cvs $Header$William S Fulton2007-10-171-2/+0
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10007 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* force examples to use preinst-swig, as is done in the test-suiteMarcelo Matus2005-11-2710-10/+10
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7880 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* fix extern declarationsWilliam S Fulton2005-06-281-0/+2
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7321 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Removed unneeded constructor for shape class.Art Yerkes2004-11-032-3/+0
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6645 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* html fixesWilliam S Fulton2004-11-021-1/+1
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6632 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* String from ptr example. Demonstrates use of out typemap and handling ofArt Yerkes2003-12-051-0/+1
| | | | | | | return value with argout. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5490 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Added string-from-ptr example.Art Yerkes2003-12-053-0/+73
| | | | | | | -- 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
* Added checklist entry and corrected warning.Art Yerkes2003-12-042-1/+2
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5479 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* This example both shows the new enum literal facility, and is a regressionArt Yerkes2003-12-045-0/+50
| | | | | | | | | | | | 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
* shapes example: slight correction to depth map.Art Yerkes2003-12-042-1/+2
| | | | | | | | | | | | | | | | | 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
* Added contract example.Art Yerkes2003-11-234-0/+59
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5375 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Removed useless C_list.Art Yerkes2003-11-121-1/+1
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5304 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Removed needless C_list.Art Yerkes2003-11-121-1/+1
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5303 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* swigp4-ify.Art Yerkes2003-11-011-3/+3
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5236 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* swip4-ify.Art Yerkes2003-11-011-26/+20
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5235 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* swigp4-ified.Art Yerkes2003-11-011-11/+11
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5234 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* swigp4-ified examples.Art Yerkes2003-11-014-15/+21
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5232 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Examples updated.Art Yerkes2003-10-255-4/+6
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5206 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Updated example for new Swig module.Art Yerkes2003-10-251-0/+1
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5205 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Added noarg item to example to show director default constructor.Art Yerkes2003-10-254-2/+69
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5203 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Director related changes, other edits.Art Yerkes2003-10-222-0/+3
| | | | | | | | | 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
* Added a usage message.Art Yerkes2003-06-191-0/+9
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4914 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Added defines to enable possibly-conflicting extras provided by ocaml module.Art Yerkes2003-06-061-3/+2
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4869 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* This shouldn't be here!William S Fulton2003-05-211-148/+0
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4814 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Strings test, tests in, out, inout string and char * types.Art Yerkes2003-04-164-0/+95
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4687 626c5289-ae23-0410-ae9c-e8d60b6d4f22