comparison lib-src/gnuslib.c @ 363:972bbb6d6ca2 r21-1-11

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