diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-28 18:07:04 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-28 18:07:04 +0200 |
commit | b97462993b00ecc5cd04051b4fc2abd164fefb04 (patch) | |
tree | 6575f4c47b658a69c7da60e72d1f748e866e0aaf /src/ipc.h | |
parent | 2583e020e7f1f1036f6df8f5b93668e7a0187d60 (diff) |
Single app instance; IPC mechanism
Only one instance of Lagrange is allowed to run per a runtime directory. Otherwise the instances will overwrite each others' files.
Added a check at startup to see if an instance is already running. If so, options can be used to communicate with it.
By default, a new tab is opened in the running instance.
IssueID #37
IssueID #164
IssueID #174
IssueID #178
Diffstat (limited to 'src/ipc.h')
-rw-r--r-- | src/ipc.h | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -22,5 +22,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
22 | 22 | ||
23 | #pragma once | 23 | #pragma once |
24 | 24 | ||
25 | #include <the_Foundation/defs.h> | 25 | #include <the_Foundation/string.h> |
26 | #include <the_Foundation/process.h> | ||
26 | 27 | ||
28 | void init_Ipc (const char *runDir); | ||
29 | void deinit_Ipc (void); | ||
30 | |||
31 | iProcessId check_Ipc (void); | ||
32 | void listen_Ipc (void); | ||
33 | iString * communicate_Ipc (const iString *command); | ||
34 | void signal_Ipc (iProcessId pid); | ||
35 | |||
36 | enum iIpcWrite { | ||
37 | command_IpcWrite, | ||
38 | response_IpcWrite, | ||
39 | }; | ||
40 | |||
41 | iBool write_Ipc (iProcessId pid, const iString *input, enum iIpcWrite type); | ||