1 /****************************************************************************
2 * Copyright (c) 2017 Free Software Foundation, Inc. *
4 * Permission is hereby granted, free of charge, to any person obtaining a *
5 * copy of this software and associated documentation files (the *
6 * "Software"), to deal in the Software without restriction, including *
7 * without limitation the rights to use, copy, modify, merge, publish, *
8 * distribute, distribute with modifications, sublicense, and/or sell *
9 * copies of the Software, and to permit persons to whom the Software is *
10 * furnished to do so, subject to the following conditions: *
12 * The above copyright notice and this permission notice shall be included *
13 * in all copies or substantial portions of the Software. *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 * Except as contained in this notice, the name(s) of the above copyright *
24 * holders shall not be used in advertising or otherwise to promote the *
25 * sale, use or other dealings in this Software without prior written *
27 ****************************************************************************/
29 /****************************************************************************
30 * Author: Thomas E. Dickey *
31 ****************************************************************************/
33 #include <curses.priv.h>
35 MODULE_ID("$Id: report_offsets.c,v 1.5 2017/06/03 13:52:28 tom Exp $")
37 #define show_size(type) \
38 printf("%6ld\t" #type "\n", (long)sizeof(type))
39 #define show_offset(type,member) \
40 printf("%6ld\t" #type "." #member "\n", (long)offsetof(type,member))
45 printf("Size/offsets of data structures:\n");
54 show_size(NCURSES_BOOL);
58 show_offset(SCREEN, _panelHook);
60 show_offset(SCREEN, _ttytype);
63 show_offset(SCREEN, tracechr_buf);
65 #ifdef USE_SP_WINDOWLIST
66 show_offset(SCREEN, _windowlist);
68 show_offset(SCREEN, rsp);
71 show_offset(SCREEN, _ordered_pairs);
74 show_offset(SCREEN, use_tioctl);
78 show_offset(SCREEN, _screen_acs_fix);
83 show_offset(TERMINAL, type);
84 show_offset(TERMINAL, Filedes);
86 show_offset(TERMINAL, Ottyb);
87 show_offset(TERMINAL, Nttyb);
89 show_offset(TERMINAL, _baudrate);
90 show_offset(TERMINAL, _termname);
91 #if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR
92 show_offset(TERMINAL, type2);
98 show_offset(TERMTYPE, ext_str_table);
99 show_offset(TERMTYPE, ext_Strings);
105 show_offset(WINDOW, _bkgrnd);
106 #if NCURSES_EXT_COLORS
107 show_offset(WINDOW, _color);