Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtksh / basetbl.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: basetbl.c /main/3 1995/11/01 15:50:27 rswiston $ */
24 /** %W% **/
25
26 /*      Copyright (c) 1991, 1992 UNIX System Laboratories, Inc.   */
27 /*      All Rights Reserved     */
28
29 /*      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF UNIX System Laboratories, Inc.    */
30 /*      The copyright notice above does not evidence any       */
31 /*      actual or intended publication of such source code.    */
32
33 #include "stdio.h"
34 #include <sys/types.h>
35 #include "exksh.h"
36 #include "msgs.h"
37
38 /*
39  * Declare all strings in one place to avoid duplication
40  */
41 char STR_uint[] = "uint";
42 static char STR_intp[] = "intp";
43 static char STR_int[] = "int";
44 static char STR_dint[] = "dint";
45 char STR_unsigned_long[] = "unsigned_long";
46 static char STR_longp[] = "longp";
47 static char STR_long[] = "long";
48 static char STR_dlong[] = "dlong";
49 static char STR_ushort[] = "ushort";
50 static char STR_short[] = "short";
51 static char STR_dshort[] = "dshort";
52 static char STR_unchar[] = "unchar";
53 static char STR_char[] = "char";
54 char STR_string_t[] = "string_t";
55
56 struct memtbl T_uint[] = {
57         { (char *) STR_uint, (char *) STR_uint, K_INT, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(uint), 0 }, NULL
58 };
59 struct memtbl T_dint[] = {
60         { (char *) STR_dint, (char *) STR_dint, K_DINT, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(int) },  NULL
61 };
62 struct memtbl T_int[] = {
63         { (char *) STR_int, (char *) STR_int, K_INT, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(int) },  NULL
64 };
65 struct memtbl T_intp[] = {
66         { (char *) STR_intp, (char *) STR_intp, K_INT, F_SIMPLE, -1, 1, 0, 0, 0, 0, sizeof(int) },  NULL
67 };
68 struct memtbl T_unsigned_long[] = {
69         { (char *) STR_unsigned_long, (char *) STR_unsigned_long, K_LONG, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(unsigned long), 0 }, NULL
70 };
71 struct memtbl T_long[] = {
72         { (char *) STR_long, (char *) STR_long, K_LONG, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(long) },  NULL
73 };
74 struct memtbl T_dlong[] = {
75         { (char *) STR_dlong, (char *) STR_dlong, K_DLONG, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(long) },  NULL
76 };
77 struct memtbl T_longp[] = {
78         { (char *) STR_longp, (char *) STR_longp, K_LONG, F_SIMPLE, -1, 1, 0, 0, 0, 0, sizeof(long) },  NULL
79 };
80 struct memtbl T_ushort[] = {
81         { (char *) STR_ushort, (char *) STR_ushort, K_SHORT, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(ushort) },  NULL
82 };
83 struct memtbl T_short[] = {
84         { (char *) STR_dshort, (char *) STR_dshort, K_DSHORT, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(short) },  NULL
85 };
86 struct memtbl T_dshort[] = {
87         { (char *) STR_short, (char *) STR_short, K_SHORT, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(short) },  NULL
88 };
89 struct memtbl T_unchar[] = {
90         { (char *) STR_unchar, (char *) STR_unchar, K_CHAR, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(unsigned char) },  NULL
91 };
92 struct memtbl T_char[] = {
93         { (char *) STR_char, (char *) STR_char, K_CHAR, F_SIMPLE, -1, 0, 0, 0, 0, 0, sizeof(char) },  NULL
94 };
95 struct memtbl T_string_t[] = {
96         { (char *) STR_string_t, (char *) STR_string_t, K_STRING, F_TYPE_IS_PTR, -1, 0, 0, -1, 0, 0, sizeof(char *) },  NULL
97 };
98 struct memtbl *basemems[] = {
99         T_uint,
100         T_int,
101         T_dint,
102         T_intp,
103         T_unsigned_long,
104         T_long,
105         T_dlong,
106         T_longp,
107         T_ushort,
108         T_short,
109         T_dshort,
110         T_unchar,
111         T_char,
112         T_string_t,
113         NULL
114 };
115
116 struct symarray basedefs[] = {
117         { "PRDECIMAL", PRDECIMAL },
118         { "PRHEX", PRHEX },
119         { "PRMIXED", PRMIXED },
120         { "PRMIXED_SYMBOLIC", PRMIXED_SYMBOLIC },
121         { "PRNAMES", PRNAMES },
122         { "PRSYMBOLIC", PRSYMBOLIC },
123         { NULL, 0 }
124 };