Cleanup!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15806 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a31ddcb397
commit
5edcfe9619
@ -1,128 +1,69 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: Invoker.h
|
||||
// Author: Frans van Nispen (xlr8@tref.nl)
|
||||
// Description: BInvoker class defines a protocol for objects that
|
||||
// post messages to a "target".
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Frans van Nispen (xlr8@tref.nl)
|
||||
*/
|
||||
#ifndef _INVOKER_H
|
||||
#define _INVOKER_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <BeBuild.h>
|
||||
#include <Messenger.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
class BHandler;
|
||||
class BLooper;
|
||||
class BMessage;
|
||||
|
||||
// BInvoker class --------------------------------------------------------------
|
||||
|
||||
class BInvoker {
|
||||
public:
|
||||
BInvoker();
|
||||
BInvoker(BMessage *message,
|
||||
const BHandler *handler,
|
||||
const BLooper *looper = NULL);
|
||||
BInvoker(BMessage *message, BMessenger target);
|
||||
virtual ~BInvoker();
|
||||
public:
|
||||
BInvoker();
|
||||
BInvoker(BMessage* message, const BHandler* handler,
|
||||
const BLooper* looper = NULL);
|
||||
BInvoker(BMessage* message, BMessenger target);
|
||||
virtual ~BInvoker();
|
||||
|
||||
virtual status_t SetMessage(BMessage *message);
|
||||
BMessage *Message() const;
|
||||
uint32 Command() const;
|
||||
virtual status_t SetMessage(BMessage *message);
|
||||
BMessage* Message() const;
|
||||
uint32 Command() const;
|
||||
|
||||
virtual status_t SetTarget(const BHandler *h, const BLooper *loop = NULL);
|
||||
virtual status_t SetTarget(BMessenger messenger);
|
||||
bool IsTargetLocal() const;
|
||||
BHandler *Target(BLooper **looper = NULL) const;
|
||||
BMessenger Messenger() const;
|
||||
virtual status_t SetTarget(const BHandler *handler,
|
||||
const BLooper *looper = NULL);
|
||||
virtual status_t SetTarget(BMessenger messenger);
|
||||
bool IsTargetLocal() const;
|
||||
BHandler* Target(BLooper** _looper = NULL) const;
|
||||
BMessenger Messenger() const;
|
||||
|
||||
virtual status_t SetHandlerForReply(BHandler *handler);
|
||||
BHandler *HandlerForReply() const;
|
||||
virtual status_t SetHandlerForReply(BHandler* handler);
|
||||
BHandler* HandlerForReply() const;
|
||||
|
||||
virtual status_t Invoke(BMessage *msg = NULL);
|
||||
|
||||
// Invoke with BHandler notification. Use this to perform an
|
||||
// Invoke() with some other kind of notification change code.
|
||||
// (A raw invoke should always notify as B_CONTROL_INVOKED.)
|
||||
// Unlike a raw Invoke(), there is no standard message that is
|
||||
// sent. If 'msg' is NULL, then nothing will be sent to this
|
||||
// invoker's target... however, a notification message will
|
||||
// still be sent to any watchers of the invoker's handler.
|
||||
// Note that the BInvoker class does not actually implement
|
||||
// any of this behavior -- it is up to subclasses to override
|
||||
// Invoke() and call Notify() with the appropriate change code.
|
||||
status_t InvokeNotify(BMessage *msg, uint32 kind = B_CONTROL_INVOKED);
|
||||
status_t SetTimeout(bigtime_t timeout);
|
||||
bigtime_t Timeout() const;
|
||||
virtual status_t Invoke(BMessage* message = NULL);
|
||||
status_t InvokeNotify(BMessage* message,
|
||||
uint32 kind = B_CONTROL_INVOKED);
|
||||
status_t SetTimeout(bigtime_t timeout);
|
||||
bigtime_t Timeout() const;
|
||||
|
||||
protected:
|
||||
// Return the change code for a notification. This is either
|
||||
// B_CONTROL_INVOKED for raw Invoke() calls, or the kind
|
||||
// supplied to InvokeNotify(). In addition, 'notify' will be
|
||||
// set to true if this was an InvokeNotify() call, else false.
|
||||
uint32 InvokeKind(bool* notify = NULL);
|
||||
protected:
|
||||
uint32 InvokeKind(bool* _notify = NULL);
|
||||
void BeginInvokeNotify(uint32 kind = B_CONTROL_INVOKED);
|
||||
void EndInvokeNotify();
|
||||
|
||||
// Start and end an InvokeNotify context around an Invoke() call.
|
||||
// These are only needed for writing custom methods that
|
||||
// emulate the standard InvokeNotify() call.
|
||||
void BeginInvokeNotify(uint32 kind = B_CONTROL_INVOKED);
|
||||
void EndInvokeNotify();
|
||||
private:
|
||||
virtual void _ReservedInvoker1();
|
||||
virtual void _ReservedInvoker2();
|
||||
virtual void _ReservedInvoker3();
|
||||
|
||||
// Private or reserved ---------------------------------------------------------
|
||||
private:
|
||||
// to be able to keep binary compatibility
|
||||
virtual void _ReservedInvoker1();
|
||||
virtual void _ReservedInvoker2();
|
||||
virtual void _ReservedInvoker3();
|
||||
BInvoker(const BInvoker&);
|
||||
BInvoker& operator=(const BInvoker&);
|
||||
|
||||
BInvoker(const BInvoker&);
|
||||
BInvoker &operator=(const BInvoker&);
|
||||
|
||||
BMessage *fMessage;
|
||||
BMessenger fMessenger;
|
||||
BHandler *fReplyTo;
|
||||
bigtime_t fTimeout;
|
||||
uint32 fNotifyKind;
|
||||
uint32 _reserved[1]; // to be able to keep binary compatibility
|
||||
BMessage* fMessage;
|
||||
BMessenger fMessenger;
|
||||
BHandler* fReplyTo;
|
||||
bigtime_t fTimeout;
|
||||
uint32 fNotifyKind;
|
||||
uint32 _reserved[1];
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif // _INVOKER_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,46 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: MessageFilter.h
|
||||
// Author: Erik Jaesler (erik@cgsoftware.com)
|
||||
// Description: BMessageFilter class creates objects that filter
|
||||
// in-coming BMessages.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Erik Jaesler (erik@cgsoftware.com)
|
||||
*/
|
||||
#ifndef _MESSAGE_FILTER_H
|
||||
#define _MESSAGE_FILTER_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <BeBuild.h>
|
||||
#include <Handler.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
class BMessage;
|
||||
|
||||
@ -67,60 +38,48 @@ enum message_source {
|
||||
B_LOCAL_SOURCE
|
||||
};
|
||||
|
||||
|
||||
// BMessageFilter Class --------------------------------------------------------
|
||||
class BMessageFilter {
|
||||
public:
|
||||
BMessageFilter(uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter(message_delivery delivery,
|
||||
message_source source, filter_hook func = NULL);
|
||||
BMessageFilter(message_delivery delivery,
|
||||
message_source source, uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter(const BMessageFilter& filter);
|
||||
BMessageFilter(const BMessageFilter* filter);
|
||||
virtual ~BMessageFilter();
|
||||
|
||||
public:
|
||||
BMessageFilter( uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter( message_delivery delivery,
|
||||
message_source source,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter( message_delivery delivery,
|
||||
message_source source,
|
||||
uint32 what,
|
||||
filter_hook func = NULL);
|
||||
BMessageFilter(const BMessageFilter& filter);
|
||||
BMessageFilter(const BMessageFilter* filter);
|
||||
virtual ~BMessageFilter();
|
||||
BMessageFilter& operator=(const BMessageFilter& from);
|
||||
|
||||
BMessageFilter &operator=(const BMessageFilter& from);
|
||||
// Hook function; ignored if filter_hook is non-NULL
|
||||
virtual filter_result Filter(BMessage* message, BHandler** _target);
|
||||
|
||||
// Hook function; ignored if filter_hook is non-NULL
|
||||
virtual filter_result Filter(BMessage* message, BHandler** target);
|
||||
message_delivery MessageDelivery() const;
|
||||
message_source MessageSource() const;
|
||||
uint32 Command() const;
|
||||
bool FiltersAnyCommand() const;
|
||||
BLooper* Looper() const;
|
||||
|
||||
message_delivery MessageDelivery() const;
|
||||
message_source MessageSource() const;
|
||||
uint32 Command() const;
|
||||
bool FiltersAnyCommand() const;
|
||||
BLooper *Looper() const;
|
||||
private:
|
||||
friend class BLooper;
|
||||
friend class BHandler;
|
||||
|
||||
// Private or reserved ---------------------------------------------------------
|
||||
private:
|
||||
friend class BLooper;
|
||||
friend class BHandler;
|
||||
virtual void _ReservedMessageFilter1();
|
||||
virtual void _ReservedMessageFilter2();
|
||||
|
||||
virtual void _ReservedMessageFilter1();
|
||||
virtual void _ReservedMessageFilter2();
|
||||
|
||||
void SetLooper(BLooper* owner);
|
||||
filter_hook FilterFunction() const;
|
||||
bool fFiltersAny;
|
||||
uint32 what;
|
||||
message_delivery fDelivery;
|
||||
message_source fSource;
|
||||
BLooper *fLooper;
|
||||
filter_hook fFilterFunction;
|
||||
uint32 _reserved[3];
|
||||
void SetLooper(BLooper* owner);
|
||||
filter_hook FilterFunction() const;
|
||||
bool fFiltersAny;
|
||||
uint32 fWhat;
|
||||
message_delivery fDelivery;
|
||||
message_source fSource;
|
||||
BLooper *fLooper;
|
||||
filter_hook fFilterFunction;
|
||||
uint32 _reserved[3];
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif // _MESSAGE_FILTER_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,28 +1,11 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: AppMisc.cpp
|
||||
// Author: Ingo Weinhold (bonefish@users.sf.net)
|
||||
// Description: Miscellaneous private functionality.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold, bonefish@@users.sf.net
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/utsname.h>
|
||||
@ -32,6 +15,7 @@
|
||||
#include <image.h>
|
||||
#include <OS.h>
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
// get_app_path
|
||||
|
@ -1,44 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2004, Haiku
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: Clipboard.cpp
|
||||
// Author: Gabe Yoder (gyoder@stny.rr.com)
|
||||
// Description: BClipboard provides an interface to a system-wide clipboard
|
||||
// storage area.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Gabe Yoder (gyoder@stny.rr.com)
|
||||
*/
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <ClipboardPrivate.h>
|
||||
|
||||
#include <Clipboard.h>
|
||||
#include <Application.h>
|
||||
#include <RegistrarDefs.h>
|
||||
#include <RosterPrivate.h>
|
||||
|
||||
#include <ClipboardPrivate.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
#ifdef RUN_WITHOUT_REGISTRAR
|
||||
static BClipboard sClipboard(NULL);
|
||||
BClipboard *be_clipboard = &sClipboard;
|
||||
@ -86,6 +65,7 @@ BClipboard::Name() const
|
||||
return (const char *)fName;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Returns the (locally cached) number of commits to the clipboard.
|
||||
|
||||
The returned value is the number of successful Commit() invocations for
|
||||
@ -102,6 +82,7 @@ BClipboard::LocalCount() const
|
||||
return fCount;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Returns the number of commits to the clipboard.
|
||||
|
||||
The returned value is the number of successful Commit() invocations for
|
||||
@ -240,8 +221,7 @@ BClipboard::Data() const
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// Private methods
|
||||
// #pragma mark - Private methods
|
||||
|
||||
|
||||
BClipboard::BClipboard(const BClipboard &)
|
||||
@ -305,7 +285,10 @@ BClipboard::UploadToSystem()
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
// init_clipboard
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
/*! \brief Initializes the global \c be_clipboard.
|
||||
|
||||
Invoked at libbe initialization time.
|
||||
|
@ -1,29 +1,11 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2005, Haiku
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: Handler.cpp
|
||||
// Author: Erik Jaesler (erik@cgsoftware.com)
|
||||
// Description: BHandler defines the message-handling protocol.
|
||||
// MessageReceived() is its lynchpin.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Erik Jaesler (erik@cgsoftware.com)
|
||||
*/
|
||||
|
||||
/**
|
||||
@note Some musings on the member variable 'fToken'. In searching a dump
|
||||
of libbe.so, I found a struct/class called 'TokenSpace', which has
|
||||
@ -119,15 +101,8 @@
|
||||
Maybe that's too heavy-weight a solution, though.
|
||||
*/
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <TokenSpace.h>
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <AppDefs.h>
|
||||
#include <Handler.h>
|
||||
#include <Looper.h>
|
||||
@ -136,8 +111,10 @@
|
||||
#include <Messenger.h>
|
||||
#include <PropertyInfo.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
#include <TokenSpace.h>
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
||||
using std::map;
|
||||
using std::vector;
|
||||
|
@ -1,145 +1,138 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: Invoker.cpp
|
||||
// Author: Marc Flerackers (mflerackers@androme.be)
|
||||
// Description: BInvoker class defines a protocol for objects that
|
||||
// post messages to a "target".
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Marc Flerackers (mflerackers@androme.be)
|
||||
*/
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <Invoker.h>
|
||||
#include <Errors.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
BInvoker::BInvoker(BMessage *message, BMessenger messenger)
|
||||
: fMessage(message),
|
||||
fMessenger(messenger),
|
||||
fReplyTo(NULL),
|
||||
fTimeout(B_INFINITE_TIMEOUT),
|
||||
fNotifyKind(0)
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BInvoker::BInvoker(BMessage *message, const BHandler *handler,
|
||||
const BLooper *looper)
|
||||
: fMessage(message),
|
||||
fMessenger(BMessenger(handler, looper)),
|
||||
fReplyTo(NULL),
|
||||
fTimeout(B_INFINITE_TIMEOUT),
|
||||
fNotifyKind(0)
|
||||
BInvoker::BInvoker(BMessage* message, BMessenger messenger)
|
||||
:
|
||||
fMessage(message),
|
||||
fMessenger(messenger),
|
||||
fReplyTo(NULL),
|
||||
fTimeout(B_INFINITE_TIMEOUT),
|
||||
fNotifyKind(0)
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
BInvoker::BInvoker(BMessage* message, const BHandler* handler,
|
||||
const BLooper* looper)
|
||||
:
|
||||
fMessage(message),
|
||||
fMessenger(BMessenger(handler, looper)),
|
||||
fReplyTo(NULL),
|
||||
fTimeout(B_INFINITE_TIMEOUT),
|
||||
fNotifyKind(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BInvoker::BInvoker()
|
||||
: fMessage(NULL),
|
||||
fReplyTo(NULL),
|
||||
fTimeout(B_INFINITE_TIMEOUT),
|
||||
fNotifyKind(0)
|
||||
:
|
||||
fMessage(NULL),
|
||||
fReplyTo(NULL),
|
||||
fTimeout(B_INFINITE_TIMEOUT),
|
||||
fNotifyKind(0)
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
BInvoker::~BInvoker()
|
||||
{
|
||||
delete fMessage;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BInvoker::SetMessage(BMessage *message)
|
||||
|
||||
|
||||
status_t
|
||||
BInvoker::SetMessage(BMessage* message)
|
||||
{
|
||||
if (fMessage == message)
|
||||
return B_OK;
|
||||
|
||||
if (fMessage)
|
||||
delete fMessage;
|
||||
|
||||
delete fMessage;
|
||||
fMessage = message;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BMessage *BInvoker::Message() const
|
||||
|
||||
|
||||
BMessage *
|
||||
BInvoker::Message() const
|
||||
{
|
||||
return fMessage;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
uint32 BInvoker::Command() const
|
||||
|
||||
|
||||
uint32
|
||||
BInvoker::Command() const
|
||||
{
|
||||
if (fMessage)
|
||||
return fMessage->what;
|
||||
else
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BInvoker::SetTarget(BMessenger messenger)
|
||||
|
||||
|
||||
status_t
|
||||
BInvoker::SetTarget(BMessenger messenger)
|
||||
{
|
||||
fMessenger = messenger;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BInvoker::SetTarget(const BHandler *handler, const BLooper *looper)
|
||||
|
||||
|
||||
status_t
|
||||
BInvoker::SetTarget(const BHandler* handler, const BLooper* looper)
|
||||
{
|
||||
fMessenger = BMessenger(handler, looper);
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BInvoker::IsTargetLocal() const
|
||||
|
||||
|
||||
bool
|
||||
BInvoker::IsTargetLocal() const
|
||||
{
|
||||
return fMessenger.IsTargetLocal();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BHandler *BInvoker::Target(BLooper **looper) const
|
||||
|
||||
|
||||
BHandler*
|
||||
BInvoker::Target(BLooper** _looper) const
|
||||
{
|
||||
return fMessenger.Target(looper);
|
||||
return fMessenger.Target(_looper);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BMessenger BInvoker::Messenger() const
|
||||
|
||||
|
||||
BMessenger
|
||||
BInvoker::Messenger() const
|
||||
{
|
||||
return fMessenger;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BInvoker::SetHandlerForReply(BHandler *replyHandler)
|
||||
|
||||
|
||||
status_t
|
||||
BInvoker::SetHandlerForReply(BHandler* replyHandler)
|
||||
{
|
||||
fReplyTo = replyHandler;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BHandler *BInvoker::HandlerForReply() const
|
||||
|
||||
|
||||
BHandler *
|
||||
BInvoker::HandlerForReply() const
|
||||
{
|
||||
return fReplyTo;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BInvoker::Invoke(BMessage *message)
|
||||
|
||||
|
||||
status_t
|
||||
BInvoker::Invoke(BMessage* message)
|
||||
{
|
||||
if (!message)
|
||||
message = Message();
|
||||
@ -149,64 +142,77 @@ status_t BInvoker::Invoke(BMessage *message)
|
||||
|
||||
return fMessenger.SendMessage(message, fReplyTo, fTimeout);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BInvoker::InvokeNotify(BMessage *message, uint32 kind)
|
||||
|
||||
|
||||
status_t
|
||||
BInvoker::InvokeNotify(BMessage* message, uint32 kind)
|
||||
{
|
||||
if (fNotifyKind != 0)
|
||||
return B_WOULD_BLOCK;
|
||||
|
||||
BeginInvokeNotify(kind);
|
||||
|
||||
status_t err = Invoke(message);
|
||||
|
||||
EndInvokeNotify();
|
||||
|
||||
return err;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BInvoker::SetTimeout(bigtime_t timeout)
|
||||
|
||||
|
||||
status_t
|
||||
BInvoker::SetTimeout(bigtime_t timeout)
|
||||
{
|
||||
fTimeout = timeout;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bigtime_t BInvoker::Timeout() const
|
||||
|
||||
|
||||
bigtime_t
|
||||
BInvoker::Timeout() const
|
||||
{
|
||||
return fTimeout;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
uint32 BInvoker::InvokeKind(bool *notify)
|
||||
|
||||
|
||||
uint32
|
||||
BInvoker::InvokeKind(bool* _notify)
|
||||
{
|
||||
if (notify)
|
||||
*notify = (fNotifyKind != 0) ? true : false;
|
||||
if (_notify)
|
||||
*_notify = fNotifyKind != 0;
|
||||
|
||||
if (fNotifyKind != 0)
|
||||
return fNotifyKind;
|
||||
else
|
||||
return B_CONTROL_INVOKED;
|
||||
|
||||
return B_CONTROL_INVOKED;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BInvoker::BeginInvokeNotify(uint32 kind)
|
||||
|
||||
|
||||
void
|
||||
BInvoker::BeginInvokeNotify(uint32 kind)
|
||||
{
|
||||
fNotifyKind = kind;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BInvoker::EndInvokeNotify()
|
||||
|
||||
|
||||
void
|
||||
BInvoker::EndInvokeNotify()
|
||||
{
|
||||
fNotifyKind = 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void BInvoker::_ReservedInvoker1() {}
|
||||
void BInvoker::_ReservedInvoker2() {}
|
||||
void BInvoker::_ReservedInvoker3() {}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
BInvoker::BInvoker(const BInvoker &)
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BInvoker &BInvoker::operator=(const BInvoker &)
|
||||
|
||||
|
||||
BInvoker &
|
||||
BInvoker::operator=(const BInvoker &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
@ -1,89 +1,72 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: LooperList.cpp
|
||||
// Author(s): Erik Jaesler (erik@cgsoftware.com)
|
||||
// Description: Maintains a global list of all loopers in a given team.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Erik Jaesler (erik@cgsoftware.com)
|
||||
*/
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
#include <algorithm>
|
||||
//! Maintains a global list of all loopers in a given team.
|
||||
|
||||
|
||||
#include "LooperList.h"
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <Autolock.h>
|
||||
#include <Looper.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
#include <algorithm>
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
#include "LooperList.h"
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
using std::vector;
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
BLooperList gLooperList;
|
||||
|
||||
typedef vector<BLooperList::LooperData>::iterator LDIter;
|
||||
typedef vector<BLooperList::LooperData>::iterator LooperDataIterator;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
BLooperList::BLooperList()
|
||||
: fLock("BLooperList lock"),
|
||||
:
|
||||
fLock("BLooperList lock"),
|
||||
fLooperID(0)
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::Lock()
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::Lock()
|
||||
{
|
||||
return fLock.Lock();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BLooperList::Unlock()
|
||||
|
||||
|
||||
void
|
||||
BLooperList::Unlock()
|
||||
{
|
||||
fLock.Unlock();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::IsLocked()
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::IsLocked()
|
||||
{
|
||||
return fLock.IsLocked();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BLooperList::AddLooper(BLooper* looper)
|
||||
|
||||
|
||||
void
|
||||
BLooperList::AddLooper(BLooper* looper)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
if (!IsLooperValid(looper))
|
||||
{
|
||||
LDIter i = find_if(fData.begin(), fData.end(), EmptySlotPred);
|
||||
if (i == fData.end())
|
||||
{
|
||||
if (!IsLooperValid(looper)) {
|
||||
LooperDataIterator i = find_if(fData.begin(), fData.end(), EmptySlotPred);
|
||||
if (i == fData.end()) {
|
||||
fData.push_back(LooperData(looper, ++fLooperID));
|
||||
looper->fLooperID = fLooperID;
|
||||
looper->Lock();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
i->looper = looper;
|
||||
i->id = ++fLooperID;
|
||||
looper->fLooperID = fLooperID;
|
||||
@ -91,183 +74,188 @@ void BLooperList::AddLooper(BLooper* looper)
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::IsLooperValid(const BLooper* looper)
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::IsLooperValid(const BLooper* looper)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
|
||||
return find_if(fData.begin(), fData.end(), FindLooperPred(looper)) !=
|
||||
fData.end();
|
||||
return find_if(fData.begin(), fData.end(),
|
||||
FindLooperPred(looper)) != fData.end();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::RemoveLooper(BLooper* looper)
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::RemoveLooper(BLooper* looper)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
|
||||
LDIter i = find_if(fData.begin(), fData.end(), FindLooperPred(looper));
|
||||
if (i != fData.end())
|
||||
{
|
||||
LooperDataIterator i = find_if(fData.begin(), fData.end(),
|
||||
FindLooperPred(looper));
|
||||
if (i != fData.end()) {
|
||||
i->looper = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BLooperList::GetLooperList(BList* list)
|
||||
|
||||
|
||||
void
|
||||
BLooperList::GetLooperList(BList* list)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
for (uint32 i = 0; i < fData.size(); ++i)
|
||||
{
|
||||
|
||||
for (uint32 i = 0; i < fData.size(); ++i) {
|
||||
if (fData[i].looper)
|
||||
list->AddItem(fData[i].looper);
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
int32 BLooperList::CountLoopers()
|
||||
|
||||
|
||||
int32
|
||||
BLooperList::CountLoopers()
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
return (int32)fData.size();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BLooper* BLooperList::LooperAt(int32 index)
|
||||
|
||||
|
||||
BLooper*
|
||||
BLooperList::LooperAt(int32 index)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
|
||||
BLooper* Looper = NULL;
|
||||
BLooper* looper = NULL;
|
||||
if (index < (int32)fData.size())
|
||||
{
|
||||
Looper = fData[(uint32)index].looper;
|
||||
}
|
||||
looper = fData[(uint32)index].looper;
|
||||
|
||||
return Looper;
|
||||
return looper;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BLooper* BLooperList::LooperForThread(thread_id tid)
|
||||
|
||||
|
||||
BLooper*
|
||||
BLooperList::LooperForThread(thread_id thread)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
BLooper* looper = NULL;
|
||||
LDIter i = find_if(fData.begin(), fData.end(), FindThreadPred(tid));
|
||||
LooperDataIterator i = find_if(fData.begin(), fData.end(), FindThreadPred(thread));
|
||||
if (i != fData.end())
|
||||
{
|
||||
looper = i->looper;
|
||||
}
|
||||
|
||||
return looper;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BLooper* BLooperList::LooperForName(const char* name)
|
||||
|
||||
|
||||
BLooper*
|
||||
BLooperList::LooperForName(const char* name)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
BLooper* looper = NULL;
|
||||
LDIter i = find_if(fData.begin(), fData.end(), FindNamePred(name));
|
||||
LooperDataIterator i = find_if(fData.begin(), fData.end(), FindNamePred(name));
|
||||
if (i != fData.end())
|
||||
{
|
||||
looper = i->looper;
|
||||
}
|
||||
|
||||
return looper;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BLooper* BLooperList::LooperForPort(port_id port)
|
||||
|
||||
|
||||
BLooper*
|
||||
BLooperList::LooperForPort(port_id port)
|
||||
{
|
||||
BAutolock Listlock(fLock);
|
||||
AssertLocked();
|
||||
BLooper* looper = NULL;
|
||||
LDIter i = find_if(fData.begin(), fData.end(), FindPortPred(port));
|
||||
LooperDataIterator i = find_if(fData.begin(), fData.end(), FindPortPred(port));
|
||||
if (i != fData.end())
|
||||
{
|
||||
looper = i->looper;
|
||||
}
|
||||
|
||||
return looper;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::EmptySlotPred(LooperData& Data)
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::EmptySlotPred(LooperData& Data)
|
||||
{
|
||||
return Data.looper == NULL;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BLooperList::AssertLocked()
|
||||
|
||||
|
||||
void
|
||||
BLooperList::AssertLocked()
|
||||
{
|
||||
if (!IsLocked())
|
||||
{
|
||||
debugger("looperlist is not locked; proceed at great risk!");
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// #pragma mark -
|
||||
// #pragma mark BLooperList::LooperData
|
||||
// #pragma mark -
|
||||
//------------------------------------------------------------------------------
|
||||
// #pragma mark - BLooperList::LooperData
|
||||
|
||||
|
||||
BLooperList::LooperData::LooperData()
|
||||
: looper(NULL), id(0)
|
||||
: looper(NULL), id(0)
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
BLooperList::LooperData::LooperData(BLooper* loop, uint32 i)
|
||||
: looper(loop), id(i)
|
||||
: looper(loop), id(i)
|
||||
{
|
||||
;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BLooperList::LooperData::LooperData(const LooperData& rhs)
|
||||
|
||||
|
||||
BLooperList::LooperData::LooperData(const LooperData& other)
|
||||
{
|
||||
*this = rhs;
|
||||
*this = other;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
BLooperList::LooperData&
|
||||
BLooperList::LooperData::operator=(const LooperData& rhs)
|
||||
BLooperList::LooperData::operator=(const LooperData& other)
|
||||
{
|
||||
if (this != &rhs)
|
||||
{
|
||||
looper = rhs.looper;
|
||||
id = rhs.id;
|
||||
if (this != &other) {
|
||||
looper = other.looper;
|
||||
id = other.id;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::FindLooperPred::operator()(BLooperList::LooperData& Data)
|
||||
bool
|
||||
BLooperList::FindLooperPred::operator()(BLooperList::LooperData& Data)
|
||||
{
|
||||
return Data.looper && (looper == Data.looper);
|
||||
return Data.looper && looper == Data.looper;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::FindThreadPred::operator()(LooperData& Data)
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::FindThreadPred::operator()(LooperData& Data)
|
||||
{
|
||||
return Data.looper && (thread == Data.looper->Thread());
|
||||
return Data.looper && thread == Data.looper->Thread();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::FindNamePred::operator()(LooperData& Data)
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::FindNamePred::operator()(LooperData& Data)
|
||||
{
|
||||
return Data.looper && (strcmp(name, Data.looper->Name()) == 0);
|
||||
return Data.looper && !strcmp(name, Data.looper->Name());
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BLooperList::FindPortPred::operator()(LooperData& Data)
|
||||
|
||||
|
||||
bool
|
||||
BLooperList::FindPortPred::operator()(LooperData& Data)
|
||||
{
|
||||
return Data.looper && (port == _get_looper_port_(Data.looper));
|
||||
return Data.looper && port == _get_looper_port_(Data.looper);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,63 +1,49 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: MessageFilter.cpp
|
||||
// Author: Erik Jaesler (erik@cgsoftware.com)
|
||||
// Description: BMessageFilter class creates objects that filter
|
||||
// in-coming BMessages.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Erik Jaesler (erik@cgsoftware.com)
|
||||
*/
|
||||
|
||||
|
||||
#include <MessageFilter.h>
|
||||
|
||||
|
||||
BMessageFilter::BMessageFilter(uint32 inWhat, filter_hook func)
|
||||
: fFiltersAny(false),
|
||||
what(inWhat),
|
||||
fDelivery(B_ANY_DELIVERY),
|
||||
fSource(B_ANY_SOURCE),
|
||||
fLooper(NULL),
|
||||
fFilterFunction(func)
|
||||
:
|
||||
fFiltersAny(false),
|
||||
fWhat(inWhat),
|
||||
fDelivery(B_ANY_DELIVERY),
|
||||
fSource(B_ANY_SOURCE),
|
||||
fLooper(NULL),
|
||||
fFilterFunction(func)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BMessageFilter::BMessageFilter(message_delivery delivery, message_source source,
|
||||
filter_hook func)
|
||||
: fFiltersAny(true),
|
||||
what(0),
|
||||
fDelivery(delivery),
|
||||
fSource(source),
|
||||
fLooper(NULL),
|
||||
fFilterFunction(func)
|
||||
BMessageFilter::BMessageFilter(message_delivery delivery,
|
||||
message_source source, filter_hook func)
|
||||
:
|
||||
fFiltersAny(true),
|
||||
fWhat(0),
|
||||
fDelivery(delivery),
|
||||
fSource(source),
|
||||
fLooper(NULL),
|
||||
fFilterFunction(func)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BMessageFilter::BMessageFilter(message_delivery delivery, message_source source,
|
||||
uint32 inWhat, filter_hook func)
|
||||
: fFiltersAny(false),
|
||||
what(inWhat),
|
||||
fDelivery(delivery),
|
||||
fSource(source),
|
||||
fLooper(NULL),
|
||||
fFilterFunction(func)
|
||||
BMessageFilter::BMessageFilter(message_delivery delivery,
|
||||
message_source source, uint32 inWhat, filter_hook func)
|
||||
:
|
||||
fFiltersAny(false),
|
||||
fWhat(inWhat),
|
||||
fDelivery(delivery),
|
||||
fSource(source),
|
||||
fLooper(NULL),
|
||||
fFilterFunction(func)
|
||||
{
|
||||
}
|
||||
|
||||
@ -83,7 +69,7 @@ BMessageFilter &
|
||||
BMessageFilter::operator=(const BMessageFilter& from)
|
||||
{
|
||||
fFiltersAny = from.FiltersAnyCommand();
|
||||
what = from.Command();
|
||||
fWhat = from.Command();
|
||||
fDelivery = from.MessageDelivery();
|
||||
fSource = from.MessageSource();
|
||||
fFilterFunction = from.FilterFunction();
|
||||
@ -118,7 +104,7 @@ BMessageFilter::MessageSource() const
|
||||
uint32
|
||||
BMessageFilter::Command() const
|
||||
{
|
||||
return what;
|
||||
return fWhat;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,29 +1,12 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: MessageRunner.cpp
|
||||
// Author: Ingo Weinhold (bonefish@users.sf.net)
|
||||
// Description: A BMessageRunner periodically sends a message to a
|
||||
// specified target.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold (bonefish@users.sf.net)
|
||||
*/
|
||||
|
||||
|
||||
#include <Application.h>
|
||||
#include <AppMisc.h>
|
||||
#include <MessageRunner.h>
|
||||
@ -33,6 +16,7 @@
|
||||
|
||||
using namespace BPrivate;
|
||||
|
||||
|
||||
// constructor
|
||||
/*! \brief Creates and initializes a new BMessageRunner.
|
||||
|
||||
|
@ -1,40 +1,21 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2005, Haiku
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: Messenger.h
|
||||
// Author: Ingo Weinhold (bonefish@users.sf.net)
|
||||
// Description: BMessenger delivers messages to local or remote targets.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold (bonefish@users.sf.net)
|
||||
*/
|
||||
|
||||
// debugging
|
||||
//#define DBG(x) x
|
||||
#define DBG(x)
|
||||
#define OUT printf
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
#include <new>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <AppMisc.h>
|
||||
#include <MessageUtils.h>
|
||||
#include "ObjectLocker.h"
|
||||
#include "TokenSpace.h"
|
||||
|
||||
#ifdef USING_MESSAGE4
|
||||
# include <MessagePrivate.h>
|
||||
#endif
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <Application.h>
|
||||
#include <Handler.h>
|
||||
#include <Looper.h>
|
||||
@ -45,21 +26,15 @@
|
||||
#include <Roster.h>
|
||||
#include <TokenSpace.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
#include <AppMisc.h>
|
||||
#include <MessageUtils.h>
|
||||
#include "ObjectLocker.h"
|
||||
#include "TokenSpace.h"
|
||||
#include <new>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef USING_MESSAGE4
|
||||
#include <MessagePrivate.h>
|
||||
#endif
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
// debugging
|
||||
//#define DBG(x) x
|
||||
#define DBG(x)
|
||||
#define OUT printf
|
||||
|
||||
using BPrivate::gDefaultTokens;
|
||||
using BPrivate::gLooperList;
|
||||
|
@ -1,116 +1,94 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: PropertyInfo.h
|
||||
// Author: Marc Flerackers (mflerackers@androme.be)
|
||||
// Description: Utility class for maintain scripting information.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Marc Flerackers (mflerackers@androme.be)
|
||||
*/
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <PropertyInfo.h>
|
||||
#include <Message.h>
|
||||
#include <Errors.h>
|
||||
#include <ByteOrder.h>
|
||||
#include <DataIO.h>
|
||||
#include <Message.h>
|
||||
#include <PropertyInfo.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
BPropertyInfo::BPropertyInfo(property_info *p, value_info *ci,
|
||||
bool free_on_delete)
|
||||
: fPropInfo(p),
|
||||
fValueInfo(ci),
|
||||
fPropCount(0),
|
||||
fInHeap(free_on_delete),
|
||||
fValueCount(0)
|
||||
BPropertyInfo::BPropertyInfo(property_info* propertyInfo, value_info* valueInfo,
|
||||
bool freeOnDelete)
|
||||
:
|
||||
fPropInfo(propertyInfo),
|
||||
fValueInfo(valueInfo),
|
||||
fPropCount(0),
|
||||
fInHeap(freeOnDelete),
|
||||
fValueCount(0)
|
||||
{
|
||||
if (fPropInfo)
|
||||
{
|
||||
if (fPropInfo != NULL) {
|
||||
while (fPropInfo[fPropCount].name)
|
||||
fPropCount++;
|
||||
}
|
||||
|
||||
if (fValueInfo)
|
||||
{
|
||||
if (fValueInfo != NULL) {
|
||||
while (fValueInfo[fValueCount].name)
|
||||
fValueCount++;
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
BPropertyInfo::~BPropertyInfo()
|
||||
{
|
||||
FreeMem();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
int32 BPropertyInfo::FindMatch(BMessage *msg, int32 index, BMessage *spec,
|
||||
int32 form, const char *prop, void *data) const
|
||||
|
||||
|
||||
int32 BPropertyInfo::FindMatch(BMessage* message, int32 index,
|
||||
BMessage* specifier, int32 form, const char* property, void* data) const
|
||||
{
|
||||
int32 property_index = 0;
|
||||
int32 propertyIndex = 0;
|
||||
|
||||
while ((fPropInfo != NULL) && (fPropInfo[property_index].name)) {
|
||||
property_info *propInfo = fPropInfo + property_index;
|
||||
while (fPropInfo != NULL && fPropInfo[propertyIndex].name != NULL) {
|
||||
property_info* propertyInfo = fPropInfo + propertyIndex;
|
||||
|
||||
if ((strcmp(propInfo->name, prop) == 0) &&
|
||||
(FindCommand(msg->what, index, propInfo)) &&
|
||||
(FindSpecifier(form, propInfo))) {
|
||||
if (!strcmp(propertyInfo->name, property)
|
||||
&& FindCommand(message->what, index, propertyInfo)
|
||||
&& FindSpecifier(form, propertyInfo)) {
|
||||
if (data)
|
||||
*((uint32*)data) = propInfo->extra_data;
|
||||
return property_index;
|
||||
*((uint32*)data) = propertyInfo->extra_data;
|
||||
|
||||
return propertyIndex;
|
||||
}
|
||||
property_index++;
|
||||
propertyIndex++;
|
||||
}
|
||||
|
||||
return B_ERROR;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BPropertyInfo::IsFixedSize() const
|
||||
|
||||
|
||||
bool
|
||||
BPropertyInfo::IsFixedSize() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
type_code BPropertyInfo::TypeCode() const
|
||||
|
||||
|
||||
type_code
|
||||
BPropertyInfo::TypeCode() const
|
||||
{
|
||||
return B_PROPERTY_INFO_TYPE;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
ssize_t BPropertyInfo::FlattenedSize() const
|
||||
|
||||
|
||||
ssize_t
|
||||
BPropertyInfo::FlattenedSize() const
|
||||
{
|
||||
size_t size = (2 * sizeof(int32)) + 1;
|
||||
|
||||
if (fPropInfo)
|
||||
{
|
||||
if (fPropInfo) {
|
||||
// Main chunks
|
||||
for (int32 pi = 0; fPropInfo[pi].name != NULL; pi++)
|
||||
{
|
||||
for (int32 pi = 0; fPropInfo[pi].name != NULL; pi++) {
|
||||
size += strlen(fPropInfo[pi].name) + 1;
|
||||
|
||||
if (fPropInfo[pi].usage)
|
||||
@ -130,16 +108,13 @@ ssize_t BPropertyInfo::FlattenedSize() const
|
||||
}
|
||||
|
||||
// Type chunks
|
||||
for (int32 pi = 0; fPropInfo[pi].name != NULL; pi++)
|
||||
{
|
||||
for (int32 pi = 0; fPropInfo[pi].name != NULL; pi++) {
|
||||
for (int32 i = 0; i < 10 && fPropInfo[pi].types[i] != 0; i++)
|
||||
size += sizeof(int32);
|
||||
size += sizeof(int32);
|
||||
|
||||
for (int32 i = 0; i < 3 && fPropInfo[pi].ctypes[i].pairs[0].name != 0; i++)
|
||||
{
|
||||
for (int32 j = 0; j < 5 && fPropInfo[pi].ctypes[i].pairs[j].name != 0; j++)
|
||||
{
|
||||
for (int32 i = 0; i < 3 && fPropInfo[pi].ctypes[i].pairs[0].name != 0; i++) {
|
||||
for (int32 j = 0; j < 5 && fPropInfo[pi].ctypes[i].pairs[j].name != 0; j++) {
|
||||
size += strlen(fPropInfo[pi].ctypes[i].pairs[j].name) + 1;
|
||||
size += sizeof(int32);
|
||||
}
|
||||
@ -149,13 +124,11 @@ ssize_t BPropertyInfo::FlattenedSize() const
|
||||
}
|
||||
}
|
||||
|
||||
if (fValueInfo)
|
||||
{
|
||||
if (fValueInfo) {
|
||||
size += sizeof(int16);
|
||||
|
||||
// Chunks
|
||||
for (int32 vi = 0; fValueInfo[vi].name != NULL; vi++)
|
||||
{
|
||||
for (int32 vi = 0; fValueInfo[vi].name != NULL; vi++) {
|
||||
size += sizeof(int32);
|
||||
size += sizeof(int32);
|
||||
|
||||
@ -172,8 +145,10 @@ ssize_t BPropertyInfo::FlattenedSize() const
|
||||
|
||||
return size;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BPropertyInfo::Flatten(void *buffer, ssize_t numBytes) const
|
||||
|
||||
|
||||
status_t
|
||||
BPropertyInfo::Flatten(void* buffer, ssize_t numBytes) const
|
||||
{
|
||||
if (numBytes < FlattenedSize())
|
||||
return B_NO_MEMORY;
|
||||
@ -182,26 +157,26 @@ status_t BPropertyInfo::Flatten(void *buffer, ssize_t numBytes) const
|
||||
return B_BAD_VALUE;
|
||||
|
||||
BMemoryIO flatData(buffer, numBytes);
|
||||
|
||||
|
||||
char tmpChar = B_HOST_IS_BENDIAN;
|
||||
int32 tmpInt;
|
||||
|
||||
|
||||
flatData.Write(&tmpChar, sizeof(tmpChar));
|
||||
flatData.Write(&fPropCount, sizeof(fPropCount));
|
||||
tmpInt = 0x01 | (fValueInfo ? 0x2 : 0x0);
|
||||
flatData.Write(&tmpInt, sizeof(tmpInt));
|
||||
|
||||
if (fPropInfo) { // Main chunks
|
||||
|
||||
if (fPropInfo) {
|
||||
// Main chunks
|
||||
for (int32 pi = 0; fPropInfo[pi].name != NULL; pi++) {
|
||||
flatData.Write(fPropInfo[pi].name, strlen(fPropInfo[pi].name) + 1);
|
||||
if (fPropInfo[pi].usage != NULL) {
|
||||
flatData.Write(fPropInfo[pi].usage, strlen(fPropInfo[pi].usage) + 1);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
tmpChar = 0;
|
||||
flatData.Write(&tmpChar, sizeof(tmpChar));
|
||||
}
|
||||
|
||||
|
||||
flatData.Write(&fPropInfo[pi].extra_data, sizeof(fPropInfo[pi].extra_data));
|
||||
|
||||
for (int32 i = 0; i < 10 && fPropInfo[pi].commands[i] != 0; i++) {
|
||||
@ -209,14 +184,14 @@ status_t BPropertyInfo::Flatten(void *buffer, ssize_t numBytes) const
|
||||
}
|
||||
tmpInt = 0;
|
||||
flatData.Write(&tmpInt, sizeof(tmpInt));
|
||||
|
||||
|
||||
for (int32 i = 0; i < 10 && fPropInfo[pi].specifiers[i] != 0; i++) {
|
||||
flatData.Write(&fPropInfo[pi].specifiers[i], sizeof(fPropInfo[pi].specifiers[i]));
|
||||
}
|
||||
tmpInt = 0;
|
||||
flatData.Write(&tmpInt, sizeof(tmpInt));
|
||||
}
|
||||
|
||||
|
||||
// Type chunks
|
||||
for (int32 pi = 0; fPropInfo[pi].name != NULL; pi++) {
|
||||
for (int32 i = 0; i < 10 && fPropInfo[pi].types[i] != 0; i++) {
|
||||
@ -228,9 +203,9 @@ status_t BPropertyInfo::Flatten(void *buffer, ssize_t numBytes) const
|
||||
for (int32 i = 0; i < 3 && fPropInfo[pi].ctypes[i].pairs[0].name != 0; i++) {
|
||||
for (int32 j = 0; j < 5 && fPropInfo[pi].ctypes[i].pairs[j].name != 0; j++) {
|
||||
flatData.Write(fPropInfo[pi].ctypes[i].pairs[j].name,
|
||||
strlen(fPropInfo[pi].ctypes[i].pairs[j].name) + 1);
|
||||
strlen(fPropInfo[pi].ctypes[i].pairs[j].name) + 1);
|
||||
flatData.Write(&fPropInfo[pi].ctypes[i].pairs[j].type,
|
||||
sizeof(fPropInfo[pi].ctypes[i].pairs[j].type));
|
||||
sizeof(fPropInfo[pi].ctypes[i].pairs[j].type));
|
||||
}
|
||||
tmpInt = 0;
|
||||
flatData.Write(&tmpInt, sizeof(tmpInt));
|
||||
@ -239,7 +214,7 @@ status_t BPropertyInfo::Flatten(void *buffer, ssize_t numBytes) const
|
||||
flatData.Write(&tmpInt, sizeof(tmpInt));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fValueInfo) {
|
||||
// Value Chunks
|
||||
flatData.Write(&fValueCount, sizeof(fValueCount));
|
||||
@ -249,25 +224,28 @@ status_t BPropertyInfo::Flatten(void *buffer, ssize_t numBytes) const
|
||||
flatData.Write(fValueInfo[vi].name, strlen(fValueInfo[vi].name) + 1);
|
||||
if (fValueInfo[vi].usage) {
|
||||
flatData.Write(fValueInfo[vi].usage, strlen(fValueInfo[vi].usage) + 1);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
tmpChar = 0;
|
||||
flatData.Write(&tmpChar, sizeof(tmpChar));
|
||||
}
|
||||
flatData.Write(&fValueInfo[vi].extra_data, sizeof(fValueInfo[vi].extra_data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BPropertyInfo::AllowsTypeCode(type_code code) const
|
||||
|
||||
|
||||
bool
|
||||
BPropertyInfo::AllowsTypeCode(type_code code) const
|
||||
{
|
||||
return (code == B_PROPERTY_INFO_TYPE);
|
||||
return code == B_PROPERTY_INFO_TYPE;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
ssize_t numBytes)
|
||||
|
||||
|
||||
status_t
|
||||
BPropertyInfo::Unflatten(type_code code, const void* buffer,
|
||||
ssize_t numBytes)
|
||||
{
|
||||
if (!AllowsTypeCode(code))
|
||||
return B_BAD_TYPE;
|
||||
@ -276,23 +254,23 @@ status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
return B_BAD_VALUE;
|
||||
|
||||
FreeMem();
|
||||
|
||||
|
||||
BMemoryIO flatData(buffer, numBytes);
|
||||
char tmpChar = B_HOST_IS_BENDIAN;
|
||||
int32 tmpInt;
|
||||
|
||||
flatData.Read(&tmpChar, sizeof(tmpChar));
|
||||
bool swapRequired = (tmpChar != B_HOST_IS_BENDIAN);
|
||||
|
||||
|
||||
flatData.Read(&fPropCount, sizeof(fPropCount));
|
||||
|
||||
|
||||
int32 flags;
|
||||
flatData.Read(&flags, sizeof(flags));
|
||||
if (swapRequired) {
|
||||
fPropCount = B_SWAP_INT32(fPropCount);
|
||||
flags = B_SWAP_INT32(flags);
|
||||
}
|
||||
|
||||
|
||||
if (flags & 1) {
|
||||
fPropInfo = static_cast<property_info *>(malloc(sizeof(property_info) * (fPropCount + 1)));
|
||||
memset(fPropInfo, 0, (fPropCount + 1) * sizeof(property_info));
|
||||
@ -301,7 +279,7 @@ status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
for (int32 pi = 0; pi < fPropCount; pi++) {
|
||||
fPropInfo[pi].name = strdup(static_cast<const char*>(buffer) + flatData.Position());
|
||||
flatData.Seek(strlen(fPropInfo[pi].name) + 1, SEEK_CUR);
|
||||
|
||||
|
||||
fPropInfo[pi].usage = strdup(static_cast<const char *>(buffer) + flatData.Position());
|
||||
flatData.Seek(strlen(fPropInfo[pi].usage) + 1, SEEK_CUR);
|
||||
|
||||
@ -309,7 +287,7 @@ status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
if (swapRequired) {
|
||||
fPropInfo[pi].extra_data = B_SWAP_INT32(fPropInfo[pi].extra_data);
|
||||
}
|
||||
|
||||
|
||||
flatData.Read(&tmpInt, sizeof(tmpInt));
|
||||
for (int32 i = 0; tmpInt != 0; i++) {
|
||||
if (swapRequired) {
|
||||
@ -318,7 +296,7 @@ status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
fPropInfo[pi].commands[i] = tmpInt;
|
||||
flatData.Read(&tmpInt, sizeof(tmpInt));
|
||||
}
|
||||
|
||||
|
||||
flatData.Read(&tmpInt, sizeof(tmpInt));
|
||||
for (int32 i = 0; tmpInt != 0; i++) {
|
||||
if (swapRequired) {
|
||||
@ -345,14 +323,14 @@ status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
for (int32 j = 0; tmpInt != 0; j++) {
|
||||
flatData.Seek(-sizeof(tmpInt), SEEK_CUR);
|
||||
fPropInfo[pi].ctypes[i].pairs[j].name =
|
||||
strdup(static_cast<const char *>(buffer) + flatData.Position());
|
||||
strdup(static_cast<const char *>(buffer) + flatData.Position());
|
||||
flatData.Seek(strlen(fPropInfo[pi].ctypes[i].pairs[j].name) + 1, SEEK_CUR);
|
||||
|
||||
|
||||
flatData.Read(&fPropInfo[pi].ctypes[i].pairs[j].type,
|
||||
sizeof(fPropInfo[pi].ctypes[i].pairs[j].type));
|
||||
sizeof(fPropInfo[pi].ctypes[i].pairs[j].type));
|
||||
if (swapRequired) {
|
||||
fPropInfo[pi].ctypes[i].pairs[j].type =
|
||||
B_SWAP_INT32(fPropInfo[pi].ctypes[i].pairs[j].type);
|
||||
B_SWAP_INT32(fPropInfo[pi].ctypes[i].pairs[j].type);
|
||||
}
|
||||
flatData.Read(&tmpInt, sizeof(tmpInt));
|
||||
}
|
||||
@ -370,17 +348,16 @@ status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
fValueInfo = static_cast<value_info *>(malloc(sizeof(value_info) * (fValueCount + 1)));
|
||||
memset(fValueInfo, 0, (fValueCount + 1) * sizeof(value_info));
|
||||
|
||||
for (int32 vi = 0; vi < fValueCount; vi++)
|
||||
{
|
||||
for (int32 vi = 0; vi < fValueCount; vi++) {
|
||||
flatData.Read(&fValueInfo[vi].kind, sizeof(fValueInfo[vi].kind));
|
||||
flatData.Read(&fValueInfo[vi].value, sizeof(fValueInfo[vi].value));
|
||||
|
||||
fValueInfo[vi].name = strdup(static_cast<const char *>(buffer) + flatData.Position());
|
||||
flatData.Seek(strlen(fValueInfo[vi].name) + 1, SEEK_CUR);
|
||||
|
||||
|
||||
fValueInfo[vi].usage = strdup(static_cast<const char *>(buffer) + flatData.Position());
|
||||
flatData.Seek(strlen(fValueInfo[vi].usage) + 1, SEEK_CUR);
|
||||
|
||||
|
||||
flatData.Read(&fValueInfo[vi].extra_data, sizeof(fValueInfo[vi].extra_data));
|
||||
if (swapRequired) {
|
||||
fValueInfo[vi].kind = static_cast<value_kind>(B_SWAP_INT32(fValueInfo[vi].kind));
|
||||
@ -392,28 +369,38 @@ status_t BPropertyInfo::Unflatten(type_code code, const void *buffer,
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
const property_info *BPropertyInfo::Properties() const
|
||||
|
||||
|
||||
const property_info*
|
||||
BPropertyInfo::Properties() const
|
||||
{
|
||||
return fPropInfo;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
const value_info *BPropertyInfo::Values() const
|
||||
|
||||
|
||||
const value_info*
|
||||
BPropertyInfo::Values() const
|
||||
{
|
||||
return fValueInfo;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
int32 BPropertyInfo::CountProperties() const
|
||||
|
||||
|
||||
int32
|
||||
BPropertyInfo::CountProperties() const
|
||||
{
|
||||
return fPropCount;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
int32 BPropertyInfo::CountValues() const
|
||||
|
||||
|
||||
int32
|
||||
BPropertyInfo::CountValues() const
|
||||
{
|
||||
return fValueCount;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BPropertyInfo::PrintToStream() const
|
||||
|
||||
|
||||
void
|
||||
BPropertyInfo::PrintToStream() const
|
||||
{
|
||||
printf(" property commands types specifiers\n");
|
||||
printf("--------------------------------------------------------------------------------\n");
|
||||
@ -444,110 +431,106 @@ void BPropertyInfo::PrintToStream() const
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BPropertyInfo::FindCommand(uint32 what, int32 index, property_info *p)
|
||||
|
||||
|
||||
bool
|
||||
BPropertyInfo::FindCommand(uint32 what, int32 index, property_info *propertyInfo)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (p->commands[0] == 0) {
|
||||
|
||||
if (propertyInfo->commands[0] == 0) {
|
||||
result = true;
|
||||
} else if (index == 0) {
|
||||
for (int32 i = 0; i < 10 && p->commands[i] != 0; i++) {
|
||||
if (p->commands[i] == what) {
|
||||
for (int32 i = 0; i < 10 && propertyInfo->commands[i] != 0; i++) {
|
||||
if (propertyInfo->commands[i] == what) {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool BPropertyInfo::FindSpecifier(uint32 form, property_info *p)
|
||||
|
||||
|
||||
bool
|
||||
BPropertyInfo::FindSpecifier(uint32 form, property_info *propertyInfo)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (p->specifiers[0] == 0) {
|
||||
|
||||
if (propertyInfo->specifiers[0] == 0) {
|
||||
result = true;
|
||||
} else {
|
||||
for (int32 i = 0; i < 10 && p->specifiers[i] != 0; i++) {
|
||||
if (p->specifiers[i] == form) {
|
||||
for (int32 i = 0; i < 10 && propertyInfo->specifiers[i] != 0; i++) {
|
||||
if (propertyInfo->specifiers[i] == form) {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void BPropertyInfo::_ReservedPropertyInfo1() {}
|
||||
void BPropertyInfo::_ReservedPropertyInfo2() {}
|
||||
void BPropertyInfo::_ReservedPropertyInfo3() {}
|
||||
void BPropertyInfo::_ReservedPropertyInfo4() {}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
BPropertyInfo::BPropertyInfo(const BPropertyInfo &)
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
BPropertyInfo &BPropertyInfo::operator=(const BPropertyInfo &)
|
||||
|
||||
|
||||
BPropertyInfo&
|
||||
BPropertyInfo::operator=(const BPropertyInfo &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BPropertyInfo::FreeMem()
|
||||
|
||||
|
||||
void
|
||||
BPropertyInfo::FreeMem()
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
if (!fInHeap) {
|
||||
|
||||
if (!fInHeap)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (fPropInfo != NULL) {
|
||||
for(i = 0; i < fPropCount; i++) {
|
||||
if (fPropInfo[i].name != NULL) {
|
||||
free(fPropInfo[i].name);
|
||||
}
|
||||
if (fPropInfo[i].usage != NULL) {
|
||||
free(fPropInfo[i].usage);
|
||||
}
|
||||
for(j = 0; j < 3; j++) {
|
||||
for(k = 0; k < 5; k++) {
|
||||
if (fPropInfo[i].ctypes[j].pairs[k].name == NULL) {
|
||||
for (i = 0; i < fPropCount; i++) {
|
||||
free(fPropInfo[i].name);
|
||||
free(fPropInfo[i].usage);
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
for (k = 0; k < 5; k++) {
|
||||
if (fPropInfo[i].ctypes[j].pairs[k].name == NULL)
|
||||
break;
|
||||
} else {
|
||||
free(fPropInfo[i].ctypes[j].pairs[k].name);
|
||||
}
|
||||
|
||||
free(fPropInfo[i].ctypes[j].pairs[k].name);
|
||||
}
|
||||
if (fPropInfo[i].ctypes[j].pairs[0].name == NULL) {
|
||||
|
||||
if (fPropInfo[i].ctypes[j].pairs[0].name == NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(fPropInfo);
|
||||
fPropInfo = NULL;
|
||||
fPropCount = 0;
|
||||
}
|
||||
|
||||
|
||||
if (fValueInfo != NULL) {
|
||||
for(i = 0; i < fValueCount; i++) {
|
||||
if (fValueInfo[i].name != NULL) {
|
||||
free(fValueInfo[i].name);
|
||||
}
|
||||
if (fValueInfo[i].usage != NULL) {
|
||||
free(fValueInfo[i].usage);
|
||||
}
|
||||
for (i = 0; i < fValueCount; i++) {
|
||||
free(fValueInfo[i].name);
|
||||
free(fValueInfo[i].usage);
|
||||
}
|
||||
free(fValueInfo);
|
||||
fValueInfo = NULL;
|
||||
fValueCount = 0;
|
||||
}
|
||||
|
||||
|
||||
fInHeap = false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
@ -1,32 +1,18 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: RegistrarDefs.cpp
|
||||
// Author(s): Ingo Weinhold (bonefish@users.sf.net)
|
||||
// Description: API classes - registrar interface.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold (bonefish@users.sf.net)
|
||||
*/
|
||||
|
||||
//! API classes - registrar interface.
|
||||
|
||||
|
||||
#include <AppMisc.h>
|
||||
#include <RegistrarDefs.h>
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
// names
|
||||
|
@ -1,34 +1,18 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: RegistrarThread.cpp
|
||||
// Author(s): Ingo Weinhold (bonefish@users.sf.net)
|
||||
//
|
||||
// Description: Base thread class for threads spawned and managed by the registrar
|
||||
//
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold (bonefish@users.sf.net)
|
||||
*/
|
||||
|
||||
//! Base thread class for threads spawned and managed by the registrar
|
||||
|
||||
|
||||
#include "RegistrarThread.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/*! \class RegistrarThread
|
||||
\brief Base thread class for threads spawned and managed by the registrar
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file RegistrarThreadManager.cpp
|
||||
RegistrarThreadManager implementation
|
||||
*/
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Tyler Dauwalder
|
||||
*/
|
||||
|
||||
|
||||
#include "RegistrarThreadManager.h"
|
||||
|
||||
|
@ -1,28 +1,13 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: RosterPrivate.cpp
|
||||
// Author(s): Ingo Weinhold (bonefish@users.sf.net)
|
||||
// Description: Access class for BRoster members
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold (bonefish@users.sf.net)
|
||||
*/
|
||||
|
||||
//! Access class for BRoster members
|
||||
|
||||
|
||||
#include <RosterPrivate.h>
|
||||
#include <Roster.h>
|
||||
|
@ -85,10 +85,9 @@ BTokenSpace::RemoveToken(int32 token, remove_token_callback callback)
|
||||
}
|
||||
|
||||
|
||||
/** Checks wether or not the \a token exists with the specified
|
||||
* \a type in the token space or not.
|
||||
*/
|
||||
|
||||
/*! Checks wether or not the \a token exists with the specified
|
||||
\a type in the token space or not.
|
||||
*/
|
||||
bool
|
||||
BTokenSpace::CheckToken(int32 token, int16 type) const
|
||||
{
|
||||
|
@ -1,29 +1,12 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2005, Haiku
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// File Name: TypeConstants.cpp
|
||||
// Description: These type constants are exported by libbe under R5.
|
||||
// We need them for binary compatibility.
|
||||
// See <TypeConstants.h>.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2005, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Michael Lotz <mmlr@mlotz.ch>
|
||||
*/
|
||||
|
||||
//! These type constants are exported by libbe under R5.
|
||||
|
||||
const char *B_URL_HTTP = "application/x-vnd.Be.URL.http";
|
||||
const char *B_URL_HTTPS = "application/x-vnd.Be.URL.https";
|
||||
|
Loading…
Reference in New Issue
Block a user