2
*******************************************************************************
4
* Copyright (C) 2000, International Business Machines
5
* Corporation and others. All Rights Reserved.
7
*******************************************************************************
8
* file name: ucmstrip.c
10
* tab size: 8 (not used)
13
* created on: 2000nov09
14
* created by: Markus W. Scherer
16
* This tool reads a .ucm file, expects there to be a line in the header with
17
* "File created on..." and removes the lines before and including that.
18
* Then it removes lines with <icu:state> and <uconv_class> and <code_set_name>.
19
* This helps comparing .ucm files with different copyright statements and
20
* different state specifications.
22
* To compile, just call a C compiler/linker with this source file.
23
* On Windows: cl ucmstrip.c
31
main(int argc, const char *argv[]) {
34
unsigned long b, i, mappingsTop=0;
36
/* parse the input file from stdin */
37
/* skip lines until and including the one with "created on" */
39
if(gets(line)==NULL) {
42
if(0==strncmp(line, "# File created on ", 18)) {
47
/* write all lines except with <uconv_class> and <icu:state> and <code_set_name> */
49
if(gets(line)==NULL) {
52
if(0!=strncmp(line, "<uconv_class>", 13) && 0!=strncmp(line, "<icu:state>", 11) && 0!=strncmp(line, "<code_set_name>", 14)) {