ncurses 5.7 - patch 20090829
[ncurses.git] / include / MKterm.h.awk.in
index 5fc20529b11b360cd40f6231da3ac24dba140d3c..215d6d24d19a453023c78cf35ac20a44335fb430 100644 (file)
@@ -1,7 +1,7 @@
 # vile:awkmode
 BEGIN          {
                    print  "/****************************************************************************"
-                   print  " * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *"
+                   print  " * Copyright (c) 1998-2008,2009 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            *"
@@ -34,7 +34,7 @@ BEGIN         {
                    print  "/*    and: Thomas E. Dickey                        1995-on                  */"
                    print  "/****************************************************************************/"
                    print  ""
-                   print  "/* $Id: MKterm.h.awk.in,v 1.50 2008/05/24 23:13:59 tom Exp $ */"
+                   print  "/* $Id: MKterm.h.awk.in,v 1.57 2009/05/09 15:54:50 tom Exp $ */"
                    print  ""
                    print  "/*"
                    print  "**  term.h -- Definition of struct term"
@@ -130,11 +130,15 @@ BEGIN             {
                    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 */"
@@ -228,8 +232,16 @@ END                {
                        print  "    char *      _termname;      /* used for termname() */"
                        print  "} TERMINAL;"
                        print  ""
-                       print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
+                       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@ || @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);"
@@ -240,7 +252,6 @@ END         {
                        print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
                        print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
                        print  ""
-                       print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
                        print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
                        print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
                        print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
@@ -253,8 +264,6 @@ END         {
                        print  ""
                        print  "#else"
                        print  ""
-                       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
-                       print  ""
                        print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
                        print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
                        print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
@@ -312,6 +321,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"