X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tools%2Fcommon.h;h=e000489f3db35e41ae30be7c1830709d596161ff;hb=HEAD;hp=4ca8e12c3d7939216ee6ad8ede80811ce461d008;hpb=9ea60b8d585086fa64f7a8cd298ec1cd698ad56d;p=ia32rtools.git diff --git a/tools/common.h b/tools/common.h index 4ca8e12..e000489 100644 --- a/tools/common.h +++ b/tools/common.h @@ -1,5 +1,10 @@ + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#define IS(w, y) !strcmp(w, y) +#define IS_START(w, y) !strncmp(w, y, strlen(y)) + // read a line, truncating it if it doesn't fit -static char *my_fgets(char *s, size_t size, FILE *stream) +static inline char *my_fgets(char *s, size_t size, FILE *stream) { char *ret, *ret2; char buf[64];