~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/tools/genrb/list.h

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

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