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
dcfc9361
Commit
dcfc9361
authored
Aug 24, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules/modules.c: Implement and Expose GetModulesNamesForCapability.
parent
3be4e19f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
include/vlc_modules.h
include/vlc_modules.h
+8
-0
src/modules/modules.c
src/modules/modules.c
+36
-0
No files found.
include/vlc_modules.h
View file @
dcfc9361
...
...
@@ -113,6 +113,14 @@ VLC_EXPORT( vlc_bool_t, __module_Exists, ( vlc_object_t *, const char * ) );
#define module_FindName(a,b) __module_FindName(VLC_OBJECT(a),b)
VLC_EXPORT
(
module_t
*
,
__module_FindName
,
(
vlc_object_t
*
,
const
char
*
)
);
/* Return a NULL terminated array with the names of the modules that have a
* certain capability.
* Free after uses both the string and the table. */
#define module_GetModulesNamesForCapability(a,b) \
__module_GetModulesNamesForCapability(VLC_OBJECT(a),b)
VLC_EXPORT
(
char
**
,
__module_GetModulesNamesForCapability
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_capability
)
);
VLC_EXPORT
(
module_t
*
,
vlc_module_create
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
module_t
*
,
vlc_submodule_create
,
(
module_t
*
)
);
VLC_EXPORT
(
int
,
vlc_module_set
,
(
module_t
*
module
,
int
propid
,
void
*
value
)
);
...
...
src/modules/modules.c
View file @
dcfc9361
...
...
@@ -808,6 +808,42 @@ vlc_bool_t __module_Exists( vlc_object_t *p_this, const char * psz_name )
}
}
/*****************************************************************************
* module_GetModuleNamesForCapability: Return a NULL terminated array with the
* names of the modules that have a certain capability.
* Free after uses both the string and the table.
*****************************************************************************/
char
**
__module_GetModulesNamesForCapability
(
vlc_object_t
*
p_this
,
const
char
*
psz_capability
)
{
vlc_list_t
*
p_list
;
int
i
,
count
=
0
;
char
**
psz_ret
;
/* Do it in two passes */
p_list
=
vlc_list_find
(
p_this
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
for
(
i
=
0
;
i
<
p_list
->
i_count
;
i
++
)
{
module_t
*
p_module
=
((
module_t
*
)
p_list
->
p_values
[
i
].
p_object
);
const
char
*
psz_module_capability
=
p_module
->
psz_capability
;
if
(
psz_module_capability
&&
!
strcmp
(
psz_module_capability
,
psz_capability
)
)
count
++
;
}
psz_ret
=
malloc
(
sizeof
(
char
**
)
*
(
count
+
1
)
);
for
(
i
=
0
;
i
<
p_list
->
i_count
;
i
++
)
{
module_t
*
p_module
=
((
module_t
*
)
p_list
->
p_values
[
i
].
p_object
);
const
char
*
psz_module_capability
=
p_module
->
psz_capability
;
if
(
psz_module_capability
&&
!
strcmp
(
psz_module_capability
,
psz_capability
)
)
psz_ret
[
i
]
=
strdup
(
p_module
->
psz_object_name
);
}
psz_ret
[
count
]
=
NULL
;
vlc_list_release
(
p_list
);
return
psz_ret
;
}
/*****************************************************************************
* Following functions are local.
...
...
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