[BACK]Return to pr.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / pr

Diff for /src/usr.bin/pr/pr.c between version 1.17 and 1.18

version 1.17, 2003/06/10 22:20:49 version 1.18, 2003/06/12 20:58:10
Line 178 
Line 178 
  *        Line length is unlimited.   *        Line length is unlimited.
  */   */
 int  int
 onecol(argc, argv)  onecol(int argc, char *argv[])
     int argc;  
     char *argv[];  
 {  {
     int off;      int off;
     int lrgln;      int lrgln;
Line 341 
Line 339 
  *              the general approach is to buffer a page of data, then print   *              the general approach is to buffer a page of data, then print
  */   */
 int  int
 vertcol(argc, argv)  vertcol(int argc, char *argv[])
         int argc;  
         char *argv[];  
 {  {
     char *ptbf;      char *ptbf;
     char **lstdat;      char **lstdat;
Line 669 
Line 665 
  * horzcol:    print files with more than one column of output across a page   * horzcol:    print files with more than one column of output across a page
  */   */
 int  int
 horzcol(argc, argv)  horzcol(int argc, char *argv[])
         int argc;  
         char *argv[];  
 {  {
     char *ptbf;      char *ptbf;
     int pln;      int pln;
Line 829 
Line 823 
  *        processing has completed   *        processing has completed
  */   */
 void  void
 flsh_errs()  flsh_errs(void)
 {  {
     struct ferrlist *f;      struct ferrlist *f;
   
Line 874 
Line 868 
  *        more than one file concurrently   *        more than one file concurrently
  */   */
 int  int
 mulfile(argc, argv)  mulfile(int argc, char *argv[])
     int argc;  
     char *argv[];  
 {  {
     char *ptbf;      char *ptbf;
     int j;      int j;
Line 1112 
Line 1104 
  *    mor:    set if more data in line (not truncated)   *    mor:    set if more data in line (not truncated)
  */   */
 int  int
 inln(inf, buf, lim, cnt, cps, trnc, mor)  inln(FILE *inf, char *buf, int lim, int *cnt, int *cps, int trnc, int *mor)
     FILE *inf;  
     char *buf;  
     int lim;  
     int *cnt;  
     int *cps;  
     int trnc;  
     int *mor;  
 {  {
     int col;      int col;
     int gap = ingap;      int gap = ingap;
Line 1233 
Line 1218 
  *        1 is more, 0 is complete, -1 is no \n's   *        1 is more, 0 is complete, -1 is no \n's
  */   */
 int  int
 otln(buf, cnt, svips, svops, mor)  otln(char *buf, int cnt, int *svips, int *svops, int mor)
     char *buf;  
     int cnt;  
     int *svops;  
     int *svips;  
     int mor;  
 {  {
     int ops;        /* last col output */      int ops;        /* last col output */
     int ips;        /* last col in buf examined */      int ips;        /* last col in buf examined */
Line 1395 
Line 1375 
  *    lncnt    number of lines per page   *    lncnt    number of lines per page
  */   */
 int  int
 inskip(inf, pgcnt, lncnt)  inskip(FILE *inf, int pgcnt, int lncnt)
     FILE *inf;  
     int pgcnt;  
     int lncnt;  
 {  {
     int c;      int c;
     int cnt;      int cnt;
Line 1427 
Line 1404 
  *    dt    if set skips the date processing (used with -m)   *    dt    if set skips the date processing (used with -m)
  */   */
 FILE *  FILE *
 nxtfile(argc, argv, fname, buf, dt)  nxtfile(int argc, char *argv[], char **fname, char *buf, int dt)
     int argc;  
     char **argv;  
     char **fname;  
     char *buf;  
     int dt;  
 {  {
     FILE *inf = NULL;      FILE *inf = NULL;
     struct timeval tv;      struct timeval tv;
Line 1565 
Line 1537 
  *        numbers as part of the column so spaces may be replaced.   *        numbers as part of the column so spaces may be replaced.
  */   */
 void  void
 addnum(buf, wdth, line)  addnum(char *buf, int wdth, int line)
     char *buf;  
     int wdth;  
     int line;  
 {  {
     char *pt = buf + wdth;      char *pt = buf + wdth;
   
Line 1600 
Line 1569 
  * the context each output mode, but we let the caller figure that out.   * the context each output mode, but we let the caller figure that out.
  */   */
 int  int
 prhead(buf, fname, pagcnt)  prhead(char *buf, char *fname, int pagcnt)
     char *buf;  
     char *fname;  
     int pagcnt;  
 {  {
     int ips = 0;      int ips = 0;
     int ops = 0;      int ops = 0;
Line 1649 
Line 1615 
  * we haven't printed a hearder, these no need for a trailer   * we haven't printed a hearder, these no need for a trailer
  */   */
 int  int
 prtail(cnt, incomp)  prtail(int cnt, int incomp)
     int cnt;  
     int incomp;  
 {  {
     /*      /*
      * if were's skipping to page N or haven't put out anything yet just exit       * if were's skipping to page N or haven't put out anything yet just exit
Line 1740 
Line 1704 
  * terminate():    when a SIGINT is recvd   * terminate():    when a SIGINT is recvd
  */   */
 void  void
 terminate(which_sig)  terminate(int which_sig)
     int which_sig;  
 {  {
     flsh_errs();      flsh_errs();
     _exit(1);      _exit(1);
 }  }
   
 void  void
 mfail()  mfail(void)
 {  {
     ferrout("pr: memory allocation failed\n");      ferrout("pr: memory allocation failed\n");
 }  }
   
 void  void
 pfail()  pfail(void)
 {  {
     ferrout("pr: write failure, %s\n", strerror(errno));      ferrout("pr: write failure, %s\n", strerror(errno));
 }  }
   
 void  void
 usage()  usage(void)
 {  {
     ferrout(      ferrout(
      "usage: pr [+page] [-col] [-adfFmrt] [-e[ch][gap]] [-h header]\n");       "usage: pr [+page] [-col] [-adfFmrt] [-e[ch][gap]] [-h header]\n");
Line 1775 
Line 1738 
  *        checks on options   *        checks on options
  */   */
 int  int
 setup(argc, argv)  setup(int argc, char *argv[])
     int argc;  
     char **argv;  
 {  {
     int c;      int c;
     int eflag = 0;      int eflag = 0;

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18