| 1 |
< |
/* Copyright (c) 1994 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1995 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 138 |
|
mg_ehand[MG_E_CMIX] != NULL) |
| 139 |
|
uneed |= 1<<MG_E_COLOR; |
| 140 |
|
if (mg_ehand[MG_E_RD] != NULL || mg_ehand[MG_E_TD] != NULL || |
| 141 |
+ |
mg_ehand[MG_E_IR] != NULL || |
| 142 |
|
mg_ehand[MG_E_ED] != NULL || |
| 143 |
|
mg_ehand[MG_E_RS] != NULL || |
| 144 |
|
mg_ehand[MG_E_TS] != NULL || |
| 219 |
|
char *fn; |
| 220 |
|
{ |
| 221 |
|
static int nfids; |
| 221 |
– |
int olen; |
| 222 |
|
register char *cp; |
| 223 |
|
|
| 224 |
|
ctx->fid = ++nfids; |
| 231 |
|
return(MG_OK); |
| 232 |
|
} |
| 233 |
|
/* get name relative to this context */ |
| 234 |
< |
if (mg_file != NULL && |
| 235 |
< |
(cp = strrchr(mg_file->fname, '/')) != NULL) |
| 236 |
< |
olen = cp - mg_file->fname + 1; |
| 237 |
< |
else |
| 238 |
< |
olen = 0; |
| 239 |
< |
if (olen) |
| 234 |
> |
if (mg_file != NULL && (cp = strrchr(mg_file->fname, '/')) != NULL) { |
| 235 |
|
strcpy(ctx->fname, mg_file->fname); |
| 236 |
< |
strcpy(ctx->fname+olen, fn); |
| 236 |
> |
strcpy(ctx->fname+(cp-mg_file->fname+1), fn); |
| 237 |
> |
} else |
| 238 |
> |
strcpy(ctx->fname, fn); |
| 239 |
|
ctx->fp = fopen(ctx->fname, "r"); |
| 240 |
|
if (ctx->fp == NULL) |
| 241 |
|
return(MG_ENOFILE); |
| 386 |
|
{ |
| 387 |
|
char *xfarg[MG_MAXARGC]; |
| 388 |
|
MG_FCTXT ictx; |
| 389 |
+ |
XF_SPEC *xf_orig = xf_context; |
| 390 |
|
int rv; |
| 391 |
|
|
| 392 |
|
if (ac < 2) |
| 403 |
|
if ((rv = mg_handle(MG_E_XF, ac-1, xfarg)) != MG_OK) |
| 404 |
|
return(rv); |
| 405 |
|
} |
| 406 |
< |
while (!feof(mg_file->fp)) { |
| 406 |
> |
do { |
| 407 |
|
while (mg_read()) |
| 408 |
|
if ((rv = mg_parse()) != MG_OK) { |
| 409 |
|
fprintf(stderr, "%s: %d: %s:\n%s", ictx.fname, |
| 415 |
|
if (ac > 2) |
| 416 |
|
if ((rv = mg_handle(MG_E_XF, 1, xfarg)) != MG_OK) |
| 417 |
|
return(rv); |
| 418 |
< |
} |
| 418 |
> |
} while (xf_context != xf_orig); |
| 419 |
|
mg_close(); |
| 420 |
|
return(MG_OK); |
| 421 |
|
} |