Imported Upstream version 58.1
[platform/upstream/icu.git] / source / tools / makeconv / makeconv.h
1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 *
6 *   Copyright (C) 2000-2010, International Business Machines
7 *   Corporation and others.  All Rights Reserved.
8 *
9 *******************************************************************************
10 *   file name:  makeconv.h
11 *   encoding:   US-ASCII
12 *   tab size:   8 (not used)
13 *   indentation:4
14 *
15 *   created on: 2000nov01
16 *   created by: Markus W. Scherer
17 */
18
19 #ifndef __MAKECONV_H__
20 #define __MAKECONV_H__
21
22 #include "unicode/utypes.h"
23 #include "ucnv_bld.h"
24 #include "unewdata.h"
25 #include "ucm.h"
26
27 /* exports from makeconv.c */
28 U_CFUNC UBool VERBOSE;
29 U_CFUNC UBool SMALL;
30 U_CFUNC UBool IGNORE_SISO_CHECK;
31
32 /* converter table type for writing */
33 enum {
34     TABLE_NONE,
35     TABLE_BASE,
36     TABLE_EXT,
37     TABLE_BASE_AND_EXT
38 };
39
40 /* abstract converter generator struct, C++ - style */
41 struct NewConverter;
42 typedef struct NewConverter NewConverter;
43
44 struct NewConverter {
45     void
46     (*close)(NewConverter *cnvData);
47
48     /** is this byte sequence valid? */
49     UBool
50     (*isValid)(NewConverter *cnvData,
51                const uint8_t *bytes, int32_t length);
52
53     UBool
54     (*addTable)(NewConverter *cnvData, UCMTable *table, UConverterStaticData *staticData);
55
56     uint32_t
57     (*write)(NewConverter *cnvData, const UConverterStaticData *staticData,
58              UNewDataMemory *pData, int32_t tableType);
59 };
60
61 #endif /* __MAKECONV_H__ */