string matching object based approach in C
// Prototyping for match utilities for C library
typedef struct
{
size_t len;
size_t state; // indicates to what portion a match is made.
char string[0];
} Pattern;
Pattern* Pattern_new(const char* string)
{
size_t sizedStr = strlen(string);
Pattern* newpat = malloc(sizeof(Pattern) + sizedStr);
newpat->len = sizedStr;
newpat->state = 0;
return newpat;
}