home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / utils / precognition / include / stringlist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-24  |  2.4 KB  |  96 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.  
  14. typedef struct StringList
  15. {
  16.    char   **Entries;     /* Pointer to an array of strings. */
  17.    UBYTE   *Qualifiers;  /* An array of byte flags */
  18.    USHORT   nEntries;    /* # of entries. */
  19. } StringList;
  20.  
  21.  
  22. void StringList_Init( 
  23.    #ifdef ANSI_HEADERS
  24.                            StringList *slist, BOOL Qualify 
  25.    #endif
  26.                     );
  27.    /*
  28.    ** If 'Qualify == TRUE', then the Qualifier array is used,
  29.    ** otherwise it is not.
  30.    */
  31.  
  32. void StringList_CleanUp( 
  33.    #ifdef ANSI_HEADERS
  34.                            StringList *slist 
  35.    #endif
  36.                        );
  37.  
  38. BOOL StringList_AddString( 
  39.    #ifdef ANSI_HEADERS
  40.                            StringList *slist,
  41.                            char       *string,
  42.                            BYTE        qualifier 
  43.    #endif
  44.                          );
  45.    /*
  46.    ** Returns false if couldn't allocate memory.
  47.    */
  48.  
  49. BOOL StringList_AddStrings( 
  50.    #ifdef ANSI_HEADERS
  51.                             StringList  *slist,
  52.                             char       **strings,
  53.                             BYTE        *qualifiers 
  54.    #endif
  55.                           );
  56.    /*
  57.    ** This is an easy way of adding a set of strings to a list.
  58.    ** 'strings' is a NULL terminated list of strings that you
  59.    ** added (e.g. {"This", "That", "The other", NULL}; )
  60.    ** 'qualifiers', if not NULL, is an array of BYTE values
  61.    ** to use as the qualifiers.  (These do NOT need to be NULL
  62.    ** terminated).
  63.    */
  64.  
  65.  
  66. BOOL StringList_DeleteString( 
  67.    #ifdef ANSI_HEADERS
  68.                               StringList *slist, USHORT n 
  69.    #endif
  70.                             );
  71.    /*
  72.    ** 'n' is the ordinal number of the string from the
  73.    ** beginning of the list.
  74.    */
  75.  
  76. BOOL StringList_DeleteAllStrings( 
  77.    #ifdef ANSI_HEADERS
  78.                                     StringList *slist 
  79.    #endif
  80.                                 );
  81.  
  82.  
  83. void StringList_Sort( 
  84.    #ifdef ANSI_HEADERS
  85.                         StringList *slist 
  86.    #endif
  87.                     );
  88.  
  89. BOOL StringList_Dup( 
  90.    #ifdef ANSI_HEADERS
  91.                      StringList *source, StringList *target 
  92.    #endif
  93.                    );
  94.  
  95. #endif
  96.