# 2.11BSD#431 - /usr/src/ucb/pascal/pi/px_header.c

##### Functions

    error             X
    exit              X
    main              X

##### Macros

    ADDR_LC           X
    ETXTBSY           X
    HEADER_BYTES      X

##### struct's

    header            X

       1: static  char    sccsid[] = "@(#)px_header.c	2.2";   /*	SCCS id keyword	*/
       2: /* Copyright (c) 1979 Regents of the University of California */
       3:
       4: extern  errno;
       5:
       6: #define ETXTBSY 26
       7:
       8: struct header
       9:     {
      10:     int     magic;
      11:     unsigned    txt_size;
      12:     unsigned    data_size;
      13:     unsigned    bss_size;
      14:     unsigned    syms_size;
      15:     unsigned    entry_point;
      16:     unsigned    tr_size;
      17:     unsigned    dr_size;
      18:     };
      19:
      20: #define HEADER_BYTES    1024
      21: #define ADDR_LC     (HEADER_BYTES-sizeof (struct header))  - sizeof (short)
      22:
      23: main(argc, argv)
      24:     register int argc;
      25:     register char *argv[];
      26: {
      27:     register int i, j;
      28:     register short *ip;
      29:     int largv[512], pv[2];
      30:
      31:     if (argc > 510) {
      32:         error("Too many arguments.\n");
      33:         exit(1);
      34:     }
      35:     largv[0] = argv[0];
      36:     largv[1] = "-";
      37:     for (i = 1; i < argc; i++)
      38:         largv[i + 1] = argv[i];
      39:     largv[argc + 1] = 0;
      40:     pipe(pv);
      41:     i = fork();
      42:     if (i == -1)
      43:         error("Try again.\n");
      44:     if (i == 0) {
      45:         close(pv[0]);
      46:         write(pv[1], ADDR_LC, sizeof ( short ));
      47:         ip = ADDR_LC;
      48:         i = *ip++;
      49:         while (i != 0) {
      50:             j = (i > 0 && i < 512) ? i : 512;
      51:             write(pv[1], ip, j);
      52:             ip += 512 / sizeof ( short );
      53:             i -= j;
      54:         }
      55:         exit(1);
      56:     }
      57:     close(pv[1]);
      58:     if (pv[0] != 3) {
      59:         close(3);
      60:         dup(pv[0]);
      61:         close(pv[0]);
      62:     }
      63:     execv("/usr/ucb/px", largv);
      64:     error("Px not found.\n");
      65: }
      66:
      67: error(cp)
      68:     register char *cp;
      69: {
      70:     register int i;
      71:     register char *dp;
      72:
      73:     dp = cp;
      74:     i = 0;
      75:     while (*dp++)
      76:         i++;
      77:     write(2, cp, i);
      78:     exit(1);
      79: }
      80:
      81: exit(i)
      82: {
      83:     _exit(i);
      84: }

#### Defined functions

error defined in line 67; used 197 times

- in line 32, 43, 64
- in /usr/src/ucb/pascal/pi/ato.c line 27, 33
- in /usr/src/ucb/pascal/pi/call.c line 45, 55, 62, 88
- in /usr/src/ucb/pascal/pi/case.c line 55, 90, 113, 132
- in /usr/src/ucb/pascal/pi/clas.c line 205-207(2)
- in /usr/src/ucb/pascal/pi/const.c line 25-27(2)
- in /usr/src/ucb/pascal/pi/conv.c line 89
- in /usr/src/ucb/pascal/pi/cset.c line 64-68(2), 79, 96
- in /usr/src/ucb/pascal/pi/fdec.c line 60, 76, 83-86(2), 103, 121, 149, 161-163(2), 174, 247, 346-350(2), 356, 370, 385, 533
- in /usr/src/ucb/pascal/pi/func.c line 45, 70, 81, 97, 107, 130, 142, 151, 166, 178, 195-202(3), 209, 216, 223, 232, 239, 245
- in /usr/src/ucb/pascal/pi/lab.c line 35-37(2), 90, 110-114(2), 122
- in /usr/src/ucb/pascal/pi/lval.c line 42, 89, 97, 115, 144-153(4), 175, 182, 252, 286
- in /usr/src/ucb/pascal/pi/nl.c line 625-630(2), 692, 701
- in /usr/src/ucb/pascal/pi/proc.c line 83, 114, 120, 129, 136, 219, 245, 255, 266-270(2), 309, 318, 327, 334, 354-361(3), 425, 437, 462, 482-486(2), 492, 499, 509-514(2), 520, 534, 541, 550, 557, 566-575(3), 589, 601, 608, 616, 625, 632, 641, 649, 656, 666, 673, 681, 688, 696, 704, 711, 720, 730, 747-752(2), 758, 766, 780, 791
- in /usr/src/ucb/pascal/pi/rec.c line 159, 226
- in /usr/src/ucb/pascal/pi/rval.c line 126, 144, 200, 206-210(2), 230, 244, 257-261(2), 273-277(2), 307, 320-327(3), 337-341(2), 427, 435, 445-448(2), 463, 472, 509, 556
- in /usr/src/ucb/pascal/pi/stat.c line 60, 185, 326, 334, 434, 487, 522, 540, 549
- in /usr/src/ucb/pascal/pi/type.c line 23-25(2), 94, 128, 139, 146, 153, 212, 218, 224, 239, 245, 279, 286, 293, 322
- in /usr/src/ucb/pascal/pi/var.c line 28
- in /usr/src/ucb/pascal/pi/yyerror.c line 105
- in /usr/src/ucb/pascal/pi/yyget.c line 147, 203, 209, 225, 235

exit defined in line 81; used 6 times

- in line 33, 55, 78
- in /usr/src/ucb/pascal/pi/main.c line 220
- in /usr/src/ucb/pascal/pi/pix.c line 43, 97

main defined in line 23; never used

#### Defined variables

sccsid defined in line 1; never used

#### Defined struct's

header defined in line 8; never used

#### Defined macros

ADDR_LC defined in line 21; used 2 times

- in line 46-47(2)

ETXTBSY defined in line 6; never used
HEADER_BYTES defined in line 20; used 1 times

- in line 21

Last modified: 1987-07-25 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 515 |