MCPcopy Create free account
hub / github.com/apache/cloudberry / simple_string_list_append

Function simple_string_list_append

src/fe_utils/simple_list.c:62–79  ·  view source on GitHub ↗

* Append a string to the list. * * The given string is copied, so it need not survive past the call. */

Source from the content-addressed store, hash-verified

60 * The given string is copied, so it need not survive past the call.
61 */
62void
63simple_string_list_append(SimpleStringList *list, const char *val)
64{
65 SimpleStringListCell *cell;
66
67 cell = (SimpleStringListCell *)
68 pg_malloc(offsetof(SimpleStringListCell, val) + strlen(val) + 1);
69
70 cell->next = NULL;
71 cell->touched = false;
72 strcpy(cell->val, val);
73
74 if (list->tail)
75 list->tail->next = cell;
76 else
77 list->head = cell;
78 list->tail = cell;
79}
80
81/*
82 * Is string present in the list?

Callers 14

mainFunction · 0.85
verify_backup_directoryFunction · 0.85
verify_backup_fileFunction · 0.85
mainFunction · 0.85
expand_dbname_patternsFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
vacuum_one_databaseFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 1

pg_mallocFunction · 0.85

Tested by

no test coverage detected