00001 00002 /*--------------------------------------------------------------------------- 00003 E.S.O. 00004 ---------------------------------------------------------------------------- 00005 File name : comm.h 00006 Author : N. Devillard 00007 Created on : September 1999 00008 Language : ANSI C 00009 Part of ECLIPSE library for Adonis 00010 Description : communication module, output message handling 00011 *--------------------------------------------------------------------------*/ 00012 00013 /* 00014 00015 $Id: comm.h,v 1.2 2005/04/08 13:37:49 amodigli Exp $ 00016 $Author: amodigli $ 00017 $Date: 2005/04/08 13:37:49 $ 00018 $Revision: 1.2 $ 00019 00020 */ 00021 00022 /*--------------------------------------------------------------------------- 00023 Includes 00024 ---------------------------------------------------------------------------*/ 00025 00026 #include <stdio.h> 00027 #include <stdlib.h> 00028 #include <string.h> 00029 #include <unistd.h> 00030 #include <stdarg.h> 00031 00032 00033 /*--------------------------------------------------------------------------- 00034 Defines 00035 ---------------------------------------------------------------------------*/ 00036 00037 #define OUTPUTMSGSZ 256 00038 00039 00040 /*---------------------------------------------------------------------------- 00041 * Public toggle functions 00042 *--------------------------------------------------------------------------*/ 00043 00044 00045 void set_verbose(int flag); 00046 int verbose_active(void); 00047 void set_debug(int flag); 00048 int debug_active(void); 00049 void set_logfile(int flag); 00050 int logfile_active(void); 00051 void set_logfilename(char * name); 00052 char * get_logfilename(void); 00053 00054 00055 /*--------------------------------------------------------------------------- 00056 Function codes 00057 ---------------------------------------------------------------------------*/ 00058 00059 00060 /*--------------------------------------------------------------------------- 00061 Function : HelloWorld() 00062 In : Program name, short help 00063 Out : message to stdout 00064 Job : prints out program name and a short help 00065 Notice : 00066 ---------------------------------------------------------------------------*/ 00067 00068 void 00069 HelloWorld( 00070 char *pname, 00071 char *shelp 00072 ); 00073 00074 00075 00076 00077 /*--------------------------------------------------------------------------- 00078 Function : e_warning() 00079 In : Message to be printed out 00080 Out : Message on stderr 00081 Job : Prints a warning on stderr 00082 Notice : should be replaced in a windowed version 00083 ---------------------------------------------------------------------------*/ 00084 void 00085 e_warning(const char *fmt, ...) ; 00086 00087 00088 /*--------------------------------------------------------------------------- 00089 Function : e_error() 00090 In : Message to be printed out 00091 Out : Message on stderr 00092 Job : Prints a warning on stderr 00093 Notice : should be replaced in a windowed version 00094 ---------------------------------------------------------------------------*/ 00095 00096 void 00097 e_error(const char *fmt, ...); 00098 00099 00100 /*--------------------------------------------------------------------------- 00101 Function : e_comment() 00102 In : comment level, message to be printed a la printf 00103 Out : comment sent out 00104 Job : prints out a comment on stdout 00105 Notice : 00106 ---------------------------------------------------------------------------*/ 00107 00108 void 00109 e_comment(int level, const char * fmt, ...); 00110 00111 /*--------------------------------------------------------------------------- 00112 Function : ComputeStatus() 00113 In : Message, number done so far, total, comment level 00114 Out : Status is printed on stdout 00115 Job : Prints out advance status on stdout 00116 Notice : 00117 ---------------------------------------------------------------------------*/ 00118 00119 void 00120 ComputeStatus(char *Msg, int done, int total, int level); 00121 00122 00123 00124 /*--------------------------------------------------------------------------- 00125 Function : DisplayLicense() 00126 In : void 00127 Out : void 00128 Job : Displays the distribution license on stdout 00129 Notice : eclipse is distributed under GNU license, with an 00130 ESO copyright. 00131 ---------------------------------------------------------------------------*/ 00132 00133 void DisplayLicense(void); 00134 00135 00136 /*--------------------------------------------------------------------------- 00137 Function : print_eclipse_version() 00138 In : void 00139 Out : eclipse version number on stdout 00140 Job : prints out current eclipse version 00141 Notice : 00142 ---------------------------------------------------------------------------*/ 00143 00144 void print_eclipse_version(void); 00145 00146 00147 /*--------------------------------------------------------------------------- 00148 Function : get_eclipse_version() 00149 In : void 00150 Out : pointer to statically allocated string 00151 Job : return eclipse current version number 00152 Notice : do not modify the returned value nor its contents! 00153 ---------------------------------------------------------------------------*/ 00154 00155 char * get_eclipse_version(void); 00156 00157 00158 00159 /*--------------------------------------------------------------------------- 00160 Function : e_logfile_start() 00161 In : void 00162 Out : void 00163 Job : appends header information to the E_LOGFILE 00164 Notice : 00165 ---------------------------------------------------------------------------*/ 00166 00167 void e_logfile_start(void); 00168 00169 00170 00171 /*--------------------------------------------------------------------------- 00172 Function : e_logfile_stop() 00173 In : void 00174 Out : void 00175 Job : appends tail information to the E_LOGFILE 00176 Notice : 00177 ---------------------------------------------------------------------------*/ 00178 00179 void e_logfile_stop(void); 00180 00181 00182 00183 /*--------------------------------------------------------------------------- 00184 Function : e_logfile() 00185 In : character string to print out 00186 Out : if E_LOGFILE exists and points to a valid file, appends 00187 the messages to this file 00188 Job : Log messages into a log file 00189 Notice : 00190 ---------------------------------------------------------------------------*/ 00191 00192 void e_logfile(char * type, char * msg); 00193 00194 /*--------------------------------------------------------------------------*/
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001