Date: Fri, 20 Aug 1999 04:58:17 -0400 (EDT) From: mrami@gbtb.com To: FreeBSD-gnats-submit@freebsd.org Subject: misc/13266: Removing ncurses namespace pollution w/ C++ Message-ID: <199908200858.EAA43964@gbtb.com>
next in thread | raw e-mail | index | archive | help
>Number: 13266 >Category: misc >Synopsis: Removal of #defines and addition of constness for C++ in ncurses.h and nterm.h headers >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Aug 20 02:10:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Marc Ramirez >Release: FreeBSD 3.2-RELEASE i386 >Organization: Great Big Throbbing Brains >Environment: Stock 3.2-RELEASE >Description: When 'ncurses.h' is included in a C++ program, it includes a bunch of terminal capability #defines from nterm.h, some of which clobber various methods in the STL. It's especially bad because all of the capabilities are defined in lower case, and they're in plain English, easily confusable with other meanings (e.g. erase!?!?) >How-To-Repeat: Try to compile the following program: #include <ncurses.h> #include <iostream> #include <vector> int main(void) { vector<int> v; v.push_back(1); cout << v[0] << endl; return 0; } >Fix: I tried to remove as many #defines as reasonable, using consts and inline functions as replacements (esp. for the curses "pseudo-functions" which are no longer pseudo). Also the prototypes have been changed to have an idea of what should be const and what shouldn't be, which is good for C++ programmers. This can't be done in a backwards-compatible fashion; in particular, the capabilities and the ACS map are defined as parameterless macros, but are not manifest constants, so they had to be replaced by inline functions. What was ACS_HLINE should be, in C++, ACS_HLINE(). This is okay for the ACS map, but it poses a problem for the capabilities, where you find code like 'if (keypad_xmit)', which is now always true with it being a function. To solve this, I ifdef'd all my changes. The new changes are surrounded by the moral equivalent of #if defined(__cplusplus) && !defined(CURSES_COMPAT) so that they are on by default with C++. With CURSES_COMPAT you get the full old behavior, #defines and all. Unfortunately, I'm not wise (or wizened) enough to be familiar with the compatibility issues, so I don't know if my changes are better on or off by default. Although, I can't imagine many C++ programmers have been using ncurses, since even a simple program like: #include <ncurses.h> int main(void) { const char *fred="Hello, World!"; initscr(); mvprintw(3,3,fred); getch(); endwin(); return 0; } complains: test.cc: In function `int main()': test.cc:7: warning: converting `const char *' to `char *' is a contravariance violation test.cc:7: warning: passing `const char *' as argument 3 of `mvprintw(int, int, char * ...)' discards const Here are the patches for libmytinfo and libncurses. I guess this is more of a request for review. I've tested my changes on some fairly curses-intensive programs, but I haven't done a make world or anything (can't spare any machines right now). libmytinfo removes mktermhead.c, term.head, and term.tail adds mkterm_h.c term.part2, term.part4 I removed the diff entries for the removed files, and also for term.h (it can be made with 'make update_term_h' ------------------------ libmytinfo -------------------------- Common subdirectories: /usr/src/lib/libmytinfo/EXAMPLES and ./EXAMPLES diff -N /usr/src/lib/libmytinfo/Makefile ./Makefile 19,20c19,20 < update_term_h: ${.CURDIR}/term.head ${.CURDIR}/term.tail < cat ${.CURDIR}/term.head ${.CURDIR}/term.tail > ${.CURDIR}/term.h --- > update_term_h: mkterm_h ${.CURDIR}/cap_list ${.CURDIR}/term.part2 ${.CURDIR}/term.part4 > ./mkterm_h -n ${CAPS} -c ${.CURDIR}/cap_list -2 ${.CURDIR}/term.part2 -4 ${.CURDIR}/term.part4 -o ${.CURDIR}/term.h 54,56d53 < ${.CURDIR}/term.head: mktermhead ${.CURDIR}/cap_list < ./mktermhead -n $(CAPS) ${.CURDIR}/cap_list > ${.CURDIR}/term.head < 60,61c57,58 < mktermhead: mktermhead.c readcaps.o < $(CC) -static $(CFLAGS) $(LDFLAGS) -o mktermhead ${.CURDIR}/mktermhead.c readcaps.o --- > mkterm_h: mkterm_h.c readcaps.o > $(CC) -static $(CFLAGS) $(LDFLAGS) -o mkterm_h ${.CURDIR}/mkterm_h.c readcaps.o diff -N /usr/src/lib/libmytinfo/addstr.c ./addstr.c 39c39 < register char *s; { --- > register const char *s; { 41a42 > char *news; 72c73 < s = strcpy(p->buf + p->len, s); --- > news = strcpy(p->buf + p->len, s); 74c75 < return s; --- > return news; diff -N /usr/src/lib/libmytinfo/defs.h ./defs.h 141c141 < char *_addstr(char *); --- > char *_addstr(const char *); > diff -N /usr/src/lib/libmytinfo/defs.h ./defs.h > 141c141 > < char *_addstr(char *); > --- > > char *_addstr(const char *); diff -N /usr/src/lib/libmytinfo/mkterm_h.c ./mkterm_h.c 0a1,320 > /* > * mkterm_h.c > * > * By Ross Ridge > * Public Domain > * 92/06/04 11:38:57 > * > * generates term.h > * > */ > > /* > * 99/08/16 Marc Ramirez > * > * In trying to make mytinfo more c++-friendly, I had to change the > * order of a lot of declarations, so now the header is split into > * four parts: > * > * Part 1: _USE defines and numbers of different types of caps; > * generated > * > * Part 2: definition of struct _terminal and declaration of cur_term > * and _term_buf; included from term.part2 > * > * Part 3: definitions of the cap macros; generated > * > * Part 4: function prototypes and various miscellany; included from > * term.part4 > * */ > > > #define NOTLIB > #include <unistd.h> > #include "defs.h" > > const char SCCSid[] = "@(#) mytinfo mkterm_h.c 3.3 92/06/04 public domain, By Ross Ridge"; > > #define DEFAULT_CAPS 1000 > > > extern char *optarg; > extern int optind; > > char *pname; > > void usage(void) { > fprintf(stderr, "usage: %s -2 <part 2 file> -4 <part 4 file> [-n <# caps>] [-c <cap file>] [-o <out file>]\n", pname); > exit(1); > } > > void copyfile(FILE *i, FILE *o) { > #define CFBUFSIZ (8*1024) > static char buf[CFBUFSIZ]; > int cnt,ocnt; > > for (;;) { > cnt=fread(buf,1,CFBUFSIZ,i); > if (cnt) { > ocnt=fwrite(buf,1,cnt,o); > if (ocnt<cnt) { > fprintf(stderr,"%s: error writing output file: %s\n",pname,strerror(errno)); > exit(1); > } > } > if (cnt<CFBUFSIZ) { > if (feof(i)) { > return; > } else { > fprintf(stderr,"%s: error reading input file: %s\n",pname,strerror(errno)); > exit(1); > } > } > } > > } > > int > main(argc, argv) > int argc; > char **argv; { > FILE *f, *part2=NULL, *part4=NULL, *outf; > int caps = DEFAULT_CAPS; > int n; > register int i; > int nb, ns, nn; > struct caplist *list; > char got_two=0, got_four=0; > char ch; > > pname=argv[0]; > f = stdin; > outf = stdout; > > while ((ch = getopt(argc, argv, "n:2:4:c:o:")) != -1) > switch (ch) { > case 'n': > caps=atoi(optarg); > break; > case '2': > if ( (part2=fopen(optarg,"r")) == NULL) { > fprintf(stderr,"%s: error opening %s: %s\n\n",argv[0],optarg,strerror(errno)); > exit(1); > } > got_two=1; > break; > case '4': > if ( (part4=fopen(optarg,"r")) == NULL) { > fprintf(stderr,"%s: error opening %s: %s\n\n",argv[0],optarg,strerror(errno)); > exit(1); > } > got_four=1; > break; > case 'c': > if ( (f=fopen(optarg,"r")) == NULL) { > fprintf(stderr,"%s: error opening %s: %s\n\n",argv[0],optarg,strerror(errno)); > exit(1); > } > break; > case 'o': > if ( (outf=fopen(optarg,"w")) == NULL) { > fprintf(stderr,"%s: error opening %s: %s\n\n",argv[0],optarg,strerror(errno)); > exit(1); > } > break; > case '?': > default: > usage(); > } > > argc-=optind; > argv+=optind; > > if (argc>0) { > fprintf(stderr,"%s: extra parameters specified on command line\n",pname); > usage(); > } > if (!got_two) { > fprintf(stderr,"%s: 'part2' file not specified\n",pname); > usage(); > } > if (!got_four) { > fprintf(stderr,"%s: 'part4' file not specified\n",pname); > usage(); > } > > > list = (struct caplist *) malloc(caps * sizeof(struct caplist)); > if (list == NULL) { > fprintf(stderr, "%s: malloc failed.\n", argv[0]); > return 1; > } > > n = readcaps(f, list, caps); > if (n > caps) { > fprintf(stderr, "%s: too many caps, use -n.\n", argv[0]); > return 1; > } > switch(n) { > case 0: > fprintf(stderr, "%s: no caps in file.\n", argv[0]); > return 1; > case -1: > fprintf(stderr, "%s: bad caps line.\n", argv[0]); > return 1; > case -2: > fprintf(stderr, "%s: unexpected EOF.\n", argv[0]); > return 1; > } > > nb=nn=ns=0; > for (i = 0; i < n; i++) { > switch (list[i].type) { > case '!': > nb++; > break; > case '#': > nn++; > break; > case '$': > ns++; > break; > } > } > > fputs("/*\n",outf); > fputs(" * term.h \n",outf); > fputs(" *\n",outf); > fputs(" * This file was generated automatically.\n",outf); > fputs(" *\n",outf); > fputs(" */\n",outf); > fputc('\n',outf); > fputs("#ifndef _TERM_H_\n",outf); > fputs("#define _TERM_H_\n",outf); > fputc('\n',outf); > > fputs("#ifndef OVERRIDE\n",outf); > fputs("#undef _USE_SGTTY\n",outf); > #ifdef USE_SGTTY > fputs("#define _USE_SGTTY\n",outf); > #endif > fputs("#undef _USE_TERMIO\n",outf); > #ifdef USE_TERMIO > fputs("#define _USE_TERMIO\n",outf); > #endif > fputs("#undef _USE_TERMIOS\n",outf); > #ifdef USE_TERMIOS > fputs("#define _USE_TERMIOS\n",outf); > #endif > fputs("#undef _USE_SMALLMEM\n",outf); > #ifdef USE_SMALLMEM > fputs("#define _USE_SMALLMEM\n",outf); > #endif > fputs("#undef _USE_PROTOTYPES\n",outf); > #ifdef USE_PROTOTYPES > fputs("#define _USE_PROTOTYPES\n",outf); > #endif > fputs("#undef _USE_WINSZ\n",outf); > #ifdef USE_WINSZ > fputs("#define _USE_WINSZ\n",outf); > #endif > fputs("#undef _USE_TERMINFO\n",outf); > #ifdef USE_TERMINFO > fputs("#define _USE_TERMINFO\n",outf); > #endif > fputs("#undef _USE_TERMCAP\n",outf); > #ifdef USE_TERMCAP > fputs("#define _USE_TERMCAP\n",outf); > #endif > fputs("#undef _MAX_CHUNK\n",outf); > fprintf(outf,"#define _MAX_CHUNK %d\n", MAX_CHUNK); > fputs("#endif /* OVERRIDE */\n",outf); > fputc('\n',outf); > > > fprintf(outf,"#if ( defined(__cplusplus) && !defined(CURSES_COMPAT) )\n\n"); > fprintf (outf,"const int NUM_OF_BOOLS\t=%d;\n", nb); > fprintf (outf,"const int NUM_OF_NUMS\t=%d;\n", nn); > fprintf (outf,"const int NUM_OF_STRS\t=%d;\n", ns); > > fprintf (outf,"\n#else\n\n"); > > fprintf (outf,"#define NUM_OF_BOOLS\t%d\n", nb); > fprintf (outf,"#define NUM_OF_NUMS\t%d\n", nn); > fprintf (outf,"#define NUM_OF_STRS\t%d\n", ns); > > fprintf(outf,"\n#endif /* __cplusplus || !CURSES_COMPAT */\n"); > > fputc('\n',outf); > > copyfile(part2,outf); > > fprintf(outf,"#if ( defined(__cplusplus) && !defined(CURSES_COMPAT) )\n\n"); > nb=nn=ns=0; > for (i = 0; i < n; i++) { > if (list[i].type == '!') { > fprintf(outf, > "inline bool\n\t%-*s(void) { return _CUR_TERM.bools[%d]; }\n", > MAX_VARNAME, list[i].var, nb++); > } > } > > for (i = 0; i < n; i++) { > if (list[i].type == '#') { > fprintf(outf, > "inline int\n\t%-*s(void) { return _CUR_TERM.nums[%d]; }\n", > MAX_VARNAME, list[i].var, nn++); > } > } > > for (i = 0; i < n; i++) { > if (list[i].type == '$') { > fprintf(outf, > "inline const char*\n\t%-*s(void) { return _CUR_TERM.strs[%d]; }\n", > MAX_VARNAME, list[i].var, ns++); > } > } > > fputc('\n',outf); > > fprintf (outf,"\n#else\n\n"); > > nb=nn=ns=0; > for (i = 0; i < n; i++) { > if (list[i].type == '!') { > fprintf(outf,"#define %-*s (_CUR_TERM.bools[%d])\n", > MAX_VARNAME, list[i].var, nb++); > } > } > > for (i = 0; i < n; i++) { > if (list[i].type == '#') { > fprintf(outf,"#define %-*s (_CUR_TERM.nums[%d])\n", > MAX_VARNAME, list[i].var, nn++); > } > } > > for (i = 0; i < n; i++) { > if (list[i].type == '$') { > fprintf(outf,"#define %-*s (_CUR_TERM.strs[%d])\n", > MAX_VARNAME, list[i].var, ns++); > } > } > > fputc('\n',outf); > > fprintf(outf,"\n#endif /* __cplusplus || !CURSES_COMPAT */\n"); > > fputc('\n',outf); > > copyfile(part4,outf); > > fclose(part2); > fclose(part4); > if (f!=stdin) > fclose(f); > if (outf!=stdout) > fclose(outf); > > return 0; > } diff -N /usr/src/lib/libmytinfo/term.part2 ./term.part2 0a1,108 > /* > * originally from: > * > * 92/02/01 07:30:28 > * @(#) mytinfo term.tail 3.2 92/02/01 public domain, By Ross Ridge > * > * modified by Marc Ramirez on 99/08/16 now in term.part2 > * > */ > > #if defined(_USE_TERMIO) || defined(_USE_TERMIOS) > #ifndef ICANON > #ifdef _USE_TERMIO > #include <termio.h> > #else > #include <termios.h> > #endif > #endif > #if defined(_USE_WINSZ) && defined(__FreeBSD__) > #include <sys/ioctl.h> > #endif > #if defined(_USE_WINSZ) && defined(xenix) > #include <sys/stream.h> > #include <sys/ptem.h> > #endif > #endif > > #ifdef _USE_SGTTY > #ifndef CBREAK > #include <sgtty.h> > #endif > #endif > > typedef struct _terminal { > int fd; > #ifdef _USE_SMALLMEM > #ifdef _USE_TERMIOS > speed_t baudrate; > #else > unsigned short baudrate; > #endif > unsigned pad:1, xon:1, termcap:1; > #else > int pad; > int xon; > int termcap; > #ifdef _USE_TERMIOS > speed_t baudrate; > #else > long baudrate; > #endif > #endif > char padch; > short true_lines, true_columns; > struct strbuf { > struct strbuf *next; > #ifdef _USE_SMALLMEM > short len; > #else > int len; > #endif > char buf[_MAX_CHUNK]; > } *strbuf; > char *name, *name_long, *name_all; > #ifdef _USE_SGTTY > struct sgtty_str { > struct sgttyb v6; > #ifdef TIOCGETC > struct tchars v7; > #endif > #ifdef TIOCLGET > int bsd; > #endif > #ifdef TIOCGLTC > struct ltchars bsd_new; > #endif > } prog_mode, shell_mode; > #else /* _USE_SGTTY */ > #ifdef _USE_TERMIOS > struct termios prog_mode, shell_mode; > #else > #ifdef _USE_TERMIO > struct termio prog_mode, shell_mode; > #endif > #endif > #endif /* else _USE_SGTTY */ > #ifdef _USE_WINSZ > #ifdef TIOCGWINSZ > struct winsize prog_winsz, shell_winsz; > #endif > #endif > char bools[NUM_OF_BOOLS]; > short nums[NUM_OF_NUMS]; > char *strs[NUM_OF_STRS]; > } TERMINAL; > > extern TERMINAL *cur_term; > extern TERMINAL _term_buf; > > #ifndef _CUR_TERM > #ifdef SINGLE > #define _CUR_TERM _term_buf > #else > #define _CUR_TERM (*cur_term) > #endif > #endif > > diff -N /usr/src/lib/libmytinfo/term.part4 ./term.part4 0a1,62 > /* > * 92/02/01 07:30:28 > * @(#) mytinfo term.tail 3.2 92/02/01 public domain, By Ross Ridge > * > * modified by Marc Ramirez on 99/08/16 now in term.part4 > */ > > #ifndef __P > #if defined(_USE_PROTOTYPES) && (defined(__STDC__) || defined(__cplusplus)) > #define __P(protos) protos /* full-blown ANSI C */ > #else > #define __P(protos) () /* traditional C preprocessor */ > #endif > #endif > > #ifdef __cplusplus > extern "C" { > #endif > > extern char *tparm __P((const char *, ...)); > extern int setupterm __P((char *, int, int *)), set_curterm __P((TERMINAL *)); > extern int del_curterm __P((TERMINAL *)), tputs __P((const char *, int, int (*)(int))); > extern int putp __P((const char *)); > extern int tigetflag __P((char *)), tigetnum __P((char *)); > extern char *tigetstr __P((char *)); > extern int def_prog_mode __P((void)), def_shell_mode __P((void)); > extern int reset_prog_mode __P((void)), reset_shell_mode __P((void)); > > #ifdef __cplusplus > } > #endif > > > extern char *boolnames[], *boolcodes[], *boolfnames[]; > extern char *numnames[], *numcodes[], *numfnames[]; > extern char *strnames[], *strcodes[], *strfnames[]; > > #if ( defined(__cplusplus) && !defined(CURSES_COMPAT) ) > > #ifndef OKERR_DEFINED > #define OKERR_DEFINED > const int OK=0; > const int ERR=-1; > #endif > > #else > > #ifndef OK > #undef ERR > #define OK (0) > #define ERR (-1) > #endif > > #endif /* ( defined(__cplusplus) && !defined(CURSES_COMPAT) ) */ > > /* Compatibility */ > #define Filedes fd > #define Ottyb shell_mode > #define Nttyb prog_mode > #define TTY struct termios > > #endif /* _TERM_H_ */ diff -N /usr/src/lib/libmytinfo/tputs.c ./tputs.c 208c208 < char *str; { --- > const char *str; { ------------------------- libncurses --------------------------- diff /usr/src/lib/libncurses/curses.h ./curses.h 24a25,28 > #ifdef __cplusplus > #include <unistd.h> /* for usleep */ > #endif > 29c33 < typedef unsigned long chtype; --- > typedef long chtype; 44c48,52 < #define bool char --- > #if !defined(__cplusplus) > > typedef char bool; > > #endif 46a55,56 > #if !defined(__cplusplus) || defined(CURSES_COMPAT) > 62a73,91 > #else /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > const chtype A_ATTRIBUTES (0xffffff00UL); > const chtype A_NORMAL (0x00000000UL); > const chtype A_STANDOUT (0x00010000UL); > const chtype A_UNDERLINE (0x00020000UL); > const chtype A_REVERSE (0x00040000UL); > const chtype A_BLINK (0x00080000UL); > const chtype A_DIM (0x00100000UL); > const chtype A_BOLD (0x00200000UL); > const chtype A_ALTCHARSET (0x00400000UL); > const chtype A_INVIS (0x00800000UL); > const chtype A_PROTECT (0x01000000UL); > const chtype A_CHARTEXT (0x000000ffUL); > const chtype A_COLOR (0x0000ff00UL); > inline chtype COLOR_PAIR(chtype n) { return chtype(n << 8); } > inline int PAIR_NUMBER(chtype a) { return ((a & A_COLOR) >> 8); } > > #endif /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ 68,75c97,104 < #define COLOR_BLACK 0 < #define COLOR_RED 1 < #define COLOR_GREEN 2 < #define COLOR_YELLOW 3 < #define COLOR_BLUE 4 < #define COLOR_MAGENTA 5 < #define COLOR_CYAN 6 < #define COLOR_WHITE 7 --- > enum {COLOR_BLACK =0, > COLOR_RED =1, > COLOR_GREEN =2, > COLOR_YELLOW =3, > COLOR_BLUE =4, > COLOR_MAGENTA=5, > COLOR_CYAN =6, > COLOR_WHITE =7}; 80a110 > #if !defined(__cplusplus) || defined(CURSES_COMPAT) 107a138,169 > #else /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > inline chtype ACS_ULCORNER(void) { return acs_map['l']; } > inline chtype ACS_LLCORNER(void) { return acs_map['m']; } > inline chtype ACS_URCORNER(void) { return acs_map['k']; } > inline chtype ACS_LRCORNER(void) { return acs_map['j']; } > inline chtype ACS_RTEE(void) { return acs_map['u']; } > inline chtype ACS_LTEE(void) { return acs_map['t']; } > inline chtype ACS_BTEE(void) { return acs_map['v']; } > inline chtype ACS_TTEE(void) { return acs_map['w']; } > inline chtype ACS_HLINE(void) { return acs_map['q']; } > inline chtype ACS_VLINE(void) { return acs_map['x']; } > inline chtype ACS_PLUS(void) { return acs_map['n']; } > inline chtype ACS_S1(void) { return acs_map['o']; } /* scan line 1 */ > inline chtype ACS_S9(void) { return acs_map['s']; } /* scan line 9 */ > inline chtype ACS_DIAMOND(void) { return acs_map['`']; } /* diamond */ > inline chtype ACS_CKBOARD(void) { return acs_map['a']; } /* checker board =&(stipple) */ > inline chtype ACS_DEGREE(void) { return acs_map['f']; } /* degree symbol */ > inline chtype ACS_PLMINUS(void) { return acs_map['g']; } /* plus/minus */ > inline chtype ACS_BULLET(void) { return acs_map['~']; } /* bullet */ > inline chtype ACS_LARROW(void) { return acs_map[',']; } /* arrow pointing left */ > inline chtype ACS_RARROW(void) { return acs_map['+']; } /* arrow pointing right */ > inline chtype ACS_DARROW(void) { return acs_map['.']; } /* arrow pointing down */ > inline chtype ACS_UARROW(void) { return acs_map['-']; } /* arrow pointing up */ > inline chtype ACS_BOARD(void) { return acs_map['h']; } /* board of squares */ > inline chtype ACS_LANTERN(void) { return acs_map['I']; } /* lantern symbol */ > inline chtype ACS_BLOCK(void) { return acs_map['0']; } /* solid square block */ > > #endif /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > #if !defined(__cplusplus) || defined(CURSES_COMPAT) > 112d173 < 115a177,191 > > #else /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > const bool TRUE=true; > const bool FALSE=false; > #ifndef OKERR_DEFINED > #define OKERR_DEFINED > const int ERR=-1; > const int OK=0; > #endif > > #endif /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > #if !defined(__cplusplus) || defined(CURSES_COMPAT) > 122d197 < 124a200,211 > #else /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > const int _SUBWIN =0x01; > const int _ENDLINE =0x02; > const int _FULLWIN =0x04; > const int _SCROLLWIN =0x08; > const int _ISPAD =0x10; > const int _HASMOVED =0x20; > const int _NOCHANGE =-1; > > #endif /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > 158c245 < WINDOW *_parent; /* parent if a sub-window */ --- > const WINDOW *_parent; /* parent if a sub-window */ 182c269 < extern void _tracef(char *, ...); --- > extern void _tracef(const char *, ...); 187a275,276 > #if !defined(__cplusplus) || defined(CURSES_COMPAT) > 192a282,290 > #else /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > const int TRACE_DISABLE =0x00; /* turn off tracing */ > const int TRACE_ORDINARY=0x01; /* ordinary trace mode */ > const int TRACE_CHARPUT =0x02; /* also trace all character outputs */ > const int TRACE_MAXIMUM =0x0f; /* maximum trace level */ > > #endif /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > 194a293,296 > extern int setupterm(char *,int,int *); > extern int putp(const char *); > > 199c301 < extern int copywin(WINDOW *,WINDOW *,int,int,int,int,int,int,int); --- > extern int copywin(const WINDOW *, const WINDOW *,int,int,int,int,int,int,int); 204c306 < extern WINDOW *derwin(WINDOW *,int,int,int,int); --- > extern WINDOW *derwin(const WINDOW *,int,int,int,int); 206c308 < extern WINDOW *dupwin(WINDOW *); --- > extern WINDOW *dupwin(const WINDOW *); 214,216c316,318 < extern int intrflush(WINDOW *,bool); < extern int is_linetouched(WINDOW *,int); < extern int is_wintouched(WINDOW *); --- > extern int intrflush(const WINDOW *,bool); > extern int is_linetouched(const WINDOW *,int); > extern int is_wintouched(const WINDOW *); 223c325 < extern char *longname(void); --- > extern const char *longname(void); 226,227c328,329 < extern int mvprintw(int,int,char *,...); < extern int mvscanw(int,int,char *,...); --- > extern int mvprintw(int,int,const char *,...); > extern int mvscanw(int,int,const char *,...); 229,230c331,332 < extern int mvwprintw(WINDOW *,int,int,char *,...); < extern int mvwscanw(WINDOW *,int,int,char *,...); --- > extern int mvwprintw(WINDOW *,int,int,const char *,...); > extern int mvwscanw(WINDOW *,int,int,const char *,...); 241,242c343,344 < extern int overlay(WINDOW *,WINDOW *); < extern int overwrite(WINDOW *,WINDOW *); --- > extern int overlay(const WINDOW *,const WINDOW *); > extern int overwrite(const WINDOW *, const WINDOW *); 245,246c347 < extern int printw(char *,...); < extern int putp(char *); --- > extern int printw(const char *,...); 253c354 < extern int scanw(char *,...); --- > extern int scanw(const char *,...); 256,257c357 < extern int setupterm(char *,int,int *); < extern WINDOW *subwin(WINDOW *,int,int,int,int); --- > extern WINDOW *subwin(const WINDOW *,int,int,int,int); 265,266c365,366 < extern int vwscanw(WINDOW *,char *,va_list); < extern int vwprintw(WINDOW *,char *,va_list); --- > extern int vwscanw(WINDOW *, const char *,va_list); > extern int vwprintw(WINDOW *,const char *,va_list); 268,269c368,369 < extern int waddchnstr(WINDOW *,chtype *,int); < extern int waddnstr(WINDOW *,char *,int); --- > extern int waddchnstr(WINDOW *,const chtype *,int); > extern int waddnstr(WINDOW *,const char *,int); 273c373 < extern int wborder(WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); --- > extern int wborder(const WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); 275,277c375,377 < extern int wclrtobot(WINDOW *); < extern int wclrtoeol(WINDOW *); < extern int wdelch(WINDOW *); --- > extern int wclrtobot(const WINDOW *); > extern int wclrtoeol(const WINDOW *); > extern int wdelch(const WINDOW *); 281,284c381,384 < extern int wgetnstr(WINDOW *,char *,int maxlen); < extern int whline(WINDOW *,chtype,int); < extern int winnstr(WINDOW *, char *, int); < extern int winsch(WINDOW *,chtype); --- > extern int wgetnstr(WINDOW *, char *,int maxlen); > extern int whline(const WINDOW *,chtype,int); > extern int winnstr(const WINDOW *, char *, int); > extern int winsch(const WINDOW *,chtype); 286c386 < extern int winsnstr(WINDOW *,char *,int); --- > extern int winsnstr(const WINDOW *,const char *,int); 289c389 < extern int wprintw(WINDOW *,char *,...); --- > extern int wprintw(WINDOW *,const char *,...); 292c392 < extern int wscanw(WINDOW *,char *,...); --- > extern int wscanw(WINDOW *,const char *,...); 296,297c396,397 < extern int wtouchln(WINDOW *,int,int,int); < extern int wvline(WINDOW *,chtype,int); --- > extern int wtouchln(const WINDOW *,int,int,int); > extern int wvline(const WINDOW *,chtype,int); 300c400 < extern int color_content(short,short *,short *, short *); --- > extern int color_content(short, short*, short*, short*); 304c404 < extern int pair_content(short,short*,short*); --- > extern int pair_content(short, short*, short*); 308c408 < extern int slk_set(int,char *,int); --- > extern int slk_set(int,const char *,int); 322a423,425 > > #if !defined(__cplusplus) || defined(CURSES_COMPAT) > 450a554,798 > > #else /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > > inline int wgetstr(WINDOW *w, char *s) { return wgetnstr(w, s, -1); } > > inline int napms(const int x) { return usleep(1000*x); } > inline int setterm(char *term) { return setupterm(term, 1, (int *)0); } > > inline int fixterm(void) { return reset_prog_mode(); } > inline int resetterm(void) { return reset_shell_mode(); } > inline int saveterm(void) { return def_prog_mode(); } > inline int crmode(void) { return cbreak(); } > inline int nocrmode(void) { return nocbreak(); } > inline void gettmode(void) { } > > inline void getyx(const WINDOW *win, int& y, int& x) { (y = (win)->_cury, x = (win)->_curx); } > inline void getbegyx(const WINDOW *win, int& y, int& x) { (y = (win)->_begy, x = (win)->_begx); } > inline void getmaxyx(const WINDOW *win, int& y, int& x) { (y = (win)->_maxy + 1, x = (win)->_maxx + 1); } > inline void getsyx(int& y, int& x) { getyx(stdscr, y, x); } > inline void setsyx(const int y, const int x) { (stdscr->_cury = y, stdscr->_curx = x); } > > inline void wbkgdset(WINDOW *win, const chtype ch) { ((win)->_bkgd = ch); } > > /* It seems older SYSV curses define these */ > inline chtype getattrs(const WINDOW *win) { return (win->_attrs); } > inline int getmaxx(const WINDOW *win) { return ((win)->_maxx + 1); } > inline int getmaxy(const WINDOW *win) { return ((win)->_maxy + 1); } > > inline chtype winch(const WINDOW *win) { return ((win)->_line[(win)->_cury][(win)->_curx]); } > inline void wattrset(WINDOW *win, chtype at) { ((win)->_attrs = (at)); } > inline void wstandout(WINDOW *win) { wattrset(win,A_STANDOUT); } > inline void wstandend(WINDOW *win) { wattrset(win,A_NORMAL); } > > inline WINDOW *subpad(WINDOW *p, const int l, const int c, const int y, const int x) { return derwin(p,l,c,y,x); } > inline int scroll(WINDOW *win) { return wscrl(win,1); } > > inline int touchwin(const WINDOW *win) { return wtouchln((win), 0, (win)->_maxy + 1, 1); } > inline int touchline(const WINDOW *win, const int s, const int c) { return wtouchln((win), s, c, 1); } > inline int untouchwin(const WINDOW *win) { return wtouchln((win), 0, (win)->_maxy + 1, 0); } > > inline int box(const WINDOW *win, const int v, const int h) { return wborder(win, v, v, h, h, 0, 0, 0, 0); } > inline int border(const int ls, const int rs, const int ts, const int bs, const int tl, const int tr, const int bl, const int br) { return wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br); } > inline int hline(const int ch, const int n) { return whline(stdscr, ch, n); } > inline int vline(const int ch, const int n) { return wvline(stdscr, ch, n); } > > inline int winsstr(const WINDOW *w, const char* s) { return winsnstr(w, s, 0); } > inline int winstr(const WINDOW *w, char* s) { return winnstr(w, s, -1); } > > inline int redrawwin(WINDOW *w) { return wredrawln(w, 0, w->_maxy+1); } > inline int waddstr(WINDOW *win, const char* str) { return waddnstr(win,str,-1); } > inline int waddchstr(WINDOW *win, const chtype* str) { return waddchnstr(win,str,-1); } > > /* > * pseudo functions for standard screen > */ > > inline void bkgdset(const chtype ch) { wbkgdset(stdscr,ch); } > inline int bkgd(const chtype ch) { return wbkgd(stdscr,ch); } > inline chtype inch(void) { return winch(stdscr); } > inline void standout(void) { wstandout(stdscr); } > inline void standend(void) { wstandend(stdscr); } > inline int attron(const chtype at) { return wattron(stdscr,at); } > inline int attroff(const chtype at) { return wattroff(stdscr,at); } > inline void attrset(const chtype at) { wattrset(stdscr,at); } > inline int addch(const chtype ch) { return waddch(stdscr,ch); } > inline int echochar(const chtype c) { return wechochar(stdscr, c); } > inline int getch(void) { return wgetch(stdscr); } > inline int addstr(char* str) { return waddnstr(stdscr,str,-1); } > inline int getstr(char* str) { return wgetstr(stdscr,str); } > inline int move(const int y, const int x) { return wmove(stdscr,y,x); } > inline int clear(void) { return wclear(stdscr); } > inline int erase(void) { return werase(stdscr); } > inline int clrtobot(void) { return wclrtobot(stdscr); } > inline int clrtoeol(void) { return wclrtoeol(stdscr); } > inline int insertln(void) { return winsdelln(stdscr, 1); } > inline int winsertln(WINDOW *w) { return winsdelln(w, 1); } > inline int deleteln(void) { return winsdelln(stdscr, -1); } > inline int wdeleteln(WINDOW *w) { return winsdelln(w, -1); } > inline int refresh(void) { return wrefresh(stdscr); } > inline int innstr(char *s, const int n) { return winnstr(stdscr,s,n); } > inline int insch(const chtype c) { return winsch(stdscr,c); } > inline int delch(void) { return wdelch(stdscr); } > inline int setscrreg(const int t, const int b) { return wsetscrreg(stdscr,t,b); } > inline int scrl(const int n) { return wscrl(stdscr,n); } > inline int timeout(const int delay) { return wtimeout(stdscr, delay); } > inline int addnstr(const char* str, const int n) { return waddnstr(stdscr,str,n); } > inline int addchstr(const chtype* str) { return waddchstr(stdscr,str); } > inline int addchnstr(const chtype* str, const int n) { return waddchnstr(stdscr,str, n); } > inline int insdelln(const int n) { return winsdelln(stdscr, n); } > inline int insstr(const char* s) { return winsstr(stdscr, s); } > inline int insnstr(const char* s, const int n) { return winsnstr(stdscr, s, n); } > > /* > * mv functions > */ > > inline int mvwaddch(WINDOW *win, > const int y, > const int x, > const chtype ch) > { return (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)); } > > inline int mvwgetch(WINDOW *win, > const int y, > const int x) > { return (wmove(win,y,x) == ERR ? ERR : wgetch(win)); } > > inline int mvwaddchnstr(WINDOW *win, > const int y, > const int x, > const chtype* str, > const int n) > { return (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n)); } > > inline int mvwaddchstr(WINDOW *win, > const int y, > const int x, > const chtype* str) > { return (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)); } > > inline int mvwaddnstr(WINDOW *win, > const int y, > const int x, > const char* str, > const int n) > { return (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n)); } > > inline int mvwaddstr(WINDOW *win, > const int y, > const int x, > const char* str) > { return (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)); } > > inline int mvwgetstr(WINDOW *win, > const int y, > const int x, > char* str) > { return (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)); } > > inline chtype mvwinch(WINDOW *win, > const int y, > const int x) > { return (wmove(win,y,x) == ERR ? ERR : winch(win)); } > > inline int mvwdelch(WINDOW *win, > const int y, > const int x) > { return (wmove(win,y,x) == ERR ? ERR : wdelch(win)); } > > inline int mvwinnstr(WINDOW *win, > const int y, > const int x, > char* s, > const int n) > { return (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)); } > > inline int mvwinsch(WINDOW *win, > const int y, > const int x, > const chtype c) > { return (wmove(win,y,x) == ERR ? ERR : winsch(win,c)); } > > inline int mvaddch(const int y, > const int x, > const chtype ch) > { return mvwaddch(stdscr,y,x,ch); } > > inline int mvgetch(const int y, > const int x) > { return mvwgetch(stdscr,y,x); } > > inline int mvaddnstr(const int y, > const int x, > char* str, > const int n) > { return mvwaddnstr(stdscr,y,x,str,n); } > > inline int mvaddstr(const int y, > const int x, > const char* str) > { return mvwaddstr(stdscr,y,x,str); } > > inline int mvgetstr(const int y, > const int x, > char* str) > { return mvwgetstr(stdscr,y,x,str); } > > inline chtype mvinch(const int y, > const int x) > { return mvwinch(stdscr,y,x); } > > inline int mvdelch(const int y, > const int x) > { return mvwdelch(stdscr,y,x); } > > inline int mvinnstr(const int y, > const int x, > char* s, > const int n) > { return mvwinnstr(stdscr,y,x,s,n); } > > inline int mvinsch(const int y, > const int x, > const chtype c) > { return mvwinsch(stdscr,y,x,c); } > > inline int mvwinsstr(WINDOW *w, > const int y, > const int x, > const char* s) > { return (wmove(w,y,x) == ERR ? ERR : winsstr(w,s)); } > > > inline int mvwinsnstr(WINDOW *w, > const int y, > const int x, > const char* s, > const int n) > { return (wmove(w,y,x) == ERR ? ERR : winsnstr(w,s,n)); } > > inline int mvinsstr(const int y, > const int x, > const char* s) > { return mvwinsstr(stdscr,y,x,s); } > > inline int mvinsnstr(const int y, > const int x, > const char* s, > const int n) > { return mvwinsnstr(stdscr,y,x,s,n); } > > /* > * XSI curses macros for XPG4 conformance. > */ > > inline chtype wattr_get(const WINDOW *win) { return ((win)->_attrs); } > inline chtype attr_get(void) { return wattr_get(stdscr); } > > inline chtype getbkgd(const WINDOW *win) { return ((win)->_bkgd); } > inline int vid_attr(const int a) { return vidattr(a); } > > #endif /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > 453a802,803 > #if !defined(__cplusplus) || defined(CURSES_COMPAT) > 553c903,1009 < #endif --- > > #else /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > > const int KEY_MIN =0401; /* Minimum curses key */ > const int KEY_BREAK =0401; /* break key (unreliable) */ > const int KEY_DOWN =0402; /* The four arrow keys ... */ > const int KEY_UP =0403; > const int KEY_LEFT =0404; > const int KEY_RIGHT =0405; /* ... */ > const int KEY_HOME =0406; /* Home key (upward+left arrow) */ > const int KEY_BACKSPACE =0407; /* backspace (unreliable) */ > const int KEY_F0 =0410; /* Function keys. Space for 64 */ > inline int KEY_F(int n) { return (KEY_F0+(n)); } /* keys is reserved. */ > const int KEY_DL =0510; /* Delete line */ > const int KEY_IL =0511; /* Insert line */ > const int KEY_DC =0512; /* Delete character */ > const int KEY_IC =0513; /* Insert char or enter insert mode */ > const int KEY_EIC =0514; /* Exit insert char mode */ > const int KEY_CLEAR =0515; /* Clear screen */ > const int KEY_EOS =0516; /* Clear to end of screen */ > const int KEY_EOL =0517; /* Clear to end of line */ > const int KEY_SF =0520; /* Scroll 1 line forward */ > const int KEY_SR =0521; /* Scroll 1 line backwards (reverse) */ > const int KEY_NPAGE =0522; /* Next page */ > const int KEY_PPAGE =0523; /* Previous page */ > const int KEY_STAB =0524; /* Set tab */ > const int KEY_CTAB =0525; /* Clear tab */ > const int KEY_CATAB =0526; /* Clear all tabs */ > const int KEY_ENTER =0527; /* Enter or send (unreliable) */ > const int KEY_SRESET =0530; /* soft (partial) reset (unreliable) */ > const int KEY_RESET =0531; /* reset or hard reset (unreliable) */ > const int KEY_PRINT =0532; /* print or copy */ > const int KEY_LL =0533; /* home down or bottom (lower left) */ > > /* The keypad is arranged like this: */ > /* a1 up a3 */ > /* left b2 right */ > /* c1 down c3 */ > > const int KEY_A1 =0534; /* Upper left of keypad */ > const int KEY_A3 =0535; /* Upper right of keypad */ > const int KEY_B2 =0536; /* Center of keypad */ > const int KEY_C1 =0537; /* Lower left of keypad */ > const int KEY_C3 =0540; /* Lower right of keypad */ > const int KEY_BTAB =0541; /* Back tab key */ > const int KEY_BEG =0542; /* beg(inning) key */ > const int KEY_CANCEL =0543; /* cancel key */ > const int KEY_CLOSE =0544; /* close key */ > const int KEY_COMMAND =0545; /* cmd (command) key */ > const int KEY_COPY =0546; /* copy key */ > const int KEY_CREATE =0547; /* create key */ > const int KEY_END =0550; /* end key */ > const int KEY_EXIT =0551; /* exit key */ > const int KEY_FIND =0552; /* find key */ > const int KEY_HELP =0553; /* help key */ > const int KEY_MARK =0554; /* mark key */ > const int KEY_MESSAGE =0555; /* message key */ > const int KEY_MOVE =0556; /* move key */ > const int KEY_NEXT =0557; /* next object key */ > const int KEY_OPEN =0560; /* open key */ > const int KEY_OPTIONS =0561; /* options key */ > const int KEY_PREVIOUS =0562; /* previous object key */ > const int KEY_REDO =0563; /* redo key */ > const int KEY_REFERENCE =0564; /* ref(erence) key */ > const int KEY_REFRESH =0565; /* refresh key */ > const int KEY_REPLACE =0566; /* replace key */ > const int KEY_RESTART =0567; /* restart key */ > const int KEY_RESUME =0570; /* resume key */ > const int KEY_SAVE =0571; /* save key */ > const int KEY_SBEG =0572; /* shifted beginning key */ > const int KEY_SCANCEL =0573; /* shifted cancel key */ > const int KEY_SCOMMAND =0574; /* shifted command key */ > const int KEY_SCOPY =0575; /* shifted copy key */ > const int KEY_SCREATE =0576; /* shifted create key */ > const int KEY_SDC =0577; /* shifted delete char key */ > const int KEY_SDL =0600; /* shifted delete line key */ > const int KEY_SELECT =0601; /* select key */ > const int KEY_SEND =0602; /* shifted end key */ > const int KEY_SEOL =0603; /* shifted clear line key */ > const int KEY_SEXIT =0604; /* shifted exit key */ > const int KEY_SFIND =0605; /* shifted find key */ > const int KEY_SHELP =0606; /* shifted help key */ > const int KEY_SHOME =0607; /* shifted home key */ > const int KEY_SIC =0610; /* shifted input key */ > const int KEY_SLEFT =0611; /* shifted left arrow key */ > const int KEY_SMESSAGE =0612; /* shifted message key */ > const int KEY_SMOVE =0613; /* shifted move key */ > const int KEY_SNEXT =0614; /* shifted next key */ > const int KEY_SOPTIONS =0615; /* shifted options key */ > const int KEY_SPREVIOUS =0616; /* shifted prev key */ > const int KEY_SPRINT =0617; /* shifted print key */ > const int KEY_SREDO =0620; /* shifted redo key */ > const int KEY_SREPLACE =0621; /* shifted replace key */ > const int KEY_SRIGHT =0622; /* shifted right arrow */ > const int KEY_SRSUME =0623; /* shifted resume key */ > const int KEY_SSAVE =0624; /* shifted save key */ > const int KEY_SSUSPEND =0625; /* shifted suspend key */ > const int KEY_SUNDO =0626; /* shifted undo key */ > const int KEY_SUSPEND =0627; /* suspend key */ > const int KEY_UNDO =0630; /* undo key */ > const int KEY_MAX =0777; /* Maximum curses key */ > > > #endif /* !defined(__cplusplus) || defined(CURSES_COMPAT) */ > > #endif /* __NCURSES_H */ diff /usr/src/lib/libncurses/curses.priv.h ./curses.priv.h 65,66c65,66 < extern chtype _nc_background(WINDOW *); < extern chtype _nc_render(WINDOW *, chtype); --- > extern chtype _nc_background(const WINDOW *); > extern chtype _nc_render(const WINDOW *, chtype); 70,72c70,72 < struct try { < struct try *child; /* ptr to child. NULL if none */ < struct try *sibling; /* ptr to sibling. NULL if none */ --- > struct _try { > struct _try *child; /* ptr to child. NULL if none */ > struct _try *sibling; /* ptr to sibling. NULL if none */ 108c108 < struct try *_keytry; /* "Try" for use with keypad mode */ --- > struct _try *_keytry; /* "Try" for use with keypad mode */ 128a129 > 137c138 < #define UNINITIALISED ((struct try * ) -1) --- > #define UNINITIALISED ((struct _try * ) -1) diff /usr/src/lib/libncurses/lib_addch.c ./lib_addch.c 16c16 < static inline chtype render_char(WINDOW *win, chtype ch) --- > static inline chtype render_char(const WINDOW *win, chtype ch) 28c28 < chtype _nc_background(WINDOW *win) --- > chtype _nc_background(const WINDOW *win) 34c34 < chtype _nc_render(WINDOW *win, chtype ch) --- > chtype _nc_render(const WINDOW *win, chtype ch) diff /usr/src/lib/libncurses/lib_addstr.c ./lib_addstr.c 16c16 < waddnstr(WINDOW *win, char *str, int n) --- > waddnstr(WINDOW *win, const char *str, int n) 39c39 < waddchnstr(WINDOW *win, chtype *str, int n) --- > waddchnstr(WINDOW *win, const chtype *str, int n) diff /usr/src/lib/libncurses/lib_box.c ./lib_box.c 18c18 < int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, --- > int wborder(const WINDOW *win, chtype ls, chtype rs, chtype ts, 75c75 < int whline(WINDOW *win, chtype ch, int n) --- > int whline(const WINDOW *win, chtype ch, int n) 104c104 < int wvline(WINDOW *win, chtype ch, int n) --- > int wvline(const WINDOW *win, chtype ch, int n) diff /usr/src/lib/libncurses/lib_clrbot.c ./lib_clrbot.c 15c15 < int wclrtobot(WINDOW *win) --- > int wclrtobot(const WINDOW *win) diff /usr/src/lib/libncurses/lib_clreol.c ./lib_clreol.c 15c15 < int wclrtoeol(WINDOW *win) --- > int wclrtoeol(const WINDOW *win) diff /usr/src/lib/libncurses/lib_color.c ./lib_color.c 29c29 < color_pairs = malloc(max_pairs); --- > color_pairs = (unsigned char *)malloc(max_pairs); diff /usr/src/lib/libncurses/lib_delch.c ./lib_delch.c 16c16 < int wdelch(WINDOW *win) --- > int wdelch(const WINDOW *win) diff /usr/src/lib/libncurses/lib_doupdate.c ./lib_doupdate.c 27c27 < static void ClrUpdate( WINDOW *scr ); --- > static void ClrUpdate(const WINDOW *scr ); 32c32 < static void InsStr( chtype *line, int count ); --- > static void InsStr(const chtype *line, int count ); 198c198 < static void ClrUpdate(WINDOW *scr) --- > static void ClrUpdate(const WINDOW *scr) 542c542 < static void InsStr(chtype *line, int count) --- > static void InsStr(const chtype *line, int count) diff /usr/src/lib/libncurses/lib_getch.c ./lib_getch.c 99c99 < static int kgetch(WINDOW *); --- > static int kgetch(const WINDOW *); 183c183 < kgetch(WINDOW *win) --- > kgetch(const WINDOW *win) 185c185 < struct try *ptr; --- > struct _try *ptr; diff /usr/src/lib/libncurses/lib_inchstr.c ./lib_inchstr.c 15c15 < int winchnstr(WINDOW *win, chtype *chstr, int i) --- > int winchnstr(const WINDOW *win, const chtype *chstr, int i) diff /usr/src/lib/libncurses/lib_insch.c ./lib_insch.c 15c15 < int winsch(WINDOW *win, chtype c) --- > int winsch(const WINDOW *win, chtype c) diff /usr/src/lib/libncurses/lib_insstr.c ./lib_insstr.c 15c15 < int winsnstr(WINDOW *win, char *str, int n) --- > int winsnstr(const WINDOW *win, const char *str, int n) diff /usr/src/lib/libncurses/lib_instr.c ./lib_instr.c 32c32 < int winnstr(WINDOW *win, char *str, int n) --- > int winnstr(const WINDOW *win, char *str, int n) diff /usr/src/lib/libncurses/lib_longname.c ./lib_longname.c 17c17 < char * --- > const char * diff /usr/src/lib/libncurses/lib_newterm.c ./lib_newterm.c 51c51 < int (*hook)(); --- > int (*hook)(WINDOW *, int); diff /usr/src/lib/libncurses/lib_newwin.c ./lib_newwin.c 59c59 < WINDOW * derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) --- > WINDOW * derwin(const WINDOW *orig, int num_lines, int num_columns, int begy, int begx) 101c101 < WINDOW *subwin(WINDOW *w, int l, int c, int y, int x) --- > WINDOW *subwin(const WINDOW *w, int l, int c, int y, int x) 125c125 < if ((win->_firstchar = calloc(num_lines, sizeof(short))) == NULL) { --- > if ((win->_firstchar = (short *)calloc(num_lines, sizeof(short))) == NULL) { 131c131 < if ((win->_lastchar = calloc(num_lines, sizeof(short))) == NULL) { --- > if ((win->_lastchar = (short *)calloc(num_lines, sizeof(short))) == NULL) { diff /usr/src/lib/libncurses/lib_options.c ./lib_options.c 105c105 < static void add_to_try(char *, short); --- > static void add_to_try(const char *, short); 142c142 < static struct try *newtry; --- > static struct _try *newtry; 154c154 < static void add_to_try(char *str, short code) --- > static void add_to_try(const char *str, short code) 157c157 < struct try *ptr, *savedptr; --- > struct _try *ptr, *savedptr; 181c181 < if ((ptr->sibling = (struct try *) malloc(sizeof *ptr)) == NULL) { --- > if ((ptr->sibling = (struct _try *) malloc(sizeof *ptr)) == NULL) { 195c195 < savedptr = ptr = newtry = (struct try *) malloc(sizeof *ptr); --- > savedptr = ptr = newtry = (struct _try *) malloc(sizeof *ptr); 210c210 < ptr->child = (struct try *) malloc(sizeof *ptr); --- > ptr->child = (struct _try *) malloc(sizeof *ptr); 244c244 < int intrflush(WINDOW *win, bool flag) --- > int intrflush(const WINDOW *win, bool flag) diff /usr/src/lib/libncurses/lib_overlay.c ./lib_overlay.c 15c15 < static void overlap(WINDOW *s, WINDOW *d, int flag) --- > static void overlap(const WINDOW *s, const WINDOW *d, int flag) 42c42 < int overlay(WINDOW *win1, WINDOW *win2) --- > int overlay(const WINDOW *win1, const WINDOW *win2) 58c58 < int overwrite(WINDOW *win1, WINDOW *win2) --- > int overwrite(const WINDOW *win1, const WINDOW *win2) 64c64 < int copywin(WINDOW *src, WINDOW *dst, --- > int copywin(const WINDOW *src, const WINDOW *dst, diff /usr/src/lib/libncurses/lib_pad.c ./lib_pad.c 127c127 < int pechochar(WINDOW *pad, chtype ch) --- > int pechochar(const WINDOW *pad, chtype ch) diff /usr/src/lib/libncurses/lib_printw.c ./lib_printw.c 15c15 < int printw(char *fmt, ...) --- > int printw(const char *fmt, ...) 30c30 < int wprintw(WINDOW *win, char *fmt, ...) --- > int wprintw(WINDOW *win, const char *fmt, ...) 45c45 < int mvprintw(int y, int x, char *fmt, ...) --- > int mvprintw(int y, int x, const char *fmt, ...) 58c58 < int mvwprintw(WINDOW *win, int y, int x, char *fmt, ...) --- > int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...) 69c69 < int vwprintw(WINDOW *win, char *fmt, va_list argp) --- > int vwprintw(WINDOW *win, const char *fmt, va_list argp) diff /usr/src/lib/libncurses/lib_scanw.c ./lib_scanw.c 16c16 < int vwscanw(WINDOW *win, char *fmt, va_list argp) --- > int vwscanw(WINDOW *win, const char *fmt, va_list argp) 26c26 < int scanw(char *fmt, ...) --- > int scanw(const char *fmt, ...) 36c36 < int wscanw(WINDOW *win, char *fmt, ...) --- > int wscanw(WINDOW *win, const char *fmt, ...) 48c48 < int mvscanw(int y, int x, char *fmt, ...) --- > int mvscanw(int y, int x, const char *fmt, ...) 58c58 < int mvwscanw(WINDOW *win, int y, int x, char *fmt, ...) --- > int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...) diff /usr/src/lib/libncurses/lib_screen.c ./lib_screen.c 8c8 < int putwin(WINDOW *win, char *file) --- > int putwin(const WINDOW *win, const char *file) 21c21 < int scr_restore(char *file) --- > int scr_restore(const char *file) 35c35 < int scr_dump(char *file) --- > int scr_dump(const char *file) 41c41 < int scr_init(char *file) --- > int scr_init(const char *file) 47c47 < int scr_set(char *file) --- > int scr_set(const char *file) 53c53 < WINDOW *getwin(FILE *filep) --- > WINDOW *getwin(const FILE *filep) diff /usr/src/lib/libncurses/lib_set_term.c ./lib_set_term.c 16,18c16,17 < struct screen * < set_term(screen) < struct screen *screen; --- > SCREEN * > set_term(SCREEN *screen) diff /usr/src/lib/libncurses/lib_slk.c ./lib_slk.c 20c20 < #define UNINITIALISED ((struct try * ) -1) --- > #define UNINITIALISED ((struct _try * ) -1) 122c122 < slk_set(int i, char *str, int format) --- > slk_set(int i, const char *str, int format) diff /usr/src/lib/libncurses/lib_touch.c ./lib_touch.c 18c18 < int is_linetouched(WINDOW *win, int line) --- > int is_linetouched(const WINDOW *win, int line) 26c26 < int is_wintouched(WINDOW *win) --- > int is_wintouched(const WINDOW *win) 36c36 < int wtouchln(WINDOW *win, int y, int n, int changed) --- > int wtouchln(const WINDOW *win, int y, int n, int changed) diff /usr/src/lib/libncurses/lib_trace.c ./lib_trace.c 26c26 < void _tracef(char *fmt, ...); --- > void _tracef(const char *fmt, ...); 169c169 < _tracef(char *fmt, ...) --- > _tracef(const char *fmt, ...) diff /usr/src/lib/libncurses/lib_unctrl.c ./lib_unctrl.c 5c5 < char *unctrl(register chtype ch) --- > const char *unctrl(register chtype ch) 42c42 < return (char *)table[TextOf(ch)]; --- > return table[TextOf(ch)]; diff /usr/src/lib/libncurses/lib_window.c ./lib_window.c 15c15 < int mvder(WINDOW *win, int y, int x) --- > int mvder(const WINDOW *win, int y, int x) 20c20 < void wsyncup(WINDOW *win) --- > void wsyncup(const WINDOW *win) 25c25 < int syncok(WINDOW *win, bool bf) --- > int syncok(const WINDOW *win, bool bf) 30c30 < void wcursyncup(WINDOW *win) --- > void wcursyncup(const WINDOW *win) 35c35 < void wsyncdown(WINDOW *win) --- > void wsyncdown(const WINDOW *win) 40c40 < WINDOW *dupwin(WINDOW *win) --- > WINDOW *dupwin(const WINDOW *win) diff /usr/src/lib/libncurses/unctrl.h ./unctrl.h 46c46 < extern char *unctrl(chtype); --- > extern const char *unctrl(chtype); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908200858.EAA43964>