incremental updates and command-list/update kung fu

this needs some serious cleaning up and testing

git-svn-id: https://svn.musicpd.org/mpd/trunk@692 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2004-04-11 17:37:47 +00:00
parent 87f53c94d7
commit fc7a264e4d
6 changed files with 218 additions and 70 deletions

View File

@@ -233,6 +233,7 @@ int interfaceReadInput(Interface * interface) {
if(argArrayLength==0);
else if(strcmp(argArray[0],INTERFACE_LIST_MODE_END)==0) {
ListNode * node = interface->commandList->firstNode;
ListNode * tempNode;
ret = 0;
while(node!=NULL) {
@@ -240,12 +241,16 @@ int interfaceReadInput(Interface * interface) {
int argArrayLength;
argArrayLength = buffer2array((char *)node->data,&argArray);
DEBUG("interface %i: process command \"%s\"\n",interface->num,node->data);
ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray);
ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray,node);
DEBUG("interface %i: command returned %i\n",interface->num,ret);
freeArgArray(argArray,argArrayLength);
node = node->nextNode;
if(ret!=0 ||
interface->expired) {
tempNode = node->nextNode;
deleteNodeFromList(
interface->commandList,
node);
node = tempNode;
if(ret!=0 || interface->expired)
{
node = NULL;
}
}
@@ -295,7 +300,7 @@ int interfaceReadInput(Interface * interface) {
}
else {
DEBUG("interface %i: process command \"%s\"\n",interface->num,interface->buffer);
ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray);
ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray,NULL);
DEBUG("interface %i: command returned %i\n",interface->num,ret);
}
if(ret==0) {