]> git.ozlabs.org Git - ccan/blobdiff - ccan/array_size/_info
alignof, array_size, crc: provide comments to allow testing examples.
[ccan] / ccan / array_size / _info
index 1722ba2933f1906479f6da5263eb8bf0b7930c48..af7ef1cfd291cd5179ad11ad5d8e26c55d512f30 100644 (file)
  * macro or constant.
  *
  * Example:
+ *     // Outputs "Initialized 32 values"
  *     #include <ccan/array_size/array_size.h>
  *     #include <stdlib.h>
+ *     #include <stdio.h>
  *
  *     // We currently use 32 random values.
  *     static unsigned int vals[32];
  *
- *     static void init_values(void)
+ *     int main(void)
  *     {
  *             unsigned int i;
  *             for (i = 0; i < ARRAY_SIZE(vals); i++)
  *                     vals[i] = random();
+ *             printf("Initialized %u values\n", i);
+ *             return 0;
  *     }
  *
- * Licence: LGPL (2 or any later version)
+ * License: LGPL (2 or any later version)
  * Author: Rusty Russell <rusty@rustcorp.com.au>
  */
 int main(int argc, char *argv[])