Is the attached C prog a legal translation of this DX script code?:
macro foo( ) -> ( )
{
a = "1";
b = c;
}
Figure 1: yanked from from dx/html/pages/progu091.htm#HDRSETVARS
If so, then we have a bug in the Linux and FreeBSD DXLink macro parsers.
Give the code a try and see what you get.
Strip away the macro begin/end calls and it works.
Randy
P.S. Some of the dx/samples/dxlink progs fail with similar errors. They
worked on SGI last time I checked, but I'll reverify Tuesday. This may be
a platform specific parse bug.
/* cc -o tst tst.c -lDXL -I/usr/local/dx/include -L/usr/local/dx/lib_freebsd */
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include "dxl.h"
main(int argc, char *argv[])
{
DXLConnection *conn = NULL;
char result[100];
putenv( "DXLSYNCHRONOUS" );
putenv( "DXLTRACE" );
conn = DXLStartDX("dx -execonly", NULL);
assert(conn);
exDXLBeginMacroDefinition( conn, "macro foo( ) -> ( )" );
/*DXLSetString(conn, "a","1");*/
DXLSend(conn, "a = \"1\";");
DXLSend(conn, "b = c;");
exDXLEndMacroDefinition( conn );
printf("Hit return to quit:");
fgets(result, sizeof(result), stdin);
DXLExitDX(conn);
}
/*---------------------------------------------------------------------------
THE ERROR:
...
DXLink connected to server at version 4.2.0
Sending -> |1000001|$mac|0|
Sending -> macro foo( ) -> ( )
Sending -> {
Sending -> a = "1";
Sending -> |1000002|$for|8|a = "1";|
Sending -> $sync
Recving <- id 1000001 type 7 0: ERROR: UI[10,1]: parse error: |
----------------------------------------------------------------------------*/