summaryrefslogtreecommitdiffstats
path: root/tapset/string.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-04-27 11:56:15 -0400
committerDave Brolley <brolley@redhat.com>2009-04-27 11:56:15 -0400
commite84f20287ae21b31c3505dfd0a81176687ad1ec5 (patch)
tree956005556406fc93e4444ee0d425aafed8e241d0 /tapset/string.stp
parentfb6d28283bd7ea63364a008d32c53687a694642f (diff)
parent097e4a5b397b9e826453e01caa1f8169886128c5 (diff)
downloadsystemtap-steved-e84f20287ae21b31c3505dfd0a81176687ad1ec5.tar.gz
systemtap-steved-e84f20287ae21b31c3505dfd0a81176687ad1ec5.tar.xz
systemtap-steved-e84f20287ae21b31c3505dfd0a81176687ad1ec5.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Conflicts: configure testsuite/configure
Diffstat (limited to 'tapset/string.stp')
-rw-r--r--tapset/string.stp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tapset/string.stp b/tapset/string.stp
index 2f43aecc..35ee9fa2 100644
--- a/tapset/string.stp
+++ b/tapset/string.stp
@@ -25,6 +25,18 @@ function substr:string(str:string,start:long, length:long) %{ /* pure */
strlcpy(THIS->__retvalue, THIS->str + THIS->start, length);
%}
+/** @addtogroup library
+* @code function stringat:string(str:string, pos:long) @endcode
+* @param str string
+* @param pos the given position. 0 = start of the string
+* @return Returns the char in given position of string.
+*/
+function stringat:long(str:string, pos:long) %{ /* pure */
+ if (THIS->pos >= 0 && THIS->pos < strlen(THIS->str))
+ THIS->__retvalue = THIS->str[THIS->pos];
+ else
+ THIS->__retvalue = 0;
+%}
/** @addtogroup library
* @code isinstr:long(s1:string,s2:string) @endcode