summaryrefslogtreecommitdiff
path: root/legacy/ecore/examples/args_example.c
blob: d8a8a5e84be07d1db494eecbf7e78c27f4c32f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Example of how to set and retrieve program arguments.
 */
#include <Ecore.h>

#include <stdlib.h>
#include <stdio.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;
}