119370Spst/* Header for environment manipulation library. 298944Sobrien Copyright 1989, 1992, 2000 Free Software Foundation, Inc. 319370Spst 498944Sobrien This program is free software; you can redistribute it and/or modify 598944Sobrien it under the terms of the GNU General Public License as published by 698944Sobrien the Free Software Foundation; either version 2 of the License, or 798944Sobrien (at your option) any later version. 819370Spst 998944Sobrien This program is distributed in the hope that it will be useful, 1098944Sobrien but WITHOUT ANY WARRANTY; without even the implied warranty of 1198944Sobrien MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1298944Sobrien GNU General Public License for more details. 1319370Spst 1498944Sobrien You should have received a copy of the GNU General Public License 1598944Sobrien along with this program; if not, write to the Free Software 1698944Sobrien Foundation, Inc., 59 Temple Place - Suite 330, 1798944Sobrien Boston, MA 02111-1307, USA. */ 1819370Spst 1919370Spst#if !defined (ENVIRON_H) 2019370Spst#define ENVIRON_H 1 2119370Spst 2219370Spst/* We manipulate environments represented as these structures. */ 2319370Spst 2419370Spststruct environ 2598944Sobrien { 2698944Sobrien /* Number of usable slots allocated in VECTOR. 2798944Sobrien VECTOR always has one slot not counted here, 2898944Sobrien to hold the terminating zero. */ 2998944Sobrien int allocated; 3098944Sobrien /* A vector of slots, ALLOCATED + 1 of them. 3198944Sobrien The first few slots contain strings "VAR=VALUE" 3298944Sobrien and the next one contains zero. 3398944Sobrien Then come some unused slots. */ 3498944Sobrien char **vector; 3598944Sobrien }; 3619370Spst 3798944Sobrienextern struct environ *make_environ (void); 3819370Spst 3998944Sobrienextern void free_environ (struct environ *); 4019370Spst 4198944Sobrienextern void init_environ (struct environ *); 4219370Spst 4398944Sobrienextern char *get_in_environ (const struct environ *, const char *); 4419370Spst 4598944Sobrienextern void set_in_environ (struct environ *, const char *, const char *); 4619370Spst 4798944Sobrienextern void unset_in_environ (struct environ *, char *); 4819370Spst 4998944Sobrienextern char **environ_vector (struct environ *); 5019370Spst 5198944Sobrien#endif /* defined (ENVIRON_H) */ 52