]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
Fix sort by artist
[vlc] / include / vlc_common.h
index ed4da001f3bc0f8e0a0e4d4136ac430375ab63ee..2f3e156d2acc8c753c9feecdc3542529fd43b107 100644 (file)
@@ -334,6 +334,15 @@ typedef struct announce_method_t announce_method_t;
 typedef struct announce_handler_t announce_handler_t;
 typedef struct sap_handler_t sap_handler_t;
 
+typedef struct sout_std_t sout_std_t;
+typedef struct sout_display_t sout_display_t;
+typedef struct sout_duplicate_t sout_duplicate_t;
+typedef struct sout_transcode_t sout_transcode_t;
+typedef struct sout_chain_t sout_chain_t;
+typedef struct streaming_profile_t streaming_profile_t;
+typedef struct sout_module_t sout_module_t;
+typedef struct sout_gui_descr_t sout_gui_descr_t;
+
 /* Decoders */
 typedef struct decoder_t      decoder_t;
 typedef struct decoder_sys_t  decoder_sys_t;
@@ -356,6 +365,10 @@ typedef struct vlc_acl_t vlc_acl_t;
 /* Misc */
 typedef struct iso639_lang_t iso639_lang_t;
 typedef struct device_t device_t;
+typedef struct device_probe_t device_probe_t;
+typedef struct probe_sys_t probe_sys_t;
+typedef struct localized_string_t localized_string_t;
+typedef struct i18n_string_t i18n_string_t;
 
 /* block */
 typedef struct block_t      block_t;
@@ -594,6 +607,25 @@ static int64_t GCD( int64_t a, int64_t b )
     else return a;
 }
 
+/* Malloc with automatic error */
+#define MALLOC_VOID( var, type ) { var = (type*)malloc( sizeof( type) ); \
+                                   if( !var ) return; }
+#define MALLOC_NULL( var, type ) { var = (type*)malloc( sizeof( type) ); \
+                                   if( !var ) return NULL; }
+#define MALLOC_ERR( var, type ) { var = (type*)malloc( sizeof( type) ); \
+                                   if( !var ) return VLC_ENOMEM; }
+#define MALLOC_GOTOERR( var, type ) { var = (type*)malloc( sizeof( type) ); \
+                                      if( !var ) goto error; }
+#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;
+
+#define FREENULL(a) if( a ) { free( a ); a = NULL; }
+#define FREE(a) if( a ) { free( a ); }
+
 /* Dynamic array handling: realloc array, move data, increment position */
 #if defined( _MSC_VER ) && _MSC_VER < 1300 && !defined( UNDER_CE )
 #   define VLCCVP (void**) /* Work-around for broken compiler */