]> git.sesse.net Git - vlc/commitdiff
variables: add a var_GetAddress function.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 5 Oct 2009 08:43:11 +0000 (10:43 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Sat, 10 Oct 2009 09:26:48 +0000 (11:26 +0200)
include/vlc_variables.h

index 06ae899f327b3f29e313f03dcecff2e8b21c0916..5c84a7af2d2ee17a7b975a37adad71ddad6f8413 100644 (file)
@@ -416,6 +416,15 @@ static inline char *__var_GetNonEmptyString( vlc_object_t *p_obj, const char *ps
     return NULL;
 }
 
+LIBVLC_USED
+static inline void *__var_GetAddress( vlc_object_t *p_obj, const char *psz_name )
+{
+    vlc_value_t val;
+    if( var_GetChecked( p_obj, psz_name, VLC_VAR_ADDRESS, &val ) )
+        return NULL;
+    else
+        return val.p_address;
+}
 
 /**
  * __var_GetInteger() with automatic casting
@@ -438,6 +447,10 @@ static inline char *__var_GetNonEmptyString( vlc_object_t *p_obj, const char *ps
  */
 #define var_GetString(a,b)   __var_GetString( VLC_OBJECT(a),b)
 #define var_GetNonEmptyString(a,b)   __var_GetNonEmptyString( VLC_OBJECT(a),b)
+/**
+ * __var_GetAddress() with automatic casting
+ */
+#define var_GetAddress(a,b)  __var_GetAddress( VLC_OBJECT(a),b)