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

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



/** return true if omode specifies exec access */
bool mode_isexec(int self);

/** return true if omode specifies read access */
bool mode_isread(int self);

/** return true if omode specifies write access */
bool mode_iswrite(int self);

/** return true if omode pseicfies read/write access */
bool mode_isread_write(int self);

/** return true if mode contains any kind of write access including rw */
bool mode_includes_write(int self);

/** return true if mode contains any kind of read access including rw */
bool mode_includes_read(int self);


bool dirmode_isexec(ulong self);

bool dirmode_isread(ulong self);

bool dirmode_iswrite(ulong self);

bool dirmode_isdir(ulong self);



bool perm_isread(ulong self);

bool perm_iswrite(ulong self);

bool perm_isexec(ulong self);

bool perm_isappend(ulong self);

bool perm_isexclusive(ulong self);

/** returns true if the given perm contains DMDIR bit, false otherwise */
bool perm_isdir(ulong self);


/** return true if qid is for dirctory */
bool qid_isdir(Qid *qid);

/** dump qid info */
void qid_dump(Qid *qid);


/** 
 * clone a new dir with all the fields allocated from one malloc, so that it
 * can be freed by one free call 
 */
Dir *dir_clone(Dir *self);
  
/** copy directory structure from copy to self */
void dir_copy(Dir *self, Dir *copy);

/** frees every pointer entry individually */
void dir_free(Dir *self);

/** print out directory related information */
void dir_dump(Dir *self);

/** print out fcall information */
void fcall_dump(Fcall *self);

/** return a static array that points to the error to the last system call */
char *last_error(void);


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].