Commit Graph

198 Commits

Author SHA1 Message Date
Ingo Weinhold 89dc7e4875 Added private BPositionIO derived classes BFileIO and BFileDescriptorIO which
wrap a FILE* respectively a file descriptor.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-15 22:19:27 +00:00
Axel Dörfler f46308c92a * More header cleanup, continuing korli's work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-13 09:48:02 +00:00
Jérôme Duval d25dd4b920 some copyright headers clean up
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-12 21:02:09 +00:00
Ingo Weinhold bc0693b219 * Construct the MIME data base directories lazily.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 08:52:13 +00:00
Ingo Weinhold d3ed58a7c9 Added ELF64 support to BResources.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 17:14:29 +00:00
Ingo Weinhold ff4d0f1c92 * Style cleanup.
* Removed AutoDeleter class and use the shared one instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 15:00:40 +00:00
Ingo Weinhold d6778355ee * <DiskDeviceTypes.h>: Removed kPartitionTypeIntel{Primary,Logical} constants.
* Added new header headers/private/system/disk_device_types.h, which defines
  the <DiskDeviceTypes.h> constants as macros and which can be used where the
  constants cannot be used. The constants are defined using the macros, so now
  there's only one place where the string literals should be specified.
* Use the macros in the partitioning systems. I was too lazy to also adjust the
  file systems -- most of them seem to hard-code the string literal yet.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:07:42 +00:00
Ingo Weinhold 7f96148cac Patch by Bryce Groff with changes by myself:
* Added missing name parameter to the partitioning system module child creation
  and child creation validation hooks. Pass the name to them.
* Added BPartitionParameterEditor interface, which is/will be used for editing
  disk system specific parameters.
* Implemented partition parameter editors for BFS initialization and Intel
  partition map child creation.
* Fixed the incorrect supported child partition type iteration in the Intel
  partition map add-on. It does now return actual types.
* Handle the "active" flag parameter in the Intel partitioning system module.
* DriveSetup:
  - Replaced the "Create" submenu by a simple menu item. The type can now by
    chosen in the dialog.
  - Make use of initialization and child creation parameter editors. Some
    non-generic code has been moved to the respective editor implementations
    (BFS, intel partitioning system).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31658 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-20 20:29:16 +00:00
Ingo Weinhold 42c9b01aa6 * {BEntry,BNode}::GetStat() were still passing the BeOS struct stat size to
the syscall. Anything beyond st_mtim was therefore not filled in. Fixes
  the incorrectly shown creation times in Tracker.
* The BStatable::GetStat() solution was not sufficient yet. We still have to
  provide the old GetStat() symbol for BNode and BEntry, since those could be
  used by old applications/libraries. We also still have to implement the old
  GetStat() slots in the derived classes, but don't need to implement it in
  the base class (was purely virtual before and is private now).
* The old BStatable::_OhSoStatable1() slot function was not implemented
  correctly. Calling the virtual function at the vtable slot obviously results
  in an infinite recursion. The correct implementation would make use of the
  Perform() method, but Be didn't provide one for BStatable, so we have to use
  the old GetStat() method. Fixed #3960.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30851 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-25 14:03:38 +00:00
Stephan Aßmus acc632c7ec Make it clear from the API that the volume passed in is not touched by the
function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-22 14:13:45 +00:00
Michael Lotz 6eb09230ba * Resolve further warnings on GCC4.
* Enable -Werror on GCC4 builds as well (limited to the same selected targets).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-01 22:12:55 +00:00
Axel Dörfler a58e2ed8f8 * Added functions FindPartitionByVolume() and FindPartitionByMountPoint()
that conveniently bridge BVolumes/mount points with BPartitions.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28346 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-27 15:33:37 +00:00
Axel Dörfler ab42853558 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-19 13:17:29 +00:00
Rene Gollent ca5e024130 Probably forgotten changes in the last commit, though I'm not sure if Axel had any other style cleanups in mind in this file. Fixes build at any rate.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28230 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-18 15:45:57 +00:00
Axel Dörfler c7cf50a4e5 * Added a handy BDiskSystem::SupportsWriting().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:47:30 +00:00
Axel Dörfler 38bbc95758 * Made the use of file devices more convenient and complete by adding
the methods IsFile() and GetFilePath() to BDiskDevice, and
  BDiskDeviceRoster::GetFileDeviceForPath().
* Added new syscalls to implement this functionality.
* Added new flag B_DISK_DEVICE_IS_FILE.
* Fixed wrong operator precedence assumption in the BDiskDevice class at
  several places.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 21:51:43 +00:00
Stefano Ceccherini 9fb13d5822 the virtual version is const
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 11:23:15 +00:00
Axel Dörfler 06ba3f0acb * Added two new ways to retrieve an icon from a device:
- B_GET_ICON_NAME: returns the name of an icon. This will then be read from
    a predefined location on disk (not yet implemented). This would also allow
    to add specifiers like "-boot", or "-fat|bfs|ntfs|...", and have special
    icons for those.
  - B_GET_VECTOR_ICON: retrieves the vector icon of a device, if any.
* get_device_icon(BBitmap*, ...) now supports other color spaces than B_CMAP8.
* Added get_device_icon(), BPartition::GetIcon(), and BVolume::GetIcon()
  variants that can also retrieve the icon data directly (like
  BNodeInfo::GetIcon()).
* Reenabled the previous BPartition::GetIcon(), based on a patch by
  Justin O'Dell - this fixes #1391.
* Tracker's MountMenu class now uses B_RGBA32 icons, instead of B_CMAP8.
* Added vector icon to scsi_disk, and scsi_cd. The former doesn't have any
  special removable icon, though.
* Header cleanup, added/updated license, whitespace cleanup.
* Marked deprecated/obsolete driver ioctls in Drivers.h.
* Removed OpenBeOS namespace in the headers I touched that still had them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 11:27:07 +00:00
Stephan Aßmus afbd081a6f * TRACE macro no longer needs double parenthesis.
* The global BPathMonitor looper is now always used, no more optional looper
  and no more BApplication looper usage. This way we know how the looper behaves
  and PathHandler::Quit() can be synchronous. In the end, the bug I was
  observing was not caused by the previous asynchronous node monitor stopping,
  but this should be safer anyways. When BPathMonitor::StopWatching() returns,
  you have really stopped watching and not some time later.
* Introduced "FileEntry" which is an entry_ref plus node id. This is now used
  instead of the node_ref for the "watched files set". The whole point
  is to really be able to add the "path" field to the B_PATH_MONITOR message.
  Previously, the initial path that was passed to StartWatching() was added,
  regardless if the message was for an entry somewhere down the hierarchy when
  watching recursively. The downside of the new method is that it uses a lot
  more RAM per entry. Another option would be to store the node id of the parent
  directory and iterate the directory always when in need to construct the path.
* Watching a folder recursively now really adds all the existing subfolders
  as well as all the files if not watching for folders only. The tests for the
  old implementation only tested what happens when the watched folder was newly
  created and then subfolders were created. Those where already added by the
  code. Now it also adds the subfolders of folder that appear in a watched
  folder.
TODO: Remove folders and files recursively when they dissappear. More testing
for B_ENTRY_MOVED. Optimizations are possible when some information is
retrieved twice. I am also planning to add a way for the BPathMonitor user to
filter the automatically watched files/folders in B_WATCH_RECURSIVELY mode.

I grepped the entire Haiku tree for usage of BPathMonitor. Only net_server
and Mail were using it, but both in a way that is not affected by these
changes. Anyways, TextSearch works more reliable now, even for entries in
subfolders.

Feedback very welcome! :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 20:02:59 +00:00
Stephan Aßmus f7c226f467 * StartWatching() now takes an optional BLooper pointer. This looper will
then be used for receiving node monitoring messages.
* Reenabled using be_app as default BLooper if the API user does not provide
  one. I think the problem that Stefano needed to work aroung in r23995 was
  actually caused by the incorrect locking (an never unlocking) of the looper
  before calling PathHandler::Quit().
->If I understand correctly, this code as supposed to work around the possible
  situation that the looper holding those PathHandlers may have already quit,
  leaving stale PathHandler pointers behind. But that case was not prevented
  by the old code anyways, since one would have had to access freed memory to
  even get the stale BLooper pointer. The real fix would be to store the
  BLooper pointer with each PathHandler so that the possible gone-ness of
  those loopers could be checked independent of accessing the PathHandler
  pointer. (The whole problem is that PathHandler adds itself to the BLooper
  and if the looper quits, it will free all its attached handlers.)
* Introduced a global fallback BLooper for the case that no BApplication is
  running, which resolves a TODO.

All this is yet untested, but should have a good chance of working.
(Famous last words...)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26843 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 16:56:24 +00:00
Stephan Aßmus b5bc41debf * Use new header layout in PathMonitor.h
* Honor 80 char/line limit in PathMonitor.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26788 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 13:04:45 +00:00
Axel Dörfler 1da9f5cea5 * Added BDiskSystem::ShortName() and everything needed to get it there.
* Added BDiskDeviceRoster::GetDiskSystem() method, that can get a disk system
  by short/pretty/module name - since they should all be unique, I put them
  in a single namespace, please complain if you don't like that :-)
* Cleaned up DiskSystem.h and DiskDeviceRoster.h according to the updated
  header guidelines.
* Renamed ntfs pretty name from "ntfs File System" to "Windows NT File System".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 11:44:00 +00:00
Stephan Aßmus 96418817f9 * added a PrintToStream() method
* added optional tracing for the main operations
* fixed bad pointer arithmetic when reallocating/moving the object's data
* it was impossible to remove the very first space via _RemoveSpaces()
* added a little more variaty to error return codes for some
  functions to make them a little more helpful

-> This fixes the bogus space values in DriveSetup (#1737)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 12:38:15 +00:00
Michael Lotz f82c11c079 bonefish+mmlr:
* Move most of MIME database support out of libbe and into registrar
* Use the (async) MessageDeliverer instead of a synchronous SendMessage in _SendMonitorUpdate

This fixes a deadlock when the message port of a MIME database watching
application gets full as documented in bug #1311.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 22:45:06 +00:00
Ingo Weinhold 300868ce27 * Removed no longer needed disk device related syscalls
(_kern_{supports,validate}_*(), etc.).
* Adjusted the prototypes of the disk device modification syscalls.
  Commented out their implementations for the time -- they'll mostly
  have to be rewritten completely.
* Implemented the userland disk device jobs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-31 21:16:22 +00:00
Ingo Weinhold 3ca9267ce3 * The BMutablePartition setters adjust the change flags accordingly.
* PartitionDelegate::Uninitialize() uninitializes the mutable partition. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-31 17:02:52 +00:00
Ingo Weinhold 25ab0d1a4a * Fixed typos in the disk device job constants.
* Added missing job classes (they don't do anything yet, though) and
  completed the implementation of the job generator.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22767 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-29 23:51:02 +00:00
Ingo Weinhold 9417631f64 * Made _CountDescendants() public.
* Added private _ChildAt() and _CountChildren(), which don't ask the
  delegate, thus reflecting the hierarchy as it was before changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22610 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-18 03:42:30 +00:00
Ingo Weinhold 013e7894b7 We need flags to track what properties of the partition change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-18 03:39:50 +00:00
Ingo Weinhold 1573b62671 * Removed the BDiskDeviceJob class. Jobs won't be generated and executed
in the kernel anymore. The respective functionality will be moved into
  the userland. Depending on how we want the API user to interface with
  it, we may want to reintroduce a similar class later.
* Cleared remaining references to shadow partitions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22606 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 22:56:23 +00:00
Ingo Weinhold 27d7c36659 * Reimplemented BDiskDevice::IsModified()/
{Prepare,Commit,Cancel}Modifications() using the userland add-on
  backend. IsModified() and CommitModifications() are little more than
  stubs ATM.
* Made BPartition::VisitEachChild()/VisitEachDescendant() const.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22602 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 21:50:20 +00:00
Ingo Weinhold 46b93b2cfd Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22600 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 20:51:10 +00:00
Ingo Weinhold c9518b6240 Removed some now obsolete methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 01:04:53 +00:00
Ingo Weinhold fe6bd3b5b7 * Moved GetNextSupportedType() and IsSubSystemFor() from
BDiskSystem to BPartition and reimplemented them using the userland
  add-on backend instead of syscalls. As a side effect this solves the
  TODO I recently added in GetNextSupportedType().
* Reimplemented BDiskSystem::GetTypeForContentType() using the userland
  add-on backend instead of a syscall.
* Moved GetTypeForContentType() and IsSubSystemFor() from
  BPartitionHandle to BDiskSystemAddOn. They were misplaced.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 01:01:49 +00:00
Ingo Weinhold b62085b975 Coding style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-16 00:32:41 +00:00
Axel Dörfler f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
Ingo Weinhold 28541deac2 Beginning of the integration with the new userland disk system add-on
based code. Small API changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22561 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 00:41:18 +00:00
Ingo Weinhold 08baf63a9f Decided that BPartition::ImmutableDelegate would basically be a big
collection of no-op methods, which could as well be implemented in
BPartition itself. This makes the Delegate hierarchy unnecessary:
MutableDelegate becomes Delegate, and we save a few casts as a side
effect.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-14 00:07:03 +00:00
Ingo Weinhold 350043e707 * Initialization of BPartition::Delegate is now two-phased. The first phase
builds the object hierarchy, the second will (in case of MutableDelegate)
  let the disk systems do their initialization. This way the disk systems
  already find a fully functional object hierarchy they can work with.
* Child creation also takes a partition name as a parameter, now.
* Implemented BMutablePartition child creation/deletion.
* The BDiskSystemAddOn/BPartitionHandle::Validate*() methods return a
  status_t instead of a bool, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22540 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 21:29:33 +00:00
Ingo Weinhold 103ca6a3ad The info about partitionable space will be provided by the userland disk
system add-ons. First work to make this class usable for them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22539 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 21:17:26 +00:00
Ingo Weinhold b3e7c4a4b9 * Added fDelegate member.
* Removed private AutoDeleter class. The shared ArrayDeleter is used instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22538 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 21:13:02 +00:00
Karsten Heimrich 98148bd6c5 * this should fix the build on gcc4
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22524 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-12 22:47:42 +00:00
Ingo Weinhold 15ed7c71d6 More fleshing out the disk system add-on interface and related classes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-10 21:35:22 +00:00
Ingo Weinhold 98b97f9603 First draft of the userland disk system add-on interface. A good deal of
functionality of the kernel add-ons will be moved into userland, which
will simplify the kernel-side significantly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-08 01:33:46 +00:00
Ingo Weinhold 04adb291a6 Clear the user_partition_data::user_data fields before updating the
BPartition structure with the data retrieved from the kernel. For new
partitions the field is not set in the next step and later code would
use an initialized pointer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22471 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 14:56:26 +00:00
Ingo Weinhold 7ede8e4494 Added [Content]Parameters() getters.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 14:52:54 +00:00
Ingo Weinhold 2652981136 Added Supports[Content]Name() methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-22 21:22:29 +00:00
Ingo Weinhold 04ed91ac9c Added copy constructor and assignment operator.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-28 14:56:02 +00:00
Axel Dörfler d2d753669d * Renamed "EFI GUID Partition Table" to "EFI GUID Partition Map" to be consistent
with the other partition types.
* Added kPartitionTypeEFI to the constants.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-05 19:41:47 +00:00
Axel Dörfler d00539e3ba * Revamped BPathMonitor API as suggested by Ingo - we could rename it to BNodeMonitor
and add wrappers for watch_node() as well, though.
* Implemented more or less all what is needed for the path monitoring to work.
* Added a test application: works fine under Haiku, but somewhat flaky under BeOS,
  dunno why yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-08 00:30:59 +00:00