2021-08-06 21:12:11 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_STDIO_APPEND_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_STDIO_APPEND_H_
|
2021-08-04 05:42:17 +00:00
|
|
|
#include "libc/fmt/pflink.h"
|
|
|
|
|
2021-07-19 21:55:20 +00:00
|
|
|
#define APPEND_COOKIE 21578
|
2021-08-04 05:42:17 +00:00
|
|
|
|
2021-07-19 21:55:20 +00:00
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
|
|
|
struct appendz {
|
2021-08-06 21:12:11 +00:00
|
|
|
size_t i;
|
|
|
|
size_t n;
|
2021-07-19 21:55:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct appendz appendz(char *);
|
2021-08-06 21:12:11 +00:00
|
|
|
ssize_t appendr(char **, size_t);
|
|
|
|
ssize_t appendd(char **, const void *, size_t);
|
|
|
|
ssize_t appendw(char **, uint64_t);
|
|
|
|
ssize_t appends(char **, const char *);
|
|
|
|
ssize_t appendf(char **, const char *, ...);
|
|
|
|
ssize_t vappendf(char **, const char *, va_list);
|
2022-03-24 15:00:21 +00:00
|
|
|
ssize_t kappendf(char **, const char *, ...);
|
|
|
|
ssize_t kvappendf(char **, const char *, va_list);
|
2021-07-19 21:55:20 +00:00
|
|
|
|
|
|
|
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
2021-08-06 21:12:11 +00:00
|
|
|
#define appendf(BUF, FMT, ...) appendf(BUF, PFLINK(FMT), ##__VA_ARGS__)
|
|
|
|
#define vappendf(BUF, FMT, VA) vappendf(BUF, PFLINK(FMT), VA)
|
2021-07-19 21:55:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
2021-08-06 21:12:11 +00:00
|
|
|
#endif /* COSMOPOLITAN_LIBC_STDIO_APPEND_H_ */
|