aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.c')
-rw-r--r--src/Utils.c55
1 files changed, 10 insertions, 45 deletions
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)