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 |
42 |
|
|
43 |
|
FONT *ourfont; /* our font */ |
44 |
|
|
51 |
– |
char *libpath; /* library search path */ |
52 |
– |
|
45 |
|
typedef struct line { |
46 |
|
char *s; /* line w/o LF */ |
47 |
|
short *sp; /* character spacing */ |
58 |
|
char *argv[]; |
59 |
|
{ |
60 |
|
int an; |
61 |
< |
#ifdef MSDOS |
70 |
< |
setmode(fileno(stdout), O_BINARY); |
71 |
< |
#endif |
61 |
> |
SET_FILE_BINARY(stdout); |
62 |
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
63 |
|
switch (argv[an][1]) { |
64 |
|
case 'c': /* color */ |
116 |
|
exit(1); |
117 |
|
} |
118 |
|
/* load font file */ |
129 |
– |
if ((libpath = getenv(ULIBVAR)) == NULL) |
130 |
– |
libpath = DEFPATH; |
119 |
|
ourfont = getfont(fontfile); |
120 |
|
/* get text */ |
121 |
|
if (an == argc) |
128 |
|
/* convert text to bitmap */ |
129 |
|
maptext(); |
130 |
|
/* print header */ |
131 |
+ |
newheader("RADIANCE", stdout); |
132 |
|
printargs(argc, argv, stdout); |
133 |
|
fputformat(COLRFMT, stdout); |
134 |
|
putchar('\n'); |
217 |
|
if (curl == NULL) |
218 |
|
goto memerr; |
219 |
|
len = strlen(buf); |
220 |
< |
curl->s = malloc(len); |
220 |
> |
curl->s = (char *)malloc(len); |
221 |
|
curl->sp = (short *)malloc(sizeof(short)*len--); |
222 |
|
if (curl->s == NULL | curl->sp == NULL) |
223 |
|
goto memerr; |
254 |
|
ourtext = (LINE *)malloc(sizeof(LINE)); |
255 |
|
if (ourtext == NULL) |
256 |
|
goto memerr; |
257 |
< |
ourtext->s = malloc(MAXLINE); |
257 |
> |
ourtext->s = (char *)malloc(MAXLINE); |
258 |
|
if (ourtext->s == NULL) |
259 |
|
goto memerr; |
260 |
|
for (cp = ourtext->s; ac-- > 0; av++) { |
432 |
|
exit(1); |
433 |
|
} |
434 |
|
} |
435 |
< |
free((char *)scanout); |
435 |
> |
free((void *)scanout); |
436 |
|
} |