notaz.gp2x.de
/
ia32rtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
translate: fixes
[ia32rtools.git]
/
tools
/
common.h
diff --git
a/tools/common.h
b/tools/common.h
index
4ca8e12
..
e000489
100644
(file)
--- 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
// 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];
{
char *ret, *ret2;
char buf[64];