summaryrefslogtreecommitdiffstats
path: root/tapset/string.stp
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2010-03-30 15:53:51 -0500
committerDavid Smith <dsmith@redhat.com>2010-03-30 15:53:51 -0500
commit1713a05f2afa6df663a7fd3552849759a7d3ff48 (patch)
treebd182e9ce4c075cf4cde34a273966761fa3edbff /tapset/string.stp
parenteda8b449152cf0f864d2cd250fb2b7a2945bc996 (diff)
downloadsystemtap-steved-1713a05f2afa6df663a7fd3552849759a7d3ff48.tar.gz
systemtap-steved-1713a05f2afa6df663a7fd3552849759a7d3ff48.tar.xz
systemtap-steved-1713a05f2afa6df663a7fd3552849759a7d3ff48.zip
PR 9871 (partial) fix. Removed some embedded-C in ioblock.stp/vfs.stp.
* tapset/dev.stp: Added a bdevname() script function. * tapset/ioblock.stp: Rewrote the embedded-C devname function to just use bdevname() script function. * tapset/vfs.stp: Removed embedded-C __bdevname() C function. Calls bdevname() script function instead. * tapset/string.stp: Added isdigit() function.
Diffstat (limited to 'tapset/string.stp')
-rw-r--r--tapset/string.stp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tapset/string.stp b/tapset/string.stp
index d03e5570..9f2c150d 100644
--- a/tapset/string.stp
+++ b/tapset/string.stp
@@ -164,3 +164,17 @@ function strtol:long(str:string, base:long)
%{ /* pure */ /* unprivileged */
THIS->__retvalue = simple_strtol(THIS->str, NULL, THIS->base);
%}
+
+/**
+ * sfunction isdigit - Checks for a digit.
+ * @str: String to check.
+ *
+ * Description: Checks for a digit (0 through 9) as the first
+ * character of a string. Returns non-zero if true, and a zero if
+ * false.
+ */
+function isdigit:long(str:string)
+%{ /* pure */ /* unprivileged */
+ THIS->__retvalue = isdigit(THIS->str[0]);
+%}
+