Change all // comments to /* */ and run pgindent

Fabrízio de Royes Mello
This commit is contained in:
Christoph Berg 2014-08-30 22:18:12 +02:00
parent 81982fa168
commit 17dafd471e
3 changed files with 1580 additions and 1531 deletions

File diff suppressed because it is too large Load Diff

View File

@ -41,76 +41,78 @@
#include "catalog/pg_control.h"
#include "storage/bufpage.h"
// Options for Block formatting operations
/* Options for Block formatting operations */
static unsigned int blockOptions = 0;
typedef enum
typedef enum blockSwitches
{
BLOCK_ABSOLUTE = 0x00000001, // -a: Absolute (vs Relative) addressing
BLOCK_BINARY = 0x00000002, // -b: Binary dump of block
BLOCK_FORMAT = 0x00000004, // -f: Formatted dump of blocks / control file
BLOCK_FORCED = 0x00000008, // -S: Block size forced
BLOCK_NO_INTR = 0x00000010, // -d: Dump straight blocks
BLOCK_RANGE = 0x00000020, // -R: Specific block range to dump
BLOCK_CHECKSUMS = 0x00000040 // -k: verify block checksums
}
blockSwitches;
BLOCK_ABSOLUTE = 0x00000001, /* -a: Absolute(vs Relative) addressing */
BLOCK_BINARY = 0x00000002, /* -b: Binary dump of block */
BLOCK_FORMAT = 0x00000004, /* -f: Formatted dump of blocks / control file */
BLOCK_FORCED = 0x00000008, /* -S: Block size forced */
BLOCK_NO_INTR = 0x00000010, /* -d: Dump straight blocks */
BLOCK_RANGE = 0x00000020, /* -R: Specific block range to dump */
BLOCK_CHECKSUMS = 0x00000040 /* -k: verify block checksums */
} blockSwitches;
static int blockStart = -1; // -R [start]: Block range start
static int blockEnd = -1; // -R [end]: Block range end
/* -R[start]:Block range start */
static int blockStart = -1;
// Options for Item formatting operations
/* -R[end]:Block range end */
static int blockEnd = -1;
/* Options for Item formatting operations */
static unsigned int itemOptions = 0;
typedef enum
{
ITEM_DETAIL = 0x00000001, // -i: Display interpreted items
ITEM_HEAP = 0x00000002, // -y: Blocks contain HeapTuple items
ITEM_INDEX = 0x00000004, // -x: Blocks contain IndexTuple items
ITEM_SPG_INNER = 0x00000008, // Blocks contain SpGistInnerTuple items
ITEM_SPG_LEAF = 0x00000010 // Blocks contain SpGistLeafTuple items
}
itemSwitches;
// Options for Control File formatting operations
typedef enum itemSwitches
{
ITEM_DETAIL = 0x00000001, /* -i: Display interpreted items */
ITEM_HEAP = 0x00000002, /* -y: Blocks contain HeapTuple items */
ITEM_INDEX = 0x00000004, /* -x: Blocks contain IndexTuple items */
ITEM_SPG_INNER = 0x00000008, /* Blocks contain SpGistInnerTuple items */
ITEM_SPG_LEAF = 0x00000010 /* Blocks contain SpGistLeafTuple items */
} itemSwitches;
/* Options for Control File formatting operations */
static unsigned int controlOptions = 0;
typedef enum
{
CONTROL_DUMP = 0x00000001, // -c: Dump control file
CONTROL_FORMAT = BLOCK_FORMAT, // -f: Formatted dump of control file
CONTROL_FORCED = BLOCK_FORCED // -S: Block size forced
}
controlSwitches;
// Possible value types for the Special Section
typedef enum
typedef enum controlSwitches
{
SPEC_SECT_NONE, // No special section on block
SPEC_SECT_SEQUENCE, // Sequence info in special section
SPEC_SECT_INDEX_BTREE, // BTree index info in special section
SPEC_SECT_INDEX_HASH, // Hash index info in special section
SPEC_SECT_INDEX_GIST, // GIST index info in special section
SPEC_SECT_INDEX_GIN, // GIN index info in special section
SPEC_SECT_INDEX_SPGIST, // SP-GIST index info in special section
SPEC_SECT_ERROR_UNKNOWN, // Unknown error
SPEC_SECT_ERROR_BOUNDARY // Boundary error
}
specialSectionTypes;
CONTROL_DUMP = 0x00000001, /* -c: Dump control file */
CONTROL_FORMAT = BLOCK_FORMAT, /* -f: Formatted dump of control file */
CONTROL_FORCED = BLOCK_FORCED /* -S: Block size forced */
} controlSwitches;
/* Possible value types for the Special Section */
typedef enum specialSectionTypes
{
SPEC_SECT_NONE, /* No special section on block */
SPEC_SECT_SEQUENCE, /* Sequence info in special section */
SPEC_SECT_INDEX_BTREE, /* BTree index info in special section */
SPEC_SECT_INDEX_HASH, /* Hash index info in special section */
SPEC_SECT_INDEX_GIST, /* GIST index info in special section */
SPEC_SECT_INDEX_GIN, /* GIN index info in special section */
SPEC_SECT_INDEX_SPGIST, /* SP - GIST index info in special section */
SPEC_SECT_ERROR_UNKNOWN, /* Unknown error */
SPEC_SECT_ERROR_BOUNDARY /* Boundary error */
} specialSectionTypes;
static unsigned int specialType = SPEC_SECT_NONE;
// Possible return codes from option validation routine.
// pg_filedump doesn't do much with them now but maybe in
// the future...
typedef enum
/* Possible return codes from option validation routine. */
/* pg_filedump doesn't do much with them now but maybe in */
/* the future... */
typedef enum optionReturnCodes
{
OPT_RC_VALID, // All options are valid
OPT_RC_INVALID, // Improper option string
OPT_RC_FILE, // File problems
OPT_RC_DUPLICATE, // Duplicate option encountered
OPT_RC_COPYRIGHT // Copyright should be displayed
}
optionReturnCodes;
OPT_RC_VALID, /* All options are valid */
OPT_RC_INVALID, /* Improper option string */
OPT_RC_FILE, /* File problems */
OPT_RC_DUPLICATE, /* Duplicate option encountered */
OPT_RC_COPYRIGHT /* Copyright should be displayed */
} optionReturnCodes;
// Simple macro to check for duplicate options and then set
// an option flag for later consumption
/* Simple macro to check for duplicate options and then set */
/* an option flag for later consumption */
#define SET_OPTION(_x,_y,_z) if (_x & _y) \
{ \
rc = OPT_RC_DUPLICATE; \
@ -119,6 +121,6 @@ optionReturnCodes;
else \
_x |= _y;
#define SEQUENCE_MAGIC 0x1717 // PostgreSQL defined magic number
#define EOF_ENCOUNTERED (-1) // Indicator for partial read
#define BYTES_PER_LINE 16 // Format the binary 16 bytes per line
#define SEQUENCE_MAGIC 0x1717 /* PostgreSQL defined magic number */
#define EOF_ENCOUNTERED (-1) /* Indicator for partial read */
#define BYTES_PER_LINE 16 /* Format the binary 16 bytes per line */