upgraded to the latest NetBSD version
[unix-history] / usr / src / usr.bin / make / lst.lib / lstClose.c
CommitLineData
bb2109e7 1/*
f5ed9d08
KB
2 * Copyright (c) 1988, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
bb2109e7
KB
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Adam de Boor.
7 *
f15db449 8 * %sccs.include.redist.c%
bb2109e7
KB
9 */
10
11#ifndef lint
bfdbffbb 12static char sccsid[] = "@(#)lstClose.c 8.2 (Berkeley) %G%";
bb2109e7
KB
13#endif /* not lint */
14
c65fedcf
KB
15/*-
16 * LstClose.c --
17 * Close a list for sequential access.
18 * The sequential functions access the list in a slightly different way.
19 * CurPtr points to their idea of the current node in the list and they
20 * access the list based on it. Because the list is circular, Lst_Next
21 * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be
22 * used to determine when to stop.
c65fedcf 23 */
c65fedcf
KB
24
25#include "lstInt.h"
26
27/*-
28 *-----------------------------------------------------------------------
29 * Lst_Close --
30 * Close a list which was opened for sequential access.
31 *
32 * Results:
33 * None.
34 *
35 * Side Effects:
36 * The list is closed.
37 *
38 *-----------------------------------------------------------------------
39 */
40void
41Lst_Close (l)
42 Lst l; /* The list to close */
43{
44 register List list = (List) l;
45
46 if (LstValid(l) == TRUE) {
47 list->isOpen = FALSE;
48 list->atEnd = Unknown;
49 }
50}
51