Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
d1f93aa1
Commit
d1f93aa1
authored
Feb 20, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add var_CreateGetNonEmptyString and factor some code
parent
03057991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
30 deletions
+14
-30
include/vlc_variables.h
include/vlc_variables.h
+14
-30
No files found.
include/vlc_variables.h
View file @
d1f93aa1
...
...
@@ -418,13 +418,8 @@ static inline void __var_DecInteger( vlc_object_t *p_obj, const char *psz_name )
*/
static
inline
int
__var_CreateGetInteger
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
__var_Create
(
p_obj
,
psz_name
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
i_int
;
else
return
0
;
return
__var_GetInteger
(
p_obj
,
psz_name
);
}
/**
...
...
@@ -435,13 +430,8 @@ static inline int __var_CreateGetInteger( vlc_object_t *p_obj, const char *psz_n
*/
static
inline
int
__var_CreateGetBool
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
__var_Create
(
p_obj
,
psz_name
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
b_bool
;
else
return
VLC_FALSE
;
return
__var_GetBool
(
p_obj
,
psz_name
);
}
/**
...
...
@@ -452,13 +442,8 @@ static inline int __var_CreateGetBool( vlc_object_t *p_obj, const char *psz_name
*/
static
inline
int64_t
__var_CreateGetTime
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
__var_Create
(
p_obj
,
psz_name
,
VLC_VAR_TIME
|
VLC_VAR_DOINHERIT
);
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
i_time
;
else
return
0
;
return
__var_GetTime
(
p_obj
,
psz_name
);
}
/**
...
...
@@ -469,13 +454,8 @@ static inline int64_t __var_CreateGetTime( vlc_object_t *p_obj, const char *psz_
*/
static
inline
float
__var_CreateGetFloat
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
__var_Create
(
p_obj
,
psz_name
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
f_float
;
else
return
0
.
0
;
return
__var_GetFloat
(
p_obj
,
psz_name
);
}
/**
...
...
@@ -484,15 +464,18 @@ static inline float __var_CreateGetFloat( vlc_object_t *p_obj, const char *psz_n
* \param p_obj The object that holds the variable
* \param psz_name The name of the variable
*/
static
inline
char
*
__var_CreateGetString
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
static
inline
char
*
__var_CreateGetString
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
__var_Create
(
p_obj
,
psz_name
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
return
__var_GetString
(
p_obj
,
psz_name
);
}
static
inline
char
*
__var_CreateGetNonEmptyString
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
__var_Create
(
p_obj
,
psz_name
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
psz_string
;
else
return
strdup
(
""
);
return
__var_GetNonEmptyString
(
p_obj
,
psz_name
);
}
/**
...
...
@@ -515,6 +498,7 @@ static inline char *__var_CreateGetString( vlc_object_t *p_obj, const char *psz_
* __var_CreateGetString() with automatic casting
*/
#define var_CreateGetString(a,b) __var_CreateGetString( VLC_OBJECT(a),b)
#define var_CreateGetNonEmptyString(a,b) __var_CreateGetNonEmptyString( VLC_OBJECT(a),b)
/**
* @}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment