7213709-C-Programming

Page 289

427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485

if ((pos = strcmp (BUFFER,p->name)) == 0) /* found word*/ { p->line = pushonheap(p->line); return (p); } if (pos < 0) { p->left = install(p->left); } else { p->right = install(p->right); }

/* Trace down list */

return (p); } /*********************************************************/ /* LEVEL 4 */ /*********************************************************/ struct heap *pushonheap (h)

/* push nxt ln no.to heap */

struct heap *h; { struct heap *hp,*newheap(); hp = newheap(); hp->num = LINECOUNT; hp->spec = SPECIALCHAR; hp->next = h; return (hp); } /*********************************************************/ /* TOOLKIT file input */ /*********************************************************/ backone (ch,fp)

/* backspace one in file */

char ch; FILE *fp; { if (ungetc(ch,fp) != ch) { printf ("\nDebug: Toolkit file input: backone() FAILED\n"); exit(0); } } /**********************************************************/ /* TOOLKIT stdin */ /**********************************************************/ char *filename ()


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.