1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

Print actual density code as well as string for density- I dunno about others,

but I sure remember 0x15 easier than 'ECMA 17'. Also handle density codes
0 (default) and 0x7f ('same') as special cases.
This commit is contained in:
Matt Jacob 1999-03-02 06:27:59 +00:00
parent e5f251d2d3
commit c4e8e42c98
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44397

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$Id: mt.c,v 1.20 1998/12/22 17:28:25 mjacob Exp $";
"$Id: mt.c,v 1.21 1999/02/05 02:46:21 mjacob Exp $";
#endif /* not lint */
/*
@ -511,14 +511,19 @@ denstostring(int d)
static char buf[20];
struct densities *sd;
/* densities 0 and 0x7f are handled as special cases */
if (d == 0)
return "default";
if (d == 0x7f)
return "same";
for (sd = dens; sd->dens; sd++)
if (sd->dens == d)
break;
if (sd->dens == 0) {
if (sd->dens == 0)
sprintf(buf, "0x%02x", d);
return buf;
} else
return sd->name;
else
sprintf(buf, "0x%02x:%s", d, sd->name);
return buf;
}
/*