Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * |
michael@0 | 4 | * Copyright (C) 2005-2012, International Business Machines |
michael@0 | 5 | * Corporation and others. All Rights Reserved. |
michael@0 | 6 | * |
michael@0 | 7 | ******************************************************************************* |
michael@0 | 8 | * file name: writesrc.h |
michael@0 | 9 | * encoding: US-ASCII |
michael@0 | 10 | * tab size: 8 (not used) |
michael@0 | 11 | * indentation:4 |
michael@0 | 12 | * |
michael@0 | 13 | * created on: 2005apr23 |
michael@0 | 14 | * created by: Markus W. Scherer |
michael@0 | 15 | * |
michael@0 | 16 | * Helper functions for writing source code for data. |
michael@0 | 17 | */ |
michael@0 | 18 | |
michael@0 | 19 | #ifndef __WRITESRC_H__ |
michael@0 | 20 | #define __WRITESRC_H__ |
michael@0 | 21 | |
michael@0 | 22 | #include <stdio.h> |
michael@0 | 23 | #include "unicode/utypes.h" |
michael@0 | 24 | #include "utrie2.h" |
michael@0 | 25 | |
michael@0 | 26 | /** |
michael@0 | 27 | * Creates a source text file and writes a header comment with the ICU copyright. |
michael@0 | 28 | * Writes a C/Java-style comment with the generator name. |
michael@0 | 29 | */ |
michael@0 | 30 | U_CAPI FILE * U_EXPORT2 |
michael@0 | 31 | usrc_create(const char *path, const char *filename, const char *generator); |
michael@0 | 32 | |
michael@0 | 33 | /** |
michael@0 | 34 | * Creates a source text file and writes a header comment with the ICU copyright. |
michael@0 | 35 | * Writes the comment with # lines, as used in scripts and text data. |
michael@0 | 36 | */ |
michael@0 | 37 | U_CAPI FILE * U_EXPORT2 |
michael@0 | 38 | usrc_createTextData(const char *path, const char *filename, const char *generator); |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * Writes the contents of an array of 8/16/32-bit words. |
michael@0 | 42 | * The prefix and postfix are optional (can be NULL) and are written first/last. |
michael@0 | 43 | * The prefix may contain a %ld or similar field for the array length. |
michael@0 | 44 | * The {} and declaration etc. need to be included in prefix/postfix or |
michael@0 | 45 | * printed before and after the array contents. |
michael@0 | 46 | */ |
michael@0 | 47 | U_CAPI void U_EXPORT2 |
michael@0 | 48 | usrc_writeArray(FILE *f, |
michael@0 | 49 | const char *prefix, |
michael@0 | 50 | const void *p, int32_t width, int32_t length, |
michael@0 | 51 | const char *postfix); |
michael@0 | 52 | |
michael@0 | 53 | /** |
michael@0 | 54 | * Calls usrc_writeArray() for the index and data arrays of a frozen UTrie2. |
michael@0 | 55 | * Only the index array is written for a 16-bit UTrie2. In this case, dataPrefix |
michael@0 | 56 | * is ignored and can be NULL. |
michael@0 | 57 | */ |
michael@0 | 58 | U_CAPI void U_EXPORT2 |
michael@0 | 59 | usrc_writeUTrie2Arrays(FILE *f, |
michael@0 | 60 | const char *indexPrefix, const char *dataPrefix, |
michael@0 | 61 | const UTrie2 *pTrie, |
michael@0 | 62 | const char *postfix); |
michael@0 | 63 | |
michael@0 | 64 | /** |
michael@0 | 65 | * Writes the UTrie2 struct values. |
michael@0 | 66 | * The {} and declaration etc. need to be included in prefix/postfix or |
michael@0 | 67 | * printed before and after the array contents. |
michael@0 | 68 | */ |
michael@0 | 69 | U_CAPI void U_EXPORT2 |
michael@0 | 70 | usrc_writeUTrie2Struct(FILE *f, |
michael@0 | 71 | const char *prefix, |
michael@0 | 72 | const UTrie2 *pTrie, |
michael@0 | 73 | const char *indexName, const char *dataName, |
michael@0 | 74 | const char *postfix); |
michael@0 | 75 | |
michael@0 | 76 | /** |
michael@0 | 77 | * Writes the contents of an array of mostly invariant characters. |
michael@0 | 78 | * Characters 0..0x1f are printed as numbers, |
michael@0 | 79 | * others as characters with single quotes: '%c'. |
michael@0 | 80 | * |
michael@0 | 81 | * The prefix and postfix are optional (can be NULL) and are written first/last. |
michael@0 | 82 | * The prefix may contain a %ld or similar field for the array length. |
michael@0 | 83 | * The {} and declaration etc. need to be included in prefix/postfix or |
michael@0 | 84 | * printed before and after the array contents. |
michael@0 | 85 | */ |
michael@0 | 86 | U_CAPI void U_EXPORT2 |
michael@0 | 87 | usrc_writeArrayOfMostlyInvChars(FILE *f, |
michael@0 | 88 | const char *prefix, |
michael@0 | 89 | const char *p, int32_t length, |
michael@0 | 90 | const char *postfix); |
michael@0 | 91 | |
michael@0 | 92 | #endif |