aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2015-12-18 23:06:11 +1100
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2015-12-21 19:32:54 +1100
commite1ccaebacd4e8f277222d2177e7c02fb31ea0bf2 (patch)
tree4aa0088d395f48eb67a8f471ade0ca17cd54e965 /src
parent67dca5b835148d971127a4c882a8de456cffd868 (diff)
downloadluaossl-e1ccaebacd4e8f277222d2177e7c02fb31ea0bf2.tar.gz
luaossl-e1ccaebacd4e8f277222d2177e7c02fb31ea0bf2.tar.bz2
luaossl-e1ccaebacd4e8f277222d2177e7c02fb31ea0bf2.zip
bignum: Rename tostring function to todec. Expose as ":todec" method
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/openssl.c b/src/openssl.c
index a1a7c58..cb74506 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -1941,7 +1941,7 @@ static int bn__gc(lua_State *L) {
static BIO *getbio(lua_State *);
-static int bn__tostring(lua_State *L) {
+static int bn_todec(lua_State *L) {
BIGNUM *bn = checksimple(L, 1, BIGNUM_CLASS);
char *txt = NULL;
BIO *bio;
@@ -1966,8 +1966,8 @@ static int bn__tostring(lua_State *L) {
sslerr:
OPENSSL_free(txt);
- return auxL_error(L, auxL_EOPENSSL, "bignum:__tostring");
-} /* bn__tostring() */
+ return auxL_error(L, auxL_EOPENSSL, "bignum:todec");
+} /* bn_todec() */
static const luaL_Reg bn_methods[] = {
@@ -1980,6 +1980,7 @@ static const luaL_Reg bn_methods[] = {
{ "shl", &bn__shl },
{ "shr", &bn__shr },
{ "tobin", &bn_tobin },
+ { "todec", &bn_todec },
{ NULL, NULL },
};
@@ -1997,7 +1998,7 @@ static const luaL_Reg bn_metatable[] = {
{ "__lt", &bn__lt },
{ "__le", &bn__le },
{ "__gc", &bn__gc },
- { "__tostring", &bn__tostring },
+ { "__tostring", &bn_todec },
{ NULL, NULL },
};