annotate lib-src/gnuserv.h @ 153:25f70ba0133c r20-3b3

Import from CVS: tag r20-3b3
author cvs
date Mon, 13 Aug 2007 09:38:25 +0200
parents ac2d302a0011
children 929b76928fce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* -*-C-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Header file for the GNU Emacs server and client C code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 Copying is permitted under those conditions described by the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 General Public License.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 Copyright (C) 1989 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 Author: Andy Norman (ange@hplb.hpl.hp.com), based on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 'etc/server.c' and 'etc/emacsclient.c' from the 18.52 GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 Emacs distribution.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 Please mail bugs and suggestions to the author at the above address.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 /* HISTORY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 * 11-Nov-1990 bristor@simba
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 * Added EOT stuff.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 * This file incorporates new features added by Bob Weiner <weiner@mot.com>,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 * Darrell Kindred <dkindred@cmu.edu> and Arup Mukherjee <arup@cmu.edu>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 * Please see the note at the end of the README file for details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 * (If gnuserv came bundled with your emacs, the README file is probably
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 * ../etc/gnuserv.README relative to the directory containing this file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup alpha !";
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #define NO_SHORTNAMES
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #define PATCHLEVEL 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #define NO_SHORTNAMES
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 /* gnuserv should not be compiled using SOCKS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #define DO_NOT_SOCKSIFY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #include <../src/config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #undef read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #undef write
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 #undef open
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #undef close
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #undef signal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 /* Define the communication method between server and clients:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 * You can have either or both kinds of sockets, but you can't mix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 * sockets with sysv ipc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 #define INTERNET_DOMAIN_SOCKETS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #define UNIX_DOMAIN_SOCKETS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 /* #define SYSV_IPC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 * Define additional authentication protocols to be used. These methods will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 * be tried before falling back to the default gnuserv protocol (based on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 * the GNU_SECURE environment variable). Currently, only MIT-MAGIC-COOKIE-1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 * is also supported.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 * Comment out the next line(s) if you don't want to enable the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 * appropriate authentication protocol.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #if defined (HAVE_XAUTH)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #define AUTH_MAGIC_COOKIE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 #endif /* HAVE_XAUTH */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 * stuff related to supporting MIT-MAGIC-COOKIE-1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #define MCOOKIE_SCREEN "999" /* screen # to use as the gnuserv cookie */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 #define MCOOKIE_NAME "MAGIC-1" /* authentication protocol name */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #define MCOOKIE_X_NAME "MIT-MAGIC-COOKIE-1" /* as needed by X */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 #define DEFAUTH_NAME "GNU-SECURE" /* name of default auth protocol */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 #define AUTH_TIMEOUT 15 /* # seconds to wait for auth data */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 #define AUTH_NAMESZ 15 /* max allows auth protocol name size */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 * Pick a default communication scheme, if none was specified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 #if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && !defined(INTERNET_DOMAIN_SOCKETS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 #ifdef HAVE_SYSVIPC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 #define SYSV_IPC /* SYSV systems use SYSV IPC by default */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #endif /* HAVE_SYSVIPC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #ifdef BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 #define UNIX_DOMAIN_SOCKETS /* BSD systems use Unix Domain sockets by default */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 #endif /* BSD */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 #endif /* No communication method pre-defined */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 #include <sys/types.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 #include <sys/param.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 #include <sys/stat.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 #include <stdio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 #ifdef STDC_HEADERS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #include <stdlib.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #include <string.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 #endif /* STDC_HEADERS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #include <signal.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #include <errno.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 #ifdef HAVE_UNISTD_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #include <unistd.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 #ifdef HAVE_SYS_TIME_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #include <sys/time.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 * If you are using SYSV_IPC, you might want to make the buffer size bigger
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 * since it limits the size of requests and responses. Don't make it bigger
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 * than your system's max message size though (usually a couple of k) or else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 * msgsend will start failing. For sockets, using the system BUFSIZ is usually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 * what you want.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 # define GSERV_BUFSZ BUFSIZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 #ifdef SYSV_IPC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 #include <sys/ipc.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 #include <sys/msg.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 #define send_string(s,str) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 if (strlen(msgp->mtext) + strlen(str) < GSERV_BUFSZ) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 strcat(msgp->mtext,str); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 else \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 fprintf(stderr,"%s: not enough message buffer space\n",progname); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 exit(1); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 #endif /* SYSV_IPC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #include <sys/socket.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 #ifdef INTERNET_DOMAIN_SOCKETS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #include <netdb.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 #include <netinet/in.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #include <arpa/inet.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 #define TABLE_SIZE 101 /* The number of entries in the hash table */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #define HASH(host) host /* Rather simplistic hash function */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 #define DEFAULT_PORT 21490 /* default port number to use is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 * DEFAULT_PORT + uid */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 #endif /* INTERNET_DOMAIN_SOCKETS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #ifdef UNIX_DOMAIN_SOCKETS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 #include <sys/un.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 #define HIDE_UNIX_SOCKET /* put the unix socket in a protected dir */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 #endif /* UNIX_DOMAIN_SOCKETS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 /* On some platforms, we need to do the equivalent of "stty litout" to get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 * characters like ^D to pass through to emacs. This problem has only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 * been observed under emacs18; fsf19 and lemacs are probably okay without it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 #ifndef DONT_USE_LITOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 #if !defined(HAVE_TERMIO) && !defined(HAVE_TERMIOS) && !defined(VMS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 #if !defined(MSDOS) && !defined(BSD4_1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 #define USE_LITOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 #define HOSTNAMSZ 255 /* max size of a hostname */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 #define REPLYSIZ 300 /* max size of reply from server to client */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 #undef FALSE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 #define FALSE 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 #undef TRUE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 #define TRUE 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 extern char *optarg;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 extern int optind;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 extern char *progname;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 /* The casts shut Sun's compiler up and are safe in the context these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 are actually used. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 #define max2(x,y) (((int) (x) > (int) (y)) ? (x) : (y))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 #define min2(x,y) (((int) (x) < (int) (y)) ? (x) : (y))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 #ifndef _NFILE /* rough guess at maximum number of open files */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #define _NFILE 20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 #define EOT_STR "\004"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #define EOT_CHR '\004'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 /* connection types */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 #define CONN_UNIX 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 #define CONN_INTERNET 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 #define CONN_IPC 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 /* function declarations */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 extern int make_connection (char *hostarg, int portarg, int *s);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 #ifdef SYSV_IPC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 extern void disconnect_from_ipc_server();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 extern void send_string (int s, CONST char *msg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 extern void disconnect_from_server (int s, int echo);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 #ifdef INTERNET_DOMAIN_SOCKETS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 extern int internet_addr (char *host);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 #endif