2020-06-15 14:18:57 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_X_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_X_H_
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
|
|
|
int xwrite(int, const void *, uint64_t);
|
2020-12-05 20:20:41 +00:00
|
|
|
void xdie(void) wontreturn;
|
2022-09-13 06:10:38 +00:00
|
|
|
char *xdtoa(double)
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xdtoaf(float)
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xdtoal(long double)
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
void *xmalloc(size_t) attributeallocsize((1))
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
2021-04-18 18:34:59 +00:00
|
|
|
void *xrealloc(void *, size_t)
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
attributeallocsize((2)) dontthrow nocallback dontdiscard;
|
2022-09-13 06:10:38 +00:00
|
|
|
void *xcalloc(size_t, size_t) attributeallocsize((1, 2))
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
void *xvalloc(size_t) attributeallocsize((1)) returnsaligned((FRAMESIZE))
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
void *xmemalign(size_t, size_t) attributeallocalign((1)) attributeallocsize((2))
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
2020-10-11 04:18:53 +00:00
|
|
|
void *xmemalignzero(size_t, size_t) attributeallocalign((1))
|
2022-09-13 06:10:38 +00:00
|
|
|
attributeallocsize((2)) returnspointerwithnoaliases dontthrow nocallback
|
|
|
|
dontdiscard returnsnonnull;
|
|
|
|
char *xstrdup(const char *) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xstrndup(const char *, size_t) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xstrcat(const char *, ...) paramsnonnull((1)) nullterminated()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
#define xstrcat(...) (xstrcat)(__VA_ARGS__, 0)
|
|
|
|
char *xstrmul(const char *, size_t) paramsnonnull((1))
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xinet_ntop(int, const void *) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
void *xunbinga(size_t, const char16_t *)
|
|
|
|
attributeallocalign((1)) returnspointerwithnoaliases dontthrow nocallback
|
|
|
|
dontdiscard returnsnonnull dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
void *xunbing(const char16_t *) returnspointerwithnoaliases dontthrow nocallback
|
|
|
|
dontdiscard returnsnonnull dontthrow nocallback dontdiscard returnsnonnull;
|
2022-08-21 04:36:07 +00:00
|
|
|
char16_t *utf8to16(const char *, size_t, size_t *) dontdiscard;
|
|
|
|
char *utf16to8(const char16_t *, size_t, size_t *) dontdiscard;
|
|
|
|
wchar_t *utf8to32(const char *, size_t, size_t *) dontdiscard;
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
wchar_t *utf16to32(const char16_t *, size_t, size_t *) dontdiscard;
|
2022-08-21 04:36:07 +00:00
|
|
|
char *utf32to8(const wchar_t *, size_t, size_t *) dontdiscard;
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
char *xhomedir(void) dontdiscard;
|
|
|
|
char *xstripext(const char *) dontdiscard;
|
|
|
|
char *xstripexts(const char *) dontdiscard;
|
2022-11-02 05:36:03 +00:00
|
|
|
void *xload(_Atomic(void *) *, const void *, size_t, size_t);
|
|
|
|
void *xloadzd(_Atomic(void *) *, const void *, size_t, size_t, size_t, size_t,
|
2021-10-02 15:17:04 +00:00
|
|
|
uint32_t);
|
2021-01-29 09:27:09 +00:00
|
|
|
int rmrf(const char *);
|
2022-09-13 06:10:38 +00:00
|
|
|
char *xbasename(const char *) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xdirname(const char *) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xjoinpaths(const char *, const char *) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xreadlink(const char *) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
|
|
|
char *xreadlinkat(int, const char *) paramsnonnull()
|
|
|
|
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
|
2022-05-25 18:31:08 +00:00
|
|
|
void xfixpath(void);
|
2021-07-06 20:39:18 +00:00
|
|
|
void *xslurp(const char *, size_t *)
|
2021-06-24 19:31:26 +00:00
|
|
|
paramsnonnull((1)) returnspointerwithnoaliases
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
returnsaligned((PAGESIZE)) dontdiscard;
|
2020-09-28 08:13:56 +00:00
|
|
|
int xbarf(const char *, const void *, size_t);
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_X_H_ */
|