summaryrefslogtreecommitdiff
path: root/comm/Channel.cc
diff options
context:
space:
mode:
authorsc2000-12-04 13:23:22 +0000
committersc2000-12-04 13:23:22 +0000
commit2455534347596bd4ccf415c9cdf6d2e42a98fb72 (patch)
tree09379b262ce739bfa86cf9c7610c83b471b89ffc /comm/Channel.cc
parentee21a6940d4a8edb758187352ae717bbe7b1b825 (diff)
downloadivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.zip
ivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.tar.gz
ivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.tar.bz2
ivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.tar.xz
IvlFilDes -> IvlFd
Diffstat (limited to 'comm/Channel.cc')
-rw-r--r--comm/Channel.cc58
1 files changed, 26 insertions, 32 deletions
diff --git a/comm/Channel.cc b/comm/Channel.cc
index f396a40..98bc97c 100644
--- a/comm/Channel.cc
+++ b/comm/Channel.cc
@@ -1,17 +1,17 @@
/*
- * The Unix Channel
+ * Ivy League
*
- * by Michel Beaudouin-Lafon
+ * File descriptors, channels
*
- * Copyright 1990-1997
+ * Copyright 1990-2000
* Laboratoire de Recherche en Informatique (LRI)
+ * Centre d'Etudes de la Navigation Aerienne (CENA)
*
- * File descriptors, channels
+ * original code by Michel Beaudouin-Lafon,
+ * heavily modified by Stephane Chatty and Stephane Sire
*
* $Id$
- * $CurLog$
- * Smart(ies) removed by Stephane Sire
- * Removed ReadHandler and WriteHandler
+ *
*/
#ifdef __GNUG__
@@ -37,7 +37,7 @@ static int Inited = 0;
/*?nodoc?*/
void
-IvlFilDes :: Use (int fd)
+IvlFd :: Use (int fd)
{
if (fd < 0)
return;
@@ -52,7 +52,7 @@ IvlFilDes :: Use (int fd)
/*?nodoc?*/
void
-IvlFilDes :: Unuse (int fd)
+IvlFd :: Unuse (int fd)
{
if (fd < 0)
return;
@@ -62,20 +62,20 @@ IvlFilDes :: Unuse (int fd)
/*?nodoc?*/
char*
-IvlFilDes :: StrRepr (char* buf)
+IvlFd :: StrRepr (char* buf)
{
sprintf (buf, "%d", Fd);
return buf;
}
-/*?class IvlFilDes
+/*?class IvlFd
This class implements objects representing Unix file descriptors.
-When the associated file descriptor is -1, the \typ{IvlFilDes} is said to be closed,
+When the associated file descriptor is -1, the \typ{IvlFd} is said to be closed,
else it is said to be opened.
Because several objects of this class can refer to the same file descriptor,
the destructor closes the file descriptor only if it is the last object referring to this file descriptor.
This is implemented with the help of a reference count, the overloading of \fun{operator =}
-and the definition of the constructor \fun{IvlFilDes(const IvlFilDes\&)}.
+and the definition of the constructor \fun{IvlFd(const IvlFd\&)}.
All member functions described here are inline for maximum efficiency.
?*/
@@ -84,38 +84,32 @@ All member functions described here are inline for maximum efficiency.
/*?
Construct a closed file descriptor.
?*/
-IvlFilDes :: IvlFilDes ()
+IvlFd :: IvlFd ()
{ }
/*?
Construct an open file descriptor for the Unix file descriptor \var{fd}.
-In particular, this makes it possible to pass an integer where a \typ{IvlFilDes} is normally expected.
+In particular, this makes it possible to pass an integer where a \typ{IvlFd} is normally expected.
This is most useful when using Unix file descriptors.
?*/
-IvlFilDes :: IvlFilDes (int fd)
+IvlFd :: IvlFd (int fd)
{ }
/*?
-This conversion operator makes it possible to pass a \typ{IvlFilDes} argument where
-an integer is expected. This is most useful for system calls.
+This conversion operator makes it possible to pass a \typ{IvlFd} argument where
+an integer file descriptor is expected. This is most useful for system calls.
?*/
int
-IvlFilDes :: operator int ()
+IvlFd :: operator int ()
{ }
-/*?
-Return the Unix file descriptor, or -1 if it is closed.
-?*/
-int
-IvlFilDes :: FilDes ()
-{ }
/*?
Open the object on file descriptor \var{fd}.
If it was already opened, it is closed first.
?*/
void
-IvlFilDes :: Open (int fd)
+IvlFd :: Open (int fd)
{ }
/*?
@@ -124,14 +118,14 @@ only if it was the last reference to it.
\fun{Close} is automatically called by the destructor.
?*/
void
-IvlFilDes :: Close ()
+IvlFd :: Close ()
{ }
/*?
Return true if the object is opened, false else.
?*/
bool
-IvlFilDes :: Opened ()
+IvlFd :: Opened ()
{ }
/*?
@@ -140,7 +134,7 @@ This is the Unix \fun{read} system call.
For efficiency, this function does not test whether the file descriptor is opened.
?*/
int
-IvlFilDes :: Read (byte* b, int n)
+IvlFd :: Read (byte* b, int n)
{ }
/*?
@@ -149,13 +143,13 @@ This is the Unix \fun{write} system call.
For efficiency, this function does not test whether the file descriptor is opened.
?*/
int
-IvlFilDes :: Write (byte* b, int n)
+IvlFd :: Write (byte* b, int n)
{ }
#endif /* DOC */
/*?class IvlChannel
-A \typ{IvlChannel} is basically a file descriptor, with more strict semantics than a \typ{IvlFilDes}.
+A \typ{IvlChannel} is basically a file descriptor, with more strict semantics than a \typ{IvlFd}.
A channel is immutable: once initialized, it cannot change its file descriptor.
It has a mode, of type \typ{^{IOMODE}}, with possible values
\var{IONone}, \var{IORead}, \var{IOWrite}, \var{IOReadWrite},
@@ -327,7 +321,7 @@ IvlChannel :: Read (byte* b, int n)
{ }
/*?
-The Unix \fun{read} and \fun{write} system calls, as in class \typ{IvlFilDes}.
+The Unix \fun{read} and \fun{write} system calls, as in class \typ{IvlFd}.
?*/
int
IvlChannel :: Write (byte* b, int n)