]> git.ozlabs.org Git - ccan/blob - ccan/version/_info
3aad1e8a56327cfa4080a28326a3640e35542301
[ccan] / ccan / version / _info
1 #include <string.h>
2 #include "config.h"
3
4 /**
5  * version - helper functions for major.minor-style version numbers
6  *
7  * This code provides some helper functions to deal with version numbers in
8  * the form major.minor.
9  *
10  * Author: Peter Hutterer <peter.hutterer@who-t.net>
11  * Maintainer: Peter Hutterer <peter.hutterer@who-t.net>
12  * License: BSD-MIT
13  *
14  * Example:
15  *      struct version a = version(1, 0);
16  *      struct version b = version(2, 2);
17  *
18  *      if (version_cmp(a, b) < 0)
19  *              printf("Feature supported in version 2.2 but we have %d.%d\n",
20  *                      version_major(a), version_minor(a));
21  *
22  *      if (version_cmp(a, version(3, 4)) < 0)
23  *              printf("Feature only supported in version 3.4\n");
24  *
25  */
26 int main(int argc, char *argv[])
27 {
28         /* Expect exactly one argument */
29         if (argc != 2)
30                 return 1;
31
32         if (strcmp(argv[1], "depends") == 0) {
33                 return 0;
34         }
35
36         return 1;
37 }