Re: Definition techniques using ESQL-C
Posted in 1992
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
> > I am a bit confused about how to do something that seems like it should > be easy. I want to define a structure that can be used in both an > ESQL-C source file and a standard c file. It seems that if I make > a standard header file defining the structure using the standard > c syntax ( struct foo { int bar; }; ), ESQL-C won't let me create a > host variable of type struct foo. It only works if i use the following > syntax ( $struct foo { int bar; }; ). This of course messes things > up for standard c. Jon, If anyone comes up with a reasonable way of doing this, let me know. When I was confronted with the problem, I only found two ways of handling it. The first was the obvious, having two separate include files, one for the ESQL program and one for the standard C program. The second was to duplicate the structure inside the same file using the '$struct foo' in one and the plain 'struct foo' in the other. Then using #ifdef ESQL for the ESQL structure. Both of these require you to update both structures; at least the second one puts them both in the same file. If anyone has a cleaner way of doing this I would certainly appreciate hearing about it. -- Rory Martin Internet: dksl2vq@bell-atl.com Bell Atlantic Network Services 2221-L Broadbirch Drive Voice: 1+ (301) 989-5075 Silver Spring, MD 20904-1985 "No matter where you go, there you are." ---------------------------------------------------------------------------