Commit Graph

8120 Commits

Author SHA1 Message Date
Oliver Tappe b9c8e3de1b string.h: include strings.h for compatibility.
* Partly reverting hrev47655, as the moved declarations are expected
  by many ports to be accessable via string.h. 
  Following standards is a good thing in general, but not if it causes 
  more problems than it helps ...
2014-10-30 00:20:13 +01:00
Ingo Weinhold 6bbd25f071 Make vfs_resize_fd_table() accessible in the kernel
Also update some types from int to uint32.
2014-10-29 21:07:02 +01:00
Ingo Weinhold 078a965f65 vm_soft_fault(): Avoid deadlock waiting for wired ranges
* VMArea::AddWaiterIfWired(): Replace the ignoreRange argument by a
flags argument and introduce (currently only) flag
IGNORE_WRITE_WIRED_RANGES. If specified, ranges wired for writing
are ignored. Ignoring just a single specified range doesn't cut it
in vm_soft_fault(), and there aren't any other users of that feature.
* vm_soft_fault(): When having to unmap a page of a lower cache, this
page cannot be wired for writing. So we can safely ignore all
writed-wired ranges, instead of just our own. We even have to do that
in case there's another thread that concurrently tries to write-wire
the same page, since otherwise we'd deadlock waiting for each other.
2014-10-29 12:37:25 +01:00
Ingo Weinhold 9da590f73e Add vm_page_free_etc()
It additionally gets a vm_page_reservation* argument. If not NULL, the
page count of the reservation is incremented for the freed page.
2014-10-29 02:36:08 +01:00
Michael Lotz 52d500e5b4 kernel: Workaround for double lock of spinlock in user timers.
The thread that is being [un]scheduled already has its time_lock locked
in {stop|continue}_cpu_timers(). When updating the TeamTimeUserTimer,
the team is asked for its cpu time. Team::CPUTime() then iterates the
threads of the team and locks the time_lock of the thread again.

This workaround passes a possibly locked thread through the relevant
functions so Team::CPUTime() can decide whether or not a thread it
iterates needs to be locked or not.

This works around #11032 and its duplicates #11314 and #11344.
2014-10-29 00:25:37 +01:00
Adrien Destugues 4ed39e6a62 disk device manager: check that partitions are unmounted before uninitializing.
when uninitializing a partition or a disk (removing the partition
table), check that all partitions from that table are unmounted, as they
are about to become invalid.

Fixes #8827.
2014-10-28 23:52:57 +01:00
Adrien Destugues 04dbe5b1c5 safemode.h: make it usable from C code. 2014-10-28 23:52:22 +01:00
Adrien Destugues 5d5ec05b1d B*Format: make immutable and remove locking
The language and formatting conventions can now only be set when
creating the objects. This removed the needs for locking them when
formatting to avoid some other thread changing the format while it's
being used.

Adjust tests and DeskBar TimeView to the API changes.
2014-10-27 14:08:42 +01:00
Ingo Weinhold fa80e7b28f x86 kernel args: Increase number of page tables 2014-10-27 10:57:28 +01:00
Ithamar R. Adema 475f00372b ARM: remove annoying #warning
Although done with the best intentions, the usage of #warning in the
ARM build makes it hard to see what's going on, or see any "real"
warnings.

Remove at least this particularly often triggered one, so we can
have a relatively "quiet" build again...
2014-10-26 23:40:17 +01:00
Adrien Destugues 850f2d1e58 Add the at() method to C++ vectors.
* There is no reason not to have this.
2014-10-26 20:28:21 +01:00
Ingo Weinhold d228f29f6e BPackageManager: Add SetDebugLevel()
Sets the debug level of the solver.
2014-10-26 00:19:35 +02:00
Ingo Weinhold 74b582a4e5 BSolver: Add SetDebugLevel()
In LibsolvSolver set the debug level of the pool.
2014-10-26 00:19:35 +02:00
Axel Dörfler 50d274f7f9 fs_shell: Added missing new permission check function.
* Fixes the build.
2014-10-25 19:31:15 +02:00
Axel Dörfler 5a95af70a2 vfs/{b|btr|package|b}fs/ext2/exfat: common access check.
* Added VFS helper function check_access_permissions() that combines
  several partially correct versions to the one true version (tm).
* All but BFS (since recently) missed the S_IXOTH for root on directories,
  and all but packagefs missed proper group handling.
2014-10-25 18:47:15 +02:00
Michael Lotz e9922e775f haiku_loader: Fix wrong size of gBootGDT on x86_64.
The BOOT_GDT_SEGMENT_COUNT was based on USER_DATA_SEGMENT on both
x86 and x86_64. However, on x86_64 the order of the segments is
different, leading to a too small gBootGDT array. Move the define to
the arch specific headers so they can be setup correctly in either case.
Also add a STATIC_ASSERT() to check that the descriptors fit into the
array.

Pointed out by CID 1210898.
2014-10-22 21:06:07 +02:00
Adrien Destugues 015a928b88 Notifications: use a single settings file.
There were 3 setting files, each an archived BMessage. Now there is only
one with all the data inside.
* Rework the SettingsPane class to save and load settings from a
message, rather than having each panel pick a file path on its own
* Move saving the app filters to the preference app, rather than the
server (so it's done at the same place as other settings)
* Rework loading prefs in the server so the settings message is read
from the file once and all settings are loaded from it.

This turns out to be more changes than I anticipated.
Fixes #9424.
2014-10-21 18:53:06 +02:00
Adrien Destugues 9bf4e99477 BUrl: IDNA ToUnicode and ToASCII conversions.
* Since DNS are normally restricted to ASCII, the use of UTF-8 in domain
names is implemented using a "punycode" encoding.
* The request to the DNS server must be sent with the ASCII
representation of the domain name, however the Unicode one should be
used for user-visible parts.
* ICU provides an implementation of the conversion, which we use here.
* Conversion is currently done in-place and modifies the BUrl object
(this is similar to UrlEncode/UrlDecode).
* Adjust existing IDN test to make use of these methods. It's passing
now.
2014-10-21 14:43:13 +02:00
Adrien Destugues 06f436b3ac Use strict mode when url-decoding file requests.
We don't want '+' to become a space here.
Fixes #11109.
2014-10-21 11:31:48 +02:00
Adrien Destugues 9c5d1aa295 Fix infinite recursion in agg when drawing bezier with invalid points
* Patch extracted from http://trac.osgeo.org/mapserver/ticket/3862
* Fixes #6738
2014-10-20 15:54:58 +02:00
Adrien Destugues b10790de44 Radeon: fix warnings on 64bit. 2014-10-19 12:51:53 +00:00
Adrien Destugues 13af65c402 intel_extreme: fix warnings on 64bit. 2014-10-19 12:51:51 +00:00
Adrien Destugues a7f7bf3dc9 Radeon: fix warning. 2014-10-19 11:49:53 +02:00
Adrien Destugues 00640ac82e Forgot to fix LDBL_MIN... 2014-10-15 13:08:10 +02:00
Adrien Destugues 1f792e1852 gcc2 float.h: use decimal floats. 2014-10-15 11:29:54 +02:00
Adrien Destugues 7f6fdce3c1 Update haiku copy of gcc2 float.h
Shouldn't be needed, but we may as well use the correct version here
too.
2014-10-14 22:11:27 +02:00
Adrien Destugues bdb4ae32fd Fix unarchiving of BScrollView with layout
* We archive views using "managed" archives, and the children are not
attached in the BView(BMessage*) constructor, but later. So it's not
possible to find the target and scrollbars in the constructor of
BScrollView.
* Make BScrollView override AllUnarchived and find the target and
scrollbars again there. The code is slightly different as there is no
guarantee that the first child will be the target in that case. The
existing code in the constructor is preserved for non-managed archives.
2014-10-12 16:02:34 +02:00
Adrien Destugues 4cada3807c BDragger: add layout-aware constructor.
Somehow no one needed this yet.
2014-10-11 11:18:56 +02:00
Adrien Destugues 26b0a53d12 Add parsing support to BTimeFormat. 2014-10-09 13:35:23 +02:00
Adrien Destugues 961fdd8cc3 BMessageFormat: parse the pattern at construction
* Instead of parsing the pattern everytime Format() is called, parse it
only once when the object is created.
* Adjust all callers to make use of the feature and reuse the instance
as much as possible. This also allows calling B_TRANSLATE only once
instead of everytime the formatting needs to be done. We use either a
static instance (when the message pattern is constant) or a field (when
it is not known to be constant).
* Since the BMessageFormat instances are now reused, add locking to
avoid race conditions (ICU itself is thread safe, but the format pattern
is recreated when the locale is changed)
2014-10-08 15:12:48 +02:00
Adrien Destugues 97d07c8af2 Add API for parsing dates. 2014-10-07 17:40:18 +02:00
Adrien Destugues 090a0d7686 Add an API to get month names. 2014-10-07 16:08:22 +02:00
Adrien Destugues 4a3a474224 Reimplement BDateTimeFormat using ICU support
* Avoid hardcoding the format to "date, time"
* Allows using DateTimePatternGenerator to create custom formats from a
set of fields.
2014-10-07 13:06:40 +02:00
Adrien Destugues 0da7796e6c Add BMessageFormat class.
This can be used to format complex messages properly. It moves the
complexity of handling plural forms, gender, and anything else needed
into the localizable string, rather than hardcoding it in the code.

This moves the difficulty of handling these things properly to people
doing translations, rather than relying on developers to do it.

Fixes #10755, but our localization must now be updated to make use of
the feature.
2014-10-07 08:51:23 +02:00
Adrien Destugues 136884d011 Remove references to NumberFormatImpl.
The class and header file are gone, so don't try to use them.
Fixes #11312.
2014-10-06 08:35:50 +02:00
Adrien Destugues e3857211d3 Move DateTimeFormat and NumberFormat out of BLocale
* ... and adjust all callers
* Remove NumberFormatImpl: we rely on ICU to provide this and it can be
fully wrapped into the C++ file. The class was a stub anyway.
* "Monetary" format is included in NumberFormat for now. There may be a
more generic solution to handle monetary and BTimeUnitFormat (and other
arbitrary units)
2014-10-02 09:19:54 +02:00
Oliver Tappe 3006031ac2 Move Geolocation to kits/shared and make it private. 2014-10-02 00:32:48 +02:00
Adrien Destugues 03b2550ef1 Move time formatting to BTimeformat.
* Harmonize API for all B*Format to take an output BString by reference
as the first parameter,
* Move the FormatTime methods from BLocale to BTimeFormat
* Adjust all callers for BTimeFormat, BTimeUnitFormat and
BDurationFormat.
2014-10-01 18:13:35 +02:00
Adrien Destugues 44f11d0982 Make BDateFormat inherit from BFormat again
* Move relevant parts up into BFormat so other format classes can use
those
* Adjust BDurationFormat and BTimeUnitFormat for the changes
* Remove the "default" date format, it is better to keep only a default
locale and let applications create B*Formats from it as needed.
* Creating a B*Format without arguments to the constructor now
configures it for the default locale, which allows for easy use in
standard cases (formatting something with the current language and
format)
* Creating a B*Format is potentially an expansive operation, it is
advised to keep the instance around and reuse it whenever possible.
However it must be "refreshed" when the locale changes, for apps which
supports that, since it keeps a copy of the language and formatting
convention, rather than a pointer to the locale as it did before.
2014-10-01 16:29:12 +02:00
Adrien Destugues 13d147b12b Introduce "invalid" text controls.
* MarkAsInvalid is used to enable or disable the mark
* The B_INVALID BControlLook flag is used
* invalid BTextControls are drawn with a red border.
* You ar encouraged to let the user know more precisely what's wrong, by
showing an helpful error message next to the control or in a tooltip.
2014-10-01 12:12:16 +02:00
Adrien Destugues afd5ec11d2 Add setters to BDate and BCalendarView
* BDate setters don't perform any validation, use with caution.
* BCalendarView setters do perform validation checks, and will adjust
the day so it fits the requested month or year.
* Add tests for the BCalendarView setters.
2014-09-30 15:38:24 +02:00
Adrien Destugues 526d483999 Make BDateFormat mutable
* Add setters for the language and formatting conventions
* Add shortcut getter and setter for the date format
* Use those in the locale roster to make the BDateFormat actually use
the system preferred language and format.
* Applications can also use this to extract specific information from
the system format (eg. set date format to "LLLL" to extract month
names), or define specific formats more easily (eg. for parsing and
generating e-mail headers or HTTP cookies).
2014-09-30 11:49:47 +02:00
Adrien Destugues f188c1defa BDateFormat: improve API
* Use a reference rather than a pointer for the output string, removing
the need for NULL checks (which were missing, anyway)
* Adjust callers to that change
* Add new Format variant taking a BDate argument
2014-09-30 09:47:02 +02:00
Adrien Destugues 1d38b7a86a Geolocation: avoid static init of BUrl
* Fixes #11290.
2014-09-27 19:20:39 +02:00
Adrien Destugues 2a5e33a980 Move date formatting from BLocale to BDateFormat
* There is a little code duplication. This will be moved to BFormat once
the time and datetime formatting is also moved out of BLocale
* The way to create a BDateFormat from a BLocale is still open for
discussion. I'm undecided between making BDateFormat a member of
BLocale, or adding a BDateFormat(const BLocale&) constructor.
* Adjust all users of the API.
2014-09-26 18:31:11 +02:00
Adrien Destugues 2f36873105 UrlRequest: add empty SetTimeout for ease of use.
* Requests that support this can implement it, NetworkRequest does
* Build fix: no need to return status_t.
2014-09-26 15:51:36 +02:00
Adrien Destugues 654ae69aa6 NetworkRequest: add a SetTimeout method. 2014-09-26 15:21:54 +02:00
Paweł Dziepak ac97d35790 kernel/arch: remove leftover debug message
Polite fault handlers are nice, but we like the silent ones even more.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-25 21:57:32 +02:00
Adrien Destugues 13f0458896 Add BGeolocation experimental API.
A BGeolocation object can query an online service to get geolocation
and geotagging data:
 * LocateSelf() tries to locate the machine it is running on, by using an
online database of wifi access points
 * Locate() (not yet implemented) searches a BString and converts it to
lat/lon coordinates (reverse geotagging)
 * Name() (not yet implemented) finds a suitable name for the given
coordinates (address, building name, or anything fitting).

The default service used is openbmap.org, which is freely available but
not very accurate. A request has been sent to Mozilla to use MLS
(Mozilla Location Services), which is a bit more accurate but needs an
API key. MLS is used for geolocation on FirefoxOS, for mobile phones
which don't have a GPS, and the data can be contributed by Firefox for
Android or the dedicated MozStumbler app.

Alternatively, Google Maps also provide the service, but wants
people to pay for it. Google Maps data is more accurate as all Android
devices contribute data to it.

All 3 services use the same JSON-based API: we send a list of reachable
Wifi APs (mac address and signal strength), and we get lattitude and
longitude information, and possibly extra data which will currently be
unused.

This can be used to implement HTML5 geolocation with reasonably accurate
results, but it can also be used in other places. For example
FirstBootPrompt could try to guess a list of most likely languages and
keyboard layouts from it (if wifi is working at install time, that is).
2014-09-23 16:37:59 +02:00
Stefano Ceccherini d553b90c86 BSynth/BSoftSynth: implemented GetAudio().
Patch by Pete Goodeve (modified by me, hopefully for the better and
without introducing bugs) which implements BSynth::GetAudio().
2014-09-21 19:46:04 +02:00