Commit graph

10 commits

Author SHA1 Message Date
sin-ack c8585b77d2 Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack 3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack c70f45ff44 Everywhere: Explicitly specify the size in StringView constructors
This commit moves the length calculations out to be directly on the
StringView users. This is an important step towards the goal of removing
StringView(char const*), as it moves the responsibility of calculating
the size of the string to the user of the StringView (which will prevent
naive uses causing OOB access).
2022-07-12 23:11:35 +02:00
Idan Horowitz 086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
alexmajor 2f1717182e stty: Port to LibMain 2022-02-01 04:58:24 +00:00
Andreas Kling 8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Brian Gianforcaro 219d4ba376 Utilities: Remove unused header includes 2021-08-01 08:10:16 +02:00
Daniel Bertalan 4531f689ff Userland: Fix incorrect iflag/oflag printing in stty
The `c_iflag` and `c_oflag` fields were swapped in the source code which
caused the bit values to be interpreted as the wrong flag. It was a
stupid mistake on my part.
2021-06-10 23:44:14 +02:00
Daniel Bertalan e401ff0802 Userland: Fix stty not setting control characters
`AK::Result` does not work if both the error and value types are
integers.
2021-05-24 20:14:21 +01:00
Daniel Bertalan 8262d6fc68 Utilities: Implement stty
This commit adds support for most of the useful POSIX-defined features.
This will come in handy when dealing with serial terminals that are
implemented in #7260.

Unfortunately, it isn't possible to use `Core::ArgsParser` due to the
oddity of the input format. Most of this code is therefore just data
wrangling and parsing.
2021-05-23 09:04:24 +04:30