Subversion Repositories Kolibri OS

Rev

Rev 4921 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*-
  2.  * Code created by modifying scanf.c which has following copyright.
  3.  *
  4.  * Copyright (c) 1990 The Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms are permitted
  8.  * provided that the above copyright notice and this paragraph are
  9.  * duplicated in all such forms and that any documentation,
  10.  * advertising materials, and other materials related to such
  11.  * distribution and use acknowledge that the software was developed
  12.  * by the University of California, Berkeley.  The name of the
  13.  * University may not be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  */
  19.  
  20. #include <_ansi.h>
  21. #include <reent.h>
  22. #include <stdio.h>
  23. #ifdef _HAVE_STDC
  24. #include <stdarg.h>
  25. #else
  26. #include <varargs.h>
  27. #endif
  28. #include "local.h"
  29.  
  30. #ifndef _REENT_ONLY
  31.  
  32. int
  33. _DEFUN(vscanf, (fmt, ap),
  34.        _CONST char *fmt _AND
  35.        va_list ap)
  36. {
  37.   struct _reent *reent = _REENT;
  38.  
  39.   _REENT_SMALL_CHECK_INIT (reent);
  40.   return __svfscanf_r (reent, _stdin_r (reent), fmt, ap);
  41. }
  42.  
  43. #ifdef _NANO_FORMATTED_IO
  44. int
  45. _EXFUN(viscanf, (const char *, __VALIST) _ATTRIBUTE ((__alias__("vscanf"))));
  46. #endif
  47.  
  48. #endif /* !_REENT_ONLY */
  49.  
  50. int
  51. _DEFUN(_vscanf_r, (ptr, fmt, ap),
  52.        struct _reent *ptr _AND
  53.        _CONST char *__restrict fmt   _AND
  54.        va_list ap)
  55. {
  56.   _REENT_SMALL_CHECK_INIT (ptr);
  57.   return __svfscanf_r (ptr, _stdin_r (ptr), fmt, ap);
  58. }
  59.  
  60. #ifdef _NANO_FORMATTED_IO
  61. int
  62. _EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST)
  63.        _ATTRIBUTE ((__alias__("_vscanf_r"))));
  64. #endif
  65.