b5da5ef3b12888449a0616bd3fb0b7d858667925
[egate.git] / util / gips.c
1 /* Gateway kernel
2  * Europagate, 1995
3  *
4  * $Log: gips.c,v $
5  * Revision 1.2  1995/04/19 16:02:06  adam
6  * Some hacks to get the FIFO communication work!! Isn't reliable.
7  *
8  * Revision 1.1  1995/03/27  08:25:00  adam
9  * New module gip: Gateway IPc module.
10  * New module gw-db: Gateway hash-db module (user information table).
11  *
12  */
13
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <assert.h>
17 #include <string.h>
18 #include <unistd.h>
19 #include <fcntl.h>
20
21 #include <gw-log.h>
22 #include <gip.h>
23
24 GIP gips_initialize (const char *name)
25 {
26     return gip_initialize (name);
27 }
28
29 int gips_destroy (GIP gip)
30 {
31     return gip_destroy (gip);
32 }
33
34 int gips_open (GIP gip, const char *client)
35 {
36     gw_log (GW_LOG_DEBUG, "gips", "open writeonly of %s", client);
37     gip->wfd = open (client, O_WRONLY);
38     gw_log (GW_LOG_DEBUG, "gips", "open readonly of %s", gip->name);
39     gip->rfd = open (gip->name, O_RDONLY);
40     if (gip->rfd == -1)
41         return -1;
42     if (gip->wfd == -1)
43         return -1;
44     return 0;
45 }
46
47 int gips_close (GIP gip)
48 {
49     close (gip->rfd);
50     close (gip->wfd);
51     return 0;
52 }