xref: /csrg-svn/usr.bin/window/value.h (revision 62471)
115571Sedward /*
2*62471Sbostic  * Copyright (c) 1983, 1993
3*62471Sbostic  *	The Regents of the University of California.  All rights reserved.
433514Sbostic  *
542954Sbostic  * This code is derived from software contributed to Berkeley by
642954Sbostic  * Edward Wang at The University of California, Berkeley.
742954Sbostic  *
842835Sbostic  * %sccs.include.redist.c%
933514Sbostic  *
10*62471Sbostic  *	@(#)value.h	8.1 (Berkeley) 06/06/93
1115571Sedward  */
1215571Sedward 
1315571Sedward struct value {
1415571Sedward 	char v_type;
1515571Sedward 	union {
1615571Sedward 		int V_num;
1715571Sedward 		char *V_str;
1815571Sedward 	} v_un;
1915571Sedward };
2015571Sedward #define v_num	v_un.V_num
2115571Sedward #define v_str	v_un.V_str
2215571Sedward 
2315571Sedward #define V_NUM	1
2415571Sedward #define V_STR	2
2515668Sedward #define V_ERR	3
2615843Sedward 
2715843Sedward #define val_free(v)	((v).v_type == V_STR ? str_free((v).v_str) : 0)
28