Merge branch 'ps/ci-python-2-deprecation' into next
[alt-git.git] / fsmonitor-path-utils.h
blob5bfdfb81c147ee9011a5ab80a9e9f279e9a99278
1 #ifndef FSM_PATH_UTILS_H
2 #define FSM_PATH_UTILS_H
4 #include "strbuf.h"
6 struct alias_info
8 struct strbuf alias;
9 struct strbuf points_to;
12 struct fs_info {
13 int is_remote;
14 char *typename;
18 * Get some basic filesystem information for the given path
20 * The caller owns the storage that is occupied by fs_info and
21 * is responsible for releasing it.
23 * Returns -1 on error, zero otherwise.
25 int fsmonitor__get_fs_info(const char *path, struct fs_info *fs_info);
28 * Determines if the filesystem that path resides on is remote.
30 * Returns -1 on error, 0 if not remote, 1 if remote.
32 int fsmonitor__is_fs_remote(const char *path);
35 * Get the alias in given path, if any.
37 * Sets alias to the first alias that matches any part of the path.
39 * If an alias is found, info.alias and info.points_to are set to the
40 * found mapping.
42 * Returns -1 on error, 0 otherwise.
44 * The caller owns the storage that is occupied by info.alias and
45 * info.points_to and is responsible for releasing it.
47 int fsmonitor__get_alias(const char *path, struct alias_info *info);
50 * Resolve the path against the given alias.
52 * Returns the resolved path if there is one, NULL otherwise.
54 * The caller owns the storage that the returned string occupies and
55 * is responsible for releasing it.
57 char *fsmonitor__resolve_alias(const char *path,
58 const struct alias_info *info);
60 #endif