12 #ifndef INCLUDE_OPTPARSE_H_ 13 #define INCLUDE_OPTPARSE_H_ 20 #define strcasecmp(s1,s2) _stricmp(s1,s2) 21 #define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n) 28 int atobv(
char *arg,
int def);
31 int atoiv(
char *arg,
int def);
64 int atoi_time(
const char *str,
const char *error_hint);
71 char *
asepc(
char **stringp,
char delim);
82 char *
getkwargs(
char **s,
char **key,
char **val);
char * trim_ws(char *str)
Trim left and right whitespace in string.
Definition: optparse.c:261
int atoiv(char *arg, int def)
Convert string to int with fallback default.
Definition: optparse.c:27
int atobv(char *arg, int def)
Convert string to bool with fallback default.
Definition: optparse.c:18
char * remove_ws(char *str)
Remove all whitespace from string.
Definition: optparse.c:279
char * hostport_param(char *param, char **host, char **port)
Parse param string to host and port.
Definition: optparse.c:52
unsigned int uint32_t
Definition: mongoose.h:269
char * getkwargs(char **s, char **key, char **val)
Parse a comma-separated list of key/value pairs into kwargs.
Definition: optparse.c:252
char * arg_param(char *arg)
Get the next colon or comma separated arg, NULL otherwise.
Definition: optparse.c:38
char * asepc(char **stringp, char delim)
Similar to strsep.
Definition: optparse.c:242
uint32_t atouint32_metric(const char *str, const char *error_hint)
Convert a string to an unsigned integer, uses strtod() and accepts metric suffixes of 'k'...
Definition: optparse.c:86
int atoi_time(const char *str, const char *error_hint)
Convert a string to an integer, uses strtod() and accepts time suffixes of 'd', 'h', 'm', and 's' (also 'D', 'H', 'M', and 'S'), or the form hours:minutes[:seconds].
Definition: optparse.c:147