[vlc-commits] lua: remove leading '__' in function name

Rémi Duraffort git at videolan.org
Wed Jul 13 11:10:53 CEST 2011


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jul 11 15:41:26 2011 +0200| [17bb975a23921e19835842de2dce02b3c5f94600] | committer: Rémi Duraffort

lua: remove leading '__' in function name

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=17bb975a23921e19835842de2dce02b3c5f94600
---

 modules/lua/libs/objects.c   |   47 +++++++++++++++++++++--------------------
 modules/lua/libs/objects.h   |    4 +-
 modules/lua/libs/variables.c |    5 ++-
 modules/lua/libs/variables.h |    7 +++--
 modules/lua/vlc.c            |   17 +++++++++-----
 modules/lua/vlc.h            |   26 +++++++++++-----------
 6 files changed, 57 insertions(+), 49 deletions(-)

diff --git a/modules/lua/libs/objects.c b/modules/lua/libs/objects.c
index 32c2bd2..bcc6f13 100644
--- a/modules/lua/libs/objects.c
+++ b/modules/lua/libs/objects.c
@@ -51,29 +51,6 @@ typedef struct
 /*****************************************************************************
  * Generic vlc_object_t wrapper creation
  *****************************************************************************/
-int __vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
-                              lua_CFunction pf_gc )
-{
-    vlc_object_t **udata = (vlc_object_t **)
-        lua_newuserdata( L, sizeof( vlc_object_t * ) );
-    *udata = p_obj;
-
-    if( luaL_newmetatable( L, "vlc_object" ) )
-    {
-        /* Hide the metatable */
-        lua_pushliteral( L, "none of your business" );
-        lua_setfield( L, -2, "__metatable" );
-        if( pf_gc ) /* FIXME */
-        {
-            /* Set the garbage collector if needed */
-            lua_pushcfunction( L, pf_gc );
-            lua_setfield( L, -2, "__gc" );
-        }
-    }
-    lua_setmetatable( L, -2 );
-    return 1;
-}
-
 int vlclua_gc_release( lua_State *L )
 {
     vlc_object_t **p_obj = (vlc_object_t **)luaL_checkudata( L, 1, "vlc_object" );
@@ -118,6 +95,30 @@ static int vlclua_get_input( lua_State *L )
     return 1;
 }
 
+#undef vlclua_push_vlc_object
+int vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
+                              lua_CFunction pf_gc )
+{
+    vlc_object_t **udata = (vlc_object_t **)
+        lua_newuserdata( L, sizeof( vlc_object_t * ) );
+    *udata = p_obj;
+
+    if( luaL_newmetatable( L, "vlc_object" ) )
+    {
+        /* Hide the metatable */
+        lua_pushliteral( L, "none of your business" );
+        lua_setfield( L, -2, "__metatable" );
+        if( pf_gc ) /* FIXME */
+        {
+            /* Set the garbage collector if needed */
+            lua_pushcfunction( L, pf_gc );
+            lua_setfield( L, -2, "__gc" );
+        }
+    }
+    lua_setmetatable( L, -2 );
+    return 1;
+}
+
 /*****************************************************************************
  *
  *****************************************************************************/
diff --git a/modules/lua/libs/objects.h b/modules/lua/libs/objects.h
index cc91fab..687a1d5 100644
--- a/modules/lua/libs/objects.h
+++ b/modules/lua/libs/objects.h
@@ -25,10 +25,10 @@
 #ifndef VLC_LUA_OBJECTS_H
 #define VLC_LUA_OBJECTS_H
 
-int __vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
+int vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
                               lua_CFunction pf_gc );
 #define vlclua_push_vlc_object( a, b, c ) \
-        __vlclua_push_vlc_object( a, VLC_OBJECT( b ), c )
+        vlclua_push_vlc_object( a, VLC_OBJECT( b ), c )
 int vlclua_gc_release( lua_State *L );
 
 #endif
diff --git a/modules/lua/libs/variables.c b/modules/lua/libs/variables.c
index 26bc0d9..cb866b3 100644
--- a/modules/lua/libs/variables.c
+++ b/modules/lua/libs/variables.c
@@ -263,8 +263,9 @@ static int vlclua_libvlc_command( lua_State *L )
     return vlclua_push_ret( L, i_ret );
 }
 
-int __vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj,
-                                const char *psz_name )
+#undef vlclua_var_toggle_or_set
+int vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj,
+                              const char *psz_name )
 {
     bool b_bool;
     if( lua_gettop( L ) > 1 ) return vlclua_error( L );
diff --git a/modules/lua/libs/variables.h b/modules/lua/libs/variables.h
index f87e78a..cbc60d8 100644
--- a/modules/lua/libs/variables.h
+++ b/modules/lua/libs/variables.h
@@ -25,9 +25,10 @@
 #ifndef VLC_LUA_VARIABLES_H
 #define VLC_LUA_VARIABLES_H
 
-#define vlclua_var_toggle_or_set(a,b,c) \
-    __vlclua_var_toggle_or_set(a,VLC_OBJECT(b),c)
-int __vlclua_var_toggle_or_set( lua_State *, vlc_object_t *, const char * );
+int vlclua_var_toggle_or_set( lua_State *, vlc_object_t *, const char * );
+
+#define vlclua_var_toggle_or_set( a, b, c ) \
+        vlclua_var_toggle_or_set( a, VLC_OBJECT( b ), c )
 
 #endif
 
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 26e30ca..88e23e8 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -372,8 +372,9 @@ char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const
  * Meta data setters utility.
  * Playlist item table should be on top of the stack when these are called
  *****************************************************************************/
-void __vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
-                              input_item_t *p_input )
+#undef vlclua_read_meta_data
+void vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
+                            input_item_t *p_input )
 {
 #define TRY_META( a, b )                                        \
     lua_getfield( L, -1, a );                                   \
@@ -406,7 +407,8 @@ void __vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
     TRY_META( "trackid", TrackID );
 }
 
-void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_read_custom_meta_data
+void vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
                                      input_item_t *p_input )
 {
     /* Lock the input item and create the meta table if needed */
@@ -451,7 +453,8 @@ void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
 /**
  * Playlist item table should be on top of the stack when this is called
  */
-void __vlclua_read_options( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_read_options
+void vlclua_read_options( vlc_object_t *p_this, lua_State *L,
                             int *pi_options, char ***pppsz_options )
 {
     lua_getfield( L, -1, "options" );
@@ -477,7 +480,8 @@ void __vlclua_read_options( vlc_object_t *p_this, lua_State *L,
     lua_pop( L, 1 ); /* pop "options" */
 }
 
-int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_playlist_add_internal
+int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                                     playlist_t *p_playlist,
                                     input_item_t *p_parent, bool b_play )
 {
@@ -750,7 +754,8 @@ static int vlclua_add_modules_path_inner( lua_State *L, const char *psz_path )
     return count;
 }
 
-int __vlclua_add_modules_path( vlc_object_t *obj, lua_State *L, const char *psz_filename )
+#undef vlclua_add_modules_path
+int vlclua_add_modules_path( vlc_object_t *obj, lua_State *L, const char *psz_filename )
 {
     /* Setup the module search path:
      *   * "The script's directory"/modules
diff --git a/modules/lua/vlc.h b/modules/lua/vlc.h
index 6aa47aa..5d87914 100644
--- a/modules/lua/vlc.h
+++ b/modules/lua/vlc.h
@@ -135,19 +135,19 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *url );
 /*****************************************************************************
  * Playlist and meta data internal utilities.
  *****************************************************************************/
-void __vlclua_read_options( vlc_object_t *, lua_State *, int *, char *** );
-#define vlclua_read_options(a,b,c,d) __vlclua_read_options(VLC_OBJECT(a),b,c,d)
-void __vlclua_read_meta_data( vlc_object_t *, lua_State *, input_item_t * );
-#define vlclua_read_meta_data(a,b,c) __vlclua_read_meta_data(VLC_OBJECT(a),b,c)
-void __vlclua_read_custom_meta_data( vlc_object_t *, lua_State *,
-                                     input_item_t *);
-#define vlclua_read_custom_meta_data(a,b,c) __vlclua_read_custom_meta_data(VLC_OBJECT(a),b,c)
-int __vlclua_playlist_add_internal( vlc_object_t *, lua_State *, playlist_t *,
-                                    input_item_t *, bool );
-#define vlclua_playlist_add_internal(a,b,c,d,e) __vlclua_playlist_add_internal(VLC_OBJECT(a),b,c,d,e)
-
-int __vlclua_add_modules_path( vlc_object_t *, lua_State *, const char *psz_filename );
-#define vlclua_add_modules_path( a, b, c ) __vlclua_add_modules_path(VLC_OBJECT(a), b, c)
+void vlclua_read_options( vlc_object_t *, lua_State *, int *, char *** );
+#define vlclua_read_options( a, b, c, d ) vlclua_read_options( VLC_OBJECT( a ), b, c, d )
+void vlclua_read_meta_data( vlc_object_t *, lua_State *, input_item_t * );
+#define vlclua_read_meta_data( a, b, c ) vlclua_read_meta_data( VLC_OBJECT( a ), b, c )
+void vlclua_read_custom_meta_data( vlc_object_t *, lua_State *,
+                                   input_item_t *);
+#define vlclua_read_custom_meta_data( a, b, c ) vlclua_read_custom_meta_data( VLC_OBJECT( a ), b, c )
+int vlclua_playlist_add_internal( vlc_object_t *, lua_State *, playlist_t *,
+                                  input_item_t *, bool );
+#define vlclua_playlist_add_internal( a, b, c, d, e ) vlclua_playlist_add_internal( VLC_OBJECT( a ), b, c, d, e )
+
+int vlclua_add_modules_path( vlc_object_t *, lua_State *, const char *psz_filename );
+#define vlclua_add_modules_path( a, b, c ) vlclua_add_modules_path( VLC_OBJECT( a ), b, c )
 
 /**
  * Per-interface private state



More information about the vlc-commits mailing list