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/eet/src/examples/eet-basic.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/eet/src/examples/eet-basic.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libraries/eet/src/examples/eet-basic.c b/libraries/eet/src/examples/eet-basic.c new file mode 100644 index 0000000..05ff397 --- /dev/null +++ b/libraries/eet/src/examples/eet-basic.c | |||
@@ -0,0 +1,40 @@ | |||
1 | #include <Eet.h> | ||
2 | |||
3 | int | ||
4 | main(void) | ||
5 | { | ||
6 | Eet_File *ef; | ||
7 | char *ret; | ||
8 | int size; | ||
9 | char *entries[] = | ||
10 | { | ||
11 | "Entry 1", | ||
12 | "Big text string here compared to others", | ||
13 | "Eet is cool" | ||
14 | }; | ||
15 | |||
16 | eet_init(); | ||
17 | |||
18 | // blindly open an file for output and write strings with their NUL char | ||
19 | ef = eet_open("test.eet", EET_FILE_MODE_WRITE); | ||
20 | eet_write(ef, "Entry 1", entries[0], strlen(entries[0]) + 1, 0); | ||
21 | eet_write(ef, "Entry 2", entries[1], strlen(entries[1]) + 1, 1); | ||
22 | eet_write(ef, "Entry 3", entries[2], strlen(entries[2]) + 1, 0); | ||
23 | eet_close(ef); | ||
24 | |||
25 | // open the file again and blindly get the entries we wrote | ||
26 | ef = eet_open("test.eet", EET_FILE_MODE_READ); | ||
27 | ret = eet_read(ef, "Entry 1", &size); | ||
28 | printf("%s\n", ret); | ||
29 | free(ret); | ||
30 | ret = eet_read(ef, "Entry 2", &size); | ||
31 | printf("%s\n", ret); | ||
32 | free(ret); | ||
33 | ret = eet_read(ef, "Entry 3", &size); | ||
34 | printf("%s\n", ret); | ||
35 | free(ret); | ||
36 | eet_close(ef); | ||
37 | |||
38 | eet_shutdown(); | ||
39 | } | ||
40 | |||