X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tools%2Fcommon.h;fp=tools%2Fcommon.h;h=e000489f3db35e41ae30be7c1830709d596161ff;hb=3084511901606db82741bffafc8582ab9b7591cc;hp=4ca8e12c3d7939216ee6ad8ede80811ce461d008;hpb=71d50aa7a431645296bc8624618e02e7f3bf73ac;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];