diff options
| author | daurnimator <quae@daurnimator.com> | 2015-12-18 23:06:11 +1100 |
|---|---|---|
| committer | daurnimator <quae@daurnimator.com> | 2015-12-21 19:32:54 +1100 |
| commit | e1ccaebacd4e8f277222d2177e7c02fb31ea0bf2 (patch) | |
| tree | 4aa0088d395f48eb67a8f471ade0ca17cd54e965 | |
| parent | 67dca5b835148d971127a4c882a8de456cffd868 (diff) | |
| download | luaossl-e1ccaebacd4e8f277222d2177e7c02fb31ea0bf2.tar.gz luaossl-e1ccaebacd4e8f277222d2177e7c02fb31ea0bf2.tar.bz2 luaossl-e1ccaebacd4e8f277222d2177e7c02fb31ea0bf2.zip | |
bignum: Rename tostring function to todec. Expose as ":todec" method
| -rw-r--r-- | src/openssl.c | 9 |
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) { | |||
| 1941 | 1941 | ||
| 1942 | static BIO *getbio(lua_State *); | 1942 | static BIO *getbio(lua_State *); |
| 1943 | 1943 | ||
| 1944 | static int bn__tostring(lua_State *L) { | 1944 | static int bn_todec(lua_State *L) { |
| 1945 | BIGNUM *bn = checksimple(L, 1, BIGNUM_CLASS); | 1945 | BIGNUM *bn = checksimple(L, 1, BIGNUM_CLASS); |
| 1946 | char *txt = NULL; | 1946 | char *txt = NULL; |
| 1947 | BIO *bio; | 1947 | BIO *bio; |
| @@ -1966,8 +1966,8 @@ static int bn__tostring(lua_State *L) { | |||
| 1966 | sslerr: | 1966 | sslerr: |
| 1967 | OPENSSL_free(txt); | 1967 | OPENSSL_free(txt); |
| 1968 | 1968 | ||
| 1969 | return auxL_error(L, auxL_EOPENSSL, "bignum:__tostring"); | 1969 | return auxL_error(L, auxL_EOPENSSL, "bignum:todec"); |
| 1970 | } /* bn__tostring() */ | 1970 | } /* bn_todec() */ |
| 1971 | 1971 | ||
| 1972 | 1972 | ||
| 1973 | static const luaL_Reg bn_methods[] = { | 1973 | static const luaL_Reg bn_methods[] = { |
| @@ -1980,6 +1980,7 @@ static const luaL_Reg bn_methods[] = { | |||
| 1980 | { "shl", &bn__shl }, | 1980 | { "shl", &bn__shl }, |
| 1981 | { "shr", &bn__shr }, | 1981 | { "shr", &bn__shr }, |
| 1982 | { "tobin", &bn_tobin }, | 1982 | { "tobin", &bn_tobin }, |
| 1983 | { "todec", &bn_todec }, | ||
| 1983 | { NULL, NULL }, | 1984 | { NULL, NULL }, |
| 1984 | }; | 1985 | }; |
| 1985 | 1986 | ||
| @@ -1997,7 +1998,7 @@ static const luaL_Reg bn_metatable[] = { | |||
| 1997 | { "__lt", &bn__lt }, | 1998 | { "__lt", &bn__lt }, |
| 1998 | { "__le", &bn__le }, | 1999 | { "__le", &bn__le }, |
| 1999 | { "__gc", &bn__gc }, | 2000 | { "__gc", &bn__gc }, |
| 2000 | { "__tostring", &bn__tostring }, | 2001 | { "__tostring", &bn_todec }, |
| 2001 | { NULL, NULL }, | 2002 | { NULL, NULL }, |
| 2002 | }; | 2003 | }; |
| 2003 | 2004 | ||
