X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_ti.c;h=355310ec778cecae99259ae9b96a4aa02ba4559d;hp=df460f953ea71aa081ee0e8e397c7b802dddd826;hb=404cc3f5b0751dd219565139f825c5a4d445f651;hpb=a8987e73ec254703634802b4f7ee30d3a485524d diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c index df460f95..355310ec 100644 --- a/ncurses/tinfo/lib_ti.c +++ b/ncurses/tinfo/lib_ti.c @@ -1,5 +1,5 @@ /**************************************************************************** - * 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 * @@ -36,17 +36,17 @@ #include #include -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)) { @@ -59,15 +59,23 @@ tigetflag(NCURSES_CONST char *str) 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)) { @@ -81,15 +89,23 @@ tigetnum(NCURSES_CONST char *str) 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)) { @@ -101,3 +117,11 @@ tigetstr(NCURSES_CONST char *str) returnPtr(CANCELLED_STRING); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +tigetstr(NCURSES_CONST char *str) +{ + return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str); +} +#endif