Template:Csig
From Maths
Revision as of 08:30, 1 October 2017 by Alec (Talk | contribs) (Added pre section, documentation and examples, leaving "sample" at top for now due to laziness)
int printf()
Usage
Currently supports up to 6 arguments, you may use pre and post to make things appear before and after (with a space between them and the body, if present), arguments go as follows:
- return or type (eg int)
- symbol name (eg printf)
- arg1 - type (eg const char*)
- If not present, then no brackets are rendered after the symbol name, for a variable definition
- If present but empty then brackets are shown, this is how you'd achieve a function with no arguments over a variable
- arg1 - name
- arg2 - type
- arg2 - name
- arg3 - type
- arg4 - name
and so on.
An argument is considered present if the type/name arguments are not both empty, so an empty type with the name as ... is valid, for example varadic functions (c-style)
Examples
- int printf(const char* format, ...)
- int printf(const char* format, ...)
- int errno __attribute__((aligned(16)))
- pid_t getpid()
- long:
- int lots_of_args(a b, c d, e f, g h) __attribute__((noreturn))
Family
Think of any *_t versions as "template" - to be used alone, without the _t at the end they may be styling (only csig and cs are designed to be used alone and lack a _t to indicate this)
- template:cprim - used within template:csig or template:cs to style primitive types.
- template:cprim_t - standalone version, used inline, rather than inside csig or cs
- template:ckw - used within csig or cs
- template:ckw_t - standalone version