chiark / gitweb /
Include types with tabulated function arguments and structure members.
authormdw <mdw>
Thu, 19 Aug 1999 18:31:46 +0000 (18:31 +0000)
committermdw <mdw>
Thu, 19 Aug 1999 18:31:46 +0000 (18:31 +0000)
man/conn.3
man/hash.3
man/lbuf.3
man/mdwopt.3
man/selbuf.3
man/str.3
man/sym.3
man/testrig.3
man/tv.3

index 663fc1e2602496dd321eb58da1e848b0bc9a15bb..5a12b7ae8dbbd636c81085e14a200de8c8b11097 100644 (file)
@@ -28,33 +28,33 @@ selector must be initialized.  This requires a call to
 .B conn_init
 with a fairly large number of arguments:
 .TP
-.I c
+.BI "conn *" c
 Pointer to
 .B conn
 object which needs to be initialized.
 .TP
-.I s
+.BI "sel_state *" s
 Pointer to a multiplexor object (type
 .BR sel_state )
 to which this selector should be attached.  See
 .BR sel (3)
 for more details about multiplexors, and how this whole system works.
 .TP
-.I fd
+.BI "int " fd
 File descriptor for the socket you want to connect.  This becomes the
 `property' of the
 .B conn
 selector until the connection attempt finishes.  For example, if there's
 an error, the descriptor will be closed.
 .TP
-.I dst
+.BI "struct sockaddr *" dst
 Pointer to destination socket address for the connection.  Make sure
 that the address has the right family.
 .TP
-.I dsz 
+.BI "int " dsz 
 Size of the destination socket address.
 .TP
-.I func
+.BI "void (*" func ")(int " fd ", void *" p )
 A function to call when the connection is complete.  It is passed the
 file descriptor of the connected socket, and the pointer passed
 to
@@ -66,7 +66,7 @@ passed, and the global
 .B errno
 value is set appropriately.
 .TP
-.I p
+.BI "void *" p
 An arbitrary pointer whose value is passed to the handler function when
 the connection finishes.
 .PP
index 9df4670a8725c1f141808b5d7c514ad04a748eb0..a708d22316c38887fcd00a72e5d384446a265fe2 100644 (file)
@@ -90,12 +90,12 @@ A low-level hashtable is represented by a
 .B hash_table
 structure.  It contains two members:
 .TP
-.B mask
+.B "uint32 mask"
 The current bitmask to be applied to hashes.  This is one less than the
 current number of bins in the hashtable, and is applied to hash values
 in order to decide which bin an item should be in.
 .TP
-.B v
+.B "hash_base **v"
 The bin vector.  It is an array of pointers to hashtable items.
 .PP
 A hashtable item consists of a
@@ -106,13 +106,13 @@ structure by adding keying information and other data; the
 only contains the bare minimum of information needed to maintain the
 hashtable at a low level.  It contains the following members:
 .TP
-.B next
+.B "hash_base *next"
 Pointer to the next item in the bin list.  The final item has a null
 .B next
 pointer.  The entry in the bin vector is null if the bin list is empty.
 It is up to the high-level implementation to insert items into the list.
 .TP
-.B hash
+.B "uint32 hash"
 The hash for this item.  This must be the full 32-bit hash for the
 current item.  It is used during hashtable expansion to determine which
 bin an item should be moved to.
index ecd58aab1cc77f70695dd709b71d4845eef6f745..beab46f3d18f50ab3f592e6ab8f59b90aa788d0a 100644 (file)
@@ -42,16 +42,16 @@ The function
 .B lbuf_init
 initializes a line buffer ready for use.  It is given three arguments:
 .TP
-.I b
+.BI "lbuf *" b
 A pointer to the block of memory to use for the line buffer.  This is
 all the memory the line buffer requires.
 .TP
-.I func
+.BI "void (*" func ")(char *" s ", void *" p )
 The
 .I line-handler
 function to which the line buffer should pass completed lines of text.
 .TP
-.I p
+.BI "void *" p
 A pointer argument to be passed to the function when a completed line of
 text arrives.
 .PP
@@ -101,15 +101,15 @@ Once the free area has had some data written to it,
 is called to examine the new data and break it into text lines.  This is
 given three arguments:
 .TP
-.I b
+.BI "lbuf *" b
 The address of the line buffer.
 .TP
-.I p
+.BI "char *" p
 The address at which the new data has been written.  This must be the
 base address returned from
 .BR lbuf_free .
 .TP
-.I len
+.BI "size_t " len
 The number of bytes which have been written to the buffer.
 .PP
 The
index daa2c8412ab3c3622bc7a53976c2608bc9d9f3ea..6045fed73df0676669f049cd2457b1ec3d2c0f7e 100644 (file)
@@ -136,24 +136,24 @@ about the option in a data block.
 .PP
 The data block is a structure containing at least the following members:
 .TP
-.B arg
+.B "char *arg"
 Pointer to the argument of the current option, or null.  Argument
 strings persist for as long as the underlying command line argument
 array
 .I argv
 does, so it's usually safe just to remember the pointer.
 .TP
-.B opt
+.B "int opt"
 Value of the current option
 .TP
-.B int
+.B "int ind"
 Must be initialized to 0 before the first call to
 .BR mdwopt .
 After the last call, it is the index into
 .I argv
 of the first nonoption argument.
 .TP
-.B err
+.B "int err"
 Set to nonzero to allow
 .B mdwopt
 to emit error messages about illegal option syntax.  (This would be a
@@ -161,7 +161,7 @@ flag setting, but it has to be here for
 .B getopt
 compatibility.)
 .TP
-.B prog
+.B "char *prog"
 Contains the program's name, stripped of any path prefix.  This is an
 obsolete feature: the
 .BR quis (3)
@@ -258,16 +258,16 @@ table is of type
 .BR "struct option" ,
 which contains the following members (in order):
 .TP
-.B name
+.B "const char *name"
 Pointer to the option's name.
 .TP
-.B has_arg
+.B "int has_arg"
 A flags word describing the option.  (The name is historical.)
 .TP
-.B flag
+.B "int *flag"
 Address of the flag variable to use when this option is matched.
 .TP
-.B val
+.B "int val"
 Value to store or return when this option is matched.
 .PP
 The table is terminated by an entry whose
index 334a5638c5580ec9260fc1aef75f17e2db9047f9..bedae5245241aadd7385191e8a3fc8c258ab9c28 100644 (file)
@@ -39,22 +39,22 @@ This object must be allocated by the caller, and initialized using the
 .B selbuf_init
 function.  This requires a fair few arguments:
 .TP
-.I b
+.BI "selbuf *" b
 Pointer to the
 .B selbuf
 object to initialize.
 .TP
-.I s
+.BI "sel_state *" s
 Pointer to a multiplexor object (type
 .BR sel_state )
 to which this selector should be attached.  See
 .BR sel (3)
 for more details about multiplexors, and how this whole system works.
 .TP
-.I fd
+.BI "int " fd
 The file descriptor of the stream the selector should read from.
 .TP
-.I func
+.BI "void (*" func ")(char *" s ", void *" p )
 The
 .I "line handler"
 function.  It is passed a pointer to each line read from the file (or
@@ -64,7 +64,7 @@ argument to
 .B selbuf_init
 described below).
 .TP
-.I p
+.BI "void *" p
 A pointer argument passed to
 .I func
 for each line read from the file.  Apart from this, the pointer is not
index 4ac61d194a9fdb3117e0557942a78b22b5d75eca..1484fb576fd0f60b852cb578c534ef421a466db8 100644 (file)
--- a/man/str.3
+++ b/man/str.3
@@ -50,11 +50,11 @@ The function
 divides a string into whitespace-separated words.  The arguments are as
 follows:
 .TP
-.I p
+.BI "char *" p
 The address of the string to split.  The string is modified by having
 null terminators written after each word extracted.
 .TP
-.I v
+.BI "char *" v []
 The address of an array of pointers to characters.  This array will be
 filled in by
 .BR str_split :
@@ -62,12 +62,12 @@ the first entry will point to the first word extracted from the string,
 and so on.  If there aren't enough words in the string, the remaining
 array elements are filled with null pointers.
 .TP
-.I c
+.BI "size_t " c
 The maximum number of words to extract; also, the number of elements in
 the array
 .IR v .
 .TP
-.I rest
+.BI "char **" rest
 The address of a pointer in which to store the address of the remainder
 of the string.  Leading whitespace is removed from the remainder before
 storing.  If the remainder string is empty, a null pointer is stored
index c495ab3c4780b7aed78b9d1b4a3530933bba1258..d81186b464ceb65643b0e6d34e0139d9e368d31f 100644 (file)
--- a/man/sym.3
+++ b/man/sym.3
@@ -99,27 +99,27 @@ Most of the actual work is done by the function
 It does both lookup and creation, depending on its arguments.  To do its
 job, it needs to know the following bits of information:
 .TP
-.I t
+.BI "sym_table *" t
 A pointer to a symbol table to manipulate.
 .TP
-.I n
+.BI "const char *" n
 The address of the
 .I key
 to look up or create.  Usually this will be a simple text string,
 although it can actually be any arbitrary binary data.
 .TP
-.I l
+.BI "long " l
 The length of the key.  If this is \-1,
 .B sym_find
 assumes that the key is a null-terminated string, and calculates its
 length itself.
 .TP
-.I sz
+.BI "size_t " sz
 The size of the value block to allocate if the key could not be found.
 If this is zero, no value is allocated, and a null pointer is returned
 to indicate an unsuccessful lookup.
 .TP
-.I f
+.BI "unsigned *" f
 The address of a `found' flag to set.  This is an output parameter.  On
 exit,
 .B sym_find
index db3a261c2b01b4857ef50031403eefba2ca3bc7e..9138b8801ccc1c4a638d1f05ad141c7a5dd03fb2 100644 (file)
@@ -98,18 +98,18 @@ typedef struct test_chunk {
 .VE
 The members of this structure are as follows:
 .TP
-.I "name"
+.B "const char *name"
 The name of the chunk described by this chunk definition, or null if
 this is the termination marker.
 .TP
-.I "test"
+.B "int (*test)(dstr dv[])"
 The test function.  It is passed an array of dynamic strings, one for
 each field, and must return nonzero if the test succeeded or zero if the
 test failed.  On success, the function should not write anything to
 stdout or stderr; on failure, a report of the test arguments should be
 emitted to stderr.
 .TP
-.I "f"
+.B "test_type *f[TEST_FIELDMAX]"
 Definitions of the fields.  This is an array of pointers to
 .I "field types"
 (see below), terminated by a null pointer.
@@ -128,15 +128,15 @@ typedef struct test_type {
 } test_type;
 .VE
 The
-.I cvt
+.B cvt
 member is a function called to read an input string stored in
-.I buf
+.B buf
 and output internal-format data in the dynamic string
 .IR d .
 The testrig driver has already stripped of quotes and dealt with
 backslash escapes.
 The
-.I dump
+.B dump
 member is called to write the internal-format data in dynamic string
 .I d
 to the
index dc4bd1fbd5f299b55dfb62fe208563c3b7161646..433b3ffb9ab39c31086182503678fd1f7ff66e6a 100644 (file)
--- a/man/tv.3
+++ b/man/tv.3
@@ -159,8 +159,8 @@ The idea of passing a relational operator to
 .B TV_CMP
 is stolen from the
 .B timercmp
-macro in the GNU C library.  I don't know whether this macro is a GNU
-original, but it certainly doesn't seem to be portable.  The
+macro in the GNU C library.  This doesn't look like a GNU original,
+however; whatever, it doesn't seem to be very portable.  The GNU
 .B timercmp
 macro had a warning attached to it that it wouldn't work for operators
 like