소스 검색

Haiku initial support.

Brucey 4 년 전
부모
커밋
22d1d7f25a

+ 2 - 0
appstub.mod/appstub.bmx

@@ -68,6 +68,8 @@ Import "appstub.linux.c"
 Import "appstub.linux.c"
 ?nx
 Import "appstub.nx.c"
+?haiku
+Import "appstub.haiku.c"
 ?
 
 Extern

+ 17 - 0
appstub.mod/appstub.haiku.c

@@ -0,0 +1,17 @@
+
+#include <brl.mod/blitz.mod/blitz.h>
+
+#include <signal.h>
+
+int __bb_brl_appstub_appstub();
+
+int main( int argc,char *argv[] ){
+
+	signal( SIGPIPE,SIG_IGN );
+	
+	bbStartup( argc,argv,0,0 );
+	
+	__bb_brl_appstub_appstub();
+
+	return 0;
+}

+ 4 - 0
appstub.mod/debugger_mt.stdio.bmx

@@ -10,6 +10,8 @@ Include "deref_win32.bmx"
 Include "deref_linux.bmx"
 ?macos
 Include "deref_macos.bmx"
+?haiku
+Include "deref_haiku.bmx"
 ?
 
 
@@ -495,6 +497,8 @@ Function DebugDerefPointer:String(decl:Int Ptr, pointer:Byte Ptr)
 	result = DebugDerefPointerLinux(dataSize, ptrDepth, pointer, buffer, res)
 	?macos
 	result = DebugDerefPointerMacos(dataSize, ptrDepth, pointer, buffer, res)
+	?haiku
+	result = DebugDerefPointerHaiku(dataSize, ptrDepth, pointer, buffer, res)
 	?
 
 	If Not res Then

+ 6 - 0
appstub.mod/deref_haiku.bmx

@@ -0,0 +1,6 @@
+
+Function DebugDerefPointerHaiku:String(dataSize:Size_T, ptrDepth:Int, pointer:Byte Ptr, buffer:Byte Ptr, res:Int Var)
+
+	Return ""
+	
+End Function

+ 2 - 0
blitz.mod/blitz.bmx

@@ -75,6 +75,8 @@ ModuleInfo "CC_OPTS: -DGC_THREADS -DATOMIC_UNCOLLECTABLE"
 ModuleInfo "CC_OPTS: -DNO_GETCONTEXT"
 ?nx
 ModuleInfo "CC_OPTS: -DATOMIC_UNCOLLECTABLE -DNN_BUILD_TARGET_PLATFORM_NX"
+?haiku
+ModuleInfo "CC_OPTS: -DGC_THREADS -DPARALLEL_MARK -DATOMIC_UNCOLLECTABLE -DLARGE_CONFIG -DUSE_MMAP -DUSE_MUNMAP -DGC_UNMAP_THRESHOLD=3"
 ?
 ModuleInfo "CC_OPTS: -DJAVA_FINALIZATION"
 

+ 94 - 0
blitz.mod/blitz_app.c

@@ -343,6 +343,67 @@ int bbIsMainThread(){
 //	return pthread_self()==_mainThread;
 }
 
+#elif __HAIKU__
+
+#include <unistd.h>
+#include <pthread.h>
+#include <limits.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <kernel/OS.h>
+
+static int base_time;
+static pthread_t _mainThread;
+
+static void startup(){
+	
+	_mainThread=pthread_self();
+
+	bigtime_t uptime = system_time();
+	base_time=bbMilliSecs()-uptime/1000;
+}
+
+//***** ThreadSafe! *****
+void bbDelay( int millis ){
+	int i,e;
+	
+	if( millis<0 ) return;
+
+	e=bbMilliSecs()+millis;
+	
+	for( i=0;;++i ){
+		int t=e-bbMilliSecs();
+		if( t<=0 ){
+			if( !i ) usleep( 0 );	//always sleep at least once.
+			break;
+		}
+		usleep( t*1000 );
+	}
+}
+
+#if __STDC_VERSION__ >= 199901L
+extern void bbUDelay( int microseconds );
+#else
+void bbUDelay( int microseconds ) {
+	if (microseconds <0) return
+	usleep( microseconds );
+}
+#endif
+
+//***** ThreadSafe! *****
+int bbMilliSecs(){
+	int t;
+	struct timeval tv;
+	gettimeofday(&tv,0);
+	t=tv.tv_sec*1000;
+	t+=tv.tv_usec/1000;
+	return t-base_time;
+}
+
+int bbIsMainThread(){
+	return pthread_self()==_mainThread;
+}
+
 #endif
 
 
@@ -429,6 +490,7 @@ void bbStartup( int argc,char *argv[],void *dummy1,void *dummy2 ){
 	
 	bbGCStackTop=ebp+28;
 	
+	bbThreadPreStartup();
 	bbGCStartup();
 	bbThreadStartup();
 	
@@ -499,7 +561,39 @@ void bbStartup( int argc,char *argv[],void *dummy1,void *dummy2 ){
 
 //	bbThreadStartup();
 	bbGCStartup();
+
+#elif __HAIKU__
+
+	#include <kernel/image.h>
+
+	bbThreadPreStartup();
+	bbGCStartup();
+	bbThreadStartup();
+
+	char buf[MAXPATHLEN];
+
+	getcwd( buf,MAXPATHLEN );
+	bbLaunchDir=bbStringFromUTF8String( buf );
+	
+	image_info info;
+	int cookie;
+	get_next_image_info(B_CURRENT_TEAM, &cookie, &info);
 	
+	snprintf(buf, PATH_MAX, "%s", info.name);
+	char *e;
+	bbAppFile=bbStringFromUTF8String( buf );
+	e=strrchr( buf,'/' );
+	if( e ){
+		*e=0;
+		bbAppDir=bbStringFromUTF8String( buf );
+	}else{
+		bbAppDir=&bbEmptyString;
+	}
+
+	char *d=bbStringToUTF8String( bbAppDir );
+	chdir( d );
+	bbMemFree(d);
+
 #endif
 
 	BBINCREFS( bbLaunchDir );

+ 13 - 3
blitz.mod/blitz_thread.c

@@ -104,6 +104,9 @@ static DWORD WINAPI threadProc( void *p ){
 	return 0;
 }
 
+void bbThreadPreStartup(){
+}
+
 void bbThreadStartup(){
 
 	if( bb_mutex_init( &_bbLock )<0 ) exit(-1);
@@ -218,6 +221,9 @@ void bbThreadUnregister( BBThread * thread ) {
 
 static __thread BBThread * bbThread;
 
+void bbThreadPreStartup(){
+}
+
 void bbThreadStartup() {
 
 	BBThread *thread=GC_MALLOC_UNCOLLECTABLE( sizeof( BBThread ) );
@@ -315,6 +321,8 @@ int bbThreadResume( BBThread *thread ) {
 #define MUTEX_RECURSIVE 2
 #elif __SWITCH__
 #define MUTEX_RECURSIVE 1
+#elif __HAIKU__
+#define MUTEX_RECURSIVE 3
 #endif
 
 pthread_mutexattr_t _bb_mutexattr;
@@ -322,11 +330,13 @@ pthread_mutexattr_t _bb_mutexattr;
 static BBThread *threads;
 static pthread_key_t curThreadTls;
 
-void bbThreadStartup(){
-
+void bbThreadPreStartup(){
 	if( pthread_mutexattr_init( &_bb_mutexattr )<0 ) exit(-1);
 	if( pthread_mutexattr_settype( &_bb_mutexattr,MUTEX_RECURSIVE )<0 ) exit(-1);
-	
+}
+
+void bbThreadStartup(){
+
 	if( pthread_key_create( &curThreadTls,0 )<0 ) exit(-1);
 
 	if( bb_mutex_init( &_bbLock )<0 ) exit(-1);

+ 10 - 0
blitz.mod/blitz_thread.h

@@ -73,6 +73,15 @@ typedef sem_t bb_sem_t;
 #define bb_sem_post sem_post
 #define bb_sem_timed_wait sem_timedwait
 
+#elif __HAIKU__
+#include <semaphore.h>
+typedef sem_t bb_sem_t;
+#define bb_sem_init(SEMPTR,COUNT) (sem_init((SEMPTR),0,(COUNT))>=0)
+#define bb_sem_destroy sem_destroy
+#define bb_sem_wait sem_wait
+#define bb_sem_post sem_post
+#define bb_sem_timed_wait sem_timedwait
+
 #endif
 
 #ifdef _WIN32
@@ -106,6 +115,7 @@ struct BBThread{
 #endif
 };
 
+void bbThreadPreStartup();
 void			bbThreadStartup();
 
 BBThread*		bbThreadCreate( BBThreadProc entry,BBObject *data );

+ 2 - 0
clipboard.mod/clipboard.bmx

@@ -42,6 +42,8 @@ ModuleInfo "CC_OPTS: -DLIBCLIPBOARD_BUILD_WIN32"
 ModuleInfo "CC_OPTS: -DLIBCLIPBOARD_BUILD_X11"
 ?macos
 ModuleInfo "CC_OPTS: -DLIBCLIPBOARD_BUILD_COCOA"
+?haiku
+ModuleInfo "CC_OPTS: -DLIBCLIPBOARD_BUILD_HAIKU"
 ?
 
 '

+ 1 - 1
clipboard.mod/doc/tclipboard_settext.bmx

@@ -8,7 +8,7 @@ Local clipboard:TClipboard = New TClipboard.Create()
 
 ' try to set a new text
 If clipboard.SetText("TEST") Then
-	Print clipboard.Text(clipboard)
+	Print clipboard.Text()
 EndIf
 
 'output:

+ 117 - 0
clipboard.mod/libclipboard/src/clipboard_haiku.cpp

@@ -0,0 +1,117 @@
+
+#include <Clipboard.h>
+
+#include "libclipboard.h"
+
+#ifdef LIBCLIPBOARD_BUILD_HAIKU
+
+extern "C" {
+
+/** Haiku Implementation of the clipboard context **/
+struct clipboard_c {
+	BClipboard * bcb;
+
+    /** malloc **/
+    clipboard_malloc_fn malloc;
+    /** calloc **/
+    clipboard_calloc_fn calloc;
+    /** realloc **/
+    clipboard_realloc_fn realloc;
+    /** free **/
+    clipboard_free_fn free;
+};
+
+LCB_API clipboard_c *LCB_CC clipboard_new(clipboard_opts *cb_opts) {
+	if (!be_app) {
+		return NULL;
+	}
+	
+	clipboard_opts defaults = {};
+	if (cb_opts == NULL) {
+		cb_opts = &defaults;
+	}
+
+	clipboard_calloc_fn calloc_fn = cb_opts->user_calloc_fn ? cb_opts->user_calloc_fn : calloc;
+	clipboard_c *cb = (clipboard_c*)calloc_fn(1, sizeof(clipboard_c));
+	if (cb == NULL) {
+		return NULL;
+	}
+	LCB_SET_ALLOCATORS(cb, cb_opts);
+
+	cb->bcb = new BClipboard("system");
+	
+	return cb;
+}
+
+LCB_API void LCB_CC clipboard_free(clipboard_c *cb) {
+	if (cb == NULL) {
+		return;
+	}
+	
+	delete cb->bcb;
+
+	cb->free(cb);
+}
+
+LCB_API void LCB_CC clipboard_clear(clipboard_c *cb, clipboard_mode mode) {
+    if (cb == NULL || cb->bcb == NULL) {
+        return;
+    }
+
+	cb->bcb->Clear();
+}
+
+LCB_API bool LCB_CC clipboard_set_text_ex(clipboard_c *cb, const char *src, int length, clipboard_mode mode) {
+	if (cb == NULL || src == NULL || length == 0) {
+		return false;
+	}
+
+	if (cb->bcb->Lock()) {
+		cb->bcb->Clear();
+		
+		BMessage *clip = cb->bcb->Data();
+		clip->AddData("text/plain", B_MIME_TYPE, src, length);
+		status_t status = cb->bcb->Commit();
+		
+		cb->bcb->Unlock();
+		
+		return status == B_OK;
+		
+	} else {
+		return false;
+	}
+}
+
+LCB_API char LCB_CC *clipboard_text_ex(clipboard_c *cb, int *length, clipboard_mode mode) {
+	if (cb == NULL) {
+		return NULL;
+	}
+	
+	if (be_clipboard->Lock()) {
+		BMessage *clip = cb->bcb->Data();
+		
+		const char * s;
+		ssize_t len;
+		clip->FindData("text/plain", B_MIME_TYPE, (const void **)&s, &len);
+		
+		char * ret = (char*)cb->malloc(len + 1);
+		if (ret != NULL) {
+			memcpy(ret, s, len);
+			ret[len] = '\0';
+
+			if (length) {
+				*length = len;
+			}
+		}
+		return ret;
+	}
+	return NULL;
+}
+
+LCB_API bool LCB_CC clipboard_has_ownership(clipboard_c *cb, clipboard_mode mode) {
+	return false;
+}
+
+}
+
+#endif /* LIBCLIPBOARD_BUILD_HAIKU */

+ 2 - 0
clipboard.mod/source.bmx

@@ -30,6 +30,8 @@ Import "libclipboard/src/clipboard_win32.c"
 Import "libclipboard/src/clipboard_x11.c"
 ?macos
 Import "libclipboard/src/clipboard_cocoa.m"
+?haiku
+Import "libclipboard/src/clipboard_haiku.cpp"
 ?
 
 Import "glue.c"

+ 1 - 1
glmax2d.mod/glmax2d.bmx

@@ -33,7 +33,7 @@ ModuleInfo "History: Ripped out a bunch of dead code"
 ModuleInfo "History: 1.05 Release"
 ModuleInfo "History: Added checks to prevent invalid textures deletes"
 
-?Not opengles And Not nx And Not raspberrypi
+?Not opengles And Not nx And Not raspberrypi And Not haiku
 
 Import BRL.Max2D
 Import BRL.GLGraphics

+ 37 - 0
platform.mod/haiku_glue.c

@@ -0,0 +1,37 @@
+/*
+ Copyright (c) 2019-2020 Bruce A Henderson
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ 
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ 
+    1. The origin of this software must not be misrepresented; you must not
+    claim that you wrote the original software. If you use this software
+    in a product, an acknowledgment in the product documentation would be
+    appreciated but is not required.
+ 
+    2. Altered source versions must be plainly marked as such, and must not be
+    misrepresented as being the original software.
+ 
+    3. This notice may not be removed or altered from any source
+    distribution.
+*/
+#include <kernel/OS.h>
+#include <sys/utsname.h>
+#include <brl.mod/blitz.mod/blitz.h>
+
+int bmx_os_getproccount() {
+	system_info info;
+	get_system_info(&info);
+	return info.cpu_count;
+}
+
+BBString * bmx_os_gethaikuversion() {
+	struct utsname u;
+	uname(&u);
+	return bbStringFromUTF8String(u.version);
+}

+ 21 - 3
platform.mod/platform.bmx

@@ -45,8 +45,10 @@ Import SDL.SDL
 
 ?win32
 Import "win32_glue.c"
-?Not win32 And Not android
+?Not win32 And Not android And Not haiku
 Import "glue.c"
+?haiku
+Import "haiku_glue.c"
 ?
 
 Private
@@ -68,6 +70,8 @@ Function OSVersion:String()
 	Return MacOSVersion()
 ?win32
 	Return WindowsVersion()
+?haiku
+	Return HaikuVersion()
 ?
 End Function
 
@@ -110,11 +114,12 @@ Function MacOSVersion:String()
 End Function
 
 Private
-?win32
 Extern
+?win32
 	Function bmx_os_getwindowsversion(major:Int Var, minor:Int Var)
+?haiku
+	Function bmx_os_gethaikuversion:String()
 End Extern
-?
 Public
 
 Function WindowsVersion:String()
@@ -133,6 +138,19 @@ Function WindowsVersion:String()
 ?
 End Function
 
+Function HaikuVersion:String()
+?Not haiku
+	Return ""
+?haiku
+	If _version Then
+		Return _version
+	End If
+	
+	_version = bmx_os_gethaikuversion()
+	Return _version
+?
+End Function
+
 Rem
 bbdoc: Returns the number of logical processors available.
 about: Logical processors are the number of physical processors times the number of threads that can run on each.

+ 3 - 0
socket.mod/socket.bmx

@@ -42,6 +42,9 @@ Function ioctl_( socket,opt,buf:Byte Ptr )="ioctl"
 ?nx
 Const FIONREAD=$4004667F
 Function ioctl_( socket,opt,buf:Byte Ptr )="ioctl"
+?haiku
+Const FIONREAD=$be000001
+Function ioctl_( socket,opt,buf:Byte Ptr )="int ioctl(int, unsigned long, BBBYTE*)!"
 ?
 End Extern
 

+ 1 - 1
threads.mod/threads.c

@@ -233,7 +233,7 @@ int threads_TimedWaitCond(pthread_cond_t *cond,bb_mutex_t *mutex, int millisecs)
 
 #endif
 
-#if __linux
+#if __linux || __HAIKU__
 int threads_TimedWaitSemaphore( bb_sem_t *sem, int millisecs ){
 	struct timespec ts;
 	

+ 42 - 0
volumes.mod/haikuglue.cpp

@@ -0,0 +1,42 @@
+/*
+  Copyright (c) 2010-2020 Bruce A Henderson
+
+  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.
+*/
+
+#include <FindDirectory.h>
+#include <Path.h>
+#include <brl.mod/blitz.mod/blitz.h>
+
+extern "C" {
+
+BBString * bmx_volumes_getdir(directory_which which) {
+	BPath path;
+	status_t res = find_directory(which, &path);
+	if (res == 0) {
+		return bbStringFromUTF8String(path.Path());
+	} else {
+		return &bbEmptyString;
+	}
+}
+
+	
+}

+ 170 - 0
volumes.mod/vol_haiku.bmx

@@ -0,0 +1,170 @@
+' Copyright (c) 2007-2020 Bruce A Henderson
+' 
+' 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.
+' 
+SuperStrict
+
+Import brl.LinkedList
+Import Pub.Stdc
+
+Import "main.bmx"
+Import "haikuglue.cpp"
+
+Extern
+	Function bmx_volumes_getdir:String(which:Int)
+End Extern
+
+Global haikuVolume_driver:THaikuVolumeDriver = New THaikuVolumeDriver
+
+Type THaikuVolumeDriver
+
+	Method New()
+		volume_driver = THaikuVolume.Create()
+	End Method
+
+End Type
+
+Type THaikuVolume Extends TVolume
+
+	Field vs:TVolSpace
+
+	Function Create:THaikuVolume()
+		Local this:THaikuVolume = New THaikuVolume
+		
+		Return this
+	End Function
+
+
+	
+	Method ListVolumes:TList() Override
+		Local volumes:TList
+		
+
+		
+		Return volumes
+	End Method
+	
+	Method GetVolumeFreeSpace:Long(vol:String) Override
+	
+	End Method
+	
+	Method GetVolumeSize:Long(vol:String) Override
+	
+	End Method
+
+	Method GetVolumeInfo:TVolume(vol:String) Override
+
+	End Method
+	
+	Method Refresh() Override
+
+	End Method
+	
+	Method GetUserHomeDir:String() Override
+		Return bmx_volumes_getdir(B_USER_DIRECTORY)
+	End Method
+	
+	Method GetUserDesktopDir:String() Override
+		Return bmx_volumes_getdir(B_USER_DIRECTORY)
+	End Method
+	
+	Method GetUserAppDir:String() Override
+		Return bmx_volumes_getdir(B_USER_APPS_DIRECTORY)
+	End Method
+	
+	Method GetUserDocumentsDir:String() Override
+		Return bmx_volumes_getdir(B_USER_DOCUMENTATION_DIRECTORY)
+	End Method
+
+	Method GetCustomDir:String(dirType:Int, flags:Int = 0) Override
+		Return bmx_volumes_getdir(dirType)
+	End Method
+
+End Type
+
+Type TVolSpace
+	Field vol:String	
+	Field _size:Long
+	Field _free:Long
+	
+	Function _create:TVolSpace() {  }
+		Local this:TVolSpace = New TVolSpace
+		
+		'this.vol = vol
+		If this.refresh() <> 0 Then
+			Return Null
+		End If
+
+		Return this
+	End Function
+	
+	Method refresh:Int()
+		'Return bmx_volumes_volspace_refresh(vol, Varptr _size, Varptr _free)
+	End Method
+	
+	Method size:Long()
+		Return _size
+	End Method
+	
+	Method free:Long()
+		Return _free
+	End Method
+End Type
+
+Private
+
+Const B_USER_DIRECTORY:Int = 3000
+Const B_USER_CONFIG_DIRECTORY:Int = 3001
+Const B_USER_ADDONS_DIRECTORY:Int = 3002
+Const B_USER_BOOT_DIRECTORY:Int = 3003
+Const B_USER_FONTS_DIRECTORY:Int = 3004
+Const B_USER_LIB_DIRECTORY:Int = 3005
+Const B_USER_SETTINGS_DIRECTORY:Int = 3006
+Const B_USER_DESKBAR_DIRECTORY:Int = 3007
+Const B_USER_PRINTERS_DIRECTORY:Int = 3008
+Const B_USER_TRANSLATORS_DIRECTORY:Int = 3009
+Const B_USER_MEDIA_NODES_DIRECTORY:Int = 3010
+Const B_USER_SOUNDS_DIRECTORY:Int = 3011
+Const B_USER_DATA_DIRECTORY:Int = 3012
+Const B_USER_CACHE_DIRECTORY:Int = 3013
+Const B_USER_PACKAGES_DIRECTORY:Int = 3014
+Const B_USER_HEADERS_DIRECTORY:Int = 3015
+Const B_USER_NONPACKAGED_DIRECTORY:Int = 3016
+Const B_USER_NONPACKAGED_ADDONS_DIRECTORY:Int = 3017
+Const B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY:Int = 3018
+Const B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY:Int = 3019
+Const B_USER_NONPACKAGED_BIN_DIRECTORY:Int = 3020
+Const B_USER_NONPACKAGED_DATA_DIRECTORY:Int = 3021
+Const B_USER_NONPACKAGED_FONTS_DIRECTORY:Int = 3022
+Const B_USER_NONPACKAGED_SOUNDS_DIRECTORY:Int = 3023
+Const B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY:Int = 3024
+Const B_USER_NONPACKAGED_LIB_DIRECTORY:Int = 3025
+Const B_USER_NONPACKAGED_HEADERS_DIRECTORY:Int = 3026
+Const B_USER_NONPACKAGED_DEVELOP_DIRECTORY:Int = 3027
+Const B_USER_DEVELOP_DIRECTORY:Int = 3028
+Const B_USER_DOCUMENTATION_DIRECTORY:Int = 3029
+Const B_USER_SERVERS_DIRECTORY:Int = 3030
+Const B_USER_APPS_DIRECTORY:Int = 3031
+Const B_USER_BIN_DIRECTORY:Int = 3032
+Const B_USER_PREFERENCES_DIRECTORY:Int = 3033
+Const B_USER_ETC_DIRECTORY:Int = 3034
+Const B_USER_LOG_DIRECTORY:Int = 3035
+Const B_USER_SPOOL_DIRECTORY:Int = 3036
+Const B_USER_VAR_DIRECTORY:Int = 3037
+

+ 5 - 1
volumes.mod/volumes.bmx

@@ -25,11 +25,13 @@ bbdoc: Volumes
 End Rem
 Module BRL.Volumes
 
-ModuleInfo "Version: 1.11"
+ModuleInfo "Version: 1.12"
 ModuleInfo "License: MIT"
 ModuleInfo "Author: Bruce A Henderson"
 ModuleInfo "Copyright: (c) 2006-2020 Bruce A Henderson"
 
+ModuleInfo "History: 1.12"
+ModuleInfo "History: Added Haiku support."
 ModuleInfo "History: 1.11"
 ModuleInfo "History: Fixed Linux home dir extraction."
 ModuleInfo "History: 1.10"
@@ -67,4 +69,6 @@ Import "vol_win.bmx"
 ?macos
 ModuleInfo "CC_OPTS: -D_DARWIN_FEATURE_64_BIT_INODE"
 Import "vol_mac.bmx"
+?linux
+Import "vol_haiku.bmx"
 ?