diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-05-15 03:31:06 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-05-15 03:31:06 +0000 |
commit | 8b852ffc1bdca3ad129ad0beeb93028fa695e590 (patch) | |
tree | f4eae324dc4b6fea3a503bf1680f88edae96cf3d /ace | |
parent | 2fdbd9e922334cd2b39f677daabd23812a443e6c (diff) | |
download | ATCD-8b852ffc1bdca3ad129ad0beeb93028fa695e590.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Containers.h | 4 | ||||
-rw-r--r-- | ace/Object_Manager.cpp | 14 | ||||
-rw-r--r-- | ace/Service_Config.cpp | 81 | ||||
-rw-r--r-- | ace/Service_Config.h | 55 | ||||
-rw-r--r-- | ace/Svc_Conf.h | 21 | ||||
-rw-r--r-- | ace/Svc_Conf.l | 7 | ||||
-rw-r--r-- | ace/Svc_Conf.y | 13 | ||||
-rw-r--r-- | ace/Svc_Conf_l.cpp | 63 | ||||
-rw-r--r-- | ace/Svc_Conf_y.cpp | 103 | ||||
-rw-r--r-- | ace/config-kcc-common.h | 2 |
10 files changed, 238 insertions, 125 deletions
diff --git a/ace/Containers.h b/ace/Containers.h index 3d5b260ca97..bc52c503775 100644 --- a/ace/Containers.h +++ b/ace/Containers.h @@ -176,7 +176,8 @@ template<class T> class ACE_Node { // = TITLE - // Implementation element in a Queue. + // Implementation element in a Queue, Set, and Stack. +public: friend class ACE_Unbounded_Queue<T>; friend class ACE_Unbounded_Queue_Iterator<T>; friend class ACE_Unbounded_Set<T>; @@ -184,7 +185,6 @@ class ACE_Node friend class ACE_Unbounded_Stack<T>; friend class ACE_Unbounded_Stack_Iterator<T>; -public: ~ACE_Node (void); // This isn't necessary, but it keeps the compiler happy. diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp index ade5b492d35..cb8aff6a65f 100644 --- a/ace/Object_Manager.cpp +++ b/ace/Object_Manager.cpp @@ -97,8 +97,8 @@ ACE_Sig_Adapter *ace_service_config_sig_handler = 0; class ACE_Object_Manager_Preallocations { public: - ACE_Object_Manager_Preallocations (); - ~ACE_Object_Manager_Preallocations(); + ACE_Object_Manager_Preallocations (void); + ~ACE_Object_Manager_Preallocations (void); private: #if !defined (ACE_HAS_WINCE) @@ -157,7 +157,7 @@ ACE_Object_Manager_Preallocations::ACE_Object_Manager_Preallocations () insert (&ace_svc_desc_ACE_Service_Manager); } -ACE_Object_Manager_Preallocations::~ACE_Object_Manager_Preallocations () +ACE_Object_Manager_Preallocations::~ACE_Object_Manager_Preallocations (void) { } @@ -631,12 +631,12 @@ ACE_Object_Manager::get_singleton_lock (ACE_RW_Thread_Mutex *&lock) ACE_Object_Manager::~ACE_Object_Manager (void) { - // No mutex here. Only the main thread should destroy the - // singleton ACE_Object_Manager instance. + // No mutex here. Only the main thread should destroy the singleton + // ACE_Object_Manager instance. // First, indicate that the ACE_Object_Manager instance is (being) - // destroyed. If an object tries to register after this, it will - // be refused. + // destroyed. If an object tries to register after this, it will be + // refused. ACE_Object_Manager::shutting_down_ = 1; ACE_Trace::stop_tracing (); diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index 30edb871fbb..7f3b5c0dbee 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -65,6 +65,7 @@ const ASYS_TCHAR *ACE_Service_Config::service_config_file_ = ASYS_TEXT (ACE_DEFA // List of statically configured services. ACE_STATIC_SVCS *ACE_Service_Config::static_svcs_ = 0; +ACE_SVC_QUEUE *ACE_Service_Config::svc_queue_ = 0; ACE_STATIC_SVCS * ACE_Service_Config::static_svcs (void) @@ -241,11 +242,13 @@ ACE_Service_Config::parse_args (int argc, ASYS_TCHAR *argv[]) break; } case 'S': - // Process just a single directive. - if (ACE_Service_Config::process_directive (getopt.optarg) == -1) + if (ACE_Service_Config::svc_queue_ == 0) + ACE_Service_Config::svc_queue_ = new ACE_SVC_QUEUE; + + if (ACE_Service_Config::svc_queue_->enqueue_head + (ACE_CString (getopt.optarg)) == -1) ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("%p\n"), - ASYS_TEXT ("process_directives"))); + ASYS_TEXT ("%p\n"), "enqueue_head")); break; default: ACE_ERROR ((LM_ERROR, @@ -263,7 +266,7 @@ ACE_Service_Config::initialize (const ASYS_TCHAR svc_name[], { ACE_TRACE ("ACE_Service_Config::initialize"); ACE_ARGV args (parameters); - ACE_Service_Type *srp = 0; + ACE_Service_Type *srp = 0; ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("opening static service %s\n"), svc_name)); @@ -335,15 +338,21 @@ ACE_Service_Config::process_directives_i (void) } int -ACE_Service_Config::process_directive (ASYS_TCHAR directive[]) +ACE_Service_Config::process_directive (const ASYS_TCHAR directive[]) { ACE_TRACE ("ACE_Service_Config::process_directives"); ACE_UNUSED_ARG (directive); - // @@ What needs to happen at this point is for the <directive> to - // be placed into a buffer that the YY_INPUT macro knows how to - // process correctly. - return ACE_Service_Config::process_directives_i (); + // Place <directive> into a buffer that the YY_INPUT macro knows how + // to process correctly. + ace_yydirective = directive; + + int result = ACE_Service_Config::process_directives_i (); + + // Reset to 0 to avoid confusing the YY_INPUT macro on subsequent + // requests. + ace_yydirective = 0; + return result; } // Process service configuration requests as indicated in the @@ -369,6 +378,37 @@ ACE_Service_Config::process_directives (void) } } +int +ACE_Service_Config::process_commandline_directives (void) +{ + int result = 0; + + if (ACE_Service_Config::svc_queue_ != 0) + { + ACE_CString *sptr = 0; + ACE_SVC_QUEUE &queue = *ACE_Service_Config::svc_queue_; + + for (ACE_SVC_QUEUE_ITERATOR iter (queue); + iter.next (sptr) != 0; + iter.advance ()) + { + // Process just a single directive. + if (ACE_Service_Config::process_directive (sptr->fast_rep ()) == -1) + { + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("process_directive"))); + result = -1; + } + } + + delete ACE_Service_Config::svc_queue_; + ACE_Service_Config::svc_queue_ = 0; + } + + return result; +} + // Add the default statically-linked services to the Service // Repository. @@ -400,8 +440,10 @@ ACE_Service_Config::load_static_svcs (void) ACE_Service_Type *sr; - ACE_NEW_RETURN (sr, ACE_Service_Type (ssd->name_, stp, - 0, ssd->active_), -1); + ACE_NEW_RETURN (sr, ACE_Service_Type (ssd->name_, + stp, + 0, + ssd->active_), -1); if (ACE_Service_Repository::instance ()->insert (sr) == -1) return -1; @@ -450,14 +492,15 @@ ACE_Service_Config::open (const ASYS_TCHAR program_name[], // same size as the ACE_Service_Repository). ACE_Reactor::instance (); - // Register ourselves to receive reconfiguration requests via - // signals! - + // See if we need to load the static services. if (ACE_Service_Config::no_static_svcs_ == 0 && ACE_Service_Config::load_static_svcs () == -1) return -1; else - return ACE_Service_Config::process_directives (); + { + int result = ACE_Service_Config::process_commandline_directives (); + return ACE_Service_Config::process_directives () + result; + } } } @@ -637,6 +680,9 @@ ACE_Service_Config::start_daemon (void) template class ACE_Node<ACE_Static_Svc_Descriptor *>; template class ACE_Unbounded_Set<ACE_Static_Svc_Descriptor *>; template class ACE_Unbounded_Set_Iterator<ACE_Static_Svc_Descriptor *>; +template class ACE_Node<ACE_CString>; +template class ACE_Unbounded_Set<ACE_CString>; +template class ACE_Unbounded_Set_Iterator<ACE_CString>; template class ACE_Malloc<ACE_LOCAL_MEMORY_POOL, ACE_Null_Mutex>; template class ACE_Allocator_Adapter<ACE_Malloc<ACE_LOCAL_MEMORY_POOL, ACE_Null_Mutex> >; template class auto_ptr<ACE_Obstack>; @@ -645,6 +691,9 @@ template class ACE_Auto_Basic_Ptr<ACE_Obstack>; #pragma instantiate ACE_Node<ACE_Static_Svc_Descriptor *> #pragma instantiate ACE_Unbounded_Set<ACE_Static_Svc_Descriptor *> #pragma instantiate ACE_Unbounded_Set_Iterator<ACE_Static_Svc_Descriptor *> +#pragma instantiate ACE_Node<ACE_CString> +#pragma instantiate ACE_Unbounded_Set<ACE_ACE_CString> +#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_CString> #pragma instantiate ACE_Malloc<ACE_LOCAL_MEMORY_POOL, ACE_Null_Mutex> #pragma instantiate ACE_Allocator_Adapter<ACE_Malloc<ACE_LOCAL_MEMORY_POOL, ACE_Null_Mutex> > #pragma instantiate auto_ptr<ACE_Obstack> diff --git a/ace/Service_Config.h b/ace/Service_Config.h index 6e4103892a8..6e74378642e 100644 --- a/ace/Service_Config.h +++ b/ace/Service_Config.h @@ -20,6 +20,7 @@ #include "ace/Service_Object.h" #include "ace/Signal.h" #include "ace/Containers.h" +#include "ace/SString.h" // Forward decl. class ACE_Service_Repository; @@ -33,8 +34,12 @@ extern "C" typedef ACE_Service_Object *(*ACE_SERVICE_ALLOCATOR) (ACE_Service_Object_Exterminator *); } -struct ACE_Static_Svc_Descriptor +class ACE_Static_Svc_Descriptor { + // = TITLE + // Holds the information necessary to describe a statically linked + // Svc. +public: ASYS_TCHAR *name_; // Name of the service. @@ -61,13 +66,19 @@ public: // Compare two service descriptors for equality. }; -// = Maintain a set of the statically linked service descriptor. - +// Maintain a set of the statically linked service descriptors. typedef ACE_Unbounded_Set<ACE_Static_Svc_Descriptor *> ACE_STATIC_SVCS; typedef ACE_Unbounded_Set_Iterator<ACE_Static_Svc_Descriptor *> ACE_STATIC_SVCS_ITERATOR; +// Maintain a queue of services to be configured from the +// command-line. +typedef ACE_Unbounded_Queue<ACE_CString> + ACE_SVC_QUEUE; +typedef ACE_Unbounded_Queue_Iterator<ACE_CString> + ACE_SVC_QUEUE_ITERATOR; + class ACE_Export ACE_Service_Config { // = TITLE @@ -98,15 +109,15 @@ public: static int open (const ASYS_TCHAR program_name[], LPCTSTR logger_key = ACE_DEFAULT_LOGGER_KEY); // Performs an open without parsing command-line arguments. Returns - // -1 on failure and 0 otherwise. + // number of errors that occurred on failure and 0 otherwise. static int open (int argc, ASYS_TCHAR *argv[], LPCTSTR logger_key = ACE_DEFAULT_LOGGER_KEY); // This is the primary entry point into the ACE_Service_Config (the // constructor just handles simple initializations). It parses - // arguments passed in from the command-line. Returns -1 on failure - // and 0 otherwise. + // arguments passed in from the command-line. Returns number of + // errors that occurred on failure and 0 otherwise. virtual ~ACE_Service_Config (void); // Perform user-specified close activities and remove dynamic @@ -242,7 +253,8 @@ public: // from the ACE_Reactor, and unlinking it if necessary. #if defined (ACE_HAS_WINCE) - // We must provide these function to bridge Svc_Conf parser with ACE. + // We must provide these function to bridge the <Svc_Conf> parser + // with ACE. static int initialize (const ACE_Service_Type *, char parameters[]); static int initialize (const char svc_name[], char parameters[]); static int resume (const char svc_name[]); @@ -261,17 +273,22 @@ public: protected: static int process_directives (void); - // Process service configuration requests as indicated in the - // <service_config_file>. Returns -1 if errors occur, else 0. + // Process service configuration requests that are provided in the + // <service_config_file>. Returns the number of errors that + // occurred. - static int process_directive (ASYS_TCHAR directive[]); + static int process_commandline_directives (void); + // Process service configuration requests that were provided on the + // command-line. Returns the number of errors that occurred. + + static int process_directive (const ASYS_TCHAR directive[]); // Process one service configuration <directive>, which is passed as - // a string. Returns -1 if errors occur, else 0. + // a string. Returns the number of errors that occurred. static int process_directives_i (void); // This is the implementation function that <process_directives> and - // <process_directive> both call. Returns -1 if errors occur, else - // 0. + // <process_directive> both call. Returns the number of errors that + // occurred. static void parse_args (int, ASYS_TCHAR *argv[]); // Handle the command-line options intended for the @@ -295,12 +312,12 @@ private: static LPCTSTR logger_key_; // Where to write the logging output. - //static ACE_Static_Svc_Descriptor service_list_[]; - // List of statically linked services. - static ACE_STATIC_SVCS *static_svcs_; // Singleton repository of statically linked services. + static ACE_SVC_QUEUE *svc_queue_; + // Queue of services requested on the command-line. + static sig_atomic_t reconfig_occurred_; // True if reconfiguration occurred. @@ -320,9 +337,9 @@ private: #include "ace/Service_Config.i" #endif /* __ACE_INLINE__ */ -// These must go here to avoid circular includes... -// (only left here for to not break applications -// which rely on this - no real need any longer) +// These must go here to avoid circular includes... (only left here +// for to not break applications which rely on this - no real need any +// longer) #include "ace/Reactor.h" #include "ace/Svc_Conf_Tokens.h" #endif /* ACE_SERVICE_CONFIG_H */ diff --git a/ace/Svc_Conf.h b/ace/Svc_Conf.h index 55021a766aa..817c2240315 100644 --- a/ace/Svc_Conf.h +++ b/ace/Svc_Conf.h @@ -45,6 +45,23 @@ ACE_YY_DECL; extern FILE *ace_yyin; // Name of input stream +#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; \ + } \ + else if ( ace_yy_current_buffer->ace_yy_is_interactive ) \ + { \ + int c = getc( ace_yyin ); \ + result = c == EOF ? 0 : 1; \ + buf[0] = (char) c; \ + } \ + else if ( ((result = fread( buf, 1, max_size, ace_yyin )) == 0) \ + && ferror( ace_yyin ) ) \ + ACE_YY_FATAL_ERROR( "input in flex scanner failed" ); + void ace_yyerror (char *); // Error handling routine required by YACC or BISON @@ -54,6 +71,10 @@ extern int ace_yylineno; extern int ace_yyerrno; // Keeps track of the number of errors encountered so far +extern char *ace_yydirective; +// Used to parse service configurator directives from a string rather +// than from a svc.conf file. + extern char *ace_yytext; // Holds the lexeme for the current token diff --git a/ace/Svc_Conf.l b/ace/Svc_Conf.l index a4e6f5b4735..f128cec1974 100644 --- a/ace/Svc_Conf.l +++ b/ace/Svc_Conf.l @@ -12,6 +12,10 @@ int yylineno = 1; // Keeps track of the number of errors encountered so far. int yyerrno = 0; +// Used to parse service configurator directives from a string rather +// than from a svc.conf file. +char *yydirective = 0; + #define token(x) x %} @@ -73,5 +77,8 @@ yywrap (void) ::fflush (yyin); yytext[0] = '#'; yyleng = 0; + + // This needs to be freed to prevent a memory leak. + yy_delete_buffer (yy_current_buffer); return 1; } diff --git a/ace/Svc_Conf.y b/ace/Svc_Conf.y index 26d5ce0ce02..ab78ac99d8a 100644 --- a/ace/Svc_Conf.y +++ b/ace/Svc_Conf.y @@ -6,8 +6,11 @@ #include "ace/Module.h" #include "ace/Stream.h" -static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type); -static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, const char *svc_name); +// Prototypes. +static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, + ACE_Static_Node *svc_type); +static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, + const char *svc_name); #define YYDEBUG_LEXER_TEXT (yytext[yyleng] = '\0', yytext) // Force the pretty debugging code to compile. @@ -286,7 +289,8 @@ yyerror (char *s) // record. static ACE_Module_Type * -get_module (ACE_Static_Node *str_rec, const char *svc_name) +get_module (ACE_Static_Node *str_rec, + const char *svc_name) { const ACE_Service_Type *sr = str_rec->record (); const ACE_Service_Type_Impl *type = sr->type (); @@ -305,7 +309,8 @@ get_module (ACE_Static_Node *str_rec, const char *svc_name) } static ACE_Module_Type * -get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type) +get_module (ACE_Static_Node *str_rec, + ACE_Static_Node *svc_type) { const ACE_Service_Type *sr = str_rec->record (); const ACE_Service_Type_Impl *type = sr->type (); diff --git a/ace/Svc_Conf_l.cpp b/ace/Svc_Conf_l.cpp index 3dc1700a3f2..5b7fa4b6271 100644 --- a/ace/Svc_Conf_l.cpp +++ b/ace/Svc_Conf_l.cpp @@ -502,6 +502,10 @@ int ace_yylineno = 1; // Keeps track of the number of errors encountered so far. int ace_yyerrno = 0; +// Used to parse service configurator directives from a string rather +// than from a svc.conf file. +char *ace_yydirective = 0; + #define token(x) x /* Macros after this point can all be overridden by user definitions in @@ -596,7 +600,7 @@ ACE_YY_DECL register char *ace_yy_cp, *ace_yy_bp; register int ace_yy_act; -# line 32 "Svc_Conf.l" +# line 36 "Svc_Conf.l" @@ -684,97 +688,97 @@ case 1: ace_yy_c_buf_p = ace_yy_cp -= 1; ACE_YY_DO_BEFORE_ACTION; /* set up ace_yytext again */ ACE_YY_USER_ACTION -# line 34 "Svc_Conf.l" +# line 38 "Svc_Conf.l" ; /* EMPTY */ ACE_YY_BREAK case 2: ACE_YY_USER_ACTION -# line 35 "Svc_Conf.l" +# line 39 "Svc_Conf.l" { return token (ACE_DYNAMIC); } /* ACE_YY_BREAK */ case 3: ACE_YY_USER_ACTION -# line 36 "Svc_Conf.l" +# line 40 "Svc_Conf.l" { return token (ACE_STATIC); } /* ACE_YY_BREAK */ case 4: ACE_YY_USER_ACTION -# line 37 "Svc_Conf.l" +# line 41 "Svc_Conf.l" { return token (ACE_SUSPEND); } /* ACE_YY_BREAK */ case 5: ACE_YY_USER_ACTION -# line 38 "Svc_Conf.l" +# line 42 "Svc_Conf.l" { return token (ACE_RESUME); } /* ACE_YY_BREAK */ case 6: ACE_YY_USER_ACTION -# line 39 "Svc_Conf.l" +# line 43 "Svc_Conf.l" { return token (ACE_REMOVE); } /* ACE_YY_BREAK */ case 7: ACE_YY_USER_ACTION -# line 40 "Svc_Conf.l" +# line 44 "Svc_Conf.l" { return token (ACE_USTREAM); } /* ACE_YY_BREAK */ case 8: ACE_YY_USER_ACTION -# line 41 "Svc_Conf.l" +# line 45 "Svc_Conf.l" { return token (ACE_MODULE_T); } /* ACE_YY_BREAK */ case 9: ACE_YY_USER_ACTION -# line 42 "Svc_Conf.l" +# line 46 "Svc_Conf.l" { return token (ACE_SVC_OBJ_T); } /* ACE_YY_BREAK */ case 10: ACE_YY_USER_ACTION -# line 43 "Svc_Conf.l" +# line 47 "Svc_Conf.l" { return token (ACE_STREAM_T); } /* ACE_YY_BREAK */ case 11: ACE_YY_USER_ACTION -# line 44 "Svc_Conf.l" +# line 48 "Svc_Conf.l" { return token (ACE_ACTIVE); } /* ACE_YY_BREAK */ case 12: ACE_YY_USER_ACTION -# line 45 "Svc_Conf.l" +# line 49 "Svc_Conf.l" { return token (ACE_INACTIVE); } /* ACE_YY_BREAK */ case 13: ACE_YY_USER_ACTION -# line 46 "Svc_Conf.l" +# line 50 "Svc_Conf.l" { return token (ACE_COLON); } /* ACE_YY_BREAK */ case 14: ACE_YY_USER_ACTION -# line 47 "Svc_Conf.l" +# line 51 "Svc_Conf.l" { return token (ACE_STAR); } /* ACE_YY_BREAK */ case 15: ACE_YY_USER_ACTION -# line 48 "Svc_Conf.l" +# line 52 "Svc_Conf.l" { return token (ACE_LPAREN); } /* ACE_YY_BREAK */ case 16: ACE_YY_USER_ACTION -# line 49 "Svc_Conf.l" +# line 53 "Svc_Conf.l" { return token (ACE_RPAREN); } /* ACE_YY_BREAK */ case 17: ACE_YY_USER_ACTION -# line 50 "Svc_Conf.l" +# line 54 "Svc_Conf.l" { return token (ACE_LBRACE); } /* ACE_YY_BREAK */ case 18: ACE_YY_USER_ACTION -# line 51 "Svc_Conf.l" +# line 55 "Svc_Conf.l" { return token (ACE_RBRACE); } /* ACE_YY_BREAK */ case 19: ACE_YY_USER_ACTION -# line 52 "Svc_Conf.l" +# line 56 "Svc_Conf.l" { // Eliminate the opening and closing double quotes *ACE_OS::strrchr (ace_yytext, '"') = '\0'; ace_yyleng -= 1; @@ -783,7 +787,7 @@ ACE_YY_USER_ACTION /* ACE_YY_BREAK */ case 20: ACE_YY_USER_ACTION -# line 57 "Svc_Conf.l" +# line 61 "Svc_Conf.l" { ace_yylval.ident_ = ace_obstack->copy (ace_yytext, ace_yyleng); return token (ACE_IDENT); @@ -791,7 +795,7 @@ ACE_YY_USER_ACTION /* ACE_YY_BREAK */ case 21: ACE_YY_USER_ACTION -# line 61 "Svc_Conf.l" +# line 65 "Svc_Conf.l" { ace_yylval.ident_ = ace_obstack->copy (ace_yytext, ace_yyleng); return token (ACE_PATHNAME); @@ -799,29 +803,29 @@ ACE_YY_USER_ACTION /* ACE_YY_BREAK */ case 22: ACE_YY_USER_ACTION -# line 65 "Svc_Conf.l" +# line 69 "Svc_Conf.l" ; /* EMPTY */ ACE_YY_BREAK case 23: ACE_YY_USER_ACTION -# line 66 "Svc_Conf.l" +# line 70 "Svc_Conf.l" { ace_yylineno++; } ACE_YY_BREAK case 24: ACE_YY_USER_ACTION -# line 67 "Svc_Conf.l" +# line 71 "Svc_Conf.l" { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("unknown char = %d\n"), *ace_yytext)); } ACE_YY_BREAK case ACE_YY_STATE_EOF(INITIAL): case ACE_YY_STATE_EOF(PARAMETERS): case ACE_YY_STATE_EOF(NORMAL): -# line 68 "Svc_Conf.l" +# line 72 "Svc_Conf.l" { ACE_YY_NEW_FILE; ace_yyterminate(); } /* ACE_YY_BREAK */ case 25: ACE_YY_USER_ACTION -# line 69 "Svc_Conf.l" +# line 73 "Svc_Conf.l" ACE_SVC_CONF_ECHO; ACE_YY_BREAK @@ -1530,7 +1534,7 @@ void *ptr; { free( ACE_MALLOC_T (ptr) ); } -# line 69 "Svc_Conf.l" +# line 73 "Svc_Conf.l" int ace_yywrap (void) @@ -1538,5 +1542,8 @@ ace_yywrap (void) ::fflush (ace_yyin); ace_yytext[0] = '#'; ace_yyleng = 0; + + // This needs to be freed to prevent a memory leak. + ace_yy_delete_buffer (ace_yy_current_buffer); return 1; } diff --git a/ace/Svc_Conf_y.cpp b/ace/Svc_Conf_y.cpp index f0cdbfd5a10..fc352a7d947 100644 --- a/ace/Svc_Conf_y.cpp +++ b/ace/Svc_Conf_y.cpp @@ -10,8 +10,11 @@ char ace_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\ #include "ace/Module.h" #include "ace/Stream.h" -static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type); -static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, const char *svc_name); +/* Prototypes.*/ +static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, + ACE_Static_Node *svc_type); +static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, + const char *svc_name); #define ACE_YYDEBUG_LEXER_TEXT (ace_yytext[ace_yyleng] = '\0', ace_yytext) /* Force the pretty debugging code to compile.*/ @@ -20,7 +23,7 @@ static ACE_Module_Type *get_module (ACE_Static_Node *str_rec, const char *svc_na /* Efficient memory allocation technique.*/ ACE_Obstack *ace_obstack; -#line 24 "Svc_Conf_y.cpp" +#line 27 "Svc_Conf_y.cpp" #define ACE_DYNAMIC 257 #define ACE_STATIC 258 #define ACE_SUSPEND 259 @@ -244,7 +247,7 @@ ACE_YYSTYPE ace_yylval; #define ace_yystacksize ACE_YYSTACKSIZE short ace_yyss[ACE_YYSTACKSIZE]; ACE_YYSTYPE ace_yyvs[ACE_YYSTACKSIZE]; -#line 275 "Svc_Conf.y" +#line 278 "Svc_Conf.y" // Prints the error string to standard output. Cleans up the error // messages. @@ -259,7 +262,8 @@ ace_yyerror (char *s) // record. static ACE_Module_Type * -get_module (ACE_Static_Node *str_rec, const char *svc_name) +get_module (ACE_Static_Node *str_rec, + const char *svc_name) { const ACE_Service_Type *sr = str_rec->record (); const ACE_Service_Type_Impl *type = sr->type (); @@ -278,7 +282,8 @@ get_module (ACE_Static_Node *str_rec, const char *svc_name) } static ACE_Module_Type * -get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type) +get_module (ACE_Static_Node *str_rec, + ACE_Static_Node *svc_type) { const ACE_Service_Type *sr = str_rec->record (); const ACE_Service_Type_Impl *type = sr->type (); @@ -375,7 +380,7 @@ main (int argc, char *argv[]) return ace_yyparse (); } #endif /* DEBUGGING */ -#line 379 "Svc_Conf_y.cpp" +#line 384 "Svc_Conf_y.cpp" #define ACE_YYABORT goto ace_yyabort #define ACE_YYACCEPT goto ace_yyaccept #define ACE_YYERROR goto ace_yyerrlab @@ -403,7 +408,7 @@ int ace_yyindent; #endif /* ACE_YYDEBUG_INDENT */ #ifndef ACE_YYDEBUG_REDUCE #ifdef __cplusplus -void ACE_YYDEBUG_REDUCE(int /* ace_yynew_state */, int /* ace_yyrule_num */, char *ace_yyrule_string, int ace_yynew_indent, int ace_yyrhs_count) +void ACE_YYDEBUG_REDUCE(int ace_yynew_state, int ace_yyrule_num, char *ace_yyrule_string, int ace_yynew_indent, int ace_yyrhs_count) #else ACE_YYDEBUG_REDUCE(ace_yynew_state, ace_yyrule_num, ace_yyrule_string, ace_yynew_indent, ace_yyrhs_count) int ace_yynew_state; @@ -433,7 +438,7 @@ int ace_yyrhs_count; #endif /* ACE_YYDEBUG_REDUCE */ #ifndef ACE_YYDEBUG_SHIFT_LEXEME #ifdef __cplusplus -void ACE_YYDEBUG_SHIFT_LEXEME(int /* ace_yyold_state */, int /* ace_yynew_state */, char *ace_yytoken_string, int ace_yynew_indent) +void ACE_YYDEBUG_SHIFT_LEXEME(int ace_yyold_state, int ace_yynew_state, char *ace_yytoken_string, int ace_yynew_indent) #else ACE_YYDEBUG_SHIFT_LEXEME(ace_yyold_state, ace_yynew_state, ace_yytoken_string, ace_yynew_indent) int ace_yyold_state; @@ -448,7 +453,7 @@ int ace_yynew_indent; #endif /* ACE_YYDEBUG_SHIFT_LEXEME */ #ifndef ACE_YYDEBUG_LOOK_AHEAD #ifdef __cplusplus -void ACE_YYDEBUG_LOOK_AHEAD(int /* ace_yynew_state */, int ace_yytoken_num, char *ace_yytoken_string, int ace_yyindent) +void ACE_YYDEBUG_LOOK_AHEAD(int ace_yynew_state, int ace_yytoken_num, char *ace_yytoken_string, int ace_yyindent) #else ACE_YYDEBUG_LOOK_AHEAD(ace_yynew_state, ace_yytoken_num, ace_yytoken_string, ace_yyindent) int ace_yynew_state; @@ -465,7 +470,7 @@ int ace_yyindent; #endif /* ACE_YYDEBUG_LOOK_AHEAD */ #ifndef ACE_YYDEBUG_DISCARD_STATE #ifdef __cplusplus -void ACE_YYDEBUG_DISCARD_STATE(int /* ace_yynew_state */, int ace_yyindent) +void ACE_YYDEBUG_DISCARD_STATE(int ace_yynew_state, int ace_yyindent) #else ACE_YYDEBUG_DISCARD_STATE(ace_yynew_state, ace_yyindent) int ace_yynew_state; @@ -493,7 +498,7 @@ int ace_yyindent; #endif /* ACE_YYDEBUG_DISCARD_STATE */ #ifndef ACE_YYDEBUG_DISCARD_TOKEN #ifdef __cplusplus -void ACE_YYDEBUG_DISCARD_TOKEN(int /* ace_yynew_state */, int /* ace_yytoken_num */, char *ace_yytoken_string, int ace_yyindent) +void ACE_YYDEBUG_DISCARD_TOKEN(int ace_yynew_state, int ace_yytoken_num, char *ace_yytoken_string, int ace_yyindent) #else ACE_YYDEBUG_DISCARD_TOKEN(ace_yynew_state, ace_yytoken_num, ace_yytoken_string, ace_yyindent) int ace_yynew_state; @@ -508,7 +513,7 @@ int ace_yyindent; #endif /* ACE_YYDEBUG_DISCARD_TOKEN */ #ifndef ACE_YYDEBUG_SHIFT_ERROR_LEXEME #ifdef __cplusplus -void ACE_YYDEBUG_SHIFT_ERROR_LEXEME(int /* ace_yyold_state */, int /* ace_yynew_state */, int ace_yyindent) +void ACE_YYDEBUG_SHIFT_ERROR_LEXEME(int ace_yyold_state, int ace_yynew_state, int ace_yyindent) #else ACE_YYDEBUG_SHIFT_ERROR_LEXEME(ace_yyold_state, ace_yynew_state, ace_yyindent) int ace_yyold_state; @@ -534,7 +539,7 @@ ace_yyparse() extern char *ace_foo(); #endif - if ((ace_yys = ACE_OS::getenv("ACE_YYDEBUG"))) + if (ace_yys = ACE_OS::getenv("ACE_YYDEBUG")) { ace_yyn = *ace_yys; if (ace_yyn >= '0' && ace_yyn <= '9') @@ -551,7 +556,7 @@ ace_yyparse() *ace_yyssp = ace_yystate = 0; ace_yyloop: - if ((ace_yyn = ace_yydefred[ace_yystate])) goto ace_yyreduce; + if (ace_yyn = ace_yydefred[ace_yystate]) goto ace_yyreduce; if (ace_yychar < 0) { if ((ace_yychar = ace_yylex()) < 0) ace_yychar = 0; @@ -682,7 +687,7 @@ ace_yyreduce: switch (ace_yyn) { case 1: -#line 39 "Svc_Conf.y" +#line 42 "Svc_Conf.y" { if (ace_yyvsp[0].parse_node_ != 0) { @@ -692,13 +697,13 @@ case 1: } break; case 2: -#line 47 "Svc_Conf.y" +#line 50 "Svc_Conf.y" { ace_obstack->release (); } break; case 10: -#line 64 "Svc_Conf.y" +#line 67 "Svc_Conf.y" { if (ace_yyvsp[-1].svc_record_ != 0) ace_yyval.parse_node_ = new ACE_Dynamic_Node (ace_yyvsp[-1].svc_record_, ace_yyvsp[0].ident_); @@ -707,74 +712,74 @@ case 10: } break; case 11: -#line 74 "Svc_Conf.y" +#line 77 "Svc_Conf.y" { ace_yyval.parse_node_ = new ACE_Static_Node (ace_yyvsp[-1].ident_, ace_yyvsp[0].ident_); } break; case 12: -#line 81 "Svc_Conf.y" +#line 84 "Svc_Conf.y" { ace_yyval.parse_node_ = new ACE_Suspend_Node (ace_yyvsp[0].ident_); } break; case 13: -#line 88 "Svc_Conf.y" +#line 91 "Svc_Conf.y" { ace_yyval.parse_node_ = new ACE_Resume_Node (ace_yyvsp[0].ident_); } break; case 14: -#line 95 "Svc_Conf.y" +#line 98 "Svc_Conf.y" { ace_yyval.parse_node_ = new ACE_Remove_Node (ace_yyvsp[0].ident_); } break; case 15: -#line 102 "Svc_Conf.y" +#line 105 "Svc_Conf.y" { ace_yyval.parse_node_ = new ACE_Stream_Node (ace_yyvsp[-1].static_node_, ace_yyvsp[0].parse_node_); } break; case 16: -#line 105 "Svc_Conf.y" +#line 108 "Svc_Conf.y" { ace_yyval.static_node_ = new ACE_Static_Node (ace_yyvsp[0].ident_); } break; case 17: -#line 106 "Svc_Conf.y" +#line 109 "Svc_Conf.y" { ace_yyval.parse_node_ = new ACE_Dummy_Node (ace_yyvsp[-1].static_node_, ace_yyvsp[0].parse_node_); } break; case 18: -#line 113 "Svc_Conf.y" +#line 116 "Svc_Conf.y" { } break; case 19: -#line 116 "Svc_Conf.y" +#line 119 "Svc_Conf.y" { } break; case 20: -#line 122 "Svc_Conf.y" +#line 125 "Svc_Conf.y" { /* Initialize left context...*/ ace_yyval.static_node_ = ace_yyvsp[-1].static_node_; } break; case 21: -#line 127 "Svc_Conf.y" +#line 130 "Svc_Conf.y" { ace_yyval.parse_node_ = ace_yyvsp[-1].parse_node_; } break; case 22: -#line 130 "Svc_Conf.y" +#line 133 "Svc_Conf.y" { ace_yyval.parse_node_ = 0; } break; case 23: -#line 135 "Svc_Conf.y" +#line 138 "Svc_Conf.y" { if (ace_yyvsp[0].parse_node_ != 0) { @@ -784,11 +789,11 @@ case 23: } break; case 24: -#line 142 "Svc_Conf.y" +#line 145 "Svc_Conf.y" { ace_yyval.parse_node_ = 0; } break; case 25: -#line 147 "Svc_Conf.y" +#line 150 "Svc_Conf.y" { if (ace_yyvsp[0].static_node_ != 0) { @@ -806,7 +811,7 @@ case 25: } break; case 26: -#line 163 "Svc_Conf.y" +#line 166 "Svc_Conf.y" { ACE_Module_Type *mt = get_module (ace_yyvsp[-2].static_node_, ace_yyvsp[0].static_node_->name ()); @@ -815,7 +820,7 @@ case 26: } break; case 27: -#line 170 "Svc_Conf.y" +#line 173 "Svc_Conf.y" { ACE_Module_Type *mt = get_module (ace_yyvsp[-2].static_node_, ace_yyvsp[0].static_node_->name ()); if (mt != 0) @@ -823,7 +828,7 @@ case 27: } break; case 28: -#line 176 "Svc_Conf.y" +#line 179 "Svc_Conf.y" { ACE_Module_Type *mt = get_module (ace_yyvsp[-2].static_node_, ace_yyvsp[0].static_node_->name ()); if (mt != 0) @@ -831,7 +836,7 @@ case 28: } break; case 29: -#line 182 "Svc_Conf.y" +#line 185 "Svc_Conf.y" { ACE_Module_Type *mt = get_module (ace_yyvsp[-2].static_node_, ace_yyvsp[0].static_node_->name ()); if (mt != 0 @@ -845,7 +850,7 @@ case 29: } break; case 30: -#line 197 "Svc_Conf.y" +#line 200 "Svc_Conf.y" { u_int flags = ACE_Service_Type::DELETE_THIS @@ -868,64 +873,64 @@ case 30: } break; case 31: -#line 221 "Svc_Conf.y" +#line 224 "Svc_Conf.y" { ace_yyval.type_ = 1; } break; case 32: -#line 225 "Svc_Conf.y" +#line 228 "Svc_Conf.y" { ace_yyval.type_ = 0; } break; case 33: -#line 229 "Svc_Conf.y" +#line 232 "Svc_Conf.y" { ace_yyval.type_ = 1; } break; case 34: -#line 236 "Svc_Conf.y" +#line 239 "Svc_Conf.y" { ace_yyval.location_node_ = new ACE_Object_Node (ace_yyvsp[-2].ident_, ace_yyvsp[0].ident_); } break; case 35: -#line 240 "Svc_Conf.y" +#line 243 "Svc_Conf.y" { ace_yyval.location_node_ = new ACE_Function_Node (ace_yyvsp[-4].ident_, ace_yyvsp[-2].ident_); } break; case 36: -#line 244 "Svc_Conf.y" +#line 247 "Svc_Conf.y" { ace_yyval.location_node_ = new ACE_Static_Function_Node (ace_yyvsp[-2].ident_); } break; case 37: -#line 251 "Svc_Conf.y" +#line 254 "Svc_Conf.y" { ace_yyval.type_ = ACE_MODULE_T; } break; case 38: -#line 255 "Svc_Conf.y" +#line 258 "Svc_Conf.y" { ace_yyval.type_ = ACE_SVC_OBJ_T; } break; case 39: -#line 259 "Svc_Conf.y" +#line 262 "Svc_Conf.y" { ace_yyval.type_ = ACE_STREAM_T; } break; case 41: -#line 266 "Svc_Conf.y" +#line 269 "Svc_Conf.y" { ace_yyval.ident_ = 0; } break; -#line 928 "Svc_Conf_y.cpp" +#line 933 "Svc_Conf_y.cpp" } ace_yyssp -= ace_yym; ace_yystate = *ace_yyssp; diff --git a/ace/config-kcc-common.h b/ace/config-kcc-common.h index 9fddb7ee129..49975764a36 100644 --- a/ace/config-kcc-common.h +++ b/ace/config-kcc-common.h @@ -46,6 +46,8 @@ // Compiler doesn't support static data member templates. //#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES +#define ACE_HAS_USING_KEYWORD + // Define this if you want to use the standard C++ library #define ACE_HAS_STANDARD_CPP_LIBRARY 1 #define ACE_HAS_STDCPP_STL_INCLUDES 1 |