gdb/environ.h - gdb

Data types defined

Macros defined

Source code

  1. /* Header for environment manipulation library.
  2.    Copyright (C) 1989-2015 Free Software Foundation, Inc.

  3.    This program is free software; you can redistribute it and/or modify
  4.    it under the terms of the GNU General Public License as published by
  5.    the Free Software Foundation; either version 3 of the License, or
  6.    (at your option) any later version.

  7.    This program is distributed in the hope that it will be useful,
  8.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.    GNU General Public License for more details.

  11.    You should have received a copy of the GNU General Public License
  12.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  13. #if !defined (ENVIRON_H)
  14. #define ENVIRON_H 1

  15. /* We manipulate environments represented as these structures.  */

  16. struct gdb_environ
  17.   {
  18.     /* Number of usable slots allocated in VECTOR.
  19.        VECTOR always has one slot not counted here,
  20.        to hold the terminating zero.  */
  21.     int allocated;
  22.     /* A vector of slots, ALLOCATED + 1 of them.
  23.        The first few slots contain strings "VAR=VALUE"
  24.        and the next one contains zero.
  25.        Then come some unused slots.  */
  26.     char **vector;
  27.   };

  28. extern struct gdb_environ *make_environ (void);

  29. extern void free_environ (struct gdb_environ *);

  30. extern void init_environ (struct gdb_environ *);

  31. extern char *get_in_environ (const struct gdb_environ *, const char *);

  32. extern void set_in_environ (struct gdb_environ *, const char *, const char *);

  33. extern void unset_in_environ (struct gdb_environ *, const char *);

  34. extern char **environ_vector (struct gdb_environ *);

  35. #endif /* defined (ENVIRON_H) */