/* --------------------------------------------------- */
/* Header-file BASIS 1.0, (C) Wabnig Harald, 25.5.2002 */
/* --------------------------------------------------- */

#ifndef LISTE_INCLUDE
#define LISTE_INCLUDE

/* Default-Cache-Size (if none is given in ltmeminit) for List-Structures */
#define DEFLSMAX	100

typedef struct __lnode * __lptr;
typedef struct __lnode {
  void * info;
  __lptr next;
} __lst;

typedef struct {
  int lnr;
  __lptr lptr;
  __lptr list;
} List;

extern void lsmeminit(int);
extern void lsinit(List *);
extern void Make_List(List **);

extern int lsempty(List *);
extern int lsnumber(List *);

extern void lsinsert(List *, void *);
extern void lssortinsert(List *, void *);
extern int lsdelete(List *, void *);

extern int lsdelfst(List *, void **);

extern int lsfind(List *, void *); /* checks if element is in list */
extern int lschange(List *, void * old, void * new);

extern void lsfree(List *);
extern void lsfreeall(List *);

extern void lsunify(List *); /* convert a list of lists into a single list */

extern void lsinitread(List *);
extern int lsread(List *, void **);
extern int lsreadfst(List *, void **);
extern int lsdelread(List *, void **);

extern void lsinitsortread(List *);
extern int lssortread(List *, void **);

extern void lscopy(List *, List *);
extern void lscat(List *, List *);
extern void lssortcat(List *, List *);

#define LSSORT_MAXITEMS		10000
extern void lssort(List * ls, void * sortfunc);

extern void lsmoveleft(List *, void *);
extern void lsmoveright(List *, void *);

#endif
