scuffed-code/icu4c/source/tools/genrb/list.h

90 lines
2.1 KiB
C
Raw Normal View History

1999-08-16 21:50:52 +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
#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 {
UChar *fKey;
UChar *fValue;
};
/* A tagged list */
struct STaggedList {
struct SStringPair *fData;
int32_t fCount;
int32_t fCapacity;
};
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);
const UChar* taglist_get(const struct SList *list, const UChar *tag,
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