15796c8dcSSimon Schubert /* Header for environment manipulation library. 2*ef5ccd6cSJohn Marino Copyright (C) 1989-2013 Free Software Foundation, Inc. 35796c8dcSSimon Schubert 45796c8dcSSimon Schubert This program is free software; you can redistribute it and/or modify 55796c8dcSSimon Schubert it under the terms of the GNU General Public License as published by 65796c8dcSSimon Schubert the Free Software Foundation; either version 3 of the License, or 75796c8dcSSimon Schubert (at your option) any later version. 85796c8dcSSimon Schubert 95796c8dcSSimon Schubert This program is distributed in the hope that it will be useful, 105796c8dcSSimon Schubert but WITHOUT ANY WARRANTY; without even the implied warranty of 115796c8dcSSimon Schubert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 125796c8dcSSimon Schubert GNU General Public License for more details. 135796c8dcSSimon Schubert 145796c8dcSSimon Schubert You should have received a copy of the GNU General Public License 155796c8dcSSimon Schubert along with this program. If not, see <http://www.gnu.org/licenses/>. */ 165796c8dcSSimon Schubert 175796c8dcSSimon Schubert #if !defined (ENVIRON_H) 185796c8dcSSimon Schubert #define ENVIRON_H 1 195796c8dcSSimon Schubert 205796c8dcSSimon Schubert /* We manipulate environments represented as these structures. */ 215796c8dcSSimon Schubert 225796c8dcSSimon Schubert struct gdb_environ 235796c8dcSSimon Schubert { 245796c8dcSSimon Schubert /* Number of usable slots allocated in VECTOR. 255796c8dcSSimon Schubert VECTOR always has one slot not counted here, 265796c8dcSSimon Schubert to hold the terminating zero. */ 275796c8dcSSimon Schubert int allocated; 285796c8dcSSimon Schubert /* A vector of slots, ALLOCATED + 1 of them. 295796c8dcSSimon Schubert The first few slots contain strings "VAR=VALUE" 305796c8dcSSimon Schubert and the next one contains zero. 315796c8dcSSimon Schubert Then come some unused slots. */ 325796c8dcSSimon Schubert char **vector; 335796c8dcSSimon Schubert }; 345796c8dcSSimon Schubert 355796c8dcSSimon Schubert extern struct gdb_environ *make_environ (void); 365796c8dcSSimon Schubert 375796c8dcSSimon Schubert extern void free_environ (struct gdb_environ *); 385796c8dcSSimon Schubert 395796c8dcSSimon Schubert extern void init_environ (struct gdb_environ *); 405796c8dcSSimon Schubert 415796c8dcSSimon Schubert extern char *get_in_environ (const struct gdb_environ *, const char *); 425796c8dcSSimon Schubert 435796c8dcSSimon Schubert extern void set_in_environ (struct gdb_environ *, const char *, const char *); 445796c8dcSSimon Schubert 455796c8dcSSimon Schubert extern void unset_in_environ (struct gdb_environ *, char *); 465796c8dcSSimon Schubert 475796c8dcSSimon Schubert extern char **environ_vector (struct gdb_environ *); 485796c8dcSSimon Schubert 495796c8dcSSimon Schubert #endif /* defined (ENVIRON_H) */ 50