summaryrefslogtreecommitdiffstats
path: root/runtime/docs/examples/list.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-06-18 07:24:42 +0000
committerhunt <hunt>2005-06-18 07:24:42 +0000
commite5d2abb56ca57a613e4ef9398a6499190b2265be (patch)
tree083465047d73bc498f2278d2eb3dc8514b455ad3 /runtime/docs/examples/list.c
parentef0e92b0335077884edd5ac9997a203bec1839b0 (diff)
downloadsystemtap-steved-e5d2abb56ca57a613e4ef9398a6499190b2265be.tar.gz
systemtap-steved-e5d2abb56ca57a613e4ef9398a6499190b2265be.tar.xz
systemtap-steved-e5d2abb56ca57a613e4ef9398a6499190b2265be.zip
2005-06-18 Martin Hunt <hunt@redhat.com>
* counter.c: New file. Counter aggregations. * stat.c: New file. Stat aggregations. * stat.h: Header file for stats. * map-int.c: New file. Support for int64 values. * map-stat.c: New file. Support for stat values. * map-str.c: New file. Support for string values. * map-values.c: Now just includes the necessary map-*.c files. * stat-common.c: New file. Stats stuff common to Stats and maps containing stats. * Doxyfile: Bumped version to 0.6. * README: Renamed README.doc and reorganized.
Diffstat (limited to 'runtime/docs/examples/list.c')
-rw-r--r--runtime/docs/examples/list.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/docs/examples/list.c b/runtime/docs/examples/list.c
index 15d13d4b..6294cccb 100644
--- a/runtime/docs/examples/list.c
+++ b/runtime/docs/examples/list.c
@@ -1,5 +1,5 @@
-struct map_node_str *ptr;
+struct map_node *ptr;
MAP map = _stp_list_new(10, STRING);
@@ -8,7 +8,10 @@ for (i = 0; i < 10; i++) {
_stp_list_add (map, buf);
}
+/* old way to print a list of strings */
foreach (map, ptr)
- printf ("map[%ld] = %s\n", key1int(ptr), ptr->str);
+ _stp_printf ("list[%ld] = %s\n", key1int(ptr), _stp_get_str(ptr));
+/* new way to print a list of strings */
+ _stp_map_print(map, "list[%1d] = %s");