2
0

buf.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*-------------------------------------------------------------------------
  2. *
  3. * buf.h
  4. * Basic buffer manager data types.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/storage/buf.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef BUF_H
  15. #define BUF_H
  16. /*
  17. * Buffer identifiers.
  18. *
  19. * Zero is invalid, positive is the index of a shared buffer (1..NBuffers),
  20. * negative is the index of a local buffer (-1 .. -NLocBuffer).
  21. */
  22. typedef int Buffer;
  23. #define InvalidBuffer 0
  24. /*
  25. * BufferIsInvalid
  26. * True iff the buffer is invalid.
  27. */
  28. #define BufferIsInvalid(buffer) ((buffer) == InvalidBuffer)
  29. /*
  30. * BufferIsLocal
  31. * True iff the buffer is local (not visible to other backends).
  32. */
  33. #define BufferIsLocal(buffer) ((buffer) < 0)
  34. /*
  35. * Buffer access strategy objects.
  36. *
  37. * BufferAccessStrategyData is private to freelist.c
  38. */
  39. typedef struct BufferAccessStrategyData *BufferAccessStrategy;
  40. #endif /* BUF_H */