summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2002-11-07 06:51:47 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2002-11-07 06:51:47 +0000
commit1bbe31fe89c82c6acf2a8c006d366016f4833ff1 (patch)
treee96346784efbc3bd95da98ee7a5e92d0eb021607
parent3e1d8b5e36da3ed22f2a20cda3552f9e8f7d475e (diff)
downloadATCD-1bbe31fe89c82c6acf2a8c006d366016f4833ff1.tar.gz
ChangeLogTag:Wed Nov 6 18:55:22 2002 Steve Huston <shuston@riverace.com>
-rw-r--r--TAO/ChangeLog6
-rw-r--r--TAO/utils/nslist/nsadd.cpp46
-rw-r--r--THANKS3
3 files changed, 46 insertions, 9 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index c3801bedd4d..fdc84df7cc8 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,9 @@
+Wed Nov 6 20:09:14 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
+
+ * utils/nslist/nsadd.cpp: Enhanced the utilty so that it can add arbitrary
+ paths to Naming Service entries. Thanks to Paul Caffrey <denginere@hotmail.com>
+ for this fix.
+
Thu Nov 7 06:44:12 UTC 2002 Johnny Willemsen <jwillemsen@remedy.nl>
* orbsvcs/tests/Makefile.bor:
diff --git a/TAO/utils/nslist/nsadd.cpp b/TAO/utils/nslist/nsadd.cpp
index 1e2626d91a6..a06ce5004fa 100644
--- a/TAO/utils/nslist/nsadd.cpp
+++ b/TAO/utils/nslist/nsadd.cpp
@@ -13,6 +13,7 @@
//
// = AUTHOR
// Carlos O'Ryan
+// enhanced Nov 6, 2002 Paul Caffrey <denginere@hotmail.com>
//
// ================================================================
@@ -39,7 +40,7 @@ main (int argc, char *argv[])
int rebind = 0;
while (argc > 0)
{
- if (strcmp(*argv, "--ior") == 0)
+ if (strcmp (*argv, "--ior") == 0)
{
if (argc == 1)
{
@@ -51,7 +52,7 @@ main (int argc, char *argv[])
argv++;
ior = *argv;
}
- else if (strcmp(*argv, "--name") == 0)
+ else if (strcmp (*argv, "--name") == 0)
{
if (argc == 1)
{
@@ -63,11 +64,11 @@ main (int argc, char *argv[])
argv++;
name = *argv;
}
- else if (strcmp(*argv, "--rebind") == 0)
+ else if (strcmp (*argv, "--rebind") == 0)
{
rebind = 1;
}
- else if (strncmp(*argv, "--", 2) == 0)
+ else if (strncmp (*argv, "--", 2) == 0)
{
ACE_DEBUG ((LM_DEBUG,
"Usage: %s --name <name> "
@@ -102,10 +103,39 @@ main (int argc, char *argv[])
"Error: nil naming context\n"));
return 1;
}
+ //printf (" make a copy\n");
+ char buf[BUFSIZ];
+ strcpy (buf, name);
+ char *bp = &buf[0];
+ char *cp = 0;
+ int ntoks = 0;
+ char *toks[20];
+ while ((cp = strtok (bp, "/")) != 0)
+ {
+ toks[ntoks] = cp;
+ ntoks++;
+ if (cp == 0)
+ break;
+ bp = 0; // way strtok works
+ }
+
+ // now assign name = toks[ntoks]
+ char lastname[BUFSIZ];
+ strcpy (lastname, toks[ntoks-1]);
+ // search for '.' in name; if exists then the part after '.' is the kind
+ char *kind = strchr (lastname, '.');
+ if (kind != 0)
+ {
+ *kind = 0;
+ kind++;
+ }
+
+ ACE_TRY_CHECK;
+ CosNaming::Name the_name (ntoks);
+ the_name.length (ntoks);
+ for (i=0; i<ntoks; i++)
+ the_name[i].id = CORBA::string_dup (toks[i]);
- CosNaming::Name the_name (1);
- the_name.length (1);
- the_name[0].id = CORBA::string_dup (name);
if (rebind)
{
root_nc->rebind (the_name, obj.in () ACE_ENV_ARG_PARAMETER);
@@ -127,3 +157,5 @@ main (int argc, char *argv[])
return 0;
}
+
+
diff --git a/THANKS b/THANKS
index a3eff7d135b..290e384303c 100644
--- a/THANKS
+++ b/THANKS
@@ -1061,7 +1061,7 @@ John Buckman <john@lyris.com>
Guy Rosen <grosen@bigfoot.com>
<amoderni@viasoft.com>
Bennett R. Stabile <bstabile@home.com>
-Paul Caffrey <pcaffrey@iel.ie>
+Paul Caffrey <denginere@hotmail.com>
Low Aik long <aiklong@softhome.net>
Michael Rinne <Michael.Rinne@ZN-AG.de>
Jaffar Shaikh <Jaffar_Shaikh@Mitel.com>
@@ -1548,7 +1548,6 @@ Colin Weaver <colin.weaver@invensys.com>
Kew Whitney <Whitney.Kew@Invensys.com>
Sean Ogle <sean.ogle@syslog.at>
Tim Bradley <bradley_t@ociweb.com>
-Denginere <denginere@hotmail.com>
Kier Schmitt <SchmittKC@kpt.nuwc.navy.mil>
George Varsamis <gv@prismtechnologies.com>
Alan Tanga <stang1@lucent.com>