]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
Removes trailing spaces. Removes tabs.
[vlc] / include / vlc_common.h
index 8ef6ff2dd769924672358f39ac19191e21d9f6ce..a741bfa2467ab35ccebce4019ef70577c8c9b871 100644 (file)
@@ -64,9 +64,8 @@
 #include <stdlib.h>
 #include <stdarg.h>
 
-#ifdef HAVE_STRING_H
-#   include <string.h>                                         /* strerror() */
-#endif
+#include <string.h>                                         /* strerror() */
+#include <stdio.h>
 
 #ifdef HAVE_SYS_TYPES_H
 #   include <sys/types.h>
@@ -192,6 +191,24 @@ typedef uint32_t vlc_fourcc_t;
 
 #endif
 
+static inline void __vlc_fourcc_to_char( vlc_fourcc_t fcc, char *psz_fourcc )
+{
+#ifdef WORDS_BIGENDIAN
+    psz_fourcc[0] = (uint32_t) (fcc >> 24);
+    psz_fourcc[1] = (uint32_t) (fcc >> 16);
+    psz_fourcc[2] = (uint32_t) (fcc >> 8);
+    psz_fourcc[3] = (uint32_t) (fcc);
+#else
+    psz_fourcc[3] = (uint32_t) (fcc >> 24);
+    psz_fourcc[2] = (uint32_t) (fcc >> 16);
+    psz_fourcc[1] = (uint32_t) (fcc >> 8);
+    psz_fourcc[0] = (uint32_t) (fcc);
+#endif
+}
+
+#define vlc_fourcc_to_char( a, b ) \
+    __vlc_fourcc_to_char( (vlc_fourcc_t)(a), (char *)(b) )
+
 /*****************************************************************************
  * Classes declaration
  *****************************************************************************/
@@ -383,7 +400,7 @@ typedef struct httpd_url_t      httpd_url_t;
 typedef struct httpd_client_t   httpd_client_t;
 typedef struct httpd_callback_sys_t httpd_callback_sys_t;
 typedef struct httpd_message_t  httpd_message_t;
-typedef int    (*httpd_callback_t)( httpd_callback_sys_t *, httpd_client_t *, httpd_message_t *answer, httpd_message_t *query );
+typedef int    (*httpd_callback_t)( httpd_callback_sys_t *, httpd_client_t *, httpd_message_t *answer, const httpd_message_t *query );
 typedef struct httpd_file_t     httpd_file_t;
 typedef struct httpd_file_sys_t httpd_file_sys_t;
 typedef int (*httpd_file_callback_t)( httpd_file_sys_t *, httpd_file_t *, uint8_t *psz_request, uint8_t **pp_data, int *pi_data );
@@ -473,13 +490,13 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
 
 #if defined (WIN32) && defined (DLL_EXPORT)
 #  ifdef __cplusplus
-#    define VLC_PUBLIC_API __declspec(dllexport) 
-#    define VLC_PRIVATE_API __declspec(dllexport) 
+#    define VLC_PUBLIC_API __declspec(dllexport)
+#    define VLC_PRIVATE_API __declspec(dllexport)
 #    define   VLC_EXPORT( type, name, args ) extern "C" __declspec(dllexport) type name args
 #    define VLC_INTERNAL( type, name, args ) extern "C" type name args
 #  else
-#    define VLC_PUBLIC_API extern __declspec(dllexport) 
-#    define VLC_PRIVATE_API extern __declspec(dllexport) 
+#    define VLC_PUBLIC_API extern __declspec(dllexport)
+#    define VLC_PRIVATE_API extern __declspec(dllexport)
 #    define   VLC_EXPORT( type, name, args ) __declspec(dllexport) type name args
 #    define VLC_INTERNAL( type, name, args ) type name args
 #  endif
@@ -502,7 +519,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
 #      define   VLC_EXPORT( type, name, args ) __attribute__((visibility("default"))) type name args
 #      define VLC_INTERNAL( type, name, args ) __attribute__((visibility("hidden"))) type name args
 #    else
-#      define VLC_PUBLIC_API extern 
+#      define VLC_PUBLIC_API extern
 #      define VLC_PRIVATE_API extern
 #      define   VLC_EXPORT( type, name, args ) type name args
 #      define VLC_INTERNAL( type, name, args ) type name args
@@ -525,6 +542,8 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
 
 #include "vlc_threads.h"
 
+typedef struct vlc_object_internals_t vlc_object_internals_t;
+
 /*****************************************************************************
  * Common structure members
  *****************************************************************************/
@@ -535,6 +554,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
  * these members are common for all vlc objects                             \
  */                                                                         \
 /**@{*/                                                                     \
+    vlc_object_internals_t *p_internals;                                    \
     int   i_object_id;                                                      \
     int   i_object_type;                                                    \
     const char *psz_object_type;                                            \
@@ -544,10 +564,6 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
     char *psz_header;                                                       \
     int  i_flags;                                                           \
                                                                             \
-    /* Thread properties, if any */                                         \
-    vlc_bool_t   b_thread;                                                  \
-    vlc_thread_t thread_id;                                                 \
-                                                                            \
     /* Object access lock */                                                \
     vlc_mutex_t  object_lock;                                               \
     vlc_cond_t   object_wait;                                               \
@@ -556,16 +572,9 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
     volatile vlc_bool_t b_error;                  /**< set by the object */ \
     volatile vlc_bool_t b_die;                   /**< set by the outside */ \
     volatile vlc_bool_t b_dead;                   /**< set by the object */ \
-    volatile vlc_bool_t b_attached;               /**< set by the object */ \
     vlc_bool_t b_force;      /**< set by the outside (eg. module_Need()) */ \
                                                                             \
-    /* Object variables */                                                  \
-    vlc_mutex_t     var_lock;                                               \
-    int             i_vars;                                                 \
-    variable_t *    p_vars;                                                 \
-                                                                            \
     /* Stuff related to the libvlc structure */                             \
-    vlc_object_t *p_libvlc_global;                 /**< root of all evil */ \
     libvlc_int_t *p_libvlc;                  /**< (root of all evil) - 1 */ \
                                                                             \
     volatile int    i_refcount;                         /**< usage count */ \