diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-13 15:53:28 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-13 15:53:28 +0000 |
commit | 6caebeb327936ec608b3471efd5e13b5072bb2d4 (patch) | |
tree | 5aff56fbeabdf9a8c1f2f0016c98c4ca05c0a9ee | |
parent | 737409f63e0a2b708d616735acbc1cdfcca2e388 (diff) | |
download | ATCD-6caebeb327936ec608b3471efd5e13b5072bb2d4.tar.gz |
ChangeLogTag:Wed Jun 13 10:22:10 2001 Nanbor Wang <nanbor@cs.wustl.edu>
-rw-r--r-- | ChangeLog | 34 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 34 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 34 | ||||
-rw-r--r-- | THANKS | 5 | ||||
-rw-r--r-- | ace/Configuration.cpp | 2 | ||||
-rw-r--r-- | ace/Makefile | 2 | ||||
-rw-r--r-- | ace/Obchunk.cpp | 30 | ||||
-rw-r--r-- | ace/Obchunk.h | 72 | ||||
-rw-r--r-- | ace/Obchunk.i (renamed from ace/Obstack.i) | 2 | ||||
-rw-r--r-- | ace/Obstack.cpp | 154 | ||||
-rw-r--r-- | ace/Obstack.h | 98 | ||||
-rw-r--r-- | ace/Obstack_T.cpp | 165 | ||||
-rw-r--r-- | ace/Obstack_T.h | 114 | ||||
-rw-r--r-- | ace/Obstack_T.i | 33 | ||||
-rw-r--r-- | ace/Service_Config.cpp | 4 | ||||
-rw-r--r-- | ace/Svc_Conf.h | 12 | ||||
-rw-r--r-- | ace/Svc_Conf_l.cpp | 1560 | ||||
-rw-r--r-- | ace/Svc_Conf_y.cpp | 6 | ||||
-rw-r--r-- | ace/ace_dll.dsp | 21 | ||||
-rw-r--r-- | ace/ace_lib.dsp | 21 |
20 files changed, 1363 insertions, 1040 deletions
diff --git a/ChangeLog b/ChangeLog index 4828aba9201..6338a9b397b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +Wed Jun 13 10:22:10 2001 Nanbor Wang <nanbor@cs.wustl.edu> + + * ace/Svc_Conf_l.cpp: Need to read the sizeof (ACE_TCHAR) of bytes + to handle UNICODE svc.conf correctly. + + * ace/Svc_Conf.h: Changed the macro ACE_YY_INPUT to handle + ACE_TCHAR instead of char. Thanks to Allen Kelly + <akelly@postx.com> for sending the patches. + + * ace/Obstack_T.{h,i,cpp}: Templatized ACE_Obstack on the char + type it handles. + + * ace/Obchunk.{h,i,cpp}: New files containing the non-template + class ACE_Obchunk. + + * ace/Obstack.{h,cpp}: All the class definitions were moved to + Obchunk.* and Obstack_T.*. These files typedef'ed + ACE_Obstack_T<char> to ACE_Obstack for backward compatibility. + + * ace/Obstack.i: Removed file. + + * ace/ace_dll.dsp: + * ace/ace_lib.dsp: + * ace/Makefile: Added Obchunk and Obstack_T. + + * ace/Service_Config.cpp: + * ace/Svc_Conf_y.cpp: + * ace/Svc_Conf.h: Changed ACE_Obstack to ACE_Obstack_T<ACE_TCHAR> + to handle UNICODE files when needed. + + * ace/Configuration.cpp (set_string_value): When storing wchar + strings, the datasize passed to RegSetValueEx is the total size + in bytes, not the string length. + Wed Jun 13 08:42:31 2001 Christopher Kohlhoff <chris@kohlhoff.com> * include/makeinclude/ace_flags.bor: diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 4828aba9201..6338a9b397b 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,37 @@ +Wed Jun 13 10:22:10 2001 Nanbor Wang <nanbor@cs.wustl.edu> + + * ace/Svc_Conf_l.cpp: Need to read the sizeof (ACE_TCHAR) of bytes + to handle UNICODE svc.conf correctly. + + * ace/Svc_Conf.h: Changed the macro ACE_YY_INPUT to handle + ACE_TCHAR instead of char. Thanks to Allen Kelly + <akelly@postx.com> for sending the patches. + + * ace/Obstack_T.{h,i,cpp}: Templatized ACE_Obstack on the char + type it handles. + + * ace/Obchunk.{h,i,cpp}: New files containing the non-template + class ACE_Obchunk. + + * ace/Obstack.{h,cpp}: All the class definitions were moved to + Obchunk.* and Obstack_T.*. These files typedef'ed + ACE_Obstack_T<char> to ACE_Obstack for backward compatibility. + + * ace/Obstack.i: Removed file. + + * ace/ace_dll.dsp: + * ace/ace_lib.dsp: + * ace/Makefile: Added Obchunk and Obstack_T. + + * ace/Service_Config.cpp: + * ace/Svc_Conf_y.cpp: + * ace/Svc_Conf.h: Changed ACE_Obstack to ACE_Obstack_T<ACE_TCHAR> + to handle UNICODE files when needed. + + * ace/Configuration.cpp (set_string_value): When storing wchar + strings, the datasize passed to RegSetValueEx is the total size + in bytes, not the string length. + Wed Jun 13 08:42:31 2001 Christopher Kohlhoff <chris@kohlhoff.com> * include/makeinclude/ace_flags.bor: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 4828aba9201..6338a9b397b 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,37 @@ +Wed Jun 13 10:22:10 2001 Nanbor Wang <nanbor@cs.wustl.edu> + + * ace/Svc_Conf_l.cpp: Need to read the sizeof (ACE_TCHAR) of bytes + to handle UNICODE svc.conf correctly. + + * ace/Svc_Conf.h: Changed the macro ACE_YY_INPUT to handle + ACE_TCHAR instead of char. Thanks to Allen Kelly + <akelly@postx.com> for sending the patches. + + * ace/Obstack_T.{h,i,cpp}: Templatized ACE_Obstack on the char + type it handles. + + * ace/Obchunk.{h,i,cpp}: New files containing the non-template + class ACE_Obchunk. + + * ace/Obstack.{h,cpp}: All the class definitions were moved to + Obchunk.* and Obstack_T.*. These files typedef'ed + ACE_Obstack_T<char> to ACE_Obstack for backward compatibility. + + * ace/Obstack.i: Removed file. + + * ace/ace_dll.dsp: + * ace/ace_lib.dsp: + * ace/Makefile: Added Obchunk and Obstack_T. + + * ace/Service_Config.cpp: + * ace/Svc_Conf_y.cpp: + * ace/Svc_Conf.h: Changed ACE_Obstack to ACE_Obstack_T<ACE_TCHAR> + to handle UNICODE files when needed. + + * ace/Configuration.cpp (set_string_value): When storing wchar + strings, the datasize passed to RegSetValueEx is the total size + in bytes, not the string length. + Wed Jun 13 08:42:31 2001 Christopher Kohlhoff <chris@kohlhoff.com> * include/makeinclude/ace_flags.bor: @@ -1226,7 +1226,7 @@ Richard Hardgrave <hardgrav@ttd.teradyne.com> Mark Drijver <mdrijver@remedy.nl> Guy Bolton King <guy_bolton_king@non.agilent.com> Carlton Teel <teel@signal-analysis.com> -Alexandre Cervieri <alexandre.cervieri@terra.com.br> +Alexandre Cervieri <alexandre.cervieri@terra.com.br> Darren Griffith <darren.griffith@esecurityinc.com> Sam Mok <sam.mok@westwave.com> Josh Curry <Josh.Curry@lipper.reuters.com> @@ -1237,7 +1237,7 @@ Corey Trager <corey.trager@tradingtechnologies.com> Kirat Singh <kirat.singh@gs.com> Oleg Pavliv <oleg_pavliv@yahoo.com> Frederick Niemi <fniemi@cisco.com> -Vsevolod Novikov <novikov@ci.nnov.ru> +Vsevolod Novikov <novikov@ci.nnov.ru> Andrew Munro <Andrew.Munro@Australia.Boeing.com> Nicolas Huynh <HUYNH_Nicolas@cena.fr> Kevin Burge <kcburge@systemware-inc.com> @@ -1261,6 +1261,7 @@ Andrew Finnell <Andrew.Finnell@esecurityinc.com> Dan Levi <DanL@webmap.com> Rob Andzik <andzik@rtlogic.com> James Maynard <James.Maynard@ot.com.au> +Allen Kelly <akelly@postx.com> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson in the early 1990's. Paul devised the recursive Makefile diff --git a/ace/Configuration.cpp b/ace/Configuration.cpp index 8b78305fc5b..010da55a523 100644 --- a/ace/Configuration.cpp +++ b/ace/Configuration.cpp @@ -663,7 +663,7 @@ ACE_Configuration_Win32Registry::set_string_value (const ACE_Configuration_Secti 0, REG_SZ, (BYTE *) value.fast_rep (), - value.length () + 1) != ERROR_SUCCESS) + (value.length () + 1) * sizeof (ACE_TCHAR)) != ERROR_SUCCESS) return -2; return 0; diff --git a/ace/Makefile b/ace/Makefile index 01ab99305aa..b8e9a52db47 100644 --- a/ace/Makefile +++ b/ace/Makefile @@ -195,6 +195,7 @@ MEMORY_FILES = \ Malloc_Instantiations \ Mem_Map \ Memory_Pool \ + Obchunk \ Obstack \ Read_Buffer \ Shared_Memory \ @@ -269,6 +270,7 @@ TEMPLATE_FILES = \ Message_Block_T \ Message_Queue_T \ Module \ + Obstack_T \ Pair_T \ Refcounted_Auto_Ptr \ RB_Tree \ diff --git a/ace/Obchunk.cpp b/ace/Obchunk.cpp new file mode 100644 index 00000000000..2d6946766a0 --- /dev/null +++ b/ace/Obchunk.cpp @@ -0,0 +1,30 @@ +// $Id$ + +#include "ace/obchunk.h" + +#if !defined (__ACE_INLINE__) +#include "ace/Obchunk.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(ace, Obchunk, "$Id$") + +ACE_ALLOC_HOOK_DEFINE(ACE_Obchunk) + +void +ACE_Obchunk::dump (void) const +{ + ACE_TRACE ("ACE_Obchunk::dump"); + + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("end_ = %x\n"), this->end_)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("cur_ = %x\n"), this->cur_)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +ACE_Obchunk::ACE_Obchunk (size_t size) + : end_ (contents_ + size), + block_ (contents_), + cur_ (contents_), + next_ (0) +{ +} diff --git a/ace/Obchunk.h b/ace/Obchunk.h new file mode 100644 index 00000000000..9259b97a7a0 --- /dev/null +++ b/ace/Obchunk.h @@ -0,0 +1,72 @@ +/* -*- C++ -*- */ +//============================================================================= +/** + * @file Obchunk.h + * + * $Id$ + * + * @author Doug Schmidt + */ +//============================================================================= + + +#ifndef ACE_OBCHUNK_H +#define ACE_OBCHUNK_H +#include "ace/pre.h" + +#include "ace/Malloc.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @class ACE_Obchunk + * + * @brief Defines the state that represents a "chunk" of memory. + * Evenything in this class is public because it is designed + * as an internal structure of Obstack_T and users are + * not supposed to use this class directly. + * @sa ACE_Obstack_T + */ +class ACE_Export ACE_Obchunk +{ +public: + /// Constructor. + ACE_Obchunk (size_t size); + + /// Dtor. + ~ACE_Obchunk (void); + + /// Dump the state of an object. + void dump (void) const; + + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + + /// Pointer to the end of the chunk. + char *end_; + + /// Pointer to the head of the current building block. + char *block_; + + /// Pointer to the current location in the chunk. + char *cur_; + + /// Next chunk in the chain. + ACE_Obchunk *next_; + + /** + * Pointer to the beginning contents of this chunk. This field is + * actually overlayed by the memory allocated by + * <ACE_Obstack::new_chunk>. Therefore, it *must* come last. + */ + char contents_[4]; +}; + +#if defined (__ACE_INLINE__) +#include "ace/Obchunk.i" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* ACE_OBCHUNK_H */ diff --git a/ace/Obstack.i b/ace/Obchunk.i index 7a47c3da4cc..510c511d4f9 100644 --- a/ace/Obstack.i +++ b/ace/Obchunk.i @@ -1,7 +1,7 @@ /* -*- C++ -*- */ // $Id$ -// Obstack.i +// Obchunk.i ACE_INLINE ACE_Obchunk::~ACE_Obchunk (void) diff --git a/ace/Obstack.cpp b/ace/Obstack.cpp index fbb63f72d1b..d794f1263fe 100644 --- a/ace/Obstack.cpp +++ b/ace/Obstack.cpp @@ -2,154 +2,10 @@ #include "ace/Obstack.h" -#if !defined (__ACE_INLINE__) -#include "ace/Obstack.i" -#endif /* __ACE_INLINE__ */ - ACE_RCSID(ace, Obstack, "$Id$") -ACE_ALLOC_HOOK_DEFINE(ACE_Obstack) - -void -ACE_Obstack::dump (void) const -{ - ACE_TRACE ("ACE_Obstack::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("size_ = %d\n"), this->size_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("head_ = %x\n"), this->head_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("curr_ = %x\n"), this->curr_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Obchunk) - -void -ACE_Obchunk::dump (void) const -{ - ACE_TRACE ("ACE_Obchunk::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("end_ = %x\n"), this->end_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("cur_ = %x\n"), this->cur_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_Obchunk::ACE_Obchunk (size_t size) - : end_ (contents_ + size), - cur_ (contents_), - next_ (0) -{ -} - -class ACE_Obchunk * -ACE_Obstack::new_chunk (void) -{ - ACE_TRACE ("ACE_Obstack::new_chunk"); - - char *temp; - - ACE_ALLOCATOR_RETURN - (temp, - ACE_static_cast (char *, - this->allocator_strategy_->malloc - (sizeof (class ACE_Obchunk) - + this->size_)), - 0); - - return new (temp) ACE_Obchunk (this->size_); -} - -ACE_Obstack::ACE_Obstack (size_t size, - ACE_Allocator *allocator_strategy) - : allocator_strategy_ (allocator_strategy), - size_ (size) -{ - ACE_TRACE ("ACE_Obstack::ACE_Obstack"); - - if (this->allocator_strategy_ == 0) - ACE_ALLOCATOR (this->allocator_strategy_, - ACE_Allocator::instance ()); - - this->head_ = this->new_chunk (); - this->curr_ = this->head_; -} - -ACE_Obstack::~ACE_Obstack (void) -{ - ACE_TRACE ("ACE_Obstack::~ACE_Obstack"); - - ACE_Obchunk *temp = this->head_; - - while (temp != 0) - { - ACE_Obchunk *next = temp->next_; - temp->next_ = 0; - this->allocator_strategy_->free ((void *) temp); - temp = next; - } -} - -char * -ACE_Obstack::copy (const char *s, - size_t len) -{ - ACE_TRACE ("ACE_Obstack::copy"); - char *result; - - ACE_ASSERT (this->size_ >= len + 1); - - // Check whether we need to grow our chunk... - - if (this->curr_->cur_ + len + 1 >= this->curr_->end_) - { - if (this->curr_->next_ == 0) - { - // We must allocate new memory. - this->curr_->next_ = this->new_chunk (); - this->curr_ = this->curr_->next_; - } - else - { - // We can reuse previously allocated memory. - this->curr_ = this->curr_->next_; - this->curr_->cur_ = this->curr_->contents_; - } - } - - result = this->curr_->cur_; - ACE_OS::memcpy (result, s, len); - result[len] = '\0'; - this->curr_->cur_ += (len + 1); - return result; -} - -#if defined (ACE_HAS_WCHAR) -/** - * Convert the wchar_t string into a normal string (which requires a doubling - * of size with a cast) and send it to the normal char * version of copy. - * We also need to cast the return value back to wchar_t to pass back to the - * app. - * - * @note This is mainly here for Svc_Conf support with ACE_USES_WCHAR. - */ -wchar_t * -ACE_Obstack::copy (const wchar_t *data, size_t len) -{ - return ACE_reinterpret_cast - (wchar_t *, - this->copy (ACE_reinterpret_cast (const char *, data), - len * sizeof (wchar_t))); -} -#endif /* ACE_HAS_WCHAR */ - -void -ACE_Obstack::release (void) -{ - ACE_TRACE ("ACE_Obstack::release"); - - this->curr_ = this->head_; - this->curr_->cur_ = this->curr_->contents_; -} - - +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Obstack_T<char>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Obstack_T<char> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Obstack.h b/ace/Obstack.h index f6f566c2abc..55de8cb5133 100644 --- a/ace/Obstack.h +++ b/ace/Obstack.h @@ -14,107 +14,15 @@ #define ACE_OBSTACK_H #include "ace/pre.h" -#include "ace/Malloc.h" +#include "ace/Obstack_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -/** - * @class ACE_Obchunk - * - * @brief Defines the state that represents a "chunk" of memory. - */ -class ACE_Export ACE_Obchunk -{ -public: - friend class ACE_Obstack; - - /// Constructor. - ACE_Obchunk (size_t size); - - /// dtor. - ~ACE_Obchunk (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Pointer to the end of the chunk. - char *end_; - - /// Pointer to the current location in the chunk. - char *cur_; - - /// Next chunk in the chain. - ACE_Obchunk *next_; - - /** - * Pointer to the beginning contents of this chunk. This field is - * actually overlayed by the memory allocated by - * <ACE_Obstack::new_chunk>. Therefore, it *must* come last. - */ - char contents_[4]; -}; - -/** - * @class ACE_Obstack - * - * @brief Define a simple "mark and release" memory allocation utility. - * - * The implementation is similar to the GNU obstack utility, - * which is used extensively in the GCC compiler. - */ -class ACE_Export ACE_Obstack -{ -public: - // = Initialization and termination methods. - ACE_Obstack (size_t size = 4096 - sizeof (ACE_Obchunk), - ACE_Allocator *allocator_strategy = 0); - ~ACE_Obstack (void); - - /// Copy the data into the current Obchunk. - char *copy (const char *data, - size_t len); - -#if defined (ACE_HAS_WCHAR) - /// Version of copy that takes in a wchar_t * (used in Svc_Conf) - wchar_t *copy (const wchar_t *data, size_t len); -#endif /* ACE_HAS_WCHAR */ - - /// "Release" the entire stack of Obchunks, putting it back on the - /// free list. - void release (void); - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - class ACE_Obchunk *new_chunk (void); - - /// Pointer to the allocator used by this Obstack. - ACE_Allocator *allocator_strategy_; - - /// Current size of the Obstack; - size_t size_; - - // Don't change the order of the following two fields. - /// Head of the Obchunk chain. - class ACE_Obchunk *head_; - - /// Pointer to the current Obchunk. - class ACE_Obchunk *curr_; -}; +typedef ACE_Obstack_T<char> ACE_Obstack; -#if defined (__ACE_INLINE__) -#include "ace/Obstack.i" -#endif /* __ACE_INLINE__ */ +ACE_EXPORT_SINGLETON_DECLARATION (ACE_Obstack_T <char>); #include "ace/post.h" #endif /* ACE_OBSTACK_H */ diff --git a/ace/Obstack_T.cpp b/ace/Obstack_T.cpp new file mode 100644 index 00000000000..d1fbd1ca946 --- /dev/null +++ b/ace/Obstack_T.cpp @@ -0,0 +1,165 @@ +// $Id$ + +#include "ace/Obstack_T.h" + +#if !defined (__ACE_INLINE__) +#include "ace/Obstack_T.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(ace, Obstack_T, "$Id$") + +ACE_ALLOC_HOOK_DEFINE(ACE_Obstack_T) + +template <class CHAR> void +ACE_Obstack_T<CHAR>::dump (void) const +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::dump"); + + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("size_ = %d\n"), this->size_)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("head_ = %x\n"), this->head_)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("curr_ = %x\n"), this->curr_)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +template <class CHAR> int +ACE_Obstack_T<CHAR>::request (size_t len) +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::request"); + + // normalize the length. + len *= sizeof (CHAR); + + // We will always have enough room for null terminating char + // unless sizeof (char) > 4. + // There's no way we can handle more than this->size_ of strings. + if (this->size_ < len) + return -1; + + // Check whether we need to grow our chunk... + if (this->curr_->cur_ + len >= this->curr_->end_) + { + ACE_Obchunk *temp = this->curr_; + if (this->curr_->next_ == 0) + { + // We must allocate new memory. + this->curr_->next_ = this->new_chunk (); + this->curr_ = this->curr_->next_; + } + else + { + // We can reuse previously allocated memory. + this->curr_ = this->curr_->next_; + this->curr_->block_ = this->curr_->cur_ = this->curr_->contents_; + } + + // if there are something in there already. + if (temp->cur_ != temp->block_) + { + // @@ Require pointer arithmatic? + size_t datasize = temp->cur_ - temp->block_; + + // Check the total length of data again. + if (this->size_ < len + datasize) + return -1; + + ACE_OS::memcpy (this->curr_->block_, + temp->block_, + datasize); + this->curr_->cur_ = this->curr_->block_ + datasize; + } + } + + return 0; +} + +template <class CHAR> CHAR * +ACE_Obstack_T<CHAR>::grow (CHAR c) +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::grow"); + + if (this->request (1) == 0) + { + CHAR *retv = ACE_reinterpret_cast (CHAR *, + this->curr_->cur_); + this->curr_->cur_ += sizeof (CHAR); + *retv = c; + return retv; + } + else + return 0; +} + +template <class CHAR> ACE_Obchunk * +ACE_Obstack_T<CHAR>::new_chunk (void) +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::new_chunk"); + + char *temp; + + ACE_ALLOCATOR_RETURN + (temp, + ACE_static_cast (char *, + this->allocator_strategy_->malloc + (sizeof (class ACE_Obchunk) + + this->size_)), + 0); + + return new (temp) ACE_Obchunk (this->size_); +} + +template <class CHAR> +ACE_Obstack_T<CHAR>::ACE_Obstack_T (size_t size, + ACE_Allocator *allocator_strategy) + : allocator_strategy_ (allocator_strategy), + size_ (size) +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::ACE_Obstack"); + + if (this->allocator_strategy_ == 0) + ACE_ALLOCATOR (this->allocator_strategy_, + ACE_Allocator::instance ()); + + this->head_ = this->new_chunk (); + this->curr_ = this->head_; +} + +template <class CHAR> +ACE_Obstack_T<CHAR>::~ACE_Obstack_T (void) +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::~ACE_Obstack"); + + ACE_Obchunk *temp = this->head_; + + while (temp != 0) + { + ACE_Obchunk *next = temp->next_; + temp->next_ = 0; + this->allocator_strategy_->free ((void *) temp); + temp = next; + } +} + +template <class CHAR> CHAR * +ACE_Obstack_T<CHAR>::copy (const CHAR *s, + size_t len) +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::copy"); + + if (this->request (len) != 0) + return 0; + + size_t tsize = len * sizeof (CHAR); + ACE_OS::memcpy (this->curr_->cur_, s, tsize); + this->curr_->cur_ += tsize ; + return this->freeze (); +} + +template <class CHAR> void +ACE_Obstack_T<CHAR>::release (void) +{ + ACE_TRACE ("ACE_Obstack_T<CHAR>::release"); + + this->curr_ = this->head_; + this->curr_->cur_ = this->curr_->contents_; +} diff --git a/ace/Obstack_T.h b/ace/Obstack_T.h new file mode 100644 index 00000000000..0cf272b3dd0 --- /dev/null +++ b/ace/Obstack_T.h @@ -0,0 +1,114 @@ +/* -*- C++ -*- */ +//============================================================================= +/** + * @file Obstack_T.h + * + * $Id$ + * + * @author Doug Schmidt, Nanbor Wang + */ +//============================================================================= + + +#ifndef ACE_OBSTACK_T_H +#define ACE_OBSTACK_T_H +#include "ace/pre.h" + +#include "ace/Obchunk.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +/** + * @class ACE_Obstack + * + * @brief Define a simple "mark and release" memory allocation utility. + * + * The implementation is similar to the GNU obstack utility, + * which is used extensively in the GCC compiler. + */ +template <class CHAR> +class ACE_Obstack_T +{ +public: + // = Initialization and termination methods. + ACE_Obstack_T (size_t size = (4096 * sizeof (CHAR)) - sizeof (ACE_Obchunk), + ACE_Allocator *allocator_strategy = 0); + ~ACE_Obstack_T (void); + + /// Request Obstack to prepare a block at least @a len long for building + /// a new string. Return -1 if fail, 0 if success. + int request (size_t len); + + /// Inserting a new CHAR \a c into the current building + /// block without freezing (null terminating) the block. + /// This function will create new chunk by checking the + /// boundary of current Obchunk. Return + /// the location \a c gets inserted to, or 0 if error. + CHAR *grow (CHAR c); + + /// Inserting a new CHAR \a c into the current building + /// block without freezing (null terminating) the block and without + /// checking for out-of-bound error. + void grow_fast (CHAR c); + + /// Freeze the current building block by null terminating it. + /// Return the starting address of the current building block, 0 + /// if error occurs. + CHAR *freeze (void); + + /// Copy the data into the current Obchunk and freeze the current + /// block. Return the starting address of the current building + /// block, 0 if error occurs. @a len specify the string length, + /// not the actually data size. + CHAR *copy (const CHAR *data, + size_t len); + + /// Return the maximum @a length or @a size of a string that can be put into + /// this Obstack. @a size = @a length * sizeof (CHAR). + size_t length (void) const; + size_t size (void) const; + + /// "Release" the entire stack of Obchunks, putting it back on the + /// free list. + void release (void); + + /// Dump the state of an object. + void dump (void) const; + + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + +protected: + class ACE_Obchunk *new_chunk (void); + + /// Pointer to the allocator used by this Obstack. + ACE_Allocator *allocator_strategy_; + + /// Current size of the Obstack; + size_t size_; + + // Don't change the order of the following two fields. + /// Head of the Obchunk chain. + class ACE_Obchunk *head_; + + /// Pointer to the current Obchunk. + class ACE_Obchunk *curr_; +}; + +#if defined (__ACE_INLINE__) +#include "ace/Obstack_T.i" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Obstack_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Obstack_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" +#endif /* ACE_OBSTACK_T_H */ diff --git a/ace/Obstack_T.i b/ace/Obstack_T.i new file mode 100644 index 00000000000..f6ff337ba6e --- /dev/null +++ b/ace/Obstack_T.i @@ -0,0 +1,33 @@ +// $Id$ + +template <class CHAR> ACE_INLINE size_t +ACE_Obstack_T<CHAR>::length () const +{ + return this->size_ / sizeof (CHAR); +} + +template <class CHAR> ACE_INLINE size_t +ACE_Obstack_T<CHAR>::size () const +{ + return this->size_; +} + +template <class CHAR> ACE_INLINE void +ACE_Obstack_T<CHAR>::grow_fast (CHAR c) +{ + * (ACE_reinterpret_cast (CHAR *, + this->curr_->cur_)) = c; + this->curr_->cur_ += sizeof (CHAR); +} + +template <class CHAR> ACE_INLINE CHAR * +ACE_Obstack_T<CHAR>::freeze (void) +{ + CHAR *retv = ACE_reinterpret_cast (CHAR *, this->curr_->block_); + * (ACE_reinterpret_cast (CHAR *, + this->curr_->cur_)) = 0; + + this->curr_->cur_ += sizeof (CHAR); + this->curr_->block_ = this->curr_->cur_; + return retv; +} diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index e32c345e725..413c72acbe9 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -368,10 +368,10 @@ ACE_Service_Config::process_directives_i (void) ace_yyerrno = 0; ace_yylineno = 1; - ACE_Obstack *oldstack = ace_obstack; + ACE_Obstack_T<ACE_TCHAR> *oldstack = ace_obstack; ACE_NEW_RETURN (ace_obstack, - ACE_Obstack, + ACE_Obstack_T<ACE_TCHAR>, -1); ace_yyparse (); diff --git a/ace/Svc_Conf.h b/ace/Svc_Conf.h index 12f09dcc290..36b2418d1c8 100644 --- a/ace/Svc_Conf.h +++ b/ace/Svc_Conf.h @@ -50,21 +50,23 @@ ACE_YY_DECL; extern FILE *ace_yyin; // Name of input stream - +// note: if using wide charcaters (unicode) for interactive or string +// based input it may be worth checking this all works fine getc is +// not portable in wide char versions, needs more work #define ACE_YY_INPUT(buf,result,max_size) \ if (ace_yydirective != 0) \ { \ int c = *ace_yydirective++; \ result = c == '\0' ? 0 : 1; \ - buf[0] = (char) c; \ + buf[0] = (ACE_TCHAR) c; \ } \ else if ( ace_yy_current_buffer->ace_yy_is_interactive ) \ { \ int c = getc( ace_yyin ); \ result = c == EOF ? 0 : 1; \ - buf[0] = (char) c; \ + buf[0] = (ACE_TCHAR) c; \ } \ - else if ( ((result = fread( buf, 1, max_size, ace_yyin )) == 0) \ + else if ( ((result = fread( buf, sizeof (ACE_TCHAR), max_size, ace_yyin )) == 0) \ && ferror( ace_yyin ) ) \ ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("input in flex scanner failed") ); @@ -87,7 +89,7 @@ extern ACE_TCHAR *ace_yytext; extern int ace_yyleng; // Holds the length of the lexeme for the current token -extern ACE_Obstack *ace_obstack; +extern ACE_Obstack_T<ACE_TCHAR> *ace_obstack; // Efficient memory allocation technique extern ACE_Service_Type_Impl * diff --git a/ace/Svc_Conf_l.cpp b/ace/Svc_Conf_l.cpp index 6350fbb3545..bb738e1678f 100644 --- a/ace/Svc_Conf_l.cpp +++ b/ace/Svc_Conf_l.cpp @@ -31,15 +31,15 @@ /* The "const" storage-class-modifier is valid. */ #define ACE_YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ #if __STDC__ #define ACE_YY_USE_PROTOS #define ACE_YY_USE_CONST -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch @@ -110,10 +110,10 @@ extern FILE *ace_yyin, *ace_yyout; * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * - * if ( condition_holds ) - * ace_yyless( 5 ); - * else - * do_something_else(); + * if ( condition_holds ) + * ace_yyless( 5 ); + * else + * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all @@ -123,15 +123,15 @@ extern FILE *ace_yyin, *ace_yyout; /* Return all but the first 'n' matched characters back to the input stream. */ #define ace_yyless(n) \ - do \ - { \ - /* Undo effects of setting up ace_yytext. */ \ - *ace_yy_cp = ace_yy_hold_char; \ - ACE_YY_RESTORE_ACE_YY_MORE_OFFSET \ - ace_yy_c_buf_p = ace_yy_cp = ace_yy_bp + n - ACE_YY_MORE_ADJ; \ - ACE_YY_DO_BEFORE_ACTION; /* set up ace_yytext again */ \ - } \ - while ( 0 ) + do \ + { \ + /* Undo effects of setting up ace_yytext. */ \ + *ace_yy_cp = ace_yy_hold_char; \ + ACE_YY_RESTORE_ACE_YY_MORE_OFFSET \ + ace_yy_c_buf_p = ace_yy_cp = ace_yy_bp + n - ACE_YY_MORE_ADJ; \ + ACE_YY_DO_BEFORE_ACTION; /* set up ace_yytext again */ \ + } \ + while ( 0 ) #if 0 #define unput(c) ace_yyunput( c, ace_yytext_ptr ) @@ -145,61 +145,61 @@ typedef unsigned int ace_yy_size_t; struct ace_yy_buffer_state - { - FILE *ace_yy_input_file; - - ACE_TCHAR *ace_yy_ch_buf; /* input buffer */ - ACE_TCHAR *ace_yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - ace_yy_size_t ace_yy_buf_size; - - /* Number of characters read into ace_yy_ch_buf, not including EOB - * characters. - */ - int ace_yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int ace_yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int ace_yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int ace_yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int ace_yy_fill_buffer; - - int ace_yy_buffer_status; + { + FILE *ace_yy_input_file; + + ACE_TCHAR *ace_yy_ch_buf; /* input buffer */ + ACE_TCHAR *ace_yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + ace_yy_size_t ace_yy_buf_size; + + /* Number of characters read into ace_yy_ch_buf, not including EOB + * characters. + */ + int ace_yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int ace_yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int ace_yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int ace_yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int ace_yy_fill_buffer; + + int ace_yy_buffer_status; #define ACE_YY_BUFFER_NEW 0 #define ACE_YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as ACE_YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via ace_yyrestart()), so that the user can continue scanning by - * just pointing ace_yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as ACE_YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via ace_yyrestart()), so that the user can continue scanning by + * just pointing ace_yyin at a new input file. + */ #define ACE_YY_BUFFER_EOF_PENDING 2 - }; + }; static ACE_YY_BUFFER_STATE ace_yy_current_buffer = 0; @@ -213,15 +213,15 @@ static ACE_YY_BUFFER_STATE ace_yy_current_buffer = 0; /* ace_yy_hold_char holds the character lost when ace_yytext is formed. */ static ACE_TCHAR ace_yy_hold_char; -static int ace_yy_n_chars; /* number of characters read into ace_yy_ch_buf */ +static int ace_yy_n_chars; /* number of characters read into ace_yy_ch_buf */ int ace_yyleng; /* Points to current character in buffer. */ static ACE_TCHAR *ace_yy_c_buf_p = (ACE_TCHAR *) 0; -static int ace_yy_init = 1; /* whether we need to initialize */ -static int ace_yy_start = 0; /* start state number */ +static int ace_yy_init = 1; /* whether we need to initialize */ +static int ace_yy_start = 0; /* start state number */ /* Flag which is used to allow ace_yywrap()'s to do buffer switches * instead of setting up a fresh ace_yyin. A bit of a hack ... @@ -249,18 +249,18 @@ static void ace_yy_flex_free ACE_YY_PROTO(( void * )); #define ace_yy_new_buffer ace_yy_create_buffer #define ace_yy_set_interactive(is_interactive) \ - { \ - if ( ! ace_yy_current_buffer ) \ - ace_yy_current_buffer = ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); \ - ace_yy_current_buffer->ace_yy_is_interactive = is_interactive; \ - } + { \ + if ( ! ace_yy_current_buffer ) \ + ace_yy_current_buffer = ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); \ + ace_yy_current_buffer->ace_yy_is_interactive = is_interactive; \ + } #define ace_yy_set_bol(at_bol) \ - { \ - if ( ! ace_yy_current_buffer ) \ - ace_yy_current_buffer = ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); \ - ace_yy_current_buffer->ace_yy_at_bol = at_bol; \ - } + { \ + if ( ! ace_yy_current_buffer ) \ + ace_yy_current_buffer = ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); \ + ace_yy_current_buffer->ace_yy_at_bol = at_bol; \ + } #define ACE_YY_AT_BOL() (ace_yy_current_buffer->ace_yy_at_bol) @@ -279,11 +279,11 @@ static void ace_yy_fatal_error ACE_YY_PROTO(( ace_yyconst ACE_TCHAR msg[] )); * corresponding action - sets up ace_yytext. */ #define ACE_YY_DO_BEFORE_ACTION \ - ace_yytext_ptr = ace_yy_bp; \ - ace_yyleng = (int) (ace_yy_cp - ace_yy_bp); \ - ace_yy_hold_char = *ace_yy_cp; \ - *ace_yy_cp = '\0'; \ - ace_yy_c_buf_p = ace_yy_cp; + ace_yytext_ptr = ace_yy_bp; \ + ace_yyleng = (int) (ace_yy_cp - ace_yy_bp); \ + ace_yy_hold_char = *ace_yy_cp; \ + *ace_yy_cp = '\0'; \ + ace_yy_c_buf_p = ace_yy_cp; #define ACE_YY_NUM_RULES 25 #define ACE_YY_END_OF_BUFFER 26 @@ -618,21 +618,21 @@ ACE_YY_MALLOC_DECL */ #ifndef ACE_YY_INPUT #define ACE_YY_INPUT(buf,result,max_size) \ - if ( ace_yy_current_buffer->ace_yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( ace_yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (ACE_TCHAR) c; \ - if ( c == '\n' ) \ - buf[n++] = (ACE_TCHAR) c; \ - if ( c == EOF && ferror( ace_yyin ) ) \ - ACE_YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, ace_yyin )) == 0) \ - && ferror( ace_yyin ) ) \ - ACE_YY_FATAL_ERROR( "input in flex scanner failed" ); + if ( ace_yy_current_buffer->ace_yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( ace_yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (ACE_TCHAR) c; \ + if ( c == '\n' ) \ + buf[n++] = (ACE_TCHAR) c; \ + if ( c == EOF && ferror( ace_yyin ) ) \ + ACE_YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, ace_yyin )) == 0) \ + && ferror( ace_yyin ) ) \ + ACE_YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "ace_yyterminate();" - @@ -673,102 +673,102 @@ ACE_YY_MALLOC_DECL #endif #define ACE_YY_RULE_SETUP \ - if ( ace_yyleng > 0 ) \ - ace_yy_current_buffer->ace_yy_at_bol = \ - (ace_yytext[ace_yyleng - 1] == '\n'); \ - ACE_YY_USER_ACTION + if ( ace_yyleng > 0 ) \ + ace_yy_current_buffer->ace_yy_at_bol = \ + (ace_yytext[ace_yyleng - 1] == '\n'); \ + ACE_YY_USER_ACTION ACE_YY_DECL - { - register ace_yy_state_type ace_yy_current_state; - register ACE_TCHAR *ace_yy_cp = 0, *ace_yy_bp = 0; - register int ace_yy_act; + { + register ace_yy_state_type ace_yy_current_state; + register ACE_TCHAR *ace_yy_cp = 0, *ace_yy_bp = 0; + register int ace_yy_act; #line 39 "Svc_Conf.l" - if ( ace_yy_init ) - { - ace_yy_init = 0; + if ( ace_yy_init ) + { + ace_yy_init = 0; #ifdef ACE_YY_USER_INIT - ACE_YY_USER_INIT; + ACE_YY_USER_INIT; #endif - if ( ! ace_yy_start ) - ace_yy_start = 1; /* first start state */ + if ( ! ace_yy_start ) + ace_yy_start = 1; /* first start state */ - if ( ! ace_yyin ) - ace_yyin = stdin; + if ( ! ace_yyin ) + ace_yyin = stdin; - if ( ! ace_yyout ) - ace_yyout = stdout; + if ( ! ace_yyout ) + ace_yyout = stdout; - if ( ! ace_yy_current_buffer ) - ace_yy_current_buffer = - ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); + if ( ! ace_yy_current_buffer ) + ace_yy_current_buffer = + ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); - ace_yy_load_buffer_state(); - } + ace_yy_load_buffer_state(); + } - while ( 1 ) /* loops until end-of-file is reached */ - { - ace_yy_cp = ace_yy_c_buf_p; + while ( 1 ) /* loops until end-of-file is reached */ + { + ace_yy_cp = ace_yy_c_buf_p; - /* Support of ace_yytext. */ - *ace_yy_cp = ace_yy_hold_char; + /* Support of ace_yytext. */ + *ace_yy_cp = ace_yy_hold_char; - /* ace_yy_bp points to the position in ace_yy_ch_buf of the start of - * the current run. - */ - ace_yy_bp = ace_yy_cp; + /* ace_yy_bp points to the position in ace_yy_ch_buf of the start of + * the current run. + */ + ace_yy_bp = ace_yy_cp; - ace_yy_current_state = ace_yy_start; - ace_yy_current_state += ACE_YY_AT_BOL(); + ace_yy_current_state = ace_yy_start; + ace_yy_current_state += ACE_YY_AT_BOL(); ace_yy_match: - do - { - register ACE_YY_CHAR ace_yy_c = ace_yy_ec[ACE_YY_SC_TO_UI(*ace_yy_cp)]; - if ( ace_yy_accept[ace_yy_current_state] ) - { - ace_yy_last_accepting_state = ace_yy_current_state; - ace_yy_last_accepting_cpos = ace_yy_cp; - } - while ( ace_yy_chk[ace_yy_base[ace_yy_current_state] + ace_yy_c] != ace_yy_current_state ) - { - ace_yy_current_state = (int) ace_yy_def[ace_yy_current_state]; - if ( ace_yy_current_state >= 107 ) - ace_yy_c = ace_yy_meta[(unsigned int) ace_yy_c]; - } - ace_yy_current_state = ace_yy_nxt[ace_yy_base[ace_yy_current_state] + (unsigned int) ace_yy_c]; - ++ace_yy_cp; - } - while ( ace_yy_base[ace_yy_current_state] != 437 ); + do + { + register ACE_YY_CHAR ace_yy_c = ace_yy_ec[ACE_YY_SC_TO_UI(*ace_yy_cp)]; + if ( ace_yy_accept[ace_yy_current_state] ) + { + ace_yy_last_accepting_state = ace_yy_current_state; + ace_yy_last_accepting_cpos = ace_yy_cp; + } + while ( ace_yy_chk[ace_yy_base[ace_yy_current_state] + ace_yy_c] != ace_yy_current_state ) + { + ace_yy_current_state = (int) ace_yy_def[ace_yy_current_state]; + if ( ace_yy_current_state >= 107 ) + ace_yy_c = ace_yy_meta[(unsigned int) ace_yy_c]; + } + ace_yy_current_state = ace_yy_nxt[ace_yy_base[ace_yy_current_state] + (unsigned int) ace_yy_c]; + ++ace_yy_cp; + } + while ( ace_yy_base[ace_yy_current_state] != 437 ); ace_yy_find_action: - ace_yy_act = ace_yy_accept[ace_yy_current_state]; - if ( ace_yy_act == 0 ) - { /* have to back up */ - ace_yy_cp = ace_yy_last_accepting_cpos; - ace_yy_current_state = ace_yy_last_accepting_state; - ace_yy_act = ace_yy_accept[ace_yy_current_state]; - } + ace_yy_act = ace_yy_accept[ace_yy_current_state]; + if ( ace_yy_act == 0 ) + { /* have to back up */ + ace_yy_cp = ace_yy_last_accepting_cpos; + ace_yy_current_state = ace_yy_last_accepting_state; + ace_yy_act = ace_yy_accept[ace_yy_current_state]; + } - ACE_YY_DO_BEFORE_ACTION; + ACE_YY_DO_BEFORE_ACTION; -do_action: /* This label is used only to access EOF actions. */ +do_action: /* This label is used only to access EOF actions. */ - switch ( ace_yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of ACE_YY_DO_BEFORE_ACTION */ - *ace_yy_cp = ace_yy_hold_char; - ace_yy_cp = ace_yy_last_accepting_cpos; - ace_yy_current_state = ace_yy_last_accepting_state; - goto ace_yy_find_action; + switch ( ace_yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of ACE_YY_DO_BEFORE_ACTION */ + *ace_yy_cp = ace_yy_hold_char; + ace_yy_cp = ace_yy_last_accepting_cpos; + ace_yy_current_state = ace_yy_last_accepting_state; + goto ace_yy_find_action; case 1: *ace_yy_cp = ace_yy_hold_char; /* undo effects of setting up ace_yytext */ @@ -777,97 +777,97 @@ ACE_YY_DO_BEFORE_ACTION; /* set up ace_yytext again */ ACE_YY_RULE_SETUP #line 41 "Svc_Conf.l" ; /* EMPTY */ - ACE_YY_BREAK + ACE_YY_BREAK case 2: ACE_YY_RULE_SETUP #line 42 "Svc_Conf.l" { return token (ACE_DYNAMIC); } - // ACE_YY_BREAK + // ACE_YY_BREAK case 3: ACE_YY_RULE_SETUP #line 43 "Svc_Conf.l" { return token (ACE_STATIC); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 4: ACE_YY_RULE_SETUP #line 44 "Svc_Conf.l" { return token (ACE_SUSPEND); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 5: ACE_YY_RULE_SETUP #line 45 "Svc_Conf.l" { return token (ACE_RESUME); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 6: ACE_YY_RULE_SETUP #line 46 "Svc_Conf.l" { return token (ACE_REMOVE); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 7: ACE_YY_RULE_SETUP #line 47 "Svc_Conf.l" { return token (ACE_USTREAM); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 8: ACE_YY_RULE_SETUP #line 48 "Svc_Conf.l" { return token (ACE_MODULE_T); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 9: ACE_YY_RULE_SETUP #line 49 "Svc_Conf.l" { return token (ACE_SVC_OBJ_T); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 10: ACE_YY_RULE_SETUP #line 50 "Svc_Conf.l" { return token (ACE_STREAM_T); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 11: ACE_YY_RULE_SETUP #line 51 "Svc_Conf.l" { return token (ACE_ACTIVE); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 12: ACE_YY_RULE_SETUP #line 52 "Svc_Conf.l" { return token (ACE_INACTIVE); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 13: ACE_YY_RULE_SETUP #line 53 "Svc_Conf.l" { return token (ACE_COLON); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 14: ACE_YY_RULE_SETUP #line 54 "Svc_Conf.l" { return token (ACE_STAR); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 15: ACE_YY_RULE_SETUP #line 55 "Svc_Conf.l" { return token (ACE_LPAREN); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 16: ACE_YY_RULE_SETUP #line 56 "Svc_Conf.l" { return token (ACE_RPAREN); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 17: ACE_YY_RULE_SETUP #line 57 "Svc_Conf.l" { return token (ACE_LBRACE); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 18: ACE_YY_RULE_SETUP #line 58 "Svc_Conf.l" { return token (ACE_RBRACE); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 19: ACE_YY_RULE_SETUP #line 59 "Svc_Conf.l" { // Check for first type of string, i.e., - // "double quotes" delimited. + // "double quotes" delimited. ACE_TCHAR *s = ACE_OS::strrchr (ace_yytext, '"'); if (s == 0) // Check for second type of string, i.e., @@ -878,36 +878,36 @@ ACE_YY_RULE_SETUP // Eliminate the opening and closing double or // single quotes. *s = '\0'; - ace_yyleng -= 1; + ace_yyleng -= 1; ace_yylval.ident_ = ace_obstack->copy (ace_yytext + 1, ace_yyleng); - return token (ACE_STRING); } -// ACE_YY_BREAK + return token (ACE_STRING); } +// ACE_YY_BREAK case 20: ACE_YY_RULE_SETUP #line 74 "Svc_Conf.l" { - ace_yylval.ident_ = ace_obstack->copy (ace_yytext, ace_yyleng); - return token (ACE_IDENT); - } -// ACE_YY_BREAK + ace_yylval.ident_ = ace_obstack->copy (ace_yytext, ace_yyleng); + return token (ACE_IDENT); + } +// ACE_YY_BREAK case 21: ACE_YY_RULE_SETUP #line 78 "Svc_Conf.l" { - ace_yylval.ident_ = ace_obstack->copy (ace_yytext, ace_yyleng); - return token (ACE_PATHNAME); - } -// ACE_YY_BREAK + ace_yylval.ident_ = ace_obstack->copy (ace_yytext, ace_yyleng); + return token (ACE_PATHNAME); + } +// ACE_YY_BREAK case 22: ACE_YY_RULE_SETUP #line 82 "Svc_Conf.l" ; /* EMPTY */ - ACE_YY_BREAK + ACE_YY_BREAK case 23: ACE_YY_RULE_SETUP #line 83 "Svc_Conf.l" { ace_yylineno++; } - ACE_YY_BREAK + ACE_YY_BREAK case 24: ACE_YY_RULE_SETUP #line 84 "Svc_Conf.l" @@ -916,322 +916,322 @@ ACE_YY_RULE_SETUP ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("|%c"), *ace_yytext)); ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT (")\n"))); } - ACE_YY_BREAK + ACE_YY_BREAK case ACE_YY_STATE_EOF(INITIAL): case ACE_YY_STATE_EOF(PARAMETERS): case ACE_YY_STATE_EOF(NORMAL): #line 89 "Svc_Conf.l" { ACE_YY_NEW_FILE; ace_yyterminate(); } -// ACE_YY_BREAK +// ACE_YY_BREAK case 25: ACE_YY_RULE_SETUP #line 90 "Svc_Conf.l" ACE_SVC_CONF_ECHO; - ACE_YY_BREAK - - case ACE_YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB ACE_TCHAR. */ - int ace_yy_amount_of_matched_text = (int) (ace_yy_cp - ace_yytext_ptr) - 1; - - /* Undo the effects of ACE_YY_DO_BEFORE_ACTION. */ - *ace_yy_cp = ace_yy_hold_char; - ACE_YY_RESTORE_ACE_YY_MORE_OFFSET - - if ( ace_yy_current_buffer->ace_yy_buffer_status == ACE_YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed ace_yyin at a new source and called - * ace_yylex(). If so, then we have to assure - * consistency between ace_yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - ace_yy_n_chars = ace_yy_current_buffer->ace_yy_n_chars; - ace_yy_current_buffer->ace_yy_input_file = ace_yyin; - ace_yy_current_buffer->ace_yy_buffer_status = ACE_YY_BUFFER_NORMAL; - } - - /* Note that here we test for ace_yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since ace_yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( ace_yy_c_buf_p <= &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars] ) - { /* This was really a NUL. */ - ace_yy_state_type ace_yy_next_state; - - ace_yy_c_buf_p = ace_yytext_ptr + ace_yy_amount_of_matched_text; - - ace_yy_current_state = ace_yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * ace_yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - ace_yy_next_state = ace_yy_try_NUL_trans( ace_yy_current_state ); - - ace_yy_bp = ace_yytext_ptr + ACE_YY_MORE_ADJ; - - if ( ace_yy_next_state ) - { - /* Consume the NUL. */ - ace_yy_cp = ++ace_yy_c_buf_p; - ace_yy_current_state = ace_yy_next_state; - goto ace_yy_match; - } - - else - { - ace_yy_cp = ace_yy_c_buf_p; - goto ace_yy_find_action; - } - } - - else switch ( ace_yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - ace_yy_did_buffer_switch_on_eof = 0; - - if ( ace_yywrap() ) - { - /* Note: because we've taken care in - * ace_yy_get_next_buffer() to have set up - * ace_yytext, we can now set up - * ace_yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * ACE_YY_NULL, it'll still work - another - * ACE_YY_NULL will get returned. - */ - ace_yy_c_buf_p = ace_yytext_ptr + ACE_YY_MORE_ADJ; - - ace_yy_act = ACE_YY_STATE_EOF(ACE_YY_START); - goto do_action; - } - - else - { - if ( ! ace_yy_did_buffer_switch_on_eof ) - ACE_YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - ace_yy_c_buf_p = - ace_yytext_ptr + ace_yy_amount_of_matched_text; - - ace_yy_current_state = ace_yy_get_previous_state(); - - ace_yy_cp = ace_yy_c_buf_p; - ace_yy_bp = ace_yytext_ptr + ACE_YY_MORE_ADJ; - goto ace_yy_match; - - case EOB_ACT_LAST_MATCH: - ace_yy_c_buf_p = - &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars]; - - ace_yy_current_state = ace_yy_get_previous_state(); - - ace_yy_cp = ace_yy_c_buf_p; - ace_yy_bp = ace_yytext_ptr + ACE_YY_MORE_ADJ; - goto ace_yy_find_action; - } - break; - } - - default: - ACE_YY_FATAL_ERROR( - ACE_LIB_TEXT ("fatal flex scanner internal error--no action found" )); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of ace_yylex */ + ACE_YY_BREAK + + case ACE_YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB ACE_TCHAR. */ + int ace_yy_amount_of_matched_text = (int) (ace_yy_cp - ace_yytext_ptr) - 1; + + /* Undo the effects of ACE_YY_DO_BEFORE_ACTION. */ + *ace_yy_cp = ace_yy_hold_char; + ACE_YY_RESTORE_ACE_YY_MORE_OFFSET + + if ( ace_yy_current_buffer->ace_yy_buffer_status == ACE_YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed ace_yyin at a new source and called + * ace_yylex(). If so, then we have to assure + * consistency between ace_yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + ace_yy_n_chars = ace_yy_current_buffer->ace_yy_n_chars; + ace_yy_current_buffer->ace_yy_input_file = ace_yyin; + ace_yy_current_buffer->ace_yy_buffer_status = ACE_YY_BUFFER_NORMAL; + } + + /* Note that here we test for ace_yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since ace_yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( ace_yy_c_buf_p <= &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars] ) + { /* This was really a NUL. */ + ace_yy_state_type ace_yy_next_state; + + ace_yy_c_buf_p = ace_yytext_ptr + ace_yy_amount_of_matched_text; + + ace_yy_current_state = ace_yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * ace_yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + ace_yy_next_state = ace_yy_try_NUL_trans( ace_yy_current_state ); + + ace_yy_bp = ace_yytext_ptr + ACE_YY_MORE_ADJ; + + if ( ace_yy_next_state ) + { + /* Consume the NUL. */ + ace_yy_cp = ++ace_yy_c_buf_p; + ace_yy_current_state = ace_yy_next_state; + goto ace_yy_match; + } + + else + { + ace_yy_cp = ace_yy_c_buf_p; + goto ace_yy_find_action; + } + } + + else switch ( ace_yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + ace_yy_did_buffer_switch_on_eof = 0; + + if ( ace_yywrap() ) + { + /* Note: because we've taken care in + * ace_yy_get_next_buffer() to have set up + * ace_yytext, we can now set up + * ace_yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * ACE_YY_NULL, it'll still work - another + * ACE_YY_NULL will get returned. + */ + ace_yy_c_buf_p = ace_yytext_ptr + ACE_YY_MORE_ADJ; + + ace_yy_act = ACE_YY_STATE_EOF(ACE_YY_START); + goto do_action; + } + + else + { + if ( ! ace_yy_did_buffer_switch_on_eof ) + ACE_YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + ace_yy_c_buf_p = + ace_yytext_ptr + ace_yy_amount_of_matched_text; + + ace_yy_current_state = ace_yy_get_previous_state(); + + ace_yy_cp = ace_yy_c_buf_p; + ace_yy_bp = ace_yytext_ptr + ACE_YY_MORE_ADJ; + goto ace_yy_match; + + case EOB_ACT_LAST_MATCH: + ace_yy_c_buf_p = + &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars]; + + ace_yy_current_state = ace_yy_get_previous_state(); + + ace_yy_cp = ace_yy_c_buf_p; + ace_yy_bp = ace_yytext_ptr + ACE_YY_MORE_ADJ; + goto ace_yy_find_action; + } + break; + } + + default: + ACE_YY_FATAL_ERROR( + ACE_LIB_TEXT ("fatal flex scanner internal error--no action found" )); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of ace_yylex */ /* ace_yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int ace_yy_get_next_buffer() - { - register ACE_TCHAR *dest = ace_yy_current_buffer->ace_yy_ch_buf; - register ACE_TCHAR *source = ace_yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( ace_yy_c_buf_p > &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars + 1] ) - ACE_YY_FATAL_ERROR( - ACE_LIB_TEXT ("fatal flex scanner internal error--end of buffer missed" )); - - if ( ace_yy_current_buffer->ace_yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( ace_yy_c_buf_p - ace_yytext_ptr - ACE_YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (ace_yy_c_buf_p - ace_yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( ace_yy_current_buffer->ace_yy_buffer_status == ACE_YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - ace_yy_current_buffer->ace_yy_n_chars = ace_yy_n_chars = 0; - - else - { - int num_to_read = - ace_yy_current_buffer->ace_yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + { + register ACE_TCHAR *dest = ace_yy_current_buffer->ace_yy_ch_buf; + register ACE_TCHAR *source = ace_yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( ace_yy_c_buf_p > &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars + 1] ) + ACE_YY_FATAL_ERROR( + ACE_LIB_TEXT ("fatal flex scanner internal error--end of buffer missed" )); + + if ( ace_yy_current_buffer->ace_yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( ace_yy_c_buf_p - ace_yytext_ptr - ACE_YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (ace_yy_c_buf_p - ace_yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( ace_yy_current_buffer->ace_yy_buffer_status == ACE_YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + ace_yy_current_buffer->ace_yy_n_chars = ace_yy_n_chars = 0; + + else + { + int num_to_read = + ace_yy_current_buffer->ace_yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ #ifdef ACE_YY_USES_REJECT - ACE_YY_FATAL_ERROR( + ACE_YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else - /* just a shorter name for the current buffer */ - ACE_YY_BUFFER_STATE b = ace_yy_current_buffer; + /* just a shorter name for the current buffer */ + ACE_YY_BUFFER_STATE b = ace_yy_current_buffer; - int ace_yy_c_buf_p_offset = - (int) (ace_yy_c_buf_p - b->ace_yy_ch_buf); + int ace_yy_c_buf_p_offset = + (int) (ace_yy_c_buf_p - b->ace_yy_ch_buf); - if ( b->ace_yy_is_our_buffer ) - { - int new_size = b->ace_yy_buf_size * 2; + if ( b->ace_yy_is_our_buffer ) + { + int new_size = b->ace_yy_buf_size * 2; - if ( new_size <= 0 ) - b->ace_yy_buf_size += b->ace_yy_buf_size / 8; - else - b->ace_yy_buf_size *= 2; + if ( new_size <= 0 ) + b->ace_yy_buf_size += b->ace_yy_buf_size / 8; + else + b->ace_yy_buf_size *= 2; - b->ace_yy_ch_buf = (ACE_TCHAR *) - /* Include room in for 2 EOB chars. */ - ace_yy_flex_realloc( (void *) b->ace_yy_ch_buf, - b->ace_yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->ace_yy_ch_buf = 0; + b->ace_yy_ch_buf = (ACE_TCHAR *) + /* Include room in for 2 EOB chars. */ + ace_yy_flex_realloc( (void *) b->ace_yy_ch_buf, + b->ace_yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->ace_yy_ch_buf = 0; - if ( ! b->ace_yy_ch_buf ) - ACE_YY_FATAL_ERROR( - ACE_LIB_TEXT ("fatal error - scanner input buffer overflow") ); + if ( ! b->ace_yy_ch_buf ) + ACE_YY_FATAL_ERROR( + ACE_LIB_TEXT ("fatal error - scanner input buffer overflow") ); - ace_yy_c_buf_p = &b->ace_yy_ch_buf[ace_yy_c_buf_p_offset]; + ace_yy_c_buf_p = &b->ace_yy_ch_buf[ace_yy_c_buf_p_offset]; - num_to_read = ace_yy_current_buffer->ace_yy_buf_size - - number_to_move - 1; + num_to_read = ace_yy_current_buffer->ace_yy_buf_size - + number_to_move - 1; #endif - } + } - if ( num_to_read > ACE_YY_READ_BUF_SIZE ) - num_to_read = ACE_YY_READ_BUF_SIZE; + if ( num_to_read * sizeof (ACE_TCHAR) > ACE_YY_READ_BUF_SIZE ) + num_to_read = ACE_YY_READ_BUF_SIZE / sizeof (ACE_TCHAR); - /* Read in more data. */ - ACE_YY_INPUT( (&ace_yy_current_buffer->ace_yy_ch_buf[number_to_move]), - ace_yy_n_chars, num_to_read ); + /* Read in more data. */ + ACE_YY_INPUT( (&ace_yy_current_buffer->ace_yy_ch_buf[number_to_move]), + ace_yy_n_chars, num_to_read ); - ace_yy_current_buffer->ace_yy_n_chars = ace_yy_n_chars; - } + ace_yy_current_buffer->ace_yy_n_chars = ace_yy_n_chars; + } - if ( ace_yy_n_chars == 0 ) - { - if ( number_to_move == ACE_YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - ace_yyrestart( ace_yyin ); - } + if ( ace_yy_n_chars == 0 ) + { + if ( number_to_move == ACE_YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + ace_yyrestart( ace_yyin ); + } - else - { - ret_val = EOB_ACT_LAST_MATCH; - ace_yy_current_buffer->ace_yy_buffer_status = - ACE_YY_BUFFER_EOF_PENDING; - } - } + else + { + ret_val = EOB_ACT_LAST_MATCH; + ace_yy_current_buffer->ace_yy_buffer_status = + ACE_YY_BUFFER_EOF_PENDING; + } + } - else - ret_val = EOB_ACT_CONTINUE_SCAN; + else + ret_val = EOB_ACT_CONTINUE_SCAN; - ace_yy_n_chars += number_to_move; - ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars] = ACE_YY_END_OF_BUFFER_CHAR; - ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars + 1] = ACE_YY_END_OF_BUFFER_CHAR; + ace_yy_n_chars += number_to_move; + ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars] = ACE_YY_END_OF_BUFFER_CHAR; + ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars + 1] = ACE_YY_END_OF_BUFFER_CHAR; - ace_yytext_ptr = &ace_yy_current_buffer->ace_yy_ch_buf[0]; + ace_yytext_ptr = &ace_yy_current_buffer->ace_yy_ch_buf[0]; - return ret_val; - } + return ret_val; + } /* ace_yy_get_previous_state - get the state just before the EOB ACE_TCHAR was reached */ static ace_yy_state_type ace_yy_get_previous_state() - { - register ace_yy_state_type ace_yy_current_state; - register ACE_TCHAR *ace_yy_cp; - - ace_yy_current_state = ace_yy_start; - ace_yy_current_state += ACE_YY_AT_BOL(); - - for ( ace_yy_cp = ace_yytext_ptr + ACE_YY_MORE_ADJ; ace_yy_cp < ace_yy_c_buf_p; ++ace_yy_cp ) - { - register ACE_YY_CHAR ace_yy_c = (*ace_yy_cp ? ace_yy_ec[ACE_YY_SC_TO_UI(*ace_yy_cp)] : 1); - if ( ace_yy_accept[ace_yy_current_state] ) - { - ace_yy_last_accepting_state = ace_yy_current_state; - ace_yy_last_accepting_cpos = ace_yy_cp; - } - while ( ace_yy_chk[ace_yy_base[ace_yy_current_state] + ace_yy_c] != ace_yy_current_state ) - { - ace_yy_current_state = (int) ace_yy_def[ace_yy_current_state]; - if ( ace_yy_current_state >= 107 ) - ace_yy_c = ace_yy_meta[(unsigned int) ace_yy_c]; - } - ace_yy_current_state = ace_yy_nxt[ace_yy_base[ace_yy_current_state] + (unsigned int) ace_yy_c]; - } - - return ace_yy_current_state; - } + { + register ace_yy_state_type ace_yy_current_state; + register ACE_TCHAR *ace_yy_cp; + + ace_yy_current_state = ace_yy_start; + ace_yy_current_state += ACE_YY_AT_BOL(); + + for ( ace_yy_cp = ace_yytext_ptr + ACE_YY_MORE_ADJ; ace_yy_cp < ace_yy_c_buf_p; ++ace_yy_cp ) + { + register ACE_YY_CHAR ace_yy_c = (*ace_yy_cp ? ace_yy_ec[ACE_YY_SC_TO_UI(*ace_yy_cp)] : 1); + if ( ace_yy_accept[ace_yy_current_state] ) + { + ace_yy_last_accepting_state = ace_yy_current_state; + ace_yy_last_accepting_cpos = ace_yy_cp; + } + while ( ace_yy_chk[ace_yy_base[ace_yy_current_state] + ace_yy_c] != ace_yy_current_state ) + { + ace_yy_current_state = (int) ace_yy_def[ace_yy_current_state]; + if ( ace_yy_current_state >= 107 ) + ace_yy_c = ace_yy_meta[(unsigned int) ace_yy_c]; + } + ace_yy_current_state = ace_yy_nxt[ace_yy_base[ace_yy_current_state] + (unsigned int) ace_yy_c]; + } + + return ace_yy_current_state; + } /* ace_yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = ace_yy_try_NUL_trans( current_state ); + * next_state = ace_yy_try_NUL_trans( current_state ); */ #ifdef ACE_YY_USE_PROTOS @@ -1240,27 +1240,27 @@ static ace_yy_state_type ace_yy_try_NUL_trans( ace_yy_state_type ace_yy_current_ static ace_yy_state_type ace_yy_try_NUL_trans( ace_yy_current_state ) ace_yy_state_type ace_yy_current_state; #endif - { - register int ace_yy_is_jam; - register ACE_TCHAR *ace_yy_cp = ace_yy_c_buf_p; - - register ACE_YY_CHAR ace_yy_c = 1; - if ( ace_yy_accept[ace_yy_current_state] ) - { - ace_yy_last_accepting_state = ace_yy_current_state; - ace_yy_last_accepting_cpos = ace_yy_cp; - } - while ( ace_yy_chk[ace_yy_base[ace_yy_current_state] + ace_yy_c] != ace_yy_current_state ) - { - ace_yy_current_state = (int) ace_yy_def[ace_yy_current_state]; - if ( ace_yy_current_state >= 107 ) - ace_yy_c = ace_yy_meta[(unsigned int) ace_yy_c]; - } - ace_yy_current_state = ace_yy_nxt[ace_yy_base[ace_yy_current_state] + (unsigned int) ace_yy_c]; - ace_yy_is_jam = (ace_yy_current_state == 106); - - return ace_yy_is_jam ? 0 : ace_yy_current_state; - } + { + register int ace_yy_is_jam; + register ACE_TCHAR *ace_yy_cp = ace_yy_c_buf_p; + + register ACE_YY_CHAR ace_yy_c = 1; + if ( ace_yy_accept[ace_yy_current_state] ) + { + ace_yy_last_accepting_state = ace_yy_current_state; + ace_yy_last_accepting_cpos = ace_yy_cp; + } + while ( ace_yy_chk[ace_yy_base[ace_yy_current_state] + ace_yy_c] != ace_yy_current_state ) + { + ace_yy_current_state = (int) ace_yy_def[ace_yy_current_state]; + if ( ace_yy_current_state >= 107 ) + ace_yy_c = ace_yy_meta[(unsigned int) ace_yy_c]; + } + ace_yy_current_state = ace_yy_nxt[ace_yy_base[ace_yy_current_state] + (unsigned int) ace_yy_c]; + ace_yy_is_jam = (ace_yy_current_state == 106); + + return ace_yy_is_jam ? 0 : ace_yy_current_state; + } #ifndef ACE_YY_NO_UNPUT @@ -1271,41 +1271,41 @@ static void ace_yyunput( c, ace_yy_bp ) int c; register ACE_TCHAR *ace_yy_bp; #endif - { - register ACE_TCHAR *ace_yy_cp = ace_yy_c_buf_p; + { + register ACE_TCHAR *ace_yy_cp = ace_yy_c_buf_p; - /* undo effects of setting up ace_yytext */ - *ace_yy_cp = ace_yy_hold_char; + /* undo effects of setting up ace_yytext */ + *ace_yy_cp = ace_yy_hold_char; - if ( ace_yy_cp < ace_yy_current_buffer->ace_yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = ace_yy_n_chars + 2; - register ACE_TCHAR *dest = &ace_yy_current_buffer->ace_yy_ch_buf[ - ace_yy_current_buffer->ace_yy_buf_size + 2]; - register ACE_TCHAR *source = - &ace_yy_current_buffer->ace_yy_ch_buf[number_to_move]; + if ( ace_yy_cp < ace_yy_current_buffer->ace_yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = ace_yy_n_chars + 2; + register ACE_TCHAR *dest = &ace_yy_current_buffer->ace_yy_ch_buf[ + ace_yy_current_buffer->ace_yy_buf_size + 2]; + register ACE_TCHAR *source = + &ace_yy_current_buffer->ace_yy_ch_buf[number_to_move]; - while ( source > ace_yy_current_buffer->ace_yy_ch_buf ) - *--dest = *--source; + while ( source > ace_yy_current_buffer->ace_yy_ch_buf ) + *--dest = *--source; - ace_yy_cp += (int) (dest - source); - ace_yy_bp += (int) (dest - source); - ace_yy_current_buffer->ace_yy_n_chars = - ace_yy_n_chars = ace_yy_current_buffer->ace_yy_buf_size; + ace_yy_cp += (int) (dest - source); + ace_yy_bp += (int) (dest - source); + ace_yy_current_buffer->ace_yy_n_chars = + ace_yy_n_chars = ace_yy_current_buffer->ace_yy_buf_size; - if ( ace_yy_cp < ace_yy_current_buffer->ace_yy_ch_buf + 2 ) - ACE_YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } + if ( ace_yy_cp < ace_yy_current_buffer->ace_yy_ch_buf + 2 ) + ACE_YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } - *--ace_yy_cp = (ACE_TCHAR) c; + *--ace_yy_cp = (ACE_TCHAR) c; - ace_yytext_ptr = ace_yy_bp; - ace_yy_hold_char = *ace_yy_cp; - ace_yy_c_buf_p = ace_yy_cp; - } -#endif /* ifndef ACE_YY_NO_UNPUT */ + ace_yytext_ptr = ace_yy_bp; + ace_yy_hold_char = *ace_yy_cp; + ace_yy_c_buf_p = ace_yy_cp; + } +#endif /* ifndef ACE_YY_NO_UNPUT */ #ifdef __cplusplus @@ -1313,73 +1313,73 @@ static int ace_yyinput() #else static int input() #endif - { - int c; - - *ace_yy_c_buf_p = ace_yy_hold_char; - - if ( *ace_yy_c_buf_p == ACE_YY_END_OF_BUFFER_CHAR ) - { - /* ace_yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( ace_yy_c_buf_p < &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars] ) - /* This was really a NUL. */ - *ace_yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = ace_yy_c_buf_p - ace_yytext_ptr; - ++ace_yy_c_buf_p; - - switch ( ace_yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because ace_yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - ace_yyrestart( ace_yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( ace_yywrap() ) - return EOF; - - if ( ! ace_yy_did_buffer_switch_on_eof ) - ACE_YY_NEW_FILE; + { + int c; + + *ace_yy_c_buf_p = ace_yy_hold_char; + + if ( *ace_yy_c_buf_p == ACE_YY_END_OF_BUFFER_CHAR ) + { + /* ace_yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( ace_yy_c_buf_p < &ace_yy_current_buffer->ace_yy_ch_buf[ace_yy_n_chars] ) + /* This was really a NUL. */ + *ace_yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = ace_yy_c_buf_p - ace_yytext_ptr; + ++ace_yy_c_buf_p; + + switch ( ace_yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because ace_yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + ace_yyrestart( ace_yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( ace_yywrap() ) + return EOF; + + if ( ! ace_yy_did_buffer_switch_on_eof ) + ACE_YY_NEW_FILE; #ifdef __cplusplus - return ace_yyinput(); + return ace_yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - ace_yy_c_buf_p = ace_yytext_ptr + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + ace_yy_c_buf_p = ace_yytext_ptr + offset; + break; + } + } + } - c = *(unsigned char *) ace_yy_c_buf_p; /* cast for 8-bit char's */ - *ace_yy_c_buf_p = '\0'; /* preserve ace_yytext */ - ace_yy_hold_char = *++ace_yy_c_buf_p; + c = *(unsigned char *) ace_yy_c_buf_p; /* cast for 8-bit char's */ + *ace_yy_c_buf_p = '\0'; /* preserve ace_yytext */ + ace_yy_hold_char = *++ace_yy_c_buf_p; - ace_yy_current_buffer->ace_yy_at_bol = (c == '\n'); + ace_yy_current_buffer->ace_yy_at_bol = (c == '\n'); - return c; - } + return c; + } #ifdef ACE_YY_USE_PROTOS @@ -1388,13 +1388,13 @@ void ace_yyrestart( FILE *input_file ) void ace_yyrestart( input_file ) FILE *input_file; #endif - { - if ( ! ace_yy_current_buffer ) - ace_yy_current_buffer = ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); + { + if ( ! ace_yy_current_buffer ) + ace_yy_current_buffer = ace_yy_create_buffer( ace_yyin, ACE_YY_BUF_SIZE ); - ace_yy_init_buffer( ace_yy_current_buffer, input_file ); - ace_yy_load_buffer_state(); - } + ace_yy_init_buffer( ace_yy_current_buffer, input_file ); + ace_yy_load_buffer_state(); + } #ifdef ACE_YY_USE_PROTOS @@ -1403,28 +1403,28 @@ void ace_yy_switch_to_buffer( ACE_YY_BUFFER_STATE new_buffer ) void ace_yy_switch_to_buffer( new_buffer ) ACE_YY_BUFFER_STATE new_buffer; #endif - { - if ( ace_yy_current_buffer == new_buffer ) - return; + { + if ( ace_yy_current_buffer == new_buffer ) + return; - if ( ace_yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *ace_yy_c_buf_p = ace_yy_hold_char; - ace_yy_current_buffer->ace_yy_buf_pos = ace_yy_c_buf_p; - ace_yy_current_buffer->ace_yy_n_chars = ace_yy_n_chars; - } + if ( ace_yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *ace_yy_c_buf_p = ace_yy_hold_char; + ace_yy_current_buffer->ace_yy_buf_pos = ace_yy_c_buf_p; + ace_yy_current_buffer->ace_yy_n_chars = ace_yy_n_chars; + } - ace_yy_current_buffer = new_buffer; - ace_yy_load_buffer_state(); + ace_yy_current_buffer = new_buffer; + ace_yy_load_buffer_state(); - /* We don't actually know whether we did this switch during - * EOF (ace_yywrap()) processing, but the only time this flag - * is looked at is after ace_yywrap() is called, so it's safe - * to go ahead and always set it. - */ - ace_yy_did_buffer_switch_on_eof = 1; - } + /* We don't actually know whether we did this switch during + * EOF (ace_yywrap()) processing, but the only time this flag + * is looked at is after ace_yywrap() is called, so it's safe + * to go ahead and always set it. + */ + ace_yy_did_buffer_switch_on_eof = 1; + } #ifdef ACE_YY_USE_PROTOS @@ -1432,12 +1432,12 @@ void ace_yy_load_buffer_state( void ) #else void ace_yy_load_buffer_state() #endif - { - ace_yy_n_chars = ace_yy_current_buffer->ace_yy_n_chars; - ace_yytext_ptr = ace_yy_c_buf_p = ace_yy_current_buffer->ace_yy_buf_pos; - ace_yyin = ace_yy_current_buffer->ace_yy_input_file; - ace_yy_hold_char = *ace_yy_c_buf_p; - } + { + ace_yy_n_chars = ace_yy_current_buffer->ace_yy_n_chars; + ace_yytext_ptr = ace_yy_c_buf_p = ace_yy_current_buffer->ace_yy_buf_pos; + ace_yyin = ace_yy_current_buffer->ace_yy_input_file; + ace_yy_hold_char = *ace_yy_c_buf_p; + } #ifdef ACE_YY_USE_PROTOS @@ -1447,28 +1447,28 @@ ACE_YY_BUFFER_STATE ace_yy_create_buffer( file, size ) FILE *file; int size; #endif - { - ACE_YY_BUFFER_STATE b; + { + ACE_YY_BUFFER_STATE b; - b = (ACE_YY_BUFFER_STATE) ace_yy_flex_alloc( sizeof( struct ace_yy_buffer_state ) ); - if ( ! b ) - ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_create_buffer()") ); + b = (ACE_YY_BUFFER_STATE) ace_yy_flex_alloc( sizeof( struct ace_yy_buffer_state ) ); + if ( ! b ) + ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_create_buffer()") ); - b->ace_yy_buf_size = size; + b->ace_yy_buf_size = size; - /* ace_yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->ace_yy_ch_buf = (ACE_TCHAR *) ace_yy_flex_alloc( b->ace_yy_buf_size + 2 ); - if ( ! b->ace_yy_ch_buf ) - ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_create_buffer()") ); + /* ace_yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->ace_yy_ch_buf = (ACE_TCHAR *) ace_yy_flex_alloc( b->ace_yy_buf_size + 2 ); + if ( ! b->ace_yy_ch_buf ) + ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_create_buffer()") ); - b->ace_yy_is_our_buffer = 1; + b->ace_yy_is_our_buffer = 1; - ace_yy_init_buffer( b, file ); + ace_yy_init_buffer( b, file ); - return b; - } + return b; + } #ifdef ACE_YY_USE_PROTOS @@ -1477,18 +1477,18 @@ void ace_yy_delete_buffer( ACE_YY_BUFFER_STATE b ) void ace_yy_delete_buffer( b ) ACE_YY_BUFFER_STATE b; #endif - { - if ( ! b ) - return; + { + if ( ! b ) + return; - if ( b == ace_yy_current_buffer ) - ace_yy_current_buffer = (ACE_YY_BUFFER_STATE) 0; + if ( b == ace_yy_current_buffer ) + ace_yy_current_buffer = (ACE_YY_BUFFER_STATE) 0; - if ( b->ace_yy_is_our_buffer ) - ace_yy_flex_free( (void *) b->ace_yy_ch_buf ); + if ( b->ace_yy_is_our_buffer ) + ace_yy_flex_free( (void *) b->ace_yy_ch_buf ); - ace_yy_flex_free( (void *) b ); - } + ace_yy_flex_free( (void *) b ); + } #ifndef ACE_YY_ALWAYS_INTERACTIVE @@ -1506,22 +1506,22 @@ FILE *file; #endif - { - ace_yy_flush_buffer( b ); + { + ace_yy_flush_buffer( b ); - b->ace_yy_input_file = file; - b->ace_yy_fill_buffer = 1; + b->ace_yy_input_file = file; + b->ace_yy_fill_buffer = 1; #if ACE_YY_ALWAYS_INTERACTIVE - b->ace_yy_is_interactive = 1; + b->ace_yy_is_interactive = 1; #else #if ACE_YY_NEVER_INTERACTIVE - b->ace_yy_is_interactive = 0; + b->ace_yy_is_interactive = 0; #else - b->ace_yy_is_interactive = file ? (ACE_OS::isatty( fileno (file) ) > 0) : 0; + b->ace_yy_is_interactive = file ? (ACE_OS::isatty( fileno (file) ) > 0) : 0; #endif #endif - } + } #ifdef ACE_YY_USE_PROTOS @@ -1531,27 +1531,27 @@ void ace_yy_flush_buffer( b ) ACE_YY_BUFFER_STATE b; #endif - { - if ( ! b ) - return; + { + if ( ! b ) + return; - b->ace_yy_n_chars = 0; + b->ace_yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->ace_yy_ch_buf[0] = ACE_YY_END_OF_BUFFER_CHAR; - b->ace_yy_ch_buf[1] = ACE_YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->ace_yy_ch_buf[0] = ACE_YY_END_OF_BUFFER_CHAR; + b->ace_yy_ch_buf[1] = ACE_YY_END_OF_BUFFER_CHAR; - b->ace_yy_buf_pos = &b->ace_yy_ch_buf[0]; + b->ace_yy_buf_pos = &b->ace_yy_ch_buf[0]; - b->ace_yy_at_bol = 1; - b->ace_yy_buffer_status = ACE_YY_BUFFER_NEW; + b->ace_yy_at_bol = 1; + b->ace_yy_buffer_status = ACE_YY_BUFFER_NEW; - if ( b == ace_yy_current_buffer ) - ace_yy_load_buffer_state(); - } + if ( b == ace_yy_current_buffer ) + ace_yy_load_buffer_state(); + } #ifndef ACE_YY_NO_SCAN_BUFFER @@ -1562,33 +1562,33 @@ ACE_YY_BUFFER_STATE ace_yy_scan_buffer( base, size ) ACE_TCHAR *base; ace_yy_size_t size; #endif - { - ACE_YY_BUFFER_STATE b; + { + ACE_YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != ACE_YY_END_OF_BUFFER_CHAR || - base[size-1] != ACE_YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; + if ( size < 2 || + base[size-2] != ACE_YY_END_OF_BUFFER_CHAR || + base[size-1] != ACE_YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; - b = (ACE_YY_BUFFER_STATE) ace_yy_flex_alloc( sizeof( struct ace_yy_buffer_state ) ); - if ( ! b ) - ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_scan_buffer()") ); + b = (ACE_YY_BUFFER_STATE) ace_yy_flex_alloc( sizeof( struct ace_yy_buffer_state ) ); + if ( ! b ) + ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_scan_buffer()") ); - b->ace_yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->ace_yy_buf_pos = b->ace_yy_ch_buf = base; - b->ace_yy_is_our_buffer = 0; - b->ace_yy_input_file = 0; - b->ace_yy_n_chars = b->ace_yy_buf_size; - b->ace_yy_is_interactive = 0; - b->ace_yy_at_bol = 1; - b->ace_yy_fill_buffer = 0; - b->ace_yy_buffer_status = ACE_YY_BUFFER_NEW; + b->ace_yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->ace_yy_buf_pos = b->ace_yy_ch_buf = base; + b->ace_yy_is_our_buffer = 0; + b->ace_yy_input_file = 0; + b->ace_yy_n_chars = b->ace_yy_buf_size; + b->ace_yy_is_interactive = 0; + b->ace_yy_at_bol = 1; + b->ace_yy_fill_buffer = 0; + b->ace_yy_buffer_status = ACE_YY_BUFFER_NEW; - ace_yy_switch_to_buffer( b ); + ace_yy_switch_to_buffer( b ); - return b; - } + return b; + } #endif @@ -1599,13 +1599,13 @@ ACE_YY_BUFFER_STATE ace_yy_scan_string( ace_yyconst ACE_TCHAR *ace_yy_str ) ACE_YY_BUFFER_STATE ace_yy_scan_string( ace_yy_str ) ace_yyconst ACE_TCHAR *ace_yy_str; #endif - { - int len; - for ( len = 0; ace_yy_str[len]; ++len ) - ; + { + int len; + for ( len = 0; ace_yy_str[len]; ++len ) + ; - return ace_yy_scan_bytes( ace_yy_str, len ); - } + return ace_yy_scan_bytes( ace_yy_str, len ); + } #endif @@ -1617,34 +1617,34 @@ ACE_YY_BUFFER_STATE ace_yy_scan_bytes( bytes, len ) ace_yyconst ACE_TCHAR *bytes; int len; #endif - { - ACE_YY_BUFFER_STATE b; - ACE_TCHAR *buf; - ace_yy_size_t n; - int i; + { + ACE_YY_BUFFER_STATE b; + ACE_TCHAR *buf; + ace_yy_size_t n; + int i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (ACE_TCHAR *) ace_yy_flex_alloc( n ); - if ( ! buf ) - ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_scan_bytes()") ); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (ACE_TCHAR *) ace_yy_flex_alloc( n ); + if ( ! buf ) + ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("out of dynamic memory in ace_yy_scan_bytes()") ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[len] = buf[len+1] = ACE_YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = ACE_YY_END_OF_BUFFER_CHAR; - b = ace_yy_scan_buffer( buf, n ); - if ( ! b ) - ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("bad buffer in ace_yy_scan_bytes()") ); + b = ace_yy_scan_buffer( buf, n ); + if ( ! b ) + ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("bad buffer in ace_yy_scan_bytes()") ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->ace_yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->ace_yy_is_our_buffer = 1; - return b; - } + return b; + } #endif @@ -1655,49 +1655,49 @@ static void ace_yy_push_state( int new_state ) static void ace_yy_push_state( new_state ) int new_state; #endif - { - if ( ace_yy_start_stack_ptr >= ace_yy_start_stack_depth ) - { - ace_yy_size_t new_size; + { + if ( ace_yy_start_stack_ptr >= ace_yy_start_stack_depth ) + { + ace_yy_size_t new_size; - ace_yy_start_stack_depth += ACE_YY_START_STACK_INCR; - new_size = ace_yy_start_stack_depth * sizeof( int ); + ace_yy_start_stack_depth += ACE_YY_START_STACK_INCR; + new_size = ace_yy_start_stack_depth * sizeof( int ); - if ( ! ace_yy_start_stack ) - ace_yy_start_stack = (int *) ace_yy_flex_alloc( new_size ); + if ( ! ace_yy_start_stack ) + ace_yy_start_stack = (int *) ace_yy_flex_alloc( new_size ); - else - ace_yy_start_stack = (int *) ace_yy_flex_realloc( - (void *) ace_yy_start_stack, new_size ); + else + ace_yy_start_stack = (int *) ace_yy_flex_realloc( + (void *) ace_yy_start_stack, new_size ); - if ( ! ace_yy_start_stack ) - ACE_YY_FATAL_ERROR( - ACE_LIB_TEXT ("out of memory expanding start-condition stack") ); - } + if ( ! ace_yy_start_stack ) + ACE_YY_FATAL_ERROR( + ACE_LIB_TEXT ("out of memory expanding start-condition stack") ); + } - ace_yy_start_stack[ace_yy_start_stack_ptr++] = ACE_YY_START; + ace_yy_start_stack[ace_yy_start_stack_ptr++] = ACE_YY_START; - BEGIN(new_state); - } + BEGIN(new_state); + } #endif #ifndef ACE_YY_NO_POP_STATE static void ace_yy_pop_state() - { - if ( --ace_yy_start_stack_ptr < 0 ) - ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("start-condition stack underflow") ); + { + if ( --ace_yy_start_stack_ptr < 0 ) + ACE_YY_FATAL_ERROR( ACE_LIB_TEXT ("start-condition stack underflow") ); - BEGIN(ace_yy_start_stack[ace_yy_start_stack_ptr]); - } + BEGIN(ace_yy_start_stack[ace_yy_start_stack_ptr]); + } #endif #ifndef ACE_YY_NO_TOP_STATE static int ace_yy_top_state() - { - return ace_yy_start_stack[ace_yy_start_stack_ptr - 1]; - } + { + return ace_yy_start_stack[ace_yy_start_stack_ptr - 1]; + } #endif #ifndef ACE_YY_EXIT_FAILURE @@ -1710,10 +1710,10 @@ static void ace_yy_fatal_error( ace_yyconst ACE_TCHAR msg[] ) static void ace_yy_fatal_error( msg ) ACE_TCHAR msg[]; #endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( ACE_YY_EXIT_FAILURE ); - } + { + (void) fprintf( stderr, "%s\n", msg ); + exit( ACE_YY_EXIT_FAILURE ); + } @@ -1721,16 +1721,16 @@ ACE_TCHAR msg[]; #undef ace_yyless #define ace_yyless(n) \ - do \ - { \ - /* Undo effects of setting up ace_yytext. */ \ - ace_yytext[ace_yyleng] = ace_yy_hold_char; \ - ace_yy_c_buf_p = ace_yytext + n; \ - ace_yy_hold_char = *ace_yy_c_buf_p; \ - *ace_yy_c_buf_p = '\0'; \ - ace_yyleng = n; \ - } \ - while ( 0 ) + do \ + { \ + /* Undo effects of setting up ace_yytext. */ \ + ace_yytext[ace_yyleng] = ace_yy_hold_char; \ + ace_yy_c_buf_p = ace_yytext + n; \ + ace_yy_hold_char = *ace_yy_c_buf_p; \ + *ace_yy_c_buf_p = '\0'; \ + ace_yyleng = n; \ + } \ + while ( 0 ) /* Internal utility routines. */ @@ -1744,11 +1744,11 @@ ACE_TCHAR *s1; ace_yyconst ACE_TCHAR *s2; int n; #endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } #endif #ifdef ACE_YY_NEED_STRLEN @@ -1758,13 +1758,13 @@ static int ace_yy_flex_strlen( ace_yyconst ACE_TCHAR *s ) static int ace_yy_flex_strlen( s ) ace_yyconst ACE_TCHAR *s; #endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; + { + register int n; + for ( n = 0; s[n]; ++n ) + ; - return n; - } + return n; + } #endif @@ -1774,9 +1774,9 @@ static void *ace_yy_flex_alloc( ace_yy_size_t size ) static void *ace_yy_flex_alloc( size ) ace_yy_size_t size; #endif - { - return (void *) malloc( size ); - } + { + return (void *) malloc( size ); + } #ifdef ACE_YY_USE_PROTOS static void *ace_yy_flex_realloc( void *ptr, ace_yy_size_t size ) @@ -1785,16 +1785,16 @@ static void *ace_yy_flex_realloc( ptr, size ) void *ptr; ace_yy_size_t size; #endif - { - /* The cast to (ACE_TCHAR *) in the following accommodates both - * implementations that use ACE_TCHAR* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (ACE_TCHAR *) ptr, size ); - } + { + /* The cast to (ACE_TCHAR *) in the following accommodates both + * implementations that use ACE_TCHAR* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (ACE_TCHAR *) ptr, size ); + } #ifdef ACE_YY_USE_PROTOS static void ace_yy_flex_free( void *ptr ) @@ -1802,16 +1802,16 @@ static void ace_yy_flex_free( void *ptr ) static void ace_yy_flex_free( ptr ) void *ptr; #endif - { - free( ACE_MALLOC_T (ptr) ); - } + { + free( ACE_MALLOC_T (ptr) ); + } #if ACE_YY_MAIN int main() - { - ace_yylex(); - return 0; - } + { + ace_yylex(); + return 0; + } #endif #line 90 "Svc_Conf.l" @@ -1831,7 +1831,7 @@ ace_yywrap (void) void ace_yy_delete_parse_buffer (void) { - if (ace_yy_current_buffer != 0) + if (ace_yy_current_buffer != 0) { ace_yy_delete_buffer (ace_yy_current_buffer); ace_yy_current_buffer = 0; diff --git a/ace/Svc_Conf_y.cpp b/ace/Svc_Conf_y.cpp index 1f6b8909933..7688242ba06 100644 --- a/ace/Svc_Conf_y.cpp +++ b/ace/Svc_Conf_y.cpp @@ -1,5 +1,5 @@ #ifndef lint -char ace_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\ +char ace_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\ Modified 5/2/90 by J. Roskind to support graphic debugging modes"; #endif #line 2 "Svc_Conf.y" @@ -23,7 +23,7 @@ static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec, /* #define ACE_YYDEBUG 1*/ /* Efficient memory allocation technique.*/ -ACE_Obstack *ace_obstack; +ACE_Obstack_T<ACE_TCHAR> *ace_obstack; #line 30 "Svc_Conf_y.cpp" #define ACE_DYNAMIC 257 @@ -386,7 +386,7 @@ int main (int argc, char *argv[]) { ace_yyin = stdin; - ace_obstack = new ACE_Obstack; + ace_obstack = new ACE_Obstack_T<ACE_TCHAR>; // Try to reopen any filename argument to use ACE_YYIN. if (argc > 1 && (ace_yyin = freopen (argv[1], "r", stdin)) == 0) diff --git a/ace/ace_dll.dsp b/ace/ace_dll.dsp index 2cf64ccfd9f..b4d65be6b18 100644 --- a/ace/ace_dll.dsp +++ b/ace/ace_dll.dsp @@ -135,7 +135,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# 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 "../" /I "../PACE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ACE_BUILD_DLL" /D "ACE_OS_BUILD_DLL" /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "../" /I "../PACE" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ACE_BUILD_DLL" /D "ACE_OS_BUILD_DLL" /FR /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
@@ -566,6 +566,10 @@ SOURCE=.\NT_Service.cpp # End Source File
# Begin Source File
+SOURCE=.\Obchunk.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Object_Manager.cpp
# End Source File
# Begin Source File
@@ -1566,6 +1570,10 @@ SOURCE=.\NT_Service.h # End Source File
# Begin Source File
+SOURCE=.\Obchunk.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Object_Manager.h
# End Source File
# Begin Source File
@@ -1574,6 +1582,10 @@ SOURCE=.\Obstack.h # End Source File
# Begin Source File
+SOURCE=.\Obstack_T.h
+# End Source File
+# Begin Source File
+
SOURCE=.\OS.h
# End Source File
# Begin Source File
@@ -2538,7 +2550,7 @@ SOURCE=.\Object_Manager.i # End Source File
# Begin Source File
-SOURCE=.\Obstack.i
+SOURCE=.\Obstack_T.i
# End Source File
# Begin Source File
@@ -3078,6 +3090,11 @@ SOURCE=.\Module.cpp # End Source File
# Begin Source File
+SOURCE=.\Obstack_T.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
SOURCE=.\Pair_T.cpp
# PROP Exclude_From_Build 1
# End Source File
diff --git a/ace/ace_lib.dsp b/ace/ace_lib.dsp index a411fcbfaae..25af5eb4728 100644 --- a/ace/ace_lib.dsp +++ b/ace/ace_lib.dsp @@ -549,6 +549,10 @@ SOURCE=.\NT_Service.cpp # End Source File
# Begin Source File
+SOURCE=.\Obchunk.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Object_Manager.cpp
# End Source File
# Begin Source File
@@ -1549,6 +1553,10 @@ SOURCE=.\NT_Service.h # End Source File
# Begin Source File
+SOURCE=.\Obchunk.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Object_Manager.h
# End Source File
# Begin Source File
@@ -1557,6 +1565,10 @@ SOURCE=.\Obstack.h # End Source File
# Begin Source File
+SOURCE=.\Obstack_T.h
+# End Source File
+# Begin Source File
+
SOURCE=.\OS.h
# End Source File
# Begin Source File
@@ -2533,6 +2545,10 @@ SOURCE=.\Obstack.i # End Source File
# Begin Source File
+SOURCE=.\Obstack_T.i
+# End Source File
+# Begin Source File
+
SOURCE=.\OS.i
# End Source File
# Begin Source File
@@ -3069,6 +3085,11 @@ SOURCE=.\Module.cpp # End Source File
# Begin Source File
+SOURCE=.\Obstack_T.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
SOURCE=.\Pair_T.cpp
# PROP Exclude_From_Build 1
# End Source File
|