MmsNamedVariableList MmsDomain_getNamedVariableList(MmsDomain* self, char* variableListName) { MmsNamedVariableList variableList = NULL; LinkedList element = LinkedList_getNext(self->namedVariableLists); while (element != NULL) { MmsNamedVariableList varList = (MmsNamedVariableList) element->data; if (strcmp(MmsNamedVariableList_getName(varList), variableListName) == 0) { variableList = varList; break; } element = LinkedList_getNext(element); } return variableList; }
MmsNamedVariableList MmsServerConnection_getNamedVariableList(MmsServerConnection* self, char* variableListName) { //TODO remove code duplication - similar to MmsDomain_getNamedVariableList ! MmsNamedVariableList variableList = NULL; LinkedList element = LinkedList_getNext(self->namedVariableLists); while (element != NULL) { MmsNamedVariableList varList = (MmsNamedVariableList) element->data; if (strcmp(MmsNamedVariableList_getName(varList), variableListName) == 0) { variableList = varList; break; } element = LinkedList_getNext(element); } return variableList; }