ncurses 5.9 - patch 20140726
[ncurses.git] / include / MKterm.h.awk.in
index ee22f014d128bf1eef2aec4bed64ac85219120d0..587ee52123884d97a98e3bc8273e1a8b37c75484 100644 (file)
@@ -1,6 +1,7 @@
+# vile:awkmode
 BEGIN          {
                    print  "/****************************************************************************"
-                   print  " * Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *"
+                   print  " * Copyright (c) 1998-2011,2013 Free Software Foundation, Inc.              *"
                    print  " *                                                                          *"
                    print  " * Permission is hereby granted, free of charge, to any person obtaining a  *"
                    print  " * copy of this software and associated documentation files (the            *"
@@ -33,7 +34,7 @@ BEGIN         {
                    print  "/*    and: Thomas E. Dickey                        1995-on                  */"
                    print  "/****************************************************************************/"
                    print  ""
-                   print  "/* $Id: MKterm.h.awk.in,v 1.47 2006/11/26 01:18:23 tom Exp $ */"
+                   print  "/* $Id: MKterm.h.awk.in,v 1.62 2013/08/17 19:21:56 tom Exp $ */"
                    print  ""
                    print  "/*"
                    print  "**  term.h -- Definition of struct term"
@@ -61,6 +62,12 @@ BEGIN                {
                    print  "#undef  NCURSES_SBOOL"
                    print  "#define NCURSES_SBOOL @NCURSES_SBOOL@"
                    print  ""
+                   print  "#undef  NCURSES_USE_DATABASE"
+                   print  "#define NCURSES_USE_DATABASE @NCURSES_USE_DATABASE@"
+                   print  ""
+                   print  "#undef  NCURSES_USE_TERMCAP"
+                   print  "#define NCURSES_USE_TERMCAP @NCURSES_USE_TERMCAP@"
+                   print  ""
                    print  "#undef  NCURSES_XNAMES"
                    print  "#define NCURSES_XNAMES @NCURSES_XNAMES@"
                    print  ""
@@ -92,48 +99,17 @@ BEGIN               {
                    print  "#include <termio.h>"
                    print  "#define TTY struct termio"
                    print  ""
-                   print  "/* Add definitions to make termio look like termios."
-                   print  " * But ifdef it, since there are some implementations"
-                   print  " * that try to do this for us in a fake <termio.h>."
-                   print  " */"
-                   print  "#ifndef TCSANOW"
-                   print  "#define TCSANOW TCSETA"
-                   print  "#endif"
-                   print  "#ifndef TCSADRAIN"
-                   print  "#define TCSADRAIN TCSETAW"
-                   print  "#endif"
-                   print  "#ifndef TCSAFLUSH"
-                   print  "#define TCSAFLUSH TCSETAF"
-                   print  "#endif"
-                   print  "#ifndef tcsetattr"
-                   print  "#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)"
-                   print  "#endif"
-                   print  "#ifndef tcgetattr"
-                   print  "#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)"
-                   print  "#endif"
-                   print  "#ifndef cfgetospeed"
-                   print  "#define cfgetospeed(t) ((t)->c_cflag & CBAUD)"
-                   print  "#endif"
-                   print  "#ifndef TCIFLUSH "
-                   print  "#define TCIFLUSH 0"
-                   print  "#endif"
-                   print  "#ifndef TCOFLUSH "
-                   print  "#define TCOFLUSH 1"
-                   print  "#endif"
-                   print  "#ifndef TCIOFLUSH "
-                   print  "#define TCIOFLUSH 2"
-                   print  "#endif"
-                   print  "#ifndef tcflush"
-                   print  "#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)"
-                   print  "#endif"
-                   print  ""
                    print  "#else /* !HAVE_TERMIO_H */"
                    print  ""
+                   print  "#if __MINGW32__"
+                   print  "#  include <ncurses_mingw.h>"
+                   print  "#  define TTY struct termios"
+                   print  "#else"
                    print  "#undef TERMIOS"
                    print  "#include <sgtty.h>"
                    print  "#include <sys/ioctl.h>"
                    print  "#define TTY struct sgttyb"
-                   print  ""
+                   print  "#endif /* MINGW32 */"
                    print  "#endif /* HAVE_TERMIO_H */"
                    print  ""
                    print  "#endif /* HAVE_TERMIOS_H */"
@@ -227,28 +203,35 @@ END               {
                        print  "    char *      _termname;      /* used for termname() */"
                        print  "} TERMINAL;"
                        print  ""
+                       print  "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@"
                        print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+                       print  "#elif @cf_cv_enable_reentrant@"
+                       print  "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
+                       print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
+                       print  "#else"
+                       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+                       print  "#endif"
                        print  ""
-                       print  "#if BROKEN_LINKER"
-                       print  "#define boolnames  _nc_boolnames()"
-                       print  "#define boolcodes  _nc_boolcodes()"
-                       print  "#define boolfnames _nc_boolfnames()"
-                       print  "#define numnames   _nc_numnames()"
-                       print  "#define numcodes   _nc_numcodes()"
-                       print  "#define numfnames  _nc_numfnames()"
-                       print  "#define strnames   _nc_strnames()"
-                       print  "#define strcodes   _nc_strcodes()"
-                       print  "#define strfnames  _nc_strfnames()"
-                       print  ""
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolnames (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolcodes (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolfnames (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numnames (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numcodes (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numfnames (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strnames (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strcodes (void);"
-                       print  "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strfnames (void);"
+                       print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
+                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
+                       print  ""
+                       print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
+                       print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
+                       print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
+                       print  "#define numnames   NCURSES_PUBLIC_VAR(numnames())"
+                       print  "#define numcodes   NCURSES_PUBLIC_VAR(numcodes())"
+                       print  "#define numfnames  NCURSES_PUBLIC_VAR(numfnames())"
+                       print  "#define strnames   NCURSES_PUBLIC_VAR(strnames())"
+                       print  "#define strcodes   NCURSES_PUBLIC_VAR(strcodes())"
+                       print  "#define strfnames  NCURSES_PUBLIC_VAR(strfnames())"
                        print  ""
                        print  "#else"
                        print  ""
@@ -269,6 +252,7 @@ END         {
                        print  "extern NCURSES_EXPORT(int) _nc_get_tty_mode (TTY *buf);"
                        print  "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);"
                        print  "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);"
+                       print  "extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE *const);"
                        print  "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);"
                        print  "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);"
                        print  "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);"
@@ -291,12 +275,14 @@ END               {
                        print  "extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);"
                        print  ""
                        print  "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
-                       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);        /* implemented */"
+                       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);        /* special */"
                        print  "#else"
-                       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);       /* implemented */"
-                       print  "extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...);        /* implemented */"
+                       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);       /* special */"
+                       print  "extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...);        /* special */"
                        print  "#endif"
                        print  ""
+                       print  "extern NCURSES_EXPORT(char *) tiparm (const char *, ...);               /* special */"
+                       print  ""
                        print  "#endif /* __NCURSES_H */"
                        print  ""
                        print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
@@ -309,6 +295,37 @@ END                {
                        print  "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));"
                        print  "#endif /* NCURSES_TERMCAP_H_incl */"
                        print  ""
+                       print  "/*"
+                       print  " * Include curses.h before term.h to enable these extensions."
+                       print  " */"
+                       print  "#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)"
+                       print  ""
+                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tigetstr) (SCREEN*, NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(putp) (SCREEN*, const char *);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetflag) (SCREEN*, NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetnum) (SCREEN*, NCURSES_CONST char *);"
+                       print  ""
+                       print  "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
+                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, ...);     /* special */"
+                       print  "#else"
+                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);    /* special */"
+                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm_varargs) (SCREEN*, NCURSES_CONST char *, ...);     /* special */"
+                       print  "#endif"
+                       print  ""
+                       print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
+                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgetstr) (SCREEN*, NCURSES_CONST char *, char **);"
+                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetflag) (SCREEN*, NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetnum) (SCREEN*, NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);"
+                       print  ""
+                       print  "extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);"
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);"
+                       print  ""
+                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);"
+                       print  "#endif /* NCURSES_SP_FUNCS */"
+                       print  ""
                        print  "#ifdef __cplusplus"
                        print  "}"
                        print  "#endif"