[vlc-commits] Move VLC object internals to a more private header

Rémi Denis-Courmont git at videolan.org
Sat Nov 10 18:01:14 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 10 17:28:31 2012 +0200| [ffc6586bfe66dd333db309bb1c6e4a9c6b4796d1] | committer: Rémi Denis-Courmont

Move VLC object internals to a more private header

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

 src/libvlc.c         |    2 +-
 src/libvlc.h         |   31 -------------------------------
 src/misc/variables.c |   14 ++++++--------
 src/misc/variables.h |   35 +++++++++++++++++++++++++++++++++--
 4 files changed, 40 insertions(+), 42 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 5856843..abbe7d3 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -70,8 +70,8 @@
 #include <vlc_modules.h>
 
 #include "libvlc.h"
-
 #include "playlist/playlist_internal.h"
+#include "misc/variables.h"
 
 #include <vlc_vlm.h>
 
diff --git a/src/libvlc.h b/src/libvlc.h
index 8777663..5d557c8 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -124,43 +124,12 @@ void vlc_object_set_destructor (vlc_object_t *, vlc_destructor_t);
  */
 module_t *module_find_by_shortcut (const char *psz_shortcut);
 
-/**
- * Private LibVLC data for each object.
- */
-typedef struct vlc_object_internals vlc_object_internals_t;
-
-struct vlc_object_internals
-{
-    char           *psz_name; /* given name */
-
-    /* Object variables */
-    void           *var_root;
-    vlc_mutex_t     var_lock;
-    vlc_cond_t      var_wait;
-
-    /* Objects thread synchronization */
-    int             pipes[2];
-
-    /* Objects management */
-    vlc_spinlock_t   ref_spin;
-    unsigned         i_refcount;
-    vlc_destructor_t pf_destructor;
-
-    /* Objects tree structure */
-    vlc_object_internals_t *next;  /* next sibling */
-    vlc_object_internals_t *prev;  /* previous sibling */
-    vlc_object_internals_t *first; /* first child */
-};
-
 #define ZOOM_SECTION N_("Zoom")
 #define ZOOM_QUARTER_KEY_TEXT N_("1:4 Quarter")
 #define ZOOM_HALF_KEY_TEXT N_("1:2 Half")
 #define ZOOM_ORIGINAL_KEY_TEXT N_("1:1 Original")
 #define ZOOM_DOUBLE_KEY_TEXT N_("2:1 Double")
 
-#define vlc_internals( obj ) (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
-#define vlc_externals( priv ) ((vlc_object_t *)((priv) + 1))
-
 typedef struct sap_handler_t sap_handler_t;
 
 /**
diff --git a/src/misc/variables.c b/src/misc/variables.c
index 7473b6d..c438526 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -28,17 +28,9 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-#include <vlc_charset.h>
-#include "variables.h"
-
 #ifdef HAVE_SEARCH_H
 # include <search.h>
 #endif
-
-#include "libvlc.h"
-#include "config/configuration.h"
-
 #include <assert.h>
 #include <math.h>
 #include <limits.h>
@@ -46,6 +38,12 @@
 # include <dlfcn.h>
 #endif
 
+#include <vlc_common.h>
+#include <vlc_charset.h>
+#include "libvlc.h"
+#include "variables.h"
+#include "config/configuration.h"
+
 /*****************************************************************************
  * Private types
  *****************************************************************************/
diff --git a/src/misc/variables.h b/src/misc/variables.h
index 2ab9a1e..7d56caf 100644
--- a/src/misc/variables.h
+++ b/src/misc/variables.h
@@ -1,8 +1,7 @@
 /*****************************************************************************
  * variables.h: object variables typedefs
  *****************************************************************************
- * Copyright (C) 2002-2006 VLC authors and VideoLAN
- * $Id$
+ * Copyright (C) 1999-2012 VLC authors and VideoLAN
  *
  * Authors: Samuel Hocevar <sam at zoy.org>
  *
@@ -24,6 +23,38 @@
 #ifndef LIBVLC_VARIABLES_H
 # define LIBVLC_VARIABLES_H 1
 
+/**
+ * Private LibVLC data for each object.
+ */
+typedef struct vlc_object_internals vlc_object_internals_t;
+
+struct vlc_object_internals
+{
+    char           *psz_name; /* given name */
+
+    /* Object variables */
+    void           *var_root;
+    vlc_mutex_t     var_lock;
+    vlc_cond_t      var_wait;
+
+    /* Objects thread synchronization */
+    int             pipes[2];
+
+    /* Objects management */
+    vlc_spinlock_t   ref_spin;
+    unsigned         i_refcount;
+    vlc_destructor_t pf_destructor;
+
+    /* Objects tree structure */
+    vlc_object_internals_t *next;  /* next sibling */
+    vlc_object_internals_t *prev;  /* previous sibling */
+    vlc_object_internals_t *first; /* first child */
+};
+
+# define vlc_internals( obj ) (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
+# define vlc_externals( priv ) ((vlc_object_t *)((priv) + 1))
+
+
 typedef struct callback_entry_t callback_entry_t;
 
 typedef struct variable_ops_t



More information about the vlc-commits mailing list