From cf59a018780a28b2f2642878efe3246afe1497c2 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 12 Mar 2001 01:01:10 +0000 Subject: [PATCH] ipc updates... SVN revision: 4365 --- src/ipc.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/ipc.c b/src/ipc.c index 87a62bae5..cc57b8491 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1,7 +1,16 @@ #include "e.h" +struct _coords { + int xid; + int x; + int y; +}; + +typedef struct _coords coords; + void e_ipc_init(void); -static char *e_ipc_get_version(char *argv); +static void e_ipc_get_version(int fd); +static void e_ipc_move_window(int fd); void e_ipc_init(void) @@ -16,11 +25,26 @@ e_ipc_init(void) /* add ipc services or functions clients can use */ e_add_ipc_service(0, e_ipc_get_version); + e_add_ipc_service(1, e_ipc_move_window); } -static char -*e_ipc_get_version(char *argv) +static void +e_ipc_get_version(int fd) { - printf("e_ipc_get_version service called\n"); fflush(stdout); - return "0.17.0"; + e_ipc_send_data(fd, &VERSION, strlen(VERSION)); +} + +static void +e_ipc_move_window(int fd) +{ + coords test; + int retval = 0; + + /* get window id and coords to move to */ + e_ipc_get_data(fd, &test); + + /* move window here */ + + /* return failure or success */ + e_ipc_send_data(fd, &retval, sizeof(retval)); }