summaryrefslogtreecommitdiff
path: root/Examples/lua/exception/example.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/lua/exception/example.i')
-rw-r--r--Examples/lua/exception/example.i17
1 files changed, 17 insertions, 0 deletions
diff --git a/Examples/lua/exception/example.i b/Examples/lua/exception/example.i
new file mode 100644
index 0000000..09cd9e8
--- /dev/null
+++ b/Examples/lua/exception/example.i
@@ -0,0 +1,17 @@
+/* File : example.i */
+%module example
+
+%{
+#include "example.h"
+%}
+
+%include "std_string.i"
+
+// we want to return Exc objects to the interpreter
+// therefore we add this typemap
+// note: only works if Exc is copyable
+%apply SWIGTYPE EXCEPTION_BY_VAL {Exc};
+
+/* Let's just grab the original header file here */
+%include "example.h"
+