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_strbuf_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 '')
-rw-r--r-- | libraries/eina/src/examples/eina_strbuf_01.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libraries/eina/src/examples/eina_strbuf_01.c b/libraries/eina/src/examples/eina_strbuf_01.c new file mode 100644 index 0000000..eddfccf --- /dev/null +++ b/libraries/eina/src/examples/eina_strbuf_01.c | |||
@@ -0,0 +1,41 @@ | |||
1 | //Compile with: | ||
2 | //gcc -Wall -o eina_strbuf_01 eina_strbuf_01.c `pkg-config --cflags --libs eina` | ||
3 | |||
4 | #include <stdio.h> | ||
5 | #include <Eina.h> | ||
6 | |||
7 | int main(int argc, char **argv) | ||
8 | { | ||
9 | Eina_Strbuf *buf; | ||
10 | |||
11 | eina_init(); | ||
12 | |||
13 | buf = eina_strbuf_new(); | ||
14 | |||
15 | eina_strbuf_append_length(buf, "buffe", 5); | ||
16 | eina_strbuf_append_char(buf, 'r'); | ||
17 | printf("%s\n", eina_strbuf_string_get(buf)); | ||
18 | |||
19 | eina_strbuf_insert_escaped(buf, "my ", 0); | ||
20 | printf("%s\n", eina_strbuf_string_get(buf)); | ||
21 | eina_strbuf_reset(buf); | ||
22 | |||
23 | eina_strbuf_append_escaped(buf, "my buffer"); | ||
24 | printf("%s\n", eina_strbuf_string_get(buf)); | ||
25 | eina_strbuf_reset(buf); | ||
26 | |||
27 | eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r'); | ||
28 | eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf)); | ||
29 | printf("%s\n", eina_strbuf_string_get(buf)); | ||
30 | |||
31 | eina_strbuf_remove(buf, 0, 7); | ||
32 | printf("%s\n", eina_strbuf_string_get(buf)); | ||
33 | |||
34 | eina_strbuf_replace_all(buf, "length", "size"); | ||
35 | printf("%s\n", eina_strbuf_string_get(buf)); | ||
36 | |||
37 | eina_strbuf_free(buf); | ||
38 | eina_shutdown(); | ||
39 | |||
40 | return 0; | ||
41 | } | ||