]> diplodocus.org Git - nmh/blob - h/dropsbr.h
uip/flist.c: Make locally defined and used functions static.
[nmh] / h / dropsbr.h
1 /* dropsbr.h -- definitions for maildrop-style files
2 */
3
4 /*
5 * A file which is formatted like a maildrop may have a corresponding map
6 * file which is an index to the bounds of each message. The first record
7 * of such an map is special, it contains:
8 *
9 * d_id = number of messages in file
10 * d_size = version number of map
11 * d_start = last message read
12 * d_stop = size of file
13 *
14 * Each record after that contains:
15 *
16 * d_id = BBoard-ID: of message, or similar info
17 * d_size = size of message in ARPA Internet octets (\n == 2 octets)
18 * d_start = starting position of message in file
19 * d_stop = stopping position of message in file
20 *
21 * Note that d_start/d_stop do NOT include the message delimiters, so
22 * programs using the map can simply fseek to d_start and keep reading
23 * until the position is at d_stop.
24 */
25
26 /*
27 * various formats for maildrop files
28 */
29 #define OTHER_FORMAT 0
30 #define MBOX_FORMAT 1
31 #define MMDF_FORMAT 2
32
33 #define DRVRSN 3
34
35 struct drop {
36 int d_id;
37 int d_size;
38 off_t d_start;
39 off_t d_stop;
40 };
41
42 /*
43 * prototypes
44 */
45 int mbx_open (char *, int, uid_t, gid_t, mode_t);
46 int mbx_read (FILE *, long, struct drop **);
47 int mbx_write(char *, int, FILE *, int, long, long, off_t, int, int);
48 int mbx_copy (char *, int, int, int, int, char *, int);
49 int mbx_size (int, off_t, off_t);
50 int mbx_close (char *, int);
51 char *map_name (char *);
52 int map_read (char *, long, struct drop **, int);
53 int map_write (char *, int, int, long, off_t, off_t, long, int, int);
54 int map_chk (char *, int, struct drop *, long, int);