diff --git a/headers/build/config/HaikuConfig.h b/headers/build/config/HaikuConfig.h new file mode 100644 index 0000000000..cb405a162e --- /dev/null +++ b/headers/build/config/HaikuConfig.h @@ -0,0 +1,70 @@ +/* + * Copyright 2009, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _CONFIG_HAIKU_CONFIG_H +#define _CONFIG_HAIKU_CONFIG_H + + +/* Determine the architecture and define macros for some fundamental + properties: + __HAIKU_ARCH - short name of the architecture (used in paths) + __HAIKU_ARCH_ - defined to 1 for the respective architecture + __HAIKU_ARCH_64_BIT - defined to 1 on 64 bit architectures + __HAIKU_BIG_ENDIAN - defined to 1 on big endian architectures +*/ +#ifdef __INTEL__ +# ifdef HAIKU_HOST_PLATFORM_64_BIT +# define __HAIKU_ARCH x86_64 +# define __HAIKU_ARCH_X86_64 1 +# define __HAIKU_ARCH_64_BIT 1 +# else +# define __HAIKU_ARCH x86 +# define __HAIKU_ARCH_X86 1 +# endif +#elif __POWERPC__ +# define __HAIKU_ARCH ppc +# define __HAIKU_ARCH_PPC 1 +# define __HAIKU_BIG_ENDIAN 1 +#elif __M68K__ +# define __HAIKU_ARCH m68k 1 +# define __HAIKU_ARCH_M68K 1 +# define __HAIKU_BIG_ENDIAN 1 +#elif __MIPSEL__ +# define __HAIKU_ARCH mipsel +# define __HAIKU_ARCH_MIPSEL 1 +#elif __ARM__ +# define __HAIKU_ARCH arm +# define __HAIKU_ARCH_ARM 1 +#else +# error Unsupported architecture! +#endif + +/* implied properties */ +#ifndef __HAIKU_ARCH_64_BIT +# define __HAIKU_ARCH_32_BIT 1 +#endif +#ifndef __HAIKU_BIG_ENDIAN +# define __HAIKU_LITTLE_ENDIAN 1 +#endif + +/* architecture specific include macros */ +#define __HAIKU_ARCH_HEADER(header) +#define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header) \ + + +/* BeOS R5 binary compatibility (gcc 2 on x86) */ +#if defined(__HAIKU_ARCH_X86) && __GNUC__ == 2 +# define __HAIKU_BEOS_COMPATIBLE 1 +#endif + +/* BeOS R5 compatible types */ +#ifdef __HAIKU_ARCH_X86 + /* TODO: This should be "#ifdef __HAIKU_BEOS_COMPATIBLE", but this will + break all gcc 4 C++ optional packages. I.e. switch that at a suitable + time. + */ +# define __HAIKU_BEOS_COMPATIBLE_TYPES 1 +#endif + +#endif /* _CONFIG_HAIKU_CONFIG_H */ diff --git a/headers/build/config/types.h b/headers/build/config/types.h new file mode 100644 index 0000000000..d038d1968b --- /dev/null +++ b/headers/build/config/types.h @@ -0,0 +1,62 @@ +/* + * Copyright 2009, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _CONFIG_TYPES_H +#define _CONFIG_TYPES_H + + +#include + +#include + + +/* fixed-width types -- the __haiku_std_[u]int* types correspond to the POSIX + [u]int*_t types, the _haiku_[u]int* types to the BeOS [u]int* types. If + __HAIKU_BEOS_COMPATIBLE_TYPES is not defined both sets are identical. Once + we drop compatibility for good, we can consolidate the types. +*/ +typedef int8_t __haiku_std_int8; +typedef uint8_t __haiku_std_uint8; +typedef int16_t __haiku_std_int16; +typedef uint16_t __haiku_std_uint16; +typedef int32_t __haiku_std_int32; +typedef uint32_t __haiku_std_uint32; +typedef int64_t __haiku_std_int64; +typedef uint64_t __haiku_std_uint64; + +typedef __haiku_std_int8 __haiku_int8; +typedef __haiku_std_uint8 __haiku_uint8; +typedef __haiku_std_int16 __haiku_int16; +typedef __haiku_std_uint16 __haiku_uint16; +#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES +typedef signed long int __haiku_int32; +typedef unsigned long int __haiku_uint32; +#else +typedef __haiku_std_int32 __haiku_int32; +typedef __haiku_std_uint32 __haiku_uint32; +#endif +typedef __haiku_std_int64 __haiku_int64; +typedef __haiku_std_uint64 __haiku_uint64; + +/* address types */ +#ifdef __HAIKU_ARCH_64_BIT + typedef __haiku_int64 __haiku_saddr_t; + typedef __haiku_uint64 __haiku_addr_t; +#else + typedef __haiku_int32 __haiku_saddr_t; + typedef __haiku_uint32 __haiku_addr_t; +#endif + +/* address type limits */ +#ifdef __HAIKU_ARCH_64_BIT +# define __HAIKU_SADDR_MAX (9223372036854775807LL) +# define __HAIKU_ADDR_MAX (18446744073709551615ULL) +#else +# define __HAIKU_SADDR_MAX (2147483647) +# define __HAIKU_ADDR_MAX (4294967295U) +#endif +#define __HAIKU_SADDR_MIN (-__HAIKU_SADDR_MAX-1) + + +#endif /* _CONFIG_TYPES_H */ diff --git a/headers/build/os/BeBuild.h b/headers/build/os/BeBuild.h index 34afeaf5a0..91d33b0284 100644 --- a/headers/build/os/BeBuild.h +++ b/headers/build/os/BeBuild.h @@ -1,365 +1,71 @@ -/****************************************************************************** -/ -/ File: BeBuild.h -/ -/ Description: Import/export macros -/ -/ Copyright 1993-98, Be Incorporated -/ -*******************************************************************************/ - +/* + * Copyright 2007-2009, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _BE_BUILD_H #define _BE_BUILD_H -#define B_BEOS_VERSION_4 0x0400 -#define B_BEOS_VERSION_4_5 0x0450 -#define B_BEOS_VERSION_5 0x0500 -#define B_BEOS_VERSION B_BEOS_VERSION_5 -#define B_BEOS_VERSION_MAUI B_BEOS_VERSION_5 +#include -#if defined(__POWERPC__) - // the PowerPC build is using GCC now (BeOS R5 used to use the Metrowerks - // compiler), so it is not compatible to any BeOS version on that platform - // before. However, that wouldn't rule out source compatibility, which - // we do here (for now). - #define _PR2_COMPATIBLE_ 0 - #define _PR3_COMPATIBLE_ 0 - #define _R4_COMPATIBLE_ 0 - #define _R4_5_COMPATIBLE_ 0 -#elif defined(__INTEL__) - #define _PR2_COMPATIBLE_ 0 - #define _PR3_COMPATIBLE_ 0 - #define _R4_COMPATIBLE_ 1 - #define _R4_5_COMPATIBLE_ 1 + +#define B_BEOS_VERSION_4 0x0400 +#define B_BEOS_VERSION_4_5 0x0450 +#define B_BEOS_VERSION_5 0x0500 + +#define B_BEOS_VERSION B_BEOS_VERSION_5 +#define B_BEOS_VERSION_MAUI B_BEOS_VERSION_5 + +/* Haiku (API) version */ +#define B_HAIKU_VERSION_BEOS 0x00000001 +#define B_HAIKU_VERSION_BONE 0x00000002 +#define B_HAIKU_VERSION_DANO 0x00000003 +#define B_HAIKU_VERSION_1_ALPHA_1 0x00000100 +#define B_HAIKU_VERSION_1_PRE_ALPHA_2 0x00000101 +#define B_HAIKU_VERSION_1 0x00010000 + +#define B_HAIKU_VERSION B_HAIKU_VERSION_1_PRE_ALPHA_2 + +/* Haiku ABI */ +#define B_HAIKU_ABI_MAJOR 0xffff0000 +#define B_HAIKU_ABI_GCC_2 0x00020000 +#define B_HAIKU_ABI_GCC_4 0x00040000 + +#define B_HAIKU_ABI_GCC_2_ANCIENT 0x00020000 +#define B_HAIKU_ABI_GCC_2_BEOS 0x00020001 +#define B_HAIKU_ABI_GCC_2_HAIKU 0x00020002 + +#if __GNUC__ == 2 +# define B_HAIKU_ABI B_HAIKU_ABI_GCC_2_HAIKU +#elif __GNUC__ == 4 +# define B_HAIKU_ABI B_HAIKU_ABI_GCC_4 #else -# error Configure BeBuild.h for your platform -#endif - -#if __MWERKS__ -# define _UNUSED(x) -# define _PACKED -#endif - -#if __GNUC__ -# define _UNUSED(x) x -# define _PACKED __attribute__((packed)) -#endif - -#if defined(__INTEL__) || defined(__POWERPC__) - -// This is the standard import/export definitions used for -// the ELF binary format - this should be usable by all flavors -// of OpenBeOS. - -# define _EXPORT -# define _IMPORT - -# define _IMPEXP_KERNEL -# define _IMPEXP_GL -# define _IMPEXP_ROOT -# define _IMPEXP_NET -# define _IMPEXP_NETDEV -# define _IMPEXP_ATALK -# define _IMPEXP_BE -# define _IMPEXP_TRACKER -# define _IMPEXP_MAIL -# define _IMPEXP_DEVICE -# define _IMPEXP_MEDIA -# define _IMPEXP_MIDI -# define _IMPEXP_MIDI2 -# define _IMPEXP_GAME -# define _IMPEXP_GSOUND -# define _IMPEXP_TRANSLATION -# define _IMPEXP_TEXTENCODING -# define _IMPEXP_INPUT +# error Unsupported gcc version! #endif -#ifdef __cplusplus +#ifdef __HAIKU_ARCH_64_BIT +# define B_HAIKU_64_BIT 1 +#endif -/* cpp kit */ +#ifdef __HAIKU_BEOS_COMPATIBLE +# define B_HAIKU_BEOS_COMPATIBLE 1 +#endif -/* support kit */ -class _IMPEXP_BE BArchivable; -class _IMPEXP_BE BAutolock; -class _IMPEXP_BE BBlockCache; -class _IMPEXP_BE BBufferIO; -class _IMPEXP_BE BDataIO; -class _IMPEXP_BE BPositionIO; -class _IMPEXP_BE BMallocIO; -class _IMPEXP_BE BMemoryIO; -class _IMPEXP_BE BFlattenable; -class _IMPEXP_BE BList; -class _IMPEXP_BE BLocker; -class _IMPEXP_BE BStopWatch; -class _IMPEXP_BE BString; -class _IMPEXP_BE PointerList; +#define _UNUSED(argument) argument +#define _PACKED __attribute__((packed)) +#define _PRINTFLIKE(_format_, _args_) \ + __attribute__((format(__printf__, _format_, _args_))) +#define _EXPORT +#define _IMPORT -/*storage kit */ -struct _IMPEXP_BE entry_ref; -struct _IMPEXP_BE node_ref; -class _IMPEXP_BE BAppFileInfo; -class _IMPEXP_BE BDirectory; -class _IMPEXP_BE BEntry; -class _IMPEXP_BE BFile; -class _IMPEXP_BE BRefFilter; -class _IMPEXP_BE BMimeType; -class _IMPEXP_BE BNode; -class _IMPEXP_BE BNodeInfo; -class _IMPEXP_BE BPath; -class _IMPEXP_BE BQuery; -class _IMPEXP_BE BResources; -class _IMPEXP_BE BResourceStrings; -class _IMPEXP_BE BStatable; -class _IMPEXP_BE BSymLink; -class _IMPEXP_BE BVolume; -class _IMPEXP_BE BVolumeRoster; +#define B_DEFINE_SYMBOL_VERSION(function, versionedSymbol) \ + __asm__(".symver " function "," versionedSymbol) -//class _IMPEXP_BE Partition; -//class _IMPEXP_BE Session; -//class _IMPEXP_BE Device; -//class _IMPEXP_BE DeviceList; -//class _IMPEXP_BE TNodeWalker; -//class _IMPEXP_BE TQueryWalker; -//class _IMPEXP_BE TVolWalker; -/*app kit */ -struct _IMPEXP_BE app_info; -class _IMPEXP_BE BApplication; -class _IMPEXP_BE BClipboard; -class _IMPEXP_BE BHandler; -class _IMPEXP_BE BInvoker; -class _IMPEXP_BE BLooper; -class _IMPEXP_BE BMessage; -class _IMPEXP_BE BMessageFilter; -class _IMPEXP_BE BMessageQueue; -class _IMPEXP_BE BMessageRunner; -class _IMPEXP_BE BMessenger; -class _IMPEXP_BE BPropertyInfo; -class _IMPEXP_BE BRoster; +#define _IMPEXP_ROOT +#define _IMPEXP_BE -class _IMPEXP_BE _BAppServerLink_; -class _IMPEXP_BE _BSession_; - -/*interface kit */ -class _IMPEXP_BE BAlert; -class _IMPEXP_BE BBitmap; -class _IMPEXP_BE BBox; -class _IMPEXP_BE BButton; -class _IMPEXP_BE BChannelControl; -class _IMPEXP_BE BChannelSlider; -class _IMPEXP_BE BCheckBox; -class _IMPEXP_BE BColorControl; -class _IMPEXP_BE BControl; -class _IMPEXP_BE BDeskbar; -class _IMPEXP_BE BDragger; -class _IMPEXP_BE BFont; -class _IMPEXP_BE BInputDevice; -class _IMPEXP_BE BListItem; -class _IMPEXP_BE BListView; -class _IMPEXP_BE BStringItem; -class _IMPEXP_BE BMenu; -class _IMPEXP_BE BMenuBar; -class _IMPEXP_BE BMenuField; -class _IMPEXP_BE BMenuItem; -class _IMPEXP_BE BOptionControl; -class _IMPEXP_BE BOptionPopUp; -class _IMPEXP_BE BOutlineListView; -class _IMPEXP_BE BPicture; -class _IMPEXP_BE BPictureButton; -class _IMPEXP_BE BPoint; -class _IMPEXP_BE BPolygon; -class _IMPEXP_BE BPopUpMenu; -class _IMPEXP_BE BPrintJob; -class _IMPEXP_BE BRadioButton; -class _IMPEXP_BE BRect; -class _IMPEXP_BE BRegion; -class _IMPEXP_BE BScreen; -class _IMPEXP_BE BScrollBar; -class _IMPEXP_BE BScrollView; -class _IMPEXP_BE BSeparatorItem; -class _IMPEXP_BE BShelf; -class _IMPEXP_BE BShape; -class _IMPEXP_BE BShapeIterator; -class _IMPEXP_BE BSlider; -class _IMPEXP_BE BStatusBar; -class _IMPEXP_BE BStringView; -class _IMPEXP_BE BTab; -class _IMPEXP_BE BTabView; -class _IMPEXP_BE BTextControl; -class _IMPEXP_BE BTextView; -class _IMPEXP_BE BView; -class _IMPEXP_BE BWindow; - -class _IMPEXP_BE _BTextInput_; -class _IMPEXP_BE _BMCMenuBar_; -class _IMPEXP_BE _BMCItem_; -class _IMPEXP_BE _BWidthBuffer_; -class _IMPEXP_BE BPrivateScreen; - -/* net kit */ -class _IMPEXP_NET _Allocator; -class _IMPEXP_NET _Transacter; -class _IMPEXP_NET _FastIPC; - -/* netdev kit */ -class _IMPEXP_NETDEV BNetPacket; -class _IMPEXP_NETDEV BStandardPacket; -class _IMPEXP_NETDEV BTimeoutHandler; -class _IMPEXP_NETDEV BPacketHandler; -class _IMPEXP_NETDEV BNetProtocol; -class _IMPEXP_NETDEV BNetDevice; -class _IMPEXP_NETDEV BCallBackHandler; -class _IMPEXP_NETDEV BNetConfig; -class _IMPEXP_NETDEV BIpDevice; - -class _IMPEXP_NETDEV _NetBufList; -class _IMPEXP_NETDEV _BSem; - -/* atalk kit */ -class _IMPEXP_ATALK _PrinterNode; - -/* tracker kit */ -class _IMPEXP_TRACKER BFilePanel; -class _IMPEXP_TRACKER BRecentItemsList; -class _IMPEXP_TRACKER BRecentFilesList; -class _IMPEXP_TRACKER BRecentFoldersList; -class _IMPEXP_TRACKER BRecentAppsList; - -/* mail kit */ -class _IMPEXP_MAIL BMailMessage; - -/* device kit */ -class _IMPEXP_DEVICE BA2D; -class _IMPEXP_DEVICE BD2A; -class _IMPEXP_DEVICE BDigitalPort; -class _IMPEXP_DEVICE BJoystick; -class _IMPEXP_DEVICE BSerialPort; - -/* media kit */ -class _IMPEXP_MEDIA BDACRenderer; -class _IMPEXP_MEDIA BAudioFileStream; -class _IMPEXP_MEDIA BADCStream; -class _IMPEXP_MEDIA BDACStream; -class _IMPEXP_MEDIA BAbstractBufferStream; -class _IMPEXP_MEDIA BBufferStreamManager; -class _IMPEXP_MEDIA BBufferStream; -class _IMPEXP_MEDIA BSoundFile; -class _IMPEXP_MEDIA BSubscriber; - -class _IMPEXP_MEDIA BMediaRoster; -class _IMPEXP_MEDIA BMediaNode; -class _IMPEXP_MEDIA BTimeSource; -class _IMPEXP_MEDIA BBufferProducer; -class _IMPEXP_MEDIA BBufferConsumer; -class _IMPEXP_MEDIA BBuffer; -class _IMPEXP_MEDIA BBufferGroup; -class _IMPEXP_MEDIA BControllable; -class _IMPEXP_MEDIA BFileInterface; -class _IMPEXP_MEDIA BEntityInterface; -class _IMPEXP_MEDIA BMediaAddOn; -class _IMPEXP_MEDIA BMediaTheme; -class _IMPEXP_MEDIA BParameterWeb; -class _IMPEXP_MEDIA BParameterGroup; -class _IMPEXP_MEDIA BParameter; -class _IMPEXP_MEDIA BNullParameter; -class _IMPEXP_MEDIA BDiscreteParameter; -class _IMPEXP_MEDIA BContinuousParameter; -class _IMPEXP_MEDIA BMediaFiles; -class _IMPEXP_MEDIA BSound; -class _IMPEXP_MEDIA BSoundCard; -class _IMPEXP_MEDIA BSoundPlayer; -class _IMPEXP_MEDIA BMediaFormats; -class _IMPEXP_MEDIA BTimedEventQueue; -//class _IMPEXP_MEDIA BEventIterator; -class _IMPEXP_MEDIA BMediaEventLooper; -class _IMPEXP_MEDIA BMediaFile; -class _IMPEXP_MEDIA BMediaTrack; - -class _IMPEXP_MEDIA media_node; -struct _IMPEXP_MEDIA media_input; -struct _IMPEXP_MEDIA media_output; -struct _IMPEXP_MEDIA live_node_info; -struct _IMPEXP_MEDIA buffer_clone_info; -struct _IMPEXP_MEDIA media_source; -struct _IMPEXP_MEDIA media_destination; -struct _IMPEXP_MEDIA media_raw_audio_format; -struct _IMPEXP_MEDIA media_raw_video_format; -struct _IMPEXP_MEDIA media_video_display_info; -struct _IMPEXP_MEDIA flavor_info; -struct _IMPEXP_MEDIA dormant_node_info; -struct _IMPEXP_MEDIA dormant_flavor_info; -struct _IMPEXP_MEDIA media_source; -struct _IMPEXP_MEDIA media_destination; -struct _IMPEXP_MEDIA _media_format_description; -struct _IMPEXP_MEDIA media_timed_event; - -/* midi kit */ -class _IMPEXP_MIDI BMidi; -class _IMPEXP_MIDI BMidiPort; -class _IMPEXP_MIDI BMidiStore; -class _IMPEXP_MIDI BMidiSynth; -class _IMPEXP_MIDI BMidiSynthFile; -class _IMPEXP_MIDI BMidiText; -class _IMPEXP_MIDI BSamples; -class _IMPEXP_MIDI BSynth; - -class _IMPEXP_MIDI2 BMidiEndpoint; -class _IMPEXP_MIDI2 BMidiProducer; -class _IMPEXP_MIDI2 BMidiConsumer; -class _IMPEXP_MIDI2 BMidiLocalProducer; -class _IMPEXP_MIDI2 BMidiLocalConsumer; -class _IMPEXP_MIDI2 BMidiRoster; - -/* game kit */ -class _IMPEXP_GAME BWindowScreen; -class _IMPEXP_GAME BDirectWindow; - -/* gamesound kit */ -class _IMPEXP_GSOUND BGameSound; -class _IMPEXP_GSOUND BSimpleGameSound; -class _IMPEXP_GSOUND BStreamingGameSound; -class _IMPEXP_GSOUND BFileGameSound; -class _IMPEXP_GSOUND BPushGameSound; - -/* translation kit */ -class _IMPEXP_TRANSLATION BTranslatorRoster; -class _IMPEXP_TRANSLATION BTranslationUtils; -class _IMPEXP_TRANSLATION BBitmapStream; -class _IMPEXP_TRANSLATION BTranslator; -struct _IMPEXP_TRANSLATION translation_format; -struct _IMPEXP_TRANSLATION translator_info; - -/* GL */ -class _IMPEXP_GL BGLView; -class _IMPEXP_GL BGLScreen; -class _IMPEXP_GL GLUnurbs; -class _IMPEXP_GL GLUquadric; -class _IMPEXP_GL GLUtesselator; - -typedef class _IMPEXP_GL GLUnurbs GLUnurbsObj; -typedef class _IMPEXP_GL GLUquadric GLUquadricObj; -typedef class _IMPEXP_GL GLUtesselator GLUtesselatorObj; -typedef class _IMPEXP_GL GLUtesselator GLUtriangulatorObj; - -/* input_server */ -class _IMPEXP_INPUT BInputServerDevice; -class _IMPEXP_INPUT BInputServerFilter; -class _IMPEXP_INPUT BInputServerMethod; - -#else /* __cplusplus */ -/* -//typedef struct _IMPEXP_GL GLUnurbs GLUnurbs; -//typedef struct _IMPEXP_GL GLUquadric GLUquadric; -//typedef struct _IMPEXP_GL GLUtesselator GLUtesselator; - -//typedef struct _IMPEXP_GL GLUnurbs GLUnurbsObj; -//typedef struct _IMPEXP_GL GLUquadric GLUquadricObj; -//typedef struct _IMPEXP_GL GLUtesselator GLUtesselatorObj; -//typedef struct _IMPEXP_GL GLUtesselator GLUtriangulatorObj; -*/ -#endif /* __cplusplus */ #endif /* _BE_BUILD_H */ diff --git a/headers/build/os/app/Application.h b/headers/build/os/app/Application.h index 3bb29ef30e..83ffa8677f 100644 --- a/headers/build/os/app/Application.h +++ b/headers/build/os/app/Application.h @@ -10,6 +10,10 @@ #include + +struct app_info; + + class BApplication { public: BApplication(const char* signature); diff --git a/headers/build/os/app/Handler.h b/headers/build/os/app/Handler.h index 9a17a7f9d9..46d0b6205a 100644 --- a/headers/build/os/app/Handler.h +++ b/headers/build/os/app/Handler.h @@ -45,6 +45,7 @@ class BLooper; class BMessageFilter; class BMessage; +class BMessenger; class BList; class _ObserverList; diff --git a/headers/build/os/app/Roster.h b/headers/build/os/app/Roster.h index 87f11e45ca..25f40d9b5a 100644 --- a/headers/build/os/app/Roster.h +++ b/headers/build/os/app/Roster.h @@ -22,7 +22,7 @@ // File Name: Roster.h // Author: Ingo Weinhold (bonefish@users.sf.net) // Description: BRoster class lets you launch apps and keeps -// track of apps that are running. +// track of apps that are running. // Global be_roster represents the default BRoster. // app_info structure provides info for a running app. //------------------------------------------------------------------------------ @@ -69,7 +69,10 @@ enum { B_SOME_APP_ACTIVATED = 'BRAW', }; +class BFile; class BList; +class BMimeType; +class BNodeInfo; // BRoster class BRoster { diff --git a/headers/build/os/storage/Directory.h b/headers/build/os/storage/Directory.h index 7d7c30c2a9..4e005c21be 100644 --- a/headers/build/os/storage/Directory.h +++ b/headers/build/os/storage/Directory.h @@ -1,5 +1,5 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered +// This software is part of the OpenBeOS distribution and is covered // by the OpenBeOS license. //--------------------------------------------------------------------- /*! @@ -19,17 +19,18 @@ namespace OpenBeOS { #endif +class BFile; class BSymLink; /*! \class BDirectory \brief A directory in the filesystem - + Provides an interface for manipulating directories and their contents. \author Ingo Weinhold \author Tyler Dauwalder - + \version 0.0.0 */ class BDirectory : public BNode, public BEntryList { @@ -90,7 +91,7 @@ private: int get_fd() const; status_t set_dir_fd(int fd); - + private: uint32 _reservedData[7]; int fDirFd; diff --git a/headers/build/os/storage/Node.h b/headers/build/os/storage/Node.h index 67dfc8dd1f..ffb187c695 100644 --- a/headers/build/os/storage/Node.h +++ b/headers/build/os/storage/Node.h @@ -9,6 +9,9 @@ #include class BDirectory; +class BEntry; +class BString; +struct entry_ref; //! Reference structure to a particular vnode on a particular device /*! node_ref - A node reference. @@ -18,7 +21,7 @@ class BDirectory; @version 0.0.0 */ struct node_ref { - node_ref(); + node_ref(); node_ref(const node_ref &ref); bool operator==(const node_ref &ref) const; @@ -95,7 +98,7 @@ private: friend class BDirectory; friend class BSymLink; - virtual void _RudeNode1(); + virtual void _RudeNode1(); virtual void _RudeNode2(); virtual void _RudeNode3(); virtual void _RudeNode4(); diff --git a/headers/build/os/storage/SymLink.h b/headers/build/os/storage/SymLink.h index 6d00925982..efe3df404a 100644 --- a/headers/build/os/storage/SymLink.h +++ b/headers/build/os/storage/SymLink.h @@ -1,5 +1,5 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered +// This software is part of the OpenBeOS distribution and is covered // by the OpenBeOS license. // // File Name: SymLink.h @@ -19,14 +19,16 @@ namespace OpenBeOS { #endif +class BPath; + /*! \class BSymLink \brief A symbolic link in the filesystem - + Provides an interface for manipulating symbolic links. \author Ingo Weinhold - + \version 0.0.0 */ class BSymLink : public BNode { diff --git a/headers/build/os/support/ByteOrder.h b/headers/build/os/support/ByteOrder.h index bb9bd7f17a..96e996119d 100644 --- a/headers/build/os/support/ByteOrder.h +++ b/headers/build/os/support/ByteOrder.h @@ -1,24 +1,19 @@ -// 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_ +/* + * Copyright 2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _BYTEORDER_H +#define _BYTEORDER_H #include -#include -#include /* For convenience */ - #include +#include +#include + /* for convenience */ -#ifdef __cplusplus -extern "C" { -#endif - -/*----------------------------------------------------------------------*/ -/*------- Swap-direction constants, and swapping functions -------------*/ - +/* swap directions */ typedef enum { B_SWAP_HOST_TO_LENDIAN, B_SWAP_HOST_TO_BENDIAN, @@ -27,121 +22,111 @@ typedef enum { 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); -/*-------------------------------------------------------------*/ +/* BSD/networking macros */ +#ifndef htonl +# 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) +#endif - -/*-------------------------------------------------------------*/ -/*--------- 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 ---------------------------------*/ +/* always swap 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) +#if BYTE_ORDER == __LITTLE_ENDIAN +/* Host is little endian */ -/*-------------------------------------------------------------*/ -/*---------Berkeley macros -----------------------------------*/ -#ifndef htonl /* avoid collision with */ - #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) -#endif +#define B_HOST_IS_LENDIAN 1 +#define B_HOST_IS_BENDIAN 0 + +/* Host native to little endian */ +#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) + +/* Little endian to 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) + +/* Host native to big endian */ +#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) + +/* Big endian to 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 /* BYTE_ORDER */ +/* Host is big endian */ + +#define B_HOST_IS_LENDIAN 0 +#define B_HOST_IS_BENDIAN 1 + +/* Host native to little endian */ +#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) + +/* Little endian to 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) + +/* Host native to big endian */ +#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) + +/* Big endian to 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 /* BYTE_ORDER */ + + +#ifdef __cplusplus +extern "C" { +#endif + +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 arg); +extern uint32 __swap_int32(uint32 arg); +extern uint16 __swap_int16(uint16 arg); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif -/*-------------------------------------------------------------*/ -/*-------------------------------------------------------------*/ - -#endif // _sk_byte_order_h_ +#endif /* _BYTEORDER_H */ diff --git a/headers/build/os/support/SupportDefs.h b/headers/build/os/support/SupportDefs.h index 795001de40..527216cdd4 100644 --- a/headers/build/os/support/SupportDefs.h +++ b/headers/build/os/support/SupportDefs.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007, Haiku, Inc. All Rights Reserved. + * Copyright 2004-2009, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Author: @@ -9,39 +9,34 @@ #define _SUPPORT_DEFS_H -/* this must be located before the include of sys/types.h */ -#if !defined(_SYS_TYPES_H) && !defined(_SYS_TYPES_H_) -typedef unsigned long ulong; -typedef unsigned int uint; -typedef unsigned short ushort; -#endif +#include #include #include +#include #include -// Shorthand type formats -typedef signed char int8; -typedef unsigned char uint8; -typedef volatile signed char vint8; -typedef volatile unsigned char vuint8; +/* fixed-size integer types */ +typedef __haiku_int8 int8; +typedef __haiku_uint8 uint8; +typedef __haiku_int16 int16; +typedef __haiku_uint16 uint16; +typedef __haiku_int32 int32; +typedef __haiku_uint32 uint32; +typedef __haiku_int64 int64; +typedef __haiku_uint64 uint64; -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; +/* shorthand types */ +typedef volatile int8 vint8; +typedef volatile uint8 vuint8; +typedef volatile int16 vint16; +typedef volatile uint16 vuint16; +typedef volatile int32 vint32; +typedef volatile uint32 vuint32; +typedef volatile int64 vint64; +typedef volatile uint64 vuint64; typedef volatile long vlong; typedef volatile int vint; @@ -56,21 +51,100 @@ typedef volatile unsigned char vuchar; typedef unsigned char uchar; typedef unsigned short unichar; - -// Descriptive formats +/* descriptive types */ typedef int32 status_t; typedef int64 bigtime_t; typedef uint32 type_code; typedef uint32 perform_code; -// Empty string ("") +/* printf()/scanf() format strings for [u]int* types */ +#define FSSH_B_PRId8 PRId8 +#define FSSH_B_PRIi8 PRIi8 +#define FSSH_B_PRId16 PRId16 +#define FSSH_B_PRIi16 PRIi16 +#define FSSH_B_PRId32 PRId32 +#define FSSH_B_PRIi32 PRIi32 +#define FSSH_B_PRId64 PRId64 +#define FSSH_B_PRIi64 PRIi64 +#define FSSH_B_PRIu8 PRIu8 +#define FSSH_B_PRIo8 PRIo8 +#define FSSH_B_PRIx8 PRIx8 +#define FSSH_B_PRIX8 PRIX8 +#define FSSH_B_PRIu16 PRIu16 +#define FSSH_B_PRIo16 PRIo16 +#define FSSH_B_PRIx16 PRIx16 +#define FSSH_B_PRIX16 PRIX16 +#define FSSH_B_PRIu32 PRIu32 +#define FSSH_B_PRIo32 PRIo32 +#define FSSH_B_PRIx32 PRIx32 +#define FSSH_B_PRIX32 PRIX32 +#define FSSH_B_PRIu64 PRIu64 +#define FSSH_B_PRIo64 PRIo64 +#define FSSH_B_PRIx64 PRIx64 +#define FSSH_B_PRIX64 PRIX64 + +#define FSSH_B_SCNd8 SCNd8 +#define FSSH_B_SCNi8 SCNi8 +#define FSSH_B_SCNd16 SCNd16 +#define FSSH_B_SCNi16 SCNi16 +#define FSSH_B_SCNd32 SCNd32 +#define FSSH_B_SCNi32 SCNi32 +#define FSSH_B_SCNd64 SCNd64 +#define FSSH_B_SCNi64 SCNi64 +#define FSSH_B_SCNu8 SCNu8 +#define FSSH_B_SCNo8 SCNo8 +#define FSSH_B_SCNx8 SCNx8 +#define FSSH_B_SCNu16 SCNu16 +#define FSSH_B_SCNu16 SCNu16 +#define FSSH_B_SCNx16 SCNx16 +#define FSSH_B_SCNu32 SCNu32 +#define FSSH_B_SCNo32 SCNo32 +#define FSSH_B_SCNx32 SCNx32 +#define FSSH_B_SCNu64 SCNu64 +#define FSSH_B_SCNo64 SCNo64 +#define FSSH_B_SCNx64 SCNx64 + + +/* printf() format strings for some standard types */ +/* size_t */ +#define FSSH_B_PRIuSIZE FSSH_B_PRIu32 +#define FSSH_B_PRIoSIZE FSSH_B_PRIo32 +#define FSSH_B_PRIxSIZE FSSH_B_PRIx32 +#define FSSH_B_PRIXSIZE FSSH_B_PRIX32 +/* ssize_t */ +#define FSSH_B_PRIdSSIZE FSSH_B_PRId32 +#define FSSH_B_PRIiSSIZE FSSH_B_PRIi32 +/* addr_t */ +#ifdef HAIKU_HOST_PLATFORM_64_BIT +# define FSSH_B_PRIuADDR FSSH_B_PRIu64 +# define FSSH_B_PRIoADDR FSSH_B_PRIo64 +# define FSSH_B_PRIxADDR FSSH_B_PRIx64 +# define FSSH_B_PRIXADDR FSSH_B_PRIX64 +#else +# define FSSH_B_PRIuADDR FSSH_B_PRIu32 +# define FSSH_B_PRIoADDR FSSH_B_PRIo32 +# define FSSH_B_PRIxADDR FSSH_B_PRIx32 +# define FSSH_B_PRIXADDR FSSH_B_PRIX32 +#endif +/* off_t */ +#define FSSH_B_PRIdOFF FSSH_B_PRId64 +#define FSSH_B_PRIiOFF FSSH_B_PRIi64 +/* dev_t */ +#define FSSH_B_PRIdDEV FSSH_B_PRId32 +#define FSSH_B_PRIiDEV FSSH_B_PRIi32 +/* ino_t */ +#define FSSH_B_PRIdINO FSSH_B_PRId64 +#define FSSH_B_PRIiINO FSSH_B_PRIi64 + + +/* Empty string ("") */ #ifdef __cplusplus extern const char *B_EMPTY_STRING; #endif -// min and max comparisons +/* min and max comparisons */ #ifndef __cplusplus # ifndef min # define min(a,b) ((a)>(b)?(b):(a)) @@ -78,17 +152,17 @@ extern const char *B_EMPTY_STRING; # ifndef max # define max(a,b) ((a)>(b)?(a):(b)) # endif -#endif +#endif -// min() and max() won't work in C++ +/* min() and max() are functions in C++ */ #define min_c(a,b) ((a)>(b)?(b):(a)) #define max_c(a,b) ((a)>(b)?(a):(b)) -// Grandfathering +/* Grandfathering */ #ifndef __cplusplus # include -#endif +#endif #ifndef NULL # define NULL (0) @@ -99,31 +173,31 @@ extern const char *B_EMPTY_STRING; extern "C" { #endif -// Atomic functions; previous value is returned +/* Atomic functions; previous value is returned */ extern int32 atomic_set(vint32 *value, int32 newValue); extern int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst); extern int32 atomic_add(vint32 *value, int32 addValue); extern int32 atomic_and(vint32 *value, int32 andValue); -extern int32 atomic_or(vint32 *value, int32 orValue); +extern int32 atomic_or(vint32 *value, int32 orValue); extern int32 atomic_get(vint32 *value); extern int64 atomic_set64(vint64 *value, int64 newValue); extern int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst); extern int64 atomic_add64(vint64 *value, int64 addValue); extern int64 atomic_and64(vint64 *value, int64 andValue); -extern int64 atomic_or64(vint64 *value, int64 orValue); +extern int64 atomic_or64(vint64 *value, int64 orValue); extern int64 atomic_get64(vint64 *value); -// Other stuff +/* Other stuff */ extern void* get_stack_frame(void); #ifdef __cplusplus } #endif -// Obsolete or discouraged API +/* Obsolete or discouraged API */ -// use 'true' and 'false' +/* use 'true' and 'false' */ #ifndef FALSE # define FALSE 0 #endif @@ -131,4 +205,4 @@ extern void* get_stack_frame(void); # define TRUE 1 #endif -#endif // _SUPPORT_DEFS_H +#endif /* _SUPPORT_DEFS_H */