EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

StdLib/Include/Ia32/machine/ansi.h

Go to the documentation of this file.
00001 /*      $NetBSD: ansi.h,v 1.19 2006/10/04 13:52:00 tnozaki Exp $        */
00002 
00003 /*-
00004  * Copyright (c) 1990, 1993
00005  *      The Regents of the University of California.  All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  * 3. Neither the name of the University nor the names of its contributors
00016  *    may be used to endorse or promote products derived from this software
00017  *    without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00020  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00022  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00023  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00024  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00025  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00026  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00027  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00028  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00029  * SUCH DAMAGE.
00030  *
00031  *      @(#)ansi.h      8.2 (Berkeley) 1/4/94
00032  */
00033 
00034 #ifndef _ANSI_H_
00035 #define _ANSI_H_
00036 
00037 #include  <sys/EfiCdefs.h>
00038 
00039 #include <machine/int_types.h>
00040 
00041 /*
00042  * Types which are fundamental to the implementation and may appear in
00043  * more than one standard header are defined here.  Standard headers
00044  * then use:
00045  *      #ifdef  _BSD_SIZE_T_
00046  *      typedef _BSD_SIZE_T_ size_t;
00047  *      #undef  _BSD_SIZE_T_
00048  *      #endif
00049  */
00050 #define _BSD_CLOCK_T_     _EFI_CLOCK_T      /* clock() */
00051 #define _BSD_PTRDIFF_T_   _EFI_PTRDIFF_T_   /* ptr1 - ptr2 */
00052 #define _BSD_SIZE_T_      _EFI_SIZE_T_      /* sizeof() */
00053 #define _BSD_SSIZE_T_     INTN              /* byte count or error */
00054 #define _BSD_TIME_T_      _EFI_TIME_T       /* time() */
00055 #define _BSD_VA_LIST_     VA_LIST
00056 #define _BSD_CLOCKID_T_   INT64             /* clockid_t */
00057 #define _BSD_TIMER_T_     INT64             /* timer_t */
00058 #define _BSD_SUSECONDS_T_ INT64             /* suseconds_t */
00059 #define _BSD_USECONDS_T_  UINT64            /* useconds_t */
00060 
00061 /*
00062  * NOTE: rune_t is not covered by ANSI nor other standards, and should not
00063  * be instantiated outside of lib/libc/locale.  use wchar_t.
00064  *
00065  * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
00066  * ``unsigned long'' or ``long''.  Two things are happening here.  It is not
00067  * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,
00068  * it looks like 10646 will be a 31 bit standard.  This means that if your
00069  * ints cannot hold 32 bits, you will be in trouble.  The reason an int was
00070  * chosen over a long is that the is*() and to*() routines take ints (says
00071  * ANSI C), but they use _RUNE_T_ instead of int.  By changing it here, you
00072  * lose a bit of ANSI conformance, but your programs will still work.
00073  *    
00074  * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.  When wchar_t
00075  * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
00076  * defined for ctype.h.
00077  */
00078 #define _BSD_WCHAR_T_     _EFI_WCHAR_T    /* wchar_t */
00079 #define _BSD_WINT_T_      _EFI_WINT_T     /* wint_t */
00080 #define _BSD_RUNE_T_      _EFI_WCHAR_T    /* rune_t */
00081 #define _BSD_WCTRANS_T_         void *          /* wctrans_t */
00082 #define _BSD_WCTYPE_T_    unsigned int    /* wctype_t */
00083 
00084 /*
00085  * mbstate_t is an opaque object to keep conversion state, during multibyte
00086  * stream conversions.  The content must not be referenced by user programs.
00087  */
00088 typedef union {
00089         __int64_t __mbstateL;   /* for alignment */
00090         char __mbstate8[128];
00091 } __mbstate_t;
00092 #define _BSD_MBSTATE_T_         __mbstate_t     /* mbstate_t */
00093 
00094 #endif  /* _ANSI_H_ */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines