I would rewrite the code to include the proper header files.
Seconded.
Lemme tell you why.
I hate PINE. I hate it with a fiery, burning, and unending passion. Because,
you see, PINE (at least in the past) used to do this garbage. They REFUSED to
use standard headers. Instead, for each target, they'd carefully create what
they thought were probably the right declarations to use.
They were wrong.
This meant that, as soon as you tried PINE on a big-endian machine with a
64-bit filesystem, EVERYTHING blew up, data was lost, files were destroyed.
BECAUSE THEY WERE WRONG.
Note that their explanation was actually worse; apparently, there had once
existed a machine on which (they claim) the standard headers mis-declared
things, so they concluded it was "safer" to provide their own declarations.
There are two problems with this:
1. No one looking at that code would ever conclude that, had the author
of that code found a "bug" in a compiler, there was a legitimate basis for
thinking that the compiler had actually been at fault.
2. Breaking dozens of systems on the grounds that you once found one which
was broken is not a good trade-off.
Never do this.
To put this in perspective: I maintain a utility which works by intercepting
calls to the standard library and operating system and replacing them with
duplicates. That is to say, if you are running with this utility, and
you write:
FILE *fp = fopen(...);
your code will call *my* fopen, not the host environment one.
I use the prototype declarations from the standard headers. (It's fussier,
because I provide *definitions* of my own, which merely match signatures, but
I still let <stdio.h> provide the initial declaration of fopen().)
So, even if you really ARE writing your own versions of these functions,
it is still suicidally stupid not to use the standard headers for them.
Yes, in theory you might be able to do it correctly. You also might not.
-s