Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
bef75ae8
Commit
bef75ae8
authored
Oct 22, 2004
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/variables.c: Implemented inheritance for variables of type list.
parent
44bdd6e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
src/misc/variables.c
src/misc/variables.c
+34
-1
No files found.
src/misc/variables.c
View file @
bef75ae8
...
...
@@ -63,16 +63,22 @@ static void DupList( vlc_value_t *p_val )
int
i
;
vlc_list_t
*
p_list
=
malloc
(
sizeof
(
vlc_list_t
)
);
p_list
->
i_count
=
p_val
->
p_list
->
i_count
;
if
(
p_val
->
p_list
->
i_count
)
{
p_list
->
i_count
=
p_val
->
p_list
->
i_count
;
p_list
->
p_values
=
malloc
(
p_list
->
i_count
*
sizeof
(
vlc_value_t
)
);
p_list
->
pi_types
=
malloc
(
p_list
->
i_count
*
sizeof
(
int
)
);
}
else
{
p_list
->
p_values
=
NULL
;
p_list
->
pi_types
=
NULL
;
}
for
(
i
=
0
;
i
<
p_list
->
i_count
;
i
++
)
{
p_list
->
p_values
[
i
]
=
p_val
->
p_list
->
p_values
[
i
];
p_list
->
pi_types
[
i
]
=
p_val
->
p_list
->
pi_types
[
i
];
switch
(
p_val
->
p_list
->
pi_types
[
i
]
&
VLC_VAR_TYPE
)
{
case
VLC_VAR_STRING
:
...
...
@@ -1224,6 +1230,33 @@ static int InheritValue( vlc_object_t *p_this, const char *psz_name,
case
VLC_VAR_BOOL
:
p_val
->
b_bool
=
config_GetInt
(
p_this
,
psz_name
);
break
;
case
VLC_VAR_LIST
:
{
char
*
psz_var
=
config_GetPsz
(
p_this
,
psz_name
);
vlc_list_t
*
p_list
=
malloc
(
sizeof
(
vlc_list_t
));
p_val
->
p_list
=
p_list
;
p_list
->
i_count
=
0
;
while
(
*
psz_var
)
{
char
*
psz_item
=
psz_var
;
vlc_value_t
val
;
while
(
*
psz_var
&&
*
psz_var
!=
','
)
psz_var
++
;
if
(
*
psz_var
==
','
)
{
*
psz_var
=
'\0'
;
psz_var
++
;
}
val
.
i_int
=
strtol
(
psz_item
,
NULL
,
0
);
INSERT_ELEM
(
p_list
->
p_values
,
p_list
->
i_count
,
p_list
->
i_count
,
val
);
/* p_list->i_count is incremented twice by INSERT_ELEM */
p_list
->
i_count
--
;
INSERT_ELEM
(
p_list
->
pi_types
,
p_list
->
i_count
,
p_list
->
i_count
,
VLC_VAR_INTEGER
);
}
break
;
}
default:
return
VLC_ENOOBJ
;
break
;
...
...
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