summaryrefslogtreecommitdiffstats
path: root/runtime/docs/examples
diff options
context:
space:
mode:
authorhunt <hunt>2005-03-29 18:07:58 +0000
committerhunt <hunt>2005-03-29 18:07:58 +0000
commite32551b18f4560056d2d482f5e1505b1b98fa82a (patch)
tree4e9e07a9b46a4fd5dea27732571cbb04c0ef5dee /runtime/docs/examples
parent13b35bb112459702e7371ecc89d7deb789818a86 (diff)
downloadsystemtap-steved-e32551b18f4560056d2d482f5e1505b1b98fa82a.tar.gz
systemtap-steved-e32551b18f4560056d2d482f5e1505b1b98fa82a.tar.xz
systemtap-steved-e32551b18f4560056d2d482f5e1505b1b98fa82a.zip
*** empty log message ***
Diffstat (limited to 'runtime/docs/examples')
-rw-r--r--runtime/docs/examples/argv.c1
-rw-r--r--runtime/docs/examples/list.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/runtime/docs/examples/argv.c b/runtime/docs/examples/argv.c
index 5200c350..609ad74f 100644
--- a/runtime/docs/examples/argv.c
+++ b/runtime/docs/examples/argv.c
@@ -4,6 +4,7 @@ int inst_do_execve (char * filename, char __user *__user *argv, char __user *__u
{
struct map_node_str *ptr;
+ _stp_list_clear (arglist);
_stp_copy_argv_from_user (arglist, argv);
foreach (arglist, ptr)
diff --git a/runtime/docs/examples/list.c b/runtime/docs/examples/list.c
new file mode 100644
index 00000000..15d13d4b
--- /dev/null
+++ b/runtime/docs/examples/list.c
@@ -0,0 +1,14 @@
+
+struct map_node_str *ptr;
+
+MAP map = _stp_list_new(10, STRING);
+
+for (i = 0; i < 10; i++) {
+ sprintf (buf, "Item%d", i);
+ _stp_list_add (map, buf);
+ }
+
+foreach (map, ptr)
+ printf ("map[%ld] = %s\n", key1int(ptr), ptr->str);
+
+