diff options
author | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-06 22:48:32 +0000 |
---|---|---|
committer | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-06 22:48:32 +0000 |
commit | 23c1145590047e66c9db357d6ceb2356a7198881 (patch) | |
tree | b628409c5442a2dff01eb8249264fada59d8a1dd /ace | |
parent | 83dbafe0d09ae8f4ba082512de1a33ef08e4bb9a (diff) | |
download | ATCD-23c1145590047e66c9db357d6ceb2356a7198881.tar.gz |
Changes for pSOS using Diab 4.2a release
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Log_Msg.cpp | 8 | ||||
-rw-r--r-- | ace/Log_Record.cpp | 265 | ||||
-rw-r--r-- | ace/Log_Record.h | 28 | ||||
-rw-r--r-- | ace/OS.cpp | 17 | ||||
-rw-r--r-- | ace/OS.h | 10 | ||||
-rw-r--r-- | ace/OS.i | 96 | ||||
-rw-r--r-- | ace/Parse_Node.cpp | 11 | ||||
-rw-r--r-- | ace/SString.cpp | 46 | ||||
-rw-r--r-- | ace/Stats.cpp | 12 | ||||
-rw-r--r-- | ace/config-WinCE.h | 4 | ||||
-rw-r--r-- | ace/config-psos-diab.h | 29 | ||||
-rw-r--r-- | ace/streams.h | 4 |
12 files changed, 345 insertions, 185 deletions
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp index 6e1e2b7e6e0..2e193b4cf83 100644 --- a/ace/Log_Msg.cpp +++ b/ace/Log_Msg.cpp @@ -551,11 +551,11 @@ ACE_Log_Msg::open (const ASYS_TCHAR *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 (this->msg_ostream () == 0) -#if !defined (ACE_HAS_WINCE) +#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) this->msg_ostream (&cerr); #else - this->msg_ostream (ACE_CE_DEFAULT_LOG_STREAM); -#endif /* !ACE_HAS_WINCE */ + this->msg_ostream (ACE_DEFAULT_LOG_STREAM); +#endif /* ACE_LACKS_IOSTREAM_TOTALLY */ } if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::SILENT)) ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::SILENT); @@ -1078,7 +1078,7 @@ ACE_Log_Msg::log (ACE_Log_Record &log_record, && this->msg_ostream () != 0) log_record.print (ACE_Log_Msg::local_host_, ACE_Log_Msg::flags_, -#if !defined (ACE_HAS_WINCE) +#if ! defined (ACE_LACKS_IOSTREAM_TOTALLY) *this->msg_ostream ()); #else this->msg_ostream ()); diff --git a/ace/Log_Record.cpp b/ace/Log_Record.cpp index d1a8b3d8539..1773e0e5f17 100644 --- a/ace/Log_Record.cpp +++ b/ace/Log_Record.cpp @@ -13,7 +13,7 @@ ACE_RCSID(ace, Log_Record, "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Log_Record) -const ASYS_TCHAR *ACE_Log_Record::priority_names_[] = +const ASYS_TCHAR *ACE_Log_Record::priority_names_[] = { ASYS_TEXT ("<none>"), ASYS_TEXT ("LM_SHUTDOWN"), @@ -43,7 +43,7 @@ ACE_Log_Record::priority (void) const } void -ACE_Log_Record::priority (u_long p) +ACE_Log_Record::priority (u_long p) { ACE_TRACE ("ACE_Log_Record::priority"); this->type_ = p; @@ -63,7 +63,7 @@ ACE_Log_Record::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } -void +void ACE_Log_Record::msg_data (const ASYS_TCHAR *data) { // ACE_TRACE ("ACE_Log_Record::msg_data"); @@ -71,23 +71,23 @@ ACE_Log_Record::msg_data (const ASYS_TCHAR *data) this->round_up (); } -ACE_Log_Record::ACE_Log_Record (ACE_Log_Priority lp, - long ts_sec, - long p) +ACE_Log_Record::ACE_Log_Record (ACE_Log_Priority lp, + long ts_sec, + long p) : length_ (0), - type_ (long (lp)), - time_stamp_ (ts_sec), + type_ (long (lp)), + time_stamp_ (ts_sec), pid_ (p) { // ACE_TRACE ("ACE_Log_Record::ACE_Log_Record"); } -ACE_Log_Record::ACE_Log_Record (ACE_Log_Priority lp, - const ACE_Time_Value &ts, - long p) +ACE_Log_Record::ACE_Log_Record (ACE_Log_Priority lp, + const ACE_Time_Value &ts, + long p) : length_ (0), type_ (long (lp)), - time_stamp_ (ts), + time_stamp_ (ts), pid_ (p) { // ACE_TRACE ("ACE_Log_Record::ACE_Log_Record"); @@ -98,12 +98,12 @@ ACE_Log_Record::round_up (void) { // ACE_TRACE ("ACE_Log_Record::round_up"); // Determine the length of the payload. - int len = (sizeof *this - MAXLOGMSGLEN) + int len = (sizeof *this - MAXLOGMSGLEN) + (ACE_OS::strlen (this->msg_data_) + 1); // Round up to the alignment. - this->length_ = 1 + ((len + ACE_Log_Record::ALIGN_WORDB - 1) - & ~(ACE_Log_Record::ALIGN_WORDB - 1)); + this->length_ = 1 + ((len + ACE_Log_Record::ALIGN_WORDB - 1) + & ~(ACE_Log_Record::ALIGN_WORDB - 1)); } ACE_Log_Record::ACE_Log_Record (void) @@ -115,14 +115,96 @@ ACE_Log_Record::ACE_Log_Record (void) // ACE_TRACE ("ACE_Log_Record::ACE_Log_Record"); } -// Print out the record on the stderr stream with the appropriate -// format. +#if defined (ACE_HAS_WINCE) +int +ACE_Log_Record::format_msg (const ASYS_TCHAR host_name[], + u_long verbose_flag, + CString *msg) +{ + if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE)) + { + time_t now = this->time_stamp_.sec (); + ASYS_TCHAR ctp[26]; // 26 is a magic number... + + if (ACE_OS::ctime_r (&now, ctp, sizeof ctp) == 0) + return -1; + + /* 01234567890123456789012345 */ + /* Wed Oct 18 14:25:36 1989n0 */ + + ctp[19] = '\0'; // NUL-terminate after the time. + ctp[24] = '\0'; // NUL-terminate after the date. + + const ASYS_TCHAR *lhost_name = host_name == + 0 ? ASYS_TEXT ("<local_host>") : host_name; + + msg->Format (ASYS_TEXT ("%s.%d %s@%s@%d@%s@%s"), + ctp + 4, + this->time_stamp_.usec () / 1000, + ctp + 20, + lhost_name, + this->pid_, + ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), + this->msg_data_); + } + else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE)) + msg->Format (ASYS_TEXT ("%s@%s"), + ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), + this->msg_data_); + else + msg->Format (ASYS_TEXT ("%s"), this->msg_data_); + + return 0; +} + -#if !defined (ACE_HAS_WINCE) int ACE_Log_Record::print (const ASYS_TCHAR *host_name, - u_long verbose_flag, - FILE *fp) + u_long verbose_flag, + ACE_CE_Bridge *log_window) +{ + // ACE_TRACE ("ACE_Log_Record::print"); + + CString *msg = new CString (); + + if (this->format_msg (host_name, verbose_flag, msg) != -1) + { + if (log_window == 0) + log_window = ACE_CE_Bridge::get_default_winbridge (); + log_window->write_msg (msg); + return 0; + } + + return -1; +} + +int +ACE_Log_Record::print (const ASYS_TCHAR *host_name, + u_long verbose_flag, + FILE *fp) +{ + int ret = -1; + + CString msg; + + if (this->format_msg (host_name, verbose_flag, &msg) != -1 && + fp != NULL) + { + ret = ACE_OS::fwrite (ACE_MULTIBYTE_STRING (msg), + 1, + msg.GetLength (), + fp); + } + + return ret; +} + +#else /* ! ACE_HAS_WINCE */ + +int +ACE_Log_Record::print (const ASYS_TCHAR *host_name, + u_long verbose_flag, + FILE *fp) { // ACE_TRACE ("ACE_Log_Record::print"); @@ -134,7 +216,7 @@ ACE_Log_Record::print (const ASYS_TCHAR *host_name, ASYS_TCHAR ctp[26]; // 26 is a magic number... if (ACE_OS::ctime_r (&now, ctp, sizeof ctp) == 0) - return -1; + return -1; /* 01234567890123456789012345 */ /* Wed Oct 18 14:25:36 1989n0 */ @@ -142,23 +224,23 @@ ACE_Log_Record::print (const ASYS_TCHAR *host_name, ctp[19] = '\0'; // NUL-terminate after the time. ctp[24] = '\0'; // NUL-terminate after the date. -#if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) - const ASYS_TCHAR *lhost_name = (const ASYS_TCHAR *) ((host_name == 0) +# if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) + const ASYS_TCHAR *lhost_name = (const ASYS_TCHAR *) ((host_name == 0) ? ((char *) "<local_host>") : ((char *) host_name)); -#else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ +# else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ const ASYS_TCHAR *lhost_name = host_name == 0 ? ASYS_TEXT ("<local_host>") : host_name; -#endif /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ +# endif /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ ret = ACE_OS::fprintf (fp, ASYS_TEXT ("%s.%d %s@%s@%d@%s@%s"), - ctp + 4, - this->time_stamp_.usec () / 1000, - ctp + 20, - lhost_name, - this->pid_, - ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), - this->msg_data_); + ctp + 4, + this->time_stamp_.usec () / 1000, + ctp + 20, + lhost_name, + this->pid_, + ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), + this->msg_data_); } else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE)) ret = ACE_OS::fprintf (fp, @@ -175,10 +257,17 @@ ACE_Log_Record::print (const ASYS_TCHAR *host_name, return ret; } +#endif /* defined (ACE_HAS_WINCE) */ + +// Print out the record on the stderr stream with the appropriate +// format. + +#if ! defined (ACE_LACKS_IOSTREAM_TOTALLY) + int ACE_Log_Record::print (const ASYS_TCHAR host_name[], - u_long verbose_flag, - ostream &s) + u_long verbose_flag, + ostream &s) { // ACE_TRACE ("ACE_Log_Record::print"); @@ -188,7 +277,7 @@ ACE_Log_Record::print (const ASYS_TCHAR host_name[], ASYS_TCHAR ctp[26]; // 26 is a magic number... if (ACE_OS::ctime_r (&now, ctp, sizeof ctp) == 0) - return -1; + return -1; /* 01234567890123456789012345 */ /* Wed Oct 18 14:25:36 1989n0 */ @@ -196,14 +285,14 @@ ACE_Log_Record::print (const ASYS_TCHAR host_name[], ctp[19] = '\0'; // NUL-terminate after the time. ctp[24] = '\0'; // NUL-terminate after the date. -#if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) - const ASYS_TCHAR *lhost_name = +# if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) + const ASYS_TCHAR *lhost_name = (const ASYS_TCHAR *) ((host_name == 0) ? ((char *) "<local_host>") : ((char *) host_name)); -#else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ +# else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ const ASYS_TCHAR *lhost_name = host_name == 0 ? ASYS_TEXT ("<local_host>") : host_name; -#endif /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ +# endif /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ // Make sure that the output of the timestamp and process id is // "fixed width." @@ -216,16 +305,16 @@ ACE_Log_Record::print (const ASYS_TCHAR host_name[], "%03d", this->pid_); s << (ctp + 4) << '.' - << s_msec + << s_msec << ' ' - << (ctp + 20) - << '@' - << lhost_name - << '@' - << s_pid - << '@' - << ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)) - << '@'; + << (ctp + 20) + << '@' + << lhost_name + << '@' + << s_pid + << '@' + << ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)) + << '@'; } else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE)) s << ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)) @@ -235,84 +324,6 @@ ACE_Log_Record::print (const ASYS_TCHAR host_name[], s.flush (); return 0; } -#else /* ACE_HAS_WINCE */ -int -ACE_Log_Record::format_msg (const ASYS_TCHAR host_name[], - u_long verbose_flag, - CString *msg) -{ - if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE)) - { - time_t now = this->time_stamp_.sec (); - ASYS_TCHAR ctp[26]; // 26 is a magic number... - - if (ACE_OS::ctime_r (&now, ctp, sizeof ctp) == 0) - return -1; - - /* 01234567890123456789012345 */ - /* Wed Oct 18 14:25:36 1989n0 */ - - ctp[19] = '\0'; // NUL-terminate after the time. - ctp[24] = '\0'; // NUL-terminate after the date. - - const ASYS_TCHAR *lhost_name = host_name == - 0 ? ASYS_TEXT ("<local_host>") : host_name; - - msg->Format (ASYS_TEXT ("%s.%d %s@%s@%d@%s@%s"), - ctp + 4, - this->time_stamp_.usec () / 1000, - ctp + 20, - lhost_name, - this->pid_, - ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), - this->msg_data_); - } - else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE)) - msg->Format (ASYS_TEXT ("%s@%s"), - ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), - this->msg_data_); - else - msg->Format (ASYS_TEXT ("%s"), this->msg_data_); - - return 0; -} - -int -ACE_Log_Record::print (const ASYS_TCHAR *host_name, - u_long verbose_flag, - FILE *fp) -{ - int ret = -1; - CString msg; - - if (this->format_msg (host_name, verbose_flag, &msg) != -1 && - fp != NULL) - { - ret = ACE_OS::fwrite (ACE_MULTIBYTE_STRING (msg), - 1, - msg.GetLength (), - fp); - } - return ret; -} - -int -ACE_Log_Record::print (const ASYS_TCHAR *host_name, - u_long verbose_flag, - ACE_CE_Bridge *log_window) -{ - // ACE_TRACE ("ACE_Log_Record::print"); - CString *msg = new CString (); +#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - if (this->format_msg (host_name, verbose_flag, msg) != -1) - { - if (log_window == 0) - log_window = ACE_CE_Bridge::get_default_winbridge (); - log_window->write_msg (msg); - return 0; - } - - return -1; -} -#endif /* ! ACE_HAS_WINCE */ diff --git a/ace/Log_Record.h b/ace/Log_Record.h index 5cf45662344..0c08bc5366b 100644 --- a/ace/Log_Record.h +++ b/ace/Log_Record.h @@ -19,6 +19,7 @@ #include "ace/ACE.h" #include "ace/Log_Priority.h" +#include "ace/SString.h" #ifndef ACE_LOG_RECORD_H #define ACE_LOG_RECORD_H @@ -63,7 +64,8 @@ public: ~ACE_Log_Record (void); // Default dtor. -#if !defined (ACE_HAS_WINCE) /* @@ Sould this be ACE_LACKS_IOSTREAM_TOTALLY? */ +#if ! defined (ACE_LACKS_IOSTREAM_TOTALLY) + int print (const ASYS_TCHAR host_name[], u_long verbose_flag, FILE *fp = stderr); @@ -75,23 +77,39 @@ public: ostream &stream); // Write the contents of the logging record to the appropriate // <ostream>. + #else + +# if defined (ACE_HAS_WINCE) + int format_msg (const ASYS_TCHAR host_name[], u_long verbose_flag, CString *msg); int print (const ASYS_TCHAR host_name[], u_long verbose_flag, + ACE_CE_Bridge *log_ = 0); + // For Windows CE, the default is to log messages to a preset + // window. + + int print (const ASYS_TCHAR host_name[], + u_long verbose_flag, FILE *fp); // Write the contents of the logging record to the appropriate // <FILE>. +#else + int print (const ASYS_TCHAR host_name[], u_long verbose_flag, - ACE_CE_Bridge *log_ = 0); - // For Windows CE, the default is to log messages to a preset - // window. -#endif /* ! ACE_HAS_WINCE */ + FILE *fp = stderr); + // Write the contents of the logging record to the appropriate + // <FILE>. + +# endif /* defined (ACE_HAS_WINCE) */ + + +#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ static const ASYS_TCHAR *priority_name (ACE_Log_Priority p); // Returns a character array with the string form of the diff --git a/ace/OS.cpp b/ace/OS.cpp index 205ff63f9a3..6bd6ded7a00 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -4255,6 +4255,23 @@ ACE_OS::open (const char *filename, ACE_FAIL_RETURN (h); else return h; +#elif defined (ACE_PSOS) + ACE_UNUSED_ARG (mode); + ACE_UNUSED_ARG (perms); + ACE_UNUSED_ARG (sa); +# if defined (ACE_PSOS_LACKS_PHILE) + ACE_UNUSED_ARG (filename); + return 0; +# else + unsigned long result, handle; + result = ::open_f (&handle, ACE_const_cast(char *, filename), 0); + if (result != 0) + { + errno = result; + return ACE_static_cast (ACE_HANDLE, -1); + } + return ACE_static_cast (ACE_HANDLE, handle); +# endif /* defined (ACE_PSOS_LACKS_PHILE) */ #else ACE_UNUSED_ARG (sa); ACE_OSCALL_RETURN (::open (filename, mode, perms), ACE_HANDLE, -1); @@ -688,8 +688,10 @@ typedef int key_t; # include /**/ <pna.h> /* pNA+ TCP/IP Network Manager calls */ # include /**/ <phile.h> /* pHILE+ file system calls */ // #include /**/ <prepccfg.h> /* pREPC+ file system calls */ -# include /**/ <unistd.h> /* Diab Data supplied file system calls */ -# include /**/ <sys/wait.h> /* Diab Data supplied header file */ + +// These are colliding with the pSOS libraries +// # include /**/ <unistd.h> /* Diab Data supplied file system calls */ +// # include /**/ <sys/wait.h> /* Diab Data supplied header file */ // This collides with phile.h // #include /**/ <sys/stat.h> /* Diab Data supplied header file */ @@ -2486,6 +2488,8 @@ protected: // from compiler supplied stdlib.h extern int putenv(char *); + int isatty (ACE_HANDLE h); + # endif /* ACE_PSOS_SNARFS_HEADER_INFO */ # if defined (ACE_LACKS_SCHED_H) @@ -4084,7 +4088,7 @@ typedef int ACE_Sched_Priority; class ACE_Sched_Params; # if defined (ACE_LACKS_FILELOCKS) -# if ! defined (VXWORKS) +# if ! defined (VXWORKS) && ! defined (ACE_PSOS) // VxWorks defines struct flock in sys/fcntlcom.h. But it doesn't // appear to support flock (). struct flock @@ -582,8 +582,13 @@ ACE_OS::getuid (void) ACE_INLINE int ACE_OS::isatty (ACE_HANDLE fd) { +# if defined (ACE_LACKS_ISATTY) + ACE_UNUSED_ARG (fd); + return 0; +#else // ACE_TRACE ("ACE_OS::isatty"); ACE_OSCALL_RETURN (::isatty (fd), int, -1); +# endif /* defined (ACE_LACKS_ISATTY) */ } # if !defined (ACE_HAS_MOSTLY_UNICODE_APIS) @@ -1008,6 +1013,9 @@ ACE_OS::unlink (const char *path) # if defined (VXWORKS) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::unlink ((char *) path), ace_result_), int, -1); +# elif defined (ACE_PSOS) + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::remove ((char *) path), ace_result_), + int, -1); # else ACE_OSCALL_RETURN (::unlink (path), int, -1); # endif /* VXWORKS */ @@ -1109,9 +1117,13 @@ ACE_OS::_exit (int status) ::exit (status); #elif defined (ACE_PSOSIM) ::u_exit (status); -#elif defined (ACE_PSOS_LACKS_PREPC) // JINLU TM does not support exit +#elif defined (ACE_PSOS) +# if defined (ACE_PSOS_LACKS_PREPC) // JINLU TM does not support exit ACE_UNUSED_ARG (status); return; +# else + ::exit (status); +# endif /* defined (ACE_PSOS_LACKS_PREPC) */ #elif !defined (ACE_HAS_WINCE) ::_exit (status); #else @@ -5358,9 +5370,7 @@ ACE_OS::signal (int signum, ACE_SignalHandler func) if (signum == 0) return 0; else -#if defined (ACE_PSOS) && !defined (ACE_PSOS_TM) - return (ACE_SignalHandler) ::signal (signum, (void (*)(void)) func); -#elif defined (ACE_PSOS_TM) //JINLU +#if defined (ACE_PSOS_TM) //JINLU return (ACE_SignalHandler) ::signal (signum, (void (*)(int)) func); #elif defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) || !defined (ACE_LACKS_UNIX_SIGNALS) # if !defined (ACE_HAS_TANDEM_SIGNALS) && !defined (ACE_HAS_LYNXOS_SIGNALS) @@ -6907,6 +6917,15 @@ ACE_OS::close (ACE_HANDLE handle) // ACE_TRACE ("ACE_OS::close"); #if defined (ACE_WIN32) ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CloseHandle (handle), ace_result_), int, -1); +#elif defined (ACE_PSOS) && ! defined (ACE_PSOS_LACKS_PHILE) + unsigned long result; + result = ::close_f (handle); + if (result != 0) + { + errno = result; + return ACE_static_cast (int, -1); + } + return ACE_static_cast (int, 0); #else ACE_OSCALL_RETURN (::close (handle), int, -1); #endif /* ACE_WIN32 */ @@ -6949,6 +6968,10 @@ ACE_OS::creat (LPCTSTR filename, mode_t mode) ACE_UNUSED_ARG (filename); ACE_UNUSED_ARG (mode); ACE_NOTSUP_RETURN (-1); +#elif defined(ACE_PSOS) + ACE_UNUSED_ARG (filename); + ACE_UNUSED_ARG (mode); + ACE_NOTSUP_RETURN (-1); #else ACE_OSCALL_RETURN (::creat (filename, mode), ACE_HANDLE, ACE_INVALID_HANDLE); @@ -7346,6 +7369,15 @@ ACE_OS::write (ACE_HANDLE handle, const void *buf, size_t nbyte) return (ssize_t) bytes_written; else ACE_FAIL_RETURN (-1); +#elif defined (ACE_PSOS) +# if defined (ACE_PSOS_LACKS_PHILE) + ACE_UNUSED_ARG (handle); + ACE_UNUSED_ARG (buf); + ACE_UNUSED_ARG (nbyte); + ACE_NOTSUP_RETURN (-1); +# else + ACE_OSCALL_RETURN (::write_f (handle, buf, nbyte), ssize_t, -1); +# endif /* defined (ACE_PSOS_LACKS_PHILE) */ #else # if defined (ACE_LACKS_POSIX_PROTOTYPES) ACE_OSCALL_RETURN (::write (handle, (const char *) buf, nbyte), ssize_t, -1); @@ -7385,6 +7417,25 @@ ACE_OS::read (ACE_HANDLE handle, void *buf, size_t len) return (ssize_t) ok_len; else ACE_FAIL_RETURN (-1); +#elif defined (ACE_PSOS) +# if defined (ACE_PSOS_LACKS_PHILE) + ACE_UNUSED_ARG (handle); + ACE_UNUSED_ARG (buf); + ACE_UNUSED_ARG (len); + ACE_NOTSUP_RETURN (-1); +# else + unsigned long count, result; + result = ::read_f (handle, buf, len, &count); + if (result != 0) + { + return ACE_static_cast (ssize_t, -1); + } + else + { + return ACE_static_cast (ssize_t, + (count = len ? count : 0)); + } +# endif /* defined (ACE_PSOS_LACKS_PHILE */ #else # if defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_HAS_CHARPTR_SOCKOPT) ACE_OSCALL_RETURN (::read (handle, (char *) buf, len), ssize_t, -1); @@ -8983,7 +9034,7 @@ ACE_OS::getpid (void) // ACE_TRACE ("ACE_OS::getpid"); #if defined (ACE_WIN32) return ::GetCurrentProcessId (); -#elif defined (VXWORKS) || defined (ACE_PSOS_TM) +#elif defined (VXWORKS) || defined (ACE_PSOS) // getpid() is not supported: just one process anyways return 0; #elif defined (CHORUS) @@ -9038,6 +9089,30 @@ ACE_OS::lseek (ACE_HANDLE handle, off_t offset, int whence) ACE_FAIL_RETURN (-1); else return result; +#elif defined (ACE_PSOS) +# if defined (ACE_PSOS_LACKS_PHILE) + ACE_UNUSED_ARG (handle); + ACE_UNUSED_ARG (offset); + ACE_UNUSED_ARG (whence); + ACE_NOTSUP_RETURN (-1); +# else + unsigned long oldptr, newptr, result; + // seek to the requested position + result = ::lseek_f (handle, whence, offset, &oldptr); + if (result != 0) + { + errno = result; + return ACE_static_cast (off_t, -1); + } + // now do a dummy seek to the current position to obtain the position + result = ::lseek_f (handle, SEEK_CUR, 0, &newptr); + if (result != 0) + { + errno = result; + return ACE_static_cast (off_t, -1); + } + return ACE_static_cast (off_t, newptr); +# endif /* defined (ACE_PSOS_LACKS_PHILE */ #else ACE_OSCALL_RETURN (::lseek (handle, offset, whence), int, -1); #endif /* ACE_WIN32 */ @@ -9140,7 +9215,7 @@ ACE_INLINE int ACE_OS::kill (pid_t pid, int signum) { // ACE_TRACE ("ACE_OS::kill"); -#if defined (ACE_WIN32) || defined (CHORUS) || defined(ACE_PSOS_TM) +#if defined (ACE_WIN32) || defined (CHORUS) || defined(ACE_PSOS) ACE_UNUSED_ARG (pid); ACE_UNUSED_ARG (signum); ACE_NOTSUP_RETURN (-1); @@ -9171,7 +9246,7 @@ ACE_OS::sigaction (int signum, else osa->sa_handler = ::signal (signum, nsa->sa_handler); return osa->sa_handler == SIG_ERR ? -1 : 0; -#elif defined (CHORUS) || defined (ACE_HAS_WINCE) || defined(ACE_PSOS_TM) +#elif defined (CHORUS) || defined (ACE_HAS_WINCE) || defined(ACE_PSOS) ACE_UNUSED_ARG (signum); ACE_UNUSED_ARG (nsa); ACE_UNUSED_ARG (osa); @@ -10444,14 +10519,19 @@ putchar (int c) #endif /* ACE_HAS_WINCE */ #if defined (ACE_PSOS) +ACE_INLINE int +isatty (ACE_HANDLE h) +{ + return ACE_OS::isatty (h); +} #if defined (fileno) #undef fileno +#endif /* defined (fileno)*/ ACE_INLINE ACE_HANDLE fileno (FILE *fp) { return (ACE_HANDLE) fp; } -#endif /* defined (fileno)*/ #endif /* defined (ACE_PSOS) */ ACE_INLINE diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index 8a8c1d25578..fc314b0ab42 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -77,7 +77,14 @@ ACE_Parse_Node::link (ACE_Parse_Node *n) ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node *str_ops, const ACE_Parse_Node *str_mods) +#if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) + : ACE_Parse_Node (str_ops == 0 ? ACE_static_cast (char *, + ASYS_TEXT ("<unknown>")) + : ACE_static_cast (char *, + str_ops->name ())), +#else : ACE_Parse_Node (str_ops == 0 ? "<unknown>" : str_ops->name ()), +#endif /* defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ node_ (str_ops), mods_ (str_mods) { @@ -180,7 +187,7 @@ ACE_Resume_Node::apply (void) if (ACE_Service_Config::resume (this->name ()) == -1) ace_yyerrno++; - if (ACE::debug ()) + if (ACE::debug ()) ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("did resume on %s, error = %d\n"), this->name (), @@ -392,7 +399,7 @@ ACE_Location_Node::open_handle (void) ASYS_TCHAR dl_exppathname[MAXPATHLEN]; if (::ExpandEnvironmentStringsA (name, dl_exppathname, - MAXPATHLEN)) + MAXPATHLEN)) name = dl_exppathname; #endif /* ACE_WIN32 */ diff --git a/ace/SString.cpp b/ace/SString.cpp index ad68e13c610..bfecd825af4 100644 --- a/ace/SString.cpp +++ b/ace/SString.cpp @@ -212,7 +212,7 @@ const int ACE_CString::npos = -1; const int ACE_SString::npos = -1; const int ACE_WString::npos = -1; -#if !defined (ACE_HAS_WINCE) +#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) ostream & operator<< (ostream &os, const ACE_CString &cs) { @@ -235,12 +235,12 @@ operator<< (ostream &os, const ACE_SString &ss) os << ss.fast_rep (); return os; } -#endif /* !ACE_HAS_WINCE */ +#endif /* !ACE_LACKS_IOSTREAM_TOTALLY */ // Constructor that copies <s> into dynamically allocated memory. // Probable loss of data. Please use with care. -ACE_CString::ACE_CString (const ACE_USHORT16 *s, +ACE_CString::ACE_CString (const ACE_USHORT16 *s, ACE_Allocator *alloc) : allocator_ (alloc ? alloc : ACE_Allocator::instance ()), len_ (0), @@ -259,7 +259,7 @@ ACE_CString::ACE_CString (const ACE_USHORT16 *s, { this->release_ = 1; - this->len_ = ACE_WString::strlen (s); + this->len_ = ACE_WString::strlen (s); this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1); // Copy the ACE_USHORT16 * string byte-by-byte into the char * @@ -272,22 +272,22 @@ ACE_CString::ACE_CString (const ACE_USHORT16 *s, } void -ACE_CString::set (const char *s, +ACE_CString::set (const char *s, size_t len, int release) { // Free memory if necessary // Going from memory to no memory - if ((!release || s == 0 || s[0] == '\0') + if ((!release || s == 0 || s[0] == '\0') && this->release_) this->allocator_->free (this->rep_); // Going from memory to more memory - else if (this->len_ < len + else if (this->len_ < len && this->release_) this->allocator_->free (this->rep_); - + // Figure out future ownership if (!release || s == 0 || s[0] == '\0') this->release_ = 0; @@ -295,7 +295,7 @@ ACE_CString::set (const char *s, this->release_ = 1; // Allocate memory if owner and necessary - + // Len is greater than 0, so must allocate space for it. if (this->release_ && this->len_ < len) this->rep_ = (char *) this->allocator_->malloc (len + 1); @@ -310,7 +310,7 @@ ACE_CString::set (const char *s, // If we don't own the string. else if (!this->release_) this->rep_ = (char *) s; - + // We own the string. else { @@ -632,14 +632,14 @@ ACE_WString::ACE_WString (const char *s, if (s == 0) { this->len_ = 0; - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); this->rep_[this->len_] = 0; } else { this->len_ = ACE_OS::strlen (s); - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); // Copy the char * string byte-by-byte into the ACE_USHORT16 * @@ -666,14 +666,14 @@ ACE_WString::ACE_WString (const ACE_USHORT16 *s, if (s == 0) { this->len_ = 0; - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); this->rep_[this->len_] = 0; } else { this->len_ = ACE_WString::strlen (s); - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); ACE_OS::memcpy (this->rep_, @@ -695,7 +695,7 @@ ACE_WString::ACE_WString (ACE_USHORT16 c, this->allocator_ = ACE_Allocator::instance (); this->len_ = 1; - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); this->rep_[0] = c; this->rep_[this->len_] = 0; @@ -716,14 +716,14 @@ ACE_WString::ACE_WString (const ACE_USHORT16 *s, if (s == 0) { this->len_ = 0; - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); this->rep_[this->len_] = 0; } else { this->len_ = len; - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); ACE_OS::memcpy (this->rep_, @@ -747,7 +747,7 @@ ACE_WString::ACE_WString (size_t len, this->allocator_ = ACE_Allocator::instance (); this->len_ = len; - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + 1) * sizeof (ACE_USHORT16)); ACE_OS::memset (this->rep_, @@ -768,7 +768,7 @@ ACE_WString::ACE_WString (const ACE_WString &s) if (this->allocator_ == 0) this->allocator_ = ACE_Allocator::instance (); - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((s.len_ + 1) * sizeof (ACE_USHORT16)); ACE_OS::memcpy ((void *) this->rep_, (const void *) s.rep_, @@ -803,7 +803,7 @@ ACE_WString::set (const ACE_USHORT16 *s, size_t len) if (this->len_ < len) { this->allocator_->free (this->rep_); - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((len + 1) * sizeof (ACE_USHORT16)); } @@ -849,7 +849,7 @@ ACE_WString::resize (size_t len) if (this->len_ < len) { this->allocator_->free (this->rep_); - this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc + this->rep_ = (ACE_USHORT16 *) this->allocator_->malloc ((len + 1) * sizeof (ACE_USHORT16)); } @@ -866,7 +866,7 @@ ACE_WString & ACE_WString::operator+= (const ACE_WString &s) { ACE_TRACE ("ACE_WString::operator+="); - ACE_USHORT16 *t = (ACE_USHORT16 *) this->allocator_->malloc + ACE_USHORT16 *t = (ACE_USHORT16 *) this->allocator_->malloc ((this->len_ + s.len_ + 1) * sizeof (ACE_USHORT16)); ACE_OS::memcpy ((void *) t, @@ -906,7 +906,7 @@ ACE_WString::strstr (const ACE_USHORT16 *s1, // Check if the substring is longer than the string being searched. if (len2 > len1) - return 0; + return 0; // Go upto <len> size_t len = len1 - len2; diff --git a/ace/Stats.cpp b/ace/Stats.cpp index eee2d0ef619..14421744241 100644 --- a/ace/Stats.cpp +++ b/ace/Stats.cpp @@ -137,9 +137,15 @@ ACE_Stats::std_dev (ACE_Stats_Value &std_dev, // Scale up by field width so that we don't lose the // precision of the mean. Carefully . . . const ACE_UINT64 product (*sample * field); - ACE_UINT64 difference = - product >= mean_scaled ? product - mean_scaled - : mean_scaled - product; + ACE_UINT64 difference; + if (product >= mean_scaled) + { + difference = product - mean_scaled; + } + else + { + difference = mean_scaled - product; + } // Do the squaring using 64-bit arithmetic. sum_of_squares += difference * ACE_U64_TO_U32 (difference); diff --git a/ace/config-WinCE.h b/ace/config-WinCE.h index 12588834eb2..c499ed669fa 100644 --- a/ace/config-WinCE.h +++ b/ace/config-WinCE.h @@ -30,6 +30,8 @@ #define ACE_USES_WINCE_SEMA_SIMULATION +#define ACE_LACKS_IOSTREAM_TOTALLY + #if defined (ACE_HAS_STRICT) # undef ACE_HAS_STRICT #endif /* ACE_HAS_STRICT */ @@ -148,6 +150,6 @@ typedef long off_t; #define ACE_HAS_STRDUP_EMULATION // @@ This needs to be defined and initialized as a static. (Singleton?) -#define ACE_CE_DEFAULT_LOG_STREAM 0 +#define ACE_DEFAULT_LOG_STREAM 0 #endif /* ACE_CONFIG_WINCE_H */ diff --git a/ace/config-psos-diab.h b/ace/config-psos-diab.h index 1817db629a7..42f11e5aeec 100644 --- a/ace/config-psos-diab.h +++ b/ace/config-psos-diab.h @@ -1,8 +1,8 @@ /* -*- C++ -*- */ // $Id$ -// The following configuration file is designed to work for pSOSystem V2.2.1, -// using the Diab Data D-C++ 4.2 p3 compiler (or a later version) +// The following configuration file is designed to work for pSOSystem V2.2.2, +// using the Diab Data D-C++ 4.2a compiler (or a later version) #ifndef ACE_CONFIG_H #define ACE_CONFIG_H @@ -14,6 +14,14 @@ # undef __ACE_INLINE__ #endif /* __ACE_INLINE__ */ +#define ACE_LACKS_ISATTY + +#define ACE_LACKS_DIFFTIME + +#define ACE_LACKS_FCNTL + +#define ACE_LACKS_FILELOCKS + #define ACE_LACKS_INLINE_FUNCTIONS #define ACE_LACKS_TEMPLATE_AS_TEMPLATE_PARAMETER @@ -22,7 +30,6 @@ # include "ace/config-g++-common.h" #endif /* __GNUG__ */ -#define ACE_PSOS_LACKS_PREPC #define ACE_HAS_STRDUP_EMULATION @@ -42,12 +49,20 @@ # define ACE_LACKS_SEEKDIR # define ACE_LACKS_REWINDDIR +#define ACE_LACKS_TRUNCATE + // Template instantiation definitions // #define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_FILE #define ACE_TEMPLATES_REQUIRE_SOURCE #define ACE_LACKS_METHOD_DEFINITIONS_IN_CLASS_TEMPLATE -/* #define ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION */ +// IO Streams stuff +// #define ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION +#define ACE_LACKS_IOSTREAM_TOTALLY +#define ACE_LACKS_ACE_IOSTREAM +#define ACE_LACKS_IOSTREAM_FX +#define ACE_DEFAULT_LOG_STREAM 0 +#define ostream FILE #define ACE_LACKS_HRTIME_T @@ -129,8 +144,6 @@ #define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_IOSTREAM_FX - #define ACE_LACKS_KEY_T #define ACE_LACKS_LINEBUFFERED_STREAMBUF @@ -173,7 +186,7 @@ #define ACE_LACKS_SYSV_SHMEM -// #define ACE_LACKS_SYS_NERR +#define ACE_LACKS_SYS_NERR #define ACE_LACKS_SYS_TYPES_H @@ -194,6 +207,8 @@ #define ACE_PSOS_CANT_USE_SYS_TYPES +// #define ACE_PSOS_LACKS_PHILE + #define ACE_PSOS_SNARFS_HEADER_INFO #if !defined (ACE_PSOS) diff --git a/ace/streams.h b/ace/streams.h index 56130bec6f7..6bd1b445429 100644 --- a/ace/streams.h +++ b/ace/streams.h @@ -96,7 +96,7 @@ using std::oct; #else /* ACE_HAS_STANDARD_CPP_LIBRARY */ -#if !defined (ACE_HAS_WINCE) +#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) #include /**/ <fstream.h> #include /**/ <iostream.h> @@ -110,7 +110,7 @@ using std::oct; #endif /* _MSC_VER */ #include /**/ <strstrea.h> // VSB #endif /* ACE_WIN32 */ -#endif /* ACE_HAS_WINCE */ +#endif /* ACE_LACKS_IOSTREAM_TOTALLY */ #endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ |