Unmark gen_random_uuid() function leakproof.
[pgsql.git] / src / include / fe_utils / simple_list.h
blobc83ab6f77e453588f4acfcb2859e8c7e409cbba2
1 /*-------------------------------------------------------------------------
3 * Simple list facilities for frontend code
5 * Data structures for simple lists of OIDs, strings, and pointers. The
6 * support for these is very primitive compared to the backend's List
7 * facilities, but it's all we need in, eg, pg_dump.
10 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
11 * Portions Copyright (c) 1994, Regents of the University of California
13 * src/include/fe_utils/simple_list.h
15 *-------------------------------------------------------------------------
17 #ifndef SIMPLE_LIST_H
18 #define SIMPLE_LIST_H
20 typedef struct SimpleOidListCell
22 struct SimpleOidListCell *next;
23 Oid val;
24 } SimpleOidListCell;
26 typedef struct SimpleOidList
28 SimpleOidListCell *head;
29 SimpleOidListCell *tail;
30 } SimpleOidList;
32 typedef struct SimpleStringListCell
34 struct SimpleStringListCell *next;
35 bool touched; /* true, when this string was searched and
36 * touched */
37 char val[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string here */
38 } SimpleStringListCell;
40 typedef struct SimpleStringList
42 SimpleStringListCell *head;
43 SimpleStringListCell *tail;
44 } SimpleStringList;
46 typedef struct SimplePtrListCell
48 struct SimplePtrListCell *next;
49 void *ptr;
50 } SimplePtrListCell;
52 typedef struct SimplePtrList
54 SimplePtrListCell *head;
55 SimplePtrListCell *tail;
56 } SimplePtrList;
58 extern void simple_oid_list_append(SimpleOidList *list, Oid val);
59 extern bool simple_oid_list_member(SimpleOidList *list, Oid val);
60 extern void simple_oid_list_destroy(SimpleOidList *list);
62 extern void simple_string_list_append(SimpleStringList *list, const char *val);
63 extern bool simple_string_list_member(SimpleStringList *list, const char *val);
64 extern void simple_string_list_destroy(SimpleStringList *list);
66 extern const char *simple_string_list_not_touched(SimpleStringList *list);
68 extern void simple_ptr_list_append(SimplePtrList *list, void *ptr);
69 extern void simple_ptr_list_destroy(SimplePtrList *list);
71 #endif /* SIMPLE_LIST_H */