Commit e39289a9 authored by Avuton Olrich's avatar Avuton Olrich

[CLEANUP] Remove unnecessary includes, static

functions that don't need to be exported, rename misspelled function git-svn-id: https://svn.musicpd.org/mpd/trunk@4325 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent f965b403
...@@ -22,13 +22,10 @@ ...@@ -22,13 +22,10 @@
#include "ls.h" #include "ls.h"
#include "directory.h" #include "directory.h"
#include "volume.h" #include "volume.h"
#include "path.h"
#include "stats.h" #include "stats.h"
#include "myfprintf.h" #include "myfprintf.h"
#include "list.h" #include "list.h"
#include "conf.h"
#include "permission.h" #include "permission.h"
#include "audio.h"
#include "buffer2array.h" #include "buffer2array.h"
#include "log.h" #include "log.h"
#include "dbUtils.h" #include "dbUtils.h"
...@@ -127,7 +124,7 @@ struct _CommandEntry { ...@@ -127,7 +124,7 @@ struct _CommandEntry {
char * current_command = NULL; char * current_command = NULL;
int command_listNum = 0; int command_listNum = 0;
CommandEntry * getCommandEntryFromString(char * string, int * permission); static CommandEntry * getCommandEntryFromString(char * string, int * permission);
List * commandList; List * commandList;
...@@ -142,7 +139,7 @@ CommandEntry * newCommandEntry() { ...@@ -142,7 +139,7 @@ CommandEntry * newCommandEntry() {
return cmd; return cmd;
} }
void addCommand(char * name, unsigned int reqPermission, int minargs, static void addCommand(char * name, unsigned int reqPermission, int minargs,
int maxargs, CommandHandlerFunction handler_func, int maxargs, CommandHandlerFunction handler_func,
CommandListHandlerFunction listHandler_func) CommandListHandlerFunction listHandler_func)
{ {
...@@ -157,13 +154,13 @@ void addCommand(char * name, unsigned int reqPermission, int minargs, ...@@ -157,13 +154,13 @@ void addCommand(char * name, unsigned int reqPermission, int minargs,
insertInList(commandList, cmd->cmd, cmd); insertInList(commandList, cmd->cmd, cmd);
} }
int handleUrlHandlers(FILE * fp, unsigned int * permission, int argArrayLength, static int handleUrlHandlers(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return printRemoteUrlHandlers(fp); return printRemoteUrlHandlers(fp);
} }
int handlePlay(FILE * fp, unsigned int * permission, int argArrayLength, static int handlePlay(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int song = -1; int song = -1;
...@@ -180,7 +177,7 @@ int handlePlay(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -180,7 +177,7 @@ int handlePlay(FILE * fp, unsigned int * permission, int argArrayLength,
return playPlaylist(fp,song,0); return playPlaylist(fp,song,0);
} }
int handlePlayId(FILE * fp, unsigned int * permission, int argArrayLength, static int handlePlayId(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int id = -1; int id = -1;
...@@ -197,13 +194,13 @@ int handlePlayId(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -197,13 +194,13 @@ int handlePlayId(FILE * fp, unsigned int * permission, int argArrayLength,
return playPlaylistById(fp, id, 0); return playPlaylistById(fp, id, 0);
} }
int handleStop(FILE * fp, unsigned int * permission, int argArrayLength, static int handleStop(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return stopPlaylist(fp); return stopPlaylist(fp);
} }
int handleCurrentSong(FILE * fp, unsigned int * permission, int argArrayLength, static int handleCurrentSong(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int song = getPlaylistCurrentSong(); int song = getPlaylistCurrentSong();
...@@ -214,7 +211,7 @@ int handleCurrentSong(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -214,7 +211,7 @@ int handleCurrentSong(FILE * fp, unsigned int * permission, int argArrayLength,
else return 0; else return 0;
} }
int handlePause(FILE * fp, unsigned int * permission, static int handlePause(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray) int argArrayLength, char ** argArray)
{ {
if(argArrayLength==2) { if(argArrayLength==2) {
...@@ -229,7 +226,7 @@ int handlePause(FILE * fp, unsigned int * permission, ...@@ -229,7 +226,7 @@ int handlePause(FILE * fp, unsigned int * permission,
return playerPause(fp); return playerPause(fp);
} }
int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength, static int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
char * state = NULL; char * state = NULL;
...@@ -283,19 +280,19 @@ int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -283,19 +280,19 @@ int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength,
return 0; return 0;
} }
int handleKill(FILE * fp, unsigned int * permission, int argArrayLength, static int handleKill(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return COMMAND_RETURN_KILL; return COMMAND_RETURN_KILL;
} }
int handleClose(FILE * fp, unsigned int * permission, int argArrayLength, static int handleClose(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return COMMAND_RETURN_CLOSE; return COMMAND_RETURN_CLOSE;
} }
int handleAdd(FILE * fp, unsigned int * permission, int argArrayLength, static int handleAdd(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
char * path = argArray[1]; char * path = argArray[1];
...@@ -305,13 +302,13 @@ int handleAdd(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -305,13 +302,13 @@ int handleAdd(FILE * fp, unsigned int * permission, int argArrayLength,
return addAllIn(fp,path); return addAllIn(fp,path);
} }
int handleAddId(FILE * fp, unsigned int * permission, int argArrayLength, static int handleAddId(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return addToPlaylist(fp, argArray[1], 1); return addToPlaylist(fp, argArray[1], 1);
} }
int handleDelete(FILE * fp, unsigned int * permission, int argArrayLength, static int handleDelete(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int song; int song;
...@@ -326,7 +323,7 @@ int handleDelete(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -326,7 +323,7 @@ int handleDelete(FILE * fp, unsigned int * permission, int argArrayLength,
return deleteFromPlaylist(fp,song); return deleteFromPlaylist(fp,song);
} }
int handleDeleteId(FILE * fp, unsigned int * permission, int argArrayLength, static int handleDeleteId(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int id; int id;
...@@ -341,47 +338,49 @@ int handleDeleteId(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -341,47 +338,49 @@ int handleDeleteId(FILE * fp, unsigned int * permission, int argArrayLength,
return deleteFromPlaylistById(fp, id); return deleteFromPlaylistById(fp, id);
} }
int handlePlaylist(FILE * fp, unsigned int * permission, int argArrayLength, static int handlePlaylist(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return showPlaylist(fp); return showPlaylist(fp);
} }
int handleShuffle(FILE * fp, unsigned int * permission, int argArrayLength, static int handleShuffle(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return shufflePlaylist(fp); return shufflePlaylist(fp);
} }
int handleClear(FILE * fp, unsigned int * permission, int argArrayLength, static int handleClear(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return clearPlaylist(fp); return clearPlaylist(fp);
} }
int handleSave(FILE * fp, unsigned int * permission, int argArrayLength, static int handleSave(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return savePlaylist(fp,argArray[1]); return savePlaylist(fp,argArray[1]);
} }
int handleLoad(FILE * fp, unsigned int * permission, int argArrayLength, static int handleLoad(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return loadPlaylist(fp,argArray[1]); return loadPlaylist(fp,argArray[1]);
} }
int handleListPlaylist(FILE * fp, unsigned int * permission, int argArrayLength,
static int handleListPlaylist(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return PlaylistInfo(fp,argArray[1],0); return PlaylistInfo(fp,argArray[1],0);
} }
int handleListPlaylistInfo(FILE * fp, unsigned int * permission, int argArrayLength,
static int handleListPlaylistInfo(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return PlaylistInfo(fp,argArray[1], 1); return PlaylistInfo(fp,argArray[1], 1);
} }
int handleLsInfo(FILE * fp, unsigned int * permission, int argArrayLength, static int handleLsInfo(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
if(argArrayLength==1) { if(argArrayLength==1) {
...@@ -394,13 +393,13 @@ int handleLsInfo(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -394,13 +393,13 @@ int handleLsInfo(FILE * fp, unsigned int * permission, int argArrayLength,
} }
} }
int handleRm(FILE * fp, unsigned int * permission, int argArrayLength, static int handleRm(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return deletePlaylist(fp,argArray[1]); return deletePlaylist(fp,argArray[1]);
} }
int handlePlaylistChanges(FILE * fp, unsigned int * permission, static int handlePlaylistChanges(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray) int argArrayLength, char ** argArray)
{ {
unsigned long version; unsigned long version;
...@@ -415,7 +414,7 @@ int handlePlaylistChanges(FILE * fp, unsigned int * permission, ...@@ -415,7 +414,7 @@ int handlePlaylistChanges(FILE * fp, unsigned int * permission,
return playlistChanges(fp, version); return playlistChanges(fp, version);
} }
int handlePlaylistChangesPosId(FILE * fp, unsigned int * permission, static int handlePlaylistChangesPosId(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray) int argArrayLength, char ** argArray)
{ {
unsigned long version; unsigned long version;
...@@ -430,7 +429,7 @@ int handlePlaylistChangesPosId(FILE * fp, unsigned int * permission, ...@@ -430,7 +429,7 @@ int handlePlaylistChangesPosId(FILE * fp, unsigned int * permission,
return playlistChangesPosId(fp, version); return playlistChangesPosId(fp, version);
} }
int handlePlaylistInfo(FILE * fp, unsigned int * permission, static int handlePlaylistInfo(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray) int argArrayLength, char ** argArray)
{ {
int song = -1; int song = -1;
...@@ -447,7 +446,7 @@ int handlePlaylistInfo(FILE * fp, unsigned int * permission, ...@@ -447,7 +446,7 @@ int handlePlaylistInfo(FILE * fp, unsigned int * permission,
return playlistInfo(fp,song); return playlistInfo(fp,song);
} }
int handlePlaylistId(FILE * fp, unsigned int * permission, static int handlePlaylistId(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray) int argArrayLength, char ** argArray)
{ {
int id = -1; int id = -1;
...@@ -464,7 +463,7 @@ int handlePlaylistId(FILE * fp, unsigned int * permission, ...@@ -464,7 +463,7 @@ int handlePlaylistId(FILE * fp, unsigned int * permission,
return playlistId(fp, id); return playlistId(fp, id);
} }
int handleFind(FILE * fp, unsigned int * permission, int argArrayLength, static int handleFind(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int ret; int ret;
...@@ -485,7 +484,7 @@ int handleFind(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -485,7 +484,7 @@ int handleFind(FILE * fp, unsigned int * permission, int argArrayLength,
return ret; return ret;
} }
int handleSearch(FILE * fp, unsigned int * permission, int argArrayLength, static int handleSearch(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int ret; int ret;
...@@ -506,7 +505,7 @@ int handleSearch(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -506,7 +505,7 @@ int handleSearch(FILE * fp, unsigned int * permission, int argArrayLength,
return ret; return ret;
} }
int listHandleUpdate(FILE * fp, unsigned int * permission, int argArrayLength, static int listHandleUpdate(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray, ListNode * commandNode, CommandEntry * cmd) char ** argArray, ListNode * commandNode, CommandEntry * cmd)
{ {
static List * pathList = NULL; static List * pathList = NULL;
...@@ -533,7 +532,7 @@ int listHandleUpdate(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -533,7 +532,7 @@ int listHandleUpdate(FILE * fp, unsigned int * permission, int argArrayLength,
return 0; return 0;
} }
int handleUpdate(FILE * fp, unsigned int * permission, int argArrayLength, static int handleUpdate(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
if(argArrayLength==2) { if(argArrayLength==2) {
...@@ -547,19 +546,19 @@ int handleUpdate(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -547,19 +546,19 @@ int handleUpdate(FILE * fp, unsigned int * permission, int argArrayLength,
return updateInit(fp,NULL); return updateInit(fp,NULL);
} }
int handleNext(FILE * fp, unsigned int * permission, int argArrayLength, static int handleNext(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return nextSongInPlaylist(fp); return nextSongInPlaylist(fp);
} }
int handlePrevious(FILE * fp, unsigned int * permission, int argArrayLength, static int handlePrevious(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return previousSongInPlaylist(fp); return previousSongInPlaylist(fp);
} }
int handleListAll(FILE * fp, unsigned int * permission, int argArrayLength, static int handleListAll(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
char * directory = NULL; char * directory = NULL;
...@@ -568,7 +567,7 @@ int handleListAll(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -568,7 +567,7 @@ int handleListAll(FILE * fp, unsigned int * permission, int argArrayLength,
return printAllIn(fp,directory); return printAllIn(fp,directory);
} }
int handleVolume(FILE * fp, unsigned int * permission, int argArrayLength, static int handleVolume(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int change; int change;
...@@ -582,7 +581,7 @@ int handleVolume(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -582,7 +581,7 @@ int handleVolume(FILE * fp, unsigned int * permission, int argArrayLength,
return changeVolumeLevel(fp,change,1); return changeVolumeLevel(fp,change,1);
} }
int handleSetVol(FILE * fp, unsigned int * permission, int argArrayLength, static int handleSetVol(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int level; int level;
...@@ -596,7 +595,7 @@ int handleSetVol(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -596,7 +595,7 @@ int handleSetVol(FILE * fp, unsigned int * permission, int argArrayLength,
return changeVolumeLevel(fp,level,0); return changeVolumeLevel(fp,level,0);
} }
int handleRepeat(FILE * fp, unsigned int * permission, int argArrayLength, static int handleRepeat(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int status; int status;
...@@ -610,7 +609,7 @@ int handleRepeat(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -610,7 +609,7 @@ int handleRepeat(FILE * fp, unsigned int * permission, int argArrayLength,
return setPlaylistRepeatStatus(fp,status); return setPlaylistRepeatStatus(fp,status);
} }
int handleRandom(FILE * fp, unsigned int * permission, int argArrayLength, static int handleRandom(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int status; int status;
...@@ -624,20 +623,20 @@ int handleRandom(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -624,20 +623,20 @@ int handleRandom(FILE * fp, unsigned int * permission, int argArrayLength,
return setPlaylistRandomStatus(fp,status); return setPlaylistRandomStatus(fp,status);
} }
int handleStats(FILE * fp, unsigned int * permission, int argArrayLength, static int handleStats(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return printStats(fp); return printStats(fp);
} }
int handleClearError(FILE * fp, unsigned int * permission, int argArrayLength, static int handleClearError(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
clearPlayerError(); clearPlayerError();
return 0; return 0;
} }
int handleList(FILE * fp, unsigned int * permission, int argArrayLength, static int handleList(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int numConditionals = 0; int numConditionals = 0;
...@@ -681,7 +680,7 @@ int handleList(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -681,7 +680,7 @@ int handleList(FILE * fp, unsigned int * permission, int argArrayLength,
return ret; return ret;
} }
int handleMove(FILE * fp, unsigned int * permission, int argArrayLength, static int handleMove(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int from; int from;
...@@ -703,7 +702,7 @@ int handleMove(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -703,7 +702,7 @@ int handleMove(FILE * fp, unsigned int * permission, int argArrayLength,
return moveSongInPlaylist(fp,from,to); return moveSongInPlaylist(fp,from,to);
} }
int handleMoveId(FILE * fp, unsigned int * permission, int argArrayLength, static int handleMoveId(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int id; int id;
...@@ -725,7 +724,7 @@ int handleMoveId(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -725,7 +724,7 @@ int handleMoveId(FILE * fp, unsigned int * permission, int argArrayLength,
return moveSongInPlaylistById(fp, id, to); return moveSongInPlaylistById(fp, id, to);
} }
int handleSwap(FILE * fp, unsigned int * permission, int argArrayLength, static int handleSwap(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int song1; int song1;
...@@ -747,7 +746,7 @@ int handleSwap(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -747,7 +746,7 @@ int handleSwap(FILE * fp, unsigned int * permission, int argArrayLength,
return swapSongsInPlaylist(fp,song1,song2); return swapSongsInPlaylist(fp,song1,song2);
} }
int handleSwapId(FILE * fp, unsigned int * permission, int argArrayLength, static int handleSwapId(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int id1; int id1;
...@@ -769,7 +768,7 @@ int handleSwapId(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -769,7 +768,7 @@ int handleSwapId(FILE * fp, unsigned int * permission, int argArrayLength,
return swapSongsInPlaylistById(fp, id1, id2); return swapSongsInPlaylistById(fp, id1, id2);
} }
int handleSeek(FILE * fp, unsigned int * permission, int argArrayLength, static int handleSeek(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int song; int song;
...@@ -791,7 +790,7 @@ int handleSeek(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -791,7 +790,7 @@ int handleSeek(FILE * fp, unsigned int * permission, int argArrayLength,
return seekSongInPlaylist(fp,song,time); return seekSongInPlaylist(fp,song,time);
} }
int handleSeekId(FILE * fp, unsigned int * permission, int argArrayLength, static int handleSeekId(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int id; int id;
...@@ -813,7 +812,7 @@ int handleSeekId(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -813,7 +812,7 @@ int handleSeekId(FILE * fp, unsigned int * permission, int argArrayLength,
return seekSongInPlaylistById(fp, id, time); return seekSongInPlaylistById(fp, id, time);
} }
int handleListAllInfo(FILE * fp, unsigned int * permission, int argArrayLength, static int handleListAllInfo(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
char * directory = NULL; char * directory = NULL;
...@@ -822,13 +821,13 @@ int handleListAllInfo(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -822,13 +821,13 @@ int handleListAllInfo(FILE * fp, unsigned int * permission, int argArrayLength,
return printInfoForAllIn(fp,directory); return printInfoForAllIn(fp,directory);
} }
int handlePing(FILE * fp, unsigned int * permission, int argArrayLength, static int handlePing(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
return 0; return 0;
} }
int handlePassword(FILE * fp, unsigned int * permission, int argArrayLength, static int handlePassword(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
if(getPermissionFromPassword(argArray[1],permission)<0) { if(getPermissionFromPassword(argArray[1],permission)<0) {
...@@ -839,7 +838,7 @@ int handlePassword(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -839,7 +838,7 @@ int handlePassword(FILE * fp, unsigned int * permission, int argArrayLength,
return 0; return 0;
} }
int handleCrossfade(FILE * fp, unsigned int * permission, int argArrayLength, static int handleCrossfade(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int time; int time;
...@@ -857,7 +856,7 @@ int handleCrossfade(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -857,7 +856,7 @@ int handleCrossfade(FILE * fp, unsigned int * permission, int argArrayLength,
return 0; return 0;
} }
int handleEnableDevice(FILE * fp, unsigned int * permission, int argArrayLength, static int handleEnableDevice(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
int device; int device;
...@@ -873,7 +872,7 @@ int handleEnableDevice(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -873,7 +872,7 @@ int handleEnableDevice(FILE * fp, unsigned int * permission, int argArrayLength,
return enableAudioDevice(fp, device); return enableAudioDevice(fp, device);
} }
int handleDisableDevice(FILE * fp, unsigned int * permission, static int handleDisableDevice(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray) int argArrayLength, char ** argArray)
{ {
int device; int device;
...@@ -889,7 +888,7 @@ int handleDisableDevice(FILE * fp, unsigned int * permission, ...@@ -889,7 +888,7 @@ int handleDisableDevice(FILE * fp, unsigned int * permission,
return disableAudioDevice(fp, device); return disableAudioDevice(fp, device);
} }
int handleDevices(FILE * fp, unsigned int * permission, int argArrayLength, static int handleDevices(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
printAudioDevices(fp); printAudioDevices(fp);
...@@ -898,7 +897,7 @@ int handleDevices(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -898,7 +897,7 @@ int handleDevices(FILE * fp, unsigned int * permission, int argArrayLength,
} }
/* don't be fooled, this is the command handler for "commands" command */ /* don't be fooled, this is the command handler for "commands" command */
int handleCommands(FILE * fp, unsigned int * permission, int argArrayLength, static int handleCommands(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
ListNode * node = commandList->firstNode; ListNode * node = commandList->firstNode;
...@@ -916,7 +915,7 @@ int handleCommands(FILE * fp, unsigned int * permission, int argArrayLength, ...@@ -916,7 +915,7 @@ int handleCommands(FILE * fp, unsigned int * permission, int argArrayLength,
return 0; return 0;
} }
int handleNotcommands(FILE * fp, unsigned int * permission, int argArrayLength, static int handleNotcommands(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray) char ** argArray)
{ {
ListNode * node = commandList->firstNode; ListNode * node = commandList->firstNode;
...@@ -1000,7 +999,7 @@ void finishCommands() { ...@@ -1000,7 +999,7 @@ void finishCommands() {
freeList(commandList); freeList(commandList);
} }
int checkArgcAndPermission(CommandEntry * cmd, FILE *fp, static int checkArgcAndPermission(CommandEntry * cmd, FILE *fp,
unsigned int permission, int argc, char** argArray) unsigned int permission, int argc, char** argArray)
{ {
int min = cmd->min + 1; int min = cmd->min + 1;
...@@ -1044,7 +1043,7 @@ int checkArgcAndPermission(CommandEntry * cmd, FILE *fp, ...@@ -1044,7 +1043,7 @@ int checkArgcAndPermission(CommandEntry * cmd, FILE *fp,
else return 0; else return 0;
} }
CommandEntry * getCommandEntryAndCheckArgcAndPermission(FILE * fp, static CommandEntry * getCommandEntryAndCheckArgcAndPermission(FILE * fp,
unsigned int * permission, int argArrayLength, char ** argArray) unsigned int * permission, int argArrayLength, char ** argArray)
{ {
static char unknown[] = ""; static char unknown[] = "";
...@@ -1073,7 +1072,7 @@ CommandEntry * getCommandEntryAndCheckArgcAndPermission(FILE * fp, ...@@ -1073,7 +1072,7 @@ CommandEntry * getCommandEntryAndCheckArgcAndPermission(FILE * fp,
return cmd; return cmd;
} }
CommandEntry * getCommandEntryFromString(char * string, int * permission) { static CommandEntry * getCommandEntryFromString(char * string, int * permission) {
CommandEntry * cmd = NULL; CommandEntry * cmd = NULL;
char ** argArray; char ** argArray;
int argArrayLength = buffer2array(string,&argArray); int argArrayLength = buffer2array(string,&argArray);
...@@ -1087,7 +1086,7 @@ CommandEntry * getCommandEntryFromString(char * string, int * permission) { ...@@ -1087,7 +1086,7 @@ CommandEntry * getCommandEntryFromString(char * string, int * permission) {
return cmd; return cmd;
} }
int processCommandInternal(FILE * fp, unsigned int * permission, static int processCommandInternal(FILE * fp, unsigned int * permission,
char * commandString, char * commandString,
ListNode * commandNode) ListNode * commandNode)
{ {
...@@ -1120,7 +1119,7 @@ int processCommandInternal(FILE * fp, unsigned int * permission, ...@@ -1120,7 +1119,7 @@ int processCommandInternal(FILE * fp, unsigned int * permission,
return ret; return ret;
} }
int proccessListOfCommands(FILE * fp, int * permission, int * expired, int processListOfCommands(FILE * fp, int * permission, int * expired,
int listOK, List * list) int listOK, List * list)
{ {
ListNode * node = list->firstNode; ListNode * node = list->firstNode;
...@@ -1130,11 +1129,11 @@ int proccessListOfCommands(FILE * fp, int * permission, int * expired, ...@@ -1130,11 +1129,11 @@ int proccessListOfCommands(FILE * fp, int * permission, int * expired,
command_listNum = 0; command_listNum = 0;
while(node!=NULL) { while(node!=NULL) {
DEBUG("proccesListOfCommands: process command \"%s\"\n", DEBUG("processListOfCommands: process command \"%s\"\n",
node->data); node->data);
ret = processCommandInternal(fp,permission,(char *)node->data, ret = processCommandInternal(fp,permission,(char *)node->data,
node); node);
DEBUG("proccessListOfCommands: command returned %i\n",ret); DEBUG("processListOfCommands: command returned %i\n",ret);
tempNode = node->nextNode; tempNode = node->nextNode;
deleteNodeFromList(list,node); deleteNodeFromList(list,node);
node = tempNode; node = tempNode;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
extern char * current_command; extern char * current_command;
extern int command_listNum; extern int command_listNum;
int proccessListOfCommands(FILE * fp, int * permission, int * expired, int processListOfCommands(FILE * fp, int * permission, int * expired,
int listOK, List * list); int listOK, List * list);
int processCommand(FILE * fp, unsigned int * permission, char * commandString); int processCommand(FILE * fp, unsigned int * permission, char * commandString);
......
...@@ -202,7 +202,7 @@ void openAInterface(int fd, struct sockaddr * addr) { ...@@ -202,7 +202,7 @@ void openAInterface(int fd, struct sockaddr * addr) {
} }
} }
static int proccessLineOfInput(Interface * interface) { static int processLineOfInput(Interface * interface) {
int ret = 1; int ret = 1;
char * line = interface->buffer+interface->bufferPos; char * line = interface->buffer+interface->bufferPos;
...@@ -216,7 +216,7 @@ static int proccessLineOfInput(Interface * interface) { ...@@ -216,7 +216,7 @@ static int proccessLineOfInput(Interface * interface) {
if(strcmp(line, INTERFACE_LIST_MODE_END)==0) { if(strcmp(line, INTERFACE_LIST_MODE_END)==0) {
DEBUG("interface %i: process command " DEBUG("interface %i: process command "
"list\n",interface->num); "list\n",interface->num);
ret = proccessListOfCommands( ret = processListOfCommands(
interface->fp, interface->fp,
&(interface->permission), &(interface->permission),
&(interface->expired), &(interface->expired),
...@@ -303,7 +303,7 @@ static int processBytesRead(Interface * interface, int bytesRead) { ...@@ -303,7 +303,7 @@ static int processBytesRead(Interface * interface, int bytesRead) {
bytesRead--; bytesRead--;
if(interface->buffer[interface->bufferLength-1]=='\n') { if(interface->buffer[interface->bufferLength-1]=='\n') {
interface->buffer[interface->bufferLength-1] = '\0'; interface->buffer[interface->bufferLength-1] = '\0';
ret = proccessLineOfInput(interface); ret = processLineOfInput(interface);
interface->bufferPos = interface->bufferLength; interface->bufferPos = interface->bufferLength;
} }
if(interface->bufferLength==INTERFACE_MAX_BUFFER_LENGTH) if(interface->bufferLength==INTERFACE_MAX_BUFFER_LENGTH)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment