PostgreSQL Source Code  git master
rmgrdesc_utils.c File Reference
#include "postgres.h"
#include "access/rmgrdesc_utils.h"
#include "storage/off.h"
Include dependency graph for rmgrdesc_utils.c:

Go to the source code of this file.

Functions

void array_desc (StringInfo buf, void *array, size_t elem_size, int count, void(*elem_desc)(StringInfo buf, void *elem, void *data), void *data)
 
void offset_elem_desc (StringInfo buf, void *offset, void *data)
 
void redirect_elem_desc (StringInfo buf, void *offset, void *data)
 
void oid_elem_desc (StringInfo buf, void *relid, void *data)
 

Function Documentation

◆ array_desc()

void array_desc ( StringInfo  buf,
void *  array,
size_t  elem_size,
int  count,
void(*)(StringInfo buf, void *elem, void *data elem_desc,
void *  data 
)

Definition at line 24 of file rmgrdesc_utils.c.

27 {
28  if (count == 0)
29  {
31  return;
32  }
34  for (int i = 0; i < count; i++)
35  {
36  elem_desc(buf, (char *) array + elem_size * i, data);
37  if (i < count - 1)
39  }
41 }
int i
Definition: isn.c:73
const void * data
static char * buf
Definition: pg_test_fsync.c:73
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:182
void appendStringInfoChar(StringInfo str, char ch)
Definition: stringinfo.c:194

References appendStringInfoChar(), appendStringInfoString(), buf, data, and i.

Referenced by delvacuum_desc(), heap2_desc(), heap_desc(), and plan_elem_desc().

◆ offset_elem_desc()

void offset_elem_desc ( StringInfo  buf,
void *  offset,
void *  data 
)

Definition at line 44 of file rmgrdesc_utils.c.

45 {
46  appendStringInfo(buf, "%u", *(OffsetNumber *) offset);
47 }
uint16 OffsetNumber
Definition: off.h:24
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:97

References appendStringInfo(), and buf.

Referenced by delvacuum_desc(), heap2_desc(), and plan_elem_desc().

◆ oid_elem_desc()

void oid_elem_desc ( StringInfo  buf,
void *  relid,
void *  data 
)

Definition at line 58 of file rmgrdesc_utils.c.

59 {
60  appendStringInfo(buf, "%u", *(Oid *) relid);
61 }
unsigned int Oid
Definition: postgres_ext.h:31

References appendStringInfo(), and buf.

Referenced by heap_desc().

◆ redirect_elem_desc()

void redirect_elem_desc ( StringInfo  buf,
void *  offset,
void *  data 
)

Definition at line 50 of file rmgrdesc_utils.c.

51 {
52  OffsetNumber *new_offset = (OffsetNumber *) offset;
53 
54  appendStringInfo(buf, "%u->%u", new_offset[0], new_offset[1]);
55 }

References appendStringInfo(), and buf.

Referenced by heap2_desc().