]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/ucmndata.h
ICU-531.48.tar.gz
[apple/icu.git] / icuSources / common / ucmndata.h
index 3ee38997f700b7b8933045559ff287f24c41f5f7..36163c508b9774b8f9d2bb4abe22c341418254ed 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1999-2001, International Business Machines
+*   Copyright (C) 1999-2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************/
@@ -43,7 +43,35 @@ typedef struct  {
     UDataInfo   info;
 } DataHeader;
 
+typedef struct {
+    uint32_t nameOffset;
+    uint32_t dataOffset;
+} UDataOffsetTOCEntry;
+
+typedef struct {
+    uint32_t count;
+    UDataOffsetTOCEntry entry[2];    /* Actual size of array is from count. */
+} UDataOffsetTOC;
+
+/**
+ * Get the header size from a const DataHeader *udh.
+ * Handles opposite-endian data.
+ *
+ * @internal
+ */
+U_CFUNC uint16_t
+udata_getHeaderSize(const DataHeader *udh);
 
+/**
+ * Get the UDataInfo.size from a const UDataInfo *info.
+ * Handles opposite-endian data.
+ *
+ * @internal
+ */
+U_CFUNC uint16_t
+udata_getInfoSize(const UDataInfo *info);
+
+U_CDECL_BEGIN
 /*
  *  "Virtual" functions for data lookup.
  *  To call one, given a UDataMemory *p, the code looks like this:
@@ -52,12 +80,15 @@ typedef struct  {
  */
 
 typedef const DataHeader *
-(* LookupFn)(const UDataMemory *pData,
-             const char *tocEntryName,
-             UErrorCode *pErrorCode);
+(U_CALLCONV * LookupFn)(const UDataMemory *pData,
+                        const char *tocEntryName,
+                        int32_t *pLength,
+                        UErrorCode *pErrorCode);
 
 typedef uint32_t
-(* NumEntriesFn)(const UDataMemory *pData);
+(U_CALLCONV * NumEntriesFn)(const UDataMemory *pData);
+
+U_CDECL_END
 
 typedef struct {
     LookupFn      Lookup;
@@ -75,7 +106,6 @@ typedef struct {
  *     otherwise
  *         set an errorcode.
  */
-void   udata_checkCommonData(UDataMemory *pData, UErrorCode *pErrorCode);
-
+U_CFUNC void udata_checkCommonData(UDataMemory *pData, UErrorCode *pErrorCode);
 
 #endif