typedef struct Matcher Matcher;
#pragma incomplete Matcher /* See 9fans "new compiler" 2005-01-07 */
/** constructor */
Matcher *matcher_new(QidGenerator *qidgen);
/** destructor */
void matcher_free(Matcher *self);
/** adding */
void matcher_add(Matcher *self, Rule *rule);
/** finds the first rule that returns non nil Dir */
Dir *matcher_find(Matcher *self, char *path);
/**
* goes through rule set and open the first file that can be opened with the
* specified mode.
*
* @return nil if success, an error string otherwise.
*/
char *matcher_open_file(Matcher *self, FidData *fiddata, int omode);
/**
* goes through rule set and open the first dir that can be opened with the
* specified mode.
*
* @return nil if success, an error string otherwise.
*/
char *matcher_open_dir(Matcher *self, FidData *fiddata, int omode);
/**
* creates the file with given file path.
*
* @todo should we retain the the file's perm, owner, group during truncation?
* we wouldn't under if the base layer is a cdrom.
*/
char *matcher_create(Matcher *self,
FidData *fiddata, char *path, int omode, ulong perm);
/** removes the file wiath given path */
char *matcher_remove(Matcher *self, char *path);
/** perform wstat with given path */
char *matcher_wstat(Matcher *self, char *path, Dir *d, HoleManager *holes);
|