97#define PATH_DEFER(path) __attribute__((cleanup(path_defer_cleanup))) path_t* CONCAT(i, __COUNTER__) = (path)
110#define PATH_VALID_CHAR(ch) \
111 (strchr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-. ()[]{}~!@#$%^&?',;=+", (ch)))
118#define PATH_HANDLE_DOTDOT_MAX_ITER 1000
136typedef struct pathname
153#define PATHNAME_IS_VALID(pathname) ((pathname) != NULL && (pathname)->isValid)
166#define PATHNAME(string) \
168 pathname_t* pathname = alloca(sizeof(pathname_t)); \
169 pathname_init(pathname, string); \
197 .mount = NULL, .dentry = NULL \
207#define PATH_CREATE(inMount, inDentry) \
210 .mount = REF(inMount), .dentry = REF(inDentry), \
#define MAX_PATH
Maximum length of filepaths.
static void path_defer_cleanup(path_t **path)
mode_t
Path flags and permissions.
void path_put(path_t *path)
Put a path.
uint64_t path_step(path_t *path, const char *name, namespace_t *ns)
Walk a single step in a path.
void path_set(path_t *path, mount_t *mount, dentry_t *dentry)
Set a path.
uint64_t path_walk_parent(path_t *path, const pathname_t *pathname, char *outLastName, namespace_t *ns)
Walk a pathname to its parent and get the name of the last component.
uint64_t path_walk_parent_and_child(const path_t *from, path_t *outParent, path_t *outChild, const pathname_t *pathname, namespace_t *ns)
Traverse a pathname to its parent and child paths.
uint64_t path_walk(path_t *path, const pathname_t *pathname, namespace_t *ns)
Walk a pathname to a path.
uint64_t pathname_init(pathname_t *pathname, const char *string)
Initialize a pathname.
void path_copy(path_t *dest, const path_t *src)
Copy a path.
uint64_t path_to_name(const path_t *path, pathname_t *pathname)
Convert a path to a pathname.
#define NULL
Pointer error value.
Directory entry structure.