Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
b3f3f35f
Commit
b3f3f35f
authored
Nov 08, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new command "commands" for avuton
git-svn-id:
https://svn.musicpd.org/mpd/trunk@2547
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
3c3cfc35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
TODO
TODO
+0
-2
command.c
src/command.c
+22
-0
No files found.
TODO
View file @
b3f3f35f
0.12
----
*) permissions command to print out permissions info
*) rewrite saved playlist code
*) abstract out saved playlists from playlist.c
*) command for displaying playlist contents
...
...
src/command.c
View file @
b3f3f35f
...
...
@@ -86,6 +86,7 @@
#define COMMAND_ENABLE_DEV "enabledevice"
#define COMMAND_DISABLE_DEV "disabledevice"
#define COMMAND_DEVICES "devices"
#define COMMAND_COMMANDS "commands"
#define COMMAND_STATUS_VOLUME "volume"
#define COMMAND_STATUS_STATE "state"
...
...
@@ -806,6 +807,26 @@ int handleDevices(FILE * fp, unsigned int * permission, int argArrayLength,
return
0
;
}
/* don't be fooled, this is the command handler for "commands" command */
int
handleCommands
(
FILE
*
fp
,
unsigned
int
*
permission
,
int
argArrayLength
,
char
**
argArray
)
{
ListNode
*
node
=
commandList
->
firstNode
;
CommandEntry
*
cmd
;
while
(
node
!=
NULL
)
{
cmd
=
(
CommandEntry
*
)
node
->
data
;
if
(
*
permission
&
cmd
->
reqPermission
)
{
myfprintf
(
fp
,
"command: %s
\n
"
,
cmd
->
cmd
);
}
node
=
node
->
nextNode
;
}
return
0
;
}
void
initCommands
()
{
commandList
=
makeList
(
free
);
...
...
@@ -858,6 +879,7 @@ void initCommands() {
addCommand
(
COMMAND_ENABLE_DEV
,
PERMISSION_ADMIN
,
1
,
1
,
handleEnableDevice
,
NULL
);
addCommand
(
COMMAND_DISABLE_DEV
,
PERMISSION_ADMIN
,
1
,
1
,
handleDisableDevice
,
NULL
);
addCommand
(
COMMAND_DEVICES
,
PERMISSION_ADMIN
,
0
,
0
,
handleDevices
,
NULL
);
addCommand
(
COMMAND_COMMANDS
,
0
,
0
,
0
,
handleCommands
,
NULL
);
sortList
(
commandList
);
}
...
...
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