fcap cleaning, added new features and reorganized the unit

This commit is contained in:
2018-02-22 13:42:42 +01:00
parent 805e47594a
commit b678a8f2b7
8 changed files with 546 additions and 152 deletions
+12 -12
View File
@@ -74,41 +74,41 @@ const char *str_4(uint32_t n,
return a;
}
uint32_t str_parse_2(const char *tpl,
uint32_t str_parse_2(const char *value,
const char *a, uint32_t na,
const char *b, uint32_t nb,
bool *suc)
{
if (streq(tpl, a)) return na;
if (streq(tpl, b)) return nb;
if (streq(value, a)) return na;
if (streq(value, b)) return nb;
*suc = false;
return na;
}
uint32_t str_parse_3(const char *tpl,
uint32_t str_parse_3(const char *value,
const char *a, uint32_t na,
const char *b, uint32_t nb,
const char *c, uint32_t nc,
bool *suc)
{
if (streq(tpl, a)) return na;
if (streq(tpl, b)) return nb;
if (streq(tpl, c)) return nc;
if (streq(value, a)) return na;
if (streq(value, b)) return nb;
if (streq(value, c)) return nc;
*suc = false;
return na;
}
uint32_t str_parse_4(const char *tpl,
uint32_t str_parse_4(const char *value,
const char *a, uint32_t na,
const char *b, uint32_t nb,
const char *c, uint32_t nc,
const char *d, uint32_t nd,
bool *suc)
{
if (streq(tpl, a)) return na;
if (streq(tpl, b)) return nb;
if (streq(tpl, c)) return nc;
if (streq(tpl, d)) return nd;
if (streq(value, a)) return na;
if (streq(value, b)) return nb;
if (streq(value, c)) return nc;
if (streq(value, d)) return nd;
*suc = false;
return na;
}