According to Berend de Boer:
Can we not simply see a C .h file as an interface-only module? I mean I can simply import a c .h file which gpc parses and all symbols defined in that header file are exported symbols?
This would mean that GPC would have to parse C source.
Remember that #include "foo.h" or (*$include "foo.h" *) just means that GPC treads the file `foo.h' just if its contents were written in our source file. A Pascal program using this mechanism would in fact look like the following:
Program Test;
extern int foo;
extern void ioctl (int fildes, int cmd, ...);
begin [...] end.
You don't actually want this. ;-)
I don't know how far this is feasible. And it doesn't cover a.out modules creating using other languages (GNAT, ...). But it does cover the majority of cases you need externals.
You can write a C header file for everything you want to import, independently of the language it was originally written in. Our point is that it must also be possible to write a *Pascal* interface for everything we want to import.
Peter
e-mail: peter.gerwinski@uni-essen.de home address: D"usseldorfer Str. 35, 45145 Essen, Germany WWW: http://agnes.dida.physik.uni-essen.de/~peter