comparison lib-src/gnuslib.c @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 972bbb6d6ca2
children 74fd4e045ea6
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
74 74
75 char *tmpdir = NULL; 75 char *tmpdir = NULL;
76 76
77 char *progname = NULL; 77 char *progname = NULL;
78 78
79 int 79 int make_connection(hostarg, portarg, s)
80 make_connection (char *hostarg, int portarg, int *s) 80 char *hostarg;
81 int portarg;
82 int *s;
81 { 83 {
82 #ifdef INTERNET_DOMAIN_SOCKETS 84 #ifdef INTERNET_DOMAIN_SOCKETS
83 char *ptr; 85 char *ptr;
84 if (hostarg == NULL) 86 if (hostarg == NULL)
85 hostarg = getenv("GNU_HOST"); 87 hostarg = getenv("GNU_HOST");
192 194
193 #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) 195 #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS)
194 /* 196 /*
195 send_string -- send string to socket. 197 send_string -- send string to socket.
196 */ 198 */
197 void 199 void send_string(s,msg)
198 send_string (int s, CONST char *msg) 200 int s;
201 CONST char *msg;
199 { 202 {
200 #if 0 203 #if 0
201 if (send(s,msg,strlen(msg),0) < 0) { 204 if (send(s,msg,strlen(msg),0) < 0) {
202 perror(progname); 205 perror(progname);
203 fprintf(stderr,"%s: unable to send\n",progname); 206 fprintf(stderr,"%s: unable to send\n",progname);
281 #ifdef INTERNET_DOMAIN_SOCKETS 284 #ifdef INTERNET_DOMAIN_SOCKETS
282 /* 285 /*
283 internet_addr -- return the internet addr of the hostname or 286 internet_addr -- return the internet addr of the hostname or
284 internet address passed. Return -1 on error. 287 internet address passed. Return -1 on error.
285 */ 288 */
286 int 289 int internet_addr(host)
287 internet_addr (char *host) 290 char *host;
288 { 291 {
289 struct hostent *hp; /* pointer to host info for remote host */ 292 struct hostent *hp; /* pointer to host info for remote host */
290 IN_ADDR numeric_addr; /* host address */ 293 IN_ADDR numeric_addr; /* host address */
291 294
292 numeric_addr = inet_addr(host); 295 numeric_addr = inet_addr(host);
390 #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) 393 #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS)
391 /* 394 /*
392 disconnect_from_server -- inform the server that sending has finished, and wait for 395 disconnect_from_server -- inform the server that sending has finished, and wait for
393 its reply. 396 its reply.
394 */ 397 */
395 void 398 void disconnect_from_server(s,echo)
396 disconnect_from_server (int s, int echo) 399 int s;
400 int echo;
397 { 401 {
398 #if 0 402 #if 0
399 char buffer[REPLYSIZ+1]; 403 char buffer[REPLYSIZ+1];
400 #else 404 #else
401 char buffer[GSERV_BUFSZ+1]; 405 char buffer[GSERV_BUFSZ+1];