Ingo Weinhold 25a7b01d15 Merge branch 'master' into package-management
Additional changes:
* Add src/system/kernel/lib/zlib, which builds a kernel version of zlib,
  needed by packagefs.
* BuildFeatures: Add a build feature "gcc2" to allow for easier checks.
* Referenceable.cpp: Include <OS.h> instead of <debugger.h>. The latter
  is not needed and prevents building for the build platform.
* zlib/zutil.h: Fix gcc 2 build. We really should use the external
  package instead.

Conflicts:
	.gitignore
	build/jam/BuildSetup
	build/jam/FileRules
	build/jam/FloppyBootImage
	build/jam/HaikuImage
	build/jam/ImageRules
	build/jam/KernelRules
	build/jam/NetBootArchive
	build/jam/OptionalBuildFeatures
	build/jam/OptionalLibPackages
	build/jam/OptionalPackageDependencies
	build/jam/OptionalPackages
	build/scripts/build_haiku_image
	configure
	data/bin/installoptionalpackage
	data/system/boot/Bootscript
	headers/os/app/Message.h
	headers/os/package/PackageInfo.h
	headers/os/package/PackageInfoAttributes.h
	headers/os/package/PackageInfoSet.h
	headers/os/package/PackageRoster.h
	headers/os/package/PackageVersion.h
	headers/os/package/hpkg/PackageInfoAttributeValue.h
	headers/os/storage/FindDirectory.h
	headers/os/storage/Node.h
	headers/os/support/StringList.h
	headers/private/system/directories.h
	src/add-ons/kernel/drivers/audio/ac97/es1370/Jamfile
	src/add-ons/kernel/file_systems/packagefs/AttributeIndex.cpp
	src/add-ons/kernel/file_systems/packagefs/Jamfile
	src/add-ons/kernel/file_systems/packagefs/Package.cpp
	src/add-ons/kernel/file_systems/packagefs/Package.h
	src/add-ons/kernel/file_systems/packagefs/PackageDomain.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageDomain.h
	src/add-ons/kernel/file_systems/packagefs/PackageFSRoot.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.h
	src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.h
	src/add-ons/kernel/file_systems/packagefs/PackageLinksDirectory.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageNode.h
	src/add-ons/kernel/file_systems/packagefs/ResolvableFamily.cpp
	src/add-ons/kernel/file_systems/packagefs/Version.cpp
	src/add-ons/kernel/file_systems/packagefs/Version.h
	src/add-ons/kernel/file_systems/packagefs/Volume.cpp
	src/add-ons/kernel/file_systems/packagefs/Volume.h
	src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp
	src/add-ons/kernel/file_systems/userlandfs/shared/driver_settings.c
	src/apps/deskbar/BarApp.cpp
	src/apps/deskbar/BarMenuBar.cpp
	src/apps/deskbar/BarMenuBar.h
	src/apps/deskbar/BarView.cpp
	src/apps/deskbar/BarView.h
	src/apps/deskbar/BarWindow.cpp
	src/apps/deskbar/BarWindow.h
	src/apps/deskbar/DeskbarMenu.cpp
	src/apps/deskbar/DeskbarMenu.h
	src/apps/deskbar/DeskbarUtils.cpp
	src/apps/deskbar/DeskbarUtils.h
	src/apps/deskbar/ExpandoMenuBar.cpp
	src/apps/deskbar/ExpandoMenuBar.h
	src/apps/deskbar/TeamMenu.cpp
	src/apps/processcontroller/ProcessController.cpp
	src/apps/remotedesktop/RemoteDesktop.cpp
	src/bin/bash/config-top.h
	src/bin/finddir.c
	src/bin/package/Jamfile
	src/bin/package/command_add.cpp
	src/bin/package/command_create.cpp
	src/bin/package/command_list.cpp
	src/bin/package_repo/command_list.cpp
	src/bin/pkgman/command_refresh.cpp
	src/build/libbe/support/Jamfile
	src/build/libpackage/Jamfile
	src/build/libroot/Jamfile
	src/build/libroot/fs.cpp
	src/build/libroot/remapped_functions.h
	src/kits/locale/MutableLocaleRoster.cpp
	src/kits/opengl/GLRendererRoster.cpp
	src/kits/package/PackageInfo.cpp
	src/kits/package/PackageInfoSet.cpp
	src/kits/package/PackageRoster.cpp
	src/kits/package/PackageVersion.cpp
	src/kits/package/RepositoryCache.cpp
	src/kits/package/hpkg/PackageWriterImpl.cpp
	src/kits/package/hpkg/ReaderImplBase.cpp
	src/kits/package/hpkg/WriterImplBase.cpp
	src/kits/print/PrintTransport.cpp
	src/kits/print/Printer.cpp
	src/kits/screensaver/ScreenSaverRunner.cpp
	src/kits/support/StringList.cpp
	src/kits/tracker/ContainerWindow.cpp
	src/kits/tracker/DeskWindow.cpp
	src/kits/tracker/PoseView.cpp
	src/libs/print/libprint/Transport.cpp
	src/preferences/printers/AddPrinterDialog.cpp
	src/preferences/screensaver/ScreenSaverWindow.cpp
	src/servers/debug/DebugServer.cpp
	src/servers/input/AddOnManager.cpp
	src/servers/media_addon/MediaAddonServer.cpp
	src/system/boot/Jamfile
	src/system/boot/loader/Jamfile
	src/system/boot/loader/loader.cpp
	src/system/boot/loader/vfs.cpp
	src/system/kernel/fs/vfs.cpp
	src/system/kernel/fs/vfs_boot.cpp
	src/system/libroot/os/find_directory.cpp
	src/system/runtime_loader/runtime_loader.cpp
	src/tools/package/Jamfile
2013-05-05 15:03:26 +02:00

117 lines
2.8 KiB
C++

/*
* Copyright 2002-2011, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _NODE_H
#define _NODE_H
#include <Statable.h>
class BDirectory;
class BEntry;
class BString;
struct entry_ref;
struct node_ref {
node_ref();
node_ref(dev_t device, ino_t node);
node_ref(const node_ref &ref);
bool operator==(const node_ref& ref) const;
bool operator!=(const node_ref& ref) const;
node_ref& operator=(const node_ref& ref);
dev_t device;
ino_t node;
};
class BNode : public BStatable {
public:
BNode();
BNode(const entry_ref* ref);
BNode(const BEntry* entry);
BNode(const char* path);
BNode(const BDirectory* dir, const char* path);
BNode(const BNode& node);
virtual ~BNode();
status_t InitCheck() const;
virtual status_t GetStat(struct stat* st) const;
status_t SetTo(const entry_ref* ref);
status_t SetTo(const BEntry* entry);
status_t SetTo(const char* path);
status_t SetTo(const BDirectory* dir, const char* path);
void Unset();
status_t Lock();
status_t Unlock();
status_t Sync();
ssize_t WriteAttr(const char* name, type_code type,
off_t offset, const void* buffer,
size_t length);
ssize_t ReadAttr(const char* name, type_code type,
off_t offset, void* buffer,
size_t length) const;
status_t RemoveAttr(const char* name);
status_t RenameAttr(const char* oldName,
const char* newName);
status_t GetAttrInfo(const char* name,
struct attr_info* info) const;
status_t GetNextAttrName(char* buffer);
status_t RewindAttrs();
status_t WriteAttrString(const char* name,
const BString* data);
status_t ReadAttrString(const char* name,
BString* result) const;
BNode& operator=(const BNode& node);
bool operator==(const BNode& node) const;
bool operator!=(const BNode& node) const;
int Dup();
// This should be "const" but R5's is not... Ugggh.
private:
friend class BFile;
friend class BDirectory;
friend class BSymLink;
virtual void _RudeNode1();
virtual void _RudeNode2();
virtual void _RudeNode3();
virtual void _RudeNode4();
virtual void _RudeNode5();
virtual void _RudeNode6();
private:
status_t set_fd(int fd);
virtual void close_fd();
void set_status(status_t newStatus);
status_t _SetTo(int fd, const char* path, bool traverse);
status_t _SetTo(const entry_ref* ref, bool traverse);
virtual status_t set_stat(struct stat& st, uint32 what);
status_t _GetStat(struct stat* st) const;
virtual status_t _GetStat(struct stat_beos* st) const;
status_t InitAttrDir();
private:
uint32 rudeData[4];
int fFd;
int fAttrFd;
status_t fCStatus;
};
#endif // _NODE_H