diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-04 01:58:31 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-04 01:58:31 +0000 |
commit | f958e0a4c5bb7241b2ec443a402d10c29abfc08f (patch) | |
tree | aeaaf910ae09cffaa0289223503f12dcdfcb8245 /src/command.h | |
parent | d22e5ec5228ccb3f6fd843cebc4662953f42451d (diff) | |
download | mpd-f958e0a4c5bb7241b2ec443a402d10c29abfc08f.tar.gz mpd-f958e0a4c5bb7241b2ec443a402d10c29abfc08f.tar.xz mpd-f958e0a4c5bb7241b2ec443a402d10c29abfc08f.zip |
work on ACK error codes
git-svn-id: https://svn.musicpd.org/mpd/trunk@1324 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/command.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/command.h b/src/command.h index 3aad04dca..8e2b90711 100644 --- a/src/command.h +++ b/src/command.h @@ -29,6 +29,9 @@ #define COMMAND_RETURN_KILL 10 #define COMMAND_RETURN_CLOSE 20 +extern char * current_command; +extern int command_listNum; + int proccessListOfCommands(FILE * fp, int * permission, int * expired, List * list); @@ -40,6 +43,18 @@ void finishCommands(); #define commandSuccess(fp) myfprintf(fp, "OK\n") -#define commandError(fp, format, ... ) myfprintf(fp, "ACK " format "\n", ##__VA_ARGS__) +#define commandError(fp, format, ... ) \ + {\ + if(current_command) { \ + myfprintf(fp, "ACK [%s:%i] " format "\n", \ + current_command, command_listNum, \ + ##__VA_ARGS__); \ + current_command = NULL; \ + } \ + else { \ + myfprintf(fp, "ACK [:%i] " format "\n", \ + command_listNum, ##__VA_ARGS__); \ + } \ + } #endif |