container_of: don't put member_ptr in container_off.
[ccan] / ccan / crc / _info
1 #include <string.h>
2 #include <stdio.h>
3
4 /**
5  * crc - routines for crc of bytes
6  *
7  * Cyclic Redundancy Check routines.  These are reasonably fast
8  * checksum routines, but not suitable for cryptographic use.
9  *
10  * They are useful for simple error detection, eg. a 32-bit CRC will
11  * detect a single error burst of up to 32 bits.
12  *
13  * Example:
14  *      #include <ccan/crc/crc.h>
15  *      #include <stdio.h>
16  *      #include <stdlib.h>
17  *
18  *      // Given IHATEMATH outputs 0x98a3b8df
19  *      int main(int argc, char *argv[])
20  *      {
21  *              if (argc != 2) {
22  *                      fprintf(stderr, "Usage: %s <string>\n"
23  *                              "Prints 32 bit CRC of the string\n", argv[0]);
24  *                      exit(1);
25  *              }
26  *              printf("0x%08x\n", crc32c(0, argv[1], strlen(argv[1])));
27  *              exit(0);
28  *      }
29  *
30  * License: GPL (v2 or any later version)
31  * Author: Gary S. Brown, Clay Haapala
32  * Maintainer: Rusty Russell <rusty@rustcorp.com.au>
33  */
34 int main(int argc, char *argv[])
35 {
36         if (argc != 2)
37                 return 1;
38
39         if (strcmp(argv[1], "depends") == 0) {
40                 printf("ccan/array_size\n");
41                 return 0;
42         }
43
44         return 1;
45 }