RE: parameter passing to c
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Data Types & Schema Design
I am not sure if I have understood your problem exactly, but it seems that you are trying to pass 4gl records into C functions. If this is the case, here's an explanation of how ( apparently ) 4gl = records behave: When you pass a whole record to a function, this is equivalent to = passing all the fields of the record separately as parameters to that function. = Thus, if you had a record: MyRec RECORD number INTEGER, string VARCHAR(10) END RECORD and if you called a function like this: foo( MyRec.* ) Then this call is absolutely equivalent to: foo( MyRec.number, MyRec.string ) So, if foo was a C function it would pop the parameters like this: int foo( args ) int args; { long number; char string[11]; popquote( string, 10 ); // or something like this popint( &number ); .... } Regards, Emil. ---------- From: jacks@opennet.net Sent: 17 =DF=ED=F3=E0=F0=E8 1997 =E3. 19:42 To: informix-list@rmy.emory.edu Subject: parameter passing to c The C program that I am using requires that I pass in some simi-complex=20 data structures. It is expecting pointers to those items to be passed = in. I have created records in Informix, but I don't know how to intermix the = two. Apparently, the pop functions for retrieving the data from off the stack = don't seem to handle anthing like this. I really don't want to write a trivial = wrapper function. Any advice would be appreciated, Jack Sneddon (801)375-9190 jacks@opennet.net