mirror of
https://github.com/troglobit/libite.git
synced 2026-11-25 20:28:17 +00:00
lite.h: Minor coding style cleanup.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
f5355ecf7b
commit
3eb1fbb31d
1 file changed
+6
-6
@@ -118,23 +118,23 @@ static inline int atonum(const char *str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Validate string, non NULL and not zero length */
|
/* Validate string, non NULL and not zero length */
|
||||||
static inline int string_valid (const char *s)
|
static inline int string_valid(const char *s)
|
||||||
{
|
{
|
||||||
return s && strlen (s);
|
return s && strlen(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Relaxed comparison, e.g., sys_string_match("small", "smaller") => TRUE */
|
/* Relaxed comparison, e.g., sys_string_match("small", "smaller") => TRUE */
|
||||||
static inline int string_match (const char *a, const char *b)
|
static inline int string_match(const char *a, const char *b)
|
||||||
{
|
{
|
||||||
size_t min = MIN(strlen (a), strlen (b));
|
size_t min = MIN(strlen(a), strlen(b));
|
||||||
|
|
||||||
return !strncasecmp (a, b, min);
|
return !strncasecmp(a, b, min);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Strict comparison, e.g., sys_string_match("small", "smaller") => FALSE */
|
/* Strict comparison, e.g., sys_string_match("small", "smaller") => FALSE */
|
||||||
static inline int string_compare (const char *a, const char *b)
|
static inline int string_compare (const char *a, const char *b)
|
||||||
{
|
{
|
||||||
return strlen (a) == strlen (b) && !strcmp (a, b);
|
return strlen(a) == strlen(b) && !strcmp(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Strict comparison, like sys_string_compare(), but case insensitive,
|
/* Strict comparison, like sys_string_compare(), but case insensitive,
|
||||||
|
|||||||
Reference in new issue
Block a user