Merge branch 'master' into sam460ex

This commit is contained in:
François Revol 2012-11-02 23:31:50 +01:00
commit e5ad6254c6
34 changed files with 1027 additions and 748 deletions

View File

@ -1355,7 +1355,7 @@ if $(HAIKU_NO_WERROR) != 1 {
EnableWerror src add-ons translators bmp ;
# EnableWerror src add-ons translators exr ;
EnableWerror src add-ons translators gif ;
EnableWerror src add-ons translators hpgs ;
# EnableWerror src add-ons translators hpgs ;
EnableWerror src add-ons translators hvif ;
EnableWerror src add-ons translators ico ;
# EnableWerror src add-ons translators jpeg ; # gcc2

View File

@ -87,18 +87,18 @@ SYSTEM_LIBS =
libbe.so libbsd.so libbnetapi.so
libdebug.so libdevice.so
libgame.so $(X86_ONLY)libGL.so libgnu.so
$(HAIKU_JPEG_CURRENT_LIB)
libmail.so libmedia.so libmidi.so libmidi2.so
libnetwork.so
$(HAIKU_LIBPNG_CURRENT_LIB)
<revisioned>libroot.so libroot-addon-icu.so
libscreensaver.so
libtextencoding.so libtiff.so libtracker.so libtranslation.so
libz.so
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
$(HAIKU_FREETYPE_CURRENT_LIB)
;
PRIVATE_SYSTEM_LIBS =
$(HAIKU_JPEG_CURRENT_LIB)
$(HAIKU_LIBPNG_CURRENT_LIB)
$(HAIKU_ZLIB_CURRENT_LIB)
$(HAIKU_FREETYPE_CURRENT_LIB)
libalm.so
libfluidsynth.so
libilmimf.so
@ -334,6 +334,13 @@ SYSTEM_LIBS_ALIASES =
$(SYSTEM_LIBS_LIBBE_ALIASES)
;
OPTIONAL_LIBS_ALIASES =
$(HAIKU_FREETYPE_CURRENT_LINK)
$(HAIKU_JPEG_CURRENT_LINK)
$(HAIKU_LIBPNG_CURRENT_LINK)
$(HAIKU_ZLIB_CURRENT_LINK)
;
# libfreetype.so links to the current freetype lib
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_FREETYPE_CURRENT_LIB:BS)
: $(HAIKU_FREETYPE_CURRENT_LINK) : : true ;
@ -352,6 +359,12 @@ AddSymlinkToHaikuHybridImage system lib : $(HAIKU_JPEG_CURRENT_LIB:BS)
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_JPEG_CURRENT_LINK)
: libjpeg.so : : true ;
# zlib.so links to the current zlib
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_ZLIB_CURRENT_LIB:BS)
: $(HAIKU_ZLIB_CURRENT_LINK) : : true ;
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_ZLIB_CURRENT_LINK)
: libzlib.so : : true ;
# servers
AddFilesToHaikuImage system servers : $(SYSTEM_SERVERS) ;
@ -724,42 +737,42 @@ AddDirectoryToHaikuImage home config settings printers "Save as PDF"
# PDF Writer enconding files
CopyDirectoryToHaikuImage system data
: [ FDirName $(HAIKU_TOP) src add-ons print drivers pdf encoding ]
: "PDF Writer" : -x .svn -x Jamfile ;
: "PDF Writer" : -x Jamfile ;
# Gutenprint data files
CopyDirectoryToHaikuImage system data
: [ FDirName $(HAIKU_TOP) src libs print libgutenprint src xml ]
: gutenprint : -x .svn -x *.c -x Makefile.am -x Makefile.in ;
: gutenprint : -x *.c -x Makefile.am -x Makefile.in ;
# dvb channel settings
CopyDirectoryToHaikuImage home config settings Media
: [ FDirName $(HAIKU_TOP) data settings media dvb ]
: dvb : -x .svn -x Jamfile ;
: dvb : -x Jamfile ;
# licenses
CopyDirectoryToHaikuImage system data
: [ FDirName $(HAIKU_TOP) data system data licenses ]
: licenses : -x .svn ;
: licenses ;
# Copy documentation as per DiskUsage's license requirement.
CopyDirectoryToHaikuImage system documentation
: [ FDirName $(HAIKU_TOP) docs apps diskusage ]
: diskusage : -x .svn ;
: diskusage ;
# Copy documentation as per PDFlib Lite's license requirement.
CopyDirectoryToHaikuImage system documentation
: [ FDirName $(HAIKU_TOP) src libs pdflib doc ]
: pdflib : -x .svn ;
: pdflib ;
# Copy sample programs as per PDFlib Lite's license requirement.
CopyDirectoryToHaikuImage develop sample-code
: [ FDirName $(HAIKU_TOP) src libs pdflib bind pdflib ]
: pdflib : -x .svn ;
: pdflib ;
# Copy Mesa3D GL headers into image
if $(TARGET_ARCH) = x86 {
CopyDirectoryToHaikuImage develop headers os opengl
: [ FDirName $(HAIKU_MESA_HEADERS) GL ] : : -x .svn ;
: [ FDirName $(HAIKU_MESA_HEADERS) GL ] ;
}
#pragma mark - Optional Packages

View File

@ -705,7 +705,7 @@ rule AddSourceDirectoryToHaikuImage dirTokens : alwaysUpdate
CopyDirectoryToHaikuImage home HaikuSources
: [ FDirName $(HAIKU_TOP) $(dirTokens) ]
: : -x .svn : $(alwaysUpdate) ;
: : : $(alwaysUpdate) ;
}
rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : alwaysUpdate
@ -715,7 +715,7 @@ rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : alwaysUpdate
CopyDirectoryToHaikuImage develop headers
: [ FDirName $(HAIKU_TOP) headers $(dirTokens) ]
: $(dirName) : -x .svn : $(alwaysUpdate) ;
: $(dirName) : : $(alwaysUpdate) ;
}
rule AddWifiFirmwareToHaikuImage driver : package : archive : extract

View File

@ -581,3 +581,43 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 {
} else {
Echo "jpeg support not available on $(TARGET_ARCH)" ;
}
# zlib
local zlibBaseURL = $(baseURL)/lib ;
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 {
if $(TARGET_ARCH) = ppc {
HAIKU_ZLIB_FILE = zlib-1.2.7-ppc-gcc4-2012-10-30.zip ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_ZLIB_FILE = zlib-1.2.7-x86-gcc4-2012-10-30.zip ;
} else {
HAIKU_ZLIB_FILE = zlib-1.2.7-x86-gcc2-2012-10-30.zip ;
}
local zlibZipFile = [ DownloadFile $(HAIKU_ZLIB_FILE)
: $(zlibBaseURL)/$(HAIKU_ZLIB_FILE) ] ;
HAIKU_ZLIB_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_ZLIB_FILE:B) ] ;
HAIKU_ZLIB_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_ZLIB_DIR)
: common/include : $(zlibZipFile)
: extracted-zlib ] ;
HAIKU_ZLIB_LIB = [ ExtractArchive $(HAIKU_ZLIB_DIR)
:
common/lib/libz.so
: $(zlibZipFile)
: extracted-zlib ] ;
HAIKU_ZLIB_CURRENT_LIB = [ ExtractArchive $(HAIKU_ZLIB_DIR)
:
common/lib/libz.so.1.2.7
: $(zlibZipFile)
: extracted-zlib ] ;
Depends $(HAIKU_ZLIB_LIB) $(HAIKU_ZLIB_CURRENT_LIB) : $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
HAIKU_ZLIB_CURRENT_LINK = libz.so.1 ;
HAIKU_ZLIB_HEADERS = [ FDirName $(HAIKU_ZLIB_DIR) common include ] ;
} else {
Echo "zlib support not available on $(TARGET_ARCH)" ;
}

View File

@ -782,7 +782,8 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
# library symlinks
local lib ;
for lib in $(SYSTEM_LIBS) $(SYSTEM_LIBS_LIBGL_ALIASES) $(developmentLibs) {
for lib in $(SYSTEM_LIBS) $(SYSTEM_LIBS_LIBGL_ALIASES) $(developmentLibs)
$(OPTIONAL_LIBS_ALIASES) {
AddSymlinkToHaikuHybridImage $(abiDirTokens) lib
: /system/lib $(lib:BS) : : true ;
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;
@ -846,7 +847,6 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
AddHeaderDirectoryToHaikuImage libs ncurses : 3rdparty ;
AddHeaderDirectoryToHaikuImage libs termcap : 3rdparty ;
AddHeaderDirectoryToHaikuImage libs tiff : 3rdparty ;
AddHeaderDirectoryToHaikuImage libs zlib : 3rdparty ;
CopyDirectoryToHaikuImage develop headers :
[ FDirName $(HAIKU_FREETYPE_DIR) develop headers 3rdparty ] ;
@ -854,14 +854,16 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
: 3rdparty ;
CopyDirectoryToHaikuImage develop headers : $(HAIKU_LIBPNG_HEADERS)
: 3rdparty ;
CopyDirectoryToHaikuImage develop headers : $(HAIKU_ZLIB_HEADERS)
: 3rdparty ;
# cpp headers
if $(HAIKU_GCC_VERSION[1]) = 2 {
# GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
CopyDirectoryToHaikuImage $(abiDirTokens) headers
: [ FDirName $(HAIKU_TOP) headers cpp ] : : -x .svn ;
: [ FDirName $(HAIKU_TOP) headers cpp ] ;
CopyDirectoryToAlternativeGCCArchive $(abiDirTokens) headers
: [ FDirName $(HAIKU_TOP) headers cpp ] : : -x .svn ;
: [ FDirName $(HAIKU_TOP) headers cpp ] ;
}
}
@ -1978,10 +1980,10 @@ if [ IsOptionalHaikuImagePackageAdded WebPositiveBookmarks ] {
if [ IsOptionalHaikuImagePackageAdded Welcome ] {
CopyDirectoryToHaikuImage system documentation
: [ FDirName $(HAIKU_TOP) docs welcome ]
: welcome : -x .svn ;
: welcome ;
CopyDirectoryToHaikuImage system documentation
: [ FDirName $(HAIKU_TOP) docs userguide ]
: userguide : -x .svn ;
: userguide ;
}

View File

@ -109,7 +109,7 @@ copy_headers()
sourceDir=$1
targetDir=$2
headers="`find $sourceDir -name \*\.h | grep -v /.svn`"
headers="`find $sourceDir -name \*\.h`"
headers="`echo $headers | sed -e s@$sourceDir/@@g`"
for f in $headers; do
headerTargetDir=$targetDir/`dirname $f`

View File

@ -130,7 +130,7 @@ copy_headers()
sourceDir=$1
targetDir=$2
headers="$(find $sourceDir -name \*\.h | grep -v /.svn)"
headers="$(find $sourceDir -name \*\.h)"
headers="$(echo $headers | sed -e s@$sourceDir/@@g)"
for f in $headers; do
headerTargetDir=$targetDir/$(dirname $f)

2
configure vendored
View File

@ -327,7 +327,7 @@ HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy`
SFDISK_BINARY=sfdisk
HOST_SFDISK=$SFDISK_BINARY
haikuRequiredLegacyGCCVersion="2.95.3-haiku-121012"
haikuRequiredLegacyGCCVersion="2.95.3-haiku-121101"
export haikuRequiredLegacyGCCVersion
# version of legacy gcc required to build haiku

View File

@ -350,7 +350,10 @@ private:
public:
const charT* c_str () const
{ if (length () == 0) return ""; terminate (); return data (); }
{
static const charT null_str[1] = {0};
if (length () == 0) return null_str; terminate (); return data ();
}
void resize (size_type n, charT c);
void resize (size_type n)
{ resize (n, eos ()); }

View File

@ -387,6 +387,22 @@ template <class _FLT> complex<_FLT>
template <class _FLT> complex<_FLT>
sqrt (const complex<_FLT>&) __attribute__ ((const));
template <class _FLT> inline complex<_FLT>
tan (const complex<_FLT>& x)
{
return sin (x) / cos (x);
}
template <class _FLT> inline complex<_FLT>
tanh (const complex<_FLT>& x)
{
return sinh (x) / cosh (x);
}
template <class _FLT> inline complex<_FLT>
log10 (const complex<_FLT>& x)
{
return log (x) / log (10.0);
}
template <class _FLT> istream& operator >> (istream&, complex<_FLT>&);
template <class _FLT> ostream& operator << (ostream&, const complex<_FLT>&);
} // extern "C++"

View File

@ -220,7 +220,7 @@ extern int execle(const char *path, const char *arg , ... /*, char **envp */);
extern int exect(const char *path, char *const *argv);
extern int execvp(const char *file, char *const *argv);
extern void _exit(int status);
extern void _exit(int status) __attribute__ ((noreturn));
extern pid_t tcgetpgrp(int fd);
extern int tcsetpgrp(int fd, pid_t pgrpid);

View File

@ -3,6 +3,6 @@ SubDir HAIKU_TOP src add-ons kernel busses ata ;
SubInclude HAIKU_TOP src add-ons kernel busses ata generic_ide_pci ;
SubInclude HAIKU_TOP src add-ons kernel busses ata ide_isa ;
SubInclude HAIKU_TOP src add-ons kernel busses ata it8211 ;
#SubInclude HAIKU_TOP src add-ons kernel busses ata promise_tx2 ;
SubInclude HAIKU_TOP src add-ons kernel busses ata promise_tx2 ;
SubInclude HAIKU_TOP src add-ons kernel busses ata silicon_image_3112 ;
SubInclude HAIKU_TOP src add-ons kernel busses ata legacy_sata ;

View File

@ -21,65 +21,70 @@
#include "wrapper.h"
#define PROMISE_TX2_CONTROLLER_MODULE_NAME "busses/ata/promise_tx2/device_v1"
#define PROMISE_TX2_CONTROLLER_MODULE_NAME "busses/ata/promise_tx2/driver_v1"
#define PROMISE_TX2_CHANNEL_MODULE_NAME "busses/ata/promise_tx2/channel/v1"
static ata_for_controller_interface *ide;
static ata_adapter_interface *ata_adapter;
static device_manager_info *pnp;
static ata_for_controller_interface *sATA;
static ata_adapter_interface *sATAAdapter;
static device_manager_info *sDeviceManager;
static void
set_channel(void *cookie, ata_channel channel)
{
sATAAdapter->set_channel((ata_adapter_channel_info *)cookie, channel);
}
static status_t
write_command_block_regs(void *channel_cookie, ata_task_file *tf, ata_reg_mask mask)
{
return ata_adapter->write_command_block_regs((ata_adapter_channel_info *)channel_cookie, tf, mask);
return sATAAdapter->write_command_block_regs((ata_adapter_channel_info *)channel_cookie, tf, mask);
}
static status_t
read_command_block_regs(void *channel_cookie, ata_task_file *tf, ata_reg_mask mask)
{
return ata_adapter->read_command_block_regs((ata_adapter_channel_info *)channel_cookie, tf, mask);
return sATAAdapter->read_command_block_regs((ata_adapter_channel_info *)channel_cookie, tf, mask);
}
static uint8
get_altstatus(void *channel_cookie)
{
return ata_adapter->get_altstatus((ata_adapter_channel_info *)channel_cookie);
return sATAAdapter->get_altstatus((ata_adapter_channel_info *)channel_cookie);
}
static status_t
write_device_control(void *channel_cookie, uint8 val)
{
return ata_adapter->write_device_control((ata_adapter_channel_info *)channel_cookie, val);
return sATAAdapter->write_device_control((ata_adapter_channel_info *)channel_cookie, val);
}
static status_t
write_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
{
return ata_adapter->write_pio((ata_adapter_channel_info *)channel_cookie, data, count, force_16bit);
return sATAAdapter->write_pio((ata_adapter_channel_info *)channel_cookie, data, count, force_16bit);
}
static status_t
read_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
{
return ata_adapter->read_pio((ata_adapter_channel_info *)channel_cookie, data, count, force_16bit);
return sATAAdapter->read_pio((ata_adapter_channel_info *)channel_cookie, data, count, force_16bit);
}
static int32
inthand(void *arg)
handle_interrupt(void *arg)
{
ata_adapter_channel_info *channel = (ata_adapter_channel_info *)arg;
pci_device_module_info *pci = channel->pci;
pci_device device = channel->device;
ide_bm_status bm_status;
uint8 status;
pci_device *device = channel->device;
SHOW_FLOW0( 3, "" );
@ -91,7 +96,7 @@ inthand(void *arg)
if ((pci->read_io_8(device, channel->bus_master_base + 3) & 0x20) == 0)
return B_UNHANDLED_INTERRUPT;
return ata_adapter->inthand(arg);
return sATAAdapter->inthand(arg);
}
@ -99,88 +104,86 @@ static status_t
prepare_dma(void *channel_cookie, const physical_entry *sg_list,
size_t sg_list_count, bool to_device)
{
return ata_adapter->prepare_dma((ata_adapter_channel_info *)channel_cookie, sg_list, sg_list_count, to_device);
return sATAAdapter->prepare_dma((ata_adapter_channel_info *)channel_cookie, sg_list, sg_list_count, to_device);
}
static status_t
start_dma(void *channel_cookie)
{
return ata_adapter->start_dma((ata_adapter_channel_info *)channel_cookie);
return sATAAdapter->start_dma((ata_adapter_channel_info *)channel_cookie);
}
static status_t
finish_dma(void *channel_cookie)
{
return ata_adapter->finish_dma((ata_adapter_channel_info *)channel_cookie);
return sATAAdapter->finish_dma((ata_adapter_channel_info *)channel_cookie);
}
static status_t
init_channel(device_node_handle node, ata_channel ata_channel,
void **channel_cookie)
init_channel(device_node *node, void **channel_cookie)
{
return ata_adapter->init_channel(node, ata_channel, (ata_adapter_channel_info **)channel_cookie,
sizeof(ata_adapter_channel_info), inthand);
}
static status_t
uninit_channel(void *channel_cookie)
{
return ata_adapter->uninit_channel((ata_adapter_channel_info *)channel_cookie);
}
static void channel_removed(device_node_handle node, void *channel_cookie)
{
return ata_adapter->channel_removed(node, (ata_adapter_channel_info *)channel_cookie);
}
static status_t
init_controller(device_node_handle node, void *user_cookie,
ata_adapter_controller_info **cookie)
{
return ata_adapter->init_controller(node, user_cookie, cookie,
sizeof(ata_adapter_controller_info));
}
static status_t
uninit_controller(ata_adapter_controller_info *controller)
{
return ata_adapter->uninit_controller(controller);
return sATAAdapter->init_channel(node,
(ata_adapter_channel_info **)channel_cookie,
sizeof(ata_adapter_channel_info), handle_interrupt);
}
static void
controller_removed(device_node_handle node, ata_adapter_controller_info *controller)
uninit_channel(void *channel_cookie)
{
return ata_adapter->controller_removed(node, controller);
sATAAdapter->uninit_channel((ata_adapter_channel_info *)channel_cookie);
}
static void channel_removed(void *channel_cookie)
{
return sATAAdapter->channel_removed(
(ata_adapter_channel_info *)channel_cookie);
}
static status_t
init_controller(device_node *node, void **cookie)
{
return sATAAdapter->init_controller(node,
(ata_adapter_controller_info **)cookie,
sizeof(ata_adapter_controller_info));
}
static void
uninit_controller(void *controller)
{
sATAAdapter->uninit_controller(
(ata_adapter_controller_info *)controller);
}
static void
controller_removed(void *controller)
{
return sATAAdapter->controller_removed(
(ata_adapter_controller_info *)controller);
}
// publish node of ide controller
static status_t
publish_controller(device_node_handle parent, uint16 bus_master_base, uint8 intnum,
io_resource_handle *resources, device_node_handle *node)
publish_controller(device_node *parent, uint16 bus_master_base, uint8 intnum,
io_resource *resources, device_node **node)
{
device_attr attrs[] = {
// info about ourself and our consumer
{ B_DRIVER_MODULE, B_STRING_TYPE, { string: PROMISE_TX2_CONTROLLER_MODULE_NAME }},
// properties of this controller for ide bus manager
// there are always max. 2 devices
{ IDE_CONTROLLER_MAX_DEVICES_ITEM, B_UINT8_TYPE, { ui8: 2 }},
{ ATA_CONTROLLER_MAX_DEVICES_ITEM, B_UINT8_TYPE, { ui8: 2 }},
// of course we can DMA
{ IDE_CONTROLLER_CAN_DMA_ITEM, B_UINT8_TYPE, { ui8: 1 }},
// command queuing always works
{ IDE_CONTROLLER_CAN_CQ_ITEM, B_UINT8_TYPE, { ui8: 1 }},
{ ATA_CONTROLLER_CAN_DMA_ITEM, B_UINT8_TYPE, { ui8: 1 }},
// choose any name here
{ IDE_CONTROLLER_CONTROLLER_NAME_ITEM, B_STRING_TYPE, { string: "Promise TX2" }},
{ ATA_CONTROLLER_CONTROLLER_NAME_ITEM, B_STRING_TYPE, { string: "Promise TX2" }},
// DMA properties
// some say it must be dword-aligned, others that it can be byte-aligned;
@ -203,19 +206,18 @@ publish_controller(device_node_handle parent, uint16 bus_master_base, uint8 intn
SHOW_FLOW0(2, "");
return pnp->register_device(parent, attrs, resources, node);
return sDeviceManager->register_node(parent,
PROMISE_TX2_CONTROLLER_MODULE_NAME, attrs, resources, node);
}
// detect pure IDE controller, i.e. without channels
static status_t
detect_controller(pci_device_module_info *pci, pci_device pci_device,
device_node_handle parent, uint16 bus_master_base, int8 intnum,
device_node_handle *node)
detect_controller(pci_device_module_info *pci, pci_device *pci_device,
device_node *parent, uint16 bus_master_base, int8 intnum,
device_node **node)
{
io_resource_handle resource_handles[2];
SHOW_FLOW0(3, "");
if ((bus_master_base & PCI_address_space) != 1)
@ -225,33 +227,33 @@ detect_controller(pci_device_module_info *pci, pci_device pci_device,
{
io_resource resources[2] = {
{ IO_PORT, bus_master_base, 16 },
{ B_IO_PORT, bus_master_base, 16 },
{}
};
if (pnp->acquire_io_resources(resources, resource_handles) != B_OK)
return B_ERROR;
return publish_controller(parent, bus_master_base, intnum, resources,
node);
}
return publish_controller(parent, bus_master_base, intnum, resource_handles, node);
}
static status_t
probe_controller(device_node_handle parent)
probe_controller(device_node *parent)
{
pci_device_module_info *pci;
pci_device device;
pci_device *device;
uint16 command_block_base[2];
uint16 control_block_base[2];
uint16 bus_master_base;
device_node_handle controller_node, channels[2];
device_node *controller_node;
device_node *channels[2];
uint8 intnum;
status_t res;
status_t status;
SHOW_FLOW0(3, "");
if (pnp->init_driver(parent, NULL, (driver_module_info **)&pci, (void **)&device) != B_OK)
if (sDeviceManager->get_driver(parent, (driver_module_info **)&pci,
(void **)&device) != B_OK)
return B_ERROR;
command_block_base[0] = pci->read_pci_config(device, PCI_base_registers, 4);
@ -267,99 +269,86 @@ probe_controller(device_node_handle parent)
control_block_base[1] &= PCI_address_io_mask;
bus_master_base &= PCI_address_io_mask;
res = detect_controller(pci, device, parent, bus_master_base, intnum, &controller_node);
if (res != B_OK || controller_node == NULL)
goto err;
status = detect_controller(pci, device, parent, bus_master_base, intnum,
&controller_node);
if (status != B_OK || controller_node == NULL)
return status;
ata_adapter->detect_channel(pci, device, controller_node,
sATAAdapter->detect_channel(pci, device, controller_node,
PROMISE_TX2_CHANNEL_MODULE_NAME, true,
command_block_base[0], control_block_base[0], bus_master_base, intnum,
0, "Primary Channel", &channels[0], false);
ata_adapter->detect_channel(pci, device, controller_node,
sATAAdapter->detect_channel(pci, device, controller_node,
PROMISE_TX2_CHANNEL_MODULE_NAME, true,
command_block_base[1], control_block_base[1], bus_master_base, intnum,
1, "Secondary Channel", &channels[1], false);
pnp->uninit_driver(parent);
return B_OK;
err:
pnp->uninit_driver(parent);
return res;
}
static status_t
std_ops(int32 op, ...)
{
switch (op) {
case B_MODULE_INIT:
case B_MODULE_UNINIT:
return B_OK;
default:
return B_ERROR;
}
}
module_dependency module_dependencies[] = {
{ IDE_FOR_CONTROLLER_MODULE_NAME, (module_info **)&ide },
{ B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&pnp },
{ ATA_ADAPTER_MODULE_NAME, (module_info **)&ata_adapter },
{ ATA_FOR_CONTROLLER_MODULE_NAME, (module_info **)&sATA },
{ B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&sDeviceManager },
{ ATA_ADAPTER_MODULE_NAME, (module_info **)&sATAAdapter },
{}
};
// exported interface
static ide_controller_interface channel_interface = {
static ata_controller_interface sChannelInterface = {
{
{
PROMISE_TX2_CHANNEL_MODULE_NAME,
0,
std_ops
NULL
},
NULL, // supported devices
NULL,
(status_t (*)( device_node_handle , void *, void ** )) init_channel,
NULL, // supports_device()
NULL, // register_device()
init_channel,
uninit_channel,
NULL, // register_child_devices()
NULL, // rescan_child_devices()
channel_removed
},
&write_command_block_regs,
&read_command_block_regs,
set_channel,
&get_altstatus,
&write_device_control,
write_command_block_regs,
read_command_block_regs,
&write_pio,
&read_pio,
get_altstatus,
write_device_control,
&prepare_dma,
&start_dma,
&finish_dma,
write_pio,
read_pio,
prepare_dma,
start_dma,
finish_dma,
};
static driver_module_info controller_interface = {
static driver_module_info sControllerInterface = {
{
PROMISE_TX2_CONTROLLER_MODULE_NAME,
0,
std_ops
NULL
},
NULL,
probe_controller,
(status_t (*)(device_node_handle, void *, void **)) init_controller,
(status_t (*)(void *)) uninit_controller,
(void (*)(device_node_handle, void *)) controller_removed
init_controller,
uninit_controller,
NULL,
NULL,
controller_removed
};
module_info *modules[] = {
(module_info *)&controller_interface,
(module_info *)&channel_interface,
(module_info *)&sControllerInterface,
(module_info *)&sChannelInterface,
NULL
};

View File

@ -8,8 +8,6 @@
*/
#define MIME_STRING_TYPE 'MIMS'
#include <KernelExport.h>
#include <SupportDefs.h>
#include <TypeConstants.h>
@ -23,7 +21,9 @@
#include "mime_table.h"
#include "ntfs.h"
//TODO: notify*()
const char* kHaikuAttrPrefix={"HAIKU-XATTR:"};
status_t
fs_open_attrib_dir(fs_volume *_vol, fs_vnode *_node, void **_cookie)
@ -66,9 +66,9 @@ fs_open_attrib_dir(fs_volume *_vol, fs_vnode *_node, void **_cookie)
exit:
if (ctx)
if (ctx != NULL)
ntfs_attr_put_search_ctx(ctx);
if (ni)
if (ni != NULL)
ntfs_inode_close(ni);
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
@ -153,23 +153,31 @@ fs_read_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie,
TRACE("%s - ENTER\n", __FUNCTION__);
while (!(result = ntfs_attrs_walk(cookie->ctx))) {
ATTR_RECORD *attr = cookie->ctx->attr;
if (attr->type == AT_DATA) {
const char *real_name;
// it's the actual file body
if (attr->name_length == 0)
continue;
name = ntfs_attr_name_get((const ntfschar *)(((char *)attr)
+ attr->name_offset), attr->name_length);
dprintf("found AT_DATA '%s'\n", name);
bufsize = MIN(bufsize, sizeof(struct dirent) + strlen(name) + 1);
if(strncmp(name, kHaikuAttrPrefix, strlen(kHaikuAttrPrefix)) !=0 ) {
TRACE("found AT_DATA '%s' - Skip\n", name);
continue;
}
TRACE("found AT_DATA '%s' - Found\n", name);
real_name = name + strlen(kHaikuAttrPrefix);
bufsize = MIN(bufsize, sizeof(struct dirent) + strlen(real_name) + 1);
entry->d_ino = node->vnid;
entry->d_dev = ns->id;
entry->d_reclen = sizeof(struct dirent) + strlen(name);
entry->d_reclen = sizeof(struct dirent) + strlen(real_name);
//XXX size
strcpy(entry->d_name, name);
strcpy(entry->d_name, real_name);
ntfs_attr_name_free(&name);
numEntries++;
if (numEntries >= *num)
@ -210,9 +218,13 @@ fs_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
int ulen;
ntfs_inode *ni = NULL;
ntfs_attr *na = NULL;
status_t result = B_NO_ERROR;
status_t result = B_NO_ERROR;
TRACE("%s - ENTER\n", __FUNCTION__);
if (ns->flags & B_FS_IS_READONLY) {
return B_READ_ONLY_DEVICE;
}
TRACE("%s - ENTER - name: [%s] vnid: %d\n", __FUNCTION__, name, node->vnid);
LOCK_VOL(ns);
@ -224,7 +236,7 @@ fs_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
ni = ntfs_inode_open(ns->ntvol, node->vnid);
if (ni == NULL) {
result = errno;
ERROR("%s - inode_open: %s\n", __FUNCTION__, strerror(result));
TRACE("%s - inode_open: %s\n", __FUNCTION__, strerror(result));
goto exit;
}
@ -235,59 +247,66 @@ fs_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
// check for a named stream
if (true) {
char ntfs_attr_name[MAX_PATH] = {0};
strcat(ntfs_attr_name, kHaikuAttrPrefix);
strcat(ntfs_attr_name,name);
uname = ntfs_calloc(MAX_PATH);
ulen = ntfs_mbstoucs(name, &uname);
ulen = ntfs_mbstoucs(ntfs_attr_name, &uname);
if (ulen < 0) {
result = EILSEQ;
ERROR("%s - mb alloc: %s\n", __FUNCTION__, strerror(result));
TRACE("%s - mb alloc: %s\n", __FUNCTION__, strerror(result));
goto exit;
}
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
if (na) {
result = EEXIST;
ERROR("%s - ntfs_attr_open: %s\n", __FUNCTION__,
strerror(result));
goto exit;
if (na != NULL) {
if (ntfs_attr_truncate(na, 0)) {
result = errno;
goto exit;
}
} else {
if (ntfs_attr_add(ni, AT_DATA, uname, ulen, NULL, 0) < 0) {
result = errno;
TRACE("%s - ntfs_attr_add: %s\n", __FUNCTION__,
strerror(result));
goto exit;
}
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
if (na == NULL) {
result = errno;
TRACE("%s - ntfs_attr_open: %s\n", __FUNCTION__,
strerror(result));
goto exit;
}
}
//if (ntfs_non_resident_attr_record_add(ni, AT_DATA, uname, ulen, 0, 32,
// 0) < 0) {
if (ntfs_attr_add(ni, AT_DATA, uname, ulen, NULL, 0) < 0) {
if(ntfs_attr_pwrite(na, 0, sizeof(uint32), &type) < 0 ) {
result = errno;
//ERROR("%s - ntfs_non_resident_attr_record_add: %s\n",
ERROR("%s - ntfs_attr_add: %s\n", __FUNCTION__, strerror(result));
goto exit;
}
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
if (!na) {
result = errno;
ERROR("%s - ntfs_attr_open: %s\n", __FUNCTION__,
strerror(result));
goto exit;
}
}
cookie = (attrcookie*)ntfs_calloc(sizeof(attrcookie));
if (cookie != NULL) {
cookie->omode = openMode;
*_cookie = (void*)cookie;
cookie->inode = ni;
cookie->stream = na;
ni = NULL;
na = NULL;
cookie->vnid = node->vnid;
cookie->uname = uname;
cookie->uname_len = ulen;
cookie->type = type;
uname = NULL;
} else
result = ENOMEM;
exit:
if (uname)
if (uname != NULL)
free(uname);
if (na)
if (na != NULL)
ntfs_attr_close(na);
if (ni)
if (ni != NULL)
ntfs_inode_close(ni);
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
@ -310,8 +329,9 @@ fs_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
ntfs_inode *ni = NULL;
ntfs_attr *na = NULL;
status_t result = B_NO_ERROR;
uint32 type = B_XATTR_TYPE;
TRACE("%s - ENTER\n", __FUNCTION__);
TRACE("%s - ENTER - name: [%s] vnid: %d\n", __FUNCTION__, name, node->vnid);
LOCK_VOL(ns);
@ -333,18 +353,33 @@ fs_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
// check for a named stream
if (true) {
char ntfs_attr_name[MAX_PATH] = {0};
strcat(ntfs_attr_name, kHaikuAttrPrefix);
strcat(ntfs_attr_name, name);
uname = ntfs_calloc(MAX_PATH);
ulen = ntfs_mbstoucs(name, &uname);
ulen = ntfs_mbstoucs(ntfs_attr_name, &uname);
if (ulen < 0) {
result = EILSEQ;
goto exit;
}
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
if (na) {
if (na != NULL) {
if (openMode & O_TRUNC) {
if (ntfs_attr_truncate(na, 0))
result = errno;
if (ns->flags & B_FS_IS_READONLY) {
result = B_READ_ONLY_DEVICE;
goto exit;
} else {
if (ntfs_attr_truncate(na, sizeof(uint32))) {
result = errno;
goto exit;
}
}
}
if (ntfs_attr_pread(na, 0, sizeof(uint32), &type) != sizeof(uint32)) {
result = errno;
goto exit;
}
} else {
result = ENOENT;
@ -357,22 +392,23 @@ fs_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
if (cookie != NULL) {
cookie->omode = openMode;
cookie->vnid = node->vnid;
cookie->uname = uname;
cookie->uname_len = ulen;
cookie->type = type;
*_cookie = (void*)cookie;
cookie->inode = ni;
cookie->stream = na;
ni = NULL;
na = NULL;
uname = NULL;
} else
result = ENOMEM;
exit:
if (uname)
if (uname != NULL)
free(uname);
if (na)
if (na != NULL)
ntfs_attr_close(na);
if (ni)
if (ni != NULL)
ntfs_inode_close(ni);
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
@ -386,6 +422,7 @@ exit:
status_t
fs_close_attrib(fs_volume *_vol, fs_vnode *_node, void *cookie)
{
TRACE("%s vnid: %d\n", __FUNCTION__, ((vnode*)_node->private_node)->vnid);
return B_NO_ERROR;
}
@ -398,10 +435,8 @@ fs_free_attrib_cookie(fs_volume *_vol, fs_vnode *_node, void *_cookie)
LOCK_VOL(ns);
if (cookie->stream)
ntfs_attr_close(cookie->stream);
if (cookie->inode)
ntfs_inode_close(cookie->inode);
if (cookie->uname != NULL)
free(cookie->uname);
UNLOCK_VOL(ns);
@ -415,21 +450,33 @@ fs_read_attrib_stat(fs_volume *_vol, fs_vnode *_node, void *_cookie,
struct stat *stat)
{
nspace *ns = (nspace *)_vol->private_volume;
//vnode *node = (vnode *)_node->private_node;
vnode *node = (vnode *)_node->private_node;
attrcookie *cookie = (attrcookie *)_cookie;
//ntfs_inode *ni = cookie->inode;
ntfs_attr *na = cookie->stream;
//status_t result = B_NO_ERROR;
ntfs_inode *ni = NULL;
ntfs_attr *na = NULL;
status_t result = B_NO_ERROR;
LOCK_VOL(ns);
//ERRPRINT("%s - ENTER\n", __FUNCTION__);
ni = ntfs_inode_open(ns->ntvol, node->vnid);
if (ni == NULL) {
result = errno;
goto exit;
}
na = ntfs_attr_open(ni, AT_DATA, cookie->uname, cookie->uname_len);
if (na == NULL) {
result = errno;
goto exit;
}
stat->st_type = B_XATTR_TYPE;
stat->st_size = na ? na->data_size : 0;
stat->st_type = cookie->type;
stat->st_size = na ? na->data_size - sizeof(uint32) : 0;
//exit:
exit:
if (na != NULL)
ntfs_attr_close(na);
if (ni != NULL)
ntfs_inode_close(ni);
UNLOCK_VOL(ns);
@ -442,10 +489,10 @@ fs_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
void *buffer, size_t *len)
{
nspace *ns = (nspace *)_vol->private_volume;
//vnode *node = (vnode *)_node->private_node;
vnode *node = (vnode *)_node->private_node;
attrcookie *cookie = (attrcookie *)_cookie;
ntfs_inode *ni = cookie->inode;
ntfs_attr *na = cookie->stream;
ntfs_inode *ni = NULL;
ntfs_attr *na = NULL;
size_t size = *len;
int total = 0;
status_t result = B_NO_ERROR;
@ -455,20 +502,32 @@ fs_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
return EINVAL;
}
LOCK_VOL(ns);
TRACE("%s - ENTER\n", __FUNCTION__);
TRACE("%s - ENTER vnid: %d\n", __FUNCTION__, node->vnid);
ni = ntfs_inode_open(ns->ntvol, node->vnid);
if (ni == NULL) {
result = errno;
goto exit;
}
na = ntfs_attr_open(ni, AT_DATA, cookie->uname, cookie->uname_len);
if (na == NULL) {
result = errno;
goto exit;
}
pos += sizeof(uint32);
// it is a named stream
if (na) {
if (na != NULL) {
if (pos + size > na->data_size)
size = na->data_size - pos;
while (size) {
off_t bytesRead = ntfs_attr_pread(na, pos, size, buffer);
if (bytesRead < (s64)size) {
ntfs_log_error("ntfs_attr_pread returned less bytes than "
ERROR("ntfs_attr_pread returned less bytes than "
"requested.\n");
}
if (bytesRead <= 0) {
@ -487,10 +546,12 @@ fs_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
result = ENOENT; // TODO
}
fs_ntfs_update_times(_vol, ni, NTFS_UPDATE_ATIME); // XXX needed ?
exit:
if (na != NULL)
ntfs_attr_close(na);
if (ni != NULL)
ntfs_inode_close(ni);
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
UNLOCK_VOL(ns);
@ -500,22 +561,24 @@ exit:
status_t
fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,off_t pos,
fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
const void *buffer, size_t *_length)
{
nspace *ns = (nspace *)_vol->private_volume;
//vnode *node = (vnode *)_node->private_node;
vnode *node = (vnode *)_node->private_node;
attrcookie *cookie = (attrcookie *)_cookie;
ntfs_inode *ni = cookie->inode;
ntfs_attr *na = cookie->stream;
ntfs_inode *ni = NULL;
ntfs_attr *na = NULL;
size_t size = *_length;
char *attr_name = NULL;
char *real_name = NULL;
int total = 0;
status_t result = B_NO_ERROR;
TRACE("%s - ENTER!!\n", __FUNCTION__);
if (ns->flags & B_FS_IS_READONLY) {
ERROR("ntfs is read-only\n");
return EROFS;
TRACE("%s - ENTER vnode: %d\n", __FUNCTION__, node->vnid);
if (ns->flags & B_FS_IS_READONLY) {
return B_READ_ONLY_DEVICE;
}
if (pos < 0) {
@ -523,13 +586,23 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,off_t pos,
return EINVAL;
}
LOCK_VOL(ns);
TRACE("%s - ENTER\n", __FUNCTION__);
ni = ntfs_inode_open(ns->ntvol, node->vnid);
if (ni == NULL) {
result = errno;
goto exit;
}
na = ntfs_attr_open(ni, AT_DATA, cookie->uname, cookie->uname_len);
if (na == NULL) {
result = errno;
goto exit;
}
pos += sizeof(uint32);
// it is a named stream
if (na) {
if (na != NULL) {
if (cookie->omode & O_APPEND)
pos = na->data_size;
@ -560,15 +633,27 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,off_t pos,
*_length = total;
} else {
*_length = 0;
return EINVAL;
result = EINVAL;
goto exit;
}
if (total > 0)
fs_ntfs_update_times(_vol, ni, NTFS_UPDATE_ATIME); // XXX needed ?
exit:
if (ntfs_ucstombs(na->name, na->name_len, &attr_name, 0) >= 0) {
if (attr_name != NULL) {
if(strncmp(attr_name, kHaikuAttrPrefix, strlen(kHaikuAttrPrefix)) !=0 )
goto exit;
real_name = attr_name + strlen(kHaikuAttrPrefix);
notify_attribute_changed(ns->id, MREF(ni->mft_no),
real_name, B_ATTR_CHANGED);
free(attr_name);
}
}
exit:
if (na != NULL)
ntfs_attr_close(na);
if (ni != NULL)
ntfs_inode_close(ni);
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
UNLOCK_VOL(ns);
@ -576,3 +661,68 @@ exit:
return result;
}
status_t
fs_remove_attrib(fs_volume *_vol, fs_vnode *_node, const char* name)
{
nspace *ns = (nspace *)_vol->private_volume;
vnode *node = (vnode *)_node->private_node;
char ntfs_attr_name[MAX_PATH]={0};
ntfschar *uname = NULL;
int ulen;
ntfs_inode *ni = NULL;
status_t result = B_NO_ERROR;
TRACE("%s - ENTER - name: [%s]\n", __FUNCTION__, name);
if (ns->flags & B_FS_IS_READONLY) {
ERROR("ntfs is read-only\n");
return B_READ_ONLY_DEVICE;
}
LOCK_VOL(ns);
if (node == NULL) {
result = EINVAL;
goto exit;
}
ni = ntfs_inode_open(ns->ntvol, node->vnid);
if (ni == NULL) {
result = errno;
goto exit;
}
strcat(ntfs_attr_name, kHaikuAttrPrefix);
strcat(ntfs_attr_name, name);
uname = ntfs_calloc(MAX_PATH);
ulen = ntfs_mbstoucs(ntfs_attr_name, &uname);
if (ulen < 0) {
result = EILSEQ;
goto exit;
}
if (ntfs_attr_remove(ni, AT_DATA, uname, ulen)) {
result = ENOENT;
goto exit;
}
if (!(ni->flags & FILE_ATTR_ARCHIVE)) {
ni->flags |= FILE_ATTR_ARCHIVE;
NInoFileNameSetDirty(ni);
}
notify_attribute_changed(ns->id, MREF(ni->mft_no), name, B_ATTR_REMOVED);
exit:
if (uname != NULL)
free(uname);
if (ni != NULL)
ntfs_inode_close(ni);
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
UNLOCK_VOL(ns);
return result;
}

View File

@ -33,6 +33,7 @@ status_t fs_read_attrib(fs_volume *_vol, fs_vnode *_node, void *cookie,
off_t pos, void *buffer, size_t *_length);
status_t fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *cookie,
off_t pos, const void *buffer, size_t *_length);
status_t fs_remove_attrib(fs_volume *_vol, fs_vnode *_node, const char* name);
#endif // NTFS_ATTRIBUTES_H

View File

@ -21,13 +21,27 @@
#include "fake_attributes.h"
#include "mime_table.h"
int32 kBeOSTypeCookie = 0x1234;
int32 kOpenTypeCookie = 0;
int32 kCloseTypeCookie = 1;
int32 kSetTypeCookie = 0x1234;
int32 kFreeTypeCookie = 0x87654321;
char *kFailBackMime = {"application/octet-stream"};
char *kDirectoryMime = {"application/x-vnd.Be-directory"};
status_t set_mime(vnode *node, const char *filename)
{
struct ext_mime *p;
int32 namelen, ext_len;
node->mime = NULL;
int32 namelen;
int32 ext_len;
node->mime = kFailBackMime;
if (filename == NULL)
{
node->mime = kDirectoryMime;
return B_NO_ERROR;
}
namelen = strlen(filename);
for (p=mimes; p->extension; p++) {
@ -63,17 +77,18 @@ fake_open_attrib_dir(fs_volume *_vol, fs_vnode *_node, void **_cookie)
goto exit;
}
*(int32 *)(*_cookie) = 0;
*(int32 *)(*_cookie) = kOpenTypeCookie;
exit:
TRACE("fs_open_attrdir - EXIT, result is %s\n", strerror(result));
TRACE("fake_open_attrdir - EXIT, result is %s\n", strerror(result));
UNLOCK_VOL(ns);
return result;
}
status_t
fake_close_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
{
@ -83,7 +98,7 @@ fake_close_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
LOCK_VOL(ns);
*(int32 *)_cookie = 1;
*(int32 *)_cookie = kCloseTypeCookie;
TRACE("fake_close_attrdir - EXIT\n");
@ -92,6 +107,7 @@ fake_close_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
return B_NO_ERROR;
}
status_t
fake_free_attrib_dir_cookie(fs_volume *_vol, fs_vnode *_node, void *_cookie)
{
@ -109,7 +125,7 @@ fake_free_attrib_dir_cookie(fs_volume *_vol, fs_vnode *_node, void *_cookie)
goto exit;
}
*(int32 *)_cookie = 0x87654321;
*(int32 *)_cookie = kFreeTypeCookie;
free(_cookie);
exit:
@ -122,6 +138,7 @@ exit:
return result;
}
status_t
fake_rewind_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
{
@ -134,13 +151,13 @@ fake_rewind_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
TRACE("fake_rewind_attrcookie - ENTER\n");
if (_cookie == NULL) {
TRACE("fake_rewind_attrcookie - error: fs_rewind_attrcookie"
TRACE("fake_rewind_attrcookie - error: fake_rewind_attrcookie"
"called with null cookie\n");
result = EINVAL;
goto exit;
}
*(uint32 *)_cookie = 0;
*(uint32 *)_cookie = kOpenTypeCookie;
exit:
@ -167,16 +184,16 @@ fake_read_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie,
*num = 0;
if ((*cookie == 0) && (node->mime)) {
if ((*cookie == kOpenTypeCookie) && (node->mime)) {
*num = 1;
entry->d_ino = node->vnid;
entry->d_dev = ns->id;
entry->d_reclen = 10;
entry->d_reclen = sizeof(struct dirent) + 10;
strcpy(entry->d_name, "BEOS:TYPE");
}
*cookie = 1;
*cookie = kCloseTypeCookie;
TRACE("fake_read_attrdir - EXIT\n");
@ -186,28 +203,45 @@ fake_read_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie,
}
status_t
fake_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
int openMode, void **_cookie)
fake_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
uint32 type, int openMode, void** _cookie)
{
nspace *ns = (nspace *)_vol->private_volume;
vnode *node = (vnode *)_node->private_node;
int result = B_NO_ERROR;
LOCK_VOL(ns);
TRACE("fake_open_attrib - ENTER\n");
TRACE("fake_create_attrib - ENTER (name = [%s])\n",name);
if (strcmp(name, "BEOS:TYPE")) {
result = ENOENT;
if (strcmp(name, "BEOS:TYPE") != 0)
goto exit;
}
*_cookie = &kSetTypeCookie;
if (node->mime == NULL) {
result = ENOENT;
goto exit;
}
exit:
*_cookie = &kBeOSTypeCookie;
TRACE("fake_create_attrib - EXIT, result is %s\n", strerror(result));
UNLOCK_VOL(ns);
return result;
}
status_t
fake_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
int openMode, void **_cookie)
{
nspace *ns = (nspace *)_vol->private_volume;
int result = B_NO_ERROR;
LOCK_VOL(ns);
TRACE("fake_open_attrib - ENTER (name = [%s])\n",name);
if (strcmp(name, "BEOS:TYPE") != 0)
goto exit;
*_cookie = &kSetTypeCookie;
exit:
@ -238,25 +272,23 @@ fake_read_attrib_stat(fs_volume *_vol, fs_vnode *_node, void *_cookie,
struct stat *stat)
{
nspace *ns = (nspace *)_vol->private_volume;
vnode *node = (vnode *)_node->private_node;
vnode *node = (vnode *)_node->private_node;
int result = B_NO_ERROR;
LOCK_VOL(ns);
TRACE("fake_read_attr_stat - ENTER\n");
if (_cookie != &kBeOSTypeCookie) {
result = ENOENT;
goto exit;
}
if (node->mime == NULL) {
if (_cookie != &kSetTypeCookie) {
result = ENOENT;
goto exit;
}
stat->st_type = MIME_STRING_TYPE;
stat->st_size = strlen(node->mime) + 1;
if (node->mime == NULL)
stat->st_size = 0;
else
stat->st_size = strlen(node->mime) + 1;
exit:
@ -274,7 +306,7 @@ fake_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,
off_t pos,void *buffer, size_t *_length)
{
nspace *ns = (nspace *)_vol->private_volume;
vnode *node = (vnode *)_node->private_node;
vnode *node = (vnode *)_node->private_node;
int result = B_NO_ERROR;
@ -282,7 +314,7 @@ fake_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,
TRACE("fake_read_attr - ENTER\n");
if (_cookie != &kBeOSTypeCookie) {
if (_cookie != &kSetTypeCookie) {
result = ENOENT;
goto exit;
}
@ -315,23 +347,5 @@ status_t
fake_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
const void *buffer, size_t *_length)
{
nspace *ns = (nspace *)_vol->private_volume;
int result = B_NO_ERROR;
LOCK_VOL(ns);
TRACE("fake_write_attr - ENTER\n");
*_length = 0;
if (_cookie != &kBeOSTypeCookie) {
result = ENOSYS;
}
TRACE("fake_write_attrib - EXIT, result is %s\n", strerror(result));
UNLOCK_VOL(ns);
return result;
return B_NO_ERROR;
}

View File

@ -24,6 +24,8 @@ status_t fake_rewind_attrib_dir(fs_volume *_vol, fs_vnode *_node,
void *_cookie);
status_t fake_read_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie,
struct dirent *buf, size_t bufsize, uint32 *num);
status_t fake_create_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
uint32 type, int openMode, void** _cookie);
status_t fake_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
int openMode, void **_cookie);
status_t fake_close_attrib(fs_volume *_vol, fs_vnode *_node, void *cookie);

File diff suppressed because it is too large Load Diff

View File

@ -156,7 +156,7 @@ fs_vnode_ops gNTFSVnodeOps = {
&fs_read_attrib_stat,
NULL, //&fs_write_attr_stat,
NULL, //&fs_rename_attr,
NULL, //&fs_remove_attr,
&fs_remove_attrib,
};

View File

@ -3,14 +3,14 @@
This file may be used under the terms of the Be Sample Code License.
*/
#include <sys/types.h>
struct ext_mime {
char *extension;
char *mime;
};
struct ext_mime mimes[] = {
{ "***", "application/x-vnd.Be-directory"},
{ "gz", "application/x-gzip" },
{ "hqx", "application/x-binhex40" },
{ "lha", "application/x-lharc" },
@ -24,8 +24,13 @@ struct ext_mime mimes[] = {
{ "z", "application/x-compress" },
{ "zip", "application/zip" },
{ "zoo", "application/x-zoo" },
{ "rar", "application/x-rar-compressed" },
{ "rar", "application/x-rar" },
{ "pkg", "application/x-scode-UPkg" },
{ "7z", "application/x-7z-compressed" },
{ "bz2", "application/x-bzip2" },
{ "xz", "application/x-xz" },
{ "jar", "application/x-jar" },
{ "aif", "audio/x-aiff" },
{ "aiff", "audio/x-aiff" },
@ -37,13 +42,20 @@ struct ext_mime mimes[] = {
{ "wav", "audio/x-wav" },
{ "mp3", "audio/x-mpeg" },
{ "ogg", "audio/x-vorbis" },
{ "flac", "audio/x-flac" },
{ "wma", "audio/x-ms-wma" },
{ "avi", "video/x-msvideo" },
{ "mov", "video/quicktime" },
{ "qt", "video/quicktime" },
{ "mpg", "video/mpeg" },
{ "mpeg", "video/mpeg" },
{ "flv", "video/x-flv" },
{ "mp4", "video/mp4" },
{ "mkv", "video/x-matroska" },
{ "asf", "application/x-asf" },
{ "rm", "video/vnd.rn-realvideo" },
{ "wmv", "video/x-ms-wmv" },
{ "bmp", "image/x-bmp" },
{ "fax", "image/g3fax" },
@ -61,11 +73,21 @@ struct ext_mime mimes[] = {
{ "tif", "image/tiff" },
{ "tiff", "image/tiff" },
{ "xbm", "image/x-xbitmap" },
{ "djvu", "image/x-djvu" },
{ "djvu", "image/x-djvu" },
{ "svg", "image/svg+xml" },
{ "ico", "image/vnd.microsoft.icon" },
{ "doc", "application/msword" },
{ "xls", "application/vnd.ms-excel" },
{ "xls", "application/vnd.ms-excel" },
{ "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" },
{ "docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document" },
{ "ppt", "application/vnd.ms-powerpoint" },
{ "pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation" },
{ "chm", "application/x-chm" },
{ "txt", "text/plain" },
{ "xml", "text/plain" },
{ "doc", "text/plain" },
{ "htm", "text/html" },
{ "html", "text/html" },
{ "rtf", "text/rtf" },
@ -74,15 +96,15 @@ struct ext_mime mimes[] = {
{ "c++", "text/x-source-code" },
{ "h", "text/x-source-code" },
{ "hh", "text/x-source-code" },
{ "hpp", "text/x-source-code" },
{ "cxx", "text/x-source-code" },
{ "cpp", "text/x-source-code" },
{ "S", "text/x-source-code" },
{ "java", "text/x-source-code" },
{ "exe", "application/x-vnd.Be-elfexecutable" },
{ "dll", "application/x-vnd.Be.ELF-object" },
{ "ini", "text/plain" },
{ "inf", "text/plain" },
{ "ttf", "application/x-truetype" },
{ 0, 0 }
{ NULL, NULL }
};

View File

@ -87,19 +87,20 @@ typedef struct vnode {
} vnode;
typedef struct filecookie {
int omode;
off_t last_size;
int omode;
off_t last_size;
} filecookie;
typedef struct attrcookie {
int omode;
ntfs_inode *inode;
ntfs_attr *stream;
// MFT ref for EA ?
int omode;
ino_t vnid;
ntfschar* uname;
int uname_len;
uint32 type;
} attrcookie;
typedef struct attrdircookie {
ntfs_inode *inode;
ntfs_inode* inode;
ntfs_attr_search_ctx *ctx;
} attrdircookie;

View File

@ -33,8 +33,8 @@
#include <sys/stat.h>
//callback function for readdir()
static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name,
static int
_ntfs_dirent_filler(void *_dirent, const ntfschar *name,
const int name_len, const int name_type, const s64 pos, const MFT_REF mref,
const unsigned dt_type)
{
@ -45,42 +45,64 @@ static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name,
return 0;
if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user
|| cookie->show_sys_files) {
if (cookie->readed == 1) {
cookie->pos=pos;
cookie->readed = 0;
return -1;
} else {
if (ntfs_ucstombs(name, name_len, &filename, 0) >= 0) {
if (filename) {
strcpy(cookie->name,filename);
cookie->ino=MREF(mref);
cookie->readed = 1;
free(filename);
return 0;
}
|| cookie->show_sys_files) {
int len = ntfs_ucstombs(name, name_len, &filename, 0);
if (len >= 0 && filename != NULL) {
cache_entry* new_entry =
(cache_entry*)ntfs_calloc(sizeof(cache_entry));
if (new_entry == NULL) {
free(filename);
return -1;
}
new_entry->ent =
(struct dirent*)ntfs_calloc(sizeof(struct dirent) + len);
new_entry->ent->d_dev = cookie->dev_id;
new_entry->ent->d_ino = MREF(mref);
memcpy(new_entry->ent->d_name,filename, len + 1);
new_entry->ent->d_reclen = sizeof(struct dirent) + len;
if(cookie->cache_root == NULL || cookie->entry == NULL) {
cookie->cache_root = new_entry;
cookie->entry = cookie->cache_root;
cookie->entry->next = NULL;
} else {
cookie->entry->next = (void*)new_entry;
cookie->entry = cookie->entry->next;
cookie->entry->next = NULL;
}
return -1;
free(filename);
return 0;
}
return -1;
}
return 0;
}
status_t
fs_free_dircookie(fs_volume *_vol, fs_vnode *vnode, void *cookie)
fs_free_dircookie(fs_volume *_vol, fs_vnode *vnode, void *_cookie)
{
nspace *ns = (nspace*)_vol->private_volume;
LOCK_VOL(ns);
dircookie *cookie = (dircookie*)_cookie;
LOCK_VOL(ns);
TRACE("fs_free_dircookie - ENTER\n");
if (cookie != NULL)
if (cookie != NULL) {
cache_entry *entry = cookie->cache_root;
while (entry != NULL) {
cache_entry *next = entry->next;
if (entry->ent != NULL)
free(entry->ent);
free(entry);
entry = next;
}
free(cookie);
}
TRACE("fs_free_dircookie - EXIT\n");
UNLOCK_VOL(ns);
return B_NO_ERROR;
@ -93,11 +115,10 @@ fs_opendir(fs_volume *_vol, fs_vnode *_node, void** _cookie)
nspace *ns = (nspace*)_vol->private_volume;
vnode *node = (vnode*)_node->private_node;
dircookie *cookie = NULL;
int result = B_NO_ERROR;
ntfs_inode *ni = NULL;
int result = B_NO_ERROR;
LOCK_VOL(ns);
TRACE("fs_opendir - ENTER\n");
ni = ntfs_inode_open(ns->ntvol, node->vnid);
@ -114,21 +135,19 @@ fs_opendir(fs_volume *_vol, fs_vnode *_node, void** _cookie)
cookie = (dircookie*)ntfs_calloc(sizeof(dircookie));
if (cookie != NULL) {
cookie->pos = 0;
cookie->ino = 0;
cookie->readed = 0;
cookie->last = 0;
cookie->name[0] = 0;
cookie->dev_id = ns->id;
cookie->show_sys_files = ns->show_sys_files;
cookie->cache_root = NULL;
cookie->entry = cookie->cache_root;
*_cookie = (void*)cookie;
} else
result = ENOMEM;
exit:
if (ni)
if (ni != NULL)
ntfs_inode_close(ni);
TRACE("fs_opendir - EXIT\n");
UNLOCK_VOL(ns);
return result;
@ -138,32 +157,7 @@ exit:
status_t
fs_closedir(fs_volume *_vol, fs_vnode *_node, void *cookie)
{
nspace *ns = (nspace*)_vol->private_volume;
vnode *node = (vnode*)_node->private_node;
int result = B_NO_ERROR;
ntfs_inode *ni = NULL;
LOCK_VOL(ns);
TRACE("fs_closedir - ENTER\n");
ni = ntfs_inode_open(ns->ntvol, node->vnid);
if (ni == NULL) {
result = ENOENT;
goto exit;
}
fs_ntfs_update_times(_vol, ni, NTFS_UPDATE_ATIME);
exit:
if (ni)
ntfs_inode_close(ni);
TRACE("fs_closedir - EXIT\n");
UNLOCK_VOL(ns);
return result;
return B_NO_ERROR;
}
@ -174,50 +168,61 @@ fs_readdir(fs_volume *_vol, fs_vnode *_node, void *_cookie, struct dirent *buf,
nspace *ns = (nspace*)_vol->private_volume;
vnode *node = (vnode*)_node->private_node;
dircookie *cookie = (dircookie*)_cookie;
uint32 nameLength = bufsize - sizeof(struct dirent), realLen;
int result = B_NO_ERROR;
ntfs_inode *ni = NULL;
LOCK_VOL(ns);
uint32 nameLength = bufsize - sizeof(struct dirent), realLen;
int result = B_NO_ERROR;
LOCK_VOL(ns);
TRACE("fs_readdir - ENTER (sizeof(buf)=%d, bufsize=%d, num=%d\n",
sizeof(buf), bufsize, *num);
if (!ns || !node || !cookie || !num || bufsize < sizeof(*buf)) {
result = EINVAL;
goto exit;
}
if (cookie->readed == 1 || cookie->last == 1) {
result = ENOENT;
goto exit;
}
ni = ntfs_inode_open(ns->ntvol, node->vnid);
if (ni == NULL) {
ERROR("fs_readdir - dir not opened\n");
TRACE("fs_readdir - dir not opened\n");
result = ENOENT;
goto exit;
}
result = ntfs_readdir(ni, &cookie->pos, cookie,
(ntfs_filldir_t)_ntfs_dirent_filler);
if(cookie->cache_root == NULL) {
cookie->entry = NULL;
result = ntfs_readdir(ni, &cookie->pos, cookie,
(ntfs_filldir_t)_ntfs_dirent_filler);
cookie->entry = cookie->cache_root;
if(result) {
result = ENOENT;
goto exit;
}
}
if(cookie->entry == NULL) {
result = ENOENT;
goto exit;
}
if(cookie->entry->ent == NULL) {
result = ENOENT;
goto exit;
}
realLen = nameLength > 255 ? 255 : nameLength;
buf->d_dev = ns->id;
buf->d_ino = cookie->ino;
strlcpy(buf->d_name, cookie->name, realLen + 1);
buf->d_ino = cookie->entry->ent->d_ino;
strlcpy(buf->d_name, cookie->entry->ent->d_name, realLen + 1);
buf->d_reclen = sizeof(struct dirent) + realLen;
if (result == 0)
cookie->last = 1;
result = B_NO_ERROR;
cookie->entry = (cache_entry*)cookie->entry->next;
TRACE("fs_readdir - FILE: [%s]\n",buf->d_name);
exit:
if (ni)
if (ni != NULL)
ntfs_inode_close(ni);
if (result == B_NO_ERROR)
@ -228,8 +233,7 @@ exit:
if (result == ENOENT)
result = B_NO_ERROR;
TRACE("fs_readdir - EXIT result (%s)\n", strerror(result));
TRACE("fs_readdir - EXIT num=%d result (%s)\n",*num, strerror(result));
UNLOCK_VOL(ns);
return result;
@ -237,26 +241,33 @@ exit:
status_t
fs_rewinddir(fs_volume *_vol, fs_vnode *vnode, void *_cookie)
fs_rewinddir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
{
nspace *ns = (nspace*)_vol->private_volume;
dircookie *cookie = (dircookie*)_cookie;
int result = EINVAL;
LOCK_VOL(ns);
TRACE("fs_rewinddir - ENTER\n");
if (cookie != NULL) {
cache_entry *entry = cookie->cache_root;
while (entry != NULL) {
cache_entry *next = entry->next;
if (entry->ent != NULL)
free(entry->ent);
free(entry);
entry = next;
}
cookie->pos = 0;
cookie->ino = 0;
cookie->readed = 0;
cookie->last = 0;
cookie->name[0] = 0;
cookie->dev_id = ns->id;
cookie->show_sys_files = ns->show_sys_files;
cookie->cache_root = NULL;
cookie->entry = cookie->cache_root;
result = B_NO_ERROR;
}
TRACE("fs_rewinddir - EXIT, result is %s\n", strerror(result));
UNLOCK_VOL(ns);
return result;

View File

@ -24,15 +24,21 @@
#include "ntfs.h"
typedef struct cache_entry {
struct dirent *ent;
struct cache_entry *next;
} cache_entry;
typedef struct dircookie {
u64 pos;
int readed;
int last;
ino_t ino;
BOOL show_sys_files;
char name[MAX_PATH];
dev_t dev_id;
BOOL show_sys_files;
cache_entry *cache_root;
cache_entry *entry;
} dircookie;
status_t fs_closedir(fs_volume *volume, fs_vnode *vnode, void *cookie);
status_t fs_free_dircookie(fs_volume *volume, fs_vnode *vnode, void *cookie);
status_t fs_opendir(fs_volume *volume, fs_vnode *vnode, void** cookie);

View File

@ -56,7 +56,7 @@ Addon ffmpeg :
be
media
libz.a
$(HAIKU_ZLIB_LIB)
$(TARGET_LIBSUPC++)
$(TARGET_NETWORK_LIBS)
;

View File

@ -11,7 +11,10 @@ if $(HAIKU_LIBSTDC++) = libstdc++.r4.so {
SubDirC++Flags -Dios_base=ios -ftemplate-depth-24 ;
}
UseLibraryHeaders zlib ;
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
Includes [ FGristFiles ImfPxr24Compressor.cpp ImfZipCompressor.cpp ]
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
#StaticLibrary libilmimf.a :
SharedLibrary libilmimf.so :
@ -73,6 +76,7 @@ ImfVecAttribute.cpp
ImfVersion.cpp
ImfWav.cpp
ImfZipCompressor.cpp
: libhalf.a libiex.a libimath.a libilmthread.a $(TARGET_LIBSTDC++) z
: libhalf.a libiex.a libimath.a libilmthread.a $(TARGET_LIBSTDC++)
$(HAIKU_ZLIB_LIB)
;

View File

@ -2,7 +2,8 @@ SubDir HAIKU_TOP src add-ons translators hpgs ;
SubDirSysHdrs [ FDirName $(SUBDIR) lib ] ;
SubDirCcFlags -DHPGS_SHARED -std=c99 ;
UseLibraryHeaders zlib ;
UseLibraryHeaders iconv ;
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
UseHeaders $(HAIKU_LIBPNG_HEADERS) : true ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
@ -42,13 +43,15 @@ hpgszostream.c
Includes [ FGristFiles hpgsimage.c ]
: $(HAIKU_LIBPNG_HEADERS_DEPENDENCY) ;
Includes [ FGristFiles hpgszostream.c ]
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
Translator HPGSTranslator :
# HPGSTranslator classes
ConfigView.cpp
HPGSTranslator.cpp
$(sources)
: be translation $(HAIKU_LIBPNG_LIB) libtextencoding.so libz.so
: be translation $(HAIKU_LIBPNG_LIB) libtextencoding.so $(HAIKU_ZLIB_LIB)
libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: true
;

View File

@ -36,6 +36,7 @@
#include <errno.h>
#if (defined(__BEOS__) || defined(__HAIKU__))
#include <png.h>
#define png_infopp_NULL (png_infopp)NULL
#else
#include <libpng12/png.h>
#endif

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons translators png ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UseLibraryHeaders zlib ;
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
UseHeaders $(HAIKU_LIBPNG_HEADERS) : true ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
@ -20,7 +20,8 @@ Translator PNGTranslator :
PNGTranslator.cpp
PNGView.cpp
: be translation $(HAIKU_LIBPNG_LIB) z libtranslatorsutils.a $(TARGET_LIBSUPC++)
: be translation $(HAIKU_LIBPNG_LIB) $(HAIKU_ZLIB_LIB)
$(TARGET_LIBSUPC++) libtranslatorsutils.a
$(HAIKU_LOCALE_LIBS)
: true
;

View File

@ -5,11 +5,14 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
# Include support sub folder
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons translators wonderbrush support ] ;
UseLibraryHeaders zlib ;
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
AddResources WonderBrushTranslator : WonderBrushTranslator.rdef ;
Includes [ FGristFiles bitmap_compression.cpp ]
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
Translator WonderBrushTranslator :
Canvas.cpp
Layer.cpp
@ -23,8 +26,8 @@ Translator WonderBrushTranslator :
blending.cpp
lab_convert.cpp
: be translation z libtranslatorsutils.a $(TARGET_LIBSUPC++)
$(HAIKU_LOCALE_LIBS)
: be translation $(HAIKU_ZLIB_LIB) libtranslatorsutils.a
$(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: true
;

View File

@ -11,7 +11,7 @@ Application InstalledPackages :
main.cpp
UninstallWindow.cpp
UninstallView.cpp
: be tracker translation z $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: be tracker translation $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
;
DoCatalogs InstalledPackages :

View File

@ -1,10 +1,13 @@
SubDir HAIKU_TOP src apps packageinstaller ;
UsePrivateHeaders shared interface ;
SubDirHdrs $(HAIKU_TOP) headers libs zlib ;
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits interface ] ;
Includes [ FGristFiles PackageItem.cpp ]
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
Application PackageInstaller :
main.cpp
PackageWindow.cpp
@ -16,7 +19,8 @@ Application PackageInstaller :
PackageTextViewer.cpp
PackageImageViewer.cpp
InstalledPackageInfo.cpp
: be $(HAIKU_LOCALE_LIBS) tracker translation z $(TARGET_LIBSUPC++)
: be $(HAIKU_LOCALE_LIBS) tracker translation $(HAIKU_ZLIB_LIB)
$(TARGET_LIBSUPC++)
: PackageInstaller.rdef
;

View File

@ -1,6 +1,6 @@
SubDir HAIKU_TOP src kits package ;
UseLibraryHeaders zlib ;
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
UsePrivateHeaders
kernel
@ -8,6 +8,9 @@ UsePrivateHeaders
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package hpkg ] ;
Includes [ FGristFiles ZlibCompressionBase.cpp ]
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
HPKG_SOURCES =
AttributeDataReader.cpp
BlockBufferCache.cpp
@ -72,5 +75,5 @@ SharedLibrary libpackage.so
$(HPKG_SOURCES)
:
libshared.a be z $(TARGET_LIBSTDC++)
libshared.a be $(HAIKU_ZLIB_LIB) $(TARGET_LIBSTDC++)
;

View File

@ -24,4 +24,4 @@ SubInclude HAIKU_TOP src libs termcap ;
SubInclude HAIKU_TOP src libs tiff ;
SubInclude HAIKU_TOP src libs udis86 ;
SubInclude HAIKU_TOP src libs util ;
SubInclude HAIKU_TOP src libs zlib ;

View File

@ -1,7 +1,8 @@
SubDir HAIKU_TOP src libs tiff ;
UseLibraryHeaders tiff zlib ;
UseLibraryHeaders tiff ;
UseHeaders $(HAIKU_JPEG_HEADERS) : true ;
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
@ -47,10 +48,12 @@ local shared_files =
Includes [ FGristFiles tif_jpeg.c tif_ojpeg.c ]
: $(HAIKU_JPEG_HEADERS_DEPENDENCY) ;
Includes [ FGristFiles tif_pixarlog.c tif_zip.c ]
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
Objects $(shared_files) ;
SharedLibrary libtiff.so : [ FGristFiles $(shared_files:S=.o) ]
: $(HAIKU_JPEG_LIB) z : 3.8 ;
: $(HAIKU_JPEG_LIB) $(HAIKU_ZLIB_LIB) : 3.8 ;
StaticLibrary libtiff.a : [ FGristFiles $(shared_files:S=.o) ] ;