当前位置导航:炫浪网>>网络学院>>编程开发>>C++教程>>C++基础入门教程

curses库的学习笔记

    * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
    * *
    * Permission is hereby granted, free of charge, to any person obtaining a *
    * copy of this software and associated documentation files (the *
    * "Software"), to deal in the Software without restriction, including *
    * without limitation the rights to use, copy, modify, merge, publish, *
    * distribute, distribute with modifications, sublicense, and/or sell *
    * copies of the Software, and to permit persons to whom the Software is *
    * furnished to do so, subject to the following conditions: *
    * *
    * The above copyright notice and this permission notice shall be included *
    * in all copies or substantial portions of the Software. *
    * *
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
    * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
    * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
    * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
    * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
    * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
    * *
    * Except as contained in this notice, the name(s) of the above copyright *
    * holders shall not be used in advertising or otherwise to promote the *
    * sale, use or other dealings in this Software without prior written *
    * authorization. *
    ****************************************************************************/

    /****************************************************************************
    * Author: Zeyd M. Ben-Halim  1992,1995 *
    * and: Eric S. Raymond  *
    * and: Thomas E. Dickey 1996-on *
    ****************************************************************************/

    /* $Id: curses.h.in,v 1.136 2003/01/18 23:33:20 tom Exp $ */

    #ifndef __NCURSES_H
    #define __NCURSES_H

    #define CURSES 1

    #define CURSES_H 1

    /* This should be defined for the enhanced functionality to be visible.
    * However, some of the wide-character (enhanced) functionality is missing.
    * So we do not define it (yet).
    #define _XOPEN_CURSES 1
    */

    /* These are defined only in curses.h, and are used for conditional compiles */
    #define NCURSES_VERSION_MAJOR 5
    #define NCURSES_VERSION_MINOR 3
    #define NCURSES_VERSION_PATCH 20030118

    /* This is defined in more than one ncurses header, for identification */
    #undef NCURSES_VERSION
    #define NCURSES_VERSION "5.3"

    #include

    /*
    * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
    * configured using --disable-macros.
    */
    #ifdef NCURSES_NOMACROS
    #define NCURSES_ATTR_T attr_t
    #endif

    #ifndef NCURSES_ATTR_T
    #define NCURSES_ATTR_T int
    #endif

    /*
    * Expands to 'const' if ncurses is configured using --enable-const. Note that
    * doing so makes it incompatible with other implementations of X/Open Curses.
    */
    #undef NCURSES_CONST
    #define NCURSES_CONST /*nothing*/

    /*
    * The internal type used for color values
    */
    #undef NCURSES_COLOR_T
    #define NCURSES_COLOR_T short

    /*
    * The internal type used for window dimensions.
    */
    #undef NCURSES_SIZE_T
    #define NCURSES_SIZE_T short

    /*
    * NCURSES_CH_T is used in building the library, but not used otherwise in
    * this header file, since that would make the normal/wide-character versions
    * of the header incompatible.
    */
    #undef NCURSES_CH_T
    #define NCURSES_CH_T chtype

    typedef unsigned long chtype;

    #include
    #include
    #include  /* we need va_list */
    #ifdef _XOPEN_SOURCE_EXTENDED
    #include  /* we want wchar_t */
    #endif /* _XOPEN_SOURCE_EXTENDED */

    /* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also
    * implement it. If so, we must use the C++ compiler's type to avoid conflict
    * with other interfaces.
    *
    * A further complication is that  may declare 'bool' to be a
    * different type, such as an enum which is not necessarily compatible with
    * C++. If we have , make 'bool' a macro, so users may #undef it.
    * Otherwise, let it remain a typedef to avoid conflicts with other #define's.
    * In either case, make a typedef for NCURSES_BOOL which can be used if needed
    * from either C or C++.
    */

    #undef TRUE
    #define TRUE 1

    #undef FALSE
    #define FALSE 0

    typedef unsigned char NCURSES_BOOL;

    #if (!defined(__cplusplus) || !1) && (!0)

    #if 1
    #include
    #endif

    #undef bool

    #if 1
    #define bool NCURSES_BOOL
    #else
    typedef unsigned char bool;
    #endif

    #endif /* !__cplusplus, etc. */

    #ifdef __cplusplus
    extern "C" {
    #endif

    /*

共4页 首页 上一页 1 2 3 4 下一页 尾页 跳转到
相关内容
赞助商链接