summaryrefslogtreecommitdiff
path: root/ecore/examples/args_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'ecore/examples/args_example.c')
-rw-r--r--ecore/examples/args_example.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/ecore/examples/args_example.c b/ecore/examples/args_example.c
new file mode 100644
index 0000000..439b09c
--- /dev/null
+++ b/ecore/examples/args_example.c
@@ -0,0 +1,25 @@
+/* Example of how to set and retrieve program arguments.
+ */
+#include <Ecore.h>
+
+int timer_once(void *data)
+{
+ int argc;
+ char **argv;
+ int i;
+
+ ecore_app_args_get(&argc, &argv);
+ for (i = 0; i < argc; i++) printf("ARG %i: %s\n", i, argv[i]);
+ ecore_main_loop_quit();
+ return 1;
+}
+
+int main(int argc, char **argv)
+{
+ ecore_init();
+ ecore_app_args_set(argc, (const char **) argv);
+ ecore_timer_add(0.1, timer_once, NULL);
+ ecore_main_loop_begin();
+ ecore_shutdown();
+ return 0;
+}