X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Fcrcsync%2F_info.c;fp=ccan%2Fcrcsync%2F_info.c;h=0000000000000000000000000000000000000000;hb=570c9c555f076e74f46141bb42b5d1d7ac89f632;hp=52e2ebe2febdc65f8e0831500567edd3cb13d50c;hpb=8f61c0bccb152b2365baf70deac1e59264d7feb7;p=ccan diff --git a/ccan/crcsync/_info.c b/ccan/crcsync/_info.c deleted file mode 100644 index 52e2ebe2..00000000 --- a/ccan/crcsync/_info.c +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include -#include "config.h" - -/** - * crcsync - routines to use crc for an rsync-like protocol. - * - * This is a complete library for synchronization using a variant of the - * rsync protocol. - * - * Example: - * // Calculate checksums of file (3-arg mode) - * // Or print differences between file and checksums (4+ arg mode) - * #include - * #include - * #include - * #include - * #include - * - * static void print_result(long result) - * { - * if (result < 0) - * printf("MATCHED CRC %lu\n", -result - 1); - * else if (result > 0) - * printf("%lu literal bytes\n", result); - * } - * - * int main(int argc, char *argv[]) - * { - * size_t len, used, blocksize; - * char *file; - * struct crc_context *ctx; - * uint32_t *crcs; - * long res, i; - * - * if (argc < 3 || (blocksize = atoi(argv[1])) == 0) - * errx(1, "Usage: %s ...\n" - * "OR: %s ", argv[0], argv[0]); - * - * file = grab_file(NULL, argv[2], &len); - * if (!file) - * err(1, "Opening file %s", argv[2]); - * - * if (argc == 3) { - * // Short form prints CRCs of file for use in long form. - * used = (len + blocksize - 1) / blocksize; - * crcs = malloc(used * sizeof(uint32_t)); - * crc_of_blocks(file, len, blocksize, 32, crcs); - * for (i = 0; i < used; i++) - * printf("%i ", crcs[i]); - * printf("\n"); - * return 0; - * } - * - * crcs = malloc((argc - 3) * sizeof(uint32_t)); - * for (i = 0; i < argc-3; i++) - * crcs[i] = atoi(argv[3+i]); - * - * ctx = crc_context_new(blocksize, 32, crcs, argc-3); - * for (used = 0; used < len; ) { - * used += crc_read_block(ctx, &res, file+used, len-used); - * print_result(res); - * } - * while ((res = crc_read_flush(ctx)) != 0) - * print_result(res); - * - * return 0; - * } - * - * Licence: LGPL (v2 or any later version) - */ -int main(int argc, char *argv[]) -{ - if (argc != 2) - return 1; - - if (strcmp(argv[1], "depends") == 0) { - printf("ccan/crc\n"); - return 0; - } - - return 1; -}