PostgreSQL Source Code  git master
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 char * generic_identify (uint8 info)
 

Function Documentation

◆ generic_desc()

void generic_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 24 of file genericdesc.c.

25 {
26  Pointer ptr = XLogRecGetData(record),
27  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 }
char * Pointer
Definition: c.h:486
uint16 OffsetNumber
Definition: off.h:24
static char * buf
Definition: pg_test_fsync.c:73
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:97
#define XLogRecGetDataLen(decoder)
Definition: xlogreader.h:416
#define XLogRecGetData(decoder)
Definition: xlogreader.h:415

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

◆ generic_identify()

const char* generic_identify ( uint8  info)

Definition at line 52 of file genericdesc.c.

53 {
54  return "Generic";
55 }