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
|
|
|
*
|
|
|
|
*
|
2007-01-05 23:20:05 +01:00
|
|
|
* Portions Copyright (c) 1996-2007, 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
|
|
|
*
|
2007-05-30 22:12:03 +02:00
|
|
|
* $PostgreSQL: pgsql/src/include/storage/buf.h,v 1.22 2007/05/30 20:12:03 tgl 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
|
2004-04-26 01:50:58 +02:00
|
|
|
* True iff the buffer is local (not visible to other backends).
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
|
|
|
#define BufferIsLocal(buffer) ((buffer) < 0)
|
|
|
|
|
2007-05-30 22:12:03 +02:00
|
|
|
/*
|
|
|
|
* Buffer access strategy objects.
|
|
|
|
*
|
|
|
|
* BufferAccessStrategyData is private to freelist.c
|
|
|
|
*/
|
|
|
|
typedef struct BufferAccessStrategyData *BufferAccessStrategy;
|
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* BUF_H */
|