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
This commit is contained in:
Ingo Weinhold
2013-05-05 15:03:26 +02:00
15096 changed files with 647420 additions and 1619850 deletions
+1
View File
@@ -122,6 +122,7 @@ private:
status_t _SetupServerAllocator();
status_t _InitGUIContext();
status_t _ConnectToServer();
void _ReconnectToServer();
bool _QuitAllWindows(bool force);
bool _WindowQuitLoop(bool quitFilePanels, bool force);
void _ArgvReceived(BMessage* message);
+115
View File
@@ -0,0 +1,115 @@
/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _KEY_H
#define _KEY_H
#include <DataIO.h>
#include <Message.h>
#include <ObjectList.h>
#include <String.h>
enum BKeyPurpose {
B_KEY_PURPOSE_ANY,
B_KEY_PURPOSE_GENERIC,
B_KEY_PURPOSE_KEYRING,
B_KEY_PURPOSE_WEB,
B_KEY_PURPOSE_NETWORK,
B_KEY_PURPOSE_VOLUME
};
enum BKeyType {
B_KEY_TYPE_ANY,
B_KEY_TYPE_GENERIC,
B_KEY_TYPE_PASSWORD,
B_KEY_TYPE_CERTIFICATE
};
class BKey {
public:
BKey();
BKey(BKeyPurpose purpose,
const char* identifier,
const char* secondaryIdentifier = NULL,
const uint8* data = NULL,
size_t length = 0);
BKey(BKey& other);
virtual ~BKey();
virtual BKeyType Type() const { return B_KEY_TYPE_GENERIC; };
void Unset();
status_t SetTo(BKeyPurpose purpose,
const char* identifier,
const char* secondaryIdentifier = NULL,
const uint8* data = NULL,
size_t length = 0);
void SetPurpose(BKeyPurpose purpose);
BKeyPurpose Purpose() const;
void SetIdentifier(const char* identifier);
const char* Identifier() const;
void SetSecondaryIdentifier(const char* identifier);
const char* SecondaryIdentifier() const;
status_t SetData(const uint8* data, size_t length);
size_t DataLength() const;
const uint8* Data() const;
status_t GetData(uint8* buffer, size_t bufferSize) const;
const char* Owner() const;
bigtime_t CreationTime() const;
virtual status_t Flatten(BMessage& message) const;
virtual status_t Unflatten(const BMessage& message);
BKey& operator=(const BKey& other);
bool operator==(const BKey& other) const;
bool operator!=(const BKey& other) const;
virtual void PrintToStream();
private:
friend class BKeyStore;
BKeyPurpose fPurpose;
BString fIdentifier;
BString fSecondaryIdentifier;
BString fOwner;
bigtime_t fCreationTime;
mutable BMallocIO fData;
};
class BPasswordKey : public BKey {
public:
BPasswordKey();
BPasswordKey(const char* password,
BKeyPurpose purpose, const char* identifier,
const char* secondaryIdentifier = NULL);
BPasswordKey(BPasswordKey& other);
virtual ~BPasswordKey();
virtual BKeyType Type() const { return B_KEY_TYPE_PASSWORD; };
status_t SetTo(const char* password,
BKeyPurpose purpose,
const char* identifier,
const char* secondaryIdentifier = NULL);
status_t SetPassword(const char* password);
const char* Password() const;
virtual void PrintToStream();
};
#endif // _KEY_H
+103
View File
@@ -0,0 +1,103 @@
/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _KEY_STORE_H
#define _KEY_STORE_H
#include <Key.h>
class BKeyStore {
public:
BKeyStore();
virtual ~BKeyStore();
status_t GetKey(BKeyType type, const char* identifier,
BKey& key);
status_t GetKey(BKeyType type, const char* identifier,
const char* secondaryIdentifier, BKey& key);
status_t GetKey(BKeyType type, const char* identifier,
const char* secondaryIdentifier,
bool secondaryIdentifierOptional,
BKey& key);
status_t GetKey(const char* keyring,
BKeyType type, const char* identifier,
BKey& key);
status_t GetKey(const char* keyring,
BKeyType type, const char* identifier,
const char* secondaryIdentifier, BKey& key);
status_t GetKey(const char* keyring,
BKeyType type, const char* identifier,
const char* secondaryIdentifier,
bool secondaryIdentifierOptional,
BKey& key);
status_t AddKey(const BKey& key);
status_t AddKey(const char* keyring, const BKey& key);
status_t RemoveKey(const BKey& key);
status_t RemoveKey(const char* keyring, const BKey& key);
status_t GetNextKey(uint32& cookie, BKey& key);
status_t GetNextKey(BKeyType type, BKeyPurpose purpose,
uint32& cookie, BKey& key);
status_t GetNextKey(const char* keyring,
uint32& cookie, BKey& key);
status_t GetNextKey(const char* keyring,
BKeyType type, BKeyPurpose purpose,
uint32& cookie, BKey& key);
// Keyrings
status_t AddKeyring(const char* keyring);
status_t RemoveKeyring(const char* keyring);
status_t GetNextKeyring(uint32& cookie,
BString& keyring);
status_t SetUnlockKey(const char* keyring,
const BKey& key);
status_t RemoveUnlockKey(const char* keyring);
// Master keyring
status_t SetMasterUnlockKey(const BKey& key);
status_t RemoveMasterUnlockKey();
status_t AddKeyringToMaster(const char* keyring);
status_t RemoveKeyringFromMaster(const char* keyring);
status_t GetNextMasterKeyring(uint32& cookie,
BString& keyring);
// Locking
bool IsKeyringUnlocked(const char* keyring);
status_t LockKeyring(const char* keyring);
status_t LockMasterKeyring();
// Applications
status_t GetNextApplication(uint32& cookie,
BString& signature) const;
status_t GetNextApplication(const char* keyring,
uint32& cookie, BString& signature) const;
status_t RemoveApplication(const char* signature);
status_t RemoveApplication(const char* keyring,
const char* signature);
// Service functions
status_t GeneratePassword(BPasswordKey& password,
size_t length, uint32 flags);
float PasswordStrength(const char* password);
private:
status_t _SendKeyMessage(BMessage& message,
BMessage* reply) const;
};
#endif // _KEY_STORE_H
+483 -293
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010, Haiku Inc. All Rights Reserved.
* Copyright 2005-2012, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -9,6 +9,8 @@
#define _MESSAGE_H
#include <new>
#include <BeBuild.h>
#include <DataIO.h>
#include <Flattenable.h>
@@ -19,6 +21,7 @@
#include <AppDefs.h> /* For convenience */
#include <TypeConstants.h> /* For convenience */
class BAlignment;
class BBlockCache;
class BMessenger;
@@ -46,343 +49,530 @@ enum {
// app-defined specifiers start at B_SPECIFIERS_END + 1
};
class BMessage {
public:
uint32 what;
public:
uint32 what;
BMessage();
BMessage(uint32 what);
BMessage(const BMessage &other);
virtual ~BMessage();
BMessage();
BMessage(uint32 what);
BMessage(const BMessage& other);
virtual ~BMessage();
BMessage &operator=(const BMessage &other);
BMessage& operator=(const BMessage& other);
// Statistics and misc info
status_t GetInfo(type_code typeRequested, int32 index,
char **nameFound, type_code *typeFound,
int32 *countFound = NULL) const;
status_t GetInfo(const char *name, type_code *typeFound,
int32 *countFound = NULL) const;
status_t GetInfo(const char *name, type_code *typeFound,
bool *fixedSize) const;
status_t GetInfo(const char *name, type_code *typeFound,
int32 *countFound, bool *fixedSize) const;
// Statistics and misc info
status_t GetInfo(type_code typeRequested, int32 index,
char** nameFound, type_code* typeFound,
int32* countFound = NULL) const;
status_t GetInfo(const char* name, type_code* typeFound,
int32* countFound = NULL) const;
status_t GetInfo(const char* name, type_code* typeFound,
bool* fixedSize) const;
status_t GetInfo(const char* name, type_code* typeFound,
int32* countFound, bool* fixedSize) const;
int32 CountNames(type_code type) const;
bool IsEmpty() const;
bool IsSystem() const;
bool IsReply() const;
void PrintToStream() const;
int32 CountNames(type_code type) const;
bool IsEmpty() const;
bool IsSystem() const;
bool IsReply() const;
void PrintToStream() const;
status_t Rename(const char *oldEntry, const char *newEntry);
status_t Rename(const char* oldEntry,
const char* newEntry);
// Delivery info
bool WasDelivered() const;
bool IsSourceWaiting() const;
bool IsSourceRemote() const;
BMessenger ReturnAddress() const;
const BMessage *Previous() const;
bool WasDropped() const;
BPoint DropPoint(BPoint *offset = NULL) const;
// Delivery info
bool WasDelivered() const;
bool IsSourceWaiting() const;
bool IsSourceRemote() const;
BMessenger ReturnAddress() const;
const BMessage* Previous() const;
bool WasDropped() const;
BPoint DropPoint(BPoint* offset = NULL) const;
// Replying
status_t SendReply(uint32 command, BHandler *replyTo = NULL);
status_t SendReply(BMessage *reply, BHandler *replyTo = NULL,
bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t SendReply(BMessage *reply, BMessenger replyTo,
bigtime_t timeout = B_INFINITE_TIMEOUT);
// Replying
status_t SendReply(uint32 command,
BHandler* replyTo = NULL);
status_t SendReply(BMessage* reply,
BHandler* replyTo = NULL,
bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t SendReply(BMessage* reply, BMessenger replyTo,
bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t SendReply(uint32 command, BMessage *replyToReply);
status_t SendReply(BMessage *the_reply, BMessage *replyToReply,
bigtime_t sendTimeout = B_INFINITE_TIMEOUT,
bigtime_t replyTimeout = B_INFINITE_TIMEOUT);
status_t SendReply(uint32 command,
BMessage* replyToReply);
status_t SendReply(BMessage* reply,
BMessage* replyToReply,
bigtime_t sendTimeout = B_INFINITE_TIMEOUT,
bigtime_t replyTimeout
= B_INFINITE_TIMEOUT);
// Flattening data
ssize_t FlattenedSize() const;
status_t Flatten(char *buffer, ssize_t size) const;
status_t Flatten(BDataIO *stream, ssize_t *size = NULL) const;
status_t Unflatten(const char *flatBuffer);
status_t Unflatten(BDataIO *stream);
// Flattening data
ssize_t FlattenedSize() const;
status_t Flatten(char* buffer, ssize_t size) const;
status_t Flatten(BDataIO* stream,
ssize_t* size = NULL) const;
status_t Unflatten(const char* flatBuffer);
status_t Unflatten(BDataIO* stream);
// Specifiers (scripting)
status_t AddSpecifier(const char *property);
status_t AddSpecifier(const char *property, int32 index);
status_t AddSpecifier(const char *property, int32 index, int32 range);
status_t AddSpecifier(const char *property, const char *name);
status_t AddSpecifier(const BMessage *specifier);
// Specifiers (scripting)
status_t AddSpecifier(const char* property);
status_t AddSpecifier(const char* property, int32 index);
status_t AddSpecifier(const char* property, int32 index,
int32 range);
status_t AddSpecifier(const char* property,
const char* name);
status_t AddSpecifier(const BMessage* specifier);
status_t SetCurrentSpecifier(int32 index);
status_t GetCurrentSpecifier(int32 *index,
BMessage *specifier = NULL, int32 *what = NULL,
const char **property = NULL) const;
bool HasSpecifiers() const;
status_t PopSpecifier();
status_t SetCurrentSpecifier(int32 index);
status_t GetCurrentSpecifier(int32* index,
BMessage* specifier = NULL,
int32* what = NULL,
const char** property = NULL) const;
bool HasSpecifiers() const;
status_t PopSpecifier();
// Adding data
status_t AddAlignment(const char* name,
const BAlignment& alignment);
status_t AddRect(const char *name, BRect aRect);
status_t AddPoint(const char *name, BPoint aPoint);
status_t AddSize(const char* name, BSize aSize);
status_t AddString(const char *name, const char *aString);
status_t AddString(const char *name, const BString &aString);
status_t AddStrings(const char *name, const BStringList &list);
status_t AddInt8(const char *name, int8 value);
status_t AddUInt8(const char *name, uint8 value);
status_t AddInt16(const char *name, int16 value);
status_t AddUInt16(const char *name, uint16 value);
status_t AddInt32(const char *name, int32 value);
status_t AddUInt32(const char *name, uint32 value);
status_t AddInt64(const char *name, int64 value);
status_t AddUInt64(const char *name, uint64 value);
status_t AddBool(const char *name, bool aBoolean);
status_t AddFloat(const char *name, float aFloat);
status_t AddDouble(const char *name, double aDouble);
status_t AddPointer(const char *name, const void *aPointer);
status_t AddMessenger(const char *name, BMessenger messenger);
status_t AddRef(const char *name, const entry_ref *ref);
status_t AddMessage(const char *name, const BMessage *message);
status_t AddFlat(const char *name, BFlattenable *object,
int32 count = 1);
status_t AddData(const char *name, type_code type,
const void *data, ssize_t numBytes,
bool isFixedSize = true, int32 count = 1);
// Adding data
status_t AddAlignment(const char* name,
const BAlignment& alignment);
status_t AddRect(const char* name, BRect rect);
status_t AddPoint(const char* name, BPoint point);
status_t AddSize(const char* name, BSize size);
status_t AddString(const char* name, const char* string);
status_t AddString(const char* name,
const BString& string);
status_t AddStrings(const char *name,
const BStringList& list);
status_t AddInt8(const char* name, int8 value);
status_t AddUInt8(const char* name, uint8 value);
status_t AddInt16(const char* name, int16 value);
status_t AddUInt16(const char* name, uint16 value);
status_t AddInt32(const char* name, int32 value);
status_t AddUInt32(const char* name, uint32 value);
status_t AddInt64(const char* name, int64 value);
status_t AddUInt64(const char* name, uint64 value);
status_t AddBool(const char* name, bool value);
status_t AddFloat(const char* name, float value);
status_t AddDouble(const char* name, double value);
status_t AddPointer(const char* name,
const void* pointer);
status_t AddMessenger(const char* name,
BMessenger messenger);
status_t AddRef(const char* name, const entry_ref* ref);
status_t AddMessage(const char* name,
const BMessage* message);
status_t AddFlat(const char* name, BFlattenable* object,
int32 count = 1);
status_t AddData(const char* name, type_code type,
const void* data, ssize_t numBytes,
bool isFixedSize = true, int32 count = 1);
// Removing data
status_t RemoveData(const char *name, int32 index = 0);
status_t RemoveName(const char *name);
status_t MakeEmpty();
status_t Append(const BMessage& message);
// Finding data
status_t FindAlignment(const char* name,
BAlignment* alignment) const;
status_t FindAlignment(const char* name, int32 index,
BAlignment* alignment) const;
// Removing data
status_t RemoveData(const char* name, int32 index = 0);
status_t RemoveName(const char* name);
status_t MakeEmpty();
status_t FindRect(const char *name, BRect *rect) const;
status_t FindRect(const char *name, int32 index, BRect *rect) const;
status_t FindPoint(const char *name, BPoint *point) const;
status_t FindPoint(const char *name, int32 index, BPoint *point) const;
// Finding data
status_t FindAlignment(const char* name,
BAlignment* alignment) const;
status_t FindAlignment(const char* name, int32 index,
BAlignment* alignment) const;
status_t FindSize(const char *name, BSize* size) const;
status_t FindSize(const char *name,
int32 index, BSize* size) const;
status_t FindRect(const char* name, BRect* rect) const;
status_t FindRect(const char* name, int32 index,
BRect* rect) const;
status_t FindPoint(const char* name,
BPoint* point) const;
status_t FindPoint(const char* name, int32 index,
BPoint* point) const;
status_t FindString(const char *name, const char **string) const;
status_t FindString(const char *name, int32 index, const char **string) const;
status_t FindString(const char *name, BString *string) const;
status_t FindString(const char *name, int32 index, BString *string) const;
status_t FindStrings(const char *name, BStringList *list) const;
status_t FindInt8(const char *name, int8 *value) const;
status_t FindInt8(const char *name, int32 index, int8 *value) const;
status_t FindUInt8(const char *name, uint8 *value) const;
status_t FindUInt8(const char *name, int32 index, uint8 *value) const;
status_t FindInt16(const char *name, int16 *value) const;
status_t FindInt16(const char *name, int32 index, int16 *value) const;
status_t FindUInt16(const char *name, uint16 *value) const;
status_t FindUInt16(const char *name, int32 index, uint16 *value) const;
status_t FindInt32(const char *name, int32 *value) const;
status_t FindInt32(const char *name, int32 index, int32 *value) const;
status_t FindUInt32(const char *name, uint32 *value) const;
status_t FindUInt32(const char *name, int32 index, uint32 *value) const;
status_t FindInt64(const char *name, int64 *value) const;
status_t FindInt64(const char *name, int32 index, int64 *value) const;
status_t FindUInt64(const char *name, uint64 *value) const;
status_t FindUInt64(const char *name, int32 index, uint64 *value) const;
status_t FindBool(const char *name, bool *value) const;
status_t FindBool(const char *name, int32 index, bool *value) const;
status_t FindFloat(const char *name, float *value) const;
status_t FindFloat(const char *name, int32 index, float *value) const;
status_t FindDouble(const char *name, double *value) const;
status_t FindDouble(const char *name, int32 index, double *value) const;
status_t FindPointer(const char *name, void **pointer) const;
status_t FindPointer(const char *name, int32 index, void **pointer) const;
status_t FindMessenger(const char *name, BMessenger *messenger) const;
status_t FindMessenger(const char *name, int32 index, BMessenger *messenger) const;
status_t FindRef(const char *name, entry_ref *ref) const;
status_t FindRef(const char *name, int32 index, entry_ref *ref) const;
status_t FindMessage(const char *name, BMessage *message) const;
status_t FindMessage(const char *name, int32 index, BMessage *message) const;
status_t FindFlat(const char *name, BFlattenable *object) const;
status_t FindFlat(const char *name, int32 index, BFlattenable *object) const;
status_t FindData(const char *name, type_code type,
const void **data, ssize_t *numBytes) const;
status_t FindData(const char *name, type_code type, int32 index,
const void **data, ssize_t *numBytes) const;
status_t FindSize(const char* name, BSize* size) const;
status_t FindSize(const char* name, int32 index,
BSize* size) const;
// Replacing data
status_t ReplaceAlignment(const char* name,
const BAlignment& alignment);
status_t ReplaceAlignment(const char* name, int32 index,
const BAlignment& alignment);
status_t FindString(const char* name,
const char** string) const;
status_t FindString(const char* name, int32 index,
const char** string) const;
status_t FindString(const char* name,
BString* string) const;
status_t FindString(const char* name, int32 index,
BString* string) const;
status_t FindStrings(const char* name,
BStringList* list) const;
status_t FindInt8(const char* name, int8* value) const;
status_t FindInt8(const char* name, int32 index,
int8* value) const;
status_t FindUInt8(const char* name, uint8* value) const;
status_t FindUInt8(const char* name, int32 index,
uint8* value) const;
status_t FindInt16(const char* name, int16* value) const;
status_t FindInt16(const char* name, int32 index,
int16* value) const;
status_t FindUInt16(const char* name,
uint16* value) const;
status_t FindUInt16(const char* name, int32 index,
uint16* value) const;
status_t FindInt32(const char* name, int32* value) const;
status_t FindInt32(const char* name, int32 index,
int32* value) const;
status_t FindUInt32(const char* name,
uint32* value) const;
status_t FindUInt32(const char* name, int32 index,
uint32* value) const;
status_t FindInt64(const char* name, int64* value) const;
status_t FindInt64(const char* name, int32 index,
int64* value) const;
status_t FindUInt64(const char* name,
uint64* value) const;
status_t FindUInt64(const char* name, int32 index,
uint64* value) const;
status_t FindBool(const char* name, bool* value) const;
status_t FindBool(const char* name, int32 index,
bool* value) const;
status_t FindFloat(const char* name, float* value) const;
status_t FindFloat(const char* name, int32 index,
float* value) const;
status_t FindDouble(const char* name,
double* value) const;
status_t FindDouble(const char* name, int32 index,
double* value) const;
status_t FindPointer(const char* name,
void** pointer) const;
status_t FindPointer(const char* name, int32 index,
void** pointer) const;
status_t FindMessenger(const char* name,
BMessenger* messenger) const;
status_t FindMessenger(const char* name, int32 index,
BMessenger* messenger) const;
status_t FindRef(const char* name, entry_ref* ref) const;
status_t FindRef(const char* name, int32 index,
entry_ref* ref) const;
status_t FindMessage(const char* name,
BMessage* message) const;
status_t FindMessage(const char* name, int32 index,
BMessage* message) const;
status_t FindFlat(const char* name,
BFlattenable* object) const;
status_t FindFlat(const char* name, int32 index,
BFlattenable* object) const;
status_t FindData(const char* name, type_code type,
const void** data, ssize_t* numBytes) const;
status_t FindData(const char* name, type_code type,
int32 index, const void** data,
ssize_t* numBytes) const;
status_t ReplaceRect(const char *name, BRect aRect);
status_t ReplaceRect(const char *name, int32 index, BRect aRect);
// Replacing data
status_t ReplaceAlignment(const char* name,
const BAlignment& alignment);
status_t ReplaceAlignment(const char* name, int32 index,
const BAlignment& alignment);
status_t ReplacePoint(const char *name, BPoint aPoint);
status_t ReplacePoint(const char *name, int32 index, BPoint aPoint);
status_t ReplaceSize(const char* name, BSize aSize);
status_t ReplaceSize(const char* name, int32 index, BSize aSize);
status_t ReplaceRect(const char* name, BRect rect);
status_t ReplaceRect(const char* name, int32 index,
BRect rect);
status_t ReplaceString(const char *name, const char *aString);
status_t ReplaceString(const char *name, int32 index, const char *aString);
status_t ReplaceString(const char *name, const BString &aString);
status_t ReplaceString(const char *name, int32 index, const BString &aString);
status_t ReplaceInt8(const char *name, int8 value);
status_t ReplaceInt8(const char *name, int32 index, int8 value);
status_t ReplaceUInt8(const char *name, uint8 value);
status_t ReplaceUInt8(const char *name, int32 index, uint8 value);
status_t ReplaceInt16(const char *name, int16 value);
status_t ReplaceInt16(const char *name, int32 index, int16 value);
status_t ReplaceUInt16(const char *name, uint16 value);
status_t ReplaceUInt16(const char *name, int32 index, uint16 value);
status_t ReplaceInt32(const char *name, int32 value);
status_t ReplaceInt32(const char *name, int32 index, int32 value);
status_t ReplaceUInt32(const char *name, uint32 value);
status_t ReplaceUInt32(const char *name, int32 index, uint32 value);
status_t ReplaceInt64(const char *name, int64 value);
status_t ReplaceInt64(const char *name, int32 index, int64 value);
status_t ReplaceUInt64(const char *name, uint64 value);
status_t ReplaceUInt64(const char *name, int32 index, uint64 value);
status_t ReplaceBool(const char *name, bool aBoolean);
status_t ReplaceBool(const char *name, int32 index, bool aBoolean);
status_t ReplaceFloat(const char *name, float aFloat);
status_t ReplaceFloat(const char *name, int32 index, float aFloat);
status_t ReplaceDouble(const char *name, double aDouble);
status_t ReplaceDouble(const char *name, int32 index, double aDouble);
status_t ReplacePointer(const char *name, const void *pointer);
status_t ReplacePointer(const char *name,int32 index,const void *pointer);
status_t ReplaceMessenger(const char *name, BMessenger messenger);
status_t ReplaceMessenger(const char *name, int32 index, BMessenger messenger);
status_t ReplaceRef( const char *name,const entry_ref *ref);
status_t ReplaceRef( const char *name, int32 index, const entry_ref *ref);
status_t ReplaceMessage(const char *name, const BMessage *message);
status_t ReplaceMessage(const char *name, int32 index, const BMessage *message);
status_t ReplaceFlat(const char *name, BFlattenable *object);
status_t ReplaceFlat(const char *name, int32 index, BFlattenable *object);
status_t ReplaceData(const char *name, type_code type,
const void *data, ssize_t numBytes);
status_t ReplaceData(const char *name, type_code type, int32 index,
const void *data, ssize_t numBytes);
status_t ReplacePoint(const char* name, BPoint aPoint);
status_t ReplacePoint(const char* name, int32 index,
BPoint aPoint);
status_t ReplaceSize(const char* name, BSize aSize);
status_t ReplaceSize(const char* name, int32 index,
BSize aSize);
// Comparing data - Haiku experimental API
bool HasSameData(const BMessage &other,
bool ignoreFieldOrder = true, bool deep = false) const;
status_t ReplaceString(const char* name,
const char* string);
status_t ReplaceString(const char* name, int32 index,
const char* string);
status_t ReplaceString(const char* name,
const BString& string);
status_t ReplaceString(const char* name, int32 index,
const BString& string);
status_t ReplaceInt8(const char* name, int8 value);
status_t ReplaceInt8(const char* name, int32 index,
int8 value);
status_t ReplaceUInt8(const char* name, uint8 value);
status_t ReplaceUInt8(const char* name, int32 index,
uint8 value);
status_t ReplaceInt16(const char* name, int16 value);
status_t ReplaceInt16(const char* name, int32 index,
int16 value);
status_t ReplaceUInt16(const char* name, uint16 value);
status_t ReplaceUInt16(const char* name, int32 index,
uint16 value);
status_t ReplaceInt32(const char* name, int32 value);
status_t ReplaceInt32(const char* name, int32 index,
int32 value);
status_t ReplaceUInt32(const char* name, uint32 value);
status_t ReplaceUInt32(const char* name, int32 index,
uint32 value);
status_t ReplaceInt64(const char* name, int64 value);
status_t ReplaceInt64(const char* name, int32 index,
int64 value);
status_t ReplaceUInt64(const char* name, uint64 value);
status_t ReplaceUInt64(const char* name, int32 index,
uint64 value);
status_t ReplaceBool(const char* name, bool aBoolean);
status_t ReplaceBool(const char* name, int32 index,
bool value);
status_t ReplaceFloat(const char* name, float value);
status_t ReplaceFloat(const char* name, int32 index,
float value);
status_t ReplaceDouble(const char* name, double value);
status_t ReplaceDouble(const char* name, int32 index,
double value);
status_t ReplacePointer(const char* name,
const void* pointer);
status_t ReplacePointer(const char* name, int32 index,
const void* pointer);
status_t ReplaceMessenger(const char* name,
BMessenger messenger);
status_t ReplaceMessenger(const char* name, int32 index,
BMessenger messenger);
status_t ReplaceRef(const char* name,
const entry_ref* ref);
status_t ReplaceRef(const char* name, int32 index,
const entry_ref* ref);
status_t ReplaceMessage(const char* name,
const BMessage* message);
status_t ReplaceMessage(const char* name, int32 index,
const BMessage* message);
status_t ReplaceFlat(const char* name,
BFlattenable* object);
status_t ReplaceFlat(const char* name, int32 index,
BFlattenable* object);
status_t ReplaceData(const char* name, type_code type,
const void* data, ssize_t numBytes);
status_t ReplaceData(const char* name, type_code type,
int32 index, const void* data,
ssize_t numBytes);
void *operator new(size_t size);
void *operator new(size_t, void *pointer);
void operator delete(void *pointer, size_t size);
// Comparing data - Haiku experimental API
bool HasSameData(const BMessage& other,
bool ignoreFieldOrder = true,
bool deep = false) const;
// Private, reserved, or obsolete
bool HasAlignment(const char*, int32 n = 0) const;
bool HasRect(const char *, int32 n = 0) const;
bool HasPoint(const char *, int32 n = 0) const;
bool HasSize(const char*, int32 n = 0) const;
bool HasString(const char *, int32 n = 0) const;
bool HasInt8(const char *, int32 n = 0) const;
bool HasUInt8(const char *, int32 n = 0) const;
bool HasInt16(const char *, int32 n = 0) const;
bool HasUInt16(const char *, int32 n = 0) const;
bool HasInt32(const char *, int32 n = 0) const;
bool HasUInt32(const char *, int32 n = 0) const;
bool HasInt64(const char *, int32 n = 0) const;
bool HasUInt64(const char *, int32 n = 0) const;
bool HasBool(const char *, int32 n = 0) const;
bool HasFloat(const char *, int32 n = 0) const;
bool HasDouble(const char *, int32 n = 0) const;
bool HasPointer(const char *, int32 n = 0) const;
bool HasMessenger(const char *, int32 n = 0) const;
bool HasRef(const char *, int32 n = 0) const;
bool HasMessage(const char *, int32 n = 0) const;
bool HasFlat(const char *, const BFlattenable *) const;
bool HasFlat(const char *, int32 n, const BFlattenable *) const;
bool HasData(const char *, type_code , int32 n = 0) const;
BRect FindRect(const char *, int32 n = 0) const;
BPoint FindPoint(const char *, int32 n = 0) const;
const char *FindString(const char *, int32 n = 0) const;
int8 FindInt8(const char *, int32 n = 0) const;
int16 FindInt16(const char *, int32 n = 0) const;
int32 FindInt32(const char *, int32 n = 0) const;
int64 FindInt64(const char *, int32 n = 0) const;
bool FindBool(const char *, int32 n = 0) const;
float FindFloat(const char *, int32 n = 0) const;
double FindDouble(const char *, int32 n = 0) const;
void* operator new(size_t size);
void* operator new(size_t, void* pointer);
void* operator new(size_t,
const std::nothrow_t& noThrow);
void operator delete(void* pointer, size_t size);
class Private;
struct message_header;
struct field_header;
// Private, reserved, or obsolete
bool HasAlignment(const char* name,
int32 n = 0) const;
bool HasRect(const char* name, int32 n = 0) const;
bool HasPoint(const char* name, int32 n = 0) const;
bool HasSize(const char* name, int32 n = 0) const;
bool HasString(const char* name, int32 n = 0) const;
bool HasInt8(const char* name, int32 n = 0) const;
bool HasUInt8(const char* name, int32 n = 0) const;
bool HasInt16(const char* name, int32 n = 0) const;
bool HasUInt16(const char* name, int32 n = 0) const;
bool HasInt32(const char* name, int32 n = 0) const;
bool HasUInt32(const char* name, int32 n = 0) const;
bool HasInt64(const char* name, int32 n = 0) const;
bool HasUInt64(const char* name, int32 n = 0) const;
bool HasBool(const char* name, int32 n = 0) const;
bool HasFloat(const char* name, int32 n = 0) const;
bool HasDouble(const char* name, int32 n = 0) const;
bool HasPointer(const char* name, int32 n = 0) const;
bool HasMessenger(const char* name,
int32 n = 0) const;
bool HasRef(const char* name, int32 n = 0) const;
bool HasMessage(const char* name, int32 n = 0) const;
bool HasFlat(const char* name,
const BFlattenable* object) const;
bool HasFlat(const char* name, int32 n,
const BFlattenable* object) const;
bool HasData(const char* name, type_code ,
int32 n = 0) const;
BRect FindRect(const char* name, int32 n = 0) const;
BPoint FindPoint(const char* name, int32 n = 0) const;
const char* FindString(const char* name, int32 n = 0) const;
int8 FindInt8(const char* name, int32 n = 0) const;
int16 FindInt16(const char* name, int32 n = 0) const;
int32 FindInt32(const char* name, int32 n = 0) const;
int64 FindInt64(const char* name, int32 n = 0) const;
bool FindBool(const char* name, int32 n = 0) const;
float FindFloat(const char* name, int32 n = 0) const;
double FindDouble(const char* name, int32 n = 0) const;
private:
friend class Private;
friend class BMessageQueue;
// Convenience methods
bool GetBool(const char* name,
bool defaultValue) const;
bool GetBool(const char* name, int32 index,
bool defaultValue) const;
int8 GetInt8(const char* name,
int8 defaultValue) const;
int8 GetInt8(const char* name, int32 index,
int8 defaultValue) const;
uint8 GetUInt8(const char* name,
uint8 defaultValue) const;
uint8 GetUInt8(const char* name, int32 index,
uint8 defaultValue) const;
int16 GetInt16(const char* name,
int16 defaultValue) const;
int16 GetInt16(const char* name, int32 index,
int16 defaultValue) const;
uint16 GetUInt16(const char* name,
uint16 defaultValue) const;
uint16 GetUInt16(const char* name, int32 index,
uint16 defaultValue) const;
int32 GetInt32(const char* name,
int32 defaultValue) const;
int32 GetInt32(const char* name, int32 index,
int32 defaultValue) const;
uint32 GetUInt32(const char* name,
uint32 defaultValue) const;
uint32 GetUInt32(const char* name, int32 index,
uint32 defaultValue) const;
int64 GetInt64(const char* name,
int64 defaultValue) const;
int64 GetInt64(const char* name, int32 index,
int64 defaultValue) const;
uint64 GetUInt64(const char* name,
uint64 defaultValue) const;
uint64 GetUInt64(const char* name, int32 index,
uint64 defaultValue) const;
float GetFloat(const char* name,
float defaultValue) const;
float GetFloat(const char* name, int32 index,
float defaultValue) const;
double GetDouble(const char* name,
double defaultValue) const;
double GetDouble(const char* name, int32 index,
double defaultValue) const;
void* GetPointer(const char* name,
const void* defaultValue) const;
void* GetPointer(const char* name, int32 index,
const void* defaultValue) const;
const char* GetString(const char* name,
const char* defaultValue) const;
const char* GetString(const char* name, int32 index,
const char* defaultValue) const;
BAlignment GetAlignment(const char* name, int32 index,
const BAlignment& defaultValue) const;
BAlignment GetAlignment(const char* name,
const BAlignment& defaultValue) const;
BRect GetRect(const char* name, int32 index,
const BRect& defaultValue) const;
BRect GetRect(const char* name,
const BRect& defaultValue) const;
BPoint GetPoint(const char* name, int32 index,
const BPoint& defaultValue) const;
BPoint GetPoint(const char* name,
const BPoint& defaultValue) const;
BSize GetSize(const char* name, int32 index,
const BSize& defaultValue) const;
BSize GetSize(const char* name,
const BSize& defaultValue) const;
status_t _InitCommon(bool initHeader);
status_t _InitHeader();
status_t _Clear();
// fixed size fields only
status_t SetBool(const char* name, bool value);
status_t SetInt8(const char* name, int8 value);
status_t SetUInt8(const char* name, uint8 value);
status_t SetInt16(const char* name, int16 value);
status_t SetUInt16(const char* name, uint16 value);
status_t SetInt32(const char* name, int32 value);
status_t SetUInt32(const char* name, uint32 value);
status_t SetInt64(const char* name, int64 value);
status_t SetUInt64(const char* name, uint64 value);
status_t SetPointer(const char* name, const void* value);
status_t SetString(const char* name, const char* string);
status_t SetString(const char* name,
const BString& string);
status_t SetFloat(const char* name, float value);
status_t SetDouble(const char* name, double value);
status_t SetAlignment(const char* name,
const BAlignment& value);
status_t SetPoint(const char* name, const BPoint& value);
status_t SetRect(const char* name, const BRect& value);
status_t SetSize(const char* name, const BSize& value);
status_t SetData(const char* name, type_code type,
const void* data, ssize_t numBytes);
status_t _FlattenToArea(message_header **_header) const;
status_t _CopyForWrite();
status_t _Reference();
status_t _Dereference();
class Private;
struct message_header;
struct field_header;
status_t _ValidateMessage();
private:
friend class Private;
friend class BMessageQueue;
status_t _ResizeData(uint32 offset, int32 change);
status_t _InitCommon(bool initHeader);
status_t _InitHeader();
status_t _Clear();
uint32 _HashName(const char* name) const;
status_t _FindField(const char* name, type_code type,
field_header** _result) const;
status_t _AddField(const char* name, type_code type,
bool isFixedSize, field_header** _result);
status_t _RemoveField(field_header* field);
status_t _FlattenToArea(message_header** _header) const;
status_t _CopyForWrite();
status_t _Reference();
status_t _Dereference();
void _PrintToStream(const char* indent) const;
status_t _ValidateMessage();
private:
message_header* fHeader;
field_header* fFields;
uint8* fData;
status_t _ResizeData(uint32 offset, int32 change);
uint32 fFieldsAvailable;
size_t fDataAvailable;
uint32 _HashName(const char* name) const;
status_t _FindField(const char* name, type_code type,
field_header** _result) const;
status_t _AddField(const char* name, type_code type,
bool isFixedSize, field_header** _result);
status_t _RemoveField(field_header* field);
mutable BMessage* fOriginal;
void _PrintToStream(const char* indent) const;
BMessage* fQueueLink;
// fQueueLink is used by BMessageQueue to build a linked list
private:
BMessage(BMessage* message);
// deprecated
void* fArchivingPointer;
virtual void _ReservedMessage1();
virtual void _ReservedMessage2();
virtual void _ReservedMessage3();
uint32 fReserved[8];
status_t _SendMessage(port_id port, team_id portOwner,
int32 token, bigtime_t timeout,
bool replyRequired,
BMessenger& replyTo) const;
status_t _SendMessage(port_id port, team_id portOwner,
int32 token, BMessage* reply,
bigtime_t sendTimeout,
bigtime_t replyTimeout) const;
static status_t _SendFlattenedMessage(void* data, int32 size,
port_id port, int32 token,
bigtime_t timeout);
// deprecated
BMessage(BMessage *message);
static void _StaticInit();
static void _StaticReInitForkedChild();
static void _StaticCleanup();
static void _StaticCacheCleanup();
static int32 _StaticGetCachedReplyPort();
virtual void _ReservedMessage1();
virtual void _ReservedMessage2();
virtual void _ReservedMessage3();
private:
message_header* fHeader;
field_header* fFields;
uint8* fData;
status_t _SendMessage(port_id port, team_id portOwner, int32 token,
bigtime_t timeout, bool replyRequired,
BMessenger &replyTo) const;
status_t _SendMessage(port_id port, team_id portOwner,
int32 token, BMessage *reply, bigtime_t sendTimeout,
bigtime_t replyTimeout) const;
static status_t _SendFlattenedMessage(void *data, int32 size,
port_id port, int32 token, bigtime_t timeout);
uint32 fFieldsAvailable;
size_t fDataAvailable;
static void _StaticInit();
static void _StaticReInitForkedChild();
static void _StaticCleanup();
static void _StaticCacheCleanup();
static int32 _StaticGetCachedReplyPort();
mutable BMessage* fOriginal;
enum { sNumReplyPorts = 3 };
static port_id sReplyPorts[sNumReplyPorts];
static int32 sReplyPortInUse[sNumReplyPorts];
static int32 sGetCachedReplyPort();
BMessage* fQueueLink;
// fQueueLink is used by BMessageQueue to build a linked list
static BBlockCache* sMsgCache;
void* fArchivingPointer;
uint32 fReserved[8];
enum { sNumReplyPorts = 3 };
static port_id sReplyPorts[sNumReplyPorts];
static int32 sReplyPortInUse[sNumReplyPorts];
static int32 sGetCachedReplyPort();
static BBlockCache* sMsgCache;
};
#endif // _MESSAGE_H
+5
View File
@@ -48,6 +48,9 @@ public:
// Operators and misc
status_t SetTo(const char *signature, team_id team = -1);
status_t SetTo(const BHandler *handler, const BLooper *looper = NULL);
BMessenger &operator=(const BMessenger &from);
bool operator==(const BMessenger &other) const;
@@ -63,6 +66,8 @@ private:
void _SetTo(team_id team, port_id port, int32 token);
void _InitData(const char *signature, team_id team, status_t *result);
void _InitData(const BHandler *handler, const BLooper *looper,
status_t *result);
private:
port_id fPort;