From: Petr Špaček Date: Thu, 13 Feb 2020 09:05:07 +0000 (+0100) Subject: contrib: remove unsed _info files from CCAN X-Git-Tag: v5.1.0~42^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74f4e55891e437f520c8ed631ab00298f2e9d41c;p=thirdparty%2Fknot-resolver.git contrib: remove unsed _info files from CCAN --- diff --git a/contrib/ccan/asprintf/_info b/contrib/ccan/asprintf/_info deleted file mode 100644 index f72d668cc..000000000 --- a/contrib/ccan/asprintf/_info +++ /dev/null @@ -1,45 +0,0 @@ -#include "config.h" -#include -#include - -/** - * asprintf - asprintf wrapper (and if necessary, implementation). - * - * This provides a convenient wrapper for asprintf, and also implements - * asprintf if necessary. - * - * Author: Rusty Russell - * - * License: MIT - * - * Example: - * #include - * #include - * #include - * - * int main(int argc, char *argv[]) - * { - * char *p = afmt("This program has %i arguments", argc); - * int ret; - * - * while ((ret = write(STDOUT_FILENO, p, strlen(p))) > 0) { - * p += ret; - * if (!*p) - * exit(0); - * } - * err(1, "Writing to stdout"); - * } - */ -int main(int argc, char *argv[]) -{ - /* Expect exactly one argument */ - if (argc != 2) - return 1; - - if (strcmp(argv[1], "depends") == 0) { - printf("ccan/compiler\n"); - return 0; - } - - return 1; -} diff --git a/contrib/ccan/compiler/_info b/contrib/ccan/compiler/_info deleted file mode 100644 index d60dff4d1..000000000 --- a/contrib/ccan/compiler/_info +++ /dev/null @@ -1,64 +0,0 @@ -#include "config.h" -#include -#include - -/** - * compiler - macros for common compiler extensions - * - * Abstracts away some compiler hints. Currently these include: - * - COLD - * For functions not called in fast paths (aka. cold functions) - * - PRINTF_FMT - * For functions which take printf-style parameters. - * - CONST_FUNCTION - * For functions which return the same value for same parameters. - * - NEEDED - * For functions and variables which must be emitted even if unused. - * - UNNEEDED - * For functions and variables which need not be emitted if unused. - * - UNUSED - * For parameters which are not used. - * - IS_COMPILE_CONSTANT() - * For using different tradeoffs for compiletime vs runtime evaluation. - * - * License: CC0 (Public domain) - * Author: Rusty Russell - * - * Example: - * #include - * #include - * #include - * - * // Example of a (slow-path) logging function. - * static int log_threshold = 2; - * static void COLD PRINTF_FMT(2,3) - * logger(int level, const char *fmt, ...) - * { - * va_list ap; - * va_start(ap, fmt); - * if (level >= log_threshold) - * vfprintf(stderr, fmt, ap); - * va_end(ap); - * } - * - * int main(int argc, char *argv[]) - * { - * if (argc != 1) { - * logger(3, "Don't want %i arguments!\n", argc-1); - * return 1; - * } - * return 0; - * } - */ -int main(int argc, char *argv[]) -{ - /* Expect exactly one argument */ - if (argc != 2) - return 1; - - if (strcmp(argv[1], "depends") == 0) { - return 0; - } - - return 1; -} diff --git a/contrib/ccan/ilog/_info b/contrib/ccan/ilog/_info deleted file mode 100644 index f1f3f2d5b..000000000 --- a/contrib/ccan/ilog/_info +++ /dev/null @@ -1,50 +0,0 @@ -/** - * ilog - Integer logarithm. - * - * ilog_32() and ilog_64() compute the minimum number of bits required to store - * an unsigned 32-bit or 64-bit value without any leading zero bits. - * - * This can also be thought of as the location of the highest set bit, with - * counting starting from one (so that 0 returns 0, 1 returns 1, and 2**31 - * returns 32). - * - * When the value is known to be non-zero ilog32_nz() and ilog64_nz() can - * compile into as few as two instructions, one of which may get optimized out - * later. - * - * STATIC_ILOG_32 and STATIC_ILOG_64 allow computation on compile-time - * constants, so other compile-time constants can be derived from them. - * - * Example: - * #include - * #include - * #include - * - * int main(void){ - * int i; - * printf("ilog32(0x%08X)=%i\n",0,ilog32(0)); - * for(i=1;i<=STATIC_ILOG_32(USHRT_MAX);i++){ - * uint32_t v; - * v=(uint32_t)1U<<(i-1); - * //Here we know v is non-zero, so we can use ilog32_nz(). - * printf("ilog32(0x%08X)=%i\n",v,ilog32_nz(v)); - * } - * return 0; - * } - * - * License: CC0 (Public domain) - * Author: Timothy B. Terriberry - */ -#include "config.h" -#include -#include - -int main(int _argc,const char *_argv[]){ - /*Expect exactly one argument.*/ - if(_argc!=2)return 1; - if(strcmp(_argv[1],"depends")==0){ - printf("ccan/compiler\n"); - return 0; - } - return 1; -} diff --git a/contrib/ccan/json/_info b/contrib/ccan/json/_info deleted file mode 100644 index 3113b63ee..000000000 --- a/contrib/ccan/json/_info +++ /dev/null @@ -1,119 +0,0 @@ -#include "config.h" -#include -#include - -/** - * json - Parse and generate JSON (JavaScript Object Notation) - * - * This is a library for encoding and decoding JSON that strives to be - * easy to learn, use, and incorporate into an application. - * - * JSON (JavaScript Object Notation) facilitates passing data among different - * programming languages, particularly JavaScript. It looks like this: - * - * [ - * { - * "id": 1, - * "firstname": "John", - * "lastname": "Smith", - * "email": "john@example.com", - * "likes_pizza": false - * }, - * { - * "id": 2, - * "firstname": "Linda", - * "lastname": "Jones", - * "email": null, - * "likes_pizza": true - * } - * ] - * - * Example: - * #include - * #include - * #include - * #include - * - * static int find_number(JsonNode *object, const char *name, double *out) - * { - * JsonNode *node = json_find_member(object, name); - * if (node && node->tag == JSON_NUMBER) { - * *out = node->number_; - * return 1; - * } - * return 0; - * } - * - * static void solve_pythagorean(JsonNode *triple) - * { - * double a = 0, b = 0, c = 0; - * int a_given, b_given, c_given; - * - * if (triple->tag != JSON_OBJECT) { - * fprintf(stderr, "Error: Expected a JSON object.\n"); - * exit(EXIT_FAILURE); - * } - * - * a_given = find_number(triple, "a", &a); - * b_given = find_number(triple, "b", &b); - * c_given = find_number(triple, "c", &c); - * - * if (a_given + b_given + c_given != 2) { - * fprintf(stderr, "Error: I need two sides to compute the length of the third.\n"); - * exit(EXIT_FAILURE); - * } - * - * if (a_given && b_given) { - * c = sqrt(a*a + b*b); - * json_append_member(triple, "c", json_mknumber(c)); - * } else if (a_given && c_given) { - * b = sqrt(c*c - a*a); - * json_append_member(triple, "b", json_mknumber(b)); - * } else if (b_given && c_given) { - * a = sqrt(c*c - b*b); - * json_append_member(triple, "a", json_mknumber(a)); - * } - * } - * - * int main(void) - * { - * JsonNode *triples = json_mkarray(); - * - * json_append_element(triples, json_decode("{\"a\": 3, \"b\": 4}")); - * json_append_element(triples, json_decode("{\"a\": 5, \"c\": 13}")); - * json_append_element(triples, json_decode("{\"b\": 24, \"c\": 25}")); - * - * JsonNode *triple; - * json_foreach(triple, triples) - * solve_pythagorean(triple); - * - * char *tmp = json_stringify(triples, "\t"); - * puts(tmp); - * free(tmp); - * - * json_delete(triples); - * return 0; - * } - * - * Author: Joey Adams - * Version: 0.1 - * License: MIT - */ -int main(int argc, char *argv[]) -{ - /* Expect exactly one argument */ - if (argc != 2) - return 1; - - if (strcmp(argv[1], "depends") == 0) { - /* Nothing */ - return 0; - } - - if (strcmp(argv[1], "libs") == 0) { - printf("m\n"); /* Needed for sqrt() used in example code above. */ - return 0; - } - - return 1; -}