diff options
author | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-05-27 20:35:37 +0000 |
---|---|---|
committer | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-05-27 20:35:37 +0000 |
commit | 5b0dbd7ddb37eb4cd4542be4a47832675d4219e4 (patch) | |
tree | e40f3a036d4ddc01b56ec6cab0207bb80180c4ac | |
parent | 99e67f7a700fb0550a674b47bc8c04146e524e99 (diff) | |
download | ATCD-5b0dbd7ddb37eb4cd4542be4a47832675d4219e4.tar.gz |
ChangeLogTag: Fri May 27 15:32:15 2005 Justin Michel <michel_j@ociweb.com>
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | ace/ACE.cpp | 56 | ||||
-rw-r--r-- | ace/ACE.h | 12 | ||||
-rw-r--r-- | ace/SOCK_SEQPACK_Association.h | 2 | ||||
-rw-r--r-- | ace/SOCK_SEQPACK_Connector.h | 2 | ||||
-rw-r--r-- | apps/drwho/Protocol_Manager.cpp | 2 | ||||
-rw-r--r-- | examples/APG/Reactor/Timers.cpp | 2 | ||||
-rw-r--r-- | tests/Network_Adapters_Test.cpp | 2 |
8 files changed, 90 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog index db7dcdb614c..effb1f61193 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +Fri May 27 15:32:15 2005 Justin Michel <michel_j@ociweb.com> + + * ace/ACE.h: + * ace/ACE.cpp: + + Added a new ACE::wild_match() function which is used to support the + TAO -ORBPreferredInterfaces option. wild_match was contributed by + Kevin Heifner <heifner_k@ociweb.com>. + + * ace/SOCK_SEQPACK_Association.h: + * ace/SOCK_SEQPACK_Connector.h: + * apps/drwho/Protocol_Manager.cpp: + * examples/APG/Reactor/Timers.cpp: + * tests/Network_Adapters_Test.cpp: + + These files #included config.h which isn't safe, because + it won't necessarilly pick up the correct symbols. For example, I + caught this by trying to build ACE on Windows with __ACE_INLINE__ = 0. + The files that #included config.h directly saw that it was defined as 0, but + changing them to #include config-all.h instead, correctly saw that + the symbol was undefined. + Fri May 27 10:26:34 2005 Chad Elliott <elliott_c@ociweb.com> * bin/MakeProjectCreator/templates/gnu.mpd: diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 85e0a036811..fd8c9a73f10 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -3232,7 +3232,7 @@ ACE::sock_error (int error) /* NOTREACHED */ case WSAEDESTADDRREQ: return ACE_LIB_TEXT ("destination address required"); - /* NOTREACHED */ + /* NOTREACHED */ default: ACE_OS::sprintf (unknown_msg, ACE_LIB_TEXT ("unknown error: %d"), error); return unknown_msg; @@ -3457,3 +3457,57 @@ ACE::strdelete (wchar_t *s) delete [] s; } #endif /* ACE_HAS_WCHAR */ + +inline static bool equal_char(char a, char b, bool case_sensitive) +{ + if (case_sensitive) + return a == b; + return ACE_OS::ace_tolower(a) == ACE_OS::ace_tolower(b); +} + +bool +ACE::wild_match(const char* str, const char* pat, bool case_sensitive) +{ + if (str == pat) + return true; + if (pat == 0 || str == 0) + return false; + + bool star = false; + const char* s = str; + const char* p = pat; + while (*s != '\0') + { + if (*p == '*') + { + star = true; + pat = p; + while (*++pat == '*'); + + if (*pat == '\0') + return true; + p = pat; + } + else if (*p == '?') + { + ++s; + ++p; + } + else if (! equal_char(*s, *p, case_sensitive)) + { + if (!star) + return false; + s = ++str; + p = pat; + } + else + { + ++s; + ++p; + } + } + if (*p == '*') + while (*++p == '*'); + + return *p == '\0'; +} diff --git a/ace/ACE.h b/ace/ACE.h index d42be3c5098..5556ed65237 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -98,6 +98,10 @@ namespace ACE /// Check if error indicates the process being out of handles (file /// descriptors). extern ACE_Export int out_of_handles (int error); + + /// Simple wildcard matching function supporting '*' and '?' + /// return true if string s matches pattern. + extern ACE_Export bool wild_match(const char* s, const char* pattern, bool case_sensitive = true); /** * @name I/O operations @@ -540,23 +544,23 @@ namespace ACE /// Computes CRC-CCITT for the buffer. extern ACE_Export ACE_UINT16 crc_ccitt(const void *buf, size_t len, - ACE_UINT16 crc = 0); + ACE_UINT16 crc = 0); /// Computes CRC-CCITT for the @ len iovec buffers. extern ACE_Export ACE_UINT16 crc_ccitt(const iovec *iov, int len, - ACE_UINT16 crc = 0); + ACE_UINT16 crc = 0); /// Computes the ISO 8802-3 standard 32 bits CRC for the string. extern ACE_Export ACE_UINT32 crc32 (const char *str); /// Computes the ISO 8802-3 standard 32 bits CRC for the buffer. extern ACE_Export ACE_UINT32 crc32 (const void *buf, size_t len, - ACE_UINT32 crc = 0); + ACE_UINT32 crc = 0); /// Computes the ISO 8802-3 standard 32 bits CRC for the /// @ len iovec buffers. extern ACE_Export ACE_UINT32 crc32 (const iovec *iov, int len, - ACE_UINT32 crc = 0); + ACE_UINT32 crc = 0); /// Euclid's greatest common divisor algorithm. extern ACE_Export u_long gcd (u_long x, u_long y); diff --git a/ace/SOCK_SEQPACK_Association.h b/ace/SOCK_SEQPACK_Association.h index b2ea5896adb..0320c90a7dd 100644 --- a/ace/SOCK_SEQPACK_Association.h +++ b/ace/SOCK_SEQPACK_Association.h @@ -19,7 +19,7 @@ #define ACE_SOCK_SEQPACK_ASSOCIATION_H #include /**/ "ace/pre.h" -#include "ace/config.h" +#include "ace/config-all.h" #include "ace/ACE_export.h" #include "ace/SOCK_IO.h" diff --git a/ace/SOCK_SEQPACK_Connector.h b/ace/SOCK_SEQPACK_Connector.h index af75a23b963..26139d10eee 100644 --- a/ace/SOCK_SEQPACK_Connector.h +++ b/ace/SOCK_SEQPACK_Connector.h @@ -18,7 +18,7 @@ #define ACE_SOCK_SEQPACK_CONNECTOR_H #include /**/ "ace/pre.h" -#include "ace/config.h" +#include "ace/config-all.h" #include "ace/ACE_export.h" #include "ace/SOCK_SEQPACK_Association.h" diff --git a/apps/drwho/Protocol_Manager.cpp b/apps/drwho/Protocol_Manager.cpp index faf118ef169..5e93399c837 100644 --- a/apps/drwho/Protocol_Manager.cpp +++ b/apps/drwho/Protocol_Manager.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "ace/config.h" +#include "ace/config-all.h" #include "ace/Log_Msg.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_string.h" diff --git a/examples/APG/Reactor/Timers.cpp b/examples/APG/Reactor/Timers.cpp index 3e5706b44e7..c603b86bef4 100644 --- a/examples/APG/Reactor/Timers.cpp +++ b/examples/APG/Reactor/Timers.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "ace/config.h" +#include "ace/config-all.h" #include "ace/OS_main.h" #if !defined (ACE_LACKS_FORK) diff --git a/tests/Network_Adapters_Test.cpp b/tests/Network_Adapters_Test.cpp index 8e1694d1ebc..882ac59118c 100644 --- a/tests/Network_Adapters_Test.cpp +++ b/tests/Network_Adapters_Test.cpp @@ -18,7 +18,7 @@ // ============================================================================ // We need this to be able to check for ACE_HAS_ICMP_SUPPORT -#include "ace/config.h" +#include "ace/config-all.h" #include "test_config.h" #if defined (ACE_HAS_ICMP_SUPPORT) && (ACE_HAS_ICMP_SUPPORT == 1) |