Main Page | Class List | File List | Class Members | File Members | Related Pages

ut_messages.c

00001 /***************************************************************************
00002  *            ut_messages_en.c
00003  *
00004  *  Jan 20 2005
00005  *  Copyright  2005  Alliance MCA
00006  *  Written by : Antoine Calando (antoine@alliancemca.net)
00007  ****************************************************************************/
00008 /*
00009  *  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  This program is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU Library General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with this program; if not, write to the Free Software
00021  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00022  */
00023 
00029 #include "debug.h"
00030 #include "utrac.h"
00031 #include "ut_error.h"
00032 
00033 
00037 const char * UT_EOL_NAME[] = { "CR", "LF", "CRLF", "LFCR", "Mix","BSN", "Nul", "None" };
00038 
00039 typedef struct UtErrorMessage {
00040         UtCode code;
00041         const char * message;
00042 } UtErrorMessage;
00043 
00044 
00045 const char * ut_error_message (UtCode code) {
00046         
00047         UtErrorMessage array[] = {
00048                 { UT_INTERRUPTED_BY_USER, "Processing interrupted by user" },
00049                 //{ UT_ERROR,   "Erreur indéfinie" },
00050                 //{ UT_SIZE_MISSING, "Taille manquante" },
00051                 { UT_NOT_FOUND_ERROR, "Element not found" },
00052 
00053                 { UT_MALLOC_ERROR, "Memory allocation refused"},
00054                 { UT_OPEN_FILE_ERROR, "Unable to open file"},
00055                 { UT_CLOSE_FILE_ERROR, "Unable to close file"},
00056                 { UT_FSTAT_FILE_ERROR, "Call to fstat refused"},
00057                 { UT_READ_FILE_ERROR, "Error during reading"},
00058                 { UT_READ_FILE_ERROR2, "Error during reading"},
00059                 { UT_FILE_TOO_BIG_ERROR, "File too big"},
00060 
00061                 { UT_ALREADY_INITIALISED_ERROR, "Utrac already initialised"},
00062                 { UT_SYNTAX_ERROR, "Syntax error"},
00063                 { UT_STRING_MISSING_ERROR, "Missing string"},
00064                 { UT_LANG_SYS_ALREADY_DEFINED_ERROR, "Language/system already defined"},
00065                 { UT_LANG_SYS_CODE_MISSING_ERROR, "Missing language/system code "},
00066                 { UT_PARTIAL_LANG_SYS_CODE_ERROR, "Incomplete language/system entry"},
00067                 { UT_LANG_SYS_NAME_MISSING_ERROR, "Missing language/system name"},
00068                 { UT_LANG_SYS_UNDEFINED_ERROR, "Undefined language/system"},
00069                 { UT_LANG_SYS_COEF_MISSING_ERROR, "Missing language/system coefficient"},
00070                 { UT_LANG_SYS_INCORRECT_COEF_ERROR, "Incorrect language/system coefficient"},
00071                 { UT_LANG_SYS_COEF_TOO_BIG_ERROR, "Language/system coefficient too big"},
00072                 { UT_LANG_SYS_DEF_AFTER_CHARSET_ERROR, "Language/system defined after charsets"},
00073                 { UT_INCORRECT_CHARMAP_ENTRY_ERROR, "Incorrect charmap entry"},
00074                 { UT_UNDEFINED_CATEGORY_ERROR, "Undefined character category"},
00075                 { UT_CHAR_TOO_BIG_ERROR, "Character too big"},
00076                 { UT_UNICODE_CHAR_TOO_BIG_ERROR, "Unicode character too big"},
00077                 { UT_CHARSET_FILE_ERROR, "Error in charsets file"},
00078                 { UT_CHARMAP_ENTRY_ILLEGAL_ERROR, "Illegal charmap entry in this charset"},
00079         
00080                 { UT_BAD_PARAMETER_ERROR, "Bad parameter"},
00081                 //{ UT_BAD_FLAGS_ERROR, ""},
00082                 //{ UT_DATA_OR_FILNAME_UNSPECIFIED_ERROR, ""},
00083                 //{ UT_EMPTY_FILE_ERROR, "Fichier vide"},
00084                 { UT_EMPTY_DATA_ERROR, "No data"},
00085                 { UT_BINARY_DATA_ERROR, "Binary data"},
00086                 //{ UT_CHARSET_NOT_RECOGNIZED_ERROR, ""},
00087                 
00088                 { UT_UNSET, NULL }
00089         };
00090         
00091         int i=0;
00092         while (array[i].code != UT_UNSET) {
00093                 if (array[i].code == code) return array[i].message;
00094                 i++;
00095         }
00096                         
00097         return NULL;
00098 }

Generated on Fri Feb 25 18:30:15 2005 for Utrac by  doxygen 1.3.9