summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-06-20 17:48:55 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-06-20 17:48:55 +0000
commite9e8bdacc538e84de228ae1af07b230df365803b (patch)
treeb9901e3ae8c127463f73af82a96a5d5e3e39eac5
parentf3669d95b47cdee4a9771204230c79327583ec4d (diff)
downloadATCD-e9e8bdacc538e84de228ae1af07b230df365803b.tar.gz
ChangeLogTag:Tue Jun 20 10:44:07 2000 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a34
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp137
2 files changed, 90 insertions, 81 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index b2354590a35..b84122c0665 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,15 +1,23 @@
+Tue Jun 20 10:44:07 2000 Carlos O'Ryan <coryan@uci.edu>
+
+ * orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp:
+ MSVC6 still does not implement the standard scope for variables
+ declared inside a for() loop. Or at least it does not work in
+ our default configurations. Workaround that by declaring the
+ variable in the enclosing scope.
+
Tue Jun 20 11:50:50 2000 Balachandran Natarajan <bala@cs.wustl.edu>
- * tao/FT_CORBA.pidl: The IDL file for FT_CORBA. This is from
- version 1.0 of FT_CORBA CORBA spec.
+ * tao/FT_CORBA.pidl: The IDL file for FT_CORBA. This is from
+ version 1.0 of FT_CORBA CORBA spec.
- * tao/IOPC.cpp:
- * tao/IOPC.h:
- * tao/IOP.pidl: Added some definitions from FT_CORBA spec that
- have been defined in the IOP module.
+ * tao/IOPC.cpp:
+ * tao/IOPC.h:
+ * tao/IOP.pidl: Added some definitions from FT_CORBA spec that
+ have been defined in the IOP module.
Tue Jun 20 00:25:51 2000 Craig Rodrigues <crodrigu@bbn.com>
-
+
* orbsvcs/tests/AVStreams/mpeg/source/client/Makefile
* orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Makefile
* orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/Makefile
@@ -18,7 +26,7 @@ Tue Jun 20 00:25:51 2000 Craig Rodrigues <crodrigu@bbn.com>
* orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Makefile
Updated Makefile dependencies. Removed X11 hardcoded paths.
- vcrs now builds.
+ vcrs now builds.
* orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp
* orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/audio.cpp
@@ -50,8 +58,8 @@ Tue Jun 20 00:25:51 2000 Craig Rodrigues <crodrigu@bbn.com>
* orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/as.cpp
* orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/vs.cpp
* orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp
- * orbsvcs/tests/AVStreams/mpeg/source/README
-
+ * orbsvcs/tests/AVStreams/mpeg/source/README
+
More Linux and gcc 2.95 fixes
Mon Jun 19 20:35:46 2000 Carlos O'Ryan <coryan@uci.edu>
@@ -62,9 +70,9 @@ Mon Jun 19 20:35:46 2000 Carlos O'Ryan <coryan@uci.edu>
Add the project files to the new Interoperable Naming test.
* orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.cpp:
- The order to catch some exceptions was wrong.
- Fixed runaway strings literals that continued after the end of
- the line.
+ The order to catch some exceptions was wrong.
+ Fixed runaway strings literals that continued after the end of
+ the line.
Mon Jun 19 19:26:14 2000 Ossama Othman <ossama@uci.edu>
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp
index 9fc12751547..61c579d023f 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp
@@ -143,12 +143,12 @@ void
TAO_Naming_Context::
to_string_helper_length (CORBA::ULong &len, const char * &src)
{
- for (const char *j =src; *j != '\0'; ++j)
+ for (const char *j =src; *j != '\0'; ++j)
{
++len;
if (*j == '.' || *j == '\\' || *j == '/')
++len;
- }
+ }
++len; // '.' seperator or '/' seperator
}
@@ -157,9 +157,9 @@ void
TAO_Naming_Context::
to_string_helper_assign (char * &k, const char * &src)
{
- for (; *src != '\0'; ++src)
+ for (; *src != '\0'; ++src)
{
- if (*src == '.' || *src == '\\' || *src == '/')
+ if (*src == '.' || *src == '\\' || *src == '/')
{
*k = '\\';
++k;
@@ -167,7 +167,7 @@ to_string_helper_assign (char * &k, const char * &src)
*k = *src;
++k;
}
-
+
}
char *
@@ -177,7 +177,7 @@ TAO_Naming_Context::to_string (const CosNaming::Name &n,
CosNaming::NamingContext::InvalidName))
{
// Accepts a Name and returns a stringified name.
-
+
// Check for invalid name.
if (n.length () == 0)
ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
@@ -185,47 +185,48 @@ TAO_Naming_Context::to_string (const CosNaming::Name &n,
// Length of the return string
CORBA::ULong len = 0;
-
- for (CORBA::ULong i = 0; i < n.length (); ++i)
+
+ CORBA::ULong i = 0;
+ for (; i < n.length (); ++i)
{
const char *id = n[i].id.in ();
// Count number of characters in id
this->to_string_helper_length (len, id);
-
+
const char *kind = n[i].kind.in ();
// Count number of characters in kind
this->to_string_helper_length (len, kind);
}
-
+
// Allocate memory to the return parameter
//
char *str_name = CORBA::string_alloc (len);
-
+
// check for memory allocation
//
if (str_name == 0)
{
ACE_THROW_RETURN (CORBA::NO_MEMORY (), 0);
}
-
+
char *k = str_name;
-
+
// Stringify the name
- for (CORBA::ULong i = 0; i < n.length (); i++)
- {
-
+ for (i = 0; i < n.length (); i++)
+ {
+
// Stringify Id
//
const char *id = n[i].id.in ();
this->to_string_helper_assign (k, id);
const char *kind = n[i].kind.in ();
-
+
if (*kind != '\0')
{
- // If 'kind' is set,
+ // If 'kind' is set,
// Append a seperator between the id and kind.
//
*k = '.';
@@ -235,7 +236,7 @@ TAO_Naming_Context::to_string (const CosNaming::Name &n,
//
this->to_string_helper_assign (k, kind);
}
-
+
// If this is not the last name component, add a seperator
// between the name components
//
@@ -244,12 +245,12 @@ TAO_Naming_Context::to_string (const CosNaming::Name &n,
*k = '/';
++k;
}
-
+
}
// Terminate
*k = '\0';
++k;
-
+
return str_name;
}
@@ -259,13 +260,13 @@ to_name_helper (char *dest, const char*& src)
{
for (; *src != '\0'; ++src, ++dest)
{
-
+
if (*src == '.' || *src == '/')
{
*dest = '\0';
return;
}
-
+
if (*src == '\\')
{
src++;
@@ -276,66 +277,66 @@ to_name_helper (char *dest, const char*& src)
return;
}
}
-
+
// In all cases.
*dest = *src;
}
-
+
// Terminate.
*dest = '\0';
}
-
+
CosNaming::Name *
TAO_Naming_Context::to_name (const char *sn,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException,
CosNaming::NamingContext::InvalidName))
{
- // Returns the Name from its stringified form.
+ // Returns the Name from its stringified form.
CosNaming::Name n;
// Total number of name components in the name
CORBA::ULong ncomp = 0;
-
+
// Total length of the unstrigified name
CORBA::ULong len=0;
-
-
- for (const char *j = sn; *j != '\0'; ++j)
+
+
+ for (const char *j = sn; *j != '\0'; ++j)
{
// Make a pass through the Name and count each character
if (*j == '/')
{
ncomp++;
}
-
+
if (*j == '\\')
{
++j;
--len;
-
+
if (*j == '\0')
{
// Case: The very last component
++len;
}
}
-
+
// In all cases.
++len;
}
-
-
+
+
// Check for InvalidName i.e. Invalid stringified name
//
if (len == 0)
ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
0);
-
+
// Assign the length of the return unstringified name.
//
n.length (ncomp+1);
-
+
// Keeps track of the number of the name component
//
CORBA::ULong count = 0;
@@ -361,7 +362,7 @@ TAO_Naming_Context::to_name (const char *sn,
n[count].id = id;
n[count].kind = kind;
-
+
count++;
// End
@@ -373,7 +374,7 @@ TAO_Naming_Context::to_name (const char *sn,
return new CosNaming::Name (n);
}
-char *
+char *
TAO_Naming_Context::to_url (const char * addr,
const char * sn,
CORBA::Environment &ACE_TRY_ENV)
@@ -381,20 +382,20 @@ TAO_Naming_Context::to_url (const char * addr,
CosNaming::NamingContextExt::InvalidAddress,
CosNaming::NamingContext::InvalidName))
{
- // Returns a fully formed URL string.
-
+ // Returns a fully formed URL string.
+
// NON US-ASCII charcters excluding those in this array are the
// characters that need to be escaped
//
- char non_escaped_punctuation[]= {';', '/', ':', '?', '@',
- '=', '+', '$', ',', '-',
- '_', '.', '!', '~', '*',
+ char non_escaped_punctuation[]= {';', '/', ':', '?', '@',
+ '=', '+', '$', ',', '-',
+ '_', '.', '!', '~', '*',
'\'', '(', ')' };
-
+
// Variable to keep track of the number of characters
//
CORBA::ULong no_char = ACE_OS::strlen (addr);
-
+
// Check for invalid address
if (no_char == 0)
ACE_THROW_RETURN (CosNaming::NamingContextExt::InvalidAddress (),
@@ -408,7 +409,7 @@ TAO_Naming_Context::to_url (const char * addr,
{
// Make a pass through the in string name to count the number of
// characters and if the character
- // is to be escaped, increment the number of characters by 3.
+ // is to be escaped, increment the number of characters by 3.
//
if ( !isalnum (*sn_ptr))
{
@@ -416,7 +417,7 @@ TAO_Naming_Context::to_url (const char * addr,
for (const char *i = non_escaped_punctuation; *i != '\0'; ++i)
{
- // But if the character is one of the 18 non US-ASCII characters
+ // But if the character is one of the 18 non US-ASCII characters
// and hence neednot be escaped, decrement the count by
// the 3.
//
@@ -426,7 +427,7 @@ TAO_Naming_Context::to_url (const char * addr,
}
}
}
-
+
++no_char;
}
@@ -435,12 +436,12 @@ TAO_Naming_Context::to_url (const char * addr,
if (no_char == no_char_addr)
ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
0);
-
+
// The 'iiopname://' tag is to be prepended at the starting of the
// return parameter.
//
char prefix []= "iiopname://1.1@";
-
+
// Allocate dynamic memory
//
char *str_url = CORBA::string_alloc (no_char + sizeof (prefix));
@@ -449,7 +450,7 @@ TAO_Naming_Context::to_url (const char * addr,
// Copy 'prefix' to the return parameter.
str_url_ptr = ACE_OS::strcpy (str_url_ptr , prefix);
-
+
// Concatenate the address
str_url_ptr = ACE_OS::strcat (str_url_ptr, addr);
@@ -470,48 +471,48 @@ TAO_Naming_Context::to_url (const char * addr,
//
for (sn_ptr = sn; *sn_ptr != '\0'; ++sn_ptr)
{
-
+
if ( !isalnum (*sn_ptr))
{
CORBA::ULong i = 0;
-
+
// This boolean keeps track if the character is to be
// escaped. If the character is a non US-ASCII Alphanumeric
// but is in the set of characters that need not be escaped,
// the boolean becomes TRUE '0'
//
CORBA::Boolean found = 1;
-
+
while (found == 1 && i < 18)
{
if (*sn_ptr == non_escaped_punctuation [i])
{
// If it is in the set, change the boolean value
- //
+ //
found = 0;
}
-
+
// Still not found ..but may be one of the remaining
// characters: so continue to check
//
++i;
}
-
+
if (found == 1)
{
// The character needs to be escaped
//
*tempptr_ptr = '%';
++tempptr_ptr;
-
+
// Append the hexadecimal representation of the
// character.
const char *bytes = sn_ptr;
-
+
*tempptr_ptr = ACE::nibble2hex ((*bytes) >> 4);
++tempptr_ptr;
*tempptr_ptr++ = ACE::nibble2hex (*bytes);
-
+
}
else
{
@@ -519,9 +520,9 @@ TAO_Naming_Context::to_url (const char * addr,
*tempptr_ptr = *sn_ptr;
++tempptr_ptr;
}
-
+
}
- else
+ else
{
// If the character is a US-ASCII Alphanumeric value...
*tempptr_ptr = *sn_ptr;
@@ -532,15 +533,15 @@ TAO_Naming_Context::to_url (const char * addr,
// Terminate the string
*tempptr_ptr = '\0';
-
- str_url_ptr = ACE_OS::strcat (str_url_ptr,
+
+ str_url_ptr = ACE_OS::strcat (str_url_ptr,
temp_ptr.in ());
// CORBA::string_free (temp_ptr);
return str_url;
-}
+}
CORBA::Object_ptr
@@ -554,7 +555,7 @@ TAO_Naming_Context::resolve_str (const char * n,
{
// Similar to <resolve> above. It accepts a strigified name as an
// argument instead of a Name.
-
+
// Get the unstrigified name.
CosNaming::Name_var name = this->to_name (n, ACE_TRY_ENV);
ACE_CHECK_RETURN (CORBA::Object::_nil ());