1. Re: C to Euphoria
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Jul 11, 1998
- 401 views
Antoine Delle Donne writes: > How to convert these structures in Euphoria and will they > keep the same size as in C. For example structure IDNAME is > 162 bytes long Will it still be 162 bytes long in Euphoria? Euphoria does not have structures like C. Euphoria has atoms and sequences (only). The size of data in Euphoria is largely irrelevant since Euphoria is a high level language and does not define the way that atoms and sequences are laid out in memory. You can't get the address of a Euphoria variable. Euphoria programs can call C functions via the Euphoria routines c_func() and c_proc(). Euphoria can access memory using peek() and poke() and can allocate memory using allocate(). To access fields in a C structure you must get a pointer (address) to the structure, and then use peek() and poke(), or peek4u(), peek4s(), or poke4() to read/write the fields. You need to calculate the offsets of the fields you are interested in. Most fields are 4 bytes in size. Sometimes a structure will contain a gap so the next field will be better aligned. See one of the WIN32 example programs on the RDS Web site. Also read DOC\PLATFORM.DOC in the Euphoria .ZIP file. > P.S. I'm trying to reply to the list but Outlook98 seems to > send to original poster?? Will have to figure that out. When you hit the Reply button to reply to a message from the list server, you need to check whether your reply is going to "Euphoria Programming for MS-DOS" or only to the person who posted. It seems to vary depending on who posted the message. I guess it has something to do with the "Reply-To" information they specified. You should add the EUPHORIA mailing list address to your address book. Regards, Rob Craig Rapid Deployment Software http://members.aol.com/FilesEu/