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
5d90c3fa
Commit
5d90c3fa
authored
Dec 28, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_GetActionId: binary search
parent
1b7540c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/misc/action.c
src/misc/action.c
+12
-4
No files found.
src/misc/action.c
View file @
5d90c3fa
...
...
@@ -26,6 +26,7 @@
#include <vlc_common.h>
#include "../libvlc.h"
#include <vlc_keys.h>
#include <stdlib.h>
int
vlc_key_to_action
(
vlc_object_t
*
libvlc
,
const
char
*
varname
,
vlc_value_t
prevkey
,
vlc_value_t
curkey
,
void
*
priv
)
...
...
@@ -46,11 +47,18 @@ int vlc_key_to_action (vlc_object_t *libvlc, const char *varname,
return
var_SetInteger
(
libvlc
,
"key-action"
,
key
->
i_action
);
}
static
int
actcmp
(
const
void
*
key
,
const
void
*
ent
)
{
const
struct
action
*
act
=
ent
;
return
strcmp
(
key
,
act
->
name
);
}
vlc_key_t
vlc_GetActionId
(
const
char
*
name
)
{
for
(
size_t
i
=
0
;
i
<
libvlc_actions_count
;
i
++
)
if
(
!
strcmp
(
libvlc_actions
[
i
].
name
,
name
))
return
libvlc_actions
[
i
].
value
;
return
0
;
const
struct
action
*
act
;
act
=
bsearch
(
name
,
libvlc_actions
,
libvlc_actions_count
,
sizeof
(
*
act
),
actcmp
);
return
(
act
!=
NULL
)
?
act
->
value
:
0
;
}
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