1 /* @(#)long2.c 1.4 10/10/84 2 * 3 * Copyright -C- 1982 Barry S. Roitblat 4 * 5 * 6 * This file contains routines to implement the long text commands 7 * of the gremlin PICTURE editor. 8 * 9 */ 10 11 #include "gremlin.h" 12 #include "grem2.h" 13 #include <ctype.h> 14 15 /* imports from graphics files */ 16 17 extern GRVector(), GRArc(), GRPutText(), GRClose(); 18 extern GRDisplayPoint(), GRDeletePoint(), GRBlankPoints(); 19 extern charxsize, charysize, GrXMax, GrYMax; 20 21 /* import from path.c */ 22 23 extern int PSetPath(), PConvertTilde(); 24 extern char *PGetPath(); 25 26 /* imports from display.c */ 27 28 extern DISScreenAdd(), DISScreenErase(); 29 extern DISDisplaySet(), DISEraseSet(), DISClearSetDisplay(); 30 31 /* imports from database files */ 32 33 extern ELT *DBInit(), *DBCreateElt(), *DBRead(); 34 extern DBDelete(), DBGravitate(), DBClearElt(); 35 extern ELT *DBCopy(); 36 extern DBXform(), DBChangeBrush(); 37 extern DBAddSet(), DBClearSet(); 38 extern POINT *PTInit(), *PTMakePoint(); 39 extern PTDeletePoint(); 40 41 /* imports from undodb.c */ 42 43 extern UNELT *unlist, *unback; 44 extern UNForget(); 45 46 /* imports from short.c */ 47 48 extern SHUpdate(); 49 extern int adj[]; 50 51 /* imports from textio.c */ 52 53 extern TxPutString(), TxPutMsg(), TxMsgOK(), TxClose(); 54 extern TXFIELD TAlign, TAdjust, TBrush, TFont, TGravity, TCSize; 55 extern TEdit, TJustmode; 56 57 /* imports from menu.c */ 58 59 extern MNHighLt(), MNUnHighLt(); 60 extern HiMen[], HiFont[], HiBrush[], HiMode[]; 61 62 /* imports from c */ 63 64 extern char *malloc(); 65 extern char *strcpy(), *sprintf(); 66 67 /* imports from main.c */ 68 69 extern ELT *PICTURE; /* current PICTURE database */ 70 extern ELT *cset; /* current set database */ 71 extern CBRUSH, CSIZE, CFONT; /* current brush, size, font */ 72 extern CJUST; /* current text justification */ 73 extern Gridon; /* grid mode flag */ 74 extern Orientation; /* orientation of workspace */ 75 extern SEARCH; /* flag for path search */ 76 extern Alignment; /* point alignment indicator */ 77 extern float PX, PY; /* cursor coordinates */ 78 extern float Lastx, Lasty; /* previous cursor coordinates */ 79 extern SEQ; /* point sequence number */ 80 extern POINT *POINTLIST, *BACKPOINT;/* accumulated point list */ 81 extern Gridsize; /* grid spacing */ 82 extern Adjustment; /* point adjustment mode */ 83 extern GravityOn; /* gravity mode flag */ 84 extern Consume; /* point clear flag */ 85 extern CHANGED; /* PICTURE changed flag */ 86 extern ELT *MEN[]; /* pointers for user symbols */ 87 extern POINT MENPOINT[]; /* pointers used fo user symbols */ 88 extern cmdbuf[]; /* line buffer for commands */ 89 extern char *textpos[], *dispmode[];/* text positioning modes */ 90 extern int textmode[]; /* text positioning */ 91 extern char *lines[], *fonts[]; /* line and character styles */ 92 extern int jmodes, lnum[], fnum[]; 93 94 /* imports from long1.c */ 95 extern bang; 96 extern GetNumParm(); 97 extern LGLookup(); 98 extern SetOrient(); 99 100 char *Editfile; 101 102 #define BADNUM -1 103 #define NONUM -2 104 #define Delimiter(c) ((c == '\0') || (c == ' ') || (c == ',')) 105 106 static char badarg[10] = "bad args"; 107 108 109 LGFont(line) 110 char *line; 111 /* 112 * This routine looks at the command line for parameters to set 113 * the current Font. 114 */ 115 116 { 117 int new, index; 118 char string[2]; 119 120 Consume = FALSE; 121 index = 0; 122 if (isalpha(*(++line))) 123 { 124 new = LGLookup(line, fonts, &index); 125 if ( new >= 0) new = fnum[new]; 126 else new = BADNUM; 127 } 128 else new = GetNumParm(line, &index); 129 if ( (new == BADNUM) || (new > NFONTS) ) 130 { 131 error(badarg); 132 return; 133 } 134 if (new != NONUM) 135 { 136 MNUnHighLt(HiFont[CFONT-1]); 137 MNHighLt(HiFont[new-1], hicolor); 138 CFONT = new; 139 (void) sprintf(string, "%1d",new); 140 TxPutString(&TFont,string); 141 } 142 } /* end LGFont */ 143 144 145 LGJust(line) 146 char *line; 147 /* 148 * This routine looks at the command line for parameters to set 149 * the current text justification mode. 150 */ 151 152 { 153 int new, index; 154 155 Consume = FALSE; 156 index = 0; 157 if (isalpha(*(++line))) 158 { 159 /* make sure mode is in lower case, and look up in table */ 160 if (isupper(*line)) 161 { 162 *line = tolower(*line); 163 *(line+1) = tolower(*(line+1)); 164 } 165 for (new = 0; (strcmp(line, textpos[new]) != 0); ++new) 166 if (new > jmodes) 167 { 168 error("no such mode"); 169 return; 170 } 171 if ( new < 0) new = BADNUM; 172 } 173 else new = GetNumParm(line, &index) - 1; 174 if ( (new <= BADNUM) || (new > jmodes) ) 175 { 176 error(badarg); 177 return; 178 } 179 if (new != NONUM) 180 { 181 new = textmode[new]; 182 CJUST = new; 183 TxPutString(&TJustmode,dispmode[new]); 184 } 185 } /* end LGJust */ 186 187 188 LGSize(line) 189 char *line; 190 /* 191 * This routine changes the current character size. 192 */ 193 194 { 195 int new, index; 196 char string[2]; 197 198 index = 1; 199 new = GetNumParm(line, &index); 200 if ( (new == BADNUM) || (new > NSIZES) ) 201 { 202 error(badarg); 203 return; 204 } 205 if (new != NONUM) 206 { 207 CSIZE = new; 208 (void) sprintf(string, "%1d",new); 209 TxPutString(&TCSize,string); 210 } 211 Consume = FALSE; 212 } /* end LGSize */ 213 214 LGAlign(line) 215 char *line; 216 /* 217 * This routine sets the point alignment indicator 218 */ 219 220 { 221 int newalign, index; 222 char string[4]; 223 224 index = 1; 225 newalign = GetNumParm(line, &index); 226 if (newalign == NONUM) 227 if (Alignment == 1) Alignment = Gridsize; 228 else Alignment = 1; 229 else 230 { 231 if ((newalign < 1) || (newalign > GrYMax/2) ) 232 { 233 error(badarg); 234 return; 235 } 236 Alignment = newalign; 237 } 238 (void) sprintf(string, "%3d",Alignment); 239 TxPutString(&TAlign,string); 240 Consume = FALSE; 241 } /* end LGAlign */ 242 243 244 LGIncludeSet(line) 245 char *line; 246 /* 247 * This routine adds all elements selected by points in POINTLIST 248 * to the current set. It does not remove previously selected elements. 249 * 250 */ 251 252 { 253 POINT *p1, *p2; 254 ELT *e1; 255 float n1, n2; 256 257 if (DBNullelt(PICTURE)) return; 258 if (SEQ == 0) /* no points: entire picture becomes */ 259 { /* current set */ 260 e1 = PICTURE; 261 while ( !DBNullelt(e1) ) 262 { 263 DBAddSet(e1); 264 DISDisplaySet(e1); 265 e1 = DBNextElt(e1); 266 } 267 } /* end if */ 268 else 269 { 270 p1 = POINTLIST; 271 while ( !Nullpoint(p1) ) 272 { 273 DBGravitate(p1->x, p1->y, &n1, &n2, &p2, &e1, PICTURE); 274 if ( !DBNullelt(e1) ) 275 { 276 DBAddSet(e1); 277 DISDisplaySet(e1); 278 } 279 p1 = PTNextPoint(p1); 280 } /* end while */; 281 } /* end else */ 282 } /* end LGIncludeSet */ 283 284 285 286 LGMenu(line) 287 char *line; 288 /* 289 * This routine implements the menu command. The contents of 290 * the specified user menu item is copied into the PICTURE transformed 291 * to the positioning point. 292 */ 293 294 { 295 296 ELT *elist, *e1; 297 POINT *plist; 298 int symbol, index; 299 float xmat[3][2]; 300 301 if (SEQ < 1) 302 { 303 error("no positioning point"); 304 return; 305 } 306 index = 1; 307 symbol = GetNumParm(line, &index); 308 if ( (symbol <= 0) || (symbol > NUSER) ) 309 { 310 error(badarg); 311 return; 312 } 313 symbol--; /* users inputs number between 1 and N, actual 314 symbol number is between 0 and N-1 */ 315 xmat[0][0] = xmat[1][1] = 1; /* create transformation matrix */ 316 xmat[0][1] = xmat[1][0] = 0; /* for copy into PICTURE */ 317 plist = POINTLIST; 318 while ( !Nullpoint(plist) ) 319 { 320 DISClearSetDisplay(); /* Clear old current set */ 321 DBClearSet(); 322 xmat[2][0] = plist->x - (MENPOINT[symbol]).x; 323 xmat[2][1] = plist->y - (MENPOINT[symbol]).y; 324 elist = MEN[symbol]; 325 while ( !DBNullelt(elist) ) /* copy buffer to picture */ 326 { 327 e1 = DBCopy(elist, xmat, &PICTURE); 328 DBAddSet(e1); 329 DISScreenAdd(e1, (linemask | setmask)); 330 elist = DBNextElt(elist); 331 } /* end while */ 332 plist = PTNextPoint(plist); 333 } /* end while */ 334 CHANGED = TRUE; 335 } /* end LGMenu */ 336 337 338 LGRead(line) 339 char *line; 340 /* 341 * This routine reads in the specified filename (command line) to the 342 * selected user symbol or current set if no user symbol is selected. If 343 * no filename is specified, the current set is copied to the user symbol; 344 */ 345 346 { 347 POINT pos, ppos; 348 ELT *elist, *e1; 349 char tname[50], filename[100]; 350 float xmat[3][2]; 351 int i, orient; 352 353 if ( *line == '\0' ) /* no arguments */ 354 { 355 error(badarg); 356 return; 357 } 358 ++line; 359 (void) sscanf(line, "%s", tname); 360 elist = DBRead(tname, &orient, &pos); /* read file */ 361 UNForget(); /* forget changes registered by DBRead */ 362 if (SEQ < 1) /* no positioning point */ 363 { 364 ppos.x = pos.x; 365 ppos.y = pos.y; 366 } 367 else 368 { 369 ppos.x = POINTLIST->x; 370 ppos.y = POINTLIST->y; 371 } 372 xmat[0][0] = xmat[1][1] = 1; /* set up matrix to copy to */ 373 xmat[0][1] = xmat[1][0] = 0; /* appropriate place in */ 374 xmat[2][0] = ppos.x - pos.x; /* picture as current set */ 375 xmat[2][1] = ppos.y - pos.y; 376 DBClearSet(); 377 DISClearSetDisplay(); 378 while ( !DBNullelt(elist) ) 379 { 380 e1 = DBCopy(elist, xmat, &PICTURE); 381 DISScreenAdd(e1, (linemask | setmask)); 382 DBAddSet(e1); 383 e1 = DBNextElt(elist); 384 DBClearElt(elist); 385 elist = e1; 386 } 387 CHANGED = TRUE; 388 } /* end LGRead */ 389 390 391 LGEdit(line) 392 char *line; 393 /* 394 * This routine reads in a new PICTURE for editing 395 */ 396 397 { 398 FILE *fp, *POpen(); 399 POINT pos; 400 ELT *e1; 401 char *tn, tname[50]; 402 int i; 403 404 if (!bang) /* no ! */ 405 { 406 if (CHANGED) 407 { 408 error("no write"); 409 return; 410 } 411 } /* end if !bang */; 412 DBClearSet(); 413 while ( !DBNullelt(PICTURE) ) /* clear current PICTURE */ 414 { 415 e1 = DBNextElt(PICTURE); 416 DBClearElt(PICTURE); 417 PICTURE = e1; 418 }; 419 ++line; 420 tn = tname; 421 (void) sscanf(line, "%s", tname); 422 423 POINTLIST = PTInit(); /* Initialize globals */ 424 SEQ = 0; 425 CHANGED = FALSE; 426 427 i = strlen(tname); 428 if (i > 0) /* filename present */ 429 { 430 fp = POpen(tname, (char **) NULL, SEARCH); 431 TxPutString(&TEdit, tname); 432 if (fp == NULL) 433 { 434 PICTURE = DBInit(); 435 error(" (creating new file)"); 436 } 437 else 438 { 439 fclose(fp); /* bug fix 10/10/84 mro */ 440 PICTURE = DBRead(tname, &Orientation, &pos); 441 SetOrient(Orientation); /* Set appropriate picture area 442 * orientation */ 443 } 444 (void) strcpy (Editfile, tname); 445 } 446 else 447 { 448 TxPutString(&TEdit, ""); 449 (void) strcpy(Editfile, ""); 450 } 451 unlist = unback = nullun; 452 CP(); 453 SHUpdate(); /* display new picture */ 454 } /* end LGEdit */ 455 456 static restorepoints() 457 458 /* This routine (re) displays the points in the back-up pointlist 459 */ 460 { 461 462 int i; 463 POINT *plist, *pl1, *pl2; 464 465 GRBlankPoints(); 466 plist = BACKPOINT; 467 for (i=0; !Nullpoint(plist); ++i) 468 { 469 Lastx = plist->x; 470 Lasty = plist->y; 471 GRDisplayPoint( (int) plist->x, (int) plist->y, i, pointstyle ); 472 plist = PTNextPoint(plist); 473 } 474 pl1 = POINTLIST; 475 POINTLIST = BACKPOINT; 476 SEQ = i; 477 BACKPOINT = pl1; 478 } /* end restorepoints */ 479 480 481 LGUndo(line) 482 char *line; 483 /* 484 * This routine uses the information in the undo database to reconstruct 485 * the PICTURE as it was before the last command. The undo database is set 486 * so that the next undo would nullify this one. 487 * An undo of an Add is to delete the new element. 488 * Add the old element back to undo a delete. 489 * Modified elements are undone by copying the old element into the database 490 * in place of the modified element. 491 */ 492 493 { 494 UNELT *fix, *temp; 495 ELT *(*e1); 496 497 fix = unlist; /* initialize unlist so that undo-ing can */ 498 unlist = nullun; /* add items to properly undo the undo */ 499 if (fix == nullun) 500 { 501 fix = unback; 502 unback = nullun; 503 } 504 DBClearSet(); 505 DISClearSetDisplay(); 506 GRBlankPoints(); 507 while (fix != nullun) 508 { 509 switch (fix->action) 510 { 511 case ADD: DISScreenErase(fix->newelt, linemask); 512 TxMsgOK(); 513 restorepoints(); 514 DBDelete(fix->newelt, fix->dbase); 515 temp = fix->nextun; 516 free((char *) fix); 517 fix = temp; 518 break; 519 520 case DELETE: fix->action = ADD; /* create undo unelt */ 521 fix->newelt = fix->oldelt; 522 fix->oldelt = NULL; 523 fix->newelt->nextelt = PICTURE; 524 restorepoints(); 525 DBAddSet(fix->newelt); 526 DISScreenAdd(fix->newelt,(linemask|setmask)); 527 PICTURE = fix->newelt; /* put in database */ 528 temp = fix->nextun; 529 fix->nextun = unlist; /* link into unlist */ 530 unlist = fix; 531 fix = temp; 532 break; 533 534 case MOD: DISScreenErase(fix->newelt, linemask); 535 TxMsgOK(); 536 restorepoints(); 537 DISScreenAdd(fix->oldelt, (setmask | linemask)); 538 DBAddSet(fix->oldelt); 539 e1 = fix->dbase; 540 while ( *e1 != fix->newelt ) 541 { /* find elt to replace */ 542 e1 = &(DBNextElt((*e1))); 543 } 544 fix->oldelt->nextelt = DBNextElt((*e1)); 545 *e1 = fix->oldelt; 546 fix->oldelt = fix->newelt; 547 fix->newelt = *e1; /* create undo unelt */ 548 temp = fix->nextun; 549 fix->nextun = unlist; 550 unlist = fix; /* link into unlist */ 551 fix = temp; 552 break; 553 554 } /* end switch */; 555 } /* end while */ 556 Consume = FALSE; 557 } /* LGUndo */ 558 559 560 LGWrite(line) 561 char *line; 562 /* 563 * This routine writes the current PICTURE into the specified filename 564 * or to the current Editfile 565 */ 566 567 { 568 FILE *fp, *fopen(); 569 char tname[50], filename[100], string[100], *tn, *fn, *wfile; 570 ELT *elist; 571 POINT *plist, pos; 572 int i, space, stat; 573 574 space = 100; 575 ++line; 576 tn = tname; fn = filename; 577 (void) sscanf(line, "%s", tname); 578 i = strlen(tname); 579 if (i == 0) /* no filename */ 580 { 581 if ( *Editfile == '\0' ) 582 { 583 error("write to where?"); 584 return; 585 } 586 fp = fopen(Editfile, "w"); 587 wfile = Editfile; 588 } 589 else 590 { 591 stat = PConvertTilde(&tn, &fn, &space); 592 *fn = '\0'; 593 if (stat == FALSE) 594 { 595 sprintf(string, "unknown path %s", tname); 596 error(string); 597 return; 598 } 599 if ( !bang ) /* user doesn't insist */ 600 { 601 fp = fopen(filename, "r"); 602 if ( fp != NULL ) 603 { 604 error("file already exists"); 605 return; 606 } 607 } 608 fp = fopen(filename, "w"); 609 wfile = filename; 610 }; 611 if (fp == NULL) /* file error */ 612 { 613 (void) sprintf(string,"can't open %s", wfile); 614 error(string); 615 return; 616 }; 617 TxPutMsg("writing file..."); 618 CHANGED = FALSE; 619 if (SEQ > 0) /* specified a positioning point */ 620 { 621 pos.x = POINTLIST->x; 622 pos.y = POINTLIST->y; 623 } 624 else 625 { 626 if ( !DBNullelt(PICTURE) ) 627 { 628 pos.x = PICTURE->ptlist->x; 629 pos.y = PICTURE->ptlist->y; 630 } 631 else 632 { 633 pos.x = pos.y = 0; 634 }; 635 } 636 fprintf(fp,"gremlinfile\n"); /* write header */ 637 fprintf(fp, "%d %1.2f %1.2f\n", Orientation, pos.x, pos.y); 638 elist = PICTURE; 639 while ( !DBNullelt(elist) ) /* write each element */ 640 { 641 fprintf(fp, "%d\n", elist->type); 642 plist = elist->ptlist; 643 while ( !Nullpoint(plist) ) /* write each point */ 644 { 645 fprintf(fp, "%1.2f %1.2f\n",plist->x, plist->y); 646 plist = PTNextPoint(plist); 647 } /* end while plist */ 648 fprintf(fp, "%1.2f %1.2f\n", -1.0, -1.0); /* end pointlist */ 649 fprintf(fp, "%d %d\n",elist->brushf, elist->size); 650 fprintf(fp,"%d %s\n ", strlen(elist->textpt), elist->textpt); 651 elist = DBNextElt(elist); 652 } /* end while */ 653 fprintf(fp,"%d\n",-1); /* end of element list */ 654 TxMsgOK(); 655 (void) fclose(fp); 656 } /* end LGWrite */; 657 658 659 LGQuit(line) 660 char *line; 661 /* 662 * This routine terminates the editor. The terminal states for the text 663 * terminal and the graphics display are restored and an EXIT is performed. 664 */ 665 666 { 667 if (!bang) 668 { 669 if (CHANGED) 670 { 671 error("no write"); 672 return; 673 } 674 } /* end if */; 675 GRClose(); 676 TxClose(); 677 exit(0); 678 } /* end LGQuit */ 679 680 LGHAdjust() 681 /* 682 * Horizontal adjust - 683 * This routine toggles the adjustment mode. 684 */ 685 686 { 687 if (Adjustment == HORZ) 688 { 689 MNUnHighLt(HiMode[adj[HORZ]]); 690 Adjustment = NOADJ; 691 TxPutString(&TAdjust, "NO ADJUSTMENT"); 692 } 693 else 694 { 695 MNUnHighLt(HiMode[adj[Adjustment]]); 696 MNHighLt(HiMode[adj[HORZ]], hicolor); 697 Adjustment = HORZ; 698 TxPutString(&TAdjust, " HORIZONTAL "); 699 } 700 Consume = FALSE; 701 } 702 703 704 LGVAdjust() 705 /* 706 * Vertical adjust - 707 * This routine toggles the adjustment mode. 708 */ 709 710 { 711 if (Adjustment == VERT) 712 { 713 MNUnHighLt(HiMode[adj[VERT]]); 714 Adjustment = NOADJ; 715 TxPutString(&TAdjust, "NO ADJUSTMENT"); 716 } 717 else 718 { 719 MNUnHighLt(HiMode[adj[Adjustment]]); 720 MNHighLt(HiMode[adj[VERT]], hicolor); 721 Adjustment = VERT; 722 TxPutString(&TAdjust, " VERTICAL "); 723 } 724 Consume = FALSE; 725 } 726 727 728 729 static sign(x) 730 float x; 731 /* 732 * This local routine returns 1 if x >= 0 733 * otherwise returns 0; 734 */ 735 736 { 737 if (x >= 0) return(1); 738 else return(0); 739 } 740 741 LGMirror(line) 742 char *line; 743 /* 744 * This routine mirrors the elements in the current set as defined 745 * by points. The mirroring is accomplished by defining a transformation 746 * matrix and calling DBXform. 747 */ 748 749 { 750 ELT *e1; 751 POINT pt, pos, *p1, *p2; 752 float xmat[3][2], scalex, scaley; 753 int i, j; 754 755 if (SEQ < 3) /* not enough points */ 756 { 757 error("not enough points"); 758 return; 759 } 760 if (DBNullelt(cset)) 761 { 762 error("no current set"); 763 return; 764 } 765 p1 = PTNextPoint(POINTLIST); 766 p2 = PTNextPoint(p1); 767 scalex = scaley = 1; 768 if (sign(p1->x - POINTLIST->x) != sign(p2->x - POINTLIST->x)) 769 scalex = -scalex; 770 if (sign(p1->y - POINTLIST->y) != sign(p2->y - POINTLIST->y)) 771 scaley = -scaley; 772 773 /* create transformation matrix to translate set to origin, 774 performing the mirroring and translating back */ 775 776 xmat[0][0] = scalex; 777 xmat[1][1] = scaley; 778 xmat[1][0] = xmat[0][1] = 0; 779 xmat[2][0] = - POINTLIST->x * (scalex - 1.0); 780 xmat[2][1] = - POINTLIST->y * (scaley - 1.0); 781 e1 = cset; 782 while ( !DBNullelt(e1) ) 783 { 784 DISScreenErase(e1, (linemask | setmask)); 785 TxMsgOK(); 786 DBXform(e1, xmat, &PICTURE); 787 if (TEXT(e1->type)) 788 { 789 GRsetwmask(textmask | setmask); 790 p1 = e1->ptlist; 791 GRPutText(e1->type, p1, e1->brushf, e1->size,e1->textpt, &pos); 792 i= strlen(e1->textpt); 793 p2 = PTInit(); 794 (void) PTMakePoint(p1->x, p1->y, &p2); 795 /* add extra positioning points */ 796 (void) PTMakePoint(pos.x, pos.y, &p2); 797 (void) PTMakePoint(pos.x + i * charxsize / 2, pos.y, &p2); 798 (void) PTMakePoint(pos.x + i * charxsize, pos.y, &p2); 799 e1->ptlist = p2; 800 } /* end if TEXT */ 801 else 802 { 803 if (e1->type == ARC) /* arcs require special handling */ 804 if (e1->size > 0) /* circles are OK */ 805 if (scalex * scaley < 0) /* both directions OK */ 806 { /* swap starting and ending points of arc */ 807 p1 = PTNextPoint(e1->ptlist); 808 p2 = PTNextPoint(p1); 809 pt.x = p1->x; 810 pt.y = p1->y; 811 p1->x = p2->x; 812 p1->y = p2->y; 813 p2->x = pt.x; 814 p2->y = pt.y; 815 } 816 DISScreenAdd(e1, (linemask | setmask)); 817 } /* end else */ 818 e1 = DBNextofSet(e1); 819 } /* end while */ 820 CHANGED = TRUE; 821 } /* end LGMirror */ 822 823 824 LGPath(line) 825 char *line; 826 /* 827 * This routine looks at the command line for parameters to set 828 * the current search path. 829 */ 830 831 { 832 char path[100]; 833 834 if ( *line == '\0' ) TxPutMsg(PGetPath()); /* no arguments */ 835 else 836 { 837 SEARCH = TRUE; 838 (void) sscanf(line, "%s", path); 839 PSetPath(path); 840 } 841 Consume = FALSE; 842 } /* end LGFont */ 843