File: memblk.h

package info (click to toggle)
procmail 3.22-27
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 2,128 kB
  • sloc: ansic: 9,888; sh: 1,957; makefile: 136
file content (31 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (13)
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
typedef struct memblk {
    char*p;						  /* where it starts */
    long len;			 /* current size, not including trailing NUL */
#ifdef USE_MMAP
    off_t filelen;				     /* how long is the file */
    int fd;					   /* file which is mmap()ed */
#endif
} memblk;

typedef char*(read_func_type) P((char*,long,void*));
typedef int(cleanup_func_type) P((memblk*,long*,long,void*));

void
 makeblock P((memblk*const,const long)), /* create block of the given length */
 freeblock P((memblk*const)),				    /* deallocate it */
 lockblock P((memblk*const));	   /* protect this block from future changes */
int							  /* by this process */
 resizeblock P((memblk*const,const long,const int));	  /* change the size */
char		      /* dynamically grow a block to fit data as it comes in */
 *read2blk P((memblk*const,long*const,read_func_type*,cleanup_func_type*,void*));

#ifdef USE_MMAP
extern int ISprivate;		     /* is themail a private copy or shared? */
#define isprivate	(themail.fd<0||ISprivate)
#define private(x)	(ISprivate=(x))
#else
#define isprivate	1
#define private(x)	1
#endif

extern memblk themail;