Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /****************************************************************************
  2. *
  3. *                            Open Watcom Project
  4. *
  5. *    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
  6. *
  7. *  ========================================================================
  8. *
  9. *    This file contains Original Code and/or Modifications of Original
  10. *    Code as defined in and that are subject to the Sybase Open Watcom
  11. *    Public License version 1.0 (the 'License'). You may not use this file
  12. *    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
  13. *    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
  14. *    provided with the Original Code and Modifications, and is also
  15. *    available at www.sybase.com/developer/opensource.
  16. *
  17. *    The Original Code and all software distributed under the License are
  18. *    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  19. *    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
  20. *    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
  21. *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
  22. *    NON-INFRINGEMENT. Please see the License for the specific language
  23. *    governing rights and limitations under the License.
  24. *
  25. *  ========================================================================
  26. *
  27. * Description:  Format specification descriptor for scanf family.
  28. *
  29. ****************************************************************************/
  30.  
  31.  
  32. #ifndef _SCANF_H_INCLUDED
  33. #define _SCANF_H_INCLUDED
  34.  
  35. #include "variety.h"
  36. #include "widechar.h"
  37. #include <stdarg.h>
  38.  
  39. typedef struct {
  40.     int         (*cget_rtn)();      /* character get rtn */
  41.     void        (*uncget_rtn)();    /* unget a character rtn */
  42.     CHAR_TYPE   *ptr;               /* file or string pointer */
  43.     int         width;              /* conversion field width */
  44.     unsigned    assign         : 1; /* assignment flag for current argument */
  45.     unsigned    eoinp          : 1; /* end of input reached */
  46.     unsigned    far_ptr        : 1; /* F  - far pointer */
  47.     unsigned    near_ptr       : 1; /* N  - near pointer */
  48.     unsigned    char_var       : 1; /* hh - char variable */
  49.     unsigned    short_var      : 1; /* h  - short variable */
  50.     unsigned    long_var       : 1; /* l  - long variable */
  51.     unsigned    long_long_var  : 1; /* ll - long long variable */
  52.     unsigned    long_double_var: 1; /* L - long double variable */
  53.     unsigned    p_format       : 1; /* %p (pointer conversion) */
  54. } SCNF_SPECS;
  55.  
  56. #if defined(__HUGE__)
  57.     #define PTR_SCNF_SPECS SCNF_SPECS _WCFAR *
  58. #else
  59.     #define PTR_SCNF_SPECS SCNF_SPECS *
  60. #endif
  61.  
  62. #if defined( __STDC_WANT_LIB_EXT1__ ) && __STDC_WANT_LIB_EXT1__ == 1
  63.   #if defined(__WIDECHAR__)
  64.     extern int __wscnf_s( PTR_SCNF_SPECS, const CHAR_TYPE *, const char **msg, va_list );
  65.   #else
  66.     extern int __scnf_s( PTR_SCNF_SPECS, const CHAR_TYPE *, const char **msg, va_list );
  67.   #endif
  68. #else
  69.   #if defined(__WIDECHAR__)
  70.     extern int __wscnf( PTR_SCNF_SPECS, const CHAR_TYPE *, va_list );
  71.   #else
  72.     extern int __scnf( PTR_SCNF_SPECS, const CHAR_TYPE *, va_list );
  73.   #endif
  74. #endif
  75.  
  76. //#pragma off(unreferenced);
  77. #endif
  78.