* Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.

* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.
This commit is contained in:
thorpej 2002-05-24 22:17:20 +00:00
parent d67a5bbb21
commit 42320e8223
6 changed files with 31 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdio.h,v 1.44 2002/05/24 21:07:44 thorpej Exp $ */
/* $NetBSD: stdio.h,v 1.45 2002/05/24 22:17:20 thorpej Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -371,6 +371,9 @@ int vasprintf __P((char ** __restrict, const char * __restrict,
__attribute__((__format__(__printf__, 2, 0)));
int vscanf __P((const char * __restrict, _BSD_VA_LIST_))
__attribute__((__format__(__scanf__, 1, 0)));
int vfscanf __P((FILE * __restrict, const char * __restrict,
_BSD_VA_LIST_))
__attribute__((__format__(__scanf__, 2, 0)));
int vsscanf __P((const char * __restrict, const char * __restrict,
_BSD_VA_LIST_))
__attribute__((__format__(__scanf__, 2, 0)));
@ -378,13 +381,6 @@ __const char *fmtcheck __P((const char *, const char *))
__attribute__((__format_arg__(2)));
__END_DECLS
/*
* This is a #define because the function is used internally and
* (unlike vfscanf) the name __svfscanf is guaranteed not to collide
* with a user function when _ANSI_SOURCE or _POSIX_SOURCE is defined.
*/
#define vfscanf(fp, fmt, va) __svfscanf((fp), (fmt), (va))
/*
* Stdio function-access interface.
*/
@ -404,9 +400,6 @@ __END_DECLS
*/
__BEGIN_DECLS
int __srget __P((FILE *));
int __svfscanf __P((FILE * __restrict, const char * __restrict,
_BSD_VA_LIST_))
__attribute__((__format__(__scanf__, 2, 0)));
int __swbuf __P((int, FILE *));
__END_DECLS

View File

@ -1,4 +1,4 @@
/* $NetBSD: fscanf.c,v 1.8 1999/09/20 04:39:28 lukem Exp $ */
/* $NetBSD: fscanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)fscanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: fscanf.c,v 1.8 1999/09/20 04:39:28 lukem Exp $");
__RCSID("$NetBSD: fscanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -54,6 +54,8 @@ __RCSID("$NetBSD: fscanf.c,v 1.8 1999/09/20 04:39:28 lukem Exp $");
#include <varargs.h>
#endif
#include "local.h"
int
#if __STDC__
fscanf(FILE *fp, char const *fmt, ...) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: local.h,v 1.10 2001/12/07 11:47:43 yamt Exp $ */
/* $NetBSD: local.h,v 1.11 2002/05/24 22:17:20 thorpej Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -62,6 +62,9 @@ extern int _fwalk __P((int (*)(FILE *)));
extern char *_mktemp __P((char *));
extern int __swsetup __P((FILE *));
extern int __sflags __P((const char *, int *));
extern int __svfscanf __P((FILE * __restrict, const char * __restrict,
_BSD_VA_LIST_))
__attribute__((__format__(__scanf__, 2, 0)));
extern int __sdidinit;

View File

@ -1,4 +1,4 @@
/* $NetBSD: scanf.c,v 1.8 1999/09/20 04:39:32 lukem Exp $ */
/* $NetBSD: scanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)scanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: scanf.c,v 1.8 1999/09/20 04:39:32 lukem Exp $");
__RCSID("$NetBSD: scanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -54,6 +54,8 @@ __RCSID("$NetBSD: scanf.c,v 1.8 1999/09/20 04:39:32 lukem Exp $");
#include <varargs.h>
#endif
#include "local.h"
int
#if __STDC__
scanf(char const *fmt, ...)

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfscanf.c,v 1.30 2001/12/07 11:47:45 yamt Exp $ */
/* $NetBSD: vfscanf.c,v 1.31 2002/05/24 22:17:20 thorpej Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: vfscanf.c,v 1.30 2001/12/07 11:47:45 yamt Exp $");
__RCSID("$NetBSD: vfscanf.c,v 1.31 2002/05/24 22:17:20 thorpej Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -67,6 +67,15 @@ __RCSID("$NetBSD: vfscanf.c,v 1.30 2001/12/07 11:47:45 yamt Exp $");
#include "floatio.h"
#endif
/*
* Provide an external name for vfscanf. Note, we don't use the normal
* namespace.h method; stdio routines explicitly use the internal name
* __svfscanf.
*/
#ifdef __weak_alias
__weak_alias(vfscanf,__svfscanf)
#endif
#define BUF 513 /* Maximum length of numeric string. */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: vscanf.c,v 1.9 1999/09/20 04:39:34 lukem Exp $ */
/* $NetBSD: vscanf.c,v 1.10 2002/05/24 22:17:21 thorpej Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)vscanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: vscanf.c,v 1.9 1999/09/20 04:39:34 lukem Exp $");
__RCSID("$NetBSD: vscanf.c,v 1.10 2002/05/24 22:17:21 thorpej Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -49,6 +49,8 @@ __RCSID("$NetBSD: vscanf.c,v 1.9 1999/09/20 04:39:34 lukem Exp $");
#include <errno.h>
#include <stdio.h>
#include "local.h"
int
vscanf(fmt, ap)
const char *fmt;