"Fossies" - the Fresh Open Source Software Archive

Member "utrac-0.3.2/src/ut_messages_en.c" (4 Jan 2009, 3672 Bytes) of package /linux/privat/old/utrac-0.3.2.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ut_messages_en.c" see the Fossies "Dox" file reference documentation.

    1 /***************************************************************************
    2  *            ut_messages_en.c
    3  *
    4  *  Jan 20 2005
    5  *  Copyright  2005  Alliance MCA
    6  *  Written by : Antoine Calando (antoine@alliancemca.net)
    7  ****************************************************************************/
    8 /*
    9  *  This program is free software; you can redistribute it and/or modify
   10  *  it under the terms of the GNU General Public License as published by
   11  *  the Free Software Foundation; either version 2 of the License, or
   12  *  (at your option) any later version.
   13  *
   14  *  This program is distributed in the hope that it will be useful,
   15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17  *  GNU Library General Public License for more details.
   18  *
   19  *  You should have received a copy of the GNU General Public License
   20  *  along with this program; if not, write to the Free Software
   21  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   22  */
   23 
   24 /*!
   25  * \file ut_messages_en.c
   26  * \author  Antoine Calando (antoine@alliancemca.net)
   27  */
   28 
   29 #include "debug.h"
   30 #include "utrac.h"
   31 #include "ut_error.h"
   32 
   33 
   34 /*!
   35  *\brief Names of eol type.
   36  */
   37 const char * UT_EOL_NAME[] = { "CR", "LF", "CRLF", "LFCR", "Mix","BSN", "Nul", "None" };
   38 
   39 typedef struct UtErrorMessage {
   40     UtCode code;
   41     const char * message;
   42 } UtErrorMessage;
   43 
   44 
   45 const char * ut_error_message (UtCode code) {
   46     
   47     UtErrorMessage array[] = {
   48         { UT_INTERRUPTED_BY_USER, "Processing interrupted by user" },
   49         //{ UT_ERROR,   "Erreur indéfinie" },
   50         //{ UT_SIZE_MISSING, "Taille manquante" },
   51         { UT_NOT_FOUND_ERROR, "Element not found" },
   52 
   53         { UT_MALLOC_ERROR, "Memory allocation refused"},
   54         { UT_OPEN_FILE_ERROR, "Unable to open file"},
   55         { UT_CLOSE_FILE_ERROR, "Unable to close file"},
   56         { UT_FSTAT_FILE_ERROR, "Call to fstat refused"},
   57         { UT_READ_FILE_ERROR, "Error during reading"},
   58         { UT_READ_FILE_ERROR2, "Error during reading"},
   59         { UT_FILE_TOO_BIG_ERROR, "File too big"},
   60 
   61         { UT_ALREADY_INITIALISED_ERROR, "Utrac already initialised"},
   62         { UT_SYNTAX_ERROR, "Syntax error"},
   63         { UT_STRING_MISSING_ERROR, "Missing string"},
   64         { UT_LANG_SYS_ALREADY_DEFINED_ERROR, "Language/system already defined"},
   65         { UT_LANG_SYS_CODE_MISSING_ERROR, "Missing language/system code "},
   66         { UT_PARTIAL_LANG_SYS_CODE_ERROR, "Incomplete language/system entry"},
   67         { UT_LANG_SYS_NAME_MISSING_ERROR, "Missing language/system name"},
   68         { UT_LANG_SYS_UNDEFINED_ERROR, "Undefined language/system"},
   69         { UT_LANG_SYS_COEF_MISSING_ERROR, "Missing language/system coefficient"},
   70         { UT_LANG_SYS_INCORRECT_COEF_ERROR, "Incorrect language/system coefficient"},
   71         { UT_LANG_SYS_COEF_TOO_BIG_ERROR, "Language/system coefficient too big"},
   72         { UT_LANG_SYS_DEF_AFTER_CHARSET_ERROR, "Language/system defined after charsets"},
   73         { UT_INCORRECT_CHARMAP_ENTRY_ERROR, "Incorrect charmap entry"},
   74         { UT_UNDEFINED_CATEGORY_ERROR, "Undefined character category"},
   75         { UT_CHAR_TOO_BIG_ERROR, "Character too big"},
   76         { UT_UNICODE_CHAR_TOO_BIG_ERROR, "Unicode character too big"},
   77         { UT_CHARSET_FILE_ERROR, "Error in charsets file"},
   78         { UT_CHARMAP_ENTRY_ILLEGAL_ERROR, "Illegal charmap entry in this charset"},
   79     
   80         { UT_BAD_PARAMETER_ERROR, "Bad parameter"},
   81         //{ UT_BAD_FLAGS_ERROR, ""},
   82         //{ UT_DATA_OR_FILNAME_UNSPECIFIED_ERROR, ""},
   83         //{ UT_EMPTY_FILE_ERROR, "Fichier vide"},
   84         { UT_EMPTY_DATA_ERROR, "No data"},
   85         { UT_BINARY_DATA_ERROR, "Binary data"},
   86         //{ UT_CHARSET_NOT_RECOGNIZED_ERROR, ""},
   87         
   88         { UT_UNSET, NULL }
   89     };
   90     
   91     int i=0;
   92     while (array[i].code != UT_UNSET) {
   93         if (array[i].code == code) return array[i].message;
   94         i++;
   95     }
   96             
   97     return NULL;
   98 }