| 1 |
|
| 2 |
/* |
| 3 |
* Copyright (c) 2018 Chris Jones <[email protected]> |
| 4 |
* Copyright (c) 2018 |
| 5 |
* |
| 6 |
* Permission to use, copy, modify, and distribute this software for any |
| 7 |
* purpose with or without fee is hereby granted, provided that the above |
| 8 |
* copyright notice and this permission notice appear in all copies. |
| 9 |
* |
| 10 |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 |
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 |
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef _MACPORTS_STDIO_H_ |
| 20 |
#define _MACPORTS_STDIO_H_ |
| 21 |
|
| 22 |
/* MP support header */ |
| 23 |
#include "MacportsLegacySupport.h" |
| 24 |
|
| 25 |
/* Include the primary system time.h */ |
| 26 |
#include_next <stdio.h> |
| 27 |
|
| 28 |
/* dprintf */ |
| 29 |
#if __MP_LEGACY_SUPPORT_DPRINTF__ |
| 30 |
|
| 31 |
__MP__BEGIN_DECLS |
| 32 |
extern int dprintf(int fd, const char * __restrict format, ...); |
| 33 |
__MP__END_DECLS |
| 34 |
|
| 35 |
#endif /* __MP_LEGACY_SUPPORT_DPRINTF__ */ |
| 36 |
|
| 37 |
/* getline */ |
| 38 |
#if __MP_LEGACY_SUPPORT_GETLINE__ |
| 39 |
|
| 40 |
/* |
| 41 |
* [XSI] The ssize_t and size_t types shall be defined as described |
| 42 |
* in <sys/types.h>. |
| 43 |
*/ |
| 44 |
#ifndef _SIZE_T |
| 45 |
#define _SIZE_T |
| 46 |
typedef __darwin_size_t size_t; |
| 47 |
#endif |
| 48 |
|
| 49 |
#ifndef _SSIZE_T |
| 50 |
#define _SSIZE_T |
| 51 |
typedef __darwin_ssize_t ssize_t; |
| 52 |
#endif |
| 53 |
|
| 54 |
__MP__BEGIN_DECLS |
| 55 |
extern ssize_t getdelim(char **lineptr, size_t *n, int delimiter, FILE *fp); |
| 56 |
extern ssize_t getline (char **lineptr, size_t *n, FILE *stream); |
| 57 |
__MP__END_DECLS |
| 58 |
|
| 59 |
#endif /* __MP_LEGACY_SUPPORT_GETLINE__ */ |
| 60 |
|
| 61 |
/* open_memstream */ |
| 62 |
#if __MP_LEGACY_SUPPORT_OPEN_MEMSTREAM__ |
| 63 |
|
| 64 |
__MP__BEGIN_DECLS |
| 65 |
FILE *open_memstream(char **ptr, size_t *sizeloc); |
| 66 |
__MP__END_DECLS |
| 67 |
|
| 68 |
#endif /* __MP_LEGACY_SUPPORT_OPEN_MEMSTREAM__ */ |
| 69 |
|
| 70 |
/* fmemopen */ |
| 71 |
#if __MP_LEGACY_SUPPORT_FMEMOPEN__ |
| 72 |
|
| 73 |
__MP__BEGIN_DECLS |
| 74 |
FILE *fmemopen(void *buf, size_t size, const char *mode); |
| 75 |
__MP__END_DECLS |
| 76 |
|
| 77 |
#endif /* __MP_LEGACY_SUPPORT_FMEMOPEN__ */ |
| 78 |
|
| 79 |
/* renameat */ |
| 80 |
#if __MP_LEGACY_SUPPORT_ATCALLS__ |
| 81 |
|
| 82 |
/* |
| 83 |
* [XSI] The ssize_t and size_t types shall be defined as described |
| 84 |
* in <sys/types.h>. |
| 85 |
*/ |
| 86 |
#ifndef _SIZE_T |
| 87 |
#define _SIZE_T |
| 88 |
typedef __darwin_size_t size_t; |
| 89 |
#endif |
| 90 |
|
| 91 |
#ifndef _SSIZE_T |
| 92 |
#define _SSIZE_T |
| 93 |
typedef __darwin_ssize_t ssize_t; |
| 94 |
#endif |
| 95 |
|
| 96 |
__MP__BEGIN_DECLS |
| 97 |
extern int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); |
| 98 |
__MP__END_DECLS |
| 99 |
|
| 100 |
#endif /* __MP_LEGACY_SUPPORT_ATCALLS__ */ |
| 101 |
|
| 102 |
#endif /* _MACPORTS_STDIO_H_ */ |