home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / tools / genrb / list.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  2.5 KB  |  93 lines

  1. /*
  2. *******************************************************************************
  3. *                                                                             *
  4. * COPYRIGHT:                                                                  *
  5. *   (C) Copyright International Business Machines Corporation, 1998, 1999     *
  6. *   Licensed Material - Program-Property of IBM - All Rights Reserved.        *
  7. *   US Government Users Restricted Rights - Use, duplication, or disclosure   *
  8. *   restricted by GSA ADP Schedule Contract with IBM Corp.                    *
  9. *                                                                             *
  10. *******************************************************************************
  11. *
  12. * File list.h
  13. *
  14. * Modification History:
  15. *
  16. *   Date        Name        Description
  17. *   06/01/99    stephen     Creation.
  18. *******************************************************************************
  19. */
  20.  
  21. #ifndef LIST_H
  22. #define LIST_H 1
  23.  
  24. #include "utypes.h"
  25.  
  26. /* A string list */
  27. struct SStringList {
  28.   UChar **fData;
  29.   int32_t fCount;
  30.   int32_t fCapacity;
  31. };
  32.  
  33. struct SList* strlist_open(UErrorCode *status);
  34. void strlist_close(struct SList *list, UErrorCode *status);
  35. void strlist_add(struct SList *list, const UChar *s, UErrorCode *status);
  36.  
  37. /* A two-dimensional string list */
  38. struct SStringList2d {
  39.   UChar **fData;
  40.   int32_t fCount;
  41.   int32_t fCapacity;
  42.   
  43.   int32_t *fRows;
  44.   int32_t fRowCount;
  45.   int32_t fRowCapacity;
  46. };
  47.  
  48. struct SList* strlist2d_open(UErrorCode *status);
  49. void strlist2d_close(struct SList *list, UErrorCode *status);
  50. void strlist2d_newRow(struct SList *list, UErrorCode *status);
  51. void strlist2d_add(struct SList *list, const UChar *s, UErrorCode *status);
  52.  
  53. /* A name/value pair for a tagged list */
  54. struct SStringPair {
  55.   UChar *fKey;
  56.   UChar *fValue;
  57. };
  58.  
  59. /* A tagged list */
  60. struct STaggedList {
  61.   struct SStringPair *fData;
  62.   int32_t fCount;
  63.   int32_t fCapacity;
  64. };
  65.  
  66. struct SList* taglist_open(UErrorCode *status);
  67. void taglist_close(struct SList *list, UErrorCode *status);
  68. void taglist_add(struct SList *list, const UChar *tag, 
  69.          const UChar *data, UErrorCode *status);
  70. const UChar* taglist_get(const struct SList *list, const UChar *tag, 
  71.              UErrorCode *status);
  72.  
  73. /* Types of lists */
  74. enum EListType {
  75.   eEmpty,
  76.   eStringList,
  77.   eStringList2d,
  78.   eTaggedList
  79. };
  80.  
  81. /* A generic list container */
  82. struct SList {
  83.   enum EListType fType; /* type of element in union */
  84.   
  85.   union {
  86.     struct SStringList fStringList;
  87.     struct SStringList2d fStringList2d;
  88.     struct STaggedList fTaggedList;
  89.   } u;
  90. };
  91.  
  92. #endif
  93.