1*40411Sbostic /*- 2*40411Sbostic * LstClose.c -- 3*40411Sbostic * Close a list for sequential access. 4*40411Sbostic * The sequential functions access the list in a slightly different way. 5*40411Sbostic * CurPtr points to their idea of the current node in the list and they 6*40411Sbostic * access the list based on it. Because the list is circular, Lst_Next 7*40411Sbostic * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be 8*40411Sbostic * used to determine when to stop. 9*40411Sbostic * 10*40411Sbostic * Copyright (c) 1988 by University of California Regents 11*40411Sbostic * 12*40411Sbostic * Permission to use, copy, modify, and distribute this 13*40411Sbostic * software and its documentation for any purpose and without 14*40411Sbostic * fee is hereby granted, provided that the above copyright 15*40411Sbostic * notice appears in all copies. Neither the University of California nor 16*40411Sbostic * Adam de Boor makes any representations about the suitability of this 17*40411Sbostic * software for any purpose. It is provided "as is" without 18*40411Sbostic * express or implied warranty. 19*40411Sbostic */ 20*40411Sbostic #ifndef lint 21*40411Sbostic static char *rcsid = 22*40411Sbostic "$Id: lstClose.c,v 1.6 88/11/17 20:51:55 adam Exp $ SPRITE (Berkeley)"; 23*40411Sbostic #endif lint 24*40411Sbostic 25*40411Sbostic #include "lstInt.h" 26*40411Sbostic 27*40411Sbostic /*- 28*40411Sbostic *----------------------------------------------------------------------- 29*40411Sbostic * Lst_Close -- 30*40411Sbostic * Close a list which was opened for sequential access. 31*40411Sbostic * 32*40411Sbostic * Results: 33*40411Sbostic * None. 34*40411Sbostic * 35*40411Sbostic * Side Effects: 36*40411Sbostic * The list is closed. 37*40411Sbostic * 38*40411Sbostic *----------------------------------------------------------------------- 39*40411Sbostic */ 40*40411Sbostic void 41*40411Sbostic Lst_Close (l) 42*40411Sbostic Lst l; /* The list to close */ 43*40411Sbostic { 44*40411Sbostic register List list = (List) l; 45*40411Sbostic 46*40411Sbostic if (LstValid(l) == TRUE) { 47*40411Sbostic list->isOpen = FALSE; 48*40411Sbostic list->atEnd = Unknown; 49*40411Sbostic } 50*40411Sbostic } 51*40411Sbostic 52