home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / most423.zip / most.c < prev    next >
C/C++ Source or Header  |  1994-01-28  |  1KB  |  56 lines

  1. #include <stdio.h>
  2. #include "externs.h"
  3. #include "window.h"
  4. #include "buffer.h"
  5. #include "file.h"
  6. #include "sysdep.h"
  7. #include "keym.h"
  8. #include "most.h"
  9. #include "search.h"  
  10.  
  11. int SQUEEZE_LINES = 0;          /* switch parameters */
  12. int MOST_A_OPT = 0;             /* automatically choose -b if necessary */
  13. int MOST_C_OPT = 0;             /* begin pages at top of screen */
  14. int MOST_V_OPT = 0;             /* display control chars */
  15. int MOST_B_OPT = 0;             /* display Binary File */
  16. int MOST_T_OPT = 0;             /* display tab as ^I-- valid only with V option */
  17. int MOST_D_OPT = 0;             /* delete file mode  (see ':D')  */
  18. int MOST_L_OPT = 0;             /* use ^L (formfeed) to clear screen */
  19.  
  20. void most(char *file, int start)
  21. {
  22.     int piped, row, col;
  23.     
  24.     init_display();
  25.     get_cdir(C_DIR);
  26.  
  27.     row = col = 0;
  28.     if (file[0] == '\0') piped = 1; else piped = 0;
  29.     
  30.     find_file(file);
  31.     goto_line(start);
  32.     CURS_POS = C_POS;
  33.     if (*SEARCH_STR != '\0' && (row = search(C_POS,1,&col), row > 0))
  34.       {
  35.           goto_line(row);
  36.       }
  37.     else
  38.       {
  39.           row = C_LINE;
  40.           col = 1;
  41.       }
  42.     
  43.     window_buffer();
  44.     CURS_ROW = WIN->curs_line = row - C_LINE + 1;
  45.     WIN->curs_pos = CURS_POS;
  46.     CURS_COL = WIN->curs_col = col;
  47.     redraw_window();
  48.     update_status(1);
  49.  
  50.     while (1)
  51.       {
  52.           execute_key();
  53.       } 
  54. }
  55.  
  56.