- Main Page
- Data Structures
- Files

- File List

# E:/DevIL/src-ILU/src/ilu_error.c

    00001 //-----------------------------------------------------------------------------
    00002 //
    00003 // ImageLib Utility Sources
    00004 // Copyright (C) 2000-2002 by Denton Woods
    00005 // Last modified: 02/20/2002 <--Y2K Compliant! =]
    00006 //
    00007 // Filename: src-ILU/src/ilu_error.c
    00008 //
    00009 // Description: Error functions
    00010 //
    00011 //-----------------------------------------------------------------------------
    00012
    00013
    00014 #include "ilu_internal.h"
    00015 #include "ilu_error/ilu_err-arabic.h"
    00016 #include "ilu_error/ilu_err-dutch.h"
    00017 #include "ilu_error/ilu_err-english.h"
    00018 #include "ilu_error/ilu_err-japanese.h"
    00019 #include "ilu_error/ilu_err-spanish.h"
    00020 #include "ilu_error/ilu_err-german.h"
    00021
    00022
    00023 ILconst_string *iluErrors;
    00024 ILconst_string *iluLibErrors;
    00025 ILconst_string *iluMiscErrors;
    00026 #define ILU_NUM_LANGUAGES 6
    00027
    00028 ILconst_string *iluErrorStrings[ILU_NUM_LANGUAGES] = {
    00029         iluErrorStringsEnglish,
    00030         iluErrorStringsArabic,
    00031         iluErrorStringsDutch,
    00032         iluErrorStringsJapanese,
    00033         iluErrorStringsSpanish,
    00034         iluErrorStringsGerman
    00035 };
    00036
    00037 ILconst_string *iluLibErrorStrings[ILU_NUM_LANGUAGES] = {
    00038         iluLibErrorStringsEnglish,
    00039         iluLibErrorStringsArabic,
    00040         iluLibErrorStringsDutch,
    00041         iluLibErrorStringsJapanese,
    00042         iluLibErrorStringsSpanish,
    00043         iluLibErrorStringsGerman
    00044 };
    00045
    00046 ILconst_string *iluMiscErrorStrings[ILU_NUM_LANGUAGES] = {
    00047         iluMiscErrorStringsEnglish,
    00048         iluMiscErrorStringsArabic,
    00049         iluMiscErrorStringsDutch,
    00050         iluMiscErrorStringsJapanese,
    00051         iluMiscErrorStringsSpanish,
    00052         iluMiscErrorStringsGerman
    00053 };
    00054
    00055
    00056 ILconst_string ILAPIENTRY iluErrorString(ILenum Error)
    00057 {
    00058         // Now we are dealing with Unicode strings.
    00059         if (Error == IL_NO_ERROR) {
    00060                 return iluMiscErrors[0];
    00061         }
    00062         if (Error == IL_UNKNOWN_ERROR) {
    00063                 return iluMiscErrors[1];
    00064         }
    00065         if (Error >= IL_INVALID_ENUM && Error <= IL_FILE_READ_ERROR) {
    00066                 return (ILstring)iluErrors[Error - IL_INVALID_ENUM];
    00067         }
    00068         if (Error >= IL_LIB_GIF_ERROR && Error <= IL_LIB_EXR_ERROR) {
    00069                 return (ILstring)iluLibErrors[Error - IL_LIB_GIF_ERROR];
    00070         }
    00071
    00072         return iluMiscErrors[0];
    00073 }
    00074
    00075
    00076 ILboolean ILAPIENTRY iluSetLanguage(ILenum Language)
    00077 {
    00078         switch (Language)
    00079         {
    00080                 case ILU_ENGLISH:
    00081                 case ILU_ARABIC:
    00082                 case ILU_DUTCH:
    00083                 case ILU_JAPANESE:
    00084                 case ILU_SPANISH:
    00085                 case ILU_GERMAN:
    00086                         iluErrors = iluErrorStrings[Language - ILU_ENGLISH];
    00087                         iluLibErrors = iluLibErrorStrings[Language - ILU_ENGLISH];
    00088                         iluMiscErrors = iluMiscErrorStrings[Language - ILU_ENGLISH];
    00089                         break;
    00090
    00091                 default:
    00092                         ilSetError(IL_INVALID_ENUM);
    00093                         return IL_FALSE;
    00094         }
    00095
    00096         return IL_TRUE;
    00097 }