33 * pg_list.h
44 * interface for PostgreSQL generic linked list package
55 *
6+ * This package implements singly-linked homogeneous lists.
67 *
7- * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
8- * Portions Copyright (c) 1994, Regents of the University of California
9- *
10- * $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.46 2004/05/30 23:40:39 neilc Exp $
11- *
12- *-------------------------------------------------------------------------
13- */
14- #ifndef PG_LIST_H
15- #define PG_LIST_H
16-
17- #include "nodes/nodes.h"
18-
19- /*
20- * This package implements singly-linked homogeneous lists. It is
21- * important to have constant-time length, append, and prepend
8+ * It is important to have constant-time length, append, and prepend
229 * operations. To achieve this, we deal with two distinct data
2310 * structures:
2411 *
3825 *
3926 * (At the moment, ints and Oids are the same size, but they may not
4027 * always be so; try to be careful to maintain the distinction.)
28+ *
29+ *
30+ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
31+ * Portions Copyright (c) 1994, Regents of the University of California
32+ *
33+ * $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.47 2004/06/01 06:02:13 tgl Exp $
34+ *
35+ *-------------------------------------------------------------------------
4136 */
37+ #ifndef PG_LIST_H
38+ #define PG_LIST_H
39+
40+ #include "nodes/nodes.h"
41+
4242
4343typedef struct ListCell ListCell ;
4444
@@ -107,7 +107,7 @@ extern int list_length(List *l);
107107 * the List API: the macro lfirst() was used to mean "the data in this
108108 * cons cell". To avoid changing every usage of lfirst(), that meaning
109109 * has been kept. As a result, lfirst() takes a ListCell and returns
110- * the data it contains; to get the data in the _first_ cell of a
110+ * the data it contains; to get the data in the first cell of a
111111 * List, use linitial(). Worse, lsecond() is more closely related to
112112 * linitial() than lfirst(): given a List, lsecond() returns the data
113113 * in the second cons cell.
@@ -122,10 +122,6 @@ extern int list_length(List *l);
122122#define linitial_int (l ) lfirst_int(list_head(l))
123123#define linitial_oid (l ) lfirst_oid(list_head(l))
124124
125- #define llast (l ) lfirst(list_tail(l))
126- #define llast_int (l ) lfirst_int(list_tail(l))
127- #define llast_oid (l ) lfirst_oid(list_tail(l))
128-
129125#define lsecond (l ) lfirst(lnext(list_head(l)))
130126#define lsecond_int (l ) lfirst_int(lnext(list_head(l)))
131127#define lsecond_oid (l ) lfirst_oid(lnext(list_head(l)))
@@ -138,6 +134,10 @@ extern int list_length(List *l);
138134#define lfourth_int (l ) lfirst_int(lnext(lnext(lnext(list_head(l)))))
139135#define lfourth_oid (l ) lfirst_oid(lnext(lnext(lnext(list_head(l)))))
140136
137+ #define llast (l ) lfirst(list_tail(l))
138+ #define llast_int (l ) lfirst_int(list_tail(l))
139+ #define llast_oid (l ) lfirst_oid(list_tail(l))
140+
141141/*
142142 * Convenience macros for building fixed-length lists
143143 */
@@ -301,19 +301,4 @@ extern int length(List *list);
301301
302302#endif /* ENABLE_LIST_COMPAT */
303303
304- typedef struct FastList
305- {
306- List * list ;
307- } FastList ;
308-
309- extern void FastListInit (FastList * fl );
310- extern void FastListFromList (FastList * fl , List * list );
311- extern List * FastListValue (FastList * fl );
312- extern void makeFastList1 (FastList * fl , void * elem );
313- extern void FastAppend (FastList * fl , void * datum );
314- extern void FastAppendi (FastList * fl , int datum );
315- extern void FastAppendo (FastList * fl , Oid datum );
316- extern void FastConc (FastList * fl , List * cells );
317- extern void FastConcFast (FastList * fl1 , FastList * fl2 );
318-
319304#endif /* PG_LIST_H */
0 commit comments