home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594b.lha / Precognition_rel1 / StringList.h < prev    next >
C/C++ Source or Header  |  1991-12-12  |  1KB  |  54 lines

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