summaryrefslogtreecommitdiff
path: root/trunk/Examples/test-suite/li_reference.i
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2010-06-02 20:53:17 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2010-06-02 20:53:17 +0000
commit2824b0cbb66e715490e1ef13250bd675d87b32d9 (patch)
treec3bc8d54c6d73f2b7ce08cac34172dbc9f5e5b95 /trunk/Examples/test-suite/li_reference.i
parent289cfef4b4766ff266f3b1bdda8ca3a952e5a047 (diff)
downloadswig-39489534f6104d5a2938392418dbb7189c037f8b.tar.gz
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/tags/rel-2.0.0@12089 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'trunk/Examples/test-suite/li_reference.i')
-rw-r--r--trunk/Examples/test-suite/li_reference.i52
1 files changed, 52 insertions, 0 deletions
diff --git a/trunk/Examples/test-suite/li_reference.i b/trunk/Examples/test-suite/li_reference.i
new file mode 100644
index 000000000..f16fdbeaa
--- /dev/null
+++ b/trunk/Examples/test-suite/li_reference.i
@@ -0,0 +1,52 @@
+%module li_reference
+
+%include "reference.i"
+
+%inline %{
+ double FrVal;
+ double ToVal;
+ void PDouble(double *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = FrVal + t; }
+ void RDouble(double &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = FrVal + t; }
+ void PFloat(float *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (float)(FrVal + t); }
+ void RFloat(float &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (float)(FrVal + t); }
+ void PInt(int *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (int)(FrVal + t); }
+ void RInt(int &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (int)(FrVal + t); }
+ void PShort(short *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (short)(FrVal + t); }
+ void RShort(short &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (short)(FrVal + t); }
+ void PLong(long *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (long)(FrVal + t); }
+ void RLong(long &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (long)(FrVal + t); }
+ void PUInt(unsigned int *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (unsigned int)(FrVal + t); }
+ void RUInt(unsigned int &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (unsigned int)(FrVal + t); }
+ void PUShort(unsigned short *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (unsigned short)(FrVal + t); }
+ void RUShort(unsigned short &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (unsigned short)(FrVal + t); }
+ void PULong(unsigned long *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (unsigned long)(FrVal + t); }
+ void RULong(unsigned long &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (unsigned long)(FrVal + t); }
+ void PUChar(unsigned char *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (unsigned char)(FrVal + t); }
+ void RUChar(unsigned char &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (unsigned char)(FrVal + t); }
+ void PChar(signed char *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (signed char)(FrVal + t); }
+ void RChar(signed char &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (signed char)(FrVal + t); }
+ void PBool(bool *REFERENCE, int t = 0)
+ { ToVal = *REFERENCE; *REFERENCE = (FrVal + t) ? true : false; }
+ void RBool(bool &REFERENCE, int t = 0)
+ { ToVal = REFERENCE; REFERENCE = (FrVal + t) ? true : false; }
+%}