home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / bm_src / printlin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-16  |  915 b   |  41 lines

  1. #include <stdio.h>
  2. #include <osbind.h>
  3. #include "Extern.h"
  4. PrintLine(OffSet,LineStart,LineEnd)
  5. int OffSet; /* offset of LineStart from beginning of file */
  6. char *LineStart,
  7.     *LineEnd;
  8. {
  9.     char OffStr[80];
  10.         char save;
  11.  
  12.     if (lFlag) {
  13.         if (strlen(FileName) > 76) {
  14.             fprintf(stderr,"bm: filename too long\n");
  15.             exit(2);
  16.         } /* if */
  17.         if (strlen(FileName)) {
  18.             Cconws(FileName);
  19.             Cconws("\r\n");
  20.         } /* if */
  21.         return 0; /* value ignored */
  22.     } /* if */
  23.     if (FileName && !hFlag) {
  24.         if (strlen(FileName) > 76) {
  25.             fprintf(stderr,"bm: filename too long\n");
  26.             exit(2);
  27.         } /* if */
  28.         Cconws(FileName);
  29.         Cconws(":");
  30.     } /* if */
  31.     if (nFlag) {
  32.         sprintf(OffStr,"%d: ",OffSet);
  33.         Cconws(OffStr);
  34.     } /* if */
  35.         save = LineEnd[1];
  36.         LineEnd[1] = '\0';
  37.     Cconws(LineStart);
  38.         LineEnd[1] = save;
  39.     if (*LineEnd != '\n') Cconws("\r\n");
  40.  } /* PrintLine */
  41.