scanf.c
Upload User: super_houu
Upload Date: 2008-09-21
Package Size: 4099k
Code Size: 1k
Category:

DVD

Development Platform:

Others

  1. /*
  2.  *      Paradigm C/C++ Run-Time Library - Version 5.0
  3.  *
  4.  *      Copyright (c) 1998 Paradigm Systems.  All rights reserved.
  5.  *      Portions Copyright (c) 1996 Borland International.
  6.  *
  7.  *      $Revision: 3 $
  8.  *      $Workfile: scanf.c $
  9.  *
  10.  * function(s)
  11.  *        scanf - gets formatted input from stdin
  12.  */
  13. #include "Config.h" // Global Configuration - do not remove!
  14. #if defined(_DEBUG) || defined(D_RELEASE_TRACE_ENABLED) // ZKR GL051004
  15. #include "CpuV186tserio.h"
  16. #include <stdarg.h>
  17. #include <stdio.h>
  18. #undef   ungetc         /* remove the macro version */
  19. /*---------------------------------------------------------------------*
  20. Name            scanf - gets formatted input from stdin
  21. Usage           int scanf(const char *format[, argument ...])
  22. Prototype in    stdio.h
  23. Description     gets formatted input from stdin
  24. Return value    number of fields scanned and stored.  scanf returns EOF
  25.                 if an attempt is made to read at end-of-file
  26. *---------------------------------------------------------------------*/
  27. #pragma codeseg _TEXT "CODE"
  28. int _RTLENTRY _FARFUNC scanf(const char *fmt, ...)
  29.   {
  30.   char zString[RECEIVE_STRING_SIZE_LIMIT];
  31.   gets (zString);
  32.   return vsscanf(zString,fmt,_va_ptr);
  33.   }
  34. #endif // #if defined(_DEBUG) || defined(D_RELEASE_TRACE_ENABLED) // ZKR GL051004