mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Add epoll and do more release readiness changes
This change also pays off some of the remaining technical debt with stdio, file descriptors, and memory managemnt polyfills.
This commit is contained in:
parent
a9ea949df8
commit
3e4fd4b0ad
271 changed files with 5706 additions and 1365 deletions
|
@ -44,7 +44,8 @@
|
|||
* @param va points to the variadic argument state
|
||||
* @see libc/fmt/pflink.h (dynamic memory is not a requirement)
|
||||
*/
|
||||
int vcscanf(int callback(void *), void *arg, const char *fmt, va_list va) {
|
||||
int vcscanf(int callback(void *), int unget(int, void *), void *arg,
|
||||
const char *fmt, va_list va) {
|
||||
struct FreeMe {
|
||||
struct FreeMe *next;
|
||||
void *ptr;
|
||||
|
@ -56,13 +57,18 @@ int vcscanf(int callback(void *), void *arg, const char *fmt, va_list va) {
|
|||
while (c != -1) {
|
||||
switch (p[i++]) {
|
||||
case '\0':
|
||||
return items;
|
||||
if (c != -1 && unget) {
|
||||
unget(c, arg);
|
||||
}
|
||||
goto Done;
|
||||
case ' ':
|
||||
case '\t':
|
||||
case '\n':
|
||||
case '\r':
|
||||
case '\v':
|
||||
while (isspace(c)) c = callback(arg);
|
||||
while (isspace(c)) {
|
||||
c = callback(arg);
|
||||
}
|
||||
break;
|
||||
case '%': {
|
||||
uintmax_t number;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue