mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-24 10:59:29 +01:00
Deprecate fgetwln()
This function has the same problems as fgetln() which is already marked as deprecated.
This commit is contained in:
parent
6eebc1f264
commit
3cabf46bb0
15
man/libbsd.7
15
man/libbsd.7
@ -1,6 +1,6 @@
|
|||||||
.\" libbsd man page
|
.\" libbsd man page
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright © 2017 Gullem Jover <guillem@hadrons.org>
|
.\" Copyright © 2017-2018 Gullem Jover <guillem@hadrons.org>
|
||||||
.\"
|
.\"
|
||||||
.\" Redistribution and use in source and binary forms, with or without
|
.\" Redistribution and use in source and binary forms, with or without
|
||||||
.\" modification, are permitted provided that the following conditions
|
.\" modification, are permitted provided that the following conditions
|
||||||
@ -24,7 +24,7 @@
|
|||||||
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.Dd May 31 2017
|
.Dd May 21 2018
|
||||||
.Dt LIBBSD 7
|
.Dt LIBBSD 7
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -143,6 +143,17 @@ Use
|
|||||||
.Fn getline 3
|
.Fn getline 3
|
||||||
instead, which is available in many systems and required by
|
instead, which is available in many systems and required by
|
||||||
.St -p1003.1-2008 .
|
.St -p1003.1-2008 .
|
||||||
|
.It Fn fgetwln
|
||||||
|
Unportable, requires assistance from the stdio layer.
|
||||||
|
An implementation has to choose between leaking buffers or being reentrant
|
||||||
|
for a limited amount of streams (this implementation chose the latter with
|
||||||
|
a limit of 32).
|
||||||
|
Use
|
||||||
|
.Fn fgetwc 3
|
||||||
|
instead, which is available in many systems and required by
|
||||||
|
.St -isoC-99
|
||||||
|
and
|
||||||
|
.St -p1003.1-2001 .
|
||||||
.It Fn funopen
|
.It Fn funopen
|
||||||
Unportable, requires assistance from the stdio layer or some hook framework.
|
Unportable, requires assistance from the stdio layer or some hook framework.
|
||||||
On GNU systems the
|
On GNU systems the
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
|
#include "local-link.h"
|
||||||
|
|
||||||
struct filewbuf {
|
struct filewbuf {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
wchar_t *wbuf;
|
wchar_t *wbuf;
|
||||||
@ -85,3 +87,6 @@ fgetwln(FILE *stream, size_t *lenp)
|
|||||||
*lenp = wused;
|
*lenp = wused;
|
||||||
return wused ? fb->wbuf : NULL;
|
return wused ? fb->wbuf : NULL;
|
||||||
}
|
}
|
||||||
|
libbsd_link_warning(fgetwln,
|
||||||
|
"This function cannot be safely ported, use fgetwc(3) "
|
||||||
|
"instead, as it is supported by C99 and POSIX.1-2001.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user