8 /* naive and wrong regex stubs */
9 typedef struct regex_t {
13 #define REG_EXTENDED 1
18 int regcomp(regex_t *regex, const char *pattern, int cflags)
20 size_t len = strlen(pattern)+1;
22 regex->pattern = malloc(len);
23 memcpy(regex->pattern, pattern, len);
26 int regexec(const regex_t *regex, const char *haystack, int flags)
29 const char *pattern = regex->pattern;
30 for (i = 0; pattern[i] != '\0'; ++i) {
31 if (pattern[i] != haystack[i])
37 void regfree(regex_t *regex)