Category : OS/2 Files
Archive   : GNUGREP.ZIP
Filename : STD.C

 
Output of file : STD.C contained in archive : GNUGREP.ZIP
/* std.c - compensate for a few missing library functions.
In the Public Domain; written by Mike Haertel. */

#include "std.h"
#include "unix.h"

#ifdef X_memmove
PTR
DEFUN(memmove, (d, s, n), PTR d AND PTRCONST s AND size_t n)
{
char *dd;
const char *ss;

dd = d;
ss = s;
if (dd > ss && dd < ss + n)
{
dd += n;
ss += n;
while (n--)
*--dd = *--ss;
}
else
while (n--)
*dd++ = *ss++;
return d;
}
#endif /* X_memmove */

#ifdef X_remove
#if defined(unix) || defined(__unix__)
int
DEFUN(remove, (filename), const char *filename)
{
extern int EXFUN(unlink, (const char *));

return unlink(filename);
}
#endif /* unix */
#endif /* X_strerror */

#ifdef X_strerror
#if defined(unix) || defined(__unix__)
char *
DEFUN(strerror, (errnum), int errnum)
{
extern int sys_nerr;
extern char *sys_errlist[];

if (errnum > 0 && errnum < sys_nerr)
return sys_errlist[errnum];
return "";
}
#endif /* unix */
#endif /* X_strerror */


  3 Responses to “Category : OS/2 Files
Archive   : GNUGREP.ZIP
Filename : STD.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/