summaryrefslogtreecommitdiff
path: root/ace/INET_Addr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/INET_Addr.cpp')
-rw-r--r--ace/INET_Addr.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index f0b86a80d9a..8f85baaced5 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -15,7 +15,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_INET_Addr)
// Transform the current address into string format.
int
-ACE_INET_Addr::addr_to_string (ASYS_TCHAR s[],
+ACE_INET_Addr::addr_to_string (ACE_TCHAR s[],
size_t size,
int ipaddr_format) const
{
@@ -33,10 +33,10 @@ ACE_INET_Addr::addr_to_string (ASYS_TCHAR s[],
else
{
ACE_OS::sprintf (s,
- ASYS_TEXT ("%s:%d"),
+ ACE_TEXT ("%s:%d"),
(ipaddr_format == 0
? this->get_host_name ()
- : ASYS_WIDE_STRING (this->get_host_addr ())),
+ : this->get_host_addr ()),
this->get_port_number ());
return 0;
}
@@ -49,11 +49,11 @@ ACE_INET_Addr::dump (void) const
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
- ASYS_TCHAR s[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16];
- ACE_OS::sprintf (s, ASYS_TEXT ("%s:%d"),
- ASYS_WIDE_STRING (this->get_host_addr ()),
+ ACE_TCHAR s[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16];
+ ACE_OS::sprintf (s, ACE_TEXT ("%s:%d"),
+ this->get_host_addr (),
this->get_port_number ());
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("%s"), s));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s"), s));
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}
@@ -112,21 +112,21 @@ ACE_INET_Addr::set (const ACE_INET_Addr &sa)
// Transform the string into the current addressing format.
int
-ACE_INET_Addr::string_to_addr (const ASYS_TCHAR s[])
+ACE_INET_Addr::string_to_addr (const ACE_TCHAR s[])
{
ACE_TRACE ("ACE_INET_Addr::string_to_addr");
int result;
- ASYS_TCHAR *t;
+ ACE_TCHAR *t;
// Need to make a duplicate since we'll be overwriting the string.
ACE_ALLOCATOR_RETURN (t,
ACE_OS::strdup (s),
-1);
- ASYS_TCHAR *ip_addr = ACE_OS::strchr (t, ':');
+ ACE_TCHAR *ip_addr = ACE_OS::strchr (t, ':');
if (ip_addr == 0) // Assume it's a port number.
{
- if (ACE_OS::strspn (t, ASYS_TEXT ("1234567890"))
+ if (ACE_OS::strspn (t, ACE_TEXT ("1234567890"))
== ACE_OS::strlen (t))
{ // port number
u_short port = (u_short) ACE_OS::atoi (t);
@@ -142,7 +142,7 @@ ACE_INET_Addr::string_to_addr (const ASYS_TCHAR s[])
*ip_addr = '\0'; ++ip_addr; // skip over ':'
if (ACE_OS::strspn (ip_addr,
- ASYS_TEXT ("1234567890")) ==
+ ACE_TEXT ("1234567890")) ==
ACE_OS::strlen (ip_addr))
{
u_short port =
@@ -158,13 +158,13 @@ ACE_INET_Addr::string_to_addr (const ASYS_TCHAR s[])
}
int
-ACE_INET_Addr::set (const ASYS_TCHAR address[])
+ACE_INET_Addr::set (const ACE_TCHAR address[])
{
ACE_TRACE ("ACE_INET_Addr::set");
return this->string_to_addr (address);
}
-ACE_INET_Addr::ACE_INET_Addr (const ASYS_TCHAR address[])
+ACE_INET_Addr::ACE_INET_Addr (const ACE_TCHAR address[])
: ACE_Addr (AF_INET, sizeof this->inet_addr_)
{
ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
@@ -216,7 +216,7 @@ ACE_INET_Addr::set (u_short port_number,
int
ACE_INET_Addr::set (u_short port_number,
- const ASYS_TCHAR host_name[],
+ const ACE_TCHAR host_name[],
int encode)
{
ACE_TRACE ("ACE_INET_Addr::set");
@@ -232,7 +232,7 @@ ACE_INET_Addr::set (u_short port_number,
errno = EINVAL;
return -1;
}
- else if (ACE_OS::inet_aton (ASYS_ONLY_MULTIBYTE_STRING (host_name),
+ else if (ACE_OS::inet_aton (host_name,
(struct in_addr *) &addr) == 1)
return this->set (port_number,
encode ? ntohl (addr) : addr,
@@ -246,7 +246,7 @@ ACE_INET_Addr::set (u_short port_number,
ACE_HOSTENT_DATA buf;
int error;
- hostent *hp = ACE_OS::gethostbyname_r (ASYS_ONLY_MULTIBYTE_STRING (host_name), &hentry,
+ hostent *hp = ACE_OS::gethostbyname_r (host_name, &hentry,
buf, &error);
#endif /* VXWORKS */
@@ -271,9 +271,9 @@ ACE_INET_Addr::set (u_short port_number,
// <host_name>.
int
-ACE_INET_Addr::set (const ASYS_TCHAR port_name[],
- const ASYS_TCHAR host_name[],
- const ASYS_TCHAR protocol[])
+ACE_INET_Addr::set (const ACE_TCHAR port_name[],
+ const ACE_TCHAR host_name[],
+ const ACE_TCHAR protocol[])
{
ACE_TRACE ("ACE_INET_Addr::set");
@@ -286,8 +286,8 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[],
servent sentry;
ACE_SERVENT_DATA buf;
- servent *sp = ACE_OS::getservbyname_r ((char *) port_name,
- (char *) protocol,
+ servent *sp = ACE_OS::getservbyname_r (port_name,
+ protocol,
&sentry,
buf);
if (sp == 0)
@@ -301,9 +301,9 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[],
// address.
int
-ACE_INET_Addr::set (const ASYS_TCHAR port_name[],
+ACE_INET_Addr::set (const ACE_TCHAR port_name[],
ACE_UINT32 inet_address,
- const ASYS_TCHAR protocol[])
+ const ACE_TCHAR protocol[])
{
ACE_TRACE ("ACE_INET_Addr::set");
@@ -316,8 +316,8 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[],
servent sentry;
ACE_SERVENT_DATA buf;
- servent *sp = ACE_OS::getservbyname_r ((char *) port_name,
- (char *) protocol,
+ servent *sp = ACE_OS::getservbyname_r (port_name,
+ protocol,
&sentry,
buf);
if (sp == 0)
@@ -332,22 +332,22 @@ ACE_INET_Addr::set (const ASYS_TCHAR port_name[],
ACE_INET_Addr::ACE_INET_Addr (u_short port_number,
- const ASYS_TCHAR host_name[])
+ const ACE_TCHAR host_name[])
{
ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
if (this->set (port_number,
host_name) == -1)
#if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS)
ACE_ERROR ((LM_ERROR,
- (char *) "ACE_INET_Addr::ACE_INET_Addr: %p\n",
+ (char *)"ACE_INET_Addr::ACE_INET_Addr: %p\n",
(((char *) host_name == 0) ?
((char *) "<unknown>") :
((char *) (host_name)))));
#else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT ("ACE_INET_Addr::ACE_INET_Addr: %p\n"),
+ ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr: %p\n"),
((host_name == 0) ?
- (ASYS_TEXT ("<unknown>")) :
+ (ACE_TEXT ("<unknown>")) :
host_name)));
#endif /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */
}
@@ -393,42 +393,42 @@ ACE_INET_Addr::ACE_INET_Addr (u_short port_number,
ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
if (this->set (port_number, inet_address) == -1)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT ("%p\n"),
- ASYS_TEXT ("ACE_INET_Addr::ACE_INET_Addr")));
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr")));
}
// Creates a ACE_INET_Addr from a PORT_NAME and the remote
// HOST_NAME.
-ACE_INET_Addr::ACE_INET_Addr (const ASYS_TCHAR port_name[],
- const ASYS_TCHAR host_name[],
- const ASYS_TCHAR protocol[])
+ACE_INET_Addr::ACE_INET_Addr (const ACE_TCHAR port_name[],
+ const ACE_TCHAR host_name[],
+ const ACE_TCHAR protocol[])
{
ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
if (this->set (port_name,
host_name,
protocol) == -1)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT ("ACE_INET_Addr::ACE_INET_Addr")));
+ ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr")));
}
// Creates a ACE_INET_Addr from a PORT_NAME and an Internet address.
-ACE_INET_Addr::ACE_INET_Addr (const ASYS_TCHAR port_name[],
+ACE_INET_Addr::ACE_INET_Addr (const ACE_TCHAR port_name[],
ACE_UINT32 inet_address,
- const ASYS_TCHAR protocol[])
+ const ACE_TCHAR protocol[])
{
ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
if (this->set (port_name,
inet_address,
protocol) == -1)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT ("ACE_INET_Addr::ACE_INET_Addr")));
+ ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr")));
}
int
-ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[],
+ACE_INET_Addr::get_host_name (ACE_TCHAR hostname[],
size_t len) const
{
ACE_TRACE ("ACE_INET_Addr::get_host_name");
@@ -472,12 +472,13 @@ ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[],
#else
hostent hentry;
ACE_HOSTENT_DATA buf;
- hostent *hp = ACE_OS::gethostbyaddr_r ((char *) &this->inet_addr_.sin_addr,
- a_len,
- this->addr_type_,
- &hentry,
- buf,
- &error);
+ hostent *hp =
+ ACE_OS::gethostbyaddr_r (ACE_TEXT_CHAR_TO_TCHAR ((char *)&this->inet_addr_.sin_addr),
+ a_len,
+ this->addr_type_,
+ &hentry,
+ buf,
+ &error);
#endif /* CHORUS */
if (hp == 0)
@@ -495,8 +496,7 @@ ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[],
return -1;
}
- ACE_OS::strcpy (hostname,
- ASYS_WIDE_STRING (hp->h_name));
+ ACE_OS::strcpy (hostname, ACE_TEXT_CHAR_TO_TCHAR (hp->h_name));
return 0;
#endif /* VXWORKS */
}
@@ -504,14 +504,14 @@ ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[],
// Return the character representation of the hostname.
-const ASYS_TCHAR *
+const ACE_TCHAR *
ACE_INET_Addr::get_host_name (void) const
{
ACE_TRACE ("ACE_INET_Addr::get_host_name");
- static ASYS_TCHAR name[MAXHOSTNAMELEN + 1];
+ static ACE_TCHAR name[MAXHOSTNAMELEN + 1];
if (this->get_host_name (name, MAXHOSTNAMELEN + 1) == -1)
- ACE_OS::strcpy (name, ASYS_TEXT ("<unknown>"));
+ ACE_OS::strcpy (name, ACE_TEXT ("<unknown>"));
return name;
}