Commit Graph

64853 Commits

Author SHA1 Message Date
Augustin Cavalier
79bc16ba6e Rewrite <netdb.h> and drop a lot of non-standard stuff.
While the BSDs and glibc seem to have various _r functions,
they all return int for errors instead of a pointer, making ours
exactly backwards of theirs for error reporting and thus useless.
So, remove them from the header entirely. They are left in
for ABI backwards compatibility for the time being.

A few constants not used by anything in the tree (i.e. not actually
implemented by libnetwork/netresolv) were also dropped. Some deprecated
or non-standard functions were placed behind _DEFAULT_SOURCE or deleted
entirely.

The header itself is now organized approximately as the BSDs do,
although with various Haiku-isms instead of BSD-isms where appropriate.
2023-02-27 22:51:17 -05:00
Augustin Cavalier
9ae547b297 data/network: Use ports & services files from OpenBSD.
This cuts out a lot of unnecessary protocol entires found in the
longer NetBSD (and originally from ISC) lists. This data is used
in the implementation of getservent(), etc.
2023-02-27 22:01:12 -05:00
Augustin Cavalier
6d36f6bfad netdb: Drop definitions for getipnodeby...
We do not actually export them, or even have source for them in-tree.
2023-02-27 21:11:49 -05:00
PulkoMandy
dd8d24ee62 build: remove most of MathRules.
We shouldn't be doing these crazy things.

The only usage of this is the NextID rule which computes an unique
number by incrementing a variable. This is used for example to generate
names for the extra files used in xattr emulation.

But we certainly don't need multiplication, division, etc. That's better
done in scripts (Python, for example) in rule actions. So keep just
enough of this for NextID to work, and we could probably make it even
simpler.

Change-Id: Id06d4f5e236205203fe8d604de440753b63801bc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6088
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-26 00:54:53 +00:00
Máximo Castañeda
e70df3f778 app_server: AppFontManager does not need a BLooper
Saves at least a thread and a few semaphores per app.

Change-Id: Ied43e5944471918b34b897722346a25d159090df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6073
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-25 11:34:57 +00:00
Máximo Castañeda
6ae6a38e53 app_server: refactor font managers
Move common add/remove code to the base class and improve encapsulation.
Loading FreeType is the responsibility of the global font manager.
Rename FontManagerBase back to FontManager.

Change-Id: I9396112f01583e19d03011106fd1fa1e37958ee8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6072
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-25 11:34:46 +00:00
Máximo Castañeda
76b2fd5bed app_server: include the manager in the font cache key
App-loaded fonts get the same IDs for different apps, so the cache
entries can be easily overwritten or used for an unexpected font. The
FontManager adds a unique chunk to the string.

Change-Id: I67ea9971784f425370d1aad516af4dae8489c45b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6071
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-25 11:34:46 +00:00
Autocomitter
f369023834 Update translations from Pootle 2023-02-25 08:18:28 +00:00
Augustin Cavalier
08f748dea7 Deskbar: Remove B_TRANSLATE_SYSTEM_NAME and leave a comment as to why.
Fixes #18206. Related to #18251; a better way to accomplish finding
views without scripting should be added, really.
2023-02-24 11:38:20 -05:00
Augustin Cavalier
36e200e2e0 sys/uio: Add preadv/pwritev.
Fixes #18243.

Change-Id: Ib5867f86100430f5e5c43ce4b2d6d561f546cc1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6068
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-24 16:31:51 +00:00
Jim906
429e730135 mount_server: remember read-only attribute
* Record the read-only status of a partition in settings/mount_server
  so it will be applied if automatically mounting on next boot.
* Fixes #18081.

Change-Id: Idd7267fd356f35689bb6ad79de4a45bf071164f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6080
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-24 15:59:15 +00:00
Alexander von Gluck IV
8eb9f41407 data: Drop ARM FDT dts from repo
* We depend on FDT passed to the bootloader now
  from EFI or u-boot via fdt_addr_r now
* We leave an fdt path within the boot partition
  (for now) to allow / encourage users to optionally
  plug in their own DTB's for troubleshooting. (only
  on u-boot loader)

Change-Id: I3f2d81b60d46f388f333d5caa27aa77e6e36447d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6081
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Tested-by: Automation <automation@haiku-os.org>
2023-02-23 18:24:21 +00:00
Augustin Cavalier
4c442eb0b8 remote_disk: Fix B_GET[_BIOS]_GEOMETRY ioctls.
They were incorrectly modified in	688acf41a3.

Fixes #18277.
2023-02-22 16:13:21 -05:00
PulkoMandy
5f88744263 BMenuField: allow to use non-fixed size in combination with layout mode
In fixed size mode, the menu field always uses all the available width.
In non-fixed size mode, the menu field will resize itself to be as small
as possible.

With layout, usually the difference isn't noticeable, since the layout
will already try to resize the control to the smallest possible size.
But there are a few cases where it makes a difference, when the layout
is over-constrained and the menu field can't be made as small as
possible. In that case, the menu field would be forced to fill its
allocated space, where we can instead make it a little smaller.

Change-Id: I911d497218a09aab3824865968558df5d4b3cf98
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6076
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-21 10:47:46 +00:00
Pascal Abresch
40a7fe3f68 Api docs: style search
Change-Id: I11cf0ae20ff7fc34dd2facaba462f5851efea050
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6078
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-21 10:47:03 +00:00
PulkoMandy
fc2f1a3247 BMenuField: remove deprecated constructors
These were introduced by mistake during the addition of the layout
system. They have been private since 2011. It seems safe to assume that
nothing uses them anymore and they can now be removed safely.

Change-Id: I98d030096f9cb06fccc25233fe4da17d0213050e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6075
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-18 17:20:27 +00:00
PulkoMandy
3cc1da2b77 BControl: fix big-endian bitmap handling for control icons
The code is endian-dependant because the alpha channel is not at the
same place. This resulted in transparent white in icons being converted
to partially transparent yellow when attempting to darken the icons, for
example.

Change-Id: I57916139ba37b8d7ae0f9e9ba9e74c1d496d7b05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6077
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-18 17:16:14 +00:00
Augustin Cavalier
dc509bfab4 fs_shell: Use proper readv/writev functions on Haiku hosts.
Fixes #18269.
2023-02-18 11:38:48 -05:00
Pascal Abresch
9a91a72662 Api docs: dark mode
Change-Id: I46538353f38902b58937286a9e32167424fc7d0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6074
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-18 16:08:12 +00:00
Autocomitter
98a5975248 Update translations from Pootle 2023-02-18 08:15:53 +00:00
Augustin Cavalier
050515f6ae BFS: Fix missing trim of last range in a corner case.
The previous logic of _AddTrim plus _TrimNext meant that if a trim
range was specified in the final call to _TrimNext (i.e. with force=true),
but the trim buffer was already full at that point, that last range
would not actually be trimmed.

Now, _AddTrim returns true when the buffer is filled and trimming
should be done, rather than delaying it and requiring a second
add after trimming.

Change-Id: I4b782948e8dc9267c63e61bce0c078fd4e834177
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6070
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-17 20:21:24 +00:00
vaibhavg20comp
ba9ce9c13b termios: Added cfsetspeed function.
BSD extension to set both the input and output speed of a termios
structure.

Fixes #18220.

Change-Id: I8c4a06b4be4aa55b8ce35cb7f62552fc47a8e8d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6049
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-02-17 16:16:39 +00:00
Jérôme Duval
8aadf2e84a setvolume: implement some common features
unmute when increasing volume, mute at the minimum volume, don't decrease volume when muted

Change-Id: Ifd671b2a8d7d8a4da2bc15adc18f9aa7c46e66d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6017
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-16 11:40:17 +00:00
Augustin Cavalier
c97648aad1 docs/user: Use Doxygen's internal search system.
Fixes #17209.
2023-02-15 16:49:45 -05:00
Augustin Cavalier
f7b2278e28 docs/user: Update Doxyfile to Doxygen 1.9.6.
Automated conversion via "doxygen -u". No changes to settings otherwise.
2023-02-15 16:45:53 -05:00
Augustin Cavalier
06cf64e90c fstrim: Pretty-print the trimmed size in addition to showing raw byte counts.
Also do not bother printing sizes if we are exiting without success
and nothing was reported as trimmed.
2023-02-15 16:11:35 -05:00
Augustin Cavalier
1572bf59b7 nvme_disk: Use the correct length value in the total-trimmed calculation.
We want to return the total trimmed size in bytes, not blocks.
Fixes incorrect trim size reporting under NVMe devices.
2023-02-15 15:30:24 -05:00
David Karoly
1831c1c60d libroot/crypt: remove selectsmix
There's only one implementation of smix so we don't
need any selection logic.

Change-Id: Id43e4ed49ee5a96755c3c4ab975bd128024e57b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6065
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-14 20:32:20 +00:00
Adrien Destugues
0849c914a7 xfs: Enable -Werror, fix all warnings
Define a dedicated OnDiskData structure for each on-disk structure. This
must match the on-disk layout, except for endianness, which is handled
by _SwapEndian methods. These structure are "plain old data" so we can
use offsetof on them. They are wrapped in an easier to use C++ API.

This resolves a lot of problems with the previous code: warnings caused
by the use of offsetof as well as a much simpler instanciation of the
objects from on-disk data.

Also fixed another problem with UUIDs, where the UUIDs were handled by
pointers in a lot of place where it was not necessary. Use references
instead. The V4 structures which don't have an UUID will return a "null"
(zero-filled) one.

Change-Id: Ifb2bf6ab94906ca50410dd3446d3566615392ca2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6021
Reviewed-by: Raghav Sharma <raghavself28@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-14 15:36:25 +00:00
Augustin Cavalier
66196a82f2 libroot_build: Correct read/write[v] functions.
The previous change was not tested thoroughly enough, it seems.
2023-02-14 01:59:31 -05:00
Augustin Cavalier
5e9fd9f60d libroot_build & fs_shell: Provide _kern_ functions for readv/writev...
..instead of readv_pos/writev_pos. This way, we can be sure that we
are remapping them properly even under Haiku, as well as remove some
potential confusions.

bfs_shell seems to still work fine on a regular build.
2023-02-14 00:49:52 -05:00
Augustin Cavalier
81458ef8a6 kernel/vfs: Remove read sizing hack in common_file_io_vec_pages.
All drivers using IORequest should have any problems here already caught
by it, and overruns in other drivers would overrun the buffer and cause
corruptions, so we should no longer silently be ignoring this,
presuming it is still a problem at all.

As the TODO comment indicated that this logic could also be used for
writes if this wasn't a problem, I have added a separate TODO for that.
2023-02-13 23:12:23 -05:00
Augustin Cavalier
478c8c847d Drivers.h: Rename device_{read|write}_pages back to device_{read|write}v_hook.
They are not about reading and writing pages, but just iovecs.
As the passed iovecs use void*s, it can't possibly be working with
physical pages on 32-bit systems with PAE.

It appears nothing uses or implements these functions anyway,
as there was nothing else in the tree I had to adjust after making
this change...
2023-02-13 23:05:16 -05:00
David Karoly
6b8403b44b libroot/crypt: replace crypt_des implementation with musl's
This is required to make crypt_r() really reentrant.

Change-Id: I81497be16cae21fabb5895a88e27e6c20d3e06e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6066
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-13 19:38:56 +00:00
Máximo Castañeda
46f36ae4e0 app_server FontManager: remove not owned family deletion
On adding a font, we may or not have other faces of the same family, so
we may be trying to add the new face to an already managed family. In
that case, we can't delete it when we get an error inserting the new
style.

This same code was already in place before the user fonts, but it's much
more unlikely to trigger, except maybe on purpose. A later patch
refactoring a bunch of things will join both into the base class.

Fixes #18169

Change-Id: I78053b6e941c18b952fc2bd64f393e26d3d53b0a
2023-02-13 11:49:09 +01:00
Máximo Castañeda
b5c5eec531 app_server: don't return FreeType errors
They don't code Haiku errors and they are positive.

Change-Id: Ibd9da5251117e8883262d8880bad3c88eea6c4a9
2023-02-13 11:49:09 +01:00
Alexander von Gluck IV
1a76488fc8 servers/index: Fix broken CatchUpDone logic; get vs set ptr
* warned about by gcc compiling Haiku under Haiku

Change-Id: I40cd5a2cdaf6a4a346883f6f6060a5a729bc3117
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6064
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-13 01:04:05 +00:00
Máximo Castañeda
88b5bdf748 app_server: fix dangling references in user fonts
Change-Id: I213959b407245c6c0eb1208ebea7145f699366fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-12 08:47:36 +00:00
Máximo Castañeda
85d52d335d app_server: push FontManager knowledge to FontStyle creation
Change-Id: I98a68a894642147d398faf22591a22afef4c3ba2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6060
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-12 08:47:36 +00:00
Máximo Castañeda
cb190a7dee app_server: new font code cleanup: includes and the like
Change-Id: I4b7f882fffc34be1984060838f13971c48d4abfc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6059
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-12 08:47:36 +00:00
Pascal Abresch
229a173c6e Mail: respect system text & Link color
Change-Id: I0e37f640decb69a43ee12389af36c70c3821d548
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6062
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2023-02-11 18:53:58 +00:00
Jessica Hamilton
49df70db7a build: include zstd_devel in Development optional package.
* zstd_devel is now required for building Haiku.

Change-Id: I75f6482322b01c5e675c93ec04a9584ca21f95d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6055
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-10 19:15:28 +00:00
Jim906
5214106737 WebPositive: draggable page icon
* Enable user to drag the WebPositive web page icon to the bookmark
  bar to create a bookmark there, or drag it to a Tracker window to
  create a bookmark in the displayed directory.
* Send a message to the drag target that can be handled by Tracker's
  generic drop routine.
* Overload _CreateBookmark with a more flexible version and a
  _CreateBookmark(BMessage*) that handles both the icon being dropped
  on the bookmark bar, and the message that Tracker sends if the icon
  is dropped on Tracker.
* Account for the fact that, when _CreateBookmark(BMessage*) is called,
  Tracker may or may not have already determined the file name to use and
  created the file, depending on whether the icon was dragged to
  Tracker or not.
* Use page-specific small and large icons for the bookmark file, if
  they are available (currently Haiku WebKit doesn't seem to provide
  them though).
* Follows CharacterMap as a model for dragging an icon and ShowImage
  for dragging to Tracker.
* Fixes #10795.

Change-Id: I7f32013cc1372dab1894b5d92335d3a4cbfb671f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6007
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-10 19:15:04 +00:00
Dale Cieslak
88f36b2dd9 FontManagerBase: remove families from BObject list when deleting them
possibly related to #18169

Change-Id: If878109e7d739494d71ff97447de6bdeaa9f905d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6056
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-10 19:13:10 +00:00
David Karoly
125b262675 libroot: introduce crypt_r
Change-Id: Ieacd1b383ac078a440227c7954f5531a36fbbd62
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5827
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-10 18:00:44 +00:00
Máximo Castañeda
c83c6cde11 tests/app_server: fix loop direction
Change-Id: Ifb9324a8cd5d9cf4c2ed2016cd597673955007e7
2023-02-10 12:53:30 +01:00
Oscar Lesta
b4567c396c acpi_lid: avoid possible memory leak
Also: removed a now unnecessary line-break.

Change-Id: I86ceda3a437d075ff8a611df1a93cceefe3ce82b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6054
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-02-09 18:17:09 +00:00
PulkoMandy
96e28a400a googlefs: De-Googlize, rename to WebSearchFS
DuckDuckGo terms of use say "don't use our name for your app", so go for
a generic "Web Search". Mention them in the README, however.

Their terms of use say "don't remove our branding", but the results from
the HTML page have pretty much no branding. There's a logo at the top of
the page, but the terms of use also say "don't use our logo". So I guess
we're fine here.

Change-Id: Ib24a95faf4e727769ae00c1cb74fab79abde0379
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5498
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-08 18:42:37 +00:00
PulkoMandy
5a369046a3 googlefs: use DuckDuckGo HTML search page
This is much easier to parse. The only downside is it is HTTPS only, so
we can't do this in the kernel. But it works well as a userlandfs
filesystem.

TODO: rename and replace the icon. Make it clear that the replies are
generated by DuckDuckGo (we can add this in the README file exposed by
the filesystem for example)

Change-Id: I7cdbe7d71d63f3ab742f21dc55fb9df7b16da7df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5495
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-08 18:42:37 +00:00
Oscar Lesta
a780ec8653 acpi_ac: update "last_status" on acpi_ac_notify_handler()
* Extracted an "acpi_ac_update_status()" function.
* Use that for both "acpi_ac_init_driver" and "acpi_ac_notify_handler".

This ensures that "acpi_ac_read()" returns the correct (current) status.

Change-Id: I4f8f35037180c10fe507b9abfda3a8a169349c13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6048
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-08 18:01:01 +00:00