replace hash.c; speedup/cleanup from Chris Torek
[unix-history] / usr / src / usr.bin / make / lst.lib / lstInit.c
CommitLineData
bb2109e7
KB
1/*
2 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
3 * All rights reserved.
c65fedcf 4 *
bb2109e7
KB
5 * This code is derived from software contributed to Berkeley by
6 * Adam de Boor.
c65fedcf 7 *
f15db449 8 * %sccs.include.redist.c%
c65fedcf 9 */
bb2109e7 10
c65fedcf 11#ifndef lint
fc46faab 12static char sccsid[] = "@(#)lstInit.c 5.4 (Berkeley) %G%";
bb2109e7
KB
13#endif /* not lint */
14
15/*-
16 * init.c --
17 * Initialize a new linked list.
18 */
c65fedcf
KB
19
20#include "lstInt.h"
21
22/*-
23 *-----------------------------------------------------------------------
24 * Lst_Init --
25 * Create and initialize a new list.
26 *
27 * Results:
28 * The created list.
29 *
30 * Side Effects:
31 * A list is created, what else?
32 *
33 *-----------------------------------------------------------------------
34 */
35Lst
36Lst_Init(circ)
37 Boolean circ; /* TRUE if the list should be made circular */
38{
39 register List nList;
40
41 PAlloc (nList, List);
42
43 nList->firstPtr = NilListNode;
44 nList->lastPtr = NilListNode;
45 nList->isOpen = FALSE;
46 nList->isCirc = circ;
47 nList->atEnd = Unknown;
48
49 return ((Lst)nList);
50}