struct _fnmatch_state; typedef struct _fnmatch_state fnmatch_state; /*compile pattern*/ fnmatch_state* fnmatch_compile(char *pattern,int flags); /* add prefix to matched strings. suppose you want match foo againist /home/foo, /home/bar/foo, /home/bar/bar fnmatch_state* s=fnmatch_compile("foo",0); fnmatch_state* home=fnmatch_prefix(s,"/home"); fnmatch_state* bar=fnmatch_prefix(s,"/bar"); fnmatch_exec(home,"foo"); fnmatch_exec(bar,"foo"); fnmatch_exec(bar,"bar"); */ fnmatch_state* fnmatch_prefix(fnmatch_state *pattern,char *prefix); int fnmatch_exec(fnmatch_state * pattern,char *string);