2004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>

* libc/stdio/asprintf.c libc/stdio/clearerr.c,
        libc/stdio/fclose.c libc/stdio/fcloseall.c libc/stdio/fdopen.c,
        libc/stdio/feof.c libc/stdio/ferror.c libc/stdio/fflush.c,
        libc/stdio/fgetc.c libc/stdio/fgetpos.c libc/stdio/fgets.c,
        libc/stdio/fileno.c libc/stdio/findfp.c libc/stdio/fiprintf.c,
        libc/stdio/flags.c libc/stdio/fopen.c libc/stdio/fprintf.c,
        libc/stdio/fputc.c libc/stdio/fputs.c libc/stdio/fread.c,
        libc/stdio/freopen.c libc/stdio/fscanf.c libc/stdio/fseek.c,
        libc/stdio/fseeko.c libc/stdio/fsetpos.c libc/stdio/ftell.c,
        libc/stdio/ftello.c libc/stdio/fvwrite.c libc/stdio/fwalk.c,
        libc/stdio/fwrite.c libc/stdio/getc.c libc/stdio/getc_u.c,
        libc/stdio/getchar.c libc/stdio/getchar_u.c,
        libc/stdio/getdelim.c libc/stdio/getline.c libc/stdio/gets.c,
        libc/stdio/getw.c libc/stdio/iprintf.c libc/stdio/local.h,
        libc/stdio/makebuf.c libc/stdio/mktemp.c libc/stdio/perror.c,
        libc/stdio/printf.c libc/stdio/putc.c libc/stdio/putc_u.c,
        libc/stdio/putchar.c libc/stdio/putchar_u.c libc/stdio/puts.c,
        libc/stdio/putw.c libc/stdio/refill.c libc/stdio/remove.c,
        libc/stdio/rename.c libc/stdio/rewind.c libc/stdio/rget.c,
        libc/stdio/scanf.c libc/stdio/setbuf.c libc/stdio/setbuffer.c,
        libc/stdio/setlinebuf.c libc/stdio/setvbuf.c,
        libc/stdio/siprintf.c libc/stdio/snprintf.c,
        libc/stdio/sprintf.c libc/stdio/sscanf.c libc/stdio/stdio.c,
        libc/stdio/tmpfile.c libc/stdio/tmpnam.c libc/stdio/ungetc.c,
        libc/stdio/vasprintf.c libc/stdio/vfieeefp.h,
        libc/stdio/vfprintf.c libc/stdio/vfscanf.c,
        libc/stdio/vprintf.c libc/stdio/vscanf.c,
        libc/stdio/vsnprintf.c libc/stdio/vsprintf.c,
        libc/stdio/vsscanf.c libc/stdio/wbuf.c,
        libc/stdio/wsetup.c: Perform minor formatting changes.  Move
        copyright notices to top of file, ensure that <_ansi.h> is
        included, be consistent with open parentheses, use _DEFUN macro,
        include "local.h" where needed, and remove various compiler
        warnings.
This commit is contained in:
Jeff Johnston
2004-04-23 20:01:55 +00:00
parent 7ed02aabd1
commit 05b315770a
79 changed files with 1502 additions and 1157 deletions

View File

@ -1,3 +1,40 @@
2004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* libc/stdio/asprintf.c libc/stdio/clearerr.c,
libc/stdio/fclose.c libc/stdio/fcloseall.c libc/stdio/fdopen.c,
libc/stdio/feof.c libc/stdio/ferror.c libc/stdio/fflush.c,
libc/stdio/fgetc.c libc/stdio/fgetpos.c libc/stdio/fgets.c,
libc/stdio/fileno.c libc/stdio/findfp.c libc/stdio/fiprintf.c,
libc/stdio/flags.c libc/stdio/fopen.c libc/stdio/fprintf.c,
libc/stdio/fputc.c libc/stdio/fputs.c libc/stdio/fread.c,
libc/stdio/freopen.c libc/stdio/fscanf.c libc/stdio/fseek.c,
libc/stdio/fseeko.c libc/stdio/fsetpos.c libc/stdio/ftell.c,
libc/stdio/ftello.c libc/stdio/fvwrite.c libc/stdio/fwalk.c,
libc/stdio/fwrite.c libc/stdio/getc.c libc/stdio/getc_u.c,
libc/stdio/getchar.c libc/stdio/getchar_u.c,
libc/stdio/getdelim.c libc/stdio/getline.c libc/stdio/gets.c,
libc/stdio/getw.c libc/stdio/iprintf.c libc/stdio/local.h,
libc/stdio/makebuf.c libc/stdio/mktemp.c libc/stdio/perror.c,
libc/stdio/printf.c libc/stdio/putc.c libc/stdio/putc_u.c,
libc/stdio/putchar.c libc/stdio/putchar_u.c libc/stdio/puts.c,
libc/stdio/putw.c libc/stdio/refill.c libc/stdio/remove.c,
libc/stdio/rename.c libc/stdio/rewind.c libc/stdio/rget.c,
libc/stdio/scanf.c libc/stdio/setbuf.c libc/stdio/setbuffer.c,
libc/stdio/setlinebuf.c libc/stdio/setvbuf.c,
libc/stdio/siprintf.c libc/stdio/snprintf.c,
libc/stdio/sprintf.c libc/stdio/sscanf.c libc/stdio/stdio.c,
libc/stdio/tmpfile.c libc/stdio/tmpnam.c libc/stdio/ungetc.c,
libc/stdio/vasprintf.c libc/stdio/vfieeefp.h,
libc/stdio/vfprintf.c libc/stdio/vfscanf.c,
libc/stdio/vprintf.c libc/stdio/vscanf.c,
libc/stdio/vsnprintf.c libc/stdio/vsprintf.c,
libc/stdio/vsscanf.c libc/stdio/wbuf.c,
libc/stdio/wsetup.c: Perform minor formatting changes. Move
copyright notices to top of file, ensure that <_ansi.h> is
included, be consistent with open parentheses, use _DEFUN macro,
include "local.h" where needed, and remove various compiler
warnings.
2004-04-21 J"orn Rennecke <joern.rennecke@superh.com> 2004-04-21 J"orn Rennecke <joern.rennecke@superh.com>
* libc/stdio/vfscanf.c (NNZDIGITS): New define. * libc/stdio/vfscanf.c (NNZDIGITS): New define.

View File

@ -14,9 +14,10 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* This code was copied from sprintf.c */ /* This code was copied from sprintf.c */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
@ -24,12 +25,14 @@
#include <varargs.h> #include <varargs.h>
#endif #endif
#include <limits.h> #include <limits.h>
#include <_ansi.h>
#include "local.h" #include "local.h"
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_DEFUN (_asprintf_r, (ptr, strp, fmt), struct _reent *ptr _AND char **strp _AND _CONST char *fmt _DOTS) _DEFUN(_asprintf_r, (ptr, strp, fmt),
struct _reent *ptr _AND
char **strp _AND
_CONST char *fmt _DOTS)
#else #else
_asprintf_r(ptr, strp, fmt, va_alist) _asprintf_r(ptr, strp, fmt, va_alist)
struct _reent *ptr; struct _reent *ptr;
@ -63,7 +66,9 @@ _asprintf_r (ptr, strp, fmt, va_alist)
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_DEFUN (asprintf, (strp, fmt), char **strp _AND _CONST char *fmt _DOTS) _DEFUN(asprintf, (strp, fmt),
char **strp _AND
_CONST char *fmt _DOTS)
#else #else
asprintf(strp, fmt, va_alist) asprintf(strp, fmt, va_alist)
char **strp; char **strp;

View File

@ -52,6 +52,7 @@ ANSI C requires <<clearerr>>.
No supporting OS subroutines are required. No supporting OS subroutines are required.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#undef clearerr #undef clearerr

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fclose>>---close a file <<fclose>>---close a file
@ -10,7 +27,7 @@ INDEX
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
int fclose(FILE *<[fp]>); int fclose(FILE *<[fp]>);
int _fclose_r(void *<[reent]>, FILE *<[fp]>); int _fclose_r(struct _reent *<[reent]>, FILE *<[fp]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -18,7 +35,7 @@ TRAD_SYNOPSIS
FILE *<[fp]>; FILE *<[fp]>;
int fclose(<[fp]>) int fclose(<[fp]>)
void *<[reent]> struct _reent *<[reent]>
FILE *<[fp]>; FILE *<[fp]>;
DESCRIPTION DESCRIPTION
@ -40,32 +57,12 @@ Required OS subroutines: <<close>>, <<fstat>>, <<isatty>>, <<lseek>>,
<<read>>, <<sbrk>>, <<write>>. <<read>>, <<sbrk>>, <<write>>.
*/ */
/* #include <_ansi.h>
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <reent.h> #include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "local.h"
#include <sys/lock.h> #include <sys/lock.h>
#include "local.h"
/*
* Close a file.
*/
int int
_DEFUN(_fclose_r, (rptr, fp), _DEFUN(_fclose_r, (rptr, fp),

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fcloseall>>---close all files <<fcloseall>>---close all files
@ -37,34 +54,18 @@ PORTABILITY
Required OS subroutines: <<close>>, <<fstat>>, <<isatty>>, <<lseek>>, Required OS subroutines: <<close>>, <<fstat>>, <<isatty>>, <<lseek>>,
<<read>>, <<sbrk>>, <<write>>. <<read>>, <<sbrk>>, <<write>>.
*/ */
/* This file based upon fwalk.c. */ /* This file based upon fwalk.c. */
/* #include <_ansi.h>
* Copyright (c) 1990 The Regents of the University of California. #include <reent.h>
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "local.h" #include "local.h"
int int
_fcloseall_r (ptr) _DEFUN(_fcloseall_r, (ptr),
struct _reent *ptr; struct _reent *ptr)
{ {
return _fwalk_reent (ptr, _fclose_r); return _fwalk_reent (ptr, _fclose_r);
} }
@ -72,7 +73,7 @@ _fcloseall_r (ptr)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
fcloseall (void) _DEFUN_VOID(fcloseall)
{ {
return _fcloseall_r (_GLOBAL_REENT); return _fcloseall_r (_GLOBAL_REENT);
} }

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fdopen>>---turn open file into a stream <<fdopen>>---turn open file into a stream
@ -10,7 +27,7 @@ INDEX
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
FILE *fdopen(int <[fd]>, const char *<[mode]>); FILE *fdopen(int <[fd]>, const char *<[mode]>);
FILE *_fdopen_r(void *<[reent]>, FILE *_fdopen_r(struct _reent *<[reent]>,
int <[fd]>, const char *<[mode]>); int <[fd]>, const char *<[mode]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
@ -20,7 +37,7 @@ TRAD_SYNOPSIS
char *<[mode]>; char *<[mode]>;
FILE *_fdopen_r(<[reent]>, <[fd]>, <[mode]>) FILE *_fdopen_r(<[reent]>, <[fd]>, <[mode]>)
char *<[reent]>; struct _reent *<[reent]>;
int <[fd]>; int <[fd]>;
char *<[mode]>); char *<[mode]>);
@ -37,16 +54,15 @@ PORTABILITY
<<fdopen>> is ANSI. <<fdopen>> is ANSI.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include "local.h" #include "local.h"
#include <_syslist.h> #include <_syslist.h>
extern int __sflags ();
FILE * FILE *
_DEFUN(_fdopen_r, (ptr, fd, mode), _DEFUN(_fdopen_r, (ptr, fd, mode),
struct _reent *ptr _AND struct _reent *ptr _AND

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<feof>>---test for end of file <<feof>>---test for end of file

View File

@ -53,6 +53,7 @@ No supporting OS subroutines are required.
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
/* A subroutine version of the macro ferror. */ /* A subroutine version of the macro ferror. */

View File

@ -51,6 +51,7 @@ ANSI C requires <<fflush>>.
No supporting OS subroutines are required. No supporting OS subroutines are required.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include "local.h" #include "local.h"

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fgetc>>---get a character from a file or stream <<fgetc>>---get a character from a file or stream
@ -36,6 +53,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
int int

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fgetpos>>---record position in a stream or file <<fgetpos>>---record position in a stream or file
@ -54,6 +71,8 @@ conforming C implementations may return a different result from
No supporting OS subroutines are required. No supporting OS subroutines are required.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
int int

View File

@ -16,9 +16,9 @@
*/ */
/* /*
FUNCTION FUNCTION
<<fgets>>---get character string from a file or stream <<fgets>>---get character string from a file or stream
INDEX INDEX
fgets fgets
@ -54,10 +54,10 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "local.h"
extern int __srefill ();
/* /*
* Read at most n-1 characters from the given file. * Read at most n-1 characters from the given file.
@ -139,14 +139,14 @@ _DEFUN (fgets, (buf, n, fp),
len = ++t - p; len = ++t - p;
fp->_r -= len; fp->_r -= len;
fp->_p = t; fp->_p = t;
(void) memcpy ((_PTR) s, (_PTR) p, len); _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len);
s[len] = 0; s[len] = 0;
_funlockfile (fp); _funlockfile (fp);
return (buf); return (buf);
} }
fp->_r -= len; fp->_r -= len;
fp->_p += len; fp->_p += len;
(void) memcpy ((_PTR) s, (_PTR) p, len); _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len);
s += len; s += len;
} }
while ((n -= len) != 0); while ((n -= len) != 0);

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fileno>>---return file descriptor associated with stream <<fileno>>---return file descriptor associated with stream
@ -28,6 +45,7 @@ POSIX requires <<fileno>>.
Supporting OS subroutines required: none. Supporting OS subroutines required: none.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include "local.h" #include "local.h"

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,7 +14,10 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
@ -25,12 +26,12 @@
#include <sys/lock.h> #include <sys/lock.h>
#include "local.h" #include "local.h"
static void static _VOID
std (ptr, flags, file, data) _DEFUN(std, (ptr, flags, file, data),
FILE *ptr; FILE *ptr _AND
int flags; int flags _AND
int file; int file _AND
struct _reent *data; struct _reent *data)
{ {
ptr->_p = 0; ptr->_p = 0;
ptr->_r = 0; ptr->_r = 0;
@ -60,9 +61,9 @@ std (ptr, flags, file, data)
} }
struct _glue * struct _glue *
__sfmoreglue (d, n) _DEFUN(__sfmoreglue, (d, n),
struct _reent *d; struct _reent *d _AND
register int n; register int n)
{ {
struct _glue *g; struct _glue *g;
FILE *p; FILE *p;
@ -83,8 +84,8 @@ __sfmoreglue (d, n)
*/ */
FILE * FILE *
__sfp (d) _DEFUN(__sfp, (d),
struct _reent *d; struct _reent *d)
{ {
FILE *fp; FILE *fp;
int n; int n;
@ -138,17 +139,17 @@ found:
* The name `_cleanup' is, alas, fairly well known outside stdio. * The name `_cleanup' is, alas, fairly well known outside stdio.
*/ */
void _VOID
_cleanup_r (ptr) _DEFUN(_cleanup_r, (ptr),
struct _reent *ptr; struct _reent *ptr)
{ {
/* (void) _fwalk(fclose); */ /* _CAST_VOID _fwalk(fclose); */
(void) _fwalk (ptr, fflush); /* `cheating' */ _CAST_VOID _fwalk (ptr, fflush); /* `cheating' */
} }
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
void _VOID
_cleanup () _DEFUN_VOID(_cleanup)
{ {
_cleanup_r (_GLOBAL_REENT); _cleanup_r (_GLOBAL_REENT);
} }
@ -158,9 +159,9 @@ _cleanup ()
* __sinit() is called whenever stdio's internal variables must be set up. * __sinit() is called whenever stdio's internal variables must be set up.
*/ */
void _VOID
__sinit (s) _DEFUN(__sinit, (s),
struct _reent *s; struct _reent *s)
{ {
/* make sure we clean up on exit */ /* make sure we clean up on exit */
s->__cleanup = _cleanup_r; /* conservative */ s->__cleanup = _cleanup_r; /* conservative */
@ -197,22 +198,22 @@ __sinit (s)
__LOCK_INIT_RECURSIVE(static, __sfp_lock); __LOCK_INIT_RECURSIVE(static, __sfp_lock);
void _VOID
__sfp_lock_acquire () _DEFUN_VOID(__sfp_lock_acquire)
{ {
__lock_acquire(__sfp_lock); __lock_acquire_recursive (__sfp_lock);
} }
void _VOID
__sfp_lock_release () _DEFUN_VOID(__sfp_lock_release)
{ {
__lock_release(__sfp_lock); __lock_release_recursive (__sfp_lock);
} }
/* Walkable file locking routine. */ /* Walkable file locking routine. */
static int static int
__fp_lock (ptr) _DEFUN(__fp_lock, (ptr),
FILE * ptr; FILE * ptr)
{ {
_flockfile (ptr); _flockfile (ptr);
@ -221,26 +222,26 @@ __fp_lock (ptr)
/* Walkable file unlocking routine. */ /* Walkable file unlocking routine. */
static int static int
__fp_unlock (ptr) _DEFUN(__fp_unlock, (ptr),
FILE * ptr; FILE * ptr)
{ {
_funlockfile (ptr); _funlockfile (ptr);
return 0; return 0;
} }
void _VOID
__fp_lock_all () _DEFUN_VOID(__fp_lock_all)
{ {
__sfp_lock_acquire (); __sfp_lock_acquire ();
(void) _fwalk (_REENT, __fp_lock); _CAST_VOID _fwalk (_REENT, __fp_lock);
} }
void _VOID
__fp_unlock_all () _DEFUN_VOID(__fp_unlock_all)
{ {
(void) _fwalk (_REENT, __fp_unlock); _CAST_VOID _fwalk (_REENT, __fp_unlock);
__sfp_lock_release (); __sfp_lock_release ();
} }

View File

@ -1,6 +1,24 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fiprintf>>---format output to file (integer only) <<fiprintf>>---format output to file (integer only)
INDEX INDEX
fiprintf fiprintf
@ -38,7 +56,6 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#include <_ansi.h> #include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
@ -47,7 +64,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
fiprintf (FILE * fp, const char *fmt,...) fiprintf(FILE * fp, _CONST char *fmt,...)
#else #else
int int
fiprintf(fp, fmt, va_alist) fiprintf(fp, fmt, va_alist)

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92 */
/* /*
* Copyright (c) 1990 Regents of the University of California. * Copyright (c) 1990 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,11 +14,12 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92 */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
@ -31,10 +30,10 @@
*/ */
int int
__sflags (ptr, mode, optr) _DEFUN(__sflags, (ptr, mode, optr),
struct _reent *ptr; struct _reent *ptr _AND
register char *mode; register char *mode _AND
int *optr; int *optr)
{ {
register int ret, m, o; register int ret, m, o;

View File

@ -28,7 +28,7 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
FILE *fopen(const char *<[file]>, const char *<[mode]>); FILE *fopen(const char *<[file]>, const char *<[mode]>);
FILE *_fopen_r(void *<[reent]>, FILE *_fopen_r(struct _reent *<[reent]>,
const char *<[file]>, const char *<[mode]>); const char *<[file]>, const char *<[mode]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
@ -38,7 +38,7 @@ TRAD_SYNOPSIS
char *<[mode]>; char *<[mode]>;
FILE *_fopen_r(<[reent]>, <[file]>, <[mode]>) FILE *_fopen_r(<[reent]>, <[file]>, <[mode]>)
void *<[reent]>; struct _reent *<[reent]>;
char *<[file]>; char *<[file]>;
char *<[mode]>; char *<[mode]>;
@ -113,13 +113,15 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include "local.h" #include <sys/lock.h>
#ifdef __CYGWIN__ #ifdef __CYGWIN__
#include <fcntl.h> #include <fcntl.h>
#endif #endif
#include <sys/lock.h> #include "local.h"
FILE * FILE *
_DEFUN(_fopen_r, (ptr, file, mode), _DEFUN(_fopen_r, (ptr, file, mode),

View File

@ -17,7 +17,6 @@
#include <_ansi.h> #include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
@ -26,7 +25,7 @@
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
fprintf (FILE * fp, const char *fmt,...) fprintf(FILE * fp, _CONST char *fmt,...)
#else #else
int int
fprintf(fp, fmt, va_alist) fprintf(fp, fmt, va_alist)

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fputc>>---write a character on a stream or file <<fputc>>---write a character on a stream or file
@ -40,6 +57,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
int int

View File

@ -47,6 +47,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "fvwrite.h" #include "fvwrite.h"

View File

@ -55,6 +55,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "local.h" #include "local.h"
@ -131,7 +132,7 @@ _DEFUN (fread, (buf, size, count, fp),
while (resid > (r = fp->_r)) while (resid > (r = fp->_r))
{ {
(void) memcpy ((void *) p, (void *) fp->_p, (size_t) r); _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, (size_t) r);
fp->_p += r; fp->_p += r;
/* fp->_r = 0 ... done in __srefill */ /* fp->_r = 0 ... done in __srefill */
p += r; p += r;
@ -150,7 +151,7 @@ _DEFUN (fread, (buf, size, count, fp),
return (total - resid) / size; return (total - resid) / size;
} }
} }
(void) memcpy ((void *) p, (void *) fp->_p, resid); _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, resid);
fp->_r -= resid; fp->_r -= resid;
fp->_p += resid; fp->_p += resid;
#ifdef __SCLE #ifdef __SCLE

View File

@ -66,12 +66,14 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<open>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<open>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <time.h> #include <time.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdlib.h> #include <stdlib.h>
#include "local.h"
#include <sys/lock.h> #include <sys/lock.h>
#include "local.h"
/* /*
* Re-direct an existing, open (probably) file to some other file. * Re-direct an existing, open (probably) file to some other file.
@ -96,7 +98,7 @@ _DEFUN (_freopen_r, (ptr, file, mode, fp),
if ((flags = __sflags (ptr, mode, &oflags)) == 0) if ((flags = __sflags (ptr, mode, &oflags)) == 0)
{ {
_funlockfile (fp); _funlockfile (fp);
(void) _fclose_r (ptr, fp); _CAST_VOID _fclose_r (ptr, fp);
__sfp_lock_release (); __sfp_lock_release ();
return NULL; return NULL;
} }
@ -114,10 +116,10 @@ _DEFUN (_freopen_r, (ptr, file, mode, fp),
else else
{ {
if (fp->_flags & __SWR) if (fp->_flags & __SWR)
(void) fflush (fp); _CAST_VOID fflush (fp);
/* if close is NULL, closing is a no-op, hence pointless */ /* if close is NULL, closing is a no-op, hence pointless */
if (fp->_close != NULL) if (fp->_close != NULL)
(void) (*fp->_close) (fp->_cookie); _CAST_VOID (*fp->_close) (fp->_cookie);
} }
/* /*

View File

@ -16,21 +16,20 @@
*/ */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "local.h" #include "local.h"
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
fscanf (FILE *fp, const char *fmt, ...) fscanf(FILE *fp, _CONST char *fmt, ...)
#else #else
fscanf(FILE *fp, fmt, va_alist) fscanf(FILE *fp, fmt, va_alist)
FILE *fp; FILE *fp;
@ -55,7 +54,7 @@ fscanf (FILE *fp, fmt, va_alist)
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_fscanf_r (struct _reent *ptr, FILE *fp, const char *fmt, ...) _fscanf_r(struct _reent *ptr, FILE *fp, _CONST char *fmt, ...)
#else #else
_fscanf_r(ptr, FILE *fp, fmt, va_alist) _fscanf_r(ptr, FILE *fp, fmt, va_alist)
struct _reent *ptr; struct _reent *ptr;

View File

@ -98,6 +98,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <fcntl.h> #include <fcntl.h>
@ -120,8 +122,9 @@ _DEFUN (_fseek_r, (ptr, fp, offset, whence),
long offset _AND long offset _AND
int whence) int whence)
{ {
_fpos_t _EXFUN ((*seekfn), (void *, _fpos_t, int)); _fpos_t _EXFUN((*seekfn), (_PTR, _fpos_t, int));
_fpos_t target, curoff; _fpos_t target;
_fpos_t curoff = 0;
size_t n; size_t n;
struct stat st; struct stat st;
int havepos; int havepos;

View File

@ -15,6 +15,8 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
int int
@ -30,10 +32,10 @@ _DEFUN (_fseeko_r, (ptr, fp, offset, whence),
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
fseeko (fp, offset, whence) _DEFUN(fseeko, (fp, offset, whence),
register FILE *fp; register FILE *fp _AND
_off_t offset; _off_t offset _AND
int whence; int whence)
{ {
/* for now we simply cast since off_t should be long */ /* for now we simply cast since off_t should be long */
return _fseek_r (_REENT, fp, (long)offset, whence); return _fseek_r (_REENT, fp, (long)offset, whence);

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<fsetpos>>---restore position of a stream or file <<fsetpos>>---restore position of a stream or file
@ -48,6 +65,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
int int

View File

@ -92,9 +92,10 @@ static char sccsid[] = "%W% (Berkeley) %G%";
* ftell: return current offset. * ftell: return current offset.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include "local.h" #include "local.h"
long long

View File

@ -15,6 +15,8 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
_off_t _off_t

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,7 +14,9 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
@ -24,7 +24,7 @@
#include "fvwrite.h" #include "fvwrite.h"
#define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b))
#define COPY(n) (void) memmove((void *) fp->_p, (void *) p, (size_t) (n)) #define COPY(n) _CAST_VOID memmove ((_PTR) fp->_p, (_PTR) p, (size_t) (n))
#define GETIOV(extra_work) \ #define GETIOV(extra_work) \
while (len == 0) \ while (len == 0) \
@ -43,12 +43,12 @@
*/ */
int int
__sfvwrite (fp, uio) _DEFUN(__sfvwrite, (fp, uio),
register FILE *fp; register FILE *fp _AND
register struct __suio *uio; register struct __suio *uio)
{ {
register size_t len; register size_t len;
register _CONST char *p; register _CONST char *p = NULL;
register struct __siov *iov; register struct __siov *iov;
register int w, s; register int w, s;
char *nl; char *nl;
@ -181,12 +181,13 @@ __sfvwrite (fp, uio)
* that the amount to write is MIN(len,nldist). * that the amount to write is MIN(len,nldist).
*/ */
nlknown = 0; nlknown = 0;
nldist = 0;
do do
{ {
GETIOV (nlknown = 0); GETIOV (nlknown = 0);
if (!nlknown) if (!nlknown)
{ {
nl = memchr ((void *) p, '\n', len); nl = memchr ((_PTR) p, '\n', len);
nldist = nl ? nl + 1 - p : len + 1; nldist = nl ? nl + 1 - p : len + 1;
nlknown = 1; nlknown = 1;
} }

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,20 +14,23 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "local.h" #include "local.h"
static int static int
__fwalk (ptr, function) _DEFUN(__fwalk, (ptr, function),
struct _reent *ptr; struct _reent *ptr _AND
register int (*function) (); register int (*function) ())
{ {
register FILE *fp; register FILE *fp;
register int n, ret = 0; register int n, ret = 0;
@ -51,9 +52,9 @@ __fwalk (ptr, function)
/* Special version of __fwalk where the function pointer is a reentrant /* Special version of __fwalk where the function pointer is a reentrant
I/O function (e.g. _fclose_r). */ I/O function (e.g. _fclose_r). */
static int static int
__fwalk_reent (ptr, reent_function) _DEFUN(__fwalk_reent, (ptr, reent_function),
struct _reent *ptr; struct _reent *ptr _AND
register int (*reent_function) (); register int (*reent_function) ())
{ {
register FILE *fp; register FILE *fp;
register int n, ret = 0; register int n, ret = 0;
@ -73,9 +74,9 @@ __fwalk_reent (ptr, reent_function)
} }
int int
_fwalk (ptr, function) _DEFUN(_fwalk, (ptr, function),
struct _reent *ptr; struct _reent *ptr _AND
register int (*function) (); register int (*function)())
{ {
register int ret = 0; register int ret = 0;
@ -96,9 +97,9 @@ _fwalk (ptr, function)
/* Special version of _fwalk which handles a function pointer to a /* Special version of _fwalk which handles a function pointer to a
reentrant I/O function (e.g. _fclose_r). */ reentrant I/O function (e.g. _fclose_r). */
int int
_fwalk_reent (ptr, reent_function) _DEFUN(_fwalk_reent, (ptr, reent_function),
struct _reent *ptr; struct _reent *ptr _AND
register int (*reent_function) (); register int (*reent_function) ())
{ {
register int ret = 0; register int ret = 0;

View File

@ -61,6 +61,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#if 0 #if 0

View File

@ -62,6 +62,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
/* /*
@ -71,8 +72,8 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#undef getc #undef getc
int int
getc (fp) _DEFUN(getc, (fp),
register FILE *fp; register FILE *fp)
{ {
int result; int result;
_flockfile (fp); _flockfile (fp);

View File

@ -50,6 +50,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
/* /*
@ -59,8 +60,8 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#undef getc_unlocked #undef getc_unlocked
int int
getc_unlocked (fp) _DEFUN(getc_unlocked, (fp),
register FILE *fp; register FILE *fp)
{ {
/* CHECK_INIT is called (eventually) by __srefill. */ /* CHECK_INIT is called (eventually) by __srefill. */

View File

@ -28,7 +28,7 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
int getchar(void); int getchar(void);
int _getchar_r(void *<[reent]>); int _getchar_r(struct _reent *<[reent]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -71,16 +71,16 @@ static char sccsid[] = "%W% (Berkeley) %G%";
* A subroutine version of the macro getchar. * A subroutine version of the macro getchar.
*/ */
#include <stdio.h> #include <_ansi.h>
#include <reent.h> #include <reent.h>
#include <stdio.h>
#include "local.h" #include "local.h"
#undef getchar #undef getchar
int int
_getchar_r (f) _DEFUN(_getchar_r, (f),
struct _reent *f; struct _reent *f)
{ {
_REENT_SMALL_CHECK_INIT (_stdin_r (f)); _REENT_SMALL_CHECK_INIT (_stdin_r (f));
return getc (_stdin_r (f)); return getc (_stdin_r (f));
@ -89,7 +89,7 @@ _getchar_r (f)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
getchar () _DEFUN_VOID(getchar)
{ {
/* CHECK_INIT is called (eventually) by __srefill. */ /* CHECK_INIT is called (eventually) by __srefill. */

View File

@ -54,14 +54,15 @@ static char sccsid[] = "%W% (Berkeley) %G%";
* A subroutine version of the macro getchar_unlocked. * A subroutine version of the macro getchar_unlocked.
*/ */
#include <stdio.h> #include <_ansi.h>
#include <reent.h> #include <reent.h>
#include <stdio.h>
#undef getchar_unlocked #undef getchar_unlocked
int int
_getchar_unlocked_r (f) _DEFUN(_getchar_unlocked_r, (f),
struct _reent *f; struct _reent *f)
{ {
return getc_unlocked (_stdin_r (f)); return getc_unlocked (_stdin_r (f));
} }
@ -69,7 +70,7 @@ _getchar_unlocked_r (f)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
getchar_unlocked () _DEFUN_VOID(getchar_unlocked)
{ {
/* CHECK_INIT is called (eventually) by __srefill. */ /* CHECK_INIT is called (eventually) by __srefill. */

View File

@ -1,3 +1,4 @@
/* Copyright 2002, Red Hat Inc. - all rights reserved */
/* /*
FUNCTION FUNCTION
<<getdelim>>---read a line up to a specified line delimeter <<getdelim>>---read a line up to a specified line delimeter
@ -37,8 +38,7 @@ PORTABILITY
No supporting OS subroutines are directly required. No supporting OS subroutines are directly required.
*/ */
/* Copyright 2002, Red Hat Inc. - all rights reserved */ #include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
@ -48,11 +48,11 @@ No supporting OS subroutines are directly required.
#define DEFAULT_LINE_SIZE 128 #define DEFAULT_LINE_SIZE 128
ssize_t ssize_t
__getdelim (bufptr, n, delim, fp) _DEFUN(__getdelim, (bufptr, n, delim, fp),
char **bufptr; char **bufptr _AND
size_t *n; size_t *n _AND
int delim; int delim _AND
FILE *fp; FILE *fp)
{ {
char *buf; char *buf;
char *ptr; char *ptr;

View File

@ -1,3 +1,4 @@
/* Copyright 2002, Red Hat Inc. - all rights reserved */
/* /*
FUNCTION FUNCTION
<<getline>>---read a line from a file <<getline>>---read a line from a file
@ -37,17 +38,16 @@ PORTABILITY
No supporting OS subroutines are directly required. No supporting OS subroutines are directly required.
*/ */
/* Copyright 2002, Red Hat Inc. - all rights reserved */ #include <_ansi.h>
#include <stdio.h> #include <stdio.h>
extern ssize_t __getdelim (char **, size_t *, int, FILE *); extern ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));
ssize_t ssize_t
__getline (lptr, n, fp) _DEFUN(__getline, (lptr, n, fp),
char **lptr; char **lptr _AND
size_t *n; size_t *n _AND
FILE *fp; FILE *fp)
{ {
return __getdelim (lptr, n, '\n', fp); return __getdelim (lptr, n, '\n', fp);
} }

View File

@ -15,11 +15,10 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* /*
FUNCTION FUNCTION
<<gets>>---get character string (obsolete, use <<fgets>> instead) <<gets>>---get character string (obsolete, use <<fgets>> instead)
INDEX INDEX
gets gets
INDEX INDEX
@ -30,7 +29,7 @@ ANSI_SYNOPSIS
char *gets(char *<[buf]>); char *gets(char *<[buf]>);
char *_gets_r(void *<[reent]>, char *<[buf]>); char *_gets_r(struct _reent *<[reent]>, char *<[buf]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -39,7 +38,7 @@ TRAD_SYNOPSIS
char *<[buf]>; char *<[buf]>;
char *_gets_r(<[reent]>, <[buf]>) char *_gets_r(<[reent]>, <[buf]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[buf]>; char *<[buf]>;
DESCRIPTION DESCRIPTION
@ -68,12 +67,14 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
char * char *
_gets_r (ptr, buf) _DEFUN(_gets_r, (ptr, buf),
struct _reent *ptr; struct _reent *ptr _AND
char *buf; char *buf)
{ {
register int c; register int c;
register char *s = buf; register char *s = buf;
@ -93,8 +94,8 @@ _gets_r (ptr, buf)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
char * char *
gets (buf) _DEFUN(gets, (buf),
char *buf; char *buf)
{ {
return _gets_r (_REENT, buf); return _gets_r (_REENT, buf);
} }

View File

@ -54,11 +54,12 @@ Supporting OS subroutines required: <<fread>>. */
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
int int
getw (fp) _DEFUN(getw, (fp),
register FILE *fp; register FILE *fp)
{ {
int result; int result;
if (fread ((char*)&result, sizeof (result), 1, fp) != 1) if (fread ((char*)&result, sizeof (result), 1, fp) != 1)

View File

@ -1,6 +1,24 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<iprintf>>---write formatted output (integer only) <<iprintf>>---write formatted output (integer only)
INDEX INDEX
iprintf iprintf
@ -36,21 +54,20 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
*/ */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include "local.h"
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "local.h"
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
iprintf (const char *fmt,...) iprintf(_CONST char *fmt,...)
#else #else
int int
iprintf(fmt, va_alist) iprintf(fmt, va_alist)
@ -76,7 +93,7 @@ iprintf (fmt, va_alist)
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
_iprintf_r (struct _reent *ptr, const char *fmt, ...) _iprintf_r(struct _reent *ptr, _CONST char *fmt, ...)
#else #else
int int
_iprintf_r(data, fmt, va_alist) _iprintf_r(data, fmt, va_alist)

View File

@ -23,6 +23,7 @@
*/ */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdarg.h> #include <stdarg.h>
#include <reent.h> #include <reent.h>
#include <unistd.h> #include <unistd.h>
@ -31,15 +32,16 @@ extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list
extern FILE *_EXFUN(__sfp,(struct _reent *)); extern FILE *_EXFUN(__sfp,(struct _reent *));
extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*)); extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*));
extern int _EXFUN(__srefill,(FILE *)); extern int _EXFUN(__srefill,(FILE *));
extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(void *, char *, int)); extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(_PTR, char *, int));
extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite,(void *, char const *, int)); extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite,(_PTR, char _CONST *, int));
extern _fpos_t _EXFUN(__sseek,(void *, _fpos_t, int)); extern _fpos_t _EXFUN(__sseek,(_PTR, _fpos_t, int));
extern int _EXFUN(__sclose,(void *)); extern int _EXFUN(__sclose,(_PTR));
extern int _EXFUN(__stextmode,(int)); extern int _EXFUN(__stextmode,(int));
extern void _EXFUN(__sinit,(struct _reent *)); extern _VOID _EXFUN(__sinit,(struct _reent *));
extern void _EXFUN(_cleanup_r,(struct _reent *)); extern _VOID _EXFUN(_cleanup_r,(struct _reent *));
extern void _EXFUN(__smakebuf,(FILE *)); extern _VOID _EXFUN(__smakebuf,(FILE *));
extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *))); extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *)));
extern int _EXFUN(_fwalk_reent,(struct _reent *, int (*)(FILE *)));
struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n)); struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n));
extern int _EXFUN(__srefill,(FILE *fp)); extern int _EXFUN(__srefill,(FILE *fp));
@ -92,6 +94,6 @@ char *_EXFUN(_llicvt,(char *, long long, char));
#define __sfp_lock_acquire() #define __sfp_lock_acquire()
#define __sfp_lock_release() #define __sfp_lock_release()
#else #else
void _EXFUN(__sfp_lock_acquire,(void)); _VOID _EXFUN(__sfp_lock_acquire,(_VOID));
void _EXFUN(__sfp_lock_release,(void)); _VOID _EXFUN(__sfp_lock_release,(_VOID));
#endif #endif

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,13 +14,14 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/unistd.h> #include <sys/unistd.h>
#include "local.h" #include "local.h"
/* /*
@ -33,9 +32,9 @@
* optimization) right after the _fstat() that finds the buffer size. * optimization) right after the _fstat() that finds the buffer size.
*/ */
void _VOID
__smakebuf (fp) _DEFUN(__smakebuf, (fp),
register FILE *fp; register FILE *fp)
{ {
register size_t size, couldbetty; register size_t size, couldbetty;
register _PTR p; register _PTR p;

View File

@ -1,8 +1,3 @@
/* This is file MKTEMP.C */
/* This file may have been modified by DJ Delorie (Jan 1991). If so,
** these modifications are Copyright (C) 1991 DJ Delorie.
*/
/* /*
* Copyright (c) 1987 Regents of the University of California. * Copyright (c) 1987 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -21,6 +16,10 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* This is file MKTEMP.C */
/* This file may have been modified by DJ Delorie (Jan 1991). If so,
** these modifications are Copyright (C) 1991 DJ Delorie.
*/
/* /*
FUNCTION FUNCTION
@ -40,8 +39,8 @@ ANSI_SYNOPSIS
char *mktemp(char *<[path]>); char *mktemp(char *<[path]>);
int mkstemp(char *<[path]>); int mkstemp(char *<[path]>);
char *_mktemp_r(void *<[reent]>, char *<[path]>); char *_mktemp_r(struct _reent *<[reent]>, char *<[path]>);
int *_mkstemp_r(void *<[reent]>, char *<[path]>); int *_mkstemp_r(struct _reent *<[reent]>, char *<[path]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -52,11 +51,11 @@ TRAD_SYNOPSIS
char *<[path]>; char *<[path]>;
char *_mktemp_r(<[reent]>, <[path]>) char *_mktemp_r(<[reent]>, <[path]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[path]>; char *<[path]>;
int _mkstemp_r(<[reent]>, <[path]>) int _mkstemp_r(<[reent]>, <[path]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[path]>; char *<[path]>;
DESCRIPTION DESCRIPTION
@ -93,13 +92,14 @@ V Interface Definition requires <<mktemp>> as of Issue 2.
Supporting OS subroutines required: <<getpid>>, <<open>>, <<stat>>. Supporting OS subroutines required: <<getpid>>, <<open>>, <<stat>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <reent.h>
static int static int
_DEFUN(_gettemp, (ptr, path, doopen), _DEFUN(_gettemp, (ptr, path, doopen),

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<perror>>---print an error message on standard error <<perror>>---print an error message on standard error
@ -11,7 +28,7 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
void perror(char *<[prefix]>); void perror(char *<[prefix]>);
void _perror_r(void *<[reent]>, char *<[prefix]>); void _perror_r(struct _reent *<[reent]>, char *<[prefix]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -19,7 +36,7 @@ TRAD_SYNOPSIS
char *<[prefix]>; char *<[prefix]>;
void _perror_r(<[reent]>, <[prefix]>) void _perror_r(<[reent]>, <[prefix]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[prefix]>; char *<[prefix]>;
DESCRIPTION DESCRIPTION
@ -33,7 +50,6 @@ of the strings described for <<strerror>>.
The alternate function <<_perror_r>> is a reentrant version. The The alternate function <<_perror_r>> is a reentrant version. The
extra argument <[reent]> is a pointer to a reentrancy structure. extra argument <[reent]> is a pointer to a reentrancy structure.
RETURNS RETURNS
<<perror>> returns no result. <<perror>> returns no result.
@ -45,13 +61,13 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <stddef.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "local.h" #include "local.h"
void _VOID
_DEFUN(_perror_r, (ptr, s), _DEFUN(_perror_r, (ptr, s),
struct _reent *ptr _AND struct _reent *ptr _AND
_CONST char *s) _CONST char *s)
@ -73,7 +89,7 @@ _DEFUN (_perror_r, (ptr, s),
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
void _VOID
_DEFUN(perror, (s), _DEFUN(perror, (s),
_CONST char *s) _CONST char *s)
{ {

View File

@ -1,18 +1,33 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include "local.h"
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "local.h"
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
_printf_r (struct _reent *ptr, const char *fmt, ...) _printf_r(struct _reent *ptr, _CONST char *fmt, ...)
#else #else
int int
_printf_r(ptr, fmt, va_alist) _printf_r(ptr, fmt, va_alist)
@ -39,7 +54,7 @@ _printf_r (ptr, fmt, va_alist)
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
printf (const char *fmt, ...) printf(_CONST char *fmt, ...)
#else #else
int int
printf(fmt, va_alist) printf(fmt, va_alist)

View File

@ -65,6 +65,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
/* /*
@ -74,9 +75,9 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#undef putc #undef putc
int int
putc (c, fp) _DEFUN(putc, (c, fp),
int c; int c _AND
register FILE *fp; register FILE *fp)
{ {
int result; int result;
_flockfile (fp); _flockfile (fp);

View File

@ -44,12 +44,14 @@ POSIX 1003.1 requires <<putc_unlocked>>. <<putc_unlocked>> may be
implemented as a macro, so arguments should not have side-effects. implemented as a macro, so arguments should not have side-effects.
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. */ <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
/* /*
@ -59,9 +61,9 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#undef putc_unlocked #undef putc_unlocked
int int
putc_unlocked (c, fp) _DEFUN(putc_unlocked, (c, fp),
int c; int c _AND
register FILE *fp; register FILE *fp)
{ {
/* CHECK_INIT is (eventually) called by __swbuf. */ /* CHECK_INIT is (eventually) called by __swbuf. */

View File

@ -28,7 +28,7 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
int putchar(int <[ch]>); int putchar(int <[ch]>);
int _putchar_r(void *<[reent]>, int <[ch]>); int _putchar_r(struct _reent *<[reent]>, int <[ch]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -36,7 +36,7 @@ TRAD_SYNOPSIS
int <[ch]>; int <[ch]>;
int _putchar_r(<[reent]>, <[ch]>) int _putchar_r(<[reent]>, <[ch]>)
char *<[reent]>; struct _reent *<[reent]>;
int <[ch]>; int <[ch]>;
DESCRIPTION DESCRIPTION
@ -68,16 +68,17 @@ static char sccsid[] = "%W% (Berkeley) %G%";
* A subroutine version of the macro putchar. * A subroutine version of the macro putchar.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include "local.h" #include "local.h"
#undef putchar #undef putchar
int int
_putchar_r (ptr, c) _DEFUN(_putchar_r, (ptr, c),
struct _reent *ptr; struct _reent *ptr _AND
int c; int c)
{ {
_REENT_SMALL_CHECK_INIT (_stdout_r (ptr)); _REENT_SMALL_CHECK_INIT (_stdout_r (ptr));
return putc (c, _stdout_r (ptr)); return putc (c, _stdout_r (ptr));
@ -86,8 +87,8 @@ _putchar_r (ptr, c)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
putchar (c) _DEFUN(putchar, (c),
int c; int c)
{ {
/* CHECK_INIT is (eventually) called by __swbuf. */ /* CHECK_INIT is (eventually) called by __swbuf. */

View File

@ -54,14 +54,16 @@ static char sccsid[] = "%W% (Berkeley) %G%";
* A subroutine version of the macro putchar_unlocked. * A subroutine version of the macro putchar_unlocked.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#undef putchar_unlocked #undef putchar_unlocked
int int
_putchar_unlocked_r (ptr, c) _DEFUN(_putchar_unlocked_r, (ptr, c),
struct _reent *ptr; struct _reent *ptr _AND
int c; int c)
{ {
return putc_unlocked (c, _stdout_r (ptr)); return putc_unlocked (c, _stdout_r (ptr));
} }
@ -69,12 +71,12 @@ _putchar_unlocked_r (ptr, c)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
putchar_unlocked (c) _DEFUN(putchar_unlocked, (c),
int c; int c)
{ {
/* CHECK_INIT is (eventually) called by __swbuf. */ /* CHECK_INIT is (eventually) called by __swbuf. */
_putchar_unlocked_r (_REENT, c); return _putchar_unlocked_r (_REENT, c);
} }
#endif #endif

View File

@ -28,7 +28,7 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
int puts(const char *<[s]>); int puts(const char *<[s]>);
int _puts_r(void *<[reent]>, const char *<[s]>); int _puts_r(struct _reent *<[reent]>, const char *<[s]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -36,7 +36,7 @@ TRAD_SYNOPSIS
char *<[s]>; char *<[s]>;
int _puts_r(<[reent]>, <[s]>) int _puts_r(<[reent]>, <[s]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[s]>; char *<[s]>;
DESCRIPTION DESCRIPTION
@ -55,15 +55,17 @@ ANSI C requires <<puts>>, but does not specify that the result on
success must be <<0>>; any non-negative value is permitted. success must be <<0>>; any non-negative value is permitted.
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. */ <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "fvwrite.h" #include "fvwrite.h"
#include "local.h" #include "local.h"

View File

@ -44,7 +44,8 @@ PORTABILITY
<<fwrite>> should be used instead. In fact, this implementation of <<fwrite>> should be used instead. In fact, this implementation of
<<putw>> is based upon <<fwrite>>. <<putw>> is based upon <<fwrite>>.
Supporting OS subroutines required: <<fwrite>>. */ Supporting OS subroutines required: <<fwrite>>.
*/
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
@ -53,11 +54,11 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#include <stdio.h> #include <stdio.h>
int int
putw (w, fp) _DEFUN(putw, (w, fp),
int w; int w _AND
register FILE *fp; register FILE *fp)
{ {
if (fwrite((const char*)&w, sizeof(w), 1, fp) != 1) if (fwrite ((_CONST char*)&w, sizeof (w), 1, fp) != 1)
return EOF; return EOF;
return 0; return 0;
} }

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,14 +14,16 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include "local.h"
#include <stdlib.h> #include <stdlib.h>
#include "local.h"
static int static int
lflush (fp) _DEFUN(lflush, (fp),
FILE *fp; FILE *fp)
{ {
if ((fp->_flags & (__SLBF | __SWR)) == (__SLBF | __SWR)) if ((fp->_flags & (__SLBF | __SWR)) == (__SLBF | __SWR))
return fflush (fp); return fflush (fp);
@ -94,7 +94,7 @@ _DEFUN (__srefill, (fp),
*/ */
if (fp->_flags & (__SLBF | __SNBF)) if (fp->_flags & (__SLBF | __SNBF))
(void) _fwalk (_GLOBAL_REENT, lflush); _CAST_VOID _fwalk (_GLOBAL_REENT, lflush);
fp->_p = fp->_bf._base; fp->_p = fp->_bf._base;
fp->_r = (*fp->_read) (fp->_cookie, (char *) fp->_p, fp->_bf._size); fp->_r = (*fp->_read) (fp->_cookie, (char *) fp->_p, fp->_bf._size);
fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ fp->_flags &= ~__SMOD; /* buffer contents are again pristine */

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<remove>>---delete a file's name <<remove>>---delete a file's name
@ -9,7 +26,7 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
int remove(char *<[filename]>); int remove(char *<[filename]>);
int _remove_r(void *<[reent]>, char *<[filename]>); int _remove_r(struct _reent *<[reent]>, char *<[filename]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -17,7 +34,7 @@ TRAD_SYNOPSIS
char *<[filename]>; char *<[filename]>;
int _remove_r(<[reent]>, <[filename]>) int _remove_r(<[reent]>, <[filename]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[filename]>; char *<[filename]>;
DESCRIPTION DESCRIPTION
@ -44,13 +61,14 @@ open file may vary among implementations.
Supporting OS subroutine required: <<unlink>>. Supporting OS subroutine required: <<unlink>>.
*/ */
#include <stdio.h> #include <_ansi.h>
#include <reent.h> #include <reent.h>
#include <stdio.h>
int int
_remove_r (ptr, filename) _DEFUN(_remove_r, (ptr, filename),
struct _reent *ptr; struct _reent *ptr _AND
_CONST char *filename; _CONST char *filename)
{ {
if (_unlink_r (ptr, filename) == -1) if (_unlink_r (ptr, filename) == -1)
return -1; return -1;
@ -61,8 +79,8 @@ _remove_r (ptr, filename)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
remove (filename) _DEFUN(remove, (filename),
_CONST char *filename; _CONST char *filename)
{ {
return _remove_r (_REENT, filename); return _remove_r (_REENT, filename);
} }

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<rename>>---rename a file <<rename>>---rename a file
@ -11,7 +28,7 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
int rename(const char *<[old]>, const char *<[new]>); int rename(const char *<[old]>, const char *<[new]>);
int _rename_r(void *<[reent]>, int _rename_r(struct _reent *<[reent]>,
const char *<[old]>, const char *<[new]>); const char *<[old]>, const char *<[new]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
@ -21,7 +38,7 @@ TRAD_SYNOPSIS
char *<[new]>; char *<[new]>;
int _rename_r(<[reent]>, <[old]>, <[new]>) int _rename_r(<[reent]>, <[old]>, <[new]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[old]>; char *<[old]>;
char *<[new]>; char *<[new]>;
@ -48,15 +65,16 @@ as <<*<[new]>>> may vary from one implementation to another.
Supporting OS subroutines required: <<link>>, <<unlink>>, or <<rename>>. Supporting OS subroutines required: <<link>>, <<unlink>>, or <<rename>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <sys/unistd.h> #include <sys/unistd.h>
#include <reent.h>
int int
_rename_r (ptr, old, new) _DEFUN(_rename_r, (ptr, old, new),
struct _reent *ptr; struct _reent *ptr _AND
_CONST char *old; _CONST char *old _AND
_CONST char *new; _CONST char *new)
{ {
#ifdef HAVE_RENAME #ifdef HAVE_RENAME
return _rename (old,new); return _rename (old,new);
@ -76,9 +94,9 @@ _rename_r (ptr, old, new)
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
rename (old, new) _DEFUN(rename, (old, new),
_CONST char *old; _CONST char *old _AND
_CONST char *new; _CONST char *new)
{ {
return _rename_r (_REENT, old, new); return _rename_r (_REENT, old, new);
} }

View File

@ -56,24 +56,26 @@ No supporting OS subroutines are required.
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
void _VOID
_DEFUN(_rewind_r, (ptr, fp), _DEFUN(_rewind_r, (ptr, fp),
struct _reent * ptr _AND struct _reent * ptr _AND
register FILE * fp) register FILE * fp)
{ {
(void) _fseek_r (ptr, fp, 0L, SEEK_SET); _CAST_VOID _fseek_r (ptr, fp, 0L, SEEK_SET);
clearerr (fp); clearerr (fp);
} }
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
void _VOID
_DEFUN(rewind, (fp), _DEFUN(rewind, (fp),
register FILE * fp) register FILE * fp)
{ {
(void) _fseek_r (_REENT, fp, 0L, SEEK_SET); _CAST_VOID _fseek_r (_REENT, fp, 0L, SEEK_SET);
} }
#endif /* !_REENT_ONLY */ #endif /* !_REENT_ONLY */

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,11 +14,13 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include "local.h" #include "local.h"
@ -31,8 +31,8 @@ static char sccsid[] = "%W% (Berkeley) %G%";
*/ */
int int
__srget (fp) _DEFUN(__srget, (fp),
register FILE *fp; register FILE *fp)
{ {
if (__srefill (fp) == 0) if (__srefill (fp) == 0)
{ {

View File

@ -16,20 +16,20 @@
*/ */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include "local.h"
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "local.h"
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
scanf (const char *fmt, ...) scanf(_CONST char *fmt, ...)
#else #else
scanf(fmt, va_alist) scanf(fmt, va_alist)
char *fmt; char *fmt;
@ -54,7 +54,7 @@ scanf (fmt, va_alist)
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_scanf_r (struct _reent *ptr, const char *fmt, ...) _scanf_r(struct _reent *ptr, _CONST char *fmt, ...)
#else #else
_scanf_r(ptr, fmt, va_alist) _scanf_r(ptr, fmt, va_alist)
struct _reent *ptr; struct _reent *ptr;
@ -76,4 +76,3 @@ _scanf_r (ptr, fmt, va_alist)
return (ret); return (ret);
} }

View File

@ -70,10 +70,10 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#include <stdio.h> #include <stdio.h>
#include "local.h" #include "local.h"
void _VOID
_DEFUN(setbuf, (fp, buf), _DEFUN(setbuf, (fp, buf),
FILE * fp _AND FILE * fp _AND
char *buf) char *buf)
{ {
(void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
} }

View File

@ -14,7 +14,6 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* /*
Modified copy of setbuf.c to support the setbuffer function Modified copy of setbuf.c to support the setbuffer function
defined as part of BSD. defined as part of BSD.
@ -69,7 +68,6 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
FUNCTION FUNCTION
<<setlinebuf>>---specify line buffering for a file or stream <<setlinebuf>>---specify line buffering for a file or stream
INDEX INDEX
@ -108,11 +106,11 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#include <stdio.h> #include <stdio.h>
#include "local.h" #include "local.h"
void _VOID
_DEFUN(setbuffer, (fp, buf, size), _DEFUN(setbuffer, (fp, buf, size),
FILE * fp _AND FILE * fp _AND
char *buf _AND char *buf _AND
int size) int size)
{ {
(void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size); _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size);
} }

View File

@ -14,7 +14,6 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* /*
Modified copy of setbuf.c to support setlinebuf function Modified copy of setbuf.c to support setlinebuf function
defined as part of BSD. defined as part of BSD.
@ -23,7 +22,6 @@ Modifications by Gareth Pearce, 2001.
/* /*
FUNCTION FUNCTION
<<setlinebuf>>---specify line buffering for a file or stream <<setlinebuf>>---specify line buffering for a file or stream
INDEX INDEX

View File

@ -126,11 +126,11 @@ _DEFUN (setvbuf, (fp, buf, mode, size),
* non buffer flags, and clear malloc flag. * non buffer flags, and clear malloc flag.
*/ */
(void) fflush (fp); _CAST_VOID fflush (fp);
fp->_r = 0; fp->_r = 0;
fp->_lbfsize = 0; fp->_lbfsize = 0;
if (fp->_flags & __SMBF) if (fp->_flags & __SMBF)
_free_r (_REENT, (void *) fp->_bf._base); _free_r (_REENT, (_PTR) fp->_bf._base);
fp->_flags &= ~(__SLBF | __SNBF | __SMBF); fp->_flags &= ~(__SLBF | __SNBF | __SMBF);
if (mode == _IONBF) if (mode == _IONBF)

View File

@ -1,6 +1,24 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<siprintf>>---write formatted output (integer only) <<siprintf>>---write formatted output (integer only)
INDEX INDEX
siprintf siprintf
@ -29,6 +47,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
@ -36,13 +56,13 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#include <varargs.h> #include <varargs.h>
#endif #endif
#include <limits.h> #include <limits.h>
#include <_ansi.h>
#include <reent.h>
#include "local.h" #include "local.h"
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_DEFUN (siprintf, (str, fmt), char *str _AND _CONST char *fmt _DOTS) _DEFUN(siprintf, (str, fmt),
char *str _AND
_CONST char *fmt _DOTS)
#else #else
siprintf(str, fmt, va_alist) siprintf(str, fmt, va_alist)
char *str; char *str;

View File

@ -1,7 +1,3 @@
/* doc in sprintf.c */
/* This code created by modifying sprintf.c so copyright inherited. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -18,7 +14,11 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* doc in sprintf.c */
/* This code created by modifying sprintf.c so copyright inherited. */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
@ -26,12 +26,15 @@
#include <varargs.h> #include <varargs.h>
#endif #endif
#include <limits.h> #include <limits.h>
#include <_ansi.h>
#include "local.h" #include "local.h"
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_DEFUN (_snprintf_r, (ptr, str, size, fmt), struct _reent *ptr _AND char *str _AND size_t size _AND _CONST char *fmt _DOTS) _DEFUN(_snprintf_r, (ptr, str, size, fmt),
struct _reent *ptr _AND
char *str _AND
size_t size _AND
_CONST char *fmt _DOTS)
#else #else
_snprintf_r(ptr, str, size, fmt, va_alist) _snprintf_r(ptr, str, size, fmt, va_alist)
struct _reent *ptr; struct _reent *ptr;
@ -64,7 +67,10 @@ _snprintf_r (ptr, str, size, fmt, va_alist)
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_DEFUN (snprintf, (str, size, fmt), char *str _AND size_t size _AND _CONST char *fmt _DOTS) _DEFUN(snprintf, (str, size, fmt),
char *str _AND
size_t size _AND
_CONST char *fmt _DOTS)
#else #else
snprintf(str, size, fmt, va_alist) snprintf(str, size, fmt, va_alist)
char *str; char *str;

View File

@ -16,9 +16,9 @@
*/ */
/* /*
FUNCTION FUNCTION
<<printf>>, <<fprintf>>, <<asprintf>>, <<sprintf>>, <<snprintf>>---format output <<printf>>, <<fprintf>>, <<asprintf>>, <<sprintf>>, <<snprintf>>---format output
INDEX INDEX
fprintf fprintf
INDEX INDEX
@ -305,6 +305,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
@ -312,12 +314,14 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#include <varargs.h> #include <varargs.h>
#endif #endif
#include <limits.h> #include <limits.h>
#include <_ansi.h>
#include "local.h" #include "local.h"
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_DEFUN (_sprintf_r, (ptr, str, fmt), struct _reent *ptr _AND char *str _AND _CONST char *fmt _DOTS) _DEFUN(_sprintf_r, (ptr, str, fmt),
struct _reent *ptr _AND
char *str _AND
_CONST char *fmt _DOTS)
#else #else
_sprintf_r(ptr, str, fmt, va_alist) _sprintf_r(ptr, str, fmt, va_alist)
struct _reent *ptr; struct _reent *ptr;
@ -349,7 +353,9 @@ _sprintf_r (ptr, str, fmt, va_alist)
int int
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
_DEFUN (sprintf, (str, fmt), char *str _AND _CONST char *fmt _DOTS) _DEFUN(sprintf, (str, fmt),
char *str _AND
_CONST char *fmt _DOTS)
#else #else
sprintf(str, fmt, va_alist) sprintf(str, fmt, va_alist)
char *str; char *str;

View File

@ -16,7 +16,6 @@
*/ */
/* /*
FUNCTION FUNCTION
<<scanf>>, <<fscanf>>, <<sscanf>>---scan and format input <<scanf>>, <<fscanf>>, <<sscanf>>---scan and format input
@ -375,12 +374,11 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
/* | ARGSUSED */ /* | ARGSUSED */
/*SUPPRESS 590*/ /*SUPPRESS 590*/
static static _READ_WRITE_RETURN_TYPE
_READ_WRITE_RETURN_TYPE _DEFUN(eofread, (cookie, buf, len),
eofread (cookie, buf, len) _PTR cookie _AND
_PTR cookie; char *buf _AND
char *buf; int len)
int len;
{ {
return 0; return 0;
} }
@ -389,7 +387,9 @@ eofread (cookie, buf, len)
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
_DEFUN (sscanf, (str, fmt), _CONST char *str _AND _CONST char *fmt _DOTS) _DEFUN(sscanf, (str, fmt),
_CONST char *str _AND
_CONST char *fmt _DOTS)
#else #else
int int
sscanf(str, fmt, va_alist) sscanf(str, fmt, va_alist)
@ -422,7 +422,10 @@ sscanf (str, fmt, va_alist)
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
int int
_DEFUN (_sscanf_r, (ptr, str, fmt), struct _reent *ptr _AND _CONST char *str _AND _CONST char *fmt _DOTS) _DEFUN(_sscanf_r, (ptr, str, fmt),
struct _reent *ptr _AND
_CONST char *str _AND
_CONST char *fmt _DOTS)
#else #else
int int
_sscanf_r(ptr, str, fmt, va_alist) _sscanf_r(ptr, str, fmt, va_alist)

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,7 +14,10 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
@ -29,10 +30,10 @@
*/ */
_READ_WRITE_RETURN_TYPE _READ_WRITE_RETURN_TYPE
__sread (cookie, buf, n) _DEFUN(__sread, (cookie, buf, n),
_PTR cookie; _PTR cookie _AND
char *buf; char *buf _AND
int n; int n)
{ {
register FILE *fp = (FILE *) cookie; register FILE *fp = (FILE *) cookie;
register int ret; register int ret;
@ -60,10 +61,10 @@ __sread (cookie, buf, n)
} }
_READ_WRITE_RETURN_TYPE _READ_WRITE_RETURN_TYPE
__swrite (cookie, buf, n) _DEFUN(__swrite, (cookie, buf, n),
_PTR cookie; _PTR cookie _AND
char _CONST *buf; char _CONST *buf _AND
int n; int n)
{ {
register FILE *fp = (FILE *) cookie; register FILE *fp = (FILE *) cookie;
int w; int w;
@ -72,7 +73,7 @@ __swrite (cookie, buf, n)
#endif #endif
if (fp->_flags & __SAPP) if (fp->_flags & __SAPP)
(void) _lseek_r (_REENT, fp->_file, (_off_t) 0, SEEK_END); _CAST_VOID _lseek_r (_REENT, fp->_file, (_off_t) 0, SEEK_END);
fp->_flags &= ~__SOFF; /* in case O_APPEND mode is set */ fp->_flags &= ~__SOFF; /* in case O_APPEND mode is set */
#ifdef __SCLE #ifdef __SCLE
@ -91,10 +92,10 @@ __swrite (cookie, buf, n)
} }
_fpos_t _fpos_t
__sseek (cookie, offset, whence) _DEFUN(__sseek, (cookie, offset, whence),
_PTR cookie; _PTR cookie _AND
_fpos_t offset; _fpos_t offset _AND
int whence; int whence)
{ {
register FILE *fp = (FILE *) cookie; register FILE *fp = (FILE *) cookie;
register _off_t ret; register _off_t ret;
@ -111,8 +112,8 @@ __sseek (cookie, offset, whence)
} }
int int
__sclose (cookie) _DEFUN(__sclose, (cookie),
_PTR cookie; _PTR cookie)
{ {
FILE *fp = (FILE *) cookie; FILE *fp = (FILE *) cookie;
@ -121,7 +122,8 @@ __sclose (cookie)
#ifdef __SCLE #ifdef __SCLE
int int
__stextmode (int fd) _DEFUN(__stextmode, (fd),
int fd)
{ {
#ifdef __CYGWIN__ #ifdef __CYGWIN__
return _cygwin_istext_for_stdio (fd); return _cygwin_istext_for_stdio (fd);

View File

@ -11,14 +11,14 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
FILE *tmpfile(void); FILE *tmpfile(void);
FILE *_tmpfile_r(void *<[reent]>); FILE *_tmpfile_r(struct _reent *<[reent]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
FILE *tmpfile(); FILE *tmpfile();
FILE *_tmpfile_r(<[reent]>) FILE *_tmpfile_r(<[reent]>)
char *<[reent]>; struct _reent *<[reent]>;
DESCRIPTION DESCRIPTION
Create a temporary file (a file which will be deleted automatically), Create a temporary file (a file which will be deleted automatically),
@ -45,6 +45,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<getpid>>,
<<tmpfile>> also requires the global pointer <<environ>>. <<tmpfile>> also requires the global pointer <<environ>>.
*/ */
#include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>

View File

@ -2,7 +2,6 @@
* tmpname.c * tmpname.c
* Original Author: G. Haley * Original Author: G. Haley
*/ */
/* /*
FUNCTION FUNCTION
<<tmpnam>>, <<tempnam>>---name for a temporary file <<tmpnam>>, <<tempnam>>---name for a temporary file
@ -20,8 +19,8 @@ ANSI_SYNOPSIS
#include <stdio.h> #include <stdio.h>
char *tmpnam(char *<[s]>); char *tmpnam(char *<[s]>);
char *tempnam(char *<[dir]>, char *<[pfx]>); char *tempnam(char *<[dir]>, char *<[pfx]>);
char *_tmpnam_r(void *<[reent]>, char *<[s]>); char *_tmpnam_r(struct _reent *<[reent]>, char *<[s]>);
char *_tempnam_r(void *<[reent]>, char *<[dir]>, char *<[pfx]>); char *_tempnam_r(struct _reent *<[reent]>, char *<[dir]>, char *<[pfx]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdio.h> #include <stdio.h>
@ -33,11 +32,11 @@ TRAD_SYNOPSIS
char *<[pfx]>; char *<[pfx]>;
char *_tmpnam_r(<[reent]>, <[s]>) char *_tmpnam_r(<[reent]>, <[s]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[s]>; char *<[s]>;
char *_tempnam_r(<[reent]>, <[dir]>, <[pfx]>) char *_tempnam_r(<[reent]>, <[dir]>, <[pfx]>)
char *<[reent]>; struct *<[reent]>;
char *<[dir]>; char *<[dir]>;
char *<[pfx]>; char *<[pfx]>;
@ -93,6 +92,7 @@ The global pointer <<environ>> is also required.
*/ */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -104,13 +104,13 @@ The global pointer <<environ>> is also required.
another one. Return nonzero if successful, otherwise zero. */ another one. Return nonzero if successful, otherwise zero. */
static int static int
worker (ptr, result, part1, part2, part3, part4) _DEFUN(worker, (ptr, result, part1, part2, part3, part4),
struct _reent *ptr; struct _reent *ptr _AND
char *result; char *result _AND
_CONST char *part1; _CONST char *part1 _AND
_CONST char *part2; _CONST char *part2 _AND
int part3; int part3 _AND
int *part4; int *part4)
{ {
/* Generate the filename and make sure that there isn't one called /* Generate the filename and make sure that there isn't one called
it already. */ it already. */

View File

@ -19,6 +19,7 @@
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -33,8 +34,8 @@ static char sccsid[] = "%W% (Berkeley) %G%";
/*static*/ /*static*/
int int
__submore (fp) _DEFUN(__submore, (fp),
register FILE *fp; register FILE *fp)
{ {
register int i; register int i;
register unsigned char *p; register unsigned char *p;
@ -58,7 +59,7 @@ __submore (fp)
p = (unsigned char *) _realloc_r (_REENT, (_PTR) (fp->_ub._base), i << 1); p = (unsigned char *) _realloc_r (_REENT, (_PTR) (fp->_ub._base), i << 1);
if (p == NULL) if (p == NULL)
return EOF; return EOF;
(void) memcpy ((void *) (p + i), (void *) p, (size_t) i); _CAST_VOID memcpy ((_PTR) (p + i), (_PTR) p, (size_t) i);
fp->_p = p + i; fp->_p = p + i;
fp->_ub._base = p; fp->_ub._base = p;
fp->_ub._size = i << 1; fp->_ub._size = i << 1;
@ -66,9 +67,9 @@ __submore (fp)
} }
int int
ungetc (c, fp) _DEFUN(ungetc, (c, fp),
int c; int c _AND
register FILE *fp; register FILE *fp)
{ {
if (c == EOF) if (c == EOF)
return (EOF); return (EOF);

View File

@ -1,5 +1,3 @@
/* doc in vfprintf.c */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,15 +14,14 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* This code was based on vsprintf.c */ /* This code was based on vsprintf.c */
/* doc in vfprintf.c */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <limits.h> #include <limits.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC

View File

@ -1,116 +1,3 @@
/*
FUNCTION
<<vprintf>>, <<vfprintf>>, <<vsprintf>>---format argument list
INDEX
vprintf
INDEX
vfprintf
INDEX
vsprintf
INDEX
vsnprintf
ANSI_SYNOPSIS
#include <stdio.h>
#include <stdarg.h>
int vprintf(const char *<[fmt]>, va_list <[list]>);
int vfprintf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
int vsprintf(char *<[str]>, const char *<[fmt]>, va_list <[list]>);
int vasprintf(char **<[strp]>, const char *<[fmt]>, va_list <[list]>);
int vsnprintf(char *<[str]>, size_t <[size]>, const char *<[fmt]>, va_list <[list]>);
int _vprintf_r(void *<[reent]>, const char *<[fmt]>,
va_list <[list]>);
int _vfprintf_r(void *<[reent]>, FILE *<[fp]>, const char *<[fmt]>,
va_list <[list]>);
int _vasprintf_r(void *<[reent]>, char **<[str]>, const char *<[fmt]>,
va_list <[list]>);
int _vsprintf_r(void *<[reent]>, char *<[str]>, const char *<[fmt]>,
va_list <[list]>);
int _vsnprintf_r(void *<[reent]>, char *<[str]>, size_t <[size]>, const char *<[fmt]>,
va_list <[list]>);
TRAD_SYNOPSIS
#include <stdio.h>
#include <varargs.h>
int vprintf( <[fmt]>, <[list]>)
char *<[fmt]>;
va_list <[list]>;
int vfprintf(<[fp]>, <[fmt]>, <[list]>)
FILE *<[fp]>;
char *<[fmt]>;
va_list <[list]>;
int vasprintf(<[strp]>, <[fmt]>, <[list]>)
char **<[strp]>;
char *<[fmt]>;
va_list <[list]>;
int vsprintf(<[str]>, <[fmt]>, <[list]>)
char *<[str]>;
char *<[fmt]>;
va_list <[list]>;
int vsnprintf(<[str]>, <[size]>, <[fmt]>, <[list]>)
char *<[str]>;
size_t <[size]>;
char *<[fmt]>;
va_list <[list]>;
int _vprintf_r(<[reent]>, <[fmt]>, <[list]>)
char *<[reent]>;
char *<[fmt]>;
va_list <[list]>;
int _vfprintf_r(<[reent]>, <[fp]>, <[fmt]>, <[list]>)
char *<[reent]>;
FILE *<[fp]>;
char *<[fmt]>;
va_list <[list]>;
int _vasprintf_r(<[reent]>, <[strp]>, <[fmt]>, <[list]>)
char *<[reent]>;
char **<[strp]>;
char *<[fmt]>;
va_list <[list]>;
int _vsprintf_r(<[reent]>, <[str]>, <[fmt]>, <[list]>)
char *<[reent]>;
char *<[str]>;
char *<[fmt]>;
va_list <[list]>;
int _vsnprintf_r(<[reent]>, <[str]>, <[size]>, <[fmt]>, <[list]>)
char *<[reent]>;
char *<[str]>;
size_t <[size]>;
char *<[fmt]>;
va_list <[list]>;
DESCRIPTION
<<vprintf>>, <<vfprintf>>, <<vasprintf>>, <<vsprintf>> and <<vsnprintf>> are
(respectively) variants of <<printf>>, <<fprintf>>, <<asprintf>>, <<sprintf>>,
and <<snprintf>>. They differ only in allowing their caller to pass the
variable argument list as a <<va_list>> object (initialized by <<va_start>>)
rather than directly accepting a variable number of arguments.
RETURNS
The return values are consistent with the corresponding functions:
<<vasprintf>>/<<vsprintf>> returns the number of bytes in the output string,
save that the concluding <<NULL>> is not counted.
<<vprintf>> and <<vfprintf>> return the number of characters transmitted.
If an error occurs, <<vprintf>> and <<vfprintf>> return <<EOF>> and
<<vasprintf>> returns -1. No error returns occur for <<vsprintf>>.
PORTABILITY
ANSI C requires all three functions.
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -147,6 +34,119 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/*
FUNCTION
<<vprintf>>, <<vfprintf>>, <<vsprintf>>---format argument list
INDEX
vprintf
INDEX
vfprintf
INDEX
vsprintf
INDEX
vsnprintf
ANSI_SYNOPSIS
#include <stdio.h>
#include <stdarg.h>
int vprintf(const char *<[fmt]>, va_list <[list]>);
int vfprintf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
int vsprintf(char *<[str]>, const char *<[fmt]>, va_list <[list]>);
int vasprintf(char **<[strp]>, const char *<[fmt]>, va_list <[list]>);
int vsnprintf(char *<[str]>, size_t <[size]>, const char *<[fmt]>, va_list <[list]>);
int _vprintf_r(struct _reent *<[reent]>, const char *<[fmt]>,
va_list <[list]>);
int _vfprintf_r(struct _reent *<[reent]>, FILE *<[fp]>, const char *<[fmt]>,
va_list <[list]>);
int _vasprintf_r(struct _reent *<[reent]>, char **<[str]>, const char *<[fmt]>,
va_list <[list]>);
int _vsprintf_r(struct _reent *<[reent]>, char *<[str]>, const char *<[fmt]>,
va_list <[list]>);
int _vsnprintf_r(struct _reent *<[reent]>, char *<[str]>, size_t <[size]>, const char *<[fmt]>,
va_list <[list]>);
TRAD_SYNOPSIS
#include <stdio.h>
#include <varargs.h>
int vprintf( <[fmt]>, <[list]>)
char *<[fmt]>;
va_list <[list]>;
int vfprintf(<[fp]>, <[fmt]>, <[list]>)
FILE *<[fp]>;
char *<[fmt]>;
va_list <[list]>;
int vasprintf(<[strp]>, <[fmt]>, <[list]>)
char **<[strp]>;
char *<[fmt]>;
va_list <[list]>;
int vsprintf(<[str]>, <[fmt]>, <[list]>)
char *<[str]>;
char *<[fmt]>;
va_list <[list]>;
int vsnprintf(<[str]>, <[size]>, <[fmt]>, <[list]>)
char *<[str]>;
size_t <[size]>;
char *<[fmt]>;
va_list <[list]>;
int _vprintf_r(<[reent]>, <[fmt]>, <[list]>)
struct _reent *<[reent]>;
char *<[fmt]>;
va_list <[list]>;
int _vfprintf_r(<[reent]>, <[fp]>, <[fmt]>, <[list]>)
struct _reent *<[reent]>;
FILE *<[fp]>;
char *<[fmt]>;
va_list <[list]>;
int _vasprintf_r(<[reent]>, <[strp]>, <[fmt]>, <[list]>)
struct _reent *<[reent]>;
char **<[strp]>;
char *<[fmt]>;
va_list <[list]>;
int _vsprintf_r(<[reent]>, <[str]>, <[fmt]>, <[list]>)
struct _reent *<[reent]>;
char *<[str]>;
char *<[fmt]>;
va_list <[list]>;
int _vsnprintf_r(<[reent]>, <[str]>, <[size]>, <[fmt]>, <[list]>)
struct _reent *<[reent]>;
char *<[str]>;
size_t <[size]>;
char *<[fmt]>;
va_list <[list]>;
DESCRIPTION
<<vprintf>>, <<vfprintf>>, <<vasprintf>>, <<vsprintf>> and <<vsnprintf>> are
(respectively) variants of <<printf>>, <<fprintf>>, <<asprintf>>, <<sprintf>>,
and <<snprintf>>. They differ only in allowing their caller to pass the
variable argument list as a <<va_list>> object (initialized by <<va_start>>)
rather than directly accepting a variable number of arguments.
RETURNS
The return values are consistent with the corresponding functions:
<<vasprintf>>/<<vsprintf>> returns the number of bytes in the output string,
save that the concluding <<NULL>> is not counted.
<<vprintf>> and <<vfprintf>> return the number of characters transmitted.
If an error occurs, <<vprintf>> and <<vfprintf>> return <<EOF>> and
<<vasprintf>> returns -1. No error returns occur for <<vsprintf>>.
PORTABILITY
ANSI C requires all three functions.
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/ /*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/
static char *rcsid = "$Id$"; static char *rcsid = "$Id$";
@ -180,21 +180,19 @@ static char *rcsid = "$Id$";
#endif #endif
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
#include <reent.h>
#include <wchar.h> #include <wchar.h>
#include <string.h> #include <string.h>
#include <sys/lock.h> #include <sys/lock.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "local.h" #include "local.h"
#include "fvwrite.h" #include "fvwrite.h"
#include "vfieeefp.h" #include "vfieeefp.h"
@ -212,9 +210,9 @@ static char *rcsid = "$Id$";
* then reset it so that it can be reused. * then reset it so that it can be reused.
*/ */
static int static int
__sprint(fp, uio) _DEFUN(__sprint, (fp, uio),
FILE *fp; FILE *fp _AND
register struct __suio *uio; register struct __suio *uio)
{ {
register int err; register int err;
@ -234,10 +232,10 @@ __sprint(fp, uio)
* worries about ungetc buffers and so forth. * worries about ungetc buffers and so forth.
*/ */
static int static int
__sbprintf(fp, fmt, ap) _DEFUN(__sbprintf, (fp, fmt, ap),
register FILE *fp; register FILE *fp _AND
const char *fmt; _CONST char *fmt _AND
va_list ap; va_list ap)
{ {
int ret; int ret;
FILE fake; FILE fake;
@ -285,13 +283,15 @@ __sbprintf(fp, fmt, ap)
#define DEFPREC 6 #define DEFPREC 6
#ifdef _NO_LONGDBL #ifdef _NO_LONGDBL
static char *cvt _PARAMS((struct _reent *, double, int, int, char *, int *, int, int *)); static char *
_EXFUN(cvt, (struct _reent *, double, int, int, char *, int *, int, int *));
#else #else
static char *cvt _PARAMS((struct _reent *, _LONG_DOUBLE, int, int, char *, int *, int, int *)); static char *
extern int _ldcheck _PARAMS((_LONG_DOUBLE *)); _EXFUN(cvt, (struct _reent *, _LONG_DOUBLE, int, int, char *, int *, int, int *));
extern int _EXFUN(_ldcheck,(_LONG_DOUBLE *));
#endif #endif
static int exponent _PARAMS((char *, int, int)); static int _EXFUN(exponent, (char *, int, int));
#else /* no FLOATING_POINT */ #else /* no FLOATING_POINT */
@ -308,7 +308,7 @@ static int exponent _PARAMS((char *, int, int));
#endif #endif
typedef quad_t * quad_ptr_t; typedef quad_t * quad_ptr_t;
typedef void * void_ptr_t; typedef _PTR void_ptr_t;
typedef char * char_ptr_t; typedef char * char_ptr_t;
typedef long * long_ptr_t; typedef long * long_ptr_t;
typedef int * int_ptr_t; typedef int * int_ptr_t;
@ -337,9 +337,10 @@ union arg_val
wint_t val_wint_t; wint_t val_wint_t;
}; };
static union arg_val *get_arg (struct _reent *data, int n, char *fmt, static union arg_val *
_EXFUN(get_arg, (struct _reent *data, int n, char *fmt,
va_list *ap, int *numargs, union arg_val *args, va_list *ap, int *numargs, union arg_val *args,
int *arg_type, char **last_fmt); int *arg_type, char **last_fmt));
#endif /* !_NO_POS_ARGS */ #endif /* !_NO_POS_ARGS */
/* /*
@ -757,7 +758,7 @@ reswitch: switch (ch) {
if (ch == 'C' || (flags & LONGINT)) { if (ch == 'C' || (flags & LONGINT)) {
mbstate_t ps; mbstate_t ps;
memset((void *)&ps, '\0', sizeof(mbstate_t)); memset ((_PTR)&ps, '\0', sizeof (mbstate_t));
if ((size = (int)_wcrtomb_r (data, cp, if ((size = (int)_wcrtomb_r (data, cp,
(wchar_t)GET_ARG (N, ap, wint_t), (wchar_t)GET_ARG (N, ap, wint_t),
&ps)) == -1) &ps)) == -1)
@ -930,7 +931,7 @@ reswitch: switch (ch) {
wcp = (_CONST wchar_t *)cp; wcp = (_CONST wchar_t *)cp;
size = m = 0; size = m = 0;
memset((void *)&ps, '\0', sizeof(mbstate_t)); memset ((_PTR)&ps, '\0', sizeof (mbstate_t));
/* Count number of bytes needed for multibyte /* Count number of bytes needed for multibyte
string that will be produced from widechar string that will be produced from widechar
@ -965,7 +966,7 @@ reswitch: switch (ch) {
goto error; goto error;
/* Convert widechar string to multibyte string. */ /* Convert widechar string to multibyte string. */
memset((void *)&ps, '\0', sizeof(mbstate_t)); memset ((_PTR)&ps, '\0', sizeof (mbstate_t));
if (_wcsrtombs_r (data, malloc_buf, if (_wcsrtombs_r (data, malloc_buf,
&wcp, size, &ps) != size) &wcp, size, &ps) != size)
goto error; goto error;
@ -1213,16 +1214,29 @@ extern char *_ldtoa_r _PARAMS((struct _reent *, _LONG_DOUBLE, int,
#define word0(x) ldword0(x) #define word0(x) ldword0(x)
#endif #endif
static char *
cvt(data, value, ndigits, flags, sign, decpt, ch, length)
struct _reent *data;
#ifdef _NO_LONGDBL #ifdef _NO_LONGDBL
double value; static char *
_DEFUN(cvt, (data, value, ndigits, flags, sign, decpt, ch, length),
struct _reent *data _AND
double value _AND
int ndigits _AND
int flags _AND
char *sign _AND
int *decpt _AND
int ch _AND
int *length)
#else #else
_LONG_DOUBLE value; static char *
_DEFUN(cvt, (data, value, ndigits, flags, sign, decpt, ch, length),
struct _reent *data _AND
_LONG_DOUBLE value _AND
int ndigits _AND
int flags _AND
char *sign _AND
int *decpt _AND
int ch _AND
int *length)
#endif #endif
int ndigits, flags, *decpt, ch, *length;
char *sign;
{ {
int mode, dsgn; int mode, dsgn;
char *digits, *bp, *rve; char *digits, *bp, *rve;
@ -1283,9 +1297,10 @@ cvt(data, value, ndigits, flags, sign, decpt, ch, length)
} }
static int static int
exponent(p0, exp, fmtch) _DEFUN(exponent, (p0, exp, fmtch),
char *p0; char *p0 _AND
int exp, fmtch; int exp _AND
int fmtch)
{ {
register char *p, *t; register char *p, *t;
char expbuf[40]; char expbuf[40];
@ -1389,7 +1404,7 @@ typedef enum {
PWPOS, /* get positional parameter value for variable width or precision */ PWPOS, /* get positional parameter value for variable width or precision */
} ACTION; } ACTION;
const static CH_CLASS chclass[256] = { _CONST static CH_CLASS chclass[256] = {
/* 00-07 */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, /* 00-07 */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER,
/* 08-0f */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, /* 08-0f */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER,
/* 10-17 */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, /* 10-17 */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER,
@ -1424,7 +1439,7 @@ const static CH_CLASS chclass[256] = {
/* f8-ff */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, /* f8-ff */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER,
}; };
const static STATE state_table[MAX_STATE][MAX_CH_CLASS] = { _CONST static STATE state_table[MAX_STATE][MAX_CH_CLASS] = {
/* '0' '1-9' '$' MODFR SPEC '.' '*' FLAG OTHER */ /* '0' '1-9' '$' MODFR SPEC '.' '*' FLAG OTHER */
/* START */ { SFLAG, WDIG, DONE, SMOD, DONE, SDOT, VARW, SFLAG, DONE }, /* START */ { SFLAG, WDIG, DONE, SMOD, DONE, SDOT, VARW, SFLAG, DONE },
/* SFLAG */ { SFLAG, WDIG, DONE, SMOD, DONE, SDOT, VARW, SFLAG, DONE }, /* SFLAG */ { SFLAG, WDIG, DONE, SMOD, DONE, SDOT, VARW, SFLAG, DONE },
@ -1439,7 +1454,7 @@ const static STATE state_table[MAX_STATE][MAX_CH_CLASS] = {
/* VPDIG */ { DONE, DONE, PREC, DONE, DONE, DONE, DONE, DONE, DONE }, /* VPDIG */ { DONE, DONE, PREC, DONE, DONE, DONE, DONE, DONE, DONE },
}; };
const static ACTION action_table[MAX_STATE][MAX_CH_CLASS] = { _CONST static ACTION action_table[MAX_STATE][MAX_CH_CLASS] = {
/* '0' '1-9' '$' MODFR SPEC '.' '*' FLAG OTHER */ /* '0' '1-9' '$' MODFR SPEC '.' '*' FLAG OTHER */
/* START */ { NOOP, NUMBER, NOOP, GETMOD, GETARG, NOOP, NOOP, NOOP, NOOP }, /* START */ { NOOP, NUMBER, NOOP, GETMOD, GETARG, NOOP, NOOP, NOOP, NOOP },
/* SFLAG */ { NOOP, NUMBER, NOOP, GETMOD, GETARG, NOOP, NOOP, NOOP, NOOP }, /* SFLAG */ { NOOP, NUMBER, NOOP, GETMOD, GETARG, NOOP, NOOP, NOOP, NOOP },
@ -1456,9 +1471,15 @@ const static ACTION action_table[MAX_STATE][MAX_CH_CLASS] = {
/* function to get positional parameter N where n = N - 1 */ /* function to get positional parameter N where n = N - 1 */
static union arg_val * static union arg_val *
get_arg (struct _reent *data, int n, char *fmt, va_list *ap, _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt),
int *numargs_p, union arg_val *args, struct _reent *data _AND
int *arg_type, char **last_fmt) int n _AND
char *fmt _AND
va_list *ap _AND
int *numargs_p _AND
union arg_val *args _AND
int *arg_type _AND
char **last_fmt)
{ {
int ch; int ch;
int number, flags; int number, flags;

View File

@ -1,3 +1,20 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* /*
FUNCTION FUNCTION
<<vscanf>>, <<vfscanf>>, <<vsscanf>>---format argument list <<vscanf>>, <<vfscanf>>, <<vsscanf>>---format argument list
@ -16,11 +33,11 @@ ANSI_SYNOPSIS
int vfscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>); int vfscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
int vsscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>); int vsscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>);
int _vscanf_r(void *<[reent]>, const char *<[fmt]>, int _vscanf_r(struct _reent *<[reent]>, const char *<[fmt]>,
va_list <[list]>); va_list <[list]>);
int _vfscanf_r(void *<[reent]>, FILE *<[fp]>, const char *<[fmt]>, int _vfscanf_r(struct _reent *<[reent]>, FILE *<[fp]>, const char *<[fmt]>,
va_list <[list]>); va_list <[list]>);
int _vsscanf_r(void *<[reent]>, const char *<[str]>, const char *<[fmt]>, int _vsscanf_r(struct _reent *<[reent]>, const char *<[str]>, const char *<[fmt]>,
va_list <[list]>); va_list <[list]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
@ -41,18 +58,18 @@ TRAD_SYNOPSIS
va_list <[list]>; va_list <[list]>;
int _vscanf_r( <[reent]>, <[fmt]>, <[ist]>) int _vscanf_r( <[reent]>, <[fmt]>, <[ist]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[fmt]>; char *<[fmt]>;
va_list <[list]>; va_list <[list]>;
int _vfscanf_r( <[reent]>, <[fp]>, <[fmt]>, <[list]>) int _vfscanf_r( <[reent]>, <[fp]>, <[fmt]>, <[list]>)
char *<[reent]>; struct _reent *<[reent]>;
FILE *<[fp]>; FILE *<[fp]>;
char *<[fmt]>; char *<[fmt]>;
va_list <[list]>; va_list <[list]>;
int _vsscanf_r( <[reent]>, <[str]>, <[fmt]>, <[list]>) int _vsscanf_r( <[reent]>, <[str]>, <[fmt]>, <[list]>)
char *<[reent]>; struct _reent *<[reent]>;
char *<[str]>; char *<[str]>;
char *<[fmt]>; char *<[fmt]>;
va_list <[list]>; va_list <[list]>;
@ -85,24 +102,8 @@ These are GNU extensions.
Supporting OS subroutines required: Supporting OS subroutines required:
*/ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <ctype.h> #include <ctype.h>
#include <wctype.h> #include <wctype.h>
#include <stdio.h> #include <stdio.h>
@ -222,10 +223,10 @@ _DEFUN (vfscanf, (fp, fmt, ap),
} }
int int
__svfscanf (fp, fmt0, ap) _DEFUN(__svfscanf, (fp, fmt0, ap),
register FILE *fp; register FILE *fp _AND
char _CONST *fmt0; char _CONST *fmt0 _AND
va_list ap; va_list ap)
{ {
return __svfscanf_r (_REENT, fp, fmt0, ap); return __svfscanf_r (_REENT, fp, fmt0, ap);
} }
@ -244,11 +245,11 @@ _DEFUN (_vfscanf_r, (data, fp, fmt, ap),
int int
__svfscanf_r (rptr, fp, fmt0, ap) _DEFUN(__svfscanf_r, (rptr, fp, fmt0, ap),
struct _reent *rptr; struct _reent *rptr _AND
register FILE *fp; register FILE *fp _AND
char _CONST *fmt0; char _CONST *fmt0 _AND
va_list ap; va_list ap)
{ {
register u_char *fmt = (u_char *) fmt0; register u_char *fmt = (u_char *) fmt0;
register int c; /* character from format, or conversion */ register int c; /* character from format, or conversion */
@ -566,7 +567,7 @@ __svfscanf_r (rptr, fp, fmt0, ap)
buf[n++] = *fp->_p; buf[n++] = *fp->_p;
fp->_r -= 1; fp->_r -= 1;
fp->_p += 1; fp->_p += 1;
memset((void *)&state, '\0', sizeof(mbstate_t)); memset ((_PTR)&state, '\0', sizeof (mbstate_t));
if ((mbslen = _mbrtowc_r (rptr, wcp, buf, n, &state)) if ((mbslen = _mbrtowc_r (rptr, wcp, buf, n, &state))
== (size_t)-1) == (size_t)-1)
goto input_failure; /* Invalid sequence */ goto input_failure; /* Invalid sequence */
@ -695,7 +696,7 @@ __svfscanf_r (rptr, fp, fmt0, ap)
buf[n++] = *fp->_p; buf[n++] = *fp->_p;
fp->_r -= 1; fp->_r -= 1;
fp->_p += 1; fp->_p += 1;
memset((void *)&state, '\0', sizeof(mbstate_t)); memset ((_PTR)&state, '\0', sizeof (mbstate_t));
if ((mbslen = _mbrtowc_r (rptr, wcp, buf, n, &state)) if ((mbslen = _mbrtowc_r (rptr, wcp, buf, n, &state))
== (size_t)-1) == (size_t)-1)
goto input_failure; goto input_failure;
@ -1171,9 +1172,9 @@ all_done:
/*static*/ /*static*/
u_char * u_char *
__sccl (tab, fmt) _DEFUN(__sccl, (tab, fmt),
register char *tab; register char *tab _AND
register u_char *fmt; register u_char *fmt)
{ {
register int c, n, v; register int c, n, v;

View File

@ -1,5 +1,3 @@
/* doc in vfprintf.c */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,16 +14,16 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* doc in vfprintf.c */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "local.h" #include "local.h"
#ifndef _REENT_ONLY #ifndef _REENT_ONLY

View File

@ -18,18 +18,14 @@
*/ */
#include <_ansi.h> #include <_ansi.h>
#include <reent.h>
#include <stdio.h> #include <stdio.h>
#include "local.h"
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "local.h"
/*
* vscanf
*/
#ifndef _REENT_ONLY #ifndef _REENT_ONLY

View File

@ -1,7 +1,3 @@
/* doc in vfprintf.c */
/* This code created by modifying vsprintf.c so copyright inherited. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -18,6 +14,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* doc in vfprintf.c */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";

View File

@ -1,5 +1,3 @@
/* doc in vfprintf.c */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,6 +14,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* doc in vfprintf.c */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";

View File

@ -28,12 +28,11 @@
#endif #endif
#include "local.h" #include "local.h"
static static _READ_WRITE_RETURN_TYPE
_READ_WRITE_RETURN_TYPE _DEFUN(eofread1, (cookie, buf, len),
eofread1 (cookie, buf, len) _PTR cookie _AND
_PTR cookie; char *buf _AND
char *buf; int len)
int len;
{ {
return 0; return 0;
} }

View File

@ -1,5 +1,3 @@
/* No user fns here. Pesch 15apr92. */
/* /*
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -16,11 +14,13 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
/* No user fns here. Pesch 15apr92. */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%"; static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include "local.h" #include "local.h"
#include "fvwrite.h" #include "fvwrite.h"
@ -32,9 +32,9 @@ static char sccsid[] = "%W% (Berkeley) %G%";
*/ */
int int
__swbuf (c, fp) _DEFUN(__swbuf, (c, fp),
register int c; register int c _AND
register FILE *fp; register FILE *fp)
{ {
register int n; register int n;

View File

@ -17,6 +17,7 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
#include <_ansi.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "local.h" #include "local.h"