annotate lib/freadable.h @ 9084:2932e92d6e31

* lib/version-etc.c (version_etc_va): Default to GPLv3+. * NEWS: Document this change.
author Eric Blake <ebb9@byu.net>
date Tue, 10 Jul 2007 12:22:36 +0000
parents d9b52dd72361
children bbbbbf4cd1c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8687
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Retrieve information about a FILE stream.
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 Copyright (C) 2007 Free Software Foundation, Inc.
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 2, or (at your option)
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 any later version.
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License along
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 with this program; if not, write to the Free Software Foundation,
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #include <stdbool.h>
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <stdio.h>
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 /* Return true if the stream STREAM supports reading, false if it supports
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 only writing, i.e. if it was opened write-only or append-only.
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 STREAM must not be wide-character oriented.
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 The result doesn't change until the stream is closed or re-opened. */
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #if HAVE___FREADABLE /* glibc >= 2.2, Solaris >= 7 */
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 # include <stdio_ext.h>
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 # define freadable(stream) (__freadable (stream) != 0)
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 #else
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 # ifdef __cplusplus
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 extern "C" {
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 # endif
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 extern bool freadable (FILE *stream);
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 # ifdef __cplusplus
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 }
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 # endif
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
d9b52dd72361 New module 'freadable'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 #endif