]> git.sesse.net Git - vlc/blobdiff - include/vlc_variables.h
*Ahem* whistles
[vlc] / include / vlc_variables.h
index 630d36d45a4d1dfa2d567c4386800235542c8226..f484b83eb749ab1794b8fc7b416781ae59df8876 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#if !defined( __LIBVLC__ )
+  #error You are not libvlc or one of its plugins. You cannot include this file
+#endif
+
 /**
  * \defgroup variables Variables
  *
@@ -49,9 +53,7 @@
 #define VLC_VAR_HASMAX    0x0400
 #define VLC_VAR_HASSTEP   0x0800
 
-#define VLC_VAR_ISLIST    0x1000
 #define VLC_VAR_ISCOMMAND 0x2000
-#define VLC_VAR_ISCONFIG  0x2000
 
 /** Creation flag */
 #define VLC_VAR_DOINHERIT 0x8000
@@ -348,6 +350,18 @@ static inline char *__var_GetString( vlc_object_t *p_obj, const char *psz_name )
         return strdup( "" );
 }
 
+static inline char *__var_GetNonEmptyString( vlc_object_t *obj, const char *name )
+{
+    vlc_value_t val;
+    if (__var_Get (obj, name, &val))
+        return NULL;
+    if (*val.psz_string)
+        return val.psz_string;
+    free (val.psz_string);
+    return NULL;
+}
+
+
 /**
  * __var_GetInteger() with automatic casting
  */
@@ -368,6 +382,7 @@ static inline char *__var_GetString( vlc_object_t *p_obj, const char *psz_name )
  * __var_GetString() with automatic casting
  */
 #define var_GetString(a,b)   __var_GetString( VLC_OBJECT(a),b)
+#define var_GetNonEmptyString(a,b)   __var_GetNonEmptyString( VLC_OBJECT(a),b)