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_file_01.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 'libraries/eina/src/examples/eina_file_01.c')
-rw-r--r-- | libraries/eina/src/examples/eina_file_01.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/libraries/eina/src/examples/eina_file_01.c b/libraries/eina/src/examples/eina_file_01.c new file mode 100644 index 0000000..6490b62 --- /dev/null +++ b/libraries/eina/src/examples/eina_file_01.c | |||
@@ -0,0 +1,45 @@ | |||
1 | //Compile with: | ||
2 | //gcc -g `pkg-config --cflags --libs eina` eina_file_01.c -o eina_file_01 | ||
3 | |||
4 | #include <stdio.h> | ||
5 | #include <Eina.h> | ||
6 | |||
7 | static void | ||
8 | _print_cb(const char *name, const char *path, void *data) | ||
9 | { | ||
10 | printf("file %s in %s\n", name, path); | ||
11 | } | ||
12 | |||
13 | int | ||
14 | main(int argc, char **argv) | ||
15 | { | ||
16 | Eina_Iterator *it; | ||
17 | const char *f_name; | ||
18 | const Eina_File_Direct_Info *f_info; | ||
19 | |||
20 | eina_init(); | ||
21 | |||
22 | eina_file_dir_list("/home/", EINA_FALSE, _print_cb, NULL); | ||
23 | |||
24 | it = eina_file_ls("/home/"); | ||
25 | EINA_ITERATOR_FOREACH(it, f_name) | ||
26 | { | ||
27 | printf("%s\n", f_name); | ||
28 | eina_stringshare_del(f_name); | ||
29 | } | ||
30 | eina_iterator_free(it); | ||
31 | |||
32 | it = eina_file_stat_ls("/home/"); | ||
33 | EINA_ITERATOR_FOREACH(it, f_info) | ||
34 | printf("%s if of type %d\n", f_info->path, f_info->type); | ||
35 | eina_iterator_free(it); | ||
36 | |||
37 | it = eina_file_direct_ls("/home/"); | ||
38 | EINA_ITERATOR_FOREACH(it, f_info) | ||
39 | printf("%s if of type %d\n", f_info->path, f_info->type); | ||
40 | eina_iterator_free(it); | ||
41 | |||
42 | eina_shutdown(); | ||
43 | |||
44 | return 0; | ||
45 | } | ||