1  /* do not edit automatically generated by mc from Lists.  */
       2  /* Lists.def provides an unordered list manipulation package.
       3  
       4  Copyright (C) 2001-2023 Free Software Foundation, Inc.
       5  Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
       6  
       7  This file is part of GNU Modula-2.
       8  
       9  GNU Modula-2 is free software; you can redistribute it and/or modify
      10  it under the terms of the GNU General Public License as published by
      11  the Free Software Foundation; either version 3, or (at your option)
      12  any later version.
      13  
      14  GNU Modula-2 is distributed in the hope that it will be useful, but
      15  WITHOUT ANY WARRANTY; without even the implied warranty of
      16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      17  General Public License for more details.
      18  
      19  You should have received a copy of the GNU General Public License
      20  along with GNU Modula-2; see the file COPYING3.  If not see
      21  <http://www.gnu.org/licenses/>.  */
      22  
      23  
      24  #if !defined (_Lists_H)
      25  #   define _Lists_H
      26  
      27  #include "config.h"
      28  #include "system.h"
      29  #   ifdef __cplusplus
      30  extern "C" {
      31  #   endif
      32  #   if !defined (PROC_D)
      33  #      define PROC_D
      34         typedef void (*PROC_t) (void);
      35         typedef struct { PROC_t proc; } PROC;
      36  #   endif
      37  
      38  #   include "GSYSTEM.h"
      39  #   include "GSymbolKey.h"
      40  
      41  #   if defined (_Lists_C)
      42  #      define EXTERN
      43  #   else
      44  #      define EXTERN extern
      45  #   endif
      46  
      47  #if !defined (Lists_List_D)
      48  #  define Lists_List_D
      49     typedef void *Lists_List;
      50  #endif
      51  
      52  
      53  /*
      54     InitList - creates a new list, l.
      55  */
      56  
      57  EXTERN void Lists_InitList (Lists_List *l);
      58  
      59  /*
      60     KillList - deletes the complete list, l.
      61  */
      62  
      63  EXTERN void Lists_KillList (Lists_List *l);
      64  
      65  /*
      66     PutItemIntoList - places a CARDINAL, c, into list, l.
      67  */
      68  
      69  EXTERN void Lists_PutItemIntoList (Lists_List l, unsigned int c);
      70  
      71  /*
      72     GetItemFromList - retrieves the nth WORD from list, l.
      73  */
      74  
      75  EXTERN unsigned int Lists_GetItemFromList (Lists_List l, unsigned int n);
      76  
      77  /*
      78     GetIndexOfList - returns the index for WORD, c, in list, l.
      79                      If more than one CARDINAL, c, exists the index
      80                      for the first is returned.
      81  */
      82  
      83  EXTERN unsigned int Lists_GetIndexOfList (Lists_List l, unsigned int c);
      84  
      85  /*
      86     NoOfItemsInList - returns the number of items in list, l.
      87  */
      88  
      89  EXTERN unsigned int Lists_NoOfItemsInList (Lists_List l);
      90  
      91  /*
      92     IncludeItemIntoList - adds a WORD, c, into a list providing
      93                           the value does not already exist.
      94  */
      95  
      96  EXTERN void Lists_IncludeItemIntoList (Lists_List l, unsigned int c);
      97  
      98  /*
      99     RemoveItemFromList - removes a WORD, c, from a list.
     100                          It assumes that this value only appears once.
     101  */
     102  
     103  EXTERN void Lists_RemoveItemFromList (Lists_List l, unsigned int c);
     104  
     105  /*
     106     IsItemInList - returns true if a WORD, c, was found in list, l.
     107  */
     108  
     109  EXTERN unsigned int Lists_IsItemInList (Lists_List l, unsigned int c);
     110  
     111  /*
     112     ForeachItemInListDo - calls procedure, P, foreach item in list, l.
     113  */
     114  
     115  EXTERN void Lists_ForeachItemInListDo (Lists_List l, SymbolKey_PerformOperation P);
     116  
     117  /*
     118     DuplicateList - returns a duplicate list derived from, l.
     119  */
     120  
     121  EXTERN Lists_List Lists_DuplicateList (Lists_List l);
     122  #   ifdef __cplusplus
     123  }
     124  #   endif
     125  
     126  #   undef EXTERN
     127  #endif