X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_data.c;h=39274f4e7c39c923688edf9f63fefc0009ad4cc7;hp=c1e2911af91996f7d38ea57e772ebff86f8ee93b;hb=7503e8d82292a2a0a4d8bb55bdf3f8a203159f68;hpb=5e1e572b71ae31a6071daa24e2460a68a6f1003c diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index c1e2911a..39274f4e 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright 2018,2020 Thomas E. Dickey * + * Copyright 1998-2016,2017 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 * @@ -42,7 +43,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.72 2017/04/10 08:34:31 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.81 2020/06/13 22:01:14 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -139,6 +140,8 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* slk_format */ + 2048, /* getstr_limit */ + NULL, /* safeprint_buf */ 0, /* safeprint_used */ @@ -152,6 +155,15 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* dbd_time */ { { 0, 0 } }, /* dbd_vars */ +#if HAVE_TSEARCH + NULL, /* cached_tparm */ + 0, /* count_tparm */ +#endif /* HAVE_TSEARCH */ + +#ifdef USE_TERM_DRIVER + 0, /* term_driver */ +#endif + #ifndef USE_SP_WINDOWLIST 0, /* _nc_windowlist */ #endif @@ -165,10 +177,22 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* safeprint_rows */ #endif -#ifdef USE_TERM_DRIVER - 0, /* term_driver */ +#ifdef USE_PTHREADS + PTHREAD_MUTEX_INITIALIZER, /* mutex_curses */ + PTHREAD_MUTEX_INITIALIZER, /* mutex_prescreen */ + PTHREAD_MUTEX_INITIALIZER, /* mutex_screen */ + PTHREAD_MUTEX_INITIALIZER, /* mutex_update */ + PTHREAD_MUTEX_INITIALIZER, /* mutex_tst_tracef */ + PTHREAD_MUTEX_INITIALIZER, /* mutex_tracef */ + 0, /* nested_tracef */ + 0, /* use_pthreads */ +#if USE_PTHREADS_EINTR + 0, /* read_thread */ +#endif +#endif +#if USE_WIDEC_SUPPORT + CHARS_0s, /* key_name */ #endif - #ifdef TRACE FALSE, /* trace_opened */ CHARS_0s, /* trace_fname */ @@ -197,18 +221,8 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* nested_tracef */ #endif #endif /* TRACE */ -#ifdef USE_PTHREADS - PTHREAD_MUTEX_INITIALIZER, /* mutex_curses */ - PTHREAD_MUTEX_INITIALIZER, /* mutex_tst_tracef */ - PTHREAD_MUTEX_INITIALIZER, /* mutex_tracef */ - 0, /* nested_tracef */ - 0, /* use_pthreads */ -#endif -#if USE_PTHREADS_EINTR - 0, /* read_thread */ -#endif -#if USE_WIDEC_SUPPORT - CHARS_0s, /* key_name */ +#if NO_LEAKS + FALSE, /* leak_checking */ #endif }; @@ -224,14 +238,7 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { TRUE, /* use_env */ FALSE, /* filter_mode */ A_NORMAL, /* previous_attr */ -#ifndef USE_SP_RIPOFF - RIPOFF_0s, /* ripoff */ - NULL, /* rsp */ -#endif { /* tparm_state */ -#ifdef TRACE - NULL, /* tname */ -#endif NULL, /* tparam_base */ STACK_FRAME_0s, /* stack */ @@ -246,12 +253,20 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { NUM_VARS_0s, /* dynamic_var */ NUM_VARS_0s, /* static_vars */ +#ifdef TRACE + NULL, /* tname */ +#endif }, NULL, /* saved_tty */ + FALSE, /* use_tioctl */ + 0, /* _outch */ +#ifndef USE_SP_RIPOFF + RIPOFF_0s, /* ripoff */ + NULL, /* rsp */ +#endif #if NCURSES_NO_PADDING FALSE, /* flag to set if padding disabled */ #endif - 0, /* _outch */ #if BROKEN_LINKER || USE_REENTRANT NULL, /* real_acs_map */ 0, /* LINES */ @@ -259,12 +274,13 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { 8, /* TABSIZE */ 1000, /* ESCDELAY */ 0, /* cur_term */ +#endif #ifdef TRACE +#if BROKEN_LINKER || USE_REENTRANT 0L, /* _outchars */ NULL, /* _tputs_trace */ #endif #endif - FALSE, /* use_tioctl */ }; /* *INDENT-ON* */ @@ -294,6 +310,9 @@ init_global_mutexes(void) if (!initialized) { initialized = TRUE; _nc_mutex_init(&_nc_globals.mutex_curses); + _nc_mutex_init(&_nc_globals.mutex_prescreen); + _nc_mutex_init(&_nc_globals.mutex_screen); + _nc_mutex_init(&_nc_globals.mutex_update); _nc_mutex_init(&_nc_globals.mutex_tst_tracef); _nc_mutex_init(&_nc_globals.mutex_tracef); }