Fix mzscheme multimap example
This commit is contained in:
parent
43bdffcbc1
commit
80e9034425
4 changed files with 6 additions and 5 deletions
|
|
@ -13,5 +13,6 @@ build:
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme
|
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int gcdmain(int argc, char *argv[]) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count(char *bytes, int len, char c) {
|
int charcount(char *bytes, int len, char c) {
|
||||||
int i;
|
int i;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
%{
|
%{
|
||||||
extern int gcd(int x, int y);
|
extern int gcd(int x, int y);
|
||||||
extern int gcdmain(int argc, char *argv[]);
|
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 capitalize (char *str, int len);
|
||||||
extern void circle (double cx, double cy);
|
extern void circle (double cx, double cy);
|
||||||
extern int squareCubed (int n, int *OUTPUT);
|
extern int squareCubed (int n, int *OUTPUT);
|
||||||
|
|
@ -50,7 +50,7 @@ extern int gcdmain(int argc, char *argv[]);
|
||||||
$2 = SCHEME_STRLEN_VAL($input);
|
$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 */
|
/* 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) {
|
%typemap(argout) (char *str, int len) {
|
||||||
Scheme_Object *s;
|
Scheme_Object *s;
|
||||||
s = scheme_make_sized_string($1,$2,1);
|
s = scheme_make_sized_string($1,$2);
|
||||||
SWIG_APPEND_VALUE(s);
|
SWIG_APPEND_VALUE(s);
|
||||||
free($1);
|
free($1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
(gcdmain #("gcdmain" "42" "105"))
|
(gcdmain #("gcdmain" "42" "105"))
|
||||||
|
|
||||||
|
|
||||||
(display (count "Hello World" #\l))
|
(display (charcount "Hello World" #\l))
|
||||||
(newline)
|
(newline)
|
||||||
|
|
||||||
(display (capitalize "hello world"))
|
(display (capitalize "hello world"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue