#include #define ui32_t unsigned int #define ui16_t unsigned short int #define a_TERMCAP_ENT_MAX 10 struct n_string{ ui32_t s_len; /* gth of string */ ui32_t s_size; /* of .s_dat, -1 */ char *s_dat; /* May contain NULs, not automatically terminated */ }; struct a_termcap_ent{ ui16_t te_flags; ui16_t te_off; /* in a_termcap_g->tg_buf / value for T_BOOL and T_NUM */ }; struct a_termcap_g{ struct a_termcap_ext_ent *tg_ext_ents; /* List of extended queries */ struct a_termcap_ent tg_ents[a_TERMCAP_ENT_MAX]; char *tg_buf_tail; /* Current cast-off in data storage */ char *tg_lib_buf; /* Shall tgetent(3) need buffer, that it is */ struct n_string tg_buf; /* Storage for just about anything */ }; int main(void){ struct a_termcap_g o; printf("%u\n", (ui32_t)((char*)0x10 - o.tg_buf)); return 0; }