Merge branch 'master' into sam460ex

This commit is contained in:
François Revol 2012-12-15 02:11:36 +01:00
commit cbabdc1731
129 changed files with 2602 additions and 1262 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/vmware #!/usr/bin/vmware
config.version = "8" config.version = "8"
virtualHW.version = "3" virtualHW.version = "6"
MemAllowAutoScaleDown = "false" MemAllowAutoScaleDown = "false"
MemTrimRate = "-1" MemTrimRate = "-1"

View File

@ -1,6 +1,6 @@
#!/usr/bin/vmware #!/usr/bin/vmware
config.version = "8" config.version = "8"
virtualHW.version = "3" virtualHW.version = "6"
MemAllowAutoScaleDown = "false" MemAllowAutoScaleDown = "false"
MemTrimRate = "-1" MemTrimRate = "-1"

View File

@ -1,6 +1,6 @@
#!/usr/bin/vmware #!/usr/bin/vmware
config.version = "8" config.version = "8"
virtualHW.version = "3" virtualHW.version = "6"
MemAllowAutoScaleDown = "false" MemAllowAutoScaleDown = "false"
MemTrimRate = "-1" MemTrimRate = "-1"

View File

@ -135,13 +135,13 @@ if $(HAIKU_ADD_OPTIONAL_PACKAGES) {
} }
# Prepare the optional build features before parsing the Jamfile tree. # Prepare the optional build features before parsing the Jamfile tree.
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalBuildFeatures ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
# Include packages that are required by all images. # Include packages that are required by all images.
AddOptionalHaikuImagePackages MandatoryPackages ; AddOptionalHaikuImagePackages MandatoryPackages ;
# If enabled, make sure that OpenSSL is added to the image. # If enabled, make sure that OpenSSL is added to the image.
if $(HAIKU_OPENSSL_ENABLED) { if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
AddOptionalHaikuImagePackages OpenSSL ; AddOptionalHaikuImagePackages OpenSSL ;
} }

View File

@ -56,8 +56,10 @@ This is the Haiku project's development tracker.
{OpenGrok {OpenGrok
--------- ---------
http://haiku.it.su.se:8180/source http://haiku.it.su.se:8180/source
http://grok.bikemonkey.org/source
http://code.metager.de/source/xref/haiku
Graciously provided by <name>. Graciously provided by Janne Johansson, Landon Fuller and MetaGer respectively.
This allows you to quickly and easily search Haiku's source code. This allows you to quickly and easily search Haiku's source code.

View File

@ -1,6 +1,12 @@
# This file contains setup for features that can optionally be used for the # This file contains setup for build features that are not available for all
# build. For features that require downloading a zip file from somewhere it is # architectures/setups or that are optional for the build. For features that
# likely the same file use for an optional package. # require downloading a zip file from somewhere it is likely the same file used
# for an optional package.
# Add the target architecture as a build feature.
EnableBuildFeatures $(HAIKU_ARCH) ;
# Detect a hybrid GCC2/GCC4 image and disable the checks for unavailable GCC4 # Detect a hybrid GCC2/GCC4 image and disable the checks for unavailable GCC4
# packages. (It does not matter if a package was built with either compiler, # packages. (It does not matter if a package was built with either compiler,
@ -56,9 +62,10 @@ if $(HAIKU_BUILD_FEATURE_SSL) {
: extracted-openssl : extracted-openssl
] ; ] ;
HAIKU_OPENSSL_ENABLED = 1 ;
HAIKU_OPENSSL_HEADERS HAIKU_OPENSSL_HEADERS
= [ FDirName $(HAIKU_OPENSSL_DIR) common include ] ; = [ FDirName $(HAIKU_OPENSSL_DIR) common include ] ;
EnableBuildFeatures openssl ;
} }
} }
@ -72,7 +79,7 @@ HAIKU_ICU_PPC_PACKAGE = icu-4.8.1-ppc-2011-08-20.zip ;
HAIKU_ICU_ARM_PACKAGE = icu-4.8.1.1-arm-2012-11-21.zip ; HAIKU_ICU_ARM_PACKAGE = icu-4.8.1.1-arm-2012-11-21.zip ;
HAIKU_ICU_X86_64_PACKAGE = icu-4.8.1.1-x86_64-2012-07-30.zip ; HAIKU_ICU_X86_64_PACKAGE = icu-4.8.1.1-x86_64-2012-07-30.zip ;
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = arm || $(TARGET_ARCH) = x86_64 { if $(TARGET_ARCH) in arm ppc x86 x86_64 {
local icu_package ; local icu_package ;
if $(TARGET_ARCH) = ppc { if $(TARGET_ARCH) = ppc {
icu_package = $(HAIKU_ICU_PPC_PACKAGE) ; icu_package = $(HAIKU_ICU_PPC_PACKAGE) ;
@ -140,6 +147,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = arm || $(TAR
HAIKU_ICU_HEADERS HAIKU_ICU_HEADERS
= [ FDirName $(HAIKU_ICU_DEVEL_DIR) develop headers 3rdparty ] ; = [ FDirName $(HAIKU_ICU_DEVEL_DIR) develop headers 3rdparty ] ;
EnableBuildFeatures icu ;
} else { } else {
Echo "ICU not available for $(TARGET_ARCH)" ; Echo "ICU not available for $(TARGET_ARCH)" ;
} }
@ -184,6 +193,8 @@ if $(HAIKU_BUILD_FEATURE_CLUCENE) {
HAIKU_CLUCENE_HEADERS HAIKU_CLUCENE_HEADERS
= [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ; = [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ;
EnableBuildFeatures clucene ;
} }
} }
@ -206,6 +217,8 @@ if $(TARGET_ARCH) = x86 {
HAIKU_GLU_LIBS = [ ExtractArchive $(HAIKU_GLU_DIR) HAIKU_GLU_LIBS = [ ExtractArchive $(HAIKU_GLU_DIR)
: system/lib/libGLU.a : $(zipFile) : extracted-glu ] ; : system/lib/libGLU.a : $(zipFile) : extracted-glu ] ;
HAIKU_GLU_HEADERS = [ FDirName $(HAIKU_GLU_DIR) develop headers os opengl ] ; HAIKU_GLU_HEADERS = [ FDirName $(HAIKU_GLU_DIR) develop headers os opengl ] ;
EnableBuildFeatures glu ;
} else { } else {
Echo "GLU not yet available on $(TARGET_ARCH)" ; Echo "GLU not yet available on $(TARGET_ARCH)" ;
} }
@ -247,6 +260,7 @@ if $(TARGET_ARCH) = x86 {
Depends $(HAIKU_MESA_HEADERS_DEPENDENCY) : $(HAIKU_GLU_HEADERS_DEPENDENCY) ; Depends $(HAIKU_MESA_HEADERS_DEPENDENCY) : $(HAIKU_GLU_HEADERS_DEPENDENCY) ;
Depends $(HAIKU_MESA_LIBS) : $(HAIKU_GLU_LIBS) ; Depends $(HAIKU_MESA_LIBS) : $(HAIKU_GLU_LIBS) ;
EnableBuildFeatures mesa ;
} else { } else {
Echo "Mesa 3D rendering support not available on $(TARGET_ARCH)" ; Echo "Mesa 3D rendering support not available on $(TARGET_ARCH)" ;
} }
@ -369,6 +383,7 @@ if $(TARGET_ARCH) = x86 {
HAIKU_LIBOGG_HEADERS = [ FDirName $(HAIKU_LIBOGG_DIR) common include ] ; HAIKU_LIBOGG_HEADERS = [ FDirName $(HAIKU_LIBOGG_DIR) common include ] ;
HAIKU_LIBVPX_HEADERS = [ FDirName $(HAIKU_LIBVPX_DIR) common include ] ; HAIKU_LIBVPX_HEADERS = [ FDirName $(HAIKU_LIBVPX_DIR) common include ] ;
EnableBuildFeatures ffmpeg ;
} else { } else {
Echo "FFMpeg support not available on $(TARGET_ARCH)" ; Echo "FFMpeg support not available on $(TARGET_ARCH)" ;
} }
@ -401,6 +416,7 @@ if $(TARGET_ARCH) = x86 {
HAIKU_MIKMOD_HEADERS = [ FDirName $(HAIKU_MIKMOD_DIR) common include ] ; HAIKU_MIKMOD_HEADERS = [ FDirName $(HAIKU_MIKMOD_DIR) common include ] ;
EnableBuildFeatures mikmod ;
} else { } else {
Echo "MikMod support not available on $(TARGET_ARCH)" ; Echo "MikMod support not available on $(TARGET_ARCH)" ;
} }
@ -448,6 +464,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
HAIKU_FREETYPE_HEADERS = [ FDirName $(HAIKU_FREETYPE_DIR) develop HAIKU_FREETYPE_HEADERS = [ FDirName $(HAIKU_FREETYPE_DIR) develop
headers 3rdparty ] [ FDirName $(HAIKU_FREETYPE_DIR) develop headers 3rdparty ] [ FDirName $(HAIKU_FREETYPE_DIR) develop
headers 3rdparty freetype2 ] ; headers 3rdparty freetype2 ] ;
EnableBuildFeatures freetype ;
} else { } else {
Echo "Freetype support not available on $(TARGET_ARCH)" ; Echo "Freetype support not available on $(TARGET_ARCH)" ;
} }
@ -492,6 +510,8 @@ if $(HAIKU_BUILD_FEATURE_TAGLIB) {
HAIKU_TAGLIB_HEADERS HAIKU_TAGLIB_HEADERS
= [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ; = [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ;
EnableBuildFeatures taglib ;
} }
} }
@ -535,6 +555,8 @@ if $(HAIKU_BUILD_FEATURE_WEBKIT) {
] ; ] ;
HAIKU_WEBKIT_HEADERS = [ FDirName $(HAIKU_WEBKIT_DIR) include ] ; HAIKU_WEBKIT_HEADERS = [ FDirName $(HAIKU_WEBKIT_DIR) include ] ;
EnableBuildFeatures webkit ;
} }
} }
@ -578,13 +600,15 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
HAIKU_LIBPNG_CURRENT_LINK = libpng15.so.15 ; HAIKU_LIBPNG_CURRENT_LINK = libpng15.so.15 ;
HAIKU_LIBPNG_HEADERS = [ FDirName $(HAIKU_LIBPNG_DIR) common include ] ; HAIKU_LIBPNG_HEADERS = [ FDirName $(HAIKU_LIBPNG_DIR) common include ] ;
EnableBuildFeatures libpng ;
} else { } else {
Echo "libpng support not available on $(TARGET_ARCH)" ; Echo "libpng support not available on $(TARGET_ARCH)" ;
} }
# jpeg # jpeg
local jpegBaseURL = $(baseURL)/lib ; local jpegBaseURL = $(baseURL)/lib ;
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(TARGET_ARCH) = arm { if $(TARGET_ARCH) in arm ppc x86 x86_64 {
if $(TARGET_ARCH) = arm { if $(TARGET_ARCH) = arm {
HAIKU_JPEG_FILE = jpeg-8d-arm-2012-11-21.zip ; HAIKU_JPEG_FILE = jpeg-8d-arm-2012-11-21.zip ;
} else if $(TARGET_ARCH) = ppc { } else if $(TARGET_ARCH) = ppc {
@ -622,6 +646,8 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
HAIKU_JPEG_CURRENT_LINK = libjpeg.so.8 ; HAIKU_JPEG_CURRENT_LINK = libjpeg.so.8 ;
HAIKU_JPEG_HEADERS = [ FDirName $(HAIKU_JPEG_DIR) common include ] ; HAIKU_JPEG_HEADERS = [ FDirName $(HAIKU_JPEG_DIR) common include ] ;
EnableBuildFeatures libjpeg ;
} else { } else {
Echo "jpeg support not available on $(TARGET_ARCH)" ; Echo "jpeg support not available on $(TARGET_ARCH)" ;
} }
@ -666,6 +692,23 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(
HAIKU_ZLIB_CURRENT_LINK = libz.so.1 ; HAIKU_ZLIB_CURRENT_LINK = libz.so.1 ;
HAIKU_ZLIB_HEADERS = [ FDirName $(HAIKU_ZLIB_DIR) common include ] ; HAIKU_ZLIB_HEADERS = [ FDirName $(HAIKU_ZLIB_DIR) common include ] ;
EnableBuildFeatures zlib ;
} else { } else {
Echo "zlib support not available on $(TARGET_ARCH)" ; Echo "zlib support not available on $(TARGET_ARCH)" ;
} }
# GPL add-ons
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
EnableBuildFeatures gpl ;
}
# ATA vs. IDE
#HACK: remove when old ide code is removed!
if $(HAIKU_ATA_STACK) = 1 {
EnableBuildFeatures ata ;
} else {
EnableBuildFeatures ide ;
}

View File

@ -1,32 +1,8 @@
# This file defines what ends up in the floppy boot image and it executes the # This file defines what ends up in the floppy boot image and it executes the
# rules building the image. # rules building the image.
local X86_ONLY = ;
local PPC_ONLY = ;
local ARM_ONLY = ;
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
X86_ONLY = "" ;
} else if $(TARGET_ARCH) = ppc {
X86_ONLY = ;
} else if $(TARGET_ARCH) = m68k {
X86_ONLY = ;
} else if $(TARGET_ARCH) = arm {
ARM_ONLY = "" ;
}
local GPL_ONLY = ;
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
GPL_ONLY = "" ;
}
#HACK: remove when old ide code is removed! #HACK: remove when old ide code is removed!
local ATA_ONLY = ;
local IDE_ONLY = ;
if $(HAIKU_ATA_STACK) = 1 {
ATA_ONLY = "" ;
} else {
IDE_ONLY = "" ;
}
local NET_BOOT = 0 ; local NET_BOOT = 0 ;
local USB_BOOT = 1 ; local USB_BOOT = 1 ;
@ -49,9 +25,10 @@ if $(NET_BOOT) = 1 {
; ;
} }
SYSTEM_ADD_ONS_BUS_MANAGERS = $(X86_ONLY)acpi $(ATA_ONLY)ata config_manager dpc pci SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
$(IDE_ONLY)ide $(X86_ONLY)isa scsi $(USB_ONLY)usb acpi@x86 ata@ata config_manager dpc pci
; ide@ide isa@x86 scsi $(USB_ONLY)usb
] ;
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ;
@ -87,11 +64,11 @@ if $(TARGET_ARCH) = x86_64 {
if $(HAIKU_ATA_STACK) = 1 { if $(HAIKU_ATA_STACK) = 1 {
AddFilesToFloppyBootArchive system add-ons kernel busses ata AddFilesToFloppyBootArchive system add-ons kernel busses ata
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata : generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
it8211 ; it8211 ;
} else { } else {
AddFilesToFloppyBootArchive system add-ons kernel busses ide AddFilesToFloppyBootArchive system add-ons kernel busses ide
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata : generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
it8211 ; it8211 ;
} }
@ -101,11 +78,11 @@ if $(TARGET_ARCH) = x86_64 {
AddFilesToFloppyBootArchive system add-ons kernel file_systems AddFilesToFloppyBootArchive system add-ons kernel file_systems
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToFloppyBootArchive system add-ons kernel generic AddFilesToFloppyBootArchive system add-ons kernel generic
: $(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph ; : ata_adapter@ata ide_adapter@ide locked_pool scsi_periph ;
AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems
: intel session ; : intel session ;
AddFilesToFloppyBootArchive system add-ons kernel interrupt_controllers AddFilesToFloppyBootArchive system add-ons kernel interrupt_controllers
: $(PPC_ONLY)openpic ; : openpic@ppc ;
if $(USB_BOOT) = 1 { if $(USB_BOOT) = 1 {
AddFilesToFloppyBootArchive system add-ons kernel busses usb AddFilesToFloppyBootArchive system add-ons kernel busses usb
@ -118,7 +95,7 @@ if $(TARGET_ARCH) = x86_64 {
# drivers # drivers
AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ; AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ;
AddNewDriversToFloppyBootArchive disk : $(ARM_ONLY)norflash ; AddNewDriversToFloppyBootArchive disk : norflash@arm ;
if $(USB_BOOT) = 1 { if $(USB_BOOT) = 1 {
AddDriversToFloppyBootArchive disk usb : usb_disk ; AddDriversToFloppyBootArchive disk usb : usb_disk ;
} }
@ -166,13 +143,13 @@ if $(TARGET_ARCH) = x86_64 {
} else { } else {
AddBootModuleSymlinksToFloppyBootArchive AddBootModuleSymlinksToFloppyBootArchive
$(SYSTEM_ADD_ONS_BUS_MANAGERS) $(SYSTEM_ADD_ONS_BUS_MANAGERS)
$(PPC_ONLY)openpic openpic@ppc
$(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph ata_adapter@ata ide_adapter@ide locked_pool scsi_periph
$(X86_ONLY)generic_x86 generic_x86@x86
ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata ahci generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
it8211 it8211
$(USB_ONLY)<usb>uhci $(USB_ONLY)<usb>ohci $(USB_ONLY)<usb>ehci $(USB_ONLY)<usb>uhci $(USB_ONLY)<usb>ohci $(USB_ONLY)<usb>ehci
scsi_cd scsi_disk $(USB_ONLY)usb_disk $(ARM_ONLY)norflash scsi_cd scsi_disk $(USB_ONLY)usb_disk norflash@arm
intel session intel session
$(SYSTEM_ADD_ONS_FILE_SYSTEMS) $(SYSTEM_ADD_ONS_FILE_SYSTEMS)
$(BOOT_ADD_ONS_NET) $(BOOT_ADD_ONS_NET)

View File

@ -5,26 +5,13 @@
# This is only temporary while x86_64 is still a work in progress, so I can # This is only temporary while x86_64 is still a work in progress, so I can
# easily add things to the image as I port them. # easily add things to the image as I port them.
local GPL_ONLY = ;
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
GPL_ONLY = "" ;
}
#HACK: remove when old ide code is removed!
local ATA_ONLY = ;
local IDE_ONLY = ;
if $(HAIKU_ATA_STACK) = 1 {
ATA_ONLY = "" ;
} else {
IDE_ONLY = "" ;
}
SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr checkfs SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr checkfs
chgrp chmod chown chroot cksum clear clockconfig cmp collectcatkeys comm chgrp chmod chown chroot cksum clear clockconfig cmp collectcatkeys comm
compress copyattr cp csplit cut date dd diff diff3 dircolors dirname df du compress copyattr cp csplit cut date dd diff diff3 dircolors dirname df du
dumpcatalog echo eject env error expand expr factor false find finddir dumpcatalog echo eject env error expand expr factor false find finddir
fmt fold fortune gawk gdb gzip gzexe getlimits grep groups head hostname id fmt fold fortune ftp gawk gdb gzip gzexe getlimits grep groups head hostname
ifconfig <bin>install isvolume join kernel_debugger kill less lessecho id ifconfig <bin>install isvolume join kernel_debugger kill less lessecho
lesskey link linkcatkeys listdev ln locale locate logger logname ls lesskey link linkcatkeys listdev ln locale locate logger logname ls
makebootable md5sum mimeset mkdir mkfifo mkfs mktemp mount mountvolume makebootable md5sum mimeset mkdir mkfifo mkfs mktemp mount mountvolume
mv nl nohup notify nproc od paste patch pathchk ping pr printenv printf mv nl nohup notify nproc od paste patch pathchk ping pr printenv printf
@ -47,8 +34,8 @@ SYSTEM_PREFERENCES = Appearance Backgrounds <preference>Deskbar FileTypes
SYSTEM_DEMOS = Sudoku ; SYSTEM_DEMOS = Sudoku ;
SYSTEM_LIBS = libbe.so libbnetapi.so libdebug.so libmedia.so libnetwork.so SYSTEM_LIBS = libbe.so libbsd.so libbnetapi.so libdebug.so libmedia.so
<revisioned>libroot.so libroot-addon-icu.so libnetwork.so <revisioned>libroot.so libroot-addon-icu.so
libtextencoding.so libtiff.so libtracker.so libtranslation.so libtextencoding.so libtiff.so libtracker.so libtranslation.so
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
; ;
@ -85,8 +72,9 @@ SYSTEM_ADD_ONS_DRIVERS_NET = 3com atheros813x ar81xx attansic_l1 attansic_l2
via_rhine wb840 via_rhine wb840
; ;
SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci ps2 isa scsi config_manager SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
usb ; ata@ata pci ps2 isa scsi config_manager usb
] ;
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ;
# modules # modules
@ -107,7 +95,7 @@ AddFilesToHaikuImage system add-ons kernel debugger
AddFilesToHaikuImage system add-ons kernel file_systems AddFilesToHaikuImage system add-ons kernel file_systems
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToHaikuImage system add-ons kernel generic AddFilesToHaikuImage system add-ons kernel generic
: $(ATA_ONLY)ata_adapter bios dpc locked_pool scsi_periph <module>tty ; : ata_adapter@ata bios dpc locked_pool scsi_periph <module>tty ;
AddFilesToHaikuImage system add-ons kernel partitioning_systems AddFilesToHaikuImage system add-ons kernel partitioning_systems
: intel session ; : intel session ;
@ -174,7 +162,7 @@ AddFilesToHaikuImage system bin : install-wifi-firmwares.sh ;
# Add the files to be used by installoptionalpackage. # Add the files to be used by installoptionalpackage.
AddDirectoryToHaikuImage common data optional-packages ; AddDirectoryToHaikuImage common data optional-packages ;
local optional-pkg-files = OptionalBuildFeatures OptionalPackageDependencies local optional-pkg-files = BuildFeatures OptionalPackageDependencies
OptionalPackages OptionalLibPackages ; OptionalPackages OptionalLibPackages ;
for name in $(optional-pkg-files) { for name in $(optional-pkg-files) {
local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ; local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ;
@ -358,7 +346,7 @@ AddFilesToHaikuImage system : haiku_loader ;
# boot module links # boot module links
AddBootModuleSymlinksToHaikuImage AddBootModuleSymlinksToHaikuImage
$(ATA_ONLY)ata pci config_manager dpc scsi usb $(ATA_ONLY)ata_adapter ata@ata pci config_manager dpc scsi usb ata_adapter@ata
locked_pool scsi_periph ahci generic_ide_pci legacy_sata locked_pool scsi_periph ahci generic_ide_pci legacy_sata
<usb>uhci <usb>ohci <usb>ehci <usb>uhci <usb>ohci <usb>ehci
scsi_cd scsi_disk usb_disk scsi_cd scsi_disk usb_disk

View File

@ -2,35 +2,9 @@
# installation directory) and it executes the rules building the image # installation directory) and it executes the rules building the image
# (respectively installing the files in the installation directory). # (respectively installing the files in the installation directory).
local X86_ONLY = ;
local PPC_ONLY = ;
local M68K_ONLY = ;
local ARM_ONLY = ;
if $(TARGET_ARCH) = x86 {
X86_ONLY = "" ;
} else if $(TARGET_ARCH) = ppc {
PPC_ONLY = "" ;
} else if $(TARGET_ARCH) = m68k {
M68K_ONLY = "" ;
} else if $(TARGET_ARCH) = arm {
ARM_ONLY = "" ;
}
local GPL_ONLY = ; SYSTEM_BIN = [ FFilterByBuildFeatures
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 { "[" addattr alert arp base64 basename bash bc beep bfsinfo
GPL_ONLY = "" ;
}
#HACK: remove when old ide code is removed!
local ATA_ONLY = ;
local IDE_ONLY = ;
if $(HAIKU_ATA_STACK) = 1 {
ATA_ONLY = "" ;
} else {
IDE_ONLY = "" ;
}
SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo
cal cat catattr checkfs checkitout chgrp chmod chop chown chroot cksum clear cal cat catattr checkfs checkitout chgrp chmod chop chown chroot cksum clear
clockconfig cmp collectcatkeys comm compress copyattr CortexAddOnHost cp clockconfig cmp collectcatkeys comm compress copyattr CortexAddOnHost cp
csplit cut date dc dd desklink df diff diff3 dircolors dirname csplit cut date dc dd desklink df diff diff3 dircolors dirname
@ -38,10 +12,10 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo
echo eject env error expand expr echo eject env error expand expr
factor false fdinfo ffm filepanel find finddir fmt fold fortune frcode factor false fdinfo ffm filepanel find finddir fmt fold fortune frcode
ftp ftpd funzip fwcontrol ftp ftpd funzip fwcontrol
gawk $(X86_ONLY)gdb getlimits grep groups gzip gzexe gawk gdb@x86 getlimits grep groups gzip gzexe
hd head hey hostname hd head hey hostname
id ident ifconfig <bin>install installsound iroster isvolume id ident ifconfig <bin>install installsound iroster isvolume
$(IDE_ONLY)ideinfo $(IDE_ONLY)idestatus ideinfo@ide idestatus@ide
join kernel_debugger keymap kill join kernel_debugger keymap kill
less lessecho lesskey link linkcatkeys listarea listattr listimage listdev less lessecho lesskey link linkcatkeys listarea listattr listimage listdev
listport listres listsem listusb ln locale locate logger login logname ls listport listres listsem listusb ln locale locate logger login logname ls
@ -64,38 +38,41 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bfsinfo
uname unchop unexpand unmount uniq unlink unrar unshar unzip unzipsfx uname unchop unexpand unmount uniq unlink unrar unshar unzip unzipsfx
<bin>updatedb uptime urlwrapper useradd uudecode uuencode <bin>updatedb uptime urlwrapper useradd uudecode uuencode
vdir version vmstat vdir version vmstat
waitfor watch wc wget whoami $(X86_ONLY)writembr xargs xres yes waitfor watch wc wget whoami writembr@x86 xargs xres yes
zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
; ] ;
SYSTEM_APPS = AboutSystem ActivityMonitor $(X86_ONLY)BootManager CharacterMap SYSTEM_APPS = [ FFilterByBuildFeatures
AboutSystem ActivityMonitor BootManager@x86 CharacterMap
CodyCam DeskCalc Devices DiskProbe DiskUsage DriveSetup CDPlayer Expander CodyCam DeskCalc Devices DiskProbe DiskUsage DriveSetup CDPlayer Expander
$(X86_ONLY)GLInfo Icon-O-Matic Installer LaunchBox Magnify Mail GLInfo@x86 Icon-O-Matic Installer LaunchBox Magnify Mail
MediaConverter MediaPlayer MidiPlayer NetworkStatus PackageInstaller People MediaConverter MediaPlayer MidiPlayer NetworkStatus PackageInstaller People
PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder
StyledEdit Terminal TextSearch TV WebWatch Workspaces StyledEdit Terminal TextSearch TV WebWatch Workspaces
; ] ;
SYSTEM_PREFERENCES = Appearance Backgrounds CPUFrequency DataTranslations SYSTEM_PREFERENCES = [ FFilterByBuildFeatures
Appearance Backgrounds CPUFrequency DataTranslations
<preference>Deskbar E-mail FileTypes Keyboard Keymap Locale Media <preference>Deskbar E-mail FileTypes Keyboard Keymap Locale Media
Mouse Network Notifications Printers Screen ScreenSaver Mouse Network Notifications Printers Screen ScreenSaver
Shortcuts Sounds Time Touchpad <preference>Tracker VirtualMemory Shortcuts Sounds Time Touchpad <preference>Tracker VirtualMemory
; ] ;
SYSTEM_DEMOS = BSnow Chart Clock Cortex FontDemo $(X86_ONLY)GLTeapot SYSTEM_DEMOS = [ FFilterByBuildFeatures
$(HAIKU_INCLUDE_TRADEMARKS)$(X86_ONLY)Haiku3d Mandelbrot OverlayImage Pairs BSnow Chart Clock Cortex FontDemo GLTeapot@x86
$(HAIKU_INCLUDE_TRADEMARKS)Haiku3d@x86 Mandelbrot OverlayImage Pairs
Playground Pulse Sudoku Playground Pulse Sudoku
; ] ;
SYSTEM_LIBS = SYSTEM_LIBS = [ FFilterByBuildFeatures
libbe.so libbsd.so libbnetapi.so libbe.so libbsd.so libbnetapi.so
libdebug.so libdevice.so libdebug.so libdevice.so
libgame.so $(X86_ONLY)libGL.so $(X86_ONLY)libglut.so libgame.so libGL.so@x86 libglut.so@x86
libgnu.so libmail.so libmedia.so libmidi.so libmidi2.so libgnu.so libmail.so libmedia.so libmidi.so libmidi2.so
libnetwork.so libnetwork.so
<revisioned>libroot.so libroot-addon-icu.so <revisioned>libroot.so libroot-addon-icu.so
libscreensaver.so libscreensaver.so
libtextencoding.so libtiff.so libtracker.so libtranslation.so libtextencoding.so libtiff.so libtracker.so libtranslation.so
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
; ] ;
PRIVATE_SYSTEM_LIBS = PRIVATE_SYSTEM_LIBS = [ FFilterByBuildFeatures
$(HAIKU_JPEG_CURRENT_LIB) $(HAIKU_JPEG_CURRENT_LIB)
$(HAIKU_LIBPNG_CURRENT_LIB) $(HAIKU_LIBPNG_CURRENT_LIB)
$(HAIKU_ZLIB_CURRENT_LIB) $(HAIKU_ZLIB_CURRENT_LIB)
@ -103,11 +80,13 @@ PRIVATE_SYSTEM_LIBS =
libalm.so libalm.so
libfluidsynth.so libfluidsynth.so
libilmimf.so libilmimf.so
; ] ;
SYSTEM_SERVERS = app_server cddb_daemon debug_server input_server mail_daemon SYSTEM_SERVERS = [ FFilterByBuildFeatures
app_server cddb_daemon debug_server input_server mail_daemon
media_addon_server media_server midi_server mount_server net_server media_addon_server media_server midi_server mount_server net_server
notification_server power_daemon print_server print_addon_server registrar syslog_daemon notification_server power_daemon print_server print_addon_server registrar
; syslog_daemon
] ;
SYSTEM_NETWORK_DEVICES = ethernet loopback ; SYSTEM_NETWORK_DEVICES = ethernet loopback ;
SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
@ -115,17 +94,14 @@ SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
#SYSTEM_NETWORK_PPP = ipcp modem pap pppoe ; #SYSTEM_NETWORK_PPP = ipcp modem pap pppoe ;
SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix icmp6 ipv6 ; SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix icmp6 ipv6 ;
SYSTEM_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant SYSTEM_ADD_ONS_ACCELERANTS = [ FFilterByBuildFeatures
$(X86_ONLY)nvidia.accelerant $(X86_ONLY)matrox.accelerant x86 @{
$(X86_ONLY)neomagic.accelerant $(X86_ONLY)intel_extreme.accelerant 3dfx.accelerant ati.accelerant matrox.accelerant neomagic.accelerant
$(X86_ONLY)s3.accelerant $(X86_ONLY)vesa.accelerant nvidia.accelerant intel_810.accelerant intel_extreme.accelerant
$(X86_ONLY)ati.accelerant radeon.accelerant radeon_hd.accelerant s3.accelerant vesa.accelerant
$(X86_ONLY)3dfx.accelerant #via.accelerant vmware.accelerant
$(X86_ONLY)radeon_hd.accelerant }@ # x86
$(X86_ONLY)intel_810.accelerant ] ;
#$(X86_ONLY)via.accelerant
#$(X86_ONLY)vmware.accelerant
;
SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator
HVIFTranslator ICOTranslator JPEGTranslator JPEG2000Translator HVIFTranslator ICOTranslator JPEGTranslator JPEG2000Translator
PCXTranslator PNGTranslator PPMTranslator PCXTranslator PNGTranslator PPMTranslator
@ -133,9 +109,10 @@ SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator
TIFFTranslator WebPTranslator WonderBrushTranslator ICNSTranslator TIFFTranslator WebPTranslator WonderBrushTranslator ICNSTranslator
; ;
SYSTEM_ADD_ONS_LOCALE_CATALOGS = <catalog-addon>plaintext ; SYSTEM_ADD_ONS_LOCALE_CATALOGS = <catalog-addon>plaintext ;
SYSTEM_ADD_ONS_MEDIA = cortex_audioadapter.media_addon SYSTEM_ADD_ONS_MEDIA = [ FFilterByBuildFeatures
cortex_audioadapter.media_addon
cortex_flanger.media_addon cortex_flanger.media_addon
$(X86_ONLY)dvb.media_addon dvb.media_addon@x86
hmulti_audio.media_addon hmulti_audio.media_addon
mixer.media_addon mixer.media_addon
opensound.media_addon opensound.media_addon
@ -147,8 +124,10 @@ SYSTEM_ADD_ONS_MEDIA = cortex_audioadapter.media_addon
#legacy.media_addon #legacy.media_addon
equalizer.media_addon equalizer.media_addon
vst_host.media_addon vst_host.media_addon
; ] ;
SYSTEM_ADD_ONS_MEDIA_PLUGINS = $(X86_ONLY)ffmpeg raw_decoder ; SYSTEM_ADD_ONS_MEDIA_PLUGINS = [ FFilterByBuildFeatures
ffmpeg@ffmpeg raw_decoder
] ;
SYSTEM_ADD_ONS_PRINT = SYSTEM_ADD_ONS_PRINT =
Canon\ LIPS3\ Compatible Canon\ LIPS3\ Compatible
Canon\ LIPS4\ Compatible Canon\ LIPS4\ Compatible
@ -163,40 +142,45 @@ SYSTEM_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR
# Parallel\ Port # Parallel\ Port
Print\ To\ File Serial\ Port USB\ Port Print\ To\ File Serial\ Port USB\ Port
; ;
SYSTEM_ADD_ONS_SCREENSAVERS = Butterfly DebugNow $(X86_ONLY)Flurry SYSTEM_ADD_ONS_SCREENSAVERS = [ FFilterByBuildFeatures
$(X86_ONLY)GLife $(HAIKU_INCLUDE_TRADEMARKS)Haiku Icons IFS Leaves Butterfly DebugNow Flurry@x86
Message Spider ; GLife@x86 $(HAIKU_INCLUDE_TRADEMARKS)Haiku Icons IFS Leaves
Message Spider
] ;
SYSTEM_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ice1712 sis7018 ; SYSTEM_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ice1712 sis7018 ;
SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia usb_audio ; SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia usb_audio ;
SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = [ FFilterByBuildFeatures
$(X86_ONLY)neomagic $(X86_ONLY)matrox $(X86_ONLY)intel_extreme x86 @{
$(X86_ONLY)s3 $(X86_ONLY)vesa #$(X86_ONLY)via #$(X86_ONLY)vmware ati 3dfx intel_810 intel_extreme matrox neomagic nvidia radeon radeon_hd
$(X86_ONLY)ati $(X86_ONLY)3dfx $(X86_ONLY)radeon_hd s3 vesa #via vmware
$(X86_ONLY)intel_810 }@ # x86
; ] ;
SYSTEM_ADD_ONS_DRIVERS_MIDI = emuxki ice1712 usb_midi ; SYSTEM_ADD_ONS_DRIVERS_MIDI = emuxki ice1712 usb_midi ;
SYSTEM_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)atheros813x SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
$(X86_ONLY)ar81xx $(X86_ONLY)attansic_l1 $(X86_ONLY)attansic_l2 x86 @{
$(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x $(X86_ONLY)dec21xxx etherpci 3com atheros813x ar81xx attansic_l1 attansic_l2 broadcom440x
$(X86_ONLY)ipro100 $(X86_ONLY)ipro1000 $(X86_ONLY)jmicron2x0 broadcom570x dec21xxx ipro100 ipro1000 jmicron2x0 marvell_yukon nforce
$(X86_ONLY)marvell_yukon $(X86_ONLY)nforce $(X86_ONLY)pcnet pegasus pcnet rtl8139 rtl81xx sis19x syskonnect via_rhine vt612x
$(X86_ONLY)rtl8139 $(X86_ONLY)rtl81xx $(X86_ONLY)sis19x sis900 }@ # x86
$(X86_ONLY)syskonnect usb_davicom usb_asix usb_ecm $(X86_ONLY)via_rhine
$(X86_ONLY)vt612x wb840 etherpci pegasus sis900 usb_davicom usb_asix usb_ecm wb840
# WLAN drivers # WLAN drivers
$(X86_ONLY)aironetwifi $(X86_ONLY)atheroswifi $(X86_ONLY)broadcom43xx x86 @{
$(X86_ONLY)iprowifi2100 $(X86_ONLY)iprowifi2200 $(X86_ONLY)iprowifi3945 aironetwifi atheroswifi broadcom43xx
$(X86_ONLY)iprowifi4965 $(X86_ONLY)marvell88w8363 $(X86_ONLY)marvell88w8335 iprowifi2100 iprowifi2200 iprowifi3945
$(X86_ONLY)ralink2860 $(X86_ONLY)ralinkwifi $(X86_ONLY)wavelanwifi iprowifi4965 marvell88w8363 marvell88w8335
ralink2860 ralinkwifi wavelanwifi
}@ # x86
# WWAN drivers # WWAN drivers
#$(GPL_ONLY)usb_beceemwmx #usb_beceemwmx@gpl
; ] ;
SYSTEM_ADD_ONS_DRIVERS_POWER = $(X86_ONLY)acpi_button ; SYSTEM_ADD_ONS_DRIVERS_POWER = [ FFilterByBuildFeatures acpi_button@x86 ] ;
SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci $(X86_ONLY)ps2 $(X86_ONLY)isa SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
$(IDE_ONLY)ide scsi config_manager agp_gart usb firewire $(X86_ONLY)acpi ata@ata pci ps2@x86 isa@x86
; ide@ide scsi config_manager agp_gart usb firewire acpi@x86
] ;
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs btrfs cdda exfat ext2 fat iso9660 nfs SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs btrfs cdda exfat ext2 fat iso9660 nfs
attribute_overlay write_overlay ntfs reiserfs udf googlefs ; attribute_overlay write_overlay ntfs reiserfs udf googlefs ;
@ -223,16 +207,14 @@ for driver in $(SYSTEM_ADD_ONS_DRIVERS_NET) {
AddFilesToHaikuImage system add-ons kernel bus_managers AddFilesToHaikuImage system add-ons kernel bus_managers
: $(SYSTEM_ADD_ONS_BUS_MANAGERS) ; : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
AddFilesToHaikuImage system add-ons kernel busses agp_gart AddFilesToHaikuImage system add-ons kernel busses agp_gart
: $(X86_ONLY)<agp_gart>intel ; : <agp_gart>intel@x86 ;
if $(HAIKU_ATA_STACK) = 1 { if $(HAIKU_ATA_STACK) = 1 {
AddFilesToHaikuImage system add-ons kernel busses ata AddFilesToHaikuImage system add-ons kernel busses ata
: generic_ide_pci it8211 legacy_sata silicon_image_3112 : generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
$(X86_ONLY)ide_isa ;
} else { } else {
AddFilesToHaikuImage system add-ons kernel busses ide AddFilesToHaikuImage system add-ons kernel busses ide
: generic_ide_pci it8211 legacy_sata silicon_image_3112 : generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
$(X86_ONLY)ide_isa ;
} }
AddFilesToHaikuImage system add-ons kernel busses scsi AddFilesToHaikuImage system add-ons kernel busses scsi
@ -241,18 +223,18 @@ AddFilesToHaikuImage system add-ons kernel busses usb
: <usb>uhci <usb>ohci <usb>ehci ; : <usb>uhci <usb>ohci <usb>ehci ;
AddFilesToHaikuImage system add-ons kernel console : vga_text ; AddFilesToHaikuImage system add-ons kernel console : vga_text ;
AddFilesToHaikuImage system add-ons kernel debugger AddFilesToHaikuImage system add-ons kernel debugger
: <kdebug>demangle $(X86_ONLY)<kdebug>disasm <kdebug>hangman : <kdebug>demangle <kdebug>disasm@x86 <kdebug>hangman
<kdebug>invalidate_on_exit <kdebug>usb_keyboard <kdebug>qrencode <kdebug>invalidate_on_exit <kdebug>usb_keyboard <kdebug>qrencode
<kdebug>run_on_exit ; <kdebug>run_on_exit ;
AddFilesToHaikuImage system add-ons kernel file_systems AddFilesToHaikuImage system add-ons kernel file_systems
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToHaikuImage system add-ons kernel generic AddFilesToHaikuImage system add-ons kernel generic
: $(ATA_ONLY)ata_adapter $(X86_ONLY)bios dpc $(IDE_ONLY)ide_adapter : ata_adapter@ata bios@x86 dpc ide_adapter@ide
locked_pool mpu401 scsi_periph <module>tty ; #$(X86_ONLY)cpuidle ; locked_pool mpu401 scsi_periph <module>tty ; #cpuidle@x86 ;
AddFilesToHaikuImage system add-ons kernel partitioning_systems AddFilesToHaikuImage system add-ons kernel partitioning_systems
: amiga_rdb apple efi_gpt intel session ; : amiga_rdb apple efi_gpt intel session ;
AddFilesToHaikuImage system add-ons kernel interrupt_controllers AddFilesToHaikuImage system add-ons kernel interrupt_controllers
: $(PPC_ONLY)openpic ; : openpic@ppc ;
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
AddFilesToHaikuImage system add-ons kernel cpu : generic_x86 ; AddFilesToHaikuImage system add-ons kernel cpu : generic_x86 ;
@ -260,9 +242,9 @@ if $(TARGET_ARCH) = x86 {
# drivers # drivers
AddNewDriversToHaikuImage disk scsi : scsi_cd scsi_disk ; AddNewDriversToHaikuImage disk scsi : scsi_cd scsi_disk ;
AddNewDriversToHaikuImage power : $(X86_ONLY)enhanced_speedstep ; AddNewDriversToHaikuImage power : enhanced_speedstep@x86 ;
AddNewDriversToHaikuImage power : $(X86_ONLY)acpi_battery ; AddNewDriversToHaikuImage power : acpi_battery@x86 ;
#AddNewDriversToHaikuImage power : $(X86_ONLY)x86_cpuidle ; #AddNewDriversToHaikuImage power : x86_cpuidle@x86 ;
# legacy drivers # legacy drivers
AddDriversToHaikuImage : console dprintf null AddDriversToHaikuImage : console dprintf null
@ -271,7 +253,7 @@ AddDriversToHaikuImage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ;
AddDriversToHaikuImage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ; AddDriversToHaikuImage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ;
AddDriversToHaikuImage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ; AddDriversToHaikuImage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ;
AddDriversToHaikuImage bus : usb_raw fw_raw ; AddDriversToHaikuImage bus : usb_raw fw_raw ;
AddDriversToHaikuImage disk floppy : $(X86_ONLY)pc_floppy ; AddDriversToHaikuImage disk floppy : pc_floppy@x86 ;
AddDriversToHaikuImage disk usb : usb_disk ; AddDriversToHaikuImage disk usb : usb_disk ;
AddDriversToHaikuImage disk usb : usb_floppy ; AddDriversToHaikuImage disk usb : usb_floppy ;
AddDriversToHaikuImage printer usb : usb_printer ; AddDriversToHaikuImage printer usb : usb_printer ;
@ -393,7 +375,7 @@ AddSymlinkToHaikuImage home Desktop
# Add the files to be used by installoptionalpackage. # Add the files to be used by installoptionalpackage.
AddDirectoryToHaikuImage common data optional-packages ; AddDirectoryToHaikuImage common data optional-packages ;
local optional-pkg-files = OptionalBuildFeatures OptionalPackageDependencies local optional-pkg-files = BuildFeatures OptionalPackageDependencies
OptionalPackages OptionalLibPackages ; OptionalPackages OptionalLibPackages ;
for name in $(optional-pkg-files) { for name in $(optional-pkg-files) {
local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ; local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ;
@ -622,12 +604,12 @@ AddFilesToHaikuImage system : haiku_loader ;
# boot module links # boot module links
AddBootModuleSymlinksToHaikuImage AddBootModuleSymlinksToHaikuImage
$(X86_ONLY)acpi $(ATA_ONLY)ata pci $(X86_ONLY)isa config_manager dpc acpi@x86 ata@ata pci isa@x86 config_manager dpc
$(IDE_ONLY)ide scsi usb ide@ide scsi usb
$(PPC_ONLY)openpic openpic@ppc
$(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph ata_adapter@ata ide_adapter@ide locked_pool scsi_periph
ahci generic_ide_pci it8211 legacy_sata silicon_image_3112 ahci generic_ide_pci it8211 legacy_sata silicon_image_3112
$(X86_ONLY)ide_isa ide_isa@x86
<usb>uhci <usb>ohci <usb>ehci <usb>uhci <usb>ohci <usb>ehci
scsi_cd scsi_disk usb_disk scsi_cd scsi_disk usb_disk
efi_gpt efi_gpt

View File

@ -96,6 +96,62 @@ rule FSplitPath
return $(components) ; return $(components) ;
} }
rule FSetConditionsHold conditions : set
{
# FSetConditionsHold <conditions> : <set> ;
# Checks whether the conditions <conditions> are satisfied by the list of
# elements <set> and returns a respective result (if so: "1", if not: empty
# list). The conditions are satisfied when <conditions> is not empty and
# * none of the negative conditions it contains hold and
# * if <conditions> contains any positive conditions, at least one one of
# those holds.
# A positive condition is an element not starting with a "!". It holds when
# the element is contained in <set>.
# A negative condition is an element that starts with a "!". It holds when
# the string resulting from removing the leading "!" is not contained in
# <set>.
#
# <conditions> - The list of conditions.
# <set> - The elements against which the conditions are tested.
#
# Examples:
# For set { a b c } the following conditions hold:
# { a }, { a d }, { !d }, { !d !e }, { a !d }, { b !e !f }
# The following conditions don't hold:
# { }, { d }, { d e }, { !a }, { !a b }, { !d e } { a b !c !d }
local hasPositive ;
local hasNegative ;
local positiveMatch ;
local condition ;
for condition in $(conditions) {
switch $(condition) {
case !* :
{
hasNegative = 1 ;
condition = [ Match "!(.*)" : $(condition) ] ;
if $(condition) in $(set) {
return ;
}
}
case * :
{
hasPositive = 1 ;
if $(condition) in $(set) {
positiveMatch = 1 ;
}
}
}
}
if $(hasPositive) {
return $(positiveMatch) ;
}
return $(hasNegative) ;
}
rule SetPlatformCompatibilityFlagVariables rule SetPlatformCompatibilityFlagVariables
{ {
# SetPlatformCompatibilityFlagVariables <platform var> : <var prefix> # SetPlatformCompatibilityFlagVariables <platform var> : <var prefix>

View File

@ -160,6 +160,8 @@ rule AddFilesToContainer container : directoryTokens : targets : destName
: $(directoryTokens) ] ; : $(directoryTokens) ] ;
local containerGrist = [ on $(container) return $(HAIKU_CONTAINER_GRIST) ] ; local containerGrist = [ on $(container) return $(HAIKU_CONTAINER_GRIST) ] ;
targets = [ FFilterByBuildFeatures $(targets) ] ;
# If the image shall only be updated, we filter out all targets not marked # If the image shall only be updated, we filter out all targets not marked
# accordingly. # accordingly.
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
@ -303,6 +305,8 @@ rule AddDriversToContainer container : relativeDirectoryTokens : targets
local directoryTokens = system add-ons kernel drivers dev local directoryTokens = system add-ons kernel drivers dev
$(relativeDirectoryTokens) ; $(relativeDirectoryTokens) ;
targets = [ FFilterByBuildFeatures $(targets) ] ;
AddFilesToContainer $(container) : system add-ons kernel drivers bin AddFilesToContainer $(container) : system add-ons kernel drivers bin
: $(targets) ; : $(targets) ;
@ -335,6 +339,8 @@ rule AddNewDriversToContainer container : relativeDirectoryTokens
local directoryTokens = system add-ons kernel drivers local directoryTokens = system add-ons kernel drivers
$(relativeDirectoryTokens) ; $(relativeDirectoryTokens) ;
targets = [ FFilterByBuildFeatures $(targets) ] ;
AddFilesToContainer $(container) : $(directoryTokens) AddFilesToContainer $(container) : $(directoryTokens)
: $(targets) ; : $(targets) ;
} }
@ -350,6 +356,8 @@ rule AddBootModuleSymlinksToContainer container : targets
return ; return ;
} }
targets = [ FFilterByBuildFeatures $(targets) ] ;
# add the symlinks # add the symlinks
local installTargetsVar local installTargetsVar
= [ on $(container) return $(HAIKU_INSTALL_TARGETS_VAR) ] ; = [ on $(container) return $(HAIKU_INSTALL_TARGETS_VAR) ] ;
@ -1272,6 +1280,8 @@ rule AddLibrariesToHaikuHybridImage directory : libs
# Installs libraries with the appropriate links onto the image. # Installs libraries with the appropriate links onto the image.
# #
libs = [ FFilterByBuildFeatures $(libs) ] ;
local lib ; local lib ;
for lib in $(libs) { for lib in $(libs) {
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ; local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;

View File

@ -417,3 +417,166 @@ rule DefineBuildProfile name : type : path {
return 1 ; return 1 ;
} }
# pragma mark - Build Features
rule FIsBuildFeatureEnabled feature
{
# FIsBuildFeatureEnabled <feature> ;
# Returns whether the given build feature <feature> is enabled (if so: "1",
# if not: empty list).
#
# <feature> - The name of the build feature (all lower case).
if $(feature) in $(HAIKU_BUILD_FEATURES) {
return 1 ;
}
return ;
}
rule FMatchesBuildFeatures specification
{
# FMatchesBuildFeatures <specification> ;
# Returns whether the given build feature specification <specification>
# holds. <specification> consists of positive and negative build feature
# conditions. Conditions can be individual list elements and multiple
# conditions can be joined, separated by ",", in a single list element. The
# effect is the same; they are considered as single set of conditions.
# A positive condition does not start with a "!". It holds when the build
# feature named by the element is enabled.
# A negative condition starts with a "!". It holds when the build feature
# named by the string resulting from removing the leading "!" is not
# enabled.
# <specification> holds when it is not empty and
# * none of the negative conditions it contains hold and
# * if it contains any positive conditions, at least one one of them holds.
#
# <specification> - The build feature specification. A list of individual
# conditions or conditions joined by ",".
local splitSpecification ;
local element ;
for element in $(specification) {
splitSpecification += [ FSplitString $(element) : "," ] ;
}
return [ FSetConditionsHold $(splitSpecification)
: $(HAIKU_BUILD_FEATURES) ] ;
}
rule FFilterByBuildFeatures list
{
# FFilterByBuildFeatures <list> ;
# Filters the list annotated by build feature specifications and returns the
# resulting list. The list can be annotated in two different ways:
# * A single list element can be annotated by appending "@<specification>"
# to it, with <specification> being a build feature specification (a
# single comma-separated string). The element appears in the resulting
# list, only if <specification> holds.
# * A sublist can be annotated by enclosing it in "<specification> @{" (two
# separate list elements) and "}@", with <specification> being a build
# feature specification (a single comma-separated string). The enclosed
# sublist appears in the resulting list, only if <specification> holds.
# The sublist annotations can be nested. The annotations themselves don't
# appear in the resulting list.
#
# <list> - A list annotated with build feature specifications.
local filteredList ;
# Since we must look ahead one element to be able to decide whether an
# element is a regular list element or a features specification for a
# subsequent "@{". Hence we always process an element other than "@{" and
# "}@" in the next iteration. We append a dummy element to the list so we
# don't need special handling for the last element.
local evaluationStack = 1 ;
local previousElement ;
local element ;
for element in $(list) dummy {
local stackTop = $(evaluationStack[1]) ;
local processElement = $(previousElement) ;
switch $(element) {
case }@ :
{
# Pop the topmost specificaton off the stack.
evaluationStack = $(evaluationStack[2-]) ;
if ! $(evaluationStack) {
Exit "FFilterByBuildFeatures: Unbalanced @( in: " $(list) ;
}
processElement = $(previousElement) ;
previousElement = ;
}
case @{ :
{
if ! $(previousElement) {
Exit "FFilterByBuildFeatures: No feature specification"
"after )@ in: " $(list) ;
}
if $(evaluationStack[1]) = 1
&& [ FMatchesBuildFeatures $(previousElement) ] {
evaluationStack = 1 $(evaluationStack) ;
} else {
evaluationStack = 0 $(evaluationStack) ;
}
processElement = ;
previousElement = ;
}
case * :
{
processElement = $(previousElement) ;
previousElement = $(element) ;
}
}
if $(processElement) && $(stackTop) = 1 {
local splitElement = [ Match "(.*)@([^@]*)" : $(processElement) ] ;
if $(splitElement) {
if [ FMatchesBuildFeatures $(splitElement[2]) ] {
filteredList += $(splitElement[1]) ;
}
} else {
filteredList += $(processElement) ;
}
}
}
if $(evaluationStack[2-]) {
Exit "FFilterByBuildFeatures: Unbalanced )@ in: " $(list) ;
}
return $(filteredList) ;
}
rule EnableBuildFeatures features : specification
{
# EnableBuildFeatures <features> : <specification> ;
# Enables the build features <features>, if the build features specification
# <specification> holds. If <specification> is omitted, the features are
# enabled unconditionally.
# The rule enables a build feature by adding its given lower case name to
# the build variable HAIKU_BUILD_FEATURES and defining a build variable
# HAIKU_BUILD_FEATURE_<FEATURE>_ENABLED (<FEATURE> being the upper case name
# of the build feature) to "1".
#
# <features> - A list of build feature names (lower case).
# <specification> - An optional build features specification (cf.
# FMatchesBuildFeatures).
if ! $(specification)
|| [ FMatchesBuildFeatures $(specification)
: $(HAIKU_BUILD_FEATURES) ] {
local feature ;
for feature in $(features) {
HAIKU_BUILD_FEATURES += $(feature) ;
HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED = 1 ;
}
}
}

View File

@ -1,43 +1,28 @@
# This file defines what ends up in the network boot archive and it executes the # This file defines what ends up in the network boot archive and it executes the
# rules building the archive. # rules building the archive.
local X86_ONLY = ;
local PPC_ONLY = ;
if $(TARGET_ARCH) = x86 {
X86_ONLY = "" ;
} else if $(TARGET_ARCH) = ppc {
X86_ONLY = ;
}
local GPL_ONLY = ;
if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
GPL_ONLY = "" ;
}
#HACK: remove when old ide code is removed!
local ATA_ONLY = ;
local IDE_ONLY = ;
if $(HAIKU_ATA_STACK) = 1 {
ATA_ONLY = "" ;
} else {
IDE_ONLY = "" ;
}
SYSTEM_NETWORK_DEVICES = ethernet loopback ; SYSTEM_NETWORK_DEVICES = ethernet loopback ;
SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame ; SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame ;
SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix ; SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix ;
SYSTEM_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com $(X86_ONLY)atheros813x SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
$(X86_ONLY)broadcom440x $(X86_ONLY)broadcom570x etherpci $(X86_ONLY)ipro1000 x86 @{
pegasus $(X86_ONLY)rtl8139 rtl8169 $(X86_ONLY)rtl81xx sis900 3com atheros813x
$(X86_ONLY)via_rhine wb840 $(X86_ONLY)ipro100 $(X86_ONLY)nforce broadcom440x broadcom570x ipro1000
rtl8139 rtl81xx
via_rhine ipro100 nforce
marvell_yukon syskonnect
attansic_l2 ar81xx
}@ # x86
etherpci pegasus rtl8169 sis900 usb_ecm wb840
#vlance #vlance
$(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect ] ;
$(X86_ONLY)attansic_l2 $(X86_ONLY)ar81xx usb_ecm SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
; pci isa@x86 ide@ide ata@ata
SYSTEM_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)isa $(IDE_ONLY)ide $(ATA_ONLY)ata
scsi config_manager agp_gart scsi config_manager agp_gart
; ] ;
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ;
@ -45,20 +30,20 @@ SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ;
AddFilesToNetBootArchive system add-ons kernel bus_managers AddFilesToNetBootArchive system add-ons kernel bus_managers
: $(SYSTEM_ADD_ONS_BUS_MANAGERS) ; : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
AddFilesToNetBootArchive system add-ons kernel busses agp_gart AddFilesToNetBootArchive system add-ons kernel busses agp_gart
: $(X86_ONLY)<agp_gart>intel ; : <agp_gart>intel@x86 ;
AddFilesToNetBootArchive system add-ons kernel busses ide AddFilesToNetBootArchive system add-ons kernel busses ide
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; : generic_ide_pci ide_isa@x86 silicon_image_3112 ;
AddFilesToNetBootArchive system add-ons kernel busses scsi AddFilesToNetBootArchive system add-ons kernel busses scsi
: ahci ; : ahci ;
AddFilesToNetBootArchive system add-ons kernel console : vga_text ; AddFilesToNetBootArchive system add-ons kernel console : vga_text ;
AddFilesToNetBootArchive system add-ons kernel file_systems AddFilesToNetBootArchive system add-ons kernel file_systems
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToNetBootArchive system add-ons kernel generic AddFilesToNetBootArchive system add-ons kernel generic
: $(IDE_ONLY)ide_adapter $(ATA_ONLY)ata_adapter locked_pool scsi_periph ; : ide_adapter@ide ata_adapter@ata locked_pool scsi_periph ;
AddFilesToNetBootArchive system add-ons kernel partitioning_systems AddFilesToNetBootArchive system add-ons kernel partitioning_systems
: intel session ; : intel session ;
AddFilesToNetBootArchive system add-ons kernel interrupt_controllers AddFilesToNetBootArchive system add-ons kernel interrupt_controllers
: $(PPC_ONLY)openpic ; : openpic@ppc ;
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
AddFilesToNetBootArchive system add-ons kernel cpu : generic_x86 ; AddFilesToNetBootArchive system add-ons kernel cpu : generic_x86 ;
@ -96,12 +81,12 @@ AddFilesToNetBootArchive system add-ons kernel network protocols
# boot module links # boot module links
AddBootModuleSymlinksToNetBootArchive AddBootModuleSymlinksToNetBootArchive
$(SYSTEM_ADD_ONS_BUS_MANAGERS) $(SYSTEM_ADD_ONS_BUS_MANAGERS)
ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ahci generic_ide_pci ide_isa@x86 silicon_image_3112
$(SYSTEM_ADD_ONS_FILE_SYSTEMS) $(SYSTEM_ADD_ONS_FILE_SYSTEMS)
$(IDE_ONLY)ide_adapter $(ATA_ONLY)ata_adapter locked_pool scsi_periph ide_adapter@ide ata_adapter@ata locked_pool scsi_periph
intel session intel session
$(PPC_ONLY)openpic openpic@ppc
$(X86_ONLY)generic_x86 generic_x86@x86
# nbd # nbd
remote_disk remote_disk
$(SYSTEM_ADD_ONS_DRIVERS_NET) $(SYSTEM_ADD_ONS_DRIVERS_NET)

View File

@ -124,36 +124,50 @@ if [ IsOptionalHaikuImagePackageAdded ABI-compliance-checker ] {
# APR # APR
if [ IsOptionalHaikuImagePackageAdded APR ] { if [ IsOptionalHaikuImagePackageAdded APR ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package APR available for $(TARGET_ARCH)" ; if $(HAIKU_GCC_VERSION[1]) >= 4 {
} else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage
apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
: : true ;
}
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip apr-1.4.6-x86_64-2012-12-08.zip
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc4-2012-08-30.zip : $(baseURL)/apr-1.4.6-x86_64-2012-12-08.zip
: : true ; : : true ;
} else { } else {
InstallOptionalHaikuImagePackage Echo "No optional package APR available for $(TARGET_ARCH)" ;
apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/apr-1.4.6-r1a4-x86-gcc2-2012-08-27.zip
: : true ;
} }
} }
# APR-util # APR-util
if [ IsOptionalHaikuImagePackageAdded APR-util ] { if [ IsOptionalHaikuImagePackageAdded APR-util ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package APR-util available for $(TARGET_ARCH)" ; if $(HAIKU_GCC_VERSION[1]) >= 4 {
} else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage
apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
: : true ;
}
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip apr-util-1.4.1-x86_64-2012-12-08.zip
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc4-2012-08-30.zip : $(baseURL)/apr-util-1.4.1-x86_64-2012-12-08.zip
: : true ; : : true ;
} else { } else {
InstallOptionalHaikuImagePackage Echo "No optional package APR-util available for $(TARGET_ARCH)" ;
apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/apr-util-1.4.1-r1a4-x86-gcc2-2012-08-27.zip
: : true ;
} }
} }
@ -410,16 +424,22 @@ if [ IsOptionalHaikuImagePackageAdded Caya ] {
# CCache # CCache
if [ IsOptionalHaikuImagePackageAdded CCache ] { if [ IsOptionalHaikuImagePackageAdded CCache ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package CCache available for $(TARGET_ARCH)" ; if $(HAIKU_GCC_VERSION[1]) >= 4 {
} else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage
ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip ;
} else {
InstallOptionalHaikuImagePackage
ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip ;
}
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip ccache-3.0.1-x86_64-2012-12-08.zip
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc4-2012-08-30.zip ; : $(baseURL)/ccache-3.0.1-x86_64-2012-12-08.zip ;
} else { } else {
InstallOptionalHaikuImagePackage Echo "No optional package CCache available for $(TARGET_ARCH)" ;
ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/ccache-3.0.1-r1a4-x86-gcc2-2012-08-27.zip ;
} }
} }
@ -531,9 +551,7 @@ if [ IsOptionalHaikuImagePackageAdded Colors! ] {
# Ctags # Ctags
if [ IsOptionalHaikuImagePackageAdded Ctags ] { if [ IsOptionalHaikuImagePackageAdded Ctags ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package Ctags available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
ctags-5.8-r1a4-x86-gcc4-2012-08-30.zip ctags-5.8-r1a4-x86-gcc4-2012-08-30.zip
@ -545,6 +563,13 @@ if [ IsOptionalHaikuImagePackageAdded Ctags ] {
: $(baseURL)/ctags-5.8-r1a4-x86-gcc2-2012-09-03.zip : $(baseURL)/ctags-5.8-r1a4-x86-gcc2-2012-09-03.zip
: : true ; : : true ;
} }
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage
ctags-5.8-x86_64-2012-12-08.zip
: $(baseURL)/ctags-5.8-x86_64-2012-12-08.zip
: : true ;
} else {
Echo "No optional package Ctags available for $(TARGET_ARCH)" ;
} }
} }
@ -996,9 +1021,7 @@ if [ IsOptionalHaikuImagePackageAdded Droid ] {
# Expat # Expat
if [ IsOptionalHaikuImagePackageAdded Expat ] { if [ IsOptionalHaikuImagePackageAdded Expat ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package Expat available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
expat-2.0.1-r1a4-x86-gcc4-2012-08-30.zip expat-2.0.1-r1a4-x86-gcc4-2012-08-30.zip
@ -1010,22 +1033,35 @@ if [ IsOptionalHaikuImagePackageAdded Expat ] {
: $(baseURL)/expat-2.0.1-r1a4-x86-gcc2-2012-08-28.zip : $(baseURL)/expat-2.0.1-r1a4-x86-gcc2-2012-08-28.zip
: : true ; : : true ;
} }
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage
expat-2.0.1-x86_64-2012-12-08.zip
: $(baseURL)/expat-2.0.1-x86_64-2012-12-08.zip
: : true ;
} else {
Echo "No optional package Expat available for $(TARGET_ARCH)" ;
} }
} }
# Fastdep # Fastdep
if [ IsOptionalHaikuImagePackageAdded Fastdep ] { if [ IsOptionalHaikuImagePackageAdded Fastdep ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package Fastdep available for $(TARGET_ARCH)" ; if $(HAIKU_GCC_VERSION[1]) >= 4 {
} else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage
fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip ;
} else {
InstallOptionalHaikuImagePackage
fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip ;
}
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip fastdep-0.16-x86_64-2012-12-08.zip
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc4-2012-08-30.zip ; : $(baseURL)/fastdep-0.16-x86_64-2012-12-08.zip ;
} else { } else {
InstallOptionalHaikuImagePackage Echo "No optional package Fastdep available for $(TARGET_ARCH)" ;
fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip
: $(baseURL)/fastdep-0.16-r1a4-x86-gcc2-2012-08-28.zip ;
} }
} }
@ -1117,9 +1153,7 @@ if [ IsOptionalHaikuImagePackageAdded GitDoc ] {
# GPerf # GPerf
if [ IsOptionalHaikuImagePackageAdded GPerf ] { if [ IsOptionalHaikuImagePackageAdded GPerf ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package GPerf available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
gperf-3.0.4-r1a4-x86-gcc4-2012-08-30.zip gperf-3.0.4-r1a4-x86-gcc4-2012-08-30.zip
@ -1131,15 +1165,20 @@ if [ IsOptionalHaikuImagePackageAdded GPerf ] {
: $(baseURL)/gperf-3.0.4-r1a4-x86-gcc2-2012-08-28.zip : $(baseURL)/gperf-3.0.4-r1a4-x86-gcc2-2012-08-28.zip
: : true ; : : true ;
} }
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage
gperf-3.0.4-x86_64-2012-12-08.zip
: $(baseURL)/gperf-3.0.4-x86_64-2012-12-08.zip
: : true ;
} else {
Echo "No optional package GPerf available for $(TARGET_ARCH)" ;
} }
} }
# Groff # Groff
if [ IsOptionalHaikuImagePackageAdded Groff ] { if [ IsOptionalHaikuImagePackageAdded Groff ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package Groff available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
groff-1.20.1-r1a4-x86-gcc4-2012-08-30.zip groff-1.20.1-r1a4-x86-gcc4-2012-08-30.zip
@ -1151,6 +1190,13 @@ if [ IsOptionalHaikuImagePackageAdded Groff ] {
: $(baseURL)/groff-1.20.1-r1a4-x86-gcc2-2012-08-28.zip : $(baseURL)/groff-1.20.1-r1a4-x86-gcc2-2012-08-28.zip
: : true ; : : true ;
} }
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage
groff-1.20.1-x86_64-2012-12-08.zip
: $(baseURL)/groff-1.20.1-x86_64-2012-12-08.zip
: : true ;
} else {
Echo "No optional package Groff available for $(TARGET_ARCH)" ;
} }
} }
@ -1266,9 +1312,7 @@ if [ IsOptionalHaikuImagePackageAdded LGrep ] {
# LibEvent # LibEvent
if [ IsOptionalHaikuImagePackageAdded LibEvent ] { if [ IsOptionalHaikuImagePackageAdded LibEvent ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package LibEvent available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
libevent-2.0.10-r1a4-x86-gcc4-2012-08-30.zip libevent-2.0.10-r1a4-x86-gcc4-2012-08-30.zip
@ -1280,6 +1324,13 @@ if [ IsOptionalHaikuImagePackageAdded LibEvent ] {
: $(baseURL)/libevent-2.0.10-r1a4-x86-gcc2-2012-08-28.zip : $(baseURL)/libevent-2.0.10-r1a4-x86-gcc2-2012-08-28.zip
: : true ; : : true ;
} }
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage
libevent-2.0.10-x86_64-2012-12-08.zip
: $(baseURL)/libevent-2.0.10-x86_64-2012-12-08.zip
: : true ;
} else {
Echo "No optional package LibEvent available for $(TARGET_ARCH)" ;
} }
} }
@ -1334,9 +1385,7 @@ if [ IsOptionalHaikuImagePackageAdded Libmng ] {
# LibXML2 # LibXML2
if [ IsOptionalHaikuImagePackageAdded LibXML2 ] { if [ IsOptionalHaikuImagePackageAdded LibXML2 ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
libxml2-2.8.0-r1a4-x86-gcc4-2012-08-28.zip libxml2-2.8.0-r1a4-x86-gcc4-2012-08-28.zip
@ -1346,6 +1395,12 @@ if [ IsOptionalHaikuImagePackageAdded LibXML2 ] {
libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip
: $(baseURL)/libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip ; : $(baseURL)/libxml2-2.8.0-r1a4-x86-gcc2-2012-08-30.zip ;
} }
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage
libxml2-2.8.0-x86_64-2012-12-08.zip
: $(baseURL)/libxml2-2.8.0-x86_64-2012-12-08.zip ;
} else {
Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ;
} }
} }
@ -1622,23 +1677,29 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] {
# P7zip # P7zip
if [ IsOptionalHaikuImagePackageAdded P7zip ] { if [ IsOptionalHaikuImagePackageAdded P7zip ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
Echo "No optional package P7zip available for $(TARGET_ARCH)" ; if $(TARGET_ARCH) = x86 {
} else { if $(HAIKU_GCC_VERSION[1]) >= 4 {
if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage
p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip ;
} else {
InstallOptionalHaikuImagePackage
p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip ;
}
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip p7zip-9.20.1-x86_64-2012-12-08.zip
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc4-2012-08-30.zip ; : $(baseURL)/p7zip-9.20.1-x86_64-2012-12-08.zip ;
} else {
InstallOptionalHaikuImagePackage
p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/p7zip-9.20.1-r1a4-x86-gcc2-2012-08-29.zip ;
} }
AddExpanderRuleToHaikuImage "application/x-7z-compressed" : .7z AddExpanderRuleToHaikuImage "application/x-7z-compressed" : .7z
: "7za l \\0045s" : "7za l \\0045s"
: "7za x -y \\0045s" : "7za x -y \\0045s"
; ;
} else {
Echo "No optional package P7zip available for $(TARGET_ARCH)" ;
} }
} }
@ -1832,9 +1893,7 @@ if [ IsOptionalHaikuImagePackageAdded Sed ] {
# SQLite # SQLite
if [ IsOptionalHaikuImagePackageAdded SQLite ] { if [ IsOptionalHaikuImagePackageAdded SQLite ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package SQLite available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 { if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
sqlite-3.7.13-r1a4-x86-gcc4-2012-08-30.zip sqlite-3.7.13-r1a4-x86-gcc4-2012-08-30.zip
@ -1844,6 +1903,12 @@ if [ IsOptionalHaikuImagePackageAdded SQLite ] {
sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip ; : $(baseURL)/sqlite-3.7.13-r1a4-x86-gcc2-2012-08-27.zip ;
} }
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage
sqlite-3.7.13-x86_64-2012-12-08.zip
: $(baseURL)/sqlite-3.7.13-x86_64-2012-12-08.zip ;
} else {
Echo "No optional package SQLite available for $(TARGET_ARCH)" ;
} }
} }
@ -2205,15 +2270,21 @@ if [ IsOptionalHaikuImagePackageAdded XZ-Utils ] {
# Yasm # Yasm
if [ IsOptionalHaikuImagePackageAdded Yasm ] { if [ IsOptionalHaikuImagePackageAdded Yasm ] {
if $(TARGET_ARCH) != x86 { if $(TARGET_ARCH) = x86 {
Echo "No optional package Yasm available for $(TARGET_ARCH)" ; if $(HAIKU_GCC_VERSION[1]) >= 4 {
} else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage
yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip ;
} else {
InstallOptionalHaikuImagePackage
yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip ;
}
} else if $(TARGET_ARCH) = x86_64 {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip yasm-1.2.0-x86_64-2012-12-08.zip
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc4-2012-08-29.zip ; : $(baseURL)/yasm-1.2.0-x86_64-2012-12-08.zip ;
} else { } else {
InstallOptionalHaikuImagePackage Echo "No optional package Yasm available for $(TARGET_ARCH)" ;
yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip
: $(baseURL)/yasm-1.2.0-r1a4-x86-gcc2-2012-08-27.zip ;
} }
} }

View File

@ -1,4 +1,4 @@
1 belarusian x-vnd.Haiku-Expander 2398100010 1 belarusian x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Распакаваць Expand ExpanderMenu Распакаваць
Close window when done expanding ExpanderPreferences Закрыць вакно пасля распакоўкі Close window when done expanding ExpanderPreferences Закрыць вакно пасля распакоўкі
Set destination… ExpanderMenu Задаць прызначэнне… Set destination… ExpanderMenu Задаць прызначэнне…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Распакоўваць фай
Creating listing for '%s' ExpanderWindow Стварэнне спіса для '%s' Creating listing for '%s' ExpanderWindow Стварэнне спіса для '%s'
Continue ExpanderWindow Працягваць Continue ExpanderWindow Працягваць
Destination folder ExpanderPreferences Тэчка прызначэння Destination folder ExpanderPreferences Тэчка прызначэння
The destination folder does not exist. ExpanderWindow Тэчка прызначэння не існуе.
Other ExpanderPreferences Іншы Other ExpanderPreferences Іншы
Cancel ExpanderPreferences Адмена Cancel ExpanderPreferences Адмена
Expansion ExpanderPreferences Пашырэньне Expansion ExpanderPreferences Пашырэньне

View File

@ -1,4 +1,4 @@
1 german x-vnd.Haiku-Expander 2398100010 1 german x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Entpacken Expand ExpanderMenu Entpacken
Close window when done expanding ExpanderPreferences Fenster nach dem Entpacken schließen Close window when done expanding ExpanderPreferences Fenster nach dem Entpacken schließen
Set destination… ExpanderMenu Ziel wählen… Set destination… ExpanderMenu Ziel wählen…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Archiv automatisch entpacken
Creating listing for '%s' ExpanderWindow Dateiliste für '%s' wird erstellt Creating listing for '%s' ExpanderWindow Dateiliste für '%s' wird erstellt
Continue ExpanderWindow Fortsetzen Continue ExpanderWindow Fortsetzen
Destination folder ExpanderPreferences Zielordner Destination folder ExpanderPreferences Zielordner
The destination folder does not exist. ExpanderWindow Der Zielordner existiert nicht.
Other ExpanderPreferences Allgemeines Other ExpanderPreferences Allgemeines
Cancel ExpanderPreferences Abbrechen Cancel ExpanderPreferences Abbrechen
Expansion ExpanderPreferences Entpacken Expansion ExpanderPreferences Entpacken

View File

@ -1,4 +1,4 @@
1 greek, modern (1453-) x-vnd.Haiku-Expander 386826896 1 greek, modern (1453-) x-vnd.Haiku-Expander 2566211356
Expand ExpanderMenu Επέκταση Expand ExpanderMenu Επέκταση
Close window when done expanding ExpanderPreferences Κλείσιμο παραθύρου μετά το πέρας Close window when done expanding ExpanderPreferences Κλείσιμο παραθύρου μετά το πέρας
Set destination… ExpanderMenu Ορισμός προορισμού... Set destination… ExpanderMenu Ορισμός προορισμού...
@ -15,7 +15,6 @@ Cancel ExpanderWindow Άκυρο
Automatically expand files ExpanderPreferences Αυτόματη επέκταση αρχείων Automatically expand files ExpanderPreferences Αυτόματη επέκταση αρχείων
Creating listing for '%s' ExpanderWindow Δημιούργησε την καταχώρηση για '%s' Creating listing for '%s' ExpanderWindow Δημιούργησε την καταχώρηση για '%s'
Continue ExpanderWindow Συνέχεια Continue ExpanderWindow Συνέχεια
The destination folder does not exist. ExpanderWindow Ο φάκελος προορισμού δεν υπάρχει.
Cancel ExpanderPreferences Άκυρο Cancel ExpanderPreferences Άκυρο
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Είστε σίγουρος ότι θέλετε να σταματήσετε την επέκταση αυτού του \nαρχείου; Τα επεκταμένα στοιχεία μπορεί να μην είναι ολοκληρωμένα. Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Είστε σίγουρος ότι θέλετε να σταματήσετε την επέκταση αυτού του \nαρχείου; Τα επεκταμένα στοιχεία μπορεί να μην είναι ολοκληρωμένα.
Select DirectoryFilePanel Επιλογή Select DirectoryFilePanel Επιλογή

View File

@ -1,4 +1,4 @@
1 finnish x-vnd.Haiku-Expander 2398100010 1 finnish x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Laajenna Expand ExpanderMenu Laajenna
Close window when done expanding ExpanderPreferences Sulje ikkuna kun laajentaminen on tehty Close window when done expanding ExpanderPreferences Sulje ikkuna kun laajentaminen on tehty
Set destination… ExpanderMenu Aseta kohde… Set destination… ExpanderMenu Aseta kohde…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Laajenna tiedostot automaattises
Creating listing for '%s' ExpanderWindow Luodaan luettelo kohteelle %s Creating listing for '%s' ExpanderWindow Luodaan luettelo kohteelle %s
Continue ExpanderWindow Jatka Continue ExpanderWindow Jatka
Destination folder ExpanderPreferences Kohdekansio Destination folder ExpanderPreferences Kohdekansio
The destination folder does not exist. ExpanderWindow Kohdekansiota ei ole olemassa.
Other ExpanderPreferences Muut Other ExpanderPreferences Muut
Cancel ExpanderPreferences Peru Cancel ExpanderPreferences Peru
Expansion ExpanderPreferences Laajentaminen Expansion ExpanderPreferences Laajentaminen

View File

@ -1,4 +1,4 @@
1 french x-vnd.Haiku-Expander 2398100010 1 french x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Décompresser Expand ExpanderMenu Décompresser
Close window when done expanding ExpanderPreferences Fermer la fenêtre après l'extraction Close window when done expanding ExpanderPreferences Fermer la fenêtre après l'extraction
Set destination… ExpanderMenu Choisir la destination… Set destination… ExpanderMenu Choisir la destination…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Décompresser les fichiers autom
Creating listing for '%s' ExpanderWindow Créer un inventaire pour « %s » Creating listing for '%s' ExpanderWindow Créer un inventaire pour « %s »
Continue ExpanderWindow Continuer Continue ExpanderWindow Continuer
Destination folder ExpanderPreferences Dossier de destination Destination folder ExpanderPreferences Dossier de destination
The destination folder does not exist. ExpanderWindow Le dossier de destination n'existe pas.
Other ExpanderPreferences Autre Other ExpanderPreferences Autre
Cancel ExpanderPreferences Annuler Cancel ExpanderPreferences Annuler
Expansion ExpanderPreferences Décompression Expansion ExpanderPreferences Décompression

View File

@ -1,4 +1,4 @@
1 hindi x-vnd.Haiku-Expander 386826896 1 hindi x-vnd.Haiku-Expander 2566211356
Expand ExpanderMenu विस्तार Expand ExpanderMenu विस्तार
Close window when done expanding ExpanderPreferences विस्तार करने के बाद विंडो बंद करें Close window when done expanding ExpanderPreferences विस्तार करने के बाद विंडो बंद करें
Set destination… ExpanderMenu गंतव्य सेट कीजिए... Set destination… ExpanderMenu गंतव्य सेट कीजिए...
@ -15,7 +15,6 @@ Cancel ExpanderWindow रद्द
Automatically expand files ExpanderPreferences अपने आप फाइलें विस्तार करें Automatically expand files ExpanderPreferences अपने आप फाइलें विस्तार करें
Creating listing for '%s' ExpanderWindow '%s' के लिए सूचीकरण बना रहा है Creating listing for '%s' ExpanderWindow '%s' के लिए सूचीकरण बना रहा है
Continue ExpanderWindow जारी रखें Continue ExpanderWindow जारी रखें
The destination folder does not exist. ExpanderWindow गंतव्य फ़ोल्डर मौजूद नहीं है.
Cancel ExpanderPreferences रद्द करे Cancel ExpanderPreferences रद्द करे
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow आप सुनिश्चित हैं कि आप इस आरकाइव के विस्तार को बंद करना चाहते हैं?\nविस्तारित आइटम सम्भव्तीय पूरे नहीं हो Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow आप सुनिश्चित हैं कि आप इस आरकाइव के विस्तार को बंद करना चाहते हैं?\nविस्तारित आइटम सम्भव्तीय पूरे नहीं हो
Select DirectoryFilePanel चुनें Select DirectoryFilePanel चुनें

View File

@ -1,4 +1,4 @@
1 hungarian x-vnd.Haiku-Expander 2398100010 1 hungarian x-vnd.Haiku-Expander 2603318510
Expand ExpanderMenu Kicsomagol Expand ExpanderMenu Kicsomagol
Close window when done expanding ExpanderPreferences A kicsomagolás végeztével zárja be az ablakot Close window when done expanding ExpanderPreferences A kicsomagolás végeztével zárja be az ablakot
Set destination… ExpanderMenu Célmappa megadása… Set destination… ExpanderMenu Célmappa megadása…
@ -17,12 +17,12 @@ Automatically expand files ExpanderPreferences Fájlok automatikus kicsomagolá
Creating listing for '%s' ExpanderWindow '%s' lista létrehozása Creating listing for '%s' ExpanderWindow '%s' lista létrehozása
Continue ExpanderWindow Folytatás Continue ExpanderWindow Folytatás
Destination folder ExpanderPreferences Célmappa Destination folder ExpanderPreferences Célmappa
The destination folder does not exist. ExpanderWindow A célmappa nem létezik.
Other ExpanderPreferences Egyéb Other ExpanderPreferences Egyéb
Cancel ExpanderPreferences Mégse Cancel ExpanderPreferences Mégse
Expansion ExpanderPreferences Kicsomagolás Expansion ExpanderPreferences Kicsomagolás
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Biztosan le szeretné állítani?\nA kicsomagolás még nem fejeződött be. Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Biztosan le szeretné állítani?\nA kicsomagolás még nem fejeződött be.
Select DirectoryFilePanel Kiválaszt Select DirectoryFilePanel Kiválaszt
Destination folder doesn't exist. Would you like to create it? ExpanderWindow A célmappa nem létezik. Létre szeretné hozni?
Same directory as source (archive) file ExpanderPreferences A mappa amiben a forrásfájl (archívum) van Same directory as source (archive) file ExpanderPreferences A mappa amiben a forrásfájl (archívum) van
Expanding '%s' ExpanderWindow '%s' kicsomagolása Expanding '%s' ExpanderWindow '%s' kicsomagolása
Settings ExpanderMenu Beállítások Settings ExpanderMenu Beállítások
@ -33,6 +33,8 @@ Show contents ExpanderWindow Tartalom megjelenítése
Automatically show contents listing ExpanderPreferences Tartalom listázása automatikusan Automatically show contents listing ExpanderPreferences Tartalom listázása automatikusan
OK ExpanderPreferences Rendben OK ExpanderPreferences Rendben
Leave destination folder path empty ExpanderPreferences Hagyja üresen a célmappa útvonalát Leave destination folder path empty ExpanderPreferences Hagyja üresen a célmappa útvonalát
Failed to create the destination folder. ExpanderWindow Nem sikerült létrehozni a célmappát.
Create ExpanderWindow Létrehozás
The folder was either moved, renamed or not\nsupported. ExpanderWindow A mappa el lett mozgatva, át lett nevezve vagy nem\ntámogatott. The folder was either moved, renamed or not\nsupported. ExpanderWindow A mappa el lett mozgatva, át lett nevezve vagy nem\ntámogatott.
The file doesn't exist ExpanderWindow A fájl nem létezik The file doesn't exist ExpanderWindow A fájl nem létezik
Stop ExpanderMenu Leállítás Stop ExpanderMenu Leállítás

View File

@ -1,4 +1,4 @@
1 japanese x-vnd.Haiku-Expander 2398100010 1 japanese x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu 解凍 Expand ExpanderMenu 解凍
Close window when done expanding ExpanderPreferences 解凍終了後ウィンドウを閉じる Close window when done expanding ExpanderPreferences 解凍終了後ウィンドウを閉じる
Set destination… ExpanderMenu 解凍先を指定… Set destination… ExpanderMenu 解凍先を指定…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences 自動的にファイルを解
Creating listing for '%s' ExpanderWindow '%s' のリストを作成中 Creating listing for '%s' ExpanderWindow '%s' のリストを作成中
Continue ExpanderWindow 続ける Continue ExpanderWindow 続ける
Destination folder ExpanderPreferences 解凍先フォルダー Destination folder ExpanderPreferences 解凍先フォルダー
The destination folder does not exist. ExpanderWindow 解凍先フォルダーは存在しません。
Other ExpanderPreferences その他 Other ExpanderPreferences その他
Cancel ExpanderPreferences キャンセル Cancel ExpanderPreferences キャンセル
Expansion ExpanderPreferences 解凍 Expansion ExpanderPreferences 解凍

View File

@ -1,4 +1,4 @@
1 lithuanian x-vnd.Haiku-Expander 2398100010 1 lithuanian x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Išskleisti Expand ExpanderMenu Išskleisti
Close window when done expanding ExpanderPreferences Viską išskleidus, užverti langą Close window when done expanding ExpanderPreferences Viską išskleidus, užverti langą
Set destination… ExpanderMenu Paskirties vieta… Set destination… ExpanderMenu Paskirties vieta…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automatiškai išskleisti failus
Creating listing for '%s' ExpanderWindow Generuojamas „%s“ turinio sąrašas Creating listing for '%s' ExpanderWindow Generuojamas „%s“ turinio sąrašas
Continue ExpanderWindow Tęsti Continue ExpanderWindow Tęsti
Destination folder ExpanderPreferences Paskirties aplankas Destination folder ExpanderPreferences Paskirties aplankas
The destination folder does not exist. ExpanderWindow Paskirties aplankas neegzistuoja.
Other ExpanderPreferences Kita Other ExpanderPreferences Kita
Cancel ExpanderPreferences Atsisakyti Cancel ExpanderPreferences Atsisakyti
Expansion ExpanderPreferences Išskleidimas Expansion ExpanderPreferences Išskleidimas

View File

@ -1,4 +1,4 @@
1 dutch; flemish x-vnd.Haiku-Expander 2398100010 1 dutch; flemish x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Uitpakken Expand ExpanderMenu Uitpakken
Close window when done expanding ExpanderPreferences Sluit dit venster wanneer het uitpakken klaar is Close window when done expanding ExpanderPreferences Sluit dit venster wanneer het uitpakken klaar is
Set destination… ExpanderMenu Bepaal doel… Set destination… ExpanderMenu Bepaal doel…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Bestanden automatisch uitpakken
Creating listing for '%s' ExpanderWindow Creëren van een overzicht voor '%s' Creating listing for '%s' ExpanderWindow Creëren van een overzicht voor '%s'
Continue ExpanderWindow Doorgaan Continue ExpanderWindow Doorgaan
Destination folder ExpanderPreferences Doelmap Destination folder ExpanderPreferences Doelmap
The destination folder does not exist. ExpanderWindow De doelmap bestaat niet.
Other ExpanderPreferences Andere Other ExpanderPreferences Andere
Cancel ExpanderPreferences Annuleren Cancel ExpanderPreferences Annuleren
Expansion ExpanderPreferences Uitpakken Expansion ExpanderPreferences Uitpakken

View File

@ -1,4 +1,4 @@
1 polish x-vnd.Haiku-Expander 2398100010 1 polish x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Rozpakuj Expand ExpanderMenu Rozpakuj
Close window when done expanding ExpanderPreferences Zamknij okno po zakończeniu rozpakowywania Close window when done expanding ExpanderPreferences Zamknij okno po zakończeniu rozpakowywania
Set destination… ExpanderMenu Wybierz miejsce docelowe… Set destination… ExpanderMenu Wybierz miejsce docelowe…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automatycznie rozpakuj pliki
Creating listing for '%s' ExpanderWindow Tworzenie listy dla '%s' Creating listing for '%s' ExpanderWindow Tworzenie listy dla '%s'
Continue ExpanderWindow Kontynuuj Continue ExpanderWindow Kontynuuj
Destination folder ExpanderPreferences Katalog docelowy Destination folder ExpanderPreferences Katalog docelowy
The destination folder does not exist. ExpanderWindow Folder docelowy nie istnieje.
Other ExpanderPreferences Inne Other ExpanderPreferences Inne
Cancel ExpanderPreferences Anuluj Cancel ExpanderPreferences Anuluj
Expansion ExpanderPreferences Rozpakowywanie Expansion ExpanderPreferences Rozpakowywanie

View File

@ -1,4 +1,4 @@
1 portuguese (brazil) x-vnd.Haiku-Expander 2398100010 1 portuguese (brazil) x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Expandir Expand ExpanderMenu Expandir
Close window when done expanding ExpanderPreferences Fechar a janela quando concluída a expansão Close window when done expanding ExpanderPreferences Fechar a janela quando concluída a expansão
Set destination… ExpanderMenu Selecionar destino… Set destination… ExpanderMenu Selecionar destino…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Expandir arquivos automaticament
Creating listing for '%s' ExpanderWindow Criando lista para '%s' Creating listing for '%s' ExpanderWindow Criando lista para '%s'
Continue ExpanderWindow Continuar Continue ExpanderWindow Continuar
Destination folder ExpanderPreferences Pasta de destino Destination folder ExpanderPreferences Pasta de destino
The destination folder does not exist. ExpanderWindow A pasta de destino não existe.
Other ExpanderPreferences Outro Other ExpanderPreferences Outro
Cancel ExpanderPreferences Cancelar Cancel ExpanderPreferences Cancelar
Expansion ExpanderPreferences Expansão Expansion ExpanderPreferences Expansão

View File

@ -1,4 +1,4 @@
1 romanian x-vnd.Haiku-Expander 386826896 1 romanian x-vnd.Haiku-Expander 2566211356
Expand ExpanderMenu Extinde Expand ExpanderMenu Extinde
Close window when done expanding ExpanderPreferences Închide fereastra atunci când s-a încheiat extinderea Close window when done expanding ExpanderPreferences Închide fereastra atunci când s-a încheiat extinderea
Set destination… ExpanderMenu Setează destinația… Set destination… ExpanderMenu Setează destinația…
@ -15,7 +15,6 @@ Cancel ExpanderWindow Renunță
Automatically expand files ExpanderPreferences Extinde fișiere automat Automatically expand files ExpanderPreferences Extinde fișiere automat
Creating listing for '%s' ExpanderWindow Se creează enumerarea pentru „%s” Creating listing for '%s' ExpanderWindow Se creează enumerarea pentru „%s”
Continue ExpanderWindow Continuă Continue ExpanderWindow Continuă
The destination folder does not exist. ExpanderWindow Dosarul destinație nu există.
Cancel ExpanderPreferences Anulează Cancel ExpanderPreferences Anulează
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ești sigur că vrei să oprești extinderea\nacestei arhive? Elementele dezarhivate pot fi incomplete. Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ești sigur că vrei să oprești extinderea\nacestei arhive? Elementele dezarhivate pot fi incomplete.
Select DirectoryFilePanel Selectează Select DirectoryFilePanel Selectează

View File

@ -1,4 +1,4 @@
1 russian x-vnd.Haiku-Expander 2398100010 1 russian x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Распаковать Expand ExpanderMenu Распаковать
Close window when done expanding ExpanderPreferences Закрывать окно после распаковки Close window when done expanding ExpanderPreferences Закрывать окно после распаковки
Set destination… ExpanderMenu Путь назначения для извлечения… Set destination… ExpanderMenu Путь назначения для извлечения…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Автоматически ра
Creating listing for '%s' ExpanderWindow Создается список файлов для '%s' Creating listing for '%s' ExpanderWindow Создается список файлов для '%s'
Continue ExpanderWindow Продолжить Continue ExpanderWindow Продолжить
Destination folder ExpanderPreferences Путь для извлечения Destination folder ExpanderPreferences Путь для извлечения
The destination folder does not exist. ExpanderWindow Папка назначения не существует.
Other ExpanderPreferences Другое Other ExpanderPreferences Другое
Cancel ExpanderPreferences Отмена Cancel ExpanderPreferences Отмена
Expansion ExpanderPreferences Извлечение Expansion ExpanderPreferences Извлечение

View File

@ -1,4 +1,4 @@
1 slovak x-vnd.Haiku-Expander 2398100010 1 slovak x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Rozbaliť Expand ExpanderMenu Rozbaliť
Close window when done expanding ExpanderPreferences Zatvoriť okno po dokončení rozbaľovania Close window when done expanding ExpanderPreferences Zatvoriť okno po dokončení rozbaľovania
Set destination… ExpanderMenu Nastaviť cieľ… Set destination… ExpanderMenu Nastaviť cieľ…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Automaticky rozbaľovať súbory
Creating listing for '%s' ExpanderWindow Vytvára sa zoznam pre „%s“ Creating listing for '%s' ExpanderWindow Vytvára sa zoznam pre „%s“
Continue ExpanderWindow Pokračovať Continue ExpanderWindow Pokračovať
Destination folder ExpanderPreferences Cieľový priečinok Destination folder ExpanderPreferences Cieľový priečinok
The destination folder does not exist. ExpanderWindow Cieľový priečinok neexistuje.
Other ExpanderPreferences Ďalšie Other ExpanderPreferences Ďalšie
Cancel ExpanderPreferences Zrušiť Cancel ExpanderPreferences Zrušiť
Expansion ExpanderPreferences Rozpínanie Expansion ExpanderPreferences Rozpínanie

View File

@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-Expander 2398100010 1 swedish x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu Expandera Expand ExpanderMenu Expandera
Close window when done expanding ExpanderPreferences Stäng fönstret när expandering är klar Close window when done expanding ExpanderPreferences Stäng fönstret när expandering är klar
Set destination… ExpanderMenu Ange mål… Set destination… ExpanderMenu Ange mål…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences Expandera filer automatiskt
Creating listing for '%s' ExpanderWindow Skapar innehållslista för '%s' Creating listing for '%s' ExpanderWindow Skapar innehållslista för '%s'
Continue ExpanderWindow Fortsätt Continue ExpanderWindow Fortsätt
Destination folder ExpanderPreferences Målmapp Destination folder ExpanderPreferences Målmapp
The destination folder does not exist. ExpanderWindow Målmappen existerar inte.
Other ExpanderPreferences Andra Other ExpanderPreferences Andra
Cancel ExpanderPreferences Avbryt Cancel ExpanderPreferences Avbryt
Expansion ExpanderPreferences Expansion Expansion ExpanderPreferences Expansion

View File

@ -1,4 +1,4 @@
1 ukrainian x-vnd.Haiku-Expander 386826896 1 ukrainian x-vnd.Haiku-Expander 2566211356
Expand ExpanderMenu Розпакувати Expand ExpanderMenu Розпакувати
Close window when done expanding ExpanderPreferences Закрити вікно після розпаковки Close window when done expanding ExpanderPreferences Закрити вікно після розпаковки
Set destination… ExpanderMenu Встановити ціль… Set destination… ExpanderMenu Встановити ціль…
@ -15,7 +15,6 @@ Cancel ExpanderWindow Відмінити
Automatically expand files ExpanderPreferences Автоматично розпакувати файли Automatically expand files ExpanderPreferences Автоматично розпакувати файли
Creating listing for '%s' ExpanderWindow Створення списку для '%s' Creating listing for '%s' ExpanderWindow Створення списку для '%s'
Continue ExpanderWindow Продовжити Continue ExpanderWindow Продовжити
The destination folder does not exist. ExpanderWindow Цільова папка відсутня.
Cancel ExpanderPreferences Відміна Cancel ExpanderPreferences Відміна
Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ви впевнені, що хочете зупинити розпаковку цього архіва? Розпаковка елементів може бути неповною. Are you sure you want to stop expanding this\narchive? The expanded items may not be complete. ExpanderWindow Ви впевнені, що хочете зупинити розпаковку цього архіва? Розпаковка елементів може бути неповною.
Select DirectoryFilePanel Вибрати Select DirectoryFilePanel Вибрати

View File

@ -1,4 +1,4 @@
1 english x-vnd.Haiku-Expander 2398100010 1 english x-vnd.Haiku-Expander 282517174
Expand ExpanderMenu 解压缩 Expand ExpanderMenu 解压缩
Close window when done expanding ExpanderPreferences 完成解压后,关闭窗口。 Close window when done expanding ExpanderPreferences 完成解压后,关闭窗口。
Set destination… ExpanderMenu 目标文件… Set destination… ExpanderMenu 目标文件…
@ -17,7 +17,6 @@ Automatically expand files ExpanderPreferences 自动解压文件
Creating listing for '%s' ExpanderWindow 为 '%s' 创建列表 Creating listing for '%s' ExpanderWindow 为 '%s' 创建列表
Continue ExpanderWindow 继续 Continue ExpanderWindow 继续
Destination folder ExpanderPreferences 目标目录 Destination folder ExpanderPreferences 目标目录
The destination folder does not exist. ExpanderWindow 目标文件夹不存在。
Other ExpanderPreferences 其他 Other ExpanderPreferences 其他
Cancel ExpanderPreferences 取消 Cancel ExpanderPreferences 取消
Expansion ExpanderPreferences 展开 Expansion ExpanderPreferences 展开

View File

@ -1,37 +1,37 @@
1 hungarian x-vnd.Haiku-PowerStatus 3224068645 1 hungarian x-vnd.Haiku-PowerStatus 3224068645
Design capacity low warning: PowerStatus Figyelmeztetés alacsony tervezett kapacitásnál: Design capacity low warning: PowerStatus Figyelmeztetés alacsony tervezett kapacitásnál:
Show percent PowerStatus Százalék megjelenítése Show percent PowerStatus Százalék megjelenítése
Design capacity: PowerStatus Tervezett kapacitás: Design capacity: PowerStatus Tervezett kapacitás:
mW PowerStatus mW mW PowerStatus mW
Type: PowerStatus Típus: Type: PowerStatus Típus:
non-rechargeable PowerStatus Nem újratölthető non-rechargeable PowerStatus Nem újratölthető
Empty battery slot PowerStatus Nincs akku behelyezve Empty battery slot PowerStatus Nincs akku behelyezve
mV PowerStatus mV mV PowerStatus mV
Run in window PowerStatus Futtatás ablakban Run in window PowerStatus Futtatás ablakban
PowerStatus System name Energiaállapot PowerStatus System name Energiaállapot
mWh PowerStatus mWh mWh PowerStatus mWh
Battery info… PowerStatus Akku infó… Battery info… PowerStatus Akku infó…
Damaged battery PowerStatus Sérült akku Damaged battery PowerStatus Sérült akku
Show time PowerStatus Idő kijelzése Show time PowerStatus Idő kijelzése
Last full charge: PowerStatus Utolsó teljes feltöltés: Last full charge: PowerStatus Utolsó teljes feltöltés:
Battery unused PowerStatus Használatlan akku Battery unused PowerStatus Használatlan akku
Extended battery info PowerStatus Bővebb akku információ Extended battery info PowerStatus Bővebb akku információ
mA PowerStatus mA mA PowerStatus mA
Current rate: PowerStatus Jelenlegi gyakoriság: Current rate: PowerStatus Jelenlegi gyakoriság:
discharging PowerStatus használatban discharging PowerStatus használatban
Show text label PowerStatus Szöveges címke megjelenítése Show text label PowerStatus Szöveges címke megjelenítése
About… PowerStatus Névjegy… About… PowerStatus Névjegy…
Model number: PowerStatus Típusszám: Model number: PowerStatus Típusszám:
Install in Deskbar PowerStatus Telepítés az Asztalsávra Install in Deskbar PowerStatus Telepítés az Asztalsávra
mAh PowerStatus mAh mAh PowerStatus mAh
Capacity: PowerStatus Kapacitás: Capacity: PowerStatus Kapacitás:
Battery discharging PowerStatus Akku használatban Battery discharging PowerStatus Akku használatban
Serial number: PowerStatus Szériaszám: Serial number: PowerStatus Szériaszám:
Capacity granularity 1: PowerStatus Kapacitás granularitás 1: Capacity granularity 1: PowerStatus Kapacitás granularitás 1:
OEM info: PowerStatus OEM információk: OEM info: PowerStatus OEM információk:
Design voltage: PowerStatus Tervezett feszültség: Design voltage: PowerStatus Tervezett feszültség:
Battery charging PowerStatus Akku töltődik Battery charging PowerStatus Akku töltődik
Design capacity warning: PowerStatus Tervezett kapacitás figyelmeztetés: Design capacity warning: PowerStatus Tervezett kapacitás figyelmeztetés:
Battery info PowerStatus Akku infó Battery info PowerStatus Akku infó
Quit PowerStatus Kilépés Quit PowerStatus Kilépés
rechargeable PowerStatus újratölthető rechargeable PowerStatus újratölthető
@ -39,6 +39,6 @@ charging PowerStatus töltődik
You can run PowerStatus in a window or install it in the Deskbar. PowerStatus Futatthatja az Energiaállapotot egy ablakban, vagy az Asztalsávra telepítheti azt. You can run PowerStatus in a window or install it in the Deskbar. PowerStatus Futatthatja az Energiaállapotot egy ablakban, vagy az Asztalsávra telepítheti azt.
Power status box PowerStatus Energiaállapot doboza Power status box PowerStatus Energiaállapot doboza
Show status icon PowerStatus Állapotikon megjelenítése Show status icon PowerStatus Állapotikon megjelenítése
Capacity granularity 2: PowerStatus Kapacitás granularitás 2: Capacity granularity 2: PowerStatus Kapacitás granularitás 2:
Technology: PowerStatus Technológia: Technology: PowerStatus Technológia:
no battery PowerStatus nincs akku no battery PowerStatus nincs akku

View File

@ -28,11 +28,11 @@
</p> </p>
<p> <p>
It resides in the first first 1024 bytes of a BFS disk which usually refers to the It resides in the first first 1024 bytes of a BFS disk which usually refers to the
first two sectors of the partition in question. Since the BFS super block is located first two sectors of the partition in question. Since the BFS superblock is located
at byte offset 512, and about 170 bytes large, this section is already reserved, at byte offset 512, and about 170 bytes large, this section is already reserved,
and thus cannot be used by the loader itself.<br> and thus cannot be used by the loader itself.<br>
The MBR only loads the first sector of a partition into memory, so it has to load The MBR only loads the first sector of a partition into memory, so it has to load
the super block (and the rest of its implementation) by itself. the superblock (and the rest of its implementation) by itself.
</p> </p>
<p> <p>
The loader must be able to load the real boot loader from a certain path, and The loader must be able to load the real boot loader from a certain path, and

View File

@ -900,6 +900,7 @@ status_t nv_general_powerup()
break; break;
case 0x029010de: /* Nvidia Geforce 7900 GTX */ case 0x029010de: /* Nvidia Geforce 7900 GTX */
case 0x029110de: /* Nvidia Geforce 7900 GT */ case 0x029110de: /* Nvidia Geforce 7900 GT */
case 0x029210de: /* Nvidia Geforce 7900 GS */
case 0x029310de: /* Nvidia Geforce 7900 GX2 */ case 0x029310de: /* Nvidia Geforce 7900 GX2 */
si->ps.card_type = G71; si->ps.card_type = G71;
si->ps.card_arch = NV40A; si->ps.card_arch = NV40A;

View File

@ -484,14 +484,30 @@ usb_disk_inquiry(device_lun *lun)
return result; return result;
} }
TRACE("peripherial_device_type 0x%02x\n", parameter.peripherial_device_type); TRACE("peripherial_device_type 0x%02x\n",
TRACE("peripherial_qualifier 0x%02x\n", parameter.peripherial_qualifier); parameter.peripherial_device_type);
TRACE("removable_medium %s\n", parameter.removable_medium ? "yes" : "no"); TRACE("peripherial_qualifier 0x%02x\n",
parameter.peripherial_qualifier);
TRACE("removable_medium %s\n",
parameter.removable_medium ? "yes" : "no");
TRACE("version 0x%02x\n", parameter.version); TRACE("version 0x%02x\n", parameter.version);
TRACE("response_data_format 0x%02x\n", parameter.response_data_format); TRACE("response_data_format 0x%02x\n", parameter.response_data_format);
TRACE_ALWAYS("vendor_identification \"%.8s\"\n", parameter.vendor_identification); TRACE_ALWAYS("vendor_identification \"%.8s\"\n",
TRACE_ALWAYS("product_identification \"%.16s\"\n", parameter.product_identification); parameter.vendor_identification);
TRACE_ALWAYS("product_revision_level \"%.4s\"\n", parameter.product_revision_level); TRACE_ALWAYS("product_identification \"%.16s\"\n",
parameter.product_identification);
TRACE_ALWAYS("product_revision_level \"%.4s\"\n",
parameter.product_revision_level);
memcpy(lun->vendor_name, parameter.vendor_identification,
MIN(sizeof(lun->vendor_name), sizeof(parameter.vendor_identification)));
memcpy(lun->product_name, parameter.product_identification,
MIN(sizeof(lun->product_name),
sizeof(parameter.product_identification)));
memcpy(lun->product_revision, parameter.product_revision_level,
MIN(sizeof(lun->product_revision),
sizeof(parameter.product_revision_level)));
lun->device_type = parameter.peripherial_device_type; /* 1:1 mapping */ lun->device_type = parameter.peripherial_device_type; /* 1:1 mapping */
lun->removable = (parameter.removable_medium == 1); lun->removable = (parameter.removable_medium == 1);
return B_OK; return B_OK;
@ -992,6 +1008,27 @@ usb_disk_free(void *cookie)
} }
static inline void
normalize_name(char *name, size_t nameLength)
{
bool wasSpace = false;
size_t insertIndex = 0;
for (size_t i = 0; i < nameLength; i++) {
bool isSpace = name[i] == ' ';
if (isSpace && wasSpace)
continue;
name[insertIndex++] = name[i];
wasSpace = isSpace;
}
if (insertIndex > 0 && name[insertIndex - 1] == ' ')
insertIndex--;
name[insertIndex] = 0;
}
static status_t static status_t
usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length) usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
{ {
@ -1005,6 +1042,19 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
status_t result = B_DEV_INVALID_IOCTL; status_t result = B_DEV_INVALID_IOCTL;
switch (op) { switch (op) {
case B_GET_DEVICE_SIZE: {
if (lun->media_changed) {
result = usb_disk_update_capacity(lun);
if (result != B_OK)
break;
}
size_t size = lun->block_size * lun->block_count;
result = user_memcpy(buffer, &size, sizeof(size));
break;
}
case B_GET_MEDIA_STATUS: { case B_GET_MEDIA_STATUS: {
*(status_t *)buffer = usb_disk_test_unit_ready(lun); *(status_t *)buffer = usb_disk_test_unit_ready(lun);
TRACE("B_GET_MEDIA_STATUS: 0x%08lx\n", *(status_t *)buffer); TRACE("B_GET_MEDIA_STATUS: 0x%08lx\n", *(status_t *)buffer);
@ -1100,6 +1150,25 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
result = user_memcpy(buffer, &iconData, sizeof(device_icon)); result = user_memcpy(buffer, &iconData, sizeof(device_icon));
break; break;
} }
case B_GET_DEVICE_NAME:
{
size_t nameLength = sizeof(lun->vendor_name)
+ sizeof(lun->product_name) + sizeof(lun->product_revision) + 3;
char name[nameLength];
snprintf(name, nameLength, "%.8s %.16s %.4s", lun->vendor_name,
lun->product_name, lun->product_revision);
normalize_name(name, nameLength);
result = user_strlcpy((char *)buffer, name, length);
if (result > 0)
result = B_OK;
TRACE_ALWAYS("got device name: \"%s\" = %s\n", name, strerror(result));
break;
}
#endif #endif
default: default:

View File

@ -78,6 +78,10 @@ struct device_lun_s {
uint8 device_type; uint8 device_type;
bool removable; bool removable;
bool write_protected; bool write_protected;
char vendor_name[8];
char product_name[16];
char product_revision[4];
}; };

View File

@ -256,6 +256,7 @@ static uint16 nvidia_device_list[] = {
0x028c, /* Nvidia Quadro4 700 GoGL */ 0x028c, /* Nvidia Quadro4 700 GoGL */
0x0290, /* Nvidia Geforce 7900 GTX */ 0x0290, /* Nvidia Geforce 7900 GTX */
0x0291, /* Nvidia Geforce 7900 GT */ 0x0291, /* Nvidia Geforce 7900 GT */
0x0292, /* Nvidia Geforce 7900 GS */
0x0293, /* Nvidia Geforce 7900 GX2 */ 0x0293, /* Nvidia Geforce 7900 GX2 */
0x0294, /* Nvidia Geforce 7950 GX2 */ 0x0294, /* Nvidia Geforce 7950 GX2 */
0x0295, /* Nvidia Geforce 7950 GT */ 0x0295, /* Nvidia Geforce 7950 GT */

View File

@ -597,7 +597,7 @@ BlockAllocator::InitializeAndClearBitmap(Transaction& transaction)
memset(buffer, 0, numBits >> 3); memset(buffer, 0, numBits >> 3);
off_t offset = 1; off_t offset = 1;
// the bitmap starts directly after the super block // the bitmap starts directly after the superblock
// initialize the AllocationGroup objects and clear the on-disk bitmap // initialize the AllocationGroup objects and clear the on-disk bitmap
@ -926,7 +926,7 @@ BlockAllocator::AllocateBlocks(Transaction& transaction, int32 groupIndex,
fVolume->SuperBlock().used_blocks fVolume->SuperBlock().used_blocks
= HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() + bestLength); = HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() + bestLength);
// We are not writing back the disk's super block - it's // We are not writing back the disk's superblock - it's
// either done by the journaling code, or when the disk // either done by the journaling code, or when the disk
// is unmounted. // is unmounted.
// If the value is not correct at mount time, it will be // If the value is not correct at mount time, it will be

View File

@ -2556,7 +2556,7 @@ Inode::Remove(Transaction& transaction, const char* name, ino_t* _id,
adds the created inode to that parent directory. If an attribute directory adds the created inode to that parent directory. If an attribute directory
is created, it will also automatically be added to the \a parent inode as is created, it will also automatically be added to the \a parent inode as
such. However, the indices root node, and the regular root node won't be such. However, the indices root node, and the regular root node won't be
added to the super block. added to the superblock.
It will also create the initial B+tree for the inode if it's a directory It will also create the initial B+tree for the inode if it's a directory
of any kind. of any kind.
\a name may be \c NULL, but only if no \a parent is given. \a name may be \c NULL, but only if no \a parent is given.

View File

@ -499,10 +499,10 @@ Journal::_ReplayRunArray(int32* _start)
// TODO: eventually check other well known offsets, like the // TODO: eventually check other well known offsets, like the
// root and index dirs // root and index dirs
if (offset == 0) { if (offset == 0) {
// This log entry writes over the super block - check if // This log entry writes over the superblock - check if
// it's valid! // it's valid!
if (Volume::CheckSuperBlock(data) != B_OK) { if (Volume::CheckSuperBlock(data) != B_OK) {
FATAL(("Log contains invalid super block!\n")); FATAL(("Log contains invalid superblock!\n"));
RETURN_ERROR(B_BAD_DATA); RETURN_ERROR(B_BAD_DATA);
} }
} }
@ -663,7 +663,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
delete logEntry; delete logEntry;
// update the super block, and change the disk's state, if necessary // update the superblock, and change the disk's state, if necessary
if (update) { if (update) {
if (superBlock.log_start == superBlock.log_end) if (superBlock.log_start == superBlock.log_end)
@ -671,7 +671,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
status_t status = journal->fVolume->WriteSuperBlock(); status_t status = journal->fVolume->WriteSuperBlock();
if (status != B_OK) { if (status != B_OK) {
FATAL(("_TransactionWritten: could not write back super block: %s\n", FATAL(("_TransactionWritten: could not write back superblock: %s\n",
strerror(status))); strerror(status)));
} }
@ -864,7 +864,7 @@ Journal::_WriteTransactionToLog()
logEntry->SetTransactionID(fTransactionID); logEntry->SetTransactionID(fTransactionID);
#endif #endif
// Update the log end pointer in the super block // Update the log end pointer in the superblock
fVolume->SuperBlock().flags = SUPER_BLOCK_DISK_DIRTY; fVolume->SuperBlock().flags = SUPER_BLOCK_DISK_DIRTY;
fVolume->SuperBlock().log_end = HOST_ENDIAN_TO_BFS_INT64(logPosition); fVolume->SuperBlock().log_end = HOST_ENDIAN_TO_BFS_INT64(logPosition);

View File

@ -4,7 +4,7 @@
*/ */
//! super block, mounting, etc. //! superblock, mounting, etc.
#include "Attribute.h" #include "Attribute.h"
@ -342,13 +342,13 @@ Volume::Mount(const char* deviceName, uint32 flags)
if (opener.IsReadOnly()) if (opener.IsReadOnly())
fFlags |= VOLUME_READ_ONLY; fFlags |= VOLUME_READ_ONLY;
// read the super block // read the superblock
if (Identify(fDevice, &fSuperBlock) != B_OK) { if (Identify(fDevice, &fSuperBlock) != B_OK) {
FATAL(("invalid super block!\n")); FATAL(("invalid superblock!\n"));
return B_BAD_VALUE; return B_BAD_VALUE;
} }
// initialize short hands to the super block (to save byte swapping) // initialize short hands to the superblock (to save byte swapping)
fBlockSize = fSuperBlock.BlockSize(); fBlockSize = fSuperBlock.BlockSize();
fBlockShift = fSuperBlock.BlockShift(); fBlockShift = fSuperBlock.BlockShift();
fAllocationGroupShift = fSuperBlock.AllocationGroupShift(); fAllocationGroupShift = fSuperBlock.AllocationGroupShift();
@ -633,7 +633,7 @@ Volume::CheckSuperBlock(const uint8* data, uint32* _offset)
} }
#ifndef BFS_LITTLE_ENDIAN_ONLY #ifndef BFS_LITTLE_ENDIAN_ONLY
// For PPC, the super block might be located at offset 0 // For PPC, the superblock might be located at offset 0
superBlock = (disk_super_block*)data; superBlock = (disk_super_block*)data;
if (superBlock->IsValid()) { if (superBlock->IsValid()) {
if (_offset != NULL) if (_offset != NULL)
@ -692,11 +692,11 @@ Volume::Initialize(int fd, const char* name, uint32 blockSize,
off_t numBlocks = deviceSize / blockSize; off_t numBlocks = deviceSize / blockSize;
// create valid super block // create valid superblock
fSuperBlock.Initialize(name, numBlocks, blockSize); fSuperBlock.Initialize(name, numBlocks, blockSize);
// initialize short hands to the super block (to save byte swapping) // initialize short hands to the superblock (to save byte swapping)
fBlockSize = fSuperBlock.BlockSize(); fBlockSize = fSuperBlock.BlockSize();
fBlockShift = fSuperBlock.BlockShift(); fBlockShift = fSuperBlock.BlockShift();
fAllocationGroupShift = fSuperBlock.AllocationGroupShift(); fAllocationGroupShift = fSuperBlock.AllocationGroupShift();

View File

@ -5,7 +5,7 @@
*/ */
//! Super block, mounting, etc. //! Superblock, mounting, etc.
#include "Volume.h" #include "Volume.h"
@ -270,7 +270,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
if (opener.IsReadOnly()) if (opener.IsReadOnly())
fFlags |= VOLUME_READ_ONLY; fFlags |= VOLUME_READ_ONLY;
// read the super block // read the superblock
status_t status = Identify(fDevice, &fSuperBlock); status_t status = Identify(fDevice, &fSuperBlock);
if (status != B_OK) { if (status != B_OK) {
ERROR("Volume::Mount(): Identify() failed\n"); ERROR("Volume::Mount(): Identify() failed\n");
@ -526,7 +526,7 @@ Volume::Identify(int fd, btrfs_super_block* superBlock)
return B_IO_ERROR; return B_IO_ERROR;
if (!superBlock->IsValid()) { if (!superBlock->IsValid()) {
ERROR("invalid super block!\n"); ERROR("invalid superblock!\n");
return B_BAD_VALUE; return B_BAD_VALUE;
} }

View File

@ -5,7 +5,7 @@
*/ */
//! Super block, mounting, etc. //! Superblock, mounting, etc.
#include "Volume.h" #include "Volume.h"
@ -310,7 +310,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
if (opener.IsReadOnly()) if (opener.IsReadOnly())
fFlags |= VOLUME_READ_ONLY; fFlags |= VOLUME_READ_ONLY;
// read the super block // read the superblock
status_t status = Identify(fDevice, &fSuperBlock); status_t status = Identify(fDevice, &fSuperBlock);
if (status != B_OK) { if (status != B_OK) {
ERROR("Volume::Mount(): Identify() failed\n"); ERROR("Volume::Mount(): Identify() failed\n");
@ -502,7 +502,7 @@ Volume::Identify(int fd, exfat_super_block* superBlock)
return B_IO_ERROR; return B_IO_ERROR;
if (!superBlock->IsValid()) { if (!superBlock->IsValid()) {
ERROR("invalid super block!\n"); ERROR("invalid superblock!\n");
return B_BAD_VALUE; return B_BAD_VALUE;
} }

View File

@ -114,7 +114,7 @@ Journal::Journal(Volume* fsVolume, Volume* jVolume)
fInitStatus = B_NO_MEMORY; fInitStatus = B_NO_MEMORY;
else { else {
fInitStatus = revokeManager->Init(); fInitStatus = revokeManager->Init();
if (fInitStatus == B_OK) { if (fInitStatus == B_OK) {
fRevokeManager = revokeManager; fRevokeManager = revokeManager;
fInitStatus = _LoadSuperBlock(); fInitStatus = _LoadSuperBlock();
@ -270,7 +270,7 @@ Journal::Unlock(Transaction* owner, bool success)
{ {
TRACE("Journal::Unlock(): Lock recursion: %ld\n", TRACE("Journal::Unlock(): Lock recursion: %ld\n",
recursive_lock_get_recursion(&fLock)); recursive_lock_get_recursion(&fLock));
if (fSeparateSubTransactions if (fSeparateSubTransactions
|| recursive_lock_get_recursion(&fLock) == 1) { || recursive_lock_get_recursion(&fLock) == 1) {
// we only end the transaction if we unlock it // we only end the transaction if we unlock it
if (owner != NULL) { if (owner != NULL) {
@ -309,7 +309,7 @@ Journal::MapBlock(off_t logical, fsblock_t& physical)
{ {
TRACE("Journal::MapBlock()\n"); TRACE("Journal::MapBlock()\n");
physical = logical; physical = logical;
return B_OK; return B_OK;
} }
@ -340,7 +340,7 @@ Journal::TransactionID() const
status_t status_t
Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock, Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
bool detached, uint8** _escapedData, uint32 &logBlock, off_t& blockNumber, bool detached, uint8** _escapedData, uint32 &logBlock, off_t& blockNumber,
long& cookie, ArrayDeleter<uint8>& escapedDataDeleter, uint32& blockCount, long& cookie, ArrayDeleter<uint8>& escapedDataDeleter, uint32& blockCount,
bool& finished) bool& finished)
@ -353,7 +353,7 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
JournalBlockTag* tag = (JournalBlockTag*)descriptorBlock->data; JournalBlockTag* tag = (JournalBlockTag*)descriptorBlock->data;
JournalBlockTag* lastTag = (JournalBlockTag*)((uint8*)descriptorBlock JournalBlockTag* lastTag = (JournalBlockTag*)((uint8*)descriptorBlock
+ fBlockSize - sizeof(JournalHeader)); + fBlockSize - sizeof(JournalHeader));
finished = false; finished = false;
status_t status = B_OK; status_t status = B_OK;
@ -430,11 +430,11 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
} }
finished = status != B_OK; finished = status != B_OK;
// Write descriptor block // Write descriptor block
--tag; --tag;
tag->SetLastTagFlag(); tag->SetLastTagFlag();
fsblock_t physicalBlock; fsblock_t physicalBlock;
status = MapBlock(descriptorBlockPos, physicalBlock); status = MapBlock(descriptorBlockPos, physicalBlock);
if (status != B_OK) if (status != B_OK)
@ -493,14 +493,14 @@ Journal::_WriteTransactionToLog()
if (size > FreeLogBlocks()) { if (size > FreeLogBlocks()) {
TRACE("Journal::_WriteTransactionToLog(): Syncing block cache\n"); TRACE("Journal::_WriteTransactionToLog(): Syncing block cache\n");
cache_sync_transaction(fFilesystemBlockCache, fTransactionID); cache_sync_transaction(fFilesystemBlockCache, fTransactionID);
if (size > FreeLogBlocks()) { if (size > FreeLogBlocks()) {
panic("Transaction fits, but sync didn't result in enough" panic("Transaction fits, but sync didn't result in enough"
"free space.\n\tGot %ld when at least %ld was expected.", "free space.\n\tGot %ld when at least %ld was expected.",
FreeLogBlocks(), size); FreeLogBlocks(), size);
} }
} }
TRACE("Journal::_WriteTransactionToLog(): finished managing space for " TRACE("Journal::_WriteTransactionToLog(): finished managing space for "
"the transaction\n"); "the transaction\n");
@ -511,7 +511,7 @@ Journal::_WriteTransactionToLog()
// Prepare Descriptor block // Prepare Descriptor block
TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for " TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for "
"the descriptor block, block size %lu\n", fBlockSize); "the descriptor block, block size %lu\n", fBlockSize);
JournalHeader* descriptorBlock = JournalHeader* descriptorBlock =
(JournalHeader*)new(std::nothrow) uint8[fBlockSize]; (JournalHeader*)new(std::nothrow) uint8[fBlockSize];
if (descriptorBlock == NULL) { if (descriptorBlock == NULL) {
TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer " TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer "
@ -525,7 +525,7 @@ Journal::_WriteTransactionToLog()
// Prepare Commit block // Prepare Commit block
TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for " TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for "
"the commit block, block size %lu\n", fBlockSize); "the commit block, block size %lu\n", fBlockSize);
JournalHeader* commitBlock = JournalHeader* commitBlock =
(JournalHeader*)new(std::nothrow) uint8[fBlockSize]; (JournalHeader*)new(std::nothrow) uint8[fBlockSize];
if (descriptorBlock == NULL) { if (descriptorBlock == NULL) {
TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer " TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer "
@ -555,7 +555,7 @@ Journal::_WriteTransactionToLog()
uint32 blockCount = 0; uint32 blockCount = 0;
uint32 logBlock = _WrapAroundLog(fLogEnd); uint32 logBlock = _WrapAroundLog(fLogEnd);
bool finished = false; bool finished = false;
status = _WritePartialTransactionToLog(descriptorBlock, detached, status = _WritePartialTransactionToLog(descriptorBlock, detached,
@ -574,10 +574,10 @@ Journal::_WriteTransactionToLog()
blockCount, finished); blockCount, finished);
if (!finished && status != B_OK) if (!finished && status != B_OK)
return status; return status;
// It is okay to write the commit blocks of the partial transactions // It is okay to write the commit blocks of the partial transactions
// as long as the commit block of the first partial transaction isn't // as long as the commit block of the first partial transaction isn't
// written. When it recovery reaches where the first commit should be // written. When it recovery reaches where the first commit should be
// and doesn't find it, it considers it found the end of the log. // and doesn't find it, it considers it found the end of the log.
fsblock_t physicalBlock; fsblock_t physicalBlock;
@ -586,7 +586,7 @@ Journal::_WriteTransactionToLog()
return status; return status;
off_t logOffset = physicalBlock * fBlockSize; off_t logOffset = physicalBlock * fBlockSize;
TRACE("Journal::_WriteTransactionToLog(): Writting commit block to " TRACE("Journal::_WriteTransactionToLog(): Writting commit block to "
"%lld\n", logOffset); "%lld\n", logOffset);
off_t written = write_pos(fJournalVolume->Device(), logOffset, off_t written = write_pos(fJournalVolume->Device(), logOffset,
@ -598,7 +598,7 @@ Journal::_WriteTransactionToLog()
commitBlock->IncrementSequence(); commitBlock->IncrementSequence();
blockCount++; blockCount++;
logBlock = _WrapAroundLog(logBlock + 1); logBlock = _WrapAroundLog(logBlock + 1);
} }
@ -617,7 +617,7 @@ Journal::_WriteTransactionToLog()
TRACE("Failed to write journal commit block.\n"); TRACE("Failed to write journal commit block.\n");
return B_IO_ERROR; return B_IO_ERROR;
} }
blockCount++; blockCount++;
fLogEnd = _WrapAroundLog(fLogEnd + blockCount); fLogEnd = _WrapAroundLog(fLogEnd + blockCount);
@ -670,7 +670,7 @@ Journal::_SaveSuperBlock()
off_t superblockPos = physicalBlock * fBlockSize; off_t superblockPos = physicalBlock * fBlockSize;
JournalSuperBlock superblock; JournalSuperBlock superblock;
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos, size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos,
&superblock, sizeof(superblock)); &superblock, sizeof(superblock));
if (bytesRead != sizeof(superblock)) if (bytesRead != sizeof(superblock))
@ -678,7 +678,7 @@ Journal::_SaveSuperBlock()
superblock.SetFirstCommitID(fFirstCommitID); superblock.SetFirstCommitID(fFirstCommitID);
superblock.SetLogStart(fLogStart); superblock.SetLogStart(fLogStart);
TRACE("Journal::SaveSuperBlock(): Write to %lld\n", superblockPos); TRACE("Journal::SaveSuperBlock(): Write to %lld\n", superblockPos);
size_t bytesWritten = write_pos(fJournalVolume->Device(), superblockPos, size_t bytesWritten = write_pos(fJournalVolume->Device(), superblockPos,
&superblock, sizeof(superblock)); &superblock, sizeof(superblock));
@ -701,10 +701,10 @@ Journal::_LoadSuperBlock()
status_t status = MapBlock(0, superblockPos); status_t status = MapBlock(0, superblockPos);
if (status != B_OK) if (status != B_OK)
return status; return status;
TRACE("Journal::_LoadSuperBlock(): super block physical block: %llu\n", TRACE("Journal::_LoadSuperBlock(): superblock physical block: %llu\n",
superblockPos); superblockPos);
JournalSuperBlock superblock; JournalSuperBlock superblock;
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos
* fJournalVolume->BlockSize(), &superblock, sizeof(superblock)); * fJournalVolume->BlockSize(), &superblock, sizeof(superblock));
@ -803,7 +803,7 @@ Journal::_CountTags(JournalHeader* descriptorBlock)
if ((tags->Flags() & JOURNAL_FLAG_LAST_TAG) != 0) if ((tags->Flags() & JOURNAL_FLAG_LAST_TAG) != 0)
count++; count++;
TRACE("Journal::_CountTags(): counted tags: %lu\n", count); TRACE("Journal::_CountTags(): counted tags: %lu\n", count);
return count; return count;
@ -824,7 +824,7 @@ Journal::Recover()
status_t status = _RecoverPassScan(lastCommitID); status_t status = _RecoverPassScan(lastCommitID);
if (status != B_OK) if (status != B_OK)
return status; return status;
status = _RecoverPassRevoke(lastCommitID); status = _RecoverPassRevoke(lastCommitID);
if (status != B_OK) if (status != B_OK)
return status; return status;
@ -978,7 +978,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
"data\n"); "data\n");
return B_NO_MEMORY; return B_NO_MEMORY;
} }
ArrayDeleter<uint8> dataDeleter(data); ArrayDeleter<uint8> dataDeleter(data);
while (nextCommitID < lastCommitID) { while (nextCommitID < lastCommitID) {
@ -994,7 +994,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
JournalBlockTag* last_tag = (JournalBlockTag*)((uint8*)header JournalBlockTag* last_tag = (JournalBlockTag*)((uint8*)header
+ fBlockSize - sizeof(JournalBlockTag)); + fBlockSize - sizeof(JournalBlockTag));
for (JournalBlockTag* tag = (JournalBlockTag*)header->data; for (JournalBlockTag* tag = (JournalBlockTag*)header->data;
tag <= last_tag; ++tag) { tag <= last_tag; ++tag) {
nextBlock = _WrapAroundLog(nextBlock + 1); nextBlock = _WrapAroundLog(nextBlock + 1);
@ -1002,7 +1002,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
if (status != B_OK) if (status != B_OK)
return status; return status;
if (!fRevokeManager->Lookup(tag->BlockNumber(), if (!fRevokeManager->Lookup(tag->BlockNumber(),
nextCommitID)) { nextCommitID)) {
// Block isn't revoked // Block isn't revoked
size_t read = read_pos(fJournalVolume->Device(), size_t read = read_pos(fJournalVolume->Device(),
@ -1111,7 +1111,7 @@ Journal::_FlushLog(bool canWait, bool flushBlocks)
TRACE("Journal::_FlushLog(): Finished. Releasing lock\n"); TRACE("Journal::_FlushLog(): Finished. Releasing lock\n");
recursive_lock_unlock(&fLock); recursive_lock_unlock(&fLock);
TRACE("Journal::_FlushLog(): Done, final status: %s\n", strerror(status)); TRACE("Journal::_FlushLog(): Done, final status: %s\n", strerror(status));
return status; return status;
} }
@ -1160,9 +1160,9 @@ Journal::_FullTransactionSize() const
size_t count = cache_blocks_in_transaction(fFilesystemBlockCache, size_t count = cache_blocks_in_transaction(fFilesystemBlockCache,
fTransactionID); fTransactionID);
TRACE("\tFull transaction size: %ld\n", count); TRACE("\tFull transaction size: %ld\n", count);
return count; return count;
} }
@ -1174,9 +1174,9 @@ Journal::_MainTransactionSize() const
size_t count = cache_blocks_in_main_transaction(fFilesystemBlockCache, size_t count = cache_blocks_in_main_transaction(fFilesystemBlockCache,
fTransactionID); fTransactionID);
TRACE("\tMain transaction size: %ld\n", count); TRACE("\tMain transaction size: %ld\n", count);
return count; return count;
} }
@ -1200,7 +1200,7 @@ Journal::_TransactionDone(bool success)
TRACE("Journal::_TransactionDone(): returning B_OK\n"); TRACE("Journal::_TransactionDone(): returning B_OK\n");
return B_OK; return B_OK;
} }
// If possible, delay flushing the transaction // If possible, delay flushing the transaction
uint32 size = _FullTransactionSize(); uint32 size = _FullTransactionSize();
TRACE("Journal::_TransactionDone(): full transaction size: %lu, max " TRACE("Journal::_TransactionDone(): full transaction size: %lu, max "
@ -1209,11 +1209,11 @@ Journal::_TransactionDone(bool success)
if (fMaxTransactionSize > 0 && size < fMaxTransactionSize) { if (fMaxTransactionSize > 0 && size < fMaxTransactionSize) {
TRACE("Journal::_TransactionDone(): delaying flush of transaction " TRACE("Journal::_TransactionDone(): delaying flush of transaction "
"%ld\n", fTransactionID); "%ld\n", fTransactionID);
// Make sure the transaction fits in the log // Make sure the transaction fits in the log
if (size < FreeLogBlocks()) if (size < FreeLogBlocks())
cache_sync_transaction(fFilesystemBlockCache, fTransactionID); cache_sync_transaction(fFilesystemBlockCache, fTransactionID);
fUnwrittenTransactions++; fUnwrittenTransactions++;
TRACE("Journal::_TransactionDone(): returning B_OK\n"); TRACE("Journal::_TransactionDone(): returning B_OK\n");
return B_OK; return B_OK;
@ -1253,7 +1253,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
if (journal->_SaveSuperBlock() != B_OK) if (journal->_SaveSuperBlock() != B_OK)
panic("ext2: Failed to write journal superblock\n"); panic("ext2: Failed to write journal superblock\n");
} }
TRACE("Journal::_TransactionWritten(): Removing log entry\n"); TRACE("Journal::_TransactionWritten(): Removing log entry\n");
journal->fLogEntries.Remove(logEntry); journal->fLogEntries.Remove(logEntry);

View File

@ -5,7 +5,7 @@
*/ */
//! Super block, mounting, etc. //! Superblock, mounting, etc.
#include "Volume.h" #include "Volume.h"
@ -300,7 +300,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
fSuperBlock.CompatibleFeatures(), fSuperBlock.IncompatibleFeatures(), fSuperBlock.CompatibleFeatures(), fSuperBlock.IncompatibleFeatures(),
fSuperBlock.ReadOnlyFeatures()); fSuperBlock.ReadOnlyFeatures());
// read the super block // read the superblock
status_t status = Identify(fDevice, &fSuperBlock); status_t status = Identify(fDevice, &fSuperBlock);
if (status != B_OK) { if (status != B_OK) {
FATAL("Volume::Mount(): Identify() failed\n"); FATAL("Volume::Mount(): Identify() failed\n");
@ -311,7 +311,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
if (!IsReadOnly() && _UnsupportedReadOnlyFeatures(fSuperBlock) != 0) if (!IsReadOnly() && _UnsupportedReadOnlyFeatures(fSuperBlock) != 0)
return B_UNSUPPORTED; return B_UNSUPPORTED;
// initialize short hands to the super block (to save byte swapping) // initialize short hands to the superblock (to save byte swapping)
fBlockShift = fSuperBlock.BlockShift(); fBlockShift = fSuperBlock.BlockShift();
if (fBlockShift < 10 || fBlockShift > 16) if (fBlockShift < 10 || fBlockShift > 16)
return B_ERROR; return B_ERROR;
@ -930,7 +930,7 @@ Volume::Identify(int fd, ext2_super_block* superBlock)
return B_IO_ERROR; return B_IO_ERROR;
if (!superBlock->IsValid()) { if (!superBlock->IsValid()) {
FATAL("invalid super block!\n"); FATAL("invalid superblock!\n");
return B_BAD_VALUE; return B_BAD_VALUE;
} }

View File

@ -30,12 +30,12 @@ using std::nothrow;
/*! /*!
\class DirEntry \class DirEntry
\brief Represents the on-disk structure for super block of the FS. \brief Represents the on-disk structure for superblock of the FS.
There exist two versions of the structure and this class can deal with both There exist two versions of the structure and this class can deal with both
of them. This class can also handle a very old layout that puts the super of them. This class can also handle a very old layout that puts the super
block in a different location. The Init() methods tries to find and read block in a different location. The Init() methods tries to find and read
the super block from disk. the superblock from disk.
*/ */
// read_super_block // read_super_block
@ -47,13 +47,13 @@ read_super_block(int device, off_t offset, const char *magic,
{ {
super_block_t *superBlock = NULL; super_block_t *superBlock = NULL;
status_t error = B_OK; status_t error = B_OK;
// allocate memory for the super block // allocate memory for the superblock
if (error == B_OK) { if (error == B_OK) {
superBlock = new(nothrow) super_block_t; superBlock = new(nothrow) super_block_t;
if (!superBlock) if (!superBlock)
error = B_NO_MEMORY; error = B_NO_MEMORY;
} }
// read the super block // read the superblock
if (error == B_OK) { if (error == B_OK) {
size_t size = sizeof(super_block_t); size_t size = sizeof(super_block_t);
if (read_pos(device, offset, superBlock, size) != (int32)size) if (read_pos(device, offset, superBlock, size) != (int32)size)

View File

@ -57,7 +57,7 @@ static inline C max(const C &a, const C &b) { return (a > b ? a : b); }
\brief Represents a volume. \brief Represents a volume.
The Volume class bundles all functionality related to a volume. The Volume class bundles all functionality related to a volume.
It knows the super block and has some basic functionality needed It knows the superblock and has some basic functionality needed
for handling VNodes. Actually it should be the layer that provides the for handling VNodes. Actually it should be the layer that provides the
abstraction from VNodes. The design is not strict in this respect abstraction from VNodes. The design is not strict in this respect
(the whole thing evolved while I was in the process of understanding (the whole thing evolved while I was in the process of understanding
@ -97,7 +97,7 @@ Volume::Identify(int fd, partition_data *partition)
if (fDevice < 0) if (fDevice < 0)
return B_ERROR; return B_ERROR;
// read and analyze super block // read and analyze superblock
return _ReadSuperBlock(); return _ReadSuperBlock();
} }
@ -130,7 +130,7 @@ Volume::Mount(fs_volume *fsVolume, const char *path)
if (fDevice < 0) if (fDevice < 0)
SET_ERROR(error, errno); SET_ERROR(error, errno);
} }
// read and analyze super block // read and analyze superblock
if (error == B_OK) if (error == B_OK)
error = _ReadSuperBlock(); error = _ReadSuperBlock();
@ -534,12 +534,12 @@ Volume::_ReadSuperBlock()
error = B_NO_MEMORY; error = B_NO_MEMORY;
// check FS state // check FS state
if (error == B_OK && fSuperBlock->GetState() != REISERFS_VALID_FS) { if (error == B_OK && fSuperBlock->GetState() != REISERFS_VALID_FS) {
FATAL(("The super block indicates a non-valid FS! Bailing out.")); FATAL(("The superblock indicates a non-valid FS! Bailing out."));
error = B_ERROR; error = B_ERROR;
} }
// check FS version // check FS version
if (error == B_OK && fSuperBlock->GetVersion() > REISERFS_VERSION_2) { if (error == B_OK && fSuperBlock->GetVersion() > REISERFS_VERSION_2) {
FATAL(("The super block indicates a version greater than 2 (%u)! " FATAL(("The superblock indicates a version greater than 2 (%u)! "
"Bailing out.", fSuperBlock->GetVersion())); "Bailing out.", fSuperBlock->GetVersion()));
error = B_ERROR; error = B_ERROR;
} }

View File

@ -220,7 +220,7 @@ struct reiserfs_de_head
// //
// //
// super block's field values // superblock's field values
// //
#define REISERFS_VERSION_0 0 /* undistributed bitmap */ #define REISERFS_VERSION_0 0 /* undistributed bitmap */
#define REISERFS_VERSION_1 1 /* distributed bitmap and resizer*/ #define REISERFS_VERSION_1 1 /* distributed bitmap and resizer*/
@ -232,7 +232,7 @@ struct reiserfs_de_head
#define R5_HASH 3 #define R5_HASH 3
#define DEFAULT_HASH R5_HASH #define DEFAULT_HASH R5_HASH
/* this is the on disk super block */ /* this is the on disk superblock */
struct reiserfs_super_block struct reiserfs_super_block
{ {

View File

@ -39,7 +39,7 @@ file_system obfs {
is_buffer false is_buffer false
} }
# dump super block # dump superblock
ioctl 56743 { ioctl 56743 {
buffer_size 0 buffer_size 0
write_buffer_size 0 write_buffer_size 0

View File

@ -31,7 +31,7 @@ local sources =
AddResources IMAP : IMAP.rdef ; AddResources IMAP : IMAP.rdef ;
if $(HAIKU_OPENSSL_ENABLED) { if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
SubDirC++Flags -DUSE_SSL ; SubDirC++Flags -DUSE_SSL ;
SetupFeatureObjectsDir ssl ; SetupFeatureObjectsDir ssl ;
} else { } else {

View File

@ -17,7 +17,7 @@ local sources =
; ;
# use OpenSSL, if enabled # use OpenSSL, if enabled
if $(HAIKU_OPENSSL_ENABLED) { if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
SubDirC++Flags -DUSE_SSL ; SubDirC++Flags -DUSE_SSL ;
SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ;
Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ;

View File

@ -13,7 +13,7 @@ local sources =
; ;
# use OpenSSL, if enabled # use OpenSSL, if enabled
if $(HAIKU_OPENSSL_ENABLED) { if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
SubDirC++Flags -DUSE_SSL ; SubDirC++Flags -DUSE_SSL ;
SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ;
Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ;

View File

@ -26,13 +26,9 @@ extern "C" {
#include "state_tracker/st_gl_api.h" #include "state_tracker/st_gl_api.h"
#include "state_tracker/st_manager.h" #include "state_tracker/st_manager.h"
#include "state_tracker/sw_winsys.h" #include "state_tracker/sw_winsys.h"
#include "softpipe/sp_context.h"
#include "softpipe/sp_public.h" #include "softpipe/sp_public.h"
#include "softpipe/sp_texture.h" #ifdef HAVE_LLVM
#ifdef USE_LLVMPIPE
#include "llvmpipe/lp_context.h"
#include "llvmpipe/lp_public.h" #include "llvmpipe/lp_public.h"
#include "llvmpipe/lp_texture.h"
#endif #endif
} }
@ -209,7 +205,7 @@ GalliumContext::CreateScreen()
return B_ERROR; return B_ERROR;
} }
#if USE_LLVMPIPE #ifdef HAVE_LLVM
fScreen = llvmpipe_create_screen(winsys); fScreen = llvmpipe_create_screen(winsys);
#endif #endif
@ -223,7 +219,7 @@ GalliumContext::CreateScreen()
} }
const char* driverName = fScreen->get_name(fScreen); const char* driverName = fScreen->get_name(fScreen);
TRACE("%s: Using %s driver.\n", __func__, driverName); ERROR("%s: Using %s driver.\n", __func__, driverName);
return B_OK; return B_OK;
} }

View File

@ -15,8 +15,10 @@ local sources =
if $(HAIKU_LLVM_PRESENT) { if $(HAIKU_LLVM_PRESENT) {
# TODO: Add LLVM OptionalBuildPackage # TODO: Add LLVM OptionalBuildPackage
SubDirC++Flags [ FDefines USE_LLVMPIPE ] ; SubDirC++Flags [ FDefines HAVE_LLVM=0x0302 ] ;
SubDirSysHdrs $(HAIKU_LLVM_HEADERS) ;
# TODO: This is a hack for now
SubDirSysHdrs /boot/common/include ;
} }

View File

@ -174,9 +174,10 @@ SoftwareRenderer::SwapBuffers(bool vsync)
// check the bitmap size still matches the size // check the bitmap size still matches the size
if (fInfo->window_bounds.bottom - fInfo->window_bounds.top if (fInfo->window_bounds.bottom - fInfo->window_bounds.top
!= fBitmap->Bounds().IntegerHeight() + 1 != fBitmap->Bounds().IntegerHeight()
|| fInfo->window_bounds.right - fInfo->window_bounds.left || fInfo->window_bounds.right - fInfo->window_bounds.left
!= fBitmap->Bounds().IntegerWidth() + 1) { != fBitmap->Bounds().IntegerWidth()) {
ERROR("%s: Bitmap size doesn't match size!\n", __func__);
return; return;
} }
uint8 bytesPerPixel = fInfo->bits_per_pixel / 8; uint8 bytesPerPixel = fInfo->bits_per_pixel / 8;

View File

@ -22,15 +22,15 @@ extern "C" {
} }
#define TRACE_CONTEXT #define TRACE_WINSYS
#ifdef TRACE_CONTEXT #ifdef TRACE_WINSYS
# define TRACE(x...) printf("GalliumContext: " x) # define TRACE(x...) printf("GalliumWinsys: " x)
# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__) # define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
#else #else
# define TRACE(x...) # define TRACE(x...)
# define CALLED() # define CALLED()
#endif #endif
#define ERROR(x...) printf("GalliumContext: " x) #define ERROR(x...) printf("GalliumWinsys: " x)
// Cast // Cast
@ -209,4 +209,4 @@ winsys_connect_hooks()
winsys->displaytarget_destroy = hook_winsys_displaytarget_destroy; winsys->displaytarget_destroy = hook_winsys_displaytarget_destroy;
return winsys; return winsys;
} }

View File

@ -263,6 +263,7 @@ Application Debugger :
ValueLoader.cpp ValueLoader.cpp
ValueNode.cpp ValueNode.cpp
ValueNodeContainer.cpp ValueNodeContainer.cpp
ValueNodeManager.cpp
# value/type_handlers # value/type_handlers
BListTypeHandler.cpp BListTypeHandler.cpp

View File

@ -26,15 +26,27 @@
#include "StringUtils.h" #include "StringUtils.h"
#include "Team.h" #include "Team.h"
#include "Thread.h" #include "Thread.h"
#include "Type.h"
#include "UiUtils.h" #include "UiUtils.h"
#include "UserInterface.h"
#include "Value.h"
#include "ValueLoader.h"
#include "ValueLocation.h"
#include "ValueNode.h"
#include "ValueNodeManager.h"
DebugReportGenerator::DebugReportGenerator(::Team* team) DebugReportGenerator::DebugReportGenerator(::Team* team,
UserInterfaceListener* listener)
: :
BLooper("DebugReportGenerator"), BLooper("DebugReportGenerator"),
fTeam(team), fTeam(team),
fArchitecture(team->GetArchitecture()), fArchitecture(team->GetArchitecture()),
fTeamDataSem(-1) fTeamDataSem(-1),
fNodeManager(NULL),
fListener(listener),
fWaitingNode(NULL),
fTraceWaitingThread(NULL)
{ {
fTeam->AddListener(this); fTeam->AddListener(this);
fArchitecture->AcquireReference(); fArchitecture->AcquireReference();
@ -45,6 +57,10 @@ DebugReportGenerator::~DebugReportGenerator()
{ {
fTeam->RemoveListener(this); fTeam->RemoveListener(this);
fArchitecture->ReleaseReference(); fArchitecture->ReleaseReference();
if (fNodeManager != NULL) {
fNodeManager->RemoveListener(this);
fNodeManager->ReleaseReference();
}
} }
@ -55,6 +71,12 @@ DebugReportGenerator::Init()
if (fTeamDataSem < B_OK) if (fTeamDataSem < B_OK)
return fTeamDataSem; return fTeamDataSem;
fNodeManager = new(std::nothrow) ValueNodeManager();
if (fNodeManager == NULL)
return B_NO_MEMORY;
fNodeManager->AddListener(this);
Run(); Run();
return B_OK; return B_OK;
@ -62,9 +84,9 @@ DebugReportGenerator::Init()
DebugReportGenerator* DebugReportGenerator*
DebugReportGenerator::Create(::Team* team) DebugReportGenerator::Create(::Team* team, UserInterfaceListener* listener)
{ {
DebugReportGenerator* self = new DebugReportGenerator(team); DebugReportGenerator* self = new DebugReportGenerator(team, listener);
try { try {
self->Init(); self->Init();
@ -132,7 +154,20 @@ DebugReportGenerator::MessageReceived(BMessage* message)
void void
DebugReportGenerator::ThreadStackTraceChanged(const ::Team::ThreadEvent& event) DebugReportGenerator::ThreadStackTraceChanged(const ::Team::ThreadEvent& event)
{ {
release_sem(fTeamDataSem); if (fTraceWaitingThread == event.GetThread()) {
fTraceWaitingThread = NULL;
release_sem(fTeamDataSem);
}
}
void
DebugReportGenerator::ValueNodeValueChanged(ValueNode* node)
{
if (node == fWaitingNode) {
fWaitingNode = NULL;
release_sem(fTeamDataSem);
}
} }
@ -267,6 +302,7 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output,
break; break;
locker.Unlock(); locker.Unlock();
fTraceWaitingThread = thread;
status_t result = acquire_sem(fTeamDataSem); status_t result = acquire_sem(fTeamDataSem);
if (result != B_OK) if (result != B_OK)
return result; return result;
@ -285,6 +321,26 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output,
sizeof(functionName))); sizeof(functionName)));
_output << data; _output << data;
if (frame->CountParameters() == 0
&& frame->CountLocalVariables() == 0) {
continue;
}
_output << "\t\t\tVariables:\n";
status_t result = fNodeManager->SetStackFrame(thread, frame);
if (result != B_OK)
continue;
ValueNodeContainer* container = fNodeManager->GetContainer();
AutoLocker<ValueNodeContainer> containerLocker(container);
for (int32 i = 0; i < container->CountChildren(); i++) {
ValueNodeChild* child = container->ChildAt(i);
containerLocker.Unlock();
_ResolveValueIfNeeded(child->Node(), frame, 1);
containerLocker.Lock();
UiUtils::PrintValueNodeGraph(_output, frame, child, 3, 1);
}
_output << "\n";
} }
_output << "\n\t\tRegisters:\n"; _output << "\n\t\tRegisters:\n";
@ -304,3 +360,60 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output,
return B_OK; return B_OK;
} }
status_t
DebugReportGenerator::_ResolveValueIfNeeded(ValueNode* node, StackFrame* frame,
int32 maxDepth)
{
status_t result = B_OK;
if (node->LocationAndValueResolutionState() == VALUE_NODE_UNRESOLVED) {
fWaitingNode = node;
fListener->ValueNodeValueRequested(frame->GetCpuState(),
fNodeManager->GetContainer(), node);
result = acquire_sem(fTeamDataSem);
}
if (node->LocationAndValueResolutionState() == B_OK && maxDepth > 0) {
AutoLocker<ValueNodeContainer> containerLocker(
fNodeManager->GetContainer());
for (int32 i = 0; i < node->CountChildren(); i++) {
ValueNodeChild* child = node->ChildAt(i);
containerLocker.Unlock();
result = _ResolveLocationIfNeeded(child, frame);
if (result != B_OK)
continue;
result = fNodeManager->AddChildNodes(child);
if (result != B_OK)
continue;
// since in the case of a pointer to a compound we hide
// the intervening compound, don't consider the hidden node
// a level for the purposes of depth traversal
if (node->GetType()->Kind() == TYPE_ADDRESS
&& child->GetType()->Kind() == TYPE_COMPOUND) {
_ResolveValueIfNeeded(child->Node(), frame, maxDepth);
} else
_ResolveValueIfNeeded(child->Node(), frame, maxDepth - 1);
containerLocker.Lock();
}
}
return result;
}
status_t
DebugReportGenerator::_ResolveLocationIfNeeded(ValueNodeChild* child,
StackFrame* frame)
{
ValueLocation* location = NULL;
ValueLoader loader(fTeam->GetArchitecture(), fTeam->GetTeamMemory(),
fTeam->GetTeamTypeInformation(), frame->GetCpuState());
status_t result = child->ResolveLocation(&loader, location);
child->SetLocation(location, result);
if (location != NULL)
location->ReleaseReference();
return result;
}

View File

@ -3,35 +3,47 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef DEBUG_REPORT_GENERATOR_H #ifndef DEBUG_REPORT_GENERATOR_H
#define DEBUG_GENERATOR_H #define DEBUG_REPORT_GENERATOR_H
#include <Looper.h> #include <Looper.h>
#include "Team.h" #include "Team.h"
#include "ValueNodeContainer.h"
class entry_ref; class entry_ref;
class Architecture; class Architecture;
class BString; class BString;
class StackFrame;
class Team; class Team;
class Thread; class Thread;
class UserInterfaceListener;
class Value;
class ValueNode;
class ValueNodeChild;
class ValueNodeManager;
class DebugReportGenerator : public BLooper, public Team::Listener { class DebugReportGenerator : public BLooper, private Team::Listener,
private ValueNodeContainer::Listener {
public: public:
DebugReportGenerator(::Team* team); DebugReportGenerator(::Team* team,
UserInterfaceListener* listener);
~DebugReportGenerator(); ~DebugReportGenerator();
status_t Init(); status_t Init();
static DebugReportGenerator* Create(::Team* team); static DebugReportGenerator* Create(::Team* team,
UserInterfaceListener* listener);
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
virtual void ThreadStackTraceChanged( virtual void ThreadStackTraceChanged(
const Team::ThreadEvent& event); const Team::ThreadEvent& event);
virtual void ValueNodeValueChanged(ValueNode* node);
private: private:
status_t _GenerateReport(const entry_ref& outputPath); status_t _GenerateReport(const entry_ref& outputPath);
status_t _GenerateReportHeader(BString& output); status_t _GenerateReportHeader(BString& output);
@ -40,10 +52,19 @@ private:
status_t _DumpDebuggedThreadInfo(BString& output, status_t _DumpDebuggedThreadInfo(BString& output,
::Thread* thread); ::Thread* thread);
status_t _ResolveLocationIfNeeded(ValueNodeChild* child,
StackFrame* frame);
status_t _ResolveValueIfNeeded(ValueNode* node,
StackFrame* frame, int32 maxDepth);
private: private:
::Team* fTeam; ::Team* fTeam;
Architecture* fArchitecture; Architecture* fArchitecture;
sem_id fTeamDataSem; sem_id fTeamDataSem;
ValueNodeManager* fNodeManager;
UserInterfaceListener* fListener;
ValueNode* fWaitingNode;
::Thread* fTraceWaitingThread;
}; };
#endif // DEBUG_REPORT_GENERATOR_H #endif // DEBUG_REPORT_GENERATOR_H

View File

@ -277,13 +277,17 @@ TeamDebugger::~TeamDebugger()
thread = next; thread = next;
} }
} }
if (fReportGenerator != NULL) {
fReportGenerator->Lock();
fReportGenerator->Quit();
}
delete fImageInfoPendingThreads; delete fImageInfoPendingThreads;
delete fBreakpointManager; delete fBreakpointManager;
delete fWatchpointManager; delete fWatchpointManager;
delete fMemoryBlockManager; delete fMemoryBlockManager;
fReportGenerator->Lock();
fReportGenerator->Quit();
delete fWorker; delete fWorker;
delete fTeam; delete fTeam;
delete fFileManager; delete fFileManager;
@ -412,7 +416,7 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, bool stopInMain)
return error; return error;
// create the debug report generator // create the debug report generator
fReportGenerator = new(std::nothrow) DebugReportGenerator(fTeam); fReportGenerator = new(std::nothrow) DebugReportGenerator(fTeam, this);
if (fReportGenerator == NULL) if (fReportGenerator == NULL)
return B_NO_MEMORY; return B_NO_MEMORY;

View File

@ -0,0 +1,233 @@
/*
* Copyright 2012, Rene Gollent, rene@gollent.com.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#include "ValueNodeManager.h"
#include "AutoLocker.h"
#include "StackFrame.h"
#include "Thread.h"
#include "TypeHandlerRoster.h"
#include "ValueNode.h"
#include "Variable.h"
#include "VariableValueNodeChild.h"
ValueNodeManager::ValueNodeManager()
:
fContainer(NULL),
fStackFrame(NULL),
fThread(NULL)
{
}
ValueNodeManager::~ValueNodeManager()
{
SetStackFrame(NULL, NULL);
}
status_t
ValueNodeManager::SetStackFrame(Thread* thread,
StackFrame* stackFrame)
{
if (fContainer != NULL) {
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
fContainer->RemoveListener(this);
fContainer->RemoveAllChildren();
containerLocker.Unlock();
fContainer->ReleaseReference();
fContainer = NULL;
}
fStackFrame = stackFrame;
fThread = thread;
if (fStackFrame != NULL) {
fContainer = new(std::nothrow) ValueNodeContainer;
if (fContainer == NULL)
return B_NO_MEMORY;
status_t error = fContainer->Init();
if (error != B_OK) {
delete fContainer;
fContainer = NULL;
return error;
}
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
fContainer->AddListener(this);
for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i);
i++) {
_AddNode(variable);
}
for (int32 i = 0; Variable* variable
= fStackFrame->LocalVariableAt(i); i++) {
_AddNode(variable);
}
}
return B_OK;
}
bool
ValueNodeManager::AddListener(ValueNodeContainer::Listener* listener)
{
return fListeners.AddItem(listener);
}
void
ValueNodeManager::RemoveListener(ValueNodeContainer::Listener* listener)
{
fListeners.RemoveItem(listener);
}
void
ValueNodeManager::ValueNodeChanged(ValueNodeChild* nodeChild,
ValueNode* oldNode, ValueNode* newNode)
{
if (fContainer == NULL)
return;
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
if (oldNode != NULL)
newNode->CreateChildren();
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
fListeners.ItemAt(i)->ValueNodeChanged(nodeChild, oldNode, newNode);
}
void
ValueNodeManager::ValueNodeChildrenCreated(ValueNode* node)
{
if (fContainer == NULL)
return;
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
fListeners.ItemAt(i)->ValueNodeChildrenCreated(node);
}
void
ValueNodeManager::ValueNodeChildrenDeleted(ValueNode* node)
{
if (fContainer == NULL)
return;
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
fListeners.ItemAt(i)->ValueNodeChildrenDeleted(node);
}
void
ValueNodeManager::ValueNodeValueChanged(ValueNode* valueNode)
{
if (fContainer == NULL)
return;
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
// check whether we know the node
ValueNodeChild* nodeChild = valueNode->NodeChild();
if (nodeChild == NULL)
return;
if (valueNode->ChildCreationNeedsValue()
&& !valueNode->ChildrenCreated()) {
status_t error = valueNode->CreateChildren();
if (error == B_OK) {
for (int32 i = 0; i < valueNode->CountChildren(); i++) {
ValueNodeChild* child = valueNode->ChildAt(i);
_CreateValueNode(child);
AddChildNodes(child);
}
}
}
for (int32 i = fListeners.CountItems() - 1; i >= 0; i--)
fListeners.ItemAt(i)->ValueNodeValueChanged(valueNode);
}
void
ValueNodeManager::_AddNode(Variable* variable)
{
// create the node child for the variable
ValueNodeChild* nodeChild = new (std::nothrow) VariableValueNodeChild(
variable);
BReference<ValueNodeChild> nodeChildReference(nodeChild, true);
if (nodeChild == NULL || !fContainer->AddChild(nodeChild)) {
delete nodeChild;
return;
}
// automatically add child nodes for the top level nodes
AddChildNodes(nodeChild);
}
status_t
ValueNodeManager::_CreateValueNode(ValueNodeChild* nodeChild)
{
if (nodeChild->Node() != NULL)
return B_OK;
// create the node
ValueNode* valueNode;
status_t error;
if (nodeChild->IsInternal()) {
error = nodeChild->CreateInternalNode(valueNode);
} else {
error = TypeHandlerRoster::Default()->CreateValueNode(nodeChild,
nodeChild->GetType(), valueNode);
}
if (error != B_OK)
return error;
nodeChild->SetNode(valueNode);
valueNode->ReleaseReference();
return B_OK;
}
status_t
ValueNodeManager::AddChildNodes(ValueNodeChild* nodeChild)
{
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
// create a value node for the value node child, if doesn't have one yet
ValueNode* valueNode = nodeChild->Node();
if (valueNode == NULL) {
status_t error = _CreateValueNode(nodeChild);
if (error != B_OK)
return error;
valueNode = nodeChild->Node();
}
// check if this node requires child creation
// to be deferred until after its location/value have been resolved
if (valueNode->ChildCreationNeedsValue())
return B_OK;
// create the children, if not done yet
if (valueNode->ChildrenCreated())
return B_OK;
return valueNode->CreateChildren();
}

View File

@ -0,0 +1,54 @@
/*
* Copyright 2012, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef VALUE_NODE_MANAGER_H
#define VALUE_NODE_MANAGER_H
#include <Referenceable.h>
#include "ValueNodeContainer.h"
class StackFrame;
class Thread;
class Variable;
class ValueNodeManager : public BReferenceable,
private ValueNodeContainer::Listener {
public:
ValueNodeManager();
virtual ~ValueNodeManager();
status_t SetStackFrame(Thread* thread,
StackFrame* frame);
bool AddListener(
ValueNodeContainer::Listener* listener);
void RemoveListener(
ValueNodeContainer::Listener* listener);
virtual void ValueNodeChanged(ValueNodeChild* nodeChild,
ValueNode* oldNode, ValueNode* newNode);
virtual void ValueNodeChildrenCreated(ValueNode* node);
virtual void ValueNodeChildrenDeleted(ValueNode* node);
virtual void ValueNodeValueChanged(ValueNode* node);
ValueNodeContainer* GetContainer() const { return fContainer; };
status_t AddChildNodes(ValueNodeChild* nodeChild);
private:
typedef BObjectList<ValueNodeContainer::Listener> ListenerList;
void _AddNode(Variable* variable);
status_t _CreateValueNode(ValueNodeChild* nodeChild);
private:
ValueNodeContainer* fContainer;
StackFrame* fStackFrame;
Thread* fThread;
ListenerList fListeners;
};
#endif // VALUE_NODE_MANAGER_H

View File

@ -28,6 +28,7 @@ BreakpointsView::BreakpointsView(Team* team, Listener* listener)
BGroupView(B_HORIZONTAL, 4.0f), BGroupView(B_HORIZONTAL, 4.0f),
fTeam(team), fTeam(team),
fBreakpoint(NULL), fBreakpoint(NULL),
fWatchpoint(NULL),
fListView(NULL), fListView(NULL),
fToggleBreakpointButton(NULL), fToggleBreakpointButton(NULL),
fRemoveBreakpointButton(NULL), fRemoveBreakpointButton(NULL),

View File

@ -50,7 +50,7 @@
#include "ValueHandlerRoster.h" #include "ValueHandlerRoster.h"
#include "ValueLocation.h" #include "ValueLocation.h"
#include "ValueNode.h" #include "ValueNode.h"
#include "ValueNodeContainer.h" #include "ValueNodeManager.h"
#include "Variable.h" #include "Variable.h"
#include "VariableValueNodeChild.h" #include "VariableValueNodeChild.h"
#include "VariablesViewState.h" #include "VariablesViewState.h"
@ -451,17 +451,10 @@ private:
ValueNodeChild* nodeChild, ValueNodeChild* nodeChild,
bool isPresentationNode = false, bool isPresentationNode = false,
bool isOnlyChild = false); bool isOnlyChild = false);
void _AddNode(Variable* variable);
status_t _CreateValueNode(ValueNodeChild* nodeChild);
status_t _AddChildNodes(ValueNodeChild* nodeChild);
// ModelNode* _GetNode(Variable* variable,
// TypeComponentPath* path) const;
private: private:
Thread* fThread; Thread* fThread;
StackFrame* fStackFrame; ValueNodeManager* fNodeManager;
ValueNodeContainer* fContainer;
ContainerListener* fContainerListener; ContainerListener* fContainerListener;
NodeList fNodes; NodeList fNodes;
NodeTable fNodeTable; NodeTable fNodeTable;
@ -841,8 +834,8 @@ VariablesView::ContainerListener::ModelNodeRestoreViewStateRequested(
VariablesView::VariableTableModel::VariableTableModel() VariablesView::VariableTableModel::VariableTableModel()
: :
fStackFrame(NULL), fThread(NULL),
fContainer(NULL), fNodeManager(NULL),
fContainerListener(NULL), fContainerListener(NULL),
fNodeTable() fNodeTable()
{ {
@ -851,13 +844,18 @@ VariablesView::VariableTableModel::VariableTableModel()
VariablesView::VariableTableModel::~VariableTableModel() VariablesView::VariableTableModel::~VariableTableModel()
{ {
SetStackFrame(NULL, NULL); if (fNodeManager != NULL)
fNodeManager->ReleaseReference();
} }
status_t status_t
VariablesView::VariableTableModel::Init() VariablesView::VariableTableModel::Init()
{ {
fNodeManager = new(std::nothrow) ValueNodeManager();
if (fNodeManager == NULL)
return B_NO_MEMORY;
return fNodeTable.Init(); return fNodeTable.Init();
} }
@ -870,10 +868,8 @@ VariablesView::VariableTableModel::SetContainerListener(
return; return;
if (fContainerListener != NULL) { if (fContainerListener != NULL) {
if (fContainer != NULL) { if (fNodeManager != NULL)
AutoLocker<ValueNodeContainer> containerLocker(fContainer); fNodeManager->RemoveListener(fContainerListener);
fContainer->RemoveListener(fContainerListener);
}
fContainerListener->SetModel(NULL); fContainerListener->SetModel(NULL);
} }
@ -883,10 +879,8 @@ VariablesView::VariableTableModel::SetContainerListener(
if (fContainerListener != NULL) { if (fContainerListener != NULL) {
fContainerListener->SetModel(this); fContainerListener->SetModel(this);
if (fContainer != NULL) { if (fNodeManager != NULL)
AutoLocker<ValueNodeContainer> containerLocker(fContainer); fNodeManager->AddListener(fContainerListener);
fContainer->AddListener(fContainerListener);
}
} }
} }
@ -895,17 +889,9 @@ void
VariablesView::VariableTableModel::SetStackFrame(Thread* thread, VariablesView::VariableTableModel::SetStackFrame(Thread* thread,
StackFrame* stackFrame) StackFrame* stackFrame)
{ {
if (fContainer != NULL) { fThread = thread;
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
if (fContainerListener != NULL) fNodeManager->SetStackFrame(thread, stackFrame);
fContainer->RemoveListener(fContainerListener);
fContainer->RemoveAllChildren();
containerLocker.Unlock();
fContainer->ReleaseReference();
fContainer = NULL;
}
fNodeTable.Clear(true); fNodeTable.Clear(true);
@ -917,38 +903,19 @@ VariablesView::VariableTableModel::SetStackFrame(Thread* thread,
NotifyNodesRemoved(TreeTablePath(), 0, count); NotifyNodesRemoved(TreeTablePath(), 0, count);
} }
fStackFrame = stackFrame; if (stackFrame == NULL)
fThread = thread; return;
if (fStackFrame != NULL) { ValueNodeContainer* container = fNodeManager->GetContainer();
fContainer = new(std::nothrow) ValueNodeContainer; AutoLocker<ValueNodeContainer> containerLocker(container);
if (fContainer == NULL)
return;
status_t error = fContainer->Init(); for (int32 i = 0; i < container->CountChildren(); i++) {
if (error != B_OK) { VariableValueNodeChild* child = dynamic_cast<VariableValueNodeChild *>(
delete fContainer; container->ChildAt(i));
fContainer = NULL; _AddNode(child->GetVariable(), NULL, child);
return; // top level nodes get their children added immediately
} // so those won't invoke our callback hook. Add them directly here.
ValueNodeChildrenCreated(child->Node());
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
if (fContainerListener != NULL)
fContainer->AddListener(fContainerListener);
for (int32 i = 0; Variable* variable = fStackFrame->ParameterAt(i);
i++) {
_AddNode(variable);
}
for (int32 i = 0; Variable* variable
= fStackFrame->LocalVariableAt(i); i++) {
_AddNode(variable);
}
// if (!fNodes.IsEmpty())
// NotifyNodesAdded(TreeTablePath(), 0, fNodes.CountItems());
} }
} }
@ -957,19 +924,14 @@ void
VariablesView::VariableTableModel::ValueNodeChanged(ValueNodeChild* nodeChild, VariablesView::VariableTableModel::ValueNodeChanged(ValueNodeChild* nodeChild,
ValueNode* oldNode, ValueNode* newNode) ValueNode* oldNode, ValueNode* newNode)
{ {
if (fContainer == NULL) AutoLocker<ValueNodeContainer> containerLocker(
return; fNodeManager->GetContainer());
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
ModelNode* modelNode = fNodeTable.Lookup(nodeChild); ModelNode* modelNode = fNodeTable.Lookup(nodeChild);
if (modelNode == NULL) if (modelNode == NULL)
return; return;
if (oldNode != NULL) { if (oldNode != NULL)
ValueNodeChildrenDeleted(oldNode);
newNode->CreateChildren();
NotifyNodeChanged(modelNode); NotifyNodeChanged(modelNode);
}
} }
@ -977,10 +939,8 @@ void
VariablesView::VariableTableModel::ValueNodeChildrenCreated( VariablesView::VariableTableModel::ValueNodeChildrenCreated(
ValueNode* valueNode) ValueNode* valueNode)
{ {
if (fContainer == NULL) AutoLocker<ValueNodeContainer> containerLocker(
return; fNodeManager->GetContainer());
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
// check whether we know the node // check whether we know the node
ValueNodeChild* nodeChild = valueNode->NodeChild(); ValueNodeChild* nodeChild = valueNode->NodeChild();
@ -1016,10 +976,8 @@ VariablesView::VariableTableModel::ValueNodeChildrenCreated(
void void
VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node) VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
{ {
if (fContainer == NULL) AutoLocker<ValueNodeContainer> containerLocker(
return; fNodeManager->GetContainer());
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
// check whether we know the node // check whether we know the node
ValueNodeChild* nodeChild = node->NodeChild(); ValueNodeChild* nodeChild = node->NodeChild();
@ -1058,10 +1016,8 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
void void
VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode) VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode)
{ {
if (fContainer == NULL) AutoLocker<ValueNodeContainer> containerLocker(
return; fNodeManager->GetContainer());
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
// check whether we know the node // check whether we know the node
ValueNodeChild* nodeChild = valueNode->NodeChild(); ValueNodeChild* nodeChild = valueNode->NodeChild();
@ -1072,19 +1028,6 @@ VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode)
if (modelNode == NULL) if (modelNode == NULL)
return; return;
if (valueNode->ChildCreationNeedsValue()
&& !valueNode->ChildrenCreated()) {
status_t error = valueNode->CreateChildren();
if (error != B_OK)
return;
for (int32 i = 0; i < valueNode->CountChildren(); i++) {
ValueNodeChild* child = valueNode->ChildAt(i);
_CreateValueNode(child);
_AddChildNodes(child);
}
}
// check whether the value actually changed // check whether the value actually changed
Value* value = valueNode->GetValue(); Value* value = valueNode->GetValue();
if (value == modelNode->GetValue()) if (value == modelNode->GetValue())
@ -1196,7 +1139,7 @@ VariablesView::VariableTableModel::GetValueAt(void* object, int32 columnIndex,
if (piece.type != VALUE_PIECE_LOCATION_MEMORY) if (piece.type != VALUE_PIECE_LOCATION_MEMORY)
return false; return false;
data.SetToFormat("[@ 0x%llx]", piece.address); data.SetToFormat("[@ %#" B_PRIx64 "]", piece.address);
_value.SetTo(data); _value.SetTo(data);
return true; return true;
} }
@ -1214,11 +1157,8 @@ VariablesView::VariableTableModel::GetValueAt(void* object, int32 columnIndex,
void void
VariablesView::VariableTableModel::NodeExpanded(ModelNode* node) VariablesView::VariableTableModel::NodeExpanded(ModelNode* node)
{ {
if (fContainer == NULL) AutoLocker<ValueNodeContainer> containerLocker(
return; fNodeManager->GetContainer());
AutoLocker<ValueNodeContainer> containerLocker(fContainer);
// add children of all children // add children of all children
// If the node only has a hidden child, add the child's children instead. // If the node only has a hidden child, add the child's children instead.
@ -1230,7 +1170,7 @@ VariablesView::VariableTableModel::NodeExpanded(ModelNode* node)
// add the children // add the children
for (int32 i = 0; ModelNode* child = node->ChildAt(i); i++) for (int32 i = 0; ModelNode* child = node->ChildAt(i); i++)
_AddChildNodes(child->NodeChild()); fNodeManager->AddChildNodes(child->NodeChild());
} }
@ -1272,13 +1212,13 @@ VariablesView::VariableTableModel::GetToolTipForTablePath(
BString pieceData; BString pieceData;
switch (piece.type) { switch (piece.type) {
case VALUE_PIECE_LOCATION_MEMORY: case VALUE_PIECE_LOCATION_MEMORY:
pieceData.SetToFormat("(%ld): Address: 0x%llx, Size: " pieceData.SetToFormat("(%" B_PRId32 "): Address: %#" B_PRIx64
"%lld bytes", i, piece.address, piece.size); ", Size: %" B_PRId64 " bytes", i, piece.address, piece.size);
break; break;
case VALUE_PIECE_LOCATION_REGISTER: case VALUE_PIECE_LOCATION_REGISTER:
{ {
Architecture* architecture = fThread->GetTeam()->GetArchitecture(); Architecture* architecture = fThread->GetTeam()->GetArchitecture();
pieceData.SetToFormat("(%ld): Register (%s)", pieceData.SetToFormat("(%" B_PRId32 "): Register (%s)",
i, architecture->Registers()[piece.reg].Name()); i, architecture->Registers()[piece.reg].Name());
break; break;
@ -1365,150 +1305,12 @@ VariablesView::VariableTableModel::_AddNode(Variable* variable,
// if the node is hidden, add its children // if the node is hidden, add its children
if (node->IsHidden()) if (node->IsHidden())
_AddChildNodes(nodeChild); fNodeManager->AddChildNodes(nodeChild);
return B_OK; return B_OK;
} }
void
VariablesView::VariableTableModel::_AddNode(Variable* variable)
{
// create the node child for the variable
ValueNodeChild* nodeChild = new (std::nothrow) VariableValueNodeChild(
variable);
BReference<ValueNodeChild> nodeChildReference(nodeChild, true);
if (nodeChild == NULL || !fContainer->AddChild(nodeChild)) {
delete nodeChild;
return;
}
// create the model node
status_t error = _AddNode(variable, NULL, nodeChild, false);
if (error != B_OK)
return;
// automatically add child nodes for the top level nodes
_AddChildNodes(nodeChild);
}
status_t
VariablesView::VariableTableModel::_CreateValueNode(ValueNodeChild* nodeChild)
{
if (nodeChild->Node() != NULL)
return B_OK;
// create the node
ValueNode* valueNode;
status_t error;
if (nodeChild->IsInternal()) {
error = nodeChild->CreateInternalNode(valueNode);
} else {
error = TypeHandlerRoster::Default()->CreateValueNode(nodeChild,
nodeChild->GetType(), valueNode);
}
if (error != B_OK)
return error;
nodeChild->SetNode(valueNode);
valueNode->ReleaseReference();
return B_OK;
}
status_t
VariablesView::VariableTableModel::_AddChildNodes(ValueNodeChild* nodeChild)
{
// create a value node for the value node child, if doesn't have one yet
ValueNode* valueNode = nodeChild->Node();
if (valueNode == NULL) {
status_t error = _CreateValueNode(nodeChild);
if (error != B_OK)
return error;
valueNode = nodeChild->Node();
}
// check if this node requires child creation
// to be deferred until after its location/value have been resolved
if (valueNode->ChildCreationNeedsValue())
return B_OK;
// create the children, if not done yet
if (valueNode->ChildrenCreated())
return B_OK;
return valueNode->CreateChildren();
}
//VariablesView::ModelNode*
//VariablesView::VariableTableModel::_GetNode(Variable* variable,
// TypeComponentPath* path) const
//{
// // find the variable node
// ModelNode* node;
// for (int32 i = 0; (node = fNodes.ItemAt(i)) != NULL; i++) {
// if (node->GetVariable() == variable)
// break;
// }
// if (node == NULL)
// return NULL;
//
// // Now walk along the path, finding the respective child node for each
// // component (might be several components at once).
// int32 componentCount = path->CountComponents();
// for (int32 i = 0; i < componentCount;) {
// ModelNode* childNode = NULL;
//
// for (int32 k = 0; (childNode = node->ChildAt(k)) != NULL; k++) {
// TypeComponentPath* childPath = childNode->Path();
// int32 childComponentCount = childPath->CountComponents();
// if (childComponentCount > componentCount)
// continue;
//
// for (int32 componentIndex = i;
// componentIndex < childComponentCount; componentIndex++) {
// TypeComponent childComponent
// = childPath->ComponentAt(componentIndex);
// TypeComponent pathComponent
// = path->ComponentAt(componentIndex);
// if (childComponent != pathComponent) {
// if (componentIndex + 1 == childComponentCount
// && pathComponent.HasPrefix(childComponent)) {
// // The last child component is a prefix of the
// // corresponding path component. We consider this a
// // match, but need to recheck the component with the
// // next node level.
// childComponentCount--;
// break;
// }
//
// // mismatch -- skip the child
// childNode = NULL;
// break;
// }
// }
//
// if (childNode != NULL) {
// // got a match -- skip the matched children components
// i = childComponentCount;
// break;
// }
// }
//
// if (childNode == NULL)
// return NULL;
//
// node = childNode;
// }
//
// return node;
//}
bool bool
VariablesView::VariableTableModel::GetTreePath(ModelNode* node, VariablesView::VariableTableModel::GetTreePath(ModelNode* node,
TreeTablePath& _path) const TreeTablePath& _path) const

View File

@ -11,6 +11,7 @@
#include <DateTime.h> #include <DateTime.h>
#include <Path.h> #include <Path.h>
#include <String.h>
#include <Variant.h> #include <Variant.h>
#include "FunctionInstance.h" #include "FunctionInstance.h"
@ -18,6 +19,9 @@
#include "StackFrame.h" #include "StackFrame.h"
#include "Team.h" #include "Team.h"
#include "Thread.h" #include "Thread.h"
#include "Type.h"
#include "Value.h"
#include "ValueNode.h"
/*static*/ const char* /*static*/ const char*
@ -156,3 +160,68 @@ UiUtils::ReportNameForTeam(::Team* team, char* buffer, size_t bufferSize)
return buffer; return buffer;
} }
/*static*/ void
UiUtils::PrintValueNodeGraph(BString& _output, StackFrame* frame,
ValueNodeChild* child, int32 indentLevel, int32 maxDepth)
{
_output.Append('\t', indentLevel);
_output << child->Name();
ValueNode* node = child->Node();
if (node == NULL) {
_output << ": Unavailable\n";
return;
}
if (node->GetType()->Kind() != TYPE_COMPOUND) {
_output << ": ";
status_t resolutionState = node->LocationAndValueResolutionState();
if (resolutionState == VALUE_NODE_UNRESOLVED)
_output << "Unresolved";
else if (resolutionState == B_OK) {
Value* value = node->GetValue();
if (value != NULL) {
BString valueData;
value->ToString(valueData);
_output << valueData;
} else
_output << "Unavailable";
} else
_output << strerror(resolutionState);
}
if (maxDepth == 0 || node->CountChildren() == 0) {
_output << "\n";
return;
}
if (node->CountChildren() == 1
&& node->GetType()->Kind() == TYPE_ADDRESS
&& node->ChildAt(0)->GetType()->Kind() == TYPE_COMPOUND) {
// for the case of a pointer to a compound type,
// we want to hide the intervening compound node and print
// the children directly.
node = node->ChildAt(0)->Node();
}
if (node != NULL) {
_output << " {\n";
for (int32 i = 0; i < node->CountChildren(); i++) {
// don't dump compound nodes if our depth limit won't allow
// us to traverse into their children anyways, and the top
// level node contains no data of intereest.
if (node->ChildAt(i)->GetType()->Kind() != TYPE_COMPOUND
|| maxDepth > 1) {
PrintValueNodeGraph(_output, frame, node->ChildAt(i),
indentLevel + 1, maxDepth - 1);
}
}
_output.Append('\t', indentLevel);
_output << "}\n";
}
return;
}

View File

@ -10,10 +10,11 @@
#include <image.h> #include <image.h>
class BString;
class BVariant; class BVariant;
class StackFrame; class StackFrame;
class Team; class Team;
class ValueNodeChild;
class UiUtils { class UiUtils {
public: public:
@ -29,6 +30,13 @@ public:
static const char* ReportNameForTeam(::Team* team, static const char* ReportNameForTeam(::Team* team,
char* buffer, size_t bufferSize); char* buffer, size_t bufferSize);
// this function assumes the value nodes have already been resolved
// (if possible).
static void PrintValueNodeGraph(BString& _output,
StackFrame* frame,
ValueNodeChild* child,
int32 indentLevel, int32 maxDepth);
}; };

View File

@ -307,6 +307,9 @@ BListValueNode::CreateChildren()
if (fChildrenCreated) if (fChildrenCreated)
return B_OK; return B_OK;
if (fLocationResolutionState != B_OK)
return fLocationResolutionState;
if (fItemCountType != NULL) { if (fItemCountType != NULL) {
BListItemCountNodeChild* countChild = new(std::nothrow) BListItemCountNodeChild* countChild = new(std::nothrow)
BListItemCountNodeChild(fItemCountLocation, this, fItemCountType); BListItemCountNodeChild(fItemCountLocation, this, fItemCountType);

View File

@ -183,66 +183,62 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
if (strcmp(member->Name(), "fHeader") == 0) { if (strcmp(member->Name(), "fHeader") == 0) {
error = baseType->ResolveDataMemberLocation(member, error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation); *location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) { if (error != B_OK) {
TRACE_LOCALS( TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): " "BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n", "failed to resolve location of header member: %s\n",
strerror(error)); strerror(error));
delete memberLocation;
return error; return error;
} }
error = valueLoader->LoadValue(memberLocation, valueType, error = valueLoader->LoadValue(memberLocation, valueType,
false, headerAddress); false, headerAddress);
delete memberLocation;
if (error != B_OK) if (error != B_OK)
return error; return error;
} else if (strcmp(member->Name(), "what") == 0) { } else if (strcmp(member->Name(), "what") == 0) {
error = baseType->ResolveDataMemberLocation(member, error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation); *location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) { if (error != B_OK) {
TRACE_LOCALS( TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): " "BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n", "failed to resolve location of header member: %s\n",
strerror(error)); strerror(error));
delete memberLocation;
return error; return error;
} }
error = valueLoader->LoadValue(memberLocation, valueType, error = valueLoader->LoadValue(memberLocation, valueType,
false, what); false, what);
delete memberLocation;
if (error != B_OK) if (error != B_OK)
return error; return error;
} else if (strcmp(member->Name(), "fFields") == 0) { } else if (strcmp(member->Name(), "fFields") == 0) {
error = baseType->ResolveDataMemberLocation(member, error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation); *location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) { if (error != B_OK) {
TRACE_LOCALS( TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): " "BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of field member: %s\n", "failed to resolve location of field member: %s\n",
strerror(error)); strerror(error));
delete memberLocation;
return error; return error;
} }
error = valueLoader->LoadValue(memberLocation, valueType, error = valueLoader->LoadValue(memberLocation, valueType,
false, fieldAddress); false, fieldAddress);
delete memberLocation;
if (error != B_OK) if (error != B_OK)
return error; return error;
} else if (strcmp(member->Name(), "fData") == 0) { } else if (strcmp(member->Name(), "fData") == 0) {
error = baseType->ResolveDataMemberLocation(member, error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation); *location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) { if (error != B_OK) {
TRACE_LOCALS( TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): " "BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of data member: %s\n", "failed to resolve location of data member: %s\n",
strerror(error)); strerror(error));
delete memberLocation;
return error; return error;
} }
error = valueLoader->LoadValue(memberLocation, valueType, error = valueLoader->LoadValue(memberLocation, valueType,
false, fDataLocation); false, fDataLocation);
delete memberLocation;
if (error != B_OK) if (error != B_OK)
return error; return error;
} }

View File

@ -84,6 +84,12 @@ CStringValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
ValuePieceLocation piece; ValuePieceLocation piece;
piece.SetToMemory(addressData.ToUInt64()); piece.SetToMemory(addressData.ToUInt64());
error = valueLoader->LoadStringValue(addressData, maxSize, valueData);
if (error != B_OK)
return error;
piece.size = valueData.Length();
ValueLocation* stringLocation = new(std::nothrow) ValueLocation( ValueLocation* stringLocation = new(std::nothrow) ValueLocation(
valueLoader->GetArchitecture()->IsBigEndian(), piece); valueLoader->GetArchitecture()->IsBigEndian(), piece);

View File

@ -21,6 +21,8 @@ public:
virtual Type* GetType() const; virtual Type* GetType() const;
virtual ValueNode* Parent() const; virtual ValueNode* Parent() const;
Variable* GetVariable() const { return fVariable; };
virtual status_t ResolveLocation(ValueLoader* valueLoader, virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location); ValueLocation*& _location);

View File

@ -43,6 +43,8 @@ const uint32 MSG_SOURCETEXT = 'mSTX';
const uint32 MSG_DESTTEXT = 'mDTX'; const uint32 MSG_DESTTEXT = 'mDTX';
const uint32 MSG_SHOWCONTENTS = 'mSCT'; const uint32 MSG_SHOWCONTENTS = 'mSCT';
const int32 MAX_STATUS_LENGTH = 35;
#undef B_TRANSLATION_CONTEXT #undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "ExpanderWindow" #define B_TRANSLATION_CONTEXT "ExpanderWindow"
@ -92,6 +94,12 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
BScrollView* scrollView = new BScrollView("", fListingText, BScrollView* scrollView = new BScrollView("", fListingText,
B_INVALIDATE_AFTER_LAYOUT, true, true); B_INVALIDATE_AFTER_LAYOUT, true, true);
// workaround to let the layout manager estimate
// the width of status view and fix the #5289
// we assume that spaces are twice narrower than normal chars
BString statusPlaceholderString;
statusPlaceholderString.SetTo(' ', MAX_STATUS_LENGTH * 2);
BView* topView = layout->View(); BView* topView = layout->View();
const float spacing = be_control_look->DefaultItemSpacing(); const float spacing = be_control_look->DefaultItemSpacing();
topView->AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing) topView->AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing)
@ -110,7 +118,8 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
.Add(fShowContents = new BCheckBox( .Add(fShowContents = new BCheckBox(
B_TRANSLATE("Show contents"), B_TRANSLATE("Show contents"),
new BMessage(MSG_SHOWCONTENTS))) new BMessage(MSG_SHOWCONTENTS)))
.Add(fStatusView = new BStringView(NULL, NULL)) .Add(fStatusView = new BStringView(NULL,
statusPlaceholderString))
.End() .End()
.End() .End()
.End() .End()
@ -412,7 +421,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
// thread has finished (finished, quit, killed, we don't know) // thread has finished (finished, quit, killed, we don't know)
// reset window state // reset window state
if (fExpandingStarted) { if (fExpandingStarted) {
fStatusView->SetText(B_TRANSLATE("File expanded")); SetStatus(B_TRANSLATE("File expanded"));
StopExpanding(); StopExpanding();
OpenDestFolder(); OpenDestFolder();
CloseWindowOrKeepOpen(); CloseWindowOrKeepOpen();
@ -421,13 +430,13 @@ ExpanderWindow::MessageReceived(BMessage* msg)
StopListing(); StopListing();
_ExpandListingText(); _ExpandListingText();
} else } else
fStatusView->SetText(""); SetStatus("");
break; break;
case 'exrr': // thread has finished case 'exrr': // thread has finished
// reset window state // reset window state
fStatusView->SetText(B_TRANSLATE("Error when expanding archive")); SetStatus(B_TRANSLATE("Error when expanding archive"));
CloseWindowOrKeepOpen(); CloseWindowOrKeepOpen();
break; break;
@ -614,7 +623,7 @@ ExpanderWindow::StartExpanding()
BPath path(&entry); BPath path(&entry);
BString text(B_TRANSLATE("Expanding '%s'")); BString text(B_TRANSLATE("Expanding '%s'"));
text.ReplaceFirst("%s", path.Leaf()); text.ReplaceFirst("%s", path.Leaf());
fStatusView->SetText(text.String()); SetStatus(text.String());
fExpandingThread = new ExpanderThread(&message, new BMessenger(this)); fExpandingThread = new ExpanderThread(&message, new BMessenger(this));
fExpandingThread->Start(); fExpandingThread->Start();
@ -713,6 +722,18 @@ ExpanderWindow::_UpdateWindowSize(bool showContents)
} }
void
ExpanderWindow::SetStatus(BString text)
{
if (text.Length() >= MAX_STATUS_LENGTH) {
text.Truncate(MAX_STATUS_LENGTH - 1);
text << B_UTF8_ELLIPSIS;
}
fStatusView->SetText(text);
}
void void
ExpanderWindow::StartListing() ExpanderWindow::StartListing()
{ {
@ -750,7 +771,7 @@ ExpanderWindow::StartListing()
BPath path(&entry); BPath path(&entry);
BString text(B_TRANSLATE("Creating listing for '%s'")); BString text(B_TRANSLATE("Creating listing for '%s'"));
text.ReplaceFirst("%s", path.Leaf()); text.ReplaceFirst("%s", path.Leaf());
fStatusView->SetText(text.String()); SetStatus(text.String());
fListingText->SetText(""); fListingText->SetText("");
fListingThread = new ExpanderThread(&message, new BMessenger(this)); fListingThread = new ExpanderThread(&message, new BMessenger(this));
@ -781,7 +802,7 @@ ExpanderWindow::StopListing(void)
fSourceButton->SetEnabled(true); fSourceButton->SetEnabled(true);
fDestButton->SetEnabled(true); fDestButton->SetEnabled(true);
fExpandButton->SetEnabled(true); fExpandButton->SetEnabled(true);
fStatusView->SetText(""); SetStatus("");
} }

View File

@ -54,6 +54,7 @@ private:
void _ExpandListingText(); void _ExpandListingText();
void StartListing(); void StartListing();
void StopListing(); void StopListing();
void SetStatus(BString text);
bool ValidateDest(); bool ValidateDest();
private: private:

View File

@ -145,11 +145,13 @@ App::_StoreSettingsIfNeeded()
BMessage settings('sett'); BMessage settings('sett');
for (int32 i = 0; BWindow* window = WindowAt(i); i++) { for (int32 i = 0; BWindow* window = WindowAt(i); i++) {
if (MainWindow* padWindow = dynamic_cast<MainWindow*>(window)) { if (MainWindow* padWindow = dynamic_cast<MainWindow*>(window)) {
BMessage* windowSettings = padWindow->Settings(); if (padWindow->Lock()) {
if (windowSettings && padWindow->Lock()) { BMessage* windowSettings = padWindow->Settings();
padWindow->SaveSettings(windowSettings); if (windowSettings) {
padWindow->SaveSettings(windowSettings);
settings.AddMessage("window", windowSettings);
}
padWindow->Unlock(); padWindow->Unlock();
settings.AddMessage("window", windowSettings);
} }
} }
} }

View File

@ -90,19 +90,21 @@ MainWindow::QuitRequested()
if (dynamic_cast<MainWindow*>(window)) if (dynamic_cast<MainWindow*>(window))
padWindowCount++; padWindowCount++;
} }
bool canClose = true;
if (padWindowCount == 1) { if (padWindowCount == 1) {
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
return false; canClose = false;
} else { } else {
BAlert* alert = new BAlert(B_TRANSLATE("last chance"), BAlert* alert = new BAlert(B_TRANSLATE("last chance"),
B_TRANSLATE("Really close this pad?\n" B_TRANSLATE("Really close this pad?\n"
"(The pad will not be remembered.)"), "(The pad will not be remembered.)"),
B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL); B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL);
alert->SetShortcut(1, B_ESCAPE); alert->SetShortcut(1, B_ESCAPE);
if (alert->Go() == 1) if (alert->Go() == 1)
return false; canClose = false;
} }
return true; return canClose;
} }

View File

@ -1691,6 +1691,8 @@ TMailWindow::QuitRequested()
|| strlen(fHeaderView->fSubject->Text()) || strlen(fHeaderView->fSubject->Text())
|| (fHeaderView->fCc && strlen(fHeaderView->fCc->Text())) || (fHeaderView->fCc && strlen(fHeaderView->fCc->Text()))
|| (fHeaderView->fBcc && strlen(fHeaderView->fBcc->Text())) || (fHeaderView->fBcc && strlen(fHeaderView->fBcc->Text()))
|| (fContentView->fTextView
&& strlen(fContentView->fTextView->Text()))
|| (fEnclosuresView != NULL || (fEnclosuresView != NULL
&& fEnclosuresView->fList->CountItems()))) { && fEnclosuresView->fList->CountItems()))) {
if (fResending) { if (fResending) {
@ -2548,15 +2550,16 @@ TMailWindow::SaveAsDraft()
return status; return status;
case B_OK: case B_OK:
{ {
char fileName[512], *eofn; char fileName[B_FILE_NAME_LENGTH];
int32 i;
// save as some version of the message's subject // save as some version of the message's subject
strncpy(fileName, fHeaderView->fSubject->Text(), if (strlen(fHeaderView->fSubject->Text()) == 0)
sizeof(fileName)-10); strlcpy(fileName, B_TRANSLATE("Untitled"),
fileName[sizeof(fileName)-10]='\0'; sizeof(fileName));
// terminate like strncpy doesn't else
eofn = fileName + strlen(fileName); strlcpy(fileName, fHeaderView->fSubject->Text(),
sizeof(fileName));
uint32 originalLength = strlen(fileName);
// convert /, \ and : to - // convert /, \ and : to -
for (char *bad = fileName; (bad = strchr(bad, '/')) != NULL; for (char *bad = fileName; (bad = strchr(bad, '/')) != NULL;
@ -2568,12 +2571,19 @@ TMailWindow::SaveAsDraft()
// Create the file; if the name exists, find a unique name // Create the file; if the name exists, find a unique name
flags = B_WRITE_ONLY | B_CREATE_FILE | B_FAIL_IF_EXISTS; flags = B_WRITE_ONLY | B_CREATE_FILE | B_FAIL_IF_EXISTS;
for (i = 1; (status = draft.SetTo(&dir, fileName, flags)) int32 i = 1;
!= B_OK; i++) { do {
if (status != B_FILE_EXISTS) status = draft.SetTo(&dir, fileName, flags);
return status; if (status == B_OK)
sprintf(eofn, "%ld", i); break;
} char appendix[B_FILE_NAME_LENGTH];
sprintf(appendix, " %ld", i++);
int32 pos = min_c(sizeof(fileName) - strlen(appendix),
originalLength);
sprintf(fileName + pos, "%s", appendix);
} while (status == B_FILE_EXISTS);
if (status != B_OK)
return status;
// Cache the ref // Cache the ref
if (fRef == NULL) if (fRef == NULL)
@ -2645,6 +2655,8 @@ TMailWindow::SaveAsDraft()
fDraft = true; fDraft = true;
fChanged = false; fChanged = false;
fSaveButton->SetEnabled(false);
return B_OK; return B_OK;
} }

View File

@ -2713,6 +2713,7 @@ ls( httpd_conn* hc )
send_mime( send_mime(
hc, 200, ok200title, "", "", "text/html; charset=%s", (off_t) -1, hc, 200, ok200title, "", "", "text/html; charset=%s", (off_t) -1,
hc->sb.st_mtime ); hc->sb.st_mtime );
free(de);
} }
else if ( hc->method == METHOD_GET ) else if ( hc->method == METHOD_GET )
{ {
@ -2947,7 +2948,6 @@ ls( httpd_conn* hc )
free(de); free(de);
return -1; return -1;
} }
free(de);
return 0; return 0;
} }

View File

@ -25,7 +25,7 @@ const uint32 MENU_NEW = 'MFnw';
const uint32 MENU_OPEN = 'MFop'; const uint32 MENU_OPEN = 'MFop';
const uint32 MENU_SAVE = 'MSav'; const uint32 MENU_SAVE = 'MSav';
const uint32 MENU_SAVEAS = 'MEsa'; const uint32 MENU_SAVEAS = 'MEsa';
const uint32 MENU_REVERT = 'MFre'; const uint32 MENU_RELOAD = 'MFrl';
const uint32 MENU_CLOSE = 'MFcl'; const uint32 MENU_CLOSE = 'MFcl';
const uint32 MENU_PAGESETUP = 'MFps'; const uint32 MENU_PAGESETUP = 'MFps';
const uint32 MENU_PRINT = 'MFpr'; const uint32 MENU_PRINT = 'MFpr';

View File

@ -73,8 +73,11 @@ StyledEditView::SetSuppressChanges(bool suppressChanges)
status_t status_t
StyledEditView::GetStyledText(BPositionIO* stream) StyledEditView::GetStyledText(BPositionIO* stream, const char* forceEncoding)
{ {
if (forceEncoding != NULL)
fEncoding = strcmp(forceEncoding, "auto") != 0 ? forceEncoding : "";
fSuppressChanges = true; fSuppressChanges = true;
status_t result = BTranslationUtils::GetStyledText(stream, this, status_t result = BTranslationUtils::GetStyledText(stream, this,
fEncoding.String()); fEncoding.String());
@ -85,24 +88,25 @@ StyledEditView::GetStyledText(BPositionIO* stream)
BNode* node = dynamic_cast<BNode*>(stream); BNode* node = dynamic_cast<BNode*>(stream);
if (node != NULL) { if (node != NULL) {
// get encoding if (forceEncoding == NULL) {
if (node->ReadAttrString("be:encoding", &fEncoding) != B_OK) { // get encoding
// try to read as "int32" if (node->ReadAttrString("be:encoding", &fEncoding) != B_OK) {
int32 encoding; // try to read as "int32"
ssize_t bytesRead = node->ReadAttr("be:encoding", B_INT32_TYPE, 0, int32 encoding;
&encoding, sizeof(encoding)); ssize_t bytesRead = node->ReadAttr("be:encoding", B_INT32_TYPE, 0,
if (bytesRead == (ssize_t)sizeof(encoding)) { &encoding, sizeof(encoding));
if (encoding == 65535) { if (bytesRead == (ssize_t)sizeof(encoding)) {
fEncoding = "UTF-8"; if (encoding == 65535) {
} else { fEncoding = "UTF-8";
const BCharacterSet* characterSet } else {
= BCharacterSetRoster::GetCharacterSetByConversionID(encoding); const BCharacterSet* characterSet
if (characterSet != NULL) = BCharacterSetRoster::GetCharacterSetByConversionID(encoding);
fEncoding = characterSet->GetName(); if (characterSet != NULL)
fEncoding = characterSet->GetName();
}
} }
} }
} }
// TODO: move those into BTranslationUtils::GetStyledText() as well? // TODO: move those into BTranslationUtils::GetStyledText() as well?
// restore alignment // restore alignment

View File

@ -34,7 +34,8 @@ class StyledEditView : public BTextView {
void Reset(); void Reset();
void SetSuppressChanges(bool suppressChanges); void SetSuppressChanges(bool suppressChanges);
status_t GetStyledText(BPositionIO* stream); status_t GetStyledText(BPositionIO* stream,
const char* forceEncoding = NULL);
status_t WriteStyledEditFile(BFile* file); status_t WriteStyledEditFile(BFile* file);
void SetEncoding(uint32 encoding); void SetEncoding(uint32 encoding);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved. * Copyright 2002-2012, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@ -8,6 +8,8 @@
* Philippe Saint-Pierre * Philippe Saint-Pierre
* Jonas Sundström * Jonas Sundström
* Ryan Leavengood * Ryan Leavengood
* Vlad Slepukhin
* Sarzhuk Zharski
*/ */
@ -33,6 +35,7 @@
#include <Menu.h> #include <Menu.h>
#include <MenuBar.h> #include <MenuBar.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <NodeMonitor.h>
#include <Path.h> #include <Path.h>
#include <PrintJob.h> #include <PrintJob.h>
#include <Rect.h> #include <Rect.h>
@ -107,6 +110,8 @@ StyledEditWindow::~StyledEditWindow()
void void
StyledEditWindow::Quit() StyledEditWindow::Quit()
{ {
_SwitchNodeMonitor(false);
_SaveAttrs(); _SaveAttrs();
if (StyledEditApp* app = dynamic_cast<StyledEditApp*>(be_app)) if (StyledEditApp* app = dynamic_cast<StyledEditApp*>(be_app))
app->CloseDocument(); app->CloseDocument();
@ -124,6 +129,9 @@ StyledEditWindow::QuitRequested()
if (fClean) if (fClean)
return true; return true;
if (fTextView->TextLength() == 0 && fSaveMessage == NULL)
return true;
BString alertText; BString alertText;
bs_printf(&alertText, bs_printf(&alertText,
B_TRANSLATE("Save changes to the document \"%s\"? "), Title()); B_TRANSLATE("Save changes to the document \"%s\"? "), Title());
@ -179,8 +187,8 @@ StyledEditWindow::MessageReceived(BMessage* message)
Quit(); Quit();
break; break;
case MENU_REVERT: case MENU_RELOAD:
_RevertToSaved(); _ReloadDocument(message);
break; break;
case MENU_CLOSE: case MENU_CLOSE:
@ -294,6 +302,10 @@ StyledEditWindow::MessageReceived(BMessage* message)
break; break;
} }
case B_NODE_MONITOR:
_HandleNodeMonitorEvent(message);
break;
// Font menu // Font menu
case FONT_SIZE: case FONT_SIZE:
@ -485,12 +497,12 @@ StyledEditWindow::MessageReceived(BMessage* message)
fRedoFlag = false; fRedoFlag = false;
} }
if (fClean) { if (fClean) {
fRevertItem->SetEnabled(false);
fSaveItem->SetEnabled(fSaveMessage == NULL); fSaveItem->SetEnabled(fSaveMessage == NULL);
} else { } else {
fRevertItem->SetEnabled(fSaveMessage != NULL);
fSaveItem->SetEnabled(true); fSaveItem->SetEnabled(true);
} }
fReloadItem->SetEnabled(fSaveMessage != NULL);
fEncodingItem->SetEnabled(fSaveMessage != NULL);
break; break;
case SAVE_AS_ENCODING: case SAVE_AS_ENCODING:
@ -646,6 +658,21 @@ StyledEditWindow::MenusBeginning()
fAlignRight->SetMarked(true); fAlignRight->SetMarked(true);
break; break;
} }
// text encoding
const BCharacterSet* charset
= BCharacterSetRoster::GetCharacterSetByFontID(fTextView->GetEncoding());
BMenu* encodingMenu = fEncodingItem->Submenu();
if (charset != NULL && encodingMenu != NULL) {
const char* mime = charset->GetMIMEName();
BString name(charset->GetPrintName());
if (mime)
name << " (" << mime << ")";
BMenuItem* item = encodingMenu->FindItem(name);
if (item != NULL)
item->SetMarked(true);
}
} }
@ -656,6 +683,8 @@ StyledEditWindow::MenusBeginning()
status_t status_t
StyledEditWindow::Save(BMessage* message) StyledEditWindow::Save(BMessage* message)
{ {
_NodeMonitorSuspender nodeMonitorSuspender(this);
if (!message) if (!message)
message = fSaveMessage; message = fSaveMessage;
@ -722,10 +751,11 @@ StyledEditWindow::Save(BMessage* message)
// clear clean modes // clear clean modes
fSaveItem->SetEnabled(false); fSaveItem->SetEnabled(false);
fRevertItem->SetEnabled(false);
fUndoCleans = false; fUndoCleans = false;
fRedoCleans = false; fRedoCleans = false;
fClean = true; fClean = true;
fNagOnNodeChange = true;
return status; return status;
} }
@ -811,6 +841,11 @@ StyledEditWindow::OpenFile(entry_ref* ref)
_LoadAttrs(); _LoadAttrs();
} }
_SwitchNodeMonitor(true, ref);
fReloadItem->SetEnabled(fSaveMessage != NULL);
fEncodingItem->SetEnabled(fSaveMessage != NULL);
fTextView->Select(0, 0); fTextView->Select(0, 0);
} }
@ -841,7 +876,7 @@ StyledEditWindow::Print(const char* documentName)
printJob.SetSettings(new BMessage(*fPrintSettings)); printJob.SetSettings(new BMessage(*fPrintSettings));
if (printJob.ConfigJob() != B_OK) if (printJob.ConfigJob() != B_OK)
return; return;
delete fPrintSettings; delete fPrintSettings;
fPrintSettings = printJob.Settings(); fPrintSettings = printJob.Settings();
@ -890,7 +925,9 @@ StyledEditWindow::Print(const char* documentName)
while (printLine <= lastLine) { while (printLine <= lastLine) {
float currentHeight = 0; float currentHeight = 0;
int32 firstLineOnPage = printLine; int32 firstLineOnPage = printLine;
while (currentHeight < printableRect.Height() && printLine <= lastLine) { while (currentHeight < printableRect.Height()
&& printLine <= lastLine)
{
currentHeight += fTextView->LineHeight(printLine); currentHeight += fTextView->LineHeight(printLine);
if (currentHeight < printableRect.Height()) if (currentHeight < printableRect.Height())
printLine++; printLine++;
@ -993,6 +1030,8 @@ StyledEditWindow::_InitWindow(uint32 encoding)
fWrapAround = false; fWrapAround = false;
fBackSearch = false; fBackSearch = false;
fNagOnNodeChange = true;
// add menubar // add menubar
fMenuBar = new BMenuBar(BRect(0, 0, 0, 0), "menubar"); fMenuBar = new BMenuBar(BRect(0, 0, 0, 0), "menubar");
AddChild(fMenuBar); AddChild(fMenuBar);
@ -1043,10 +1082,11 @@ StyledEditWindow::_InitWindow(uint32 encoding)
menuItem->SetShortcut('S', B_SHIFT_KEY); menuItem->SetShortcut('S', B_SHIFT_KEY);
menuItem->SetEnabled(true); menuItem->SetEnabled(true);
menu->AddItem(fRevertItem menu->AddItem(fReloadItem
= new BMenuItem(B_TRANSLATE("Revert to saved" B_UTF8_ELLIPSIS), = new BMenuItem(B_TRANSLATE("Reload" B_UTF8_ELLIPSIS),
new BMessage(MENU_REVERT))); new BMessage(MENU_RELOAD), 'L'));
fRevertItem->SetEnabled(false); fReloadItem->SetEnabled(false);
menu->AddItem(new BMenuItem(B_TRANSLATE("Close"), menu->AddItem(new BMenuItem(B_TRANSLATE("Close"),
new BMessage(MENU_CLOSE), 'W')); new BMessage(MENU_CLOSE), 'W'));
@ -1107,7 +1147,7 @@ StyledEditWindow::_InitWindow(uint32 encoding)
fFontMenu = new BMenu(B_TRANSLATE("Font")); fFontMenu = new BMenu(B_TRANSLATE("Font"));
fMenuBar->AddItem(fFontMenu); fMenuBar->AddItem(fFontMenu);
//"Size"-subMenu // "Size"-subMenu
fFontSizeMenu = new BMenu(B_TRANSLATE("Size")); fFontSizeMenu = new BMenu(B_TRANSLATE("Size"));
fFontSizeMenu->SetRadioMode(true); fFontSizeMenu->SetRadioMode(true);
fFontMenu->AddItem(fFontSizeMenu); fFontMenu->AddItem(fFontSizeMenu);
@ -1210,6 +1250,9 @@ StyledEditWindow::_InitWindow(uint32 encoding)
fWrapItem->SetMarked(true); fWrapItem->SetMarked(true);
fWrapItem->SetShortcut('W', B_OPTION_KEY); fWrapItem->SetShortcut('W', B_OPTION_KEY);
menu->AddItem(fEncodingItem = _MakeEncodingMenuItem());
fEncodingItem->SetEnabled(false);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(B_TRANSLATE("Statistics" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(B_TRANSLATE("Statistics" B_UTF8_ELLIPSIS),
new BMessage(SHOW_STATISTICS))); new BMessage(SHOW_STATISTICS)));
@ -1286,7 +1329,7 @@ StyledEditWindow::_SaveAttrs()
status_t status_t
StyledEditWindow::_LoadFile(entry_ref* ref) StyledEditWindow::_LoadFile(entry_ref* ref, const char* forceEncoding)
{ {
BEntry entry(ref, true); BEntry entry(ref, true);
// traverse an eventual link // traverse an eventual link
@ -1299,7 +1342,7 @@ StyledEditWindow::_LoadFile(entry_ref* ref)
if (status == B_OK) if (status == B_OK)
status = file.SetTo(&entry, B_READ_ONLY); status = file.SetTo(&entry, B_READ_ONLY);
if (status == B_OK) if (status == B_OK)
status = fTextView->GetStyledText(&file); status = fTextView->GetStyledText(&file, forceEncoding);
if (status == B_ENTRY_NOT_FOUND) { if (status == B_ENTRY_NOT_FOUND) {
// Treat non-existing files consideratley; we just want to get an // Treat non-existing files consideratley; we just want to get an
@ -1351,11 +1394,14 @@ StyledEditWindow::_LoadFile(entry_ref* ref)
void void
StyledEditWindow::_RevertToSaved() StyledEditWindow::_ReloadDocument(BMessage* message)
{ {
entry_ref ref; entry_ref ref;
const char* name; const char* name;
if (fSaveMessage == NULL || message == NULL)
return;
fSaveMessage->FindRef("directory", &ref); fSaveMessage->FindRef("directory", &ref);
fSaveMessage->FindString("name", &name); fSaveMessage->FindString("name", &name);
@ -1376,15 +1422,40 @@ StyledEditWindow::_RevertToSaved()
return; return;
} }
BString alertText; if (!fClean) {
bs_printf(&alertText, BString alertText;
B_TRANSLATE("Revert to the last version of \"%s\"? "), Title()); bs_printf(&alertText,
if (_ShowAlert(alertText, B_TRANSLATE("Cancel"), B_TRANSLATE("OK"), B_TRANSLATE("\"%s\" has unsaved changes.\n"
"", B_WARNING_ALERT) != 1) "Revert it to the last saved version? "), Title());
return; if (_ShowAlert(alertText, B_TRANSLATE("Cancel"), B_TRANSLATE("OK"),
"", B_WARNING_ALERT) != 1)
return;
}
const char* forceEncoding = NULL;
if (message->FindString("encoding", &forceEncoding) != B_OK) {
const BCharacterSet* charset
= BCharacterSetRoster::GetCharacterSetByFontID(
fTextView->GetEncoding());
if (charset != NULL)
forceEncoding = charset->GetName();
}
BScrollBar* vertBar = fScrollView->ScrollBar(B_VERTICAL);
float vertPos = vertBar != NULL ? vertBar->Value() : 0.f;
DisableUpdates();
fTextView->Reset(); fTextView->Reset();
if (_LoadFile(&ref) != B_OK)
status = _LoadFile(&ref, forceEncoding);
if (vertBar != NULL)
vertBar->SetValue(vertPos);
EnableUpdates();
if (status != B_OK)
return; return;
#undef B_TRANSLATION_CONTEXT #undef B_TRANSLATION_CONTEXT
@ -1400,10 +1471,12 @@ StyledEditWindow::_RevertToSaved()
// clear clean modes // clear clean modes
fSaveItem->SetEnabled(false); fSaveItem->SetEnabled(false);
fRevertItem->SetEnabled(false);
fUndoCleans = false; fUndoCleans = false;
fRedoCleans = false; fRedoCleans = false;
fClean = true; fClean = true;
fNagOnNodeChange = true;
} }
@ -1599,7 +1672,7 @@ StyledEditWindow::_SetFontStyle(const char* fontFamily, const char* fontStyle)
font.SetFace(face); font.SetFace(face);
fTextView->SetFontAndColor(&font); fTextView->SetFontAndColor(&font, B_FONT_FAMILY_AND_STYLE);
BMenuItem* superItem; BMenuItem* superItem;
superItem = fFontMenu->FindItem(fontFamily); superItem = fFontMenu->FindItem(fontFamily);
@ -1656,7 +1729,8 @@ StyledEditWindow::_UpdateCleanUndoRedoSaveRevert()
fClean = false; fClean = false;
fUndoCleans = false; fUndoCleans = false;
fRedoCleans = false; fRedoCleans = false;
fRevertItem->SetEnabled(fSaveMessage != NULL); fReloadItem->SetEnabled(fSaveMessage != NULL);
fEncodingItem->SetEnabled(fSaveMessage != NULL);
fSaveItem->SetEnabled(true); fSaveItem->SetEnabled(true);
fUndoItem->SetLabel(B_TRANSLATE("Can't undo")); fUndoItem->SetLabel(B_TRANSLATE("Can't undo"));
fUndoItem->SetEnabled(false); fUndoItem->SetEnabled(false);
@ -1686,3 +1760,234 @@ StyledEditWindow::_ShowAlert(const BString& text, const BString& label,
return alert->Go(); return alert->Go();
} }
BMenuItem*
StyledEditWindow::_MakeEncodingMenuItem()
{
BMenu* menu = new BMenu(B_TRANSLATE("Text encoding"));
BCharacterSetRoster roster;
BCharacterSet charset;
while (roster.GetNextCharacterSet(&charset) == B_OK) {
const char* mime = charset.GetMIMEName();
BString name(charset.GetPrintName());
if (mime)
name << " (" << mime << ")";
BMessage *message = new BMessage(MENU_RELOAD);
if (message != NULL) {
message->AddString("encoding", charset.GetName());
menu->AddItem(new BMenuItem(name, message));
}
}
menu->AddSeparatorItem();
BMessage *message = new BMessage(MENU_RELOAD);
message->AddString("encoding", "auto");
menu->AddItem(new BMenuItem(B_TRANSLATE("Autodetect"), message));
menu->SetRadioMode(true);
return new BMenuItem(menu, new BMessage(MENU_RELOAD));
}
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "NodeMonitorAlerts"
void
StyledEditWindow::_ShowNodeChangeAlert(const char* name, bool removed)
{
if (!fNagOnNodeChange)
return;
BString alertText(removed ? B_TRANSLATE("File \"%file%\" was removed by "
"another application, recover it?")
: B_TRANSLATE("File \"%file%\" was modified by "
"another application, reload it?"));
alertText.ReplaceAll("%file%", name);
if (_ShowAlert(alertText, removed ? B_TRANSLATE("Recover")
: B_TRANSLATE("Reload"), B_TRANSLATE("Ignore"), "",
B_WARNING_ALERT) == 0)
{
if (!removed) {
// supress the warning - user has already agreed
fClean = true;
BMessage msg(MENU_RELOAD);
_ReloadDocument(&msg);
} else
Save();
} else
fNagOnNodeChange = false;
fSaveItem->SetEnabled(!fClean);
}
void
StyledEditWindow::_HandleNodeMonitorEvent(BMessage *message)
{
int32 opcode = 0;
if (message->FindInt32("opcode", &opcode) != B_OK)
return;
if (opcode != B_ENTRY_CREATED
&& message->FindInt64("node") != fNodeRef.node)
// bypass foreign nodes' event
return;
switch (opcode) {
case B_STAT_CHANGED:
{
int32 fields = 0;
if (message->FindInt32("fields", &fields) == B_OK
&& (fields & (B_STAT_SIZE | B_STAT_MODIFICATION_TIME)) == 0)
break;
const char* name = NULL;
if (fSaveMessage->FindString("name", &name) != B_OK)
break;
_ShowNodeChangeAlert(name, false);
}
break;
case B_ENTRY_MOVED:
{
int32 device = 0;
int64 srcFolder = 0;
int64 dstFolder = 0;
const char* name = NULL;
if (message->FindInt32("device", &device) != B_OK
|| message->FindInt64("to directory", &dstFolder) != B_OK
|| message->FindInt64("from directory", &srcFolder) != B_OK
|| message->FindString("name", &name) != B_OK)
break;
entry_ref newRef(device, dstFolder, name);
BEntry entry(&newRef);
BEntry dirEntry;
entry.GetParent(&dirEntry);
entry_ref ref;
dirEntry.GetRef(&ref);
fSaveMessage->ReplaceRef("directory", &ref);
fSaveMessage->ReplaceString("name", name);
// store previous name - it may be useful in case
// we have just moved to temporary copy of file (vim case)
const char* sourceName = NULL;
if (message->FindString("from name", &sourceName) == B_OK) {
fSaveMessage->RemoveName("org.name");
fSaveMessage->AddString("org.name", sourceName);
fSaveMessage->RemoveName("move time");
fSaveMessage->AddInt64("move time", system_time());
}
SetTitle(name);
be_roster->AddToRecentDocuments(&newRef, APP_SIGNATURE);
if (srcFolder != dstFolder) {
_SwitchNodeMonitor(false);
_SwitchNodeMonitor(true);
}
}
break;
case B_ENTRY_REMOVED:
{
_SwitchNodeMonitor(false);
fClean = false;
// some editors like vim save files in following way:
// 1) move t.txt -> t.txt~
// 2) re-create t.txt and write data to it
// 3) remove t.txt~
// go to catch this case
int32 device = 0;
int64 directory = 0;
BString orgName;
if (fSaveMessage->FindString("org.name", &orgName) == B_OK
&& message->FindInt32("device", &device) == B_OK
&& message->FindInt64("directory", &directory) == B_OK)
{
// reuse the source name if it is not too old
bigtime_t time = fSaveMessage->FindInt64("move time");
if ((system_time() - time) < 1000000) {
entry_ref ref(device, directory, orgName);
BEntry entry(&ref);
if (entry.InitCheck() == B_OK) {
_SwitchNodeMonitor(true, &ref);
}
fSaveMessage->ReplaceString("name", orgName);
fSaveMessage->RemoveName("org.name");
fSaveMessage->RemoveName("move time");
SetTitle(orgName);
_ShowNodeChangeAlert(orgName, false);
break;
}
}
const char* name = NULL;
if (message->FindString("name", &name) != B_OK
&& fSaveMessage->FindString("name", &name) != B_OK)
name = "Unknown";
_ShowNodeChangeAlert(name, true);
}
break;
default:
break;
}
}
void
StyledEditWindow::_SwitchNodeMonitor(bool on, entry_ref* ref)
{
if (!on) {
watch_node(&fNodeRef, B_STOP_WATCHING, this);
watch_node(&fFolderNodeRef, B_STOP_WATCHING, this);
fNodeRef = node_ref();
fFolderNodeRef = node_ref();
return;
}
BEntry entry, folderEntry;
if (ref != NULL) {
entry.SetTo(ref, true);
entry.GetParent(&folderEntry);
} else if (fSaveMessage != NULL) {
entry_ref ref;
const char* name = NULL;
if (fSaveMessage->FindRef("directory", &ref) != B_OK
|| fSaveMessage->FindString("name", &name) != B_OK)
return;
BDirectory dir(&ref);
entry.SetTo(&dir, name);
folderEntry.SetTo(&ref);
} else
return;
if (entry.InitCheck() != B_OK || folderEntry.InitCheck() != B_OK)
return;
entry.GetNodeRef(&fNodeRef);
folderEntry.GetNodeRef(&fFolderNodeRef);
watch_node(&fNodeRef, B_WATCH_STAT, this);
watch_node(&fFolderNodeRef, B_WATCH_DIRECTORY, this);
}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved. * Copyright 2002-2012, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@ -15,15 +15,15 @@
#include <Window.h> #include <Window.h>
#include <String.h> #include <String.h>
#include <Message.h> #include <Message.h>
#include <Node.h>
struct entry_ref; struct entry_ref;
class BFilePanel;
class BMenu; class BMenu;
class BMessage;
class BMenuBar; class BMenuBar;
class BMenuItem; class BMenuItem;
class BFilePanel; class BMessage;
class BScrollView; class BScrollView;
class StyledEditView; class StyledEditView;
@ -52,10 +52,12 @@ public:
private: private:
void _InitWindow(uint32 encoding = 0); void _InitWindow(uint32 encoding = 0);
BMenuItem* _MakeEncodingMenuItem();
void _LoadAttrs(); void _LoadAttrs();
void _SaveAttrs(); void _SaveAttrs();
status_t _LoadFile(entry_ref* ref); status_t _LoadFile(entry_ref* ref,
void _RevertToSaved(); const char* forceEncoding = NULL);
void _ReloadDocument(BMessage *message);
bool _Search(BString searchFor, bool caseSensitive, bool _Search(BString searchFor, bool caseSensitive,
bool wrap, bool backSearch, bool wrap, bool backSearch,
bool scrollToOccurence = true); bool scrollToOccurence = true);
@ -76,6 +78,27 @@ private:
const BString& label3, const BString& label3,
alert_type type) const; alert_type type) const;
// node monitoring helper
class _NodeMonitorSuspender {
StyledEditWindow *fWindow;
public:
_NodeMonitorSuspender(StyledEditWindow *w) : fWindow(w) {
fWindow->_SwitchNodeMonitor(false);
}
~_NodeMonitorSuspender() {
fWindow->_SwitchNodeMonitor(true);
}
};
friend class _NodeMonitorSuspender;
void _HandleNodeMonitorEvent(BMessage *message);
void _ShowNodeChangeAlert(const char* name,
bool removed);
void _SwitchNodeMonitor(bool on,
entry_ref* ref = NULL);
private: private:
BMenuBar* fMenuBar; BMenuBar* fMenuBar;
BMessage* fPrintSettings; BMessage* fPrintSettings;
@ -89,7 +112,7 @@ private:
BMenuItem* fCurrentStyleItem; BMenuItem* fCurrentStyleItem;
BMenuItem* fSaveItem; BMenuItem* fSaveItem;
BMenuItem* fRevertItem; BMenuItem* fReloadItem;
BMenuItem* fUndoItem; BMenuItem* fUndoItem;
BMenuItem* fCutItem; BMenuItem* fCutItem;
@ -113,6 +136,7 @@ private:
BMenuItem* fAlignLeft; BMenuItem* fAlignLeft;
BMenuItem* fAlignCenter; BMenuItem* fAlignCenter;
BMenuItem* fAlignRight; BMenuItem* fAlignRight;
BMenuItem* fEncodingItem;
BString fStringToFind; BString fStringToFind;
BString fReplaceString; BString fReplaceString;
@ -139,6 +163,10 @@ private:
BFilePanel* fSavePanel; BFilePanel* fSavePanel;
BMenu* fSavePanelEncodingMenu; BMenu* fSavePanelEncodingMenu;
// node monitoring
node_ref fNodeRef;
node_ref fFolderNodeRef;
bool fNagOnNodeChange;
}; };

View File

@ -75,8 +75,8 @@ AppearancePrefView::AppearancePrefView(const char* name,
const char* kColorTable[] = { const char* kColorTable[] = {
B_TRANSLATE("Text"), B_TRANSLATE("Text"),
B_TRANSLATE("Background"), B_TRANSLATE("Background"),
B_TRANSLATE("Cursor text"), B_TRANSLATE("Cursor"),
B_TRANSLATE("Cursor background"), B_TRANSLATE("Text under cursor"),
B_TRANSLATE("Selected text"), B_TRANSLATE("Selected text"),
B_TRANSLATE("Selected background"), B_TRANSLATE("Selected background"),
NULL NULL
@ -93,12 +93,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
BMenu* fontMenu = _MakeFontMenu(MSG_HALF_FONT_CHANGED, BMenu* fontMenu = _MakeFontMenu(MSG_HALF_FONT_CHANGED,
PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY), PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY),
PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE)); PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE));
fFontField = new BMenuField(B_TRANSLATE("Font:"), fontMenu);
BMenu* sizeMenu = _MakeSizeMenu(MSG_HALF_SIZE_CHANGED,
PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE));
fFont = new BMenuField(B_TRANSLATE("Font:"), fontMenu);
fFontSize = new BMenuField(B_TRANSLATE("Size:"), sizeMenu);
BPopUpMenu* schemesPopUp = _MakeColorSchemeMenu(MSG_COLOR_SCHEME_CHANGED, BPopUpMenu* schemesPopUp = _MakeColorSchemeMenu(MSG_COLOR_SCHEME_CHANGED,
gPredefinedColorSchemes, gPredefinedColorSchemes[0]); gPredefinedColorSchemes, gPredefinedColorSchemes[0]);
@ -108,8 +103,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
BPopUpMenu* colorsPopUp = _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable, BPopUpMenu* colorsPopUp = _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable,
kColorTable[0]); kColorTable[0]);
fColorField = new BMenuField(B_TRANSLATE("Color:"), fColorField = new BMenuField(B_TRANSLATE("Color:"), colorsPopUp);
colorsPopUp);
fColorField->SetEnabled(false); fColorField->SetEnabled(false);
fTabTitle = new BTextControl("tabTitle", B_TRANSLATE("Tab title:"), "", fTabTitle = new BTextControl("tabTitle", B_TRANSLATE("Tab title:"), "",
@ -135,14 +129,12 @@ AppearancePrefView::AppearancePrefView(const char* name,
.Add(fTabTitle->CreateTextViewLayoutItem(), 1, 0) .Add(fTabTitle->CreateTextViewLayoutItem(), 1, 0)
.Add(fWindowTitle->CreateLabelLayoutItem(), 0, 1) .Add(fWindowTitle->CreateLabelLayoutItem(), 0, 1)
.Add(fWindowTitle->CreateTextViewLayoutItem(), 1, 1) .Add(fWindowTitle->CreateTextViewLayoutItem(), 1, 1)
.Add(fFont->CreateLabelLayoutItem(), 0, 2) .Add(fFontField->CreateLabelLayoutItem(), 0, 2)
.Add(fFont->CreateMenuBarLayoutItem(), 1, 2) .Add(fFontField->CreateMenuBarLayoutItem(), 1, 2)
.Add(fFontSize->CreateLabelLayoutItem(), 0, 3) .Add(fColorSchemeField->CreateLabelLayoutItem(), 0, 3)
.Add(fFontSize->CreateMenuBarLayoutItem(), 1, 3) .Add(fColorSchemeField->CreateMenuBarLayoutItem(), 1, 3)
.Add(fColorSchemeField->CreateLabelLayoutItem(), 0, 4) .Add(fColorField->CreateLabelLayoutItem(), 0, 4)
.Add(fColorSchemeField->CreateMenuBarLayoutItem(), 1, 4) .Add(fColorField->CreateMenuBarLayoutItem(), 1, 4)
.Add(fColorField->CreateLabelLayoutItem(), 0, 5)
.Add(fColorField->CreateMenuBarLayoutItem(), 1, 5)
.End() .End()
.AddGlue() .AddGlue()
.Add(fColorControl = new BColorControl(BPoint(10, 10), .Add(fColorControl = new BColorControl(BPoint(10, 10),
@ -152,8 +144,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
fTabTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fTabTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
fWindowTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fWindowTitle->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
fFont->SetAlignment(B_ALIGN_RIGHT); fFontField->SetAlignment(B_ALIGN_RIGHT);
fFontSize->SetAlignment(B_ALIGN_RIGHT);
fColorField->SetAlignment(B_ALIGN_RIGHT); fColorField->SetAlignment(B_ALIGN_RIGHT);
fColorSchemeField->SetAlignment(B_ALIGN_RIGHT); fColorSchemeField->SetAlignment(B_ALIGN_RIGHT);
@ -191,20 +182,23 @@ AppearancePrefView::GetPreferredSize(float* _width, float* _height)
void void
AppearancePrefView::Revert() AppearancePrefView::Revert()
{ {
fTabTitle->SetText(PrefHandler::Default()->getString(PREF_TAB_TITLE)); PrefHandler* pref = PrefHandler::Default();
fWindowTitle->SetText(PrefHandler::Default()->getString(PREF_WINDOW_TITLE));
fWarnOnExit->SetValue(PrefHandler::Default()->getBool( fTabTitle->SetText(pref->getString(PREF_TAB_TITLE));
fWindowTitle->SetText(pref->getString(PREF_WINDOW_TITLE));
fWarnOnExit->SetValue(pref->getBool(
PREF_WARN_ON_EXIT)); PREF_WARN_ON_EXIT));
fColorSchemeField->Menu()->ItemAt(0)->SetMarked(true); fColorSchemeField->Menu()->ItemAt(0)->SetMarked(true);
fColorControl->SetValue(PrefHandler::Default()-> fColorControl->SetValue(pref->
getRGB(PREF_TEXT_FORE_COLOR)); getRGB(PREF_TEXT_FORE_COLOR));
fFont->Menu()->FindItem(PrefHandler::Default()->getString( const char* family = pref->getString(PREF_HALF_FONT_FAMILY);
PREF_HALF_FONT_FAMILY))->SetMarked(true); const char* style = pref->getString(PREF_HALF_FONT_STYLE);
fFontSize->Menu()->FindItem(PrefHandler::Default()->getString( const char* size = pref->getString(PREF_HALF_FONT_SIZE);
PREF_HALF_FONT_FAMILY))->SetMarked(true);
_MarkSelectedFont(family, style, size);
} }
@ -216,8 +210,14 @@ AppearancePrefView::AttachedToWindow()
fBlinkCursor->SetTarget(this); fBlinkCursor->SetTarget(this);
fWarnOnExit->SetTarget(this); fWarnOnExit->SetTarget(this);
fFontSize->Menu()->SetTargetForItems(this); fFontField->Menu()->SetTargetForItems(this);
fFont->Menu()->SetTargetForItems(this); for (int32 i = 0; i < fFontField->Menu()->CountItems(); i++) {
BMenu* fontSizeMenu = fFontField->Menu()->SubmenuAt(i);
if (fontSizeMenu == NULL)
continue;
fontSizeMenu->SetTargetForItems(this);
}
fColorControl->SetTarget(this); fColorControl->SetTarget(this);
fColorField->Menu()->SetTargetForItems(this); fColorField->Menu()->SetTargetForItems(this);
@ -233,6 +233,7 @@ AppearancePrefView::AttachedToWindow()
void void
AppearancePrefView::MessageReceived(BMessage* msg) AppearancePrefView::MessageReceived(BMessage* msg)
{ {
bool modified = false; bool modified = false;
@ -242,51 +243,51 @@ AppearancePrefView::MessageReceived(BMessage* msg)
{ {
const char* family = NULL; const char* family = NULL;
const char* style = NULL; const char* style = NULL;
msg->FindString("font_family", &family); const char* size = NULL;
msg->FindString("font_style", &style); if (msg->FindString("font_family", &family) != B_OK
|| msg->FindString("font_style", &style) != B_OK
|| msg->FindString("font_size", &size) != B_OK) {
break;
}
PrefHandler* pref = PrefHandler::Default(); PrefHandler* pref = PrefHandler::Default();
const char* currentFamily const char* currentFamily
= pref->getString(PREF_HALF_FONT_FAMILY); = pref->getString(PREF_HALF_FONT_FAMILY);
const char* currentStyle const char* currentStyle
= pref->getString(PREF_HALF_FONT_STYLE); = pref->getString(PREF_HALF_FONT_STYLE);
const char* currentSize
= pref->getString(PREF_HALF_FONT_SIZE);
if (currentFamily == NULL || strcmp(currentFamily, family) != 0 if (currentFamily == NULL || strcmp(currentFamily, family) != 0
|| currentStyle == NULL || strcmp(currentStyle, style) != 0) { || currentStyle == NULL || strcmp(currentStyle, style) != 0
|| currentSize == NULL || strcmp(currentSize, size) != 0) {
pref->setString(PREF_HALF_FONT_FAMILY, family); pref->setString(PREF_HALF_FONT_FAMILY, family);
pref->setString(PREF_HALF_FONT_STYLE, style); pref->setString(PREF_HALF_FONT_STYLE, style);
pref->setString(PREF_HALF_FONT_SIZE, size);
_MarkSelectedFont(family, style, size);
modified = true; modified = true;
} }
break; break;
} }
case MSG_HALF_SIZE_CHANGED:
if (strcmp(PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE),
fFontSize->Menu()->FindMarked()->Label()) != 0) {
PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE,
fFontSize->Menu()->FindMarked()->Label());
modified = true;
}
break;
case MSG_COLOR_CHANGED: case MSG_COLOR_CHANGED:
{ {
rgb_color oldColor = PrefHandler::Default()->getRGB( rgb_color oldColor = PrefHandler::Default()->getRGB(
fColorField->Menu()->FindMarked()->Label()); fColorField->Menu()->FindMarked()->Label());
if (oldColor != fColorControl->ValueAsColor()) { if (oldColor != fColorControl->ValueAsColor()) {
PrefHandler::Default()->setRGB( PrefHandler::Default()->setRGB(
fColorField->Menu()->FindMarked()->Label(), fColorField->Menu()->FindMarked()->Label(),
fColorControl->ValueAsColor()); fColorControl->ValueAsColor());
modified = true; modified = true;
}
} }
break; break;
}
case MSG_COLOR_SCHEME_CHANGED: case MSG_COLOR_SCHEME_CHANGED:
{ {
color_scheme* newScheme = NULL; color_scheme* newScheme = NULL;
if (msg->FindPointer("color_scheme", if (msg->FindPointer("color_scheme",
(void**)&newScheme) == B_OK) { (void**)&newScheme) == B_OK) {
if (newScheme == &gCustomColorScheme) if (newScheme == &gCustomColorScheme)
_EnableCustomColors(true); _EnableCustomColors(true);
else else
@ -431,13 +432,17 @@ AppearancePrefView::_MakeFontMenu(uint32 command,
font.SetFamilyAndStyle(family, style); font.SetFamilyAndStyle(family, style);
if (IsFontUsable(font)) { if (IsFontUsable(font)) {
BMessage* message = new BMessage(command); BMessage* message = new BMessage(command);
const char* size
= PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE);
message->AddString("font_family", family); message->AddString("font_family", family);
message->AddString("font_style", style); message->AddString("font_style", style);
char itemLabel[134]; message->AddString("font_size", size);
snprintf(itemLabel, sizeof(itemLabel), char fontMenuLabel[134];
snprintf(fontMenuLabel, sizeof(fontMenuLabel),
"%s - %s", family, style); "%s - %s", family, style);
BMenuItem* item = new BMenuItem(itemLabel, BMenu* fontSizeMenu = _MakeFontSizeMenu(fontMenuLabel,
message); MSG_HALF_FONT_CHANGED, family, style, size);
BMenuItem* item = new BMenuItem(fontSizeMenu, message);
menu->AddItem(item); menu->AddItem(item);
if (strcmp(defaultFamily, family) == 0 if (strcmp(defaultFamily, family) == 0
&& strcmp(defaultStyle, style) == 0) && strcmp(defaultStyle, style) == 0)
@ -456,32 +461,42 @@ AppearancePrefView::_MakeFontMenu(uint32 command,
/*static*/ BMenu* /*static*/ BMenu*
AppearancePrefView::_MakeSizeMenu(uint32 command, uint8 defaultSize) AppearancePrefView::_MakeFontSizeMenu(const char* label, uint32 command,
const char* family, const char* style, const char* size)
{ {
BPopUpMenu* menu = new BPopUpMenu("size"); BMenu* menu = new BMenu(label);
int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0}; menu->SetRadioMode(true);
menu->SetLabelFromMarked(false);
int32 sizes[] = {
8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 0
};
bool found = false; bool found = false;
for (uint32 i = 0; sizes[i]; i++) { for (uint32 i = 0; sizes[i]; i++) {
BString string; BString fontSize;
string << sizes[i]; fontSize << sizes[i];
BMessage* message = new BMessage(command);
BMenuItem* item = new BMenuItem(string.String(), new BMessage(command)); message->AddString("font_family", family);
message->AddString("font_style", style);
message->AddString("font_size", fontSize.String());
BMenuItem* item = new BMenuItem(fontSize.String(), message);
menu->AddItem(item); menu->AddItem(item);
if (sizes[i] == atoi(size)) {
if (sizes[i] == defaultSize) {
item->SetMarked(true); item->SetMarked(true);
found = true; found = true;
} }
} }
if (!found) { if (!found) {
for (uint32 i = 0; sizes[i]; i++) { for (uint32 i = 0; sizes[i]; i++) {
if (sizes[i] > defaultSize) { if (sizes[i] > atoi(size)) {
BString string; BMessage* message = new BMessage(command);
string << defaultSize; message->AddString("font_family", family);
BMenuItem* item = new BMenuItem(string.String(), message->AddString("font_style", style);
new BMessage(command)); message->AddString("font_size", size);
BMenuItem* item = new BMenuItem(size, message);
item->SetMarked(true); item->SetMarked(true);
menu->AddItem(item, i); menu->AddItem(item, i);
break; break;
@ -541,3 +556,28 @@ AppearancePrefView::_MakeColorSchemeMenu(uint32 msg, const color_scheme** items,
} }
return menu; return menu;
} }
void
AppearancePrefView::_MarkSelectedFont(const char* family, const char* style,
const char* size)
{
char fontMenuLabel[134];
snprintf(fontMenuLabel, sizeof(fontMenuLabel), "%s - %s", family, style);
// mark the selected font
BMenuItem* selectedFont = fFontField->Menu()->FindItem(fontMenuLabel);
if (selectedFont != NULL)
selectedFont->SetMarked(true);
// mark the selected font size on all font menus
for (int32 i = 0; i < fFontField->Menu()->CountItems(); i++) {
BMenu* fontSizeMenu = fFontField->Menu()->SubmenuAt(i);
if (fontSizeMenu == NULL)
continue;
BMenuItem* item = fontSizeMenu->FindItem(size);
if (item != NULL)
item->SetMarked(true);
}
}

View File

@ -62,8 +62,11 @@ private:
static BMenu* _MakeFontMenu(uint32 command, static BMenu* _MakeFontMenu(uint32 command,
const char* defaultFamily, const char* defaultFamily,
const char* defaultStyle); const char* defaultStyle);
static BMenu* _MakeSizeMenu(uint32 command, static BMenu* _MakeFontSizeMenu(const char* label,
uint8 defaultSize); uint32 command,
const char* family,
const char* style,
const char* size);
static BPopUpMenu* _MakeMenu(uint32 msg, const char** items, static BPopUpMenu* _MakeMenu(uint32 msg, const char** items,
const char* defaultItem); const char* defaultItem);
@ -72,10 +75,12 @@ private:
const color_scheme** schemes, const color_scheme** schemes,
const color_scheme* defaultItemName); const color_scheme* defaultItemName);
void _MarkSelectedFont(const char* family,
const char* style, const char* size);
BCheckBox* fBlinkCursor; BCheckBox* fBlinkCursor;
BCheckBox* fWarnOnExit; BCheckBox* fWarnOnExit;
BMenuField* fFont; BMenuField* fFontField;
BMenuField* fFontSize;
BMenuField* fColorSchemeField; BMenuField* fColorSchemeField;
BMenuField* fColorField; BMenuField* fColorField;

View File

@ -103,8 +103,8 @@ static const char* const PREF_HALF_FONT_SIZE = "Half Font Size";
static const char* const PREF_TEXT_FORE_COLOR = "Text"; static const char* const PREF_TEXT_FORE_COLOR = "Text";
static const char* const PREF_TEXT_BACK_COLOR = "Background"; static const char* const PREF_TEXT_BACK_COLOR = "Background";
static const char* const PREF_CURSOR_FORE_COLOR = "Cursor text"; static const char* const PREF_CURSOR_FORE_COLOR = "Text under cursor";
static const char* const PREF_CURSOR_BACK_COLOR = "Cursor background"; static const char* const PREF_CURSOR_BACK_COLOR = "Cursor";
static const char* const PREF_SELECT_FORE_COLOR = "Selected text"; static const char* const PREF_SELECT_FORE_COLOR = "Selected text";
static const char* const PREF_SELECT_BACK_COLOR = "Selected background"; static const char* const PREF_SELECT_BACK_COLOR = "Selected background";

View File

@ -945,8 +945,8 @@ TermView::SetTermFont(const BFont *font)
fHalfFont.SetSpacing(B_FIXED_SPACING); fHalfFont.SetSpacing(B_FIXED_SPACING);
// calculate half font's max width // calculate half font's max width
// Not Bounding, check only A-Z(For case of fHalfFont is KanjiFont. ) // Not Bounding, check only A-Z (For case of fHalfFont is KanjiFont.)
for (int c = 0x20 ; c <= 0x7e; c++){ for (int c = 0x20; c <= 0x7e; c++) {
char buf[4]; char buf[4];
sprintf(buf, "%c", c); sprintf(buf, "%c", c);
int tmpWidth = (int)fHalfFont.StringWidth(buf); int tmpWidth = (int)fHalfFont.StringWidth(buf);

View File

@ -11,6 +11,7 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
@ -58,6 +59,9 @@
const static int32 kMaxTabs = 6; const static int32 kMaxTabs = 6;
const static int32 kTermViewOffset = 3; const static int32 kTermViewOffset = 3;
const static int32 kMinimumFontSize = 8;
const static int32 kMaximumFontSize = 36;
// messages constants // messages constants
static const uint32 kNewTab = 'NTab'; static const uint32 kNewTab = 'NTab';
static const uint32 kCloseView = 'ClVw'; static const uint32 kCloseView = 'ClVw';
@ -402,8 +406,8 @@ TermWindow::MenusBeginning()
float size = font.Size(); float size = font.Size();
fDecreaseFontSizeMenuItem->SetEnabled(size > 9); fDecreaseFontSizeMenuItem->SetEnabled(size > kMinimumFontSize);
fIncreaseFontSizeMenuItem->SetEnabled(size < 18); fIncreaseFontSizeMenuItem->SetEnabled(size < kMaximumFontSize);
BWindow::MenusBeginning(); BWindow::MenusBeginning();
} }
@ -449,6 +453,16 @@ TermWindow::_MakeEncodingMenu()
void void
TermWindow::_SetupMenu() TermWindow::_SetupMenu()
{ {
fFontSizeMenu = _MakeFontSizeMenu(MSG_HALF_SIZE_CHANGED,
PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE));
fIncreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Increase"),
new BMessage(kIncreaseFontSize), '+', B_COMMAND_KEY);
fDecreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Decrease"),
new BMessage(kDecreaseFontSize), '-', B_COMMAND_KEY);
fFontSizeMenu->AddSeparatorItem();
fFontSizeMenu->AddItem(fIncreaseFontSizeMenuItem);
fFontSizeMenu->AddItem(fDecreaseFontSizeMenuItem);
BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar")) BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar"))
// Terminal // Terminal
.AddMenu(B_TRANSLATE_SYSTEM_NAME("Terminal")) .AddMenu(B_TRANSLATE_SYSTEM_NAME("Terminal"))
@ -491,14 +505,7 @@ TermWindow::_SetupMenu()
.AddMenu(B_TRANSLATE("Settings")) .AddMenu(B_TRANSLATE("Settings"))
.AddItem(_MakeWindowSizeMenu()) .AddItem(_MakeWindowSizeMenu())
.AddItem(fEncodingMenu = _MakeEncodingMenu()) .AddItem(fEncodingMenu = _MakeEncodingMenu())
.AddMenu(B_TRANSLATE("Text size")) .AddItem(fFontSizeMenu)
.AddItem(B_TRANSLATE("Increase"), kIncreaseFontSize, '+',
B_COMMAND_KEY)
.GetItem(fIncreaseFontSizeMenuItem)
.AddItem(B_TRANSLATE("Decrease"), kDecreaseFontSize, '-',
B_COMMAND_KEY)
.GetItem(fDecreaseFontSizeMenuItem)
.End()
.AddSeparator() .AddSeparator()
.AddItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS), MENU_PREF_OPEN) .AddItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS), MENU_PREF_OPEN)
.AddSeparator() .AddSeparator()
@ -613,15 +620,25 @@ TermWindow::_GetPreferredFont(BFont& font)
// Default to be_fixed_font // Default to be_fixed_font
font = be_fixed_font; font = be_fixed_font;
const char* family = PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY); const char* family
const char* style = PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE); = PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY);
const char* style
= PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE);
const char* size = PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE);
font.SetFamilyAndStyle(family, style); font.SetFamilyAndStyle(family, style);
font.SetSize(atoi(size));
float size = PrefHandler::Default()->getFloat(PREF_HALF_FONT_SIZE); // mark the font size menu item
if (size < 6.0f) for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) {
size = 6.0f; BMenuItem* item = fFontSizeMenu->ItemAt(i);
font.SetSize(size); if (item == NULL)
continue;
item->SetMarked(false);
if (strcmp(item->Label(), size) == 0)
item->SetMarked(true);
}
} }
@ -771,24 +788,60 @@ TermWindow::MessageReceived(BMessage *message)
case MSG_COLS_CHANGED: case MSG_COLS_CHANGED:
{ {
int32 columns, rows; int32 columns, rows;
message->FindInt32("columns", &columns); if (message->FindInt32("columns", &columns) != B_OK
message->FindInt32("rows", &rows); || message->FindInt32("rows", &rows) != B_OK) {
break;
}
_ActiveTermView()->SetTermSize(rows, columns); for (int32 i = 0; i < fTabView->CountTabs(); i++) {
TermView* view = _TermViewAt(i);
_ResizeView(_ActiveTermView()); view->SetTermSize(rows, columns);
_ResizeView(view);
}
break; break;
} }
case MSG_HALF_FONT_CHANGED: case MSG_HALF_FONT_CHANGED:
case MSG_FULL_FONT_CHANGED: case MSG_FULL_FONT_CHANGED:
case MSG_HALF_SIZE_CHANGED:
case MSG_FULL_SIZE_CHANGED:
{ {
BFont font; BFont font;
_GetPreferredFont(font); _GetPreferredFont(font);
_ActiveTermView()->SetTermFont(&font); for (int32 i = 0; i < fTabView->CountTabs(); i++) {
TermView* view = _TermViewAt(i);
view->SetTermFont(&font);
_ResizeView(view);
}
break;
}
_ResizeView(_ActiveTermView()); case MSG_HALF_SIZE_CHANGED:
case MSG_FULL_SIZE_CHANGED:
{
const char* size = NULL;
if (message->FindString("font_size", &size) != B_OK)
break;
// mark the font size menu item
for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) {
BMenuItem* item = fFontSizeMenu->ItemAt(i);
if (item == NULL)
continue;
item->SetMarked(false);
if (strcmp(item->Label(), size) == 0)
item->SetMarked(true);
}
BFont font;
_ActiveTermView()->GetTermFont(&font);
font.SetSize(atoi(size));
PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE,
(int32)atoi(size));
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
TermView* view = _TermViewAt(i);
_TermViewAt(i)->SetTermFont(&font);
_ResizeView(view);
}
break; break;
} }
@ -957,27 +1010,50 @@ TermWindow::MessageReceived(BMessage *message)
case kIncreaseFontSize: case kIncreaseFontSize:
case kDecreaseFontSize: case kDecreaseFontSize:
{ {
TermView* view = _ActiveTermView();
BFont font; BFont font;
view->GetTermFont(&font); _ActiveTermView()->GetTermFont(&font);
float size = font.Size(); float size = font.Size();
if (message->what == kIncreaseFontSize)
size += 1;
else
size -= 1;
// limit the font size if (message->what == kIncreaseFontSize) {
if (size < 9) if (size < 12)
size = 9; size += 1;
if (size > 18) else if (size < 24)
size = 18; size += 2;
else
size += 4;
} else {
if (size <= 12)
size -= 1;
else if (size <= 24)
size -= 2;
else
size -= 4;
}
// constrain the font size
if (size < kMinimumFontSize)
size = kMinimumFontSize;
if (size > kMaximumFontSize)
size = kMaximumFontSize;
// mark the font size menu item
for (int32 i = 0; i < fFontSizeMenu->CountItems(); i++) {
BMenuItem* item = fFontSizeMenu->ItemAt(i);
if (item == NULL)
continue;
item->SetMarked(false);
if (atoi(item->Label()) == size)
item->SetMarked(true);
}
font.SetSize(size); font.SetSize(size);
view->SetTermFont(&font);
PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)size); PrefHandler::Default()->setInt32(PREF_HALF_FONT_SIZE, (int32)size);
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
_ResizeView(view); TermView* view = _TermViewAt(i);
_TermViewAt(i)->SetTermFont(&font);
_ResizeView(view);
}
break; break;
} }
@ -1144,10 +1220,12 @@ TermWindow::_AddTab(Arguments* args, const BString& currentDirectory)
view->GetFontSize(&width, &height); view->GetFontSize(&width, &height);
float minimumHeight = -1; float minimumHeight = -1;
if (fMenuBar) if (fMenuBar != NULL)
minimumHeight += fMenuBar->Bounds().Height() + 1; minimumHeight += fMenuBar->Bounds().Height() + 1;
if (fTabView && fTabView->CountTabs() > 0)
if (fTabView != NULL && fTabView->CountTabs() > 0)
minimumHeight += fTabView->TabHeight() + 1; minimumHeight += fTabView->TabHeight() + 1;
SetSizeLimits(MIN_COLS * width - 1, MAX_COLS * width - 1, SetSizeLimits(MIN_COLS * width - 1, MAX_COLS * width - 1,
minimumHeight + MIN_ROWS * height - 1, minimumHeight + MIN_ROWS * height - 1,
minimumHeight + MAX_ROWS * height - 1); minimumHeight + MAX_ROWS * height - 1);
@ -1155,7 +1233,7 @@ TermWindow::_AddTab(Arguments* args, const BString& currentDirectory)
// the terminal can be resized smaller than MIN_ROWS/MIN_COLS! // the terminal can be resized smaller than MIN_ROWS/MIN_COLS!
// If it's the first time we're called, setup the window // If it's the first time we're called, setup the window
if (fTabView->CountTabs() == 0) { if (fTabView != NULL && fTabView->CountTabs() == 0) {
float viewWidth, viewHeight; float viewWidth, viewHeight;
containerView->GetPreferredSize(&viewWidth, &viewHeight); containerView->GetPreferredSize(&viewWidth, &viewHeight);
@ -1523,9 +1601,10 @@ TermWindow::_ResizeView(TermView *view)
view->GetFontSize(&fontWidth, &fontHeight); view->GetFontSize(&fontWidth, &fontHeight);
float minimumHeight = -1; float minimumHeight = -1;
if (fMenuBar) if (fMenuBar != NULL)
minimumHeight += fMenuBar->Bounds().Height() + 1; minimumHeight += fMenuBar->Bounds().Height() + 1;
if (fTabView && fTabView->CountTabs() > 1)
if (fTabView != NULL && fTabView->CountTabs() > 1)
minimumHeight += fTabView->TabHeight() + 1; minimumHeight += fTabView->TabHeight() + 1;
SetSizeLimits(MIN_COLS * fontWidth - 1, MAX_COLS * fontWidth - 1, SetSizeLimits(MIN_COLS * fontWidth - 1, MAX_COLS * fontWidth - 1,
@ -1535,19 +1614,21 @@ TermWindow::_ResizeView(TermView *view)
float width; float width;
float height; float height;
view->Parent()->GetPreferredSize(&width, &height); view->Parent()->GetPreferredSize(&width, &height);
width += B_V_SCROLL_BAR_WIDTH; width += B_V_SCROLL_BAR_WIDTH;
// NOTE: Width is one pixel too small, since the scroll view // NOTE: Width is one pixel too small, since the scroll view
// is one pixel wider than its parent. // is one pixel wider than its parent.
height += fMenuBar->Bounds().Height() + 1; if (fMenuBar != NULL)
height += fMenuBar->Bounds().Height() + 1;
if (fTabView != NULL && fTabView->CountTabs() > 1)
height += fTabView->TabHeight() + 1;
ResizeTo(width, height); ResizeTo(width, height);
view->Invalidate(); view->Invalidate();
} }
/* static */ /* static */ BMenu*
BMenu*
TermWindow::_MakeWindowSizeMenu() TermWindow::_MakeWindowSizeMenu()
{ {
BMenu* menu = new (std::nothrow) BMenu(B_TRANSLATE("Window size")); BMenu* menu = new (std::nothrow) BMenu(B_TRANSLATE("Window size"));
@ -1581,6 +1662,51 @@ TermWindow::_MakeWindowSizeMenu()
} }
/*static*/ BMenu*
TermWindow::_MakeFontSizeMenu(uint32 command, uint8 defaultSize)
{
BMenu* menu = new (std::nothrow) BMenu(B_TRANSLATE("Font size"));
if (menu == NULL)
return NULL;
int32 sizes[] = {
8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 0
};
bool found = false;
for (uint32 i = 0; sizes[i]; i++) {
BString string;
string << sizes[i];
BMessage* message = new BMessage(command);
message->AddString("font_size", string);
BMenuItem* item = new BMenuItem(string.String(), message);
menu->AddItem(item);
if (sizes[i] == defaultSize) {
item->SetMarked(true);
found = true;
}
}
if (!found) {
for (uint32 i = 0; sizes[i]; i++) {
if (sizes[i] > defaultSize) {
BString string;
string << defaultSize;
BMessage* message = new BMessage(command);
message->AddString("font_size", string);
BMenuItem* item = new BMenuItem(string.String(), message);
item->SetMarked(true);
menu->AddItem(item, i);
break;
}
}
}
return menu;
}
void void
TermWindow::_UpdateSwitchTerminalsMenuItem() TermWindow::_UpdateSwitchTerminalsMenuItem()
{ {

View File

@ -136,6 +136,8 @@ private:
void _SetupMenu(); void _SetupMenu();
static BMenu* _MakeEncodingMenu(); static BMenu* _MakeEncodingMenu();
static BMenu* _MakeWindowSizeMenu(); static BMenu* _MakeWindowSizeMenu();
static BMenu* _MakeFontSizeMenu(uint32 command,
uint8 defaultSize);
void _UpdateSwitchTerminalsMenuItem(); void _UpdateSwitchTerminalsMenuItem();
status_t _GetWindowPositionFile(BFile* file, status_t _GetWindowPositionFile(BFile* file,
@ -198,6 +200,7 @@ private:
BMenuBar* fMenuBar; BMenuBar* fMenuBar;
BMenuItem* fSwitchTerminalsMenuItem; BMenuItem* fSwitchTerminalsMenuItem;
BMenu* fEncodingMenu; BMenu* fEncodingMenu;
BMenu* fFontSizeMenu;
BMessage* fPrintSettings; BMessage* fPrintSettings;
PrefWindow* fPrefWindow; PrefWindow* fPrefWindow;
@ -212,7 +215,7 @@ private:
// Saved search parameters // Saved search parameters
BString fFindString; BString fFindString;
BMenuItem* fFindNextMenuItem; BMenuItem* fFindNextMenuItem;
BMenuItem * fFindPreviousMenuItem; BMenuItem* fFindPreviousMenuItem;
BMenuItem* fIncreaseFontSizeMenuItem; BMenuItem* fIncreaseFontSizeMenuItem;
BMenuItem* fDecreaseFontSizeMenuItem; BMenuItem* fDecreaseFontSizeMenuItem;

View File

@ -28,6 +28,7 @@
#include "BrowserApp.h" #include "BrowserApp.h"
#include <AboutWindow.h>
#include <Alert.h> #include <Alert.h>
#include <Autolock.h> #include <Autolock.h>
#include <Catalog.h> #include <Catalog.h>
@ -75,7 +76,8 @@ BrowserApp::BrowserApp()
fCookies(NULL), fCookies(NULL),
fCookieJar(NULL), fCookieJar(NULL),
fDownloadWindow(NULL), fDownloadWindow(NULL),
fSettingsWindow(NULL) fSettingsWindow(NULL),
fAboutWindow(NULL)
{ {
} }
@ -86,25 +88,45 @@ BrowserApp::~BrowserApp()
delete fSettings; delete fSettings;
delete fCookies; delete fCookies;
delete fCookieJar; delete fCookieJar;
if (fAboutWindow != NULL)
fAboutWindow->Quit();
} }
void void
BrowserApp::AboutRequested() BrowserApp::AboutRequested()
{ {
BString aboutText("WebPositive\n\nby Ryan Leavengood, Andrea Anzani, " if (fAboutWindow == NULL) {
"Maxime Simon, Michael Lotz, Rene Gollent, Stephan Aßmus and " // create the about window
"Alexandre Deckner");
aboutText << "\n\nWebPositive 1.1";
aboutText << "\n\nHaikuWebKit " << WebKitInfo::HaikuWebKitVersion();
aboutText << " (" << WebKitInfo::HaikuWebKitRevision() << ")";
aboutText << "\nWebKit " << WebKitInfo::WebKitVersion();
aboutText << " (" << WebKitInfo::WebKitRevision() << ")";
BAlert* alert = new BAlert("About WebPositive", aboutText.String(), const char* authors[] = {
"Sweet!"); "Andrea Anzani",
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); "Stephan Aßmus",
alert->Go(NULL); "Alexandre Deckner",
"Rene Gollent",
"Ryan Leavengood",
"Michael Lotz",
"Maxime Simon",
NULL
};
BString aboutText("");
aboutText << "HaikuWebKit " << WebKitInfo::HaikuWebKitVersion();
aboutText << " (" << WebKitInfo::HaikuWebKitRevision() << ")";
aboutText << "\nWebKit " << WebKitInfo::WebKitVersion();
aboutText << " (" << WebKitInfo::WebKitRevision() << ")";
fAboutWindow = new BAboutWindow(kApplicationName,
kApplicationSignature);
fAboutWindow->AddCopyright(2007, "Haiku, Inc.");
fAboutWindow->AddAuthors(authors);
fAboutWindow->AddExtraInfo(aboutText.String());
fAboutWindow->Show();
} else if (fAboutWindow->IsHidden())
fAboutWindow->Show();
else
fAboutWindow->Activate();
} }

View File

@ -33,6 +33,8 @@
#include <Catalog.h> #include <Catalog.h>
#include <Rect.h> #include <Rect.h>
class BAboutWindow;
class BNetworkCookieJar; class BNetworkCookieJar;
class DownloadWindow; class DownloadWindow;
class BrowserWindow; class BrowserWindow;
@ -77,6 +79,8 @@ private:
DownloadWindow* fDownloadWindow; DownloadWindow* fDownloadWindow;
SettingsWindow* fSettingsWindow; SettingsWindow* fSettingsWindow;
BAboutWindow* fAboutWindow;
}; };

View File

@ -652,11 +652,10 @@ BrowserWindow::MessageReceived(BMessage* message)
BString url; BString url;
if (message->FindString("url", &url) != B_OK) if (message->FindString("url", &url) != B_OK)
url = fURLInputGroup->Text(); url = fURLInputGroup->Text();
_SetPageIcon(CurrentWebView(), NULL); _SetPageIcon(CurrentWebView(), NULL);
BString newUrl = _SmartURLHandler(url); _SmartURLHandler(url);
if (newUrl != url)
fURLInputGroup->TextView()->SetText(newUrl);
CurrentWebView()->LoadURL(newUrl.String());
break; break;
} }
case GO_BACK: case GO_BACK:
@ -2148,19 +2147,115 @@ BrowserWindow::_NewTabURL(bool isNewWindow) const
return url; return url;
} }
BString BString
BrowserWindow::_SmartURLHandler(const BString& url) const BrowserWindow::_EncodeURIComponent(const BString& search)
{ {
BString result = url; const BString escCharList = " $&`:<>[]{}\"+#%@/;=?\\^|~\',";
BString result = search;
char hexcode[4];
for (int32 i = 0; i < result.Length(); i++) {
if (escCharList.FindFirst(result[i]) != B_ERROR) {
sprintf(hexcode, "%02X", (unsigned int)result[i]);
result[i] = '%';
result.Insert(hexcode, i + 1);
i += 2;
}
}
return result;
}
void
BrowserWindow::_VisitURL(const BString& url)
{
//fURLInputGroup->TextView()->SetText(url);
CurrentWebView()->LoadURL(url.String());
}
void
BrowserWindow::_VisitSearchEngine(const BString& search)
{
// TODO: Google Code-In Task to make default search
// engine modifiable from Settings? :)
BString engine = "http://www.google.com/search?q=";
engine += _EncodeURIComponent(search);
// We have to take care of some of the escaping before
// we hand over the string to WebKit, if we want queries
// like "4+3" to not be searched as "4 3".
_VisitURL(engine);
}
inline bool
BrowserWindow::_IsValidDomainChar(char ch)
{
// TODO: Currenlty, only a whitespace character
// breaks a domain name. It might be
// a good idea (or a bad one) to make
// character filtering based on the
// IDNA 2008 standard.
return ch != ' ';
}
void
BrowserWindow::_SmartURLHandler(const BString& url)
{
// Only process if this doesn't look like a full URL (http:// or // Only process if this doesn't look like a full URL (http:// or
// file://, etc.) // file://, etc.)
if (url.FindFirst("://") == B_ERROR) {
if (url.FindFirst(".") == B_ERROR || url.FindFirst(" ") != B_ERROR) BString temp;
result.Prepend("http://www.google.com/search?q="); int32 at = url.FindFirst(":");
if (at != B_ERROR) {
BString proto;
url.CopyInto(proto, 0, at);
if (proto == "http" || proto == "https" || proto == "file")
_VisitURL(url);
else {
temp = "application/x-vnd.Be.URL.";
temp += proto;
char* argv[1] = { (char*)url.String() };
if (be_roster->Launch(temp.String(), 1, argv) != B_OK)
_VisitSearchEngine(url);
}
} else if (url == "localhost")
_VisitURL("http://localhost/");
else {
const char* localhostPrefix = "localhost/";
if(url.Compare(localhostPrefix, strlen(localhostPrefix)) == 0)
_VisitURL(url);
else {
bool isURL = false;
for (int32 i = 0; i < url.CountChars(); i++) {
if (url[i] == '.')
isURL = true;
else if (url[i] == '/')
break;
else if (!_IsValidDomainChar(url[i])) {
isURL = false;
break;
}
}
if (isURL)
_VisitURL(url);
else
_VisitSearchEngine(url);
}
} }
return result;
} }

View File

@ -190,7 +190,12 @@ private:
void _InvokeButtonVisibly(BButton* button); void _InvokeButtonVisibly(BButton* button);
BString _NewTabURL(bool isNewWindow) const; BString _NewTabURL(bool isNewWindow) const;
BString _SmartURLHandler(const BString& url) const;
BString _EncodeURIComponent(const BString& search);
void _VisitURL(const BString& url);
void _VisitSearchEngine(const BString& search);
inline bool _IsValidDomainChar(char ch);
void _SmartURLHandler(const BString& url);
void _HandlePageSourceResult( void _HandlePageSourceResult(
const BMessage* message); const BMessage* message);

View File

@ -50,7 +50,6 @@ local sources =
URLInputGroup.cpp URLInputGroup.cpp
; ;
Includes [ FGristFiles $(sources) ] : $(HAIKU_WEBKIT_HEADERS_DEPENDENCY) ; Includes [ FGristFiles $(sources) ] : $(HAIKU_WEBKIT_HEADERS_DEPENDENCY) ;
# Dependency needed to trigger downloading/unzipping the package before # Dependency needed to trigger downloading/unzipping the package before
# compiling the files. # compiling the files.
@ -60,12 +59,14 @@ Includes [ FGristFiles $(sources) ] : $(HAIKU_WEBKIT_HEADERS_DEPENDENCY) ;
#MakeLocate $(svnRevisionFile) : $(LOCATE_TARGET) ; #MakeLocate $(svnRevisionFile) : $(LOCATE_TARGET) ;
#CreateSVNRevisionFile $(svnRevisionFile) ; #CreateSVNRevisionFile $(svnRevisionFile) ;
UsePrivateHeaders shared ;
Application WebPositive : Application WebPositive :
$(sources) $(sources)
: :
$(HAIKU_WEBKIT_LIBS) $(HAIKU_WEBKIT_LIBS)
$(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS)
be network tracker translation be libshared.a network tracker translation
: :
WebPositive.rdef WebPositive.rdef
; ;

View File

@ -1,13 +1,13 @@
resource app_signature "application/x-vnd.Haiku-WebPositive"; resource app_signature "application/x-vnd.Haiku-WebPositive";
resource app_version { resource app_version {
major = 0, major = 1,
middle = 0, middle = 1,
minor = 1, minor = 0,
variety = B_APPV_ALPHA, variety = B_APPV_ALPHA,
internal = 0, internal = 0,
short_info = "WebPositive", short_info = "WebPositive",
long_info = "WebPositive ©2007-2010 The WebKit Haiku Project" long_info = "WebPositive ©2007-2012 The WebKit Haiku Project"
}; };
resource app_flags B_SINGLE_LAUNCH; resource app_flags B_SINGLE_LAUNCH;

View File

@ -118,7 +118,7 @@ main(int argc, char **argv)
if (argc < 2 || !strcmp(argv[1], "--help")) { if (argc < 2 || !strcmp(argv[1], "--help")) {
char *filename = strrchr(argv[0],'/'); char *filename = strrchr(argv[0],'/');
fprintf(stderr,"usage: %s [-srib] <device> [allocation_group start]\n" fprintf(stderr,"usage: %s [-srib] <device> [allocation_group start]\n"
"\t-s\tdump super block\n" "\t-s\tdump superblock\n"
"\t-r\tdump root node\n" "\t-r\tdump root node\n"
" the following options need the allocation_group/start " " the following options need the allocation_group/start "
"parameters:\n" "parameters:\n"
@ -214,7 +214,7 @@ main(int argc, char **argv)
} }
if (disk.ValidateSuperBlock() < B_OK) { if (disk.ValidateSuperBlock() < B_OK) {
fprintf(stderr, "The disk's super block is corrupt (or it's not a BFS " fprintf(stderr, "The disk's superblock is corrupt (or it's not a BFS "
"device)!\n"); "device)!\n");
return 0; return 0;
} }

View File

@ -286,7 +286,7 @@ main(int argc, char** argv)
} }
if (disk.ValidateSuperBlock() != B_OK) { if (disk.ValidateSuperBlock() != B_OK) {
fprintf(stderr, "The disk's super block is corrupt!\n"); fprintf(stderr, "The disk's superblock is corrupt!\n");
return -1; return -1;
} }
@ -307,7 +307,7 @@ main(int argc, char** argv)
disk.Log().allocation_group, disk.Log().start, disk.Log().allocation_group, disk.Log().start,
disk.Log().length); disk.Log().length);
} else if (block < 1) { } else if (block < 1) {
printf("Super Block intersects\n"); printf("Superblock intersects\n");
} else if (block < 1 + disk.BitmapSize()) { } else if (block < 1 + disk.BitmapSize()) {
printf("Block bitmap intersects (start %d, end %lu)\n", 1, printf("Block bitmap intersects (start %d, end %lu)\n", 1,
disk.BitmapSize()); disk.BitmapSize());

View File

@ -52,10 +52,10 @@ class BlockRunHashtable : public Hashtable
return false; return false;
memcpy(value,&run,sizeof(block_run)); memcpy(value,&run,sizeof(block_run));
if (Hashtable::Put(value,value)) if (Hashtable::Put(value,value))
return true; return true;
free(value); free(value);
return false; return false;
} }
@ -133,7 +133,7 @@ collectFiles(Disk &disk)
return; return;
} }
collectFiles(disk,root); collectFiles(disk,root);
printf(" %7Ld files found.\n",gCount); printf(" %7Ld files found.\n",gCount);
delete root; delete root;
@ -201,7 +201,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute)
{ {
runs[index++] = *run; runs[index++] = *run;
} }
// sort array to speed up disk access // sort array to speed up disk access
qsort(runs,index,sizeof(block_run),(int (*)(const void *,const void *))compareBlockRuns); qsort(runs,index,sizeof(block_run),(int (*)(const void *,const void *))compareBlockRuns);
@ -227,7 +227,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute)
delete inode; delete inode;
continue; continue;
} }
// check indices not based on standard attributes // check indices not based on standard attributes
if (sizeIndex) if (sizeIndex)
{ {
@ -422,7 +422,7 @@ main(int argc,char **argv)
printUsage(toolName); printUsage(toolName);
return -1; return -1;
} }
while (*++argv) while (*++argv)
{ {
char *arg = *argv; char *arg = *argv;
@ -447,7 +447,7 @@ main(int argc,char **argv)
else else
break; break;
} }
char *attribute = argv[0]; char *attribute = argv[0];
if (!gCheckAll && attribute == NULL) if (!gCheckAll && attribute == NULL)
{ {
@ -476,13 +476,13 @@ main(int argc,char **argv)
fprintf(stderr,"Could not open device or file \"%s\": %s\n",info.device_name,strerror(status)); fprintf(stderr,"Could not open device or file \"%s\": %s\n",info.device_name,strerror(status));
return -1; return -1;
} }
if (disk.ValidateSuperBlock() < B_OK) if (disk.ValidateSuperBlock() < B_OK)
{ {
fprintf(stderr,"The disk's super block is corrupt!\n"); fprintf(stderr,"The disk's superblock is corrupt!\n");
return -1; return -1;
} }
Directory *indices = (Directory *)Inode::Factory(&disk,disk.Indices()); Directory *indices = (Directory *)Inode::Factory(&disk,disk.Indices());
if (indices == NULL || (status = indices->InitCheck()) < B_OK) if (indices == NULL || (status = indices->InitCheck()) < B_OK)
{ {
@ -497,7 +497,7 @@ main(int argc,char **argv)
delete indices; delete indices;
return -1; return -1;
} }
block_run run; block_run run;
if (gCheckAll) if (gCheckAll)
@ -515,7 +515,7 @@ main(int argc,char **argv)
fprintf(stderr," Could not find index directory for \"%s\"!\n",attribute); fprintf(stderr," Could not find index directory for \"%s\"!\n",attribute);
delete indices; delete indices;
gHashtable.MakeEmpty(HASH_EMPTY_NONE,HASH_EMPTY_FREE); gHashtable.MakeEmpty(HASH_EMPTY_NONE,HASH_EMPTY_FREE);
return 0; return 0;

View File

@ -2,7 +2,7 @@
* Copyright (c) 2001-2008 pinc Software. All Rights Reserved. * Copyright (c) 2001-2008 pinc Software. All Rights Reserved.
*/ */
//! Handles BFS super block, disk access etc. //! Handles BFS superblock, disk access etc.
#include "Disk.h" #include "Disk.h"
#include "dump.h" #include "dump.h"
@ -157,7 +157,7 @@ Disk::Disk(const char *deviceName, bool rawMode, off_t start, off_t stop)
if (fBufferedFile->ReadAt(512 + fRawDiskOffset, &fSuperBlock, if (fBufferedFile->ReadAt(512 + fRawDiskOffset, &fSuperBlock,
sizeof(disk_super_block)) < 1) sizeof(disk_super_block)) < 1)
fprintf(stderr,"Disk: Could not read super block\n"); fprintf(stderr,"Disk: Could not read superblock\n");
//dump_super_block(&fSuperBlock); //dump_super_block(&fSuperBlock);
} }
@ -277,21 +277,21 @@ Disk::ScanForSuperBlock(off_t start, off_t stop)
printf("\n(%ld) *** BFS superblock found at: %Ld\n",superBlocks.CountItems() + 1,offset); printf("\n(%ld) *** BFS superblock found at: %Ld\n",superBlocks.CountItems() + 1,offset);
dump_super_block(super); dump_super_block(super);
// add a copy of the super block to the list // add a copy of the superblock to the list
bfs_disk_info *info = (bfs_disk_info *)malloc(sizeof(bfs_disk_info)); bfs_disk_info *info = (bfs_disk_info *)malloc(sizeof(bfs_disk_info));
if (info == NULL) if (info == NULL)
return B_NO_MEMORY; return B_NO_MEMORY;
memcpy(&info->super_block, super, sizeof(disk_super_block)); memcpy(&info->super_block, super, sizeof(disk_super_block));
info->offset = offset + i - 512; info->offset = offset + i - 512;
/* location off the BFS super block is 512 bytes after the partition start */ /* location off the BFS superblock is 512 bytes after the partition start */
superBlocks.AddItem(info); superBlocks.AddItem(info);
} }
} }
} }
if (superBlocks.CountItems() == 0) { if (superBlocks.CountItems() == 0) {
puts("\nCouldn't find any BFS super blocks!"); puts("\nCouldn't find any BFS superblocks!");
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
} }
@ -411,7 +411,7 @@ Disk::RecreateSuperBlock()
bfs_inode indexDir; bfs_inode indexDir;
bfs_inode rootDir; bfs_inode rootDir;
if (ScanForIndexAndRoot(&indexDir,&rootDir) < B_OK) { if (ScanForIndexAndRoot(&indexDir,&rootDir) < B_OK) {
fprintf(stderr,"ERROR: Could not find root directory! Trying to recreate the super block will have no effect!\n\tSetting standard values for the root dir.\n"); fprintf(stderr,"ERROR: Could not find root directory! Trying to recreate the superblock will have no effect!\n\tSetting standard values for the root dir.\n");
rootDir.inode_num.allocation_group = 8; rootDir.inode_num.allocation_group = 8;
rootDir.inode_num.start = 0; rootDir.inode_num.start = 0;
rootDir.inode_num.length = 1; rootDir.inode_num.length = 1;

View File

@ -1,6 +1,6 @@
#ifndef DISK_H #ifndef DISK_H
#define DISK_H #define DISK_H
/* Disk - handles BFS super block, disk access etc. /* Disk - handles BFS superblock, disk access etc.
** **
** Copyright (c) 2001-2003 pinc Software. All Rights Reserved. ** Copyright (c) 2001-2003 pinc Software. All Rights Reserved.
*/ */

View File

@ -709,7 +709,7 @@ usage(char *name)
"\t-i\trecreate indices on target disk\n" "\t-i\trecreate indices on target disk\n"
"\t-d\tdump missing and recreated i-nodes\n" "\t-d\tdump missing and recreated i-nodes\n"
"\t-r\tdisk access in raw mode (use only if the partition table is invalid)\n" "\t-r\tdisk access in raw mode (use only if the partition table is invalid)\n"
"\t-s\trecreate super block and exit (for experts only, don't use this\n" "\t-s\trecreate superblock and exit (for experts only, don't use this\n"
"\t\tif you don't know what you're doing)\n" "\t\tif you don't know what you're doing)\n"
"\t-v\tverbose output\n", name); "\t-v\tverbose output\n", name);
exit(-1); exit(-1);
@ -804,15 +804,15 @@ main(int argc, char **argv)
bool recreatedSuperBlock = false; bool recreatedSuperBlock = false;
if (disk.ValidateSuperBlock() < B_OK) { if (disk.ValidateSuperBlock() < B_OK) {
fprintf(stderr, "The disk's super block is corrupt!\n"); fprintf(stderr, "The disk's superblock is corrupt!\n");
if (disk.RecreateSuperBlock() < B_OK) { if (disk.RecreateSuperBlock() < B_OK) {
fprintf(stderr, "Can't recreate the disk's super block, sorry!\n"); fprintf(stderr, "Can't recreate the disk's superblock, sorry!\n");
return -1; return -1;
} }
recreatedSuperBlock = true; recreatedSuperBlock = true;
} }
if (gVerbose) { if (gVerbose) {
puts("\n*** The super block:\n"); puts("\n*** The superblock:\n");
dump_super_block(disk.SuperBlock()); dump_super_block(disk.SuperBlock());
} }
@ -825,7 +825,7 @@ main(int argc, char **argv)
status_t status = disk.WriteAt(512, disk.SuperBlock(), status_t status = disk.WriteAt(512, disk.SuperBlock(),
sizeof(disk_super_block)); sizeof(disk_super_block));
if (status < B_OK) { if (status < B_OK) {
fprintf(stderr, "Could not write super block: %s!\n", fprintf(stderr, "Could not write superblock: %s!\n",
strerror(status)); strerror(status));
return 1; return 1;
} }

Some files were not shown because too many files have changed in this diff Show More