/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** ** ** ** ** ** ** ** ** ** ** ********* ** ** ** ********** ********** *** *** ** ** ** ********** ** **** **** ** ********** ** ** ** ** ** ** ** ** ** ********** ** ** ** ******** ** ** ** ** ** ** ** ** ****** ******** ** ** ** ** ** ** ** ****** *** ** ** ** ************** ** ** ** *** ** ********** ** ************** ** ** ** *** ***************** ******** ** ** ** *********** ********* ** ********* ** ** ** *********** ** ** ** *** ** ********** ** ** ** ** ** ****** ** ** ********** ** ** ** ** ** ****** ******** ** ** ** * ** ** ********* ** ** ** * ** ** ** ** ** ** ** *** ********** ** ** ** ** ** *** ********** ********** ** ** ********* ** ** ** ** ** ** E N S E M B L E T O O L S ** ** ** ** Version 2.1 ** ** ** ** ** ** Principal Investigator: Julie D. Forman-Kay ** ** ** ** Author: Mickaƫl Krzeminski ** ** ** ** Date: November 2012 ** ** ** ** ** ************************************************************************************* ** ** ** ** ** Copyright (C) The Hospital for Sick Children, 2001 ** ** ** ** Distribution of substantively modified versions of this module is prohibited ** ** without the explicit permission of the copyright holder. ** ** ** ** Any use of this work or derivative works in whole or in part for any ** ** commercial purpose or for monetary gain is prohibited. ** ** ** ** ** ** NO WARRANTY ** ** This software package is provided 'as is' without warranty of any kind, ** ** expressed or implied. ** ** ** ** ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __ERRORS_HEADER__ #define __ERRORS_HEADER__ void error(char *type, char *arg) { printf ("ERROR: "); if (!strcmp(type, "NO_FILE")) { printf ("The file %s has not been found!", arg); } else if (!strcmp(type, "OPEN_FILE")) { printf ("The file %s cannot be accessed!", arg); } else if (!strcmp(type, "CSP_FILE")) { printf ("%s is not a CSP file type!", arg); } else if (!strcmp(type, "CDP_FILE")) { printf ("%s is not a CDP file type!", arg); } else if (!strcmp(type, "INP_FILE")) { printf ("%s is not an Inital Pool file type!", arg); } else if (!strcmp(type, "INVALID_FILE")) { printf ("The file %s is not valid!", arg); } else if (!strcmp(type, "EMPTY")) { printf ("%s is an empty file!", arg); } else if (!strcmp(type, "PDB_FILE")) { printf ("%s is not a valid PDB file!", arg); } else if (!strcmp(type, "CORR_FILE")) { printf ("The file %s is corrupted!", arg); } else if (!strcmp(type, "CREATION_FILE")) { printf ("Impossible to create the file %s!", arg); } else if (!strcmp(type, "ENVIRONMENT")) { printf ("The environment of your system does not contain the $%s variable!", arg); } else if (!strcmp(type, "READ_FILE")) { printf ("A problem occured while reading the file %s!", arg); } else if (!strcmp(type, "WRITE_FILE")) { printf ("A problem occured while writing into the file %s!", arg); } else if (!strcmp(type, "ATOM_RECORD")) { printf ("%s does not fit the PDB file model!", arg); } else if (!strcmp(type, "MEMORY")) { printf ("Memory allocation failed while attempting to %s.", arg); } else { printf (type, arg); } printf ("\n"); } void fatal_error(char *type, char *arg) { printf ("FATAL ERROR: "); if (!strcmp(type, "NO_FILE")) { printf ("The file %s has not been found or cannot be read!", arg); } else if (!strcmp(type, "EXIST_FILE")) { printf ("%s is already existing!", arg); } else if (!strcmp(type, "CSP_FILE")) { printf ("%s is not a CSP file type!", arg); } else if (!strcmp(type, "CDP_FILE")) { printf ("%s is not a CDP file type!", arg); } else if (!strcmp(type, "NRG_FILE")) { printf ("%s is not an Energy file type!", arg); } else if (!strcmp(type, "ENS_FILE")) { printf ("%s is not an ENSEMBLE file type!", arg); } else if (!strcmp(type, "BEST_FILE")) { printf ("%s is not an Best file type!", arg); } else if (!strcmp(type, "OPEN_FILE")) { printf ("The file %s cannot be accessed!", arg); } else if (!strcmp(type, "WRITE_FILE")) { printf ("A problem occured while writing into the file %s!", arg); } else if (!strcmp(type, "INVALID_FILE")) { printf ("The file %s is not valid!", arg); } else if (!strcmp(type, "CORR_FILE")) { printf ("The file %s is corrupted!", arg); } else if (!strcmp(type, "WRONG_FLAG")) { printf ("The specified flag (%s) is wrong!", arg); } else if (!strcmp(type, "DOUBLE_FLAG")) { printf ("The specified flag (%s) has been specified twice!", arg); } else if (!strcmp(type, "INVALID_ARGUMENT")) { printf ("The argument %s is not valid!", arg); } else if (!strcmp(type, "NO_ARGUMENT_FLAG")) { printf ("No argument specified after %s flag!", arg); } else if (!strcmp(type, "MEMORY")) { printf ("Memory allocation failed while attempting to %s.", arg); } else if (!strcmp(type, "EMPTY")) { printf ("%s is an empty file!", arg); } else if (!strcmp(type, "PDB_FILE")) { printf ("%s is not a valid PDB file!", arg); } else if (!strcmp(type, "PDB_FILE_HEADER")) { printf ("The PDB file contains a non valid keyword: %s.", arg); } else if (!strcmp(type, "ENVIRONMENT")) { printf ("The environment of your system does not contain the $%s variable!", arg); } else if (!strcmp(type, "END_FILE")) { printf ("The end of the %s has not been reached!", arg); } else { printf (type, arg); } printf ("\nThe program will be aborting.\n\n"); exit(1); } void warning(char *type, char *arg) { printf ("WARNING: "); if (!strcmp(type, "NO_FILE")) { printf ("The file %s has not been found!", arg); } else if (!strcmp(type, "CSP_FILE")) { printf ("%s is not a CSP file type!", arg); } else if (!strcmp(type, "ENS_FILE")) { printf ("%s is not an ENSEMBLE file type!", arg); } else if (!strcmp(type, "NO_ARGUMENT_FLAG")) { printf ("No argument specified after %s flag!", arg); } else if (!strcmp(type, "ARGUMENT")) { printf ("Invalid argument: %s", arg); } else if (!strcmp(type, "INVALID_FILE")) { printf ("The file %s is not valid!", arg); } else if (!strcmp(type, "PDB_FILE")) { printf ("%s is not a valid PDB file!", arg); } else if (!strcmp(type, "END_FILE")) { printf ("The end of the %s has not been reached!", arg); } else { printf (type, arg); } printf("\n"); } void error_msg(char *type, char *arg) { printf (type, arg); printf ("\n"); } #endif