From a1eb7d927ea3cd0fe2def854e1447bc9a2e05cc6 Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 7 May 2002 14:53:47 +0000 Subject: Just some small fixes before moving to the CactusConnect arrangement. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/Socket/trunk@19 9697cf00-7f2a-4e1b-af3c-314b8e4b499e --- src/SocketUtils.h | 9 ++++----- src/Utils.c | 55 ++++++++++--------------------------------------------- 2 files changed, 14 insertions(+), 50 deletions(-) diff --git a/src/SocketUtils.h b/src/SocketUtils.h index 37931c0..7f5ddb4 100644 --- a/src/SocketUtils.h +++ b/src/SocketUtils.h @@ -5,11 +5,11 @@ @desc @enddesc - @version $Header$ + @version $Header$ @@*/ -#ifndef _SOCKETUTILS_H_ -#define _SOCKETUTILS_H_ 1 +#ifndef _SOCKET_SOCKETUTILS_H_ +#define _SOCKET_SOCKETUTILS_H_ 1 #ifdef __cplusplus extern "C" @@ -111,5 +111,4 @@ int Socket_SetNonBlocking(); } #endif -#endif /* _SOCKETUTILS_H */ - +#endif /* _SOCKET_SOCKETUTILS_H */ diff --git a/src/Utils.c b/src/Utils.c index 663c15b..e89b482 100644 --- a/src/Utils.c +++ b/src/Utils.c @@ -3,13 +3,14 @@ @date 1991 @author John Shalf @desc - Socket stuff provided by John Shalf + Routines which deal with sockets. @enddesc @history - @hdate Thu May 25 13:45:29 2000 @hauthor Tom Goodale - @hdesc Moved this file into Cactus + @hdate Thu May 25 13:45:29 2000 + @hauthor Tom Goodale + @hdesc Moved this file into Cactus @endhistory - @version $Header$ + @version $Id$ @@*/ #include "cctk.h" @@ -33,7 +34,7 @@ #include "SocketUtils.h" static const char *rcsid = "$Header$"; -CCTK_FILEVERSION(Development_Socket) +CCTK_FILEVERSION(CactusConnect_Socket_Utils_c) /* SunOS doesn't know INADDR_NONE */ @@ -49,12 +50,6 @@ CCTK_FILEVERSION(Development_Socket) @desc @enddesc - @calls - @calledby - @history - - @endhistory - @@*/ int Socket_TCPOpenClientSock(const char *hostname,int port) { @@ -106,12 +101,6 @@ int Socket_TCPOpenClientSock(const char *hostname,int port) @desc @enddesc - @calls - @calledby - @history - - @endhistory - @@*/ int Socket_UDPOpenClientSock(const char *hostname,int port) { @@ -171,12 +160,6 @@ int Socket_UDPOpenClientSock(const char *hostname,int port) @desc @enddesc - @calls - @calledby - @history - - @endhistory - @@*/ int Socket_TCPOpenServerSock(int port) { @@ -229,12 +212,6 @@ int Socket_TCPOpenServerSock(int port) @desc @enddesc - @calls - @calledby - @history - - @endhistory - @@*/ int Socket_UDPOpenServerSock(int port) { @@ -274,16 +251,10 @@ int Socket_UDPOpenServerSock(int port) @desc @enddesc - @calls - @calledby - @history - - @endhistory - @@*/ int Socket_TCPBlockingWrite(int fd,char *buffer, int buflen) { - register int n; + int n; int nstore; n=write(fd,buffer,buflen); @@ -311,10 +282,10 @@ int Socket_TCPBlockingWrite(int fd,char *buffer, int buflen) perror("will attempt recovery by sending in smaller pieces"); #endif /* subdivide buffer and call TCPBlockingWrite() recursively */ - nstore=n; /* preserve register variable */ + nstore=n; /* preserve variable */ Socket_TCPBlockingWrite(fd,buffer,buflen>>1); Socket_TCPBlockingWrite(fd,buffer+(buflen>>1),buflen-(buflen>>1)); - n=nstore; /* restore register variable */ + n=nstore; /* restore variable */ break; case EFAULT: #ifdef PERRORS @@ -349,18 +320,12 @@ int Socket_TCPBlockingWrite(int fd,char *buffer, int buflen) @desc @enddesc - @calls - @calledby - @history - - @endhistory - @@*/ int Socket_TCPBlockingRead(int fd,char *buffer, int buflen) { /* do errno only if types.h has been included */ /* how can I tell if this has been included ? */ - register int n,accum=0; + int n,accum=0; while((n=read(fd,buffer,buflen)) > 0) { if(n>=0) -- cgit v1.2.3