PostgreSQL Source Code  git master
genericdesc.c File Reference
#include "postgres.h"
#include "access/generic_xlog.h"
#include "lib/stringinfo.h"
#include "storage/relfilelocator.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 25 of file genericdesc.c.

26 {
27  Pointer ptr = XLogRecGetData(record),
28  end = ptr + XLogRecGetDataLen(record);
29 
30  while (ptr < end)
31  {
32  OffsetNumber offset,
33  length;
34 
35  memcpy(&offset, ptr, sizeof(offset));
36  ptr += sizeof(offset);
37  memcpy(&length, ptr, sizeof(length));
38  ptr += sizeof(length);
39  ptr += length;
40 
41  if (ptr < end)
42  appendStringInfo(buf, "offset %u, length %u; ", offset, length);
43  else
44  appendStringInfo(buf, "offset %u, length %u", offset, length);
45  }
46 }
char * Pointer
Definition: c.h:472
uint16 OffsetNumber
Definition: off.h:24
static char * buf
Definition: pg_test_fsync.c:67
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:91
#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 53 of file genericdesc.c.

54 {
55  return "Generic";
56 }