Re: Deeper into the Data
- Posted by David Cuny <dcuny at LANSET.COM> Aug 27, 2000
- 455 views
Ray Smith wrote: > Interbase comes with a dll library that allows access > to the DB server. You need to look at the header file(s) > "*.h" that define the routines for this dll. > > Then you have to write wrappers in Euphoria for each > function that you want to use from Euphoria. If the Interbase API routines deal with plain C types (char*, int, double), you might want to take a look at my SWIG/Euphoria program. Instead of building the wrappers by hand, just copy the prototypes of the functions that you want into a text file called "interbase.i". Add the command: %module interbase to the top of the file, and then run SWIG with the command: swig interbase.i (or "swig -c++ interbase.i" if the routines happen to be in C++ form). SWIG will generate a couple of files: interbase.e - interface to "interbase.dll" interbase_wrap.c - c code to create "interbase.dll" interbase_wrap.doc - junk, not supported yet Have a look at "interbase.e". You will have to change the code where it interfaces to the dll: const dll_interbase = open_dll("interbase.dll") But other than that, (if you are really lucky) it should have built the Euphoria wrappers correctly. If, on the other hand, the API uses a lot of custom structures, constant values, and so on, you'll have to compile "interbase_wrap.c" into a dll and rename the DLL to "interbase.dll". In that case, you'll need to take a bit more care building the interface. You'll need to specify before the protoypes which files to include: %{ include "file1.h" include "file2.h" %} where "file1.h" and "file2.h" are files you got the prototypes from, etc. Either way, it's worth a try. -- David Cuny