~ubuntu-branches/ubuntu/quantal/icu/quantal

« back to all changes in this revision

Viewing changes to source/common/uresimp.h

  • Committer: Package Import Robot
  • Author(s): Yves Arrouye
  • Date: 2002-03-03 15:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20020303153113-3ssceqlq45xbmbnc
Tags: upstream-2.0-2.1pre20020303
ImportĀ upstreamĀ versionĀ 2.0-2.1pre20020303

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
**********************************************************************
 
3
*   Copyright (C) 2000-2001, International Business Machines
 
4
*   Corporation and others.  All Rights Reserved.
 
5
**********************************************************************
 
6
*/
 
7
 
 
8
#ifndef URESIMP_H
 
9
#define URESIMP_H
 
10
 
 
11
#include "unicode/ures.h"
 
12
 
 
13
#include "uresdata.h"
 
14
 
 
15
#define kRootLocaleName         "root"
 
16
 
 
17
/*
 
18
 The default minor version and the version separator must be exactly one
 
19
 character long.
 
20
*/
 
21
 
 
22
#define kDefaultMinorVersion    "0"
 
23
#define kVersionSeparator       "."
 
24
#define kVersionTag             "Version"
 
25
 
 
26
#define MAGIC1 19700503
 
27
#define MAGIC2 19641227
 
28
 
 
29
/*
 
30
enum UResEntryType {
 
31
    ENTRY_OK = 0,
 
32
    ENTRY_GOTO_ROOT = 1,
 
33
    ENTRY_GOTO_DEFAULT = 2,
 
34
    ENTRY_INVALID = 3
 
35
};
 
36
 
 
37
typedef enum UResEntryType UResEntryType;
 
38
*/
 
39
 
 
40
struct UResourceDataEntry;
 
41
typedef struct UResourceDataEntry UResourceDataEntry;
 
42
 
 
43
struct UResourceDataEntry {
 
44
    char *fName; /* name of the locale for bundle - still to decide whether it is original or fallback */
 
45
    char *fPath; /* path to bundle - used for distinguishing between resources with the same name */
 
46
    uint32_t fCountExisting; /* how much is this resource used */
 
47
    ResourceData fData; /* data for low level access */
 
48
    UResourceDataEntry *fParent; /*next resource in fallback chain*/
 
49
/*    UResEntryType fStatus;*/
 
50
    UErrorCode fBogus;
 
51
    int32_t fHashKey; /* for faster access in the hashtable */
 
52
};
 
53
 
 
54
struct UResourceBundle {
 
55
    const char *fKey; /*tag*/
 
56
    char *fVersion;
 
57
    UBool fHasFallback;
 
58
    UBool fIsTopLevel;
 
59
    uint32_t fMagic1;
 
60
    uint32_t fMagic2;
 
61
    /*UBool fIsStackObject;*/
 
62
    UResourceDataEntry *fData; /*for low-level access*/
 
63
    int32_t fIndex;
 
64
    int32_t fSize;
 
65
    ResourceData fResData;
 
66
    Resource fRes;
 
67
};
 
68
 
 
69
U_CFUNC void ures_setIsStackObject( UResourceBundle* resB, UBool state);
 
70
U_CFUNC UBool ures_isStackObject( UResourceBundle* resB);
 
71
 
 
72
/* Some getters used by the copy constructor */
 
73
U_CFUNC const char* ures_getName(const UResourceBundle* resB);
 
74
U_CFUNC const char* ures_getPath(const UResourceBundle* resB);
 
75
 
 
76
/* Candidates for export */
 
77
U_CFUNC UResourceBundle *ures_copyResb(UResourceBundle *r, const UResourceBundle *original, UErrorCode *status);
 
78
#endif /*URESIMP_H*/