PostgreSQL Source Code git master
Loading...
Searching...
No Matches
genericdesc.c File Reference
#include "postgres.h"
#include "access/generic_xlog.h"
#include "lib/stringinfo.h"
Include dependency graph for genericdesc.c:

Go to the source code of this file.

Functions

void generic_desc (StringInfo buf, XLogReaderState *record)
 
const chargeneric_identify (uint8 info)
 

Function Documentation

◆ generic_desc()

void generic_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 24 of file genericdesc.c.

25{
26 const char *ptr = XLogRecGetData(record);
27 const char *end = ptr + XLogRecGetDataLen(record);
28
29 while (ptr < end)
30 {
31 OffsetNumber offset,
32 length;
33
34 memcpy(&offset, ptr, sizeof(offset));
35 ptr += sizeof(offset);
36 memcpy(&length, ptr, sizeof(length));
37 ptr += sizeof(length);
38 ptr += length;
39
40 if (ptr < end)
41 appendStringInfo(buf, "offset %u, length %u; ", offset, length);
42 else
43 appendStringInfo(buf, "offset %u, length %u", offset, length);
44 }
45}
uint16 OffsetNumber
Definition off.h:24
static char buf[DEFAULT_XLOG_SEG_SIZE]
static int fb(int x)
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition stringinfo.c:145
#define XLogRecGetDataLen(decoder)
Definition xlogreader.h:415
#define XLogRecGetData(decoder)
Definition xlogreader.h:414

References appendStringInfo(), buf, fb(), XLogRecGetData, and XLogRecGetDataLen.

◆ generic_identify()

const char * generic_identify ( uint8  info)

Definition at line 52 of file genericdesc.c.

53{
54 return "Generic";
55}