summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeliazkov_i <jeliazkov_i@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-04-28 18:04:32 +0000
committerjeliazkov_i <jeliazkov_i@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-04-28 18:04:32 +0000
commit05f6d296bcf396e8dd15427b62cd1f8a2fa9998b (patch)
tree51a8971fe234257b9bbf52b1c09ff58affd586a9
parent029db2e87444858d114e9654109310e12c72225f (diff)
downloadATCD-05f6d296bcf396e8dd15427b62cd1f8a2fa9998b.tar.gz
ChangeLogTag: Fri Apr 28 18:03:11 UTC 2006 Iliyan Jeliazkov <iliyan@ociweb.com>
-rw-r--r--ChangeLog18
-rw-r--r--ace/ACE.cpp118
-rw-r--r--ace/DLL.cpp16
-rw-r--r--ace/DLL_Manager.cpp8
-rw-r--r--ace/Dynamic_Service_Base.cpp47
-rw-r--r--ace/Dynamic_Service_Dependency.cpp12
-rw-r--r--ace/Parse_Node.cpp55
-rw-r--r--ace/Service_Config.cpp151
-rw-r--r--ace/Service_Config.inl14
-rw-r--r--ace/Service_Gestalt.cpp408
-rw-r--r--ace/Service_Object.cpp8
-rw-r--r--ace/Service_Repository.cpp108
-rw-r--r--ace/Service_Types.cpp8
-rw-r--r--ace/Shared_Object.cpp3
14 files changed, 499 insertions, 475 deletions
diff --git a/ChangeLog b/ChangeLog
index 85dbccb41ed..02cc2eacf06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+Fri Apr 28 18:03:11 UTC 2006 Iliyan Jeliazkov <iliyan@ociweb.com>
+
+ * ace/ACE.cpp:
+ * ace/DLL.cpp:
+ * ace/DLL_Manager.cpp:
+ * ace/Dynamic_Service_Base.cpp:
+ * ace/Dynamic_Service_Dependency.cpp:
+ * ace/Parse_Node.cpp:
+ * ace/Service_Config.inl:
+ * ace/Service_Config.cpp:
+ * ace/Service_Gestalt.cpp:
+ * ace/Service_Object.cpp:
+ * ace/Service_Repository.cpp:
+ * ace/Service_Types.cpp:
+ * ace/Shared_Object.cpp:
+
+ Applied formatting style consistent with ACE convention.
+
Fri Apr 28 15:48:25 UTC 2006 Steve Huston <shuston@riverace.com>
* ace/Service_Config.cpp (open_i): ACE_DEFAULT_SVC_CONF shouldn't
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index 125ee429963..3f38eca8ade 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -42,7 +42,7 @@ ACE_RCSID (ace,
// Open versioned namespace, if enabled by the user.
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE
{
@@ -403,19 +403,19 @@ Examples:
Source NT UNIX
==================================================================
netsvc netsvc.dll libnetsvc.so
- (PATH will be (LD_LIBRARY_PATH
- evaluated) evaluated)
+(PATH will be (LD_LIBRARY_PATH
+evaluated) evaluated)
libnetsvc.dll libnetsvc.dll libnetsvc.dll + warning
netsvc.so netsvc.so + warning libnetsvc.so
..\../libs/netsvc ..\..\libs\netsvc.dll ../../libs/netsvc.so
- (absolute path used) (absolute path used)
+(absolute path used) (absolute path used)
*/
-const ACE_TCHAR *
-ACE::basename (const ACE_TCHAR *pathname, ACE_TCHAR delim)
+ const ACE_TCHAR *
+ ACE::basename (const ACE_TCHAR *pathname, ACE_TCHAR delim)
{
ACE_TRACE ("ACE::basename");
const ACE_TCHAR *temp = ACE_OS::strrchr (pathname, delim);
@@ -2480,34 +2480,34 @@ ACE::timestamp (ACE_TCHAR date_and_time[],
}
#if defined (WIN32)
- // Emulate Unix. Win32 does NOT support all the UNIX versions
- // below, so DO we need this ifdef.
+ // Emulate Unix. Win32 does NOT support all the UNIX versions
+ // below, so DO we need this ifdef.
static const ACE_TCHAR *day_of_week_name[] =
- {
- ACE_LIB_TEXT ("Sun"),
- ACE_LIB_TEXT ("Mon"),
- ACE_LIB_TEXT ("Tue"),
- ACE_LIB_TEXT ("Wed"),
- ACE_LIB_TEXT ("Thu"),
- ACE_LIB_TEXT ("Fri"),
- ACE_LIB_TEXT ("Sat")
- };
+ {
+ ACE_LIB_TEXT ("Sun"),
+ ACE_LIB_TEXT ("Mon"),
+ ACE_LIB_TEXT ("Tue"),
+ ACE_LIB_TEXT ("Wed"),
+ ACE_LIB_TEXT ("Thu"),
+ ACE_LIB_TEXT ("Fri"),
+ ACE_LIB_TEXT ("Sat")
+ };
static const ACE_TCHAR *month_name[] =
- {
- ACE_LIB_TEXT ("Jan"),
- ACE_LIB_TEXT ("Feb"),
- ACE_LIB_TEXT ("Mar"),
- ACE_LIB_TEXT ("Apr"),
- ACE_LIB_TEXT ("May"),
- ACE_LIB_TEXT ("Jun"),
- ACE_LIB_TEXT ("Jul"),
- ACE_LIB_TEXT ("Aug"),
- ACE_LIB_TEXT ("Sep"),
- ACE_LIB_TEXT ("Oct"),
- ACE_LIB_TEXT ("Nov"),
- ACE_LIB_TEXT ("Dec")
- };
+ {
+ ACE_LIB_TEXT ("Jan"),
+ ACE_LIB_TEXT ("Feb"),
+ ACE_LIB_TEXT ("Mar"),
+ ACE_LIB_TEXT ("Apr"),
+ ACE_LIB_TEXT ("May"),
+ ACE_LIB_TEXT ("Jun"),
+ ACE_LIB_TEXT ("Jul"),
+ ACE_LIB_TEXT ("Aug"),
+ ACE_LIB_TEXT ("Sep"),
+ ACE_LIB_TEXT ("Oct"),
+ ACE_LIB_TEXT ("Nov"),
+ ACE_LIB_TEXT ("Dec")
+ };
SYSTEMTIME local;
::GetLocalTime (&local);
@@ -2673,7 +2673,7 @@ ACE::handle_timed_complete (ACE_HANDLE h,
# if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT)
need_to_check = (fds.revents & POLLIN) && !(fds.revents & POLLOUT);
# else
- need_to_check = rd_handles.is_set (h) && !wr_handles.is_set (h);
+ need_to_check = rd_handles.is_set (h) && !wr_handles.is_set (h);
# endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */
else
@@ -3349,7 +3349,7 @@ ACE::strndup (const wchar_t *str, size_t n)
wchar_t *s;
ACE_ALLOCATOR_RETURN (s,
static_cast<wchar_t *> (
- ACE_OS::malloc ((len + 1) * sizeof (wchar_t))),
+ ACE_OS::malloc ((len + 1) * sizeof (wchar_t))),
0);
return ACE_OS::strsncpy (s, str, len + 1);
}
@@ -3470,35 +3470,35 @@ ACE::wild_match(const char* str, const char* pat, bool case_sensitive)
const char* s = str;
const char* p = pat;
while (*s != '\0')
- {
- if (*p == '*')
{
- star = true;
- pat = p;
- while (*++pat == '*');
+ if (*p == '*')
+ {
+ star = true;
+ pat = p;
+ while (*++pat == '*');
- if (*pat == '\0')
- return true;
- p = pat;
- }
- else if (*p == '?')
- {
- ++s;
- ++p;
- }
- else if (! equal_char(*s, *p, case_sensitive))
- {
- if (!star)
- return false;
- s = ++str;
- p = pat;
- }
- else
- {
- ++s;
- ++p;
- }
+ if (*pat == '\0')
+ return true;
+ p = pat;
+ }
+ else if (*p == '?')
+ {
+ ++s;
+ ++p;
}
+ else if (! equal_char(*s, *p, case_sensitive))
+ {
+ if (!star)
+ return false;
+ s = ++str;
+ p = pat;
+ }
+ else
+ {
+ ++s;
+ ++p;
+ }
+ }
if (*p == '*')
while (*++p == '*');
diff --git a/ace/DLL.cpp b/ace/DLL.cpp
index 62f85a19ebe..2d034635ac2 100644
--- a/ace/DLL.cpp
+++ b/ace/DLL.cpp
@@ -11,7 +11,7 @@
ACE_RCSID(ace, DLL, "$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Default constructor. Also, by default, the object will be closed
// before it is destroyed.
@@ -41,9 +41,9 @@ ACE_DLL::ACE_DLL (const ACE_DLL &rhs)
rhs.open_mode_,
rhs.close_handle_on_destruction_) != 0
&& ACE::debug ())
- ACE_ERROR ((LM_ERROR,
- ACE_LIB_TEXT ("ACE_DLL::copy_ctor: error: %s\n"),
- this->error ()));
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("ACE_DLL::copy_ctor: error: %s\n"),
+ this->error ()));
}
// Assignment operator
@@ -65,9 +65,9 @@ ACE_DLL::operator= (const ACE_DLL &rhs)
rhs.open_mode_,
rhs.close_handle_on_destruction_) != 0
&& ACE::debug ())
- ACE_ERROR ((LM_ERROR,
- ACE_LIB_TEXT ("ACE_DLL::operator=: error: %s\n"),
- this->error ()));
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("ACE_DLL::operator=: error: %s\n"),
+ this->error ()));
return *this;
}
@@ -148,7 +148,7 @@ ACE_DLL::open_i (const ACE_TCHAR *dll_filename,
ACE_ERROR ((LM_ERROR,
ACE_LIB_TEXT ("ACE_DLL::open_i: dll_name is %s\n"),
this->dll_name_ == 0 ? ACE_LIB_TEXT ("(null)")
- : this->dll_name_));
+ : this->dll_name_));
return -1;
}
diff --git a/ace/DLL_Manager.cpp b/ace/DLL_Manager.cpp
index ce2c3d9cf4d..25dcadce5eb 100644
--- a/ace/DLL_Manager.cpp
+++ b/ace/DLL_Manager.cpp
@@ -20,7 +20,7 @@ ACE_RCSID (ace,
/******************************************************************/
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
sig_atomic_t ACE_DLL_Handle::open_called_ = 0;
@@ -252,9 +252,9 @@ ACE_DLL_Handle::close (int unload)
ACE_Framework_Repository * frPtr= ACE_Framework_Repository::instance ();
if (frPtr)
- {
- frPtr->remove_dll_components (this->dll_name_);
- }
+ {
+ frPtr->remove_dll_components (this->dll_name_);
+ }
retval = ACE_OS::dlclose (this->handle_);
this->handle_ = ACE_SHLIB_INVALID_HANDLE;
diff --git a/ace/Dynamic_Service_Base.cpp b/ace/Dynamic_Service_Base.cpp
index 8e55675c6ac..f77d76d514b 100644
--- a/ace/Dynamic_Service_Base.cpp
+++ b/ace/Dynamic_Service_Base.cpp
@@ -9,7 +9,7 @@ ACE_RCSID (ace,
Dynamic_Service_Base,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
void
@@ -47,11 +47,11 @@ ACE_Dynamic_Service_Base::find_i (const ACE_Service_Gestalt* &repo,
ACE_Service_Gestalt* global = ACE_Service_Config::global ();
for ( ; repo->find (name, &svc_rec) == -1; repo = global)
- {
- // Check the static repo, too if different
- if (repo == global)
- break;
- }
+ {
+ // Check the static repo, too if different
+ if (repo == global)
+ break;
+ }
return svc_rec;
}
@@ -72,25 +72,26 @@ ACE_Dynamic_Service_Base::instance (const ACE_Service_Gestalt* repo,
const ACE_Service_Type *svc_rec = find_i (repo_found, name);
if (svc_rec != 0)
- {
- type = svc_rec->type ();
- if (type != 0)
- obj = type->object ();
- }
+ {
+ type = svc_rec->type ();
+ if (type != 0)
+ obj = type->object ();
+ }
if (ACE::debug ())
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT ("(%P|%t) DSB::instance, repo=%@, name=%s, type=%@ => %@"),
- repo->repo_, name, type, obj));
-
- if (repo->repo_ != repo_found->repo_)
- ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT (" [in repo=%@]\n"),
- repo_found->repo_));
- else
- ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n")));
-
- }
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) DSB::instance, repo=%@, name=%s, ")
+ ACE_LIB_TEXT ("type=%@ => %@"),
+ repo->repo_, name, type, obj));
+
+ if (repo->repo_ != repo_found->repo_)
+ ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT (" [in repo=%@]\n"),
+ repo_found->repo_));
+ else
+ ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n")));
+
+ }
return obj;
}
diff --git a/ace/Dynamic_Service_Dependency.cpp b/ace/Dynamic_Service_Dependency.cpp
index cfb556f3e1c..ffb77aad706 100644
--- a/ace/Dynamic_Service_Dependency.cpp
+++ b/ace/Dynamic_Service_Dependency.cpp
@@ -7,7 +7,7 @@ ACE_RCSID (ace,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_Dynamic_Service_Dependency::ACE_Dynamic_Service_Dependency (const ACE_TCHAR *principal)
@@ -36,11 +36,11 @@ ACE_Dynamic_Service_Dependency::init (const ACE_Service_Gestalt *cfg,
{
const ACE_Service_Type* st = ACE_Dynamic_Service_Base::find_i (cfg, principal);
if (ACE::debug () > 1)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%P|%t) DSD, this=%@ - creating dependency on "), this));
- st->dump ();
- }
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) DSD, this=%@ - creating dependency on "), this));
+ st->dump ();
+ }
this->tracker_ = st->dll ();
}
diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp
index 8e83a510bb5..860107abbb0 100644
--- a/ace/Parse_Node.cpp
+++ b/ace/Parse_Node.cpp
@@ -15,14 +15,14 @@ ACE_RCSID (ace,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE (ACE_Stream_Node)
// Provide the class hierarchy that defines the parse tree of Service
// Nodes.
-void
+ void
ACE_Stream_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -50,7 +50,7 @@ ACE_Stream_Node::apply (ACE_Service_Gestalt *config, int &yyerrno)
ACE_ALLOC_HOOK_DEFINE (ACE_Parse_Node)
-void
+ void
ACE_Parse_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -83,12 +83,12 @@ ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node *str_ops,
const ACE_Parse_Node *str_mods)
#if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS)
: ACE_Parse_Node (str_ops == 0 ? static_cast<ACE_TCHAR *> (ACE_LIB_TEXT ("<unknown>"))
- : static_cast<ACE_TCHAR *> (str_ops->name ())),
+ : static_cast<ACE_TCHAR *> (str_ops->name ())),
#else
- : ACE_Parse_Node ((str_ops == 0 ? ACE_LIB_TEXT ("<unknown>") : str_ops->name ())),
+ : ACE_Parse_Node ((str_ops == 0 ? ACE_LIB_TEXT ("<unknown>") : str_ops->name ())),
#endif /* defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */
- node_ (str_ops),
- mods_ (str_mods)
+ node_ (str_ops),
+ mods_ (str_mods)
{
ACE_TRACE ("ACE_Stream_Node::ACE_Stream_Node");
}
@@ -141,7 +141,7 @@ ACE_Parse_Node::~ACE_Parse_Node (void)
ACE_ALLOC_HOOK_DEFINE (ACE_Suspend_Node)
-void
+ void
ACE_Suspend_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -161,7 +161,7 @@ ACE_Suspend_Node::~ACE_Suspend_Node (void)
ACE_ALLOC_HOOK_DEFINE (ACE_Resume_Node)
-void
+ void
ACE_Resume_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -215,7 +215,7 @@ ACE_Resume_Node::apply (ACE_Service_Gestalt *config, int &yyerrno)
ACE_ALLOC_HOOK_DEFINE (ACE_Remove_Node)
-void
+ void
ACE_Remove_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -281,7 +281,7 @@ ACE_Dynamic_Node::apply (ACE_Service_Gestalt *config, int &yyerrno)
ACE_ALLOC_HOOK_DEFINE (ACE_Dynamic_Node)
-void
+ void
ACE_Dynamic_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -296,7 +296,7 @@ ACE_Dynamic_Node::~ACE_Dynamic_Node (void)
ACE_ALLOC_HOOK_DEFINE (ACE_Static_Node)
-void
+ void
ACE_Static_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -336,7 +336,7 @@ ACE_Static_Node::apply (ACE_Service_Gestalt *config, int &yyerrno)
{
ACE_TRACE ("ACE_Static_Node::apply");
if (config->initialize (this->name (),
- this->parameters ()) == -1)
+ this->parameters ()) == -1)
++yyerrno;
#ifndef ACE_NLOGGING
@@ -357,7 +357,7 @@ ACE_Static_Node::~ACE_Static_Node (void)
ACE_ALLOC_HOOK_DEFINE (ACE_Location_Node)
-void
+ void
ACE_Location_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -445,7 +445,7 @@ ACE_Location_Node::set_symbol (void *s)
ACE_ALLOC_HOOK_DEFINE (ACE_Object_Node)
-void
+ void
ACE_Object_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -502,7 +502,7 @@ ACE_Object_Node::~ACE_Object_Node (void)
ACE_ALLOC_HOOK_DEFINE (ACE_Function_Node)
-void
+ void
ACE_Function_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -556,7 +556,7 @@ ACE_Function_Node::make_func_name (ACE_TCHAR const * func_name)
size_t const len =
ACE_OS::strlen (func_name)
+ versioned_namespace_name_len;
- // + 1; // Null terminator.
+ // + 1; // Null terminator.
ACE_TCHAR * mangled_func_name;
ACE_NEW_RETURN (mangled_func_name,
@@ -612,7 +612,7 @@ ACE_Function_Node::symbol (ACE_Service_Gestalt *,
ACE_LIB_TEXT ("%s\n"),
function_name,
errmsg ? errmsg :
- ACE_LIB_TEXT ("no error reported")));
+ ACE_LIB_TEXT ("no error reported")));
#endif /* ACE_NLOGGING */
return 0;
@@ -644,7 +644,7 @@ ACE_Function_Node::~ACE_Function_Node (void)
ACE_ALLOC_HOOK_DEFINE (ACE_Dummy_Node)
-void
+ void
ACE_Dummy_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -686,7 +686,7 @@ ACE_Dummy_Node::~ACE_Dummy_Node (void)
ACE_ALLOC_HOOK_DEFINE (ACE_Static_Function_Node)
-void
+ void
ACE_Static_Function_Node::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -715,12 +715,13 @@ ACE_Static_Function_Node::symbol (ACE_Service_Gestalt *config,
ACE_Static_Svc_Descriptor *ssd = 0;
if (config->find_static_svc_descriptor (this->function_name_, &ssd) == -1)
- {
- yyerrno++;
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) No static service registered for function %s\n"),
- this->function_name_),
- 0);
+ {
+ yyerrno++;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) No static service ")
+ ACE_LIB_TEXT ("registered for function %s\n"),
+ this->function_name_),
+ 0);
}
if (ssd->alloc_ == 0)
@@ -735,7 +736,7 @@ ACE_Static_Function_Node::symbol (ACE_Service_Gestalt *config,
ACE_LIB_TEXT ("(%P|%t) No static service factory ")
ACE_LIB_TEXT ("function registered for function %s\n"),
this->function_name_),
- 0);
+ 0);
}
}
diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp
index 9808395dd88..c0f932a8667 100644
--- a/ace/Service_Config.cpp
+++ b/ace/Service_Config.cpp
@@ -18,7 +18,7 @@ ACE_RCSID (ace,
Service_Config,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
///
@@ -32,10 +32,10 @@ ACE_Service_Config_Guard::ACE_Service_Config_Guard (ACE_Service_Gestalt * psg)
psg->repo_));
if (saved_ != psg)
- {
- // Modify the TSS - no locking needed
- (void)ACE_Service_Config::current (psg);
- }
+ {
+ // Modify the TSS - no locking needed
+ (void)ACE_Service_Config::current (psg);
+ }
}
///
@@ -55,7 +55,7 @@ ACE_ALLOC_HOOK_DEFINE (ACE_Service_Config)
// A thread-specific storage to keep a pointer to the (current) global
// configuration.
-ACE_TSS_TYPE (ACE_TSS_Type_Adapter <ACE_Service_Gestalt*>)
+ ACE_TSS_TYPE (ACE_TSS_Type_Adapter <ACE_Service_Gestalt*>)
ACE_Service_Config::current_ (0);
// Set the signal handler to point to the handle_signal() function.
@@ -163,18 +163,18 @@ ACE_Service_Config::open_i (const ACE_TCHAR program_name[],
// Write process id to file.
if (this->pid_file_name_ != 0)
- {
- FILE* pidf = ACE_OS::fopen (this->pid_file_name_,
- ACE_LIB_TEXT("w"));
-
- if (pidf != 0)
{
- ACE_OS::fprintf (pidf,
- "%ld\n",
- static_cast<long> (ACE_OS::getpid()));
- ACE_OS::fclose (pidf);
- }
+ FILE* pidf = ACE_OS::fopen (this->pid_file_name_,
+ ACE_LIB_TEXT("w"));
+
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid()));
+ ACE_OS::fclose (pidf);
}
+ }
u_long flags = log_msg->flags ();
@@ -197,35 +197,35 @@ ACE_Service_Config::open_i (const ACE_TCHAR program_name[],
key) == -1)
result = -1;
else
- {
- if (ACE::debug ())
- ACE_DEBUG ((LM_STARTUP,
- ACE_LIB_TEXT ("starting up daemon %n\n")));
+ {
+ if (ACE::debug ())
+ ACE_DEBUG ((LM_STARTUP,
+ ACE_LIB_TEXT ("starting up daemon %n\n")));
- // Initialize the Service Repository (this will still work if
- // user forgets to define an object of type ACE_Service_Config).
- ACE_Service_Repository::instance (ACE_Service_Config::MAX_SERVICES);
+ // Initialize the Service Repository (this will still work if
+ // user forgets to define an object of type ACE_Service_Config).
+ ACE_Service_Repository::instance (ACE_Service_Config::MAX_SERVICES);
- // Initialize the ACE_Reactor (the ACE_Reactor should be the
- // same size as the ACE_Service_Repository).
- ACE_Reactor::instance ();
+ // Initialize the ACE_Reactor (the ACE_Reactor should be the
+ // same size as the ACE_Service_Repository).
+ ACE_Reactor::instance ();
- // There's no point in dealing with this on NT since it doesn't
- // really support signals very well...
+ // There's no point in dealing with this on NT since it doesn't
+ // really support signals very well...
#if !defined (ACE_LACKS_UNIX_SIGNALS)
- // Only attempt to register a signal handler for positive
- // signal numbers.
- if (ACE_Service_Config::signum_ > 0)
- {
- ACE_Sig_Set ss;
- ss.sig_add (ACE_Service_Config::signum_);
- if (ACE_Reactor::instance ()->register_handler
- (ss, ACE_Service_Config::signal_handler_) == -1)
- ACE_ERROR ((LM_ERROR,
- ACE_LIB_TEXT ("can't register signal handler\n")));
- }
-#endif /* ACE_LACKS_UNIX_SIGNALS */
+ // Only attempt to register a signal handler for positive
+ // signal numbers.
+ if (ACE_Service_Config::signum_ > 0)
+ {
+ ACE_Sig_Set ss;
+ ss.sig_add (ACE_Service_Config::signum_);
+ if (ACE_Reactor::instance ()->register_handler
+ (ss, ACE_Service_Config::signal_handler_) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("can't register signal handler\n")));
}
+#endif /* ACE_LACKS_UNIX_SIGNALS */
+ }
if (result == -1)
return -1;
@@ -236,36 +236,36 @@ ACE_Service_Config::open_i (const ACE_TCHAR program_name[],
// Check if the default file exists before attempting to queue it
// for processing
if (!ignore_default_svc_conf_file)
- {
+ {
FILE *fp = ACE_OS::fopen (ACE_DEFAULT_SVC_CONF,
- ACE_LIB_TEXT ("r"));
+ ACE_LIB_TEXT ("r"));
ignore_default_svc_conf_file = (fp == 0);
if (fp != 0)
ACE_OS::fclose (fp);
- }
+ }
if (!ignore_default_svc_conf_file
&& this->svc_conf_file_queue_->is_empty ())
- {
- // Load the default "svc.conf" entry here if there weren't
- // overriding -f arguments in <parse_args>.
- if (this->svc_conf_file_queue_->enqueue_tail (ACE_TString (ACE_DEFAULT_SVC_CONF)) == -1)
{
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("%p\n"),
- ACE_LIB_TEXT ("enqueuing ")
- ACE_DEFAULT_SVC_CONF
- ACE_LIB_TEXT(" file")),
- -1);
- }
+ // Load the default "svc.conf" entry here if there weren't
+ // overriding -f arguments in <parse_args>.
+ if (this->svc_conf_file_queue_->enqueue_tail
+ (ACE_TString (ACE_DEFAULT_SVC_CONF)) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_LIB_TEXT ("%p\n"),
+ ACE_LIB_TEXT ("enqueuing ")
+ ACE_DEFAULT_SVC_CONF
+ ACE_LIB_TEXT(" file")),
+ -1);
}
+ }
- return ACE_Service_Gestalt::open_i (program_name,
- logger_key,
- ignore_static_svcs,
- ignore_default_svc_conf_file,
- ignore_debug_flag);
-
+ return ACE_Service_Gestalt::open_i (program_name,
+ logger_key,
+ ignore_static_svcs,
+ ignore_default_svc_conf_file,
+ ignore_debug_flag);
}
/// Return the global configuration instance. Allways returns the same
@@ -283,20 +283,20 @@ ACE_Service_Config::instance (void)
return ACE_Service_Config::current ();
}
-/// Return the configuration instance, considered "global" in
-/// the current thread. This may be the same as instance(), but on some
-/// occasions, it may be a different one. For example, ACE_Service_Config_Guard
-/// provides a way of temporarily replacing the "current" configuration
-/// instance in the context of a thread.
+/// Return the configuration instance, considered "global" in the
+/// current thread. This may be the same as instance(), but on some
+/// occasions, it may be a different one. For example,
+/// ACE_Service_Config_Guard provides a way of temporarily replacing
+/// the "current" configuration instance in the context of a thread.
ACE_Service_Gestalt *
ACE_Service_Config::current (void)
{
ACE_Service_Gestalt *tmp = ACE_Service_Config::global ();
// If the Object_Manager is in transient state, the
- // ACE_Service_Gestalt::current_ instance may not have been constructed
- // yet (or may have been already destroyed). Either way there
- // are no other threads.
+ // ACE_Service_Gestalt::current_ instance may not have been
+ // constructed yet (or may have been already destroyed). Either way
+ // there are no other threads.
if (ACE_Object_Manager::starting_up () || ACE_Object_Manager::shutting_down ())
return tmp;
@@ -319,12 +319,14 @@ ACE_Service_Config::current (ACE_Service_Gestalt *newcurrent)
}
-// Changed the interface of this method to return the gestalt instead of
-// the container, underlying the service repository and defined
-// ACE_Service_Gestalt::insert (ACE_Static_Svc_Descriptor*). This way the
-// existing source code can keep using ACE_Service_Config::static_svcs(),
-// however now it is not necessary to expose the repository storage *and*
-// it is much easier to debug service registration problems.
+// This method has changed to return the gestalt instead of the
+// container, underlying the service repository and defined
+// ACE_Service_Gestalt::insert (ACE_Static_Svc_Descriptor*). This way
+// the existing source code can keep using
+// ACE_Service_Config::static_svcs(), however now it is not necessary
+// to expose the repository storage *and* it is much easier to debug
+// service registration problems.
+
ACE_Service_Gestalt *
ACE_Service_Config::static_svcs (void)
{
@@ -461,6 +463,7 @@ ACE_Service_Config::ACE_Service_Config (const ACE_TCHAR program_name[],
if (this->open (program_name,
logger_key) == -1
&& errno != ENOENT)
+
// Only print out an error if it wasn't the svc.conf file that was
// missing.
ACE_ERROR ((LM_ERROR,
diff --git a/ace/Service_Config.inl b/ace/Service_Config.inl
index c93fc6a06f2..a3cdbea8000 100644
--- a/ace/Service_Config.inl
+++ b/ace/Service_Config.inl
@@ -18,10 +18,10 @@ ACE_Service_Config::open (const ACE_TCHAR program_name[],
{
ACE_TRACE ("ACE_Service_Config::open");
return ACE_Service_Config::current()->open (program_name,
- logger_key,
+ logger_key,
ignore_static_svcs,
- ignore_default_svc_conf,
- ignore_debug_flag);
+ ignore_default_svc_conf,
+ ignore_debug_flag);
}
@@ -36,10 +36,10 @@ ACE_Service_Config::open (int argc,
ACE_TRACE ("ACE_Service_Config::open");
return ACE_Service_Config::current()->open (argc,
argv,
- logger_key,
+ logger_key,
ignore_static_svcs,
- ignore_default_svc_conf,
- ignore_debug_flag);
+ ignore_default_svc_conf,
+ ignore_debug_flag);
}
// Handle the command-line options intended for the
@@ -121,7 +121,7 @@ ACE_Service_Config::process_directive (const ACE_Static_Svc_Descriptor &ssd,
#if defined (ACE_HAS_WINCE) && defined (ACE_USES_WCHAR)
- // We must provide these function to bridge Svc_Conf parser with ACE.
+// We must provide these function to bridge Svc_Conf parser with ACE.
ACE_INLINE int
ACE_Service_Config::initialize (const ACE_Service_Type *sp, ACE_ANTI_TCHAR parameters[])
diff --git a/ace/Service_Gestalt.cpp b/ace/Service_Gestalt.cpp
index 456958ac732..82e002092e5 100644
--- a/ace/Service_Gestalt.cpp
+++ b/ace/Service_Gestalt.cpp
@@ -32,7 +32,7 @@ ACE_RCSID (ace,
Service_Gestalt,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// This is here, in the implementation, because it depends on the ACE_DLL type,
// which would be unnecessary to introduuce all over the place, had we declared
@@ -99,65 +99,65 @@ ACE_Service_Type_Forward_Declaration_Guard::~ACE_Service_Type_Forward_Declaratio
// We inserted it (as inactive), so we expect to find it, right?
if (ret < 0 && ret != -2)
- {
- ACE_ERROR ((LM_WARNING,
- ACE_LIB_TEXT ("(%P|%t) FWDCL::end - Failed (%d) to find %s\n"),
- ret, this->name_));
- ACE_ASSERT (ret == -2 || ret >= 0);
- }
-
- if (tmp != 0 && tmp->type () != 0)
- {
- // Something has registered a proper (non-forward-decl) service with
- // the same name as our dummy. The ACE_Service_Gestalt::insert() modifies
- // the memory for the previous ACE_Service_Type instance. It has in fact
- // taken ownership and deleted the instance when it replaced it with the
- // actual implementation, so nothing is left to do. We are hereby giving
- // up any ownership claims.
- this->dummy_ = 0;
-
- if(ACE::debug ())
{
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT ("(%P|%t) FWDCL::end, repo=%@ - ")
- ACE_LIB_TEXT ("Found different decl - "),
- this->repo_,
- this->name_));
- tmp->dump ();
+ ACE_ERROR ((LM_WARNING,
+ ACE_LIB_TEXT ("(%P|%t) FWDCL::end - Failed (%d) to find %s\n"),
+ ret, this->name_));
+ ACE_ASSERT (ret == -2 || ret >= 0);
}
- }
- else
- {
- if(ACE::debug ())
+ if (tmp != 0 && tmp->type () != 0)
{
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT ("(%P|%t) FWDCL::end, repo=%@ - ")
- ACE_LIB_TEXT ("Removing incomplete decl - "),
- this->repo_,
- this->name_));
- this->dummy_->dump ();
- }
+ // Something has registered a proper (non-forward-decl) service with
+ // the same name as our dummy. The ACE_Service_Gestalt::insert() modifies
+ // the memory for the previous ACE_Service_Type instance. It has in fact
+ // taken ownership and deleted the instance when it replaced it with the
+ // actual implementation, so nothing is left to do. We are hereby giving
+ // up any ownership claims.
+ this->dummy_ = 0;
+
+ if(ACE::debug ())
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) FWDCL::end, repo=%@ - ")
+ ACE_LIB_TEXT ("Found different decl - "),
+ this->repo_,
+ this->name_));
+ tmp->dump ();
+ }
- // The (dummy) forward declaration is still there and is
- // the same, which means that no actual declaration was
- // provided inside the guarded scope. Therefore, the forward
- // declaration is no longer necessary.
- if (this->repo_->remove (this->name_,
- const_cast< ACE_Service_Type**> (&this->dummy_)) == 0)
- {
- delete this->dummy_;
}
- else
+ else
{
- ACE_ERROR ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) FWDCL::end, repo=%@ - ")
- ACE_LIB_TEXT ("Failed to remove incomplete decl"),
- this->repo_,
- this->name_));
- this->dummy_->dump ();
- }
+ if(ACE::debug ())
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) FWDCL::end, repo=%@ - ")
+ ACE_LIB_TEXT ("Removing incomplete decl - "),
+ this->repo_,
+ this->name_));
+ this->dummy_->dump ();
+ }
+
+ // The (dummy) forward declaration is still there and is
+ // the same, which means that no actual declaration was
+ // provided inside the guarded scope. Therefore, the forward
+ // declaration is no longer necessary.
+ if (this->repo_->remove (this->name_,
+ const_cast< ACE_Service_Type**> (&this->dummy_)) == 0)
+ {
+ delete this->dummy_;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) FWDCL::end, repo=%@ - ")
+ ACE_LIB_TEXT ("Failed to remove incomplete decl"),
+ this->repo_,
+ this->name_));
+ this->dummy_->dump ();
}
+ }
// Clean up
@@ -247,15 +247,15 @@ ACE_Service_Gestalt::find_static_svc_descriptor (const ACE_TCHAR* name,
for (ACE_STATIC_SVCS_ITERATOR iter ( *this->static_svcs_);
iter.next (ssdp) != 0;
iter.advance ())
- {
- if (ACE_OS::strcmp ((*ssdp)->name_, name) == 0)
{
- if (ssd != 0)
- *ssd = *ssdp;
+ if (ACE_OS::strcmp ((*ssdp)->name_, name) == 0)
+ {
+ if (ssd != 0)
+ *ssd = *ssdp;
- return 0;
- }
+ return 0;
}
+ }
return -1;
} /* find_static_svc_descriptor () */
@@ -265,18 +265,19 @@ int
ACE_Service_Gestalt::insert (ACE_Static_Svc_Descriptor *stsd)
{
if (ACE::debug () > 1)
- {
- // If called during static initialization ACE_Log_Msg may not have
- // been initialized yet, so use printf intead.
- ACE_OS::fprintf (stderr,
- "// (%d|0) SG::insert"
- " repo=%p, name=%s - Static_Svc_Descriptor: active=%d, opened=%d.\n",
- ACE_OS::getpid (),
- this->repo_,
- stsd->name_,
- stsd->active_,
- this->is_opened_);
- }
+ {
+ // If called during static initialization ACE_Log_Msg may not have
+ // been initialized yet, so use printf intead.
+ ACE_OS::fprintf (stderr,
+ "// (%d|0) SG::insert"
+ " repo=%p, name=%s - queuing a Static_Svc_Descriptor:"
+ " active=%d, repo opened=%d.\n",
+ ACE_OS::getpid (),
+ this->repo_,
+ stsd->name_,
+ stsd->active_,
+ this->is_opened_);
+ }
// Inserting a service after teh Gestalt has been opened makes it
// impossible to activate it later. Perhaps open came too soon?
@@ -289,7 +290,7 @@ ACE_Service_Gestalt::insert (ACE_Static_Svc_Descriptor *stsd)
ACE_ALLOC_HOOK_DEFINE (ACE_Service_Gestalt)
-void
+ void
ACE_Service_Gestalt::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -301,14 +302,14 @@ ACE_Service_Gestalt::dump (void) const
ACE_ALLOC_HOOK_DEFINE (ACE_Service_Type_Factory)
-ACE_Service_Type_Factory::ACE_Service_Type_Factory (ACE_TCHAR const *name,
- int type,
- ACE_Location_Node *location,
- int active)
- : name_ (name)
- , type_ (type)
- , location_ (location)
- , is_active_ (active)
+ ACE_Service_Type_Factory::ACE_Service_Type_Factory (ACE_TCHAR const *name,
+ int type,
+ ACE_Location_Node *location,
+ int active)
+ : name_ (name)
+ , type_ (type)
+ , location_ (location)
+ , is_active_ (active)
{
ACE_TRACE ("ACE_Service_Type_Factory::ACE_Service_Type_Factory");
};
@@ -333,29 +334,29 @@ ACE_Service_Type_Factory::make_service_type (ACE_Service_Gestalt *cfg) const
void *sym = this->location_->symbol (cfg, yyerrno, &gobbler);
if (sym != 0)
- {
- ACE_Service_Type_Impl *stp
- = ACE_Service_Config::create_service_type_impl (this->name (),
- this->type_,
- sym,
- flags,
- gobbler);
- if (stp == 0)
- ++yyerrno;
-
- return new ACE_Service_Type (this->name (),
- stp,
- this->location_->dll (),
- this->is_active_);
- }
+ {
+ ACE_Service_Type_Impl *stp
+ = ACE_Service_Config::create_service_type_impl (this->name (),
+ this->type_,
+ sym,
+ flags,
+ gobbler);
+ if (stp == 0)
+ ++yyerrno;
+
+ return new ACE_Service_Type (this->name (),
+ stp,
+ this->location_->dll (),
+ this->is_active_);
+ }
else
- {
- ACE_ERROR ((LM_ERROR,
- ACE_LIB_TEXT ("Unable to find service: %s\n"),
- this->name ()));
- ++yyerrno;
- return 0;
- }
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("Unable to find service: %s\n"),
+ this->name ()));
+ ++yyerrno;
+ return 0;
+ }
}
ACE_TCHAR const*
@@ -375,43 +376,44 @@ ACE_Service_Gestalt::initialize (const ACE_TCHAR *svc_name,
ACE_ARGV args (parameters);
if (ACE::debug () > 1)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT ("(%P|%t) SG::initialize - () repo=%@, looking up static ")
- ACE_LIB_TEXT ("service \'%s\' to initialize\n"),
- this->repo_,
- svc_name));
- }
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) SG::initialize - () repo=%@, ")
+ ACE_LIB_TEXT ("looking up static ")
+ ACE_LIB_TEXT ("service \'%s\' to initialize\n"),
+ this->repo_,
+ svc_name));
+ }
const ACE_Service_Type *srp = 0;
if (this->repo_->find (svc_name, &srp) == -1)
- {
- // Since we're searching by name, the service may be in the
- // process-wide repository, so check that before reporting
- // failure.
- if (this->repo_ == ACE_Service_Repository::instance ()
- || ACE_Service_Repository::instance ()->find (svc_name, &srp) == -1)
{
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) SG::initialize - service \'%s\'")
- ACE_LIB_TEXT (" was not located.\n"),
- svc_name),
- -1);
- }
+ // Since we're searching by name, the service may be in the
+ // process-wide repository, so check that before reporting
+ // failure.
+ if (this->repo_ == ACE_Service_Repository::instance ()
+ || ACE_Service_Repository::instance ()->find (svc_name, &srp) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) SG::initialize - service \'%s\'")
+ ACE_LIB_TEXT (" was not located.\n"),
+ svc_name),
+ -1);
}
+ }
/// If initialization fails ...
if (srp->type ()->init (args.argc (),
args.argv ()) == -1)
- {
- // ... report and remove this entry.
- ACE_ERROR ((LM_ERROR,
- ACE_LIB_TEXT ("(%P|%t) SG::initialize - static init of \'%s\'")
- ACE_LIB_TEXT (" failed (%p)\n"),
- svc_name));
- this->repo_->remove (svc_name);
- return -1;
- }
+ {
+ // ... report and remove this entry.
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) SG::initialize - static init of \'%s\'")
+ ACE_LIB_TEXT (" failed (%p)\n"),
+ svc_name));
+ this->repo_->remove (svc_name);
+ return -1;
+ }
// If everything is ok, activate it
const_cast<ACE_Service_Type *>(srp)->active (1);
@@ -481,12 +483,12 @@ ACE_Service_Gestalt::initialize (const ACE_Service_Type_Factory *stf,
if (tmp.get () != 0 &&
this->initialize_i (tmp.get (), parameters) == 0)
- {
- // All good the ACE_Service_Type instance is now owned by the repository
- // and we should make sure it is not destroyed upon exit from this method.
- (void)tmp.release ();
- return 0;
- }
+ {
+ // All good the ACE_Service_Type instance is now owned by the repository
+ // and we should make sure it is not destroyed upon exit from this method.
+ (void)tmp.release ();
+ return 0;
+ }
// Something went wrong ...
ACE_ERROR_RETURN ((LM_ERROR,
@@ -660,8 +662,8 @@ ACE_Service_Gestalt::process_directives_i (ACE_Svc_Conf_Param *param)
// here which will be reported as a memory leak for some reason.
ACE_NO_HEAP_CHECK
- // Were we called in the context of the current instance?
- ACE_ASSERT (this == param->config);
+ // Were we called in the context of the current instance?
+ ACE_ASSERT (this == param->config);
// Temporarily (for the duration of this call) make sure that *any* static
// service registrations will happen with this instance. Such registrations
@@ -677,18 +679,18 @@ ACE_Service_Gestalt::process_directives_i (ACE_Svc_Conf_Param *param)
ACE_LIB_TEXT ("repo=%@ - %s\n"),
this->repo_,
(param->type == ACE_Svc_Conf_Param::SVC_CONF_FILE)
- ? ACE_TEXT ("<from file>")
- : param->source.directive));
+ ? ACE_TEXT ("<from file>")
+ : param->source.directive));
::ace_yyparse (param);
if (param->yyerrno > 0)
- {
- // This is a hack, better errors should be provided...
- errno = EINVAL;
- return param->yyerrno;
- }
+ {
+ // This is a hack, better errors should be provided...
+ errno = EINVAL;
+ return param->yyerrno;
+ }
else
return 0;
}
@@ -732,13 +734,13 @@ ACE_Service_Gestalt::process_file (const ACE_TCHAR file[])
// to see if it is not already being processed by searching for a dummy
// service with a matching name.
if (this->repo_->find (file, 0, 0) >=0)
- {
- ACE_DEBUG ((LM_WARNING,
- ACE_TEXT ("(%P|%t) Configuration file %s has not finished")
- ACE_TEXT (" processing yet. Ignoring.\n"),
- file));
- return 0;
- }
+ {
+ ACE_DEBUG ((LM_WARNING,
+ ACE_TEXT ("(%P|%t) Configuration file %s has not finished")
+ ACE_TEXT (" processing yet. Ignoring.\n"),
+ file));
+ return 0;
+ }
// Register a dummy service as a forward decl, using the file name as name.
// The entry will be automaticaly removed once the thread exits this block.
@@ -834,14 +836,14 @@ int
ACE_Service_Gestalt::init_svc_conf_file_queue (void)
{
if (this->svc_conf_file_queue_ == 0)
- {
- ACE_SVC_QUEUE *tmp = 0;
- ACE_NEW_RETURN (tmp,
- ACE_SVC_QUEUE,
- -1);
- delete this->svc_conf_file_queue_;
- this->svc_conf_file_queue_ = tmp;
- }
+ {
+ ACE_SVC_QUEUE *tmp = 0;
+ ACE_NEW_RETURN (tmp,
+ ACE_SVC_QUEUE,
+ -1);
+ delete this->svc_conf_file_queue_;
+ this->svc_conf_file_queue_ = tmp;
+ }
if (ACE::debug () > 1)
ACE_DEBUG ((LM_DEBUG,
@@ -880,30 +882,30 @@ ACE_Service_Gestalt::open_i (const ACE_TCHAR /*program_name*/[],
// if the singleton gestalt (ubergestalt) was already open,
// do not open it again...
if (this->is_opened_++ != 0)
- return 0;
+ return 0;
if (ignore_debug_flag == 0)
- {
- // If -d was included as a startup parameter, the user wants debug
- // information printed during service initialization.
- if (ACE::debug ())
- ACE_Log_Msg::enable_debug_messages ();
- else
- // The user has requested no debugging info.
- ACE_Log_Msg::disable_debug_messages ();
- }
+ {
+ // If -d was included as a startup parameter, the user wants debug
+ // information printed during service initialization.
+ if (ACE::debug ())
+ ACE_Log_Msg::enable_debug_messages ();
+ else
+ // The user has requested no debugging info.
+ ACE_Log_Msg::disable_debug_messages ();
+ }
// See if we need to load the static services.
if (this->no_static_svcs_ == 0
&& this->load_static_svcs () == -1)
result = -1;
else
- {
- if (this->process_commandline_directives () == -1)
- result = -1;
- else
- result = this->process_directives ();
- }
+ {
+ if (this->process_commandline_directives () == -1)
+ result = -1;
+ else
+ result = this->process_directives ();
+ }
// Reset debugging back to the way it was when we came into
@@ -913,10 +915,10 @@ ACE_Service_Gestalt::open_i (const ACE_TCHAR /*program_name*/[],
ACE_Errno_Guard error (errno);
if (ignore_debug_flag == 0)
- {
- log_msg->priority_mask (old_process_mask, ACE_Log_Msg::PROCESS);
- log_msg->priority_mask (old_thread_mask, ACE_Log_Msg::THREAD);
- }
+ {
+ log_msg->priority_mask (old_process_mask, ACE_Log_Msg::PROCESS);
+ log_msg->priority_mask (old_thread_mask, ACE_Log_Msg::THREAD);
+ }
}
return result;
@@ -939,16 +941,16 @@ ACE_Service_Gestalt::process_commandline_directives (void)
for (ACE_SVC_QUEUE_ITERATOR iter (*this->svc_queue_);
iter.next (sptr) != 0;
iter.advance ())
+ {
+ // Process just a single directive.
+ if (this->process_directive ((sptr->fast_rep ())) != 0)
{
- // Process just a single directive.
- if (this->process_directive ((sptr->fast_rep ())) != 0)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_LIB_TEXT ("%p\n"),
- ACE_LIB_TEXT ("process_directive")));
- result = -1;
- }
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("%p\n"),
+ ACE_LIB_TEXT ("process_directive")));
+ result = -1;
}
+ }
delete this->svc_queue_;
this->svc_queue_ = 0;
@@ -1006,11 +1008,11 @@ ACE_Service_Gestalt::parse_args_i (int argc, ACE_TCHAR *argv[])
break;
case 'S':
if (this->svc_queue_ == 0)
- {
- ACE_NEW_RETURN (this->svc_queue_,
- ACE_SVC_QUEUE,
- -1);
- }
+ {
+ ACE_NEW_RETURN (this->svc_queue_,
+ ACE_SVC_QUEUE,
+ -1);
+ }
if (this->svc_queue_->enqueue_tail (ACE_TString (getopt.opt_arg ())) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -1040,25 +1042,25 @@ ACE_Service_Gestalt::process_directives (void)
int result = 0;
if (this->svc_conf_file_queue_ != 0)
- {
- ACE_TString *sptr = 0;
-
- // Iterate through all the svc.conf files.
- for (ACE_SVC_QUEUE_ITERATOR iter (*this->svc_conf_file_queue_);
- iter.next (sptr) != 0;
- iter.advance ())
{
- int r = this->process_file (sptr->fast_rep ());
+ ACE_TString *sptr = 0;
- if (r < 0)
+ // Iterate through all the svc.conf files.
+ for (ACE_SVC_QUEUE_ITERATOR iter (*this->svc_conf_file_queue_);
+ iter.next (sptr) != 0;
+ iter.advance ())
+ {
+ int r = this->process_file (sptr->fast_rep ());
+
+ if (r < 0)
{
result = r;
break;
}
- result += r;
- }
+ result += r;
}
+ }
return result;
diff --git a/ace/Service_Object.cpp b/ace/Service_Object.cpp
index 87d5b655151..06627fbc6ba 100644
--- a/ace/Service_Object.cpp
+++ b/ace/Service_Object.cpp
@@ -15,12 +15,12 @@ ACE_RCSID (ace,
Service_Object,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Service_Object)
-ACE_ALLOC_HOOK_DEFINE(ACE_Service_Type)
+ ACE_ALLOC_HOOK_DEFINE(ACE_Service_Type)
-void
+ void
ACE_Service_Type::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -84,7 +84,7 @@ ACE_Service_Type::fini (void)
{
this->fini_already_called_ = 1;
if (this->type_ != 0)
- return this->type_->fini ();
+ return this->type_->fini ();
else
return 1; // No implementation was found.
// Currently only makes sense for dummy ST, used to "reserve"
diff --git a/ace/Service_Repository.cpp b/ace/Service_Repository.cpp
index 875dceb9842..e1b85fe81e8 100644
--- a/ace/Service_Repository.cpp
+++ b/ace/Service_Repository.cpp
@@ -18,12 +18,12 @@ ACE_RCSID (ace,
Service_Repository,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Service_Repository)
// Process-wide Service Repository.
-ACE_Service_Repository *ACE_Service_Repository::svc_rep_ = 0;
+ ACE_Service_Repository *ACE_Service_Repository::svc_rep_ = 0;
// Controls whether the Service_Repository is deleted when we shut
// down (we can only delete it safely if we created it)!
@@ -151,28 +151,28 @@ ACE_Service_Repository::fini (void)
// order.
for (int i = this->current_size_ - 1; i >= 0; i--)
- {
- ACE_Service_Type *s =
- const_cast<ACE_Service_Type *> (this->service_vector_[i]);
+ {
+ ACE_Service_Type *s =
+ const_cast<ACE_Service_Type *> (this->service_vector_[i]);
- if (ACE::debug ())
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT ("(%P|%t) SR::fini, %@ [%d] (%d): "),
- this, i, this->total_size_));
- s->dump();
- }
+ if (ACE::debug ())
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) SR::fini, %@ [%d] (%d): "),
+ this, i, this->total_size_));
+ s->dump();
+ }
- // Collect any errors.
- int ret = s->fini ();
- if (ACE::debug ()>1)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT ("(%P|%t) SR::fini, returned %d\n"),
- ret));
- }
- retval += ret;
+ // Collect any errors.
+ int ret = s->fini ();
+ if (ACE::debug ()>1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) SR::fini, returned %d\n"),
+ ret));
}
+ retval += ret;
+ }
}
return (retval == 0) ? 0 : -1;
@@ -309,46 +309,46 @@ ACE_Service_Repository::insert (const ACE_Service_Type *sr)
// Replacing an existing entry
if (i < this->current_size_)
- {
- return_value = 0;
- // Check for self-assignment...
- if (sr != this->service_vector_[i])
{
- s = const_cast<ACE_Service_Type *> (this->service_vector_[i]);
- this->service_vector_[i] = sr;
- }
- }
- // Adding a new entry.
- else if (i < this->total_size_)
+ return_value = 0;
+ // Check for self-assignment...
+ if (sr != this->service_vector_[i])
{
+ s = const_cast<ACE_Service_Type *> (this->service_vector_[i]);
this->service_vector_[i] = sr;
- this->current_size_++;
- return_value = 0;
}
+ }
+ // Adding a new entry.
+ else if (i < this->total_size_)
+ {
+ this->service_vector_[i] = sr;
+ this->current_size_++;
+ return_value = 0;
+ }
if (ACE::debug ())
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) SR::insert, repo=%@ [%d] (size=%d): ",
- this,
- i,
- this->total_size_));
- sr->dump();
- }
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) SR::insert, repo=%@ [%d] (size=%d): ",
+ this,
+ i,
+ this->total_size_));
+ sr->dump();
+ }
}
// Delete outside the lock
if (s != 0)
- {
- if (ACE::debug () > 1)
{
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) SR::insert, repo=%@ - destroying : ",
- this));
- s->dump();
- }
- delete s;
+ if (ACE::debug () > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) SR::insert, repo=%@ - destroying : ",
+ this));
+ s->dump();
}
+ delete s;
+ }
if (return_value == -1)
ACE_OS::last_error (ENOSPC);
@@ -437,7 +437,7 @@ ACE_Service_Repository::remove (const ACE_TCHAR name[], ACE_Service_Type **ps)
ACE_ALLOC_HOOK_DEFINE(ACE_Service_Repository_Iterator)
-void
+ void
ACE_Service_Repository_Iterator::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -450,8 +450,8 @@ ACE_Service_Repository_Iterator::dump (void) const
// perform destructive operations on elements during this iteration...
ACE_Service_Repository_Iterator::ACE_Service_Repository_Iterator
- (ACE_Service_Repository &sr,
- int ignr_suspended)
+(ACE_Service_Repository &sr,
+ int ignr_suspended)
: svc_rep_ (sr),
next_ (-1),
ignore_suspended_ (ignr_suspended)
@@ -495,8 +495,8 @@ ACE_Service_Repository_Iterator::advance (void)
for (++this->next_;
this->next_ < this->svc_rep_.current_size_
- && this->ignore_suspended_
- && this->svc_rep_.service_vector_[this->next_]->active () == 0;
+ && this->ignore_suspended_
+ && this->svc_rep_.service_vector_[this->next_]->active () == 0;
this->next_++)
continue;
diff --git a/ace/Service_Types.cpp b/ace/Service_Types.cpp
index fec79c53824..e9c5d8bccc0 100644
--- a/ace/Service_Types.cpp
+++ b/ace/Service_Types.cpp
@@ -16,7 +16,7 @@ ACE_RCSID (ace,
Service_Types,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
typedef ACE_Stream<ACE_SYNCH> MT_Stream;
typedef ACE_Module<ACE_SYNCH> MT_Module;
@@ -24,7 +24,7 @@ typedef ACE_Task<ACE_SYNCH> MT_Task;
ACE_ALLOC_HOOK_DEFINE(ACE_Service_Type_Impl)
-void
+ void
ACE_Service_Type_Impl::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -180,7 +180,7 @@ ACE_Service_Object_Type::info (ACE_TCHAR **str, size_t len) const
ACE_ALLOC_HOOK_DEFINE(ACE_Module_Type)
-void
+ void
ACE_Module_Type::dump (void) const
{
#if defined (ACE_HAS_DUMP)
@@ -307,7 +307,7 @@ ACE_Module_Type::link (void) const
ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Type)
-void
+ void
ACE_Stream_Type::dump (void) const
{
#if defined (ACE_HAS_DUMP)
diff --git a/ace/Shared_Object.cpp b/ace/Shared_Object.cpp
index 2be49edf997..ca2d554035c 100644
--- a/ace/Shared_Object.cpp
+++ b/ace/Shared_Object.cpp
@@ -1,4 +1,3 @@
-// Shared_Object.cpp
// $Id$
#include "ace/Shared_Object.h"
@@ -16,7 +15,7 @@ ACE_RCSID (ace,
Shared_Object,
"$Id$")
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Initializes object when dynamic linking occurs.