Commit Graph

111 Commits

Author SHA1 Message Date
Lephenixnoir 46c73cbc87
stdio: fix %N.Ms miscalculating spacing if M > strlen(arg) 2024-02-04 20:13:25 +01:00
Lephenixnoir be4c2b8d33
stdio: fix bypassed __scanf_end at end of scanf 2024-01-14 22:02:53 +01:00
Lephenixnoir 0cef8ca891
stdio: slight cleanup and documentation 2024-01-14 21:58:03 +01:00
Lephenixnoir 177c4eea3f
stdio: more compact scanf format parsing 2024-01-14 21:34:46 +01:00
Lephenixnoir 527c2e48fc
stdio: more syntaxic refactoring of scanf 2024-01-14 21:27:48 +01:00
Lephenixnoir 9f6e0c8039
stdio: factor out format parsing in scanf 2024-01-14 21:20:40 +01:00
Lephenixnoir 1caaa8ff63
stdio: use compact storage for %[] set in scanf
256 bytes of globals is a *lot* on the G-III.
2024-01-14 20:36:09 +01:00
Lephenixnoir 5b85d53826
(formatting: case indent) 2024-01-14 20:23:55 +01:00
Lephenixnoir 55ae7df318
stdio: simplify output size management in scanf 2024-01-14 20:23:21 +01:00
Lephenixnoir 69eadb67d2
stdio: deduplicate scanf cases and remove most gotos 2024-01-14 20:07:24 +01:00
Lephenixnoir b11c059c0f
stdio: start simplifying scanf limit tracking logic
Basically removing it from the __scanf_input structure and specializing
it at format sites. The reason is that pretending it's the end of the
stream after the limit is reached does not work because we have to
return EOF at end of stream but not when the limit is hit. So we have to
handle it explicitly, and since we do, no need to have it in the
structure too.
2024-01-14 19:28:36 +01:00
Lephenixnoir 2215b3c267
stdio: make all scanf tests pass
The tests are still far from exhaustive but that's a good start.
2024-01-14 17:31:21 +01:00
Lephenixnoir b61cc096d9
stdio: fix scanf buffering so all tests pass
Code factoring and performance improvements will follow.
2024-01-14 17:31:19 +01:00
Lephenixnoir c776336a0d
stdio: fix scanf bounds breaking strto*
Mostly an initialization problem. But I also optimized the check by
making the bound a maximal unsigned integer when there is no bound,
since __scanf_peek() is used a lot.
2024-01-14 17:31:15 +01:00
Lephenixnoir d8a55b728d
stdlib: restore private headers 2024-01-14 13:48:41 +01:00
Sylvain PILLOT 09b33ca2fa
stdlib: scanf implementation by SlyVTT
Authored-By: Slyvtt <pillot.sylvain@gmail.com>
2023-05-26 21:04:37 +02:00
Lephenixnoir 465655674b
dso: dynamically allocate destructor table
This saves static memory on mono targets where it's scarce.
2023-04-01 20:30:30 +02:00
Lephenixnoir 7c4de3e295
dso, stdlib: __cxa_atexit(), __dso_handle, atexit() (TEST) 2023-04-01 20:30:30 +02:00
Lephenixnoir 95e33092ec
stdlib: add fileno (DONE) 2023-04-01 20:30:29 +02:00
Lephenixnoir 26e54af8e0
stdlib: scanf-friendly strto* functions 2023-04-01 20:30:29 +02:00
Lephenixnoir fda0d950ed
time: fix strftime being called strftime2 2023-04-01 20:30:29 +02:00
Heath Mitchell aeeae3810d Update 'src/string/strcmp.c' 2022-11-24 13:36:02 +01:00
Heath Mitchell ee42660ea5 Update 'src/string/strncmp.c' 2022-11-24 13:30:46 +01:00
Lephenixnoir 89c6c39405
stdio: support for UTF-8 %lc in printf() 2022-08-01 11:27:24 +01:00
Yann MAGNIN bdf9566723 fxlibc - v1.4.3 : fix vhex missing headers
@update
> CMakeLists.txt
 | remove the generation of the shared version of the fxlibc (deprecated, unused)
> include/errno
 | add some error macros needed in vhex
> src/string/strerror
 | add EINTR support
 | add EAGAIN support
 | add ENOMEDIUM support
 | add EMEDIUMTYPE support

@fix
> include/target/vhex
 | add missing headers
2022-07-30 17:57:08 +02:00
Yann MAGNIN 619afe25da fxlibc - v1.4.2 : fix reallocarray() + remove old Vhex/Casiowin sources
@update
> CMakeLists.txt
  | remove casiowin-* target (unused)
  | remove x86-generic target (unused)
  | update files location
  | remove old vhex sources files (deprecated, unused)
> src/posix
  | remove this folder
> src/libc
  | move its content to src/
  | remove thread module
> src/stdlib/reallocarray
  | check if the multiplication overflow failed
  | set appropriate errno value if multiplication failed
2022-06-03 16:25:31 +02:00
Yann MAGNIN 996b2b8ded fxlibc - v1.4.1 : update Vhex stdlib
@update
> malloc  : do not use syscall, involve kmalloc
> realloc : do not use syscall, involve krealloc
> free    : do not use syscall, involve kfree

@fix
> _Exit : remove syscall
2022-05-14 11:49:08 +02:00
Lephenixnoir d50e44c563
C++ __restrict__, update STATUS, minor formatting 2022-03-31 10:12:01 +01:00
Alice Rozengarden 3f5989ceab Add getline(3) & getdelim(3) 2022-03-30 23:49:44 +02:00
Lephenixnoir 3c29639988
string: fix a bug in SuperH memset 2022-03-26 15:19:15 +00:00
Lephenixnoir 71866ed769
stdio: stdin/stdout/stderr, perror, final adjustments
Support for <stdio.h> will stop here for now.
2022-01-14 18:38:48 +01:00
Lephenixnoir ed873a652e
stdio: fgetc(), fgets(), tests for fputc() and fputs() (DONE) 2022-01-14 17:16:04 +01:00
Lephenixnoir f1512125d0
stdio: initial versions of fputc() and fputs() (TEST) 2022-01-13 21:21:23 +01:00
Lephenixnoir 6ec0c24e2d
stdio: ungetc(), update (+) and append (a) modes (DONE) 2022-01-12 10:20:30 +01:00
Lephenixnoir 06b66252c9
stdio: line buffering, test fgetpos and fsetpos (DONE) 2022-01-10 21:32:24 +01:00
Lephenixnoir 0c2f81e5bb
string: add and test a naive memrchr (DONE) 2022-01-10 21:21:03 +01:00
Lephenixnoir 909c7df815
stdio: fixes for initial fread() et fwrite() (TEST) 2022-01-10 17:10:49 +01:00
Lephenixnoir 4461bdb96a
stdio: basic fread/fwrite (WIP) 2022-01-05 21:26:06 +01:00
Lephenixnoir b6dbdf321d
stdio: error handling and positioning functions (WIP) 2022-01-02 22:09:06 +01:00
Lephenixnoir a12b84f1ef
stdio: opening primitives for FILE (WIP) 2022-01-02 19:22:43 +01:00
Lephenixnoir 51528170bb
stdio: FILE barebones with buffering model (WIP) 2022-01-02 19:22:42 +01:00
Lephenixnoir b53078776d
stdio: enable dprintf() and vdprintf() 2022-01-02 19:22:42 +01:00
Lephenixnoir 3046304497
stdlib: set errno=ENOMEM after failed malloc() 2022-01-02 19:22:42 +01:00
Lephenixnoir f7b85f18bd
time: do not depend on gint headers
They're usually not installed yet
2021-12-31 19:48:43 +01:00
Lephenixnoir dbfefe5172
errno: add ENOTEMPTY for rmdir() 2021-12-30 18:18:54 +01:00
Lephenixnoir e479393a9c
unistd, dirent: definitions for directory functions 2021-12-21 18:55:23 +01:00
Lephenixnoir c2feb94710
fcntl, unistd: declarations for the Unix file API 2021-12-13 18:37:04 +01:00
Lephenixnoir 92ccd8b1db
time: add support for C99 <time.h> (DONE) 2021-12-04 22:02:23 +01:00
Lephenixnoir e71f9867e2
support for shared libgcc in vhex 2021-11-07 18:05:33 +01:00
Lephenixnoir df4c13b007
stdlib: fix bad memset in calloc() 2021-09-25 15:16:24 +02:00