#include"global.h"
/* Initialisation du module DEBUG pour les environnements
ne permettant pas de consulter la ligne de commande
travers CLP.
*/
#defineDEBUGLINELENGTH 256
voiddbInit()
{
charbuffer[DEBUGLINELENGTH];
FILE *db;
stdebug=stderr;
memset(buffer,0,DEBUGLINELENGTH);
db=fopen(".dbfile","r");
if (db) {
/* open the debug output device */
fgets(buffer,DEBUGLINELENGTH,db);
buffer[strlen(buffer)-1]=0;
if (!(stdebug=fopen(buffer,"w")))
stdebug=fopen("/dev/null","w");
/* open the debug INPUT device */
fgets(buffer,DEBUGLINELENGTH,db);
buffer[strlen(buffer)-1]=0;
if (!(stdbin=fopen(buffer,"r")))
stdbin=fopen("/dev/null","r");
fclose(db);
}
elsestdebug=fopen("/dev/null","w");
db=fopen(".dblevel","r");
if(db) {
fgets(buffer,DEBUGLINELENGTH,db);
DbLvl=atoi(buffer);
fclose(db);
}
db=fopen(".dbmask","r");
if(db) {
fgets(buffer,DEBUGLINELENGTH,db);
DbMsk=atoi(buffer);
fclose(db);
}