2000-05-06 21:34:20 +02:00
|
|
|
/****************************************************************/
|
|
|
|
/* */
|
|
|
|
/* misc.c */
|
|
|
|
/* */
|
|
|
|
/* Miscellaneous Kernel Functions */
|
|
|
|
/* */
|
|
|
|
/* Copyright (c) 1993 */
|
|
|
|
/* Pasquale J. Villani */
|
|
|
|
/* All Rights Reserved */
|
|
|
|
/* */
|
|
|
|
/* This file is part of DOS-C. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is free software; you can redistribute it and/or */
|
|
|
|
/* modify it under the terms of the GNU General Public License */
|
|
|
|
/* as published by the Free Software Foundation; either version */
|
|
|
|
/* 2, or (at your option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is distributed in the hope that it will be useful, but */
|
|
|
|
/* WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
|
|
|
|
/* the GNU General Public License for more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public */
|
|
|
|
/* License along with DOS-C; see the file COPYING. If not, */
|
|
|
|
/* write to the Free Software Foundation, 675 Mass Ave, */
|
|
|
|
/* Cambridge, MA 02139, USA. */
|
|
|
|
/****************************************************************/
|
|
|
|
|
|
|
|
#include "portab.h"
|
|
|
|
|
|
|
|
#ifdef VERSION_STRINGS
|
2001-11-18 15:01:12 +01:00
|
|
|
static BYTE *miscRcsId =
|
|
|
|
"$Id$";
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
|
|
|
|
2001-11-18 00:26:45 +01:00
|
|
|
#include "globals.h"
|
|
|
|
#ifndef I86
|
|
|
|
|
2002-08-03 03:59:21 +02:00
|
|
|
char *strcpy(REG BYTE * d, REG CONST BYTE * s)
|
2001-11-18 00:26:45 +01:00
|
|
|
{
|
2002-08-03 03:59:21 +02:00
|
|
|
char *tmp = d;
|
|
|
|
|
|
|
|
while ((*d++ = *s++) != '\0')
|
|
|
|
;
|
|
|
|
|
|
|
|
return tmp;
|
2001-11-18 00:26:45 +01:00
|
|
|
}
|
|
|
|
|
2002-08-03 03:59:21 +02:00
|
|
|
VOID fstrcpy(REG BYTE FAR * d, REG CONST BYTE FAR * s)
|
2001-11-18 00:26:45 +01:00
|
|
|
{
|
|
|
|
while (*s)
|
|
|
|
*d++ = *s++;
|
|
|
|
*d = '\0';
|
|
|
|
}
|
|
|
|
|
2002-08-03 03:59:21 +02:00
|
|
|
VOID * memcpy(REG VOID * d, REG CONST VOID * s, REG size_t n)
|
2001-11-18 00:26:45 +01:00
|
|
|
{
|
2002-08-03 03:59:21 +02:00
|
|
|
char *cd = d;
|
|
|
|
CONST char *cs = s;
|
|
|
|
|
2001-11-18 00:26:45 +01:00
|
|
|
while (n--)
|
2002-08-03 03:59:21 +02:00
|
|
|
*cd++ = *cs++;
|
|
|
|
return d;
|
2001-11-18 00:26:45 +01:00
|
|
|
}
|
|
|
|
|
2002-08-03 03:59:21 +02:00
|
|
|
VOID fmemcpy(REG VOID FAR * d, REG CONST VOID FAR * s, REG size_t n)
|
2001-11-18 00:26:45 +01:00
|
|
|
{
|
|
|
|
while (n--)
|
|
|
|
*((BYTE FAR *) d)++ = *((BYTE FAR *) s)++;
|
|
|
|
}
|
|
|
|
|
2002-08-03 03:59:21 +02:00
|
|
|
VOID fmemset(REG VOID FAR * s, REG int ch, REG size_t n)
|
2001-11-18 00:26:45 +01:00
|
|
|
{
|
|
|
|
while (n--)
|
|
|
|
*((BYTE FAR *) s)++ = ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|