diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/eet/src/examples/eet-basic.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/libraries/eet/src/examples/eet-basic.c b/libraries/eet/src/examples/eet-basic.c deleted file mode 100644 index 05ff397..0000000 --- a/libraries/eet/src/examples/eet-basic.c +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
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 | |||