Unbreak lua's base64 encode/decode extensions
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 14 Mar 2012 09:30:34 +0000 (11:30 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 14 Mar 2012 09:35:37 +0000 (11:35 +0200)
- Commit 70f063cb773bedb7d336429d9bc8ed1d4e5d18f4 accidentally
  changed lua's base64 encode/decode interface too, ugh. Dangers of
  search-and-replace... Only the function name string exported to
  lua matters but renaming the internal functions back as well
  for naming consistency.

rpmio/rpmlua.c

index 441d062..319c0d0 100644 (file)
@@ -588,7 +588,7 @@ void rpmluaInteractive(rpmlua _lua)
 /* ------------------------------------------------------------------ */
 /* Lua API */
 
-static int rpm_rpmBase64Encode(lua_State *L)
+static int rpm_b64encode(lua_State *L)
 {
     const char *str = luaL_checkstring(L, 1);
     size_t len = lua_strlen(L, 1);
@@ -603,7 +603,7 @@ static int rpm_rpmBase64Encode(lua_State *L)
     return 1;
 }
 
-static int rpm_rpmBase64Decode(lua_State *L)
+static int rpm_b64decode(lua_State *L)
 {
     const char *str = luaL_checkstring(L, 1);
     if (str) {
@@ -823,8 +823,8 @@ static int rpm_print (lua_State *L)
 }
 
 static const luaL_reg rpmlib[] = {
-    {"rpmBase64Encode", rpm_rpmBase64Encode},
-    {"rpmBase64Decode", rpm_rpmBase64Decode},
+    {"b64encode", rpm_b64encode},
+    {"b64decode", rpm_b64decode},
     {"expand", rpm_expand},
     {"define", rpm_define},
     {"register", rpm_register},