X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fversion%2F_info;fp=ccan%2Fversion%2F_info;h=3aad1e8a56327cfa4080a28326a3640e35542301;hp=0000000000000000000000000000000000000000;hb=a0fd39057c739f1c0f5d5ee9ade90381df0ca839;hpb=81f2204ceaec3bc99442344c87e2872747c2100a diff --git a/ccan/version/_info b/ccan/version/_info new file mode 100644 index 00000000..3aad1e8a --- /dev/null +++ b/ccan/version/_info @@ -0,0 +1,37 @@ +#include +#include "config.h" + +/** + * version - helper functions for major.minor-style version numbers + * + * This code provides some helper functions to deal with version numbers in + * the form major.minor. + * + * Author: Peter Hutterer + * Maintainer: Peter Hutterer + * License: BSD-MIT + * + * Example: + * struct version a = version(1, 0); + * struct version b = version(2, 2); + * + * if (version_cmp(a, b) < 0) + * printf("Feature supported in version 2.2 but we have %d.%d\n", + * version_major(a), version_minor(a)); + * + * if (version_cmp(a, version(3, 4)) < 0) + * printf("Feature only supported in version 3.4\n"); + * + */ +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; +}