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
00028
00029
00030
00031
00032
00040 #ifndef __TOOLS_H
00041 #define __TOOLS_H
00042
00043 #if defined( __BORLANDC__ )
00044 # include <stdio>
00045 # include <string>
00046 #elif defined( __MINGW32__ ) || defined( __GNUC__ )
00047 # include <cstdio>
00048 # include <string>
00049 #else
00050 #error Unhandled compiler-specific include file selection.
00051 #endif
00052
00053 using namespace std;
00054
00059 enum
00060 {
00061 E_OK,
00062 E_OPT,
00063 E_PS,
00064 E_INT,
00065 E_ITL
00066 };
00067
00072 enum
00073 {
00074 MSG_L0,
00075 MSG_L1,
00076 MSG_L2
00077 };
00078
00083 enum
00084 {
00085 DBG_L0,
00086 DBG_L1,
00087 DBG_L2
00088 };
00089
00090
00091
00092
00093
00094 const char *getprogname();
00095 void setprogname( const char *name );
00096
00097 int getmsglevel( );
00098 void setmsglevel( int level );
00099 FILE * getmsgfile ( );
00100 void setmsgfile ( FILE *file );
00101
00102 int getdbglevel( );
00103 void setdbglevel( int level );
00104 FILE * getdbgfile ( );
00105 void setdbgfile ( FILE *file );
00106
00107 const char *dirname ( const char *pathname );
00108 const char *basename ( const char *pathname );
00109 const char *extname ( const char *pathname );
00110
00111 int exist ( const char *filename );
00112
00113 int error ( int status, const char *format ...);
00114 int message ( int level , const char *format ...);
00115 int debug ( int level , const char *format ...);
00116
00117 string prompt ( const char *ps );
00118 int pick ( int isInteractive, const char *arg, const char *set = "yY" );
00119 int ttyin ( );
00120
00121 #endif // __TOOLS_H
00122
00123
00124
00125
00126
00127
00128