Commit a0175264 authored by rswindell's avatar rswindell
Browse files

Changed all lprintf/eprintf/lputs implementations/calls to use a log_level arg.

parent 74d50304
......@@ -63,26 +63,10 @@ char lib[LEN_GSNAME+1];
#define SYNC_LIST (1L<<13)
#define KEEP_SPACE (1L<<14)
int lputs(char* str)
{
char tmp[512];
int i,j,k;
j=strlen(str);
for(i=k=0;i<j;i++) /* remove CRs */
if(str[i]==CR && str[i+1]==LF)
continue;
else
tmp[k++]=str[i];
tmp[k]=0;
return(fputs(tmp,stdout));
}
/****************************************************************************/
/* Performs printf() through local assembly routines */
/* Called from everywhere */
/* This is needed by load_cfg.c */
/****************************************************************************/
int lprintf(char *fmat, ...)
int lprintf(int level, char *fmat, ...)
{
va_list argptr;
char sbuf[512];
......@@ -91,7 +75,8 @@ int lprintf(char *fmat, ...)
va_start(argptr,fmat);
chcount=vsprintf(sbuf,fmat,argptr);
va_end(argptr);
lputs(sbuf);
truncsp(sbuf);
printf("%s\n",sbuf);
return(chcount);
}
......
......@@ -47,26 +47,9 @@ scfg_t scfg;
char *crlf="\r\n";
int lputs(char* str)
{
char tmp[256];
int i,j,k;
j=strlen(str);
for(i=k=0;i<j;i++) /* remove CRs */
if(str[i]==CR && str[i+1]==LF)
continue;
else
tmp[k++]=str[i];
tmp[k]=0;
return(fputs(tmp,stdout));
}
/****************************************************************************/
/* Performs printf() through local assembly routines */
/* Called from everywhere */
/****************************************************************************/
int lprintf(char *fmat, ...)
int lprintf(int level, char *fmat, ...)
{
va_list argptr;
char sbuf[256];
......@@ -75,7 +58,8 @@ int lprintf(char *fmat, ...)
va_start(argptr,fmat);
chcount=vsprintf(sbuf,fmat,argptr);
va_end(argptr);
lputs(sbuf);
truncsp(sbuf);
printf("%s\n",sbuf);
return(chcount);
}
......
......@@ -40,10 +40,9 @@
scfg_t scfg;
/****************************************************************************/
/* Performs printf() through local assembly routines */
/* Called from everywhere */
/* This is needed by load_cfg.c */
/****************************************************************************/
int lprintf(char *fmat, ...)
int lprintf(int level, char *fmat, ...)
{
va_list argptr;
char sbuf[512];
......@@ -52,11 +51,11 @@ int lprintf(char *fmat, ...)
va_start(argptr,fmat);
chcount=vsprintf(sbuf,fmat,argptr);
va_end(argptr);
printf("%s",sbuf);
truncsp(sbuf);
printf("%s\n",sbuf);
return(chcount);
}
char *usage="\nusage: makeuser [ctrl_dir] name [-param value] [...]\n"
"\nparams:\n"
"\t-P\tPassword\n"
......
......@@ -141,25 +141,6 @@ unsigned _rotr (
}
#endif
/******************************************************************************
Displays characters locally
******************************************************************************/
static int lputs(int level, char *str)
{
char tmp[256];
int i,j,k;
j=strlen(str);
for(i=k=0;i<j;i++) /* remove CRs */
if(str[i]==CR && str[i+1]==LF)
continue;
else
tmp[k++]=str[i];
tmp[k]=0;
return(fputs(tmp,stdout));
}
/****************************************************************************/
/* This is needed by load_cfg.c */
/****************************************************************************/
......@@ -173,7 +154,8 @@ int lprintf(int level, char *fmat, ...)
chcount=vsnprintf(sbuf,sizeof(sbuf),fmat,argptr);
sbuf[sizeof(sbuf)-1]=0;
va_end(argptr);
lputs(level, sbuf);
truncsp(sbuf);
printf("%s\n",sbuf);
return(chcount);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment