[libc] add scanf current position conversion
authorMichael Jones <michaelrj@google.com>
Tue, 24 Jan 2023 19:25:54 +0000 (11:25 -0800)
committerMichael Jones <michaelrj@google.com>
Wed, 25 Jan 2023 23:29:22 +0000 (15:29 -0800)
commitafa764c9a6d68ab6de94a5d007e0b468e65ae946
tree46d980c7f0ad9bad4f59b4868bb9d17b82356c49
parent68e7c00b03cffd6912772fdff845682eda4e29b7
[libc] add scanf current position conversion

To add the current position (%n) conversion, some reorganization needed
to be done. The "write a number to this pointer using the length
modifier" utilities and a couple other shared parsing functions have
been moved into converter_utils.h. This made implementing
current_pos_converter very simple.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D142495
libc/src/stdio/scanf_core/CMakeLists.txt
libc/src/stdio/scanf_core/converter.cpp
libc/src/stdio/scanf_core/converter_utils.h [new file with mode: 0644]
libc/src/stdio/scanf_core/current_pos_converter.h [new file with mode: 0644]
libc/src/stdio/scanf_core/float_converter.cpp
libc/src/stdio/scanf_core/int_converter.cpp
libc/src/stdio/scanf_core/scanf_main.cpp
libc/test/src/stdio/sscanf_test.cpp