From 1713a05f2afa6df663a7fd3552849759a7d3ff48 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 30 Mar 2010 15:53:51 -0500 Subject: 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. --- tapset/string.stp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tapset/string.stp') 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]); +%} + -- cgit