summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-05-25 02:13:02 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-05-25 02:13:02 +0000
commit5952780648a923aa76722d321bf554db01ff0d49 (patch)
tree2797dfd01f44b939184ce64b1ad3d5cb3da2e56c
parent59c2ed59d55f84c988d432bc2e7e9819147acbcc (diff)
downloadATCD-5952780648a923aa76722d321bf554db01ff0d49.tar.gz
ChangeLogTag:Wed May 24 18:56:16 2000 Darrell Brunsch <brunsch@uci.edu>
-rw-r--r--ChangeLog144
-rw-r--r--ChangeLogs/ChangeLog-02a144
-rw-r--r--ChangeLogs/ChangeLog-03a144
-rw-r--r--PACE/ChangeLog42
-rw-r--r--PACE/docs/ACE_Integration.txt17
-rw-r--r--ace/Makefile1
-rw-r--r--ace/Makefile.am1
-rw-r--r--ace/Makefile.bor1
-rw-r--r--ace/OS.cpp279
-rw-r--r--ace/OS.h123
-rw-r--r--ace/OS.i831
-rw-r--r--ace/OS_Dirent.cpp105
-rw-r--r--ace/OS_Dirent.h5
-rw-r--r--ace/OS_Dirent.inl90
-rw-r--r--ace/OS_Export.h40
-rw-r--r--ace/OS_String.cpp366
-rw-r--r--ace/OS_String.h161
-rw-r--r--ace/OS_String.inl718
-rw-r--r--ace/ace-dll.icc2
-rw-r--r--ace/ace-lib.icc1
-rw-r--r--ace/ace_dll.dsp31
-rw-r--r--ace/ace_lib.dsp35
22 files changed, 1766 insertions, 1515 deletions
diff --git a/ChangeLog b/ChangeLog
index 567500fb3e5..fb6c9ac24d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,34 +1,68 @@
+Wed May 24 18:56:16 2000 Darrell Brunsch <brunsch@uci.edu>:
+
+ * ace/OS_Export.h: (added)
+
+ In preparation for an eventual splitting up of the ACE DLLs,
+ I'm starting to split up the Export macros also. OS_Export will
+ be used for the lowest level OS library.
+
+ * ace/Makefile:
+ * ace/Makefile.am:
+ * ace/Makefile.bor:
+ * ace/ace-dll.icc:
+ * ace/ace-lib.icc:
+ * ace/ace_dll.dsp:
+ * ace/ace_lib.dsp:
+ * ace/OS.cpp:
+ * ace/OS.h:
+ * ace/OS.i:
+ * ace/OS_String.cpp: (added)
+ * ace/OS_String.h: (added)
+ * ace/OS_String.inl: (added)
+
+ Moved the string methods of ACE_OS to ACE_OS_String.
+
+ * ace/OS_Dirent.cpp:
+ * ace/OS_Dirent.h:
+ * ace/OS_Dirent.inl:
+
+ Separated the Win32 versions of some of the methods into the
+ cpp file. The Win32 versions were a bit too complicated to make
+ sense having inlined.
+
+ Also changed to use ACE_OS_Export.
+
Wed May 24 10:22:18 2000 Ossama Othman <ossama@uci.edu>
- * THANKS:
+ * THANKS:
- Added Håkon Innerdal <hakoni@funcom.com> to the list of
- contributors.
+ Added Håkon Innerdal <hakoni@funcom.com> to the list of
+ contributors.
- * ace/config-linux-common.h (ACE_DEFAULT_SELECT_REACTOR_SIZE):
+ * ace/config-linux-common.h (ACE_DEFAULT_SELECT_REACTOR_SIZE):
- Commented out the definition of this macro. Its setting
- unnecessarily limited the default size of the Select_Reactor to
- 256 file descriptors. `ace/OS.h' correctly sets the default
- size to FD_SETSIZE. Thanks to Håkon Innerdal
- <hakoni@funcom.com> for pointing this out.
+ Commented out the definition of this macro. Its setting
+ unnecessarily limited the default size of the Select_Reactor to
+ 256 file descriptors. `ace/OS.h' correctly sets the default
+ size to FD_SETSIZE. Thanks to Håkon Innerdal
+ <hakoni@funcom.com> for pointing this out.
- * ace/Select_Reactor_Base.cpp (open):
+ * ace/Select_Reactor_Base.cpp (open):
- Do not check if the desired size of the repository, i.e. the
- maximum number of file descriptors, is greater than FD_SETSIZE.
- The same check is effectively done in the call to
- ACE::set_handle_limits(). The redundant check also prevented
- the Reactor from supporting file descriptors numbering more than
- FD_SETSIZE on platforms that support them (e.g. via
- setrlimit(RLIMIT_NOFILE, ...)). Thanks to Håkon Innerdal
- <hakoni@funcom.com> for reporting the problem, and for providing
- a fix.
+ Do not check if the desired size of the repository, i.e. the
+ maximum number of file descriptors, is greater than FD_SETSIZE.
+ The same check is effectively done in the call to
+ ACE::set_handle_limits(). The redundant check also prevented
+ the Reactor from supporting file descriptors numbering more than
+ FD_SETSIZE on platforms that support them (e.g. via
+ setrlimit(RLIMIT_NOFILE, ...)). Thanks to Håkon Innerdal
+ <hakoni@funcom.com> for reporting the problem, and for providing
+ a fix.
- * m4/platform.m4 (ACE_DEFAULT_SELECT_REACTOR_SIZE):
+ * m4/platform.m4 (ACE_DEFAULT_SELECT_REACTOR_SIZE):
- No longer set the default size to 256 file descriptors.
- `ace/OS.h' correctly set it to FD_SETSIZE.
+ No longer set the default size to 256 file descriptors.
+ `ace/OS.h' correctly set it to FD_SETSIZE.
Wed May 24 10:08:37 2000 Joe Hoffert <joeh@cs.wustl.edu>
@@ -61,16 +95,16 @@ Wed May 24 08:10:21 2000 Steve Huston <shuston@riverace.com>
Tue May 23 20:13:52 2000 Irfan Pyarali <irfan@cs.wustl.edu>
- * ace/WFMO_Reactor.h: Moved the definition of WSANETWORKEVENTS to
- before its use. Thanks to Craig Perras <cperras@watchguard.com>
- for reporting this.
+ * ace/WFMO_Reactor.h: Moved the definition of WSANETWORKEVENTS to
+ before its use. Thanks to Craig Perras <cperras@watchguard.com>
+ for reporting this.
Tue May 23 17:59:06 2000 Luther J Baker <luther@cs.wustl.edu>
- * ACE_wrappers/pace/pace:
- Source files added.
- Changes to pace subdirectory will be noted in
- ACE_wrappers/pace/ChangeLog.
+ * ACE_wrappers/pace/pace:
+ Source files added.
+ Changes to pace subdirectory will be noted in
+ ACE_wrappers/pace/ChangeLog.
Tue May 23 17:55:17 2000 Steve Huston <shuston@riverace.com>
@@ -86,13 +120,13 @@ Tue May 23 17:21:37 2000 Steve Huston <shuston@riverace.com>
Tue May 23 16:37:27 2000 Luther J Baker <luther@cs.wustl.edu>
- * ACE_wrappers/pace directories added to ACE_wrappers:
+ * ACE_wrappers/pace directories added to ACE_wrappers:
- ACE_wrappers/pace/docs
- ACE_wrappers/pace/examples
- ACE_wrappers/pace/pace
- ACE_wrappers/pace/pace++
- ACE_wrappers/pace/tests
+ ACE_wrappers/pace/docs
+ ACE_wrappers/pace/examples
+ ACE_wrappers/pace/pace
+ ACE_wrappers/pace/pace++
+ ACE_wrappers/pace/tests
Mon May 22 15:26:42 2000 Steve Huston <shuston@riverace.com>
@@ -116,20 +150,20 @@ Wed May 10 16:47:31 2000 Steve Huston <shuston@riverace.com>
Mon May 22 15:25:33 2000 Nanbor Wang <nanbor@cs.wustl.edu>
- * ace/OS.{h,cpp} (ACE_Thread_Exit):
- * ace/Thread_Manager.cpp (~ACE_Thread_Exit): Moved the reset of
- ACE_Thread_Exit::is_constructed_ from the Thread_Exit's
- destructor to ACE_OS_Object_Manager::fini (). Otherwise, the
- singleton ACE_Thread_Exit may get created multiple times.
- Thanks to Eric Yee <eyee@authentica.com> for reporting the
- problem.
-
- Notice that ACE 5.1.1, 5.1.2 and 5.1.3 all have the same problem
- of creating TSS keys unnecessarily without cleaning them up.
- This will most likely cause a long running server process
- creating a lot of threads to crash eventually (at least on NT.)
- Therefore, you should not use these versions in a production
- environment.
+ * ace/OS.{h,cpp} (ACE_Thread_Exit):
+ * ace/Thread_Manager.cpp (~ACE_Thread_Exit): Moved the reset of
+ ACE_Thread_Exit::is_constructed_ from the Thread_Exit's
+ destructor to ACE_OS_Object_Manager::fini (). Otherwise, the
+ singleton ACE_Thread_Exit may get created multiple times.
+ Thanks to Eric Yee <eyee@authentica.com> for reporting the
+ problem.
+
+ Notice that ACE 5.1.1, 5.1.2 and 5.1.3 all have the same problem
+ of creating TSS keys unnecessarily without cleaning them up.
+ This will most likely cause a long running server process
+ creating a lot of threads to crash eventually (at least on NT.)
+ Therefore, you should not use these versions in a production
+ environment.
Mon May 22 11:23:19 2000 Pradeep Gore <pradeep@cs.wustl.edu>
@@ -149,17 +183,17 @@ Sun May 21 12:29:11 2000 Carlos O'Ryan <coryan@uci.edu>
Sun May 21 11:39:11 2000 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
- * tests/Signal_Test.cpp (worker_parent): My earlier fix on May 18th, 2000
- was incorrect. The right fix is to make the format specifier be
+ * tests/Signal_Test.cpp (worker_parent): My earlier fix on May 18th, 2000
+ was incorrect. The right fix is to make the format specifier be
%ld, rather than cast the pid_t to (int).
Sat May 20 18:34:05 2000 Ossama Othman <ossama@uci.edu>
- * configure.in (ACE_HAS_BROKEN_T_ERROR):
+ * configure.in (ACE_HAS_BROKEN_T_ERROR):
- Fixed the test that checks if t_error() correctly accepts a
- "const char *" parameter. This should fix a problem that was
- occuring on Solaris.
+ Fixed the test that checks if t_error() correctly accepts a
+ "const char *" parameter. This should fix a problem that was
+ occuring on Solaris.
Sat May 20 19:47:52 2000 Nanbor Wang <nanbor@cs.wustl.edu>
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 567500fb3e5..fb6c9ac24d4 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,34 +1,68 @@
+Wed May 24 18:56:16 2000 Darrell Brunsch <brunsch@uci.edu>:
+
+ * ace/OS_Export.h: (added)
+
+ In preparation for an eventual splitting up of the ACE DLLs,
+ I'm starting to split up the Export macros also. OS_Export will
+ be used for the lowest level OS library.
+
+ * ace/Makefile:
+ * ace/Makefile.am:
+ * ace/Makefile.bor:
+ * ace/ace-dll.icc:
+ * ace/ace-lib.icc:
+ * ace/ace_dll.dsp:
+ * ace/ace_lib.dsp:
+ * ace/OS.cpp:
+ * ace/OS.h:
+ * ace/OS.i:
+ * ace/OS_String.cpp: (added)
+ * ace/OS_String.h: (added)
+ * ace/OS_String.inl: (added)
+
+ Moved the string methods of ACE_OS to ACE_OS_String.
+
+ * ace/OS_Dirent.cpp:
+ * ace/OS_Dirent.h:
+ * ace/OS_Dirent.inl:
+
+ Separated the Win32 versions of some of the methods into the
+ cpp file. The Win32 versions were a bit too complicated to make
+ sense having inlined.
+
+ Also changed to use ACE_OS_Export.
+
Wed May 24 10:22:18 2000 Ossama Othman <ossama@uci.edu>
- * THANKS:
+ * THANKS:
- Added Håkon Innerdal <hakoni@funcom.com> to the list of
- contributors.
+ Added Håkon Innerdal <hakoni@funcom.com> to the list of
+ contributors.
- * ace/config-linux-common.h (ACE_DEFAULT_SELECT_REACTOR_SIZE):
+ * ace/config-linux-common.h (ACE_DEFAULT_SELECT_REACTOR_SIZE):
- Commented out the definition of this macro. Its setting
- unnecessarily limited the default size of the Select_Reactor to
- 256 file descriptors. `ace/OS.h' correctly sets the default
- size to FD_SETSIZE. Thanks to Håkon Innerdal
- <hakoni@funcom.com> for pointing this out.
+ Commented out the definition of this macro. Its setting
+ unnecessarily limited the default size of the Select_Reactor to
+ 256 file descriptors. `ace/OS.h' correctly sets the default
+ size to FD_SETSIZE. Thanks to Håkon Innerdal
+ <hakoni@funcom.com> for pointing this out.
- * ace/Select_Reactor_Base.cpp (open):
+ * ace/Select_Reactor_Base.cpp (open):
- Do not check if the desired size of the repository, i.e. the
- maximum number of file descriptors, is greater than FD_SETSIZE.
- The same check is effectively done in the call to
- ACE::set_handle_limits(). The redundant check also prevented
- the Reactor from supporting file descriptors numbering more than
- FD_SETSIZE on platforms that support them (e.g. via
- setrlimit(RLIMIT_NOFILE, ...)). Thanks to Håkon Innerdal
- <hakoni@funcom.com> for reporting the problem, and for providing
- a fix.
+ Do not check if the desired size of the repository, i.e. the
+ maximum number of file descriptors, is greater than FD_SETSIZE.
+ The same check is effectively done in the call to
+ ACE::set_handle_limits(). The redundant check also prevented
+ the Reactor from supporting file descriptors numbering more than
+ FD_SETSIZE on platforms that support them (e.g. via
+ setrlimit(RLIMIT_NOFILE, ...)). Thanks to Håkon Innerdal
+ <hakoni@funcom.com> for reporting the problem, and for providing
+ a fix.
- * m4/platform.m4 (ACE_DEFAULT_SELECT_REACTOR_SIZE):
+ * m4/platform.m4 (ACE_DEFAULT_SELECT_REACTOR_SIZE):
- No longer set the default size to 256 file descriptors.
- `ace/OS.h' correctly set it to FD_SETSIZE.
+ No longer set the default size to 256 file descriptors.
+ `ace/OS.h' correctly set it to FD_SETSIZE.
Wed May 24 10:08:37 2000 Joe Hoffert <joeh@cs.wustl.edu>
@@ -61,16 +95,16 @@ Wed May 24 08:10:21 2000 Steve Huston <shuston@riverace.com>
Tue May 23 20:13:52 2000 Irfan Pyarali <irfan@cs.wustl.edu>
- * ace/WFMO_Reactor.h: Moved the definition of WSANETWORKEVENTS to
- before its use. Thanks to Craig Perras <cperras@watchguard.com>
- for reporting this.
+ * ace/WFMO_Reactor.h: Moved the definition of WSANETWORKEVENTS to
+ before its use. Thanks to Craig Perras <cperras@watchguard.com>
+ for reporting this.
Tue May 23 17:59:06 2000 Luther J Baker <luther@cs.wustl.edu>
- * ACE_wrappers/pace/pace:
- Source files added.
- Changes to pace subdirectory will be noted in
- ACE_wrappers/pace/ChangeLog.
+ * ACE_wrappers/pace/pace:
+ Source files added.
+ Changes to pace subdirectory will be noted in
+ ACE_wrappers/pace/ChangeLog.
Tue May 23 17:55:17 2000 Steve Huston <shuston@riverace.com>
@@ -86,13 +120,13 @@ Tue May 23 17:21:37 2000 Steve Huston <shuston@riverace.com>
Tue May 23 16:37:27 2000 Luther J Baker <luther@cs.wustl.edu>
- * ACE_wrappers/pace directories added to ACE_wrappers:
+ * ACE_wrappers/pace directories added to ACE_wrappers:
- ACE_wrappers/pace/docs
- ACE_wrappers/pace/examples
- ACE_wrappers/pace/pace
- ACE_wrappers/pace/pace++
- ACE_wrappers/pace/tests
+ ACE_wrappers/pace/docs
+ ACE_wrappers/pace/examples
+ ACE_wrappers/pace/pace
+ ACE_wrappers/pace/pace++
+ ACE_wrappers/pace/tests
Mon May 22 15:26:42 2000 Steve Huston <shuston@riverace.com>
@@ -116,20 +150,20 @@ Wed May 10 16:47:31 2000 Steve Huston <shuston@riverace.com>
Mon May 22 15:25:33 2000 Nanbor Wang <nanbor@cs.wustl.edu>
- * ace/OS.{h,cpp} (ACE_Thread_Exit):
- * ace/Thread_Manager.cpp (~ACE_Thread_Exit): Moved the reset of
- ACE_Thread_Exit::is_constructed_ from the Thread_Exit's
- destructor to ACE_OS_Object_Manager::fini (). Otherwise, the
- singleton ACE_Thread_Exit may get created multiple times.
- Thanks to Eric Yee <eyee@authentica.com> for reporting the
- problem.
-
- Notice that ACE 5.1.1, 5.1.2 and 5.1.3 all have the same problem
- of creating TSS keys unnecessarily without cleaning them up.
- This will most likely cause a long running server process
- creating a lot of threads to crash eventually (at least on NT.)
- Therefore, you should not use these versions in a production
- environment.
+ * ace/OS.{h,cpp} (ACE_Thread_Exit):
+ * ace/Thread_Manager.cpp (~ACE_Thread_Exit): Moved the reset of
+ ACE_Thread_Exit::is_constructed_ from the Thread_Exit's
+ destructor to ACE_OS_Object_Manager::fini (). Otherwise, the
+ singleton ACE_Thread_Exit may get created multiple times.
+ Thanks to Eric Yee <eyee@authentica.com> for reporting the
+ problem.
+
+ Notice that ACE 5.1.1, 5.1.2 and 5.1.3 all have the same problem
+ of creating TSS keys unnecessarily without cleaning them up.
+ This will most likely cause a long running server process
+ creating a lot of threads to crash eventually (at least on NT.)
+ Therefore, you should not use these versions in a production
+ environment.
Mon May 22 11:23:19 2000 Pradeep Gore <pradeep@cs.wustl.edu>
@@ -149,17 +183,17 @@ Sun May 21 12:29:11 2000 Carlos O'Ryan <coryan@uci.edu>
Sun May 21 11:39:11 2000 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
- * tests/Signal_Test.cpp (worker_parent): My earlier fix on May 18th, 2000
- was incorrect. The right fix is to make the format specifier be
+ * tests/Signal_Test.cpp (worker_parent): My earlier fix on May 18th, 2000
+ was incorrect. The right fix is to make the format specifier be
%ld, rather than cast the pid_t to (int).
Sat May 20 18:34:05 2000 Ossama Othman <ossama@uci.edu>
- * configure.in (ACE_HAS_BROKEN_T_ERROR):
+ * configure.in (ACE_HAS_BROKEN_T_ERROR):
- Fixed the test that checks if t_error() correctly accepts a
- "const char *" parameter. This should fix a problem that was
- occuring on Solaris.
+ Fixed the test that checks if t_error() correctly accepts a
+ "const char *" parameter. This should fix a problem that was
+ occuring on Solaris.
Sat May 20 19:47:52 2000 Nanbor Wang <nanbor@cs.wustl.edu>
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 567500fb3e5..fb6c9ac24d4 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,34 +1,68 @@
+Wed May 24 18:56:16 2000 Darrell Brunsch <brunsch@uci.edu>:
+
+ * ace/OS_Export.h: (added)
+
+ In preparation for an eventual splitting up of the ACE DLLs,
+ I'm starting to split up the Export macros also. OS_Export will
+ be used for the lowest level OS library.
+
+ * ace/Makefile:
+ * ace/Makefile.am:
+ * ace/Makefile.bor:
+ * ace/ace-dll.icc:
+ * ace/ace-lib.icc:
+ * ace/ace_dll.dsp:
+ * ace/ace_lib.dsp:
+ * ace/OS.cpp:
+ * ace/OS.h:
+ * ace/OS.i:
+ * ace/OS_String.cpp: (added)
+ * ace/OS_String.h: (added)
+ * ace/OS_String.inl: (added)
+
+ Moved the string methods of ACE_OS to ACE_OS_String.
+
+ * ace/OS_Dirent.cpp:
+ * ace/OS_Dirent.h:
+ * ace/OS_Dirent.inl:
+
+ Separated the Win32 versions of some of the methods into the
+ cpp file. The Win32 versions were a bit too complicated to make
+ sense having inlined.
+
+ Also changed to use ACE_OS_Export.
+
Wed May 24 10:22:18 2000 Ossama Othman <ossama@uci.edu>
- * THANKS:
+ * THANKS:
- Added Håkon Innerdal <hakoni@funcom.com> to the list of
- contributors.
+ Added Håkon Innerdal <hakoni@funcom.com> to the list of
+ contributors.
- * ace/config-linux-common.h (ACE_DEFAULT_SELECT_REACTOR_SIZE):
+ * ace/config-linux-common.h (ACE_DEFAULT_SELECT_REACTOR_SIZE):
- Commented out the definition of this macro. Its setting
- unnecessarily limited the default size of the Select_Reactor to
- 256 file descriptors. `ace/OS.h' correctly sets the default
- size to FD_SETSIZE. Thanks to Håkon Innerdal
- <hakoni@funcom.com> for pointing this out.
+ Commented out the definition of this macro. Its setting
+ unnecessarily limited the default size of the Select_Reactor to
+ 256 file descriptors. `ace/OS.h' correctly sets the default
+ size to FD_SETSIZE. Thanks to Håkon Innerdal
+ <hakoni@funcom.com> for pointing this out.
- * ace/Select_Reactor_Base.cpp (open):
+ * ace/Select_Reactor_Base.cpp (open):
- Do not check if the desired size of the repository, i.e. the
- maximum number of file descriptors, is greater than FD_SETSIZE.
- The same check is effectively done in the call to
- ACE::set_handle_limits(). The redundant check also prevented
- the Reactor from supporting file descriptors numbering more than
- FD_SETSIZE on platforms that support them (e.g. via
- setrlimit(RLIMIT_NOFILE, ...)). Thanks to Håkon Innerdal
- <hakoni@funcom.com> for reporting the problem, and for providing
- a fix.
+ Do not check if the desired size of the repository, i.e. the
+ maximum number of file descriptors, is greater than FD_SETSIZE.
+ The same check is effectively done in the call to
+ ACE::set_handle_limits(). The redundant check also prevented
+ the Reactor from supporting file descriptors numbering more than
+ FD_SETSIZE on platforms that support them (e.g. via
+ setrlimit(RLIMIT_NOFILE, ...)). Thanks to Håkon Innerdal
+ <hakoni@funcom.com> for reporting the problem, and for providing
+ a fix.
- * m4/platform.m4 (ACE_DEFAULT_SELECT_REACTOR_SIZE):
+ * m4/platform.m4 (ACE_DEFAULT_SELECT_REACTOR_SIZE):
- No longer set the default size to 256 file descriptors.
- `ace/OS.h' correctly set it to FD_SETSIZE.
+ No longer set the default size to 256 file descriptors.
+ `ace/OS.h' correctly set it to FD_SETSIZE.
Wed May 24 10:08:37 2000 Joe Hoffert <joeh@cs.wustl.edu>
@@ -61,16 +95,16 @@ Wed May 24 08:10:21 2000 Steve Huston <shuston@riverace.com>
Tue May 23 20:13:52 2000 Irfan Pyarali <irfan@cs.wustl.edu>
- * ace/WFMO_Reactor.h: Moved the definition of WSANETWORKEVENTS to
- before its use. Thanks to Craig Perras <cperras@watchguard.com>
- for reporting this.
+ * ace/WFMO_Reactor.h: Moved the definition of WSANETWORKEVENTS to
+ before its use. Thanks to Craig Perras <cperras@watchguard.com>
+ for reporting this.
Tue May 23 17:59:06 2000 Luther J Baker <luther@cs.wustl.edu>
- * ACE_wrappers/pace/pace:
- Source files added.
- Changes to pace subdirectory will be noted in
- ACE_wrappers/pace/ChangeLog.
+ * ACE_wrappers/pace/pace:
+ Source files added.
+ Changes to pace subdirectory will be noted in
+ ACE_wrappers/pace/ChangeLog.
Tue May 23 17:55:17 2000 Steve Huston <shuston@riverace.com>
@@ -86,13 +120,13 @@ Tue May 23 17:21:37 2000 Steve Huston <shuston@riverace.com>
Tue May 23 16:37:27 2000 Luther J Baker <luther@cs.wustl.edu>
- * ACE_wrappers/pace directories added to ACE_wrappers:
+ * ACE_wrappers/pace directories added to ACE_wrappers:
- ACE_wrappers/pace/docs
- ACE_wrappers/pace/examples
- ACE_wrappers/pace/pace
- ACE_wrappers/pace/pace++
- ACE_wrappers/pace/tests
+ ACE_wrappers/pace/docs
+ ACE_wrappers/pace/examples
+ ACE_wrappers/pace/pace
+ ACE_wrappers/pace/pace++
+ ACE_wrappers/pace/tests
Mon May 22 15:26:42 2000 Steve Huston <shuston@riverace.com>
@@ -116,20 +150,20 @@ Wed May 10 16:47:31 2000 Steve Huston <shuston@riverace.com>
Mon May 22 15:25:33 2000 Nanbor Wang <nanbor@cs.wustl.edu>
- * ace/OS.{h,cpp} (ACE_Thread_Exit):
- * ace/Thread_Manager.cpp (~ACE_Thread_Exit): Moved the reset of
- ACE_Thread_Exit::is_constructed_ from the Thread_Exit's
- destructor to ACE_OS_Object_Manager::fini (). Otherwise, the
- singleton ACE_Thread_Exit may get created multiple times.
- Thanks to Eric Yee <eyee@authentica.com> for reporting the
- problem.
-
- Notice that ACE 5.1.1, 5.1.2 and 5.1.3 all have the same problem
- of creating TSS keys unnecessarily without cleaning them up.
- This will most likely cause a long running server process
- creating a lot of threads to crash eventually (at least on NT.)
- Therefore, you should not use these versions in a production
- environment.
+ * ace/OS.{h,cpp} (ACE_Thread_Exit):
+ * ace/Thread_Manager.cpp (~ACE_Thread_Exit): Moved the reset of
+ ACE_Thread_Exit::is_constructed_ from the Thread_Exit's
+ destructor to ACE_OS_Object_Manager::fini (). Otherwise, the
+ singleton ACE_Thread_Exit may get created multiple times.
+ Thanks to Eric Yee <eyee@authentica.com> for reporting the
+ problem.
+
+ Notice that ACE 5.1.1, 5.1.2 and 5.1.3 all have the same problem
+ of creating TSS keys unnecessarily without cleaning them up.
+ This will most likely cause a long running server process
+ creating a lot of threads to crash eventually (at least on NT.)
+ Therefore, you should not use these versions in a production
+ environment.
Mon May 22 11:23:19 2000 Pradeep Gore <pradeep@cs.wustl.edu>
@@ -149,17 +183,17 @@ Sun May 21 12:29:11 2000 Carlos O'Ryan <coryan@uci.edu>
Sun May 21 11:39:11 2000 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
- * tests/Signal_Test.cpp (worker_parent): My earlier fix on May 18th, 2000
- was incorrect. The right fix is to make the format specifier be
+ * tests/Signal_Test.cpp (worker_parent): My earlier fix on May 18th, 2000
+ was incorrect. The right fix is to make the format specifier be
%ld, rather than cast the pid_t to (int).
Sat May 20 18:34:05 2000 Ossama Othman <ossama@uci.edu>
- * configure.in (ACE_HAS_BROKEN_T_ERROR):
+ * configure.in (ACE_HAS_BROKEN_T_ERROR):
- Fixed the test that checks if t_error() correctly accepts a
- "const char *" parameter. This should fix a problem that was
- occuring on Solaris.
+ Fixed the test that checks if t_error() correctly accepts a
+ "const char *" parameter. This should fix a problem that was
+ occuring on Solaris.
Sat May 20 19:47:52 2000 Nanbor Wang <nanbor@cs.wustl.edu>
diff --git a/PACE/ChangeLog b/PACE/ChangeLog
index 7c9a6665340..a6b6a12500b 100644
--- a/PACE/ChangeLog
+++ b/PACE/ChangeLog
@@ -1,28 +1,34 @@
+Wed May 24 18:56:16 2000 Darrell Brunsch <brunsch@uci.edu>
+
+ * pace/docs/ACE_Integration.txt: (added)
+
+ For the PACE crew, a file used to document our progress in
+ splitting of ACE_OS and the PACE integration.
+
Wed May 24 14:40:41 2000 Luther J Baker <luther@cs.wustl.edu>
- * README/VERSION:
- Added to repository.
+ * README/VERSION:
+ Added to repository.
Tue May 23 18:22:48 2000 Luther J Baker <luther@cs.wustl.edu>
- * pace/pace/Makefile:
- Added to repository.
+ * pace/pace/Makefile:
+ Added to repository.
- * 'touch' to force dirs to show up with cvs co -P
- pace/docs/README
- pace/examples/README
- pace/pace/README
- pace/pace++/README
- pace/tests/README
+ * 'touch' to force dirs to show up with cvs co -P
+ pace/docs/README
+ pace/examples/README
+ pace/pace/README
+ pace/pace++/README
+ pace/tests/README
Tue May 23 17:59:06 2000 Luther J Baker <luther@cs.wustl.edu>
- * docs/todo.txt:
- Currently, all .o files appear in the
- ACE_wrappers/pace/pace directory (e.g.: nested
- files such as pace/pace/sys/socket.c generate
- pace/pace/socket.o. See pace/docs/todo.txt.
+ * docs/todo.txt:
+ Currently, all .o files appear in the
+ ACE_wrappers/pace/pace directory (e.g.: nested
+ files such as pace/pace/sys/socket.c generate
+ pace/pace/socket.o. See pace/docs/todo.txt.
- * ACE_wrappers/pace/pace:
- Source files added.
-
+ * ACE_wrappers/pace/pace:
+ Source files added.
diff --git a/PACE/docs/ACE_Integration.txt b/PACE/docs/ACE_Integration.txt
new file mode 100644
index 00000000000..92fa22e8723
--- /dev/null
+++ b/PACE/docs/ACE_Integration.txt
@@ -0,0 +1,17 @@
+These are the plans for splitting up ACE_OS and their status for both being
+split up and being PACE enabled.
+
+Finished:
+---------
+OS_Dirent
+OS_String
+
+Planned:
+--------
+OS_Stdio
+OS_Memory
+OS_Process
+OS_Synch
+OS_Socket
+OS_QoS
+
diff --git a/ace/Makefile b/ace/Makefile
index 3b11b2a8307..4457f9d9b58 100644
--- a/ace/Makefile
+++ b/ace/Makefile
@@ -12,6 +12,7 @@ OS_FILES = \
Basic_Types \
OS \
OS_Dirent \
+ OS_String \
Sched_Params
UTILS_FILES = \
ACE \
diff --git a/ace/Makefile.am b/ace/Makefile.am
index ff0949b090b..ac788d2d8b8 100644
--- a/ace/Makefile.am
+++ b/ace/Makefile.am
@@ -135,6 +135,7 @@ libACE_OS_la_SOURCES = \
Basic_Types.cpp \
OS.cpp \
OS_Dirent.cpp \
+ OS_String.cpp \
Sched_Params.cpp
libACE_Utils_la_SOURCES = \
diff --git a/ace/Makefile.bor b/ace/Makefile.bor
index b25c580e836..7ceb34ccd62 100644
--- a/ace/Makefile.bor
+++ b/ace/Makefile.bor
@@ -93,6 +93,7 @@ OBJFILES = \
$(OBJDIR)\Obstack.obj \
$(OBJDIR)\OS.obj \
$(OBJDIR)\OS_Dirent.obj \
+ $(OBJDIR)\OS_String.obj \
$(OBJDIR)\Pair.obj \
$(OBJDIR)\Parse_Node.obj \
$(OBJDIR)\Pipe.obj \
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 263950de9e3..5e185b3301b 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -6838,285 +6838,6 @@ exit (int status)
# endif /* UNDER_CE && UNDER_CE < 211 */
# endif /* ACE_HAS_WINCE */
-#if defined (ACE_HAS_STRPTIME)
-# if defined (ACE_LACKS_NATIVE_STRPTIME)
-int
-ACE_OS::strptime_getnum (char *buf,
- int *num,
- int *bi,
- int *fi,
- int min,
- int max)
-{
- int i = 0, tmp = 0;
-
- while (isdigit (buf[i]))
- {
- tmp = (tmp * 10) + (buf[i] - '0');
- if (max && (tmp > max))
- return 0;
- i++;
- }
-
- if (tmp < min)
- return 0;
- else if (i)
- {
- *num = tmp;
- (*fi)++;
- *bi += i;
- return 1;
- }
- else
- return 0;
-}
-# endif /* ACE_LACKS_NATIVE_STRPTIME */
-
-char *
-ACE_OS::strptime (char *buf,
- const char *format,
- struct tm *tm)
-{
-#if !defined (ACE_HAS_WINCE)
-#if defined (ACE_LACKS_NATIVE_STRPTIME)
- int bi = 0;
- int fi = 0;
- int percent = 0;
-
- if (!buf || !format)
- return 0;
-
- while (format[fi] != '\0')
- {
- if (percent)
- {
- percent = 0;
- switch (format[fi])
- {
- case '%': // an escaped %
- if (buf[bi] == '%')
- {
- fi++; bi++;
- }
- else
- return buf + bi;
- break;
-
- /* not supported yet: weekday via locale long/short names
- case 'a': / * weekday via locale * /
- / * FALL THROUGH * /
- case 'A': / * long/short names * /
- break;
- */
-
- /* not supported yet:
- case 'b': / * month via locale * /
- / * FALL THROUGH * /
- case 'B': / * long/short names * /
- / * FALL THROUGH * /
- case 'h':
- break;
- */
-
- /* not supported yet:
- case 'c': / * %x %X * /
- break;
- */
-
- /* not supported yet:
- case 'C': / * date & time - * /
- / * locale long format * /
- break;
- */
-
- case 'd': /* day of month (1-31) */
- /* FALL THROUGH */
- case 'e':
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mday, &bi, &fi, 1, 31))
- return buf + bi;
-
- break;
-
- case 'D': /* %m/%d/%y */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mon, &bi, &fi, 1, 12))
- return buf + bi;
-
- fi--;
- tm->tm_mon--;
-
- if (buf[bi] != '/')
- return buf + bi;
-
- bi++;
-
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mday, &bi, &fi, 1, 31))
- return buf + bi;
-
- fi--;
- if (buf[bi] != '/')
- return buf + bi;
- bi++;
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_year, &bi, &fi, 0, 99))
- return buf + bi;
- if (tm->tm_year < 69)
- tm->tm_year += 100;
- break;
-
- case 'H': /* hour (0-23) */
- /* FALL THROUGH */
- case 'k':
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_hour, &bi, &fi, 0, 23))
- return buf + bi;
- break;
-
- /* not supported yet:
- case 'I': / * hour (0-12) * /
- / * FALL THROUGH * /
- case 'l':
- break;
- */
-
- case 'j': /* day of year (0-366) */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_yday, &bi, &fi, 1, 366))
- return buf + bi;
-
- tm->tm_yday--;
- break;
-
- case 'm': /* an escaped % */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mon, &bi, &fi, 1, 12))
- return buf + bi;
-
- tm->tm_mon--;
- break;
-
- case 'M': /* minute (0-59) */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_min, &bi, &fi, 0, 59))
- return buf + bi;
-
- break;
-
- /* not supported yet:
- case 'p': / * am or pm for locale * /
- break;
- */
-
- /* not supported yet:
- case 'r': / * %I:%M:%S %p * /
- break;
- */
-
- case 'R': /* %H:%M */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_hour, &bi, &fi, 0, 23))
- return buf + bi;
-
- fi--;
- if (buf[bi] != ':')
- return buf + bi;
- bi++;
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_min, &bi, &fi, 0, 59))
- return buf + bi;
-
- break;
-
- case 'S': /* seconds (0-61) */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_sec, &bi, &fi, 0, 61))
- return buf + bi;
- break;
-
- case 'T': /* %H:%M:%S */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_hour, &bi, &fi, 0, 23))
- return buf + bi;
-
- fi--;
- if (buf[bi] != ':')
- return buf + bi;
- bi++;
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_min, &bi, &fi, 0, 59))
- return buf + bi;
-
- fi--;
- if (buf[bi] != ':')
- return buf + bi;
- bi++;
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_sec, &bi, &fi, 0, 61))
- return buf + bi;
-
- break;
-
- case 'w': /* day of week (0=Sun-6) */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_wday, &bi, &fi, 0, 6))
- return buf + bi;
-
- break;
-
- /* not supported yet: date, based on locale
- case 'x': / * date, based on locale * /
- break;
- */
-
- /* not supported yet:
- case 'X': / * time, based on locale * /
- break;
- */
-
- case 'y': /* the year - 1900 (0-99) */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_year, &bi, &fi, 0, 99))
- return buf + bi;
-
- if (tm->tm_year < 69)
- tm->tm_year += 100;
- break;
-
- case 'Y': /* the full year (1999) */
- if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_year, &bi, &fi, 0, 0))
- return buf + bi;
-
- tm->tm_year -= 1900;
- break;
-
- default: /* unrecognised */
- return buf + bi;
- } /* switch (format[fi]) */
-
- }
- else
- { /* if (percent) */
- if (format[fi] == '%')
- {
- percent = 1;
- fi++;
- }
- else
- {
- if (format[fi] == buf[bi])
- {
- fi++;
- bi++;
- }
- else
- return buf + bi;
- }
- } /* if (percent) */
- } /* while (format[fi] */
-
- return buf + bi;
-#else /* ! ACE_LACKS_NATIVE_STRPTIME */
- return ::strptime (buf,
- format,
- tm);
-#endif /* ! ACE_LACKS_NATIVE_STRPTIME */
-#else /* ! ACE_HAS_WINCE */
- ACE_UNUSED_ARG (buf);
- ACE_UNUSED_ARG (format);
- ACE_UNUSED_ARG (tm);
-
- ACE_NOTSUP_RETURN (0);
-#endif /* ! ACE_HAS_WINCE */
-}
-#endif /* ACE_HAS_STRPTIME */
-
-
// You may be asking yourself, why are we doing this? Well, in winbase.h,
// MS didn't follow their normal Api_FunctionA and Api_FunctionW style,
// so we have to #undef their define to get access to the unicode version.
diff --git a/ace/OS.h b/ace/OS.h
index ef20003354e..4ce6387a355 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -27,6 +27,7 @@
// Include the split up ACE_OS classes
#include "ace/OS_Dirent.h"
+#include "ace/OS_String.h"
# if !defined (ACE_MALLOC_ALIGN)
# define ACE_MALLOC_ALIGN ((int) sizeof (long))
@@ -5200,7 +5201,7 @@ private:
// (ACT).
};
-class ACE_Export ACE_OS : public ACE_OS_Dirent
+class ACE_Export ACE_OS : public ACE_OS_Dirent, public ACE_OS_String
{
// = TITLE
// This class defines an OS independent programming API that
@@ -6151,117 +6152,6 @@ public:
static int step (const char *str,
char *expbuf);
- // = A set of wrappers for string operations.
-
- static int to_lower (int c);
-#if defined (ACE_HAS_WCHAR)
- static wint_t to_lower (wint_t c);
-#endif /* ACE_HAS_WCHAR */
-
- static char *strcat (char *s, const char *t);
- static char *strncat (char *s, const char *t, size_t len);
-#if defined (ACE_HAS_WCHAR)
- static wchar_t *strcat (wchar_t *s, const wchar_t *t);
- static wchar_t *strncat (wchar_t *s, const wchar_t *t, size_t len);
-#endif /* ACE_HAS_WCHAR */
-
- static char *strchr (char *s, int c);
- static const char *strchr (const char *s, int c);
- static char *strrchr (char *s, int c);
- static const char *strrchr (const char *s, int c);
- static char *strnchr (char *s, int c, size_t len);
- static const char *strnchr (const char *s, int c, size_t len);
-#if defined (ACE_HAS_WCHAR)
- static wchar_t *strchr (wchar_t *s, wint_t c);
- static const wchar_t *strchr (const wchar_t *s, wint_t c);
- static wchar_t *strrchr (wchar_t *s, wint_t c);
- static const wchar_t *strrchr (const wchar_t *s, wint_t c);
- static wchar_t *strnchr (wchar_t *s, wint_t c, size_t len);
- static const wchar_t *strnchr (const wchar_t *s, wint_t c, size_t len);
-#endif /* ACE_HAS_WCHAR */
-
- static int strcmp (const char *s, const char *t);
- static int strncmp (const char *s, const char *t, size_t len);
- static int strcasecmp (const char *s, const char *t);
- static int strncasecmp (const char *s, const char *t, size_t len);
-#if defined (ACE_HAS_WCHAR)
- static int strcmp (const wchar_t *s, const wchar_t *t);
- static int strncmp (const wchar_t *s, const wchar_t *t, size_t len);
- static int strcasecmp (const wchar_t *s, const wchar_t *t);
- static int strncasecmp (const wchar_t *s, const wchar_t *t, size_t len);
-#endif /* ACE_HAS_WCHAR */
-
- static char *strcpy (char *s, const char *t);
- static char *strecpy (char *des, const char *src);
- // Copies <src> to <des>, returning a pointer to the end of the
- // copied region, rather than the beginning, as <strcpy> does.
- static char *strncpy (char *s, const char *t, size_t len);
-#if defined (ACE_HAS_WCHAR)
- static wchar_t *strcpy (wchar_t *s, const wchar_t *t);
- static wchar_t *strecpy (wchar_t *s, const wchar_t *t);
- static wchar_t *strncpy (wchar_t *s, const wchar_t *t, size_t len);
-#endif /* ACE_HAS_WCHAR */
-
- static char *strpbrk (char *s1, const char *s2);
- static const char *strpbrk (const char *s1, const char *s2);
-#if defined (ACE_HAS_WCHAR)
- static wchar_t *strpbrk (wchar_t *s1, const wchar_t *s2);
- static const wchar_t *strpbrk (const wchar_t *s1, const wchar_t *s2);
-#endif /* ACE_HAS_WCHAR */
-
-
- static size_t strcspn (const char *s, const char *reject);
-
- static size_t strspn (const char *s1, const char *s2);
-#if defined (ACE_HAS_WCHAR)
- static size_t strspn (const wchar_t *s1, const wchar_t *s2);
-#endif /* ACE_HAS_WCHAR */
-
-#if defined (ACE_HAS_STRPTIME)
- static char *strptime (char *buf,
- const char *format,
- struct tm *tm);
-#endif /* ACE_HAS_STRPTIME */
-
- static char *strstr (char *s, const char *t);
- static const char *strstr (const char *s, const char *t);
- static char *strnstr (char *s, const char *t, size_t len);
- static const char *strnstr (const char *s, const char *t, size_t len);
-#if defined (ACE_HAS_WCHAR)
- static wchar_t *strstr (wchar_t *s, const wchar_t *t);
- static const wchar_t *strstr (const wchar_t *s, const wchar_t *t);
- static wchar_t *strnstr (wchar_t *s, const wchar_t *t, size_t len);
- static const wchar_t *strnstr (const wchar_t *s, const wchar_t *t, size_t len);
-#endif /* ACE_HAS_WCHAR */
-
- static char *strdup (const char *s); // Uses malloc
-#if defined (ACE_HAS_WCHAR)
- static wchar_t *strdup (const wchar_t *s);
-#endif /* ACE_HAS_WCHAR */
-
- static size_t strlen (const char *s);
-#if defined (ACE_HAS_WCHAR)
- static size_t strlen (const wchar_t *s);
-#endif /* ACE_HAS_WCHAR */
-
- static char *strtok (char *s, const char *tokens);
- static char *strtok_r (char *s, const char *tokens, char **lasts);
-#if defined (ACE_HAS_WCHAR)
- static wchar_t *strtok (wchar_t *s, const wchar_t *tokens);
-#endif /* ACE_HAS_WCHAR */
-
- static long strtol (const char *s, char **ptr, int base);
- static u_long strtoul (const char *s, char **ptr, int base);
- static double strtod (const char *s, char **endptr);
-#if defined (ACE_HAS_WCHAR)
- static long strtol (const wchar_t *s, wchar_t **ptr, int base);
- static u_long strtoul (const wchar_t *s, wchar_t **ptr, int base);
- static double strtod (const wchar_t *s, wchar_t **endptr);
-#endif /* ACE_HAS_WCHAR */
-
- static int ace_isspace (const ACE_TCHAR s);
- static int ace_isprint (const ACE_TCHAR s);
-
// @@ UNICODE: (brunsch) Can this be handled better?
// The following WChar typedef and functions are used by TAO. TAO
// does not use wchar_t because the size of wchar_t is
@@ -6544,15 +6434,6 @@ private:
friend class ACE_OS_Object_Manager;
// Allow the ACE_OS_Object_Manager to call set_exit_hook.
-#if defined (ACE_HAS_STRPTIME) && defined (ACE_LACKS_NATIVE_STRPTIME)
- static int strptime_getnum (char *buf,
- int *num,
- int *bi,
- int *fi,
- int min,
- int max);
-#endif /* ACE_HAS_STRPTIME && ACE_LACKS_NATIVE_STRPTIME */
-
# if defined (ACE_WIN32)
# if defined (ACE_HAS_WINCE)
static const wchar_t *day_of_week_name[7];
diff --git a/ace/OS.i b/ace/OS.i
index e130404d7e8..b635bfb4e40 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -1382,491 +1382,6 @@ ACE_OS::memset (void *s, int c, size_t len)
return ::memset (s, c, len);
}
-ACE_INLINE char *
-ACE_OS::strcat (char *s, const char *t)
-{
- ACE_TRACE ("ACE_OS::strcat");
- return ::strcat (s, t);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strcat (wchar_t *s, const wchar_t *t)
-{
- ACE_TRACE ("ACE_OS::strcat");
- return ::wcscat (s, t);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE size_t
-ACE_OS::strcspn (const char *s, const char *reject)
-{
-#if !defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strcspn");
- return ::strcspn (s, reject);
-#else
- const char *scan;
- const char *rej_scan;
- int count = 0;
-
- for (scan = s; *scan; scan++)
- {
-
- for (rej_scan = reject; *rej_scan; rej_scan++)
- if (*scan == *rej_scan)
- return count;
-
- count++;
- }
-
- return count;
-#endif /* ACE_HAS_WINCE */
-}
-
-ACE_INLINE size_t
-ACE_OS::strspn (const char *s, const char *t)
-{
-#if !defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strspn");
- return ::strspn (s, t);
-#else
- ACE_UNUSED_ARG (s);
- ACE_UNUSED_ARG (t);
- ACE_NOTSUP_RETURN (-1);
-#endif /* ACE_HAS_WINCE */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE size_t
-ACE_OS::strspn (const wchar_t*s, const wchar_t *t)
-{
- ACE_TRACE ("ACE_OS::strspn");
- return ::wcsspn (s, t);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strchr (char *s, int c)
-{
-#if !defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strchr");
- return ::strchr (s, c);
-#else
- for (;;++s)
- {
- if (*s == c)
- return s;
- if (*s == 0)
- return 0;
- }
-#endif /* ACE_HAS_WINCE */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strchr (wchar_t *s, wint_t c)
-{
- ACE_TRACE ("ACE_OS::strchr");
- return ::wcschr (s, c);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE const char *
-ACE_OS::strchr (const char *s, int c)
-{
-#if !defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strchr");
- return (const char *) ::strchr (s, c);
-#else
- for (;;++s)
- {
- if (*s == c)
- return s;
- if (*s == 0)
- return 0;
- }
-#endif /* ACE_HAS_WINCE */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE const wchar_t *
-ACE_OS::strchr (const wchar_t *s, wint_t c)
-{
- ACE_TRACE ("ACE_OS::strchr");
- return (const wchar_t *) ::wcschr (s, c);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE const char *
-ACE_OS::strnchr (const char *s, int c, size_t len)
-{
- for (size_t i = 0; i < len; i++)
- if (s[i] == c)
- return s + i;
-
- return 0;
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE const wchar_t *
-ACE_OS::strnchr (const wchar_t *s, wint_t c, size_t len)
-{
- for (size_t i = 0; i < len; i++)
- if (s[i] == c)
- return s + i;
-
- return 0;
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strnchr (char *s, int c, size_t len)
-{
-#if defined ACE_PSOS_DIAB_PPC //Complier problem Diab 4.2b
- const char *const_char_s=s;
- return (char *) ACE_OS::strnchr (const_char_s, c, len);
-#else
- return (char *) ACE_OS::strnchr ((const char *) s, c, len);
-#endif
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strnchr (wchar_t *s, wint_t c, size_t len)
-{
-#if defined ACE_PSOS_DIAB_PPC //Complier problem Diab 4.2b
- const wchar_t *const_wchar_s=s;
- return (wchar_t *) ACE_OS::strnchr (const_wchar_s, c, len);
-#else
- return (wchar_t *) ACE_OS::strnchr ((const wchar_t *) s, c, len);
-#endif
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE const char *
-ACE_OS::strstr (const char *s, const char *t)
-{
- ACE_TRACE ("ACE_OS::strstr");
- return (const char *) ::strstr (s, t);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE const wchar_t *
-ACE_OS::strstr (const wchar_t *s, const wchar_t *t)
-{
- ACE_TRACE ("ACE_OS::strstr");
- return (const wchar_t *) ::wcsstr (s, t);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strstr (char *s, const char *t)
-{
- ACE_TRACE ("ACE_OS::strstr");
- return ::strstr (s, t);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strstr (wchar_t *s, const wchar_t *t)
-{
- ACE_TRACE ("ACE_OS::strstr");
- return ::wcsstr (s, t);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE size_t
-ACE_OS::strlen (const char *s)
-{
- return ::strlen (s);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE size_t
-ACE_OS::strlen (const wchar_t *s)
-{
- return ::wcslen (s);
-}
-#endif
-
-ACE_INLINE const char *
-ACE_OS::strnstr (const char *s1, const char *s2, size_t len2)
-{
- // Substring length
- size_t len1 = ACE_OS::strlen (s1);
-
- // Check if the substring is longer than the string being searched.
- if (len2 > len1)
- return 0;
-
- // Go upto <len>
- size_t len = len1 - len2;
-
- for (size_t i = 0; i <= len; i++)
- {
- if (ACE_OS::memcmp (s1 + i, s2, len2) == 0)
- // Found a match! Return the index.
- return s1 + i;
- }
-
- return 0;
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE const wchar_t *
-ACE_OS::strnstr (const wchar_t *s1, const wchar_t *s2, size_t len2)
-{
- // Substring length
- size_t len1 = ACE_OS::strlen (s1);
-
- // Check if the substring is longer than the string being searched.
- if (len2 > len1)
- return 0;
-
- // Go upto <len>
- size_t len = len1 - len2;
-
- for (size_t i = 0; i <= len; i++)
- {
- if (ACE_OS::memcmp (s1 + i, s2, len2 * sizeof (wchar_t)) == 0)
- // Found a match! Return the index.
- return s1 + i;
- }
-
- return 0;
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strnstr (char *s, const char *t, size_t len)
-{
-#if defined ACE_PSOS_DIAB_PPC //Complier problem Diab 4.2b
- const char *const_char_s=s;
- return (char *) ACE_OS::strnstr (const_char_s, t, len);
-#else
- return (char *) ACE_OS::strnstr ((const char *) s, t, len);
-#endif
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strnstr (wchar_t *s, const wchar_t *t, size_t len)
-{
- return (wchar_t *) ACE_OS::strnstr ((const wchar_t *) s, t, len);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strrchr (char *s, int c)
-{
- ACE_TRACE ("ACE_OS::strrchr");
-#if !defined (ACE_LACKS_STRRCHR)
- return ::strrchr (s, c);
-#else
- char *p = s + ::strlen (s);
-
- while (*p != c)
- if (p == s)
- return 0;
- else
- p--;
-
- return p;
-#endif /* ACE_LACKS_STRRCHR */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE const wchar_t *
-ACE_OS::strrchr (const wchar_t *s, wint_t c)
-{
- ACE_TRACE ("ACE_OS::strrchr");
-# if !defined (ACE_LACKS_WCSRCHR)
- return (const wchar_t *) ::wcsrchr (s, c);
-# else
- const wchar_t *p = s + ::wcslen (s);
-
- while (*p != c)
- if (p == s)
- return 0;
- else
- p--;
-
- return p;
-# endif /* ACE_LACKS_WCSRCHR */
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE const char *
-ACE_OS::strrchr (const char *s, int c)
-{
- ACE_TRACE ("ACE_OS::strrchr");
-#if !defined (ACE_LACKS_STRRCHR)
- return (const char *) ::strrchr (s, c);
-#else
- const char *p = s + ::strlen (s);
-
- while (*p != c)
- if (p == s)
- return 0;
- else
- p--;
-
- return p;
-#endif /* ACE_LACKS_STRRCHR */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strrchr (wchar_t *s, wint_t c)
-{
- ACE_TRACE ("ACE_OS::strrchr");
-# if !defined (ACE_LACKS_WCSRCHR)
- return (wchar_t *) ::wcsrchr (s, c);
-# else
- wchar_t *p = s + ::wcslen (s);
-
- while (*p != c)
- if (p == s)
- return 0;
- else
- p--;
-
- return p;
-# endif /* ACE_LACKS_WCSRCHR */
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE int
-ACE_OS::strcmp (const char *s, const char *t)
-{
- return ::strcmp (s, t);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE int
-ACE_OS::strcmp (const wchar_t *s, const wchar_t *t)
-{
- return ::wcscmp (s, t);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strcpy (char *s, const char *t)
-{
- return ::strcpy (s, t);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strcpy (wchar_t *s, const wchar_t *t)
-{
- return ::wcscpy (s, t);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strecpy (char *s, const char *t)
-{
- register char *dscan = s;
- register const char *sscan = t;
-
- while ((*dscan++ = *sscan++) != '\0')
- continue;
-
- return dscan;
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strecpy (wchar_t *s, const wchar_t *t)
-{
- register wchar_t *dscan = s;
- register const wchar_t *sscan = t;
-
- while ((*dscan++ = *sscan++) != L'\0')
- continue;
-
- return dscan;
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE int
-ACE_OS::to_lower (int c)
-{
- ACE_TRACE ("ACE_OS::to_lower");
- return tolower (c);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wint_t
-ACE_OS::to_lower (wint_t c)
-{
- ACE_TRACE ("ACE_OS::to_lower");
- return ::towlower (c);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strpbrk (char *s1, const char *s2)
-{
-#if !defined (ACE_HAS_WINCE)
- return ::strpbrk (s1, s2);
-#else
- ACE_UNUSED_ARG (s1);
- ACE_UNUSED_ARG (s2);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_WINCE */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strpbrk (wchar_t *s, const wchar_t *t)
-{
- ACE_TRACE ("ACE_OS::wcspbrk");
- return ::wcspbrk (s, t);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE const char *
-ACE_OS::strpbrk (const char *s1, const char *s2)
-{
-#if !defined (ACE_HAS_WINCE)
- return (const char *) ::strpbrk (s1, s2);
-#else
- ACE_UNUSED_ARG (s1);
- ACE_UNUSED_ARG (s2);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_WINCE */
-}
-
-ACE_INLINE char *
-ACE_OS::strdup (const char *s)
-{
- // @@ WINCE Should we provide this function on WinCE?
-#if defined (ACE_HAS_STRDUP_EMULATION)
- char *t = (char *) ACE_OS::malloc (::strlen (s) + 1);
- if (t == 0)
- return 0;
- else
- return ACE_OS::strcpy (t, s);
-#else
- return ::strdup (s);
-#endif /* ACE_HAS_STRDUP_EMULATION */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strdup (const wchar_t *s)
-{
-# if defined (__BORLANDC__)
- wchar_t *buffer = (wchar_t *) malloc ((ACE_OS::strlen (s) + 1) * sizeof (wchar_t));
- return ::wcscpy (buffer, s);
-# else
- return ::wcsdup (s);
-# endif /* __BORLANDC__ */
-}
-#endif /* ACE_HAS_WCHAR */
-
#if !defined (ACE_HAS_WINCE)
ACE_INLINE int
ACE_OS::vsprintf (char *buffer, const char *format, va_list argptr)
@@ -1883,352 +1398,6 @@ ACE_OS::vsprintf (wchar_t *buffer, const wchar_t *format, va_list argptr)
}
#endif /* ACE_HAS_WCHAR */
-ACE_INLINE int
-ACE_OS::strcasecmp (const char *s, const char *t)
-{
-#if !defined (ACE_WIN32) || defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strcasecmp");
-# if defined (ACE_LACKS_STRCASECMP)
- const char *scan1 = s;
- const char *scan2 = t;
-
- while (*scan1 != 0
- && ACE_OS::to_lower (*scan1) == ACE_OS::to_lower (*scan2))
- {
- ++scan1;
- ++scan2;
- }
-
- // The following case analysis is necessary so that characters which
- // look negative collate low against normal characters but high
- // against the end-of-string NUL.
-
- if (*scan1 == '\0' && *scan2 == '\0')
- return 0;
- else if (*scan1 == '\0')
- return -1;
- else if (*scan2 == '\0')
- return 1;
- else
- return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2);
-# else
- return ::strcasecmp (s, t);
-# endif /* ACE_LACKS_STRCASECMP */
-#else /* ACE_WIN32 */
- return ::_stricmp (s, t);
-#endif /* ACE_WIN32 */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE int
-ACE_OS::strcasecmp (const wchar_t *s, const wchar_t *t)
-{
- ACE_TRACE ("ACE_OS::strcasecmp");
-
-# if !defined (ACE_WIN32)
- const wchar_t *scan1 = s;
- const wchar_t *scan2 = t;
-
- while (*scan1 != 0
- && ACE_OS::to_lower (*scan1) == ACE_OS::to_lower (*scan2))
- {
- ++scan1;
- ++scan2;
- }
-
- // The following case analysis is necessary so that characters which
- // look negative collate low against normal characters but high
- // against the end-of-string NUL.
-
- if (*scan1 == '\0' && *scan2 == '\0')
- return 0;
- else if (*scan1 == '\0')
- return -1;
- else if (*scan2 == '\0')
- return 1;
- else
- return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2);
-# else /* ACE_WIN32 */
- return ::_wcsicmp (s, t);
-# endif /* ACE_WIN32 */
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE int
-ACE_OS::strncasecmp (const char *s,
- const char *t,
- size_t len)
-{
-#if !defined (ACE_WIN32) || defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strncasecmp");
-# if defined (ACE_LACKS_STRCASECMP)
- const char *scan1 = s;
- const char *scan2 = t;
- ssize_t count = ssize_t (len);
-
- while (--count >= 0
- && *scan1 != 0
- && ACE_OS::to_lower (*scan1) == ACE_OS::to_lower (*scan2))
- {
- ++scan1;
- ++scan2;
- }
-
- if (count < 0)
- return 0;
-
- // The following case analysis is necessary so that characters which
- // look negative collate low against normal characters but high
- // against the end-of-string NUL.
-
- if (*scan1 == '\0' && *scan2 == '\0')
- return 0;
- else if (*scan1 == '\0')
- return -1;
- else if (*scan2 == '\0')
- return 1;
- else
- return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2);
-# else
- return ::strncasecmp (s, t, len);
-# endif /* ACE_LACKS_STRCASECMP */
-#else /* ACE_WIN32 */
- return ::_strnicmp (s, t, len);
-#endif /* ACE_WIN32 */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE int
-ACE_OS::strncasecmp (const wchar_t *s,
- const wchar_t *t,
- size_t len)
-{
- ACE_TRACE ("ACE_OS::strcasecmp");
-
-# if !defined (ACE_WIN32)
- const wchar_t *scan1 = s;
- const wchar_t *scan2 = t;
- ssize_t count = ssize_t (n);
-
- while (--count >= 0
- && *scan1 != 0
- && ACE_OS::to_lower (*scan1) == ACE_OS::to_lower (*scan2))
- {
- ++scan1;
- ++scan2;
- }
-
- if (count < 0)
- return 0;
-
- // The following case analysis is necessary so that characters which
- // look negative collate low against normal characters but high
- // against the end-of-string NUL.
-
- if (*scan1 == '\0' && *scan2 == '\0')
- return 0;
- else if (*scan1 == '\0')
- return -1;
- else if (*scan2 == '\0')
- return 1;
- else
- return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2);
-# else /* ACE_WIN32 */
- return ::_wcsnicmp (s, t, len);
-# endif /* ACE_WIN32 */
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE int
-ACE_OS::strncmp (const char *s, const char *t, size_t len)
-{
- ACE_TRACE ("ACE_OS::strncmp");
- return ::strncmp (s, t, len);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE int
-ACE_OS::strncmp (const wchar_t *s, const wchar_t *t, size_t len)
-{
- ACE_TRACE ("ACE_OS::strncmp");
- return ::wcsncmp (s, t, len);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strncpy (char *s, const char *t, size_t len)
-{
- return ::strncpy (s, t, len);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strncpy (wchar_t *s, const wchar_t *t, size_t len)
-{
- return ::wcsncpy (s, t, len);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strncat (char *s, const char *t, size_t len)
-{
- ACE_TRACE ("ACE_OS::strncat");
- return ::strncat (s, t, len);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strncat (wchar_t *s, const wchar_t *t, size_t len)
-{
- ACE_TRACE ("ACE_OS::strncat");
- return ::wcsncat (s, t, len);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE char *
-ACE_OS::strtok (char *s, const char *tokens)
-{
- ACE_TRACE ("ACE_OS::strtok");
- return ::strtok (s, tokens);
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE wchar_t *
-ACE_OS::strtok (wchar_t *s, const wchar_t *tokens)
-{
- ACE_TRACE ("ACE_OS::strtok");
- return ::wcstok (s, tokens);
-}
-#endif /* ACE_HAS_WCHAR */
-
-
-ACE_INLINE char *
-ACE_OS::strtok_r (char *s, const char *tokens, char **lasts)
-{
- ACE_TRACE ("ACE_OS::strtok_r");
-#if defined (ACE_HAS_REENTRANT_FUNCTIONS)
- return ::strtok_r (s, tokens, lasts);
-#else
- if (s == 0)
- s = *lasts;
- else
- *lasts = s;
- if (*s == 0) // We have reached the end
- return 0;
- int l_org = ACE_OS::strlen (s);
- int l_sub = ACE_OS::strlen (s = ::strtok (s, tokens));
- *lasts = s + l_sub;
- if (l_sub != l_org)
- *lasts += 1;
- return s ;
-#endif /* (ACE_HAS_REENTRANT_FUNCTIONS) */
-}
-
-ACE_INLINE long
-ACE_OS::strtol (const char *s, char **ptr, int base)
-{
- // @@ We must implement this function for WinCE also.
- // Notice WinCE support wcstol.
-#if !defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strtol");
- return ::strtol (s, ptr, base);
-#else
- ACE_UNUSED_ARG (s);
- ACE_UNUSED_ARG (ptr);
- ACE_UNUSED_ARG (base);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_WINCE */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE long
-ACE_OS::strtol (const wchar_t *s, wchar_t **ptr, int base)
-{
- ACE_TRACE ("ACE_OS::strtol");
- return ::wcstol (s, ptr, base);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE unsigned long
-ACE_OS::strtoul (const char *s, char **ptr, int base)
-{
- // @@ WINCE: We must implement this function for WinCE also.
- // Notice WinCE support wcstoul.
-#if !defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strtoul");
-# if defined (linux) && defined (__GLIBC__)
- // ::strtoul () appears to be broken on Linux 2.0.30/Alpha w/glibc:
- // it returns 0 for a negative number.
- return (unsigned long) ::strtol (s, ptr, base);
-# else /* ! linux || ! __GLIBC__ */
- return ::strtoul (s, ptr, base);
-# endif /* ! linux || ! __GLIBC__ */
-#else /* ACE_HAS_WINCE */
- ACE_UNUSED_ARG (s);
- ACE_UNUSED_ARG (ptr);
- ACE_UNUSED_ARG (base);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_WINCE */
-}
-
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE unsigned long
-ACE_OS::strtoul (const wchar_t *s, wchar_t **ptr, int base)
-{
- ACE_TRACE ("ACE_OS::strtoul");
- return ::wcstoul (s, ptr, base);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE double
-ACE_OS::strtod (const char *s, char **endptr)
-{
- // @@ WinCE only support wcstod
-#if !defined (ACE_HAS_WINCE)
- ACE_TRACE ("ACE_OS::strtod");
- return ::strtod (s, endptr);
-#else /* ACE_HAS_WINCE */
- ACE_UNUSED_ARG (s);
- ACE_UNUSED_ARG (endptr);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_WINCE */
-}
-
-#if defined (ACE_HAS_WCHAR)
-ACE_INLINE double
-ACE_OS::strtod (const wchar_t *s, wchar_t **endptr)
-{
- ACE_TRACE ("ACE_OS::strtod");
- return ::wcstod (s, endptr);
-}
-#endif /* ACE_HAS_WCHAR */
-
-ACE_INLINE int
-ACE_OS::ace_isspace (const ACE_TCHAR s)
-{
-#if defined (ACE_HAS_WINCE)
- ACE_UNUSED_ARG (s);
- ACE_NOTSUP_RETURN (0);
-#elif defined (ACE_USES_WCHAR)
- return iswspace (s);
-#else
- return isspace (s);
-#endif /* ACE_HAS_WINCE */
-}
-
-ACE_INLINE int
-ACE_OS::ace_isprint (const ACE_TCHAR s)
-{
-#if defined (ACE_HAS_WINCE)
- ACE_UNUSED_ARG (s);
- ACE_NOTSUP_RETURN (0);
-#elif defined (ACE_USES_WCHAR)
- return iswprint (s);
-#else
- return isprint (s);
-#endif /* ACE_HAS_WINCE */
-}
ACE_INLINE long
ACE_OS::sysconf (int name)
diff --git a/ace/OS_Dirent.cpp b/ace/OS_Dirent.cpp
index b779f96e47e..7964d073bbb 100644
--- a/ace/OS_Dirent.cpp
+++ b/ace/OS_Dirent.cpp
@@ -1,11 +1,7 @@
// $Id$
#include "ace/OS_Dirent.h"
-
-// @@ (brunsch) We have to include OS.h here for the string operations.
-// Once the string stuff gets split off, then we can just include that
-// instead.
-#include "ace/OS.h"
+#include "ace/OS_String.h"
ACE_RCSID(ace, OS_Dirent, "$Id$")
@@ -13,48 +9,79 @@ ACE_RCSID(ace, OS_Dirent, "$Id$")
# include "ace/OS_Dirent.inl"
#endif /* ACE_HAS_INLINED_OS_CALLS */
+
+#if defined (ACE_WIN32)
+// Non-Win32 versions in .inl file
+
DIR *
ACE_OS_Dirent::opendir (const ACE_TCHAR *filename)
{
-#if defined (ACE_HAS_DIRENT)
-# if defined (ACE_PSOS)
-
- // The pointer to the DIR buffer must be passed to ACE_OS_Dirent::closedir
- // in order to free it and avoid a memory leak.
- DIR *dir;
- u_long result;
- ACE_NEW_RETURN (dir, DIR, 0);
-#if defined (ACE_PSOS_DIAB_PPC)
- result = ::open_dir (ACE_const_cast (char *, filename), &(dir->xdir));
-#else
- result = ::open_dir (ACE_const_cast (char *, filename), dir);
-#endif /* defined ACE_PSOS_DIAB_PPC */
- if (result == 0)
- return dir;
- else
- {
- errno = result;
- return 0;
- }
-
-# else /* ! defined (ACE_PSOS) */
-#if defined (ACE_WIN32)
DIR *dir;
ACE_NEW_RETURN (dir, DIR, 0);
ACE_NEW_RETURN (dir->directory_name_,
- ACE_TCHAR[ACE_OS::strlen (filename)],
+ ACE_TCHAR[ACE_OS_String::strlen (filename)],
0);
- ACE_OS::strcpy (dir->directory_name_, filename);
+ ACE_OS_String::strcpy (dir->directory_name_, filename);
dir->current_handle_ = INVALID_HANDLE_VALUE;
dir->started_reading_ = 0;
return dir;
-#else
- // VxWorks' ::opendir () is declared with a non-const argument.
- return ::opendir (ACE_const_cast (char *, filename));
-#endif /* defined (ACE_WIN32) */
-# endif /* ! defined (ACE_PSOS) */
-#else
- ACE_UNUSED_ARG (filename);
- ACE_NOTSUP_RETURN (0);
-#endif /* ACE_HAS_DIRENT */
}
+
+ACE_INLINE void
+ACE_OS_Dirent::closedir (DIR *d)
+{
+ if (d->current_handle_ != INVALID_HANDLE_VALUE)
+ ::FindClose (d->current_handle_);
+
+ d->current_handle_ = INVALID_HANDLE_VALUE;
+ d->started_reading_ = 0;
+}
+
+ACE_INLINE struct dirent *
+ACE_OS_Dirent::readdir (DIR *d)
+{
+ if (!d->started_reading_)
+ {
+ d->current_handle_ = ACE_TEXT_FindFirstFile (d->directory_name_,
+ &(d->fdata_));
+
+ if (d->current_handle_ != INVALID_HANDLE_VALUE
+ && d->fdata_.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
+ {
+ ::FindClose (d->current_handle_);
+ d->current_handle_ = INVALID_HANDLE_VALUE;
+ }
+ else // Skip "." and ".."
+ {
+ int retval = 1;
+ while (*(d->fdata_.cFileName) == '.'
+ && retval
+ && d->current_handle_ != INVALID_HANDLE_VALUE)
+ {
+ retval = ACE_TEXT_FindNextFile (d->current_handle_,
+ &(d->fdata_));
+ }
+ if (retval == 0)
+ d->current_handle_ = INVALID_HANDLE_VALUE;
+ }
+
+ d->started_reading_ = 1;
+ }
+ else
+ {
+ int retval = ACE_TEXT_FindNextFile (d->current_handle_,
+ &(d->fdata_));
+ if (retval == 0)
+ d->current_handle_ = INVALID_HANDLE_VALUE;
+ }
+
+ if (d->current_handle_ != INVALID_HANDLE_VALUE)
+ {
+ d->dirent_.d_name = d->fdata_.cFileName;
+ return &(d->dirent_);
+ }
+ else
+ return 0;
+}
+
+#endif /* ACE_WIN32 */
diff --git a/ace/OS_Dirent.h b/ace/OS_Dirent.h
index cbcd61c3228..fa8276ce74c 100644
--- a/ace/OS_Dirent.h
+++ b/ace/OS_Dirent.h
@@ -21,6 +21,7 @@
#include "ace/pre.h"
#include "ace/config-all.h"
+#include "ace/OS_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -73,10 +74,10 @@ typedef XDIR DIR;
# undef rewinddir
#endif /* rewinddir */
-class ACE_Export ACE_OS_Dirent
+class ACE_OS_Export ACE_OS_Dirent
// = TITLE
// This class is a wrapper for the dirent.h operations
- //
+ //
// = DESCRIPTION
{
public:
diff --git a/ace/OS_Dirent.inl b/ace/OS_Dirent.inl
index a14dc02543e..ec78f8e5c54 100644
--- a/ace/OS_Dirent.inl
+++ b/ace/OS_Dirent.inl
@@ -1,6 +1,42 @@
/* -*- C++ -*- */
// $Id$
+#if !defined (ACE_WIN32)
+// Win32 versions in .cpp file
+
+DIR *
+ACE_OS_Dirent::opendir (const ACE_TCHAR *filename)
+{
+#if defined (ACE_HAS_DIRENT)
+# if defined (ACE_PSOS)
+
+ // The pointer to the DIR buffer must be passed to ACE_OS_Dirent::closedir
+ // in order to free it and avoid a memory leak.
+ DIR *dir;
+ u_long result;
+ ACE_NEW_RETURN (dir, DIR, 0);
+#if defined (ACE_PSOS_DIAB_PPC)
+ result = ::open_dir (ACE_const_cast (char *, filename), &(dir->xdir));
+#else
+ result = ::open_dir (ACE_const_cast (char *, filename), dir);
+#endif /* defined ACE_PSOS_DIAB_PPC */
+ if (result == 0)
+ return dir;
+ else
+ {
+ errno = result;
+ return 0;
+ }
+# else /* ! defined (ACE_PSOS) */
+ // VxWorks' ::opendir () is declared with a non-const argument.
+ return ::opendir (ACE_const_cast (char *, filename));
+# endif /* ! defined (ACE_PSOS) */
+#else
+ ACE_UNUSED_ARG (filename);
+ ACE_NOTSUP_RETURN (0);
+#endif /* ACE_HAS_DIRENT */
+}
+
ACE_INLINE void
ACE_OS_Dirent::closedir (DIR *d)
{
@@ -16,14 +52,7 @@ ACE_OS_Dirent::closedir (DIR *d)
if (result != 0)
errno = result;
# else /* ! defined (ACE_PSOS) */
-# if defined (ACE_WIN32)
- if (d->current_handle_ != INVALID_HANDLE_VALUE)
- ::FindClose (d->current_handle_);
- d->current_handle_ = INVALID_HANDLE_VALUE;
- d->started_reading_ = 0;
-# else /* defined (ACE_WIN32) */
::closedir (d);
-# endif /* defined (ACE_WIN32) */
# endif /* ! defined (ACE_PSOS) */
#else
ACE_UNUSED_ARG (d);
@@ -58,52 +87,7 @@ ACE_OS_Dirent::readdir (DIR *d)
}
# else /* ! defined (ACE_PSOS) */
-# if defined (ACE_WIN32)
- if (!d->started_reading_)
- {
- d->current_handle_ = ACE_TEXT_FindFirstFile (d->directory_name_,
- &(d->fdata_));
-
- if (d->current_handle_ != INVALID_HANDLE_VALUE
- && d->fdata_.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
- {
- ::FindClose (d->current_handle_);
- d->current_handle_ = INVALID_HANDLE_VALUE;
- }
- else // Skip "." and ".."
- {
- int retval = 1;
- while (*(d->fdata_.cFileName) == '.'
- && retval
- && d->current_handle_ != INVALID_HANDLE_VALUE)
- {
- retval = ACE_TEXT_FindNextFile (d->current_handle_,
- &(d->fdata_));
- }
- if (retval == 0)
- d->current_handle_ = INVALID_HANDLE_VALUE;
- }
-
- d->started_reading_ = 1;
- }
- else
- {
- int retval = ACE_TEXT_FindNextFile (d->current_handle_,
- &(d->fdata_));
- if (retval == 0)
- d->current_handle_ = INVALID_HANDLE_VALUE;
- }
-
- if (d->current_handle_ != INVALID_HANDLE_VALUE)
- {
- d->dirent_.d_name = d->fdata_.cFileName;
- return &(d->dirent_);
- }
- else
- return 0;
-# else /* defined (ACE_WIN32) */
return ::readdir (d);
-# endif /* defined (ACE_WIN32) */
# endif /* ! defined (ACE_PSOS) */
#else
ACE_UNUSED_ARG (d);
@@ -111,6 +95,8 @@ ACE_OS_Dirent::readdir (DIR *d)
#endif /* ACE_HAS_DIRENT */
}
+#endif /* !ACE_WIN32 */
+
ACE_INLINE int
ACE_OS_Dirent::readdir_r (DIR *dirp,
struct dirent *entry,
diff --git a/ace/OS_Export.h b/ace/OS_Export.h
new file mode 100644
index 00000000000..989d6c69fe9
--- /dev/null
+++ b/ace/OS_Export.h
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by
+// generate_export_file.pl
+// ------------------------------
+#if !defined (ACE_OS_EXPORT_H)
+#define ACE_OS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_OS_HAS_DLL)
+#define ACE_OS_HAS_DLL 1
+#endif /* ! ACE_OS_HAS_DLL */
+
+#if defined (ACE_OS_HAS_DLL)
+# if (ACE_OS_HAS_DLL == 1)
+# if defined (ACE_OS_BUILD_DLL)
+# define ACE_OS_Export ACE_Proper_Export_Flag
+# define ACE_OS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACE_OS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else
+# define ACE_OS_Export ACE_Proper_Import_Flag
+# define ACE_OS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACE_OS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACE_OS_BUILD_DLL */
+# else
+# define ACE_OS_Export
+# define ACE_OS_SINGLETON_DECLARATION(T)
+# define ACE_OS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ! ACE_OS_HAS_DLL == 1 */
+#else
+# define ACE_OS_Export
+# define ACE_OS_SINGLETON_DECLARATION(T)
+# define ACE_OS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACE_OS_HAS_DLL */
+
+#endif /* ACE_OS_EXPORT_H */
+
+// End of auto generated file.
diff --git a/ace/OS_String.cpp b/ace/OS_String.cpp
new file mode 100644
index 00000000000..de97a6529b7
--- /dev/null
+++ b/ace/OS_String.cpp
@@ -0,0 +1,366 @@
+// $Id$
+
+#include "ace/OS_String.h"
+#include "ace/OS.h"
+
+ACE_RCSID(ace, OS_String, "$Id$")
+
+#if !defined (ACE_HAS_INLINED_OSCALLS)
+# include "ace/OS_String.inl"
+#endif /* ACE_HAS_INLINED_OS_CALLS */
+
+const char *
+ACE_OS_String::strnstr (const char *s1, const char *s2, size_t len2)
+{
+ // Substring length
+ size_t len1 = ACE_OS_String::strlen (s1);
+
+ // Check if the substring is longer than the string being searched.
+ if (len2 > len1)
+ return 0;
+
+ // Go upto <len>
+ size_t len = len1 - len2;
+
+ for (size_t i = 0; i <= len; i++)
+ {
+ if (ACE_OS::memcmp (s1 + i, s2, len2) == 0)
+ // Found a match! Return the index.
+ return s1 + i;
+ }
+
+ return 0;
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE const wchar_t *
+ACE_OS_String::strnstr (const wchar_t *s1, const wchar_t *s2, size_t len2)
+{
+ // Substring length
+ size_t len1 = ACE_OS_String::strlen (s1);
+
+ // Check if the substring is longer than the string being searched.
+ if (len2 > len1)
+ return 0;
+
+ // Go upto <len>
+ size_t len = len1 - len2;
+
+ for (size_t i = 0; i <= len; i++)
+ {
+ if (ACE_OS::memcmp (s1 + i, s2, len2 * sizeof (wchar_t)) == 0)
+ // Found a match! Return the index.
+ return s1 + i;
+ }
+
+ return 0;
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strdup (const char *s)
+{
+ // @@ WINCE Should we provide this function on WinCE?
+#if defined (ACE_HAS_STRDUP_EMULATION)
+ char *t = (char *) ACE_OS::malloc (::strlen (s) + 1);
+ if (t == 0)
+ return 0;
+ else
+ return ACE_OS_String::strcpy (t, s);
+#else
+ return ::strdup (s);
+#endif /* ACE_HAS_STRDUP_EMULATION */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strdup (const wchar_t *s)
+{
+# if defined (__BORLANDC__)
+ wchar_t *buffer =
+ (wchar_t *) ACE_OS::malloc ((ACE_OS_String::strlen (s) + 1)
+ * sizeof (wchar_t));
+ return ::wcscpy (buffer, s);
+# else
+ return ::wcsdup (s);
+# endif /* __BORLANDC__ */
+}
+#endif /* ACE_HAS_WCHAR */
+
+
+
+char *
+ACE_OS_String::strptime (char *buf, const char *format, struct tm *tm)
+{
+#if !defined (ACE_HAS_WINCE)
+#if defined (ACE_LACKS_NATIVE_STRPTIME)
+ int bi = 0;
+ int fi = 0;
+ int percent = 0;
+
+ if (!buf || !format)
+ return 0;
+
+ while (format[fi] != '\0')
+ {
+ if (percent)
+ {
+ percent = 0;
+ switch (format[fi])
+ {
+ case '%': // an escaped %
+ if (buf[bi] == '%')
+ {
+ fi++; bi++;
+ }
+ else
+ return buf + bi;
+ break;
+
+ /* not supported yet: weekday via locale long/short names
+ case 'a': / * weekday via locale * /
+ / * FALL THROUGH * /
+ case 'A': / * long/short names * /
+ break;
+ */
+
+ /* not supported yet:
+ case 'b': / * month via locale * /
+ / * FALL THROUGH * /
+ case 'B': / * long/short names * /
+ / * FALL THROUGH * /
+ case 'h':
+ break;
+ */
+
+ /* not supported yet:
+ case 'c': / * %x %X * /
+ break;
+ */
+
+ /* not supported yet:
+ case 'C': / * date & time - * /
+ / * locale long format * /
+ break;
+ */
+
+ case 'd': /* day of month (1-31) */
+ /* FALL THROUGH */
+ case 'e':
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mday, &bi, &fi, 1, 31))
+ return buf + bi;
+
+ break;
+
+ case 'D': /* %m/%d/%y */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mon, &bi, &fi, 1, 12))
+ return buf + bi;
+
+ fi--;
+ tm->tm_mon--;
+
+ if (buf[bi] != '/')
+ return buf + bi;
+
+ bi++;
+
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mday, &bi, &fi, 1, 31))
+ return buf + bi;
+
+ fi--;
+ if (buf[bi] != '/')
+ return buf + bi;
+ bi++;
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_year, &bi, &fi, 0, 99))
+ return buf + bi;
+ if (tm->tm_year < 69)
+ tm->tm_year += 100;
+ break;
+
+ case 'H': /* hour (0-23) */
+ /* FALL THROUGH */
+ case 'k':
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_hour, &bi, &fi, 0, 23))
+ return buf + bi;
+ break;
+
+ /* not supported yet:
+ case 'I': / * hour (0-12) * /
+ / * FALL THROUGH * /
+ case 'l':
+ break;
+ */
+
+ case 'j': /* day of year (0-366) */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_yday, &bi, &fi, 1, 366))
+ return buf + bi;
+
+ tm->tm_yday--;
+ break;
+
+ case 'm': /* an escaped % */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_mon, &bi, &fi, 1, 12))
+ return buf + bi;
+
+ tm->tm_mon--;
+ break;
+
+ case 'M': /* minute (0-59) */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_min, &bi, &fi, 0, 59))
+ return buf + bi;
+
+ break;
+
+ /* not supported yet:
+ case 'p': / * am or pm for locale * /
+ break;
+ */
+
+ /* not supported yet:
+ case 'r': / * %I:%M:%S %p * /
+ break;
+ */
+
+ case 'R': /* %H:%M */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_hour, &bi, &fi, 0, 23))
+ return buf + bi;
+
+ fi--;
+ if (buf[bi] != ':')
+ return buf + bi;
+ bi++;
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_min, &bi, &fi, 0, 59))
+ return buf + bi;
+
+ break;
+
+ case 'S': /* seconds (0-61) */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_sec, &bi, &fi, 0, 61))
+ return buf + bi;
+ break;
+
+ case 'T': /* %H:%M:%S */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_hour, &bi, &fi, 0, 23))
+ return buf + bi;
+
+ fi--;
+ if (buf[bi] != ':')
+ return buf + bi;
+ bi++;
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_min, &bi, &fi, 0, 59))
+ return buf + bi;
+
+ fi--;
+ if (buf[bi] != ':')
+ return buf + bi;
+ bi++;
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_sec, &bi, &fi, 0, 61))
+ return buf + bi;
+
+ break;
+
+ case 'w': /* day of week (0=Sun-6) */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_wday, &bi, &fi, 0, 6))
+ return buf + bi;
+
+ break;
+
+ /* not supported yet: date, based on locale
+ case 'x': / * date, based on locale * /
+ break;
+ */
+
+ /* not supported yet:
+ case 'X': / * time, based on locale * /
+ break;
+ */
+
+ case 'y': /* the year - 1900 (0-99) */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_year, &bi, &fi, 0, 99))
+ return buf + bi;
+
+ if (tm->tm_year < 69)
+ tm->tm_year += 100;
+ break;
+
+ case 'Y': /* the full year (1999) */
+ if (!ACE_OS::strptime_getnum (buf + bi, &tm->tm_year, &bi, &fi, 0, 0))
+ return buf + bi;
+
+ tm->tm_year -= 1900;
+ break;
+
+ default: /* unrecognised */
+ return buf + bi;
+ } /* switch (format[fi]) */
+
+ }
+ else
+ { /* if (percent) */
+ if (format[fi] == '%')
+ {
+ percent = 1;
+ fi++;
+ }
+ else
+ {
+ if (format[fi] == buf[bi])
+ {
+ fi++;
+ bi++;
+ }
+ else
+ return buf + bi;
+ }
+ } /* if (percent) */
+ } /* while (format[fi] */
+
+ return buf + bi;
+#else /* ! ACE_LACKS_NATIVE_STRPTIME */
+ return ::strptime (buf,
+ format,
+ tm);
+#endif /* ! ACE_LACKS_NATIVE_STRPTIME */
+#else /* ! ACE_HAS_WINCE */
+ ACE_UNUSED_ARG (buf);
+ ACE_UNUSED_ARG (format);
+ ACE_UNUSED_ARG (tm);
+
+ ACE_NOTSUP_RETURN (0);
+#endif /* ! ACE_HAS_WINCE */
+}
+
+#if defined (ACE_HAS_STRPTIME)
+# if defined (ACE_LACKS_NATIVE_STRPTIME)
+int
+ACE_OS_String::strptime_getnum (char *buf,
+ int *num,
+ int *bi,
+ int *fi,
+ int min,
+ int max)
+{
+ int i = 0, tmp = 0;
+
+ while (isdigit (buf[i]))
+ {
+ tmp = (tmp * 10) + (buf[i] - '0');
+ if (max && (tmp > max))
+ return 0;
+ i++;
+ }
+
+ if (tmp < min)
+ return 0;
+ else if (i)
+ {
+ *num = tmp;
+ (*fi)++;
+ *bi += i;
+ return 1;
+ }
+ else
+ return 0;
+}
+# endif /* ACE_LACKS_NATIVE_STRPTIME */
+#endif /* ACE_HAS_STRPTIME */
diff --git a/ace/OS_String.h b/ace/OS_String.h
new file mode 100644
index 00000000000..2bb2deb349c
--- /dev/null
+++ b/ace/OS_String.h
@@ -0,0 +1,161 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// OS_String.h
+//
+// = AUTHOR
+// (Originally in OS.h)
+// Doug Schmidt <schmidt@cs.wustl.edu>, Jesper S. M|ller
+// <stophph@diku.dk>, and a cast of thousands...
+//
+// ============================================================================
+
+#ifndef ACE_OS_STRING_H
+#define ACE_OS_STRING_H
+#include "ace/pre.h"
+
+#include "ace/config-all.h"
+#include "ace/OS_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ACE_OS_Export ACE_OS_String
+ // = TITLE
+ // This class is a wrapper for string operations
+ // Mainly includes the stuff found in string.h and ctype.h
+ //
+ // = DESCRIPTION
+{
+public:
+ static char *strcat (char *s, const char *t);
+ static char *strncat (char *s, const char *t, size_t len);
+#if defined (ACE_HAS_WCHAR)
+ static wchar_t *strcat (wchar_t *s, const wchar_t *t);
+ static wchar_t *strncat (wchar_t *s, const wchar_t *t, size_t len);
+#endif /* ACE_HAS_WCHAR */
+
+ static char *strchr (char *s, int c);
+ static const char *strchr (const char *s, int c);
+ static char *strrchr (char *s, int c);
+ static const char *strrchr (const char *s, int c);
+ static char *strnchr (char *s, int c, size_t len);
+ static const char *strnchr (const char *s, int c, size_t len);
+#if defined (ACE_HAS_WCHAR)
+ static wchar_t *strchr (wchar_t *s, wint_t c);
+ static const wchar_t *strchr (const wchar_t *s, wint_t c);
+ static wchar_t *strrchr (wchar_t *s, wint_t c);
+ static const wchar_t *strrchr (const wchar_t *s, wint_t c);
+ static wchar_t *strnchr (wchar_t *s, wint_t c, size_t len);
+ static const wchar_t *strnchr (const wchar_t *s, wint_t c, size_t len);
+#endif /* ACE_HAS_WCHAR */
+
+ static int strcmp (const char *s, const char *t);
+ static int strncmp (const char *s, const char *t, size_t len);
+ static int strcasecmp (const char *s, const char *t);
+ static int strncasecmp (const char *s, const char *t, size_t len);
+#if defined (ACE_HAS_WCHAR)
+ static int strcmp (const wchar_t *s, const wchar_t *t);
+ static int strncmp (const wchar_t *s, const wchar_t *t, size_t len);
+ static int strcasecmp (const wchar_t *s, const wchar_t *t);
+ static int strncasecmp (const wchar_t *s, const wchar_t *t, size_t len);
+#endif /* ACE_HAS_WCHAR */
+
+ static char *strcpy (char *s, const char *t);
+ static char *strecpy (char *des, const char *src);
+ // Copies <src> to <des>, returning a pointer to the end of the
+ // copied region, rather than the beginning, as <strcpy> does.
+ static char *strncpy (char *s, const char *t, size_t len);
+#if defined (ACE_HAS_WCHAR)
+ static wchar_t *strcpy (wchar_t *s, const wchar_t *t);
+ static wchar_t *strecpy (wchar_t *s, const wchar_t *t);
+ static wchar_t *strncpy (wchar_t *s, const wchar_t *t, size_t len);
+#endif /* ACE_HAS_WCHAR */
+
+ static char *strpbrk (char *s1, const char *s2);
+ static const char *strpbrk (const char *s1, const char *s2);
+#if defined (ACE_HAS_WCHAR)
+ static wchar_t *strpbrk (wchar_t *s1, const wchar_t *s2);
+ static const wchar_t *strpbrk (const wchar_t *s1, const wchar_t *s2);
+#endif /* ACE_HAS_WCHAR */
+
+ static size_t strcspn (const char *s, const char *reject);
+
+ static size_t strspn (const char *s1, const char *s2);
+#if defined (ACE_HAS_WCHAR)
+ static size_t strspn (const wchar_t *s1, const wchar_t *s2);
+#endif /* ACE_HAS_WCHAR */
+
+#if defined (ACE_HAS_STRPTIME)
+ static char *strptime (char *buf,
+ const char *format,
+ struct tm *tm);
+#endif /* ACE_HAS_STRPTIME */
+
+ static char *strstr (char *s, const char *t);
+ static const char *strstr (const char *s, const char *t);
+ static char *strnstr (char *s, const char *t, size_t len);
+ static const char *strnstr (const char *s, const char *t, size_t len);
+#if defined (ACE_HAS_WCHAR)
+ static wchar_t *strstr (wchar_t *s, const wchar_t *t);
+ static const wchar_t *strstr (const wchar_t *s, const wchar_t *t);
+ static wchar_t *strnstr (wchar_t *s, const wchar_t *t, size_t len);
+ static const wchar_t *strnstr (const wchar_t *s, const wchar_t *t, size_t len);
+#endif /* ACE_HAS_WCHAR */
+
+ static char *strdup (const char *s); // Uses malloc
+#if defined (ACE_HAS_WCHAR)
+ static wchar_t *strdup (const wchar_t *s);
+#endif /* ACE_HAS_WCHAR */
+
+ static size_t strlen (const char *s);
+#if defined (ACE_HAS_WCHAR)
+ static size_t strlen (const wchar_t *s);
+#endif /* ACE_HAS_WCHAR */
+
+ static char *strtok (char *s, const char *tokens);
+ static char *strtok_r (char *s, const char *tokens, char **lasts);
+#if defined (ACE_HAS_WCHAR)
+ static wchar_t *strtok (wchar_t *s, const wchar_t *tokens);
+#endif /* ACE_HAS_WCHAR */
+
+ static long strtol (const char *s, char **ptr, int base);
+ static u_long strtoul (const char *s, char **ptr, int base);
+ static double strtod (const char *s, char **endptr);
+#if defined (ACE_HAS_WCHAR)
+ static long strtol (const wchar_t *s, wchar_t **ptr, int base);
+ static u_long strtoul (const wchar_t *s, wchar_t **ptr, int base);
+ static double strtod (const wchar_t *s, wchar_t **endptr);
+#endif /* ACE_HAS_WCHAR */
+
+#if defined (ACE_HAS_STRPTIME) && defined (ACE_LACKS_NATIVE_STRPTIME)
+ static int strptime_getnum (char *buf, int *num, int *bi, int *fi,
+ int min, int max);
+#endif /* ACE_HAS_STRPTIME && ACE_LACKS_NATIVE_STRPTIME */
+
+ static int to_lower (int c);
+#if defined (ACE_HAS_WCHAR)
+ static wint_t to_lower (wint_t c);
+#endif /* ACE_HAS_WCHAR */
+
+ static int ace_isspace (const ACE_TCHAR s);
+ static int ace_isprint (const ACE_TCHAR s);
+};
+
+# if defined (ACE_HAS_INLINED_OSCALLS)
+# if defined (ACE_INLINE)
+# undef ACE_INLINE
+# endif /* ACE_INLINE */
+# define ACE_INLINE inline
+# include "ace/OS_String.inl"
+# endif /* ACE_HAS_INLINED_OSCALLS */
+
+#include "ace/post.h"
+#endif /* ACE_OS_STRING_H */
diff --git a/ace/OS_String.inl b/ace/OS_String.inl
new file mode 100644
index 00000000000..7069d2eecad
--- /dev/null
+++ b/ace/OS_String.inl
@@ -0,0 +1,718 @@
+// $Id$
+
+#include /**/ <string.h>
+#include /**/ <stdlib.h>
+#include /**/ <ctype.h>
+
+ACE_INLINE char *
+ACE_OS_String::strcat (char *s, const char *t)
+{
+ return ::strcat (s, t);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strcat (wchar_t *s, const wchar_t *t)
+{
+ return ::wcscat (s, t);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE size_t
+ACE_OS_String::strspn (const char *s, const char *t)
+{
+#if !defined (ACE_HAS_WINCE)
+ return ::strspn (s, t);
+#else
+ ACE_UNUSED_ARG (s);
+ ACE_UNUSED_ARG (t);
+ ACE_NOTSUP_RETURN (-1);
+#endif /* ACE_HAS_WINCE */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE size_t
+ACE_OS_String::strspn (const wchar_t*s, const wchar_t *t)
+{
+ return ::wcsspn (s, t);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strchr (char *s, int c)
+{
+#if !defined (ACE_HAS_WINCE)
+ return ::strchr (s, c);
+#else
+ for (;;++s)
+ {
+ if (*s == c)
+ return s;
+ if (*s == 0)
+ return 0;
+ }
+#endif /* ACE_HAS_WINCE */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strchr (wchar_t *s, wint_t c)
+{
+ return ::wcschr (s, c);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE const char *
+ACE_OS_String::strchr (const char *s, int c)
+{
+#if !defined (ACE_HAS_WINCE)
+ return (const char *) ::strchr (s, c);
+#else
+ for (;;++s)
+ {
+ if (*s == c)
+ return s;
+ if (*s == 0)
+ return 0;
+ }
+#endif /* ACE_HAS_WINCE */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE const wchar_t *
+ACE_OS_String::strchr (const wchar_t *s, wint_t c)
+{
+ return (const wchar_t *) ::wcschr (s, c);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE const char *
+ACE_OS_String::strnchr (const char *s, int c, size_t len)
+{
+ for (size_t i = 0; i < len; i++)
+ if (s[i] == c)
+ return s + i;
+
+ return 0;
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE const wchar_t *
+ACE_OS_String::strnchr (const wchar_t *s, wint_t c, size_t len)
+{
+ for (size_t i = 0; i < len; i++)
+ if (s[i] == c)
+ return s + i;
+
+ return 0;
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strnchr (char *s, int c, size_t len)
+{
+#if defined ACE_PSOS_DIAB_PPC //Complier problem Diab 4.2b
+ const char *const_char_s=s;
+ return (char *) ACE_OS_String::strnchr (const_char_s, c, len);
+#else
+ return (char *) ACE_OS_String::strnchr ((const char *) s, c, len);
+#endif
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strnchr (wchar_t *s, wint_t c, size_t len)
+{
+#if defined ACE_PSOS_DIAB_PPC //Complier problem Diab 4.2b
+ const wchar_t *const_wchar_s=s;
+ return (wchar_t *) ACE_OS_String::strnchr (const_wchar_s, c, len);
+#else
+ return (wchar_t *) ACE_OS_String::strnchr ((const wchar_t *) s, c, len);
+#endif
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE const char *
+ACE_OS_String::strstr (const char *s, const char *t)
+{
+ return (const char *) ::strstr (s, t);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE const wchar_t *
+ACE_OS_String::strstr (const wchar_t *s, const wchar_t *t)
+{
+ return (const wchar_t *) ::wcsstr (s, t);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strstr (char *s, const char *t)
+{
+ return ::strstr (s, t);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strstr (wchar_t *s, const wchar_t *t)
+{
+ return ::wcsstr (s, t);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE size_t
+ACE_OS_String::strlen (const char *s)
+{
+ return ::strlen (s);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE size_t
+ACE_OS_String::strlen (const wchar_t *s)
+{
+ return ::wcslen (s);
+}
+#endif
+
+ACE_INLINE char *
+ACE_OS_String::strnstr (char *s, const char *t, size_t len)
+{
+#if defined ACE_PSOS_DIAB_PPC //Complier problem Diab 4.2b
+ const char *const_char_s=s;
+ return (char *) ACE_OS_String::strnstr (const_char_s, t, len);
+#else
+ return (char *) ACE_OS_String::strnstr ((const char *) s, t, len);
+#endif
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strnstr (wchar_t *s, const wchar_t *t, size_t len)
+{
+ return (wchar_t *) ACE_OS_String::strnstr ((const wchar_t *) s, t, len);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strrchr (char *s, int c)
+{
+#if !defined (ACE_LACKS_STRRCHR)
+ return ::strrchr (s, c);
+#else
+ char *p = s + ::strlen (s);
+
+ while (*p != c)
+ if (p == s)
+ return 0;
+ else
+ p--;
+
+ return p;
+#endif /* ACE_LACKS_STRRCHR */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE const wchar_t *
+ACE_OS_String::strrchr (const wchar_t *s, wint_t c)
+{
+# if !defined (ACE_LACKS_WCSRCHR)
+ return (const wchar_t *) ::wcsrchr (s, c);
+# else
+ const wchar_t *p = s + ::wcslen (s);
+
+ while (*p != c)
+ if (p == s)
+ return 0;
+ else
+ p--;
+
+ return p;
+# endif /* ACE_LACKS_WCSRCHR */
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE const char *
+ACE_OS_String::strrchr (const char *s, int c)
+{
+#if !defined (ACE_LACKS_STRRCHR)
+ return (const char *) ::strrchr (s, c);
+#else
+ const char *p = s + ::strlen (s);
+
+ while (*p != c)
+ if (p == s)
+ return 0;
+ else
+ p--;
+
+ return p;
+#endif /* ACE_LACKS_STRRCHR */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strrchr (wchar_t *s, wint_t c)
+{
+# if !defined (ACE_LACKS_WCSRCHR)
+ return (wchar_t *) ::wcsrchr (s, c);
+# else
+ wchar_t *p = s + ::wcslen (s);
+
+ while (*p != c)
+ if (p == s)
+ return 0;
+ else
+ p--;
+
+ return p;
+# endif /* ACE_LACKS_WCSRCHR */
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE int
+ACE_OS_String::strcmp (const char *s, const char *t)
+{
+ return ::strcmp (s, t);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE int
+ACE_OS_String::strcmp (const wchar_t *s, const wchar_t *t)
+{
+ return ::wcscmp (s, t);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strcpy (char *s, const char *t)
+{
+ return ::strcpy (s, t);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strcpy (wchar_t *s, const wchar_t *t)
+{
+ return ::wcscpy (s, t);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strecpy (char *s, const char *t)
+{
+ register char *dscan = s;
+ register const char *sscan = t;
+
+ while ((*dscan++ = *sscan++) != '\0')
+ continue;
+
+ return dscan;
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strecpy (wchar_t *s, const wchar_t *t)
+{
+ register wchar_t *dscan = s;
+ register const wchar_t *sscan = t;
+
+ while ((*dscan++ = *sscan++) != L'\0')
+ continue;
+
+ return dscan;
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE size_t
+ACE_OS_String::strcspn (const char *s, const char *reject)
+{
+#if !defined (ACE_HAS_WINCE)
+ return ::strcspn (s, reject);
+#else
+ const char *scan;
+ const char *rej_scan;
+ int count = 0;
+
+ for (scan = s; *scan; scan++)
+ {
+
+ for (rej_scan = reject; *rej_scan; rej_scan++)
+ if (*scan == *rej_scan)
+ return count;
+
+ count++;
+ }
+
+ return count;
+#endif /* ACE_HAS_WINCE */
+}
+
+ACE_INLINE char *
+ACE_OS_String::strpbrk (char *s1, const char *s2)
+{
+#if !defined (ACE_HAS_WINCE)
+ return ::strpbrk (s1, s2);
+#else
+ ACE_UNUSED_ARG (s1);
+ ACE_UNUSED_ARG (s2);
+ ACE_NOTSUP_RETURN (0);
+#endif /* ACE_HAS_WINCE */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strpbrk (wchar_t *s, const wchar_t *t)
+{
+ return ::wcspbrk (s, t);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE const char *
+ACE_OS_String::strpbrk (const char *s1, const char *s2)
+{
+#if !defined (ACE_HAS_WINCE)
+ return (const char *) ::strpbrk (s1, s2);
+#else
+ ACE_UNUSED_ARG (s1);
+ ACE_UNUSED_ARG (s2);
+ ACE_NOTSUP_RETURN (0);
+#endif /* ACE_HAS_WINCE */
+}
+
+ACE_INLINE int
+ACE_OS_String::strcasecmp (const char *s, const char *t)
+{
+#if !defined (ACE_WIN32) || defined (ACE_HAS_WINCE)
+# if defined (ACE_LACKS_STRCASECMP)
+ const char *scan1 = s;
+ const char *scan2 = t;
+
+ while (*scan1 != 0
+ && ACE_OS_String::to_lower (*scan1) == ACE_OS_String::to_lower (*scan2))
+ {
+ ++scan1;
+ ++scan2;
+ }
+
+ // The following case analysis is necessary so that characters which
+ // look negative collate low against normal characters but high
+ // against the end-of-string NUL.
+
+ if (*scan1 == '\0' && *scan2 == '\0')
+ return 0;
+ else if (*scan1 == '\0')
+ return -1;
+ else if (*scan2 == '\0')
+ return 1;
+ else
+ return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
+# else
+ return ::strcasecmp (s, t);
+# endif /* ACE_LACKS_STRCASECMP */
+#else /* ACE_WIN32 */
+ return ::_stricmp (s, t);
+#endif /* ACE_WIN32 */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE int
+ACE_OS_String::strcasecmp (const wchar_t *s, const wchar_t *t)
+{
+# if !defined (ACE_WIN32)
+ const wchar_t *scan1 = s;
+ const wchar_t *scan2 = t;
+
+ while (*scan1 != 0
+ && ACE_OS_String::to_lower (*scan1) == ACE_OS_String::to_lower (*scan2))
+ {
+ ++scan1;
+ ++scan2;
+ }
+
+ // The following case analysis is necessary so that characters which
+ // look negative collate low against normal characters but high
+ // against the end-of-string NUL.
+
+ if (*scan1 == '\0' && *scan2 == '\0')
+ return 0;
+ else if (*scan1 == '\0')
+ return -1;
+ else if (*scan2 == '\0')
+ return 1;
+ else
+ return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
+# else /* ACE_WIN32 */
+ return ::_wcsicmp (s, t);
+# endif /* ACE_WIN32 */
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE int
+ACE_OS_String::strncasecmp (const char *s, const char *t, size_t len)
+{
+#if !defined (ACE_WIN32) || defined (ACE_HAS_WINCE)
+# if defined (ACE_LACKS_STRCASECMP)
+ const char *scan1 = s;
+ const char *scan2 = t;
+ ssize_t count = ssize_t (len);
+
+ while (--count >= 0
+ && *scan1 != 0
+ && ACE_OS_String::to_lower (*scan1) == ACE_OS_String::to_lower (*scan2))
+ {
+ ++scan1;
+ ++scan2;
+ }
+
+ if (count < 0)
+ return 0;
+
+ // The following case analysis is necessary so that characters which
+ // look negative collate low against normal characters but high
+ // against the end-of-string NUL.
+
+ if (*scan1 == '\0' && *scan2 == '\0')
+ return 0;
+ else if (*scan1 == '\0')
+ return -1;
+ else if (*scan2 == '\0')
+ return 1;
+ else
+ return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
+# else
+ return ::strncasecmp (s, t, len);
+# endif /* ACE_LACKS_STRCASECMP */
+#else /* ACE_WIN32 */
+ return ::_strnicmp (s, t, len);
+#endif /* ACE_WIN32 */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE int
+ACE_OS_String::strncasecmp (const wchar_t *s, const wchar_t *t, size_t len)
+{
+# if !defined (ACE_WIN32)
+ const wchar_t *scan1 = s;
+ const wchar_t *scan2 = t;
+ ssize_t count = ssize_t (n);
+
+ while (--count >= 0
+ && *scan1 != 0
+ && ACE_OS_String::to_lower (*scan1) == ACE_OS_String::to_lower (*scan2))
+ {
+ ++scan1;
+ ++scan2;
+ }
+
+ if (count < 0)
+ return 0;
+
+ // The following case analysis is necessary so that characters which
+ // look negative collate low against normal characters but high
+ // against the end-of-string NUL.
+
+ if (*scan1 == '\0' && *scan2 == '\0')
+ return 0;
+ else if (*scan1 == '\0')
+ return -1;
+ else if (*scan2 == '\0')
+ return 1;
+ else
+ return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
+# else /* ACE_WIN32 */
+ return ::_wcsnicmp (s, t, len);
+# endif /* ACE_WIN32 */
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE int
+ACE_OS_String::strncmp (const char *s, const char *t, size_t len)
+{
+ return ::strncmp (s, t, len);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE int
+ACE_OS_String::strncmp (const wchar_t *s, const wchar_t *t, size_t len)
+{
+ return ::wcsncmp (s, t, len);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strncpy (char *s, const char *t, size_t len)
+{
+ return ::strncpy (s, t, len);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strncpy (wchar_t *s, const wchar_t *t, size_t len)
+{
+ return ::wcsncpy (s, t, len);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strncat (char *s, const char *t, size_t len)
+{
+ return ::strncat (s, t, len);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strncat (wchar_t *s, const wchar_t *t, size_t len)
+{
+ return ::wcsncat (s, t, len);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE char *
+ACE_OS_String::strtok (char *s, const char *tokens)
+{
+ return ::strtok (s, tokens);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wchar_t *
+ACE_OS_String::strtok (wchar_t *s, const wchar_t *tokens)
+{
+ return ::wcstok (s, tokens);
+}
+#endif /* ACE_HAS_WCHAR */
+
+
+ACE_INLINE char *
+ACE_OS_String::strtok_r (char *s, const char *tokens, char **lasts)
+{
+#if defined (ACE_HAS_REENTRANT_FUNCTIONS)
+ return ::strtok_r (s, tokens, lasts);
+#else
+ if (s == 0)
+ s = *lasts;
+ else
+ *lasts = s;
+ if (*s == 0) // We have reached the end
+ return 0;
+ int l_org = ACE_OS_String::strlen (s);
+ int l_sub = ACE_OS_String::strlen (s = ::strtok (s, tokens));
+ *lasts = s + l_sub;
+ if (l_sub != l_org)
+ *lasts += 1;
+ return s ;
+#endif /* (ACE_HAS_REENTRANT_FUNCTIONS) */
+}
+
+ACE_INLINE long
+ACE_OS_String::strtol (const char *s, char **ptr, int base)
+{
+ // @@ We must implement this function for WinCE also.
+ // Notice WinCE support wcstol.
+#if !defined (ACE_HAS_WINCE)
+ return ::strtol (s, ptr, base);
+#else
+ ACE_UNUSED_ARG (s);
+ ACE_UNUSED_ARG (ptr);
+ ACE_UNUSED_ARG (base);
+ ACE_NOTSUP_RETURN (0);
+#endif /* ACE_HAS_WINCE */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE long
+ACE_OS_String::strtol (const wchar_t *s, wchar_t **ptr, int base)
+{
+ return ::wcstol (s, ptr, base);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE unsigned long
+ACE_OS_String::strtoul (const char *s, char **ptr, int base)
+{
+ // @@ WINCE: We must implement this function for WinCE also.
+ // Notice WinCE support wcstoul.
+#if !defined (ACE_HAS_WINCE)
+# if defined (linux) && defined (__GLIBC__)
+ // ::strtoul () appears to be broken on Linux 2.0.30/Alpha w/glibc:
+ // it returns 0 for a negative number.
+ return (unsigned long) ::strtol (s, ptr, base);
+# else /* ! linux || ! __GLIBC__ */
+ return ::strtoul (s, ptr, base);
+# endif /* ! linux || ! __GLIBC__ */
+#else /* ACE_HAS_WINCE */
+ ACE_UNUSED_ARG (s);
+ ACE_UNUSED_ARG (ptr);
+ ACE_UNUSED_ARG (base);
+ ACE_NOTSUP_RETURN (0);
+#endif /* ACE_HAS_WINCE */
+}
+
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE unsigned long
+ACE_OS_String::strtoul (const wchar_t *s, wchar_t **ptr, int base)
+{
+ return ::wcstoul (s, ptr, base);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE double
+ACE_OS_String::strtod (const char *s, char **endptr)
+{
+ // @@ WinCE only support wcstod
+#if !defined (ACE_HAS_WINCE)
+ return ::strtod (s, endptr);
+#else /* ACE_HAS_WINCE */
+ ACE_UNUSED_ARG (s);
+ ACE_UNUSED_ARG (endptr);
+ ACE_NOTSUP_RETURN (0);
+#endif /* ACE_HAS_WINCE */
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE double
+ACE_OS_String::strtod (const wchar_t *s, wchar_t **endptr)
+{
+ return ::wcstod (s, endptr);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE int
+ACE_OS_String::to_lower (int c)
+{
+ return tolower (c);
+}
+
+#if defined (ACE_HAS_WCHAR)
+ACE_INLINE wint_t
+ACE_OS_String::to_lower (wint_t c)
+{
+ return ::towlower (c);
+}
+#endif /* ACE_HAS_WCHAR */
+
+ACE_INLINE int
+ACE_OS_String::ace_isspace (const ACE_TCHAR s)
+{
+#if defined (ACE_HAS_WINCE)
+ ACE_UNUSED_ARG (s);
+ ACE_NOTSUP_RETURN (0);
+#elif defined (ACE_USES_WCHAR)
+ return iswspace (s);
+#else
+ return isspace (s);
+#endif /* ACE_HAS_WINCE */
+}
+
+ACE_INLINE int
+ACE_OS_String::ace_isprint (const ACE_TCHAR s)
+{
+#if defined (ACE_HAS_WINCE)
+ ACE_UNUSED_ARG (s);
+ ACE_NOTSUP_RETURN (0);
+#elif defined (ACE_USES_WCHAR)
+ return iswprint (s);
+#else
+ return isprint (s);
+#endif /* ACE_HAS_WINCE */
+}
diff --git a/ace/ace-dll.icc b/ace/ace-dll.icc
index ca866da88a1..620d8c5d8e5 100644
--- a/ace/ace-dll.icc
+++ b/ace/ace-dll.icc
@@ -172,6 +172,7 @@ option
'Obstack.h',
'OS.h',
'OS_Dirent.h',
+ 'OS_String.h',
'Pair.h',
'Pair_T.h',
'Parse_Node.h',
@@ -359,6 +360,7 @@ option
source type(cpp) "Obstack.cpp"
source type(cpp) "OS.cpp"
source type(cpp) "OS_Dirent.cpp"
+ source type(cpp) "OS_String.cpp"
source type(cpp) "Pair.cpp"
source type(cpp) "Parse_Node.cpp"
source type(cpp) "Pipe.cpp"
diff --git a/ace/ace-lib.icc b/ace/ace-lib.icc
index 2ea385283fb..b8bb2191e59 100644
--- a/ace/ace-lib.icc
+++ b/ace/ace-lib.icc
@@ -98,6 +98,7 @@ option
source type(cpp) "Obstack.cpp"
source type(cpp) "OS.cpp"
source type(cpp) "OS_Dirent.cpp"
+ source type(cpp) "OS_String.cpp"
source type(cpp) "Pair.cpp"
source type(cpp) "Parse_Node.cpp"
source type(cpp) "Pipe.cpp"
diff --git a/ace/ace_dll.dsp b/ace/ace_dll.dsp
index 0ab738009d3..359806668c3 100644
--- a/ace/ace_dll.dsp
+++ b/ace/ace_dll.dsp
@@ -112,7 +112,7 @@ LINK32=link.exe
CPP=cl.exe
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "../" /D ACE_HAS_DLL=1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "../" /D "NDEBUG" /D ACE_HAS_MFC=1 /D ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER=1 /D "WIN32" /D "_WINDOWS" /D ACE_ACE_HAS_DLL=1 /D "ACE_BUILD_DLL" /FR /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "../" /D "NDEBUG" /D ACE_HAS_MFC=1 /D ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER=1 /D "WIN32" /D "_WINDOWS" /D "ACE_" /D "ACE_BUILD_DLL" /D "ACE_OS_BUILD_DLL" /FR /FD /c
# SUBTRACT CPP /YX
MTL=midl.exe
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
@@ -146,7 +146,7 @@ LINK32=link.exe
CPP=cl.exe
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D ACE_HAS_DLL=1 /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D ACE_HAS_MFC=1 /D ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER=1 /D "WIN32" /D "_WINDOWS" /D ACE_ACE_HAS_DLL=1 /D "ACE_BUILD_DLL" /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D ACE_HAS_MFC=1 /D ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER=1 /D "WIN32" /D "_WINDOWS" /D "ACE_ACE_BUILD_DLL" /D "ACE_OS_BUILD_DLL" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
MTL=midl.exe
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
@@ -178,7 +178,7 @@ LINK32=link.exe
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "../" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_ACE_HAS_DLL=1 /D "ACE_BUILD_DLL" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "../" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ACE_BUILD_DLL" /D "ACE_OS_BUILD_DLL" /FD /c
# SUBTRACT CPP /YX
MTL=midl.exe
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
@@ -209,7 +209,7 @@ LINK32=link.exe
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_ACE_HAS_DLL=1 /D "ACE_BUILD_DLL" /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ACE_BUILD_DLL" /D "ACE_OS_BUILD_DLL" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
MTL=midl.exe
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
@@ -1912,6 +1912,25 @@ SOURCE=.\OS_Dirent.cpp
# End Source File
# Begin Source File
+SOURCE=.\OS_String.cpp
+
+!IF "$(CFG)" == "ACE DLL - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE DLL - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE DLL - Win32 MFC Release"
+
+!ELSEIF "$(CFG)" == "ACE DLL - Win32 MFC Debug"
+
+!ELSEIF "$(CFG)" == "ACE DLL - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE DLL - Win32 Debug"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Pair.cpp
!IF "$(CFG)" == "ACE DLL - Win32 Alpha Release"
@@ -5059,6 +5078,10 @@ SOURCE=.\OS_Dirent.inl
# End Source File
# Begin Source File
+SOURCE=.\OS_String.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Pair_T.i
# End Source File
# Begin Source File
diff --git a/ace/ace_lib.dsp b/ace/ace_lib.dsp
index 2eae774f2ef..4affc0501e4 100644
--- a/ace/ace_lib.dsp
+++ b/ace/ace_lib.dsp
@@ -90,7 +90,7 @@ LIB32=link.exe -lib
CPP=cl.exe
# ADD BASE CPP /nologo /MD /W3 /GX /O1 /I "../" /D ACE_HAS_DLL=0 /D "ACE_NO_INLINE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /W3 /GX /O1 /I "../" /D ACE_HAS_DLL=0 /D "ACE_NO_INLINE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "../" /D ACE_OS_HAS_DLL=0 /D ACE_HAS_DLL=0 /D "ACE_NO_INLINE" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
RSC=rc.exe
# ADD BASE RSC /l 0x409
@@ -117,7 +117,7 @@ LIB32=link.exe -lib
CPP=cl.exe
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D ACE_OS_HAS_DLL=0 /FD /c
# SUBTRACT CPP /YX
RSC=rc.exe
# ADD BASE RSC /l 0x409
@@ -143,7 +143,7 @@ LIB32=link.exe -lib
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MT /W3 /GX /O1 /I "../" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D "ACE_NO_INLINE" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O1 /I "../" /D ACE_HAS_DLL=0 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O1 /I "../" /D ACE_OS_HAS_DLL=0 /D ACE_HAS_DLL=0 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
RSC=rc.exe
# ADD BASE RSC /l 0x409
@@ -169,7 +169,7 @@ LIB32=link.exe -lib
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D "ACE_NO_INLINE" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D ACE_OS_HAS_DLL=0 /FD /c
# SUBTRACT CPP /YX
RSC=rc.exe
# ADD BASE RSC /l 0x409
@@ -1868,6 +1868,25 @@ SOURCE=.\OS_Dirent.cpp
# End Source File
# Begin Source File
+SOURCE=.\OS_String.cpp
+
+!IF "$(CFG)" == "ACE LIB - Win32 Alpha Static Release"
+
+!ELSEIF "$(CFG)" == "ACE LIB - Win32 Alpha Static Debug"
+
+!ELSEIF "$(CFG)" == "ACE LIB - Win32 Pharlap ETS Static Release"
+
+!ELSEIF "$(CFG)" == "ACE LIB - Win32 Pharlap ETS Static Debug"
+
+!ELSEIF "$(CFG)" == "ACE LIB - Win32 Static Release"
+
+!ELSEIF "$(CFG)" == "ACE LIB - Win32 Static Debug"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Pair.cpp
!IF "$(CFG)" == "ACE LIB - Win32 Alpha Static Release"
@@ -4151,6 +4170,10 @@ SOURCE=.\OS_Dirent.h
# End Source File
# Begin Source File
+SOURCE=.\OS_String.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Pair.h
# End Source File
# Begin Source File
@@ -5019,6 +5042,10 @@ SOURCE=.\OS_Dirent.inl
# End Source File
# Begin Source File
+SOURCE=.\OS_String.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Pair_T.i
# End Source File
# Begin Source File