1# 2# simple adt that operates on whitespace separated config files 3# such as /services/webget/config 4# 5CfgFile: module 6{ 7 PATH: con "/dis/lib/cfgfile.dis"; 8 ConfigFile: adt 9 { 10 getcfg: fn(me: self ref ConfigFile,field:string):list of string; 11 setcfg: fn(me: self ref ConfigFile,field:string,val:string); 12 delete: fn(me: self ref ConfigFile,field:string); 13 flush: fn(me: self ref ConfigFile): string; 14 15 # ----- private ------ 16 lines: list of string; 17 file: string; 18 readonly: int; 19 }; 20 21 init: fn(file:string):ref ConfigFile; 22 verify: fn(defaultpath: string, path: string) :ref Sys->FD; 23}; 24