00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <stdio.h>
00028 #include <stdlib.h>
00029 #include <assert.h>
00030 #include "kmapi_error.h"
00031 int kmapi_err_counter=0;
00032
00033 void
00034 kmapi_Error( int fTerminate, char *pch1 )
00035 {
00036 char *pchError;
00037
00038 pchError = "Error";
00039 kmapi_err_counter++;
00040
00041 fprintf( stderr, "%s: %s\n", pchError, pch1 );
00042 if ( fTerminate ) {
00043 exit( -1 );
00044 }
00045 }
00046
00047 void
00048 kmapi_Error_i1( int fTerminate, char *pchFormat, int i )
00049 {
00050 char *pchError;
00051
00052
00053 pchError = "Error";
00054 kmapi_err_counter++;
00055
00056 fprintf( stderr, "%s: ", pchError );
00057 fprintf( stderr, pchFormat, i );
00058 fprintf( stderr, "\n" );
00059
00060 if ( fTerminate ) {
00061 exit( -1 );
00062 }
00063 }
00064
00065 void
00066 kmapi_Error_pch1( int fTerminate, char *pchFormat, char *pch1 )
00067 {
00068 char *pchError;
00069
00070 pchError = "Error";
00071 kmapi_err_counter++;
00072
00073 fprintf( stderr, "%s: ", pchError );
00074
00075 fprintf( stderr, pchFormat, pch1 );
00076 fprintf( stderr, "\n" );
00077
00078 if ( fTerminate ) {
00079 exit( -1 );
00080 }
00081 }
00082
00083 void
00084 kmapi_Error_pch2( int fTerminate, char *pchFormat, char *pch1 ,char *pch2)
00085 {
00086 char *pchError;
00087
00088 pchError = "Error";
00089 kmapi_err_counter++;
00090
00091 fprintf( stderr, "%s: ", pchError );
00092
00093 fprintf( stderr, pchFormat, pch1, pch2 );
00094 fprintf( stderr, "\n" );
00095
00096 if ( fTerminate ) {
00097 exit( -1 );
00098 }
00099 }
00100
00101 void
00102 kmapi_Warning( char *pch1 )
00103 {
00104 char *pchWarning;
00105
00106 pchWarning = "Warning";
00107
00108 fprintf( stderr, "%s: %s\n", pchWarning, pch1 );
00109 }
00110
00111 void
00112 kmapi_Warning_i2( char *pchFormat, int i1, int i2 )
00113 {
00114 char *pchWarning;
00115
00116 pchWarning = "Warning";
00117
00118 fprintf( stderr, "%s: ", pchWarning );
00119
00120 fprintf( stderr, pchFormat, i1, i2 );
00121 fprintf( stderr, "\n" );
00122 }
00123
00124 void
00125 kmapi_Warning_i1( char *pchFormat, int i )
00126 {
00127 char *pchWarning;
00128
00129 pchWarning = "Warning";
00130
00131 fprintf( stderr, "%s: ", pchWarning );
00132 fprintf( stderr, pchFormat, i );
00133 fprintf( stderr, "\n" );
00134 }
00135
00136 void
00137 kmapi_Warning_pch1( char *pchFormat, char *pch1 )
00138 {
00139 char *pchWarning;
00140
00141 pchWarning = "Warning";
00142
00143 fprintf( stderr, "%s: ", pchWarning );
00144 fprintf( stderr, pchFormat, pch1 );
00145 fprintf( stderr, "\n" );
00146 }