File: bits.h

package info (click to toggle)
trn 3.6-9.3.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,596 kB
  • ctags: 1,534
  • sloc: ansic: 25,208; sh: 4,638; makefile: 1,032; yacc: 660
file content (50 lines) | stat: -rw-r--r-- 1,654 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* $Id: bits.h,v 3.0 1991/09/09 20:18:23 davison Trn $
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The authors make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

EXT char *found_bits INIT(Nullch);
EXT ART_NUM found_min;

/* if subscripting is faster than shifting on your machine, define this */
#undef USESUBSCRIPT
#ifdef USESUBSCRIPT
EXT char powerof2[] INIT({1,2,4,8,16,32,64,128});
#define pow2(x) powerof2[x]
#else
#define pow2(x) (1 << (x))
#endif

#define foundart(a) (found_bits[((a)-found_min) / BITSPERBYTE] \
	|= pow2(((a)-found_min) % BITSPERBYTE))
#define artismissing(a) (!(found_bits[((a)-found_min) / BITSPERBYTE] \
	& pow2(((a)-found_min) % BITSPERBYTE)))

EXT int dmcount INIT(0);

void	bits_init _((void));
void	rc_to_bits _((void));
void	bits_to_rc _((void));
void	setfoundbits _((void));
void	setmissingbits _((void));
void	onemore _((ARTICLE*));
void	oneless _((ARTICLE*));
void	onemissing _((ARTICLE*));
void	unmark_as_read _((void));
void	set_read _((ARTICLE*));
void	set_unread _((ARTICLE*));
void	delay_unmark _((ARTICLE*));
void	mark_as_read _((void));
void	check_first _((ART_NUM));
void	yankback _((void));
int	chase_xrefs _((bool_int));