mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 00:17:11 +02:00
eeshow/misc/util.h (strbegins): !strncmp(s, prefix, strlen(prefix))
This commit is contained in:
parent
465a36fde5
commit
fe6d3a9e85
@ -14,8 +14,9 @@
|
|||||||
#ifndef MISC_UTIL_H
|
#ifndef MISC_UTIL_H
|
||||||
#define MISC_UTIL_H
|
#define MISC_UTIL_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
@ -63,4 +64,10 @@
|
|||||||
#define unsupported(s) \
|
#define unsupported(s) \
|
||||||
fprintf(stderr, __FILE__ ":%d: unsupported: " s "\n", __LINE__)
|
fprintf(stderr, __FILE__ ":%d: unsupported: " s "\n", __LINE__)
|
||||||
|
|
||||||
|
|
||||||
|
static inline bool strbegins(const char *s, const char *prefix)
|
||||||
|
{
|
||||||
|
return !strncmp(s, prefix, strlen(prefix));
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* !MISC_UTIL_H */
|
#endif /* !MISC_UTIL_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user