1996-08-27 21:59:28 -04:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
1999-02-13 18:22:53 -05:00
|
|
|
* buf.h
|
1997-09-07 01:04:48 -04:00
|
|
|
* Basic buffer manager data types.
|
1996-08-27 21:59:28 -04:00
|
|
|
*
|
|
|
|
|
*
|
2015-01-06 11:43:47 -05:00
|
|
|
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
|
2000-01-26 00:58:53 -05:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-27 21:59:28 -04:00
|
|
|
*
|
2010-09-20 16:08:53 -04:00
|
|
|
* src/include/storage/buf.h
|
1996-08-27 21:59:28 -04:00
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
1997-09-07 01:04:48 -04:00
|
|
|
#ifndef BUF_H
|
1996-08-27 21:59:28 -04:00
|
|
|
#define BUF_H
|
|
|
|
|
|
2001-06-09 14:16:59 -04:00
|
|
|
/*
|
|
|
|
|
* Buffer identifiers.
|
|
|
|
|
*
|
|
|
|
|
* Zero is invalid, positive is the index of a shared buffer (1..NBuffers),
|
|
|
|
|
* negative is the index of a local buffer (-1 .. -NLocBuffer).
|
|
|
|
|
*/
|
|
|
|
|
typedef int Buffer;
|
1996-08-27 21:59:28 -04:00
|
|
|
|
2001-06-09 14:16:59 -04:00
|
|
|
#define InvalidBuffer 0
|
1996-08-27 21:59:28 -04:00
|
|
|
|
|
|
|
|
/*
|
1999-05-25 12:15:34 -04:00
|
|
|
* BufferIsInvalid
|
1997-09-07 01:04:48 -04:00
|
|
|
* True iff the buffer is invalid.
|
1996-08-27 21:59:28 -04:00
|
|
|
*/
|
1997-09-07 01:04:48 -04:00
|
|
|
#define BufferIsInvalid(buffer) ((buffer) == InvalidBuffer)
|
1996-08-27 21:59:28 -04:00
|
|
|
|
|
|
|
|
/*
|
1999-05-25 12:15:34 -04:00
|
|
|
* BufferIsLocal
|
2004-04-25 19:50:58 -04:00
|
|
|
* True iff the buffer is local (not visible to other backends).
|
1996-08-27 21:59:28 -04:00
|
|
|
*/
|
|
|
|
|
#define BufferIsLocal(buffer) ((buffer) < 0)
|
|
|
|
|
|
2007-05-30 16:12:03 -04:00
|
|
|
/*
|
|
|
|
|
* Buffer access strategy objects.
|
|
|
|
|
*
|
|
|
|
|
* BufferAccessStrategyData is private to freelist.c
|
|
|
|
|
*/
|
|
|
|
|
typedef struct BufferAccessStrategyData *BufferAccessStrategy;
|
|
|
|
|
|
2001-11-05 12:46:40 -05:00
|
|
|
#endif /* BUF_H */
|