Add a custom SWIG typemap for wrapping a return value of (char *)NULL

as an empty guile string. 


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15113 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Chris Shoemaker
2006-11-14 02:10:14 +00:00
parent 74871917d7
commit 0866a83d33

View File

@@ -25,7 +25,12 @@ typedef char * URLType;
typedef char gchar;
%typemap(newfree) gchar * "g_free($1);"
%typemap (out) char * {
$result = scm_makfrom0str((const char *)$1);
if (!SCM_NFALSEP($result)) {
$result = scm_makstr(0, 0);
}
}
%typemap(in) GNCPrintAmountInfo "$1 = gnc_scm2printinfo($input);"
%typemap(out) GNCPrintAmountInfo "$result = gnc_printinfo2scm($1);"