From c18d2d94c8a27c1dcc5036bebdfcce92874a297c Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sat, 28 Sep 2019 05:48:54 +0200 Subject: Funtion name with variable part in doc/man7/ and doc/internal/man3/ We have a few pages where part of function names can be considered variable. There are no normative guidelines for such a case, but if we draw from the formatting convention of variable and argument names, we can draw the conclusion that this variable part should be italized, within already given conventions. In other words, we need to help the POD processor along in cases like these: SPARSE_ARRAY_OF(TYPE) ossl_sa_TYPE_num() These need explicit formatting: B(I) B_num>() Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/10034) --- doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod | 57 ++++++++++++++++------------ doc/internal/man3/ossl_param_bld_init.pod | 10 ++++- doc/man7/bio.pod | 4 +- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod b/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod index 8afd48ec4d..60695266a7 100644 --- a/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod +++ b/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod @@ -33,38 +33,46 @@ ossl_sa_TYPE_doall_arg, ossl_sa_TYPE_get, ossl_sa_TYPE_set =head1 DESCRIPTION +=begin comment + +POD is pretty good at recognising function names and making them appropriately +bold... however, when part of the function name is variable, we have to help +the processor along + +=end comment + SPARSE_ARRAY_OF() returns the name for a sparse array of the specified -B. DEFINE_STACK_OF() creates set of functions for a sparse array of -B. This will mean that a pointer to type B is stored in each -element of a sparse array, the type is referenced by SPARSE_ARRAY_OF(TYPE) and -each function name begins with B. For example: +I. DEFINE_STACK_OF() creates set of functions for a sparse array of +I. This will mean that a pointer to type I is stored in each +element of a sparse array, the type is referenced by B(I) +and each function name begins with B_>. For example: TYPE *ossl_sa_TYPE_get(SPARSE_ARRAY_OF(TYPE) *sa, ossl_uintmax_t idx); -ossl_sa_TYPE_num() returns the number of elements in I or 0 if I is -NULL. +B_num>() returns the number of elements in I or 0 if I +is NULL. -ossl_sa_TYPE_get() returns element I in I, where I starts at -zero. If I refers to a value that has not been set then NULL is +B_get>() returns element I in I, where I starts +at zero. If I refers to a value that has not been set then NULL is returned. -ossl_sa_TYPE_set() sets element I in I to I, where I +B_set>() sets element I in I to I, where I starts at zero. The sparse array will be resized as required. -ossl_sa_TYPE_new() allocates a new empty sparse array. +B_new>() allocates a new empty sparse array. -ossl_sa_TYPE_free() frees up the I structure. It does I free up any +B_free>() frees up the I structure. It does I free up any elements of I. After this call I is no longer valid. -ossl_sa_TYPE_free_leaves() frees up the I structure and all of its +B_free_leaves>() frees up the I structure and all of its elements. After this call I is no longer valid. -ossl_sa_TYPE_doall() calls the function I for each element in I +B_doall>() calls the function I for each element in I in ascending index order. The index position, within the sparse array, of each item is passed as the first argument to the leaf function and a pointer to the associated value is is passed as the second argument. -ossl_sa_TYPE_doall_arg() calls the function I for each element in +B_doall_arg>() calls the function I for each element in I in ascending index order. The index position, within the sparse array, of each item is passed as the first argument to the leaf function, a pointer to the associated value is passed as the second argument and @@ -77,9 +85,9 @@ Sparse arrays are an internal data structure and should B be used by user applications. Care should be taken when accessing sparse arrays in multi-threaded -environments. The ossl_sa_TYPE_set operation can cause the internal structure -of the sparse array to change which causes race conditions if the sparse array -is accessed in a different thread. +environments. The B_set>() operation can cause the internal +structure of the sparse array to change which causes race conditions if the +sparse array is accessed in a different thread. SPARSE_ARRAY_OF() and DEFINE_SPARSE_ARRAY_OF() are implemented as macros. @@ -90,21 +98,22 @@ OPENSSL_SA_num and OPENSSL_SA_set. =head1 RETURN VALUES -ossl_sa_TYPE_num() returns the number of elements in the sparse array or B<0> -if the passed sparse array is NULL. +B_num>() returns the number of elements in the sparse array or +B<0> if the passed sparse array is NULL. -ossl_sa_TYPE_get() returns a pointer to a sparse array element or NULL if +B_get>() returns a pointer to a sparse array element or NULL if the element has not be set. -ossl_sa_TYPE_set() return B<1> on success and B<0> on error. In the latter +B_set>() return B<1> on success and B<0> on error. In the latter case, the elements of the sparse array remain unchanged, although the internal structures might have. -ossl_sa_TYPE_new() returns an empty sparse array or NULL if an error +B_new>() returns an empty sparse array or NULL if an error occurs. -ossl_sa_TYPE_doall, ossl_sa_TYPE_doall_arg, ossl_sa_TYPE_free() and -ossl_sa_TYPE_free_leaves() do not return values. +B_doall>(), B_doall_arg>(), +B_free>() and B_free_leaves>() +do not return values. =head1 HISTORY diff --git a/doc/internal/man3/ossl_param_bld_init.pod b/doc/internal/man3/ossl_param_bld_init.pod index 2eb838d9a9..fb439f24a6 100644 --- a/doc/internal/man3/ossl_param_bld_init.pod +++ b/doc/internal/man3/ossl_param_bld_init.pod @@ -70,7 +70,15 @@ by I of at least I bytes in size. If required, secure memory for private BIGNUMs should be pointed to by I of at least I bytes in size. -ossl_param_bld_push_TYPE() are a series of functions which will create +=begin comment + +POD is pretty good at recognising function names and making them appropriately +bold... however, when part of the function name is variable, we have to help +the processor along + +=end comment + +B>() are a series of functions which will create OSSL_PARAM objects of the specified size and correct type for the I argument. I is stored by value and an expression or auto variable can be used. diff --git a/doc/man7/bio.pod b/doc/man7/bio.pod index 1d3276b730..84892e71ac 100644 --- a/doc/man7/bio.pod +++ b/doc/man7/bio.pod @@ -49,8 +49,8 @@ BIO_free() on it other than the discarded return value. Normally the I argument is supplied by a function which returns a pointer to a BIO_METHOD. There is a naming convention for such functions: -a source/sink BIO is normally called BIO_s_*() and a filter BIO -BIO_f_*(); +a source/sink BIO is normally called B>() and a filter BIO +B>(); =head1 EXAMPLES -- cgit v1.2.3