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
d0a9dcdc
Commit
d0a9dcdc
authored
Oct 22, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ack: converted ACK_ERROR_* macros to enum
parent
7aca4cd1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
ack.h
src/ack.h
+14
-13
command.c
src/command.c
+2
-2
command.h
src/command.h
+2
-1
No files found.
src/ack.h
View file @
d0a9dcdc
...
...
@@ -19,19 +19,20 @@
#ifndef ACK_H
#define ACK_H
/* Common Errors */
#define ACK_ERROR_NOT_LIST 1
#define ACK_ERROR_ARG 2
#define ACK_ERROR_PASSWORD 3
#define ACK_ERROR_PERMISSION 4
#define ACK_ERROR_UNKNOWN 5
enum
ack
{
ACK_ERROR_NOT_LIST
=
1
,
ACK_ERROR_ARG
=
2
,
ACK_ERROR_PASSWORD
=
3
,
ACK_ERROR_PERMISSION
=
4
,
ACK_ERROR_UNKNOWN
=
5
,
#define ACK_ERROR_NO_EXIST 50
#define ACK_ERROR_PLAYLIST_MAX 51
#define ACK_ERROR_SYSTEM 52
#define ACK_ERROR_PLAYLIST_LOAD 53
#define ACK_ERROR_UPDATE_ALREADY 54
#define ACK_ERROR_PLAYER_SYNC 55
#define ACK_ERROR_EXIST 56
ACK_ERROR_NO_EXIST
=
50
,
ACK_ERROR_PLAYLIST_MAX
=
51
,
ACK_ERROR_SYSTEM
=
52
,
ACK_ERROR_PLAYLIST_LOAD
=
53
,
ACK_ERROR_UPDATE_ALREADY
=
54
,
ACK_ERROR_PLAYER_SYNC
=
55
,
ACK_ERROR_EXIST
=
56
,
};
#endif
src/command.c
View file @
d0a9dcdc
...
...
@@ -92,7 +92,7 @@ void command_success(struct client *client)
client_puts
(
client
,
"OK
\n
"
);
}
static
void
command_error_v
(
struct
client
*
client
,
int
error
,
static
void
command_error_v
(
struct
client
*
client
,
enum
ack
error
,
const
char
*
fmt
,
va_list
args
)
{
assert
(
client
!=
NULL
);
...
...
@@ -106,7 +106,7 @@ static void command_error_v(struct client *client, int error,
current_command
=
NULL
;
}
mpd_fprintf_
void
command_error
(
struct
client
*
client
,
int
error
,
mpd_fprintf_
void
command_error
(
struct
client
*
client
,
enum
ack
error
,
const
char
*
fmt
,
...)
{
va_list
args
;
...
...
src/command.h
View file @
d0a9dcdc
...
...
@@ -21,6 +21,7 @@
#include "gcc.h"
#include "sllist.h"
#include "ack.h"
#define COMMAND_RETURN_KILL 10
#define COMMAND_RETURN_CLOSE 20
...
...
@@ -39,7 +40,7 @@ void finishCommands(void);
void
command_success
(
struct
client
*
client
);
mpd_fprintf_
void
command_error
(
struct
client
*
client
,
int
error
,
mpd_fprintf_
void
command_error
(
struct
client
*
client
,
enum
ack
error
,
const
char
*
fmt
,
...);
#endif
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