summaryrefslogtreecommitdiff
path: root/Userland/Utilities
AgeCommit message (Collapse)Author
2023-01-13AK+Everywhere: Disallow returning a reference from a fallible expressionTimothy Flynn
This will silently make a copy. Rather than masking this behavior, let's explicitly disallow it.
2023-01-13strace: Fix ignored errors in formattingMacDue
2023-01-13Userland: Remove a bunch of unveil calls on /sys/kernel/processesLiav A
These are not needed anymore since the introduction of the new get_root_session_id syscall.
2023-01-12Utilities: Add ttfdisasm for disassembling OpenType instructionsMacDue
This utility when given a .tff font provides options for disassembling: - The 'fpgm' table, this a program that's run once when the font is loaded. It's used to define instructions and functions used by used by other programs. - The 'prep' table, this is a general program that's run when ever the font size (or other properties) changes. - And the programs associated with any individual glyph. The disassembly is printed in a format that matches the examples from: https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions I'm mainly adding this because I think it's neat to be able to look at these things, and think it'll be helpful for debugging an interpreter. With this you can see that all of the LiberationSerif-XXX.tff fonts in Serenity have these programs ready to go.
2023-01-12LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOrSam Atkins
clang-format sure has some interesting opinions about where to put a method call that comes after a lambda. :thonk:
2023-01-10LibCompress: Port `DeflateCompressor` to `Core::Stream`Tim Schumacher
2023-01-10LibCompress: Port `GzipCompressor` to `Core::Stream`Tim Schumacher
2023-01-08LibGfx+icc: Look at profile_size fieldNico Weber
This trims the input bytes to the profile size stored in the file. Alternatively, we could reject files where the stored size doesn't match the handed in size. But ICC profiles can be embedded in other files, and those could conceivably pad the ICC profile data some.
2023-01-08base64: TRY() the fallible function encode_base64()Kenneth Myhra
This seems to have been forgotten in commit 25f2e498.
2023-01-08chgrp: Use StringView instead of 'char const*'Kenneth Myhra
This gets rid of a couple ad-hoc instances of DeprecatedString and makes it more trivial to use the fallible function Core::System::getgrnam() in place of LibC's getgrnam().
2023-01-08passwd: Use StringView instead of DeprecatedStringKenneth Myhra
This can now be declared as a StringView, since commit 507cb411 Core::Account::from_name() takes a StringView as a input. This removes one FIXME.
2023-01-08blockdev: Use Core::System::open() instead of LibC open()Kenneth Myhra
2023-01-08blockdev: Let fetch_ioctl() return ErrorOr<void>Kenneth Myhra
2023-01-08markdown-check: Check that binary links use the text "Open"kleines Filmröllchen
Binary links will only be allowed in these contexts, which is all that we currently use them for anyways. This mainly gets rid of useless "not checking local link" spam relating to binaries, and only a few local links remain.
2023-01-08markdown-check: Check that no old-style inter-manpage links are usedkleines Filmröllchen
We've had quite some instances of people reintroducing these kinds of links because they didn't know about the "new" help:// scheme. This check should now prevent that from happening, though it might in rare circumstances trigger a false positive.
2023-01-08LibGfx+icc: Print primary platformNico Weber
There's a small, old-timey list of platforms in the spec, but as far as I can tell nobody is using additional platforms on Linux or Android or what. So let's try going with an enum class instead of the FourCC machinery for now.
2023-01-08LibArchive+Utilities: Stop using DeprecatedStringimplicitfield
This also slightly improves error propagation in tar, unzip and zip.
2023-01-07Everywhere: Remove "LibC/" includes, add lint-rule against itBen Wiederhake
2023-01-07Userland: Silence warnings from ElapsedTimer::elapsed() type changeAndrew Kaster
We changed elapsed() to return i64 instead of int as that's what AK::Time::to_milliseconds() returns, causing a bunch of implicit lossy conversions in callers. Clean those up with a mix of type changes and casts.
2023-01-07Utilities: Store per-benchmark timeout in AK::Time rather than integerAndrew Kaster
Integer seconds are cool, but the comparison is a lot easier to understand when stored as an AK::Time, and converted from_seconds() after parsing the timeout from the command line.
2023-01-07LibGfx+icc: Print fields that are fourccs registered with the ICCNico Weber
Namely: - preferred CMM type - device manufacturer - device model - profile creator These all have in common that they can take arbitrary values, so I added a FourCC class to deal with them, instead of using an enum class. I made distinct types for each of them, so that they aren't accidentally mixed up.
2023-01-07icc: Extract out_optional() functionNico Weber
2023-01-06sed: Perform case insensitive substitutions with "/i"Eli Youngs
2023-01-06sed: Write substitution output to a file with "/w"Eli Youngs
A substitution command like "s/x/y/wabc" will now write all substituted lines to a file called "abc". Note that this is in addition to writing to stdout.
2023-01-06Userland: Add a sed utilityEli Youngs
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
Rip that bandaid off! This does the following, in one big, awkward jump: - Replace all uses of `set_main_widget<Foo>()` with the `try` version. - Remove `set_main_widget<Foo>()`. - Rename the `try` version to just be `set_main_widget` because it's now the only one. The majority of places that call `set_main_widget<Foo>()` are inside constructors, so this unfortunately gives us a big batch of new `release_value_but_fixme_should_propagate_errors()` calls.
2023-01-06LibGfx+icc: Print device attribute flagsNico Weber
These flags are always 0 in practice in all profiles I've seen so far, but hey, probably nice to dump them anyways. And hey, it's just 86 lines to print 4 bits.
2023-01-06LibGfx+icc: Verify ICCProfile ID at parse time instead of in iccNico Weber
Always computing computing the md5 takes some time, but most icc profiles are small. So that's probably fine. If this ends up being a perf problem in the future, or if it ends up rejecting tons of embedded proiles from images, we can row it back. But let's see if we can get away with this first.
2023-01-05LibWeb+WebContent: Convert BrowsingContext to new pixel unitsSam Atkins
This fixes a few glitches. We no longer give the page double the width it should have, and we mark the correct area of the page as needing repainting.
2023-01-05LibGfx+icc: Print if profile id is validNico Weber
2023-01-05icc: Print profile idNico Weber
2023-01-04Everywhere: Make global `inline` functions not `static`Nico Weber
`inline` already assigns vague linkage, so there's no need to also assign per-TU linkage. Allows the linker to dedup these functions across TUs (and is almost always just the Right Thing to do in C++ -- this ain't C).
2023-01-02Everywhere: Remove unused includes of LibC/stdlib.hBen Wiederhake
These instances were detected by searching for files that include stdlib.h, but don't match the regex: \\b(_abort|abort|abs|aligned_alloc|arc4random|arc4random_buf|arc4random_ uniform|atexit|atof|atoi|atol|atoll|bsearch|calloc|clearenv|div|div_t|ex it|_Exit|EXIT_FAILURE|EXIT_SUCCESS|free|getenv|getprogname|grantpt|labs| ldiv|ldiv_t|llabs|lldiv|lldiv_t|malloc|malloc_good_size|malloc_size|mble n|mbstowcs|mbtowc|mkdtemp|mkstemp|mkstemps|mktemp|posix_memalign|posix_o penpt|ptsname|ptsname_r|putenv|qsort|qsort_r|rand|RAND_MAX|random|reallo c|realpath|secure_getenv|serenity_dump_malloc_stats|serenity_setenv|sete nv|setprogname|srand|srandom|strtod|strtof|strtol|strtold|strtoll|strtou l|strtoull|system|unlockpt|unsetenv|wcstombs|wctomb)\\b (Without the linebreaks.) This regex is pessimistic, so there might be more files that don't actually use anything from the stdlib. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
2023-01-02df: Add an option to display used/available inodesArda Cinar
2023-01-02df: Show used percentages for each listed entryArda Cinar
2023-01-02Everywhere: Remove unused includes of AK/Array.hBen Wiederhake
These instances were detected by searching for files that include Array.h, but don't match the regex: \\b(Array(?!\.h>)|iota_array|integer_sequence_generate_array)\\b These are the three symbols defined by Array.h. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
2023-01-02Everywhere: Fix badly-formatted includesBen Wiederhake
In 7c5e30daaa615ad3a2ef55222423a747ac0a1227, the focus was "only" on Userland/Libraries/, whereas this commit cleans up the remaining headers in the repo, and any new badly-formatted include.
2023-01-02LibGfx+icc: Print pcs illuminantNico Weber
2023-01-02Utilities: Resolve manpage paths more robustly in markdown-checkkleines Filmröllchen
The path is now relative to the Serenity source directory, and later parts of the URL path are not simply discarded. This allows links into subsection man pages to be checked correctly.
2023-01-01Utilities: Print arbitrary bytes in `ls`Victor Song
Currently, `ls` crashes when printing certain byte sequences. This is likely due to an out-of-bounds error when iterating through the `StringView` representing the file name to be printed. We switch to using an index-based for loop to a range-based for loop. This fixes #16678.
2022-12-31LibGfx+icc: Add profile connection space printingNico Weber
This is a bit messy: The spec says that PCSXYZ and PCSLAB are the only valid profile connection spaces -- except for DeviceLink profles, where all data color spaces are valid. So this uses the existing ColorSpace enum for profile connection spaces instead of adding a dedicated enum, to not duplicate all the color space parsing and printing code. That matches what the spec does, too. This saves about 100 lines of code, at the expense of less type safety -- but further down the line we probably want to be able to compare data color spaces and profile connection spaces, so the type safety would likely get in the way then. (But if not, we can change things around once we get to that point.)
2022-12-31LibGfx+icc: Print profile flagsNico Weber
These flags are always 0 in practice in all profiles I've seen so far, but hey, probably nice to dump them anyways.
2022-12-31Utilities: Introduce the ldd utilityLiav A
This utility lets a user to figure out what are the dependency libraries for an ELF dynamic object, whether it's a dynamically loaded executable or dynamically loaded library.
2022-12-31userdel: Use `Core::Account::sync()` to interact with sensitive filesLucas CHOLLET
2022-12-31userdel: Use `Core::File::remove()` instead of spawning `/bin/rm`Lucas CHOLLET
2022-12-31Utilities: Fix top utility not calling exit() on SIGINTHawDevelopment
Before, when running top, pressing Control+C (triggering SIGINT), would not call the atexit handler. Therefor not restoring stdin.
2022-12-30pro: Fix comment typoNico Weber
2022-12-30icc: Print rendering intentNico Weber
2022-12-30icc: Print data color spaceNico Weber
2022-12-30sql+SQLStudio: Recover from errors preparing SQL statementsTimothy Flynn
In both applications, display the SQL statement that failed to parse. For the REPL, ensure the REPL prompts the user for another statement. For SQLStudio, we don't continue executing the script as it likely does not make sense to run statements that come after a failed statement.