PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
genericdesc.c File Reference
#include "postgres.h"
#include "access/generic_xlog.h"
#include "lib/stringinfo.h"
#include "storage/relfilenode.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

void generic_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 25 of file genericdesc.c.

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

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 
47  return;
48 }
int length(const List *list)
Definition: list.c:1271
uint16 OffsetNumber
Definition: off.h:24
char * Pointer
Definition: c.h:245
#define XLogRecGetData(decoder)
Definition: xlogreader.h:220
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
#define XLogRecGetDataLen(decoder)
Definition: xlogreader.h:221
const char* generic_identify ( uint8  info)

Definition at line 55 of file genericdesc.c.

56 {
57  return "Generic";
58 }