1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* buf.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* Basic buffer manager data types.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2001-11-05 18:46:40 +01:00
|
|
|
* $Id: buf.h,v 1.12 2001/11/05 17:46:35 momjian Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef BUF_H
|
1996-08-28 03:59:28 +02:00
|
|
|
#define BUF_H
|
|
|
|
|
2001-06-09 20:16:59 +02: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-28 03:59:28 +02:00
|
|
|
|
2001-06-09 20:16:59 +02:00
|
|
|
#define InvalidBuffer 0
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* BufferIsInvalid
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff the buffer is invalid.
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#define BufferIsInvalid(buffer) ((buffer) == InvalidBuffer)
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* BufferIsLocal
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff the buffer is local (not visible to other servers).
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
|
|
|
#define BufferIsLocal(buffer) ((buffer) < 0)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If NO_BUFFERISVALID is defined, all error checking using BufferIsValid()
|
1997-09-07 07:04:48 +02:00
|
|
|
* are suppressed. Decision-making using BufferIsValid is not affected.
|
1996-08-28 03:59:28 +02:00
|
|
|
* This should be set only if one is sure there will be no errors.
|
|
|
|
* - plai 9/10/90
|
|
|
|
*/
|
|
|
|
#undef NO_BUFFERISVALID
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* BUF_H */
|