1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
142 |
|
if ((tl=(TLINE *)malloc(sizeof(TLINE)+siz)) == NULL || |
143 |
|
(tl->spc=(short *)malloc(siz*sizeof(short))) == NULL) |
144 |
|
error(SYSTEM, "out of memory in tlalloc"); |
145 |
– |
tl->spc = NULL; |
145 |
|
tl->next = NULL; |
146 |
|
strcpy(TLSTR(tl), s); |
147 |
|
return(tl); |
170 |
|
if (tm->oargs.nsargs - tndx(tm) < 1 || tm->oargs.nfargs < sndx(tm)) |
171 |
|
objerror(tm, USER, "bad # arguments"); |
172 |
|
if ((t = (TEXT *)malloc(sizeof(TEXT))) == NULL) |
173 |
< |
goto memerr; |
173 |
> |
error(SYSTEM, "out of memory in gettext"); |
174 |
|
/* compute vectors */ |
175 |
|
fcross(DxR, D, R); |
176 |
|
fcross(t->right, DxR, D); |
222 |
|
i = d * 256.0; |
223 |
|
t->tl.width = 0; |
224 |
|
for (tlp = t->tl.next; tlp != NULL; tlp = tlp->next) { |
226 |
– |
if ((tlp->spc = (short *)malloc( |
227 |
– |
(strlen(TLSTR(tlp))+1)*sizeof(short))) == NULL) |
228 |
– |
goto memerr; |
225 |
|
if (i < 0) |
226 |
|
tlp->width = squeeztext(tlp->spc, TLSTR(tlp), t->f, -i); |
227 |
|
else if (i > 0) |
234 |
|
/* we're done */ |
235 |
|
tm->os = (char *)t; |
236 |
|
return(t); |
241 |
– |
memerr: |
242 |
– |
error(SYSTEM, "out of memory in gettext"); |
237 |
|
#undef R |
238 |
|
#undef D |
239 |
|
} |
248 |
|
tp = (TEXT *)m->os; |
249 |
|
if (tp == NULL) |
250 |
|
return; |
251 |
< |
for (tlp = tp->tl.next; tlp != NULL; tlp = tlp->next) { |
251 |
> |
while ((tlp = tp->tl.next) != NULL) { |
252 |
> |
tp->tl.next = tlp->next; |
253 |
|
free((char *)tlp->spc); |
254 |
|
free((char *)tlp); |
255 |
|
} |
262 |
|
FVECT p; |
263 |
|
OBJREC *m; |
264 |
|
{ |
270 |
– |
extern double fabs(); |
265 |
|
register TEXT *tp; |
266 |
|
register TLINE *tlp; |
267 |
|
FVECT v; |