Age | Commit message (Collapse) | Author |
|
|
|
|
|
More binary format detectors and descriptions
|
|
This attempts to guess the mime-type from a given set of bytes from the
start of a file. It only supports a few well-defined patterns for now,
but it's a start!
|
|
This also moves Widget::load_from_json into Core::Object as a virtual
function in order to allow loading non-widget objects in GML (e.g.
BoxLayout).
Co-authored-by: Gunnar Beutner <gbeutner@serenityos.org>
|
|
|
|
|
|
The user's GID is already available via gid(), and it's not "extra", so
don't include it in extra_gids() again. Also rename the internally used
function from get_gids() to get_extra_gids() to make its purpose more
clear.
|
|
This previously worked and was broken by 302f9798e.
|
|
|
|
|
|
|
|
According to POSIX.1 these should be in <crypt.h>.
|
|
|
|
We already supported Vector<char const*>, so let's add Vector<String>
as well. :^)
|
|
|
|
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
|
|
Simplify some code by using this instead of concatenating the full path
ourselves at the call site.
|
|
This was a helper that would call a syscall repeatedly until it either
succeeded or failed with a non-EINTR error.
It was only used in two places, so I don't think we need this helper.
|
|
The API existed for add_positional_argument, but not for named arguments.
|
|
|
|
that just compares their timestamps.
|
|
This allows us to add fast-paths for commonly used types.
|
|
|
|
|
|
Taking a StringView parameter that gets immediately converted to
a String anyway is silly. Just take a String directly instead.
This pattern is the main reason we have the "StringView internal
StringImpl pointer" optimization, and I suspect that we can throw
that whole thing out if we make a couple more patches like this.
|
|
This should allow creating intrusive lists that have smart pointers,
while remaining free (compared to the impl before this commit) when
holding raw pointers :^)
As a sidenote, this also adds a `RawPtr<T>` type, which is just
equivalent to `T*`.
Note that this does not actually use such functionality, but is only
expected to pave the way for #6369, to replace NonnullRefPtrVector<T>
with intrusive lists.
As it is with zero-cost things, this makes the interface a bit less nice
by requiring the type name of what an `IntrusiveListNode` holds (and
optionally its container, if not RawPtr), and also requiring the type of
the container (normally `RawPtr`) on the `IntrusiveList` instance.
|
|
Since LibCore cannot depend on LibIPC, the coders are defined in LibIPC
just like they are for Core::AnonymousBuffer.
|
|
SystemServer only allowed a single socket to be created for a service
before this. Now, SystemServer will allow any amount of sockets. The
sockets can be defined like so:
[SomeService]
Socket=/tmp/portal/socket1,/tmp/portal/socket2,/tmp/portal/socket3
SocketPermissions=660,600
The last item in SocketPermissions is applied to the remainder of the
sockets in the Socket= line, so multiple sockets can have the same
permissions without having to repeat them.
Defining multiple sockets is not allowed for socket-activated services
at the moment, and wouldn't make much sense anyway.
This patch also makes socket takeovers more robust by removing the
assumption that the socket will always be passed in fd 3. Now, the
SOCKET_TAKEOVER environment variable carries information about which
endpoint corresponds to which socket, like so:
SOCKET_TAKEOVER=/tmp/portal/socket1:3 /tmp/portal/socket2:4
and LocalServer/LocalService will parse this automatically and select
the correct one. The old behavior of getting the default socket is
preserved so long as the service only requests a single socket in
SystemServer.ini.
|
|
|
|
|
|
|
|
This commit makes the user-facing StdLibExtras templates and utilities
arguably more nice-looking by removing the need to reach into the
wrapper structs generated by them to get the value/type needed.
The C++ standard library had to invent `_v` and `_t` variants (likely
because of backwards compat), but we don't need to cater to any codebase
except our own, so might as well have good things for free. :^)
|
|
|
|
The helpers check if the file is a block device or a character device
via stat and fstat.
|
|
You can now specify the font, font_size, font_weight
and font_type (fixed_width/normal) through GML
|
|
|
|
|
|
The event filter is consulted by Object::dispatch_event() and may
decide that the event should not be delivered to the target object.
|
|
|
|
|
|
Good-bye LogStream. Long live AK::Format!
|
|
This is basically the same version as const char *, but it's a nice
helper that allows us to handle strings without casting.
|
|
This commit removes the only 3rd party library (and its usages)
in serenity: puff, which is used for deflate decompression. and
replaces it with the existing original serenity implementation
in LibCompress. :^)
|
|
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
FileManager, cp, mv, rm had some duplicated code, implementing basic
file management operations. This patch creates adds functions that try
to provide an interface suited for all these programs, but this patch
does not make them be used throughout the Userland.
They are added to Core::File following the example of functions such as
read_link/real_path_for.
|
|
|