]> ncurses.scripts.mit.edu Git - ncurses.git/blob - ncurses/lib_ti.c
ncurses 4.1
[ncurses.git] / ncurses / lib_ti.c
1
2 /***************************************************************************
3 *                            COPYRIGHT NOTICE                              *
4 ****************************************************************************
5 *                ncurses is copyright (C) 1992-1995                        *
6 *                          Zeyd M. Ben-Halim                               *
7 *                          zmbenhal@netcom.com                             *
8 *                          Eric S. Raymond                                 *
9 *                          esr@snark.thyrsus.com                           *
10 *                                                                          *
11 *        Permission is hereby granted to reproduce and distribute ncurses  *
12 *        by any means and for any fee, whether alone or as part of a       *
13 *        larger distribution, in source or in binary form, PROVIDED        *
14 *        this notice is included with any such distribution, and is not    *
15 *        removed from any of its header files. Mention of ncurses in any   *
16 *        applications linked with it is highly appreciated.                *
17 *                                                                          *
18 *        ncurses comes AS IS with no warranty, implied or expressed.       *
19 *                                                                          *
20 ***************************************************************************/
21
22
23 #include <curses.priv.h>
24
25 #include <term.h>
26 #include <tic.h>
27
28 MODULE_ID("$Id: lib_ti.c,v 1.7 1996/12/21 14:24:06 tom Exp $")
29
30 int tigetflag(const char *str)
31 {
32 int i;
33
34         T(("tigetflag(%s)", str));
35
36         for (i = 0; i < BOOLCOUNT; i++)
37                 if (!strcmp(str, boolnames[i]))
38                         return cur_term->type.Booleans[i];
39
40         return ABSENT_BOOLEAN;
41 }
42
43 int tigetnum(const char *str)
44 {
45 int i;
46
47         T(("tigetnum(%s)", str));
48
49         for (i = 0; i < NUMCOUNT; i++)
50                 if (!strcmp(str, numnames[i]))
51                         return cur_term->type.Numbers[i];
52
53         return CANCELLED_NUMERIC;
54 }
55
56 char *tigetstr(const char *str)
57 {
58 int i;
59
60         T(("tigetstr(%s)", str));
61
62         for (i = 0; i < STRCOUNT; i++)
63                 if (!strcmp(str, strnames[i]))
64                         return cur_term->type.Strings[i];
65
66         return CANCELLED_STRING;
67 }