From 4632744f6dced94c5ff38f1a7efab4e4beb3112f Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Mon, 5 Oct 2009 10:43:11 +0200 Subject: [PATCH] variables: add a var_GetAddress function. --- include/vlc_variables.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/vlc_variables.h b/include/vlc_variables.h index 06ae899f32..5c84a7af2d 100644 --- a/include/vlc_variables.h +++ b/include/vlc_variables.h @@ -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) -- 2.39.2