summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore
AgeCommit message (Collapse)Author
2021-05-07LibCore: Remove Core::IODevice::printf()Andreas Kling
2021-05-07LibCore: Convert StringBuilder::appendf() => AK::FormatAndreas Kling
2021-05-07LibCore+Userland: Add more detectable typesValtteri Koskivuori
More binary format detectors and descriptions
2021-05-07LibCore: Implement basic mime type guessing based on binary patternsValtteri Koskivuori
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!
2021-05-06LibGUI: Move widget registration to LibCoreTom
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>
2021-05-05LibCore: Call setgrent before looping on groups in get_extra_gidssetepenre
2021-05-04LibCore: Avoid unnecessary Vector copy in Account ctorLinus Groh
2021-05-04LibCore: Don't include user GID in Account::extra_gids()Linus Groh
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.
2021-05-04LibCore: Let Account::from_* succeed if /etc/shadow is unreadableGunnar Beutner
This previously worked and was broken by 302f9798e.
2021-05-01Everywhere: Turn #if *_DEBUG into dbgln_if/if constexprGunnar Beutner
2021-05-01LibCore: Fix building the library on macOSGunnar Beutner
2021-05-01LibC: Implement support for getspnam() and friendsGunnar Beutner
2021-05-01LibC: Move crypt() and crypt_r() to the right header fileGunnar Beutner
According to POSIX.1 these should be in <crypt.h>.
2021-04-29Everywhere: "file name" => "filename"Andreas Kling
2021-04-29LibCore: Support Vector<String> positional argumentsAndreas Kling
We already supported Vector<char const*>, so let's add Vector<String> as well. :^)
2021-04-25Everywhere: Remove empty line after function body opening curly braceLinus Groh
2021-04-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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 *
2021-04-21LibCore: Convert String::format() => String::formatted()Andreas Kling
2021-04-21Userland: Use Core::DirIterator::next_full_path()Andreas Kling
Simplify some code by using this instead of concatenating the full path ourselves at the call site.
2021-04-21LibCore: Remove the barely-used Core::safe_syscall()Andreas Kling
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.
2021-04-18LibCore: Add ArgsParser::add_option(String&)DexesTTP
The API existed for add_positional_argument, but not for named arguments.
2021-04-18LibCore: Remove the no-longer-used Core::DateTime::is_before() functionAnotherTest
2021-04-18LibCore: Implement operator less-than for Core::DateTimeAnotherTest
that just compares their timestamps.
2021-04-17LibCore: Use is<T> in Object::find_*_of_type helpersAndreas Kling
This allows us to add fast-paths for commonly used types.
2021-04-17LibCore: Make File take String instead of StringViewAndreas Kling
2021-04-17LibCore: Make DirIterator take String instead of StringViewAndreas Kling
2021-04-17LibCore: Don't needlessly use StringView in Core::Object APIsAndreas Kling
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.
2021-04-16AK+Kernel: Make IntrusiveList capable of holding non-raw pointersAnotherTest
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.
2021-04-16LibCore+LibIPC: Add IPC coder for Core::DateTimeTimothy Flynn
Since LibCore cannot depend on LibIPC, the coders are defined in LibIPC just like they are for Core::AnonymousBuffer.
2021-04-15SystemServer+LibCore: Allow service to request multiple socketssin-ack
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.
2021-04-14LibCore: Use dbgln_if in EventLoop.cppMaciej Zygmanowski
2021-04-13LibCore: Don't leak file descriptor inside AnonymousBuffer on LinuxJean-Baptiste Boric
2021-04-10LibCore: Save errno before it gets clobbered in Core::IODevice::write()Andreas Kling
2021-04-10AK+Everywhere: Make StdLibExtras templates less wrapper-yAnotherTest
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. :^)
2021-04-06Kernel+LibCore: Note whether a process is kernel mode in /proc/allAndreas Kling
2021-03-30LibCore: Add Core::File is_device() helpersIdan Horowitz
The helpers check if the file is a block device or a character device via stat and fstat.
2021-03-29LibGUI: Enable the use of font properties through GMLEdgar Araújo
You can now specify the font, font_size, font_weight and font_type (fixed_width/normal) through GML
2021-03-28LibCore: Add Timer::create_repeating convenience methodTom
2021-03-28LibCore: Make Core::Object::event() protectedAndreas Kling
2021-03-28LibCore: Add a way to install an event filter on a Core::ObjectAndreas Kling
The event filter is consulted by Object::dispatch_event() and may decide that the event should not be delivered to the target object.
2021-03-18LibCore: Verify type of value in enum property setterVyacheslav Pukhanov
2021-03-12AK+LibCore: Remove empty filesAndreas Kling
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-03-07LibCore: Add String variant for ArgsParser::add_positional_argumentspeles
This is basically the same version as const char *, but it's a nice helper that allows us to handle strings without casting.
2021-03-03LibCore+LibHTTP+LibGfx: Switch to LibCompressIdan Horowitz
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. :^)
2021-02-26Everywhere: Remove a bunch of redundant 'AK::' namespace prefixesLinus Groh
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. :^)
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...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.
2021-02-21LibCore: Add file management helpers to reduce code duplicationMițca Dumitru
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.
2021-02-17LibCore: Convert dbgprintf() => dbgln()Andreas Kling