/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* curses.h
*
* XCurses Library
*
* Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
*
*/
#ifndef __M_CURSES_H__
#define __M_CURSES_H__
#define _XOPEN_CURSES
#include <stdio.h>
#include <term.h>
#include <unctrl.h>
#include <wchar.h>
#ifndef EOF
#endif
#ifndef WEOF
#endif
/*
* Not all <wchar.h> are created equal.
*/
#ifndef _MBSTATE_T
#define _MBSTATE_T
typedef int mbstate_t;
#endif
#define OK 0
#if !(defined(__cplusplus) && defined(_BOOL))
typedef short bool;
#endif
#define FALSE 0
typedef unsigned short attr_t;
/*
* These attributes and masks can be applied to an attr_t.
* These are ordered according to the <no_color_video> mask,
* which has been extended to include additional attributes.
*/
/*
* Internal attribute used to support <ceol_standout_glitch>.
*/
/*
* Color names.
*/
#define COLOR_BLACK 0
/*
* A cchar_t details the attributes, color, and a string of wide characters
* composing a complex character (p12). The wide character string consists
* of a spacing character (wcwidth() > 0) and zero or more non-spacing
* characters. Xcurses (p17) states that the minimum number of non-spacing
* characters associated with a spacing character must be at least 5, if a
* limit is imposed.
*/
/***
*** Opaque data type. Keep your grubby mits off.
***/
typedef struct {
} cchar_t;
/***
*** Opaque data type. Keep your grubby mits off.
***/
typedef struct window_t {
} WINDOW;
/***
*** Opaque data type. Keep your grubby mits off.
***/
typedef struct {
struct {
} _unget;
struct {
} _slk;
} SCREEN;
#ifndef __M_UNCTRL_H__
/*
* Backwards compatiblity with historical Curses applications.
*/
typedef unsigned long chtype;
#endif
/*
* These attributes and masks can be applied to a chtype.
* They are order according to the <no_color_video> mask.
*/
/*
* Colour atttribute support for chtype.
*/
/*
* Characters constants used with a chtype.
* Mapping defined in Xcurses Section 6.2.12 (p260).
*/
#ifndef _XOPEN_SOURCE
/*
* MKS Extensions for double width box characters.
*/
#endif /* _XOPEN_SOURCE */
/*
* Wide characters constants for a cchar_t.
*/
extern const cchar_t __WACS_VLINE;
extern const cchar_t __WACS_HLINE;
extern const cchar_t __WACS_ULCORNER;
extern const cchar_t __WACS_URCORNER;
extern const cchar_t __WACS_LLCORNER;
extern const cchar_t __WACS_LRCORNER;
extern const cchar_t __WACS_RTEE;
extern const cchar_t __WACS_LTEE;
extern const cchar_t __WACS_BTEE;
extern const cchar_t __WACS_TTEE;
extern const cchar_t __WACS_PLUS;
extern const cchar_t __WACS_DIAMOND;
extern const cchar_t __WACS_CKBOARD;
extern const cchar_t __WACS_DEGREE;
extern const cchar_t __WACS_PLMINUS;
extern const cchar_t __WACS_BULLET;
extern const cchar_t __WACS_LARROW;
extern const cchar_t __WACS_RARROW;
extern const cchar_t __WACS_DARROW;
extern const cchar_t __WACS_UARROW;
extern const cchar_t __WACS_BOARD;
extern const cchar_t __WACS_LANTERN;
extern const cchar_t __WACS_BLOCK;
#ifndef _XOPEN_SOURCE
/*
* MKS Extensions for double width box characters.
*/
#endif /* _XOPEN_SOURCE */
/*
* Internal functions.
*/
extern int __m_outc(int);
extern int __m_tty_wc(int, wchar_t *);
/*
* Internal macros.
*/
/*
* Global Window Macros
*/
/*
* Global variables
*/
extern int COLORS, COLOR_PAIRS;
#ifndef _XOPEN_SOURCE
/*
* Non-portable extension functions.
*/
#endif /* _XOPEN_SOURCE */
#ifdef M_CURSES_TRACE
/*
* Curses trace facility is only available with a version of
* the library that was compiled with -DM_CURSES_TRACE.
*/
extern void traceoff(void);
extern void traceon(void);
#endif /* M_CURSES_TRACE */
extern int add_wchnstr(const cchar_t *, int);
extern int add_wchstr(const cchar_t *);
extern int mvaddchnstr(int, int, const chtype *, int);
extern int mvaddchstr(int, int, const chtype *);
extern int mvadd_wchnstr(int, int, const cchar_t *, int);
extern int mvadd_wchstr(int, int, const cchar_t *);
extern int addnstr(const char *, int);
extern int addstr(const char *);
extern int mvaddnstr(int, int, const char *, int);
extern int mvaddstr(int, int, const char *);
extern int mvaddnwstr(int, int, const wchar_t *, int);
extern int mvwaddnstr(WINDOW *, int, int, const char *, int);
extern int attroff(int);
extern int attron(int);
extern int attrset(int);
extern int color_set(short, void *);
extern int wcolor_set(WINDOW *, short, void *);
extern chtype COLOR_PAIR(short);
extern short PAIR_NUMBER(chtype);
extern int baudrate(void);
extern int delay_output(int);
extern int napms(int);
extern int beep(void);
extern int flash(void);
extern int border(
extern int border_set(
extern int wborder(
WINDOW *,
extern int wborder_set(
WINDOW *,
extern bool can_change_color(void);
extern int color_content(short, short *, short *, short *);
extern bool has_colors(void);
extern int init_color(short, short, short, short);
extern int init_pair(short, short, short);
extern int pair_content(short, short *, short *);
extern int start_color(void);
extern int cbreak(void);
extern int halfdelay(int);
extern int nocbreak(void);
extern int raw(void);
extern int noraw(void);
extern int clear(void);
extern int clrtobot(void);
extern int clrtoeol(void);
extern int erase(void);
extern int curs_set(int);
extern int def_prog_mode(void);
extern int def_shell_mode(void);
extern int reset_prog_mode(void);
extern int reset_shell_mode(void);
extern int delch(void);
extern int mvdelch(int, int);
extern int deleteln(void);
extern int insdelln(int);
extern int insertln(void);
extern int doupdate(void);
extern int refresh(void);
extern int wnoutrefresh(WINDOW *);
extern int echo(void);
extern int noecho(void);
extern int echo_wchar(const cchar_t *);
extern int endwin(void);
extern void filter(void);
extern bool isendwin(void);
extern int ripoffline(int, int (*)(WINDOW *, int));
extern int typeahead(int);
extern void use_env(bool);
extern int erasechar(void);
extern int erasewchar(wchar_t *);
extern int killchar(void);
extern int flushinp(void);
extern int getch(void);
extern int mvgetch(int, int);
extern int getnstr(char *, int);
extern int getstr(char *);
extern int mvgetnstr(int, int, char *, int);
extern int mvgetstr(int, int, char *);
extern int mvwgetnstr(WINDOW *, int, int, char *, int);
extern int mvgetn_wstr(int, int, wint_t *, int);
extern int mvget_wstr(int, int, wint_t *);
extern bool has_ic(void);
extern bool has_il(void);
extern int mvhline_set(int, int, const cchar_t *, int);
extern int mvvline_set(int, int, const cchar_t *, int);
extern int in_wchnstr(cchar_t *, int);
extern int mvinchnstr(int, int, chtype *, int);
extern int mvin_wchnstr(int, int, cchar_t *, int);
extern int mvin_wchstr(int, int, cchar_t *);
extern int innstr(char *, int);
extern int instr(char *);
extern int mvinnstr(int, int, char *, int);
extern int mvinstr(int, int, char *);
extern int insnstr(const char *, int);
extern int insstr(const char *);
extern int mvinsnstr(int, int, const char *, int);
extern int mvinsstr(int, int, const char *);
extern int mvins_nwstr(int, int, const wchar_t *, int);
extern int mvins_wstr(int, int, const wchar_t *);
extern int mvwinsnstr(WINDOW *, int, int, const char *, int);
extern bool is_linetouched(WINDOW *, int);
extern bool is_wintouched(WINDOW *);
extern int untouchwin(WINDOW *);
extern const char *keyname(int);
extern char *longname(void);
extern char *termname(void);
extern int move(int, int);
extern int mvcur(int, int, int, int);
extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
extern int nl(void);
extern int nonl(void);
extern int printw(const char *, ...);
extern int mvprintw(int, int, const char *, ...);
#if defined(sun)
#else
#endif
extern void qiflush(void);
extern void noqiflush(void);
extern int resetty(void);
extern int savetty(void);
extern int scanw(const char *, ...);
extern int mvscanw(int, int, const char *, ...);
#if defined(sun)
#else
#endif
extern int scr_dump(const char *);
extern int scr_init(const char *);
extern int scr_restore(const char *);
extern int scr_set(const char *);
extern int scrl(int);
extern int setscrreg(int, int);
extern int wsetscrreg(WINDOW *, int, int);
extern int slk_attroff(const chtype);
extern int slk_attron(const chtype);
extern int slk_attrset(const chtype);
extern int slk_attr_off(const attr_t, void *);
extern int slk_attr_on(const attr_t, void *);
extern int slk_attr_set(const attr_t, short, void *);
extern int slk_color_set(short);
extern int slk_clear(void);
extern int slk_init(int);
extern char *slk_label(int);
extern int slk_noutrefresh(void);
extern int slk_refresh(void);
extern int slk_restore(void);
extern int slk_set(int, const char *, int);
extern int slk_touch(void);
extern int standend(void);
extern int standout(void);
extern attr_t term_attrs(void);
extern void timeout(int);
extern int ungetch(int);
extern void wcursyncup(WINDOW *);
/*
* These macros are not suitable for strict XPG4 conformance,
* because some of them evaluate their arguments more than once.
* However, they can improve speed and size of an application,
* provided an application is careful about not using side effects
*/
#ifndef _XOPEN_SOURCE_EXTENDED
&& initialize_color != (char *) 0)
|| parm_ich != (char *) 0) \
&& (delete_character != (char *) 0 \
|| parm_dch != (char *) 0)) \
|| (enter_insert_mode != (char *) 0 \
&& exit_insert_mode))
|| parm_insert_line != (char *) 0) \
&& (delete_line != (char *) 0 \
|| parm_delete_line !=(char*)0)) \
|| change_scroll_region != (char *) 0)
(void *)0), 1)
#ifndef _XOPEN_SOURCE
/*
* Obsolete functions names.
*/
#endif /* _XOPEN_SOURCE */
#endif /* _XOPEN_SOURCE_EXTENDED */
/*
* Special Keys
*
* Keypad layout
* A1 up A3
* left B2 right
* C1 down C3
*
* Chossing negative values for KEY_ constants means that they can
* be safely returned in either an int or long type.
*/
#endif /* __M_CURSES_H__ */