Mercurial > hg > octave-kai > gnulib-hg
annotate lib/xvasprintf.h @ 17160:72f4bab621be
fts: introduce FTS_VERBATIM
This gives clients the option to disable stripping of trailing slashes
from input path names during fts_open initialization.
The recent change v0.0-7611-g3a9002d that made fts_open strip trailing
slashes from input path names had a negative impact on findutils that
relies on the old fts_open behavior to implement POSIX requirement that
each path operand of the find utility shall be evaluated unaltered as it
was provided, including all trailing slash characters.
* lib/fts_.h (FTS_VERBATIM): New bit flag.
(FTS_OPTIONMASK, FTS_NAMEONLY, FTS_STOP): Adjust.
* lib/fts.c (fts_open): Honor it.
author | Dmitry V. Levin <ldv@altlinux.org> |
---|---|
date | Sun, 18 Nov 2012 04:40:18 +0400 |
parents | 8250f2777afc |
children | e542fd46ad6f |
rev | line source |
---|---|
5218 | 1 /* vasprintf and asprintf with out-of-memory checking. |
16201
8250f2777afc
maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents:
14350
diff
changeset
|
2 Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. |
5218 | 3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8386
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
5218 | 5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8386
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8386
diff
changeset
|
7 (at your option) any later version. |
5218 | 8 |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8386
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8386
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
5218 | 16 |
17 #ifndef _XVASPRINTF_H | |
18 #define _XVASPRINTF_H | |
19 | |
20 /* Get va_list. */ | |
21 #include <stdarg.h> | |
22 | |
12762
410eaa89fb57
Avoid a link error due to the __printf__ symbol.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
23 /* The __attribute__ feature is available in gcc versions 2.5 and later. |
410eaa89fb57
Avoid a link error due to the __printf__ symbol.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
24 The __-protected variants of the attributes 'format' and 'printf' are |
410eaa89fb57
Avoid a link error due to the __printf__ symbol.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
25 accepted by gcc versions 2.6.4 (effectively 2.7) and later. |
14350
4cf3b58aaf12
Don't interfere with a program's definition of __attribute__.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
26 We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because |
12762
410eaa89fb57
Avoid a link error due to the __printf__ symbol.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
27 gnulib and libintl do '#define printf __printf__' when they override |
410eaa89fb57
Avoid a link error due to the __printf__ symbol.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
28 the 'printf' function. */ |
14350
4cf3b58aaf12
Don't interfere with a program's definition of __attribute__.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
29 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) |
4cf3b58aaf12
Don't interfere with a program's definition of __attribute__.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
30 # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) |
4cf3b58aaf12
Don't interfere with a program's definition of __attribute__.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
31 #else |
4cf3b58aaf12
Don't interfere with a program's definition of __attribute__.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
32 # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ |
5218 | 33 #endif |
34 | |
8386
4ec84f742938
Convert tabs in the middle of preprocessor directives.
Bruno Haible <bruno@clisp.org>
parents:
6880
diff
changeset
|
35 #ifdef __cplusplus |
5218 | 36 extern "C" { |
37 #endif | |
38 | |
6880 | 39 /* Write formatted output to a string dynamically allocated with malloc(), |
40 and return it. Upon [ENOMEM] memory allocation error, call xalloc_die. | |
5218 | 41 On some other error |
42 - [EOVERFLOW] resulting string length is > INT_MAX, | |
43 - [EINVAL] invalid format string, | |
44 - [EILSEQ] error during conversion between wide and multibyte characters, | |
45 return NULL. */ | |
46 extern char *xasprintf (const char *format, ...) | |
14350
4cf3b58aaf12
Don't interfere with a program's definition of __attribute__.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
47 _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 2)); |
5218 | 48 extern char *xvasprintf (const char *format, va_list args) |
14350
4cf3b58aaf12
Don't interfere with a program's definition of __attribute__.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
49 _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 0)); |
5218 | 50 |
8386
4ec84f742938
Convert tabs in the middle of preprocessor directives.
Bruno Haible <bruno@clisp.org>
parents:
6880
diff
changeset
|
51 #ifdef __cplusplus |
5218 | 52 } |
53 #endif | |
54 | |
55 #endif /* _XVASPRINTF_H */ |