1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* psign.c - produce picture from text. |
6 |
|
* |
8 |
|
*/ |
9 |
|
|
10 |
|
#include "standard.h" |
11 |
< |
|
11 |
> |
#include "platform.h" |
12 |
|
#include "color.h" |
16 |
– |
|
13 |
|
#include "font.h" |
14 |
|
|
19 |
– |
#include "paths.h" |
20 |
– |
|
15 |
|
#ifndef SSS |
16 |
|
#define SSS 3 /* super-sample size */ |
17 |
|
#endif |
34 |
|
int xsiz, ysiz; /* bitmap dimensions */ |
35 |
|
int xdim; /* size of horizontal scan (bytes) */ |
36 |
|
|
37 |
+ |
/* conflicting def's in param.h */ |
38 |
+ |
#undef tstbit |
39 |
+ |
#undef setbit |
40 |
+ |
#undef clrbit |
41 |
+ |
#undef tglbit |
42 |
+ |
|
43 |
|
#define bitop(x,y,op) (ourbitmap[(y)*xdim+((x)>>3)] op (1<<((x)&7))) |
44 |
|
#define tstbit(x,y) bitop(x,y,&) |
45 |
|
#define setbit(x,y) bitop(x,y,|=) |
48 |
|
|
49 |
|
FONT *ourfont; /* our font */ |
50 |
|
|
51 |
– |
char *libpath; /* library search path */ |
52 |
– |
|
51 |
|
typedef struct line { |
52 |
|
char *s; /* line w/o LF */ |
53 |
|
short *sp; /* character spacing */ |
64 |
|
char *argv[]; |
65 |
|
{ |
66 |
|
int an; |
67 |
< |
#ifdef MSDOS |
70 |
< |
setmode(fileno(stdout), O_BINARY); |
71 |
< |
#endif |
67 |
> |
SET_FILE_BINARY(stdout); |
68 |
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
69 |
|
switch (argv[an][1]) { |
70 |
|
case 'c': /* color */ |
122 |
|
exit(1); |
123 |
|
} |
124 |
|
/* load font file */ |
129 |
– |
if ((libpath = getenv(ULIBVAR)) == NULL) |
130 |
– |
libpath = DEFPATH; |
125 |
|
ourfont = getfont(fontfile); |
126 |
|
/* get text */ |
127 |
|
if (an == argc) |
134 |
|
/* convert text to bitmap */ |
135 |
|
maptext(); |
136 |
|
/* print header */ |
137 |
+ |
newheader("RADIANCE", stdout); |
138 |
|
printargs(argc, argv, stdout); |
139 |
|
fputformat(COLRFMT, stdout); |
140 |
|
putchar('\n'); |
223 |
|
if (curl == NULL) |
224 |
|
goto memerr; |
225 |
|
len = strlen(buf); |
226 |
< |
curl->s = malloc(len); |
226 |
> |
curl->s = (char *)malloc(len); |
227 |
|
curl->sp = (short *)malloc(sizeof(short)*len--); |
228 |
|
if (curl->s == NULL | curl->sp == NULL) |
229 |
|
goto memerr; |
260 |
|
ourtext = (LINE *)malloc(sizeof(LINE)); |
261 |
|
if (ourtext == NULL) |
262 |
|
goto memerr; |
263 |
< |
ourtext->s = malloc(MAXLINE); |
263 |
> |
ourtext->s = (char *)malloc(MAXLINE); |
264 |
|
if (ourtext->s == NULL) |
265 |
|
goto memerr; |
266 |
|
for (cp = ourtext->s; ac-- > 0; av++) { |
438 |
|
exit(1); |
439 |
|
} |
440 |
|
} |
441 |
< |
free((char *)scanout); |
441 |
> |
free((void *)scanout); |
442 |
|
} |