ncurses 5.6 - patch 20081012
[ncurses.git] / include / MKterm.h.awk.in
index e839cf4ac6a043947e4418ad83f328fe6e8fbc5e..5fc20529b11b360cd40f6231da3ac24dba140d3c 100644 (file)
@@ -1,7 +1,7 @@
-
+# vile:awkmode
 BEGIN          {
                    print  "/****************************************************************************"
-                   print  " * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.              *"
+                   print  " * Copyright (c) 1998-2007,2008 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            *"
@@ -31,44 +31,37 @@ BEGIN               {
                    print  "/****************************************************************************/"
                    print  "/* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995                */"
                    print  "/*    and: Eric S. Raymond <esr@snark.thyrsus.com>                          */"
+                   print  "/*    and: Thomas E. Dickey                        1995-on                  */"
                    print  "/****************************************************************************/"
                    print  ""
-                   print  "/* $Id: MKterm.h.awk.in,v 1.37 2000/03/12 02:40:07 tom Exp $ */"
+                   print  "/* $Id: MKterm.h.awk.in,v 1.50 2008/05/24 23:13:59 tom Exp $ */"
                    print  ""
                    print  "/*"
                    print  "**  term.h -- Definition of struct term"
                    print  "*/"
                    print  ""
-                   print  "#ifndef _NCU_TERM_H"
-                   print  "#define _NCU_TERM_H 1"
+                   print  "#ifndef NCURSES_TERM_H_incl"
+                   print  "#define NCURSES_TERM_H_incl 1"
                    print  ""
                    print  "#undef  NCURSES_VERSION"
                    print  "#define NCURSES_VERSION \"@NCURSES_MAJOR@.@NCURSES_MINOR@\""
                    print  ""
+                   print  "#include <ncurses_dll.h>"
+                   print  ""
                    print  "#ifdef __cplusplus"
                    print  "extern \"C\" {"
                    print  "#endif"
                    print  ""
                    print  "/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H"
-                   print  " * and BROKEN_LINKER definition (based on the system for which this was"
-                   print  " * configured)."
+                   print  " * definition (based on the system for which this was configured)."
                    print  " */"
                    print  ""
-                   print  "#undef  HAVE_TERMIOS_H"
-                   print  "#define HAVE_TERMIOS_H 1/*default*/"
-                   print  ""
-                   print  "#undef  HAVE_TERMIO_H"
-                   print  "#define HAVE_TERMIO_H 0/*default*/"
-                   print  ""
-                   print  "#undef  HAVE_TCGETATTR"
-                   print  "#define HAVE_TCGETATTR 1/*default*/"
-                   print  ""
-                   print  "#undef  BROKEN_LINKER"
-                   print  "#define BROKEN_LINKER 0/*default*/"
-                   print  ""
                    print  "#undef  NCURSES_CONST"
                    print  "#define NCURSES_CONST @NCURSES_CONST@"
                    print  ""
+                   print  "#undef  NCURSES_SBOOL"
+                   print  "#define NCURSES_SBOOL @NCURSES_SBOOL@"
+                   print  ""
                    print  "#undef  NCURSES_XNAMES"
                    print  "#define NCURSES_XNAMES @NCURSES_XNAMES@"
                    print  ""
@@ -79,8 +72,9 @@ BEGIN         {
                    print  "#undef  SET_TTY"
                    print  "#undef  GET_TTY"
                    print  ""
-                   print  "/* Assume Posix termio if we have the header and function */"
-                   print  "#if HAVE_TERMIOS_H && HAVE_TCGETATTR"
+                   print  "/* Assume POSIX termio if we have the header and function */"
+                   print  "/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */"
+                   print  "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@"
                    print  ""
                    print  "#undef  TERMIOS"
                    print  "#define TERMIOS 1"
@@ -90,7 +84,8 @@ BEGIN         {
                    print  ""
                    print  "#else /* !HAVE_TERMIOS_H */"
                    print  ""
-                   print  "#if HAVE_TERMIO_H"
+                   print  "/* #if HAVE_TERMIO_H */"
+                   print  "#if @HAVE_TERMIO_H@"
                    print  ""
                    print  "#undef  TERMIOS"
                    print  "#define TERMIOS 1"
@@ -205,7 +200,7 @@ END         {
                        print  "typedef struct termtype {       /* in-core form of terminfo data */"
                        print  "    char  *term_names;          /* str_table offset of term names */"
                        print  "    char  *str_table;           /* pointer to string table */"
-                       print  "    char  *Booleans;            /* array of boolean values */"
+                       print  "    NCURSES_SBOOL  *Booleans;   /* array of boolean values */"
                        print  "    short *Numbers;             /* array of integer values */"
                        print  "    char  **Strings;            /* array of string offsets */"
                        print  ""
@@ -226,90 +221,100 @@ END              {
                        print  ""
                        print  "typedef struct term {           /* describe an actual terminal */"
                        print  "    TERMTYPE    type;           /* terminal type description */"
-                       print  "    short       Filedes;        /* file description being written to */"
+                       print  "    short       Filedes;        /* file description being written to */"
                        print  "    TTY         Ottyb,          /* original state of the terminal */"
                        print  "                Nttyb;          /* current state of the terminal */"
                        print  "    int         _baudrate;      /* used to compute padding */"
+                       print  "    char *      _termname;      /* used for termname() */"
                        print  "} TERMINAL;"
                        print  ""
-                       print  "extern TERMINAL *cur_term;"
+                       print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
+                       print  "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
+                       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  "#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_CONST char * const *_nc_boolnames(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_boolcodes(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_boolfnames(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_numnames(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_numcodes(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_numfnames(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_strnames(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_strcodes(void);"
-                       print  "extern NCURSES_CONST char * const *_nc_strfnames(void);"
+                       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())"
+                       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  ""
-                       print  "extern NCURSES_CONST char *const boolnames[];"
-                       print  "extern NCURSES_CONST char *const boolcodes[];"
-                       print  "extern NCURSES_CONST char *const boolfnames[];"
-                       print  "extern NCURSES_CONST char *const numnames[];"
-                       print  "extern NCURSES_CONST char *const numcodes[];"
-                       print  "extern NCURSES_CONST char *const numfnames[];"
-                       print  "extern NCURSES_CONST char *const strnames[];"
-                       print  "extern NCURSES_CONST char *const strcodes[];"
-                       print  "extern NCURSES_CONST char *const strfnames[];"
+                       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[];"
+                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];"
+                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];"
+                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];"
+                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];"
+                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];"
+                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];"
                        print  ""
                        print  "#endif"
                        print  ""
                        print  "/* internals */"
-                       print  "extern int _nc_set_tty_mode(TTY *buf);"
-                       print  "extern int _nc_get_tty_mode(TTY *buf);"
-                       print  "extern int _nc_read_entry(const char * const, char * const, TERMTYPE *const);"
-                       print  "extern int _nc_read_file_entry(const char *const, TERMTYPE *);"
-                       print  "extern char *_nc_first_name(const char *const);"
-                       print  "extern int _nc_name_match(const char *const, const char *const, const char *const);"
-                       print  "extern int _nc_read_termcap_entry(const char *const, TERMTYPE *const);"
-                       print  "extern const TERMTYPE *_nc_fallback(const char *);"
+                       print  "extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);"
+                       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(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);"
+                       print  "extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);"
                        print  ""
                        print  "/* entry points */"
-                       print  "extern TERMINAL *set_curterm(TERMINAL *);"
-                       print  "extern int del_curterm(TERMINAL *);"
+                       print  "extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);"
+                       print  "extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);"
                        print  ""
                        print  "/* miscellaneous entry points */"
-                       print  "extern int restartterm(NCURSES_CONST char *, int, int *);"
-                       print  "extern int setupterm(NCURSES_CONST char *,int,int *);"
+                       print  "extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);"
+                       print  "extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *);"
                        print  ""
                        print  "/* terminfo entry points, also declared in curses.h */"
                        print  "#if !defined(__NCURSES_H)"
-                       print  "extern char *tigetstr(NCURSES_CONST char *);"
-                       print  "extern char *tparm(NCURSES_CONST char *, ...);"
-                       print  "extern char ttytype[];"
-                       print  "extern int putp(const char *);"
-                       print  "extern int tigetflag(NCURSES_CONST char *);"
-                       print  "extern int tigetnum(NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT_VAR(char) ttytype[];"
+                       print  "extern NCURSES_EXPORT(int) putp (const char *);"
+                       print  "extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);"
+                       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 *, ...);        /* special */"
+                       print  "#else"
+                       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  "#endif /* __NCURSES_H */"
                        print  ""
                        print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
-                       print  "#if !defined(_NCU_TERMCAP_H)"
-                       print  "extern char *tgetstr(NCURSES_CONST char *, char **);"
-                       print  "extern char *tgoto(const char *, int, int);"
-                       print  "extern int tgetent(char *, const char *);"
-                       print  "extern int tgetflag(NCURSES_CONST char *);"
-                       print  "extern int tgetnum(NCURSES_CONST char *);"
-                       print  "extern int tputs(const char *, int, int (*)(int));"
-                       print  "#endif /* _NCU_TERMCAP_H */"
+                       print  "#if !defined(NCURSES_TERMCAP_H_incl)"
+                       print  "extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);"
+                       print  "extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);"
+                       print  "extern NCURSES_EXPORT(int) tgetent (char *, const char *);"
+                       print  "extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);"
+                       print  "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));"
+                       print  "#endif /* NCURSES_TERMCAP_H_incl */"
                        print  ""
                        print  "#ifdef __cplusplus"
                        print  "}"
                        print  "#endif"
                        print  ""
-                       print  "#endif /* _NCU_TERM_H */"
+                       print  "#endif /* NCURSES_TERM_H_incl */"
                }