X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=include%2FMKterm.h.awk.in;h=e79840d9974afede3e2a4589716a696e1f687566;hp=2c4c6d44eb3a08b260810486d1ccba3e85ea2598;hb=HEAD;hpb=ade723c546e6559187580c695f7f4637eac13125 diff --git a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in index 2c4c6d44..a93d8e86 100644 --- a/include/MKterm.h.awk.in +++ b/include/MKterm.h.awk.in @@ -26,7 +26,8 @@ BEGIN { lcurl = "{"; rcurl = "}"; print "/****************************************************************************" - print " * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. *" + print " * Copyright 2018-2021,2023 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 *" print " * copy of this software and associated documentation files (the *" @@ -59,7 +60,7 @@ BEGIN { print "/* and: Thomas E. Dickey 1995-on */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.70 2019/03/02 23:23:58 tom Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.85 2023/04/23 19:15:36 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" @@ -81,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 "" @@ -126,9 +145,14 @@ BEGIN { print "" print "#else /* !HAVE_TERMIO_H */" print "" - print "#if _WIN32" - print "# include " - print "# define TTY struct termios" + print "#if (defined(_WIN32) || defined(_WIN64))" + print "#if @EXP_WIN32_DRIVER@" + print "#include " + print "#define TTY struct winconmode" + print "#else" + print "#include " + print "#define TTY struct termios" + print "#endif" print "#else" print "#undef TERMIOS" print "#include " @@ -142,11 +166,18 @@ BEGIN { print "#ifdef TERMIOS" print "#define GET_TTY(fd, buf) tcgetattr(fd, buf)" print "#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)" + print "#elif @EXP_WIN32_DRIVER@ && (defined(_WIN32) || defined(_WIN64))" + print "#define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)" + print "#define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)" print "#else" print "#define GET_TTY(fd, buf) gtty(fd, buf)" print "#define SET_TTY(fd, buf) stty(fd, buf)" print "#endif" print "" + print "#ifndef GCC_NORETURN" + print "#define GCC_NORETURN /* nothing */" + print "#endif" + print "" print "#define NAMESIZE 256" print "" print "/* The cast works because TERMTYPE is the first data in TERMINAL */" @@ -163,7 +194,11 @@ $2 == "%%-STOP-HERE-%%" { print "/* older synonyms for some capabilities */" print "#define beehive_glitch no_esc_ctlc" print "#define teleray_glitch dest_tabs_magic_smso" + print "" + print "/* HPUX-11 uses this name rather than the standard one */" + print "#ifndef micro_char_size" print "#define micro_char_size micro_col_size" + print "#endif" print "" print "#ifdef __INTERNAL_CAPS_VISIBLE" } @@ -209,28 +244,28 @@ 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 "" + print "#undef TERMINAL" + print "#define TERMINAL struct term" + print "TERMINAL;" + print "" if (@NCURSES_EXT_COLORS@) { declare_termtype("int","2"); } else { - print "typedef TERMTYPE TERMTYPE2;" + print "#undef TERMTYPE2" + print "#define TERMTYPE2 TERMTYPE" } + 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 "" @@ -289,17 +324,15 @@ END { print "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE2 *, 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(char *) _nc_tiparm(int, const char *, ...);" + print "extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);" + print "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);" print "" print "#endif /* NCURSES_INTERNALS */" print "" - print "" print "/*" - print " * These entrypoints are used by tack." + print " * Normal entry points" print " */" - print "extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);" - print "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);" - print "" - print "/* Normal entry points */" print "extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);" print "extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);" print "" @@ -319,10 +352,11 @@ END { print "extern NCURSES_EXPORT(char *) tparm (const char *, ...); /* special */" print "#else" print "extern NCURSES_EXPORT(char *) tparm (const char *, long,long,long,long,long,long,long,long,long); /* special */" - print "extern NCURSES_EXPORT(char *) tparm_varargs (const char *, ...); /* special */" print "#endif" print "" print "extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */" + print "extern NCURSES_EXPORT(char *) tiparm_s (int, int, const char *, ...); /* special */" + print "extern NCURSES_EXPORT(int) tiscan_s (int *, int *, const char *); /* special */" print "" print "#endif /* __NCURSES_H */" print "" @@ -350,7 +384,6 @@ END { print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, const char *, ...); /* special */" print "#else" print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, const char *, long,long,long,long,long,long,long,long,long); /* special */" - print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm_varargs) (SCREEN*, const char *, ...); /* special */" print "#endif" print "" print "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */" @@ -367,6 +400,11 @@ END { print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);" print "#endif /* NCURSES_SP_FUNCS */" print "" + print "/*" + print " * Debugging features." + print " */" + print "extern GCC_NORETURN NCURSES_EXPORT(void) exit_terminfo(int);" + print "" print "#ifdef __cplusplus" printf "%s\n", rcurl; print "#endif"