]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_termcap.c
ncurses 5.7 - patch 20090523
[ncurses.git] / ncurses / tinfo / lib_termcap.c
index 2d245ffbb61f345db2ca0741134ca3c7c6804f84..fbaacb425364d9573d052e4909a1917e51039401 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 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                                                 *
  *                                                                          *
  * some of the code in here was contributed by:                             *
  * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93)                      *
 
 #include <term_entry.h>
 
-MODULE_ID("$Id: lib_termcap.c,v 1.63 2008/08/16 19:22:55 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_termcap.c,v 1.66 2009/05/23 23:47:34 tom Exp $")
 
 NCURSES_EXPORT_VAR(char *) UP = 0;
 NCURSES_EXPORT_VAR(char *) BC = 0;
@@ -76,7 +81,7 @@ NCURSES_EXPORT_VAR(char *) BC = 0;
  ***************************************************************************/
 
 NCURSES_EXPORT(int)
-tgetent(char *bufp, const char *name)
+NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name)
 {
     int errcode;
     int n;
@@ -111,7 +116,7 @@ tgetent(char *bufp, const char *name)
             */
            if (LAST_TRM != 0 && LAST_TRM != cur_term) {
                TERMINAL *trm = LAST_TRM;
-               del_curterm(LAST_TRM);
+               NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM);
                for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx)
                    if (LAST_TRM == trm)
                        LAST_TRM = 0;
@@ -164,8 +169,8 @@ tgetent(char *bufp, const char *name)
        LAST_BUF = bufp;
        LAST_USE = TRUE;
 
-       SetNoPadding(SP);
-       (void) baudrate();      /* sets ospeed as a side-effect */
+       SetNoPadding(SP_PARM);
+       (void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);      /* sets ospeed as a side-effect */
 
 /* LINT_PREPRO
 #if 0*/
@@ -177,6 +182,14 @@ tgetent(char *bufp, const char *name)
     returnCode(errcode);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tgetent(char *bufp, const char *name)
+{
+    return NCURSES_SP_NAME(tgetent) (CURRENT_SCREEN, bufp, name);
+}
+#endif
+
 /***************************************************************************
  *
  * tgetflag(str)
@@ -187,7 +200,7 @@ tgetent(char *bufp, const char *name)
  ***************************************************************************/
 
 NCURSES_EXPORT(int)
-tgetflag(NCURSES_CONST char *id)
+NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id)
 {
     unsigned i;
 
@@ -205,6 +218,14 @@ tgetflag(NCURSES_CONST char *id)
     returnCode(0);             /* Solaris does this */
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tgetflag(NCURSES_CONST char *id)
+{
+    return NCURSES_SP_NAME(tgetflag) (CURRENT_SCREEN, id);
+}
+#endif
+
 /***************************************************************************
  *
  * tgetnum(str)
@@ -215,7 +236,7 @@ tgetflag(NCURSES_CONST char *id)
  ***************************************************************************/
 
 NCURSES_EXPORT(int)
-tgetnum(NCURSES_CONST char *id)
+NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id)
 {
     unsigned i;
 
@@ -234,6 +255,14 @@ tgetnum(NCURSES_CONST char *id)
     returnCode(ABSENT_NUMERIC);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tgetnum(NCURSES_CONST char *id)
+{
+    return NCURSES_SP_NAME(tgetnum) (CURRENT_SCREEN, id);
+}
+#endif
+
 /***************************************************************************
  *
  * tgetstr(str, area)
@@ -244,7 +273,7 @@ tgetnum(NCURSES_CONST char *id)
  ***************************************************************************/
 
 NCURSES_EXPORT(char *)
-tgetstr(NCURSES_CONST char *id, char **area)
+NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area)
 {
     unsigned i;
     char *result = NULL;
@@ -278,6 +307,14 @@ tgetstr(NCURSES_CONST char *id, char **area)
     returnPtr(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+tgetstr(NCURSES_CONST char *id, char **area)
+{
+    return NCURSES_SP_NAME(tgetstr) (CURRENT_SCREEN, id, area);
+}
+#endif
+
 #if NO_LEAKS
 NCURSES_EXPORT(void)
 _nc_tgetent_leaks(void)