PostgreSQL Source Code git master
Loading...
Searching...
No Matches
rmgr.h File Reference
#include "access/rmgrlist.h"
Include dependency graph for rmgr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PG_RMGR(symname, name, redo, desc, identify, startup, cleanup, mask, decode)    symname,
 
#define RM_MAX_ID   UINT8_MAX
 
#define RM_MAX_BUILTIN_ID   (RM_NEXT_ID - 1)
 
#define RM_MIN_CUSTOM_ID   128
 
#define RM_MAX_CUSTOM_ID   UINT8_MAX
 
#define RM_N_IDS   (UINT8_MAX + 1)
 
#define RM_N_BUILTIN_IDS   (RM_MAX_BUILTIN_ID + 1)
 
#define RM_N_CUSTOM_IDS   (RM_MAX_CUSTOM_ID - RM_MIN_CUSTOM_ID + 1)
 
#define RmgrIdIsValid(rmid)   (RmgrIdIsBuiltin((rmid)) || RmgrIdIsCustom((rmid)))
 
#define RM_EXPERIMENTAL_ID   128
 

Typedefs

typedef uint8 RmgrId
 
typedef enum RmgrIds RmgrIds
 

Enumerations

enum  RmgrIds { RM_NEXT_ID }
 

Functions

static bool RmgrIdIsBuiltin (int rmid)
 
static bool RmgrIdIsCustom (int rmid)
 

Macro Definition Documentation

◆ PG_RMGR

#define PG_RMGR (   symname,
  name,
  redo,
  desc,
  identify,
  startup,
  cleanup,
  mask,
  decode 
)     symname,

Definition at line 22 of file rmgr.h.

25{
26#include "access/rmgrlist.h"
28} RmgrIds;
29
30#undef PG_RMGR
31
32#define RM_MAX_ID UINT8_MAX
33#define RM_MAX_BUILTIN_ID (RM_NEXT_ID - 1)
34#define RM_MIN_CUSTOM_ID 128
35#define RM_MAX_CUSTOM_ID UINT8_MAX
36#define RM_N_IDS (UINT8_MAX + 1)
37#define RM_N_BUILTIN_IDS (RM_MAX_BUILTIN_ID + 1)
38#define RM_N_CUSTOM_IDS (RM_MAX_CUSTOM_ID - RM_MIN_CUSTOM_ID + 1)
39
40static inline bool
41RmgrIdIsBuiltin(int rmid)
42{
43 return rmid <= RM_MAX_BUILTIN_ID;
44}
45
46static inline bool
47RmgrIdIsCustom(int rmid)
48{
49 return rmid >= RM_MIN_CUSTOM_ID && rmid <= RM_MAX_CUSTOM_ID;
50}
51
52#define RmgrIdIsValid(rmid) (RmgrIdIsBuiltin((rmid)) || RmgrIdIsCustom((rmid)))
53
54/*
55 * RmgrId to use for extensions that require an RmgrId, but are still in
56 * development and have not reserved their own unique RmgrId yet. See:
57 * https://wiki.postgresql.org/wiki/CustomWALResourceManagers
58 */
59#define RM_EXPERIMENTAL_ID 128
60
61#endif /* RMGR_H */
#define RM_MAX_BUILTIN_ID
Definition rmgr.h:34
static bool RmgrIdIsCustom(int rmid)
Definition rmgr.h:48
#define RM_MAX_CUSTOM_ID
Definition rmgr.h:36
RmgrIds
Definition rmgr.h:26
@ RM_NEXT_ID
Definition rmgr.h:28
static bool RmgrIdIsBuiltin(int rmid)
Definition rmgr.h:42
#define RM_MIN_CUSTOM_ID
Definition rmgr.h:35

◆ RM_EXPERIMENTAL_ID

#define RM_EXPERIMENTAL_ID   128

Definition at line 60 of file rmgr.h.

◆ RM_MAX_BUILTIN_ID

#define RM_MAX_BUILTIN_ID   (RM_NEXT_ID - 1)

Definition at line 34 of file rmgr.h.

◆ RM_MAX_CUSTOM_ID

#define RM_MAX_CUSTOM_ID   UINT8_MAX

Definition at line 36 of file rmgr.h.

◆ RM_MAX_ID

#define RM_MAX_ID   UINT8_MAX

Definition at line 33 of file rmgr.h.

◆ RM_MIN_CUSTOM_ID

#define RM_MIN_CUSTOM_ID   128

Definition at line 35 of file rmgr.h.

◆ RM_N_BUILTIN_IDS

#define RM_N_BUILTIN_IDS   (RM_MAX_BUILTIN_ID + 1)

Definition at line 38 of file rmgr.h.

◆ RM_N_CUSTOM_IDS

#define RM_N_CUSTOM_IDS   (RM_MAX_CUSTOM_ID - RM_MIN_CUSTOM_ID + 1)

Definition at line 39 of file rmgr.h.

◆ RM_N_IDS

#define RM_N_IDS   (UINT8_MAX + 1)

Definition at line 37 of file rmgr.h.

◆ RmgrIdIsValid

#define RmgrIdIsValid (   rmid)    (RmgrIdIsBuiltin((rmid)) || RmgrIdIsCustom((rmid)))

Definition at line 53 of file rmgr.h.

Typedef Documentation

◆ RmgrId

Definition at line 11 of file rmgr.h.

◆ RmgrIds

Enumeration Type Documentation

◆ RmgrIds

Enumerator
RM_NEXT_ID 

Definition at line 25 of file rmgr.h.

26{
27#include "access/rmgrlist.h"
29} RmgrIds;

Function Documentation

◆ RmgrIdIsBuiltin()

static bool RmgrIdIsBuiltin ( int  rmid)
inlinestatic

Definition at line 42 of file rmgr.h.

43{
44 return rmid <= RM_MAX_BUILTIN_ID;
45}

References RM_MAX_BUILTIN_ID.

Referenced by GetRmgrDesc(), and pg_get_wal_resource_managers().

◆ RmgrIdIsCustom()

static bool RmgrIdIsCustom ( int  rmid)
inlinestatic

Definition at line 48 of file rmgr.h.

49{
50 return rmid >= RM_MIN_CUSTOM_ID && rmid <= RM_MAX_CUSTOM_ID;
51}

References RM_MAX_CUSTOM_ID, and RM_MIN_CUSTOM_ID.

Referenced by main(), RegisterCustomRmgr(), and XLogDumpDisplayStats().