]> git.ozlabs.org Git - ccan/blobdiff - ccan/stringmap/_info
ccanlint: Move ccanlint test options from _info comments to code
[ccan] / ccan / stringmap / _info
index 38f3067826194ecd39e1bad0daf5fb2908f7636e..c01c576c27fecfec243761af30295b8bdb6cc7cf 100644 (file)
@@ -1,32 +1,33 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * stringmap - Macros for mapping strings to things
  *
- * stringmap provides a generic string map via macros.
+ * stringmap provides a generic string map via macros.  It also supports byte
+ * strings with null characters.
  *
  * Features which are sorely lacking in this version of stringmap are deletion and traversal.
  *
  * Example:
  *
- * #include <ccan/stringmap/stringmap.h>                                                                                                                                        
+ * #include <ccan/stringmap/stringmap.h>
  *
- * static const char *get_string(void) {                                                                                                                                        
- *      static char buffer[4096];                                                                                                                                               
- *      char *tail;                                                                                                                                                             
- *      if (!fgets(buffer, sizeof(buffer), stdin))                                                                                                                              
- *              return NULL;                                                                                                                                                    
- *      tail = strchr(buffer, 0);                                                                                                                                               
- *      if (tail>buffer && tail[-1]=='\n')                                                                                                                                      
- *              *--tail = 0;                                                                                                                                                    
- *      if (!*buffer)                                                                                                                                                           
- *              return NULL;                                                                                                                                                    
- *      return buffer;                                                                                                                                                          
- * }                                                                                                                                                                            
+ * static const char *get_string(void) {
+ *      static char buffer[4096];
+ *      char *tail;
+ *      if (!fgets(buffer, sizeof(buffer), stdin))
+ *              return NULL;
+ *      tail = strchr(buffer, 0);
+ *      if (tail>buffer && tail[-1]=='\n')
+ *              *--tail = 0;
+ *      if (!*buffer)
+ *              return NULL;
+ *      return buffer;
+ * }
  *
- * int main(void) {                                                                                                                                                             
+ * int main(void) {
  *      stringmap(int) map = stringmap_new(NULL);
  *      const char *string;
  *
@@ -48,8 +49,9 @@
  *    return 0;
  * }
  *
- *     Authors: Joey Adams, Anders Magnusson
- *     License: BSD
+ * Authors: Joey Adams, Anders Magnusson
+ * License: BSD (3 clause)
+ * Version: 0.2
  */
 int main(int argc, char *argv[])
 {
@@ -62,5 +64,11 @@ int main(int argc, char *argv[])
                return 0;
        }
 
+       if (strcmp(argv[1], "ccanlint") == 0) {
+               /* We actually depend (indirectly) on the LGPL talloc */
+               printf("license_depends_compat FAIL\n");
+               return 0;
+       }
+
        return 1;
 }