# 2.11BSD#431 - /usr/src/ucb/window/error.c

##### Functions

    err_end           X
    error             X

##### Macros

    ERRLINES          X

       1: #ifndef lint
       2: static char sccsid[] = "@(#)error.c	3.12 4/24/85";
       3: #endif
       4:
       5: /*
       6:  * Copyright (c) 1983 Regents of the University of California,
       7:  * All rights reserved.  Redistribution permitted subject to
       8:  * the terms of the Berkeley Software License Agreement.
       9:  */
      10:
      11: #include "defs.h"
      12: #include "value.h"
      13: #include "context.h"
      14: #include "char.h"
      15:
      16: #define ERRLINES 10         /* number of lines for errwin */
      17:
      18: /*VARARGS1*/
      19: error(fmt, a, b, c, d, e, f, g, h)
      20: char *fmt;
      21: {
      22:     register struct context *x;
      23:     register struct ww *w;
      24:
      25:     for (x = &cx; x != 0 && x->x_type != X_FILE; x = x->x_link)
      26:         ;
      27:     if (x == 0) {
      28:         if (terse)
      29:             wwbell();
      30:         else {
      31:             wwprintf(cmdwin, fmt, a, b, c, d, e, f, g, h);
      32:             wwputs("  ", cmdwin);
      33:         }
      34:         return;
      35:     }
      36:     if (x->x_noerr)
      37:         return;
      38:     if ((w = x->x_errwin) == 0) {
      39:         char buf[512];
      40:
      41:         (void) sprintf(buf, "Errors from %s", x->x_filename);
      42:         if ((w = x->x_errwin = openiwin(ERRLINES, buf)) == 0) {
      43:             wwputs("Can't open error window.  ", cmdwin);
      44:             x->x_noerr = 1;
      45:             return;
      46:         }
      47:     }
      48:     if (more(w, 0) == 2) {
      49:         x->x_noerr = 1;
      50:         return;
      51:     }
      52:     wwprintf(w, "line %d: ", x->x_lineno);
      53:     wwprintf(w, fmt, a, b, c, d, e, f, g, h);
      54:     wwputc('\n', w);
      55: }
      56:
      57: err_end()
      58: {
      59:     if (cx.x_type == X_FILE && cx.x_errwin != 0) {
      60:         if (!cx.x_noerr)
      61:             waitnl(cx.x_errwin);
      62:         closeiwin(cx.x_errwin);
      63:         cx.x_errwin = 0;
      64:     }
      65: }

#### Defined functions

err_end defined in line 57; used 2 times

- in /usr/src/ucb/window/lcmd.c line 100, 113

error defined in line 19; used 33 times

- in /usr/src/ucb/window/cmd.c line 41, 49, 66, 162, 211
- in /usr/src/ucb/window/cmd2.c line 73
- in /usr/src/ucb/window/cmd4.c line 25
- in /usr/src/ucb/window/cmd6.c line 63, 78
- in /usr/src/ucb/window/lcmd1.c line 143, 167, 218, 301, 320-328(3), 351
- in /usr/src/ucb/window/lcmd2.c line 26, 68, 141-145(2), 170, 252
- in /usr/src/ucb/window/mloop.c line 23
- in /usr/src/ucb/window/parser1.c line 174, 184, 191
- in /usr/src/ucb/window/win.c line 45-50(2), 58, 71, 85, 256

#### Defined variables

sccsid defined in line 2; never used

#### Defined macros

ERRLINES defined in line 16; used 1 times

- in line 42

Last modified: 1987-02-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 549 |