Hi Darren,

Darren Hart a e'crit :
> Gilles Carry wrote:
>> This library provides a set of function to help the saving of data as XML
>> formatted files.
>> Note: this is a lightweight library as it does not check if the document is 
>> well formed or grammaticallt correct.
>> It must be considered as a commodity that helps tag indentation and avoids 
>> user to toss with '<' and '>'.
>> To embbed it into executables, run:
>> XML_LIB=1 make
>>
>> Also, it adds heading tags with data such as timestamp, system information, 
>> test conditions... This to facilitate post processing. (eg. further 
>> comparisons of different testruns, formatting for plotting...)
>>
>> This patch does not alter the LTP/RT traditional stats dump.
>> A new global command line option is used: -x <id>
>>
>> Compilation is conditional to LIB_XML.
> 
> 
> Implementation and separation look good.  I have a couple questions 
> below on a couple details.  I mentioned a few coding standards nitpics 
> while I was at it so you see them early on and they don't delay things 
> in the future, but they clearly aren't a priority now.

OK.
I fix all this and send a new version soon.
See my answers below.
Tell me what you think about the tag stack stuff. (read below)
Thanks,
Gilles.

> 
> --
> Darren
> 
>> Signed-off-by: Gilles Carry <[EMAIL PROTECTED]>
>> ---
>>  testcases/realtime/config.mk        |    6 +
>>  testcases/realtime/include/libxml.h |  112 +++++++++++
>>  testcases/realtime/lib/librttest.c  |   35 ++++-
>>  testcases/realtime/lib/libxml.c     |  350 
>> +++++++++++++++++++++++++++++++++++
>>  4 files changed, 502 insertions(+), 1 deletions(-)
>>  create mode 100644 testcases/realtime/include/libxml.h
>>  create mode 100644 testcases/realtime/lib/libxml.c
>>
>> diff --git a/testcases/realtime/config.mk b/testcases/realtime/config.mk
snip
>>
>> +CFLAGS   += -m64 -g
> 
> This appears to be a superfluous change, or at least unrelated to libxml...

Yes. It's a mistake. I forgot to remove it from the patch.


>> + * </tagname>
>> + *
>> + * xs: xml stream to write to
>> + * tagname: xml markup name
>> + */
>> +void xml_end_tag (xml_stream_t *xs, char *tagname);
>> +
> 
> Hrm.. so you stated this is intended to be simple, and that's fine for 
> the first round.  In the future, should this get used more, I wonder if
> it might not make sense to return some kind of handle when a tag is 
> started, then close the tag with that handle.  That would allow the 
> library to ensure the spelling is correct, etc.  Minimize user error.

Yes, it's a bit raw for now. I already have in mind something smarter 
but I was expecting your feedback first.
My idea is to use a kind of stack for each stream. Using a handle as you 
suggest, means having as many variables as there are tags which is not 
very friendly for the programmer.



>> +
>> +    /* Check for duplicate options in optstring */
>> +    for (i=0; i<strlen(all_options); i++) {
>> +            char opt = all_options[i];
>> +
>> +            if (opt == ':')
>> +                    continue;
>> +
>> +            /* Search ahead */
>> +            if (strchr(&all_options[i+1], opt)) {
>> +                    fprintf(stderr, "Programmer error -- argument -%c 
>> already used at least twice\n", opt);
>> +                    exit(1);
>> +            }
>> +    }
> 
> The above doesn't appear related to libxml...

Oops! Another mistake. This was from another patch already pushed into LTP.


>> +
>> +char *xml_user_free_id = "";
>> +int xml_dump = 0;
> 
> Why can't these part of the xml_stream structure?

xml_user_free_id string is passed through the command line. It is used 
to distinguish test-runs as everything cannot be automatically detected. 
(eg. kernel hacks) It can be also used to simplify identification of 
runs: myRun1, myRun2...
If there are several xml streams in a programme execution (currently it 
isn't) then all get the same free id.

xml_dump is just a common flag to tell if xml is wanted. (command line 
arg -x)


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to