Fix mzscheme multimap example

This commit is contained in:
William S Fulton 2019-02-06 22:52:24 +00:00
commit 80e9034425
4 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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++) {

View file

@ -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);
}

View file

@ -20,7 +20,7 @@
(gcdmain #("gcdmain" "42" "105"))
(display (count "Hello World" #\l))
(display (charcount "Hello World" #\l))
(newline)
(display (capitalize "hello world"))