Plan 9 from Bell Labs’s /usr/web/sources/contrib/de0u/root/sys/src/cmd/divergefs/matcher.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



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);


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.