# 2.11BSD#431 - /usr/src/usr.sbin/lpr/filters/necf.c

##### Functions

    main              X

##### Macros

    PAGESIZE          X

       1: /*
       2:  * Copyright (c) 1983 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #if !defined(lint) && defined(DOSCCS)
       8: static char sccsid[] = "@(#)necf.c	5.1.1 (2.11BSD) 1997/7/29";
       9: #endif
      10:
      11: #include <stdio.h>
      12: #include <sgtty.h>
      13: #include <string.h>
      14:
      15: #define PAGESIZE    66
      16:
      17: main()
      18: {
      19:     char line[256], stdobuf[BUFSIZ];
      20:     register char c, *cp;
      21:     register lnumber;
      22:
      23:     setbuf(stdout, stdobuf);
      24: #ifdef SHEETFEEDER
      25:     printf("\033=\033\033\033O\f");
      26: #else
      27:     printf("\033=");
      28: #endif
      29:     lnumber = 0;
      30:     while (fgets(line, sizeof(line), stdin) != NULL) {
      31: #ifdef SHEETFEEDER
      32:         if (lnumber == PAGESIZE-1) {
      33:             putchar('\f');
      34:             lnumber = 0;
      35:         }
      36:         if (lnumber >= 2) {
      37: #endif
      38: #ifdef TTY
      39:             if ((cp = rindex(line, '\n')) != NULL)
      40:                 *cp = '\r';
      41: #endif
      42:             printf("%s", line);
      43: #ifdef SHEETFEEDER
      44:         }
      45:         lnumber++;
      46: #endif
      47:     }
      48:     fflush (stdout);
      49: }

#### Defined functions

main defined in line 17; never used

#### Defined variables

sccsid defined in line 8; never used

#### Defined macros

PAGESIZE defined in line 15; used 1 times

- in line 32

Last modified: 1997-07-30 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 552 |