X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_data.c;h=b817f49bd78a78c76c48526f4c2ea90ce5b1019d;hb=bd2d9c5734d2c66abe0b2ddd766695b200c154fe;hp=8ee481c6bbf61f3c0d477879baa99c7d0aba9f4a;hpb=2017ab0e60ca857accae38a01252e0cbdf5f1efe;p=ncurses.git diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index 8ee481c6..b817f49b 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * + * Copyright 2018-2022,2024 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.78 2018/03/01 18:09:21 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.89 2024/02/24 18:11:38 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -139,12 +140,15 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* slk_format */ + 2048, /* getstr_limit */ + NULL, /* safeprint_buf */ 0, /* safeprint_used */ TGETENT_0s, /* tgetent_cache */ 0, /* tgetent_index */ 0, /* tgetent_sequence */ + 0, /* terminal_count */ 0, /* dbd_blob */ 0, /* dbd_list */ @@ -152,6 +156,11 @@ 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 @@ -187,7 +196,6 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { #endif #ifdef TRACE FALSE, /* trace_opened */ - CHARS_0s, /* trace_fname */ 0, /* trace_level */ NULL, /* trace_fp */ -1, /* trace_fd */ @@ -243,7 +251,6 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { NULL, /* fmt_buff */ 0, /* fmt_size */ - NUM_VARS_0s, /* dynamic_var */ NUM_VARS_0s, /* static_vars */ #ifdef TRACE NULL, /* tname */ @@ -355,25 +362,28 @@ _nc_mutex_init(pthread_mutex_t * obj) NCURSES_EXPORT(int) _nc_mutex_lock(pthread_mutex_t * obj) { - if (_nc_use_pthreads == 0) - return 0; - return pthread_mutex_lock(obj); + int rc = 0; + if (_nc_use_pthreads != 0) + rc = pthread_mutex_lock(obj); + return rc; } NCURSES_EXPORT(int) _nc_mutex_trylock(pthread_mutex_t * obj) { - if (_nc_use_pthreads == 0) - return 0; - return pthread_mutex_trylock(obj); + int rc = 0; + if (_nc_use_pthreads != 0) + rc = pthread_mutex_trylock(obj); + return rc; } NCURSES_EXPORT(int) _nc_mutex_unlock(pthread_mutex_t * obj) { - if (_nc_use_pthreads == 0) - return 0; - return pthread_mutex_unlock(obj); + int rc = 0; + if (_nc_use_pthreads != 0) + rc = pthread_mutex_unlock(obj); + return rc; } #endif /* USE_PTHREADS */