131a9abe6Sbostic /*
2cd79ddd6Sbostic * Copyright (c) 1988, 1989, 1990, 1993
3cd79ddd6Sbostic * The Regents of the University of California. All rights reserved.
431a9abe6Sbostic *
531a9abe6Sbostic * This code is derived from software contributed to Berkeley by
631a9abe6Sbostic * Adam de Boor.
731a9abe6Sbostic *
82b713f00Sbostic * %sccs.include.redist.c%
931a9abe6Sbostic */
1031a9abe6Sbostic
1131a9abe6Sbostic #ifndef lint
12*2bb4d294Schristos static char sccsid[] = "@(#)lstForEach.c 8.2 (Berkeley) 04/28/95";
1331a9abe6Sbostic #endif /* not lint */
1431a9abe6Sbostic
1586d9cf80Sbostic /*-
1686d9cf80Sbostic * LstForeach.c --
1786d9cf80Sbostic * Perform a given function on all elements of a list.
1886d9cf80Sbostic */
1986d9cf80Sbostic
2086d9cf80Sbostic #include "lstInt.h"
2186d9cf80Sbostic
2286d9cf80Sbostic /*-
2386d9cf80Sbostic *-----------------------------------------------------------------------
2486d9cf80Sbostic * Lst_ForEach --
2586d9cf80Sbostic * Apply the given function to each element of the given list. The
2686d9cf80Sbostic * function should return 0 if Lst_ForEach should continue and non-
2786d9cf80Sbostic * zero if it should abort.
2886d9cf80Sbostic *
2986d9cf80Sbostic * Results:
3086d9cf80Sbostic * None.
3186d9cf80Sbostic *
3286d9cf80Sbostic * Side Effects:
3386d9cf80Sbostic * Only those created by the passed-in function.
3486d9cf80Sbostic *
3586d9cf80Sbostic *-----------------------------------------------------------------------
3686d9cf80Sbostic */
3786d9cf80Sbostic /*VARARGS2*/
3886d9cf80Sbostic void
Lst_ForEach(l,proc,d)3986d9cf80Sbostic Lst_ForEach (l, proc, d)
4086d9cf80Sbostic Lst l;
41*2bb4d294Schristos register int (*proc) __P((ClientData, ClientData));
4286d9cf80Sbostic register ClientData d;
4386d9cf80Sbostic {
4486d9cf80Sbostic Lst_ForEachFrom(l, Lst_First(l), proc, d);
4586d9cf80Sbostic }
4686d9cf80Sbostic
47