Page MenuHomeFreeBSD

libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
Needs ReviewPublic

Authored by unitrunker_unitrunker.net on Mon, Dec 15, 7:29 AM.
Tags
None
Referenced Files
F140039013: D54231.id168303.diff
Fri, Dec 19, 9:54 AM
F140009611: D54231.id168306.diff
Thu, Dec 18, 11:46 PM
F140008575: D54231.id168302.diff
Thu, Dec 18, 11:25 PM
Unknown Object (File)
Wed, Dec 17, 11:45 PM
Unknown Object (File)
Wed, Dec 17, 11:37 PM
Unknown Object (File)
Wed, Dec 17, 2:21 PM
Unknown Object (File)
Wed, Dec 17, 9:18 AM
Unknown Object (File)
Wed, Dec 17, 4:17 AM

Details

Reviewers
None
Group Reviewers
USB
manpages
Summary

Manual pages for libusb20_open(3) and libusb20_be_device_foreach(3).

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291675

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 69291
Build 66174: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
lib/libusb/libusb20_be_device_foreach.3
33
46

If those 2 sections are empty, it's ok to be removed, but having some information here is good.

lib/libusb/libusb20_dev_open.3
34
40
53

Same as above.

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
Copyright

Some more nits. I am still thinking if we want to move to standalone manual pages, or extend the current libusb20(3). We can also add .Sh EXAMPLES to libusb20(3).

lib/libusb/Makefile
231–232

We need to remove this if libusb20_dev_open.3 becomes a standalone man page.

262–263

We need to remove this if libusb20_be_device_foreach.3 becomes a standalone man page.

lib/libusb/libusb20_be_device_foreach.3
35

USB access library
.Pq libusb, -lusb

39

should be libusb20_be_device_foreach ?

58
59
lib/libusb/libusb20_dev_open.3
35
39
49
66
67

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
USB access library

lib/libusb/libusb20_be_device_foreach.3
1

This hyphen was for a long abandoned parser that never worked right. It has been remove

3

We took that out of example(?), style(9), and the licensing guide following what other projects have done.

https://docs.freebsd.org/en/articles/license-guide/

33

Library section is deprecated

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
lint fix (need clarity on library)

lib/libusb/libusb20_be_device_foreach.3
33

What is a good way to indicate linker requirements?

lib/libusb/libusb20_be_device_foreach.3
33

What is a good way to indicate linker requirements?

Remove this section, and put ".Lb libusb" as the first line in SYNOPSIS. This is documented in mdoc(7).

Also unless we are fixing the policy, you should follow the documented project policy and use the preferred license for new files. This is an ISO standard, many other major projects have done the same thing including the Linux kernel, and there is absolutely zero point in making everyone scroll past the same text for the millionth time.

unitrunker_unitrunker.net marked an inline comment as done.

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
Clip copyright text and place Lb clause under SYNOPSIS.

lib/libusb/libusb20_be_device_foreach.3
5

The copyright line comes before the SPDX line

20

This needs an introductory sentence. What is this function for? Why does the reader care about it?

lib/libusb/libusb20_dev_open.3
5

The copyright line comes before the SPDX line

20

This needs an introductory sentence. What does this function do? The introductory sentence needs to explain to the user if they want to continue reading this page, or if they need to look for a different page.

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
License guide; DESCRIPTION gets intro sentence.

lib/libusb/libusb20_be_device_foreach.3
12

This is the part that appears when you use apropos. These don't get periods. You want them to be short, and each word is a search keyword. The official spec is "one line about what it does".

lib/libusb/libusb20_dev_open.3
12

This is still 7 characters over the ideal:

libusb20_dev_open(3) - open a USB device to retrieve descriptors and initiate transfers

So, it will wrap on standard console. Not a big deal with library manuals because they're so over loaded, but this makes apropos more legible.

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
Shorter Nd text w/o periods.

lib/libusb/libusb20_be_device_foreach.3
12

This should be in the imperative tone.

https://en.wikipedia.org/wiki/Imperative_mood

For more information, see the FreeBSD Documentation Primer. It is filled with outstanding technical writing information.

15

Which OS/version are you typing this from?

lib/libusb/libusb20_dev_open.3
4

Whitespace at the end of the line causes a linter complaint.

32

This section also needs an introductory sentence.

33
34

And so on

43

Include files have a macro

48

And this section needs to be moved before SEE ALSO. A listing of standard sections and their standardized order are in mdoc(7).

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
Move SEE ALSO after EXAMPLES.

Updating libusb20_be_device_foreach.3 next.

lib/libusb/libusb20_be_device_foreach.3
15

14.3-RELEASE

libthr.3 as example uses obsolete .Li
Several - like mixer.3 - have no dot prefixed instruction.
Some use .Em like init_msg.3

lib/libusb/libusb20_dev_open.3
32

This is awkward. LIBUSB20_SUCCESS is not an error. Looking at ..
find . -name '*.3' -print0 | xargs -0 grep -A 5 '\.Sh ERRORS'
for inspiration.

unitrunker_unitrunker.net marked an inline comment as done.

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
Replace Va with Fa.

lib/libusb/libusb20_be_device_foreach.3
15

That explains it. Please update to 15.0. there are a lot of changes in the manual pages compiler and it's documentation since then. For example, the deprecation of Li has been rolled back.

21

Is this a system call? Calls go in section 2. I think this is a library function, but I'm not familiar with the underlying subject.

40

The mdoc language reference manual says to use standardized section names if at all possible.

54

All of these except the last need a space and a comma.

lib/libusb/libusb20_dev_open.3
21

Is this a system call? Calls go in section 2. I think this is a library function, but I'm not familiar with the underlying subject.

45

This should be outside the list, it is not an item in the list.

unitrunker_unitrunker.net marked an inline comment as done.

D54231: libusb20_dev_open(3) and libusb20_be_device_foreach(3) man pages.
library, not syscall.

unitrunker_unitrunker.net added inline comments.
lib/libusb/libusb20_be_device_foreach.3
3

@ziaee i see this was actually removed from the example back in October.

lib/libusb/libusb20_dev_open.3
21

Someone asked me to change this to call. Commits are flattened so I can't see when this was so.

It is very much a library.

45

That's a comment on LIBUSB20_ERROR_NO_DEVICE which was based on other examples I found for ERRORS.
In between a call to libusb20_be_device_foreach and a call to libusb20_dev_open, the device could become unplugged - hence the error and the comment.