It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// 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: Archivable.h
|
||||
// Author: Erik Jaesler ([email protected])
|
||||
// Description: BArchivable mix-in class defines the archiving
|
||||
// protocol. Also some global archiving functions.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef _ARCHIVABLE_H
|
||||
#define _ARCHIVABLE_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <BeBuild.h>
|
||||
#include <image.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
class BMessage;
|
||||
|
||||
// BArchivable class -----------------------------------------------------------
|
||||
class BArchivable {
|
||||
public:
|
||||
BArchivable();
|
||||
virtual ~BArchivable();
|
||||
|
||||
BArchivable(BMessage* from);
|
||||
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
||||
static BArchivable *Instantiate(BMessage* from);
|
||||
|
||||
// Private or reserved ---------------------------------------------------------
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
|
||||
private:
|
||||
|
||||
virtual void _ReservedArchivable1();
|
||||
virtual void _ReservedArchivable2();
|
||||
virtual void _ReservedArchivable3();
|
||||
|
||||
uint32 _reserved[2];
|
||||
};
|
||||
|
||||
|
||||
// Global Functions ------------------------------------------------------------
|
||||
|
||||
typedef BArchivable* (*instantiation_func) (BMessage *);
|
||||
|
||||
_IMPEXP_BE BArchivable* instantiate_object(BMessage *from, image_id *id);
|
||||
_IMPEXP_BE BArchivable* instantiate_object(BMessage *from);
|
||||
_IMPEXP_BE bool validate_instantiation(BMessage* from,
|
||||
const char* class_name);
|
||||
|
||||
_IMPEXP_BE instantiation_func find_instantiation_func(const char* class_name,
|
||||
const char* sig);
|
||||
_IMPEXP_BE instantiation_func find_instantiation_func(const char* class_name);
|
||||
_IMPEXP_BE instantiation_func find_instantiation_func(BMessage* archive_data);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#endif // _ARCHIVABLE_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// $Id: Autolock.h,v 1.1 2002/07/09 12:24:33 ejakowatz Exp $
|
||||
//
|
||||
// This is the BAutolock interface for OpenBeOS. It has been created to
|
||||
// be source and binary compatible with the BeOS version of BAutolock.
|
||||
// To that end, all members are inline just as with the BeOS version.
|
||||
//
|
||||
|
||||
|
||||
#ifndef _OPENBEOS_AUTOLOCK_H
|
||||
#define _OPENBEOS_AUTOLOCK_H
|
||||
|
||||
|
||||
#include "Locker.h"
|
||||
#include <Looper.h>
|
||||
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
class BAutolock {
|
||||
public:
|
||||
inline BAutolock(BLooper *looper);
|
||||
inline BAutolock(BLocker *locker);
|
||||
inline BAutolock(BLocker &locker);
|
||||
|
||||
inline ~BAutolock();
|
||||
|
||||
inline bool IsLocked(void);
|
||||
|
||||
private:
|
||||
BLocker *fTheLocker;
|
||||
BLooper *fTheLooper;
|
||||
bool fIsLocked;
|
||||
};
|
||||
|
||||
|
||||
inline BAutolock::BAutolock(BLooper *looper) :
|
||||
fTheLocker(NULL), fTheLooper(looper), fIsLocked(looper->Lock())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
inline BAutolock::BAutolock(BLocker *locker) :
|
||||
fTheLocker(locker), fTheLooper(NULL), fIsLocked(locker->Lock())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
inline BAutolock::BAutolock(BLocker &locker) :
|
||||
fTheLocker(&locker), fTheLooper(NULL), fIsLocked(locker.Lock())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
inline BAutolock::~BAutolock()
|
||||
{
|
||||
if (fIsLocked) {
|
||||
if (fTheLooper != NULL) {
|
||||
fTheLooper->Unlock();
|
||||
} else {
|
||||
fTheLocker->Unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline bool BAutolock::IsLocked()
|
||||
{
|
||||
return fIsLocked;
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _OPENBEOS_LOCKER_H
|
||||
@@ -0,0 +1,142 @@
|
||||
// Modified BeOS header. Just here to be able to compile and test BResources.
|
||||
// To be replaced by the OpenBeOS version to be provided by the IK Team.
|
||||
|
||||
#ifndef _sk_byte_order_h_
|
||||
#define _sk_byte_order_h_
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <endian.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <TypeConstants.h> /* For convenience */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*------- Swap-direction constants, and swapping functions -------------*/
|
||||
|
||||
typedef enum {
|
||||
B_SWAP_HOST_TO_LENDIAN,
|
||||
B_SWAP_HOST_TO_BENDIAN,
|
||||
B_SWAP_LENDIAN_TO_HOST,
|
||||
B_SWAP_BENDIAN_TO_HOST,
|
||||
B_SWAP_ALWAYS
|
||||
} swap_action;
|
||||
|
||||
extern status_t swap_data(type_code type, void *data, size_t length,
|
||||
swap_action action);
|
||||
|
||||
extern bool is_type_swapped(type_code type);
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/*----- Private implementations -----------------------------------------*/
|
||||
extern double __swap_double(double arg);
|
||||
extern float __swap_float(float arg);
|
||||
extern uint64 __swap_int64(uint64 uarg);
|
||||
extern uint32 __swap_int32(uint32 uarg);
|
||||
extern uint16 __swap_int16(uint16 uarg);
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*--------- Host is Little --------------------------------------*/
|
||||
|
||||
#if BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define B_HOST_IS_LENDIAN 1
|
||||
#define B_HOST_IS_BENDIAN 0
|
||||
|
||||
/*--------- Host Native -> Little --------------------*/
|
||||
|
||||
#define B_HOST_TO_LENDIAN_DOUBLE(arg) (double)(arg)
|
||||
#define B_HOST_TO_LENDIAN_FLOAT(arg) (float)(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT64(arg) (uint64)(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT32(arg) (uint32)(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT16(arg) (uint16)(arg)
|
||||
|
||||
/*--------- Host Native -> Big ------------------------*/
|
||||
#define B_HOST_TO_BENDIAN_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_HOST_TO_BENDIAN_FLOAT(arg) __swap_float(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT64(arg) __swap_int64(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT32(arg) __swap_int32(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT16(arg) __swap_int16(arg)
|
||||
|
||||
/*--------- Little -> Host Native ---------------------*/
|
||||
#define B_LENDIAN_TO_HOST_DOUBLE(arg) (double)(arg)
|
||||
#define B_LENDIAN_TO_HOST_FLOAT(arg) (float)(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT64(arg) (uint64)(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT32(arg) (uint32)(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT16(arg) (uint16)(arg)
|
||||
|
||||
/*--------- Big -> Host Native ------------------------*/
|
||||
#define B_BENDIAN_TO_HOST_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_BENDIAN_TO_HOST_FLOAT(arg) __swap_float(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT64(arg) __swap_int64(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT32(arg) __swap_int32(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT16(arg) __swap_int16(arg)
|
||||
|
||||
#else /* __LITTLE_ENDIAN */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*--------- Host is Big --------------------------------------*/
|
||||
|
||||
#define B_HOST_IS_LENDIAN 0
|
||||
#define B_HOST_IS_BENDIAN 1
|
||||
|
||||
/*--------- Host Native -> Little -------------------*/
|
||||
#define B_HOST_TO_LENDIAN_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_HOST_TO_LENDIAN_FLOAT(arg) __swap_float(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT64(arg) __swap_int64(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT32(arg) __swap_int32(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT16(arg) __swap_int16(arg)
|
||||
|
||||
/*--------- Host Native -> Big ------------------------*/
|
||||
#define B_HOST_TO_BENDIAN_DOUBLE(arg) (double)(arg)
|
||||
#define B_HOST_TO_BENDIAN_FLOAT(arg) (float)(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT64(arg) (uint64)(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT32(arg) (uint32)(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT16(arg) (uint16)(arg)
|
||||
|
||||
/*--------- Little -> Host Native ----------------------*/
|
||||
#define B_LENDIAN_TO_HOST_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_LENDIAN_TO_HOST_FLOAT(arg) __swap_float(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT64(arg) __swap_int64(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT32(arg) __swap_int32(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT16(arg) __swap_int16(arg)
|
||||
|
||||
/*--------- Big -> Host Native -------------------------*/
|
||||
#define B_BENDIAN_TO_HOST_DOUBLE(arg) (double)(arg)
|
||||
#define B_BENDIAN_TO_HOST_FLOAT(arg) (float)(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT64(arg) (uint64)(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT32(arg) (uint32)(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT16(arg) (uint16)(arg)
|
||||
|
||||
#endif /* __LITTLE_ENDIAN */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*--------- Just-do-it macros ---------------------------------*/
|
||||
#define B_SWAP_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_SWAP_FLOAT(arg) __swap_float(arg)
|
||||
#define B_SWAP_INT64(arg) __swap_int64(arg)
|
||||
#define B_SWAP_INT32(arg) __swap_int32(arg)
|
||||
#define B_SWAP_INT16(arg) __swap_int16(arg)
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*---------Berkeley macros -----------------------------------*/
|
||||
#define htonl(x) B_HOST_TO_BENDIAN_INT32(x)
|
||||
#define ntohl(x) B_BENDIAN_TO_HOST_INT32(x)
|
||||
#define htons(x) B_HOST_TO_BENDIAN_INT16(x)
|
||||
#define ntohs(x) B_BENDIAN_TO_HOST_INT16(x)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#endif // _sk_byte_order_h_
|
||||
@@ -0,0 +1,38 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: ClassInfo.h
|
||||
/
|
||||
/ Description: C++ class identification and casting macros
|
||||
/
|
||||
/ Copyright 1993-98, Be Incorporated
|
||||
/
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _CLASS_INFO_H
|
||||
#define _CLASS_INFO_H
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
// deprecated, use standard RTTI calls instead
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*--------- Class Info Macros ---------------------------------*/
|
||||
|
||||
#define class_name(ptr) ((typeid(*(ptr))).name())
|
||||
#define cast_as(ptr, class) (dynamic_cast<class*>(ptr))
|
||||
#define is_kind_of(ptr, class) (cast_as(ptr, class) != 0)
|
||||
#define is_instance_of(ptr, class) (typeid(*(ptr)) == typeid(class))
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
} // namespace OpenBeOS
|
||||
using namespace OpenBeOS;
|
||||
#endif
|
||||
|
||||
#endif /* _CLASS_INFO_H */
|
||||
@@ -0,0 +1,74 @@
|
||||
// Modified BeOS header. Just here to be able to compile and test BFile.
|
||||
// To be replaced by the OpenBeOS version to be provided by the IK Team.
|
||||
|
||||
#ifndef __sk_data_io_h__
|
||||
#define __sk_data_io_h__
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------*/
|
||||
/*------- BDataIO Class -------------------------------------------*/
|
||||
|
||||
class BDataIO {
|
||||
public:
|
||||
BDataIO();
|
||||
virtual ~BDataIO();
|
||||
|
||||
virtual ssize_t Read(void *buffer, size_t size) = 0;
|
||||
virtual ssize_t Write(const void *buffer, size_t size) =0;
|
||||
|
||||
/*----- Private or reserved ---------------*/
|
||||
private:
|
||||
|
||||
virtual void _ReservedDataIO1();
|
||||
virtual void _ReservedDataIO2();
|
||||
virtual void _ReservedDataIO3();
|
||||
virtual void _ReservedDataIO4();
|
||||
|
||||
BDataIO(const BDataIO &);
|
||||
BDataIO &operator=(const BDataIO &);
|
||||
|
||||
int32 _reserved[2];
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/*------- BPositionIO Class -------------------------------------------*/
|
||||
|
||||
class BPositionIO : public BDataIO {
|
||||
public:
|
||||
BPositionIO();
|
||||
virtual ~BPositionIO();
|
||||
|
||||
virtual ssize_t Read(void *buffer, size_t size);
|
||||
virtual ssize_t Write(const void *buffer, size_t size);
|
||||
|
||||
virtual ssize_t ReadAt(off_t pos, void *buffer, size_t size) = 0;
|
||||
virtual ssize_t WriteAt(off_t pos, const void *buffer, size_t size) = 0;
|
||||
|
||||
virtual off_t Seek(off_t position, uint32 seek_mode) = 0;
|
||||
virtual off_t Position() const = 0;
|
||||
|
||||
virtual status_t SetSize(off_t size);
|
||||
|
||||
/*----- Private or reserved ---------------*/
|
||||
private:
|
||||
virtual void _ReservedPositionIO1();
|
||||
virtual void _ReservedPositionIO2();
|
||||
virtual void _ReservedPositionIO3();
|
||||
virtual void _ReservedPositionIO4();
|
||||
|
||||
int32 _reserved[2];
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __sk_data_io_h__
|
||||
@@ -0,0 +1,258 @@
|
||||
#ifndef _ERRORS_H
|
||||
#define _ERRORS_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Error baselines ---------------------------------------*/
|
||||
|
||||
#define B_GENERAL_ERROR_BASE LONG_MIN
|
||||
#define B_OS_ERROR_BASE B_GENERAL_ERROR_BASE + 0x1000
|
||||
#define B_APP_ERROR_BASE B_GENERAL_ERROR_BASE + 0x2000
|
||||
#define B_INTERFACE_ERROR_BASE B_GENERAL_ERROR_BASE + 0x3000
|
||||
#define B_MEDIA_ERROR_BASE B_GENERAL_ERROR_BASE + 0x4000
|
||||
#define B_TRANSLATION_ERROR_BASE B_GENERAL_ERROR_BASE + 0x4800
|
||||
#define B_MIDI_ERROR_BASE B_GENERAL_ERROR_BASE + 0x5000
|
||||
#define B_STORAGE_ERROR_BASE B_GENERAL_ERROR_BASE + 0x6000
|
||||
#define B_POSIX_ERROR_BASE B_GENERAL_ERROR_BASE + 0x7000
|
||||
#define B_MAIL_ERROR_BASE B_GENERAL_ERROR_BASE + 0x8000
|
||||
#define B_PRINT_ERROR_BASE B_GENERAL_ERROR_BASE + 0x9000
|
||||
#define B_DEVICE_ERROR_BASE B_GENERAL_ERROR_BASE + 0xa000
|
||||
|
||||
/*--- Developer-defined errors start at (B_ERRORS_END+1)----*/
|
||||
|
||||
#define B_ERRORS_END (B_GENERAL_ERROR_BASE + 0xffff)
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- General Errors ----------------------------------------*/
|
||||
enum {
|
||||
B_NO_MEMORY = B_GENERAL_ERROR_BASE,
|
||||
B_IO_ERROR,
|
||||
B_PERMISSION_DENIED,
|
||||
B_BAD_INDEX,
|
||||
B_BAD_TYPE,
|
||||
B_BAD_VALUE,
|
||||
B_MISMATCHED_VALUES,
|
||||
B_NAME_NOT_FOUND,
|
||||
B_NAME_IN_USE,
|
||||
B_TIMED_OUT,
|
||||
B_INTERRUPTED,
|
||||
B_WOULD_BLOCK,
|
||||
B_CANCELED,
|
||||
B_NO_INIT,
|
||||
B_BUSY,
|
||||
B_NOT_ALLOWED,
|
||||
B_BAD_DATA,
|
||||
|
||||
B_ERROR = -1,
|
||||
B_OK = 0,
|
||||
B_NO_ERROR = 0
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Kernel Kit Errors -------------------------------------*/
|
||||
enum {
|
||||
B_BAD_SEM_ID = B_OS_ERROR_BASE,
|
||||
B_NO_MORE_SEMS,
|
||||
|
||||
B_BAD_THREAD_ID = B_OS_ERROR_BASE + 0x100,
|
||||
B_NO_MORE_THREADS,
|
||||
B_BAD_THREAD_STATE,
|
||||
B_BAD_TEAM_ID,
|
||||
B_NO_MORE_TEAMS,
|
||||
|
||||
B_BAD_PORT_ID = B_OS_ERROR_BASE + 0x200,
|
||||
B_NO_MORE_PORTS,
|
||||
|
||||
B_BAD_IMAGE_ID = B_OS_ERROR_BASE + 0x300,
|
||||
B_BAD_ADDRESS,
|
||||
B_NOT_AN_EXECUTABLE,
|
||||
B_MISSING_LIBRARY,
|
||||
B_MISSING_SYMBOL,
|
||||
|
||||
B_DEBUGGER_ALREADY_INSTALLED = B_OS_ERROR_BASE + 0x400
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Application Kit Errors --------------------------------*/
|
||||
enum
|
||||
{
|
||||
B_BAD_REPLY = B_APP_ERROR_BASE,
|
||||
B_DUPLICATE_REPLY,
|
||||
B_MESSAGE_TO_SELF,
|
||||
B_BAD_HANDLER,
|
||||
B_ALREADY_RUNNING,
|
||||
B_LAUNCH_FAILED,
|
||||
B_AMBIGUOUS_APP_LAUNCH,
|
||||
B_UNKNOWN_MIME_TYPE,
|
||||
B_BAD_SCRIPT_SYNTAX,
|
||||
B_LAUNCH_FAILED_NO_RESOLVE_LINK,
|
||||
B_LAUNCH_FAILED_EXECUTABLE,
|
||||
B_LAUNCH_FAILED_APP_NOT_FOUND,
|
||||
B_LAUNCH_FAILED_APP_IN_TRASH,
|
||||
B_LAUNCH_FAILED_NO_PREFERRED_APP,
|
||||
B_LAUNCH_FAILED_FILES_APP_NOT_FOUND,
|
||||
B_BAD_MIME_SNIFFER_RULE
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Storage Kit/File System Errors ------------------------*/
|
||||
enum {
|
||||
B_FILE_ERROR =B_STORAGE_ERROR_BASE,
|
||||
B_FILE_NOT_FOUND, /* discouraged; use B_ENTRY_NOT_FOUND in new code*/
|
||||
B_FILE_EXISTS,
|
||||
B_ENTRY_NOT_FOUND,
|
||||
B_NAME_TOO_LONG,
|
||||
B_NOT_A_DIRECTORY,
|
||||
B_DIRECTORY_NOT_EMPTY,
|
||||
B_DEVICE_FULL,
|
||||
B_READ_ONLY_DEVICE,
|
||||
B_IS_A_DIRECTORY,
|
||||
B_NO_MORE_FDS,
|
||||
B_CROSS_DEVICE_LINK,
|
||||
B_LINK_LIMIT,
|
||||
B_BUSTED_PIPE,
|
||||
B_UNSUPPORTED,
|
||||
B_PARTITION_TOO_SMALL
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- POSIX Errors ------------------------------------------*/
|
||||
#define E2BIG (B_POSIX_ERROR_BASE + 1)
|
||||
#define ECHILD (B_POSIX_ERROR_BASE + 2)
|
||||
#define EDEADLK (B_POSIX_ERROR_BASE + 3)
|
||||
#define EFBIG (B_POSIX_ERROR_BASE + 4)
|
||||
#define EMLINK (B_POSIX_ERROR_BASE + 5)
|
||||
#define ENFILE (B_POSIX_ERROR_BASE + 6)
|
||||
#define ENODEV (B_POSIX_ERROR_BASE + 7)
|
||||
#define ENOLCK (B_POSIX_ERROR_BASE + 8)
|
||||
#define ENOSYS (B_POSIX_ERROR_BASE + 9)
|
||||
#define ENOTTY (B_POSIX_ERROR_BASE + 10)
|
||||
#define ENXIO (B_POSIX_ERROR_BASE + 11)
|
||||
#define ESPIPE (B_POSIX_ERROR_BASE + 12)
|
||||
#define ESRCH (B_POSIX_ERROR_BASE + 13)
|
||||
#define EFPOS (B_POSIX_ERROR_BASE + 14)
|
||||
#define ESIGPARM (B_POSIX_ERROR_BASE + 15)
|
||||
#define EDOM (B_POSIX_ERROR_BASE + 16)
|
||||
#define ERANGE (B_POSIX_ERROR_BASE + 17)
|
||||
#define EPROTOTYPE (B_POSIX_ERROR_BASE + 18)
|
||||
#define EPROTONOSUPPORT (B_POSIX_ERROR_BASE + 19)
|
||||
#define EPFNOSUPPORT (B_POSIX_ERROR_BASE + 20)
|
||||
#define EAFNOSUPPORT (B_POSIX_ERROR_BASE + 21)
|
||||
#define EADDRINUSE (B_POSIX_ERROR_BASE + 22)
|
||||
#define EADDRNOTAVAIL (B_POSIX_ERROR_BASE + 23)
|
||||
#define ENETDOWN (B_POSIX_ERROR_BASE + 24)
|
||||
#define ENETUNREACH (B_POSIX_ERROR_BASE + 25)
|
||||
#define ENETRESET (B_POSIX_ERROR_BASE + 26)
|
||||
#define ECONNABORTED (B_POSIX_ERROR_BASE + 27)
|
||||
#define ECONNRESET (B_POSIX_ERROR_BASE + 28)
|
||||
#define EISCONN (B_POSIX_ERROR_BASE + 29)
|
||||
#define ENOTCONN (B_POSIX_ERROR_BASE + 30)
|
||||
#define ESHUTDOWN (B_POSIX_ERROR_BASE + 31)
|
||||
#define ECONNREFUSED (B_POSIX_ERROR_BASE + 32)
|
||||
#define EHOSTUNREACH (B_POSIX_ERROR_BASE + 33)
|
||||
#define ENOPROTOOPT (B_POSIX_ERROR_BASE + 34)
|
||||
#define ENOBUFS (B_POSIX_ERROR_BASE + 35)
|
||||
#define EINPROGRESS (B_POSIX_ERROR_BASE + 36)
|
||||
#define EALREADY (B_POSIX_ERROR_BASE + 37)
|
||||
#define EILSEQ (B_POSIX_ERROR_BASE + 38)
|
||||
#define ENOMSG (B_POSIX_ERROR_BASE + 39)
|
||||
#define ESTALE (B_POSIX_ERROR_BASE + 40)
|
||||
#define EOVERFLOW (B_POSIX_ERROR_BASE + 41)
|
||||
#define EMSGSIZE (B_POSIX_ERROR_BASE + 42)
|
||||
#define EOPNOTSUPP (B_POSIX_ERROR_BASE + 43)
|
||||
#define ENOTSOCK (B_POSIX_ERROR_BASE + 44)
|
||||
|
||||
#define ENOMEM B_NO_MEMORY
|
||||
#define EACCES B_PERMISSION_DENIED
|
||||
#define EINTR B_INTERRUPTED
|
||||
#define EIO B_IO_ERROR
|
||||
#define EBUSY B_BUSY
|
||||
#define EFAULT B_BAD_ADDRESS
|
||||
#define ETIMEDOUT B_TIMED_OUT
|
||||
#define EAGAIN B_WOULD_BLOCK /* SysV compatibility */
|
||||
#define EWOULDBLOCK B_WOULD_BLOCK /* BSD compatibility */
|
||||
#define EBADF B_FILE_ERROR
|
||||
#define EEXIST B_FILE_EXISTS
|
||||
#define EINVAL B_BAD_VALUE
|
||||
#define ENAMETOOLONG B_NAME_TOO_LONG
|
||||
#define ENOENT B_ENTRY_NOT_FOUND
|
||||
#define EPERM B_NOT_ALLOWED
|
||||
#define ENOTDIR B_NOT_A_DIRECTORY
|
||||
#define EISDIR B_IS_A_DIRECTORY
|
||||
#define ENOTEMPTY B_DIRECTORY_NOT_EMPTY
|
||||
#define ENOSPC B_DEVICE_FULL
|
||||
#define EROFS B_READ_ONLY_DEVICE
|
||||
#define EMFILE B_NO_MORE_FDS
|
||||
#define EXDEV B_CROSS_DEVICE_LINK
|
||||
#define ELOOP B_LINK_LIMIT
|
||||
#define ENOEXEC B_NOT_AN_EXECUTABLE
|
||||
#define EPIPE B_BUSTED_PIPE
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Media Kit Errors --------------------------------------*/
|
||||
enum {
|
||||
B_STREAM_NOT_FOUND = B_MEDIA_ERROR_BASE,
|
||||
B_SERVER_NOT_FOUND,
|
||||
B_RESOURCE_NOT_FOUND,
|
||||
B_RESOURCE_UNAVAILABLE,
|
||||
B_BAD_SUBSCRIBER,
|
||||
B_SUBSCRIBER_NOT_ENTERED,
|
||||
B_BUFFER_NOT_AVAILABLE,
|
||||
B_LAST_BUFFER_ERROR
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Mail Kit Errors ---------------------------------------*/
|
||||
enum
|
||||
{
|
||||
B_MAIL_NO_DAEMON = B_MAIL_ERROR_BASE,
|
||||
B_MAIL_UNKNOWN_USER,
|
||||
B_MAIL_WRONG_PASSWORD,
|
||||
B_MAIL_UNKNOWN_HOST,
|
||||
B_MAIL_ACCESS_ERROR,
|
||||
B_MAIL_UNKNOWN_FIELD,
|
||||
B_MAIL_NO_RECIPIENT,
|
||||
B_MAIL_INVALID_MAIL
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Printing Errors --------------------------------------*/
|
||||
enum
|
||||
{
|
||||
B_NO_PRINT_SERVER = B_PRINT_ERROR_BASE
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- Device Kit Errors -------------------------------------*/
|
||||
enum
|
||||
{
|
||||
B_DEV_INVALID_IOCTL = B_DEVICE_ERROR_BASE,
|
||||
B_DEV_NO_MEMORY,
|
||||
B_DEV_BAD_DRIVE_NUM,
|
||||
B_DEV_NO_MEDIA,
|
||||
B_DEV_UNREADABLE,
|
||||
B_DEV_FORMAT_ERROR,
|
||||
B_DEV_TIMEOUT,
|
||||
B_DEV_RECALIBRATE_ERROR,
|
||||
B_DEV_SEEK_ERROR,
|
||||
B_DEV_ID_ERROR,
|
||||
B_DEV_READ_ERROR,
|
||||
B_DEV_WRITE_ERROR,
|
||||
B_DEV_NOT_READY,
|
||||
B_DEV_MEDIA_CHANGED,
|
||||
B_DEV_MEDIA_CHANGE_REQUESTED,
|
||||
B_DEV_RESOURCE_CONFLICT,
|
||||
B_DEV_CONFIGURATION_ERROR,
|
||||
B_DEV_DISABLED_BY_USER,
|
||||
B_DEV_DOOR_OPEN
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#endif /* _ERRORS_H */
|
||||
@@ -0,0 +1,36 @@
|
||||
// Modified BeOS header. Just here to be able to compile and test BPath.
|
||||
// To be replaced by the OpenBeOS version to be provided by the IK Team.
|
||||
|
||||
#ifndef __sk_flattenable_h__
|
||||
#define __sk_flattenable_h__
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*----- BFlattenable class ------------------------------------*/
|
||||
|
||||
class BFlattenable {
|
||||
public:
|
||||
|
||||
virtual bool IsFixedSize() const = 0;
|
||||
virtual type_code TypeCode() const = 0;
|
||||
virtual ssize_t FlattenedSize() const = 0;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const = 0;
|
||||
virtual bool AllowsTypeCode(type_code code) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size) = 0;
|
||||
|
||||
virtual ~BFlattenable(); // was a reserved virtual in R4.0
|
||||
|
||||
/*----- Private or reserved ---------------*/
|
||||
|
||||
private:
|
||||
void _ReservedFlattenable1();
|
||||
virtual void _ReservedFlattenable2();
|
||||
virtual void _ReservedFlattenable3();
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#endif // __sk_flattenable_h__
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// List.h
|
||||
// Just here to be able to compile and test BResources.
|
||||
// To be replaced by the OpenBeOS version to be provided by the IK Team.
|
||||
|
||||
#ifndef _sk_list_h_
|
||||
#define _sk_list_h_
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
class BList {
|
||||
public:
|
||||
BList(int32 count = 20);
|
||||
BList(const BList& anotherList);
|
||||
virtual ~BList();
|
||||
|
||||
bool AddItem(void *item, int32 index);
|
||||
bool AddItem(void *item);
|
||||
bool AddList(BList *list, int32 index);
|
||||
bool AddList(BList *list);
|
||||
int32 CountItems() const;
|
||||
void DoForEach(bool (*func)(void *));
|
||||
void DoForEach(bool (*func)(void *, void *), void *arg2);
|
||||
void *FirstItem() const;
|
||||
bool HasItem(void *item) const;
|
||||
int32 IndexOf(void *item) const;
|
||||
bool IsEmpty() const;
|
||||
void *ItemAt(int32 index) const;
|
||||
void *Items() const;
|
||||
void *LastItem() const;
|
||||
void MakeEmpty();
|
||||
bool RemoveItem(void *item);
|
||||
void *RemoveItem(int32 index);
|
||||
bool RemoveItems(int32 index, int32 count);
|
||||
void SortItems(int (*compareFunc)(const void *, const void *));
|
||||
|
||||
BList& operator =(const BList &);
|
||||
|
||||
private:
|
||||
virtual void _ReservedList1();
|
||||
virtual void _ReservedList2();
|
||||
|
||||
// return type differs from BeOS version
|
||||
bool Resize(int32 count);
|
||||
|
||||
private:
|
||||
void** fObjectList;
|
||||
size_t fPhysicalSize;
|
||||
int32 fItemCount;
|
||||
int32 fBlockSize;
|
||||
uint32 _reserved[2];
|
||||
};
|
||||
|
||||
#endif // _sk_list_h_
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// $Id: Locker.h,v 1.1 2002/07/09 12:24:33 ejakowatz Exp $
|
||||
//
|
||||
// This is the BLocker interface for OpenBeOS. It has been created to
|
||||
// be source and binary compatible with the BeOS version of BLocker.
|
||||
//
|
||||
|
||||
|
||||
#ifndef _OPENBEOS_LOCKER_H
|
||||
#define _OPENBEOS_LOCKER_H
|
||||
|
||||
|
||||
#include <OS.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
class BLocker {
|
||||
public:
|
||||
BLocker();
|
||||
BLocker(const char *name);
|
||||
BLocker(bool benaphore_style);
|
||||
BLocker(const char *name, bool benaphore_style);
|
||||
|
||||
// The following constructor is not documented in the BeBook
|
||||
// and is only listed here to ensure binary compatibility.
|
||||
// DO NOT USE THIS CONSTRUCTOR!
|
||||
BLocker(const char *name, bool benaphore_style, bool);
|
||||
|
||||
virtual ~BLocker();
|
||||
|
||||
bool Lock(void);
|
||||
status_t LockWithTimeout(bigtime_t timeout);
|
||||
void Unlock(void);
|
||||
|
||||
thread_id LockingThread(void) const;
|
||||
bool IsLocked(void) const;
|
||||
int32 CountLocks(void) const;
|
||||
int32 CountLockRequests(void) const;
|
||||
sem_id Sem(void) const;
|
||||
|
||||
private:
|
||||
void InitLocker(const char *name, bool benaphore_style);
|
||||
bool AcquireLock(bigtime_t timeout, status_t *error);
|
||||
|
||||
int32 fBenaphoreCount;
|
||||
sem_id fSemaphoreID;
|
||||
thread_id fLockOwner;
|
||||
int32 fRecursiveCount;
|
||||
|
||||
// Reserved space for future changes to BLocker
|
||||
int32 fReservedSpace[4];
|
||||
};
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _OPENBEOS_LOCKER_H
|
||||
@@ -0,0 +1,45 @@
|
||||
// MallocIO.h
|
||||
// Just here to be able to compile and test BResources.
|
||||
// To be replaced by the OpenBeOS version to be provided by the IK Team.
|
||||
|
||||
#ifndef _sk_malloc_io_h
|
||||
#define _sk_malloc_io_h
|
||||
|
||||
#include <DataIO.h>
|
||||
|
||||
class BMallocIO : public BPositionIO {
|
||||
public:
|
||||
BMallocIO();
|
||||
virtual ~BMallocIO();
|
||||
|
||||
virtual ssize_t ReadAt(off_t pos, void *buffer, size_t size);
|
||||
virtual ssize_t WriteAt(off_t pos, const void *buffer, size_t size);
|
||||
|
||||
virtual off_t Seek(off_t pos, uint32 seekMode);
|
||||
virtual off_t Position() const;
|
||||
virtual status_t SetSize(off_t size);
|
||||
|
||||
void SetBlockSize(size_t blockSize);
|
||||
|
||||
const void *Buffer() const;
|
||||
size_t BufferLength() const;
|
||||
|
||||
private:
|
||||
status_t _Resize(off_t size);
|
||||
|
||||
virtual void _ReservedMallocIO1();
|
||||
virtual void _ReservedMallocIO2();
|
||||
|
||||
BMallocIO(const BMallocIO &);
|
||||
BMallocIO &operator=(const BMallocIO &);
|
||||
|
||||
private:
|
||||
size_t fBlockSize;
|
||||
size_t fMallocSize;
|
||||
size_t fLength;
|
||||
char *fData;
|
||||
off_t fPosition;
|
||||
int32 _reserved[1];
|
||||
};
|
||||
|
||||
#endif // _sk_malloc_io_h
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef _BLUE_STOP_WATCH_H
|
||||
#define _BLUE_STOP_WATCH_H
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include "support/SupportDefs.h"
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
class BStopWatch {
|
||||
public:
|
||||
BStopWatch(const char *name, bool silent = false);
|
||||
virtual ~BStopWatch();
|
||||
|
||||
void Suspend();
|
||||
void Resume();
|
||||
bigtime_t Lap();
|
||||
bigtime_t ElapsedTime() const;
|
||||
void Reset();
|
||||
const char *Name() const;
|
||||
|
||||
private:
|
||||
virtual void _ReservedStopWatch1();
|
||||
virtual void _ReservedStopWatch2();
|
||||
|
||||
bigtime_t fStart;
|
||||
bigtime_t fSuspendTime;
|
||||
bigtime_t fLaps[10];
|
||||
int32 fLap;
|
||||
const char *fName;
|
||||
uint32 _reserved[2]; // these are for fName to be initiased
|
||||
bool fSilent;
|
||||
};
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
} // namespace OpenBeOS
|
||||
using namespace OpenBeOS;
|
||||
#endif
|
||||
|
||||
#endif /* _STOP_WATCH_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: String.h
|
||||
/
|
||||
/ Description: Header for the BString class
|
||||
/
|
||||
/ Author: Steve Vallee
|
||||
/
|
||||
******************************************************************************/
|
||||
@@ -0,0 +1,167 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// 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: SupportDefs.h
|
||||
// Author: Erik Jaesler ([email protected])
|
||||
// Description: Common type definitions.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef _SUPPORT_DEFS_H
|
||||
#define _SUPPORT_DEFS_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <BeBuild.h>
|
||||
#include <sys/types.h>
|
||||
#include <support/Errors.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
typedef unsigned long ulong;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned short ushort;
|
||||
#endif // _SYS_TYPES_H
|
||||
|
||||
|
||||
// Shorthand type formats ------------------------------------------------------
|
||||
|
||||
typedef signed char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef volatile signed char vint8;
|
||||
typedef volatile unsigned char vuint8;
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef volatile short vint16;
|
||||
typedef volatile unsigned short vuint16;
|
||||
|
||||
typedef long int32;
|
||||
typedef unsigned long uint32;
|
||||
typedef volatile long vint32;
|
||||
typedef volatile unsigned long vuint32;
|
||||
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
typedef volatile long long vint64;
|
||||
typedef volatile unsigned long long vuint64;
|
||||
|
||||
typedef volatile long vlong;
|
||||
typedef volatile int vint;
|
||||
typedef volatile short vshort;
|
||||
typedef volatile char vchar;
|
||||
|
||||
typedef volatile unsigned long vulong;
|
||||
typedef volatile unsigned int vuint;
|
||||
typedef volatile unsigned short vushort;
|
||||
typedef volatile unsigned char vuchar;
|
||||
|
||||
typedef unsigned char uchar;
|
||||
typedef unsigned short unichar;
|
||||
|
||||
|
||||
// Descriptive formats ---------------------------------------------------------
|
||||
typedef int32 status_t;
|
||||
typedef int64 bigtime_t;
|
||||
typedef uint32 type_code;
|
||||
typedef uint32 perform_code;
|
||||
|
||||
|
||||
// Empty string ("") -----------------------------------------------------------
|
||||
#ifdef __cplusplus
|
||||
extern _IMPEXP_BE const char *B_EMPTY_STRING;
|
||||
#endif
|
||||
|
||||
|
||||
// min and max comparisons -----------------------------------------------------
|
||||
// min() and max() won't work in C++
|
||||
#define min_c(a,b) ((a)>(b)?(b):(a))
|
||||
#define max_c(a,b) ((a)>(b)?(a):(b))
|
||||
|
||||
#ifndef __cplusplus
|
||||
#ifndef min
|
||||
#define min(a,b) ((a)>(b)?(b):(a))
|
||||
#endif
|
||||
#ifndef max
|
||||
#define max(a,b) ((a)>(b)?(a):(b))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// Grandfathering --------------------------------------------------------------
|
||||
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned char bool;
|
||||
#define false 0
|
||||
#define true 1
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (0)
|
||||
#endif
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//----- Atomic functions; old value is returned --------------------------------
|
||||
extern _IMPEXP_ROOT int32 atomic_add(vint32 *value, int32 addvalue);
|
||||
extern _IMPEXP_ROOT int32 atomic_and(vint32 *value, int32 andvalue);
|
||||
extern _IMPEXP_ROOT int32 atomic_or(vint32 *value, int32 orvalue);
|
||||
|
||||
// Other stuff -----------------------------------------------------------------
|
||||
extern _IMPEXP_ROOT void * get_stack_frame(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
//-------- Obsolete or discouraged API -----------------------------------------
|
||||
|
||||
// use 'true' and 'false'
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif // _SUPPORT_DEFS_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// 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: TypeConstants.h
|
||||
// Author: Erik Jaesler ([email protected])
|
||||
// Description: Constants that represent distinct data types, as used
|
||||
// by BMessage et. al.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef _TYPE_CONSTANTS_H
|
||||
#define _TYPE_CONSTANTS_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <BeBuild.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
|
||||
// Data Types ------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
B_ANY_TYPE = 'ANYT',
|
||||
B_BOOL_TYPE = 'BOOL',
|
||||
B_CHAR_TYPE = 'CHAR',
|
||||
B_COLOR_8_BIT_TYPE = 'CLRB',
|
||||
B_DOUBLE_TYPE = 'DBLE',
|
||||
B_FLOAT_TYPE = 'FLOT',
|
||||
B_GRAYSCALE_8_BIT_TYPE = 'GRYB',
|
||||
B_INT64_TYPE = 'LLNG',
|
||||
B_INT32_TYPE = 'LONG',
|
||||
B_INT16_TYPE = 'SHRT',
|
||||
B_INT8_TYPE = 'BYTE',
|
||||
B_MESSAGE_TYPE = 'MSGG',
|
||||
B_MESSENGER_TYPE = 'MSNG',
|
||||
B_MIME_TYPE = 'MIME',
|
||||
B_MONOCHROME_1_BIT_TYPE = 'MNOB',
|
||||
B_OBJECT_TYPE = 'OPTR',
|
||||
B_OFF_T_TYPE = 'OFFT',
|
||||
B_PATTERN_TYPE = 'PATN',
|
||||
B_POINTER_TYPE = 'PNTR',
|
||||
B_POINT_TYPE = 'BPNT',
|
||||
B_RAW_TYPE = 'RAWT',
|
||||
B_RECT_TYPE = 'RECT',
|
||||
B_REF_TYPE = 'RREF',
|
||||
B_RGB_32_BIT_TYPE = 'RGBB',
|
||||
B_RGB_COLOR_TYPE = 'RGBC',
|
||||
B_SIZE_T_TYPE = 'SIZT',
|
||||
B_SSIZE_T_TYPE = 'SSZT',
|
||||
B_STRING_TYPE = 'CSTR',
|
||||
B_TIME_TYPE = 'TIME',
|
||||
B_UINT64_TYPE = 'ULLG',
|
||||
B_UINT32_TYPE = 'ULNG',
|
||||
B_UINT16_TYPE = 'USHT',
|
||||
B_UINT8_TYPE = 'UBYT',
|
||||
B_MEDIA_PARAMETER_TYPE = 'BMCT',
|
||||
B_MEDIA_PARAMETER_WEB_TYPE = 'BMCW',
|
||||
B_MEDIA_PARAMETER_GROUP_TYPE= 'BMCG',
|
||||
|
||||
// deprecated, do not use
|
||||
B_ASCII_TYPE = 'TEXT' // use B_STRING_TYPE instead
|
||||
};
|
||||
|
||||
//----- System-wide MIME types for handling URL's ------------------------------
|
||||
|
||||
// To register your application as a handler for a specific URL type,
|
||||
// mark it as a handler of the corresponding MIME type from the list
|
||||
// below. When the user clicks on a link in NetPositive that your
|
||||
// application is a handler for, you will get a B_ARGV_RECEIVED message
|
||||
// with the full URL as the second argument.
|
||||
extern _IMPEXP_BE const char *B_URL_HTTP; // application/x-vnd.Be.URL.http
|
||||
extern _IMPEXP_BE const char *B_URL_HTTPS; // application/x-vnd.Be.URL.https
|
||||
extern _IMPEXP_BE const char *B_URL_FTP; // application/x-vnd.Be.URL.ftp
|
||||
extern _IMPEXP_BE const char *B_URL_GOPHER; // application/x-vnd.Be.URL.gopher
|
||||
extern _IMPEXP_BE const char *B_URL_MAILTO; // application/x-vnd.Be.URL.mailto
|
||||
extern _IMPEXP_BE const char *B_URL_NEWS; // application/x-vnd.Be.URL.news
|
||||
extern _IMPEXP_BE const char *B_URL_NNTP; // application/x-vnd.Be.URL.nntp
|
||||
extern _IMPEXP_BE const char *B_URL_TELNET; // application/x-vnd.Be.URL.telnet
|
||||
extern _IMPEXP_BE const char *B_URL_RLOGIN; // application/x-vnd.Be.URL.rlogin
|
||||
extern _IMPEXP_BE const char *B_URL_TN3270; // application/x-vnd.Be.URL.tn3270
|
||||
extern _IMPEXP_BE const char *B_URL_WAIS; // application/x-vnd.Be.URL.wais
|
||||
extern _IMPEXP_BE const char *B_URL_FILE; // application/x-vnd.Be.URL.file
|
||||
|
||||
//----- Obsolete; do not use ---------------------------------------------------
|
||||
|
||||
enum {
|
||||
_DEPRECATED_TYPE_1_ = 'PATH'
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif // _TYPE_CONSTANTS_H
|
||||
|
||||
/*
|
||||
* $Log $
|
||||
*
|
||||
* $Id $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include <support/ByteOrder.h>
|
||||
Reference in New Issue
Block a user