home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / 13 < prev    next >
Encoding:
Text File  |  1992-12-09  |  1.2 KB  |  32 lines

  1. { (C) Copyright  1986-1992 MetaWare Incorporated;  Santa Cruz, CA 95060. }
  2.  
  3. pragma c_include('implement.pf');
  4. package Env;
  5.    pragma routine_aliasing_convention(Implement.RTE_aliasing);
  6.    { Package for processing the MS-DOS environemt string }
  7.    
  8.    var Env_separator:Char;    -- Separates substrings; 
  9.                                 --    default: Dos -';', unix, xenix - ':'.
  10.    iterator Each_env_field(const Name: String):(const S: String); external;
  11.       {Iterator on each field of env name. A field is separated by Env_separator.}
  12.       {If Name not found in environment, then routine returns without yielding}
  13.       {anything.}
  14.    
  15.    { Example:
  16.         Suppose the name PATH has been set to "/BIN;A:/;B:/XYZ"
  17.    
  18.         for S in Each_env_field('PATH') do ...
  19.             yields the following strings in S:  '/BIN' 'A:/' 'B:/XYZ'
  20.    }
  21.  
  22.    { Each Env_separator-separated substring of S. }
  23.    iterator Each_env_substring(const S:String):(const Substring:String);external;
  24.  
  25.    -- Obtain the entire environment string as a single chunk:   
  26.    type Env_string = String(256);
  27.    function Get_env(const Name: String): Env_string;        External;
  28.    
  29.    end;
  30.  
  31.                                                          
  32.