summaryrefslogtreecommitdiff
path: root/src/ipc.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-28 18:07:04 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-28 18:07:04 +0200
commitb97462993b00ecc5cd04051b4fc2abd164fefb04 (patch)
tree6575f4c47b658a69c7da60e72d1f748e866e0aaf /src/ipc.h
parent2583e020e7f1f1036f6df8f5b93668e7a0187d60 (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.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ipc.h b/src/ipc.h
index 22dce2a8..8127bf86 100644
--- a/src/ipc.h
+++ b/src/ipc.h
@@ -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
28void init_Ipc (const char *runDir);
29void deinit_Ipc (void);
30
31iProcessId check_Ipc (void);
32void listen_Ipc (void);
33iString * communicate_Ipc (const iString *command);
34void signal_Ipc (iProcessId pid);
35
36enum iIpcWrite {
37 command_IpcWrite,
38 response_IpcWrite,
39};
40
41iBool write_Ipc (iProcessId pid, const iString *input, enum iIpcWrite type);