1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 23 /* All Rights Reserved */ 24 25 26 #if defined(sun) 27 #pragma ident "@(#)name.h 1.7 05/06/08 SMI" /* SVr4.0 1.7.1.1 */ 28 #endif 29 30 #ifndef _NAME_H 31 #define _NAME_H 32 33 /* 34 * Copyright 2009-2016 J. Schilling 35 * @(#)name.h 1.9 16/07/06 2009-2016 J. Schilling 36 */ 37 /* 38 * UNIX shell 39 */ 40 41 #ifdef DO_SYSLOCAL 42 /* 43 * When implementing local shell variables, we need a separate "funcval" member 44 * to store the token to identify the scope of the local variable. 45 */ 46 #ifndef DO_POSIX_UNSET 47 #define DO_POSIX_UNSET 48 #endif 49 #endif 50 51 #define N_LOCAL 0100 /* Local node has a pushed old value */ 52 #define N_PUSHOV 0040 /* This node has a pushed old value */ 53 #define N_ENVCHG 0020 /* This was changed after env import */ 54 #define N_RDONLY 0010 /* This node is read-only forever */ 55 #define N_EXPORT 0004 /* This node will be exported to env */ 56 #define N_ENVNAM 0002 /* This node was imported from env */ 57 #define N_FUNCTN 0001 /* This is a function, not a param */ 58 59 #define N_DEFAULT 0 /* No attributes (yet) */ 60 61 struct namnod 62 { 63 struct namnod *namlft; /* Left name tree */ 64 struct namnod *namrgt; /* Right name tree */ 65 struct namnod *nampush; /* Pushed old value */ 66 unsigned char *namid; /* Node name, e.g. "HOME" */ 67 unsigned char *namval; /* Node value, e.g. "/home/joe" */ 68 unsigned char *namenv; /* Imported value or function node */ 69 #ifdef DO_POSIX_UNSET 70 unsigned char *funcval; /* Function node when in POSIX mode */ 71 #endif 72 int namflg; /* Flags, see above */ 73 }; 74 75 #ifndef DO_POSIX_UNSET 76 #define funcval namenv 77 #endif 78 79 #endif /* _NAME_H */ 80