From 233d41a1ef1155208e198d5aabcca8a8fae80f27 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sat, 22 Oct 2011 12:06:10 -0400 Subject: [PATCH] Add some examples to the manual. --- doc/man/cdecl99.1 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/doc/man/cdecl99.1 b/doc/man/cdecl99.1 index 662858b..eca715f 100644 --- a/doc/man/cdecl99.1 +++ b/doc/man/cdecl99.1 @@ -159,6 +159,43 @@ possibilities. The rule that is generally applied is that .Nm will choose the alternative with the simplest explanation. Thus, f is interpreted as a function which takes an int and returns an int. +.Sh EXAMPLES +.Bl -tag -width Output: +.It Input: +.Li explain int x; +.It Output: +.Li declare x as int +.It Input: +.Li explain static int* x, y; +.It Output: +.Li declare x as static pointer to int +.sp 0 +.Li declare y as static int +.It Input: +.Li explain extern int printf(const char *fmt, ...); +.It Output: +.Li declare printf as extern function (fmt as pointer to const char, ...) returning int +.It Input: +.Li explain size_t volatile * const (* restrict)[1][2][3] +.It Output: +.Li type restrict pointer to array 1 of array 2 of array 3 of const pointer to volatile int +.It Input: +.Li declare x as int +.It Output: +.Li int x +.It Input: +.Li type function (pointer to const char) returning size_t +.It Output: +.Li size_t (const char *) +.It Input: +.Li declare f as inline function (g as pointer to array 6 of pointer to const char) returning pointer to function (int, ...) returning int +.It Output: +.Li inline int (*f(const char *(*g)[6]))(int, ...) +.It Input: +.Li simplify const int const ((*restrict x)) +.It Output: +.Li const int * restrict x +.El .Sh AUTHORS Nick Bowler .Sh COPYRIGHT -- 2.43.0