]> git.ozlabs.org Git - ccan/blobdiff - ccan/crcsync/_info
ccanlint: Move ccanlint test options from _info comments to code
[ccan] / ccan / crcsync / _info
index 3713c777cc5532ea8bb11c91064fa9d7b92f3b43..7516f447480603c7722b61020953b9716980af50 100644 (file)
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * crcsync - routines to use crc for an rsync-like protocol.
@@ -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>
- *     #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>
  *                     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]);
- *     
+ *             len = tal_count(file) - 1;
+ *
  *             if (argc == 3) {
  *                     // Short form prints CRCs of file for use in long form.
  *                     used = (len + blocksize - 1) / blocksize;
@@ -69,9 +71,6 @@
  *
  * License: LGPL (v2.1 or any later version)
  * Author: Rusty Russell <rusty@rustcorp.com.au>
- * Ccanlint:
- *     // We actually depend on the GPL crc routines, so not really LGPL :(
- *     license_depends_compat FAIL
  */
 int main(int argc, char *argv[])
 {
@@ -86,6 +85,11 @@ int main(int argc, char *argv[])
                printf("ccan/array_size\n");
                return 0;
        }
+       if (strcmp(argv[1], "ccanlint") == 0) {
+               /* We actually depend on the GPL crc routines, so not really LGPL :( */
+               printf("license_depends_compat FAIL\n");
+               return 0;
+       }
 
        return 1;
 }