minor formatting change
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11995 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bdea09ed83
commit
2535297efb
8 changed files with 22 additions and 24 deletions
|
|
@ -203,20 +203,20 @@ SWIG_TYPECHECK_STRING_ARRAY 1140
|
|||
|
||||
%typemap(in) wchar_t "$1 = $input;";
|
||||
%typemap(lin,numinputs=1) wchar_t "(cl::let (($out (cl:char-code $in)))\n $body)";
|
||||
%typemap(lin,numinputs=1) wchar_t* "(excl:with-native-string ($out $in
|
||||
%typemap(lin,numinputs=1) wchar_t * "(excl:with-native-string ($out $in
|
||||
:external-format #+little-endian :fat-le #-little-endian :fat)\n
|
||||
$body)"
|
||||
|
||||
%typemap(out) wchar_t "$result = $1;";
|
||||
%typemap(lout) wchar_t "(cl::setq ACL_ffresult (cl::code-char $body))";
|
||||
%typemap(lout) wchar_t* "(cl::setq ACL_ffresult (excl:native-to-string $body
|
||||
%typemap(lout) wchar_t * "(cl::setq ACL_ffresult (excl:native-to-string $body
|
||||
:external-format #+little-endian :fat-le #-little-endian :fat))";
|
||||
|
||||
%typemap(ffitype) wchar_t ":unsigned-short";
|
||||
%typemap(lisptype) wchar_t "";
|
||||
%typemap(ctype) wchar_t "wchar_t";
|
||||
%typemap(lispclass) wchar_t "cl:character";
|
||||
%typemap(lispclass) wchar_t* "cl:string";
|
||||
%typemap(lispclass) wchar_t * "cl:string";
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
/* Array reference typemaps */
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace std {
|
|||
%typemap(typecheck) string = char *;
|
||||
%typemap(typecheck) const string & = char *;
|
||||
|
||||
%typemap(in) string (char* tempptr) {
|
||||
%typemap(in) string (char * tempptr) {
|
||||
if ($input == C_SCHEME_FALSE) {
|
||||
$1.resize(0);
|
||||
} else {
|
||||
|
|
@ -44,8 +44,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(in) const string& (std::string temp,
|
||||
char* tempptr) {
|
||||
%typemap(in) const string& (std::string temp, char *tempptr) {
|
||||
|
||||
if ($input == C_SCHEME_FALSE) {
|
||||
temp.resize(0);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace std {
|
|||
%typemap(typecheck) string = char *;
|
||||
%typemap(typecheck) const string & = char *;
|
||||
|
||||
%typemap(in) string (char* tempptr) {
|
||||
%typemap(in) string (char * tempptr) {
|
||||
if (gh_string_p($input)) {
|
||||
tempptr = SWIG_scm2str($input);
|
||||
$1.assign(tempptr);
|
||||
|
|
@ -36,8 +36,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(in) const string & (std::string temp,
|
||||
char* tempptr) {
|
||||
%typemap(in) const string & (std::string temp, char *tempptr) {
|
||||
if (gh_string_p($input)) {
|
||||
tempptr = SWIG_scm2str($input);
|
||||
temp.assign(tempptr);
|
||||
|
|
@ -48,7 +47,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(in) string * (char* tempptr) {
|
||||
%typemap(in) string * (char *tempptr) {
|
||||
if (gh_string_p($input)) {
|
||||
tempptr = SWIG_scm2str($input);
|
||||
$1 = new std::string(tempptr);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ use %include <std_except.i> instead
|
|||
%{lua_pushnumber(L,(lua_Number)(int)$1);SWIG_fail; %}
|
||||
|
||||
// strings are just sent as errors
|
||||
%typemap(throws) char*, const char*
|
||||
%typemap(throws) char *, const char *
|
||||
%{lua_pushstring(L,$1);SWIG_fail;%}
|
||||
|
||||
// char is changed to a string
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ temp=($basetype)lua_tonumber(L,$input); $1=&temp;%}
|
|||
%typemap(out) const bool&
|
||||
%{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%}
|
||||
|
||||
// strings (char* and char[])
|
||||
// strings (char * and char[])
|
||||
%fragment("SWIG_lua_isnilstring", "header") {
|
||||
int SWIG_lua_isnilstring(lua_State *L, int idx) {
|
||||
int ret = lua_isstring(L, idx);
|
||||
|
|
@ -99,17 +99,17 @@ temp=($basetype)lua_tonumber(L,$input); $1=&temp;%}
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char*, char*
|
||||
%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char *, char *
|
||||
%{$1 = ($ltype)lua_tostring(L, $input);%}
|
||||
|
||||
%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char[ANY], char[ANY]
|
||||
%{$1 = ($ltype)lua_tostring(L, $input);%}
|
||||
|
||||
%typemap(out) const char*, char*
|
||||
%{ lua_pushstring(L,(const char*)$1); SWIG_arg++;%}
|
||||
%typemap(out) const char *, char *
|
||||
%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%}
|
||||
|
||||
%typemap(out) const char[ANY], char[ANY]
|
||||
%{ lua_pushstring(L,(const char*)$1); SWIG_arg++;%}
|
||||
%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%}
|
||||
|
||||
// char's
|
||||
// currently treating chars as small strings, not as numbers
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@
|
|||
%{
|
||||
#include <stdlib.h>
|
||||
|
||||
wchar_t* str2wstr(const char* str, int len)
|
||||
wchar_t* str2wstr(const char *str, int len)
|
||||
{
|
||||
wchar_t* p;
|
||||
if (str==0 || len<1) return 0;
|
||||
p=(wchar*)malloc((len+1)*sizeof(wchar_t));
|
||||
p=(wchar *)malloc((len+1)*sizeof(wchar_t));
|
||||
if (p==0) return 0;
|
||||
if (mbstowcs(p, str, len)==-1)
|
||||
{
|
||||
|
|
@ -28,13 +28,13 @@ wchar_t* str2wstr(const char* str, int len)
|
|||
}
|
||||
%}
|
||||
|
||||
%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t*
|
||||
%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t *
|
||||
%{
|
||||
$1 = str2wstr(lua_tostring( L, $input ),lua_strlen( L, $input ));
|
||||
if ($1==0) {lua_pushfstring(L,"Error in converting to wchar (arg %d)",$input);goto fail;}
|
||||
%}
|
||||
|
||||
%typemap(freearg) wchar_t*
|
||||
%typemap(freearg) wchar_t *
|
||||
%{
|
||||
free($1);
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ SWIG_AsArgcArgv(PyObject *input,
|
|||
}
|
||||
|
||||
/*
|
||||
This typemap works with either a char**, a python list or a python
|
||||
This typemap works with either a char **, a python list or a python
|
||||
tuple
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -144,11 +144,11 @@ SWIG_InitializeModule(0);
|
|||
$1 = %reinterpret_cast(INTEGER($input), $1_ltype);
|
||||
}
|
||||
|
||||
%typemap(in,noblock=1,fragment="SWIG_strdup") char* {
|
||||
%typemap(in,noblock=1,fragment="SWIG_strdup") char * {
|
||||
$1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype);
|
||||
}
|
||||
|
||||
%typemap(freearg,noblock=1) char* {
|
||||
%typemap(freearg,noblock=1) char * {
|
||||
free($1);
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ else
|
|||
strcpy($1, "");
|
||||
%}
|
||||
|
||||
%typemap(out,noblock=1) char*
|
||||
%typemap(out,noblock=1) char *
|
||||
{ $result = $1 ? Rf_mkString(%reinterpret_cast($1,char *)) : R_NilValue; }
|
||||
|
||||
%typemap(in,noblock=1) char {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue