summaryrefslogtreecommitdiff
path: root/Examples/mzscheme
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2019-02-06 22:52:24 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2019-02-09 14:44:33 +0000
commit80e9034425e7d249f3acec213b2414308ca89472 (patch)
tree359c2a1634d5179cbc071915284bf562972939f1 /Examples/mzscheme
parent43bdffcbc1b99aa73243fd7d346cd4a5a19cf274 (diff)
downloadswig-80e9034425e7d249f3acec213b2414308ca89472.tar.gz
Fix mzscheme multimap example
Diffstat (limited to 'Examples/mzscheme')
-rw-r--r--Examples/mzscheme/multimap/Makefile1
-rw-r--r--Examples/mzscheme/multimap/example.c2
-rw-r--r--Examples/mzscheme/multimap/example.i6
-rw-r--r--Examples/mzscheme/multimap/runme.scm2
4 files changed, 6 insertions, 5 deletions
diff --git a/Examples/mzscheme/multimap/Makefile b/Examples/mzscheme/multimap/Makefile
index 713ee43a7..eccd59d82 100644
--- a/Examples/mzscheme/multimap/Makefile
+++ b/Examples/mzscheme/multimap/Makefile
@@ -13,5 +13,6 @@ build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme
+
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean
diff --git a/Examples/mzscheme/multimap/example.c b/Examples/mzscheme/multimap/example.c
index b8360fa8a..e945042ab 100644
--- a/Examples/mzscheme/multimap/example.c
+++ b/Examples/mzscheme/multimap/example.c
@@ -27,7 +27,7 @@ int gcdmain(int argc, char *argv[]) {
return 0;
}
-int count(char *bytes, int len, char c) {
+int charcount(char *bytes, int len, char c) {
int i;
int count = 0;
for (i = 0; i < len; i++) {
diff --git a/Examples/mzscheme/multimap/example.i b/Examples/mzscheme/multimap/example.i
index 515948abc..db4be3d16 100644
--- a/Examples/mzscheme/multimap/example.i
+++ b/Examples/mzscheme/multimap/example.i
@@ -4,7 +4,7 @@
%{
extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]);
-extern int count(char *bytes, int len, char c);
+extern int charcount(char *bytes, int len, char c);
extern void capitalize (char *str, int len);
extern void circle (double cx, double cy);
extern int squareCubed (int n, int *OUTPUT);
@@ -50,7 +50,7 @@ extern int gcdmain(int argc, char *argv[]);
$2 = SCHEME_STRLEN_VAL($input);
}
-extern int count(char *bytes, int len, char c);
+extern int charcount(char *bytes, int len, char c);
/* This example shows how to wrap a function that mutates a string */
@@ -68,7 +68,7 @@ extern int count(char *bytes, int len, char c);
%typemap(argout) (char *str, int len) {
Scheme_Object *s;
- s = scheme_make_sized_string($1,$2,1);
+ s = scheme_make_sized_string($1,$2);
SWIG_APPEND_VALUE(s);
free($1);
}
diff --git a/Examples/mzscheme/multimap/runme.scm b/Examples/mzscheme/multimap/runme.scm
index f1e626f43..6d2c9cce3 100644
--- a/Examples/mzscheme/multimap/runme.scm
+++ b/Examples/mzscheme/multimap/runme.scm
@@ -20,7 +20,7 @@
(gcdmain #("gcdmain" "42" "105"))
-(display (count "Hello World" #\l))
+(display (charcount "Hello World" #\l))
(newline)
(display (capitalize "hello world"))