diff options
Diffstat (limited to 'Examples/xml')
26 files changed, 6737 insertions, 0 deletions
diff --git a/Examples/xml/Makefile.in b/Examples/xml/Makefile.in new file mode 100644 index 0000000..dfda4a6 --- /dev/null +++ b/Examples/xml/Makefile.in @@ -0,0 +1,54 @@ +# Examples/xml/Makefile + +top_srcdir = @top_srcdir@ + +cleanup = tail +2 \ + | sed -e 's/ident="ID[0-9A-F]*"//g' \ + -e 's,name="/[^"]*/\([^/]*\.swg\)",name="\1",g' + +all-dot-i-files = \ + error.i \ + example.i \ + example_apply.i \ + example_const.i \ + example_gif.i \ + example_inl.i \ + example_p5.i \ + example_ro.i \ + example_title_add.i \ + example_xml.i \ + gnarly.i + +all: check + +chk-swiglib = $(top_srcdir)/Lib + +check: + for f in $(all-dot-i-files) ; do \ + base=`basename $$f .i` ; \ + xml=$$base.xml ; \ + SWIG_LIB=$(chk-swiglib) $(top_srcdir)/swig -xml $$xml $$f ; \ + cat $$xml | $(cleanup) | diff -c $$base.expected-xml - ; \ + done + +clean: + rm -f *.xml + +distclean: clean + rm -f Makefile + +# from here on, non-developers beware! + +%.expected-xml : %.i + SWIG_LIB=$(top_srcdir)/Lib $(top_srcdir)/swig -xml tmp-file $^ + cat tmp-file | $(cleanup) > $@ + rm -f tmp-file + +all-expected-xml: + for f in $(all-dot-i-files) ; do \ + make `basename $$f .i`.expected-xml ; done + +all-expected-xml-clean: + rm -f *.expected-xml + +# Examples/xml/Makefile ends here diff --git a/Examples/xml/error.expected-xml b/Examples/xml/error.expected-xml new file mode 100644 index 0000000..6b1a316 --- /dev/null +++ b/Examples/xml/error.expected-xml @@ -0,0 +1,24 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="error.i" > + <swigxml:child > + <swig:module name="error" /> + <c:enum > + <swigxml:child > + <c:enumvalue name="RED" > + <swigxml:value string="RED" /> + </c:enumvalue> + <c:enumvalue name="GREEN" /> + <c:enumvalue name="BLUE" /> + </swigxml:child> + </c:enum> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/error.i b/Examples/xml/error.i new file mode 100644 index 0000000..7ea59a0 --- /dev/null +++ b/Examples/xml/error.i @@ -0,0 +1,2 @@ +%module error +enum { RED=10, GREEN, BLUE };
\ No newline at end of file diff --git a/Examples/xml/example.expected-xml b/Examples/xml/example.expected-xml new file mode 100644 index 0000000..2823136 --- /dev/null +++ b/Examples/xml/example.expected-xml @@ -0,0 +1,23 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example.i" > + <swigxml:child > + <swig:module name="example" /> + <swig:apply name="OUTPUT" > + <swigxml:parms > + <swigxml:none name="r" > + <swigxml:type string="p.int" /> + </swigxml:none> + </swigxml:parms> + <swigxml:type string="p.int" /> + </swig:apply> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example.h b/Examples/xml/example.h new file mode 100644 index 0000000..7f31fce --- /dev/null +++ b/Examples/xml/example.h @@ -0,0 +1,3 @@ +// i add this file because it's referenced by other files. +// someone should replace these comments w/ proper content. +// --ttn, 2001/01/16 17:44:19 diff --git a/Examples/xml/example.i b/Examples/xml/example.i new file mode 100644 index 0000000..77d571e --- /dev/null +++ b/Examples/xml/example.i @@ -0,0 +1,8 @@ +/* File : example.i */ +%module example + +%apply int *OUTPUT { int *r }; + + + + diff --git a/Examples/xml/example_apply.expected-xml b/Examples/xml/example_apply.expected-xml new file mode 100644 index 0000000..50a6509 --- /dev/null +++ b/Examples/xml/example_apply.expected-xml @@ -0,0 +1,1486 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_apply.i" > + <swigxml:child > + <swig:module name="example" /> + <c:function name="add" > + <swigxml:parms > + <swigxml:parm name="x" > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm name="result" > + <swigxml:type string="p.int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <swig:file name="../../Lib/pointer.i" > + <swigxml:child > + <swig:module name="pointer" /> + <swig:insert > + <swigxml:code > + +%include pointer.i + +The pointer.i library provides run-time support for managing and +manipulating a variety of C/C++ pointer values. In particular, +you can create various kinds of objects and dereference common +pointer types. This is done through a common set of functions: + + ptrvalue - Dereferences a pointer + ptrset - Set the value of an object referenced by + a pointer. + ptrcreate - Create a new object and return a pointer. + ptrfree - Free the memory allocated by ptrcreate. + ptradd - Increment/decrement a pointer value. + +When creating, dereferencing, or setting the value of pointer +variable, only the common C datatypes of int, short, long, float, +double, char, and char * are currently supported. Other +datatypes may generate an error. + +One of the more interesting aspects of this library is that +it operates with a wide range of datatypes. For example, +the "ptrvalue" function can dereference "double *", "int *", +"long *", "char *", and other datatypes. Since SWIG encodes +pointers with type information, this can be done transparently +and in most cases, you can dereference a pointer without +ever knowing what type it actually is. + +This library is primarily designed for utility, not high +performance (the dynamic determination of pointer types takes +more work than most normal wrapper functions). As a result, +you may achieve better performance by writing customized +"helper" functions if you're making lots of calls to these +functions in inner loops or other intensive operations. + </swigxml:code> + <swigxml:section string="doc" /> + </swig:insert> + <swig:types > + <swigxml:parms > + <swigxml:parm > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.short" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.long" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.float" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.double" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.char" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.p.char" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.void" /> + </swigxml:parm> + </swigxml:parms> + </swig:types> + <swig:file name="../../Lib/xml/ptrlang.i" > + <swigxml:child > + <swig:insert > + <swigxml:code > + +#include &lt;ctype.h> + +/* Types used by the library */ +static swig_type_info *SWIG_POINTER_int_p = 0; +static swig_type_info *SWIG_POINTER_short_p =0; +static swig_type_info *SWIG_POINTER_long_p = 0; +static swig_type_info *SWIG_POINTER_float_p = 0; +static swig_type_info *SWIG_POINTER_double_p = 0; +static swig_type_info *SWIG_POINTER_char_p = 0; +static swig_type_info *SWIG_POINTER_char_pp = 0; +static swig_type_info *SWIG_POINTER_void_p = 0; + </swigxml:code> + </swig:insert> + <swig:insert > + <swigxml:code > + + SWIG_POINTER_int_p = SWIG_TypeQuery("int *"); + SWIG_POINTER_short_p = SWIG_TypeQuery("short *"); + SWIG_POINTER_long_p = SWIG_TypeQuery("long *"); + SWIG_POINTER_float_p = SWIG_TypeQuery("float *"); + SWIG_POINTER_double_p = SWIG_TypeQuery("double *"); + SWIG_POINTER_char_p = SWIG_TypeQuery("char *"); + SWIG_POINTER_char_pp = SWIG_TypeQuery("char **"); + SWIG_POINTER_void_p = SWIG_TypeQuery("void *"); + </swigxml:code> + <swigxml:section string="init" /> + </swig:insert> + <swig:insert > + <swigxml:code > + + +/* #ifdef WIN32 +#undef isspace +#define isspace(c) (c == ' ') +#endif +*/ + +/*------------------------------------------------------------------ + ptrvalue(ptr,type = 0) + + Attempts to dereference a pointer value. If type is given, it + will try to use that type. Otherwise, this function will attempt + to "guess" the proper datatype by checking against all of the + builtin C datatypes. + ------------------------------------------------------------------ */ + +#ifdef PERL_OBJECT +static SV *_ptrvalue(CPerlObj *pPerl,SV *_PTRVALUE, int index, char *type) { +#define ptrvalue(a,b,c) _ptrvalue(pPerl,a,b,c) +#else +static SV *_ptrvalue(SV *_PTRVALUE, int index, char *type) { +#define ptrvalue(a,b,c) _ptrvalue(a,b,c) +#endif + + void *ptr; + SV *obj = 0; + + if (SWIG_ConvertPtr(_PTRVALUE, &ptr, 0) &lt; 0) { + croak("Type error it ptrvalue. Argument is not a valid pointer value."); + } else { + /* If no datatype was passed, try a few common datatypes first */ + if (!type) { + + /* No datatype was passed. Type to figure out if it's a common one */ + + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_int_p) >= 0) { + type = "int"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_double_p) >= 0) { + type = "double"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_short_p) >= 0) { + type = "short"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_long_p) >= 0) { + type = "long"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_float_p) >= 0) { + type = "float"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_p) >= 0) { + type = "char"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_pp) >= 0) { + type = "char *"; + } else { + type = "unknown"; + } + } + + if (!ptr) { + croak("Unable to dereference NULL pointer."); + return 0; + } + + /* Now we have a datatype. Try to figure out what to do about it */ + if (strcmp(type,"int") == 0) { + obj = sv_newmortal(); + sv_setiv(obj,(IV) *(((int *) ptr) + index)); + } else if (strcmp(type,"double") == 0) { + obj = sv_newmortal(); + sv_setnv(obj,(double) *(((double *) ptr)+index)); + } else if (strcmp(type,"short") == 0) { + obj = sv_newmortal(); + sv_setiv(obj,(IV) *(((short *) ptr) + index)); + } else if (strcmp(type,"long") == 0) { + obj = sv_newmortal(); + sv_setiv(obj,(IV) *(((long *) ptr) + index)); + } else if (strcmp(type,"float") == 0) { + obj = sv_newmortal(); + sv_setnv(obj,(double) *(((float *) ptr)+index)); + } else if (strcmp(type,"char") == 0) { + obj = sv_newmortal(); + sv_setpv(obj,((char *) ptr)+index); + } else if (strcmp(type,"char *") == 0) { + char *c = *(((char **) ptr)+index); + obj = sv_newmortal(); + if (c) + sv_setpv(obj,c); + else + sv_setpv(obj,"NULL"); + } else { + croak("Unable to dereference unsupported datatype."); + obj = 0; + } + } + return obj; +} + +/*------------------------------------------------------------------ + ptrcreate(type,value = 0,numelements = 1) + + Attempts to create a new object of given type. Type must be + a basic C datatype. Will not create complex objects. + ------------------------------------------------------------------ */ +#ifdef PERL_OBJECT +static SV *_ptrcreate(CPerlObj *pPerl, char *type, SV *value, int numelements) { +#define ptrcreate(a,b,c) _ptrcreate(pPerl,a,b,c) +#else +static SV *_ptrcreate(char *type, SV *value, int numelements) { +#define ptrcreate(a,b,c) _ptrcreate(a,b,c) +#endif + + void *ptr; + SV *obj; + int sz; + swig_type_info *cast = 0; + + /* Check the type string against a variety of possibilities */ + + if (strcmp(type,"int") == 0) { + sz = sizeof(int)*numelements; + cast = SWIG_POINTER_int_p; + } else if (strcmp(type,"short") == 0) { + sz = sizeof(short)*numelements; + cast = SWIG_POINTER_short_p; + } else if (strcmp(type,"long") == 0) { + sz = sizeof(long)*numelements; + cast = SWIG_POINTER_long_p; + } else if (strcmp(type,"double") == 0) { + sz = sizeof(double)*numelements; + cast = SWIG_POINTER_double_p; + } else if (strcmp(type,"float") == 0) { + sz = sizeof(float)*numelements; + cast = SWIG_POINTER_float_p; + } else if (strcmp(type,"char") == 0) { + sz = sizeof(char)*numelements; + cast = SWIG_POINTER_char_p; + } else if (strcmp(type,"char *") == 0) { + sz = sizeof(char *)*(numelements+1); + cast = SWIG_POINTER_char_pp; + } else if (strcmp(type,"void") == 0) { + sz = numelements; + cast = SWIG_POINTER_void_p; + } else { + croak("Unable to create unknown datatype."); + return 0; + } + + /* Create the new object */ + + ptr = (void *) malloc(sz); + if (!ptr) { + croak("Out of memory in ptrcreate."); + return 0; + } + + /* Now try to set its default value */ + + if (value) { + if (strcmp(type,"int") == 0) { + int *ip,i,ivalue; + ivalue = (int) SvIV(value); + ip = (int *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"short") == 0) { + short *ip,ivalue; + int i; + ivalue = (short) SvIV(value); + ip = (short *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"long") == 0) { + long *ip,ivalue; + int i; + ivalue = (long) SvIV(value); + ip = (long *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"double") == 0) { + double *ip,ivalue; + int i; + ivalue = (double) SvNV(value); + ip = (double *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"float") == 0) { + float *ip,ivalue; + int i; + ivalue = (float) SvNV(value); + ip = (float *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"char") == 0) { + char *ip,*ivalue; + ivalue = (char *) SvPV(value,PL_na); + ip = (char *) ptr; + strncpy(ip,ivalue,numelements-1); + } else if (strcmp(type,"char *") == 0) { + char **ip, *ivalue; + int i; + ivalue = (char *) SvPV(value,PL_na); + ip = (char **) ptr; + for (i = 0; i &lt; numelements; i++) { + if (ivalue) { + ip[i] = (char *) malloc(strlen(ivalue)+1); + strcpy(ip[i],ivalue); + } else { + ip[i] = 0; + } + } + ip[numelements] = 0; + } + } + /* Create the pointer value */ + + + obj = sv_newmortal(); + SWIG_MakePtr(obj,ptr,cast); + return obj; +} + +/*------------------------------------------------------------------ + ptrset(ptr,value,index = 0,type = 0) + + Attempts to set the value of a pointer variable. If type is + given, we will use that type. Otherwise, we'll guess the datatype. + ------------------------------------------------------------------ */ + +#ifdef PERL_OBJECT +static void _ptrset(CPerlObj *pPerl,SV *_PTRVALUE, SV *value, int index, char *type) { +#define ptrset(a,b,c,d) _ptrset(pPerl,a,b,c,d) +#else +static void _ptrset(SV *_PTRVALUE, SV *value, int index, char *type) { +#define ptrset(a,b,c,d) _ptrset(a,b,c,d) +#endif + void *ptr; + SV *obj; + + + if (SWIG_ConvertPtr(_PTRVALUE, &ptr, 0) &lt; 0) { + croak("Type error it ptrvalue. Argument is not a valid pointer value."); + } else { + /* If no datatype was passed, try a few common datatypes first */ + if (!type) { + /* No datatype was passed. Type to figure out if it's a common one */ + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_int_p) >= 0) { + type = "int"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_double_p) >= 0) { + type = "double"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_short_p) >= 0) { + type = "short"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_long_p) >= 0) { + type = "long"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_float_p) >= 0) { + type = "float"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_p) >= 0) { + type = "char"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_pp) >= 0) { + type = "char *"; + } else { + type = "unknown"; + } + } + } + if (!ptr) { + croak("Unable to set NULL pointer."); + return; + } + + /* Now we have a datatype. Try to figure out what to do about it */ + if (strcmp(type,"int") == 0) { + *(((int *) ptr)+index) = (int) SvIV(value); + } else if (strcmp(type,"double") == 0) { + *(((double *) ptr)+index) = (double) SvNV(value); + } else if (strcmp(type,"short") == 0) { + *(((short *) ptr)+index) = (short) SvIV(value); + } else if (strcmp(type,"long") == 0) { + *(((long *) ptr)+index) = (long) SvIV(value); + } else if (strcmp(type,"float") == 0) { + *(((float *) ptr)+index) = (float) SvNV(value); + } else if (strcmp(type,"char") == 0) { + char *c = SvPV(value,PL_na); + strcpy(((char *) ptr)+index, c); + } else if (strcmp(type,"char *") == 0) { + char *c = SvPV(value,PL_na); + char **ca = (char **) ptr; + if (ca[index]) free(ca[index]); + if (strcmp(c,"NULL") == 0) { + ca[index] = 0; + } else { + ca[index] = (char *) malloc(strlen(c)+1); + strcpy(ca[index],c); + } + } else { + croak("Unable to set unsupported datatype."); + return; + } +} + +/*------------------------------------------------------------------ + ptradd(ptr,offset) + + Adds a value to an existing pointer value. Will do a type-dependent + add for basic datatypes. For other datatypes, will do a byte-add. + ------------------------------------------------------------------ */ + +#ifdef PERL_OBJECT +static SV *_ptradd(CPerlObj *pPerl, SV *_PTRVALUE, int offset) { +#define ptradd(a,b) _ptradd(pPerl,a,b) +#else +static SV *_ptradd(SV *_PTRVALUE, int offset) { +#define ptradd(a,b) _ptradd(a,b) +#endif + + void *ptr,*junk; + SV *obj; + swig_type_info *type; + char *tname; + + /* Try to handle a few common datatypes first */ + + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_int_p) >= 0) { + ptr = (void *) (((int *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_double_p) >= 0) { + ptr = (void *) (((double *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_short_p) >= 0) { + ptr = (void *) (((short *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_long_p) >= 0) { + ptr = (void *) (((long *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_float_p) >= 0) { + ptr = (void *) (((float *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_p) >= 0) { + ptr = (void *) (((char *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,0) >= 0) { + ptr = (void *) (((char *) ptr) + offset); + } else { + croak("Type error in ptradd. Argument is not a valid pointer value."); + return 0; + } + printf("ptradd = %x\n", ptr); + tname = HvNAME(SvSTASH(SvRV(_PTRVALUE))); + obj = sv_newmortal(); + sv_setref_pv(obj,tname,ptr); + return obj; +} + +/*------------------------------------------------------------------ + ptrfree(ptr) + + Destroys a pointer value + ------------------------------------------------------------------ */ +#ifdef PERL_OBJECT +void _ptrfree(CPerlObj *pPerl, SV *_PTRVALUE) { +#define ptrfree(a) _ptrfree(pPerl, a) +#else +void _ptrfree(SV *_PTRVALUE) { +#define ptrfree(a) _ptrfree(a) +#endif + + void *ptr, *junk; + + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,0) &lt; 0) { + croak("Type error in ptrfree. Argument is not a valid pointer value."); + return; + } + + /* Check to see if this pointer is a char ** */ + if (SWIG_ConvertPtr(_PTRVALUE,&junk,SWIG_POINTER_char_pp) >= 0) { + char **c = (char **) ptr; + if (c) { + int i = 0; + while (c[i]) { + free(c[i]); + i++; + } + } + } + if (ptr) + free((char *) ptr); +} + + </swigxml:code> + </swig:insert> + <swig:typemap name="ptr" > + <swigxml:code > +{ + $target = $source; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="value" > + <swigxml:code > +{ + $target = $source; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrcast" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrvalue" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrcreate" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptradd" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrset" > + <swigxml:code > +{ + if ($source == -1) return NULL; +} </swigxml:code> + <swigxml:method string="ret" /> + <swigxml:type string="int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <c:function name="ptrvalue" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="index" > + <swigxml:value string="0" /> + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="type" > + <swigxml:value string="0" /> + <swigxml:type string="p.char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="p.SV" /> + </c:function> + <c:function name="ptrset" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="value" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="index" > + <swigxml:value string="0" /> + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="type" > + <swigxml:value string="0" /> + <swigxml:type string="p.char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + <c:function name="ptrcreate" > + <swigxml:parms > + <swigxml:parm name="type" > + <swigxml:type string="p.char" /> + </swigxml:parm> + <swigxml:parm name="value" > + <swigxml:value string="0" /> + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="nitems" > + <swigxml:value string="1" /> + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="p.SV" /> + </c:function> + <c:function name="ptrfree" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + <c:function name="ptradd" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="offset" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="p.SV" /> + </c:function> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + <swig:file name="../../Lib/xml/typemaps.i" > + <swigxml:child > + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (double) SvNV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="float" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (float) SvNV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (int) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (short) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (long) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned int) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned short) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned long) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned char) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="float" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setnv($target,(double) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setnv($target,(double) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.int" /> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.short" /> + <swigxml:method string="in" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.long" /> + <swigxml:method string="in" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned short" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned long" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned char" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.float" /> + <swigxml:method string="in" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.double" /> + <swigxml:method string="in" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.int" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.short" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.long" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned short" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned long" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned char" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.float" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.double" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { + printf("Received %d\n", SvTYPE(tempsv)); + croak("Expected a double reference."); + } + dvalue = SvNV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="float" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { + croak("expected a double reference"); + } + dvalue = (float) SvNV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (short) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (long) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (unsigned int) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="unsigned short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (unsigned short) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="unsigned long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (unsigned long) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setnv(tempsv, (double) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setnv(tempsv, (double) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + <c:function name="sub" > + <swigxml:parms > + <swigxml:parm name="INPUT" > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm name="INPUT" > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm name="OUTPUT" > + <swigxml:type string="p.int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <swig:apply name="OUTPUT" > + <swigxml:parms > + <swigxml:none name="r" > + <swigxml:type string="p.int" /> + </swigxml:none> + </swigxml:parms> + <swigxml:type string="p.int" /> + </swig:apply> + <c:function name="divide" > + <swigxml:parms > + <swigxml:parm name="n" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="d" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="r" > + <swigxml:type string="p.int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="int" /> + </c:function> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_apply.i b/Examples/xml/example_apply.i new file mode 100644 index 0000000..2ed2b5b --- /dev/null +++ b/Examples/xml/example_apply.i @@ -0,0 +1,23 @@ +/* File : example.i */ +%module example + +/* This example illustrates a couple of different techniques + for manipulating C pointers */ + +/* First we'll use the pointer library */ +extern void add(int *x, int *y, int *result); +%include pointer.i + +/* Next we'll use some typemaps */ + +%include typemaps.i +extern void sub(int *INPUT, int *INPUT, int *OUTPUT); + +/* Next we'll use typemaps and the %apply directive */ + +%apply int *OUTPUT { int *r }; +extern int divide(int n, int d, int *r); + + + + diff --git a/Examples/xml/example_const.expected-xml b/Examples/xml/example_const.expected-xml new file mode 100644 index 0000000..eee768c --- /dev/null +++ b/Examples/xml/example_const.expected-xml @@ -0,0 +1,51 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_const.i" > + <swigxml:child > + <swig:module name="example" /> + <swig:constant name="ICONST" > + <swigxml:value string="42" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="FCONST" > + <swigxml:value string="2.1828" /> + <swigxml:type string="double" /> + </swig:constant> + <swig:constant name="CCONST" > + <swigxml:value string="x" /> + <swigxml:type string="char" /> + </swig:constant> + <swig:constant name="CCONST2" > + <swigxml:value string="\n" /> + <swigxml:type string="char" /> + </swig:constant> + <swig:constant name="SCONST" > + <swigxml:value string="Hello World" /> + <swigxml:type string="p.char" /> + </swig:constant> + <swig:constant name="SCONST2" > + <swigxml:value string="\"Hello World\"" /> + <swigxml:type string="p.char" /> + </swig:constant> + <swig:constant name="EXPR" > + <swigxml:value string="42+3*(2.1828)" /> + <swigxml:type string="double" /> + </swig:constant> + <c:variable name="iconst" > + <swigxml:value string="37" /> + <swigxml:type string="q(const).int" /> + </c:variable> + <c:variable name="fconst" > + <swigxml:value string="3.14" /> + <swigxml:type string="q(const).double" /> + </c:variable> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_const.i b/Examples/xml/example_const.i new file mode 100644 index 0000000..29a1a7f --- /dev/null +++ b/Examples/xml/example_const.i @@ -0,0 +1,26 @@ +/* File : example.i */ +%module example + +/* A few preprocessor macros */ + +#define ICONST 42 +#define FCONST 2.1828 +#define CCONST 'x' +#define CCONST2 '\n' +#define SCONST "Hello World" +#define SCONST2 "\"Hello World\"" + +/* This should work just fine */ +#define EXPR ICONST + 3*(FCONST) + +/* This shouldn't do anything */ +#define EXTERN extern + +/* Neither should this (BAR isn't defined) */ +#define FOO (ICONST + BAR) + +/* The following statements also produce constants */ +const int iconst = 37; +const double fconst = 3.14; + + diff --git a/Examples/xml/example_gif.expected-xml b/Examples/xml/example_gif.expected-xml new file mode 100644 index 0000000..3b21b8e --- /dev/null +++ b/Examples/xml/example_gif.expected-xml @@ -0,0 +1,2338 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_gif.i" > + <swigxml:child > + <c:typedef name="Pixel" > + <swigxml:type string="unsigned char" /> + </c:typedef> + <c:typedef name="Zvalue" > + <swigxml:type string="float" /> + </c:typedef> + <c:class name="ColorMap" > + <swigxml:child > + <c:variable name="cmap" > + <swigxml:type string="p.unsigned char" /> + </c:variable> + <c:variable name="name" > + <swigxml:type string="p.char" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="ColorMap" /> + <swigxml:altname string="ColorMap" /> + </c:class> + <c:typedef name="ColorMap" > + <swigxml:type string="ColorMap" /> + </c:typedef> + <c:function name="new_ColorMap" > + <swigxml:parms > + <swigxml:parm name="filename" > + <swigxml:type string="p.char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.ColorMap" /> + </c:function> + <c:function name="delete_ColorMap" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="ColorMap_default" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="ColorMap_assign" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + <swigxml:parm name="index" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="r" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="g" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="b" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="ColorMap_getitem" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + <swigxml:parm name="index" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="int" /> + </c:function> + <c:function name="ColorMap_setitem" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + <swigxml:parm name="index" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="value" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="ColorMap_write" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + <swigxml:parm name="filename" > + <swigxml:type string="p.char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="int" /> + </c:function> + <swig:constant name="BLACK" > + <swigxml:value string="0" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="WHITE" > + <swigxml:value string="1" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="RED" > + <swigxml:value string="2" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="GREEN" > + <swigxml:value string="3" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="BLUE" > + <swigxml:value string="4" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="YELLOW" > + <swigxml:value string="5" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="CYAN" > + <swigxml:value string="6" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="MAGENTA" > + <swigxml:value string="7" /> + <swigxml:type string="int" /> + </swig:constant> + <c:class name="FrameBuffer" > + <swigxml:child > + <c:variable name="pixels" > + <swigxml:type string="p.p.Pixel" /> + </c:variable> + <c:variable name="zbuffer" > + <swigxml:type string="p.p.Zvalue" /> + </c:variable> + <c:variable name="height" > + <swigxml:type string="unsigned int" /> + </c:variable> + <c:variable name="width" > + <swigxml:type string="unsigned int" /> + </c:variable> + <c:variable name="xmin" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="ymin" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="xmax" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="ymax" > + <swigxml:type string="int" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="FrameBuffer" /> + <swigxml:altname string="FrameBuffer" /> + </c:class> + <c:typedef name="FrameBuffer" > + <swigxml:type string="FrameBuffer" /> + </c:typedef> + <swig:constant name="ZMIN" > + <swigxml:value string="1e+36" /> + <swigxml:type string="double" /> + </swig:constant> + <c:function name="new_FrameBuffer" > + <swigxml:parms > + <swigxml:parm name="width" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + <swigxml:parm name="height" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.FrameBuffer" /> + </c:function> + <c:function name="delete_FrameBuffer" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_resize" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="width" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="height" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="int" /> + </c:function> + <c:function name="FrameBuffer_clear" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_plot" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_horizontal" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="xmin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="xmax" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_horizontalinterp" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="xmin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="xmax" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c1" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="c2" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_vertical" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="ymin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="ymax" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_box" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_solidbox" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_interpbox" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c1" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="c2" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="c3" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="c4" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_circle" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="radius" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_solidcircle" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="radius" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_line" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_setclip" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="xmin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="ymin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="xmax" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="ymax" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_noclip" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_makeGIF" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="cmap" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + <swigxml:parm name="buffer" > + <swigxml:type string="p.void" /> + </swigxml:parm> + <swigxml:parm name="maxsize" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="int" /> + </c:function> + <c:function name="FrameBuffer_writeGIF" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="p.ColorMap" /> + </swigxml:parm> + <swigxml:parm name="filename" > + <swigxml:type string="p.char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="int" /> + </c:function> + <c:function name="FrameBuffer_zresize" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="width" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="height" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_zclear" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_solidtriangle" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_interptriangle" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="tx1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="ty1" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c1" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="tx2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="ty2" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c2" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="tx3" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="ty3" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c3" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <swig:constant name="HORIZONTAL" > + <swigxml:value string="1" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="VERTICAL" > + <swigxml:value string="2" /> + <swigxml:type string="int" /> + </swig:constant> + <c:function name="FrameBuffer_drawchar" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="fgcolor" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="bgcolor" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="chr" > + <swigxml:type string="char" /> + </swigxml:parm> + <swigxml:parm name="orientation" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_drawstring" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="fgcolor" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="bgcolor" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="text" > + <swigxml:type string="p.char" /> + </swigxml:parm> + <swigxml:parm name="orientation" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:class name="PixMap" > + <swigxml:child > + <c:variable name="width" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="height" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="centerx" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="centery" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="map" > + <swigxml:type string="p.int" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="PixMap" /> + <swigxml:altname string="PixMap" /> + </c:class> + <c:typedef name="PixMap" > + <swigxml:type string="PixMap" /> + </c:typedef> + <c:function name="new_PixMap" > + <swigxml:parms > + <swigxml:parm name="width" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="height" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="centerx" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="centery" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.PixMap" /> + </c:function> + <c:function name="delete_PixMap" > + <swigxml:parms > + <swigxml:parm name="pm" > + <swigxml:type string="p.PixMap" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="PixMap_set" > + <swigxml:parms > + <swigxml:parm name="pm" > + <swigxml:type string="p.PixMap" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="pix" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="FrameBuffer_drawpixmap" > + <swigxml:parms > + <swigxml:parm name="f" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="pm" > + <swigxml:type string="p.PixMap" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="fgcolor" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="bgcolor" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <swig:constant name="TRANSPARENT" > + <swigxml:value string="0" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="FOREGROUND" > + <swigxml:value string="1" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="BACKGROUND" > + <swigxml:value string="2" /> + <swigxml:type string="int" /> + </swig:constant> + <c:class name="Plot2D" > + <swigxml:child > + <c:variable name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </c:variable> + <c:variable name="view_xmin" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="view_ymin" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="view_xmax" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="view_ymax" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="xmin" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ymin" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="xmax" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ymax" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="xscale" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="yscale" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="dx" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="dy" > + <swigxml:type string="double" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="Plot2D" /> + <swigxml:altname string="Plot2D" /> + </c:class> + <c:typedef name="Plot2D" > + <swigxml:type string="Plot2D" /> + </c:typedef> + <c:function name="new_Plot2D" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="xmin" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ymin" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="xmax" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ymax" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.Plot2D" /> + </c:function> + <c:function name="delete_Plot2D" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_copy" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.Plot2D" /> + </c:function> + <c:function name="Plot2D_clear" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_setview" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="vxmin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="vymin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="vxmax" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="vymax" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_setrange" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="xmin" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ymin" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="xmax" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ymax" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_setscale" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="xscale" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="yscale" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_plot" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_box" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_solidbox" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_interpbox" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c1" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="c2" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="c3" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="c4" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_circle" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="radius" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_solidcircle" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="radius" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_line" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_start" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_drawpixmap" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="pm" > + <swigxml:type string="p.PixMap" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="bgcolor" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_xaxis" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="xtick" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ticklength" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_yaxis" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ytick" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ticklength" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_triangle" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_solidtriangle" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot2D_interptriangle" > + <swigxml:parms > + <swigxml:parm name="p2" > + <swigxml:type string="p.Plot2D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c1" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c2" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c3" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <swig:constant name="LINEAR" > + <swigxml:value string="10" /> + <swigxml:type string="int" /> + </swig:constant> + <swig:constant name="LOG" > + <swigxml:value string="11" /> + <swigxml:type string="int" /> + </swig:constant> + <c:typedef name="Matrix" > + <swigxml:type string="p.double" /> + </c:typedef> + <c:class name="GL_Vector" > + <swigxml:child > + <c:variable name="x" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="y" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="z" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="w" > + <swigxml:type string="double" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="GL_Vector" /> + <swigxml:altname string="GL_Vector" /> + </c:class> + <c:typedef name="GL_Vector" > + <swigxml:type string="GL_Vector" /> + </c:typedef> + <c:function name="new_Matrix" > + <swigxml:storage string="extern" /> + <swigxml:type string="Matrix" /> + </c:function> + <c:function name="delete_Matrix" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_copy" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="Matrix" /> + </c:function> + <c:function name="Matrix_multiply" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="b" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_identity" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_zero" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_transpose" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="result" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_invert" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="inva" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_transform" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="r" > + <swigxml:type string="p.GL_Vector" /> + </swigxml:parm> + <swigxml:parm name="t" > + <swigxml:type string="p.GL_Vector" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_transform4" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="rx" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ry" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="rz" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="rw" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="t" > + <swigxml:type string="p.GL_Vector" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_print" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_translate" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="tx" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ty" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="tz" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_rotatex" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_rotatey" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Matrix_rotatez" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Matrix" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:class name="Plot3D" > + <swigxml:child > + <c:variable name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </c:variable> + <c:variable name="view_xmin" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="view_ymin" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="view_xmax" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="view_ymax" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="xmin" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ymin" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="zmin" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="xmax" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ymax" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="zmax" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="xcenter" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ycenter" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="zcenter" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="fovy" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="aspect" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="znear" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="zfar" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="center_mat" > + <swigxml:type string="Matrix" /> + </c:variable> + <c:variable name="model_mat" > + <swigxml:type string="Matrix" /> + </c:variable> + <c:variable name="view_mat" > + <swigxml:type string="Matrix" /> + </c:variable> + <c:variable name="fullmodel_mat" > + <swigxml:type string="Matrix" /> + </c:variable> + <c:variable name="trans_mat" > + <swigxml:type string="Matrix" /> + </c:variable> + <c:variable name="lookatz" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="xshift" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="yshift" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="zoom" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="width" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="height" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="pers_mode" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="ortho_left" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ortho_right" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ortho_bottom" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="ortho_top" > + <swigxml:type string="double" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="Plot3D" /> + <swigxml:altname string="Plot3D" /> + </c:class> + <c:typedef name="Plot3D" > + <swigxml:type string="Plot3D" /> + </c:typedef> + <c:function name="new_Plot3D" > + <swigxml:parms > + <swigxml:parm name="frame" > + <swigxml:type string="p.FrameBuffer" /> + </swigxml:parm> + <swigxml:parm name="xmin" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ymin" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="zmin" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="xmax" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="ymax" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="zmax" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.Plot3D" /> + </c:function> + <c:function name="delete_Plot3D" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_copy" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.Plot3D" /> + </c:function> + <c:function name="Plot3D_clear" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="Color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_perspective" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="fovy" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="znear" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="zfar" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_ortho" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="left" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="right" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="top" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="bottom" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_lookat" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="z" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_autoperspective" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="fovy" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_autoortho" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_rotx" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_roty" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_rotz" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_rotl" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_rotr" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_rotd" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_rotu" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_rotc" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="deg" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_zoom" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="percent" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_left" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="percent" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_right" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="percent" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_down" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="percent" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_up" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="percent" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_center" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="cx" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="cy" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_plot" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="Color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_setview" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="vxmin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="vymin" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="vxmax" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="vymax" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_start" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_line" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_triangle" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_solidtriangle" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_interptriangle" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c1" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c2" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c3" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_quad" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_solidquad" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="x4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="color" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_interpquad" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z1" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c1" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="x2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z2" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c2" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="x3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z3" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c3" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="x4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z4" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c4" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_solidsphere" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="radius" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:function name="Plot3D_outlinesphere" > + <swigxml:parms > + <swigxml:parm name="p3" > + <swigxml:type string="p.Plot3D" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="radius" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="c" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + <swigxml:parm name="bc" > + <swigxml:type string="Pixel" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="void" /> + </c:function> + <c:variable name="PixMap_SQUARE" > + <swigxml:storage string="extern" /> + <swigxml:type string="PixMap" /> + </c:variable> + <c:variable name="PixMap_TRIANGLE" > + <swigxml:storage string="extern" /> + <swigxml:type string="PixMap" /> + </c:variable> + <c:variable name="PixMap_CROSS" > + <swigxml:storage string="extern" /> + <swigxml:type string="PixMap" /> + </c:variable> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_gif.i b/Examples/xml/example_gif.i new file mode 100644 index 0000000..f0fb3b1 --- /dev/null +++ b/Examples/xml/example_gif.i @@ -0,0 +1,329 @@ +/* ----------------------------------------------------------------------------- + * gifplot.h + * + * Main header file for the GIFPlot library. + * + * Author(s) : David Beazley (beazley@cs.uchicago.edu) + * Copyright (C) 1995-1996 + * + * See the file LICENSE for information on usage and redistribution. + * ----------------------------------------------------------------------------- */ + +#include <stdio.h> +#include <fcntl.h> +#include <float.h> +#include <stdlib.h> +#include <string.h> +#include <limits.h> + +#ifndef GIFPLOT_H + +/* Pixel is 8-bits */ + +typedef unsigned char Pixel; +typedef float Zvalue; + +/* ------------------------------------------------------------------------ + ColorMap + + Definition and methods for colormaps + ------------------------------------------------------------------------ */ + +typedef struct ColorMap { + unsigned char *cmap; + char *name; +} ColorMap; + +extern ColorMap *new_ColorMap(char *filename); +extern void delete_ColorMap(ColorMap *c); +extern void ColorMap_default(ColorMap *c); +extern void ColorMap_assign(ColorMap *c, int index, int r, int g, int b); +extern int ColorMap_getitem(ColorMap *c, int index); +extern void ColorMap_setitem(ColorMap *c, int index, int value); +extern int ColorMap_write(ColorMap *c, char *filename); + +/* Some default colors */ + +#define BLACK 0 +#define WHITE 1 +#define RED 2 +#define GREEN 3 +#define BLUE 4 +#define YELLOW 5 +#define CYAN 6 +#define MAGENTA 7 + +/*------------------------------------------------------------------------- + FrameBuffer + + This structure defines a simple 8 bit framebuffer. + ------------------------------------------------------------------------- */ + +typedef struct FrameBuffer { + Pixel **pixels; + Zvalue **zbuffer; + unsigned int height; + unsigned int width; + int xmin; /* These are used for clipping */ + int ymin; + int xmax; + int ymax; +} FrameBuffer; + +#define ZMIN 1e+36 + +/* FrameBuffer Methods */ + +extern FrameBuffer *new_FrameBuffer(unsigned int width, unsigned int height); +extern void delete_FrameBuffer(FrameBuffer *frame); +extern int FrameBuffer_resize(FrameBuffer *frame, int width, int height); +extern void FrameBuffer_clear(FrameBuffer *frame, Pixel color); +extern void FrameBuffer_plot(FrameBuffer *frame, int x, int y, Pixel color); +extern void FrameBuffer_horizontal(FrameBuffer *frame, int xmin, int xmax, int y, Pixel color); +extern void FrameBuffer_horizontalinterp(FrameBuffer *f, int xmin, int xmax, int y, Pixel c1, Pixel c2); +extern void FrameBuffer_vertical(FrameBuffer *frame, int ymin, int ymax, int x, Pixel color); +extern void FrameBuffer_box(FrameBuffer *frame, int x1, int y1, int x2, int y2, Pixel color); +extern void FrameBuffer_solidbox(FrameBuffer *frame, int x1, int y1, int x2, int y2, Pixel color); +extern void FrameBuffer_interpbox(FrameBuffer *f, int x1, int y1, int x2, int y2, Pixel c1, Pixel c2, Pixel c3, Pixel c4); +extern void FrameBuffer_circle(FrameBuffer *frame, int x1, int y1, int radius, Pixel color); +extern void FrameBuffer_solidcircle(FrameBuffer *frame, int x1, int y1, int radius, Pixel color); +extern void FrameBuffer_line(FrameBuffer *frame, int x1, int y1, int x2, int y2, Pixel color); +extern void FrameBuffer_setclip(FrameBuffer *frame, int xmin, int ymin, int xmax, int ymax); +extern void FrameBuffer_noclip(FrameBuffer *frame); +extern int FrameBuffer_makeGIF(FrameBuffer *frame, ColorMap *cmap, void *buffer, unsigned int maxsize); +extern int FrameBuffer_writeGIF(FrameBuffer *f, ColorMap *c, char *filename); +extern void FrameBuffer_zresize(FrameBuffer *f, int width, int height); +extern void FrameBuffer_zclear(FrameBuffer *f); +extern void FrameBuffer_solidtriangle(FrameBuffer *f, int x1, int y1, int x2, int y2, int x3, int y3, Pixel c); +extern void FrameBuffer_interptriangle(FrameBuffer *f, int tx1, int ty1, Pixel c1, + int tx2, int ty2, Pixel c2, int tx3, int ty3, Pixel c3); + +#define HORIZONTAL 1 +#define VERTICAL 2 + +extern void FrameBuffer_drawchar(FrameBuffer *frame, int x, int y, int fgcolor, int bgcolor, char chr, int orientation); +extern void FrameBuffer_drawstring(FrameBuffer *f, int x, int y, int fgcolor, int bgcolor, char *text, int orientation); + +/* ------------------------------------------------------------------------ + PixMap + + The equivalent of "bit-maps". + ------------------------------------------------------------------------ */ + +typedef struct PixMap { + int width; + int height; + int centerx; + int centery; + int *map; +} PixMap; + +/* PIXMAP methods */ + +extern PixMap *new_PixMap(int width, int height, int centerx, int centery); +extern void delete_PixMap(PixMap *pm); +extern void PixMap_set(PixMap *pm, int x, int y, int pix); +extern void FrameBuffer_drawpixmap(FrameBuffer *f, PixMap *pm, int x, int y, int fgcolor, int bgcolor); + +#define TRANSPARENT 0 +#define FOREGROUND 1 +#define BACKGROUND 2 + +/* ------------------------------------------------------------------------ + Plot2D + + Definition and methods for 2D plots. + ------------------------------------------------------------------------ */ + +typedef struct Plot2D { + FrameBuffer *frame; /* what frame buffer are we using */ + int view_xmin; /* Minimum coordinates of view region */ + int view_ymin; + int view_xmax; /* Maximum coordinates of view region */ + int view_ymax; + double xmin; /* Minimum coordinates of plot region */ + double ymin; + double xmax; /* Maximum coordinates of plot region */ + double ymax; + int xscale; /* Type of scaling (LINEAR, LOG, etc..) */ + int yscale; + double dx; /* Private scaling parameters */ + double dy; +} Plot2D; + +/* 2D Plot methods */ + +extern Plot2D *new_Plot2D(FrameBuffer *frame,double xmin,double ymin, double xmax, double ymax); +extern void delete_Plot2D(Plot2D *p2); +extern Plot2D *Plot2D_copy(Plot2D *p2); +extern void Plot2D_clear(Plot2D *p2, Pixel c); +extern void Plot2D_setview(Plot2D *p2, int vxmin, int vymin, int vxmax, int vymax); +extern void Plot2D_setrange(Plot2D *p2, double xmin, double ymin, double xmax, double ymax); +extern void Plot2D_setscale(Plot2D *p2, int xscale, int yscale); +extern void Plot2D_plot(Plot2D *p2, double x, double y, Pixel color); +extern void Plot2D_box(Plot2D *p2, double x1, double y1, double x2, double y2, Pixel color); +extern void Plot2D_solidbox(Plot2D *p2, double x1, double y1,double x2, double y2, Pixel color); +extern void Plot2D_interpbox(Plot2D *p2, double x1, double y1, double x2, double y2, Pixel c1, Pixel c2, Pixel c3, Pixel c4); +extern void Plot2D_circle(Plot2D *p2, double x, double y, double radius, Pixel color); +extern void Plot2D_solidcircle(Plot2D *p2, double x, double y, double radius, Pixel color); +extern void Plot2D_line(Plot2D *p2, double x1, double y1, double x2, double y2, Pixel color); +extern void Plot2D_start(Plot2D *p2); +extern void Plot2D_drawpixmap(Plot2D *p2, PixMap *pm, double x, double y, Pixel color, Pixel bgcolor); +extern void Plot2D_xaxis(Plot2D *p2, double x, double y, double xtick, int ticklength, Pixel c); +extern void Plot2D_yaxis(Plot2D *p2, double x, double y, double ytick, int ticklength, Pixel c); +extern void Plot2D_triangle(Plot2D *p2, double x1, double y1, double x2, double y2, double x3, double y3, Pixel c); +extern void Plot2D_solidtriangle(Plot2D *p2, double x1, double y1, double x2, double y2, double x3, double y3, Pixel c); +extern void Plot2D_interptriangle(Plot2D *p2, double x1, double y1, Pixel c1, + double x2, double y2, Pixel c2, + double x3, double y3, Pixel c3); + +#define LINEAR 10 +#define LOG 11 + +/* ----------------------------------------------------------------------- + Matrix + + Operations on 4x4 transformation matrices and vectors. + Matrices are represented as a double array of 16 elements + ----------------------------------------------------------------------- */ + +typedef double *Matrix; +typedef struct GL_Vector { + double x; + double y; + double z; + double w; +} GL_Vector; + +extern Matrix new_Matrix(); +extern void delete_Matrix(Matrix a); +extern Matrix Matrix_copy(Matrix a); +extern void Matrix_multiply(Matrix a, Matrix b, Matrix c); +extern void Matrix_identity(Matrix a); +extern void Matrix_zero(Matrix a); +extern void Matrix_transpose(Matrix a, Matrix result); +extern void Matrix_invert(Matrix a, Matrix inva); +extern void Matrix_transform(Matrix a, GL_Vector *r, GL_Vector *t); +extern void Matrix_transform4(Matrix a, double rx, double ry, double rz, + double rw, GL_Vector *t); + +extern void Matrix_print(Matrix a); +extern void Matrix_translate(Matrix a, double tx, double ty, double tz); +extern void Matrix_rotatex(Matrix a, double deg); +extern void Matrix_rotatey(Matrix a, double deg); +extern void Matrix_rotatez(Matrix a, double deg); + +/* ----------------------------------------------------------------------- + Plot3D + + Data Structure for 3-D plots + ------------------------------------------------------------------------ */ + +typedef struct Plot3D { + FrameBuffer *frame; /* Frame buffer being used */ + int view_xmin; /* Viewing region */ + int view_ymin; + int view_xmax; + int view_ymax; + double xmin; /* Bounding box */ + double ymin; + double zmin; + double xmax; + double ymax; + double zmax; + double xcenter; /* Center point */ + double ycenter; + double zcenter; + double fovy; /* Field of view */ + double aspect; /* Aspect ratio */ + double znear; /* near "clipping" plane */ + double zfar; /* far "clipping" plane */ + Matrix center_mat; /* Matrix used for centering the model */ + Matrix model_mat; /* Model rotation matrix */ + Matrix view_mat; /* Viewing matrix */ + Matrix fullmodel_mat; /* Full model matrix. Used by sphere plot */ + Matrix trans_mat; /* Total transformation matrix */ + double lookatz; /* Where is the z-lookat point */ + double xshift; /* Used for translation and stuff */ + double yshift; + double zoom; + int width; + int height; + int pers_mode; /* Perspective mode (private) */ + double ortho_left,ortho_right,ortho_bottom,ortho_top; +} Plot3D; + +extern Plot3D *new_Plot3D(FrameBuffer *frame, double xmin, double ymin, double zmin, + double xmax, double ymax, double zmax); +extern void delete_Plot3D(Plot3D *p3); +extern Plot3D *Plot3D_copy(Plot3D *p3); +extern void Plot3D_clear(Plot3D *p3, Pixel Color); +extern void Plot3D_perspective(Plot3D *p3, double fovy, double znear, double zfar); +extern void Plot3D_ortho(Plot3D *p3, double left, double right, double top, double bottom); +extern void Plot3D_lookat(Plot3D *p3, double z); +extern void Plot3D_autoperspective(Plot3D *p3, double fovy); +extern void Plot3D_autoortho(Plot3D *p3); +extern void Plot3D_rotx(Plot3D *p3, double deg); +extern void Plot3D_roty(Plot3D *p3, double deg); +extern void Plot3D_rotz(Plot3D *p3, double deg); +extern void Plot3D_rotl(Plot3D *p3, double deg); +extern void Plot3D_rotr(Plot3D *p3, double deg); +extern void Plot3D_rotd(Plot3D *p3, double deg); +extern void Plot3D_rotu(Plot3D *p3, double deg); +extern void Plot3D_rotc(Plot3D *p3, double deg); +extern void Plot3D_zoom(Plot3D *p3, double percent); +extern void Plot3D_left(Plot3D *p3, double percent); +extern void Plot3D_right(Plot3D *p3, double percent); +extern void Plot3D_down(Plot3D *p3, double percent); +extern void Plot3D_up(Plot3D *p3, double percent); +extern void Plot3D_center(Plot3D *p3, double cx, double cy); + +extern void Plot3D_plot(Plot3D *p3, double x, double y, double z, Pixel Color); + +extern void Plot3D_setview(Plot3D *p3, int vxmin, int vymin, int vxmax, int vymax); +extern void Plot3D_start(Plot3D *p3); +extern void Plot3D_line(Plot3D *p3, double x1, double y1, double z1, + double x2, double y2, double z2, Pixel color); +extern void Plot3D_triangle(Plot3D *p3, double x1, double y1, double z1, + double x2, double y2, double z2, + double x3, double y3, double z3, Pixel color); +extern void Plot3D_solidtriangle(Plot3D *p3, double x1, double y1, double z1, + double x2, double y2, double z2, + double x3, double y3, double z3, Pixel color); + +extern void Plot3D_interptriangle(Plot3D *p3, + double x1, double y1, double z1, Pixel c1, + double x2, double y2, double z2, Pixel c2, + double x3, double y3, double z3, Pixel c3); + +extern void Plot3D_quad(Plot3D *p3, double x1, double y1, double z1, + double x2, double y2, double z2, + double x3, double y3, double z3, + double x4, double y4, double z4, + Pixel color); + +extern void Plot3D_solidquad(Plot3D *p3, double x1, double y1, double z1, + double x2, double y2, double z2, + double x3, double y3, double z3, + double x4, double y4, double z4, + Pixel color); + +extern void Plot3D_interpquad(Plot3D *p3, double x1, double y1, double z1, Pixel c1, + double x2, double y2, double z2, Pixel c2, + double x3, double y3, double z3, Pixel c3, + double x4, double y4, double z4, Pixel c4); + + +extern void Plot3D_solidsphere(Plot3D *p3, double x, double y, double z, double radius,Pixel c); + +extern void Plot3D_outlinesphere(Plot3D *p3, double x, double y, double z, double radius,Pixel c, Pixel bc); + +extern PixMap PixMap_SQUARE; +extern PixMap PixMap_TRIANGLE; +extern PixMap PixMap_CROSS; + +#endif +#define GIFPLOT_H + + + diff --git a/Examples/xml/example_inl.expected-xml b/Examples/xml/example_inl.expected-xml new file mode 100644 index 0000000..6f83cfd --- /dev/null +++ b/Examples/xml/example_inl.expected-xml @@ -0,0 +1,104 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_inl.i" > + <swigxml:child > + <swig:module name="example" /> + <swig:insert > + <swigxml:code > + +#include "example.h" + </swigxml:code> + </swig:insert> + <c:function name="dot_product" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Vector" /> + </swigxml:parm> + <swigxml:parm name="b" > + <swigxml:type string="Vector" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="double" /> + </c:function> + <c:function name="vector_add" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="Vector" /> + </swigxml:parm> + <swigxml:parm name="b" > + <swigxml:type string="Vector" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="Vector" /> + </c:function> + <c:function name="free" > + <swigxml:parms > + <swigxml:parm > + <swigxml:type string="p.void" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + <swig:insert > + <swigxml:code > + + +Vector *new_Vector(double x, double y, double z) { + Vector *v = (Vector *) malloc(sizeof(Vector)); + v->x = x; + v->y = y; + v->z = z; + return v; +} + +void vector_print(Vector *v) { + printf("Vector %x = (%g, %g, %g)\n", v, v->x, v->y, v->z); +} + </swigxml:code> + </swig:insert> + <c:function name="new_Vector" > + <swigxml:parms > + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + Vector *v = (Vector *) malloc(sizeof(Vector)); + v->x = x; + v->y = y; + v->z = z; + return v; +} </swigxml:code> + <swigxml:type string="p.Vector" /> + </c:function> + <c:function name="vector_print" > + <swigxml:parms > + <swigxml:parm name="v" > + <swigxml:type string="p.Vector" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + printf("Vector %x = (%g, %g, %g)\n", v, v->x, v->y, v->z); +} </swigxml:code> + <swigxml:type string="void" /> + </c:function> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_inl.h b/Examples/xml/example_inl.h new file mode 100644 index 0000000..212cf4b --- /dev/null +++ b/Examples/xml/example_inl.h @@ -0,0 +1,5 @@ +/* File : example.h */ + +typedef struct { + double x, y, z; +} Vector; diff --git a/Examples/xml/example_inl.i b/Examples/xml/example_inl.i new file mode 100644 index 0000000..39e4905 --- /dev/null +++ b/Examples/xml/example_inl.i @@ -0,0 +1,30 @@ +// Tests SWIG's handling of pass-by-value for complex datatypes +%module example + +%{ +#include "example.h" +%} + +/* Some functions that manipulate Vectors by value */ +extern double dot_product(Vector a, Vector b); +extern Vector vector_add(Vector a, Vector b); + +/* Include this because the vector_add() function will leak memory */ +void free(void *); + +/* Some helper functions for our interface */ +%inline %{ + +Vector *new_Vector(double x, double y, double z) { + Vector *v = (Vector *) malloc(sizeof(Vector)); + v->x = x; + v->y = y; + v->z = z; + return v; +} + +void vector_print(Vector *v) { + printf("Vector %p = (%g, %g, %g)\n", v, v->x, v->y, v->z); +} +%} + diff --git a/Examples/xml/example_p5.expected-xml b/Examples/xml/example_p5.expected-xml new file mode 100644 index 0000000..15dc205 --- /dev/null +++ b/Examples/xml/example_p5.expected-xml @@ -0,0 +1,24 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_p5.i" > + <swigxml:child > + <swig:module name="example" /> + <swig:insert > + <swigxml:code > + +#include "example.h" + </swigxml:code> + </swig:insert> + <swig:file name="example.h" > + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_p5.i b/Examples/xml/example_p5.i new file mode 100644 index 0000000..23ee8a8 --- /dev/null +++ b/Examples/xml/example_p5.i @@ -0,0 +1,11 @@ +/* File : example.i */ +%module example + +%{ +#include "example.h" +%} + +/* Let's just grab the original header file here */ + +%include "example.h" + diff --git a/Examples/xml/example_ro.expected-xml b/Examples/xml/example_ro.expected-xml new file mode 100644 index 0000000..d4a0661 --- /dev/null +++ b/Examples/xml/example_ro.expected-xml @@ -0,0 +1,23 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_ro.i" > + <swigxml:child > + <swig:pragma name="readonly" /> + <c:variable name="status" > + <swigxml:storage string="extern" /> + <swigxml:type string="int" /> + </c:variable> + <c:variable name="path" > + <swigxml:storage string="extern" /> + <swigxml:type string="a(256).char" /> + </c:variable> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_ro.i b/Examples/xml/example_ro.i new file mode 100644 index 0000000..23bd1a8 --- /dev/null +++ b/Examples/xml/example_ro.i @@ -0,0 +1,6 @@ +/* File : example.i */ +%readonly +extern int status; +extern char path[256]; + + diff --git a/Examples/xml/example_title_add.expected-xml b/Examples/xml/example_title_add.expected-xml new file mode 100644 index 0000000..5aed729 --- /dev/null +++ b/Examples/xml/example_title_add.expected-xml @@ -0,0 +1,119 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_title_add.i" > + <swigxml:child > + <swig:module name="example" /> + <swig:insert > + <swigxml:code > + +#include "example.h" + </swigxml:code> + </swig:insert> + <c:class name="Vector" > + <swigxml:child > + <c:access name="public" /> + <c:function name="Vector" > + <swigxml:parms > + <swigxml:parm name="x" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="double" /> + </swigxml:parm> + <swigxml:parm name="z" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="int" /> + </c:function> + <c:destructor name="Vector" /> + <c:function name="print" > + <swigxml:type string="p.char" /> + </c:function> + </swigxml:child> + <swigxml:classtype string="class" /> + <swigxml:namespace string="Vector" /> + </c:class> + <swig:insert > + <swigxml:code > + +Vector addv(Vector &a, Vector &b) { + return a+b; +} + </swigxml:code> + </swig:insert> + <c:function name="addv" > + <swigxml:parms > + <swigxml:parm name="a" > + <swigxml:type string="r.Vector" /> + </swigxml:parm> + <swigxml:parm name="b" > + <swigxml:type string="r.Vector" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + return a+b; +} </swigxml:code> + <swigxml:type string="Vector" /> + </c:function> + <c:class name="VectorArray" > + <swigxml:child > + <c:access name="public" /> + <c:function name="VectorArray" > + <swigxml:parms > + <swigxml:parm name="maxsize" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="int" /> + </c:function> + <c:destructor name="VectorArray" /> + <c:function name="size" > + <swigxml:type string="int" /> + </c:function> + <swig:addmethods > + <swigxml:child > + <c:function name="get" > + <swigxml:parms > + <swigxml:parm name="index" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + return (*self)[index]; + } </swigxml:code> + <swigxml:type string="r.Vector" /> + </c:function> + <c:function name="set" > + <swigxml:parms > + <swigxml:parm name="index" > + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="a" > + <swigxml:type string="r.Vector" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + (*self)[index] = a; + } </swigxml:code> + <swigxml:type string="void" /> + </c:function> + </swigxml:child> + </swig:addmethods> + </swigxml:child> + <swigxml:classtype string="class" /> + <swigxml:namespace string="VectorArray" /> + </c:class> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_title_add.i b/Examples/xml/example_title_add.i new file mode 100644 index 0000000..3320919 --- /dev/null +++ b/Examples/xml/example_title_add.i @@ -0,0 +1,47 @@ +/* File : example.i */ +%title "Matrix and vector package" + +/* This file has a few "typical" uses of C++ references. */ + +%module example + +%{ +#include "example.h" +%} + +class Vector { +public: + Vector(double x, double y, double z); + ~Vector(); + char *print(); +}; + +/* This helper function calls an overloaded operator */ +%inline %{ +Vector addv(Vector &a, Vector &b) { + return a+b; +} +%} + +/* Wrapper around an array of vectors class */ + +class VectorArray { +public: + VectorArray(int maxsize); + ~VectorArray(); + int size(); + + /* This wrapper provides an alternative to the [] operator */ + %addmethods { + Vector &get(int index) { + return (*self)[index]; + } + void set(int index, Vector &a) { + (*self)[index] = a; + } + } +}; + + + + diff --git a/Examples/xml/example_xml.expected-xml b/Examples/xml/example_xml.expected-xml new file mode 100644 index 0000000..584e468 --- /dev/null +++ b/Examples/xml/example_xml.expected-xml @@ -0,0 +1,1624 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="example_xml.i" > + <swigxml:child > + <swig:module name="my_example" /> + <c:enum name="color" > + <swigxml:child > + <c:enumvalue name="RED" > + <swigxml:value string="RED" /> + </c:enumvalue> + <c:enumvalue name="BLUE" /> + <c:enumvalue name="GREEN" /> + </swigxml:child> + </c:enum> + <c:class name="Foo" > + <swigxml:child > + <c:access name="public" /> + <c:function name="Foo" > + <swigxml:code > +{ } </swigxml:code> + <swigxml:type string="int" /> + </c:function> + <c:enum name="speed" > + <swigxml:child > + <c:enumvalue name="IMPULSE" /> + <c:enumvalue name="WARP" /> + <c:enumvalue name="LUDICROUS" /> + </swigxml:child> + </c:enum> + <c:function name="enum_test" > + <swigxml:parms > + <swigxml:parm name="s" > + <swigxml:type string="speed" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + </swigxml:child> + <swigxml:classtype string="class" /> + <swigxml:namespace string="Foo" /> + </c:class> + <c:function name="enum_test" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="color" /> + </swigxml:parm> + <swigxml:parm name="s" > + <swigxml:type string="Foo::speed" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + <swig:file name="../../Lib/pointer.i" > + <swigxml:child > + <swig:module name="pointer" /> + <swig:insert > + <swigxml:code > + +%include pointer.i + +The pointer.i library provides run-time support for managing and +manipulating a variety of C/C++ pointer values. In particular, +you can create various kinds of objects and dereference common +pointer types. This is done through a common set of functions: + + ptrvalue - Dereferences a pointer + ptrset - Set the value of an object referenced by + a pointer. + ptrcreate - Create a new object and return a pointer. + ptrfree - Free the memory allocated by ptrcreate. + ptradd - Increment/decrement a pointer value. + +When creating, dereferencing, or setting the value of pointer +variable, only the common C datatypes of int, short, long, float, +double, char, and char * are currently supported. Other +datatypes may generate an error. + +One of the more interesting aspects of this library is that +it operates with a wide range of datatypes. For example, +the "ptrvalue" function can dereference "double *", "int *", +"long *", "char *", and other datatypes. Since SWIG encodes +pointers with type information, this can be done transparently +and in most cases, you can dereference a pointer without +ever knowing what type it actually is. + +This library is primarily designed for utility, not high +performance (the dynamic determination of pointer types takes +more work than most normal wrapper functions). As a result, +you may achieve better performance by writing customized +"helper" functions if you're making lots of calls to these +functions in inner loops or other intensive operations. + </swigxml:code> + <swigxml:section string="doc" /> + </swig:insert> + <swig:types > + <swigxml:parms > + <swigxml:parm > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.short" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.long" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.float" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.double" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.char" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.p.char" /> + </swigxml:parm> + <swigxml:parm > + <swigxml:type string="p.void" /> + </swigxml:parm> + </swigxml:parms> + </swig:types> + <swig:file name="../../Lib/xml/ptrlang.i" > + <swigxml:child > + <swig:insert > + <swigxml:code > + +#include &lt;ctype.h> + +/* Types used by the library */ +static swig_type_info *SWIG_POINTER_int_p = 0; +static swig_type_info *SWIG_POINTER_short_p =0; +static swig_type_info *SWIG_POINTER_long_p = 0; +static swig_type_info *SWIG_POINTER_float_p = 0; +static swig_type_info *SWIG_POINTER_double_p = 0; +static swig_type_info *SWIG_POINTER_char_p = 0; +static swig_type_info *SWIG_POINTER_char_pp = 0; +static swig_type_info *SWIG_POINTER_void_p = 0; + </swigxml:code> + </swig:insert> + <swig:insert > + <swigxml:code > + + SWIG_POINTER_int_p = SWIG_TypeQuery("int *"); + SWIG_POINTER_short_p = SWIG_TypeQuery("short *"); + SWIG_POINTER_long_p = SWIG_TypeQuery("long *"); + SWIG_POINTER_float_p = SWIG_TypeQuery("float *"); + SWIG_POINTER_double_p = SWIG_TypeQuery("double *"); + SWIG_POINTER_char_p = SWIG_TypeQuery("char *"); + SWIG_POINTER_char_pp = SWIG_TypeQuery("char **"); + SWIG_POINTER_void_p = SWIG_TypeQuery("void *"); + </swigxml:code> + <swigxml:section string="init" /> + </swig:insert> + <swig:insert > + <swigxml:code > + + +/* #ifdef WIN32 +#undef isspace +#define isspace(c) (c == ' ') +#endif +*/ + +/*------------------------------------------------------------------ + ptrvalue(ptr,type = 0) + + Attempts to dereference a pointer value. If type is given, it + will try to use that type. Otherwise, this function will attempt + to "guess" the proper datatype by checking against all of the + builtin C datatypes. + ------------------------------------------------------------------ */ + +#ifdef PERL_OBJECT +static SV *_ptrvalue(CPerlObj *pPerl,SV *_PTRVALUE, int index, char *type) { +#define ptrvalue(a,b,c) _ptrvalue(pPerl,a,b,c) +#else +static SV *_ptrvalue(SV *_PTRVALUE, int index, char *type) { +#define ptrvalue(a,b,c) _ptrvalue(a,b,c) +#endif + + void *ptr; + SV *obj = 0; + + if (SWIG_ConvertPtr(_PTRVALUE, &ptr, 0) &lt; 0) { + croak("Type error it ptrvalue. Argument is not a valid pointer value."); + } else { + /* If no datatype was passed, try a few common datatypes first */ + if (!type) { + + /* No datatype was passed. Type to figure out if it's a common one */ + + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_int_p) >= 0) { + type = "int"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_double_p) >= 0) { + type = "double"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_short_p) >= 0) { + type = "short"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_long_p) >= 0) { + type = "long"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_float_p) >= 0) { + type = "float"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_p) >= 0) { + type = "char"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_pp) >= 0) { + type = "char *"; + } else { + type = "unknown"; + } + } + + if (!ptr) { + croak("Unable to dereference NULL pointer."); + return 0; + } + + /* Now we have a datatype. Try to figure out what to do about it */ + if (strcmp(type,"int") == 0) { + obj = sv_newmortal(); + sv_setiv(obj,(IV) *(((int *) ptr) + index)); + } else if (strcmp(type,"double") == 0) { + obj = sv_newmortal(); + sv_setnv(obj,(double) *(((double *) ptr)+index)); + } else if (strcmp(type,"short") == 0) { + obj = sv_newmortal(); + sv_setiv(obj,(IV) *(((short *) ptr) + index)); + } else if (strcmp(type,"long") == 0) { + obj = sv_newmortal(); + sv_setiv(obj,(IV) *(((long *) ptr) + index)); + } else if (strcmp(type,"float") == 0) { + obj = sv_newmortal(); + sv_setnv(obj,(double) *(((float *) ptr)+index)); + } else if (strcmp(type,"char") == 0) { + obj = sv_newmortal(); + sv_setpv(obj,((char *) ptr)+index); + } else if (strcmp(type,"char *") == 0) { + char *c = *(((char **) ptr)+index); + obj = sv_newmortal(); + if (c) + sv_setpv(obj,c); + else + sv_setpv(obj,"NULL"); + } else { + croak("Unable to dereference unsupported datatype."); + obj = 0; + } + } + return obj; +} + +/*------------------------------------------------------------------ + ptrcreate(type,value = 0,numelements = 1) + + Attempts to create a new object of given type. Type must be + a basic C datatype. Will not create complex objects. + ------------------------------------------------------------------ */ +#ifdef PERL_OBJECT +static SV *_ptrcreate(CPerlObj *pPerl, char *type, SV *value, int numelements) { +#define ptrcreate(a,b,c) _ptrcreate(pPerl,a,b,c) +#else +static SV *_ptrcreate(char *type, SV *value, int numelements) { +#define ptrcreate(a,b,c) _ptrcreate(a,b,c) +#endif + + void *ptr; + SV *obj; + int sz; + swig_type_info *cast = 0; + + /* Check the type string against a variety of possibilities */ + + if (strcmp(type,"int") == 0) { + sz = sizeof(int)*numelements; + cast = SWIG_POINTER_int_p; + } else if (strcmp(type,"short") == 0) { + sz = sizeof(short)*numelements; + cast = SWIG_POINTER_short_p; + } else if (strcmp(type,"long") == 0) { + sz = sizeof(long)*numelements; + cast = SWIG_POINTER_long_p; + } else if (strcmp(type,"double") == 0) { + sz = sizeof(double)*numelements; + cast = SWIG_POINTER_double_p; + } else if (strcmp(type,"float") == 0) { + sz = sizeof(float)*numelements; + cast = SWIG_POINTER_float_p; + } else if (strcmp(type,"char") == 0) { + sz = sizeof(char)*numelements; + cast = SWIG_POINTER_char_p; + } else if (strcmp(type,"char *") == 0) { + sz = sizeof(char *)*(numelements+1); + cast = SWIG_POINTER_char_pp; + } else if (strcmp(type,"void") == 0) { + sz = numelements; + cast = SWIG_POINTER_void_p; + } else { + croak("Unable to create unknown datatype."); + return 0; + } + + /* Create the new object */ + + ptr = (void *) malloc(sz); + if (!ptr) { + croak("Out of memory in ptrcreate."); + return 0; + } + + /* Now try to set its default value */ + + if (value) { + if (strcmp(type,"int") == 0) { + int *ip,i,ivalue; + ivalue = (int) SvIV(value); + ip = (int *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"short") == 0) { + short *ip,ivalue; + int i; + ivalue = (short) SvIV(value); + ip = (short *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"long") == 0) { + long *ip,ivalue; + int i; + ivalue = (long) SvIV(value); + ip = (long *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"double") == 0) { + double *ip,ivalue; + int i; + ivalue = (double) SvNV(value); + ip = (double *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"float") == 0) { + float *ip,ivalue; + int i; + ivalue = (float) SvNV(value); + ip = (float *) ptr; + for (i = 0; i &lt; numelements; i++) + ip[i] = ivalue; + } else if (strcmp(type,"char") == 0) { + char *ip,*ivalue; + ivalue = (char *) SvPV(value,PL_na); + ip = (char *) ptr; + strncpy(ip,ivalue,numelements-1); + } else if (strcmp(type,"char *") == 0) { + char **ip, *ivalue; + int i; + ivalue = (char *) SvPV(value,PL_na); + ip = (char **) ptr; + for (i = 0; i &lt; numelements; i++) { + if (ivalue) { + ip[i] = (char *) malloc(strlen(ivalue)+1); + strcpy(ip[i],ivalue); + } else { + ip[i] = 0; + } + } + ip[numelements] = 0; + } + } + /* Create the pointer value */ + + + obj = sv_newmortal(); + SWIG_MakePtr(obj,ptr,cast); + return obj; +} + +/*------------------------------------------------------------------ + ptrset(ptr,value,index = 0,type = 0) + + Attempts to set the value of a pointer variable. If type is + given, we will use that type. Otherwise, we'll guess the datatype. + ------------------------------------------------------------------ */ + +#ifdef PERL_OBJECT +static void _ptrset(CPerlObj *pPerl,SV *_PTRVALUE, SV *value, int index, char *type) { +#define ptrset(a,b,c,d) _ptrset(pPerl,a,b,c,d) +#else +static void _ptrset(SV *_PTRVALUE, SV *value, int index, char *type) { +#define ptrset(a,b,c,d) _ptrset(a,b,c,d) +#endif + void *ptr; + SV *obj; + + + if (SWIG_ConvertPtr(_PTRVALUE, &ptr, 0) &lt; 0) { + croak("Type error it ptrvalue. Argument is not a valid pointer value."); + } else { + /* If no datatype was passed, try a few common datatypes first */ + if (!type) { + /* No datatype was passed. Type to figure out if it's a common one */ + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_int_p) >= 0) { + type = "int"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_double_p) >= 0) { + type = "double"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_short_p) >= 0) { + type = "short"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_long_p) >= 0) { + type = "long"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_float_p) >= 0) { + type = "float"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_p) >= 0) { + type = "char"; + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_pp) >= 0) { + type = "char *"; + } else { + type = "unknown"; + } + } + } + if (!ptr) { + croak("Unable to set NULL pointer."); + return; + } + + /* Now we have a datatype. Try to figure out what to do about it */ + if (strcmp(type,"int") == 0) { + *(((int *) ptr)+index) = (int) SvIV(value); + } else if (strcmp(type,"double") == 0) { + *(((double *) ptr)+index) = (double) SvNV(value); + } else if (strcmp(type,"short") == 0) { + *(((short *) ptr)+index) = (short) SvIV(value); + } else if (strcmp(type,"long") == 0) { + *(((long *) ptr)+index) = (long) SvIV(value); + } else if (strcmp(type,"float") == 0) { + *(((float *) ptr)+index) = (float) SvNV(value); + } else if (strcmp(type,"char") == 0) { + char *c = SvPV(value,PL_na); + strcpy(((char *) ptr)+index, c); + } else if (strcmp(type,"char *") == 0) { + char *c = SvPV(value,PL_na); + char **ca = (char **) ptr; + if (ca[index]) free(ca[index]); + if (strcmp(c,"NULL") == 0) { + ca[index] = 0; + } else { + ca[index] = (char *) malloc(strlen(c)+1); + strcpy(ca[index],c); + } + } else { + croak("Unable to set unsupported datatype."); + return; + } +} + +/*------------------------------------------------------------------ + ptradd(ptr,offset) + + Adds a value to an existing pointer value. Will do a type-dependent + add for basic datatypes. For other datatypes, will do a byte-add. + ------------------------------------------------------------------ */ + +#ifdef PERL_OBJECT +static SV *_ptradd(CPerlObj *pPerl, SV *_PTRVALUE, int offset) { +#define ptradd(a,b) _ptradd(pPerl,a,b) +#else +static SV *_ptradd(SV *_PTRVALUE, int offset) { +#define ptradd(a,b) _ptradd(a,b) +#endif + + void *ptr,*junk; + SV *obj; + swig_type_info *type; + char *tname; + + /* Try to handle a few common datatypes first */ + + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_int_p) >= 0) { + ptr = (void *) (((int *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_double_p) >= 0) { + ptr = (void *) (((double *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_short_p) >= 0) { + ptr = (void *) (((short *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_long_p) >= 0) { + ptr = (void *) (((long *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_float_p) >= 0) { + ptr = (void *) (((float *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,SWIG_POINTER_char_p) >= 0) { + ptr = (void *) (((char *) ptr) + offset); + } else if (SWIG_ConvertPtr(_PTRVALUE,&ptr,0) >= 0) { + ptr = (void *) (((char *) ptr) + offset); + } else { + croak("Type error in ptradd. Argument is not a valid pointer value."); + return 0; + } + printf("ptradd = %x\n", ptr); + tname = HvNAME(SvSTASH(SvRV(_PTRVALUE))); + obj = sv_newmortal(); + sv_setref_pv(obj,tname,ptr); + return obj; +} + +/*------------------------------------------------------------------ + ptrfree(ptr) + + Destroys a pointer value + ------------------------------------------------------------------ */ +#ifdef PERL_OBJECT +void _ptrfree(CPerlObj *pPerl, SV *_PTRVALUE) { +#define ptrfree(a) _ptrfree(pPerl, a) +#else +void _ptrfree(SV *_PTRVALUE) { +#define ptrfree(a) _ptrfree(a) +#endif + + void *ptr, *junk; + + if (SWIG_ConvertPtr(_PTRVALUE,&ptr,0) &lt; 0) { + croak("Type error in ptrfree. Argument is not a valid pointer value."); + return; + } + + /* Check to see if this pointer is a char ** */ + if (SWIG_ConvertPtr(_PTRVALUE,&junk,SWIG_POINTER_char_pp) >= 0) { + char **c = (char **) ptr; + if (c) { + int i = 0; + while (c[i]) { + free(c[i]); + i++; + } + } + } + if (ptr) + free((char *) ptr); +} + + </swigxml:code> + </swig:insert> + <swig:typemap name="ptr" > + <swigxml:code > +{ + $target = $source; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="value" > + <swigxml:code > +{ + $target = $source; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrcast" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrvalue" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrcreate" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptradd" > + <swigxml:code > +{ + $target = $source; + argvi++; +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.SV" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="ptrset" > + <swigxml:code > +{ + if ($source == -1) return NULL; +} </swigxml:code> + <swigxml:method string="ret" /> + <swigxml:type string="int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <c:function name="ptrvalue" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="index" > + <swigxml:value string="0" /> + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="type" > + <swigxml:value string="0" /> + <swigxml:type string="p.char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="p.SV" /> + </c:function> + <c:function name="ptrset" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="value" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="index" > + <swigxml:value string="0" /> + <swigxml:type string="int" /> + </swigxml:parm> + <swigxml:parm name="type" > + <swigxml:value string="0" /> + <swigxml:type string="p.char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + <c:function name="ptrcreate" > + <swigxml:parms > + <swigxml:parm name="type" > + <swigxml:type string="p.char" /> + </swigxml:parm> + <swigxml:parm name="value" > + <swigxml:value string="0" /> + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="nitems" > + <swigxml:value string="1" /> + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="p.SV" /> + </c:function> + <c:function name="ptrfree" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + <c:function name="ptradd" > + <swigxml:parms > + <swigxml:parm name="ptr" > + <swigxml:type string="p.SV" /> + </swigxml:parm> + <swigxml:parm name="offset" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="p.SV" /> + </c:function> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + <swig:file name="../../Lib/xml/typemaps.i" > + <swigxml:child > + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (double) SvNV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="float" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (float) SvNV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (int) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (short) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (long) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned int) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned short) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned long) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="INPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + temp = (unsigned char) SvIV($source); + $target = &temp; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="unsigned char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="float" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:parms > + <swigxml:parm name="temp" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + $target = &amp;amp;amp;amp;amp;amp;amp;amp;temp; +} </swigxml:code> + <swigxml:method string="ignore" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setiv($target,(IV) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setnv($target,(double) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="OUTPUT" > + <swigxml:code > +{ + if (argvi >= items) { + EXTEND(sp,1); + } + $target = sv_newmortal(); + sv_setnv($target,(double) *($source)); + argvi++; +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.int" /> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.short" /> + <swigxml:method string="in" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.long" /> + <swigxml:method string="in" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned short" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned long" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned char" /> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.float" /> + <swigxml:method string="in" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.double" /> + <swigxml:method string="in" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="INPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.int" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.short" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.long" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned short" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned long" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.unsigned char" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned char" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.float" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="BOTH" > + <swigxml:srctype string="p.double" /> + <swigxml:method string="argout" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + <swigxml:srcname string="OUTPUT" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="double" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { + printf("Received %d\n", SvTYPE(tempsv)); + croak("Expected a double reference."); + } + dvalue = SvNV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="float" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) { + croak("expected a double reference"); + } + dvalue = (float) SvNV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (short) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (long) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="unsigned int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (unsigned int) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="unsigned short" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (unsigned short) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:parms > + <swigxml:parm name="dvalue" > + <swigxml:type string="unsigned long" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:code > +{ + SV *tempsv; + if (!SvROK($source)) { + croak("expected a reference"); + } + tempsv = SvRV($source); + if (!SvIOK(tempsv)) { + croak("expected a integer reference"); + } + dvalue = (unsigned long) SvIV(tempsv); + $target = &dvalue; +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setnv(tempsv, (double) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.double" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setnv(tempsv, (double) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.float" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned int" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned short" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + <swig:typemap name="REFERENCE" > + <swigxml:code > +{ + SV *tempsv; + tempsv = SvRV($arg); + sv_setiv(tempsv, (int) *$source); +} </swigxml:code> + <swigxml:method string="argout" /> + <swigxml:type string="p.unsigned long" /> + <swigxml:lang string="perl5" /> + </swig:typemap> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + <swig:typemap > + <swigxml:code > +{ + WHATEVER MAKES YOU HAPPY AS RESULT +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.int" /> + </swig:typemap> + <swig:typemap > + <swigxml:code > +{ + WHATEVER MAKES YOU HAPPY AS PARAMETER +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + </swig:typemap> + <swig:pragma name="DEBUG" > + <swigxml:value string="false" /> + <swigxml:lang string="xml" /> + </swig:pragma> + <c:function name="my_gcd" > + <swigxml:parms > + <swigxml:parm name="x" > + <swigxml:type string="p.q(const).char" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="a().p.int" /> + </swigxml:parm> + <swigxml:parm name="r" > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm name="op" > + <swigxml:type string="p.f(int,int).int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.int" /> + </c:function> + <c:variable name="my_foo" > + <swigxml:storage string="extern" /> + <swigxml:type string="double" /> + </c:variable> + <c:function name="my_void" > + <swigxml:type string="void" /> + </c:function> + <c:function name="my_empty" > + <swigxml:type string="int" /> + </c:function> + <c:variable name="my_dutch" > + <swigxml:value string="1.0" /> + <swigxml:type string="q(const).double" /> + </c:variable> + <c:class name="my_union" > + <swigxml:child > + <c:variable name="my_iii" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="my_ccc" > + <swigxml:type string="char" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="union" /> + <swigxml:namespace string="my_union" /> + </c:class> + <c:class name="my_struct" > + <swigxml:child > + <c:access name="public" /> + <c:destructor name="my_struct" > + <swigxml:storage string="virtual" /> + </c:destructor> + <c:function name="my_foo" > + <swigxml:type string="int" /> + </c:function> + <c:access name="protected" /> + <c:variable name="my_bar" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="x" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="y" > + <swigxml:type string="double" /> + </c:variable> + <c:function name="area" > + <swigxml:abstract string="1" /> + <swigxml:storage string="virtual" /> + <swigxml:type string="double" /> + </c:function> + <c:variable name="nshapes" > + <swigxml:storage string="static" /> + <swigxml:type string="int" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="my_struct" /> + </c:class> + <c:class name="my_class" > + <swigxml:child > + <c:access name="public" /> + <c:function name="my_class" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="int" /> + </c:function> + <c:access name="private" /> + <c:destructor name="my_class" /> + <c:function name="my_func" > + <swigxml:parms > + <swigxml:parm > + <swigxml:type string="my_class" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="p.p.char" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="a().int" /> + </swigxml:parm> + <swigxml:parm name="r" > + <swigxml:type string="r.q(const).int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="virtual" /> + <swigxml:type string="p.q(const).int" /> + </c:function> + <c:variable name="my_foo" > + <swigxml:type string="a(128).double" /> + </c:variable> + <c:variable name="i" > + <swigxml:type string="q(const).my_int" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="class" /> + <swigxml:bases > + <swigxml:item name="my_struct" /> + <swigxml:item name="my_union" /> + </swigxml:bases> + <swigxml:namespace string="my_class" /> + </c:class> + <c:typedef name="my_int" > + <swigxml:type string="int" /> + </c:typedef> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/example_xml.h b/Examples/xml/example_xml.h new file mode 100644 index 0000000..849071d --- /dev/null +++ b/Examples/xml/example_xml.h @@ -0,0 +1,39 @@ +/* File : example.h */ + +class Shape { +public: + Shape() { + nshapes++; + } + virtual ~Shape() { + nshapes--; + }; + double x, y; + void move(double dx, double dy); + virtual double area() = 0; + virtual double perimeter() = 0; + static int nshapes; +}; + +class Circle : public Shape { +private: + double radius; +public: + Circle(double r) : radius(r) { }; + virtual double area(); + virtual double perimeter(); +}; + +class Square : public Shape { +private: + double width; +public: + Square(double w) : width(w) { }; + virtual double area(); + virtual double perimeter(); +}; + + + + + diff --git a/Examples/xml/example_xml.i b/Examples/xml/example_xml.i new file mode 100644 index 0000000..a598b6a --- /dev/null +++ b/Examples/xml/example_xml.i @@ -0,0 +1,69 @@ +/* File : example.i */ +%module my_example + +enum color { RED=10, BLUE, GREEN }; + +class Foo { + public: + Foo() { } + enum speed { IMPULSE, WARP, LUDICROUS }; + void enum_test(speed s); +}; + +void enum_test(color c, Foo::speed s); + + + +%include pointer.i + +/* Next we'll use some typemaps */ + +%include typemaps.i + +%typemap(out) int * { + WHATEVER MAKES YOU HAPPY AS RESULT +} + +%typemap(in) int * { + WHATEVER MAKES YOU HAPPY AS PARAMETER +} + +%pragma(xml) DEBUG="false"; + +extern int * my_gcd(const char * x, int * y[], int * r, int (*op)(int,int)) const; +extern double my_foo; +void my_void(); +my_empty(); + +const double my_dutch = 1.0; + +union my_union +{ + int my_iii; + char my_ccc; +}; + +struct my_struct +{ +public: + virtual ~my_struct(); + int my_foo(); +protected: + int my_bar; + double x, y; + virtual double area() = 0; + static int nshapes; +}; + +class my_class : public my_struct, public my_union +{ +public: + my_class( char c ); +private: + ~my_class(); + virtual const int * my_func( my_class , char * * x, int y[], const int & r) const; + double my_foo[128]; + const my_int i; +}; + +typedef int my_int; diff --git a/Examples/xml/gnarly.expected-xml b/Examples/xml/gnarly.expected-xml new file mode 100644 index 0000000..da87d8a --- /dev/null +++ b/Examples/xml/gnarly.expected-xml @@ -0,0 +1,206 @@ +<swigxml:swig name="namespaces" xmlns:swigxml="http://jniplusplus.sourceforge.net" xmlns:swig="http://swig.sourceforge.net" xmlns:c="http://www.ansi.org" > + <swig:top > + <swigxml:child > + <swig:file name="../../Lib/swig.swg" > + <swigxml:type string="include" /> + </swig:file> + <swig:file name="gnarly.i" > + <swigxml:child > + <swig:module name="my_check" /> + <c:enum name="color" > + <swigxml:child > + <c:enumvalue name="RED" > + <swigxml:value string="RED" /> + </c:enumvalue> + <c:enumvalue name="BLUE" /> + <c:enumvalue name="GREEN" /> + </swigxml:child> + </c:enum> + <c:class name="Foo" > + <swigxml:child > + <c:access name="public" /> + <c:function name="Foo" > + <swigxml:code > +{ } </swigxml:code> + <swigxml:type string="int" /> + </c:function> + <c:enum name="speed" > + <swigxml:child > + <c:enumvalue name="IMPULSE" /> + <c:enumvalue name="WARP" /> + <c:enumvalue name="LUDICROUS" /> + </swigxml:child> + </c:enum> + <c:function name="enum_test" > + <swigxml:parms > + <swigxml:parm name="s" > + <swigxml:type string="speed" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + </swigxml:child> + <swigxml:classtype string="class" /> + <swigxml:namespace string="Foo" /> + </c:class> + <c:function name="enum_test" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="color" /> + </swigxml:parm> + <swigxml:parm name="s" > + <swigxml:type string="Foo::speed" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="void" /> + </c:function> + <swig:typemap > + <swigxml:code > +{ + WHATEVER MAKES YOU HAPPY AS RESULT +} </swigxml:code> + <swigxml:method string="out" /> + <swigxml:type string="p.int" /> + </swig:typemap> + <swig:typemap > + <swigxml:code > +{ + WHATEVER MAKES YOU HAPPY AS PARAMETER +} </swigxml:code> + <swigxml:method string="in" /> + <swigxml:type string="p.int" /> + </swig:typemap> + <swig:pragma name="DEBUG" > + <swigxml:value string="false" /> + <swigxml:lang string="xml" /> + </swig:pragma> + <c:function name="my_gcd" > + <swigxml:parms > + <swigxml:parm name="x" > + <swigxml:type string="p.q(const).char" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="a().p.int" /> + </swigxml:parm> + <swigxml:parm name="r" > + <swigxml:type string="p.int" /> + </swigxml:parm> + <swigxml:parm name="op" > + <swigxml:type string="p.f(int,int).int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="extern" /> + <swigxml:type string="p.int" /> + </c:function> + <c:variable name="my_foo" > + <swigxml:storage string="extern" /> + <swigxml:type string="double" /> + </c:variable> + <c:function name="my_void" > + <swigxml:type string="void" /> + </c:function> + <c:function name="my_empty" > + <swigxml:type string="int" /> + </c:function> + <c:variable name="my_dutch" > + <swigxml:value string="1.0" /> + <swigxml:type string="q(const).double" /> + </c:variable> + <c:class name="my_union" > + <swigxml:child > + <c:variable name="my_iii" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="my_ccc" > + <swigxml:type string="char" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="union" /> + <swigxml:namespace string="my_union" /> + </c:class> + <c:class name="my_struct" > + <swigxml:child > + <c:access name="public" /> + <c:destructor name="my_struct" > + <swigxml:storage string="virtual" /> + </c:destructor> + <c:function name="my_foo" > + <swigxml:type string="int" /> + </c:function> + <c:access name="protected" /> + <c:variable name="my_bar" > + <swigxml:type string="int" /> + </c:variable> + <c:variable name="x" > + <swigxml:type string="double" /> + </c:variable> + <c:variable name="y" > + <swigxml:type string="double" /> + </c:variable> + <c:function name="area" > + <swigxml:abstract string="1" /> + <swigxml:storage string="virtual" /> + <swigxml:type string="double" /> + </c:function> + <c:variable name="nshapes" > + <swigxml:storage string="static" /> + <swigxml:type string="int" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="struct" /> + <swigxml:namespace string="my_struct" /> + </c:class> + <c:class name="my_class" > + <swigxml:child > + <c:access name="public" /> + <c:function name="my_class" > + <swigxml:parms > + <swigxml:parm name="c" > + <swigxml:type string="char" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:type string="int" /> + </c:function> + <c:access name="private" /> + <c:destructor name="my_class" /> + <c:function name="my_func" > + <swigxml:parms > + <swigxml:parm > + <swigxml:type string="my_class" /> + </swigxml:parm> + <swigxml:parm name="x" > + <swigxml:type string="p.p.char" /> + </swigxml:parm> + <swigxml:parm name="y" > + <swigxml:type string="a().int" /> + </swigxml:parm> + <swigxml:parm name="r" > + <swigxml:type string="r.q(const).int" /> + </swigxml:parm> + </swigxml:parms> + <swigxml:storage string="virtual" /> + <swigxml:type string="p.q(const).int" /> + </c:function> + <c:variable name="my_foo" > + <swigxml:type string="a(128).double" /> + </c:variable> + <c:variable name="i" > + <swigxml:type string="q(const).my_int" /> + </c:variable> + </swigxml:child> + <swigxml:classtype string="class" /> + <swigxml:bases > + <swigxml:item name="my_struct" /> + <swigxml:item name="my_union" /> + </swigxml:bases> + <swigxml:namespace string="my_class" /> + </c:class> + <c:typedef name="my_int" > + <swigxml:type string="int" /> + </c:typedef> + </swigxml:child> + <swigxml:type string="include" /> + </swig:file> + </swigxml:child> + </swig:top> +</swigxml:swig> diff --git a/Examples/xml/gnarly.i b/Examples/xml/gnarly.i new file mode 100644 index 0000000..47242f8 --- /dev/null +++ b/Examples/xml/gnarly.i @@ -0,0 +1,63 @@ +/* File : check.i */ +%module my_check + +enum color { RED=10, BLUE, GREEN }; + +class Foo { + public: + Foo() { } + enum speed { IMPULSE, WARP, LUDICROUS }; + void enum_test(speed s); +}; + +void enum_test(color c, Foo::speed s); + + + +%typemap(out) int * { + WHATEVER MAKES YOU HAPPY AS RESULT +} + +%typemap(in) int * { + WHATEVER MAKES YOU HAPPY AS PARAMETER +} + +%pragma(xml) DEBUG="false"; + +extern int * my_gcd(const char * x, int * y[], int * r, int (*op)(int,int)) const; +extern double my_foo; +void my_void(); +my_empty(); + +const double my_dutch = 1.0; + +union my_union +{ + int my_iii; + char my_ccc; +}; + +struct my_struct +{ +public: + virtual ~my_struct(); + int my_foo(); +protected: + int my_bar; + double x, y; + virtual double area() = 0; + static int nshapes; +}; + +class my_class : public my_struct, public my_union +{ +public: + my_class( char c ); +private: + ~my_class(); + virtual const int * my_func( my_class , char * * x, int y[], const int & r) const; + double my_foo[128]; + const my_int i; +}; + +typedef int my_int; |
