home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / ixemul-39.47-env-bin.lha / man / cat3 / getenv.0 < prev    next >
Text File  |  1993-12-07  |  3KB  |  67 lines

  1.  
  2. GETENV(3)                  UNIX Programmer's Manual                  GETENV(3)
  3.  
  4. NNAAMMEE
  5.      ggeetteennvv, ppuutteennvv, sseetteennvv, uunnsseetteennvv - environment variable functions
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssttddlliibb..hh>>
  9.  
  10.      _c_h_a_r _*
  11.      ggeetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e)
  12.  
  13.      _i_n_t
  14.      sseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _c_o_n_s_t _c_h_a_r _*_v_a_l_u_e, _i_n_t _o_v_e_r_w_r_i_t_e)
  15.  
  16.      _i_n_t
  17.      ppuutteennvv(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g)
  18.  
  19.      _v_o_i_d
  20.      uunnsseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e)
  21.  
  22. DDEESSCCRRIIPPTTIIOONN
  23.      These functions set, unset and fetch environment variables from the host
  24.      _e_n_v_i_r_o_n_m_e_n_t _l_i_s_t. For compatibility with differing environment conven­
  25.      tions, the given arguments _n_a_m_e and _v_a_l_u_e may be appended and prepended,
  26.      respectively, with an equal sign ``=''.
  27.  
  28.      The ggeetteennvv() function obtains the current value of the environment vari­
  29.      able, _n_a_m_e. If the variable _n_a_m_e is not in the current environment , a
  30.      null pointer is returned.
  31.  
  32.      The sseetteennvv() function inserts or resets the environment variable _n_a_m_e in
  33.      the current environment list.  If the variable _n_a_m_e does not exist in the
  34.      list, it is inserted with the given _v_a_l_u_e_. If the variable does exist,
  35.      the argument _o_v_e_r_w_r_i_t_e is tested; if _o_v_e_r_w_r_i_t_e _i_s zero, the variable is
  36.      not reset, otherwise it is reset to the given _v_a_l_u_e.
  37.  
  38.      The ppuutteennvv() function performs the equivalent of:
  39.  
  40.            setenv(name, value, 1);
  41.  
  42.      The uunnsseetteennvv() function deletes all instances of the variable name point­
  43.      ed to by _n_a_m_e from the list.
  44.  
  45. RREETTUURRNN VVAALLUUEESS
  46.      The functions sseetteennvv() and ppuutteennvv() return zero if successful; otherwise
  47.      the global variable _e_r_r_n_o is set to indicate the error and a -1 is re­
  48.      turned.
  49.  
  50. EERRRROORRSS
  51.      [ENOMEM]  The function sseetteennvv() or ppuutteennvv() failed because they were un­
  52.                able to allocate memory for the environment.
  53.  
  54. SSEEEE AALLSSOO
  55.      csh(1),  sh(1),  execve(2),  environ(7)
  56.  
  57. SSTTAANNDDAARRDDSS
  58.      The ggeetteennvv() function conforms to ANSI C3.159­1989 (``ANSI C'').
  59.  
  60. HHIISSTTOORRYY
  61.      The functions sseetteennvv() and uunnsseetteennvv() appeared in Version 7 AT&T UNIX.
  62.      The ppuutteennvv() function appeared in 4.3BSD-Reno.
  63.  
  64. BSD Experimental                 June 29, 1991                               1
  65.  
  66.  
  67.