]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
Hide psz_object_name in private data
[vlc] / include / vlc_common.h
index 649553b48ff3f050bbf7ff6671694a65676ac752..fc4656749438a12ff10ccc67c006c58a012d5fbe 100644 (file)
@@ -176,15 +176,6 @@ typedef struct module_cache_t module_cache_t;
 
 typedef struct config_category_t config_category_t;
 
-/* Interface */
-typedef struct intf_thread_t intf_thread_t;
-typedef struct intf_sys_t intf_sys_t;
-typedef struct intf_console_t intf_console_t;
-typedef struct intf_msg_t intf_msg_t;
-typedef struct interaction_t interaction_t;
-typedef struct interaction_dialog_t interaction_dialog_t;
-typedef struct user_widget_t user_widget_t;
-
 /* Input */
 typedef struct input_thread_t input_thread_t;
 typedef struct input_thread_sys_t input_thread_sys_t;
@@ -362,7 +353,6 @@ typedef struct counter_t     counter_t;
 typedef struct counter_sample_t counter_sample_t;
 typedef struct stats_handler_t stats_handler_t;
 typedef struct input_stats_t input_stats_t;
-typedef struct global_stats_t global_stats_t;
 
 /* Update */
 typedef struct update_t update_t;
@@ -444,7 +434,6 @@ struct vlc_list_t
  *****************************************************************************/
 #define VLC_SUCCESS         -0                                   /* No error */
 #define VLC_ENOMEM          -1                          /* Not enough memory */
-#define VLC_ETHREAD         -2                               /* Thread error */
 #define VLC_ETIMEOUT        -3                                    /* Timeout */
 
 #define VLC_ENOMOD         -10                           /* Module not found */
@@ -510,9 +499,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
  * these members are common for all vlc objects                             \
  */                                                                         \
 /**@{*/                                                                     \
-    int   i_object_type;                                                    \
     const char *psz_object_type;                                            \
-    char *psz_object_name;                                                  \
                                                                             \
     /* Messages header */                                                   \
     char *psz_header;                                                       \
@@ -603,22 +590,7 @@ static inline uint8_t clip_uint8_vlc( int32_t a )
     else           return a;
 }
 
-/* Malloc with automatic error */
-#define MALLOC_VOID( var, type ) do { var = (type*)malloc( sizeof( type) ); \
-                                   if( !var ) return; } while(0)
-#define MALLOC_NULL( var, type ) do { var = (type*)malloc( sizeof( type) ); \
-                                   if( !var ) return NULL; } while(0)
-#define MALLOC_ERR( var, type ) do { var = (type*)malloc( sizeof( type) ); \
-                                   if( !var ) return VLC_ENOMEM; } while(0)
-#define MALLOC_GOTOERR( var, type ) do { var = (type*)malloc( sizeof( type) ); \
-                                      if( !var ) goto error; } while(0)
-#define DECMALLOC_VOID( var, type ) type* var = (type*)malloc( sizeof(type) );\
-                                    if( !var ) return;
-#define DECMALLOC_ERR( var, type )  type* var = (type*)malloc( sizeof(type) );\
-                                    if( !var ) return VLC_ENOMEM;
-#define DECMALLOC_NULL( var, type ) type* var = (type*)malloc( sizeof(type) );\
-                                    if( !var ) return NULL;
-
+/* Free and set set the variable to NULL */
 #define FREENULL(a) do { free( a ); a = NULL; } while(0)
 
 #define EMPTY_STR(str) (!str || !*str)
@@ -751,11 +723,6 @@ static inline uint64_t ntoh64 (uint64_t ll)
 #define VLC_UNUSED(x) (void)(x)
 
 /* Stuff defined in src/extras/libc.c */
-VLC_EXPORT( size_t, vlc_strlcpy, ( char *, const char *, size_t ) );
-VLC_EXPORT( long long, vlc_strtoll, ( const char *nptr, char **endptr, int base ) LIBVLC_USED );
-
-VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) LIBVLC_USED );
-char *vlc_strsep( char **, const char * );
 
 #if defined(WIN32) || defined(UNDER_CE)
 /* win32, cl and icl support */
@@ -804,14 +771,6 @@ char *vlc_strsep( char **, const char * );
 
 #   ifndef alloca
 #       define alloca _alloca
-#   endif
-
-    /* These two are not defined in mingw32 (bug?) */
-#   ifndef snprintf
-#       define snprintf _snprintf
-#   endif
-#   ifndef vsnprintf
-#       define vsnprintf _vsnprintf
 #   endif
 
 #   include <tchar.h>
@@ -819,10 +778,6 @@ char *vlc_strsep( char **, const char * );
 
 VLC_EXPORT( bool, vlc_ureduce, ( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t ) );
 
-/* vlc_wraptext (defined in src/extras/libc.c) */
-#define wraptext vlc_wraptext
-VLC_EXPORT( char *, vlc_wraptext, ( const char *, int ) LIBVLC_USED );
-
 /* iconv wrappers (defined in src/extras/libc.c) */
 typedef void *vlc_iconv_t;
 VLC_EXPORT( vlc_iconv_t, vlc_iconv_open, ( const char *, const char * ) LIBVLC_USED );
@@ -864,6 +819,12 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
  *****************************************************************************/
 VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) LIBVLC_USED );
 
+static inline const char *vlc_pgettext( const char *ctx, const char *id )
+{
+    const char *tr = vlc_gettext( id );
+    return (tr == ctx) ? id : tr;
+}
+
 /*****************************************************************************
  * libvlc features
  *****************************************************************************/
@@ -873,7 +834,6 @@ VLC_EXPORT( const char *, VLC_CompileHost, ( void ) LIBVLC_USED );
 VLC_EXPORT( const char *, VLC_CompileDomain, ( void ) LIBVLC_USED );
 VLC_EXPORT( const char *, VLC_Compiler, ( void ) LIBVLC_USED );
 VLC_EXPORT( const char *, VLC_Error, ( int ) LIBVLC_USED );
-VLC_EXPORT( const char *, VLC_Changeset, ( void ) LIBVLC_USED );
 
 /*****************************************************************************
  * Additional vlc stuff