]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/MKterm.h.awk.in
ncurses 6.2 - patch 20210828
[ncurses.git] / include / MKterm.h.awk.in
index a3f97c4791829409dadfbef0991caddb29d01b1a..b72136d813eac4a511bb3dbe6fd71e022b40682f 100644 (file)
@@ -26,7 +26,7 @@ BEGIN {
        lcurl = "{";
        rcurl = "}";
        print  "/****************************************************************************"
-       print  " * Copyright 2018-2019,2020 Thomas E. Dickey                                *"
+       print  " * Copyright 2018-2020,2021 Thomas E. Dickey                                *"
        print  " * Copyright 1998-2013,2017 Free Software Foundation, Inc.                  *"
        print  " *                                                                          *"
        print  " * Permission is hereby granted, free of charge, to any person obtaining a  *"
@@ -60,7 +60,7 @@ BEGIN {
        print  "/*    and: Thomas E. Dickey                        1995-on                  */"
        print  "/****************************************************************************/"
        print  ""
-       print  "/* $Id: MKterm.h.awk.in,v 1.77 2020/09/05 23:08:27 tom Exp $ */"
+       print  "/* $Id: MKterm.h.awk.in,v 1.81 2021/08/18 20:52:42 tom Exp $ */"
        print  ""
        print  "/*"
        print  "**      term.h -- Definition of struct term"
@@ -82,6 +82,24 @@ BEGIN {
        print  " * definition (based on the system for which this was configured)."
        print  " */"
        print  ""
+       print  "#ifndef __NCURSES_H"
+       print  ""
+       print  "typedef struct screen  SCREEN;"
+       print  ""
+       print  "#if @NCURSES_SP_FUNCS@"
+       print  "#undef  NCURSES_SP_FUNCS"
+       print  "#define NCURSES_SP_FUNCS @NCURSES_PATCH@"
+       print  "#undef  NCURSES_SP_NAME"
+       print  "#define NCURSES_SP_NAME(name) name##_sp"
+       print  ""
+       print  "/* Define the sp-funcs helper function */"
+       print  "#undef  NCURSES_SP_OUTC"
+       print  "#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)"
+       print  "typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);"
+       print  "#endif"
+       print  ""
+       print  "#endif /* __NCURSES_H */"
+       print  ""
        print  "#undef  NCURSES_CONST"
        print  "#define NCURSES_CONST @NCURSES_CONST@"
        print  ""
@@ -226,6 +244,9 @@ END {
        print  " * The only reason these structures are visible is for read-only use."
        print  " * Programs which modify the data are not, never were, portable across"
        print  " * curses implementations."
+       print  " *"
+       print  " * The first field in TERMINAL is used in macros."
+       print  " * The remaining fields are private."
        print  " */"
        print  "#ifdef NCURSES_INTERNALS"
        print  ""
@@ -235,19 +256,13 @@ END {
        print  "typedef TERMTYPE TERMTYPE2;"
        }
        print  ""
+       print  "typedef struct term TERMINAL;"
+       print  "#else"
+       print  ""
        print  "typedef struct term {           /* describe an actual terminal */"
        print  "    TERMTYPE    type;           /* terminal type description */"
-       print  "    short       Filedes;        /* file description being written to */"
-       print  "    TTY         Ottyb;          /* original state of the terminal */"
-       print  "    TTY         Nttyb;          /* current state of the terminal */"
-       print  "    int         _baudrate;      /* used to compute padding */"
-       print  "    char *      _termname;      /* used for termname() */"
-       if (@NCURSES_EXT_COLORS@) {
-       print  "    TERMTYPE2   type2;          /* extended terminal type description */"
-       }
        print  "} TERMINAL;"
-       print  "#else"
-       print  "typedef struct term TERMINAL;"
+       print  ""
        print  "#endif /* NCURSES_INTERNALS */"
        print  ""
        print  ""
@@ -388,7 +403,7 @@ END {
        print  "/*"
        print  " * Debugging features."
        print  " */"
-       print  "extern NCURSES_EXPORT(void)    exit_terminfo(int) GCC_NORETURN;"
+       print  "extern GCC_NORETURN NCURSES_EXPORT(void)    exit_terminfo(int);"
        print  ""
        print  "#ifdef __cplusplus"
        printf "%s\n", rcurl;