src/ErrorsHandling.c
/*
 * FUNCTION NAME: checkIfIsInGraph
 *
 * DESCRIPTION:
 * Function checks, if given city is in the graph.
 *
 * RETURNS:
 * NO_ERROR - city is in the graph.
 * NO_SUCH_CITY - there is no such city in the graph.
 */
FUNCTION NAME: checkIfIsInGraph
DESCRIPTION:
Function checks, if given city is in the graph.

city is in the graph.
NO_SUCH_CITY - there is no such city in the graph.
FUNCTION NAME : checkIfIsInGraph DESCRIPTION : Function checks if given city is in the graph . city is in the graph . NO_SUCH_CITY - there is no such city in the graph .
programError_t checkIfIsInGraph(const Graph_t* graph, const char* city)
{
    AdjacencyList_t* adjacency_list;
    for (adjacency_list = graph->head; adjacency_list != NULL; adjacency_list = adjacency_list->next) {
        if (strcmp(adjacency_list->from, city) == 0) {
            return NO_ERROR;
        }
    }
    return NO_SUCH_CITY;
}
programError_t checkIfIsInGraph ( const Graph_t * graph , const char * city ) { AdjacencyList_t * adjacency_list ; for ( adjacency_list = graph -> head ; adjacency_list != NULL ; adjacency_list = adjacency_list -> next ) { if ( strcmp ( adjacency_list -> from , city ) == 0 ) { return NO_ERROR ; } } return NO_SUCH_CITY ; }
FUNCTION NAME: checkIfIsInGraph
 DESCRIPTION:
 Function checks, if given city is in the graph.
FUNCTION NAME : checkIfIsInGraph DESCRIPTION : Function checks if given city is in the graph .