home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / UUPC11XT.ZIP / RN / BITS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-21  |  2.1 KB  |  75 lines

  1. /* $Header: E:\SRC\UUPC\RN\RCS/BITS.H 1.1 1992/11/21 06:14:58 ahd Exp $
  2.  *
  3.  * $Log: BITS.H $
  4.  * Revision 1.1  1992/11/21  06:14:58  ahd
  5.  * Initial
  6.  *
  7.  *
  8.  *    Rev 1.0   18 Nov 1990  0:22:38
  9.  * Initial revision.
  10.  * Revision 4.3.1.2  86/11/03  09:49:58  lwall
  11.  * Added firstbit variable.
  12.  *
  13.  * Revision 4.3.1.1  85/05/10  11:31:52  lwall
  14.  * Branch for patches.
  15.  *
  16.  * Revision 4.3  85/05/01  11:36:39  lwall
  17.  * Baseline for release with 4.3bsd.
  18.  *
  19.  */
  20.  
  21. EXT char *ctlarea INIT(Nullch);    /* one bit for each article in current newsgroup */
  22.             /* with the following interpretation: */
  23.             /*    0 => unread  */
  24.             /*    1 => read    */
  25.  
  26. /* if subscripting is faster than shifting on your machine, define this */
  27. #undef USESUBSCRIPT
  28. #ifdef USESUBSCRIPT
  29. EXT char powerof2[] INIT({1,2,4,8,16,32,64,128});
  30. #define pow2(x) powerof2[x]
  31. #else
  32. #define pow2(x) (1 << (x))
  33. #endif
  34.  
  35. #ifdef lint
  36. EXT bool nonesuch INIT(FALSE);
  37. #define ctl_set(a)
  38. #define ctl_clear(a)
  39. #define ctl_read(a) nonesuch
  40. #define was_read(a) nonesuch
  41. #else
  42. #define ctl_set(a) (ctlarea[(OFFSET(a)) / BITSPERBYTE] |= pow2((OFFSET(a)) % BITSPERBYTE))
  43. #define ctl_clear(a) (ctlarea[(OFFSET(a)) / BITSPERBYTE] &= ~pow2((OFFSET(a)) % BITSPERBYTE))
  44. #define ctl_read(a) ((ctlarea[(OFFSET(a)) / BITSPERBYTE] & pow2((OFFSET(a)) % BITSPERBYTE)) != 0)
  45.  
  46. #define was_read(a) ((a)<firstbit || ctl_read(a))
  47. #endif /* lint */
  48.  
  49. EXT ART_NUM absfirst INIT(0);    /* 1st real article in current newsgroup */
  50. EXT ART_NUM firstart INIT(0);    /* minimum unread article number in newsgroup */
  51. EXT ART_NUM firstbit INIT(0);    /* minimum valid bit, usually == firstart */
  52. EXT ART_NUM lastart INIT(0);    /* maximum article number in newsgroup */
  53.  
  54. #ifdef DELAYMARK
  55. EXT FILE *dmfp INIT(Nullfp);
  56. EXT char *dmname INIT(Nullch);
  57. EXT int dmcount INIT(0);
  58. #endif
  59.  
  60. void    bits_init();
  61. void    checkpoint_rc();
  62. void    restore_ng();
  63. void    onemore();
  64. void    oneless();
  65. void    unmark_as_read();
  66. void    delay_unmark();
  67. void    mark_as_read();
  68. void    check_first();
  69. #ifdef DELAYMARK
  70.     void    yankback();
  71. #endif
  72. int    chase_xrefs();
  73. int    initctl();
  74. void    grow_ctl();
  75.