| 1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* text.c - functions for text patterns and mixtures. |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
+ |
#include "copyright.h" |
| 9 |
+ |
|
| 10 |
|
#include "ray.h" |
| 11 |
|
|
| 12 |
+ |
#include "paths.h" |
| 13 |
+ |
|
| 14 |
|
#include "otypes.h" |
| 15 |
|
|
| 16 |
|
#include "font.h" |
| 78 |
|
TLINE tl; /* line list */ |
| 79 |
|
} TEXT; |
| 80 |
|
|
| 80 |
– |
extern char *getlibpath(); |
| 81 |
– |
|
| 82 |
– |
extern char *fgetword(); |
| 83 |
– |
|
| 81 |
|
TEXT *gettext(); |
| 82 |
|
|
| 83 |
|
TLINE *tlalloc(); |
| 136 |
|
tlalloc(s) /* allocate and assign text line */ |
| 137 |
|
char *s; |
| 138 |
|
{ |
| 142 |
– |
extern char *strcpy(); |
| 139 |
|
register int siz; |
| 140 |
|
register TLINE *tl; |
| 141 |
|
|
| 155 |
|
{ |
| 156 |
|
#define R (tm->oargs.farg+3) |
| 157 |
|
#define D (tm->oargs.farg+6) |
| 162 |
– |
extern char *strcpy(); |
| 158 |
|
FVECT DxR; |
| 159 |
|
double d; |
| 160 |
|
FILE *fp; |
| 198 |
|
tlp = tlp->next; |
| 199 |
|
} else { /* text file */ |
| 200 |
|
if ((s = getpath(tm->oargs.sarg[tndx(tm)], |
| 201 |
< |
getlibpath(), R_OK)) == NULL) { |
| 201 |
> |
getrlibpath(), R_OK)) == NULL) { |
| 202 |
|
sprintf(errmsg, "cannot find text file \"%s\"", |
| 203 |
|
tm->oargs.sarg[tndx(tm)]); |
| 204 |
|
error(USER, errmsg); |
| 253 |
|
return; |
| 254 |
|
while ((tlp = tp->tl.next) != NULL) { |
| 255 |
|
tp->tl.next = tlp->next; |
| 256 |
< |
free((char *)tlp->spc); |
| 257 |
< |
free((char *)tlp); |
| 256 |
> |
free((void *)tlp->spc); |
| 257 |
> |
free((void *)tlp); |
| 258 |
|
} |
| 259 |
< |
free((char *)tp); |
| 259 |
> |
freefont(tp->f); /* release font reference */ |
| 260 |
> |
free((void *)tp); |
| 261 |
|
m->os = NULL; |
| 262 |
|
} |
| 263 |
|
|
| 327 |
|
/* positive x axis cross test */ |
| 328 |
|
while (n--) { |
| 329 |
|
if ((p0[1]<<1 > ylb) ^ (p1[1]<<1 > ylb)) { |
| 330 |
< |
tv = p0[0]<<1 > xlb | (p1[0]<<1 > xlb) << 1; |
| 330 |
> |
tv = (p0[0]<<1 > xlb) | ((p1[0]<<1 > xlb) << 1); |
| 331 |
|
if (tv == 03) |
| 332 |
|
ncross++; |
| 333 |
|
else if (tv) |