1
|
1 // terminals.cc -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef __GNUG__ |
|
25 #pragma implementation |
|
26 #endif |
|
27 |
|
28 #include <stddef.h> |
|
29 #include <strings.h> |
|
30 #include "terminals.h" |
|
31 |
|
32 /* |
|
33 * It would be nice to be able to get these directly from gnuplot |
|
34 * during the configuration/build procedure. |
|
35 */ |
|
36 static char *valid_terminals[] = |
|
37 { |
|
38 "unknown", |
|
39 "table", |
|
40 "dumb", |
|
41 "aed512", |
|
42 "aed767", |
|
43 "bitgraph", |
|
44 "dxy800a", |
|
45 "eepic", |
|
46 "emtex", |
|
47 "epson_60dpi", |
|
48 "epson_lx800", |
|
49 "fig", |
|
50 "bfig", |
|
51 "hp2623A", |
|
52 "hp2648", |
|
53 "hp7580B", |
|
54 "hpgl", |
|
55 "hpljii", |
|
56 "hpdj", |
|
57 "pcl5_port", |
|
58 "pcl5_land", |
|
59 "imagen", |
|
60 "kc_tek40", |
|
61 "km_tek40", |
|
62 "latex", |
|
63 "nec_cp6m", |
|
64 "nec_cp6c", |
|
65 "nec_cp6d", |
|
66 "pbm", |
|
67 "pgm", |
|
68 "ppm", |
|
69 "postscript", |
|
70 "prescribe", |
|
71 "kyo", |
|
72 "qms", |
|
73 "regis", |
|
74 "selanar", |
|
75 "starc", |
|
76 "tandy_60dpi", |
|
77 "tek410", |
|
78 "tek40", |
|
79 "unixplot", |
|
80 "vx384", |
|
81 "vttek", |
|
82 "x11", |
|
83 "X11", |
|
84 (char *) NULL, |
|
85 }; |
|
86 |
|
87 /* |
|
88 * Is the given terminal named in the list above? |
|
89 */ |
|
90 int |
|
91 valid_terminal (char *term) |
|
92 { |
|
93 if (term == (char *) NULL) |
|
94 return 0; |
|
95 |
|
96 for (char **t_list = valid_terminals; *t_list != (char *) NULL; t_list++) |
|
97 { |
|
98 char *t = *t_list; |
|
99 int len = strlen (t); |
|
100 if (strncmp (term, t, len) == 0) |
|
101 return 1; |
|
102 } |
|
103 return 0; |
|
104 } |
|
105 |
|
106 /* |
|
107 ;;; Local Variables: *** |
|
108 ;;; mode: C++ *** |
|
109 ;;; page-delimiter: "^/\\*" *** |
|
110 ;;; End: *** |
|
111 */ |