]>
Commit | Line | Data |
---|---|---|
d2bd862e JH |
1 | #ifndef FSMONITOR_IPC_H |
2 | #define FSMONITOR_IPC_H | |
3 | ||
4 | #include "simple-ipc.h" | |
5 | ||
6 | /* | |
7 | * Returns true if built-in file system monitor daemon is defined | |
8 | * for this platform. | |
9 | */ | |
10 | int fsmonitor_ipc__is_supported(void); | |
11 | ||
12 | /* | |
13 | * Returns the pathname to the IPC named pipe or Unix domain socket | |
14 | * where a `git-fsmonitor--daemon` process will listen. This is a | |
15 | * per-worktree value. | |
16 | * | |
17 | * Returns NULL if the daemon is not supported on this platform. | |
18 | */ | |
19 | const char *fsmonitor_ipc__get_path(void); | |
20 | ||
21 | /* | |
22 | * Try to determine whether there is a `git-fsmonitor--daemon` process | |
23 | * listening on the IPC pipe/socket. | |
24 | */ | |
25 | enum ipc_active_state fsmonitor_ipc__get_state(void); | |
26 | ||
27 | /* | |
28 | * Connect to a `git-fsmonitor--daemon` process via simple-ipc | |
29 | * and ask for the set of changed files since the given token. | |
30 | * | |
31 | * Spawn a daemon process in the background if necessary. | |
32 | * | |
33 | * Returns -1 on error; 0 on success. | |
34 | */ | |
35 | int fsmonitor_ipc__send_query(const char *since_token, | |
36 | struct strbuf *answer); | |
37 | ||
38 | /* | |
39 | * Connect to a `git-fsmonitor--daemon` process via simple-ipc and | |
40 | * send a command verb. If no daemon is available, we DO NOT try to | |
41 | * start one. | |
42 | * | |
43 | * Returns -1 on error; 0 on success. | |
44 | */ | |
45 | int fsmonitor_ipc__send_command(const char *command, | |
46 | struct strbuf *answer); | |
47 | ||
48 | #endif /* FSMONITOR_IPC_H */ |