summaryrefslogtreecommitdiffstats
path: root/tapset/string.stp
diff options
context:
space:
mode:
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]);
+%}
+