ncurses 6.0 - patch 20161126
[ncurses.git] / ncurses / tinfo / lib_data.c
index 71261eda1077b24bcd5f3fbe2f1961a0e5fb4dd3..bd973e54fefd37f24368dd1771a4d90af97c7914 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2016 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -41,7 +42,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.54 2009/06/06 18:46:31 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.68 2016/11/21 23:29:14 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -113,6 +114,7 @@ NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data
 #define TGETENT_0s { TGETENT_0, TGETENT_0, TGETENT_0, TGETENT_0 }
 
 NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
+    0,                         /* have_sigtstp */
     0,                         /* have_sigwinch */
     0,                         /* cleanup_nested */
 
@@ -124,13 +126,14 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
 
     FALSE,                     /* have_tic_directory */
     FALSE,                     /* keep_tic_directory */
-    TERMINFO,                  /* tic_directory */
+    0,                         /* tic_directory */
 
     NULL,                      /* dbi_list */
     0,                         /* dbi_size */
 
     NULL,                      /* first_name */
     NULL,                      /* keyname_table */
+    0,                         /* init_keyname */
 
     0,                         /* slk_format */
 
@@ -141,6 +144,12 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     0,                         /* tgetent_index */
     0,                         /* tgetent_sequence */
 
+    0,                         /* dbd_blob */
+    0,                         /* dbd_list */
+    0,                         /* dbd_size */
+    0,                         /* dbd_time */
+    { { 0, 0 } },              /* dbd_vars */
+
 #ifndef USE_SP_WINDOWLIST
     0,                         /* _nc_windowlist */
 #endif
@@ -154,11 +163,15 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     0,                         /* safeprint_rows */
 #endif
 
+#ifdef USE_TERM_DRIVER
+    0,                         /* term_driver */
+#endif
+
 #ifdef TRACE
-    FALSE,                     /* init_trace */
     CHARS_0s,                  /* trace_fname */
     0,                         /* trace_level */
     NULL,                      /* trace_fp */
+    -1,                                /* trace_fd */
 
     NULL,                      /* tracearg_buf */
     0,                         /* tracearg_used */
@@ -188,6 +201,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     0,                         /* nested_tracef */
     0,                         /* use_pthreads */
 #endif
+#if USE_PTHREADS_EINTR
+    0,                         /* read_thread */
+#endif
 };
 
 #define STACK_FRAME_0  { { 0 }, 0 }
@@ -228,6 +244,7 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
 #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 */
@@ -240,6 +257,7 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
     NULL,                      /* _tputs_trace */
 #endif
 #endif
+    FALSE,                     /* use_tioctl */
 };
 /* *INDENT-ON* */
 
@@ -254,8 +272,7 @@ _nc_screen_of(WINDOW *win)
     SCREEN *sp = 0;
 
     if (win != 0) {
-       WINDOWLIST *wp = (WINDOWLIST *) win;
-       sp = wp->screen;
+       sp = WINDOW_EXT(win, screen);
     }
     return (sp);
 }
@@ -340,7 +357,9 @@ _nc_mutex_unlock(pthread_mutex_t * obj)
        return 0;
     return pthread_mutex_unlock(obj);
 }
+#endif /* USE_PTHREADS */
 
+#if defined(USE_PTHREADS) || USE_PTHREADS_EINTR
 #if USE_WEAK_SYMBOLS
 /*
  * NB: sigprocmask(2) is global but pthread_sigmask(3p)
@@ -352,7 +371,7 @@ _nc_sigprocmask(int how, const sigset_t * newmask, sigset_t * oldmask)
     if ((pthread_sigmask))
        return pthread_sigmask(how, newmask, oldmask);
     else
-       return sigprocmask(how, newmask, oldmask);
+       return (sigprocmask)(how, newmask, oldmask);
 }
 #endif
 #endif /* USE_PTHREADS */