~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/tools/makeconv/misc/ucmstrip.c

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
*******************************************************************************
3
 
*
4
 
*   Copyright (C) 2000, International Business Machines
5
 
*   Corporation and others.  All Rights Reserved.
6
 
*
7
 
*******************************************************************************
8
 
*   file name:  ucmstrip.c
9
 
*   encoding:   US-ASCII
10
 
*   tab size:   8 (not used)
11
 
*   indentation:4
12
 
*
13
 
*   created on: 2000nov09
14
 
*   created by: Markus W. Scherer
15
 
*
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.
21
 
*
22
 
*   To compile, just call a C compiler/linker with this source file.
23
 
*   On Windows: cl ucmstrip.c
24
 
*/
25
 
 
26
 
#include <stdio.h>
27
 
#include <stdlib.h>
28
 
#include <string.h>
29
 
 
30
 
extern int
31
 
main(int argc, const char *argv[]) {
32
 
    char line[200];
33
 
    char *s, *end;
34
 
    unsigned long b, i, mappingsTop=0;
35
 
 
36
 
    /* parse the input file from stdin */
37
 
    /* skip lines until and including the one with "created on" */
38
 
    for(;;) {
39
 
        if(gets(line)==NULL) {
40
 
            return 0;
41
 
        }
42
 
        if(0==strncmp(line, "# File created on ", 18)) {
43
 
            break;
44
 
        }
45
 
    }
46
 
 
47
 
    /* write all lines except with <uconv_class> and <icu:state> and <code_set_name> */
48
 
    for(;;) {
49
 
        if(gets(line)==NULL) {
50
 
            return 0;
51
 
        }
52
 
        if(0!=strncmp(line, "<uconv_class>", 13) && 0!=strncmp(line, "<icu:state>", 11) && 0!=strncmp(line, "<code_set_name>", 14)) {
53
 
            puts(line);
54
 
        }
55
 
    }
56
 
}