summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog-97a28
-rw-r--r--README2
-rw-r--r--VERSION2
-rw-r--r--ace/ACE.cpp8
-rw-r--r--ace/Connector.cpp7
-rw-r--r--ace/Handle_Set.cpp13
-rw-r--r--ace/IOStream.cpp7
-rw-r--r--ace/IOStream.h158
-rw-r--r--ace/IOStream_T.cpp122
-rw-r--r--ace/IOStream_T.h201
-rw-r--r--ace/IOStream_T.i124
-rw-r--r--ace/Log_Msg.cpp4
-rw-r--r--ace/README1
-rw-r--r--ace/SPIPE_Addr.h1
-rw-r--r--ace/config-linux-lxpthreads.h1
-rw-r--r--ace/config-linux-pthread.h1
-rw-r--r--ace/config-linux.h1
-rw-r--r--examples/Connection/blocking/SPIPE-acceptor.cpp2
-rw-r--r--examples/Threads/process_manager.cpp1
19 files changed, 391 insertions, 293 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a
index 3960d9c02f8..1ec4a7fd89a 100644
--- a/ChangeLog-97a
+++ b/ChangeLog-97a
@@ -1,3 +1,31 @@
+Sun Jun 22 09:58:36 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * Released version 4.2.9 for testing.
+
+ * ace/Log_Msg.cpp (open): Changed the use of ACE_LOG_MSG-> within
+ the open() method to use this-> in order to avoid deadlocks.
+ Thanks to Per Andersson for reporting this.
+
+ * ace/ACE.cpp: Changed the use of __SVR4 and __unix to sparc and
+ unix to work better with various UNIX environments. Thanks to
+ Michael R. MacFaden <mrm@cisco.com> for these changes.
+
+ * ace/Handle_Set.cpp (count_bits): Added special code to handle
+ the case where fdmask is typedef'd as a long rather than an int.
+ Thanks to Eric Newton <ecn@smart.net> and James Johnson for
+ reporting this.
+
+ * ace/IOStream.h: Changed the name of QuotedString to
+ ACE_Quoted_String to be consistent with the ACE naming scheme.
+ Thanks to James Johnson for suggesting this.
+
+ * ace/IOStream_T.i: Added this new file to split off the inlined
+ code from the header file.
+
+ * ace/ACE.cpp (terminate_process): Remove the
+ ACE_UNUSED_ARG(signum) from terminate_process(). Thanks to Wei
+ Chiang for reporting this.
+
Sun Jun 22 17:19:18 1997 David L. Levine <levine@cs.wustl.edu>
* examples/Threads/process_manager.cpp (main): replaced call to
diff --git a/README b/README
index 213b8969ceb..ecc6144dcc3 100644
--- a/README
+++ b/README
@@ -394,7 +394,7 @@ Gonzalo Diethelm <gonzo@ing.puc.cl>
Raj <raj@itd.ssb.com>
Darrin <darrin@jeeves.net>
Steve Weismuller <spweismu@rsoc.rockwell.com>
-Eric C. Newton <ecn@clark.net>
+Eric C. Newton <ecn@smart.net>
Andres Kruse <kruse@cern.ch>
Ramesh Nagabushnam <rcn@nynexst.com>
Antonio Tortorici <antonio@rh0011.roma.tlsoft.it>
diff --git a/VERSION b/VERSION
index 85049d4bdae..5febdefd9c0 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-This is ACE version 4.2.9, released Sun Jun 22 10:01:30 CDT 1997.
+This is ACE version 4.2.9, released Sun Jun 22 17:33:01 CDT 1997.
If you have any problems with ACE, please send email to Douglas
C. Schmidt (schmidt@cs.wustl.edu).
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index f58ea0e105f..2d8143ebcf1 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -1564,11 +1564,11 @@ int
ACE::count_interfaces (ACE_HANDLE handle,
size_t &how_many)
{
-#if defined(__SVR4)
+#if defined (sparc)
if (ACE_OS::ioctl (handle, SIOCGIFNUM, (caddr_t) &how_many) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "ACE::get_ip_interfaces:ioctl - SIOCGIFNUM failed"), -1);
return 0;
-#elif defined (__unix)
+#elif defined (unix)
// BSD compatible OS: HP UX, AIX, SunOS 4.x perform some ioctls to
// retrieve ifconf list of ifreq structs no SIOCGIFNUM on SunOS 4.x,
// so use guess and scan algorithm
@@ -1629,9 +1629,9 @@ ACE::get_handle (void)
{
// Solaris 2.x
ACE_HANDLE handle = ACE_INVALID_HANDLE;
-#if defined(__SVR4)
+#if defined (sparc)
handle = ACE_OS::open ("/dev/udp", O_RDONLY);
-#elif defined(__unix)
+#elif defined (unix)
// BSD compatible OS: HP UX, AIX, SunOS 4.x
handle = ACE_OS::socket (PF_INET, SOCK_DGRAM, 0);
#endif /* __SVR4 */
diff --git a/ace/Connector.cpp b/ace/Connector.cpp
index 18514f72494..2272964a4ee 100644
--- a/ace/Connector.cpp
+++ b/ace/Connector.cpp
@@ -580,8 +580,11 @@ ACE_Connector<SH, PR_CO_2>::info (char **strp, size_t length) const
else if (addr.addr_to_string (addr_str, sizeof addr) == -1)
return -1;
- ACE_OS::sprintf (buf, "%s\t %s %s",
- "ACE_Connector", addr_str, "# connector factory\n");
+ ACE_OS::sprintf (buf,
+ "%s\t %s %s",
+ "ACE_Connector",
+ addr_str,
+ "# connector factory\n");
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
return -1;
diff --git a/ace/Handle_Set.cpp b/ace/Handle_Set.cpp
index e146368ca07..90e612488f0 100644
--- a/ace/Handle_Set.cpp
+++ b/ace/Handle_Set.cpp
@@ -78,19 +78,17 @@ ACE_Handle_Set::ACE_Handle_Set (const ACE_FD_SET_TYPE &fd_mask)
// Counts the number of bits enabled in N. Uses a table lookup to
// speed up the count.
-#if 0
+#if defined (ACE_HAS_LONG_FDMASK)
// If there are platforms where fd_mask isn't typedef'd to "int" we'll
-// have to use the following code. OS_FDMASK_TYPE is set in the
-// config*.h file to match whatever the OS has decided it should be.
-// For the Alpha, that is "int", for Linux it is "u_long."
+// have to use the following code.
int
-ACE_Handle_Set::count_bits (OS_FDMASK_TYPE n) const
+ACE_Handle_Set::count_bits (u_long n) const
{
ACE_TRACE ("ACE_Handle_Set::count_bits");
int rval = 0;
- for (int i = 0; i < sizeof (u_long); ++i)
+ for (int i = 0; i < sizeof (u_long); i++)
{
rval += ACE_Handle_Set::nbits_[n & 0xff];
n >>= 8;
@@ -98,7 +96,7 @@ ACE_Handle_Set::count_bits (OS_FDMASK_TYPE n) const
return rval;
}
-#endif /* 0 */
+#else
int
ACE_Handle_Set::count_bits (u_long n) const
@@ -109,6 +107,7 @@ ACE_Handle_Set::count_bits (u_long n) const
+ ACE_Handle_Set::nbits_[(n >> 16) & 0xff]
+ ACE_Handle_Set::nbits_[(n >> 24) & 0xff]);
}
+#endif /* ACE_HAS_LONG_FDMASK */
// Synchronize the underlying FD_SET with the MAX_FD and the SIZE.
diff --git a/ace/IOStream.cpp b/ace/IOStream.cpp
index 4737cf6318a..13c2e0c9520 100644
--- a/ace/IOStream.cpp
+++ b/ace/IOStream.cpp
@@ -83,9 +83,14 @@
// function will be invoked by the first >>. Since it returns
// a myiostream&, the second >> will be invoked as desired. */
+ACE_HANDLE
+ACE_Streambuf::get_handle (void)
+{
+ return 0;
+}
ACE_Time_Value *
-ACE_Streambuf::recv_timeout (ACE_Time_Value * tv)
+ACE_Streambuf::recv_timeout (ACE_Time_Value *tv)
{
ACE_Time_Value * rval = recv_timeout_;
if (tv)
diff --git a/ace/IOStream.h b/ace/IOStream.h
index 681de37f6ac..9a6c9eba92a 100644
--- a/ace/IOStream.h
+++ b/ace/IOStream.h
@@ -10,14 +10,10 @@
// IOStream.h
//
// = AUTHOR
-// James CE Johnson <jcej@lads.com>
-//
-// = COAUTHOR
-// Jim Crossley <jim@lads.com>
+// James CE Johnson <jcej@lads.com> and Jim Crossley <jim@lads.com>
//
// ============================================================================
-
#if !defined (ACE_IOSTREAM_H)
#define ACE_IOSTREAM_H
@@ -35,31 +31,28 @@ typedef CString ACE_IOStream_String;
#include /**/ <String.h>
typedef String ACE_IOStream_String;
#endif /* ACE_WIN32 */
-#endif /* ACE_HAS_STRING_CLASS */
-
-#if defined (ACE_HAS_STRING_CLASS)
#if defined (DIGITAL_UNIX) && defined (DEC_CXX)
#include /**/ <stl_macros>
#endif /* DIGITAL_UNIX && DEC_CXX */
-class QuotedString : public ACE_IOStream_String
+class ACE_Quoted_String : public ACE_IOStream_String
{
public:
- inline QuotedString (void) { *this = ""; }
- inline QuotedString (const char * c) { *this = ACE_IOStream_String (c); }
- inline QuotedString (const ACE_IOStream_String& s) { *this = s; }
- inline QuotedString& operator= (const ACE_IOStream_String& s)
+ inline ACE_Quoted_String (void) { *this = ""; }
+ inline ACE_Quoted_String (const char *c) { *this = ACE_IOStream_String (c); }
+ inline ACE_Quoted_String (const ACE_IOStream_String &s) { *this = s; }
+ inline ACE_Quoted_String &operator= (const ACE_IOStream_String& s)
{
- return (QuotedString&) ACE_IOStream_String::operator= (s);
+ return (ACE_Quoted_String &) ACE_IOStream_String::operator= (s);
}
- inline QuotedString & operator = (const char c) {
- return (QuotedString&) ACE_IOStream_String::operator= (c);
+ inline ACE_Quoted_String &operator = (const char c) {
+ return (ACE_Quoted_String &) ACE_IOStream_String::operator= (c);
}
- inline QuotedString & operator = (const char* c) {
- return (QuotedString&) ACE_IOStream_String::operator= (c);
+ inline ACE_Quoted_String &operator = (const char *c) {
+ return (ACE_Quoted_String &) ACE_IOStream_String::operator= (c);
}
- inline bool operator < (const QuotedString& s) const {
+ inline bool operator < (const ACE_Quoted_String &s) const {
return *(ACE_IOStream_String *) this < (ACE_IOStream_String) s;
}
#if defined (ACE_WIN32)
@@ -69,8 +62,6 @@ public:
#endif /* ACE_HAS_STRING_CLASS */
-///////////////////////////////////////////////////////////////////////////
-
class ACE_Export ACE_Streambuf : public streambuf
// = TITLE
// Create your custom streambuf by providing and ACE_*_Stream
@@ -141,43 +132,50 @@ public:
// providing separate read/write buffers, it is up to us to manage
// their memory.
- ACE_Time_Value * recv_timeout( ACE_Time_Value * tv = NULL );
+ ACE_Time_Value *recv_timeout (ACE_Time_Value *tv = NULL);
// Get the current Time_Value pointer and provide a new one.
- char * reset_put_buffer(char * newBuffer = NULL, u_int _streambuf_size = 0, u_int _pptr = 0 );
- // Use this to allocate a new/different buffer for put operations. If you
- // do not provide a buffer pointer, one will be allocated. That is the
- // preferred method. If you do provide a buffer, the size must match that
- // being used by the get buffer.
- // If successful, you will receive a pointer to the current put buffer.
- // It is your responsibility to delete this memory when you are done with it.
-
- u_int put_avail(void);
+ char *reset_put_buffer (char *newBuffer = NULL,
+ u_int _streambuf_size = 0,
+ u_int _pptr = 0 );
+ // Use this to allocate a new/different buffer for put operations.
+ // If you do not provide a buffer pointer, one will be allocated.
+ // That is the preferred method. If you do provide a buffer, the
+ // size must match that being used by the get buffer. If
+ // successful, you will receive a pointer to the current put buffer.
+ // It is your responsibility to delete this memory when you are done
+ // with it.
+
+ u_int put_avail (void);
// Return the number of bytes to be 'put' onto the stream media.
// pbase + put_avail = pptr
- char * reset_get_buffer(char * newBuffer = NULL, u_int _streambuf_size = 0, u_int _gptr = 0, u_int _egptr = 0 );
- // Use this to allocate a new/different buffer for get operations. If you
- // do not provide a buffer pointer, one will be allocated. That is the
- // preferred method. If you do provide a buffer, the size must match that
- // being used by the put buffer.
- // If successful, you will receive a pointer to the current get buffer.
- // It is your responsibility to delete this memory when you are done with it.
-
- u_int get_waiting(void);
- // Return the number of bytes not yet gotten.
- // eback + get_waiting = gptr
- //
- u_int get_avail(void);
- // Return the number of bytes in the get area (includes some already gotten);
- // eback + get_avail = egptr
- //
-
- u_int streambuf_size(void);
+ char *reset_get_buffer (char *newBuffer = NULL,
+ u_int _streambuf_size = 0,
+ u_int _gptr = 0,
+ u_int _egptr = 0);
+ // Use this to allocate a new/different buffer for get operations.
+ // If you do not provide a buffer pointer, one will be allocated.
+ // That is the preferred method. If you do provide a buffer, the
+ // size must match that being used by the put buffer. If
+ // successful, you will receive a pointer to the current get buffer.
+ // It is your responsibility to delete this memory when you are done
+ // with it.
+
+ u_int get_waiting (void);
+ // Return the number of bytes not yet gotten. eback + get_waiting =
+ // gptr
+
+ u_int get_avail (void);
+ // Return the number of bytes in the get area (includes some already
+ // gotten); eback + get_avail = egptr
+
+ u_int streambuf_size (void);
// Query the streambuf for the size of it's buffers.
protected:
- ACE_Streambuf (u_int streambuf_size, int io_mode);
+ ACE_Streambuf (u_int streambuf_size,
+ int io_mode);
virtual int sync (void);
// Sync both input and output. See syncin/syncout below for
@@ -190,9 +188,9 @@ protected:
// The overflow function receives the character which caused the
// overflow.
- void reset_base(void);
- // Resets the base() pointer and streambuf mode. This is
- // used internally when get/put buffers are allocatd.
+ void reset_base (void);
+ // Resets the base() pointer and streambuf mode. This is used
+ // internally when get/put buffers are allocatd.
protected:
// = Two pointer sets for manipulating the read/write areas.
@@ -215,19 +213,19 @@ protected:
// iostream.
const u_int streambuf_size_;
- // This defines the size of the input and output buffers. It can
- // be set by the object constructor.
+ // This defines the size of the input and output buffers. It can be
+ // set by the object constructor.
- ACE_Time_Value recv_timeout_value_;
- ACE_Time_Value * recv_timeout_;
+ ACE_Time_Value recv_timeout_value_;
+ ACE_Time_Value *recv_timeout_;
// We want to allow the user to provide Time_Value pointers to
// prevent infinite blocking while waiting to receive data.
int syncin (void);
// syncin is called when the input needs to be synced with the
// source file. In a filebuf, this results in the seek() system
- // call being used. We can't do that on socket-like connections,
- // so this does basically nothing. That's safe because we have a
+ // call being used. We can't do that on socket-like connections, so
+ // this does basically nothing. That's safe because we have a
// separate read buffer to maintain the already-read data. In a
// filebuf, the single common buffer is used forcing the seek()
// call.
@@ -245,24 +243,31 @@ protected:
// underflow. It will attempt to fill the read buffer from the
// peer.
- virtual int get_one_byte ( );
+ virtual int get_one_byte (void);
// Used by fillbuf and others to get exactly one byte from the peer.
// recv_n is used to be sure we block until something is available.
// It is virtual because we really need to override it for
// datagram-derived objects.
- virtual ssize_t send ( char * buf, ssize_t len ) = 0;
- virtual ssize_t recv ( char * buf, ssize_t len, ACE_Time_Value * tv = NULL ) = 0;
- virtual ssize_t recv ( char * buf, ssize_t len, int flags, ACE_Time_Value * tv = NULL ) = 0;
- virtual ssize_t recv_n( char * buf, ssize_t len, int flags = 0, ACE_Time_Value * tv = NULL ) = 0;
- // Stream connections and "unconnected connections" (ie -- datagrams)
- // need to work just a little differently. We derive custom
- // Streambuf objects for them and provide these functions at that time.
-
- virtual ACE_HANDLE get_handle(void)
- {
- return 0;
- }
+ virtual ssize_t send (char *buf,
+ ssize_t len) = 0;
+ virtual ssize_t recv (char *buf,
+ ssize_t len,
+ ACE_Time_Value *tv = NULL) = 0;
+ virtual ssize_t recv (char *buf,
+ ssize_t len,
+ int flags,
+ ACE_Time_Value *tv = NULL) = 0;
+ virtual ssize_t recv_n (char *buf,
+ ssize_t len,
+ int flags = 0,
+ ACE_Time_Value *tv = NULL) = 0;
+ // Stream connections and "unconnected connections" (ie --
+ // datagrams) need to work just a little differently. We derive
+ // custom Streambuf objects for them and provide these functions at
+ // that time.
+
+ virtual ACE_HANDLE get_handle (void);
};
///////////////////////////////////////////////////////////////////////////
@@ -280,8 +285,6 @@ typedef ostream& (*__omanip_)(ostream&);
//
// virtual MT& operator<<(ios& (*func)(ios&)) { (*func)(*this); return *this; }
-
-
// This macro defines the get operator for class MT into datatype DT.
// We will use it below to quickly override most (all?) iostream get
// operators. Notice how the ipfx() and isfx() functions are used.
@@ -351,7 +354,6 @@ typedef ostream& (*__omanip_)(ostream&);
inline virtual MT& operator<<(__omanip_ func) CODE2 \
inline virtual MT& operator<<(__manip_ func) CODE2
-
#if defined (ACE_LACKS_SIGNED_CHAR)
#define GET_FUNC_SET1(MT,CODE,CODE2) GET_FUNC_SET0(MT,CODE,CODE2)
#define PUT_FUNC_SET1(MT,CODE,CODE2) PUT_FUNC_SET0(MT,CODE,CODE2)
@@ -374,17 +376,11 @@ typedef ostream& (*__omanip_)(ostream&);
#define PUT_FUNC_SET(MT) PUT_FUNC_SET1(MT,PUT_CODE,PUT_MANIP_CODE)
#define GETPUT_FUNC_SET(MT) GET_FUNC_SET(MT) PUT_FUNC_SET(MT)
-
#define GET_SIG_SET(MT) GET_FUNC_SET1(MT,= 0;,= 0;)
#define PUT_SIG_SET(MT) PUT_FUNC_SET1(MT,= 0;,= 0;)
#define GETPUT_SIG_SET(MT) GET_SIG_SET(MT) PUT_SIG_SET(MT)
-
-///////////////////////////////////////////////////////////////////////////
-
// Include the templates here.
#include "ace/IOStream_T.h"
-
#endif /* !ACE_LACKS_ACE_IOSTREAM */
-
#endif /* ACE_IOSTREAM_H */
diff --git a/ace/IOStream_T.cpp b/ace/IOStream_T.cpp
index 813dc5a7e7f..8cb37b90bd7 100644
--- a/ace/IOStream_T.cpp
+++ b/ace/IOStream_T.cpp
@@ -7,16 +7,20 @@
#define ACE_BUILD_DLL
#include "ace/IOStream_T.h"
-///////////////////////////////////////////////////////////////////////////
-
+#if !defined (__ACE_INLINE__)
+#include "ace/IOStream_T.i"
+#endif /* !__ACE_INLINE__ */
// We will be given a STREAM by the iostream object which creates us.
// See the ACE_IOStream_T template for how that works. Like other
// streambuf objects, we can be input-only, output-only or both.
template <class STREAM>
-ACE_Streambuf_T<STREAM>::ACE_Streambuf_T (STREAM *peer, u_int streambuf_size, int io_mode)
- : ACE_Streambuf (streambuf_size, io_mode), peer_ (peer)
+ACE_Streambuf_T<STREAM>::ACE_Streambuf_T (STREAM *peer,
+ u_int streambuf_size,
+ int io_mode)
+ : ACE_Streambuf (streambuf_size, io_mode),
+ peer_ (peer)
{
// A streambuf allows for unbuffered IO where every character is
// read as requested and written as provided. To me, this seems
@@ -33,19 +37,15 @@ ACE_Streambuf_T<STREAM>::ACE_Streambuf_T (STREAM *peer, u_int streambuf_size, in
#if !defined (ACE_LACKS_LINEBUFFERED_STREAMBUF)
this->linebuffered (0);
#endif /* ! ACE_LACKS_LINEBUFFERED_STREAMBUF */
-
}
-
-///////////////////////////////////////////////////////////////////////////
-
-
// The typical constructor. This will initiailze your STREAM and then
// setup the iostream baseclass to use a custom streambuf based on
// STREAM.
template <class STREAM>
-ACE_IOStream_T<STREAM>::ACE_IOStream_T (STREAM & stream, u_int streambuf_size)
+ACE_IOStream_T<STREAM>::ACE_IOStream_T (STREAM &stream,
+ u_int streambuf_size)
: iostream (streambuf_ = new ACE_Streambuf_T<STREAM> ((STREAM *) this, streambuf_size)),
STREAM (stream)
{
@@ -78,11 +78,11 @@ ACE_IOStream_T<STREAM>::close (void)
}
template <class STREAM> ACE_IOStream_T<STREAM> &
-ACE_IOStream_T<STREAM>::operator>> (ACE_Time_Value *& tv)
+ACE_IOStream_T<STREAM>::operator>> (ACE_Time_Value *&tv)
{
- ACE_Time_Value * old_tv = this->streambuf_->recv_timeout (tv);
- tv = old_tv;
- return *this;
+ ACE_Time_Value *old_tv = this->streambuf_->recv_timeout (tv);
+ tv = old_tv;
+ return *this;
}
#if defined (ACE_HAS_STRING_CLASS)
@@ -92,84 +92,84 @@ ACE_IOStream_T<STREAM>::operator>> (ACE_Time_Value *& tv)
// our own here, we may not get what we want.
template <class STREAM> ACE_IOStream_T<STREAM> &
-ACE_IOStream_T<STREAM>::operator>> (ACE_IOStream_String & v)
+ACE_IOStream_T<STREAM>::operator>> (ACE_IOStream_String &v)
{
if (ipfx0 ())
- {
- char c;
- iostream::operator>> (c);
+ {
+ char c;
+ iostream::operator>> (c);
- for (v = c ; this->get (c) && !isspace (c) ; v += c)
- continue;
- }
+ for (v = c; this->get (c) && !isspace (c); v += c)
+ continue;
+ }
isfx ();
return *this;
}
-
template <class STREAM> ACE_IOStream_T<STREAM> &
-ACE_IOStream_T<STREAM>::operator<< (ACE_IOStream_String & v)
+ACE_IOStream_T<STREAM>::operator<< (ACE_IOStream_String &v)
{
if (opfx ())
{
#if defined (ACE_WIN32)
- for (int i = 0 ; i < v.GetLength () ; ++i)
+ for (int i = 0; i < v.GetLength (); ++i)
#else
- for (u_int i = 0 ; i < (u_int) v.length () ; ++i)
-#endif
- this->put (v[i]);
+ for (u_int i = 0; i < (u_int) v.length (); ++i)
+#endif /* ACE_WIN32 */
+ this->put (v[i]);
}
osfx ();
return *this;
}
+// A more clever put operator for strings that knows how to deal with
+// quoted strings containing back-quoted quotes.
-
-//////////////////////////////////////////////////////////////////
-// A more clever put operator for strings that knows how to
-// deal with quoted strings containing back-quoted quotes.
-//
template <class STREAM> STREAM &
-operator>> (STREAM & stream, QuotedString & str)
+operator>> (STREAM &stream,
+ ACE_Quoted_String &str)
{
- char c;
+ char c;
+
+ if (!(stream >> c)) // eat space up to the first char
+ // stream.set (ios::eofbit|ios::failbit);
+ return stream;
+
+ str = ""; // Initialize the string
- if (! (stream >> c)) // eat space up to the first char
- // stream.set (ios::eofbit|ios::failbit);
- return stream;
-
- str = ""; // Initialize the string
-
- // if we don't have a quote, append until we see space
- if (c != '"')
- for (str = c ; stream.get (c) && !isspace (c) ; str += c)
- continue;
- else
- for (; stream.get (c) && c != '"' ; str += c)
- if (c == '\\')
- {
- stream.get (c);
- if (c != '"')
- str += '\\';
- }
+ // if we don't have a quote, append until we see space
+ if (c != '"')
+ for (str = c; stream.get (c) && !isspace (c); str += c)
+ continue;
+ else
+ for (; stream.get (c) && c != '"'; str += c)
+ if (c == '\\')
+ {
+ stream.get (c);
+ if (c != '"')
+ str += '\\';
+ }
return stream;
}
template <class STREAM> STREAM &
-operator<< ( STREAM & stream, QuotedString & str)
+operator<< (STREAM &stream,
+ ACE_Quoted_String &str)
{
- stream.put ('"');
- for (u_int i = 0 ; i < str.length () ; ++i)
- {
- if (str[i] == '"')
- stream.put ('\\');
- stream.put (str[i]);
- }
- stream.put ('"');
+ stream.put ('"');
+
+ for (u_int i = 0; i < str.length (); ++i)
+ {
+ if (str[i] == '"')
+ stream.put ('\\');
+ stream.put (str[i]);
+ }
+
+ stream.put ('"');
return stream;
}
diff --git a/ace/IOStream_T.h b/ace/IOStream_T.h
index a654902291f..bbbd1eca755 100644
--- a/ace/IOStream_T.h
+++ b/ace/IOStream_T.h
@@ -10,10 +10,7 @@
// IOStream_T.h
//
// = AUTHOR
-// James CE Johnson <jcej@lads.com>
-//
-// = COAUTHOR
-// Jim Crossley <jim@lads.com>
+// James CE Johnson <jcej@lads.com> and Jim Crossley <jim@lads.com>
//
// = NOTE
// This file should not be #included directly by application code.
@@ -28,58 +25,46 @@
#include "ace/IOStream.h"
#include <iomanip.h>
-///////////////////////////////////////////////////////////////////////////
-
#if defined (ACE_HAS_STRING_CLASS)
-
-template <class STREAM> STREAM & operator>> (STREAM & stream, QuotedString & str);
-template <class STREAM> STREAM & operator<< ( STREAM & stream, QuotedString & str);
-
-#endif // defined (ACE_HAS_STRING_CLASS)
-
-///////////////////////////////////////////////////////////////////////////
+template <class STREAM> STREAM & operator>> (STREAM &stream, ACE_Quoted_String &str);
+template <class STREAM> STREAM & operator<< (STREAM &stream, ACE_Quoted_String &str);
+#endif /* defined (ACE_HAS_STRING_CLASS) */
template <class STREAM>
class ACE_Streambuf_T : public ACE_Streambuf
{
public:
- ACE_Streambuf_T (STREAM * peer, u_int streambuf_size = ACE_STREAMBUF_SIZE, int io_mode = ios::in | ios::out);
+ ACE_Streambuf_T (STREAM *peer,
+ u_int streambuf_size = ACE_STREAMBUF_SIZE,
+ int io_mode = ios::in | ios::out);
// We will be given a STREAM by the iostream object which creates
// us. See the ACE_IOStream_T template for how that works. Like
// other streambuf objects, we can be input-only, output-only or
// both.
- virtual ssize_t send ( char * buf, ssize_t len )
- {
- return peer_->send_n(buf,len);
- }
- virtual ssize_t recv ( char * buf, ssize_t len, ACE_Time_Value * tv = NULL )
- {
- return this->recv( buf, len, 0, tv );
- }
- virtual ssize_t recv ( char * buf, ssize_t len, int flags, ACE_Time_Value * tv = NULL )
- {
- ssize_t rval = peer_->recv(buf,len,flags,tv);
- return rval;
- }
- virtual ssize_t recv_n( char * buf, ssize_t len, int flags = 0, ACE_Time_Value * tv = NULL )
- {
- ssize_t rval = peer_->recv_n(buf,len,flags,tv);
- return rval;
- }
+ virtual ssize_t send (char *buf, ssize_t len);
+
+ virtual ssize_t recv (char *buf,
+ ssize_t len,
+ ACE_Time_Value *tv = NULL);
+
+ virtual ssize_t recv (char *buf,
+ ssize_t len,
+ int flags,
+ ACE_Time_Value * tv = NULL);
+
+ virtual ssize_t recv_n (char *buf,
+ ssize_t len,
+ int flags = 0,
+ ACE_Time_Value *tv = NULL);
protected:
- STREAM * peer_;
- // This will be our ACE_SOCK_Stream or similar object.
+ virtual ACE_HANDLE get_handle (void);
- virtual ACE_HANDLE get_handle(void)
- {
- return peer_ ? peer_->get_handle() : 0 ;
- }
+ STREAM *peer_;
+ // This will be our ACE_SOCK_Stream or similar object.
};
-///////////////////////////////////////////////////////////////////////////
-
template <class STREAM>
class ACE_IOStream_T : public iostream, public STREAM
// = TITLE
@@ -115,7 +100,8 @@ class ACE_IOStream_T : public iostream, public STREAM
// customize only one or two.
{
public:
- ACE_IOStream_T (STREAM & stream, u_int streambuf_size = ACE_STREAMBUF_SIZE);
+ ACE_IOStream_T (STREAM &stream,
+ u_int streambuf_size = ACE_STREAMBUF_SIZE);
ACE_IOStream_T (u_int streambuf_size = ACE_STREAMBUF_SIZE);
// The default constructor. This will initiailze your STREAM and
// then setup the iostream baseclass to use a custom streambuf based
@@ -130,12 +116,12 @@ public:
// function.
#if defined (ACE_HAS_STRING_CLASS)
- virtual ACE_IOStream_T<STREAM> & operator>>(ACE_IOStream_String & v);
+ virtual ACE_IOStream_T<STREAM> &operator>> (ACE_IOStream_String &v);
// A simple string operator. The base iostream has 'em for char*
// but that isn't always the best thing for a String. If we don't
// provide our own here, we may not get what we want.
- virtual ACE_IOStream_T<STREAM> & operator<<(ACE_IOStream_String & v);
+ virtual ACE_IOStream_T<STREAM> &operator<< (ACE_IOStream_String &v);
// The converse of the String put operator.
#endif /* ACE_HAS_STRING_CLASS */
@@ -169,109 +155,64 @@ public:
// Give it a pointer to NULL to block forever.
protected:
-
ACE_Streambuf_T<STREAM> *streambuf_;
- // This is where all of the action takes place. The
- // streambuf_ is the interface to the underlying STREAM.
+ // This is where all of the action takes place. The streambuf_ is
+ // the interface to the underlying STREAM.
private:
- // We move these into the private section so that they cannot
- // be used by the application programmer. This is necessary
- // because streambuf_ will be buffering IO on the STREAM
- // object. If these functions were used in your program,
- // there is a danger of getting the datastream out of sync.
+ // = Private methods.
+
+ // We move these into the private section so that they cannot be
+ // used by the application programmer. This is necessary because
+ // streambuf_ will be buffering IO on the STREAM object. If these
+ // functions were used in your program, there is a danger of getting
+ // the datastream out of sync.
ssize_t send (...);
ssize_t recv (...);
ssize_t send_n (...);
ssize_t recv_n (...);
};
-///////////////////////////////////////////////////////////////////////////
-
template <class STREAM>
class ACE_SOCK_Dgram_SC : public STREAM
-// Datagrams don't have the notion of a "peer". Each send and receive
-// on a datagram can go to a different peer if you want. If you're
-// using datagrams for stream activity, you probably want 'em all to
-// go to (and come from) the same place. That's what this class is
-// for. BTW: 'Dgram_SC' is short for 'Datagram-Self-Contained'.
-// Here, we keep an address object so that we can remember who last
-// sent us data. When we write back, we're then able to write back to
-// that same address.
+ // = TITLE
+ // "Dgram_SC" is short for "Datagram Self-Contained."
+ //
+ // = DESCRIPTION
+ // Datagrams don't have the notion of a "peer". Each send and
+ // receive on a datagram can go to a different peer if you want.
+ // If you're using datagrams for stream activity, you probably
+ // want 'em all to go to (and come from) the same place. That's
+ // what this class is for. Here, we keep an address object so
+ // that we can remember who last sent us data. When we write
+ // back, we're then able to write back to that same address.
{
-protected:
- ACE_INET_Addr peer_;
-
public:
- ACE_SOCK_Dgram_SC (void)
- {
- }
-
- ACE_SOCK_Dgram_SC (STREAM &source, ACE_INET_Addr &dest)
- : STREAM (source), peer_ (dest)
- {
- }
-
- inline ssize_t send_n (char *buf, ssize_t len)
- {
- return STREAM::send (buf, len, peer_);
- }
-
- inline ssize_t recv (char * buf, ssize_t len, ACE_Time_Value * tv = NULL)
- {
- return recv (buf, len, 0, tv);
- }
-
- inline ssize_t recv (char * buf, ssize_t len, int flags, ACE_Time_Value * tv = NULL)
- {
- if (tv != 0)
- {
- ACE_HANDLE handle = this->get_handle ();
- ACE_Handle_Set handle_set;
-
- handle_set.set_bit (handle);
-
- switch (ACE_OS::select (int (handle) + 1,
- (fd_set *) handle_set, // read_fds.
- (fd_set *) 0, // write_fds.
- (fd_set *) 0, // exception_fds.
- tv))
- {
- case 0:
- errno = ETIME;
- case -1:
- return -1;
- default:
- ; // Do the 'recv' below
- }
- }
-
- int rval = STREAM::recv (buf, len, peer_, flags);
-#ifdef WIN32
- if (rval == SOCKET_ERROR)
- if (WSAGetLastError() == WSAEMSGSIZE)
- if (flags & MSG_PEEK)
- rval = len;
-#endif
-
- return rval < len ? rval : len;
- }
- inline ssize_t recv_n (char * buf,
- ssize_t len, int flags = 0,
- ACE_Time_Value * tv = NULL)
- {
- int rval = this->recv (buf, len, flags, tv);
- return rval;
- }
-
- inline int get_remote_addr (ACE_INET_Addr &addr) const
- {
- addr = peer_;
- return 0;
- }
+ ACE_SOCK_Dgram_SC (void);
+ ACE_SOCK_Dgram_SC (STREAM &source,
+ ACE_INET_Addr &dest);
+ ssize_t send_n (char *buf, ssize_t len);
+ ssize_t recv (char *buf,
+ ssize_t len,
+ ACE_Time_Value *tv = NULL);
+ ssize_t recv (char *buf,
+ ssize_t len,
+ int flags,
+ ACE_Time_Value *tv = NULL);
+ ssize_t recv_n (char *buf,
+ ssize_t len,
+ int flags = 0,
+ ACE_Time_Value *tv = NULL);
+ int get_remote_addr (ACE_INET_Addr &addr) const;
+protected:
+ ACE_INET_Addr peer_;
};
+#if defined (__ACE_INLINE__)
+#include "ace/IOStream_T.i"
+#endif /* __ACE_INLINE__ */
+
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "ace/IOStream_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
diff --git a/ace/IOStream_T.i b/ace/IOStream_T.i
new file mode 100644
index 00000000000..59617a3475f
--- /dev/null
+++ b/ace/IOStream_T.i
@@ -0,0 +1,124 @@
+/* -*- C++ -*- */
+
+template <class STREAM> ssize_t
+ACE_Streambuf_T<STREAM>::send (char *buf, ssize_t len)
+{
+ return peer_->send_n (buf,len);
+}
+
+template <class STREAM> ssize_t
+ACE_Streambuf_T<STREAM>::recv (char *buf,
+ ssize_t len,
+ ACE_Time_Value *tv)
+{
+ return this->recv (buf, len, 0, tv);
+}
+
+template <class STREAM> ssize_t
+ACE_Streambuf_T<STREAM>::recv (char *buf,
+ ssize_t len,
+ int flags,
+ ACE_Time_Value * tv)
+{
+ ssize_t rval = peer_->recv (buf, len, flags, tv);
+ return rval;
+}
+
+template <class STREAM> ssize_t
+ACE_Streambuf_T<STREAM>::recv_n (char *buf,
+ ssize_t len,
+ int flags = 0,
+ ACE_Time_Value *tv)
+{
+ ssize_t rval = peer_->recv_n (buf, len, flags, tv);
+ return rval;
+}
+
+template <class STREAM> ACE_HANDLE
+ACE_Streambuf_T<STREAM>::get_handle (void)
+{
+ return peer_ ? peer_->get_handle () : 0;
+}
+
+template <class STREAM> ACE_INLINE
+ACE_SOCK_Dgram_SC<STREAM>::ACE_SOCK_Dgram_SC (void)
+{
+}
+
+template <class STREAM> ACE_INLINE
+ACE_SOCK_Dgram_SC<STREAM>::ACE_SOCK_Dgram_SC (STREAM &source,
+ ACE_INET_Addr &dest)
+ : STREAM (source),
+ peer_ (dest)
+{
+}
+
+template <class STREAM> ACE_INLINE ssize_t
+ACE_SOCK_Dgram_SC<STREAM>::send_n (char *buf,
+ ssize_t len)
+{
+ return STREAM::send (buf, len, peer_);
+}
+
+template <class STREAM> ACE_INLINE ssize_t
+ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
+ ssize_t len,
+ ACE_Time_Value *tv)
+{
+ return recv (buf, len, 0, tv);
+}
+
+template <class STREAM> ACE_INLINE ssize_t
+ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
+ ssize_t len,
+ int flags,
+ ACE_Time_Value *tv)
+{
+ if (tv != 0)
+ {
+ ACE_HANDLE handle = this->get_handle ();
+ ACE_Handle_Set handle_set;
+
+ handle_set.set_bit (handle);
+
+ switch (ACE_OS::select (int (handle) + 1,
+ (fd_set *) handle_set, // read_fds.
+ (fd_set *) 0, // write_fds.
+ (fd_set *) 0, // exception_fds.
+ tv))
+ {
+ case 0:
+ errno = ETIME;
+ case -1:
+ return -1;
+ default:
+ ; // Do the 'recv' below
+ }
+ }
+
+ int rval = STREAM::recv (buf, len, peer_, flags);
+#if defined (ACE_WIN32)
+ if (rval == SOCKET_ERROR)
+ if (::WSAGetLastError () == WSAEMSGSIZE)
+ if (ACE_BIT_ENTABLED (flags, MSG_PEEK))
+ rval = len;
+#endif /* ACE_WIN32 */
+ return rval < len ? rval : len;
+}
+
+template <class STREAM> ACE_INLINE ssize_t
+ACE_SOCK_Dgram_SC<STREAM>::recv_n (char *buf,
+ ssize_t len,
+ int flags = 0,
+ ACE_Time_Value *tv)
+{
+ int rval = this->recv (buf, len, flags, tv);
+ return rval;
+}
+
+template <class STREAM> ACE_INLINE int
+ACE_SOCK_Dgram_SC<STREAM>::get_remote_addr (ACE_INET_Addr &addr) const
+{
+ addr = peer_;
+ return 0;
+}
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 17cc75263b3..7527a69d873 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -583,8 +583,8 @@ ACE_Log_Msg::open (const char *prog_name,
{
ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::OSTREAM);
// Only set this to cerr if it hasn't already been set.
- if (ACE_LOG_MSG->msg_ostream () == 0)
- ACE_LOG_MSG->msg_ostream (&cerr);
+ if (this->msg_ostream () == 0)
+ this->msg_ostream (&cerr);
}
if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::SILENT))
ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::SILENT);
diff --git a/ace/README b/ace/README
index b95ddf753f7..19c782596c4 100644
--- a/ace/README
+++ b/ace/README
@@ -60,6 +60,7 @@ ACE_HAS_THR_KEYDELETE Platform supports thr_keydelete (e.g,. UNIXWARE)
ACE_HAS_THR_MINSTACK Platform calls thr_minstack() rather than thr_min_stack() (e.g., Tandem).
ACE_HAS_LIMITED_RUSAGE_T The rusage_t structure has only two fields.
ACE_HAS_LONGLONG_T Compiler/platform supports the "long long" datatype.
+ACE_HAS_LONG_FDMASK Compiler/platform has typedef u_long fdmask (e.g., Linux).
ACE_HAS_LONG_MAP_FAILED Platform defines MAP_FAILED as a long constant.
ACE_HAS_MFC Platform supports Microsoft Foundation Classes
ACE_HAS_MSG Platform supports recvmsg and sendmsg
diff --git a/ace/SPIPE_Addr.h b/ace/SPIPE_Addr.h
index 0a758250f0e..372c9ea9ac5 100644
--- a/ace/SPIPE_Addr.h
+++ b/ace/SPIPE_Addr.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/config-linux-lxpthreads.h b/ace/config-linux-lxpthreads.h
index 83dd92b6f2f..44738924863 100644
--- a/ace/config-linux-lxpthreads.h
+++ b/ace/config-linux-lxpthreads.h
@@ -32,6 +32,7 @@
#define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+#define ACE_HAS_LONG_FDMASK
#define ACE_HAS_PENTIUM
#define ACE_HAS_LONGLONG
#define ACE_HAS_STRING_CLASS
diff --git a/ace/config-linux-pthread.h b/ace/config-linux-pthread.h
index 6a4dc8b2fcc..cfbd0095517 100644
--- a/ace/config-linux-pthread.h
+++ b/ace/config-linux-pthread.h
@@ -11,6 +11,7 @@
#define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+#define ACE_HAS_LONG_FDMASK
#define ACE_HAS_PENTIUM
#define ACE_HAS_LONGLONG
#define ACE_HAS_STRING_CLASS
diff --git a/ace/config-linux.h b/ace/config-linux.h
index 802e1fcb300..0ab7c32418a 100644
--- a/ace/config-linux.h
+++ b/ace/config-linux.h
@@ -16,6 +16,7 @@
// ONLY define this if you have config'd multicast into a 2.x kernel.
// If you do anything else, we've never tested it!
#define ACE_HAS_IP_MULTICAST
+#define ACE_HAS_LONG_FDMASK
#define ACE_HAS_PENTIUM
#define ACE_HAS_LONGLONG
diff --git a/examples/Connection/blocking/SPIPE-acceptor.cpp b/examples/Connection/blocking/SPIPE-acceptor.cpp
index c7ec25eb8eb..d4f7348c713 100644
--- a/examples/Connection/blocking/SPIPE-acceptor.cpp
+++ b/examples/Connection/blocking/SPIPE-acceptor.cpp
@@ -15,7 +15,6 @@ Svc_Handler::Svc_Handler (void)
this->mb_.size (BUFSIZ);
}
-
Svc_Handler::~Svc_Handler (void)
{
}
@@ -168,7 +167,6 @@ IPC_Server::svc (void)
#endif /* SPIPE_ACCEPTOR_C */
-
#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
template class ACE_Concurrency_Strategy<Svc_Handler>;
template class ACE_Oneshot_Acceptor<Svc_Handler, ACE_SPIPE_ACCEPTOR>;
diff --git a/examples/Threads/process_manager.cpp b/examples/Threads/process_manager.cpp
index 92d75687458..9715daa6cb3 100644
--- a/examples/Threads/process_manager.cpp
+++ b/examples/Threads/process_manager.cpp
@@ -158,6 +158,7 @@ main (int argc, char *argv[])
ACE_OS::sleep (1);
// Shutdown the child.
+
if (proc_mgr.terminate (pid) == -1)
ACE_ERROR_RETURN ((LM_DEBUG, "(%P|%t) %p\n", "terminate"), 1);