diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-06-04 01:30:13 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-06-04 01:30:13 +0000 |
commit | 67797a0990e5f662d6d5a45d57b8df9621d9b446 (patch) | |
tree | d4f372c14f4e8c1daa17a45d570dc51ad209fa3b /lib/libc/gen/getcap.3 | |
parent | bed33d97a346af66478a7c10a123af07e1608056 (diff) |
After some constructive criticism from pjanzen@ and some e-mail tag:
- only use the .Dv NULL form when referring explicitly to a function
argument or return value
- otherwise, use these forms:
o non-null
o null-terminated (hyphenated form for predicate adjective)
o else, null terminated, or null terminate, whichever the case
o null pointer, null byte, null string, etc.
- may use NUL to refer to an ASCII NUL, but it doesn't need a .Tn macro
In general, capitalizing the word "null" everywhere is unnecessary and makes
the man pages harder to read. The above is consistent with popular programming
texts (i.e., K&R, Stevens).
Diffstat (limited to 'lib/libc/gen/getcap.3')
-rw-r--r-- | lib/libc/gen/getcap.3 | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/libc/gen/getcap.3 b/lib/libc/gen/getcap.3 index cfe5e33ba3c..76de0a76a6f 100644 --- a/lib/libc/gen/getcap.3 +++ b/lib/libc/gen/getcap.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getcap.3,v 1.12 1999/06/03 10:03:20 aaron Exp $ +.\" $OpenBSD: getcap.3,v 1.13 1999/06/04 01:30:10 aaron Exp $ .\" .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. @@ -77,8 +77,7 @@ The function extracts the capability record .Fa name -from the database specified by the -.Dv NULL Ns -terminated +from the database specified by the null-terminated file array .Fa db_array and returns a pointer to a @@ -176,7 +175,7 @@ found. The end of the capability value is signaled by a .Sq \&: or .Tn ASCII -.Dv NUL +NUL (see below for capability database syntax). .Pp .Fn cgetnum @@ -196,16 +195,15 @@ retrieves the value of the string capability .Fa cap from the capability record pointed to by .Fa buf . -A pointer to a decoded, NUL-terminated, +A pointer to a decoded, null-terminated, .Xr malloc Ns \&'d copy of the string is returned in the .Ft char * pointed to by .Fa str . -The number of characters in the decoded string not including the trailing -.Dv NUL -is returned on success, \-1 if the requested string capability couldn't -be found, \-2 if a system error was encountered (storage allocation +The number of characters in the decoded string (not including the trailing +NUL) is returned on success, \-1 if the requested string capability couldn't +be found, or \-2 if a system error was encountered (storage allocation failure). .Pp .Fn cgetustr @@ -218,8 +216,7 @@ character of the capability string literally. and .Fn cgetnext comprise a function group that provides for sequential -access of the -.Dv NULL Ns -terminated +access of the null-terminated array of file names, .Fa db_array . .Fn cgetfirst @@ -455,15 +452,12 @@ A may be followed by up to three octal digits directly specifies the numeric code for a character. The use of .Tn ASCII -.Dv NUL Ns s , -while easily +NULs, while easily encoded, causes all sorts of problems and must be used with care since -.Dv NUL Ns s -are typically used to denote the end of strings; many applications +NULs are typically used to denote the end of strings; many applications use .Sq \e\|200 -to represent a -.Dv NUL . +to represent a NUL. .Sh EXAMPLES .Bd -unfilled -offset indent example\||\|an example of binding multiple values to names:\e |