-/*
- * Client-side IPC functions
- *
- * Copyright (c) 1987-2018 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// Client-side IPC functions
+//
+// Copyright (c) 1987-2018 by the citadel.org team
+//
+// This program is open source software. Use, duplication, and/or
+// disclosure are subject to the GNU General Purpose License version 3.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
#include "textclient.h"
/* Note that some of these functions may not work with multiple instances. */
-static void (*deathHook)(void) = NULL;
-int (*error_printf)(char *s, ...) = (int (*)(char *, ...))printf;
+static void (*deathHook) (void) = NULL;
+int (*error_printf) (char *s, ...) = (int (*)(char *, ...)) printf;
-void setIPCDeathHook(void (*hook)(void)) {
+void setIPCDeathHook(void (*hook) (void))
+{
deathHook = hook;
}
-void setIPCErrorPrintf(int (*func)(char *s, ...)) {
+void setIPCErrorPrintf(int (*func) (char *s, ...))
+{
error_printf = func;
}
-void connection_died(CtdlIPC* ipc, int using_ssl) {
+void connection_died(CtdlIPC * ipc, int using_ssl)
+{
if (deathHook != NULL) {
deathHook();
}
fflush(stdout);
shutdown(ipc->sock, 2);
ipc->sock = -1;
- exit(1);
+ exit(1);
}