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
a3e70b4e
Commit
a3e70b4e
authored
Feb 08, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add module_find_by_short() (internal only)
parent
4a5af94e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
src/libvlc.h
src/libvlc.h
+1
-0
src/modules/modules.c
src/modules/modules.c
+35
-2
No files found.
src/libvlc.h
View file @
a3e70b4e
...
...
@@ -146,6 +146,7 @@ extern char *psz_vlcpath;
* Free after uses both the string and the table. */
VLC_EXPORT
(
char
**
,
module_GetModulesNamesForCapability
,
(
const
char
*
psz_capability
,
char
***
psz_longname
)
);
module_t
*
module_find_by_shortcut
(
const
char
*
psz_shortcut
);
/**
* Private LibVLC data for each object.
...
...
src/modules/modules.c
View file @
a3e70b4e
...
...
@@ -689,7 +689,6 @@ void __module_unneed( vlc_object_t * p_this, module_t * p_module )
/**
* Get a pointer to a module_t given it's name.
*
* \param p_this vlc object structure
* \param psz_name the name of the module
* \return a pointer to the module or NULL in case of a failure
*/
...
...
@@ -718,7 +717,6 @@ module_t *module_find( const char * psz_name )
/**
* Tell if a module exists and release it in thic case
*
* \param p_this vlc object structure
* \param psz_name th name of the module
* \return TRUE if the module exists
*/
...
...
@@ -730,6 +728,41 @@ bool module_exists (const char * psz_name)
return
p_module
!=
NULL
;
}
/**
* Get a pointer to a module_t that matches a shortcut.
* This is a temporary hack for SD. Do not re-use (generally multiple modules
* can have the same shortcut, so this is *broken* - use module_need()!).
*
* \param psz_shortcut shortcut of the module
* \param psz_cap capability of the module
* \return a pointer to the module or NULL in case of a failure
*/
module_t
*
module_find_by_shortcut
(
const
char
*
psz_shortcut
)
{
module_t
**
list
,
*
module
;
list
=
module_list_get
(
NULL
);
if
(
!
list
)
return
NULL
;
for
(
size_t
i
=
0
;
(
module
=
list
[
i
])
!=
NULL
;
i
++
)
{
for
(
size_t
j
=
0
;
(
module
->
pp_shortcuts
[
j
]
!=
NULL
)
&&
(
j
<
MODULE_SHORTCUT_MAX
);
j
++
)
{
if
(
!
strcmp
(
module
->
pp_shortcuts
[
j
],
psz_shortcut
))
{
module_hold
(
module
);
goto
out
;
}
}
}
out:
module_list_free
(
list
);
return
module
;
}
/**
* GetModuleNamesForCapability
*
...
...
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