/* * Photo Image Print System * Copyright (C) 2000-2004 EPSON KOWA Corporation. * Copyright (C) SEIKO EPSON CORPORATION 2000-2004. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * As a special exception, EPSON KOWA Corporation gives permission to * link the code of this program with libraries which are covered by * the EPSON KOWA PUBLIC LICENCE and distribute their linked * combinations. You must obey the GNU General Public License in all * respects for all of the code used other than the libraries which * are covered by EPSON KOWA PUBLIC LICENCE. */ #ifdef HAVE_CONFIG_H # include #endif #include #include "pipsError.h" int pipsError(char *edata, int ecode){ if(ecode == NO_ERROR) return 0; if(ecode == RESOURCE_ERROR){ fprintf(stderr, "PIPS Error : Line %s : Resourcefile load error\n", edata); return 0; } fprintf(stderr, "PIPS Error : "); if(edata != NULL) fprintf(stderr, "%s : ", edata); switch(ecode){ case NO_OPTION_ERROR: // オプションが存在しない fprintf(stderr, "The option does not exist\n"); break; case OPTION_LESS_ERROR: // オプションの引数が少ない case OPTION_VALUES_ERROR: // オプションの値が,誤り fprintf(stderr, "The value of option is wrong\n"); break; case DUB_FILENAME_ERROR: // 入力ファイルの指定が、二つ以上ある fprintf(stderr, "Tow or more input files was designated\n"); break; case CONNECTION_ERROR: // オプションの組合せパターンの誤り fprintf(stderr, "The combination of the option is wrong\n"); break; case RESOURCE_FORM_ERROR: // 書式間違い fprintf(stderr, "A form is wrong\n"); break; case NO_RESOURCE_ERROR: // リソースが存在しない fprintf(stderr, "The resource does not exist\n"); break; case RESOURCE_LESS_ERROR: // リソースの引数が少ない case RESOURCE_VALUES_ERROR: // リソースの値が,誤り fprintf(stderr, "The value of resource is wrong\n"); break; case GRAPHICS_LOAD_ERROR: // グラフィクスのロードに失敗 fprintf(stderr, "Failed in the load of a graphics\n"); break; case NO_SUCH_LIBRARY: // libraryが無い case NO_FILE_ERROR: fprintf(stderr, "File not found\n"); break; case FAILED_FILE_ERROR: // ファイルのオープンに失敗 fprintf(stderr, "Open the file is failed\n"); break; case GRAPHICS_FORMAT_ERROR: // fprintf(stderr, "The data format is unsupported\n"); break; case NOT_COMMUNICATE_LPR_ERROR: // lprとの通信に失敗 fprintf(stderr, "Communication to lpr is failed\n"); break; case LIBRARY_PARAM_ERROR: // libraryの引数エラー fprintf(stderr, "The parameter of library is wrong\n"); break; case MEMORY_ERROR: fprintf(stderr, "No allocate memory\n"); break; case UNEXPECTED_ERROR: // 予期せぬエラー(致命的) fprintf(stderr, "Unexpected error is occured\n"); break; case ABNORMAL_END: // 異常終了 fprintf(stderr, "...ABEND\n"); break; default: fprintf( stderr, "Unknown error occurd(%d).\n", ecode ); break; } if ( stderr ) fflush( stderr ); return ecode; }