From clc-wiki
{when basing an article on this page, name it after the function (ignore the wiki's auto-capitalisation of the first letter); in what follows: everything enclosed in single curly braces needs to be customised or is meta-direction, leave double-curlies as-is - they're required templates; this statement itself should be removed; html comments should be maintained unless otherwise stated}
Prototype
Declared in [[{standardheadername}.h]]
{returntype} {functionname}({parameter list});
Description
{Describe function's behaviour, including constraints and assumptions. A direct quotation from the Standard is acceptable provided you can confirm that there are no differences between versions of the Standard, and attribute the quote with the following statement, including parentheses: (the Standard's wording).
If the wordings of different versions of the Standard differ without change to semantics, it's acceptable to use a direct quote from the latest version and attribute the quotation directly as: (the Standard's wording, C99 - earlier versions vary).
If there are semantic-changing differences, include them in the descriptive flow. If this is still largely in the Standard's words, attribute as: (based on wording in the Standard).
If not directly quoting the Standard, no attribution is needed but word the description in the same style that the Standard uses. }
Return value
{Describe normal return value}. {Describe failure mode and error returns as well as affect on errno
or write "This function has no failure mode and no error return"}.
Implementation
Portable Approaches
/* This should include purely portable code, although it may use non-standard identifiers in the implementation namespace to encapsulate non-portabilities or inconsistencies between versions of the Standard - see "Non-portable components" section below. Don't generate or include a header file for any such identifiers - instead set "type" in the codesummary to "Incomplete unit". */
{Compilable unit or Incomplete unit}, portable {C90 or C99} in implementation namespace; {public domain or GPL or other open source licence}; past reviewers: none; current reviews: none
{each alternative approach should be briefly introduced by a description of what's unique or significant about it}
Non-portable components
{A list of identifiers used in the above code and added to the "Non-Portable Standard Implementation Components" page in accordance with the notes on that page; each listing has the following format, where prefix is _NP_ for non-portable macros, __np_ for other non-portable identifiers, _NC_ for macros encapsulating differences between versions of the Standard or __nc_ for other identifiers doing same:
- [[Non-Portable Standard Implementation Components#{prefix}{restofidentifier}|{prefix}{restofidentifier}]]:
- {description of identifier and example implementation unless this identifier is also used elsewhere, in which case the description/implementation should occur once only, in "Non-Portable Standard Implementation Components"}
}
Non-portable Approaches
{each alternative approach should be briefly introduced and/or followed by a description of the subtleties that make it non-portable}
/* This code should not be wildly implementation-specific, and should * be included only to document traps for the unwary. */
Compilable unit, non-portable; {public domain or GPL or other open source licence}; past reviewers: none; current reviews: none
See also
{Asterisk-list of links to other articles in this wiki, if any, otherwise omit this section}
References
- The C Standard, {x.y... ({C89-ANSI/C90-ISO/C94/N869/C99/N1124} numbering) - list numbering for all versions; for identical numberings write e.g. "x.y... (C89-ANSI), x1.y1... (C90-ISO,C94,N869 numbering), x2.y2... (C99/N1124 numbering)"}
- {functionname} in the Dinkumware, Ltd C99 Library Reference
- FAQ {x.y} {optionally include question wording; see also guidelines at Clc:Policies and Conventions#Referencing_the_FAQ - if no FAQs apply, omit this reference line}
- {functionname}(3) in the multi-OS manpages at FreeBSD.org
- {functionname} in The Open Group Base Specifications, Issue 6.