Mercurial > hg > octave-jordi > gnulib-hg
annotate lib/check-version.c @ 18029:e4a13d95b503
mgetgroups: port to strict OS X
* doc/glibc-functions/getgrouplist.texi (getgrouplist):
Document the getgrouplist problem.
* lib/mgetgroups.c (getgrouplist_gids) [HAVE_GETGROUPLIST]:
New macro.
(mgetgroups): Use it.
* m4/mgetgroups.m4 (gl_MGETGROUPS):
Check for OS X signature for getgrouplist.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sun, 28 Jun 2015 23:43:35 -0700 |
parents | ab58d4870664 |
children |
rev | line source |
---|---|
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
1 /* check-version.h --- Check version string compatibility. |
17848 | 2 Copyright (C) 1998-2006, 2008-2015 Free Software Foundation, Inc. |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
3 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
4 This program is free software; you can redistribute it and/or modify |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
5 it under the terms of the GNU General Public License as published by |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
6 the Free Software Foundation; either version 2, or (at your option) |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
7 any later version. |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
8 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
12 GNU General Public License for more details. |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
13 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
16366
bb182ee4a09d
maint: replace FSF snail-mail addresses with URLs
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
15 along with this program; if not, see <http://www.gnu.org/licenses/>. */ |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
16 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
17 /* Written by Simon Josefsson. This interface is influenced by |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
18 gcry_check_version from Werner Koch's Libgcrypt. Paul Eggert |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
19 suggested the use of strverscmp to simplify implementation. */ |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
20 |
7584
a88f85e4728f
* lib/arcfour.c: Assume config.h.
Eric Blake <ebb9@byu.net>
parents:
6942
diff
changeset
|
21 #include <config.h> |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
22 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
23 #include <stddef.h> |
10345
8d80c477e0ad
strverscmp: migrate from "strverscmp.h" to <string.h>
Eric Blake <ebb9@byu.net>
parents:
7584
diff
changeset
|
24 #include <string.h> |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
25 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
26 /* Get specification. */ |
5942 | 27 #include "check-version.h" |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
28 |
6942
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
29 /* Check that the version of the library (i.e., the CPP symbol VERSION) |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
30 * is at minimum the requested one in REQ_VERSION (typically found in |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
31 * a header file) and return the version string. Return NULL if the |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
32 * condition is not satisfied. If a NULL is passed to this function, |
9e87d8474fb1
* lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents:
6259
diff
changeset
|
33 * no check is done, but the version string is simply returned. |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
34 */ |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
35 const char * |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
36 check_version (const char *req_version) |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
37 { |
5996
1805e2c15a5b
(check_version): Accept identical versions too.
Simon Josefsson <simon@josefsson.org>
parents:
5942
diff
changeset
|
38 if (!req_version || strverscmp (req_version, VERSION) <= 0) |
5940
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
39 return VERSION; |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
40 |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
41 return NULL; |
5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
42 } |