The usual way to declare the interface from an external DLL in C is to expose its interface in a .H header file. Then, to access the DLL from C the .H header file has to be #include
d in the C source code.
Translated to Delphi terms, you need to create a unit file that describes the same interface in pascal terms, translating the c syntax to pascal.
For your case, you would create a file such as...
unit xyzDevice;
{ XYZ device Delphi interface unit
translated from xyz.h by xxxxx -- Copyright (c) 2009 xxxxx
Delphi API to libXYZ - The Free XYZ device library --- Copyright (C) 2006 yyyyy }
interface
type
TXyzDeviceType = integer;
const
xyzDll = 'xyz.dll';
XYZ_DEVICE_PCI = 1;
XYZ_DEVICE_USB = 2;
function XyzDeviceStatus ( kind : TXyzDeviceType ) : integer; stdcall;
external xyzDLL; name 'DeviceStatus';
implementation
end.
And the you would declare it in the uses
clause of your source code. And invoke the function this way:
uses xyzDevice;
...
case XyzDeviceStatus(XYZ_DEVICE_USB) of ...