31 #ifndef GENSVM_STRUTIL_H 32 #define GENSVM_STRUTIL_H 39 char **
str_split(
char *original,
const char *delims,
int *len_ret);
41 void next_line(FILE *fid,
char *filename);
42 char *
get_line(FILE *fid,
char *filename,
char *buffer);
45 long get_fmt_long(FILE *fid,
char *filename,
const char *fmt);
48 long all_longs_str(
char *buffer,
long offset,
long *all_longs);
char ** str_split(char *original, const char *delims, int *len_ret)
Split a string on delimiters and return an array of parts.
bool str_contains_char(const char *str, const char c)
Check if a string contains a char.
long all_longs_str(char *buffer, long offset, long *all_longs)
Read all longs in a given buffer.
bool str_endswith(const char *str, const char *suf)
Check if a string ends with a suffix.
long all_doubles_str(char *buffer, long offset, double *all_doubles)
Read all doubles in a given buffer.
bool str_startswith(const char *str, const char *pre)
Check if a string starts with a prefix.
char * get_line(FILE *fid, char *filename, char *buffer)
Read line to buffer.
long get_fmt_long(FILE *fid, char *filename, const char *fmt)
Read a long integer from file following a format.
double get_fmt_double(FILE *fid, char *filename, const char *fmt)
Read a double from file following a format.
void next_line(FILE *fid, char *filename)
Move to next line in file.