]>
git.saurik.com Git - apple/icu.git/blob - icuSources/tools/genprops/misc/ucdstrip.c
2 *******************************************************************************
4 * Copyright (C) 2003, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: ucdstrip.c
10 * tab size: 8 (not used)
13 * created on: 2003feb20
14 * created by: Markus W. Scherer
16 * Simple tool for Unicode Character Database files with semicolon-delimited fields.
17 * Removes comments behind data lines but not in others.
19 * To compile, just call a C compiler/linker with this source file.
20 * On Windows: cl ucdstrip.c
27 /* return the first character position after the end of the data */
29 endOfData(const char *l
) {
35 /* ignore whitespace before the comment */
36 while(l
!=end
&& ((c
=*(end
-1))==' ' || c
=='\t')) {
46 main(int argc
, const char *argv
[]) {
47 static char line
[2000];
50 while(gets(line
)!=NULL
) {
51 if(strtol(line
, &end
, 16)>=0 && end
!=line
) {
52 /* code point or range followed by semicolon and data, remove comment */