OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook] documenting c structs


> ----- Original Message ----- 
> From: "Karsten Ohme" 
> > 
> > How can I document C structs? I haven't found an appropriate
> > corresponding element to funcsynopsis.

> From: Bob Stayton 
> 
> Did you find these two elements:
> 
> http://docbook.org/tdg/en/html/structname.html
> http://docbook.org/tdg/en/html/structfield.html


The <structname> and <structfield> elements may well be inappropriate here:

* They are inline elements that only identify names. They are not containers
for struct data similar to the way <funcsynopsis> is used to capture the
semantics of a function.

* They are removed in DocBook 5.

Maybe there should be a <structsynopsis> element in DocBook? For now, my
suggestion would be to use <synopsis>. Something like this:

    <synopsis language="C" role="struct">
     struct automobile {
     int year;
     char model[8];
     int engine_power;
     float weight;
     };
    </synopsis>

/MJ





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]