src/ErrorsMessages.c
/*
 * FUNCTION NAME: printDataBaseError
 *
 * DESCRIPTION:
 * Function prints an error message that depends upon a
 * value of error_code.
 */
FUNCTION NAME: printDataBaseError
DESCRIPTION:
Function prints an error message that depends upon a
value of error_code.
FUNCTION NAME : printDataBaseError DESCRIPTION : Function prints an error message that depends upon a value of error_code .
void printDataBaseError(programError_t error_code)
{
    if (error_code == ALREADY_ON_THE_LIST) {
        fputs("DataBase.txt is incorrect!\n"
              "There is at least more than one connection for a pair of the same cities.\n"
              "Add connections manually...",
            stderr);
    } else if (error_code == BAD_FORMAT) {
        fputs("DataBase.txt is incorrect!\n"
              "DataBase.txt must be filled with such format of data:\n"
              "\"City1 City2 Distance\"\n"
              "Add connections manually...",
            stderr);
    } else if (error_code == CANT_OPEN_FILE) {
        fputs("Can't open DataBase.txt file!\n"
              "Add connections manually...",
            stderr);
    } else if (error_code == CANT_UPDATE_FILE) {
        fputs("Couldn't update DataBase.txt file!\n", stderr);
    } else if (error_code == DIFFERENT_DISTANCE) {
        fputs("DataBase.txt is incorrect!\n"
              "Distance in connection from city1 to city2 is "
              "different than distance from city2 to city1!\n"
              "Add connections manually...",
            stderr);
    } else if (error_code == DIRECTED_CONNECTION) {
        fputs("DataBase.txt is incorrect!\n"
              "In this program only undirected connections are allowed!\n"
              "Add connections manually...",
            stderr);
    } else if (error_code == INCORRECT_DISTANCE) {
        fputs("DataBase.txt is incorrect!\n"
              "There is a non-positive distance between two cities.\n"
              "Add connections manually...",
            stderr);
    } else if (error_code == INCORRECT_NAME) {
        fputs("DataBase.txt is incorrect!\n"
              "City's name can only contain basic ISO Latin characters.\n"
              "Add connections manually...",
            stderr);
    } else if (error_code == NO_CONNECTIONS) {
        fputs("DataBase.txt is incorrect!\n"
              "There are no connections in this file!\n"
              "Add them manually...",
            stderr);
    } else if (error_code == IDENTICAL_NAMES) {
        fputs("DataBase.txt is incorrect!\n"
              "There is a connection between cities with same names.\n"
              "Add connections manually...",
            stderr);
    }
}
void printDataBaseError ( programError_t error_code ) { if ( error_code == ALREADY_ON_THE_LIST ) { fputs ( " \n " " \n " " " , stderr ) ; } else if ( error_code == BAD_FORMAT ) { fputs ( " \n " " \n " " \" \" \n " " " , stderr ) ; } else if ( error_code == CANT_OPEN_FILE ) { fputs ( " \n " " " , stderr ) ; } else if ( error_code == CANT_UPDATE_FILE ) { fputs ( " \n " , stderr ) ; } else if ( error_code == DIFFERENT_DISTANCE ) { fputs ( " \n " " " " \n " " " , stderr ) ; } else if ( error_code == DIRECTED_CONNECTION ) { fputs ( " \n " " \n " " " , stderr ) ; } else if ( error_code == INCORRECT_DISTANCE ) { fputs ( " \n " " \n " " " , stderr ) ; } else if ( error_code == INCORRECT_NAME ) { fputs ( " \n " " \n " " " , stderr ) ; } else if ( error_code == NO_CONNECTIONS ) { fputs ( " \n " " \n " " " , stderr ) ; } else if ( error_code == IDENTICAL_NAMES ) { fputs ( " \n " " \n " " " , stderr ) ; } }
FUNCTION NAME: printDataBaseError
 DESCRIPTION:
 Function prints an error message that depends upon a
 value of error_code.
FUNCTION NAME : printDataBaseError DESCRIPTION : Function prints an error message that depends upon a value of error_code .