Ignore:
Timestamp:
Nov 26, 2002, 10:24:54 PM (23 years ago)
Author:
bird
Message:

Import of RELENG_4_7_0_RELEASE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FREEBSD/src/kmk/lst.h

    r10 r24  
    11/*
    2  * Copyright (c) 1988, 1989, 1990, 1993
    3  *      The Regents of the University of California.  All rights reserved.
     2 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
    43 * Copyright (c) 1988, 1989 by Adam de Boor
    54 * Copyright (c) 1989 by Berkeley Softworks
     
    3736 * SUCH DAMAGE.
    3837 *
    39  *      @(#)lst.h       8.2 (Berkeley) 4/28/95
    40  * $FreeBSD: src/usr.bin/make/lst.h,v 1.15 2002/09/17 21:29:06 jmallett Exp $
     38 *      from: @(#)lst.h 8.1 (Berkeley) 6/6/93
     39 * $FreeBSD: src/usr.bin/make/lst.h,v 1.9 1999/08/28 01:03:32 peter Exp $
    4140 */
    4241
     
    4645 */
    4746#ifndef _LST_H_
    48 #define _LST_H_
     47#define _LST_H_
    4948
    5049#include        <sys/param.h>
     50#ifdef __STDC__
    5151#include        <stdlib.h>
     52#endif
    5253#include        "sprite.h"
    5354
     
    5960typedef struct  LstNode *LstNode;
    6061
     62#define NILLST          ((Lst) NIL)
     63#define NILLNODE        ((LstNode) NIL)
     64
    6165/*
    6266 * NOFREE can be used as the freeProc to Lst_Destroy when the elements are
     
    6468 * NOCOPY performs similarly when given as the copyProc to Lst_Duplicate.
    6569 */
    66 #define NOFREE          ((void (*)(void *)) 0)
    67 #define NOCOPY          ((void * (*)(void *)) 0)
     70#define NOFREE          ((void (*) __P((ClientData))) 0)
     71#define NOCOPY          ((ClientData (*) __P((ClientData))) 0)
    6872
    69 #define LST_CONCNEW     0   /* create new LstNode's when using Lst_Concat */
    70 #define LST_CONCLINK    1   /* relink LstNode's when using Lst_Concat */
     73#define LST_CONCNEW     0   /* create new LstNode's when using Lst_Concat */
     74#define LST_CONCLINK    1   /* relink LstNode's when using Lst_Concat */
    7175
    7276/*
     
    7478 */
    7579/* Create a new list */
    76 Lst             Lst_Init(Boolean);
     80Lst             Lst_Init __P((Boolean));
    7781/* Duplicate an existing list */
    78 Lst             Lst_Duplicate(Lst, void * (*)(void *));
     82Lst             Lst_Duplicate __P((Lst, ClientData (*)(ClientData)));
    7983/* Destroy an old one */
    80 void            Lst_Destroy(Lst, void (*)(void *));
     84void            Lst_Destroy __P((Lst, void (*)(ClientData)));
    8185/* True if list is empty */
    82 Boolean         Lst_IsEmpty(Lst);
     86Boolean         Lst_IsEmpty __P((Lst));
    8387
    8488/*
     
    8690 */
    8791/* Insert an element before another */
    88 ReturnStatus    Lst_Insert(Lst, LstNode, void *);
     92ReturnStatus    Lst_Insert __P((Lst, LstNode, ClientData));
    8993/* Insert an element after another */
    90 ReturnStatus    Lst_Append(Lst, LstNode, void *);
     94ReturnStatus    Lst_Append __P((Lst, LstNode, ClientData));
    9195/* Place an element at the front of a lst. */
    92 ReturnStatus    Lst_AtFront(Lst, void *);
     96ReturnStatus    Lst_AtFront __P((Lst, ClientData));
    9397/* Place an element at the end of a lst. */
    94 ReturnStatus    Lst_AtEnd(Lst, void *);
     98ReturnStatus    Lst_AtEnd __P((Lst, ClientData));
    9599/* Remove an element */
    96 ReturnStatus    Lst_Remove(Lst, LstNode);
     100ReturnStatus    Lst_Remove __P((Lst, LstNode));
    97101/* Replace a node with a new value */
    98 ReturnStatus    Lst_Replace(LstNode, void *);
     102ReturnStatus    Lst_Replace __P((LstNode, ClientData));
    99103/* Concatenate two lists */
    100 ReturnStatus    Lst_Concat(Lst, Lst, int);
     104ReturnStatus    Lst_Concat __P((Lst, Lst, int));
    101105
    102106/*
     
    104108 */
    105109/* Return first element in list */
    106 LstNode         Lst_First(Lst);
     110LstNode         Lst_First __P((Lst));
    107111/* Return last element in list */
    108 LstNode         Lst_Last(Lst);
     112LstNode         Lst_Last __P((Lst));
    109113/* Return successor to given element */
    110 LstNode         Lst_Succ(LstNode);
     114LstNode         Lst_Succ __P((LstNode));
    111115/* Get datum from LstNode */
    112 void *  Lst_Datum(LstNode);
     116ClientData      Lst_Datum __P((LstNode));
    113117
    114118/*
     
    116120 */
    117121/* Find an element in a list */
    118 LstNode         Lst_Find(Lst, void *, int (*)(void *, void *));
     122LstNode         Lst_Find __P((Lst, ClientData,
     123                              int (*)(ClientData, ClientData)));
    119124/* Find an element starting from somewhere */
    120 LstNode         Lst_FindFrom(Lst, LstNode, void *, int (*cProc)(void *, void *));
     125LstNode         Lst_FindFrom __P((Lst, LstNode, ClientData,
     126                                  int (*cProc)(ClientData, ClientData)));
    121127/*
    122128 * See if the given datum is on the list. Returns the LstNode containing
    123129 * the datum
    124130 */
    125 LstNode         Lst_Member(Lst, void *);
     131LstNode         Lst_Member __P((Lst, ClientData));
    126132/* Apply a function to all elements of a lst */
    127 void            Lst_ForEach(Lst, int (*)(void *, void *), void *);
     133void            Lst_ForEach __P((Lst, int (*)(ClientData, ClientData),
     134                                 ClientData));
    128135/*
    129136 * Apply a function to all elements of a lst starting from a certain point.
     
    131138 * beginning of the list again.
    132139 */
    133 void            Lst_ForEachFrom(Lst, LstNode, int (*)(void *, void *), void *);
     140void            Lst_ForEachFrom __P((Lst, LstNode,
     141                                     int (*)(ClientData, ClientData),
     142                                     ClientData));
    134143/*
    135144 * these functions are for dealing with a list as a table, of sorts.
     
    138147 */
    139148/* Open the list */
    140 ReturnStatus    Lst_Open(Lst);
     149ReturnStatus    Lst_Open __P((Lst));
    141150/* Next element please */
    142 LstNode         Lst_Next(Lst);
     151LstNode         Lst_Next __P((Lst));
    143152/* Done yet? */
    144 Boolean         Lst_IsAtEnd(Lst);
     153Boolean         Lst_IsAtEnd __P((Lst));
    145154/* Finish table access */
    146 void            Lst_Close(Lst);
     155void            Lst_Close __P((Lst));
    147156
    148157/*
     
    150159 */
    151160/* Place an element at tail of queue */
    152 ReturnStatus    Lst_EnQueue(Lst, void *);
     161ReturnStatus    Lst_EnQueue __P((Lst, ClientData));
    153162/* Remove an element from head of queue */
    154 void *  Lst_DeQueue(Lst);
     163ClientData      Lst_DeQueue __P((Lst));
    155164
    156165#endif /* _LST_H_ */
Note: See TracChangeset for help on using the changeset viewer.