From 46439007cf417cbd9ac8049bb4122c890097a0fa Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 20:52:35 +0000 Subject: 20060303-partial --- module/cfgfile.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 module/cfgfile.m (limited to 'module/cfgfile.m') diff --git a/module/cfgfile.m b/module/cfgfile.m new file mode 100644 index 00000000..4aff004a --- /dev/null +++ b/module/cfgfile.m @@ -0,0 +1,23 @@ +# +# simple adt that operates on whitespace separated config files +# such as /services/webget/config +# +CfgFile: module +{ + PATH: con "/dis/lib/cfgfile.dis"; + ConfigFile: adt + { + getcfg: fn(me: self ref ConfigFile,field:string):list of string; + setcfg: fn(me: self ref ConfigFile,field:string,val:string); + delete: fn(me: self ref ConfigFile,field:string); + flush: fn(me: self ref ConfigFile): string; + + # ----- private ------ + lines: list of string; + file: string; + readonly: int; + }; + + init: fn(file:string):ref ConfigFile; + verify: fn(defaultpath: string, path: string) :ref Sys->FD; +}; -- cgit v1.2.3