[ns] passing lists in pkt header between C++ and OTcl
Lori Flynn
lori@cse.ucsc.edu
Thu, 6 Jul 2000 17:16:52 -0700 (PDT)
Hi,
So far no one has replied so I'm posting this one more time... any help
would be greatly appreciated!
---------- Forwarded message ----------
Hi all.
I need to pass a list from OTcl to C++ and back, any help would be
appreciated.
The list can consist of nothing, one number, or a list of numbers. I know
how to create this in OTcl. The problem is when I call the 'recv'
function in C++ space. If the OTcl list is "" (null), then I get an error
message when I call an OTcl function using the C++ sprintf function which
calls the OTcl 'recv' using '%s' for the null field.
Maybe the above sounds confusing, here is the code from the C++ side:
sprintf(out, "%s recv %s", name(), hdr->myList);
And from the OTcl side:
Agent/myAgent instproc recv { myList } {
And the 'send' from the OTcl side:
set thisList ""
lappend thisList "."
$newAgent send $thisNeighbor $thisList
-Lori