summaryrefslogtreecommitdiff
path: root/ipl/packs/loadfuncpp/examples/arglist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/packs/loadfuncpp/examples/arglist.cpp')
-rw-r--r--ipl/packs/loadfuncpp/examples/arglist.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/ipl/packs/loadfuncpp/examples/arglist.cpp b/ipl/packs/loadfuncpp/examples/arglist.cpp
new file mode 100644
index 0000000..a62d347
--- /dev/null
+++ b/ipl/packs/loadfuncpp/examples/arglist.cpp
@@ -0,0 +1,18 @@
+
+/* Example of a C++ extension to icon via loadfunc,
+ * without garbage collection difficulties.
+ * Type 'make <platform>' to build.
+ * For available <platform>s type 'make'.
+ * Carl Sturtivant, 2007/9/25
+ */
+
+#include "loadfuncpp.h"
+
+
+extern "C" int iexample(int argc, value argv[]) {
+ safe x(argc, argv); //make the arguments into an Icon list
+ argv[0] = x;
+ return SUCCEEDED;
+}
+
+