All but four test cases work. I'm going to leave these for afterward.

I've moved completely away from the "value" type to "caml_value_t".  Although
a bit painful, this will make things easier for me.  I seem to be seeing
quite a few things that use the word value as a function, type, etc, and
wanted to get something that doesn't collide.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4593 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Art Yerkes 2003-03-20 20:51:05 +00:00
commit 9ac1568443
6 changed files with 172 additions and 129 deletions

View file

@ -104,17 +104,30 @@ namespace std {
}
}
%typemap(in) string * (std::string *temp) {
if (caml_ptr_check($input)) {
temp = new std::string((char *)caml_ptr_val($input,0));
$1 = temp;
} else {
SWIG_exception(SWIG_TypeError, "string expected");
}
}
%typemap(free) string * (std::string *temp) {
delete temp;
}
%typemap(argout) string & {
caml_list_append(swig_result,caml_val_string_len($1->c_str(),
$1->size()));
caml_list_append(swig_result,caml_val_string_len((*$1).c_str(),
(*$1).size()));
}
%typemap(out) string {
$result = caml_val_string_len($1.c_str(),$1.size());
}
%typemap(out) const string & {
$result = caml_val_string_len($1.c_str(),$1.size());
%typemap(out) string * {
$result = caml_val_string_len((*$1).c_str(),(*$1).size());
}
}