[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] passing lists between c and OTcl



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 nullList ""
	$newAgent send $thisNeighbor $nullList


-Lori