$ ls -l total 24 -rwxrwxr-x 1 mobile_c mobile_c 13008 Jan 16 13:39 c -rw-rw-r-- 1 mobile_c mobile_c 3899 Jan 16 13:37 c.c -rw-rw-r-- 1 mobile_c mobile_c 227 Jan 16 13:36 quotes $ cat quotes "''\"'\ // this should not match\ /*\ nor\ should\ this\ " '\'\'"\'\ // this should not match\ /*\ nor\ should\ this\ ' // test /* * multi line * // this should not match single line comment */ end h/*hello*/i // HIfujeg g $ cat c.c #include #include #include #include #include #include #include #define pp(x) printf("%s = %p\n", #x, x); #define pi(x) printf("%s = %d\n", #x, x); #define pc(x) printf("%s = %c\n", #x, x); #define ps(x) printf("%s = %s\n", #x, x); #define psize_t(x) printf("%s = %zu\n", #x, x); #define pb(x) printf("%s = %s\n", #x, x==true?"true":"false"); // reads a entire file int read__(char *file, char **p, size_t *q) { int fd; size_t len = 0; char *o; if (!(fd = open(file, O_RDONLY))) { fprintf(stderr, "open() failure\n"); return (1); } len = lseek(fd, 0, SEEK_END); lseek(fd, 0, 0); if (!(o = malloc(len))) { fprintf(stderr, "failure to malloc()\n"); } if ((read(fd, o, len)) == -1) { fprintf(stderr, "failure to read()\n"); } int cl = close(fd); if (cl < 0) { fprintf(stderr, "cannot close \"%s\", returned %i\n", file, cl); return -1; } *p = o; *q = len; return len; } int bcmpcq__2(void const *vp, size_t n, void const *vp2, size_t n2) { int string_match = 0; unsigned char const *p = vp; unsigned char const *p2 = vp2; int matches=0; int contains_matches=0; for (size_t i=0; i