home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c220 / 4.ddi / LIB / SRC / ENV.PF < prev    next >
Encoding:
Text File  |  1990-12-16  |  1.1 KB  |  30 lines

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