home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume3 / pcmail / part07 / pager.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-03  |  2.7 KB  |  80 lines

  1. /*++
  2. /* NAME
  3. /*    pager    5
  4. /* SUMMARY
  5. /*    pager for display files, definitions
  6. /* PROJECT
  7. /*    pc-mail
  8. /* PACKAGE
  9. /*    mailsh
  10. /* SYNOPSIS
  11. /*    #include "pager.h"
  12. /* DESCRIPTION
  13. /*    The display pager manipulates various lists of line structures.
  14. /*    Each line is linked to its predecessor and to its successor.
  15. /*
  16. /*    Besides the familiar list ops for insert/delete the pager also 
  17. /*    provides "read" and "write" operations on lines, and a 
  18. /*    sort utility.
  19. /* .nf
  20.  
  21. /* /* externally visible parts of the pager */
  22.  
  23. #define    FORW_SORT    1    /* sort in ascending order */
  24. #define    BACK_SORT    2    /* sort in reverse order */
  25.  
  26. #define    PG_NOEND    1    /* suppress '-- end of display --' */
  27.  
  28. typedef struct File {
  29.     struct Line *head;        /* ptr to first line in file */
  30.     struct Line *last;        /* ditto to the last line */
  31.     struct Line *top;        /* first one visible on screen */
  32.     struct Line *curr;        /* where the cursor sits */
  33.     int opts;            /* option flags */
  34. } File;
  35.  
  36. typedef struct Line {
  37.     struct Line *prev;        /* link to predecessor */
  38.     struct Line *next;        /* link to successor */
  39.     short lineno;        /* where it is on the screen */
  40.     short llen;            /* nbr of lines on the screen */
  41.     char line[1];        /* actually, a lot of characters */
  42. } Line;
  43.  
  44. extern File *open_pager();    /* create a new display file */
  45. extern void close_pager();    /* destroys an display file */
  46. extern int scan_pager();    /* reads from current line */
  47. extern void appd_pager();    /* appends after current line */
  48. extern void del_pager();    /* delete current line */
  49. extern void ins_pager();    /* inserts before current line */
  50. extern void sort_pager();    /* sorts a file */
  51. extern void set_pager();    /* select display file */
  52. extern char *gets_pager();    /* returns current line */
  53. extern void puts_pager();    /* replaces current line */
  54.  
  55. extern int cp_pager();        /* copy display file to disk */
  56. extern int pr_pager();        /* copy display file to printer */
  57. extern int rd_pager();        /* permanent file to display file */
  58. extern int ds_pager();        /* current page of current file */
  59. extern int up_pager();        /* handle cursor up request */
  60. extern int dn_pager();        /* handle cursor down request */
  61. extern int pu_pager();        /* handle page up request */
  62. extern int pd_pager();        /* handle page down request */
  63. extern void mesg_pager();    /* copy message array to display file */
  64. /* SEE ALSO
  65. /*    path(3), window(3), window(5)
  66. /* BUGS
  67. /*    It looks a lot like an editor, but it isn't.
  68. /* AUTHOR(S)
  69. /*    W.Z. Venema
  70. /*    Eindhoven University of Technology
  71. /*    Department of Mathematics and Computer Science
  72. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  73. /* CREATION DATE
  74. /*    Fri Apr  3 22:06:00 GMT+1:00 1987
  75. /* LAST MODIFICATION
  76. /*    Mon Apr  4 23:46:39 MET 1988
  77. /* VERSION/RELEASE
  78. /*    1.3
  79. /*--*/
  80.