diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/eina/src/examples/eina_list_03.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to '')
-rw-r--r-- | libraries/eina/src/examples/eina_list_03.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/libraries/eina/src/examples/eina_list_03.c b/libraries/eina/src/examples/eina_list_03.c new file mode 100644 index 0000000..8e15b91 --- /dev/null +++ b/libraries/eina/src/examples/eina_list_03.c | |||
@@ -0,0 +1,45 @@ | |||
1 | //Compile with: | ||
2 | //gcc -g `pkg-config --cflags --libs eina` eina_list_03.c -o eina_list_03 | ||
3 | |||
4 | #include <stdio.h> | ||
5 | #include <Eina.h> | ||
6 | |||
7 | int | ||
8 | main(int argc, char **argv) | ||
9 | { | ||
10 | Eina_List *list = NULL, *r_list; | ||
11 | Eina_List *l; | ||
12 | Eina_Iterator *itr; | ||
13 | void *list_data; | ||
14 | |||
15 | eina_init(); | ||
16 | |||
17 | list = eina_list_append(list, "caprica"); | ||
18 | list = eina_list_append(list, "sagitarius"); | ||
19 | list = eina_list_append(list, "aerilon"); | ||
20 | list = eina_list_append(list, "gemenon"); | ||
21 | |||
22 | list = eina_list_promote_list(list, eina_list_nth_list(list, 2)); | ||
23 | list = eina_list_demote_list(list, eina_list_nth_list(list, 2)); | ||
24 | |||
25 | list = eina_list_remove(list, "sagitarius"); | ||
26 | |||
27 | l = eina_list_data_find_list(list, "aerilon"); | ||
28 | eina_list_data_set(l, "aquarius"); | ||
29 | |||
30 | printf("size: %d\n", eina_list_count(list)); | ||
31 | |||
32 | r_list = eina_list_reverse_clone(list); | ||
33 | |||
34 | itr = eina_list_iterator_new(r_list); | ||
35 | EINA_ITERATOR_FOREACH(itr, list_data) | ||
36 | printf("%s\n", (char*)list_data); | ||
37 | eina_iterator_free(itr); | ||
38 | |||
39 | eina_list_free(list); | ||
40 | eina_list_free(r_list); | ||
41 | |||
42 | eina_shutdown(); | ||
43 | |||
44 | return 0; | ||
45 | } | ||