Generate Public Headers. Preserve Private Headers.

This commit is contained in:
Thomas A 2023-04-21 11:41:36 -07:00
parent 424463a868
commit cdc6110886
40 changed files with 5199 additions and 746 deletions

View File

@ -0,0 +1,452 @@
/*
* Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
*/
//Begin-Libc
#include "xlocale_private.h"
//End-Libc
#ifndef __CTYPE_H_
#define __CTYPE_H_
#include <sys/cdefs.h>
#include <runetype.h>
#define _CTYPE_A 0x00000100L /* Alpha */
#define _CTYPE_C 0x00000200L /* Control */
#define _CTYPE_D 0x00000400L /* Digit */
#define _CTYPE_G 0x00000800L /* Graph */
#define _CTYPE_L 0x00001000L /* Lower */
#define _CTYPE_P 0x00002000L /* Punct */
#define _CTYPE_S 0x00004000L /* Space */
#define _CTYPE_U 0x00008000L /* Upper */
#define _CTYPE_X 0x00010000L /* X digit */
#define _CTYPE_B 0x00020000L /* Blank */
#define _CTYPE_R 0x00040000L /* Print */
#define _CTYPE_I 0x00080000L /* Ideogram */
#define _CTYPE_T 0x00100000L /* Special */
#define _CTYPE_Q 0x00200000L /* Phonogram */
#define _CTYPE_SW0 0x20000000L /* 0 width character */
#define _CTYPE_SW1 0x40000000L /* 1 width character */
#define _CTYPE_SW2 0x80000000L /* 2 width character */
#define _CTYPE_SW3 0xc0000000L /* 3 width character */
#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */
#define _CTYPE_SWS 30 /* Bits to shift to get width */
#ifdef _NONSTD_SOURCE
/*
* Backward compatibility
*/
#define _A _CTYPE_A /* Alpha */
#define _C _CTYPE_C /* Control */
#define _D _CTYPE_D /* Digit */
#define _G _CTYPE_G /* Graph */
#define _L _CTYPE_L /* Lower */
#define _P _CTYPE_P /* Punct */
#define _S _CTYPE_S /* Space */
#define _U _CTYPE_U /* Upper */
#define _X _CTYPE_X /* X digit */
#define _B _CTYPE_B /* Blank */
#define _R _CTYPE_R /* Print */
#define _I _CTYPE_I /* Ideogram */
#define _T _CTYPE_T /* Special */
#define _Q _CTYPE_Q /* Phonogram */
#define _SW0 _CTYPE_SW0 /* 0 width character */
#define _SW1 _CTYPE_SW1 /* 1 width character */
#define _SW2 _CTYPE_SW2 /* 2 width character */
#define _SW3 _CTYPE_SW3 /* 3 width character */
#endif /* _NONSTD_SOURCE */
//Begin-Libc
/*
* _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us
* to generate code for extern versions of all intermediate inline functions.
*/
#ifdef _EXTERNALIZE_CTYPE_INLINES_
#define _USE_CTYPE_INLINE_
#define __DARWIN_CTYPE_inline
#else /* !_EXTERNALIZE_CTYPE_INLINES_ */
//End-Libc
#define __DARWIN_CTYPE_inline __header_inline
//Begin-Libc
#endif /* !_EXTERNALIZE_CTYPE_INLINES_ */
//End-Libc
//Begin-Libc
/*
* _EXTERNALIZE_CTYPE_INLINES_TOP_ is defined in locale/isctype.c to tell us
* to generate code for extern versions of all top-level inline functions.
*/
#ifdef _EXTERNALIZE_CTYPE_INLINES_TOP_
#define _USE_CTYPE_INLINE_
#define __DARWIN_CTYPE_TOP_inline
#else /* !_EXTERNALIZE_CTYPE_INLINES_TOP_ */
//End-Libc
#define __DARWIN_CTYPE_TOP_inline __header_inline
//Begin-Libc
#endif /* _EXTERNALIZE_CTYPE_INLINES_TOP_ */
//End-Libc
/*
* Use inline functions if we are allowed to and the compiler supports them.
*/
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
/* See comments in <machine/_type.h> about __darwin_ct_rune_t. */
__BEGIN_DECLS
unsigned long ___runetype(__darwin_ct_rune_t);
__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t);
__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t);
__END_DECLS
__DARWIN_CTYPE_TOP_inline int
isascii(int _c)
{
return ((_c & ~0x7F) == 0);
}
#ifdef USE_ASCII
__DARWIN_CTYPE_inline int
__maskrune(__darwin_ct_rune_t _c, unsigned long _f)
{
return (int)_DefaultRuneLocale.__runetype[_c & 0xff] & (__uint32_t)_f;
}
//Begin-Libc
#elif defined(__LIBC__)
__DARWIN_CTYPE_inline int
__maskrune(__darwin_ct_rune_t _c, unsigned long _f)
{
/* _CurrentRuneLocale.__runetype[_c] is __uint32_t
* _f is unsigned long
* ___runetype(_c) is unsigned long
* retval is int
*/
return (int)((_c < 0 || _c >= _CACHED_RUNES) ? (__uint32_t)___runetype(_c) :
__current_locale()->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & (__uint32_t)_f;
}
//End-Libc
#else /* !USE_ASCII */
__BEGIN_DECLS
int __maskrune(__darwin_ct_rune_t, unsigned long);
__END_DECLS
#endif /* USE_ASCII */
__DARWIN_CTYPE_inline int
__istype(__darwin_ct_rune_t _c, unsigned long _f)
{
#ifdef USE_ASCII
return !!(__maskrune(_c, _f));
#else /* USE_ASCII */
return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f)
: !!__maskrune(_c, _f));
#endif /* USE_ASCII */
}
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__isctype(__darwin_ct_rune_t _c, unsigned long _f)
{
#ifdef USE_ASCII
return !!(__maskrune(_c, _f));
#else /* USE_ASCII */
return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
!!(_DefaultRuneLocale.__runetype[_c] & _f);
#endif /* USE_ASCII */
}
#ifdef USE_ASCII
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__toupper(__darwin_ct_rune_t _c)
{
return _DefaultRuneLocale.__mapupper[_c & 0xff];
}
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__tolower(__darwin_ct_rune_t _c)
{
return _DefaultRuneLocale.__maplower[_c & 0xff];
}
//Begin-Libc
#elif defined(__LIBC__)
/*
* We can't do what we do for __toupper_l() (check for ASCII first, then call
* ___toupper_l() otherwise) because versions of ___toupper() before Tiger
* assume c >= _CACHED_RUNES. So we are stuck making __toupper() a routine
* to hide the extended locale details, outside of Libc.
*/
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__toupper(__darwin_ct_rune_t _c)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
__current_locale()->__lc_ctype->_CurrentRuneLocale.__mapupper[_c];
}
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__tolower(__darwin_ct_rune_t _c)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
__current_locale()->__lc_ctype->_CurrentRuneLocale.__maplower[_c];
}
//End-Libc
#else /* !USE_ASCII */
__BEGIN_DECLS
__darwin_ct_rune_t __toupper(__darwin_ct_rune_t);
__darwin_ct_rune_t __tolower(__darwin_ct_rune_t);
__END_DECLS
#endif /* USE_ASCII */
__DARWIN_CTYPE_inline int
__wcwidth(__darwin_ct_rune_t _c)
{
unsigned int _x;
if (_c == 0)
return (0);
_x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R);
if ((_x & _CTYPE_SWM) != 0)
return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
return ((_x & _CTYPE_R) != 0 ? 1 : -1);
}
#ifndef _EXTERNALIZE_CTYPE_INLINES_
#define _tolower(c) __tolower(c)
#define _toupper(c) __toupper(c)
__DARWIN_CTYPE_TOP_inline int
isalnum(int _c)
{
return (__istype(_c, _CTYPE_A|_CTYPE_D));
}
__DARWIN_CTYPE_TOP_inline int
isalpha(int _c)
{
return (__istype(_c, _CTYPE_A));
}
__DARWIN_CTYPE_TOP_inline int
isblank(int _c)
{
return (__istype(_c, _CTYPE_B));
}
__DARWIN_CTYPE_TOP_inline int
iscntrl(int _c)
{
return (__istype(_c, _CTYPE_C));
}
/* ANSI -- locale independent */
__DARWIN_CTYPE_TOP_inline int
isdigit(int _c)
{
return (__isctype(_c, _CTYPE_D));
}
__DARWIN_CTYPE_TOP_inline int
isgraph(int _c)
{
return (__istype(_c, _CTYPE_G));
}
__DARWIN_CTYPE_TOP_inline int
islower(int _c)
{
return (__istype(_c, _CTYPE_L));
}
__DARWIN_CTYPE_TOP_inline int
isprint(int _c)
{
return (__istype(_c, _CTYPE_R));
}
__DARWIN_CTYPE_TOP_inline int
ispunct(int _c)
{
return (__istype(_c, _CTYPE_P));
}
__DARWIN_CTYPE_TOP_inline int
isspace(int _c)
{
return (__istype(_c, _CTYPE_S));
}
__DARWIN_CTYPE_TOP_inline int
isupper(int _c)
{
return (__istype(_c, _CTYPE_U));
}
/* ANSI -- locale independent */
__DARWIN_CTYPE_TOP_inline int
isxdigit(int _c)
{
return (__isctype(_c, _CTYPE_X));
}
__DARWIN_CTYPE_TOP_inline int
toascii(int _c)
{
return (_c & 0x7F);
}
__DARWIN_CTYPE_TOP_inline int
tolower(int _c)
{
return (__tolower(_c));
}
__DARWIN_CTYPE_TOP_inline int
toupper(int _c)
{
return (__toupper(_c));
}
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
__DARWIN_CTYPE_TOP_inline int
digittoint(int _c)
{
return (__maskrune(_c, 0x0F));
}
__DARWIN_CTYPE_TOP_inline int
ishexnumber(int _c)
{
return (__istype(_c, _CTYPE_X));
}
__DARWIN_CTYPE_TOP_inline int
isideogram(int _c)
{
return (__istype(_c, _CTYPE_I));
}
__DARWIN_CTYPE_TOP_inline int
isnumber(int _c)
{
return (__istype(_c, _CTYPE_D));
}
__DARWIN_CTYPE_TOP_inline int
isphonogram(int _c)
{
return (__istype(_c, _CTYPE_Q));
}
__DARWIN_CTYPE_TOP_inline int
isrune(int _c)
{
return (__istype(_c, 0xFFFFFFF0L));
}
__DARWIN_CTYPE_TOP_inline int
isspecial(int _c)
{
return (__istype(_c, _CTYPE_T));
}
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#endif /* _EXTERNALIZE_CTYPE_INLINES_ */
#else /* not using inlines */
__BEGIN_DECLS
int isalnum(int);
int isalpha(int);
int isblank(int);
int iscntrl(int);
int isdigit(int);
int isgraph(int);
int islower(int);
int isprint(int);
int ispunct(int);
int isspace(int);
int isupper(int);
int isxdigit(int);
int tolower(int);
int toupper(int);
int isascii(int);
int toascii(int);
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
int _tolower(int);
int _toupper(int);
int digittoint(int);
int ishexnumber(int);
int isideogram(int);
int isnumber(int);
int isphonogram(int);
int isrune(int);
int isspecial(int);
#endif
__END_DECLS
#endif /* using inlines */
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_ctype.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* !_CTYPE_H_ */

View File

@ -0,0 +1,253 @@
/*
* Copyright (c) 2000, 2002-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)dirent.h 8.2 (Berkeley) 7/28/94
*/
#ifndef _DIRENT_H_
#define _DIRENT_H_
/*
* The kernel defines the format of directory entries
*/
#include <_types.h>
#include <sys/dirent.h>
#include <sys/cdefs.h>
#include <Availability.h>
#include <sys/_pthread/_pthread_types.h> /* __darwin_pthread_mutex_t */
struct _telldir; /* forward reference */
/* structure describing an open directory. */
typedef struct {
int __dd_fd; /* file descriptor associated with directory */
long __dd_loc; /* offset in current buffer */
long __dd_size; /* amount of data returned */
char *__dd_buf; /* data buffer */
int __dd_len; /* size of data buffer */
long __dd_seek; /* magic cookie returned */
__unused long __padding; /* (__dd_rewind space left for bincompat) */
int __dd_flags; /* flags for readdir */
__darwin_pthread_mutex_t __dd_lock; /* for thread locking */
struct _telldir *__dd_td; /* telldir position recording */
} DIR;
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
/* definitions for library routines operating on directories. */
#define DIRBLKSIZ 1024
/* flags for opendir2 */
#define DTF_HIDEW 0x0001 /* hide whiteout entries */
#define DTF_NODUP 0x0002 /* don't return duplicate names */
#define DTF_REWIND 0x0004 /* rewind after reading union stack */
#define __DTF_READALL 0x0008 /* everything has been read */
#define __DTF_SKIPREAD 0x0010 /* assume internal buffer is populated */
#define __DTF_ATEND 0x0020 /* there's nothing more to read in the kernel */
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#ifndef KERNEL
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_CLOSEDIR
//End-Libc
int closedir(DIR *) __DARWIN_ALIAS(closedir);
//Begin-Libc
#else /* LIBC_ALIAS_CLOSEDIR */
int closedir(DIR *) LIBC_ALIAS(closedir);
#endif /* !LIBC_ALIAS_CLOSEDIR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_OPENDIR
//End-Libc
DIR *opendir(const char *) __DARWIN_ALIAS_I(opendir);
//Begin-Libc
#else /* LIBC_ALIAS_OPENDIR */
DIR *opendir(const char *) LIBC_ALIAS_I(opendir);
#endif /* !LIBC_ALIAS_OPENDIR */
//End-Libc
struct dirent *readdir(DIR *) __DARWIN_INODE64(readdir);
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
//Begin-Libc
#ifndef LIBC_ALIAS_REWINDDIR
//End-Libc
void rewinddir(DIR *) __DARWIN_ALIAS_I(rewinddir);
//Begin-Libc
#else /* LIBC_ALIAS_REWINDDIR */
void rewinddir(DIR *) LIBC_ALIAS_I(rewinddir);
#endif /* !LIBC_ALIAS_REWINDDIR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SEEKDIR
//End-Libc
void seekdir(DIR *, long) __DARWIN_ALIAS_I(seekdir);
//Begin-Libc
#else /* LIBC_ALIAS_SEEKDIR */
void seekdir(DIR *, long) LIBC_ALIAS_I(seekdir);
#endif /* !LIBC_ALIAS_SEEKDIR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_TELLDIR
//End-Libc
long telldir(DIR *) __DARWIN_ALIAS_I(telldir);
//Begin-Libc
#else /* LIBC_ALIAS_TELLDIR */
long telldir(DIR *) LIBC_ALIAS_I(telldir);
#endif /* !LIBC_ALIAS_TELLDIR */
//End-Libc
__END_DECLS
/* Additional functionality provided by:
* POSIX.1-2008
*/
#if __DARWIN_C_LEVEL >= 200809L
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_OPENDIR
//End-Libc
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
DIR *fdopendir(int) __DARWIN_ALIAS_I(fdopendir);
//Begin-Libc
#else /* LIBC_ALIAS_OPENDIR */
DIR *fdopendir(int) LIBC_ALIAS_I(fdopendir);
#endif /* !LIBC_ALIAS_OPENDIR */
//End-Libc
int alphasort(const struct dirent **, const struct dirent **) __DARWIN_INODE64(alphasort);
#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)
#include <errno.h>
#include <stdlib.h>
#define dirfd(dirp) ({ \
DIR *_dirp = (dirp); \
int ret = -1; \
if (_dirp == NULL || _dirp->__dd_fd < 0) \
errno = EINVAL; \
else \
ret = _dirp->__dd_fd; \
ret; \
})
#else
int dirfd(DIR *dirp) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
#endif
int scandir(const char *, struct dirent ***,
int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)) __DARWIN_INODE64(scandir);
#ifdef __BLOCKS__
#if __has_attribute(noescape)
#define __scandir_noescape __attribute__((__noescape__))
#else
#define __scandir_noescape
#endif
int scandir_b(const char *, struct dirent ***,
int (^)(const struct dirent *) __scandir_noescape,
int (^)(const struct dirent **, const struct dirent **) __scandir_noescape)
__DARWIN_INODE64(scandir_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200809L */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
__BEGIN_DECLS
int getdirentries(int, char *, int, long *)
//Begin-Libc
#ifndef __LIBC__
//End-Libc
#if __DARWIN_64_BIT_INO_T
/*
* getdirentries() doesn't work when 64-bit inodes is in effect, so we
* generate a link error.
*/
__asm("_getdirentries_is_not_available_when_64_bit_inodes_are_in_effect")
#else /* !__DARWIN_64_BIT_INO_T */
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_6, __IPHONE_2_0,__IPHONE_2_0)
#endif /* __DARWIN_64_BIT_INO_T */
//Begin-Libc
#endif /* !__LIBC__ */
//End-Libc
;
//Begin-Libc
#ifndef LIBC_ALIAS___OPENDIR2
//End-Libc
DIR *__opendir2(const char *, int) __DARWIN_ALIAS_I(__opendir2);
//Begin-Libc
#else /* LIBC_ALIAS___OPENDIR2 */
DIR *__opendir2(const char *, int) LIBC_ALIAS_I(__opendir2);
#endif /* !LIBC_ALIAS___OPENDIR2 */
//End-Libc
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#endif /* !KERNEL */
#endif /* !_DIRENT_H_ */

View File

@ -0,0 +1,90 @@
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _FNMATCH_H_
#define _FNMATCH_H_
#include <sys/cdefs.h>
#define FNM_NOMATCH 1 /* Match failed. */
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
#define FNM_NOSYS (-1) /* Reserved. */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */
#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
#define FNM_IGNORECASE FNM_CASEFOLD
#define FNM_FILE_NAME FNM_PATHNAME
#endif
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_FNMATCH
//End-Libc
int fnmatch(const char *, const char *, int) __DARWIN_ALIAS(fnmatch);
//Begin-Libc
#else /* LIBC_ALIAS_FNMATCH */
int fnmatch(const char *, const char *, int) LIBC_ALIAS(fnmatch);
#endif /* !LIBC_ALIAS_FNMATCH */
//End-Libc
__END_DECLS
#endif /* !_FNMATCH_H_ */

View File

@ -0,0 +1,242 @@
/*
* Copyright (c) 2000, 2003-2006, 2008, 2012 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)fts.h 8.3 (Berkeley) 8/14/94
*/
#ifndef _FTS_H_
#define _FTS_H_
#include <sys/_types.h>
#include <sys/_types/_dev_t.h>
#include <sys/_types/_ino_t.h>
#include <sys/_types/_nlink_t.h>
#include <Availability.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wstrict-prototypes"
typedef struct {
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */
struct _ftsent **fts_array; /* sort array */
dev_t fts_dev; /* starting device # */
char *fts_path; /* path for this descent */
int fts_rfd; /* fd for root */
int fts_pathlen; /* sizeof(path) */
int fts_nitems; /* elements in the sort array */
#ifdef __BLOCKS__
union {
#endif /* __BLOCKS__ */
int (*fts_compar)(); /* compare function */
#ifdef __BLOCKS__
int (^fts_compar_b)(); /* compare block */
};
#endif /* __BLOCKS__ */
#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
#define FTS_LOGICAL 0x002 /* logical walk */
#define FTS_NOCHDIR 0x004 /* don't change directories */
#define FTS_NOSTAT 0x008 /* don't get stat info */
#define FTS_PHYSICAL 0x010 /* physical walk */
#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
#define FTS_XDEV 0x040 /* don't cross devices */
#define FTS_WHITEOUT 0x080 /* (no longer supported) return whiteout information */
#define FTS_COMFOLLOWDIR 0x400 /* (non-std) follow command line symlinks for directories only */
#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000)
#define FTS_OPTIONMASK 0x4ff /* valid user option mask */
#else
#define FTS_NOSTAT_TYPE 0x800 /* (non-std) no stat, but use d_type in struct dirent when available */
#define FTS_OPTIONMASK 0xcff /* valid user option mask */
#endif
#define FTS_NAMEONLY 0x100 /* (private) child names only */
#define FTS_STOP 0x200 /* (private) unrecoverable error */
#ifdef __BLOCKS__
#define FTS_BLOCK_COMPAR 0x80000000 /* fts_compar is a block */
#endif /* __BLOCKS__ */
int fts_options; /* fts_open options, global flags */
} FTS;
typedef struct _ftsent {
struct _ftsent *fts_cycle; /* cycle node */
struct _ftsent *fts_parent; /* parent directory */
struct _ftsent *fts_link; /* next file in directory */
long fts_number; /* local numeric value */
void *fts_pointer; /* local address value */
char *fts_accpath; /* access path */
char *fts_path; /* root path */
int fts_errno; /* errno for this node */
int fts_symfd; /* fd for symlink or chdir */
unsigned short fts_pathlen; /* strlen(fts_path) */
unsigned short fts_namelen; /* strlen(fts_name) */
ino_t fts_ino; /* inode */
dev_t fts_dev; /* device */
nlink_t fts_nlink; /* link count */
#define FTS_ROOTPARENTLEVEL -1
#define FTS_ROOTLEVEL 0
#define FTS_MAXLEVEL 0x7fffffff
short fts_level; /* depth (-1 to N) */
#define FTS_D 1 /* preorder directory */
#define FTS_DC 2 /* directory that causes cycles */
#define FTS_DEFAULT 3 /* none of the above */
#define FTS_DNR 4 /* unreadable directory */
#define FTS_DOT 5 /* dot or dot-dot */
#define FTS_DP 6 /* postorder directory */
#define FTS_ERR 7 /* error; errno is set */
#define FTS_F 8 /* regular file */
#define FTS_INIT 9 /* initialized only */
#define FTS_NS 10 /* stat(2) failed */
#define FTS_NSOK 11 /* no stat(2) requested */
#define FTS_SL 12 /* symbolic link */
#define FTS_SLNONE 13 /* symbolic link without target */
#define FTS_W 14 /* whiteout object */
unsigned short fts_info; /* user flags for FTSENT structure */
#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
#define FTS_ISW 0x04 /* this is a whiteout object */
#define FTS_CHDIRFD 0x08 /* indicates the fts_symfd field was set for chdir */
unsigned short fts_flags; /* private flags for FTSENT structure */
#define FTS_AGAIN 1 /* read node again */
#define FTS_FOLLOW 2 /* follow symbolic link */
#define FTS_NOINSTR 3 /* no instructions */
#define FTS_SKIP 4 /* discard node */
unsigned short fts_instr; /* fts_set() instructions */
struct stat *fts_statp; /* stat(2) information */
char fts_name[1]; /* file name */
} FTSENT;
#include <sys/cdefs.h>
#include <Availability.h>
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_CHILDREN
//End-Libc
FTSENT *fts_children(FTS *, int) __DARWIN_INODE64(fts_children);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_CHILDREN */
FTSENT *fts_children(FTS *, int) LIBC_INODE64(fts_children);
#endif /* !LIBC_ALIAS_FTS_CHILDREN */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_CLOSE
//End-Libc
int fts_close(FTS *) __DARWIN_INODE64(fts_close);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_CLOSE */
int fts_close(FTS *) LIBC_INODE64(fts_close);
#endif /* !LIBC_ALIAS_FTS_CLOSE */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_OPEN
//End-Libc
FTS *fts_open(char * const *, int,
int (*)(const FTSENT **, const FTSENT **)) __DARWIN_INODE64(fts_open);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_OPEN */
FTS *fts_open(char * const *, int,
int (*)(const FTSENT **, const FTSENT **)) LIBC_INODE64(fts_open);
#endif /* !LIBC_ALIAS_FTS_OPEN */
//End-Libc
#ifdef __BLOCKS__
#if __has_attribute(noescape)
#define __fts_noescape __attribute__((__noescape__))
#else
#define __fts_noescape
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_OPEN_B
//End-Libc
FTS *fts_open_b(char * const *, int,
int (^)(const FTSENT **, const FTSENT **) __fts_noescape)
__DARWIN_INODE64(fts_open_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_OPEN */
FTS *fts_open_b(char * const *, int,
int (^)(const FTSENT **, const FTSENT **) __fts_noescape)
LIBC_INODE64(fts_open_b);
#endif /* !LIBC_ALIAS_FTS_OPEN */
//End-Libc
#endif /* __BLOCKS__ */
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_READ
//End-Libc
FTSENT *fts_read(FTS *) __DARWIN_INODE64(fts_read);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_READ */
FTSENT *fts_read(FTS *) LIBC_INODE64(fts_read);
#endif /* !LIBC_ALIAS_FTS_READ */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_SET
//End-Libc
int fts_set(FTS *, FTSENT *, int) __DARWIN_INODE64(fts_set);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_SET */
int fts_set(FTS *, FTSENT *, int) LIBC_INODE64(fts_set);
#endif /* !LIBC_ALIAS_FTS_SET */
//End-Libc
__END_DECLS
#pragma clang diagnostic pop
#endif /* !_FTS_H_ */

View File

@ -0,0 +1,78 @@
/* $OpenBSD: ftw.h,v 1.1 2003/07/21 21:13:18 millert Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Sponsored in part by the Defense Advanced Research Projects
* Agency (DARPA) and Air Force Research Laboratory, Air Force
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
#ifndef _FTW_H
#define _FTW_H
#include <sys/stat.h>
/*
* Valid flags for the 3rd argument to the function that is passed as the
* second argument to ftw(3) and nftw(3). Say it three times fast!
*/
#define FTW_F 0 /* File. */
#define FTW_D 1 /* Directory. */
#define FTW_DNR 2 /* Directory without read permission. */
#define FTW_DP 3 /* Directory with subdirectories visited. */
#define FTW_NS 4 /* Unknown type; stat() failed. */
#define FTW_SL 5 /* Symbolic link. */
#define FTW_SLN 6 /* Sym link that names a nonexistent file. */
/*
* Flags for use as the 4th argument to nftw(3). These may be ORed together.
*/
#define FTW_PHYS 0x01 /* Physical walk, don't follow sym links. */
#define FTW_MOUNT 0x02 /* The walk does not cross a mount point. */
#define FTW_DEPTH 0x04 /* Subdirs visited before the dir itself. */
#define FTW_CHDIR 0x08 /* Change to a directory before reading it. */
struct FTW {
int base;
int level;
};
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_FTW
//End-Libc
int ftw(const char *, int (*)(const char *, const struct stat *, int), int)
__DARWIN_ALIAS_I(ftw);
//Begin-Libc
#else /* LIBC_ALIAS_FTW */
int ftw(const char *, int (*)(const char *, const struct stat *, int), int)
LIBC_ALIAS_I(ftw);
#endif /* !LIBC_ALIAS_FTW */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_NFTW
//End-Libc
int nftw(const char *, int (*)(const char *, const struct stat *, int,
struct FTW *), int, int) __DARWIN_ALIAS_I(nftw);
//Begin-Libc
#else /* LIBC_ALIAS_NFTW */
int nftw(const char *, int (*)(const char *, const struct stat *, int,
struct FTW *), int, int) LIBC_ALIAS_I(nftw);
#endif /* !LIBC_ALIAS_NFTW */
//End-Libc
__END_DECLS
#endif /* !_FTW_H */

View File

@ -0,0 +1,148 @@
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Guido van Rossum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)glob.h 8.1 (Berkeley) 6/2/93
* $FreeBSD: /repoman/r/ncvs/src/include/glob.h,v 1.7 2002/07/17 04:58:09 mikeh Exp $
*/
#ifndef _GLOB_H_
#define _GLOB_H_
#include <_types.h>
#include <sys/cdefs.h>
#include <Availability.h>
#include <sys/_types/_size_t.h>
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
struct dirent;
struct stat;
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
typedef struct {
size_t gl_pathc; /* Count of total paths so far. */
int gl_matchc; /* Count of paths matching pattern. */
size_t gl_offs; /* Reserved at beginning of gl_pathv. */
int gl_flags; /* Copy of flags parameter to glob. */
char **gl_pathv; /* List of paths matching pattern. */
/* Copy of errfunc parameter to glob. */
#ifdef __BLOCKS__
union {
#endif /* __BLOCKS__ */
int (*gl_errfunc)(const char *, int);
#ifdef __BLOCKS__
int (^gl_errblk)(const char *, int);
};
#endif /* __BLOCKS__ */
/*
* Alternate filesystem access methods for glob; replacement
* versions of closedir(3), readdir(3), opendir(3), stat(2)
* and lstat(2).
*/
void (*gl_closedir)(void *);
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
struct dirent *(*gl_readdir)(void *);
#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
void *(*gl_readdir)(void *);
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
void *(*gl_opendir)(const char *);
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
int (*gl_lstat)(const char *, struct stat *);
int (*gl_stat)(const char *, struct stat *);
#else /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
int (*gl_lstat)(const char *, void *);
int (*gl_stat)(const char *, void *);
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
} glob_t;
/* Believed to have been introduced in 1003.2-1992 */
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
#define GLOB_ERR 0x0004 /* Return on error. */
#define GLOB_MARK 0x0008 /* Append / to matching directories. */
#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
#define GLOB_NOSORT 0x0020 /* Don't sort. */
#define GLOB_NOESCAPE 0x2000 /* Disable backslash escaping. */
/* Error values returned by glob(3) */
#define GLOB_NOSPACE (-1) /* Malloc call failed. */
#define GLOB_ABORTED (-2) /* Unignored error. */
#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */
#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
#define GLOB_LIMIT 0x1000 /* limit number of returned paths */
#ifdef __BLOCKS__
#define _GLOB_ERR_BLOCK 0x80000000 /* (internal) error callback is a block */
#endif /* __BLOCKS__ */
/* source compatibility, these are the old names */
#define GLOB_MAXPATH GLOB_LIMIT
#define GLOB_ABEND GLOB_ABORTED
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_GLOB
//End-Libc
int glob(const char * __restrict, int, int (*)(const char *, int),
glob_t * __restrict) __DARWIN_INODE64(glob);
//Begin-Libc
#else /* LIBC_ALIAS_GLOB */
int glob(const char * __restrict, int, int (*)(const char *, int),
glob_t * __restrict) LIBC_INODE64(glob);
#endif /* !LIBC_ALIAS_GLOB */
//End-Libc
#ifdef __BLOCKS__
#if __has_attribute(noescape)
#define __glob_noescape __attribute__((__noescape__))
#else
#define __glob_noescape
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_GLOB_B
//End-Libc
int glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape,
glob_t * __restrict) __DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
//Begin-Libc
#else /* LIBC_ALIAS_GLOB_B */
int glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape,
glob_t * __restrict) LIBC_INODE64(glob_b);
#endif /* !LIBC_ALIAS_GLOB_B */
//End-Libc
#endif /* __BLOCKS__ */
void globfree(glob_t *);
__END_DECLS
#endif /* !_GLOB_H_ */

View File

@ -0,0 +1,225 @@
/*
* Copyright (c) 2000, 2011 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 2001-2009 Ville Laurikari <vl@iki.fi>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*-
* Copyright (c) 1992 Henry Spencer.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Henry Spencer of the University of Toronto.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)regex.h 8.2 (Berkeley) 1/3/94
*/
#ifndef _REGEX_H_
#define _REGEX_H_
#include <_regex.h>
/*******************/
/* regcomp() flags */
/*******************/
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define REG_BASIC 0000 /* Basic regular expressions (synonym for 0) */
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#define REG_EXTENDED 0001 /* Extended regular expressions */
#define REG_ICASE 0002 /* Compile ignoring upper/lower case */
#define REG_NOSUB 0004 /* Compile only reporting success/failure */
#define REG_NEWLINE 0010 /* Compile for newline-sensitive matching */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define REG_NOSPEC 0020 /* Compile turning off all special characters */
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
#define REG_LITERAL REG_NOSPEC
#endif
#define REG_PEND 0040 /* Use re_endp as end pointer */
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
#define REG_MINIMAL 0100 /* Compile using minimal repetition */
#define REG_UNGREEDY REG_MINIMAL
#endif
#define REG_DUMP 0200 /* Unused */
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
#define REG_ENHANCED 0400 /* Additional (non-POSIX) features */
#endif
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
/********************/
/* regerror() flags */
/********************/
#define REG_ENOSYS (-1) /* Reserved */
#define REG_NOMATCH 1 /* regexec() function failed to match */
#define REG_BADPAT 2 /* invalid regular expression */
#define REG_ECOLLATE 3 /* invalid collating element */
#define REG_ECTYPE 4 /* invalid character class */
#define REG_EESCAPE 5 /* trailing backslash (\) */
#define REG_ESUBREG 6 /* invalid backreference number */
#define REG_EBRACK 7 /* brackets ([ ]) not balanced */
#define REG_EPAREN 8 /* parentheses not balanced */
#define REG_EBRACE 9 /* braces not balanced */
#define REG_BADBR 10 /* invalid repetition count(s) */
#define REG_ERANGE 11 /* invalid character range */
#define REG_ESPACE 12 /* out of memory */
#define REG_BADRPT 13 /* repetition-operator operand invalid */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define REG_EMPTY 14 /* Unused */
#define REG_ASSERT 15 /* Unused */
#define REG_INVARG 16 /* invalid argument to regex routine */
#define REG_ILLSEQ 17 /* illegal byte sequence */
#define REG_ATOI 255 /* convert name to number (!) */
#define REG_ITOA 0400 /* convert number to name (!) */
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
/*******************/
/* regexec() flags */
/*******************/
#define REG_NOTBOL 00001 /* First character not at beginning of line */
#define REG_NOTEOL 00002 /* Last character not at end of line */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define REG_STARTEND 00004 /* String start/end in pmatch[0] */
#define REG_TRACE 00400 /* Unused */
#define REG_LARGE 01000 /* Unused */
#define REG_BACKR 02000 /* force use of backref code */
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
#define REG_BACKTRACKING_MATCHER REG_BACKR
#endif
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_REGCOMP
//End-Libc
int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp);
//Begin-Libc
#else /* LIBC_ALIAS_REGCOMP */
int regcomp(regex_t * __restrict, const char * __restrict, int) LIBC_ALIAS(regcomp);
#endif /* !LIBC_ALIAS_REGCOMP */
//End-Libc
size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold;
/*
* gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround,
* a dummy argument name is added.
*/
int regexec(const regex_t * __restrict, const char * __restrict, size_t,
regmatch_t __pmatch[ __restrict], int);
void regfree(regex_t *);
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
/* Darwin extensions */
int regncomp(regex_t * __restrict, const char * __restrict, size_t, int)
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
int regnexec(const regex_t * __restrict, const char * __restrict, size_t,
size_t, regmatch_t __pmatch[ __restrict], int)
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
int regwcomp(regex_t * __restrict, const wchar_t * __restrict, int)
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
int regwexec(const regex_t * __restrict, const wchar_t * __restrict, size_t,
regmatch_t __pmatch[ __restrict], int)
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
int regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int)
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
int regwnexec(const regex_t * __restrict, const wchar_t * __restrict,
size_t, size_t, regmatch_t __pmatch[ __restrict], int)
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
__END_DECLS
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_regex.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* !_REGEX_H_ */

View File

@ -0,0 +1,180 @@
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)signal.h 8.3 (Berkeley) 3/30/94
*/
#ifndef _USER_SIGNAL_H
#define _USER_SIGNAL_H
#include <sys/cdefs.h>
#include <_types.h>
#include <sys/signal.h>
#include <sys/_pthread/_pthread_types.h>
#include <sys/_pthread/_pthread_t.h>
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
extern __const char *__const sys_signame[NSIG];
extern __const char *__const sys_siglist[NSIG];
#endif
__BEGIN_DECLS
int raise(int);
__END_DECLS
#ifndef _ANSI_SOURCE
__BEGIN_DECLS
void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int);
//Begin-Libc
#ifndef LIBC_ALIAS_KILL
//End-Libc
int kill(pid_t, int) __DARWIN_ALIAS(kill);
//Begin-Libc
#else /* LIBC_ALIAS_KILL */
int kill(pid_t, int) LIBC_ALIAS(kill);
#endif /* !LIBC_ALIAS_KILL */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_KILLPG
//End-Libc
int killpg(pid_t, int) __DARWIN_ALIAS(killpg);
//Begin-Libc
#else /* LIBC_ALIAS_KILLPG */
int killpg(pid_t, int) LIBC_ALIAS(killpg);
#endif /* !LIBC_ALIAS_KILLPG */
//End-Libc
int pthread_kill(pthread_t, int);
//Begin-Libc
#ifndef LIBC_ALIAS_PTHREAD_SIGMASK
//End-Libc
int pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask);
//Begin-Libc
#else /* LIBC_ALIAS_PTHREAD_SIGMASK */
int pthread_sigmask(int, const sigset_t *, sigset_t *) LIBC_ALIAS(pthread_sigmask);
#endif /* !LIBC_ALIAS_PTHREAD_SIGMASK */
//End-Libc
int sigaction(int, const struct sigaction * __restrict,
struct sigaction * __restrict);
int sigaddset(sigset_t *, int);
//Begin-Libc
#ifndef LIBC_ALIAS_SIGALTSTACK
//End-Libc
int sigaltstack(const stack_t * __restrict, stack_t * __restrict) __DARWIN_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
//Begin-Libc
#else /* LIBC_ALIAS_SIGALTSTACK */
int sigaltstack(const stack_t * __restrict, stack_t * __restrict) LIBC_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
#endif /* !LIBC_ALIAS_SIGALTSTACK */
//End-Libc
int sigdelset(sigset_t *, int);
int sigemptyset(sigset_t *);
int sigfillset(sigset_t *);
int sighold(int);
int sigignore(int);
int siginterrupt(int, int);
int sigismember(const sigset_t *, int);
//Begin-Libc
#ifndef LIBC_ALIAS_SIGPAUSE
//End-Libc
int sigpause(int) __DARWIN_ALIAS_C(sigpause);
//Begin-Libc
#else /* LIBC_ALIAS_SIGPAUSE */
int sigpause(int) LIBC_ALIAS_C(sigpause);
#endif /* !LIBC_ALIAS_SIGPAUSE */
//End-Libc
int sigpending(sigset_t *);
int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
int sigrelse(int);
void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
//Begin-Libc
#ifndef LIBC_ALIAS_SIGSUSPEND
//End-Libc
int sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend);
//Begin-Libc
#else /* LIBC_ALIAS_SIGSUSPEND */
int sigsuspend(const sigset_t *) LIBC_ALIAS_C(sigsuspend);
#endif /* !LIBC_ALIAS_SIGSUSPEND */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SIGWAIT
//End-Libc
int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait);
//Begin-Libc
#else /* LIBC_ALIAS_SIGWAIT */
int sigwait(const sigset_t * __restrict, int * __restrict) LIBC_ALIAS_C(sigwait);
#endif /* !LIBC_ALIAS_SIGWAIT */
//End-Libc
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
void psignal(unsigned int, const char *);
int sigblock(int);
int sigsetmask(int);
int sigvec(int, struct sigvec *, struct sigvec *);
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
__END_DECLS
/* List definitions after function declarations, or Reiser cpp gets upset. */
__header_always_inline int
__sigbits(int __signo)
{
return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1));
}
#define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0)
#define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0)
#define sigismember(set, signo) ((*(set) & __sigbits(signo)) != 0)
#define sigemptyset(set) (*(set) = 0, 0)
#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
#endif /* !_ANSI_SOURCE */
#endif /* !_USER_SIGNAL_H */

View File

@ -0,0 +1,484 @@
/*
* Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)stdio.h 8.5 (Berkeley) 4/29/95
*/
#ifndef _STDIO_H_
#define _STDIO_H_
#include <_stdio.h>
#ifndef UNIFDEF_DRIVERKIT
__BEGIN_DECLS
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
__END_DECLS
#define __SLBF 0x0001 /* line buffered */
#define __SNBF 0x0002 /* unbuffered */
#define __SRD 0x0004 /* OK to read */
#define __SWR 0x0008 /* OK to write */
/* RD and WR are never simultaneously asserted */
#define __SRW 0x0010 /* open for reading & writing */
#define __SEOF 0x0020 /* found EOF */
#define __SERR 0x0040 /* found error */
#define __SMBF 0x0080 /* _buf is from malloc */
#define __SAPP 0x0100 /* fdopen()ed in append mode */
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
#define __SOPT 0x0400 /* do fseek() optimisation */
#define __SNPT 0x0800 /* do not do fseek() optimisation */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
#define __SMOD 0x2000 /* true => fgetln modified _p text */
#define __SALC 0x4000 /* allocate string space dynamically */
#define __SIGN 0x8000 /* ignore this file in _fwalk */
/*
* The following three definitions are for ANSI C, which took them
* from System V, which brilliantly took internal interface macros and
* made them official arguments to setvbuf(), without renaming them.
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
*
* Although numbered as their counterparts above, the implementation
* does not rely on this.
*/
#define _IOFBF 0 /* setvbuf should set fully buffered */
#define _IOLBF 1 /* setvbuf should set line buffered */
#define _IONBF 2 /* setvbuf should set unbuffered */
#define BUFSIZ 1024 /* size of buffer used by setbuf */
#define EOF (-1)
/* must be == _POSIX_STREAM_MAX <limits.h> */
#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
#ifndef _ANSI_SOURCE
#define P_tmpdir "/var/tmp/"
#endif
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
#define TMP_MAX 308915776
#ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1 /* set file offset to current plus offset */
#endif
#ifndef SEEK_END
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
#define stdin __stdinp
#define stdout __stdoutp
#define stderr __stderrp
#ifdef _DARWIN_UNLIMITED_STREAMS
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it."
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it."
#endif
#endif
/* ANSI-C */
__BEGIN_DECLS
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * __restrict, fpos_t *);
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 */
//Begin-Libc
#ifndef LIBC_ALIAS_FOPEN
//End-Libc
FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen));
//Begin-Libc
#else /* LIBC_ALIAS_FOPEN */
FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) LIBC_ALIAS(fopen);
#endif /* !LIBC_ALIAS_FOPEN */
//End-Libc
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
int fputc(int, FILE *);
//Begin-Libc
#ifndef LIBC_ALIAS_FPUTS
//End-Libc
int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
//Begin-Libc
#else /* LIBC_ALIAS_FPUTS */
int fputs(const char * __restrict, FILE * __restrict) LIBC_ALIAS(fputs);
#endif /* !LIBC_ALIAS_FPUTS */
//End-Libc
size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
//Begin-Libc
#ifndef LIBC_ALIAS_FREOPEN
//End-Libc
FILE *freopen(const char * __restrict, const char * __restrict,
FILE * __restrict) __DARWIN_ALIAS(freopen);
//Begin-Libc
#else /* LIBC_ALIAS_FREOPEN */
FILE *freopen(const char * __restrict, const char * __restrict,
FILE * __restrict) LIBC_ALIAS(freopen);
#endif /* !LIBC_ALIAS_FREOPEN */
//End-Libc
int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
//Begin-Libc
#ifndef LIBC_ALIAS_FWRITE
//End-Libc
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 __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) LIBC_ALIAS(fwrite);
#endif /* !LIBC_ALIAS_FWRITE */
//End-Libc
int getc(FILE *);
int getchar(void);
char *gets(char *);
void perror(const char *) __cold;
int printf(const char * __restrict, ...) __printflike(1, 2);
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
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);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3) __swift_unavailable("Use snprintf instead.");
int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
FILE *tmpfile(void);
__swift_unavailable("Use mkstemp(3) instead.")
#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 *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);
int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0) __swift_unavailable("Use vsnprintf instead.");
__END_DECLS
/* Additional functionality provided by:
* POSIX.1-1988
*/
#if __DARWIN_C_LEVEL >= 198808L
#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
__BEGIN_DECLS
#include <_ctermid.h>
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
//Begin-Libc
#ifndef LIBC_ALIAS_FDOPEN
//End-Libc
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
//Begin-Libc
#else /* LIBC_ALIAS_FDOPEN */
FILE *fdopen(int, const char *) LIBC_ALIAS(fdopen);
#endif /* !LIBC_ALIAS_FDOPEN */
//End-Libc
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
int fileno(FILE *);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 198808L */
/* Additional functionality provided by:
* POSIX.2-1992 C Language Binding Option
*/
#if TARGET_OS_IPHONE
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
#else
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg)
#endif
#if __DARWIN_C_LEVEL >= 199209L
__BEGIN_DECLS
int pclose(FILE *) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
//Begin-Libc
#ifndef LIBC_ALIAS_POPEN
//End-Libc
FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
//Begin-Libc
#else /* LIBC_ALIAS_POPEN */
FILE *popen(const char *, const char *) LIBC_ALIAS(popen);
#endif /* !LIBC_ALIAS_POPEN */
//End-Libc
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199209L */
#undef __swift_unavailable_on
/* Additional functionality provided by:
* POSIX.1c-1995,
* POSIX.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
*/
#if __DARWIN_C_LEVEL >= 199506L
/* Functions internal to the implementation. */
__BEGIN_DECLS
int __srget(FILE *);
int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0);
int __swbuf(int, FILE *);
__END_DECLS
/*
* The __sfoo macros are here so that we can
* define function versions in the C library.
*/
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
#if defined(__GNUC__) && defined(__STDC__)
__header_always_inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
#else
/*
* This has been tuned to generate reasonable code on the vax using pcc.
*/
#define __sputc(c, p) \
(--(p)->_w < 0 ? \
(p)->_w >= (p)->_lbfsize ? \
(*(p)->_p = (c)), *(p)->_p != '\n' ? \
(int)*(p)->_p++ : \
__swbuf('\n', p) : \
__swbuf((int)(c), p) : \
(*(p)->_p = (c), (int)*(p)->_p++))
#endif
#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
#define __sferror(p) (((p)->_flags & __SERR) != 0)
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
#define __sfileno(p) ((p)->_file)
__BEGIN_DECLS
void flockfile(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
/* Removed in Issue 6 */
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
int getw(FILE *);
int putw(int, FILE *);
#endif
__swift_unavailable("Use mkstemp(3) instead.")
#if !defined(_POSIX_C_SOURCE)
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.")
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_TEMPNAM
//End-Libc
char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
//Begin-Libc
#else /* LIBC_ALIAS_TEMPNAM */
char *tempnam(const char *__dir, const char *__prefix) LIBC_ALIAS(tempnam);
#endif /* !LIBC_ALIAS_TEMPNAM */
//End-Libc
__END_DECLS
#ifndef lint
#define getc_unlocked(fp) __sgetc(fp)
#define putc_unlocked(x, fp) __sputc(x, fp)
#endif /* lint */
#define getchar_unlocked() getc_unlocked(stdin)
#define putchar_unlocked(x) putc_unlocked(x, stdout)
#endif /* __DARWIN_C_LEVEL >= 199506L */
/* Additional functionality provided by:
* POSIX.1-2001
* ISO C99
*/
#if __DARWIN_C_LEVEL >= 200112L
#include <sys/_types/_off_t.h>
__BEGIN_DECLS
int fseeko(FILE * __stream, off_t __offset, int __whence);
off_t ftello(FILE * __stream);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L */
#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
__BEGIN_DECLS
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 __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) */
/* Additional functionality provided by:
* POSIX.1-2008
*/
#if __DARWIN_C_LEVEL >= 200809L
#include <sys/_types/_ssize_t.h>
__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 ** __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 */
/* Darwin extensions */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
__BEGIN_DECLS
extern __const int sys_nerr; /* perror(3) external variables */
extern __const char *__const sys_errlist[];
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 *);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
FILE *zopen(const char *, const char *, int);
/*
* Stdio function-access interface.
*/
FILE *funopen(const void *,
int (* _Nullable)(void *, char *, int),
int (* _Nullable)(void *, const char *, int),
fpos_t (* _Nullable)(void *, fpos_t, int),
int (* _Nullable)(void *));
__END_DECLS
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
#define feof_unlocked(p) __sfeof(p)
#define ferror_unlocked(p) __sferror(p)
#define clearerr_unlocked(p) __sclearerr(p)
#define fileno_unlocked(p) __sfileno(p)
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#else /* UNIFDEF_DRIVERKIT */
#define EOF (-1)
__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 __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 ** __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 */
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_stdio.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
/* Security checking functions. */
#include <secure/_stdio.h>
#endif
#endif /* _STDIO_H_ */

View File

@ -0,0 +1,470 @@
/*
* Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)stdlib.h 8.5 (Berkeley) 5/19/95
*/
#ifndef _STDLIB_H_
#define _STDLIB_H_
#include <Availability.h>
#include <sys/cdefs.h>
#include <_types.h>
#if !defined(_ANSI_SOURCE)
#ifndef UNIFDEF_DRIVERKIT
#include <sys/wait.h>
#endif /* UNIFDEF_DRIVERKIT */
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#include <alloca.h>
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#endif /* !_ANSI_SOURCE */
/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
* _GCC_SIZE_T */
#include <sys/_types/_size_t.h>
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#include <sys/_types/_ct_rune_t.h>
#include <sys/_types/_rune_t.h>
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#include <sys/_types/_wchar_t.h>
typedef struct {
int quot; /* quotient */
int rem; /* remainder */
} div_t;
typedef struct {
long quot; /* quotient */
long rem; /* remainder */
} ldiv_t;
#if !__DARWIN_NO_LONG_LONG
typedef struct {
long long quot;
long long rem;
} lldiv_t;
#endif /* !__DARWIN_NO_LONG_LONG */
#include <sys/_types/_null.h>
#ifndef UNIFDEF_DRIVERKIT
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#endif /* UNIFDEF_DRIVERKIT */
#define RAND_MAX 0x7fffffff
#ifdef _USE_EXTENDED_LOCALES_
#include <_xlocale.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#ifndef MB_CUR_MAX
#ifdef _USE_EXTENDED_LOCALES_
#define MB_CUR_MAX (___mb_cur_max())
#ifndef MB_CUR_MAX_L
#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
#endif /* !MB_CUR_MAX_L */
#else /* !_USE_EXTENDED_LOCALES_ */
extern int __mb_cur_max;
#define MB_CUR_MAX __mb_cur_max
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* MB_CUR_MAX */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \
&& defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L)
#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
#endif
//Begin-Libc
#include "libc_private.h"
/* f must be a literal string */
#define LIBC_ABORT(f,...) abort_report_np("%s:%s:%u: " f, __FILE__, __func__, __LINE__, ## __VA_ARGS__)
//End-Libc
#ifndef UNIFDEF_DRIVERKIT
#include <malloc/_malloc.h>
#endif /* UNIFDEF_DRIVERKIT */
__BEGIN_DECLS
void abort(void) __cold __dead2;
int abs(int) __pure2;
#ifndef UNIFDEF_DRIVERKIT
int atexit(void (* _Nonnull)(void));
#endif /* UNIFDEF_DRIVERKIT */
double atof(const char *);
int atoi(const char *);
long atol(const char *);
#if !__DARWIN_NO_LONG_LONG
long long
atoll(const char *);
#endif /* !__DARWIN_NO_LONG_LONG */
void *bsearch(const void *__key, const void *__base, size_t __nel,
size_t __width, int (* _Nonnull __compar)(const void *, const void *));
#ifndef UNIFDEF_DRIVERKIT
/* calloc is now declared in _malloc.h */
#endif /* UNIFDEF_DRIVERKIT */
div_t div(int, int) __pure2;
#ifndef UNIFDEF_DRIVERKIT
void exit(int) __dead2;
/* free is now declared in _malloc.h */
char *getenv(const char *);
#endif /* UNIFDEF_DRIVERKIT */
long labs(long) __pure2;
ldiv_t ldiv(long, long) __pure2;
#if !__DARWIN_NO_LONG_LONG
long long
llabs(long long);
lldiv_t lldiv(long long, long long);
#endif /* !__DARWIN_NO_LONG_LONG */
#ifndef UNIFDEF_DRIVERKIT
/* malloc is now declared in _malloc.h */
#endif /* UNIFDEF_DRIVERKIT */
int mblen(const char *__s, size_t __n);
size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
#ifndef UNIFDEF_DRIVERKIT
/* posix_memalign is now declared in _malloc.h */
#endif /* UNIFDEF_DRIVERKIT */
void qsort(void *__base, size_t __nel, size_t __width,
int (* _Nonnull __compar)(const void *, const void *));
#ifndef UNIFDEF_DRIVERKIT
int rand(void) __swift_unavailable("Use arc4random instead.");
/* realloc is now declared in _malloc.h */
void srand(unsigned) __swift_unavailable("Use arc4random instead.");
#endif /* UNIFDEF_DRIVERKIT */
double strtod(const char *, char **) __DARWIN_ALIAS(strtod);
float strtof(const char *, char **) __DARWIN_ALIAS(strtof);
long strtol(const char *__str, char **__endptr, int __base);
long double
strtold(const char *, char **);
#if !__DARWIN_NO_LONG_LONG
long long
strtoll(const char *__str, char **__endptr, int __base);
#endif /* !__DARWIN_NO_LONG_LONG */
unsigned long
strtoul(const char *__str, char **__endptr, int __base);
#if !__DARWIN_NO_LONG_LONG
unsigned long long
strtoull(const char *__str, char **__endptr, int __base);
#endif /* !__DARWIN_NO_LONG_LONG */
#ifndef UNIFDEF_DRIVERKIT
//Begin-Libc
#ifndef LIBC_ALIAS_SYSTEM
//End-Libc
#if TARGET_OS_IPHONE
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
#else
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg)
#endif
__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable")
__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
int system(const char *) __DARWIN_ALIAS_C(system);
//Begin-Libc
#else /* LIBC_ALIAS_SYSTEM */
int system(const char *) LIBC_ALIAS_C(system);
#endif /* !LIBC_ALIAS_SYSTEM */
//End-Libc
#undef __swift_unavailable_on
#endif /* UNIFDEF_DRIVERKIT */
size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
int wctomb(char *, wchar_t);
#ifndef UNIFDEF_DRIVERKIT
#ifndef _ANSI_SOURCE
void _Exit(int) __dead2;
long a64l(const char *);
double drand48(void);
char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
double erand48(unsigned short[3]);
char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
char *gcvt(double, int, char *); /* LEGACY */
int getsubopt(char **, char * const *, char **);
int grantpt(int);
#if __DARWIN_UNIX03
char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */
#else /* !__DARWIN_UNIX03 */
char *initstate(unsigned long, char *, long);
#endif /* __DARWIN_UNIX03 */
long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
char *l64a(long);
void lcong48(unsigned short[7]);
long lrand48(void) __swift_unavailable("Use arc4random instead.");
char *mktemp(char *);
int mkstemp(char *);
long mrand48(void) __swift_unavailable("Use arc4random instead.");
long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
int posix_openpt(int);
char *ptsname(int);
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_PUTENV
//End-Libc
int putenv(char *) __DARWIN_ALIAS(putenv);
//Begin-Libc
#else /* LIBC_ALIAS_PUTENV */
int putenv(char *) LIBC_ALIAS(putenv);
#endif /* !LIBC_ALIAS_PUTENV */
//End-Libc
long random(void) __swift_unavailable("Use arc4random instead.");
int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
//Begin-Libc
#ifdef __LIBC__
#ifndef LIBC_ALIAS_REALPATH
char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
#else /* LIBC_ALIAS_REALPATH */
#ifdef VARIANT_DARWINEXTSN
char *realpath(const char * __restrict, char * __restrict) LIBC_EXTSN(realpath);
#else /* !VARIANT_DARWINEXTSN */
char *realpath(const char * __restrict, char * __restrict) LIBC_ALIAS(realpath);
#endif /* VARIANT_DARWINEXTSN */
#endif /* !LIBC_ALIAS_REALPATH */
#else /* !__LIBC__ */
//End-Libc
#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
//Begin-Libc
#endif /* __LIBC__ */
//End-Libc
unsigned short
*seed48(unsigned short[3]);
//Begin-Libc
#ifndef LIBC_ALIAS_SETENV
//End-Libc
int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
//Begin-Libc
#else /* LIBC_ALIAS_SETENV */
int setenv(const char * __name, const char * __value, int __overwrite) LIBC_ALIAS(setenv);
#endif /* !LIBC_ALIAS_SETENV */
//End-Libc
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_SETKEY
//End-Libc
void setkey(const char *) __DARWIN_ALIAS(setkey);
//Begin-Libc
#else /* LIBC_ALIAS_SETKEY */
void setkey(const char *) LIBC_ALIAS(setkey);
#endif /* !LIBC_ALIAS_SETKEY */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int setkey(const char *);
#endif /* __DARWIN_UNIX03 */
char *setstate(const char *);
void srand48(long);
#if __DARWIN_UNIX03
void srandom(unsigned);
#else /* !__DARWIN_UNIX03 */
void srandom(unsigned long);
#endif /* __DARWIN_UNIX03 */
int unlockpt(int);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_UNSETENV
//End-Libc
int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
//Begin-Libc
#else /* LIBC_ALIAS_UNSETENV */
int unsetenv(const char *) LIBC_ALIAS(unsetenv);
#endif /* !LIBC_ALIAS_UNSETENV */
//End-Libc
#else /* !__DARWIN_UNIX03 */
void unsetenv(const char *);
#endif /* __DARWIN_UNIX03 */
#endif /* !_ANSI_SOURCE */
#endif /* UNIFDEF_DRIVERKIT */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#include <machine/types.h>
#ifndef UNIFDEF_DRIVERKIT
#include <sys/_types/_dev_t.h>
#include <sys/_types/_mode_t.h>
#endif /* UNIFDEF_DRIVERKIT */
#include <_types/_uint32_t.h>
uint32_t arc4random(void);
#ifndef UNIFDEF_DRIVERKIT
void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
__OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir")
__IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
__TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
__WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir");
#endif /* UNIFDEF_DRIVERKIT */
void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
void arc4random_stir(void);
uint32_t
arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
#ifdef __BLOCKS__
#ifndef UNIFDEF_DRIVERKIT
int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* UNIFDEF_DRIVERKIT */
void *bsearch_b(const void *__key, const void *__base, size_t __nel,
size_t __width, int (^ _Nonnull __compar)(const void *, const void *)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
#ifndef UNIFDEF_DRIVERKIT
/* getcap(3) functions */
char *cgetcap(char *, const char *, int);
int cgetclose(void);
int cgetent(char **, char **, const char *);
int cgetfirst(char **, char **);
int cgetmatch(const char *, const char *);
int cgetnext(char **, char **);
int cgetnum(char *, const char *, long *);
int cgetset(const char *);
int cgetstr(char *, const char *, char **);
int cgetustr(char *, const char *, char **);
int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
char *devname(dev_t, mode_t);
char *devname_r(dev_t, mode_t, char *buf, int len);
char *getbsize(int *, long *);
int getloadavg(double [], int);
const char
*getprogname(void);
void setprogname(const char *);
#endif /* UNIFDEF_DRIVERKIT */
#ifdef __BLOCKS__
#if __has_attribute(noescape)
#define __sort_noescape __attribute__((__noescape__))
#else
#define __sort_noescape
#endif
#endif /* __BLOCKS__ */
int heapsort(void *__base, size_t __nel, size_t __width,
int (* _Nonnull __compar)(const void *, const void *));
#ifdef __BLOCKS__
int heapsort_b(void *__base, size_t __nel, size_t __width,
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
int mergesort(void *__base, size_t __nel, size_t __width,
int (* _Nonnull __compar)(const void *, const void *));
#ifdef __BLOCKS__
int mergesort_b(void *__base, size_t __nel, size_t __width,
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
#ifndef UNIFDEF_DRIVERKIT
void psort(void *__base, size_t __nel, size_t __width,
int (* _Nonnull __compar)(const void *, const void *))
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#ifdef __BLOCKS__
void psort_b(void *__base, size_t __nel, size_t __width,
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
void psort_r(void *__base, size_t __nel, size_t __width, void *,
int (* _Nonnull __compar)(void *, const void *, const void *))
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* UNIFDEF_DRIVERKIT */
#ifdef __BLOCKS__
void qsort_b(void *__base, size_t __nel, size_t __width,
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
void qsort_r(void *__base, size_t __nel, size_t __width, void *,
int (* _Nonnull __compar)(void *, const void *, const void *));
int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
unsigned __endbyte);
int rpmatch(const char *)
__API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
unsigned __endbyte);
#ifndef UNIFDEF_DRIVERKIT
void sranddev(void);
void srandomdev(void);
void *reallocf(void *__ptr, size_t __size) __alloc_size(2);
long long
strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp)
__API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0));
#endif /* UNIFDEF_DRIVERKIT */
#if !__DARWIN_NO_LONG_LONG
long long
strtoq(const char *__str, char **__endptr, int __base);
unsigned long long
strtouq(const char *__str, char **__endptr, int __base);
#endif /* !__DARWIN_NO_LONG_LONG */
#ifndef UNIFDEF_DRIVERKIT
extern char *suboptarg; /* getsubopt(3) external variable */
/* valloc is now declared in _malloc.h */
#endif /* UNIFDEF_DRIVERKIT */
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
/* Poison the following routines if -fshort-wchar is set */
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
#pragma GCC poison mbstowcs mbtowc wcstombs wctomb
#endif
__END_DECLS
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_stdlib.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* _STDLIB_H_ */

View File

@ -0,0 +1,211 @@
/*
* Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)string.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _STRING_H_
#define _STRING_H_
#include <_types.h>
#include <sys/cdefs.h>
#include <Availability.h>
#include <sys/_types/_size_t.h>
#include <sys/_types/_null.h>
/* ANSI-C */
__BEGIN_DECLS
void *memchr(const void *__s, int __c, size_t __n);
int memcmp(const void *__s1, const void *__s2, size_t __n);
void *memcpy(void *__dst, const void *__src, size_t __n);
void *memmove(void *__dst, const void *__src, size_t __len);
void *memset(void *__b, int __c, size_t __len);
#ifndef UNIFDEF_DRIVERKIT
char *strcat(char *__s1, const char *__s2);
#endif /* UNIFDEF_DRIVERKIT */
char *strchr(const char *__s, int __c);
int strcmp(const char *__s1, const char *__s2);
int strcoll(const char *__s1, const char *__s2);
#ifndef UNIFDEF_DRIVERKIT
char *strcpy(char *__dst, const char *__src);
#endif /* UNIFDEF_DRIVERKIT */
size_t strcspn(const char *__s, const char *__charset);
//Begin-Libc
#ifndef LIBC_ALIAS_STRERROR
//End-Libc
char *strerror(int __errnum) __DARWIN_ALIAS(strerror);
//Begin-Libc
#else /* LIBC_ALIAS_STRERROR */
char *strerror(int __errnum) LIBC_ALIAS(strerror);
#endif /* !LIBC_ALIAS_STRERROR */
//End-Libc
size_t strlen(const char *__s);
char *strncat(char *__s1, const char *__s2, size_t __n);
int strncmp(const char *__s1, const char *__s2, size_t __n);
char *strncpy(char *__dst, const char *__src, size_t __n);
char *strpbrk(const char *__s, const char *__charset);
char *strrchr(const char *__s, int __c);
size_t strspn(const char *__s, const char *__charset);
char *strstr(const char *__big, const char *__little);
char *strtok(char *__str, const char *__sep);
size_t strxfrm(char *__s1, const char *__s2, size_t __n);
__END_DECLS
/* Additional functionality provided by:
* POSIX.1c-1995,
* POSIX.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
*/
#if __DARWIN_C_LEVEL >= 199506L
__BEGIN_DECLS
char *strtok_r(char *__str, const char *__sep, char **__lasts);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199506L */
/* Additional functionality provided by:
* POSIX.1-2001
*/
#if __DARWIN_C_LEVEL >= 200112L
__BEGIN_DECLS
int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen);
char *strdup(const char *__s1);
void *memccpy(void *__dst, const void *__src, int __c, size_t __n);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L */
/* Additional functionality provided by:
* POSIX.1-2008
*/
#if __DARWIN_C_LEVEL >= 200809L
__BEGIN_DECLS
#ifndef UNIFDEF_DRIVERKIT
char *stpcpy(char *__dst, const char *__src);
#endif /* UNIFDEF_DRIVERKIT */
char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
size_t strnlen(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
char *strsignal(int __sig);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200809L */
/* C11 Annex K */
#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
#include <sys/_types/_rsize_t.h>
#include <sys/_types/_errno_t.h>
__BEGIN_DECLS
errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
__END_DECLS
#endif
/* Darwin extensions */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#include <sys/_types/_ssize_t.h>
__BEGIN_DECLS
void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
char *strcasestr(const char *__big, const char *__little);
char *strnstr(const char *__big, const char *__little, size_t __len);
size_t strlcat(char *__dst, const char *__source, size_t __size);
size_t strlcpy(char *__dst, const char *__source, size_t __size);
void strmode(int __mode, char *__bp);
char *strsep(char **__stringp, const char *__delim);
/* SUS places swab() in unistd.h. It is listed here for source compatibility */
void swab(const void * __restrict, void * __restrict, ssize_t);
__OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1)
__TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1)
int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len);
__OSX_AVAILABLE(10.16) __IOS_AVAILABLE(14.0)
__TVOS_AVAILABLE(14.0) __WATCHOS_AVAILABLE(7.0)
int strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen);
__END_DECLS
/* Some functions historically defined in string.h were placed in strings.h
* by SUS. We are using "strings.h" instead of <strings.h> to avoid an issue
* where /Developer/Headers/FlatCarbon/Strings.h could be included instead on
* case-insensitive file systems.
*/
#include "strings.h"
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_string.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
/* Security checking functions. */
#include <secure/_string.h>
#endif
#endif /* _STRING_H_ */

View File

@ -0,0 +1,113 @@
/* $NetBSD: rbtree.h,v 1.2 2012/02/17 08:20:55 yamt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Portions Copyright (c) 2012 Apple Inc. All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas <matt@3am-software.com>.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SYS_RBTREE_H_
#define _SYS_RBTREE_H_
#include <Availability.h>
#include <sys/types.h>
#include <stdbool.h>
#include <inttypes.h>
#include <sys/queue.h>
__BEGIN_DECLS
#define RB_DIR_LEFT 0
#define RB_DIR_RIGHT 1
#define RB_TREE_MIN(T) rb_tree_iterate((T), NULL, RB_DIR_RIGHT)
#define RB_TREE_MAX(T) rb_tree_iterate((T), NULL, RB_DIR_LEFT)
#define RB_TREE_FOREACH(N, T) \
for ((N) = RB_TREE_MIN(T); (N); \
(N) = rb_tree_iterate((T), (N), RB_DIR_RIGHT))
#define RB_TREE_FOREACH_SAFE(N, T, TVAR) \
for ((N) = RB_TREE_MIN(T); (N) && ((TVAR) = rb_tree_iterate((T), (N), RB_DIR_RIGHT), 1); \
(N) = (TVAR))
#define RB_TREE_FOREACH_REVERSE(N, T) \
for ((N) = RB_TREE_MAX(T); (N); \
(N) = rb_tree_iterate((T), (N), RB_DIR_LEFT))
#define RB_TREE_FOREACH_REVERSE_SAFE(N, T, TVAR) \
for ((N) = RB_TREE_MAX(T); (N) && ((TVAR) = rb_tree_iterate((T), (N), RB_DIR_LEFT), 1); \
(N) = (TVAR))
/*
* rbto_compare_nodes_fn:
* return a positive value if the first node > the second node.
* return a negative value if the first node < the second node.
* return 0 if they are considered same.
*
* rbto_compare_key_fn:
* return a positive value if the node > the key.
* return a negative value if the node < the key.
* return 0 if they are considered same.
*/
typedef signed int (*rbto_compare_nodes_fn)(void *, const void *, const void *);
typedef signed int (*rbto_compare_key_fn)(void *, const void *, const void *);
typedef struct {
rbto_compare_nodes_fn rbto_compare_nodes;
rbto_compare_key_fn rbto_compare_key;
size_t rbto_node_offset;
void *rbto_context;
} rb_tree_ops_t;
//Begin-Libc
#ifdef _RBTREE_NO_OPAQUE_STRUCTS_
typedef struct rb_node rb_node_t;
typedef struct rb_tree rb_tree_t;
#else
//End-Libc
typedef struct rb_node { void * opaque[3]; } rb_node_t;
typedef struct rb_tree { void *opaque[8]; } rb_tree_t;
//Begin-Libc
#endif
//End-Libc
#define _rb_availability __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0);
void rb_tree_init(rb_tree_t *, const rb_tree_ops_t *) _rb_availability;
void * rb_tree_insert_node(rb_tree_t *, void *) _rb_availability;
void * rb_tree_find_node(rb_tree_t *, const void *) _rb_availability;
void * rb_tree_find_node_geq(rb_tree_t *, const void *) _rb_availability;
void * rb_tree_find_node_leq(rb_tree_t *, const void *) _rb_availability;
void rb_tree_remove_node(rb_tree_t *, void *) _rb_availability;
void * rb_tree_iterate(rb_tree_t *, void *, const unsigned int) _rb_availability;
size_t rb_tree_count(rb_tree_t *) _rb_availability;
#undef _rb_availability
__END_DECLS
#endif /* _SYS_RBTREE_H_*/

View File

@ -0,0 +1,266 @@
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)time.h 8.3 (Berkeley) 1/21/94
*/
#ifndef _TIME_H_
#define _TIME_H_
#include <_types.h>
#include <sys/cdefs.h>
#include <Availability.h>
#ifndef UNIFDEF_DRIVERKIT
#include <sys/_types/_clock_t.h>
#include <sys/_types/_null.h>
#include <sys/_types/_size_t.h>
#include <sys/_types/_time_t.h>
#include <sys/_types/_timespec.h>
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from UTC in seconds */
char *tm_zone; /* timezone abbreviation */
};
#if __DARWIN_UNIX03
#define CLOCKS_PER_SEC 1000000 /* [XSI] */
#else /* !__DARWIN_UNIX03 */
#include <machine/_limits.h> /* Include file containing CLK_TCK. */
#define CLOCKS_PER_SEC (__DARWIN_CLK_TCK)
#endif /* __DARWIN_UNIX03 */
#ifndef _ANSI_SOURCE
extern char *tzname[];
#endif
extern int getdate_err;
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_TIMEZONE
//End-Libc
extern long timezone __DARWIN_ALIAS(timezone);
//Begin-Libc
#else /* LIBC_ALIAS_TIMEZONE */
extern long timezone LIBC_ALIAS(timezone);
#endif /* !LIBC_ALIAS_TIMEZONE */
//End-Libc
#endif /* __DARWIN_UNIX03 */
extern int daylight;
#endif /* UNIFDEF_DRIVERKIT */
__BEGIN_DECLS
#ifndef UNIFDEF_DRIVERKIT
char *asctime(const struct tm *);
//Begin-Libc
#ifndef LIBC_ALIAS_CLOCK
//End-Libc
clock_t clock(void) __DARWIN_ALIAS(clock);
//Begin-Libc
#else /* LIBC_ALIAS_CLOCK */
clock_t clock(void) LIBC_ALIAS(clock);
#endif /* !LIBC_ALIAS_CLOCK */
//End-Libc
char *ctime(const time_t *);
double difftime(time_t, time_t);
struct tm *getdate(const char *);
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
//Begin-Libc
#ifndef LIBC_ALIAS_MKTIME
//End-Libc
time_t mktime(struct tm *) __DARWIN_ALIAS(mktime);
//Begin-Libc
#else /* LIBC_ALIAS_MKTIME */
time_t mktime(struct tm *) LIBC_ALIAS(mktime);
#endif /* !LIBC_ALIAS_MKTIME */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_STRFTIME
//End-Libc
size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime);
//Begin-Libc
#else /* LIBC_ALIAS_STRFTIME */
size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) LIBC_ALIAS(strftime);
#endif /* !LIBC_ALIAS_STRFTIME */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_STRPTIME
//End-Libc
char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime);
//Begin-Libc
#else /* LIBC_ALIAS_STRPTIME */
char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) LIBC_ALIAS(strptime);
#endif /* !LIBC_ALIAS_STRPTIME */
//End-Libc
time_t time(time_t *);
#ifndef _ANSI_SOURCE
void tzset(void);
#endif /* not ANSI */
/* [TSF] Thread safe functions */
char *asctime_r(const struct tm * __restrict, char * __restrict);
char *ctime_r(const time_t *, char *);
struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict);
struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict);
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
time_t posix2time(time_t);
#if !__DARWIN_UNIX03
char *timezone(int, int);
#endif /* !__DARWIN_UNIX03 */
void tzsetwall(void);
time_t time2posix(time_t);
time_t timelocal(struct tm * const);
time_t timegm(struct tm * const);
#endif /* neither ANSI nor POSIX */
#if !defined(_ANSI_SOURCE)
//Begin-Libc
#ifndef LIBC_ALIAS_NANOSLEEP
//End-Libc
int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep);
//Begin-Libc
#else /* LIBC_ALIAS_NANOSLEEP */
int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) LIBC_ALIAS_C(nanosleep);
#endif /* !LIBC_ALIAS_NANOSLEEP */
//End-Libc
#endif
#endif /* UNIFDEF_DRIVERKIT */
#if !defined(_DARWIN_FEATURE_CLOCK_GETTIME) || _DARWIN_FEATURE_CLOCK_GETTIME != 0
#if __DARWIN_C_LEVEL >= 199309L
#if __has_feature(enumerator_attributes)
#define __CLOCK_AVAILABILITY __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
#else
#define __CLOCK_AVAILABILITY
#endif
typedef enum {
_CLOCK_REALTIME __CLOCK_AVAILABILITY = 0,
#define CLOCK_REALTIME _CLOCK_REALTIME
_CLOCK_MONOTONIC __CLOCK_AVAILABILITY = 6,
#define CLOCK_MONOTONIC _CLOCK_MONOTONIC
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
_CLOCK_MONOTONIC_RAW __CLOCK_AVAILABILITY = 4,
#define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW
_CLOCK_MONOTONIC_RAW_APPROX __CLOCK_AVAILABILITY = 5,
#define CLOCK_MONOTONIC_RAW_APPROX _CLOCK_MONOTONIC_RAW_APPROX
_CLOCK_UPTIME_RAW __CLOCK_AVAILABILITY = 8,
#define CLOCK_UPTIME_RAW _CLOCK_UPTIME_RAW
_CLOCK_UPTIME_RAW_APPROX __CLOCK_AVAILABILITY = 9,
#define CLOCK_UPTIME_RAW_APPROX _CLOCK_UPTIME_RAW_APPROX
#endif
_CLOCK_PROCESS_CPUTIME_ID __CLOCK_AVAILABILITY = 12,
#define CLOCK_PROCESS_CPUTIME_ID _CLOCK_PROCESS_CPUTIME_ID
_CLOCK_THREAD_CPUTIME_ID __CLOCK_AVAILABILITY = 16
#define CLOCK_THREAD_CPUTIME_ID _CLOCK_THREAD_CPUTIME_ID
} clockid_t;
#ifndef UNIFDEF_DRIVERKIT
__CLOCK_AVAILABILITY
int clock_getres(clockid_t __clock_id, struct timespec *__res);
__CLOCK_AVAILABILITY
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
#endif /* UNIFDEF_DRIVERKIT */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
__CLOCK_AVAILABILITY
__uint64_t clock_gettime_nsec_np(clockid_t __clock_id);
#endif
#ifndef UNIFDEF_DRIVERKIT
__OSX_AVAILABLE(10.12) __IOS_PROHIBITED
__TVOS_PROHIBITED __WATCHOS_PROHIBITED
int clock_settime(clockid_t __clock_id, const struct timespec *__tp);
#endif /* UNIFDEF_DRIVERKIT */
#undef __CLOCK_AVAILABILITY
#endif /* __DARWIN_C_LEVEL */
#endif /* _DARWIN_FEATURE_CLOCK_GETTIME */
#ifndef UNIFDEF_DRIVERKIT
#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
(defined(__cplusplus) && __cplusplus >= 201703L)
/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */
#define TIME_UTC 1 /* time elapsed since epoch */
__API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0))
int timespec_get(struct timespec *ts, int base);
#endif
#endif /* UNIFDEF_DRIVERKIT */
__END_DECLS
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_time.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* !_TIME_H_ */

View File

@ -0,0 +1,992 @@
/*
* Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)unistd.h 8.12 (Berkeley) 4/27/95
*
* Copyright (c) 1998 Apple Compter, Inc.
* All Rights Reserved
*/
/* History:
7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr
3/26/98 CHW at Apple added real interface to searchfs call
3/5/98 CHW at Apple added hfs semantic system calls headers
*/
#ifndef _UNISTD_H_
#define _UNISTD_H_
#include <_types.h>
#include <sys/unistd.h>
#include <Availability.h>
#include <sys/_types/_gid_t.h>
#include <sys/_types/_intptr_t.h>
#include <sys/_types/_off_t.h>
#include <sys/_types/_pid_t.h>
/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
* _GCC_SIZE_T */
#include <sys/_types/_size_t.h>
#include <sys/_types/_ssize_t.h>
#include <sys/_types/_uid_t.h>
#include <sys/_types/_useconds_t.h>
#include <sys/_types/_null.h>
#define STDIN_FILENO 0 /* standard input file descriptor */
#define STDOUT_FILENO 1 /* standard output file descriptor */
#define STDERR_FILENO 2 /* standard error file descriptor */
/* Version test macros */
/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */
#define _XOPEN_VERSION 600 /* [XSI] */
#define _XOPEN_XCU_VERSION 4 /* Older standard */
/* Please keep this list in the same order as the applicable standard */
#define _POSIX_ADVISORY_INFO (-1) /* [ADV] */
#define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */
#define _POSIX_BARRIERS (-1) /* [BAR] */
#define _POSIX_CHOWN_RESTRICTED 200112L
#define _POSIX_CLOCK_SELECTION (-1) /* [CS] */
#define _POSIX_CPUTIME (-1) /* [CPT] */
#define _POSIX_FSYNC 200112L /* [FSC] */
#define _POSIX_IPV6 200112L
#define _POSIX_JOB_CONTROL 200112L
#define _POSIX_MAPPED_FILES 200112L /* [MF] */
#define _POSIX_MEMLOCK (-1) /* [ML] */
#define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */
#define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */
#define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */
#define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */
#define _POSIX_NO_TRUNC 200112L
#define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */
#define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */
#define _POSIX_RAW_SOCKETS (-1) /* [RS] */
#define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */
#define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */
#define _POSIX_REGEXP 200112L
#define _POSIX_SAVED_IDS 200112L /* XXX required */
#define _POSIX_SEMAPHORES (-1) /* [SEM] */
#define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */
#define _POSIX_SHELL 200112L
#define _POSIX_SPAWN (-1) /* [SPN] */
#define _POSIX_SPIN_LOCKS (-1) /* [SPI] */
#define _POSIX_SPORADIC_SERVER (-1) /* [SS] */
#define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */
#define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */
#define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */
#define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */
#define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */
#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */
#define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */
#define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */
#define _POSIX_THREADS 200112L /* [THR] */
#define _POSIX_TIMEOUTS (-1) /* [TMO] */
#define _POSIX_TIMERS (-1) /* [TMR] */
#define _POSIX_TRACE (-1) /* [TRC] */
#define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */
#define _POSIX_TRACE_INHERIT (-1) /* [TRI] */
#define _POSIX_TRACE_LOG (-1) /* [TRL] */
#define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE 0xff /* same as sys/termios.h */
#endif /* _POSIX_VDISABLE */
#if __DARWIN_C_LEVEL >= 199209L
#define _POSIX2_C_BIND 200112L
#define _POSIX2_C_DEV 200112L /* c99 command */
#define _POSIX2_CHAR_TERM 200112L
#define _POSIX2_FORT_DEV (-1) /* fort77 command */
#define _POSIX2_FORT_RUN 200112L
#define _POSIX2_LOCALEDEF 200112L /* localedef command */
#define _POSIX2_PBS (-1)
#define _POSIX2_PBS_ACCOUNTING (-1)
#define _POSIX2_PBS_CHECKPOINT (-1)
#define _POSIX2_PBS_LOCATE (-1)
#define _POSIX2_PBS_MESSAGE (-1)
#define _POSIX2_PBS_TRACK (-1)
#define _POSIX2_SW_DEV 200112L
#define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */
#endif /* __DARWIN_C_LEVEL */
#define __ILP32_OFF32 (-1)
#ifdef UNIFDEF_POSIX_ILP32_ALLOW
#define __ILP32_OFFBIG (1)
#else // UNIFDEF_POSIX_ILP32_ALLOW
#define __ILP32_OFFBIG (-1)
#endif // UNIFDEF_POSIX_ILP32_ALLOW
#define __LP64_OFF64 (1)
#define __LPBIG_OFFBIG (1)
#if __DARWIN_C_LEVEL >= 200112L
#define _POSIX_V6_ILP32_OFF32 __ILP32_OFF32
#define _POSIX_V6_ILP32_OFFBIG __ILP32_OFFBIG
#define _POSIX_V6_LP64_OFF64 __LP64_OFF64
#define _POSIX_V6_LPBIG_OFFBIG __LPBIG_OFFBIG
#endif /* __DARWIN_C_LEVEL >= 200112L */
#if __DARWIN_C_LEVEL >= 200809L
#define _POSIX_V7_ILP32_OFF32 __ILP32_OFF32
#define _POSIX_V7_ILP32_OFFBIG __ILP32_OFFBIG
#define _POSIX_V7_LP64_OFF64 __LP64_OFF64
#define _POSIX_V7_LPBIG_OFFBIG __LPBIG_OFFBIG
#endif /* __DARWIN_C_LEVEL >= 200809L */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define _V6_ILP32_OFF32 __ILP32_OFF32
#define _V6_ILP32_OFFBIG __ILP32_OFFBIG
#define _V6_LP64_OFF64 __LP64_OFF64
#define _V6_LPBIG_OFFBIG __LPBIG_OFFBIG
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
/* Removed in Issue 7 */
#define _XBS5_ILP32_OFF32 __ILP32_OFF32
#define _XBS5_ILP32_OFFBIG __ILP32_OFFBIG
#define _XBS5_LP64_OFF64 __LP64_OFF64
#define _XBS5_LPBIG_OFFBIG __LPBIG_OFFBIG
#endif /* __DARWIN_C_LEVEL < 200809L */
#if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */
#define _XOPEN_CRYPT (1)
#define _XOPEN_ENH_I18N (1) /* XXX required */
#define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */
#define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */
#define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */
#define _XOPEN_SHM (1)
#define _XOPEN_STREAMS (-1) /* Issue 6 */
#define _XOPEN_UNIX (1)
#endif /* XSI */
/* configurable system variables */
#define _SC_ARG_MAX 1
#define _SC_CHILD_MAX 2
#define _SC_CLK_TCK 3
#define _SC_NGROUPS_MAX 4
#define _SC_OPEN_MAX 5
#define _SC_JOB_CONTROL 6
#define _SC_SAVED_IDS 7
#define _SC_VERSION 8
#define _SC_BC_BASE_MAX 9
#define _SC_BC_DIM_MAX 10
#define _SC_BC_SCALE_MAX 11
#define _SC_BC_STRING_MAX 12
#define _SC_COLL_WEIGHTS_MAX 13
#define _SC_EXPR_NEST_MAX 14
#define _SC_LINE_MAX 15
#define _SC_RE_DUP_MAX 16
#define _SC_2_VERSION 17
#define _SC_2_C_BIND 18
#define _SC_2_C_DEV 19
#define _SC_2_CHAR_TERM 20
#define _SC_2_FORT_DEV 21
#define _SC_2_FORT_RUN 22
#define _SC_2_LOCALEDEF 23
#define _SC_2_SW_DEV 24
#define _SC_2_UPE 25
#define _SC_STREAM_MAX 26
#define _SC_TZNAME_MAX 27
#if __DARWIN_C_LEVEL >= 199309L
#define _SC_ASYNCHRONOUS_IO 28
#define _SC_PAGESIZE 29
#define _SC_MEMLOCK 30
#define _SC_MEMLOCK_RANGE 31
#define _SC_MEMORY_PROTECTION 32
#define _SC_MESSAGE_PASSING 33
#define _SC_PRIORITIZED_IO 34
#define _SC_PRIORITY_SCHEDULING 35
#define _SC_REALTIME_SIGNALS 36
#define _SC_SEMAPHORES 37
#define _SC_FSYNC 38
#define _SC_SHARED_MEMORY_OBJECTS 39
#define _SC_SYNCHRONIZED_IO 40
#define _SC_TIMERS 41
#define _SC_AIO_LISTIO_MAX 42
#define _SC_AIO_MAX 43
#define _SC_AIO_PRIO_DELTA_MAX 44
#define _SC_DELAYTIMER_MAX 45
#define _SC_MQ_OPEN_MAX 46
#define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */
#define _SC_RTSIG_MAX 48
#define _SC_SEM_NSEMS_MAX 49
#define _SC_SEM_VALUE_MAX 50
#define _SC_SIGQUEUE_MAX 51
#define _SC_TIMER_MAX 52
#endif /* __DARWIN_C_LEVEL >= 199309L */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define _SC_NPROCESSORS_CONF 57
#define _SC_NPROCESSORS_ONLN 58
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#if __DARWIN_C_LEVEL >= 200112L
#define _SC_2_PBS 59
#define _SC_2_PBS_ACCOUNTING 60
#define _SC_2_PBS_CHECKPOINT 61
#define _SC_2_PBS_LOCATE 62
#define _SC_2_PBS_MESSAGE 63
#define _SC_2_PBS_TRACK 64
#define _SC_ADVISORY_INFO 65
#define _SC_BARRIERS 66
#define _SC_CLOCK_SELECTION 67
#define _SC_CPUTIME 68
#define _SC_FILE_LOCKING 69
#define _SC_GETGR_R_SIZE_MAX 70
#define _SC_GETPW_R_SIZE_MAX 71
#define _SC_HOST_NAME_MAX 72
#define _SC_LOGIN_NAME_MAX 73
#define _SC_MONOTONIC_CLOCK 74
#define _SC_MQ_PRIO_MAX 75
#define _SC_READER_WRITER_LOCKS 76
#define _SC_REGEXP 77
#define _SC_SHELL 78
#define _SC_SPAWN 79
#define _SC_SPIN_LOCKS 80
#define _SC_SPORADIC_SERVER 81
#define _SC_THREAD_ATTR_STACKADDR 82
#define _SC_THREAD_ATTR_STACKSIZE 83
#define _SC_THREAD_CPUTIME 84
#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85
#define _SC_THREAD_KEYS_MAX 86
#define _SC_THREAD_PRIO_INHERIT 87
#define _SC_THREAD_PRIO_PROTECT 88
#define _SC_THREAD_PRIORITY_SCHEDULING 89
#define _SC_THREAD_PROCESS_SHARED 90
#define _SC_THREAD_SAFE_FUNCTIONS 91
#define _SC_THREAD_SPORADIC_SERVER 92
#define _SC_THREAD_STACK_MIN 93
#define _SC_THREAD_THREADS_MAX 94
#define _SC_TIMEOUTS 95
#define _SC_THREADS 96
#define _SC_TRACE 97
#define _SC_TRACE_EVENT_FILTER 98
#define _SC_TRACE_INHERIT 99
#define _SC_TRACE_LOG 100
#define _SC_TTY_NAME_MAX 101
#define _SC_TYPED_MEMORY_OBJECTS 102
#define _SC_V6_ILP32_OFF32 103
#define _SC_V6_ILP32_OFFBIG 104
#define _SC_V6_LP64_OFF64 105
#define _SC_V6_LPBIG_OFFBIG 106
#define _SC_IPV6 118
#define _SC_RAW_SOCKETS 119
#define _SC_SYMLOOP_MAX 120
#endif /* __DARWIN_C_LEVEL >= 200112L */
#if __DARWIN_C_LEVEL >= 199506L /* Really XSI */
#define _SC_ATEXIT_MAX 107
#define _SC_IOV_MAX 56
#define _SC_PAGE_SIZE _SC_PAGESIZE
#define _SC_XOPEN_CRYPT 108
#define _SC_XOPEN_ENH_I18N 109
#define _SC_XOPEN_LEGACY 110 /* Issue 6 */
#define _SC_XOPEN_REALTIME 111 /* Issue 6 */
#define _SC_XOPEN_REALTIME_THREADS 112 /* Issue 6 */
#define _SC_XOPEN_SHM 113
#define _SC_XOPEN_STREAMS 114 /* Issue 6 */
#define _SC_XOPEN_UNIX 115
#define _SC_XOPEN_VERSION 116
#define _SC_XOPEN_XCU_VERSION 121
#endif /* XSI */
#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
/* Removed in Issue 7 */
#define _SC_XBS5_ILP32_OFF32 122
#define _SC_XBS5_ILP32_OFFBIG 123
#define _SC_XBS5_LP64_OFF64 124
#define _SC_XBS5_LPBIG_OFFBIG 125
#endif /* __DARWIN_C_LEVEL <= 200809L */
#if __DARWIN_C_LEVEL >= 200112L
#define _SC_SS_REPL_MAX 126
#define _SC_TRACE_EVENT_NAME_MAX 127
#define _SC_TRACE_NAME_MAX 128
#define _SC_TRACE_SYS_MAX 129
#define _SC_TRACE_USER_EVENT_MAX 130
#endif
#if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
/* Removed in Issue 6 */
#define _SC_PASS_MAX 131
#endif
/* 132-199 available for future use */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define _SC_PHYS_PAGES 200
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#if __DARWIN_C_LEVEL >= 199209L
#ifndef _CS_PATH /* Defined in <sys/unistd.h> */
#define _CS_PATH 1
#endif
#endif
#if __DARWIN_C_LEVEL >= 200112
#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
#define _CS_POSIX_V6_LP64_OFF64_LIBS 10
#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
#endif
#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
/* Removed in Issue 7 */
#define _CS_XBS5_ILP32_OFF32_CFLAGS 20
#define _CS_XBS5_ILP32_OFF32_LDFLAGS 21
#define _CS_XBS5_ILP32_OFF32_LIBS 22
#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23
#define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24
#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25
#define _CS_XBS5_ILP32_OFFBIG_LIBS 26
#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27
#define _CS_XBS5_LP64_OFF64_CFLAGS 28
#define _CS_XBS5_LP64_OFF64_LDFLAGS 29
#define _CS_XBS5_LP64_OFF64_LIBS 30
#define _CS_XBS5_LP64_OFF64_LINTFLAGS 31
#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32
#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33
#define _CS_XBS5_LPBIG_OFFBIG_LIBS 34
#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35
#endif
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define _CS_DARWIN_USER_DIR 65536
#define _CS_DARWIN_USER_TEMP_DIR 65537
#define _CS_DARWIN_USER_CACHE_DIR 65538
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#ifdef _DARWIN_UNLIMITED_GETGROUPS
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it."
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
#error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it."
#endif
#endif
/* POSIX.1-1990 */
__BEGIN_DECLS
void _exit(int) __dead2;
int access(const char *, int);
unsigned int
alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
//Begin-Libc
#ifndef LIBC_ALIAS_CLOSE
//End-Libc
int close(int) __DARWIN_ALIAS_C(close);
//Begin-Libc
#else /* LIBC_ALIAS_CLOSE */
int close(int) LIBC_ALIAS_C(close);
#endif /* !LIBC_ALIAS_CLOSE */
//End-Libc
int dup(int);
int dup2(int, int);
int execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
pid_t fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
long fpathconf(int, int);
char *getcwd(char *, size_t);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE)
int getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups));
#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */
int getgroups(int, gid_t []);
#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */
char *getlogin(void);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
uid_t getuid(void);
int isatty(int);
int link(const char *, const char *);
off_t lseek(int, off_t, int);
long pathconf(const char *, int);
//Begin-Libc
#ifndef LIBC_ALIAS_PAUSE
//End-Libc
int pause(void) __DARWIN_ALIAS_C(pause);
//Begin-Libc
#else /* LIBC_ALIAS_PAUSE */
int pause(void) LIBC_ALIAS_C(pause);
#endif /* !LIBC_ALIAS_PAUSE */
//End-Libc
int pipe(int [2]);
//Begin-Libc
#ifndef LIBC_ALIAS_READ
//End-Libc
ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read);
//Begin-Libc
#else /* LIBC_ALIAS_READ */
ssize_t read(int, void *, size_t) LIBC_ALIAS_C(read);
#endif /* !LIBC_ALIAS_READ */
//End-Libc
int rmdir(const char *);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
pid_t setsid(void);
int setuid(uid_t);
//Begin-Libc
#ifndef LIBC_ALIAS_SLEEP
//End-Libc
unsigned int
sleep(unsigned int) __DARWIN_ALIAS_C(sleep);
//Begin-Libc
#else /* LIBC_ALIAS_SLEEP */
unsigned int
sleep(unsigned int) LIBC_ALIAS_C(sleep);
#endif /* !LIBC_ALIAS_SLEEP */
//End-Libc
long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_TTYNAME_R
//End-Libc
int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
//Begin-Libc
#else /* LIBC_ALIAS_TTYNAME_R */
int ttyname_r(int, char *, size_t) LIBC_ALIAS(ttyname_r);
#endif /* !LIBC_ALIAS_TTYNAME_R */
//End-Libc
#else /* !__DARWIN_UNIX03 */
char *ttyname_r(int, char *, size_t);
#endif /* __DARWIN_UNIX03 */
int unlink(const char *);
//Begin-Libc
#ifndef LIBC_ALIAS_WRITE
//End-Libc
ssize_t write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write);
//Begin-Libc
#else /* LIBC_ALIAS_WRITE */
ssize_t write(int __fd, const void * __buf, size_t __nbyte) LIBC_ALIAS_C(write);
#endif /* !LIBC_ALIAS_WRITE */
//End-Libc
__END_DECLS
/* Additional functionality provided by:
* POSIX.2-1992 C Language Binding Option
*/
#if __DARWIN_C_LEVEL >= 199209L
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_CONFSTR
//End-Libc
size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr);
//Begin-Libc
#else /* LIBC_ALIAS_CONFSTR */
size_t confstr(int, char *, size_t) LIBC_ALIAS(confstr);
#endif /* !LIBC_ALIAS_CONFSTR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_GETOPT
//End-Libc
int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt);
//Begin-Libc
#else /* LIBC_ALIAS_GETOPT */
int getopt(int, char * const [], const char *) LIBC_ALIAS(getopt);
#endif /* !LIBC_ALIAS_GETOPT */
//End-Libc
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199209L */
/* Additional functionality provided by:
* POSIX.1c-1995,
* POSIX.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
*/
#if __DARWIN_C_LEVEL >= 199506L
#include <_ctermid.h>
/* These F_* are really XSI or Issue 6 */
#define F_ULOCK 0 /* unlock locked section */
#define F_LOCK 1 /* lock a section for exclusive use */
#define F_TLOCK 2 /* test and lock a section for exclusive use */
#define F_TEST 3 /* test a section for locks by other procs */
__BEGIN_DECLS
/* Begin XSI */
/* Removed in Issue 6 */
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
#if !defined(_POSIX_C_SOURCE)
__deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED
#endif
void *brk(const void *);
int chroot(const char *) __POSIX_C_DEPRECATED(199506L);
#endif
char *crypt(const char *, const char *);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_ENCRYPT
//End-Libc
void encrypt(char *, int) __DARWIN_ALIAS(encrypt);
//Begin-Libc
#else /* LIBC_ALIAS_ENCRYPT */
void encrypt(char *, int) LIBC_ALIAS(encrypt);
#endif /* !LIBC_ALIAS_ENCRYPT */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int encrypt(char *, int);
#endif /* __DARWIN_UNIX03 */
int fchdir(int);
long gethostid(void);
pid_t getpgid(pid_t);
pid_t getsid(pid_t);
/* Removed in Issue 6 */
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
int getdtablesize(void) __POSIX_C_DEPRECATED(199506L);
int getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L);
char *getpass(const char *) __POSIX_C_DEPRECATED(199506L);
#endif
/* Removed in Issue 7 */
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
char *getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_LCHOWN
//End-Libc
int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
//Begin-Libc
#else /* LIBC_ALIAS_LCHOWN */
int lchown(const char *, uid_t, gid_t) LIBC_ALIAS(lchown);
#endif /* !LIBC_ALIAS_LCHOWN */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_LOCKF
//End-Libc
int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf);
//Begin-Libc
#else /* LIBC_ALIAS_LOCKF */
int lockf(int, int, off_t) LIBC_ALIAS_C(lockf);
#endif /* !LIBC_ALIAS_LOCKF */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_NICE
//End-Libc
int nice(int) __DARWIN_ALIAS(nice);
//Begin-Libc
#else /* LIBC_ALIAS_NICE */
int nice(int) LIBC_ALIAS(nice);
#endif /* !LIBC_ALIAS_NICE */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_PREAD
//End-Libc
ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread);
//Begin-Libc
#else /* LIBC_ALIAS_PREAD */
ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) LIBC_ALIAS_C(pread);
#endif /* !LIBC_ALIAS_PREAD */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_PWRITE
//End-Libc
ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite);
//Begin-Libc
#else /* LIBC_ALIAS_PWRITE */
ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) LIBC_ALIAS_C(pwrite);
#endif /* !LIBC_ALIAS_PWRITE */
//End-Libc
/* Removed in Issue 6 */
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
/* Note that Issue 5 changed the argument as intprt_t,
* but we keep it as int for binary compatability. */
#if !defined(_POSIX_C_SOURCE)
__deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED
#endif
void *sbrk(int);
#endif
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_SETPGRP
//End-Libc
pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp);
//Begin-Libc
#else /* LIBC_ALIAS_SETPGRP */
pid_t setpgrp(void) LIBC_ALIAS(setpgrp);
#endif /* !LIBC_ALIAS_SETPGRP */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
#endif /* __DARWIN_UNIX03 */
//Begin-Libc
#ifndef LIBC_ALIAS_SETREGID
//End-Libc
int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
//Begin-Libc
#else /* LIBC_ALIAS_SETREGID */
int setregid(gid_t, gid_t) LIBC_ALIAS(setregid);
#endif /* !LIBC_ALIAS_SETREGID */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SETREUID
//End-Libc
int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid);
//Begin-Libc
#else /* LIBC_ALIAS_SETREUID */
int setreuid(uid_t, uid_t) LIBC_ALIAS(setreuid);
#endif /* !LIBC_ALIAS_SETREUID */
//End-Libc
void swab(const void * __restrict, void * __restrict, ssize_t);
void sync(void);
int truncate(const char *, off_t);
useconds_t ualarm(useconds_t, useconds_t);
//Begin-Libc
#ifndef LIBC_ALIAS_USLEEP
//End-Libc
int usleep(useconds_t) __DARWIN_ALIAS_C(usleep);
//Begin-Libc
#else /* LIBC_ALIAS_USLEEP */
int usleep(useconds_t) LIBC_ALIAS_C(usleep);
#endif /* !LIBC_ALIAS_USLEEP */
//End-Libc
pid_t vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
/* End XSI */
//Begin-Libc
#ifndef LIBC_ALIAS_FSYNC
//End-Libc
int fsync(int) __DARWIN_ALIAS_C(fsync);
//Begin-Libc
#else /* LIBC_ALIAS_FSYNC */
int fsync(int) LIBC_ALIAS_C(fsync);
#endif /* !LIBC_ALIAS_FSYNC */
//End-Libc
int ftruncate(int, off_t);
int getlogin_r(char *, size_t);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199506L */
/* Additional functionality provided by:
* POSIX.1-2001
* ISO C99
*/
#if __DARWIN_C_LEVEL >= 200112L
__BEGIN_DECLS
int fchown(int, uid_t, gid_t);
int gethostname(char *, size_t);
ssize_t readlink(const char * __restrict, char * __restrict, size_t);
int setegid(gid_t);
int seteuid(uid_t);
int symlink(const char *, const char *);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L */
/* Darwin extensions */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#include <sys/select.h>
#include <sys/_types/_dev_t.h>
#include <sys/_types/_mode_t.h>
#include <sys/_types/_uuid_t.h>
__BEGIN_DECLS
void _Exit(int) __dead2;
int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t);
int acct(const char *);
int add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
void endusershell(void);
int execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
char *fflagstostr(unsigned long);
int getdomainname(char *, int);
int getgrouplist(const char *, int, int *, int *);
#if defined(__has_include)
#if __has_include(<gethostuuid_private.h>)
#include <gethostuuid_private.h>
#else
#include <gethostuuid.h>
#endif
#else
#include <gethostuuid.h>
#endif
mode_t getmode(const void *, mode_t);
int getpeereid(int, uid_t *, gid_t *);
int getsgroups_np(int *, uuid_t);
char *getusershell(void);
int getwgroups_np(int *, uuid_t);
int initgroups(const char *, int);
int issetugid(void);
char *mkdtemp(char *);
int mknod(const char *, mode_t, dev_t);
int mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */
int mkpathat_np(int dfd, const char *path, mode_t omode) /* returns errno */
__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0)
__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
int mkstemp(char *);
int mkstemps(char *, int);
char *mktemp(char *);
int mkostemp(char *path, int oflags)
__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0)
__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
int mkostemps(char *path, int slen, int oflags)
__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0)
__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
/* Non-portable mkstemp that uses open_dprotected_np */
int mkstemp_dprotected_np(char *path, int dpclass, int dpflags)
__OSX_UNAVAILABLE __IOS_AVAILABLE(10.0)
__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
char *mkdtempat_np(int dfd, char *path)
__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0)
__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
int mkstempsat_np(int dfd, char *path, int slen)
__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0)
__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
int mkostempsat_np(int dfd, char *path, int slen, int oflags)
__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0)
__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0);
int nfssvc(int, void *);
int profil(char *, size_t, unsigned long, unsigned int);
__deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.")
int pthread_setugid_np(uid_t, gid_t);
int pthread_getugid_np( uid_t *, gid_t *);
int reboot(int);
int revoke(const char *);
__deprecated int rcmd(char **, int, const char *, const char *, const char *, int *);
__deprecated int rcmd_af(char **, int, const char *, const char *, const char *, int *,
int);
__deprecated int rresvport(int *);
__deprecated int rresvport_af(int *, int);
__deprecated int iruserok(unsigned long, int, const char *, const char *);
__deprecated int iruserok_sa(const void *, int, int, const char *, const char *);
__deprecated int ruserok(const char *, int, const char *, const char *);
int setdomainname(const char *, int);
int setgroups(int, const gid_t *);
void sethostid(long);
int sethostname(const char *, int);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_SETKEY
//End-Libc
void setkey(const char *) __DARWIN_ALIAS(setkey);
//Begin-Libc
#else /* LIBC_ALIAS_SETKEY */
void setkey(const char *) LIBC_ALIAS(setkey);
#endif /* !LIBC_ALIAS_SETKEY */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int setkey(const char *);
#endif /* __DARWIN_UNIX03 */
int setlogin(const char *);
//Begin-Libc
#ifndef LIBC_ALIAS_SETMODE
//End-Libc
void *setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode));
//Begin-Libc
#else /* LIBC_ALIAS_SETMODE */
void *setmode(const char *) LIBC_ALIAS(setmode);
#endif /* !LIBC_ALIAS_SETMODE */
//End-Libc
int setrgid(gid_t);
int setruid(uid_t);
int setsgroups_np(int, const uuid_t);
void setusershell(void);
int setwgroups_np(int, const uuid_t);
int strtofflags(char **, unsigned long *, unsigned long *);
int swapon(const char *);
int ttyslot(void);
int undelete(const char *);
int unwhiteout(const char *);
void *valloc(size_t);
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
__OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; "
"please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().")
__OS_AVAILABILITY_MSG(macosx,deprecated=10.12,"syscall(2) is unsupported; "
"please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().")
int syscall(int, ...);
extern char *suboptarg; /* getsubopt(3) external variable */
int getsubopt(char **, char * const *, char **);
/* HFS & HFS Plus semantics system calls go here */
#ifdef __LP64__
int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
//Begin-Libc
#ifndef LIBC_ALIAS_GETATTRLIST
//End-Libc
int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_GETATTRLIST */
int getattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(getattrlist);
#endif /* !LIBC_ALIAS_GETATTRLIST */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SETATTRLIST
//End-Libc
int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_SETATTRLIST */
int setattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(setattrlist);
#endif /* !LIBC_ALIAS_SETATTRLIST */
//End-Libc
int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
#else /* __LP64__ */
int fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
int fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
//Begin-Libc
#ifndef LIBC_ALIAS_GETATTRLIST
//End-Libc
int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_GETATTRLIST */
int getattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(getattrlist);
#endif /* !LIBC_ALIAS_GETATTRLIST */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SETATTRLIST
//End-Libc
int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_SETATTRLIST */
int setattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(setattrlist);
#endif /* !LIBC_ALIAS_SETATTRLIST */
//End-Libc
int exchangedata(const char*,const char*,unsigned long)
__OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag")
__IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag")
__WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
#endif /* __LP64__ */
struct fssearchblock;
struct searchstate;
int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int fsctl(const char *,unsigned long,void*,unsigned int);
int ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
#define SYNC_VOLUME_FULLSYNC 0x01 /* Flush data and metadata to platter, not just to disk cache */
#define SYNC_VOLUME_WAIT 0x02 /* Wait for sync to complete */
int fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
int sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
extern int optreset;
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
#endif /* _UNISTD_H_ */

View File

@ -0,0 +1,262 @@
/*-
* Copyright (c)1999 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: /repoman/r/ncvs/src/include/wchar.h,v 1.34 2003/03/13 06:29:53 tjr Exp $
*/
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Julian Coleman.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
*/
#ifndef _WCHAR_H_
#define _WCHAR_H_
#include <_types.h>
#include <sys/cdefs.h>
#include <Availability.h>
#include <sys/_types/_null.h>
#include <sys/_types/_size_t.h>
#include <sys/_types/_mbstate_t.h>
#include <sys/_types/_ct_rune_t.h>
#include <sys/_types/_rune_t.h>
#include <sys/_types/_wchar_t.h>
#ifndef WCHAR_MIN
#define WCHAR_MIN __DARWIN_WCHAR_MIN
#endif
#ifndef WCHAR_MAX
#define WCHAR_MAX __DARWIN_WCHAR_MAX
#endif
#include <stdarg.h>
#include <stdio.h>
#ifndef UNIFDEF_DRIVERKIT
#include <time.h>
#endif /* UNIFDEF_DRIVERKIT */
#include <_wctype.h>
/* Initially added in Issue 4 */
__BEGIN_DECLS
wint_t btowc(int);
#ifndef UNIFDEF_DRIVERKIT
wint_t fgetwc(FILE *);
wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict);
wint_t fputwc(wchar_t, FILE *);
int fputws(const wchar_t * __restrict, FILE * __restrict);
int fwide(FILE *, int);
int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
wint_t getwc(FILE *);
wint_t getwchar(void);
#endif /* UNIFDEF_DRIVERKIT */
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
mbstate_t * __restrict);
int mbsinit(const mbstate_t *);
size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
mbstate_t * __restrict);
#ifndef UNIFDEF_DRIVERKIT
wint_t putwc(wchar_t, FILE *);
wint_t putwchar(wchar_t);
#endif /* UNIFDEF_DRIVERKIT */
int swprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, ...);
int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
#ifndef UNIFDEF_DRIVERKIT
wint_t ungetwc(wint_t, FILE *);
int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
__darwin_va_list);
#endif /* UNIFDEF_DRIVERKIT */
int vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict,
__darwin_va_list);
#ifndef UNIFDEF_DRIVERKIT
int vwprintf(const wchar_t * __restrict, __darwin_va_list);
#endif /* UNIFDEF_DRIVERKIT */
size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
wchar_t *wcschr(const wchar_t *, wchar_t);
int wcscmp(const wchar_t *, const wchar_t *);
int wcscoll(const wchar_t *, const wchar_t *);
wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
size_t wcscspn(const wchar_t *, const wchar_t *);
#ifndef UNIFDEF_DRIVERKIT
//Begin-Libc
#ifndef LIBC_ALIAS_WCSFTIME
//End-Libc
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
//Begin-Libc
#else /* LIBC_ALIAS_WCSFTIME */
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict) LIBC_ALIAS(wcsftime);
#endif /* !LIBC_ALIAS_WCSFTIME */
//End-Libc
#endif /* UNIFDEF_DRIVERKIT */
size_t wcslen(const wchar_t *);
wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
int wcsncmp(const wchar_t *, const wchar_t *, size_t);
wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
wchar_t *wcsrchr(const wchar_t *, wchar_t);
size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
mbstate_t * __restrict);
size_t wcsspn(const wchar_t *, const wchar_t *);
wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
int wctob(wint_t);
double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
wchar_t ** __restrict);
long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
unsigned long
wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
int wmemcmp(const wchar_t *, const wchar_t *, size_t);
wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
wchar_t *wmemset(wchar_t *, wchar_t, size_t);
#ifndef UNIFDEF_DRIVERKIT
int wprintf(const wchar_t * __restrict, ...);
int wscanf(const wchar_t * __restrict, ...);
#endif /* UNIFDEF_DRIVERKIT */
int wcswidth(const wchar_t *, size_t);
int wcwidth(wchar_t);
__END_DECLS
/* Additional functionality provided by:
* POSIX.1-2001
* ISO C99
*/
#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
__BEGIN_DECLS
#ifndef UNIFDEF_DRIVERKIT
int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
__darwin_va_list);
#endif /* UNIFDEF_DRIVERKIT */
int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
__darwin_va_list);
#ifndef UNIFDEF_DRIVERKIT
int vwscanf(const wchar_t * __restrict, __darwin_va_list);
#endif /* UNIFDEF_DRIVERKIT */
float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
long double
wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
#if !__DARWIN_NO_LONG_LONG
long long
wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
unsigned long long
wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
#endif /* !__DARWIN_NO_LONG_LONG */
__END_DECLS
#endif
/* Additional functionality provided by:
* POSIX.1-2008
*/
#if __DARWIN_C_LEVEL >= 200809L
__BEGIN_DECLS
size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
size_t, mbstate_t * __restrict);
wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
wchar_t *wcsdup(const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
int wcscasecmp(const wchar_t *, const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
size_t wcsnlen(const wchar_t *, size_t) __pure __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
size_t, mbstate_t * __restrict);
#ifndef UNIFDEF_DRIVERKIT
FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
#endif /* UNIFDEF_DRIVERKIT */
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200809L */
/* Darwin extensions */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
__BEGIN_DECLS
#ifndef UNIFDEF_DRIVERKIT
wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
#endif /* UNIFDEF_DRIVERKIT */
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
/* Poison the following routines if -fshort-wchar is set */
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf
#endif
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_wchar.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* !_WCHAR_H_ */

View File

@ -0,0 +1,143 @@
/*-
* Copyright (c)1999 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp
* $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $
* $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $
*/
#ifndef _WCTYPE_H_
#define _WCTYPE_H_
#include <sys/cdefs.h>
#include <_types.h>
#include <_types/_wctrans_t.h>
//Begin-Libc
/*
* _EXTERNALIZE_WCTYPE_INLINES_TOP_ is defined in locale/iswctype.c to tell us
* to generate code for extern versions of all top-level inline functions.
*/
#ifdef _EXTERNALIZE_WCTYPE_INLINES_TOP_
#define _USE_CTYPE_INLINE_
#define __DARWIN_WCTYPE_TOP_inline
#else /* !_EXTERNALIZE_WCTYPE_INLINES_TOP_ */
//End-Libc
#define __DARWIN_WCTYPE_TOP_inline __header_inline
//Begin-Libc
#endif /* _EXTERNALIZE_WCTYPE_INLINES_TOP_ */
//End-Libc
#include <_wctype.h>
#include <ctype.h>
/*
* Use inline functions if we are allowed to and the compiler supports them.
*/
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
__DARWIN_WCTYPE_TOP_inline int
iswblank(wint_t _wc)
{
return (__istype(_wc, _CTYPE_B));
}
#if !defined(_ANSI_SOURCE)
__DARWIN_WCTYPE_TOP_inline int
iswascii(wint_t _wc)
{
return ((_wc & ~0x7F) == 0);
}
__DARWIN_WCTYPE_TOP_inline int
iswhexnumber(wint_t _wc)
{
return (__istype(_wc, _CTYPE_X));
}
__DARWIN_WCTYPE_TOP_inline int
iswideogram(wint_t _wc)
{
return (__istype(_wc, _CTYPE_I));
}
__DARWIN_WCTYPE_TOP_inline int
iswnumber(wint_t _wc)
{
return (__istype(_wc, _CTYPE_D));
}
__DARWIN_WCTYPE_TOP_inline int
iswphonogram(wint_t _wc)
{
return (__istype(_wc, _CTYPE_Q));
}
__DARWIN_WCTYPE_TOP_inline int
iswrune(wint_t _wc)
{
return (__istype(_wc, 0xFFFFFFF0L));
}
__DARWIN_WCTYPE_TOP_inline int
iswspecial(wint_t _wc)
{
return (__istype(_wc, _CTYPE_T));
}
#endif /* !_ANSI_SOURCE */
#else /* not using inlines */
__BEGIN_DECLS
int iswblank(wint_t);
#if !defined(_ANSI_SOURCE)
wint_t iswascii(wint_t);
wint_t iswhexnumber(wint_t);
wint_t iswideogram(wint_t);
wint_t iswnumber(wint_t);
wint_t iswphonogram(wint_t);
wint_t iswrune(wint_t);
wint_t iswspecial(wint_t);
#endif
__END_DECLS
#endif /* using inlines */
__BEGIN_DECLS
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
wint_t nextwctype(wint_t, wctype_t);
#endif
wint_t towctrans(wint_t, wctrans_t);
wctrans_t
wctrans(const char *);
__END_DECLS
#ifdef _USE_EXTENDED_LOCALES_
#include <xlocale/_wctype.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* _WCTYPE_H_ */

View File

@ -0,0 +1,117 @@
/*
* Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _XLOCALE_H_
#define _XLOCALE_H_
#include <sys/cdefs.h>
#ifndef _USE_EXTENDED_LOCALES_
#define _USE_EXTENDED_LOCALES_
#endif /* _USE_EXTENDED_LOCALES_ */
#include <_locale.h>
#include <_xlocale.h>
#define LC_ALL_MASK ( LC_COLLATE_MASK \
| LC_CTYPE_MASK \
| LC_MESSAGES_MASK \
| LC_MONETARY_MASK \
| LC_NUMERIC_MASK \
| LC_TIME_MASK )
#define LC_COLLATE_MASK (1 << 0)
#define LC_CTYPE_MASK (1 << 1)
#define LC_MESSAGES_MASK (1 << 2)
#define LC_MONETARY_MASK (1 << 3)
#define LC_NUMERIC_MASK (1 << 4)
#define LC_TIME_MASK (1 << 5)
#define _LC_NUM_MASK 6
#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1))
#define LC_GLOBAL_LOCALE ((locale_t)-1)
#define LC_C_LOCALE ((locale_t)NULL)
#ifdef MB_CUR_MAX
#undef MB_CUR_MAX
#define MB_CUR_MAX (___mb_cur_max())
#ifndef MB_CUR_MAX_L
#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
#endif /* !MB_CUR_MAX_L */
#endif /* MB_CUR_MAX */
__BEGIN_DECLS
extern const locale_t _c_locale;
locale_t duplocale(locale_t);
int freelocale(locale_t);
struct lconv * localeconv_l(locale_t);
locale_t newlocale(int, __const char *, locale_t);
__const char * querylocale(int, locale_t);
locale_t uselocale(locale_t);
__END_DECLS
//Begin-Libc
#ifndef __DARWIN_XLOCALE_PRIVATE
//End-Libc
#ifdef _CTYPE_H_
#include <xlocale/_ctype.h>
#endif /* _CTYPE_H_ */
#ifdef __WCTYPE_H_
#include <xlocale/__wctype.h>
#endif /* __WCTYPE_H_ */
#ifdef _INTTYPES_H_
#include <xlocale/_inttypes.h>
#endif /* _INTTYPES_H_ */
#ifdef _LANGINFO_H_
#include <xlocale/_langinfo.h>
#endif /* _LANGINFO_H_ */
#ifdef _MONETARY_H_
#include <xlocale/_monetary.h>
#endif /* _MONETARY_H_ */
#ifdef _REGEX_H_
#include <xlocale/_regex.h>
#endif /* _REGEX_H_ */
#ifdef _STDIO_H_
#include <xlocale/_stdio.h>
#endif /* _STDIO_H_ */
#ifdef _STDLIB_H_
#include <xlocale/_stdlib.h>
#endif /* _STDLIB_H_ */
#ifdef _STRING_H_
#include <xlocale/_string.h>
#endif /*STRING_CTYPE_H_ */
#ifdef _TIME_H_
#include <xlocale/_time.h>
#endif /* _TIME_H_ */
#ifdef _WCHAR_H_
#include <xlocale/_wchar.h>
#endif /*WCHAR_CTYPE_H_ */
#ifdef _WCTYPE_H_
#include <xlocale/_wctype.h>
#endif /* _WCTYPE_H_ */
//Begin-Libc
#endif /* __DARWIN_XLOCALE_PRIVATE */
//End-Libc
#endif /* _XLOCALE_H_ */

View File

@ -0,0 +1,255 @@
/*
* Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _XLOCALE__CTYPE_H_
#define _XLOCALE__CTYPE_H_
#include <_ctype.h>
#include <_xlocale.h>
/*
* Use inline functions if we are allowed to and the compiler supports them.
*/
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
/* See comments in <machine/_type.h> about __darwin_ct_rune_t. */
__BEGIN_DECLS
unsigned long ___runetype_l(__darwin_ct_rune_t, locale_t);
__darwin_ct_rune_t ___tolower_l(__darwin_ct_rune_t, locale_t);
__darwin_ct_rune_t ___toupper_l(__darwin_ct_rune_t, locale_t);
__END_DECLS
//Begin-Libc
#ifdef __LIBC__
__DARWIN_CTYPE_inline int
__maskrune_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l)
{
/* _CurrentRuneLocale.__runetype is __uint32_t
* _f is unsigned long
* ___runetype_l(_c, _l) is unsigned long
* retval is int
*/
return (int)((_c < 0 || _c >= _CACHED_RUNES) ? (__uint32_t)___runetype_l(_c, _l) :
__locale_ptr(_l)->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & (__uint32_t)_f;
}
#else /* !__LIBC__ */
//End-Libc
__BEGIN_DECLS
int __maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t);
__END_DECLS
//Begin-Libc
#endif /* __LIBC__ */
//End-Libc
__DARWIN_CTYPE_inline int
__istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l)
{
return !!(isascii(_c) ? (_DefaultRuneLocale.__runetype[_c] & _f)
: __maskrune_l(_c, _f, _l));
}
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__toupper_l(__darwin_ct_rune_t _c, locale_t _l)
{
return isascii(_c) ? _DefaultRuneLocale.__mapupper[_c]
: ___toupper_l(_c, _l);
}
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__tolower_l(__darwin_ct_rune_t _c, locale_t _l)
{
return isascii(_c) ? _DefaultRuneLocale.__maplower[_c]
: ___tolower_l(_c, _l);
}
__DARWIN_CTYPE_inline int
__wcwidth_l(__darwin_ct_rune_t _c, locale_t _l)
{
unsigned int _x;
if (_c == 0)
return (0);
_x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, _l);
if ((_x & _CTYPE_SWM) != 0)
return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
return ((_x & _CTYPE_R) != 0 ? 1 : -1);
}
#ifndef _EXTERNALIZE_CTYPE_INLINES_
__DARWIN_CTYPE_TOP_inline int
digittoint_l(int c, locale_t l)
{
return (__maskrune_l(c, 0x0F, l));
}
__DARWIN_CTYPE_TOP_inline int
isalnum_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_A|_CTYPE_D, l));
}
__DARWIN_CTYPE_TOP_inline int
isalpha_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_A, l));
}
__DARWIN_CTYPE_TOP_inline int
isblank_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_B, l));
}
__DARWIN_CTYPE_TOP_inline int
iscntrl_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_C, l));
}
__DARWIN_CTYPE_TOP_inline int
isdigit_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_D, l));
}
__DARWIN_CTYPE_TOP_inline int
isgraph_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_G, l));
}
__DARWIN_CTYPE_TOP_inline int
ishexnumber_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_X, l));
}
__DARWIN_CTYPE_TOP_inline int
isideogram_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_I, l));
}
__DARWIN_CTYPE_TOP_inline int
islower_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_L, l));
}
__DARWIN_CTYPE_TOP_inline int
isnumber_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_D, l));
}
__DARWIN_CTYPE_TOP_inline int
isphonogram_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_Q, l));
}
__DARWIN_CTYPE_TOP_inline int
isprint_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_R, l));
}
__DARWIN_CTYPE_TOP_inline int
ispunct_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_P, l));
}
__DARWIN_CTYPE_TOP_inline int
isrune_l(int c, locale_t l)
{
return (__istype_l(c, 0xFFFFFFF0L, l));
}
__DARWIN_CTYPE_TOP_inline int
isspace_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_S, l));
}
__DARWIN_CTYPE_TOP_inline int
isspecial_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_T, l));
}
__DARWIN_CTYPE_TOP_inline int
isupper_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_U, l));
}
__DARWIN_CTYPE_TOP_inline int
isxdigit_l(int c, locale_t l)
{
return (__istype_l(c, _CTYPE_X, l));
}
__DARWIN_CTYPE_TOP_inline int
tolower_l(int c, locale_t l)
{
return (__tolower_l(c, l));
}
__DARWIN_CTYPE_TOP_inline int
toupper_l(int c, locale_t l)
{
return (__toupper_l(c, l));
}
#endif /* _EXTERNALIZE_CTYPE_INLINES_ */
#else /* not using inlines */
__BEGIN_DECLS
int digittoint_l(int, locale_t);
int isalnum_l(int, locale_t);
int isalpha_l(int, locale_t);
int isblank_l(int, locale_t);
int iscntrl_l(int, locale_t);
int isdigit_l(int, locale_t);
int isgraph_l(int, locale_t);
int ishexnumber_l(int, locale_t);
int isideogram_l(int, locale_t);
int islower_l(int, locale_t);
int isnumber_l(int, locale_t);
int isphonogram_l(int, locale_t);
int isprint_l(int, locale_t);
int ispunct_l(int, locale_t);
int isrune_l(int, locale_t);
int isspace_l(int, locale_t);
int isspecial_l(int, locale_t);
int isupper_l(int, locale_t);
int isxdigit_l(int, locale_t);
int tolower_l(int, locale_t);
int toupper_l(int, locale_t);
__END_DECLS
#endif /* using inlines */
#endif /* _XLOCALE__CTYPE_H_ */

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _XLOCALE__TIME_H_
#define _XLOCALE__TIME_H_
#include <sys/cdefs.h>
#include <sys/_types/_size_t.h>
#include <_types.h>
#include <_xlocale.h>
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_STRFTIME_L
//End-Libc
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t)
__DARWIN_ALIAS(strftime_l) __strftimelike(3);
//Begin-Libc
#else /* LIBC_ALIAS_STRFTIME_L */
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t)
LIBC_ALIAS(strftime_l) __strftimelike(3);
#endif /* !LIBC_ALIAS_STRFTIME_L */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_STRPTIME_L
//End-Libc
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t)
__DARWIN_ALIAS(strptime_l) __strftimelike(2);
//Begin-Libc
#else /* LIBC_ALIAS_STRPTIME_L */
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t)
LIBC_ALIAS(strptime_l) __strftimelike(2);
#endif /* !LIBC_ALIAS_STRPTIME_L */
//End-Libc
__END_DECLS
#endif /* _XLOCALE__TIME_H_ */

View File

@ -0,0 +1,157 @@
/*
* Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _XLOCALE__WCHAR_H_
#define _XLOCALE__WCHAR_H_
#include <_stdio.h>
#include <_xlocale.h>
#include <sys/_types/_mbstate_t.h>
#include <sys/_types/_wint_t.h>
#include <stddef.h> /* wchar_t */
/* Initially added in Issue 4 */
__BEGIN_DECLS
wint_t btowc_l(int, locale_t);
wint_t fgetwc_l(FILE *, locale_t);
wchar_t *fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t);
wint_t fputwc_l(wchar_t, FILE *, locale_t);
int fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t);
int fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...);
int fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...);
wint_t getwc_l(FILE *, locale_t);
wint_t getwchar_l(locale_t);
size_t mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict,
locale_t);
size_t mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t,
mbstate_t * __restrict, locale_t);
int mbsinit_l(const mbstate_t *, locale_t);
size_t mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t,
mbstate_t * __restrict, locale_t);
wint_t putwc_l(wchar_t, FILE *, locale_t);
wint_t putwchar_l(wchar_t, locale_t);
int swprintf_l(wchar_t * __restrict, size_t n, locale_t,
const wchar_t * __restrict, ...);
int swscanf_l(const wchar_t * __restrict, locale_t,
const wchar_t * __restrict, ...);
wint_t ungetwc_l(wint_t, FILE *, locale_t);
int vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict,
__darwin_va_list);
int vswprintf_l(wchar_t * __restrict, size_t n, locale_t,
const wchar_t * __restrict, __darwin_va_list);
int vwprintf_l(locale_t, const wchar_t * __restrict, __darwin_va_list);
size_t wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict,
locale_t);
int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
//Begin-Libc
#ifndef LIBC_ALIAS_WCSFTIME_L
//End-Libc
size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict, locale_t)
__DARWIN_ALIAS(wcsftime_l);
//Begin-Libc
#else /* LIBC_ALIAS_WCSFTIME_L */
size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict, locale_t)
LIBC_ALIAS(wcsftime_l);
#endif /* !LIBC_ALIAS_WCSFTIME_L */
//End-Libc
size_t wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t,
mbstate_t * __restrict, locale_t);
double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
long wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
locale_t);
unsigned long
wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
locale_t);
int wcswidth_l(const wchar_t *, size_t, locale_t);
size_t wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t,
locale_t);
int wctob_l(wint_t, locale_t);
int wcwidth_l(wchar_t, locale_t);
int wprintf_l(locale_t, const wchar_t * __restrict, ...);
int wscanf_l(locale_t, const wchar_t * __restrict, ...);
__END_DECLS
/* Additional functionality provided by:
* POSIX.1-2001
*/
#if __DARWIN_C_LEVEL >= 200112L
__BEGIN_DECLS
int vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict,
__darwin_va_list);
int vswscanf_l(const wchar_t * __restrict, locale_t,
const wchar_t * __restrict, __darwin_va_list);
int vwscanf_l(locale_t, const wchar_t * __restrict, __darwin_va_list);
float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
long double
wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
#if !__DARWIN_NO_LONG_LONG
long long
wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
locale_t);
unsigned long long
wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
locale_t);
#endif /* !__DARWIN_NO_LONG_LONG */
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L */
/* Additional functionality provided by:
* POSIX.1-2008
*/
#if __DARWIN_C_LEVEL >= 200809L
__BEGIN_DECLS
size_t mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t,
size_t, mbstate_t * __restrict, locale_t);
int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
size_t wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t,
size_t, mbstate_t * __restrict, locale_t);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200809L */
/* Darwin extensions */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
__BEGIN_DECLS
wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
/* Poison the following routines if -fshort-wchar is set */
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
#pragma GCC poison fgetwln_l fgetws_l fputwc_l fputws_l fwprintf_l fwscanf_l mbrtowc_l mbsnrtowcs_l mbsrtowcs_l putwc_l putwchar_l swprintf_l swscanf_l vfwprintf_l vfwscanf_l vswprintf_l vswscanf_l vwprintf_l vwscanf_l wcrtomb_l wcscoll_l wcsftime_l wcsftime_l wcsnrtombs_l wcsrtombs_l wcstod_l wcstof_l wcstol_l wcstold_l wcstoll_l wcstoul_l wcstoull_l wcswidth_l wcsxfrm_l wcwidth_l wprintf_l wscanf_l
#endif
#endif /* _XLOCALE__WCHAR_H_ */

View File

@ -63,9 +63,6 @@
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
*/
//Begin-Libc
#include "xlocale_private.h"
//End-Libc
#ifndef __CTYPE_H_
#define __CTYPE_H_
@ -117,35 +114,9 @@
#define _SW3 _CTYPE_SW3 /* 3 width character */
#endif /* _NONSTD_SOURCE */
//Begin-Libc
/*
* _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us
* to generate code for extern versions of all intermediate inline functions.
*/
#ifdef _EXTERNALIZE_CTYPE_INLINES_
#define _USE_CTYPE_INLINE_
#define __DARWIN_CTYPE_inline
#else /* !_EXTERNALIZE_CTYPE_INLINES_ */
//End-Libc
#define __DARWIN_CTYPE_inline __header_inline
//Begin-Libc
#endif /* !_EXTERNALIZE_CTYPE_INLINES_ */
//End-Libc
//Begin-Libc
/*
* _EXTERNALIZE_CTYPE_INLINES_TOP_ is defined in locale/isctype.c to tell us
* to generate code for extern versions of all top-level inline functions.
*/
#ifdef _EXTERNALIZE_CTYPE_INLINES_TOP_
#define _USE_CTYPE_INLINE_
#define __DARWIN_CTYPE_TOP_inline
#else /* !_EXTERNALIZE_CTYPE_INLINES_TOP_ */
//End-Libc
#define __DARWIN_CTYPE_TOP_inline __header_inline
//Begin-Libc
#endif /* _EXTERNALIZE_CTYPE_INLINES_TOP_ */
//End-Libc
/*
* Use inline functions if we are allowed to and the compiler supports them.
@ -172,20 +143,6 @@ __maskrune(__darwin_ct_rune_t _c, unsigned long _f)
{
return (int)_DefaultRuneLocale.__runetype[_c & 0xff] & (__uint32_t)_f;
}
//Begin-Libc
#elif defined(__LIBC__)
__DARWIN_CTYPE_inline int
__maskrune(__darwin_ct_rune_t _c, unsigned long _f)
{
/* _CurrentRuneLocale.__runetype[_c] is __uint32_t
* _f is unsigned long
* ___runetype(_c) is unsigned long
* retval is int
*/
return (int)((_c < 0 || _c >= _CACHED_RUNES) ? (__uint32_t)___runetype(_c) :
__current_locale()->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & (__uint32_t)_f;
}
//End-Libc
#else /* !USE_ASCII */
__BEGIN_DECLS
int __maskrune(__darwin_ct_rune_t, unsigned long);
@ -226,28 +183,6 @@ __tolower(__darwin_ct_rune_t _c)
{
return _DefaultRuneLocale.__maplower[_c & 0xff];
}
//Begin-Libc
#elif defined(__LIBC__)
/*
* We can't do what we do for __toupper_l() (check for ASCII first, then call
* ___toupper_l() otherwise) because versions of ___toupper() before Tiger
* assume c >= _CACHED_RUNES. So we are stuck making __toupper() a routine
* to hide the extended locale details, outside of Libc.
*/
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__toupper(__darwin_ct_rune_t _c)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
__current_locale()->__lc_ctype->_CurrentRuneLocale.__mapupper[_c];
}
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__tolower(__darwin_ct_rune_t _c)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
__current_locale()->__lc_ctype->_CurrentRuneLocale.__maplower[_c];
}
//End-Libc
#else /* !USE_ASCII */
__BEGIN_DECLS
__darwin_ct_rune_t __toupper(__darwin_ct_rune_t);

View File

@ -102,58 +102,18 @@ typedef struct {
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_CLOSEDIR
//End-Libc
int closedir(DIR *) __DARWIN_ALIAS(closedir);
//Begin-Libc
#else /* LIBC_ALIAS_CLOSEDIR */
int closedir(DIR *) LIBC_ALIAS(closedir);
#endif /* !LIBC_ALIAS_CLOSEDIR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_OPENDIR
//End-Libc
DIR *opendir(const char *) __DARWIN_ALIAS_I(opendir);
//Begin-Libc
#else /* LIBC_ALIAS_OPENDIR */
DIR *opendir(const char *) LIBC_ALIAS_I(opendir);
#endif /* !LIBC_ALIAS_OPENDIR */
//End-Libc
struct dirent *readdir(DIR *) __DARWIN_INODE64(readdir);
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
//Begin-Libc
#ifndef LIBC_ALIAS_REWINDDIR
//End-Libc
void rewinddir(DIR *) __DARWIN_ALIAS_I(rewinddir);
//Begin-Libc
#else /* LIBC_ALIAS_REWINDDIR */
void rewinddir(DIR *) LIBC_ALIAS_I(rewinddir);
#endif /* !LIBC_ALIAS_REWINDDIR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SEEKDIR
//End-Libc
void seekdir(DIR *, long) __DARWIN_ALIAS_I(seekdir);
//Begin-Libc
#else /* LIBC_ALIAS_SEEKDIR */
void seekdir(DIR *, long) LIBC_ALIAS_I(seekdir);
#endif /* !LIBC_ALIAS_SEEKDIR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_TELLDIR
//End-Libc
long telldir(DIR *) __DARWIN_ALIAS_I(telldir);
//Begin-Libc
#else /* LIBC_ALIAS_TELLDIR */
long telldir(DIR *) LIBC_ALIAS_I(telldir);
#endif /* !LIBC_ALIAS_TELLDIR */
//End-Libc
__END_DECLS
@ -165,16 +125,8 @@ __END_DECLS
#if __DARWIN_C_LEVEL >= 200809L
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_OPENDIR
//End-Libc
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
DIR *fdopendir(int) __DARWIN_ALIAS_I(fdopendir);
//Begin-Libc
#else /* LIBC_ALIAS_OPENDIR */
DIR *fdopendir(int) LIBC_ALIAS_I(fdopendir);
#endif /* !LIBC_ALIAS_OPENDIR */
//End-Libc
int alphasort(const struct dirent **, const struct dirent **) __DARWIN_INODE64(alphasort);
@ -218,9 +170,6 @@ __BEGIN_DECLS
int getdirentries(int, char *, int, long *)
//Begin-Libc
#ifndef __LIBC__
//End-Libc
#if __DARWIN_64_BIT_INO_T
/*
* getdirentries() doesn't work when 64-bit inodes is in effect, so we
@ -230,20 +179,9 @@ int getdirentries(int, char *, int, long *)
#else /* !__DARWIN_64_BIT_INO_T */
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_6, __IPHONE_2_0,__IPHONE_2_0)
#endif /* __DARWIN_64_BIT_INO_T */
//Begin-Libc
#endif /* !__LIBC__ */
//End-Libc
;
//Begin-Libc
#ifndef LIBC_ALIAS___OPENDIR2
//End-Libc
DIR *__opendir2(const char *, int) __DARWIN_ALIAS_I(__opendir2);
//Begin-Libc
#else /* LIBC_ALIAS___OPENDIR2 */
DIR *__opendir2(const char *, int) LIBC_ALIAS_I(__opendir2);
#endif /* !LIBC_ALIAS___OPENDIR2 */
//End-Libc
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */

View File

@ -76,15 +76,7 @@
#endif
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_FNMATCH
//End-Libc
int fnmatch(const char *, const char *, int) __DARWIN_ALIAS(fnmatch);
//Begin-Libc
#else /* LIBC_ALIAS_FNMATCH */
int fnmatch(const char *, const char *, int) LIBC_ALIAS(fnmatch);
#endif /* !LIBC_ALIAS_FNMATCH */
//End-Libc
__END_DECLS
#endif /* !_FNMATCH_H_ */

View File

@ -168,73 +168,22 @@ typedef struct _ftsent {
#include <Availability.h>
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_CHILDREN
//End-Libc
FTSENT *fts_children(FTS *, int) __DARWIN_INODE64(fts_children);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_CHILDREN */
FTSENT *fts_children(FTS *, int) LIBC_INODE64(fts_children);
#endif /* !LIBC_ALIAS_FTS_CHILDREN */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_CLOSE
//End-Libc
int fts_close(FTS *) __DARWIN_INODE64(fts_close);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_CLOSE */
int fts_close(FTS *) LIBC_INODE64(fts_close);
#endif /* !LIBC_ALIAS_FTS_CLOSE */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_OPEN
//End-Libc
FTS *fts_open(char * const *, int,
int (*)(const FTSENT **, const FTSENT **)) __DARWIN_INODE64(fts_open);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_OPEN */
FTS *fts_open(char * const *, int,
int (*)(const FTSENT **, const FTSENT **)) LIBC_INODE64(fts_open);
#endif /* !LIBC_ALIAS_FTS_OPEN */
//End-Libc
#ifdef __BLOCKS__
#if __has_attribute(noescape)
#define __fts_noescape __attribute__((__noescape__))
#else
#define __fts_noescape
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_OPEN_B
//End-Libc
FTS *fts_open_b(char * const *, int,
int (^)(const FTSENT **, const FTSENT **) __fts_noescape)
__DARWIN_INODE64(fts_open_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_OPEN */
FTS *fts_open_b(char * const *, int,
int (^)(const FTSENT **, const FTSENT **) __fts_noescape)
LIBC_INODE64(fts_open_b);
#endif /* !LIBC_ALIAS_FTS_OPEN */
//End-Libc
#endif /* __BLOCKS__ */
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_READ
//End-Libc
FTSENT *fts_read(FTS *) __DARWIN_INODE64(fts_read);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_READ */
FTSENT *fts_read(FTS *) LIBC_INODE64(fts_read);
#endif /* !LIBC_ALIAS_FTS_READ */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_FTS_SET
//End-Libc
int fts_set(FTS *, FTSENT *, int) __DARWIN_INODE64(fts_set);
//Begin-Libc
#else /* LIBC_ALIAS_FTS_SET */
int fts_set(FTS *, FTSENT *, int) LIBC_INODE64(fts_set);
#endif /* !LIBC_ALIAS_FTS_SET */
//End-Libc
__END_DECLS
#pragma clang diagnostic pop

View File

@ -51,28 +51,10 @@ struct FTW {
};
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_FTW
//End-Libc
int ftw(const char *, int (*)(const char *, const struct stat *, int), int)
__DARWIN_ALIAS_I(ftw);
//Begin-Libc
#else /* LIBC_ALIAS_FTW */
int ftw(const char *, int (*)(const char *, const struct stat *, int), int)
LIBC_ALIAS_I(ftw);
#endif /* !LIBC_ALIAS_FTW */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_NFTW
//End-Libc
int nftw(const char *, int (*)(const char *, const struct stat *, int,
struct FTW *), int, int) __DARWIN_ALIAS_I(nftw);
//Begin-Libc
#else /* LIBC_ALIAS_NFTW */
int nftw(const char *, int (*)(const char *, const struct stat *, int,
struct FTW *), int, int) LIBC_ALIAS_I(nftw);
#endif /* !LIBC_ALIAS_NFTW */
//End-Libc
__END_DECLS
#endif /* !_FTW_H */

View File

@ -113,34 +113,16 @@ typedef struct {
#define GLOB_ABEND GLOB_ABORTED
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_GLOB
//End-Libc
int glob(const char * __restrict, int, int (*)(const char *, int),
glob_t * __restrict) __DARWIN_INODE64(glob);
//Begin-Libc
#else /* LIBC_ALIAS_GLOB */
int glob(const char * __restrict, int, int (*)(const char *, int),
glob_t * __restrict) LIBC_INODE64(glob);
#endif /* !LIBC_ALIAS_GLOB */
//End-Libc
#ifdef __BLOCKS__
#if __has_attribute(noescape)
#define __glob_noescape __attribute__((__noescape__))
#else
#define __glob_noescape
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_GLOB_B
//End-Libc
int glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape,
glob_t * __restrict) __DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
//Begin-Libc
#else /* LIBC_ALIAS_GLOB_B */
int glob_b(const char * __restrict, int, int (^)(const char *, int) __glob_noescape,
glob_t * __restrict) LIBC_INODE64(glob_b);
#endif /* !LIBC_ALIAS_GLOB_B */
//End-Libc
#endif /* __BLOCKS__ */
void globfree(glob_t *);
__END_DECLS

View File

@ -178,15 +178,7 @@
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_REGCOMP
//End-Libc
int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp);
//Begin-Libc
#else /* LIBC_ALIAS_REGCOMP */
int regcomp(regex_t * __restrict, const char * __restrict, int) LIBC_ALIAS(regcomp);
#endif /* !LIBC_ALIAS_REGCOMP */
//End-Libc
size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold;
/*
* gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround,

View File

@ -77,46 +77,14 @@ __END_DECLS
#ifndef _ANSI_SOURCE
__BEGIN_DECLS
void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int);
//Begin-Libc
#ifndef LIBC_ALIAS_KILL
//End-Libc
int kill(pid_t, int) __DARWIN_ALIAS(kill);
//Begin-Libc
#else /* LIBC_ALIAS_KILL */
int kill(pid_t, int) LIBC_ALIAS(kill);
#endif /* !LIBC_ALIAS_KILL */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_KILLPG
//End-Libc
int killpg(pid_t, int) __DARWIN_ALIAS(killpg);
//Begin-Libc
#else /* LIBC_ALIAS_KILLPG */
int killpg(pid_t, int) LIBC_ALIAS(killpg);
#endif /* !LIBC_ALIAS_KILLPG */
//End-Libc
int pthread_kill(pthread_t, int);
//Begin-Libc
#ifndef LIBC_ALIAS_PTHREAD_SIGMASK
//End-Libc
int pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask);
//Begin-Libc
#else /* LIBC_ALIAS_PTHREAD_SIGMASK */
int pthread_sigmask(int, const sigset_t *, sigset_t *) LIBC_ALIAS(pthread_sigmask);
#endif /* !LIBC_ALIAS_PTHREAD_SIGMASK */
//End-Libc
int sigaction(int, const struct sigaction * __restrict,
struct sigaction * __restrict);
int sigaddset(sigset_t *, int);
//Begin-Libc
#ifndef LIBC_ALIAS_SIGALTSTACK
//End-Libc
int sigaltstack(const stack_t * __restrict, stack_t * __restrict) __DARWIN_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
//Begin-Libc
#else /* LIBC_ALIAS_SIGALTSTACK */
int sigaltstack(const stack_t * __restrict, stack_t * __restrict) LIBC_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
#endif /* !LIBC_ALIAS_SIGALTSTACK */
//End-Libc
int sigdelset(sigset_t *, int);
int sigemptyset(sigset_t *);
int sigfillset(sigset_t *);
@ -124,37 +92,13 @@ int sighold(int);
int sigignore(int);
int siginterrupt(int, int);
int sigismember(const sigset_t *, int);
//Begin-Libc
#ifndef LIBC_ALIAS_SIGPAUSE
//End-Libc
int sigpause(int) __DARWIN_ALIAS_C(sigpause);
//Begin-Libc
#else /* LIBC_ALIAS_SIGPAUSE */
int sigpause(int) LIBC_ALIAS_C(sigpause);
#endif /* !LIBC_ALIAS_SIGPAUSE */
//End-Libc
int sigpending(sigset_t *);
int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
int sigrelse(int);
void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
//Begin-Libc
#ifndef LIBC_ALIAS_SIGSUSPEND
//End-Libc
int sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend);
//Begin-Libc
#else /* LIBC_ALIAS_SIGSUSPEND */
int sigsuspend(const sigset_t *) LIBC_ALIAS_C(sigsuspend);
#endif /* !LIBC_ALIAS_SIGSUSPEND */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SIGWAIT
//End-Libc
int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait);
//Begin-Libc
#else /* LIBC_ALIAS_SIGWAIT */
int sigwait(const sigset_t * __restrict, int * __restrict) LIBC_ALIAS_C(sigwait);
#endif /* !LIBC_ALIAS_SIGWAIT */
//End-Libc
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
void psignal(unsigned int, const char *);
int sigblock(int);

View File

@ -151,52 +151,19 @@ 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 */
//Begin-Libc
#ifndef LIBC_ALIAS_FOPEN
//End-Libc
FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen));
//Begin-Libc
#else /* LIBC_ALIAS_FOPEN */
FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) LIBC_ALIAS(fopen);
#endif /* !LIBC_ALIAS_FOPEN */
//End-Libc
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
int fputc(int, FILE *);
//Begin-Libc
#ifndef LIBC_ALIAS_FPUTS
//End-Libc
int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
//Begin-Libc
#else /* LIBC_ALIAS_FPUTS */
int fputs(const char * __restrict, FILE * __restrict) LIBC_ALIAS(fputs);
#endif /* !LIBC_ALIAS_FPUTS */
//End-Libc
size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
//Begin-Libc
#ifndef LIBC_ALIAS_FREOPEN
//End-Libc
FILE *freopen(const char * __restrict, const char * __restrict,
FILE * __restrict) __DARWIN_ALIAS(freopen);
//Begin-Libc
#else /* LIBC_ALIAS_FREOPEN */
FILE *freopen(const char * __restrict, const char * __restrict,
FILE * __restrict) LIBC_ALIAS(freopen);
#endif /* !LIBC_ALIAS_FREOPEN */
//End-Libc
int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
//Begin-Libc
#ifndef LIBC_ALIAS_FWRITE
//End-Libc
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 __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) LIBC_ALIAS(fwrite);
#endif /* !LIBC_ALIAS_FWRITE */
//End-Libc
int getc(FILE *);
int getchar(void);
char *gets(char *);
@ -241,15 +208,7 @@ __BEGIN_DECLS
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
//Begin-Libc
#ifndef LIBC_ALIAS_FDOPEN
//End-Libc
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
//Begin-Libc
#else /* LIBC_ALIAS_FDOPEN */
FILE *fdopen(int, const char *) LIBC_ALIAS(fdopen);
#endif /* !LIBC_ALIAS_FDOPEN */
//End-Libc
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
int fileno(FILE *);
__END_DECLS
@ -271,15 +230,7 @@ int pclose(FILE *) __swift_unavailable_on("Use posix_spawn APIs or NSTask inste
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
//Begin-Libc
#ifndef LIBC_ALIAS_POPEN
//End-Libc
FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
//Begin-Libc
#else /* LIBC_ALIAS_POPEN */
FILE *popen(const char *, const char *) LIBC_ALIAS(popen);
#endif /* !LIBC_ALIAS_POPEN */
//End-Libc
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199209L */
@ -351,15 +302,7 @@ __swift_unavailable("Use mkstemp(3) instead.")
#if !defined(_POSIX_C_SOURCE)
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.")
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_TEMPNAM
//End-Libc
char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
//Begin-Libc
#else /* LIBC_ALIAS_TEMPNAM */
char *tempnam(const char *__dir, const char *__prefix) LIBC_ALIAS(tempnam);
#endif /* !LIBC_ALIAS_TEMPNAM */
//End-Libc
__END_DECLS
#ifndef lint

View File

@ -128,11 +128,6 @@ extern int __mb_cur_max;
&& defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L)
#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
#endif
//Begin-Libc
#include "libc_private.h"
/* f must be a literal string */
#define LIBC_ABORT(f,...) abort_report_np("%s:%s:%u: " f, __FILE__, __func__, __LINE__, ## __VA_ARGS__)
//End-Libc
#ifndef UNIFDEF_DRIVERKIT
#include <malloc/_malloc.h>
@ -201,9 +196,6 @@ unsigned long long
strtoull(const char *__str, char **__endptr, int __base);
#endif /* !__DARWIN_NO_LONG_LONG */
#ifndef UNIFDEF_DRIVERKIT
//Begin-Libc
#ifndef LIBC_ALIAS_SYSTEM
//End-Libc
#if TARGET_OS_IPHONE
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
@ -215,11 +207,6 @@ __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawn
__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
int system(const char *) __DARWIN_ALIAS_C(system);
//Begin-Libc
#else /* LIBC_ALIAS_SYSTEM */
int system(const char *) LIBC_ALIAS_C(system);
#endif /* !LIBC_ALIAS_SYSTEM */
//End-Libc
#undef __swift_unavailable_on
#endif /* UNIFDEF_DRIVERKIT */
@ -258,59 +245,19 @@ char *ptsname(int);
int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_PUTENV
//End-Libc
int putenv(char *) __DARWIN_ALIAS(putenv);
//Begin-Libc
#else /* LIBC_ALIAS_PUTENV */
int putenv(char *) LIBC_ALIAS(putenv);
#endif /* !LIBC_ALIAS_PUTENV */
//End-Libc
long random(void) __swift_unavailable("Use arc4random instead.");
int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
//Begin-Libc
#ifdef __LIBC__
#ifndef LIBC_ALIAS_REALPATH
char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
#else /* LIBC_ALIAS_REALPATH */
#ifdef VARIANT_DARWINEXTSN
char *realpath(const char * __restrict, char * __restrict) LIBC_EXTSN(realpath);
#else /* !VARIANT_DARWINEXTSN */
char *realpath(const char * __restrict, char * __restrict) LIBC_ALIAS(realpath);
#endif /* VARIANT_DARWINEXTSN */
#endif /* !LIBC_ALIAS_REALPATH */
#else /* !__LIBC__ */
//End-Libc
#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
//Begin-Libc
#endif /* __LIBC__ */
//End-Libc
unsigned short
*seed48(unsigned short[3]);
//Begin-Libc
#ifndef LIBC_ALIAS_SETENV
//End-Libc
int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
//Begin-Libc
#else /* LIBC_ALIAS_SETENV */
int setenv(const char * __name, const char * __value, int __overwrite) LIBC_ALIAS(setenv);
#endif /* !LIBC_ALIAS_SETENV */
//End-Libc
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_SETKEY
//End-Libc
void setkey(const char *) __DARWIN_ALIAS(setkey);
//Begin-Libc
#else /* LIBC_ALIAS_SETKEY */
void setkey(const char *) LIBC_ALIAS(setkey);
#endif /* !LIBC_ALIAS_SETKEY */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int setkey(const char *);
#endif /* __DARWIN_UNIX03 */
@ -323,15 +270,7 @@ void srandom(unsigned long);
#endif /* __DARWIN_UNIX03 */
int unlockpt(int);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_UNSETENV
//End-Libc
int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
//Begin-Libc
#else /* LIBC_ALIAS_UNSETENV */
int unsetenv(const char *) LIBC_ALIAS(unsetenv);
#endif /* !LIBC_ALIAS_UNSETENV */
//End-Libc
#else /* !__DARWIN_UNIX03 */
void unsetenv(const char *);
#endif /* __DARWIN_UNIX03 */

View File

@ -82,15 +82,7 @@ int strcoll(const char *__s1, const char *__s2);
char *strcpy(char *__dst, const char *__src);
#endif /* UNIFDEF_DRIVERKIT */
size_t strcspn(const char *__s, const char *__charset);
//Begin-Libc
#ifndef LIBC_ALIAS_STRERROR
//End-Libc
char *strerror(int __errnum) __DARWIN_ALIAS(strerror);
//Begin-Libc
#else /* LIBC_ALIAS_STRERROR */
char *strerror(int __errnum) LIBC_ALIAS(strerror);
#endif /* !LIBC_ALIAS_STRERROR */
//End-Libc
size_t strlen(const char *__s);
char *strncat(char *__s1, const char *__s2, size_t __n);
int strncmp(const char *__s1, const char *__s2, size_t __n);

View File

@ -85,17 +85,8 @@ typedef struct {
void *rbto_context;
} rb_tree_ops_t;
//Begin-Libc
#ifdef _RBTREE_NO_OPAQUE_STRUCTS_
typedef struct rb_node rb_node_t;
typedef struct rb_tree rb_tree_t;
#else
//End-Libc
typedef struct rb_node { void * opaque[3]; } rb_node_t;
typedef struct rb_tree { void *opaque[8]; } rb_tree_t;
//Begin-Libc
#endif
//End-Libc
#define _rb_availability __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0);
void rb_tree_init(rb_tree_t *, const rb_tree_ops_t *) _rb_availability;

View File

@ -101,15 +101,7 @@ extern char *tzname[];
extern int getdate_err;
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_TIMEZONE
//End-Libc
extern long timezone __DARWIN_ALIAS(timezone);
//Begin-Libc
#else /* LIBC_ALIAS_TIMEZONE */
extern long timezone LIBC_ALIAS(timezone);
#endif /* !LIBC_ALIAS_TIMEZONE */
//End-Libc
#endif /* __DARWIN_UNIX03 */
extern int daylight;
#endif /* UNIFDEF_DRIVERKIT */
@ -117,47 +109,15 @@ extern int daylight;
__BEGIN_DECLS
#ifndef UNIFDEF_DRIVERKIT
char *asctime(const struct tm *);
//Begin-Libc
#ifndef LIBC_ALIAS_CLOCK
//End-Libc
clock_t clock(void) __DARWIN_ALIAS(clock);
//Begin-Libc
#else /* LIBC_ALIAS_CLOCK */
clock_t clock(void) LIBC_ALIAS(clock);
#endif /* !LIBC_ALIAS_CLOCK */
//End-Libc
char *ctime(const time_t *);
double difftime(time_t, time_t);
struct tm *getdate(const char *);
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
//Begin-Libc
#ifndef LIBC_ALIAS_MKTIME
//End-Libc
time_t mktime(struct tm *) __DARWIN_ALIAS(mktime);
//Begin-Libc
#else /* LIBC_ALIAS_MKTIME */
time_t mktime(struct tm *) LIBC_ALIAS(mktime);
#endif /* !LIBC_ALIAS_MKTIME */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_STRFTIME
//End-Libc
size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime);
//Begin-Libc
#else /* LIBC_ALIAS_STRFTIME */
size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) LIBC_ALIAS(strftime);
#endif /* !LIBC_ALIAS_STRFTIME */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_STRPTIME
//End-Libc
char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime);
//Begin-Libc
#else /* LIBC_ALIAS_STRPTIME */
char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) LIBC_ALIAS(strptime);
#endif /* !LIBC_ALIAS_STRPTIME */
//End-Libc
time_t time(time_t *);
#ifndef _ANSI_SOURCE
@ -182,15 +142,7 @@ time_t timegm(struct tm * const);
#endif /* neither ANSI nor POSIX */
#if !defined(_ANSI_SOURCE)
//Begin-Libc
#ifndef LIBC_ALIAS_NANOSLEEP
//End-Libc
int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep);
//Begin-Libc
#else /* LIBC_ALIAS_NANOSLEEP */
int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) LIBC_ALIAS_C(nanosleep);
#endif /* !LIBC_ALIAS_NANOSLEEP */
//End-Libc
#endif
#endif /* UNIFDEF_DRIVERKIT */

View File

@ -438,15 +438,7 @@ unsigned int
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
//Begin-Libc
#ifndef LIBC_ALIAS_CLOSE
//End-Libc
int close(int) __DARWIN_ALIAS_C(close);
//Begin-Libc
#else /* LIBC_ALIAS_CLOSE */
int close(int) LIBC_ALIAS_C(close);
#endif /* !LIBC_ALIAS_CLOSE */
//End-Libc
int dup(int);
int dup2(int, int);
@ -477,27 +469,11 @@ int link(const char *, const char *);
off_t lseek(int, off_t, int);
long pathconf(const char *, int);
//Begin-Libc
#ifndef LIBC_ALIAS_PAUSE
//End-Libc
int pause(void) __DARWIN_ALIAS_C(pause);
//Begin-Libc
#else /* LIBC_ALIAS_PAUSE */
int pause(void) LIBC_ALIAS_C(pause);
#endif /* !LIBC_ALIAS_PAUSE */
//End-Libc
int pipe(int [2]);
//Begin-Libc
#ifndef LIBC_ALIAS_READ
//End-Libc
ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read);
//Begin-Libc
#else /* LIBC_ALIAS_READ */
ssize_t read(int, void *, size_t) LIBC_ALIAS_C(read);
#endif /* !LIBC_ALIAS_READ */
//End-Libc
int rmdir(const char *);
int setgid(gid_t);
@ -505,17 +481,8 @@ int setpgid(pid_t, pid_t);
pid_t setsid(void);
int setuid(uid_t);
//Begin-Libc
#ifndef LIBC_ALIAS_SLEEP
//End-Libc
unsigned int
sleep(unsigned int) __DARWIN_ALIAS_C(sleep);
//Begin-Libc
#else /* LIBC_ALIAS_SLEEP */
unsigned int
sleep(unsigned int) LIBC_ALIAS_C(sleep);
#endif /* !LIBC_ALIAS_SLEEP */
//End-Libc
long sysconf(int);
pid_t tcgetpgrp(int);
@ -523,30 +490,14 @@ int tcsetpgrp(int, pid_t);
char *ttyname(int);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_TTYNAME_R
//End-Libc
int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
//Begin-Libc
#else /* LIBC_ALIAS_TTYNAME_R */
int ttyname_r(int, char *, size_t) LIBC_ALIAS(ttyname_r);
#endif /* !LIBC_ALIAS_TTYNAME_R */
//End-Libc
#else /* !__DARWIN_UNIX03 */
char *ttyname_r(int, char *, size_t);
#endif /* __DARWIN_UNIX03 */
int unlink(const char *);
//Begin-Libc
#ifndef LIBC_ALIAS_WRITE
//End-Libc
ssize_t write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write);
//Begin-Libc
#else /* LIBC_ALIAS_WRITE */
ssize_t write(int __fd, const void * __buf, size_t __nbyte) LIBC_ALIAS_C(write);
#endif /* !LIBC_ALIAS_WRITE */
//End-Libc
__END_DECLS
@ -557,25 +508,9 @@ __END_DECLS
#if __DARWIN_C_LEVEL >= 199209L
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_CONFSTR
//End-Libc
size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr);
//Begin-Libc
#else /* LIBC_ALIAS_CONFSTR */
size_t confstr(int, char *, size_t) LIBC_ALIAS(confstr);
#endif /* !LIBC_ALIAS_CONFSTR */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_GETOPT
//End-Libc
int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt);
//Begin-Libc
#else /* LIBC_ALIAS_GETOPT */
int getopt(int, char * const [], const char *) LIBC_ALIAS(getopt);
#endif /* !LIBC_ALIAS_GETOPT */
//End-Libc
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;
@ -612,15 +547,7 @@ int chroot(const char *) __POSIX_C_DEPRECATED(199506L);
char *crypt(const char *, const char *);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_ENCRYPT
//End-Libc
void encrypt(char *, int) __DARWIN_ALIAS(encrypt);
//Begin-Libc
#else /* LIBC_ALIAS_ENCRYPT */
void encrypt(char *, int) LIBC_ALIAS(encrypt);
#endif /* !LIBC_ALIAS_ENCRYPT */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int encrypt(char *, int);
#endif /* __DARWIN_UNIX03 */
@ -641,55 +568,15 @@ char *getpass(const char *) __POSIX_C_DEPRECATED(199506L);
char *getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */
#endif
//Begin-Libc
#ifndef LIBC_ALIAS_LCHOWN
//End-Libc
int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown);
//Begin-Libc
#else /* LIBC_ALIAS_LCHOWN */
int lchown(const char *, uid_t, gid_t) LIBC_ALIAS(lchown);
#endif /* !LIBC_ALIAS_LCHOWN */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_LOCKF
//End-Libc
int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf);
//Begin-Libc
#else /* LIBC_ALIAS_LOCKF */
int lockf(int, int, off_t) LIBC_ALIAS_C(lockf);
#endif /* !LIBC_ALIAS_LOCKF */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_NICE
//End-Libc
int nice(int) __DARWIN_ALIAS(nice);
//Begin-Libc
#else /* LIBC_ALIAS_NICE */
int nice(int) LIBC_ALIAS(nice);
#endif /* !LIBC_ALIAS_NICE */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_PREAD
//End-Libc
ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread);
//Begin-Libc
#else /* LIBC_ALIAS_PREAD */
ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) LIBC_ALIAS_C(pread);
#endif /* !LIBC_ALIAS_PREAD */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_PWRITE
//End-Libc
ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite);
//Begin-Libc
#else /* LIBC_ALIAS_PWRITE */
ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) LIBC_ALIAS_C(pwrite);
#endif /* !LIBC_ALIAS_PWRITE */
//End-Libc
/* Removed in Issue 6 */
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
@ -702,64 +589,24 @@ void *sbrk(int);
#endif
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_SETPGRP
//End-Libc
pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp);
//Begin-Libc
#else /* LIBC_ALIAS_SETPGRP */
pid_t setpgrp(void) LIBC_ALIAS(setpgrp);
#endif /* !LIBC_ALIAS_SETPGRP */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
#endif /* __DARWIN_UNIX03 */
//Begin-Libc
#ifndef LIBC_ALIAS_SETREGID
//End-Libc
int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid);
//Begin-Libc
#else /* LIBC_ALIAS_SETREGID */
int setregid(gid_t, gid_t) LIBC_ALIAS(setregid);
#endif /* !LIBC_ALIAS_SETREGID */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SETREUID
//End-Libc
int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid);
//Begin-Libc
#else /* LIBC_ALIAS_SETREUID */
int setreuid(uid_t, uid_t) LIBC_ALIAS(setreuid);
#endif /* !LIBC_ALIAS_SETREUID */
//End-Libc
void swab(const void * __restrict, void * __restrict, ssize_t);
void sync(void);
int truncate(const char *, off_t);
useconds_t ualarm(useconds_t, useconds_t);
//Begin-Libc
#ifndef LIBC_ALIAS_USLEEP
//End-Libc
int usleep(useconds_t) __DARWIN_ALIAS_C(usleep);
//Begin-Libc
#else /* LIBC_ALIAS_USLEEP */
int usleep(useconds_t) LIBC_ALIAS_C(usleep);
#endif /* !LIBC_ALIAS_USLEEP */
//End-Libc
pid_t vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
/* End XSI */
//Begin-Libc
#ifndef LIBC_ALIAS_FSYNC
//End-Libc
int fsync(int) __DARWIN_ALIAS_C(fsync);
//Begin-Libc
#else /* LIBC_ALIAS_FSYNC */
int fsync(int) LIBC_ALIAS_C(fsync);
#endif /* !LIBC_ALIAS_FSYNC */
//End-Libc
int ftruncate(int, off_t);
int getlogin_r(char *, size_t);
@ -873,28 +720,12 @@ int setgroups(int, const gid_t *);
void sethostid(long);
int sethostname(const char *, int);
#if __DARWIN_UNIX03
//Begin-Libc
#ifndef LIBC_ALIAS_SETKEY
//End-Libc
void setkey(const char *) __DARWIN_ALIAS(setkey);
//Begin-Libc
#else /* LIBC_ALIAS_SETKEY */
void setkey(const char *) LIBC_ALIAS(setkey);
#endif /* !LIBC_ALIAS_SETKEY */
//End-Libc
#else /* !__DARWIN_UNIX03 */
int setkey(const char *);
#endif /* __DARWIN_UNIX03 */
int setlogin(const char *);
//Begin-Libc
#ifndef LIBC_ALIAS_SETMODE
//End-Libc
void *setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode));
//Begin-Libc
#else /* LIBC_ALIAS_SETMODE */
void *setmode(const char *) LIBC_ALIAS(setmode);
#endif /* !LIBC_ALIAS_SETMODE */
//End-Libc
int setrgid(gid_t);
int setruid(uid_t);
int setsgroups_np(int, const uuid_t);
@ -921,48 +752,16 @@ int getsubopt(char **, char * const *, char **);
#ifdef __LP64__
int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
//Begin-Libc
#ifndef LIBC_ALIAS_GETATTRLIST
//End-Libc
int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_GETATTRLIST */
int getattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(getattrlist);
#endif /* !LIBC_ALIAS_GETATTRLIST */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SETATTRLIST
//End-Libc
int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_SETATTRLIST */
int setattrlist(const char*,void*,void*,size_t,unsigned int) LIBC_ALIAS(setattrlist);
#endif /* !LIBC_ALIAS_SETATTRLIST */
//End-Libc
int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
#else /* __LP64__ */
int fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
int fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
//Begin-Libc
#ifndef LIBC_ALIAS_GETATTRLIST
//End-Libc
int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_GETATTRLIST */
int getattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(getattrlist);
#endif /* !LIBC_ALIAS_GETATTRLIST */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_SETATTRLIST
//End-Libc
int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
//Begin-Libc
#else /* LIBC_ALIAS_SETATTRLIST */
int setattrlist(const char*,void*,void*,size_t,unsigned long) LIBC_ALIAS(setattrlist);
#endif /* !LIBC_ALIAS_SETATTRLIST */
//End-Libc
int exchangedata(const char*,const char*,unsigned long)
__OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag")
__IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag")

View File

@ -138,17 +138,8 @@ int wcscoll(const wchar_t *, const wchar_t *);
wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
size_t wcscspn(const wchar_t *, const wchar_t *);
#ifndef UNIFDEF_DRIVERKIT
//Begin-Libc
#ifndef LIBC_ALIAS_WCSFTIME
//End-Libc
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
//Begin-Libc
#else /* LIBC_ALIAS_WCSFTIME */
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict) LIBC_ALIAS(wcsftime);
#endif /* !LIBC_ALIAS_WCSFTIME */
//End-Libc
#endif /* UNIFDEF_DRIVERKIT */
size_t wcslen(const wchar_t *);
wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);

View File

@ -35,20 +35,7 @@
#include <_types.h>
#include <_types/_wctrans_t.h>
//Begin-Libc
/*
* _EXTERNALIZE_WCTYPE_INLINES_TOP_ is defined in locale/iswctype.c to tell us
* to generate code for extern versions of all top-level inline functions.
*/
#ifdef _EXTERNALIZE_WCTYPE_INLINES_TOP_
#define _USE_CTYPE_INLINE_
#define __DARWIN_WCTYPE_TOP_inline
#else /* !_EXTERNALIZE_WCTYPE_INLINES_TOP_ */
//End-Libc
#define __DARWIN_WCTYPE_TOP_inline __header_inline
//Begin-Libc
#endif /* _EXTERNALIZE_WCTYPE_INLINES_TOP_ */
//End-Libc
#include <_wctype.h>
#include <ctype.h>

View File

@ -71,9 +71,6 @@ __const char * querylocale(int, locale_t);
locale_t uselocale(locale_t);
__END_DECLS
//Begin-Libc
#ifndef __DARWIN_XLOCALE_PRIVATE
//End-Libc
#ifdef _CTYPE_H_
#include <xlocale/_ctype.h>
#endif /* _CTYPE_H_ */
@ -110,8 +107,5 @@ __END_DECLS
#ifdef _WCTYPE_H_
#include <xlocale/_wctype.h>
#endif /* _WCTYPE_H_ */
//Begin-Libc
#endif /* __DARWIN_XLOCALE_PRIVATE */
//End-Libc
#endif /* _XLOCALE_H_ */

View File

@ -40,27 +40,9 @@ __darwin_ct_rune_t ___tolower_l(__darwin_ct_rune_t, locale_t);
__darwin_ct_rune_t ___toupper_l(__darwin_ct_rune_t, locale_t);
__END_DECLS
//Begin-Libc
#ifdef __LIBC__
__DARWIN_CTYPE_inline int
__maskrune_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l)
{
/* _CurrentRuneLocale.__runetype is __uint32_t
* _f is unsigned long
* ___runetype_l(_c, _l) is unsigned long
* retval is int
*/
return (int)((_c < 0 || _c >= _CACHED_RUNES) ? (__uint32_t)___runetype_l(_c, _l) :
__locale_ptr(_l)->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & (__uint32_t)_f;
}
#else /* !__LIBC__ */
//End-Libc
__BEGIN_DECLS
int __maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t);
__END_DECLS
//Begin-Libc
#endif /* __LIBC__ */
//End-Libc
__DARWIN_CTYPE_inline int
__istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l)

View File

@ -30,32 +30,12 @@
#include <_xlocale.h>
__BEGIN_DECLS
//Begin-Libc
#ifndef LIBC_ALIAS_STRFTIME_L
//End-Libc
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t)
__DARWIN_ALIAS(strftime_l) __strftimelike(3);
//Begin-Libc
#else /* LIBC_ALIAS_STRFTIME_L */
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t)
LIBC_ALIAS(strftime_l) __strftimelike(3);
#endif /* !LIBC_ALIAS_STRFTIME_L */
//End-Libc
//Begin-Libc
#ifndef LIBC_ALIAS_STRPTIME_L
//End-Libc
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t)
__DARWIN_ALIAS(strptime_l) __strftimelike(2);
//Begin-Libc
#else /* LIBC_ALIAS_STRPTIME_L */
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t)
LIBC_ALIAS(strptime_l) __strftimelike(2);
#endif /* !LIBC_ALIAS_STRPTIME_L */
//End-Libc
__END_DECLS
#endif /* _XLOCALE__TIME_H_ */

View File

@ -63,19 +63,9 @@ int vwprintf_l(locale_t, const wchar_t * __restrict, __darwin_va_list);
size_t wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict,
locale_t);
int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
//Begin-Libc
#ifndef LIBC_ALIAS_WCSFTIME_L
//End-Libc
size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict, locale_t)
__DARWIN_ALIAS(wcsftime_l);
//Begin-Libc
#else /* LIBC_ALIAS_WCSFTIME_L */
size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict, locale_t)
LIBC_ALIAS(wcsftime_l);
#endif /* !LIBC_ALIAS_WCSFTIME_L */
//End-Libc
size_t wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t,
mbstate_t * __restrict, locale_t);
double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);