]> git.ozlabs.org Git - ccan/commitdiff
crcsync: use tal/grab_file in _info example.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 10 Jun 2014 03:36:16 +0000 (13:06 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 10 Jun 2014 03:36:16 +0000 (13:06 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/crcsync/_info

index 3713c777cc5532ea8bb11c91064fa9d7b92f3b43..e6d51784e87d917e16308f68e93b45846f5e7c7c 100644 (file)
@@ -12,7 +12,8 @@
  *     // Calculate checksums of file (3-arg mode)
  *     // Or print differences between file and checksums (4+ arg mode)
  *     #include <ccan/crcsync/crcsync.h>
  *     // Calculate checksums of file (3-arg mode)
  *     // Or print differences between file and checksums (4+ arg mode)
  *     #include <ccan/crcsync/crcsync.h>
- *     #include <ccan/grab_file/grab_file.h>
+ *     #include <ccan/tal/grab_file/grab_file.h>
+ *     #include <ccan/tal/tal.h>
  *     #include <stdio.h>
  *     #include <stdlib.h>
  *     #include <err.h>
  *     #include <stdio.h>
  *     #include <stdlib.h>
  *     #include <err.h>
  *                     errx(1, "Usage: %s <blocksize> <file> <crc>...\n"
  *                          "OR: %s <blocksize> <file>", argv[0], argv[0]);
  *     
  *                     errx(1, "Usage: %s <blocksize> <file> <crc>...\n"
  *                          "OR: %s <blocksize> <file>", argv[0], argv[0]);
  *     
- *             file = grab_file(NULL, argv[2], &len);
+ *             file = grab_file(NULL, argv[2]);
  *             if (!file)
  *                     err(1, "Opening file %s", argv[2]);
  *             if (!file)
  *                     err(1, "Opening file %s", argv[2]);
- *     
+ *             len = tal_count(file) - 1;
+ *
  *             if (argc == 3) {
  *                     // Short form prints CRCs of file for use in long form.
  *                     used = (len + blocksize - 1) / blocksize;
  *             if (argc == 3) {
  *                     // Short form prints CRCs of file for use in long form.
  *                     used = (len + blocksize - 1) / blocksize;