Some missing from merge.

Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
Salja 2012-08-05 14:54:07 +02:00 committed by Antz
parent ec939a5bce
commit f4be15a7af
1895 changed files with 160408 additions and 53601 deletions

View file

@ -1,3 +1,5 @@
// $Id: Naming_Context.cpp 97308 2013-09-01 00:58:08Z mesnier_p $
#include "ace/Get_Opt.h"
#include "ace/Naming_Context.h"
#include "ace/Remote_Name_Space.h"
@ -37,10 +39,10 @@ ACE_Naming_Context::info (ACE_TCHAR **strp,
ACE_TCHAR buf[BUFSIZ];
ACE_OS::snprintf (buf, BUFSIZ,
ACE_TEXT ("%s\t#%s\n"),
ACE_TEXT ("ACE_Naming_Context"),
ACE_TEXT ("Proxy for making calls to a Name Server"));
ACE_OS::sprintf (buf,
ACE_TEXT ("%s\t#%s\n"),
ACE_TEXT ("ACE_Naming_Context"),
ACE_TEXT ("Proxy for making calls to a Name Server"));
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
return -1;
@ -140,8 +142,7 @@ ACE_Naming_Context::close (void)
ACE_Naming_Context::ACE_Naming_Context (void)
: name_options_ (0),
name_space_ (0),
netnameserver_host_ (0),
netnameserver_port_ (0)
netnameserver_host_ (0)
{
ACE_TRACE ("ACE_Naming_Context::ACE_Naming_Context");
@ -431,11 +432,7 @@ ACE_Name_Options::ACE_Name_Options (void)
this->namespace_dir_ = ACE_OS::strdup (ACE_DEFAULT_NAMESPACE_DIR);
#else /* ACE_DEFAULT_NAMESPACE_DIR */
size_t pathsize = (MAXPATHLEN + 1) * sizeof (ACE_TCHAR);
#if defined (ACE_HAS_ALLOC_HOOKS)
this->namespace_dir_ = static_cast <ACE_TCHAR *> (ACE_Allocator::instance()->malloc (pathsize));
#else
this->namespace_dir_ = static_cast <ACE_TCHAR *> (ACE_OS::malloc (pathsize));
#endif /* ACE_HAS_ALLOC_HOOKS */
if (ACE::get_temp_dir (this->namespace_dir_, MAXPATHLEN) == -1)
{
@ -452,21 +449,12 @@ ACE_Name_Options::~ACE_Name_Options (void)
{
ACE_TRACE ("ACE_Name_Options::~ACE_Name_Options");
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free ((void *) this->nameserver_host_);
ACE_Allocator::instance()->free ((void *) this->namespace_dir_ );
ACE_Allocator::instance()->free ((void *) this->process_name_ );
ACE_Allocator::instance()->free ((void *) this->database_ );
#else
ACE_OS::free ((void *) this->nameserver_host_);
ACE_OS::free ((void *) this->namespace_dir_ );
ACE_OS::free ((void *) this->process_name_ );
ACE_OS::free ((void *) this->database_ );
#endif /* ACE_HAS_ALLOC_HOOKS */
}
ACE_ALLOC_HOOK_DEFINE(ACE_Name_Options)
void
ACE_Name_Options::nameserver_port (int port)
{
@ -485,11 +473,7 @@ void
ACE_Name_Options::namespace_dir (const ACE_TCHAR *dir)
{
ACE_TRACE ("ACE_Name_Options::namespace_dir");
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free ((void *) this->namespace_dir_ );
#else
ACE_OS::free ((void *) this->namespace_dir_ );
#endif /* ACE_HAS_ALLOC_HOOKS */
this->namespace_dir_ = ACE_OS::strdup (dir);
}
@ -498,11 +482,7 @@ ACE_Name_Options::process_name (const ACE_TCHAR *pname)
{
ACE_TRACE ("ACE_Name_Options::process_name");
const ACE_TCHAR *t = ACE::basename (pname, ACE_DIRECTORY_SEPARATOR_CHAR);
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free ((void *) this->process_name_ );
#else
ACE_OS::free ((void *) this->process_name_ );
#endif /* ACE_HAS_ALLOC_HOOKS */
this->process_name_ = ACE_OS::strdup (t);
}
@ -510,11 +490,7 @@ void
ACE_Name_Options::nameserver_host (const ACE_TCHAR *host)
{
ACE_TRACE ("ACE_Name_Options::nameserver_host");
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free ((void *) this->nameserver_host_ );
#else
ACE_OS::free ((void *) this->nameserver_host_ );
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_OS::free ((void *) this->nameserver_host_);
this->nameserver_host_ = ACE_OS::strdup (host);
}
@ -536,11 +512,7 @@ void
ACE_Name_Options::database (const ACE_TCHAR *db)
{
ACE_TRACE ("ACE_Name_Options::database");
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free ((void *) this->database_);
#else
ACE_OS::free ((void *) this->database_);
#endif /* ACE_HAS_ALLOC_HOOKS */
this->database_ = ACE_OS::strdup (db);
}
@ -646,7 +618,6 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[])
this->verbosity_ = true;
break;
default:
#ifndef ACE_LACKS_STDERR
ACE_OS::fprintf (stderr, "%s\n"
"\t[-d] (enable debugging)\n"
"\t[-h nameserver host]\n"
@ -658,12 +629,13 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[])
"\t[-v] (verbose)\n"
"\t[-r] (use Win32 Registry)\n",
ACE_TEXT_ALWAYS_CHAR (argv[0]));
#endif
/* NOTREACHED */
break;
}
}
ACE_END_VERSIONED_NAMESPACE_DECL
// The following Factory is used by the ACE_Service_Config and
// svc.conf file to dynamically initialize the state of the Name
// Server client.
@ -677,5 +649,3 @@ ACE_STATIC_SVC_DEFINE (ACE_Naming_Context,
ACE_Service_Type::DELETE_OBJ,
0)
ACE_STATIC_SVC_REQUIRE (ACE_Naming_Context)
ACE_END_VERSIONED_NAMESPACE_DECL