1 /* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Edward Wang at The University of California, Berkeley. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)value.h 8.1 (Berkeley) 06/06/93 11 */ 12 13 struct value { 14 char v_type; 15 union { 16 int V_num; 17 char *V_str; 18 } v_un; 19 }; 20 #define v_num v_un.V_num 21 #define v_str v_un.V_str 22 23 #define V_NUM 1 24 #define V_STR 2 25 #define V_ERR 3 26 27 #define val_free(v) ((v).v_type == V_STR ? str_free((v).v_str) : 0) 28