2 * Copyright (C) 2010 Red Hat, Inc. All rights reserved.
4 * This file is part of LVM2.
6 * This copyrighted material is made available to anyone wishing to use,
7 * modify, copy, or redistribute it subject to the terms and conditions
8 * of the GNU Lesser General Public License v.2.1.
10 * You should have received a copy of the GNU Lesser General Public License
11 * along with this program; if not, write to the Free Software Foundation,
12 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 * Helper program to generate table included in crc.c.
20 int main(int argc, char **argv)
24 printf("\t/* CRC-32 byte lookup table generated by crc_gen.c */\n");
25 printf("\tstatic const uint32_t crctab[] = {");
27 for (i = 0; i < 256; i++) {
29 for (j = 0; j < 8; j++) {
31 crc = 0xedb88320L ^ (crc >> 1);
41 printf("0x%08.8x,", crc);