X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftrace%2Flib_tracebits.c;h=a760d13502b5c0729ef40008e84ccb6872dc1a49;hp=43b29a9496e0d44c5b984c3712f0431355ee5ecd;hb=2b7c2fd2f9d58719770902ce4d0d0aeb87b284f7;hpb=6b4f5830b7910188b532d661f79775306715f67e diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c index 43b29a94..a760d135 100644 --- a/ncurses/trace/lib_tracebits.c +++ b/ncurses/trace/lib_tracebits.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2019 Free Software Foundation, Inc. * + * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 1998-2012,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +35,7 @@ #include -MODULE_ID("$Id: lib_tracebits.c,v 1.27 2019/02/16 22:12:08 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.30 2020/09/05 22:54:47 tom Exp $") #if HAVE_SYS_TERMIO_H #include /* needed for ISC */ @@ -71,9 +72,15 @@ MODULE_ID("$Id: lib_tracebits.c,v 1.27 2019/02/16 22:12:08 tom Exp $") #ifdef TRACE +#if defined(EXP_WIN32_DRIVER) +#define BITNAMELEN 36 +#else +#define BITNAMELEN 8 +#endif + typedef struct { unsigned int val; - const char name[8]; + const char name[BITNAMELEN]; } BITNAMES; #define TRACE_BUF_SIZE(num) (_nc_globals.tracebuf_ptr[num].size) @@ -211,6 +218,36 @@ _nc_trace_ttymode(TTY * tty) if (tty->c_lflag & ALLLOCAL) lookup_bits(buf, lflags, "lflags", tty->c_lflag); } +#elif defined(EXP_WIN32_DRIVER) +#define DATA(name) { name, { #name } } + static const BITNAMES dwFlagsOut[] = + { + DATA(ENABLE_PROCESSED_OUTPUT), + DATA(ENABLE_WRAP_AT_EOL_OUTPUT), + DATA(ENABLE_VIRTUAL_TERMINAL_PROCESSING), + DATA(DISABLE_NEWLINE_AUTO_RETURN), + DATA(ENABLE_LVB_GRID_WORLDWIDE) + }; + static const BITNAMES dwFlagsIn[] = + { + DATA(ENABLE_PROCESSED_INPUT), + DATA(ENABLE_LINE_INPUT), + DATA(ENABLE_ECHO_INPUT), + DATA(ENABLE_MOUSE_INPUT), + DATA(ENABLE_INSERT_MODE), + DATA(ENABLE_QUICK_EDIT_MODE), + DATA(ENABLE_EXTENDED_FLAGS), + DATA(ENABLE_AUTO_POSITION), + DATA(ENABLE_VIRTUAL_TERMINAL_INPUT) + }; + + buf = _nc_trace_buf(0, + 8 + sizeof(dwFlagsOut) + + 8 + sizeof(dwFlagsIn)); + if (buf != 0) { + lookup_bits(buf, dwFlagsIn, "dwIn", tty->dwFlagIn); + lookup_bits(buf, dwFlagsOut, "dwOut", tty->dwFlagOut); + } #else /* reference: ttcompat(4M) on SunOS 4.1 */ #ifndef EVENP