ncurses 5.6 - patch 20080223
[ncurses.git] / ncurses / tinfo / lib_data.c
index 225935ea79f084b8e62e55d978ffd1f4a4fafbd9..e3affe40ee86c7709998a910e3655182efab170c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2008 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            *
@@ -41,7 +41,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.34 2007/10/20 21:49:10 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.40 2008/02/23 21:23:44 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -109,7 +109,7 @@ NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data
 #define CHARS_0s { '\0' }
 
 #define TGETENT_0 { 0L, FALSE, NULL, NULL, NULL }
-#define TGETENT_0s { TGETENT_0, TGETENT_0, TGETENT_0, TGETENT_0 } 
+#define TGETENT_0s { TGETENT_0, TGETENT_0, TGETENT_0, TGETENT_0 }
 
 NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     0,                         /* have_sigwinch */
@@ -131,6 +131,8 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     NULL,                      /* first_name */
     NULL,                      /* keyname_table */
 
+    0,                         /* slk_format */
+
     NULL,                      /* safeprint_buf */
     0,                         /* safeprint_used */
 
@@ -169,18 +171,16 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     NULL,                      /* tracetry_buf */
     0,                         /* tracetry_used */
 
-#ifndef USE_TERMLIB
     { CHARS_0s, CHARS_0s },    /* traceatr_color_buf */
     0,                         /* traceatr_color_sel */
     -1,                                /* traceatr_color_last */
-#endif /* USE_TERMLIB */
 
 #endif /* TRACE */
 #ifdef USE_PTHREADS
-    PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,    /* mutex_set_SP */
-    PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,    /* mutex_use_screen */
-    PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,    /* mutex_use_window */
-    PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,    /* mutex_windowlist */
+    PTHREAD_MUTEX_INITIALIZER, /* mutex_set_SP */
+    PTHREAD_MUTEX_INITIALIZER, /* mutex_use_screen */
+    PTHREAD_MUTEX_INITIALIZER, /* mutex_use_window */
+    PTHREAD_MUTEX_INITIALIZER, /* mutex_windowlist */
     PTHREAD_MUTEX_INITIALIZER, /* mutex_tst_tracef */
     PTHREAD_MUTEX_INITIALIZER, /* mutex_tracef */
     0,                         /* nested_tracef */
@@ -191,7 +191,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
 #define STACK_FRAME_0s { STACK_FRAME_0 }
 #define NUM_VARS_0s    { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
 
-#define RIPOFF_0       { 0,0 }
+#define RIPOFF_0       { 0,0,0 }
 #define RIPOFF_0s      { RIPOFF_0 }
 
 NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
@@ -231,3 +231,34 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
 #endif
 };
 /* *INDENT-ON* */
+
+/******************************************************************************/
+#ifdef USE_PTHREADS
+NCURSES_EXPORT(void)
+_nc_mutex_init(pthread_mutex_t * obj)
+{
+    pthread_mutexattr_t recattr;
+
+    memset(&recattr, 0, sizeof(recattr));
+    pthread_mutexattr_settype(&recattr, PTHREAD_MUTEX_NORMAL);
+    pthread_mutex_init(obj, &recattr);
+}
+
+NCURSES_EXPORT(int)
+_nc_mutex_lock(pthread_mutex_t * obj)
+{
+    return pthread_mutex_lock(obj);
+}
+
+NCURSES_EXPORT(int)
+_nc_mutex_trylock(pthread_mutex_t * obj)
+{
+    return pthread_mutex_trylock(obj);
+}
+
+NCURSES_EXPORT(int)
+_nc_mutex_unlock(pthread_mutex_t * obj)
+{
+    return pthread_mutex_unlock(obj);
+}
+#endif /* USE_PTHREADS */