From b97462993b00ecc5cd04051b4fc2abd164fefb04 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 28 Feb 2021 18:07:04 +0200 Subject: 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 --- src/ipc.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/ipc.h') 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. */ #pragma once -#include +#include +#include +void init_Ipc (const char *runDir); +void deinit_Ipc (void); + +iProcessId check_Ipc (void); +void listen_Ipc (void); +iString * communicate_Ipc (const iString *command); +void signal_Ipc (iProcessId pid); + +enum iIpcWrite { + command_IpcWrite, + response_IpcWrite, +}; + +iBool write_Ipc (iProcessId pid, const iString *input, enum iIpcWrite type); -- cgit v1.2.3