PostgreSQL Source Code git master
Loading...
Searching...
No Matches
simple_list.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SimpleOidListCell
 
struct  SimpleOidList
 
struct  SimpleStringListCell
 
struct  SimpleStringList
 
struct  SimplePtrListCell
 
struct  SimplePtrList
 

Typedefs

typedef struct SimpleOidListCell SimpleOidListCell
 
typedef struct SimpleOidList SimpleOidList
 
typedef struct SimpleStringListCell SimpleStringListCell
 
typedef struct SimpleStringList SimpleStringList
 
typedef struct SimplePtrListCell SimplePtrListCell
 
typedef struct SimplePtrList SimplePtrList
 

Functions

void simple_oid_list_append (SimpleOidList *list, Oid val)
 
bool simple_oid_list_member (SimpleOidList *list, Oid val)
 
void simple_oid_list_destroy (SimpleOidList *list)
 
void simple_string_list_append (SimpleStringList *list, const char *val)
 
bool simple_string_list_member (SimpleStringList *list, const char *val)
 
void simple_string_list_destroy (SimpleStringList *list)
 
const charsimple_string_list_not_touched (SimpleStringList *list)
 
void simple_ptr_list_append (SimplePtrList *list, void *ptr)
 
void simple_ptr_list_destroy (SimplePtrList *list)
 

Typedef Documentation

◆ SimpleOidList

◆ SimpleOidListCell

◆ SimplePtrList

◆ SimplePtrListCell

◆ SimpleStringList

◆ SimpleStringListCell

Function Documentation

◆ simple_oid_list_append()

void simple_oid_list_append ( SimpleOidList list,
Oid  val 
)
extern

Definition at line 26 of file simple_list.c.

27{
29
31 cell->next = NULL;
32 cell->val = val;
33
34 if (list->tail)
35 list->tail->next = cell;
36 else
37 list->head = cell;
38 list->tail = cell;
39}
void * pg_malloc(size_t size)
Definition fe_memutils.c:47
long val
Definition informix.c:689
static int fb(int x)
struct SimpleOidListCell * next
Definition simple_list.h:22

References fb(), SimpleOidListCell::next, pg_malloc(), SimpleOidListCell::val, and val.

Referenced by expand_extension_name_patterns(), expand_foreign_server_name_patterns(), expand_schema_name_patterns(), expand_table_name_patterns(), and get_parallel_tabidx_list().

◆ simple_oid_list_destroy()

void simple_oid_list_destroy ( SimpleOidList list)
extern

Definition at line 106 of file simple_list.c.

107{
108 SimpleOidListCell *cell;
109
110 cell = list->head;
111 while (cell != NULL)
112 {
114
115 next = cell->next;
116 pg_free(cell);
117 cell = next;
118 }
119}
static int32 next
Definition blutils.c:225
void pg_free(void *ptr)

References fb(), next, SimpleOidListCell::next, and pg_free().

Referenced by reindex_one_database().

◆ simple_oid_list_member()

bool simple_oid_list_member ( SimpleOidList list,
Oid  val 
)
extern

Definition at line 45 of file simple_list.c.

46{
48
49 for (cell = list->head; cell; cell = cell->next)
50 {
51 if (cell->val == val)
52 return true;
53 }
54 return false;
55}

References SimpleOidListCell::next, SimpleOidListCell::val, and val.

Referenced by makeTableDataInfo(), processExtensionTables(), selectDumpableExtension(), selectDumpableNamespace(), and selectDumpableTable().

◆ simple_ptr_list_append()

void simple_ptr_list_append ( SimplePtrList list,
void ptr 
)
extern

Definition at line 162 of file simple_list.c.

163{
164 SimplePtrListCell *cell;
165
167 cell->next = NULL;
168 cell->ptr = ptr;
169
170 if (list->tail)
171 list->tail->next = cell;
172 else
173 list->head = cell;
174 list->tail = cell;
175}
struct SimplePtrListCell * next
Definition simple_list.h:48

References fb(), SimplePtrListCell::next, pg_malloc(), and SimplePtrListCell::ptr.

Referenced by compile_database_list(), compile_relation_list_one_db(), flagInhIndexes(), and precheck_tar_backup_file().

◆ simple_ptr_list_destroy()

void simple_ptr_list_destroy ( SimplePtrList list)
extern

Definition at line 181 of file simple_list.c.

182{
183 SimplePtrListCell *cell;
184
185 cell = list->head;
186 while (cell != NULL)
187 {
189
190 next = cell->next;
191 pg_free(cell);
192 cell = next;
193 }
194}

References fb(), next, SimplePtrListCell::next, and pg_free().

Referenced by verify_tar_backup().

◆ simple_string_list_append()

void simple_string_list_append ( SimpleStringList list,
const char val 
)
extern

◆ simple_string_list_destroy()

void simple_string_list_destroy ( SimpleStringList list)
extern

Definition at line 125 of file simple_list.c.

126{
128
129 cell = list->head;
130 while (cell != NULL)
131 {
133
134 next = cell->next;
135 pg_free(cell);
136 cell = next;
137 }
138}

References fb(), next, SimpleStringListCell::next, and pg_free().

Referenced by free_retrieved_objects(), get_parallel_tabidx_list(), and reindex_one_database().

◆ simple_string_list_member()

bool simple_string_list_member ( SimpleStringList list,
const char val 
)
extern

Definition at line 87 of file simple_list.c.

88{
90
91 for (cell = list->head; cell; cell = cell->next)
92 {
93 if (strcmp(cell->val, val) == 0)
94 {
95 cell->touched = true;
96 return true;
97 }
98 }
99 return false;
100}

References fb(), SimpleStringListCell::next, SimpleStringListCell::touched, SimpleStringListCell::val, and val.

Referenced by _tocEntryRequired(), dumpDatabases(), and main().

◆ simple_string_list_not_touched()

const char * simple_string_list_not_touched ( SimpleStringList list)
extern

Definition at line 144 of file simple_list.c.

145{
147
148 for (cell = list->head; cell; cell = cell->next)
149 {
150 if (!cell->touched)
151 return cell->val;
152 }
153 return NULL;
154}

References fb(), SimpleStringListCell::next, SimpleStringListCell::touched, and SimpleStringListCell::val.

Referenced by StrictNamesCheck().