Pascal DLL:

Library MinMax;

Function Min(X, Y: Integer): Integer; export;
begin
  if X < Y then Min := X else Min := Y;

end;

Function Max(X, Y: Integer): Integer; export;
begin
  if X > Y then Max := X else Max := Y;
end;

Exports
  Min index 1,
  Max index 2;

begin
end.


Then to Call it from your C Code:

1. In your .DEF File add:

    IMPORTS
         Min  =MINMAX.Min
         Max  =MINMAX.Max

2. In your C application, you must prototype the functions as:

    int FAR PASCAL Min(int x, y);
    int FAR PASCAL Min(int x, y);

