aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_ipc_codec.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-05-13 15:15:52 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-05-13 15:15:52 +0000
commit3f92e26079e5dc9ca917da3b51eafba191ec205a (patch)
treec3c405ebf52ef2220c8f20c653d52b1342104d28 /src/bin/e_ipc_codec.c
parentOnly fake the pressed button up. (diff)
downloadenlightenment-3f92e26079e5dc9ca917da3b51eafba191ec205a.tar.gz
breaking out some ipc action!
SVN revision: 14755
Diffstat (limited to 'src/bin/e_ipc_codec.c')
-rw-r--r--src/bin/e_ipc_codec.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/e_ipc_codec.c b/src/bin/e_ipc_codec.c
index 4c88d515a..e48f8b8b3 100644
--- a/src/bin/e_ipc_codec.c
+++ b/src/bin/e_ipc_codec.c
@@ -7,6 +7,7 @@
/* local subsystem globals */
static Eet_Data_Descriptor *_e_ipc_int_edd = NULL;
static Eet_Data_Descriptor *_e_ipc_double_edd = NULL;
+static Eet_Data_Descriptor *_e_ipc_2int_edd = NULL;
/* externally accessible functions */
int
@@ -18,6 +19,9 @@ e_ipc_codec_init(void)
_e_ipc_double_edd = E_CONFIG_DD_NEW("double", E_Ipc_Double);
E_CONFIG_VAL(_e_ipc_double_edd, E_Ipc_Double, val, DOUBLE);
+ _e_ipc_2int_edd = E_CONFIG_DD_NEW("2int", E_Ipc_2Int);
+ E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val1, INT);
+ E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val2, INT);
return 1;
}
@@ -26,6 +30,7 @@ e_ipc_codec_shutdown(void)
{
E_CONFIG_DD_FREE(_e_ipc_int_edd);
E_CONFIG_DD_FREE(_e_ipc_double_edd);
+ E_CONFIG_DD_FREE(_e_ipc_2int_edd);
}
int
@@ -72,5 +77,29 @@ e_ipc_codec_double_enc(double val, int *size_ret)
return eet_data_descriptor_encode(_e_ipc_double_edd, &dat, size_ret);
}
+int
+e_ipc_codec_2int_dec(char *data, int bytes, int *dest, int *dest2)
+{
+ E_Ipc_2Int *dat;
+
+ if (!data) return 0;
+ dat = eet_data_descriptor_decode(_e_ipc_2int_edd, data, bytes);
+ if (!dat) return 0;
+ if (dest) *dest = dat->val1;
+ if (dest2) *dest2 = dat->val2;
+ free(dat);
+ return 1;
+}
+
+void *
+e_ipc_codec_2int_enc(int val1, int val2, int *size_ret)
+{
+ E_Ipc_2Int dat;
+
+ dat.val1 = val1;
+ dat.val2 = val2;
+ return eet_data_descriptor_encode(_e_ipc_2int_edd, &dat, size_ret);
+}
+
/* local subsystem globals */