diff options
author | Martin Waitz <tali@admingilde.org> | 2005-11-13 19:08:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-13 21:14:21 -0500 |
commit | aeec46b97a7975fd983219177980c58ed4fd607c (patch) | |
tree | 9ed1f67d86585c096afe12b944182c7e7c41ec39 | |
parent | f5f4917c92a9a3814eda9c947fda8afabbd1812d (diff) |
[PATCH] DocBook: allow to mark structure members private
Many structures contain both an internal part and one which is part of the API
to other modules. With this patch it is possible to only include these public
members in the kernel documentation.
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/usb.h | 6 | ||||
-rwxr-xr-x | scripts/kernel-doc | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 748d04385256..856d232c7562 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -819,7 +819,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *); | |||
819 | */ | 819 | */ |
820 | struct urb | 820 | struct urb |
821 | { | 821 | { |
822 | /* private, usb core and host controller only fields in the urb */ | 822 | /* private: usb core and host controller only fields in the urb */ |
823 | struct kref kref; /* reference count of the URB */ | 823 | struct kref kref; /* reference count of the URB */ |
824 | spinlock_t lock; /* lock for the URB */ | 824 | spinlock_t lock; /* lock for the URB */ |
825 | void *hcpriv; /* private data for host controller */ | 825 | void *hcpriv; /* private data for host controller */ |
@@ -827,7 +827,7 @@ struct urb | |||
827 | atomic_t use_count; /* concurrent submissions counter */ | 827 | atomic_t use_count; /* concurrent submissions counter */ |
828 | u8 reject; /* submissions will fail */ | 828 | u8 reject; /* submissions will fail */ |
829 | 829 | ||
830 | /* public, documented fields in the urb that can be used by drivers */ | 830 | /* public: documented fields in the urb that can be used by drivers */ |
831 | struct list_head urb_list; /* list head for use by the urb's | 831 | struct list_head urb_list; /* list head for use by the urb's |
832 | * current owner */ | 832 | * current owner */ |
833 | struct usb_device *dev; /* (in) pointer to associated device */ | 833 | struct usb_device *dev; /* (in) pointer to associated device */ |
@@ -1045,7 +1045,7 @@ struct usb_sg_request { | |||
1045 | size_t bytes; | 1045 | size_t bytes; |
1046 | 1046 | ||
1047 | /* | 1047 | /* |
1048 | * members below are private to usbcore, | 1048 | * members below are private: to usbcore, |
1049 | * and are not provided for driver access! | 1049 | * and are not provided for driver access! |
1050 | */ | 1050 | */ |
1051 | spinlock_t lock; | 1051 | spinlock_t lock; |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 8aaf74e64183..2f45fd2969d0 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -117,6 +117,8 @@ use strict; | |||
117 | # struct my_struct { | 117 | # struct my_struct { |
118 | # int a; | 118 | # int a; |
119 | # int b; | 119 | # int b; |
120 | # /* private: */ | ||
121 | # int c; | ||
120 | # }; | 122 | # }; |
121 | # | 123 | # |
122 | # All descriptions can be multiline, except the short function description. | 124 | # All descriptions can be multiline, except the short function description. |
@@ -1304,6 +1306,12 @@ sub dump_struct($$) { | |||
1304 | # ignore embedded structs or unions | 1306 | # ignore embedded structs or unions |
1305 | $members =~ s/{.*?}//g; | 1307 | $members =~ s/{.*?}//g; |
1306 | 1308 | ||
1309 | # ignore members marked private: | ||
1310 | $members =~ s/\/\*.*?private:.*?public:.*?\*\///gos; | ||
1311 | $members =~ s/\/\*.*?private:.*//gos; | ||
1312 | # strip comments: | ||
1313 | $members =~ s/\/\*.*?\*\///gos; | ||
1314 | |||
1307 | create_parameterlist($members, ';', $file); | 1315 | create_parameterlist($members, ';', $file); |
1308 | 1316 | ||
1309 | output_declaration($declaration_name, | 1317 | output_declaration($declaration_name, |
@@ -1329,6 +1337,7 @@ sub dump_enum($$) { | |||
1329 | my $x = shift; | 1337 | my $x = shift; |
1330 | my $file = shift; | 1338 | my $file = shift; |
1331 | 1339 | ||
1340 | $x =~ s@/\*.*?\*/@@gos; # strip comments. | ||
1332 | if ($x =~ /enum\s+(\w+)\s*{(.*)}/) { | 1341 | if ($x =~ /enum\s+(\w+)\s*{(.*)}/) { |
1333 | $declaration_name = $1; | 1342 | $declaration_name = $1; |
1334 | my $members = $2; | 1343 | my $members = $2; |
@@ -1365,6 +1374,7 @@ sub dump_typedef($$) { | |||
1365 | my $x = shift; | 1374 | my $x = shift; |
1366 | my $file = shift; | 1375 | my $file = shift; |
1367 | 1376 | ||
1377 | $x =~ s@/\*.*?\*/@@gos; # strip comments. | ||
1368 | while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) { | 1378 | while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) { |
1369 | $x =~ s/\(*.\)\s*;$/;/; | 1379 | $x =~ s/\(*.\)\s*;$/;/; |
1370 | $x =~ s/\[*.\]\s*;$/;/; | 1380 | $x =~ s/\[*.\]\s*;$/;/; |
@@ -1420,7 +1430,7 @@ sub create_parameterlist($$$) { | |||
1420 | $type = $arg; | 1430 | $type = $arg; |
1421 | $type =~ s/([^\(]+\(\*)$param/$1/; | 1431 | $type =~ s/([^\(]+\(\*)$param/$1/; |
1422 | push_parameter($param, $type, $file); | 1432 | push_parameter($param, $type, $file); |
1423 | } else { | 1433 | } elsif ($arg) { |
1424 | $arg =~ s/\s*:\s*/:/g; | 1434 | $arg =~ s/\s*:\s*/:/g; |
1425 | $arg =~ s/\s*\[/\[/g; | 1435 | $arg =~ s/\s*\[/\[/g; |
1426 | 1436 | ||
@@ -1628,7 +1638,6 @@ sub process_state3_type($$) { | |||
1628 | my $x = shift; | 1638 | my $x = shift; |
1629 | my $file = shift; | 1639 | my $file = shift; |
1630 | 1640 | ||
1631 | $x =~ s@/\*.*?\*/@@gos; # strip comments. | ||
1632 | $x =~ s@[\r\n]+@ @gos; # strip newlines/cr's. | 1641 | $x =~ s@[\r\n]+@ @gos; # strip newlines/cr's. |
1633 | $x =~ s@^\s+@@gos; # strip leading spaces | 1642 | $x =~ s@^\s+@@gos; # strip leading spaces |
1634 | $x =~ s@\s+$@@gos; # strip trailing spaces | 1643 | $x =~ s@\s+$@@gos; # strip trailing spaces |