Header And Logo

PostgreSQL
| The world's most advanced open source database.

buf.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * buf.h
00004  *    Basic buffer manager data types.
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/storage/buf.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef BUF_H
00015 #define BUF_H
00016 
00017 /*
00018  * Buffer identifiers.
00019  *
00020  * Zero is invalid, positive is the index of a shared buffer (1..NBuffers),
00021  * negative is the index of a local buffer (-1 .. -NLocBuffer).
00022  */
00023 typedef int Buffer;
00024 
00025 #define InvalidBuffer   0
00026 
00027 /*
00028  * BufferIsInvalid
00029  *      True iff the buffer is invalid.
00030  */
00031 #define BufferIsInvalid(buffer) ((buffer) == InvalidBuffer)
00032 
00033 /*
00034  * BufferIsLocal
00035  *      True iff the buffer is local (not visible to other backends).
00036  */
00037 #define BufferIsLocal(buffer)   ((buffer) < 0)
00038 
00039 /*
00040  * Buffer access strategy objects.
00041  *
00042  * BufferAccessStrategyData is private to freelist.c
00043  */
00044 typedef struct BufferAccessStrategyData *BufferAccessStrategy;
00045 
00046 #endif   /* BUF_H */