home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / precog2_1.lha / Precognition2_1 / include / StringList.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-04  |  2.0 KB  |  73 lines

  1. /* ==========================================================================
  2. **
  3. **                         StringList.h
  4. ** ©1991 WILLISoft
  5. **
  6. ** ==========================================================================
  7. */
  8.  
  9. #ifndef STRINGLIST_H
  10. #define STRINGLIST_H
  11.  
  12. #include <exec/types.h>
  13. #include "parms.h"
  14.  
  15. typedef struct StringList
  16. {
  17.    char   **Entries;     /* Pointer to an array of strings. */
  18.    UBYTE   *Qualifiers;  /* An array of byte flags */
  19.    USHORT   nEntries;    /* # of entries. */
  20. } StringList;
  21.  
  22.  
  23. void StringList_Init __PARMS((
  24.                            StringList *slist, BOOL Qualify
  25.                     ));
  26.    /*
  27.    ** If 'Qualify == TRUE', then the Qualifier array is used,
  28.    ** otherwise it is not.
  29.    */
  30.  
  31. void StringList_CleanUp __PARMS((
  32.                           StringList *slist
  33.                        ));
  34.  
  35. BOOL StringList_AddString __PARMS((
  36.                            StringList *slist,
  37.                            char       *string,
  38.                            BYTE        qualifier
  39.                          ));
  40.    /*
  41.    ** Returns false if couldn't allocate memory.
  42.    */
  43.  
  44. BOOL StringList_AddStrings __PARMS((
  45.                             StringList  *slist,
  46.                             char       **strings,
  47.                             BYTE        *qualifiers
  48.                           ));
  49.    /*
  50.    ** This is an easy way of adding a set of strings to a list.
  51.    ** 'strings' is a NULL terminated list of strings that you
  52.    ** added (e.g. {"This", "That", "The other", NULL}; )
  53.    ** 'qualifiers', if not NULL, is an array of BYTE values
  54.    ** to use as the qualifiers.  (These do NOT need to be NULL
  55.    ** terminated).
  56.    */
  57.  
  58.  
  59. BOOL StringList_DeleteString __PARMS(( StringList *slist, USHORT n ));
  60.    /*
  61.    ** 'n' is the ordinal number of the string from the
  62.    ** beginning of the list.
  63.    */
  64.  
  65. BOOL StringList_DeleteAllStrings __PARMS(( StringList *slist ));
  66.  
  67.  
  68. void StringList_Sort __PARMS(( StringList *slist ));
  69.  
  70. BOOL StringList_Dup __PARMS(( StringList *source, StringList *target ));
  71.  
  72. #endif
  73.