53 double sb_strtod(
const char *s00,
char **se);
58 return sb_strtod(str, NULL);
71 while ((c = va_arg(args,
const char *)) != NULL) {
80 while ((c = va_arg(args,
const char *)) != NULL) {
95 size_t sub = strspn(
string,
" \t\n\r\f");
97 memmove(
string,
string + sub, len + 1 - sub);
104 if (strchr(
" \t\n\r\f",
string[sub]) == NULL)
109 string[sub+1] =
'\0';
123 while (line[i] && isspace((
unsigned char)line[i]))
128 if (ptr != NULL && n >= max_ptr) {
144 while (line[i] && !isspace((
unsigned char)line[i]))
158 nextword(
char *line,
const char *delim,
char **word,
char *delimfound)
164 for (w = line; *w; w++) {
165 for (d = delim; *d && (*d != *w); d++);
176 for (d = delim; *d && (*d != *w); d++);
Miscellaneous useful string functions.
#define ckd_calloc(n, sz)
Macros to simplify the use of above functions.
Sphinx's memory allocation/deallocation routines.
SPHINXBASE_EXPORT double atof_c(char const *str)
Locale independent version of atof().
SPHINXBASE_EXPORT int32 str2words(char *line, char **wptr, int32 n_wptr)
Convert a line to an array of "words", based on whitespace separators.
SPHINXBASE_EXPORT char * string_join(const char *base,...)
Concatenate a NULL-terminated argument list of strings, returning a newly allocated string...
SPHINXBASE_EXPORT int32 nextword(char *line, const char *delim, char **word, char *delimfound)
Yet another attempt at a clean "next-word-in-string" function.
SPHINXBASE_EXPORT char * string_trim(char *string, enum string_edge_e which)
Remove whitespace from a string, modifying it in-place.
string_edge_e
Which end of a string to operate on for string_trim().