From e4cdcc5eb020b937182b7a8660c644485a188531 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 13 Aug 2018 15:11:26 +1000 Subject: add name:each() as an alias for the __pairs metamethod __pairs is not respected in lua 5.1 --- doc/luaossl.tex | 6 +++++- src/openssl.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/luaossl.tex b/doc/luaossl.tex index 8695949..eef4444 100644 --- a/doc/luaossl.tex +++ b/doc/luaossl.tex @@ -362,10 +362,14 @@ field & description\\\hline .blob & raw string value of the component \end{tabular} -\subsubsection[\fn{name:\_\_pairs}]{\fn{name:\_\_pairs()}} +\subsubsection[\fn{name:each}]{\fn{name:each()}} Returns a key-value iterator over the distinguished name components. The key is either the short, long, or OID identifier, with preference for the former. +\subsubsection[\fn{name:\_\_pairs}]{\fn{name:\_\_pairs()}} + +Equal to \module{name:each} + \end{Module} diff --git a/src/openssl.c b/src/openssl.c index 827aa7d..4ffad71 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -5121,6 +5121,7 @@ static int xn__tostring(lua_State *L) { static const auxL_Reg xn_methods[] = { { "add", &xn_add }, { "all", &xn_all }, + { "each", &xn__pairs }, { NULL, NULL }, }; -- cgit v1.2.3-59-g8ed1b