]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_data.c
ncurses 6.3 - patch 20220724
[ncurses.git] / ncurses / tinfo / lib_data.c
index 860c247f84f4e04f062b6a79f6b5badc59c5945f..6f6c583a1fc35e583d76b06115d3b2e4488a23ba 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
+ * Copyright 2018-2021,2022 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 <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.79 2018/09/01 19:36:39 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.87 2022/07/09 22:03:21 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -147,6 +148,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     TGETENT_0s,                        /* tgetent_cache */
     0,                         /* tgetent_index */
     0,                         /* tgetent_sequence */
+    0,                         /* terminal_count */
 
     0,                         /* dbd_blob */
     0,                         /* dbd_list */
@@ -154,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
@@ -245,7 +252,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 */
@@ -357,25 +363,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 */