Commit Graph

5176 Commits

Author SHA1 Message Date
Hamish Morrison
683cf2ff58 BMediaRecorder: fix a few issues, fix style, remove unused SoundUtils
* Use the preferred time source (GetTimeSource) for the node
* Fix node releasing when creating the connection fails
* Add virtual slots and padding
* Refactor _Connect method
2015-01-12 18:31:27 +00:00
Barrett
739fd34cf5 Replace SoundCounsumer with modified BMediaRecorder.
Signed-off-by: Hamish Morrison <hamishm53@gmail.com>
2015-01-12 18:31:20 +00:00
Adrien Destugues
3395fdcd6a gcc4 build fix.
* offsetof is not allowed on non-POD types so we need to use
offset_of_member (gcc2 accepts offsetof, and C++11 relaxed the
constraints on where it is allowed so it should work there too)
* we have offset_of_member as a workaround until we switch to C++11,
move it from khash (which is soon to be removed) to list.h which is the
other place where it is used (for this one single call in our whole
codebase)

Also fix a typo in vfs.cpp.
2015-01-12 19:04:33 +01:00
Adrien Destugues
6235b4967b More useless inclusions of khash.h 2015-01-12 18:23:45 +01:00
Adrien Destugues
955d5259d0 Rewrite sample HashTable description to use the typedefs
This makes the code more readable (as KeyType and ValueType are clearer
than int and Foo) and easier to copypaste and edit.
2015-01-09 18:09:11 +01:00
Dario Casalinuovo
14896b937a Implement BMediaRoster::RollNode().
Fixes #9083.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>
2015-01-08 08:57:01 +01:00
Axel Dörfler
1da1e5a166 Renamed BodyDownloadConfig to BodyDownloadConfigView. 2015-01-06 15:23:15 +01:00
Axel Dörfler
57b305558b MailProtocolConfigView now is a BMailSettingsView.
* Changed the private settings base classes to follow the new style.
* Made BodyDownloadConfig use the layout API.
* Adapted SMTP to these changes.
2015-01-06 15:23:06 +01:00
Axel Dörfler
bcf60bbb83 Fixed Mail build.
* The former kMsgBodyFetched (now B_MAIL_BODY_FETCHED, following the other
  message constant names in AppDefs.h) must be public.
2015-01-06 15:22:18 +01:00
Axel Dörfler
146357b547 Completed transition to the new mail API; ie. it compiles.
* Completely untested yet. Unlikely to work yet.
2015-01-06 15:21:55 +01:00
Axel Dörfler
383b34adac Moved ProtocolConfigView to headers/private/mail.
* This is by no means meant as a public header.
2015-01-06 15:21:50 +01:00
Axel Dörfler
715bf3d17a Work in progress of mail rework.
* Not everything compiles; all protocols, and inbound filters do, though.
* Renamed a few classes to give a better idea what they are for; prefixed
  public classes with the 'B' prefix.
* Moved ProtocolConfigView's classes into the BPrivate namespace.
* Moved BMailFilter into its own file.
* Added BMailFilter::DescriptiveName(). This is now used by the RuleFilter
  in order to give a description of what it's doing (ie. no more dozens of
  "Rule filter" entries in the preferences).
* Removed no longer used MailAddon.h.
* Renamed Addon to AddOn where found, since that is more consistent with the
  rest of the API.
* Merged the former MailProtocol with the former MailProtocolThread; the
  differentiation between those two was pretty messy.
* All configuration views touched so far are now using the layout kit.
* The RuleFilter is currently broken functionality wise; I have not yet decided
  how to solve the stuff it uses (TriggerFileMove() does not exist anymore,
  for example).
* BMailAddOnSettings (formerly known as AddonSettings) now directly subclass
  BMessage; there are no Settings() and EditSettings() method anymore. The
  class uses a copy of itself to determine whether or not it has been changed.
* Lots of cleanup.
2015-01-06 15:21:36 +01:00
Axel Dörfler
9192d4dcf3 Started working on the IMAP add-on itself.
* Renamed imap_config.cpp to ConfigView.cpp, IMAPFolderConfig.(h|cpp)
  to FolderConfigWindow.(h|cpp).
* Got the latter to build.
* Added Settings class to simplify and unify the BMessage based
  settings access.
* Removed the InboundProtocol[Thread] implementation from the build for now.
2015-01-06 15:20:35 +01:00
Jérôme Duval
d6aaebc757 x86: added two MSR definitions. 2014-12-23 19:14:52 +01:00
Puck Meerburg
e4e2ce4ce3 When testing screensaver, don't have mouse move exit the screen saver.
Fixes #7463

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>
2014-12-10 21:18:30 +01:00
Theodore Kokkoris
249a4944c3 Removed dead code (CID: 1255314) 2014-12-03 21:14:24 +01:00
John Scipione
539dc1bc53 A bunch of style fixes
No functional changes intended
2014-12-02 19:23:51 -05:00
Adrien Destugues
af218cc4e1 Notifications default to enabled on first boot.
* The server did this right, but the preflet would not check the
checkbox when there was no settings file.
2014-11-25 08:50:47 +01:00
Adrien Destugues
1d48729397 There is no B_PRIdTHREAD 2014-11-17 19:18:55 +01:00
Adrien Destugues
2922c4ab90 userlandfs: more 64bit fixes. 2014-11-17 18:51:49 +01:00
Adrien Destugues
5b1f411f57 UserlandFS: 64-bit fix. 2014-11-17 10:58:03 +01:00
Augustin Cavalier
0a74147e1d BToolbar: Allow the toolbar's orientation to be set by its creator.
I already made this patch in Heidi's clone of BToolbar. Adding it here
allows me to drop Heidi's version altogether.

I also relicensed the header file at the permission of Stephan. The .cpp
file still lists him as author and copyright holder.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-11-10 13:21:13 +13:00
Alexander von Gluck IV
57bc65034a Everything: Update lots of code to use B_COUNT_OF macro
* Likely not everything, but the obvious uses of B_COUNT_OF
2014-11-09 14:52:19 -06:00
Jessica Hamilton
9f8197a872 BToolbar: move into BPrivate namespace, as it's not public yet 2014-11-06 16:44:02 +13:00
Augustin Cavalier
6d93638b37 ToolBarView: rename to BToolbar and move to libshared.
Also adjust ShowImage for this, it's the only thing that's using ToolBarView
right now.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-11-04 12:45:47 +13:00
Michael Lotz
bf685cdf2e kernel: Fix missing reference release in CreateThreadEvent.
CreateThreadEvent::DoDPC() missed a reference release to balance the
acquired reference before queuing the DPC, resulting in the
CreateThreadEvent objects being leaked.

This also removes the destructor that tried to cancel the DPC. Since
the class is reference counted and only destroyed when the DPC has
run and released the last reference, this didn't make much sense.
2014-11-01 16:32:04 +01:00
Michael Lotz
6a80e6889a kernel: Fix missing reference to team/thread in signal events.
The signal to the team/thread is only actually sent in a deferred
procedure. To ensure that the team/thread stays valid between the DPC
being queued and it actually running, we need to acquire a reference.

Fixes #11390, where the DPC was run after the team was already
destroyed.
2014-10-31 16:16:37 +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
Ingo Weinhold
fa80e7b28f x86 kernel args: Increase number of page tables 2014-10-27 10:57:28 +01:00
Ingo Weinhold
d228f29f6e BPackageManager: Add SetDebugLevel()
Sets the debug level of the solver.
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
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
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
Oliver Tappe
3006031ac2 Move Geolocation to kits/shared and make it private. 2014-10-02 00:32:48 +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
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
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
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
Jessica Hamilton
fd7f53f049 storage kit: don't expose the dev_t in BPartition::Mount()
Comments to #9672 agree that there's really no need to
expose the dev_t handle, thus simplifying the API.

The dev_t handle, if required, can be retrieved via
BPartition::GetVolume() instead.
2014-09-15 16:28:41 +12:00
Paweł Dziepak
95e97463d2 kernel: add generic wrapper for accessing user memory
This patch adds user_access() which can be used to gracefully handle
page faults that may happen when accessing user memory. It is used
by arch_cpu_user{memcpy, memset, strlcpy}() to allow using optimized
functions from the standard library.

Currently only x64 uses this, but nothing really is arch specific here.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 22:39:07 +02:00
Paweł Dziepak
396b74228e kernel/x86_64: save fpu state at interrupts
The kernel is allowed to use fpu anywhere so we must make sure that
user state is not clobbered by saving fpu state at interrupt entry.
There is no need to do that in case of system calls since all fpu
data registers are caller saved.

We do not need, though, to save the whole fpu state at task swich
(again, thanks to calling convention). Only status and control
registers are preserved. This patch actually adds xmm0-15 register
to clobber list of task swich code, but the only reason of that is
to make sure that nothing bad happens inside the function that
executes that task swich. Inspection of the generated code shows
that no xmm registers are actually saved.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
b41f281071 boot/x86_64: enable sse early
Enable SSE as a part of the "preparation of the environment to run any
C or C++ code" in the entry points of stage2 bootloader.

SSE2 is going to be used by memset() and memcpy().

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
f2f91078bd kernel/x86_64: remove memset and memcpy from commpage
There is absolutely no reason for these functions to be in commpage,
they don't do anything that involves the kernel in any way.

Additionaly, this patch rewrites memset and memcpy to C++, current
implementation is quite simple (though it may perform surprisingly
well when dealing with large buffers on cpus with ermsb). Better
versions are coming soon.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
6156a508ad kernel/x86[_64]: remove get_optimized_functions from cpu modules
The possibility to specify custom memcpy and memset implementations
in cpu modules is currently unused and there is generally no point
in such feature.

There are only 2 x86 vendors that really matter and there isn't
very big difference in performance of the generic optmized versions
of these funcions across different models. Even if we wanted different
versions of memset and memcpy depending on the processor model or
features much better solution would be to use STT_GNU_IFUNC and save
one indirect call.

Long story short, we don't really benefit in any way from
get_optimized_functions and the feature it implements and it only adds
unnecessary complexity to the code.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:51 +02:00
Puck Meerburg
8bfb30ceb3 BPartition: Move dev_t return value to an optional parameter
Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-09-12 18:07:53 +12:00
Ithamar R. Adema
eea45d0a32 ARM: cleanup of bootloader memory mapping
* Removes default mapping of a portion of the RAM (will be done
  as needed)
* Passes on the page directory area to kernel, so on early vm init
  the kernel can use the area for pagetable allocation.
* Leaves it to the platform to pass in physical memory range(s). This
  will ultimately come from FDT.
* Fix long standing issue with allocation of the heap, potentially
  causing other part of the bootloader to overwrite the heap.
* Implements pagetable allocator in kernel for early vm mapping.

This fixes the first PANIC seen, we now just get the same one later
on when the VM is up... more to come...
2014-09-07 20:56:15 +02:00
Ithamar R. Adema
6048591e9d Revert "Added check to ensure KDL does not include frames beyond kernel entry in the backtrace. This prevents KDL from faulting when printing backtrace on ARM."
This reverts commit 3fbb24680c.

As I mentioned in #11131, this fix is not correct, and works around
the problem. The real reason was that arch_debug_call_with_fault_handler
was not working properly, so the fault handler went crazy.

With commit eb92810 that is fixed so this can be reverted.
2014-09-07 19:15:01 +02:00
PulkoMandy
5de8dca2e4 Bootloader: fix loading of ARM ELF files
* Let the loader know about PT_ARM_UNWIND (and ignore it)
 * Allow up to 32K of space between sections of an ELF files as ARM ones
need that.
2014-09-02 18:15:50 +02:00
PulkoMandy
83f5e2a258 Fix stack alignment for bootloader.
The ARM SP is pointing to the top item of the stack, not the first free
byte. This was confusing dprintf making it fail to print 64bit integers.
2014-09-02 17:01:27 +02:00
Arvind S Raj
3fbb24680c Added check to ensure KDL does not include frames beyond kernel entry in the backtrace. This prevents KDL from faulting when printing backtrace on ARM. 2014-09-02 13:39:57 +02:00
Stephan Aßmus
ffd7c6110b JSON parser: Improve by using exceptions to get exact error
Also strip redundant "_Parser_" prefix from private methods.
2014-08-30 23:42:02 +02:00
Paweł Dziepak
4b75a1e237 kernel/x86_64: implement x86_swap_pgdir in C++
No reason not to inline this function.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-08-25 23:07:29 +02:00
Paweł Dziepak
2e2c9bd3d0 os/support: implement atomic_*() using GCC builtin helpers
If GCC knows what these functions are actually doing the resulting
code can be optimized better what is especially noticeable in case of
invocations of atomic_{or,and}() that ignore the result. Obviously,
everything is inlined what also improves performance.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-08-25 23:05:07 +02:00
Stephan Aßmus
836bf24917 Json: Don't force someone including to use BPrivate. 2014-08-24 18:08:50 +02:00
Augustin Cavalier
e4d2963e01 libshared: Introduce JSON parser and MessageBuilder.
Based on an earlier piece of source code of mine that parsed JSON into
QObjects, this JSON parser creates a BMessage tree.

Will be used by Stephan in HaikuDepot for communication with the web app.
2014-08-24 17:36:20 +02:00
Oliver Tappe
87e8603d9f Merge branch 'gcc_syslibs'
* From now on, the gcc-specific system libraries (libgcc, libsupc++ and
  libstdc++) are provided by separate packages built along with gcc:
  - gcc_syslibs contains the shared libraries (libgcc_s.so, libsupc++.so and
    libstdc++.so)
  - gcc_syslibs_devel contains the static libraries and both c++ and gcc
    headers
  The shared libraries now make proper use of symbol versioning and there
  are version-specific symlinks
* The buildsystem has been adjusted to no longer use the libraries and
  headers from the cross-compiler, but use the ones provided by the
  above-mentioned packages. The only exception is that the 32-bit libraries
  required for the bootloader of the x86_64 architecture are still taken
  from the cross-compiler.
2014-08-13 13:50:29 +02:00
Oliver Tappe
37f558d5a3 Let runtime_loader ignore RT_RELRO program headers.
* The new libstdc++.so contains program headers of type PT_RELRO (for
  making segments read-only after relocation). While the actual feature
  has not been implemented, the runtime_loader should now silently
  accept (and ignore) those program headers.
2014-08-13 13:32:45 +02:00
John Scipione
0cf10e9dce Tracker: Style fixes to NavMenu.h
Pointer style, whitespace.

Convert TrackingHookData from a class to a struct (all members public)
2014-08-10 15:04:44 -04:00
Adrien Destugues
4ad7d95bac Revert "Add sys/ucontext.h"
This reverts commit 6ddf93bfbe.

As pointed out by Ingo, those were moved to sugnal.h in the latest issue
(issue 7) of the POSIX spec. Sorry!
2014-08-09 20:18:05 +02:00
Adrien Destugues
6ddf93bfbe Add sys/ucontext.h
* Move ucontext_t and mcontext_t there as that's where POSIX says they
should be.
2014-08-09 18:37:43 +02:00
Jérôme Duval
3aeed6607c include strings.h where appriopriate...
instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949
2014-08-08 22:40:37 +02:00
Arvind S Raj
82d287ddcb Reserve 8MB space for kernel before RAM_loader
...so that kernel does not overwrite the loader.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #11067.
2014-08-08 17:39:33 +02:00
François Revol
c8826605df Guard header for use by assembler code
Somehow it ends up being used by shell.S for the verdex bootstrap.
2014-07-23 13:27:23 +02:00
John Scipione
e8c8f8536c Storage Kit: Style fixes to database_support.h 2014-07-17 14:51:31 -04:00
John Scipione
db1ef05aef BShape: Style fixes for docs 2014-07-14 19:02:44 -04:00
Ingo Weinhold
e1e6c12480 BPackageWriter::Recompress(): Change param to BPositionIO*
Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.
2014-07-13 17:57:57 +02:00
Ingo Weinhold
43a6b92c64 PackageReaderImpl: Delay reading sections until ParseContent() 2014-07-13 17:57:56 +02:00
Ingo Weinhold
1606450b32 ReaderImplBase::Init(): Make file size check optional
If the file doesn't support GetSize(), skip the header total size file
size check.
2014-07-13 17:57:56 +02:00
Ingo Weinhold
05b565f4f2 Add private BDataPositionIOWrapper
Implements the BPositionIO interface on top of a BDataIO, requiring the
{Read,Write}At() accesses to be sequential.
2014-07-13 17:57:56 +02:00
Ingo Weinhold
44c4771163 BPackageWriter: Add BPositionIO support 2014-07-13 17:57:55 +02:00
Julian Harnath
b916156a83 Move libroot synchronization functions to private namespace
* Prefix lock functions with __ to mark them as private. Add
  forwarding macros to keep existing code working.

* Avoids symbol name clashes with kernel lock APIs, occuring when
  using kernellandemu-lib in userlandfs. Thanks to Ingo for the
  suggestion.
2014-07-13 16:19:08 +02:00
Julian Harnath
2e75b75292 Fix building Haiku from Haiku
* Always include cdefs.h to have __[BEGIN|END]_DECLS defined.
  Somehow, this didn't affect cross-build, but it made building
  from Haiku fail.
2014-07-13 15:35:31 +02:00
Ingo Weinhold
8f5130edfa package kit: Actually add support for B_HPKG_COMPRESSION_NONE
Until now we always declared in the HPKG header that the package file is
zlib compressed. For uncompressed files we would just store all
individual chunks uncompressed. Now we handle completely uncompressed
files slightly differently: We don't write the redundant chunk size
table anymore. The size savings are minor, but it makes the uncompressed
format read-streamable which may be handy.
2014-07-12 23:12:21 +02:00
Ingo Weinhold
e527b79631 Switch package file accessor classes to use BPositionIO
* PackageFileHeap{Reader,Writer} as well as Package{Reader,Writer} and
  their implementation and super classes do now internally use a
  BPositionIO instead of a FD to access the package file. This provides
  more flexibility needed for features to come.
* BPackageReader has already grown a new Init() version with a
  BPositionIO* parameter.
2014-07-12 15:40:22 +02:00
Ingo Weinhold
c55a06055f Add private class BFdIO
Simple BPositionIO implementation using the POSIX API on a FD. In effect
similar to BFile, but more easily ported to kernel and boot loader (and
the FD is reusable).
2014-07-12 15:40:21 +02:00
Axel Dörfler
de9c061339 bfs: Use the QueryParserUtils instead of its own copy.
* Ingo copied the methods into a shared location, and then obviously
  "forgot" to let BFS use them. As a side note for Ingo: the complete
  error GCC reported was "std::fssh_size_t" not defined with the macro
  wrapper as code location. The actual problem was a "using std::size_t"
  in some C++ header that accidentally got included after the wrapper.
* The shared Query code is not yet used. That'll be done another time.
* Renamed BFS_SHELL define to FS_SHELL, such that QueryParserUtils can be
  used in any file system shell, not just the bfs_shell.
2014-07-09 22:54:39 +02:00
Ingo Weinhold
cdfeba5a1e BPackageWriter: Add Recompress()
Allows rewriting an existing package file with a different compression.
2014-07-08 22:00:35 +02:00
Ingo Weinhold
a5330a8e41 Remove private support kit BUrl
Use the public BUrl from the network kit instead.
2014-07-03 17:39:59 +02:00
Ingo Weinhold
6926863e37 DynamicBuffer::Write(): Fix return type and semantics 2014-07-03 17:39:58 +02:00
Ingo Weinhold
7616c39db6 DynamicBuffer: dos2unix 2014-07-03 17:39:57 +02:00
Ingo Weinhold
739f15e144 Revert "Revert "DynamicBuffer: implement BDataIO""
This reverts commit 747b401e87.
2014-07-03 17:39:57 +02:00
Ingo Weinhold
72cf56a0fd BZlibCompressionAlgorithm: Basic support for gzip format 2014-07-01 21:54:58 +02:00
Ingo Weinhold
b3263ad3e1 Switch package kit to BZlibCompressionAlgorithm
... and remove the Zlib{Compressor,Decompressor} API.
2014-06-30 21:55:41 +02:00
Ingo Weinhold
dcdc33b0af Add B[Zlib]CompressionAlgorithm
* BCompressionAlgorithm is a base class for classes that provide
  compression/decompression functionality. There are methods for
  compressing/decompressing a single buffer and factory methods for
  a compressing/decompressing input/output BDataIO.
* BZlibCompressionAlgorithm is a BCompressionAlgorithm implementation
  using zlib.
2014-06-30 21:55:41 +02:00
Ingo Weinhold
6a89a36aa0 Move package kit Zlib* classes to support kit
Also move to B* namespace and no longer expose the zlib dependency in
the headers.
2014-06-30 21:55:41 +02:00
Ingo Weinhold
0dab9e5cb4 package kit: ReaderImplBase: Remove superfluous scratch buffer 2014-06-30 21:51:16 +02:00
Ingo Weinhold
0a62e01902 PackageWriterImpl: Remove superfluous method 2014-06-30 21:51:16 +02:00
Ingo Weinhold
84297881bb Remove BPackageKit::[...]::AbstractDataWriter and friends
* FDDataWriter and ZlibDataWriter weren't used anymore.
* AbstractDataWriter was implemented only by PackageFileHeapWriter,
  which was only used by WriterImplBase.
* Add a PackageFileHeapWriter::AddDataThrows() which has semantics
  equivalent to the previously inherited WriteDataThrows().
2014-06-23 22:58:15 +02:00
Ingo Weinhold
32832cbe47 Remove BPackageKit::BDataOutput
Use BDataIO instead.
2014-06-23 22:58:15 +02:00
Ingo Weinhold
dec78bb27c Add new error codes B_PARTIAL_{READ,WRITE} 2014-06-23 22:58:15 +02:00