diff options
| author | Randy Dunlap <rdunlap@xenotime.net> | 2006-02-01 06:06:57 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 11:53:27 -0500 |
| commit | d28bee0c0a9c6abddf1d14c69f188400e994eb5a (patch) | |
| tree | fb05862b35aa6f4f96867c9baeb4d6508d55bdb9 | |
| parent | 7045f37b17ffa6e85435ca980122b46a74caa7e4 (diff) | |
[PATCH] Doc/kernel-doc: add more usage info
- Add info that structs, unions, enums, and typedefs are supported.
- Add doc about "private:" and "public:" tags for struct fields.
- Fix some typos.
- Remove some trailing whitespace.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | Documentation/kernel-doc-nano-HOWTO.txt | 39 | ||||
| -rwxr-xr-x | scripts/kernel-doc | 6 |
2 files changed, 37 insertions, 8 deletions
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt index c406ce67edd0..c65233d430f0 100644 --- a/Documentation/kernel-doc-nano-HOWTO.txt +++ b/Documentation/kernel-doc-nano-HOWTO.txt | |||
| @@ -45,10 +45,10 @@ How to extract the documentation | |||
| 45 | 45 | ||
| 46 | If you just want to read the ready-made books on the various | 46 | If you just want to read the ready-made books on the various |
| 47 | subsystems (see Documentation/DocBook/*.tmpl), just type 'make | 47 | subsystems (see Documentation/DocBook/*.tmpl), just type 'make |
| 48 | psdocs', or 'make pdfdocs', or 'make htmldocs', depending on your | 48 | psdocs', or 'make pdfdocs', or 'make htmldocs', depending on your |
| 49 | preference. If you would rather read a different format, you can type | 49 | preference. If you would rather read a different format, you can type |
| 50 | 'make sgmldocs' and then use DocBook tools to convert | 50 | 'make sgmldocs' and then use DocBook tools to convert |
| 51 | Documentation/DocBook/*.sgml to a format of your choice (for example, | 51 | Documentation/DocBook/*.sgml to a format of your choice (for example, |
| 52 | 'db2html ...' if 'make htmldocs' was not defined). | 52 | 'db2html ...' if 'make htmldocs' was not defined). |
| 53 | 53 | ||
| 54 | If you want to see man pages instead, you can do this: | 54 | If you want to see man pages instead, you can do this: |
| @@ -124,6 +124,36 @@ patterns, which are highlighted appropriately. | |||
| 124 | Take a look around the source tree for examples. | 124 | Take a look around the source tree for examples. |
| 125 | 125 | ||
| 126 | 126 | ||
| 127 | kernel-doc for structs, unions, enums, and typedefs | ||
| 128 | --------------------------------------------------- | ||
| 129 | |||
| 130 | Beside functions you can also write documentation for structs, unions, | ||
| 131 | enums and typedefs. Instead of the function name you must write the name | ||
| 132 | of the declaration; the struct/union/enum/typedef must always precede | ||
| 133 | the name. Nesting of declarations is not supported. | ||
| 134 | Use the argument mechanism to document members or constants. | ||
| 135 | |||
| 136 | Inside a struct description, you can use the "private:" and "public:" | ||
| 137 | comment tags. Structure fields that are inside a "private:" area | ||
| 138 | are not listed in the generated output documentation. | ||
| 139 | |||
| 140 | Example: | ||
| 141 | |||
| 142 | /** | ||
| 143 | * struct my_struct - short description | ||
| 144 | * @a: first member | ||
| 145 | * @b: second member | ||
| 146 | * | ||
| 147 | * Longer description | ||
| 148 | */ | ||
| 149 | struct my_struct { | ||
| 150 | int a; | ||
| 151 | int b; | ||
| 152 | /* private: */ | ||
| 153 | int c; | ||
| 154 | }; | ||
| 155 | |||
| 156 | |||
| 127 | How to make new SGML template files | 157 | How to make new SGML template files |
| 128 | ----------------------------------- | 158 | ----------------------------------- |
| 129 | 159 | ||
| @@ -147,4 +177,3 @@ documentation, in <filename>, for the functions listed. | |||
| 147 | 177 | ||
| 148 | Tim. | 178 | Tim. |
| 149 | */ <twaugh@redhat.com> | 179 | */ <twaugh@redhat.com> |
| 150 | |||
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index b927fd25e968..940fe348009f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -45,7 +45,7 @@ use strict; | |||
| 45 | # Note: This only supports 'c'. | 45 | # Note: This only supports 'c'. |
| 46 | 46 | ||
| 47 | # usage: | 47 | # usage: |
| 48 | # kerneldoc [ -docbook | -html | -text | -man ] | 48 | # kernel-doc [ -docbook | -html | -text | -man ] |
| 49 | # [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile | 49 | # [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile |
| 50 | # or | 50 | # or |
| 51 | # [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile | 51 | # [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile |
| @@ -59,7 +59,7 @@ use strict; | |||
| 59 | # -nofunction funcname | 59 | # -nofunction funcname |
| 60 | # If set, then only generate documentation for the other function(s). All | 60 | # If set, then only generate documentation for the other function(s). All |
| 61 | # other functions are ignored. Cannot be used with -function together | 61 | # other functions are ignored. Cannot be used with -function together |
| 62 | # (yes thats a bug - perl hackers can fix it 8)) | 62 | # (yes, that's a bug -- perl hackers can fix it 8)) |
| 63 | # | 63 | # |
| 64 | # c files - list of 'c' files to process | 64 | # c files - list of 'c' files to process |
| 65 | # | 65 | # |
| @@ -434,7 +434,7 @@ sub output_enum_html(%) { | |||
| 434 | print "<hr>\n"; | 434 | print "<hr>\n"; |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | # output tyepdef in html | 437 | # output typedef in html |
| 438 | sub output_typedef_html(%) { | 438 | sub output_typedef_html(%) { |
| 439 | my %args = %{$_[0]}; | 439 | my %args = %{$_[0]}; |
| 440 | my ($parameter); | 440 | my ($parameter); |
