On Mon, Apr 20, 2009 at 06:44:16PM +0000, Tim Nieradzik wrote:
What's the main point of dParser_parse_rc_line()?
The main difference to the current implementation is that equal signs are interpreted as separator.
The current implementation also does that. The patch has a strange comment WRT equal signs: + // parse the value + i = 0; + while (*p) { + // skip all spaces and equal signs + if (!isspace(*p)) { + value[i++] = *p; + } + + p++; + } + + value[i] = '\0'; So either the implementation or the comment is wrong...
Besides, it requires that ``line'', ``name'' and ``value'' are initialised with a specific length (in dpid/dpid.c it is set to 1024). The major advantage is that corrupt files (with very long lines) would not congest the RAM since we abort after 1024 characters. This is very unlikely though.
The comment says it extracts type, name and value, but it doesn't extract type.
Sorry, I had forgotten to update the description. In a previous version of my patch there has been a ``type'' attribute. As proposed, I removed it later on. Since then this function does basically the same job as dParser_get_rc_pair().
If the required job is basically the same, I can keep the current function (maybe returning the new termination codes) and continue integrating the patchset. Otherwise, what is exactly the new function supposed to do differently? -- Cheers Jorge.-