Commit 21d8065b authored by Avuton Olrich's avatar Avuton Olrich

[CLEANUP] Remove unused code

Static what makes sense git-svn-id: https://svn.musicpd.org/mpd/trunk@4327 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent d9f31b1c
...@@ -83,13 +83,13 @@ typedef struct _Interface { ...@@ -83,13 +83,13 @@ typedef struct _Interface {
int outBufSize; int outBufSize;
} Interface; } Interface;
Interface * interfaces = NULL; static Interface * interfaces = NULL;
void flushInterfaceBuffer(Interface * interface); static void flushInterfaceBuffer(Interface * interface);
void printInterfaceOutBuffer(Interface * interface); static void printInterfaceOutBuffer(Interface * interface);
void openInterface(Interface * interface, int fd) { static void openInterface(Interface * interface, int fd) {
int flags; int flags;
assert(interface->open==0); assert(interface->open==0);
...@@ -135,7 +135,7 @@ void openInterface(Interface * interface, int fd) { ...@@ -135,7 +135,7 @@ void openInterface(Interface * interface, int fd) {
printInterfaceOutBuffer(interface); printInterfaceOutBuffer(interface);
} }
void closeInterface(Interface * interface) { static void closeInterface(Interface * interface) {
if (!interface->open) return; if (!interface->open) return;
interface->open = 0; interface->open = 0;
...@@ -330,7 +330,7 @@ static int processBytesRead(Interface * interface, int bytesRead) { ...@@ -330,7 +330,7 @@ static int processBytesRead(Interface * interface, int bytesRead) {
return ret; return ret;
} }
int interfaceReadInput(Interface * interface) { static int interfaceReadInput(Interface * interface) {
int bytesRead; int bytesRead;
bytesRead = read(interface->fd, bytesRead = read(interface->fd,
...@@ -346,7 +346,7 @@ int interfaceReadInput(Interface * interface) { ...@@ -346,7 +346,7 @@ int interfaceReadInput(Interface * interface) {
return 1; return 1;
} }
void addInterfacesReadyToReadAndListenSocketToFdSet(fd_set * fds, int * fdmax) { static void addInterfacesReadyToReadAndListenSocketToFdSet(fd_set * fds, int * fdmax) {
int i; int i;
FD_ZERO(fds); FD_ZERO(fds);
...@@ -360,7 +360,7 @@ void addInterfacesReadyToReadAndListenSocketToFdSet(fd_set * fds, int * fdmax) { ...@@ -360,7 +360,7 @@ void addInterfacesReadyToReadAndListenSocketToFdSet(fd_set * fds, int * fdmax) {
} }
} }
void addInterfacesForBufferFlushToFdSet(fd_set * fds, int * fdmax) { static void addInterfacesForBufferFlushToFdSet(fd_set * fds, int * fdmax) {
int i; int i;
FD_ZERO(fds); FD_ZERO(fds);
...@@ -373,7 +373,7 @@ void addInterfacesForBufferFlushToFdSet(fd_set * fds, int * fdmax) { ...@@ -373,7 +373,7 @@ void addInterfacesForBufferFlushToFdSet(fd_set * fds, int * fdmax) {
} }
} }
void closeNextErroredInterface() { static void closeNextErroredInterface() {
fd_set fds; fd_set fds;
struct timeval tv; struct timeval tv;
int i; int i;
...@@ -506,7 +506,7 @@ void initInterfaces() { ...@@ -506,7 +506,7 @@ void initInterfaces() {
} }
} }
void closeAllInterfaces() { static void closeAllInterfaces() {
int i; int i;
fflush(NULL); fflush(NULL);
...@@ -545,17 +545,7 @@ void closeOldInterfaces() { ...@@ -545,17 +545,7 @@ void closeOldInterfaces() {
} }
} }
void closeInterfaceWithFD(int fd) { static void flushInterfaceBuffer(Interface * interface) {
int i;
for(i=0;i<interface_max_connections;i++) {
if(interfaces[i].fd==fd) {
closeInterface(&(interfaces[i]));
}
}
}
void flushInterfaceBuffer(Interface * interface) {
ListNode * node = NULL; ListNode * node = NULL;
char * str; char * str;
int ret = 0; int ret = 0;
...@@ -592,16 +582,6 @@ void flushInterfaceBuffer(Interface * interface) { ...@@ -592,16 +582,6 @@ void flushInterfaceBuffer(Interface * interface) {
} }
} }
void flushAllInterfaceBuffers() {
int i;
for(i=0;i<interface_max_connections;i++) {
if(interfaces[i].open && !interfaces[i].expired && interfaces[i].bufferList) {
flushInterfaceBuffer(&interfaces[i]);
}
}
}
int interfacePrintWithFD(int fd, char * buffer, int buflen) { int interfacePrintWithFD(int fd, char * buffer, int buflen) {
static int i = 0; static int i = 0;
int copylen; int copylen;
...@@ -639,7 +619,7 @@ int interfacePrintWithFD(int fd, char * buffer, int buflen) { ...@@ -639,7 +619,7 @@ int interfacePrintWithFD(int fd, char * buffer, int buflen) {
return 0; return 0;
} }
void printInterfaceOutBuffer(Interface * interface) { static void printInterfaceOutBuffer(Interface * interface) {
char * buffer; char * buffer;
int ret; int ret;
......
...@@ -28,11 +28,8 @@ ...@@ -28,11 +28,8 @@
void initInterfaces(); void initInterfaces();
void openAInterface(int fd, struct sockaddr * addr); void openAInterface(int fd, struct sockaddr * addr);
void closeAllInterfaces();
void freeAllInterfaces(); void freeAllInterfaces();
void closeOldInterfaces(); void closeOldInterfaces();
void closeInterfaceWithFD(int fd);
void flushAllInterfaceBuffers();
int interfacePrintWithFD(int fd, char * buffer, int len); int interfacePrintWithFD(int fd, char * buffer, int len);
int doIOForInterfaces(); int doIOForInterfaces();
......
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