Re: structs in esql/c
Posted in 1995
}From: syadat@mercury.eng.wayne.edu (Yadati Sainath) }Subject: structs in esql/c }Date: 5 Jan 1995 00:13:59 GMT }X-Informix-List-Id: <news.10578> } }Hi Informix Gurus: } }We are trying to declare a c-struct in a header file }to be commonly used by esql/c and C++ code. }Sample header file looks as below: } }c_struct.h } }EXEC SQL BEGIN DECLARE SECTION; } }typedef struct{ } int id; } ....... } }UserServ; } }EXEC SQL END DECLARE SECTION; } }To include the same header file in C++ we need }to eliminate the declare portions. If you have }any information about this, Please mail to the }address : suresh@titan.com OR kishore@titan.com. The simplest technique is to exclude the EXEC SQL BEGIN/END bits from the header file. Then, in ESQL/C code, use: EXEC SQL BEGIN DECLARE SECTION; EXEC SQL INCLUDE c_struct.h; EXEC SQL END DECLARE SECTION; I can't remember whether the .h above is mandatory, optional, or must be absent, but it won't take long to find out... And the C++ code obviously just uses: #include "c_struct.h" Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>