1999-08-16 21:50:52 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
1999-12-13 22:28:37 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 1998-1999, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
1999-08-16 21:50:52 +00:00
|
|
|
*******************************************************************************
|
|
|
|
*
|
|
|
|
* File list.h
|
|
|
|
*
|
|
|
|
* Modification History:
|
|
|
|
*
|
|
|
|
* Date Name Description
|
|
|
|
* 06/01/99 stephen Creation.
|
|
|
|
*******************************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LIST_H
|
|
|
|
#define LIST_H 1
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/utypes.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/* A string list */
|
|
|
|
struct SStringList {
|
|
|
|
UChar **fData;
|
|
|
|
int32_t fCount;
|
|
|
|
int32_t fCapacity;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SList* strlist_open(UErrorCode *status);
|
|
|
|
void strlist_close(struct SList *list, UErrorCode *status);
|
|
|
|
void strlist_add(struct SList *list, const UChar *s, UErrorCode *status);
|
|
|
|
|
|
|
|
/* A two-dimensional string list */
|
|
|
|
struct SStringList2d {
|
|
|
|
UChar **fData;
|
|
|
|
int32_t fCount;
|
|
|
|
int32_t fCapacity;
|
|
|
|
|
|
|
|
int32_t *fRows;
|
|
|
|
int32_t fRowCount;
|
|
|
|
int32_t fRowCapacity;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SList* strlist2d_open(UErrorCode *status);
|
|
|
|
void strlist2d_close(struct SList *list, UErrorCode *status);
|
|
|
|
void strlist2d_newRow(struct SList *list, UErrorCode *status);
|
|
|
|
void strlist2d_add(struct SList *list, const UChar *s, UErrorCode *status);
|
|
|
|
|
|
|
|
/* A name/value pair for a tagged list */
|
|
|
|
struct SStringPair {
|
2000-05-15 18:39:17 +00:00
|
|
|
char *fKey;
|
1999-08-16 21:50:52 +00:00
|
|
|
UChar *fValue;
|
2000-05-15 18:39:17 +00:00
|
|
|
struct SStringPair *fNext;
|
1999-08-16 21:50:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* A tagged list */
|
|
|
|
struct STaggedList {
|
2000-05-15 18:39:17 +00:00
|
|
|
struct SStringPair *fFirst;
|
|
|
|
/*struct SStringPair *fData;*/
|
1999-08-16 21:50:52 +00:00
|
|
|
int32_t fCount;
|
2000-05-15 18:39:17 +00:00
|
|
|
/*int32_t fCapacity;*/
|
1999-08-16 21:50:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SList* taglist_open(UErrorCode *status);
|
|
|
|
void taglist_close(struct SList *list, UErrorCode *status);
|
|
|
|
void taglist_add(struct SList *list, const UChar *tag,
|
|
|
|
const UChar *data, UErrorCode *status);
|
2000-05-15 18:39:17 +00:00
|
|
|
const UChar* taglist_get(const struct SList *list, const char *tag,
|
1999-08-16 21:50:52 +00:00
|
|
|
UErrorCode *status);
|
|
|
|
|
|
|
|
/* Types of lists */
|
|
|
|
enum EListType {
|
|
|
|
eEmpty,
|
|
|
|
eStringList,
|
|
|
|
eStringList2d,
|
|
|
|
eTaggedList
|
|
|
|
};
|
|
|
|
|
|
|
|
/* A generic list container */
|
|
|
|
struct SList {
|
|
|
|
enum EListType fType; /* type of element in union */
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct SStringList fStringList;
|
|
|
|
struct SStringList2d fStringList2d;
|
|
|
|
struct STaggedList fTaggedList;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|