Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
673f8026
Commit
673f8026
authored
Apr 26, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
module_GetModulesNamesByCapability: (partially) fix submodules handling
parent
e163db1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
src/modules/modules.c
src/modules/modules.c
+14
-11
No files found.
src/modules/modules.c
View file @
673f8026
...
@@ -765,16 +765,18 @@ char ** module_GetModulesNamesForCapability( const char *psz_capability,
...
@@ -765,16 +765,18 @@ char ** module_GetModulesNamesForCapability( const char *psz_capability,
module_t
**
list
=
module_list_get
(
NULL
);
module_t
**
list
=
module_list_get
(
NULL
);
/*
Do it in two passes : count the number of modules before
*/
/*
Proceed in two passes: count the number of modules first
*/
for
(
size_t
i
=
0
;
list
[
i
];
i
++
)
for
(
size_t
i
=
0
;
list
[
i
];
i
++
)
{
{
module_t
*
p_module
=
list
[
i
];
module_t
*
p_module
=
list
[
i
];
const
char
*
psz_module_capability
=
p_module
->
psz_capability
;
const
char
*
psz_module_capability
=
p_module
->
psz_capability
;
if
(
psz_module_capability
&&
!
strcmp
(
psz_module_capability
,
psz_capability
)
)
if
(
psz_module_capability
&&
!
strcmp
(
psz_module_capability
,
psz_capability
)
)
count
++
;
count
++
;
}
}
/* Then get the names */
psz_ret
=
malloc
(
sizeof
(
char
*
)
*
(
count
+
1
)
);
psz_ret
=
malloc
(
sizeof
(
char
*
)
*
(
count
+
1
)
);
if
(
pppsz_longname
)
if
(
pppsz_longname
)
*
pppsz_longname
=
malloc
(
sizeof
(
char
*
)
*
(
count
+
1
)
);
*
pppsz_longname
=
malloc
(
sizeof
(
char
*
)
*
(
count
+
1
)
);
...
@@ -795,16 +797,17 @@ char ** module_GetModulesNamesForCapability( const char *psz_capability,
...
@@ -795,16 +797,17 @@ char ** module_GetModulesNamesForCapability( const char *psz_capability,
module_t
*
p_module
=
list
[
i
];
module_t
*
p_module
=
list
[
i
];
const
char
*
psz_module_capability
=
p_module
->
psz_capability
;
const
char
*
psz_module_capability
=
p_module
->
psz_capability
;
if
(
psz_module_capability
&&
!
strcmp
(
psz_module_capability
,
psz_capability
)
)
if
(
psz_module_capability
&&
!
strcmp
(
psz_module_capability
,
psz_capability
)
)
{
{
int
k
=
-
1
;
/* hack to handle submodules properly */
/* Explicit hack: Use the last shortcut. It _should_ be
if
(
p_module
->
b_submodule
)
* different from the object name, at least if the object
{
* contains multiple submodules with the same capability. */
while
(
p_module
->
pp_shortcuts
[
++
k
]
!=
NULL
)
;
unsigned
k
=
0
;
k
--
;
while
(
p_module
->
pp_shortcuts
[
k
]
!=
NULL
)
}
k
++
;
psz_ret
[
j
]
=
strdup
(
k
>=
0
?
p_module
->
pp_shortcuts
[
k
]
assert
(
k
>
0
);
/* pp_shortcuts[0] is always set */
:
p_module
->
psz_object_name
);
psz_ret
[
j
]
=
strdup
(
p_module
->
pp_shortcuts
[
k
-
1
]
);
if
(
pppsz_longname
)
if
(
pppsz_longname
)
(
*
pppsz_longname
)[
j
]
=
strdup
(
module_get_name
(
p_module
,
true
)
);
(
*
pppsz_longname
)[
j
]
=
strdup
(
module_get_name
(
p_module
,
true
)
);
j
++
;
j
++
;
...
...
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