| 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" |
| 14 |
– |
|
| 11 |
|
#include "color.h" |
| 16 |
– |
|
| 12 |
|
#include "font.h" |
| 13 |
|
|
| 19 |
– |
#include "paths.h" |
| 20 |
– |
|
| 14 |
|
#ifndef SSS |
| 15 |
|
#define SSS 3 /* super-sample size */ |
| 16 |
|
#endif |
| 41 |
|
|
| 42 |
|
FONT *ourfont; /* our font */ |
| 43 |
|
|
| 51 |
– |
char *libpath; /* library search path */ |
| 52 |
– |
|
| 44 |
|
typedef struct line { |
| 45 |
|
char *s; /* line w/o LF */ |
| 46 |
|
short *sp; /* character spacing */ |
| 57 |
|
char *argv[]; |
| 58 |
|
{ |
| 59 |
|
int an; |
| 60 |
< |
#ifdef MSDOS |
| 70 |
< |
setmode(fileno(stdout), O_BINARY); |
| 71 |
< |
#endif |
| 60 |
> |
SET_FILE_BINARY(stdout); |
| 61 |
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
| 62 |
|
switch (argv[an][1]) { |
| 63 |
|
case 'c': /* color */ |
| 115 |
|
exit(1); |
| 116 |
|
} |
| 117 |
|
/* load font file */ |
| 129 |
– |
if ((libpath = getenv(ULIBVAR)) == NULL) |
| 130 |
– |
libpath = DEFPATH; |
| 118 |
|
ourfont = getfont(fontfile); |
| 119 |
|
/* get text */ |
| 120 |
|
if (an == argc) |
| 127 |
|
/* convert text to bitmap */ |
| 128 |
|
maptext(); |
| 129 |
|
/* print header */ |
| 130 |
+ |
newheader("RADIANCE", stdout); |
| 131 |
|
printargs(argc, argv, stdout); |
| 132 |
|
fputformat(COLRFMT, stdout); |
| 133 |
|
putchar('\n'); |
| 204 |
|
gettext(fp) /* get text from a file */ |
| 205 |
|
FILE *fp; |
| 206 |
|
{ |
| 219 |
– |
char *fgets(); |
| 207 |
|
char buf[MAXLINE]; |
| 208 |
|
register LINE *curl; |
| 209 |
|
int len; |
| 216 |
|
if (curl == NULL) |
| 217 |
|
goto memerr; |
| 218 |
|
len = strlen(buf); |
| 219 |
< |
curl->s = malloc(len); |
| 219 |
> |
curl->s = (char *)malloc(len); |
| 220 |
|
curl->sp = (short *)malloc(sizeof(short)*len--); |
| 221 |
|
if (curl->s == NULL | curl->sp == NULL) |
| 222 |
|
goto memerr; |
| 253 |
|
ourtext = (LINE *)malloc(sizeof(LINE)); |
| 254 |
|
if (ourtext == NULL) |
| 255 |
|
goto memerr; |
| 256 |
< |
ourtext->s = malloc(MAXLINE); |
| 256 |
> |
ourtext->s = (char *)malloc(MAXLINE); |
| 257 |
|
if (ourtext->s == NULL) |
| 258 |
|
goto memerr; |
| 259 |
|
for (cp = ourtext->s; ac-- > 0; av++) { |
| 431 |
|
exit(1); |
| 432 |
|
} |
| 433 |
|
} |
| 434 |
< |
free((char *)scanout); |
| 434 |
> |
free((void *)scanout); |
| 435 |
|
} |