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