From 3be06e552546a0c10b860d83bbd23d639590774c Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 24 Mar 2005 16:59:01 +0000 Subject: Added comments ;) --- src/miav_config.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/miav_config.cc b/src/miav_config.cc index 9364131..05e0d06 100644 --- a/src/miav_config.cc +++ b/src/miav_config.cc @@ -63,8 +63,16 @@ MiavConfig::~MiavConfig() if(die) free(die); } +/** + * Adds one configuration entry, from a single zero terminated line. + */ _cfg *MiavConfig::addConfig(_cfg *parent, char* conf) { + + // + // FIXME: Check for wellformedness + // + _cfg *cfg; printf("[%s]\n", conf); @@ -97,6 +105,9 @@ _cfg *MiavConfig::addConfig(_cfg *parent, char* conf) return cfg; } +/** + * Main parse function, iterates the lines of the file. + */ int MiavConfig::parse(char* raw) { // Strip the string @@ -115,13 +126,18 @@ int MiavConfig::parse(char* raw) start = p+1; } } + // Allocated in strip free(conf); printf("done!\n"); return 0; } +/** + * Strip all unwanted data from the string, initial to parsing. + */ char* MiavConfig::strip(char* conf) { + // Freed in parse!!! char *stripped = (char*)calloc(strlen(conf) + 2, 1); char *r; char *w = stripped; -- cgit v1.2.3