Loading...
include/_stdio.h Libc-1725.40.4 Libc-1669.0.4
--- Libc/Libc-1725.40.4/include/_stdio.h
+++ Libc/Libc-1669.0.4/include/_stdio.h
@@ -66,7 +66,6 @@
 #define	_STDIO_H_
 #define	__STDIO_H_
 
-#include <_bounds.h>
 #include <sys/cdefs.h>
 #include <Availability.h>
 
@@ -82,8 +81,6 @@
 #include <sys/stdio.h>
 #include <_printf.h>
 
-_LIBC_SINGLE_BY_DEFAULT()
-
 typedef __darwin_off_t		fpos_t;
 
 #define	_FSTDIO			/* Define for new stdio with functions. */
@@ -96,7 +93,7 @@
 
 /* stdio buffers */
 struct __sbuf {
-	unsigned char *_LIBC_COUNT(_size)	_base;
+	unsigned char	*_base;
 	int		_size;
 };
 
@@ -130,7 +127,7 @@
  * NB: see WARNING above before changing the layout of this structure!
  */
 typedef	struct __sFILE {
-	unsigned char *_LIBC_UNSAFE_INDEXABLE	_p;	/* current position in (some) buffer */
+	unsigned char *_p;	/* current position in (some) buffer */
 	int	_r;		/* read space left for getc() */
 	int	_w;		/* write space left for putc() */
 	short	_flags;		/* flags, below; this FILE is free if 0 */
@@ -141,9 +138,9 @@
 	/* operations */
 	void	*_cookie;	/* cookie passed to io functions */
 	int	(* _Nullable _close)(void *);
-	int	(* _Nullable _read) (void *, char *_LIBC_COUNT(__n), int __n);
+	int	(* _Nullable _read) (void *, char *, int);
 	fpos_t	(* _Nullable _seek) (void *, fpos_t, int);
-	int	(* _Nullable _write)(void *, const char *_LIBC_COUNT(__n), int __n);
+	int	(* _Nullable _write)(void *, const char *, int);
 
 	/* separate buffer for long sequences of ungetc() */
 	struct	__sbuf _ub;	/* ungetc buffer */
@@ -237,7 +234,7 @@
 int	 fflush(FILE *);
 int	 fgetc(FILE *);
 int	 fgetpos(FILE * __restrict, fpos_t *);
-char *_LIBC_CSTR	fgets(char * __restrict _LIBC_COUNT(__size), int __size, FILE *);
+char	*fgets(char * __restrict, int, FILE *);
 #if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
 FILE	*fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen));
 #else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
@@ -262,7 +259,7 @@
 int	 fputs(const char * __restrict, FILE * __restrict) LIBC_ALIAS(fputs);
 #endif /* !LIBC_ALIAS_FPUTS */
 //End-Libc
-size_t	 fread(void * __restrict _LIBC_SIZE(__size * __nitems) __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
+size_t	 fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
 //Begin-Libc
 #ifndef LIBC_ALIAS_FREOPEN
 //End-Libc
@@ -281,10 +278,10 @@
 //Begin-Libc
 #ifndef LIBC_ALIAS_FWRITE
 //End-Libc
-size_t	 fwrite(const void * __restrict _LIBC_SIZE(__size * __nitems) __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
+size_t	 fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
 //Begin-Libc
 #else /* LIBC_ALIAS_FWRITE */
-size_t	 fwrite(const void * __restrict _LIBC_SIZE(__size * __nitems) __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) LIBC_ALIAS(fwrite);
+size_t	 fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) LIBC_ALIAS(fwrite);
 #endif /* !LIBC_ALIAS_FWRITE */
 //End-Libc
 int	 getc(FILE *);
@@ -293,7 +290,7 @@
 #if !defined(_POSIX_C_SOURCE)
 __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of gets(3), it is highly recommended that you use fgets(3) instead.")
 #endif
-char *_LIBC_CSTR	gets(char *_LIBC_UNSAFE_INDEXABLE) _LIBC_PTRCHECK_REPLACED(fgets);
+char	*gets(char *);
 
 void	 perror(const char *) __cold;
 int	 putc(int, FILE *);
@@ -303,15 +300,14 @@
 int	 rename (const char *__old, const char *__new);
 void	 rewind(FILE *);
 int	 scanf(const char * __restrict, ...) __scanflike(1, 2);
-void	 setbuf(FILE * __restrict, char * __restrict _LIBC_COUNT_OR_NULL(BUFSIZ));
-int	 setvbuf(FILE * __restrict, char * __restrict _LIBC_COUNT_OR_NULL(__size), int, size_t __size);
+void	 setbuf(FILE * __restrict, char * __restrict);
+int	 setvbuf(FILE * __restrict, char * __restrict, int, size_t);
 
 __swift_unavailable("Use snprintf instead.")
-_LIBC_PTRCHECK_REPLACED("snprintf")
 #if !defined(_POSIX_C_SOURCE)
 __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
 #endif
-int	 sprintf(char * __restrict _LIBC_UNSAFE_INDEXABLE, const char * __restrict, ...) __printflike(2, 3) _LIBC_PTRCHECK_REPLACED(snprintf);
+int	 sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
 
 int	 sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
 FILE	*tmpfile(void);
@@ -320,18 +316,17 @@
 #if !defined(_POSIX_C_SOURCE)
 __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
 #endif
-char *_LIBC_CSTR	tmpnam(char *_LIBC_COUNT(L_tmpnam));
+char	*tmpnam(char *);
 
 int	 ungetc(int, FILE *);
 int	 vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
 int	 vprintf(const char * __restrict, va_list) __printflike(1, 0);
 
 __swift_unavailable("Use vsnprintf instead.")
-_LIBC_PTRCHECK_REPLACED("vsnprintf")
 #if !defined(_POSIX_C_SOURCE)
 __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
 #endif
-int	 vsprintf(char * __restrict _LIBC_UNSAFE_INDEXABLE, const char * __restrict, va_list) __printflike(2, 0) _LIBC_PTRCHECK_REPLACED(vsnprintf);
+int	 vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0);
 __END_DECLS
 
 
@@ -341,10 +336,7 @@
  */
 
 #if __DARWIN_C_LEVEL >= 198808L
-
 #define	L_ctermid	1024	/* size for ctermid(); PATH_MAX */
-#undef _LIBC_COUNT__L_CTERMID
-#define _LIBC_COUNT__L_CTERMID _LIBC_COUNT_OR_NULL(L_ctermid)
 
 #include <_ctermid.h>
 
@@ -459,10 +451,10 @@
 //Begin-Libc
 #ifndef LIBC_ALIAS_TEMPNAM
 //End-Libc
-char *_LIBC_CSTR	tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
+char	*tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
 //Begin-Libc
 #else /* LIBC_ALIAS_TEMPNAM */
-char *_LIBC_CSTR	tempnam(const char *__dir, const char *__prefix) LIBC_ALIAS(tempnam);
+char	*tempnam(const char *__dir, const char *__prefix) LIBC_ALIAS(tempnam);
 #endif /* !LIBC_ALIAS_TEMPNAM */
 //End-Libc
 __END_DECLS
@@ -494,10 +486,10 @@
 
 #if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
 __BEGIN_DECLS
-int	 snprintf(char * __restrict _LIBC_COUNT(__size) __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
+int	 snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
 int	 vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0);
 int	 vscanf(const char * __restrict __format, va_list) __scanflike(1, 0);
-int	 vsnprintf(char * __restrict _LIBC_COUNT(__size) __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
+int	 vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
 int	 vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
 __END_DECLS
 #endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
@@ -514,10 +506,10 @@
 __BEGIN_DECLS
 int	dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
 int	vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-ssize_t getdelim(char *_LIBC_COUNT(*__linecapp) *__restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-ssize_t getline(char *_LIBC_COUNT(*__linecapp) *__restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-FILE *fmemopen(void * __restrict __buf _LIBC_SIZE(__size), size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
-FILE *open_memstream(char *_LIBC_COUNT(*__sizep) *__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
+ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
+ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
+FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
+FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
 __END_DECLS
 #endif /* __DARWIN_C_LEVEL >= 200809L */
 
@@ -530,22 +522,22 @@
 extern __const int sys_nerr;		/* perror(3) external variables */
 extern __const char *__const sys_errlist[];
 
-int	 asprintf(char *_LIBC_CSTR *__restrict, const char * __restrict, ...) __printflike(2, 3);
-char *_LIBC_CSTR	ctermid_r(char *_LIBC_COUNT(L_ctermid));
-char *_LIBC_COUNT(*__len)	fgetln(FILE *, size_t *__len);
+int	 asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
+char	*ctermid_r(char *);
+char	*fgetln(FILE *, size_t *);
 __const char *fmtcheck(const char *, const char *) __attribute__((format_arg(2)));
 int	 fpurge(FILE *);
-void	 setbuffer(FILE *, char *_LIBC_COUNT_OR_NULL(__size), int __size);
+void	 setbuffer(FILE *, char *, int);
 int	 setlinebuf(FILE *);
-int	 vasprintf(char *_LIBC_CSTR *__restrict, const char * __restrict, va_list) __printflike(2, 0);
+int	 vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
 
 
 /*
  * Stdio function-access interface.
  */
 FILE	*funopen(const void *,
-				 int (* _Nullable)(void *, char *_LIBC_COUNT(__n), int __n),
-				 int (* _Nullable)(void *, const char *_LIBC_COUNT(__n), int __n),
+				 int (* _Nullable)(void *, char *, int),
+				 int (* _Nullable)(void *, const char *, int),
 				 fpos_t (* _Nullable)(void *, fpos_t, int),
 				 int (* _Nullable)(void *));
 __END_DECLS
@@ -565,13 +557,13 @@
 __BEGIN_DECLS
 int	 sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
 #if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
-int	 snprintf(char * __restrict _LIBC_COUNT(__size) __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
-int	 vsnprintf(char * __restrict _LIBC_COUNT(__size) __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
+int	 snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
+int	 vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
 int	 vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
 #endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
 #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
-int	 asprintf(char *_LIBC_CSTR *__restrict, const char * __restrict, ...) __printflike(2, 3);
-int	 vasprintf(char *_LIBC_CSTR *__restrict, const char * __restrict, va_list) __printflike(2, 0);
+int	 asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
+int	 vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
 #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
 __END_DECLS
 #endif /* UNIFDEF_DRIVERKIT */