summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-08-04 18:25:31 -0600
committerKarl Williamson <khw@cpan.org>2019-09-02 21:52:10 -0600
commit1b7e229402b233ace142ad59f19a135d3d390e03 (patch)
treee6e2c2983812773d4e5546ebddd81bb98a810cfe /handy.h
parent8d9433ebe551c1f97278fdb5b114a4e0f4bbdc38 (diff)
downloadperl-1b7e229402b233ace142ad59f19a135d3d390e03.tar.gz
perlapi: Document C_ARRAY_LENGTH, END
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/handy.h b/handy.h
index 2b0725b634..e2fb0aab24 100644
--- a/handy.h
+++ b/handy.h
@@ -2485,11 +2485,23 @@ void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumbe
#define StructCopy(s,d,t) (*((t*)(d)) = *((t*)(s)))
-/* C_ARRAY_LENGTH is the number of elements in the C array (so you
- * want your zero-based indices to be less than but not equal to).
- *
- * C_ARRAY_END is one past the last: half-open/half-closed range,
- * not last-inclusive range. */
+/*
+=head1 Handy Values
+
+=for apidoc Am|STRLEN|C_ARRAY_LENGTH|void *a
+
+Returns the number of elements in the input C array (so you want your
+zero-based indices to be less than but not equal to).
+
+=for apidoc Am|void *|C_ARRAY_END|void *a
+
+Returns a pointer to one element past the final element of the input C array.
+
+=cut
+
+C_ARRAY_END is one past the last: half-open/half-closed range, not
+last-inclusive range.
+*/
#define C_ARRAY_LENGTH(a) (sizeof(a)/sizeof((a)[0]))
#define C_ARRAY_END(a) ((a) + C_ARRAY_LENGTH(a))