PageRenderTime 58ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/freedos/source/kernel/kernel/misc.c

https://github.com/vvnikitin/sdcboot
C | 79 lines | 39 code | 13 blank | 27 comment | 6 complexity | 3df4174828026b35620a0a1c52c7b373 MD5 | raw file
Possible License(s): GPL-2.0, 0BSD, LGPL-2.0
  1. /****************************************************************/
  2. /* */
  3. /* misc.c */
  4. /* */
  5. /* Miscellaneous Kernel Functions */
  6. /* */
  7. /* Copyright (c) 1993 */
  8. /* Pasquale J. Villani */
  9. /* All Rights Reserved */
  10. /* */
  11. /* This file is part of DOS-C. */
  12. /* */
  13. /* DOS-C is free software; you can redistribute it and/or */
  14. /* modify it under the terms of the GNU General Public License */
  15. /* as published by the Free Software Foundation; either version */
  16. /* 2, or (at your option) any later version. */
  17. /* */
  18. /* DOS-C is distributed in the hope that it will be useful, but */
  19. /* WITHOUT ANY WARRANTY; without even the implied warranty of */
  20. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
  21. /* the GNU General Public License for more details. */
  22. /* */
  23. /* You should have received a copy of the GNU General Public */
  24. /* License along with DOS-C; see the file COPYING. If not, */
  25. /* write to the Free Software Foundation, 675 Mass Ave, */
  26. /* Cambridge, MA 02139, USA. */
  27. /****************************************************************/
  28. #include "portab.h"
  29. #ifdef VERSION_STRINGS
  30. static BYTE *miscRcsId =
  31. "$Id: misc.c 653 2003-08-09 09:35:18Z bartoldeman $";
  32. #endif
  33. #include "globals.h"
  34. #ifndef I86
  35. char *strcpy(REG BYTE * d, REG CONST BYTE * s)
  36. {
  37. char *tmp = d;
  38. while ((*d++ = *s++) != '\0')
  39. ;
  40. return tmp;
  41. }
  42. VOID fstrcpy(REG BYTE FAR * d, REG CONST BYTE FAR * s)
  43. {
  44. while (*s)
  45. *d++ = *s++;
  46. *d = '\0';
  47. }
  48. VOID * memcpy(REG VOID * d, REG CONST VOID * s, REG size_t n)
  49. {
  50. char *cd = d;
  51. CONST char *cs = s;
  52. while (n--)
  53. *cd++ = *cs++;
  54. return d;
  55. }
  56. VOID fmemcpy(REG VOID FAR * d, REG CONST VOID FAR * s, REG size_t n)
  57. {
  58. while (n--)
  59. *((BYTE FAR *) d)++ = *((BYTE FAR *) s)++;
  60. }
  61. VOID fmemset(REG VOID FAR * s, REG int ch, REG size_t n)
  62. {
  63. while (n--)
  64. *((BYTE FAR *) s)++ = ch;
  65. }
  66. #endif