xref: /original-bsd/usr.bin/window/value.h (revision 1a56dd2c)
1 /*
2  * Copyright (c) 1983 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of California at Berkeley. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  *
12  *	@(#)value.h	3.6 (Berkeley) 02/21/88
13  */
14 
15 struct value {
16 	char v_type;
17 	union {
18 		int V_num;
19 		char *V_str;
20 	} v_un;
21 };
22 #define v_num	v_un.V_num
23 #define v_str	v_un.V_str
24 
25 #define V_NUM	1
26 #define V_STR	2
27 #define V_ERR	3
28 
29 #define val_free(v)	((v).v_type == V_STR ? str_free((v).v_str) : 0)
30