adding struct example

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11457 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Baozeng Ding 2009-07-27 02:57:09 +00:00
commit 8217f59d55
8 changed files with 118 additions and 27 deletions

View file

@ -306,12 +306,12 @@ public:
else {
flag = 1;
}
Printf(f->def, "CheckRhs(%d,%d);\n",num_required,num_required);
Printf(f->def, "CheckLhs(%d,%d);\n",out_required,out_required);
Printf(f->def, "CheckRhs(%d, %d);\n",num_required,num_required);
Printf(f->def, "CheckLhs(%d, %d);\n",out_required,out_required);
/* Insert the order of output parameters*/
if(flag)
Printf(f->def, "\nint iOutNum=1;\nint iVarOut=Rhs+1;");
Printf(f->def, "\nint iOutNum = 1;\nint iVarOut = Rhs + 1;");
/* Finish the the code for the function */
Printf(f->code, "return 0;\n");
@ -404,8 +404,8 @@ public:
Printv(getf->def, "int ", getname, " (char *fname,unsigned long fname_len){\n", NIL);
/* Check the number of input and output */
Printf(getf->def, "CheckRhs(0,0);\n");
Printf(getf->def, "CheckLhs(1,1);\n");
Printf(getf->def, "CheckRhs(0, 0);\n");
Printf(getf->def, "CheckLhs(1, 1);\n");
/* Insert the order of output parameters*/
Printf(getf->def, "\nint iOutNum=1;\nint iVarOut=Rhs+1;");
@ -533,7 +533,7 @@ public:
value = Getattr(n, "value");
/* write into the code string */
Printf(f_example_code, "%s.%s=%s;\n", parentName, iname, value);
Printf(f_example_code, "%s.%s = %s;\n", parentName, iname, value);
return SWIG_OK;
}