summaryrefslogtreecommitdiffstats
path: root/src/bfstd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bfstd.h')
-rw-r--r--src/bfstd.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/bfstd.h b/src/bfstd.h
index 97867fd..84f92ec 100644
--- a/src/bfstd.h
+++ b/src/bfstd.h
@@ -179,23 +179,26 @@ int open_cterm(int flags);
const char *xgetprogname(void);
/**
+ * Wrapper for strtol() that forbids leading spaces.
+ */
+int xstrtol(const char *str, char **end, int base, long *value);
+
+/**
* Wrapper for strtoll() that forbids leading spaces.
- *
- * @str
- * The string to parse.
- * @end
- * If non-NULL, will hold a pointer to the first invalid character.
- * If NULL, the entire string must be valid.
- * @base
- * The base for the conversion, or 0 to auto-detect.
- * @value
- * Will hold the parsed integer value, on success.
- * @return
- * 0 on success, -1 on failure.
*/
int xstrtoll(const char *str, char **end, int base, long long *value);
/**
+ * Wrapper for strtof() that forbids leading spaces.
+ */
+int xstrtof(const char *str, char **end, float *value);
+
+/**
+ * Wrapper for strtod() that forbids leading spaces.
+ */
+int xstrtod(const char *str, char **end, double *value);
+
+/**
* Process a yes/no prompt.
*
* @return 1 for yes, 0 for no, and -1 for unknown.