]> granicus.if.org Git - postgresql/blob - src/include/storage/buf.h
4d767b808fc68ee99452f8259eabdb164743652d
[postgresql] / src / include / storage / buf.h
1 /*-------------------------------------------------------------------------
2  *
3  * buf.h
4  *        Basic buffer manager data types.
5  *
6  *
7  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: buf.h,v 1.10 2001/10/25 05:50:09 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef BUF_H
15 #define BUF_H
16
17 /*
18  * Buffer identifiers.
19  *
20  * Zero is invalid, positive is the index of a shared buffer (1..NBuffers),
21  * negative is the index of a local buffer (-1 .. -NLocBuffer).
22  */
23 typedef int Buffer;
24
25 #define InvalidBuffer   0
26
27 /*
28  * BufferIsInvalid
29  *              True iff the buffer is invalid.
30  */
31 #define BufferIsInvalid(buffer) ((buffer) == InvalidBuffer)
32
33 /*
34  * BufferIsLocal
35  *              True iff the buffer is local (not visible to other servers).
36  */
37 #define BufferIsLocal(buffer)   ((buffer) < 0)
38
39 /*
40  * If NO_BUFFERISVALID is defined, all error checking using BufferIsValid()
41  * are suppressed.      Decision-making using BufferIsValid is not affected.
42  * This should be set only if one is sure there will be no errors.
43  * - plai 9/10/90
44  */
45 #undef NO_BUFFERISVALID
46 #endif   /* BUF_H */