/* ******************************************************************************* * * Copyright (C) 2000, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: ucmstrip.c * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 2000nov09 * created by: Markus W. Scherer * * This tool reads a .ucm file, expects there to be a line in the header with * "File created on..." and removes the lines before and including that. * Then it removes lines with and and . * This helps comparing .ucm files with different copyright statements and * different state specifications. * * To compile, just call a C compiler/linker with this source file. * On Windows: cl ucmstrip.c */ #include #include #include extern int main(int argc, const char *argv[]) { char line[200]; char *s, *end; unsigned long b, i, mappingsTop=0; /* parse the input file from stdin */ /* skip lines until and including the one with "created on" */ for(;;) { if(gets(line)==NULL) { return 0; } if(0==strncmp(line, "# File created on ", 18)) { break; } } /* write all lines except with and and */ for(;;) { if(gets(line)==NULL) { return 0; } if(0!=strncmp(line, "", 13) && 0!=strncmp(line, "", 11) && 0!=strncmp(line, "", 14)) { puts(line); } } }