/****************************************************************************
- * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2003,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 *
#include <term_entry.h>
#include <tic.h>
-MODULE_ID("$Id: lib_ti.c,v 1.23 2003/05/24 21:10:28 tom Exp $")
+MODULE_ID("$Id: lib_ti.c,v 1.24 2009/04/18 17:37:50 tom Exp $")
NCURSES_EXPORT(int)
-tigetflag(NCURSES_CONST char *str)
+NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str)
{
unsigned i;
- T((T_CALLED("tigetflag(%s)"), str));
+ T((T_CALLED("tigetflag(%p, %s)"), SP_PARM, str));
- if (cur_term != 0) {
- TERMTYPE *tp = &(cur_term->type);
+ if (HasTInfoTerminal(SP_PARM)) {
+ TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
for_each_boolean(i, tp) {
const char *capname = ExtBoolname(tp, i, boolnames);
if (!strcmp(str, capname)) {
returnCode(ABSENT_BOOLEAN);
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
-tigetnum(NCURSES_CONST char *str)
+tigetflag(NCURSES_CONST char *str)
+{
+ return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str)
{
unsigned i;
- T((T_CALLED("tigetnum(%s)"), str));
+ T((T_CALLED("tigetnum(%p, %s)"), SP_PARM, str));
- if (cur_term != 0) {
- TERMTYPE *tp = &(cur_term->type);
+ if (HasTInfoTerminal(SP_PARM)) {
+ TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
for_each_number(i, tp) {
const char *capname = ExtNumname(tp, i, numnames);
if (!strcmp(str, capname)) {
returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tigetnum(NCURSES_CONST char *str)
+{
+ return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str);
+}
+#endif
+
NCURSES_EXPORT(char *)
-tigetstr(NCURSES_CONST char *str)
+NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str)
{
unsigned i;
- T((T_CALLED("tigetstr(%s)"), str));
+ T((T_CALLED("tigetstr(%p, %s)"), SP_PARM, str));
- if (cur_term != 0) {
- TERMTYPE *tp = &(cur_term->type);
+ if (HasTInfoTerminal(SP_PARM)) {
+ TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
for_each_string(i, tp) {
const char *capname = ExtStrname(tp, i, strnames);
if (!strcmp(str, capname)) {
returnPtr(CANCELLED_STRING);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+tigetstr(NCURSES_CONST char *str)
+{
+ return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str);
+}
+#endif