summaryrefslogtreecommitdiff
path: root/Examples/ocaml
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-01-07 11:59:07 -0700
committerZackery Spytz <zspytz@gmail.com>2019-01-07 11:59:07 -0700
commit8f7bc4cc1078cd2223c051c8db12559d3d3d031e (patch)
tree053dafc2ec4ebf0a2b25a8d011a1f3cf29cf8479 /Examples/ocaml
parent1be9f5fec35bb17df5ac02eaeca10b9b87fed8a4 (diff)
downloadswig-8f7bc4cc1078cd2223c051c8db12559d3d3d031e.tar.gz
[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.
Diffstat (limited to 'Examples/ocaml')
-rw-r--r--Examples/ocaml/argout_ref/Makefile2
-rw-r--r--Examples/ocaml/argout_ref/runme.ml (renamed from Examples/ocaml/argout_ref/example_prog.ml)2
-rw-r--r--Examples/ocaml/check.list1
-rw-r--r--Examples/ocaml/contract/Makefile2
-rw-r--r--Examples/ocaml/contract/runme.ml (renamed from Examples/ocaml/contract/example_prog.ml)0
-rw-r--r--Examples/ocaml/scoped_enum/Makefile2
-rw-r--r--Examples/ocaml/scoped_enum/runme.ml (renamed from Examples/ocaml/scoped_enum/example_prog.ml)0
-rw-r--r--Examples/ocaml/shapes/Makefile2
-rw-r--r--Examples/ocaml/shapes/runme.ml (renamed from Examples/ocaml/shapes/example_prog.ml)2
-rw-r--r--Examples/ocaml/simple/Makefile2
-rw-r--r--Examples/ocaml/simple/runme.ml (renamed from Examples/ocaml/simple/example_prog.ml)2
-rw-r--r--Examples/ocaml/std_vector/runme.ml4
-rw-r--r--Examples/ocaml/string_from_ptr/Makefile6
-rw-r--r--Examples/ocaml/string_from_ptr/example.i (renamed from Examples/ocaml/string_from_ptr/foolib.i)2
-rw-r--r--Examples/ocaml/string_from_ptr/runme.ml (renamed from Examples/ocaml/string_from_ptr/example_prog.ml)4
15 files changed, 16 insertions, 17 deletions
diff --git a/Examples/ocaml/argout_ref/Makefile b/Examples/ocaml/argout_ref/Makefile
index 8b7fc959e..d8c8e9056 100644
--- a/Examples/ocaml/argout_ref/Makefile
+++ b/Examples/ocaml/argout_ref/Makefile
@@ -5,7 +5,7 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
MLFILE = example.ml
-PROGFILE = example_prog.ml
+PROGFILE = runme.ml
OBJS = example.o
check: build
diff --git a/Examples/ocaml/argout_ref/example_prog.ml b/Examples/ocaml/argout_ref/runme.ml
index b91285c1c..cb9a94255 100644
--- a/Examples/ocaml/argout_ref/example_prog.ml
+++ b/Examples/ocaml/argout_ref/runme.ml
@@ -1,4 +1,4 @@
-(* example_prog.ml *)
+(* runme.ml *)
open Swig
open Example
diff --git a/Examples/ocaml/check.list b/Examples/ocaml/check.list
index 1f1e6e709..bcc63fa7f 100644
--- a/Examples/ocaml/check.list
+++ b/Examples/ocaml/check.list
@@ -8,3 +8,4 @@ shapes
contract
scoped_enum
string_from_ptr
+strings_test
diff --git a/Examples/ocaml/contract/Makefile b/Examples/ocaml/contract/Makefile
index c77e6dcc4..868dc82b2 100644
--- a/Examples/ocaml/contract/Makefile
+++ b/Examples/ocaml/contract/Makefile
@@ -5,7 +5,7 @@ SRCS =
TARGET = example
INTERFACE = example.i
MLFILE = example.ml
-PROGFILE = example_prog.ml
+PROGFILE = runme.ml
OBJS =
check: build
diff --git a/Examples/ocaml/contract/example_prog.ml b/Examples/ocaml/contract/runme.ml
index a77eed701..a77eed701 100644
--- a/Examples/ocaml/contract/example_prog.ml
+++ b/Examples/ocaml/contract/runme.ml
diff --git a/Examples/ocaml/scoped_enum/Makefile b/Examples/ocaml/scoped_enum/Makefile
index 9655c98e6..0fa3af226 100644
--- a/Examples/ocaml/scoped_enum/Makefile
+++ b/Examples/ocaml/scoped_enum/Makefile
@@ -5,7 +5,7 @@ SRCS =
TARGET = example
INTERFACE = example.i
MLFILE = example.ml
-PROGFILE = example_prog.ml
+PROGFILE = runme.ml
OBJS =
check: build
diff --git a/Examples/ocaml/scoped_enum/example_prog.ml b/Examples/ocaml/scoped_enum/runme.ml
index f70b6e1f8..f70b6e1f8 100644
--- a/Examples/ocaml/scoped_enum/example_prog.ml
+++ b/Examples/ocaml/scoped_enum/runme.ml
diff --git a/Examples/ocaml/shapes/Makefile b/Examples/ocaml/shapes/Makefile
index 8aa35d79f..d34b48738 100644
--- a/Examples/ocaml/shapes/Makefile
+++ b/Examples/ocaml/shapes/Makefile
@@ -6,7 +6,7 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
MLFILE = example.ml
-PROGFILE = example_prog.ml
+PROGFILE = runme.ml
OBJS = example.o
check: build
diff --git a/Examples/ocaml/shapes/example_prog.ml b/Examples/ocaml/shapes/runme.ml
index b9e35158a..a7a2f9374 100644
--- a/Examples/ocaml/shapes/example_prog.ml
+++ b/Examples/ocaml/shapes/runme.ml
@@ -1,4 +1,4 @@
-(* example_prog.ml *)
+(* runme.ml *)
open Swig ;;
open Example ;;
diff --git a/Examples/ocaml/simple/Makefile b/Examples/ocaml/simple/Makefile
index 88fef7435..bec1526f1 100644
--- a/Examples/ocaml/simple/Makefile
+++ b/Examples/ocaml/simple/Makefile
@@ -5,7 +5,7 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
MLFILE = example.ml
-PROGFILE = example_prog.ml
+PROGFILE = runme.ml
OBJS = example.o
check: build
diff --git a/Examples/ocaml/simple/example_prog.ml b/Examples/ocaml/simple/runme.ml
index cc3b973d8..4f7a407ef 100644
--- a/Examples/ocaml/simple/example_prog.ml
+++ b/Examples/ocaml/simple/runme.ml
@@ -1,4 +1,4 @@
-(* example_prog.ml *)
+(* runme.ml *)
open Swig
open Example
diff --git a/Examples/ocaml/std_vector/runme.ml b/Examples/ocaml/std_vector/runme.ml
index feb70dd5e..0f5519b6f 100644
--- a/Examples/ocaml/std_vector/runme.ml
+++ b/Examples/ocaml/std_vector/runme.ml
@@ -14,7 +14,7 @@ let print_DoubleVector v =
(fun v i ->
print_float ((v '[i to int]) as float) ;
print_string " ") ;
- print_endline
+ print_endline ""
end
(* Call average with a Ocaml array... *)
@@ -27,7 +27,7 @@ let rec fill_dv v x =
fill_dv v (x *. x)
end
let _ = fill_dv v 0.999
-let _ = print_DoubleVector v ; print_endline ""
+let _ = print_DoubleVector v
let u = new_IntVector '()
let _ = for i = 1 to 4 do
u -> push_back ((i to int))
diff --git a/Examples/ocaml/string_from_ptr/Makefile b/Examples/ocaml/string_from_ptr/Makefile
index 9987d0052..3433022a8 100644
--- a/Examples/ocaml/string_from_ptr/Makefile
+++ b/Examples/ocaml/string_from_ptr/Makefile
@@ -4,9 +4,9 @@ SWIG_LIB_DIR = $(TOP)/../$(TOP_BUILDDIR_TO_TOP_SRCDIR)Lib
SWIGOPT = -c++
SRCS =
TARGET = example
-INTERFACE = foolib.i
-MLFILE = foolib.ml
-PROGFILE = example_prog.ml
+INTERFACE = example.i
+MLFILE = example.ml
+PROGFILE = runme.ml
OBJS =
check: build
diff --git a/Examples/ocaml/string_from_ptr/foolib.i b/Examples/ocaml/string_from_ptr/example.i
index 86e0880eb..d66487940 100644
--- a/Examples/ocaml/string_from_ptr/foolib.i
+++ b/Examples/ocaml/string_from_ptr/example.i
@@ -1,4 +1,4 @@
-%module foolib
+%module example
%{
static int foo( char **buf ) {
*buf = "string from c";
diff --git a/Examples/ocaml/string_from_ptr/example_prog.ml b/Examples/ocaml/string_from_ptr/runme.ml
index 8069dc228..039762017 100644
--- a/Examples/ocaml/string_from_ptr/example_prog.ml
+++ b/Examples/ocaml/string_from_ptr/runme.ml
@@ -1,7 +1,5 @@
-(* foo_program.ml -- the program using foolib *)
-
open Swig (* Give access to the swig library *)
-open Foolib (* This is the name of your swig output *)
+open Example (* This is the name of your swig output *)
let results = _foo '() (* Function names are prefixed with _ in order to make
them lex as identifiers in ocaml. Consider that