Merge branch 'master' into sam460ex
This commit is contained in:
commit
e5ad6254c6
@ -1355,7 +1355,7 @@ if $(HAIKU_NO_WERROR) != 1 {
|
|||||||
EnableWerror src add-ons translators bmp ;
|
EnableWerror src add-ons translators bmp ;
|
||||||
# EnableWerror src add-ons translators exr ;
|
# EnableWerror src add-ons translators exr ;
|
||||||
EnableWerror src add-ons translators gif ;
|
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 hvif ;
|
||||||
EnableWerror src add-ons translators ico ;
|
EnableWerror src add-ons translators ico ;
|
||||||
# EnableWerror src add-ons translators jpeg ; # gcc2
|
# EnableWerror src add-ons translators jpeg ; # gcc2
|
||||||
|
@ -87,18 +87,18 @@ SYSTEM_LIBS =
|
|||||||
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 libgnu.so
|
libgame.so $(X86_ONLY)libGL.so libgnu.so
|
||||||
$(HAIKU_JPEG_CURRENT_LIB)
|
|
||||||
libmail.so libmedia.so libmidi.so libmidi2.so
|
libmail.so libmedia.so libmidi.so libmidi2.so
|
||||||
libnetwork.so
|
libnetwork.so
|
||||||
$(HAIKU_LIBPNG_CURRENT_LIB)
|
|
||||||
<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
|
||||||
libz.so
|
|
||||||
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
|
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
|
||||||
$(HAIKU_FREETYPE_CURRENT_LIB)
|
|
||||||
;
|
;
|
||||||
PRIVATE_SYSTEM_LIBS =
|
PRIVATE_SYSTEM_LIBS =
|
||||||
|
$(HAIKU_JPEG_CURRENT_LIB)
|
||||||
|
$(HAIKU_LIBPNG_CURRENT_LIB)
|
||||||
|
$(HAIKU_ZLIB_CURRENT_LIB)
|
||||||
|
$(HAIKU_FREETYPE_CURRENT_LIB)
|
||||||
libalm.so
|
libalm.so
|
||||||
libfluidsynth.so
|
libfluidsynth.so
|
||||||
libilmimf.so
|
libilmimf.so
|
||||||
@ -334,6 +334,13 @@ SYSTEM_LIBS_ALIASES =
|
|||||||
$(SYSTEM_LIBS_LIBBE_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
|
# libfreetype.so links to the current freetype lib
|
||||||
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_FREETYPE_CURRENT_LIB:BS)
|
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_FREETYPE_CURRENT_LIB:BS)
|
||||||
: $(HAIKU_FREETYPE_CURRENT_LINK) : : true ;
|
: $(HAIKU_FREETYPE_CURRENT_LINK) : : true ;
|
||||||
@ -352,6 +359,12 @@ AddSymlinkToHaikuHybridImage system lib : $(HAIKU_JPEG_CURRENT_LIB:BS)
|
|||||||
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_JPEG_CURRENT_LINK)
|
AddSymlinkToHaikuHybridImage system lib : $(HAIKU_JPEG_CURRENT_LINK)
|
||||||
: libjpeg.so : : true ;
|
: 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
|
# servers
|
||||||
AddFilesToHaikuImage system servers : $(SYSTEM_SERVERS) ;
|
AddFilesToHaikuImage system servers : $(SYSTEM_SERVERS) ;
|
||||||
|
|
||||||
@ -724,42 +737,42 @@ AddDirectoryToHaikuImage home config settings printers "Save as PDF"
|
|||||||
# PDF Writer enconding files
|
# PDF Writer enconding files
|
||||||
CopyDirectoryToHaikuImage system data
|
CopyDirectoryToHaikuImage system data
|
||||||
: [ FDirName $(HAIKU_TOP) src add-ons print drivers pdf encoding ]
|
: [ FDirName $(HAIKU_TOP) src add-ons print drivers pdf encoding ]
|
||||||
: "PDF Writer" : -x .svn -x Jamfile ;
|
: "PDF Writer" : -x Jamfile ;
|
||||||
|
|
||||||
# Gutenprint data files
|
# Gutenprint data files
|
||||||
CopyDirectoryToHaikuImage system data
|
CopyDirectoryToHaikuImage system data
|
||||||
: [ FDirName $(HAIKU_TOP) src libs print libgutenprint src xml ]
|
: [ 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
|
# dvb channel settings
|
||||||
CopyDirectoryToHaikuImage home config settings Media
|
CopyDirectoryToHaikuImage home config settings Media
|
||||||
: [ FDirName $(HAIKU_TOP) data settings media dvb ]
|
: [ FDirName $(HAIKU_TOP) data settings media dvb ]
|
||||||
: dvb : -x .svn -x Jamfile ;
|
: dvb : -x Jamfile ;
|
||||||
|
|
||||||
# licenses
|
# licenses
|
||||||
CopyDirectoryToHaikuImage system data
|
CopyDirectoryToHaikuImage system data
|
||||||
: [ FDirName $(HAIKU_TOP) data system data licenses ]
|
: [ FDirName $(HAIKU_TOP) data system data licenses ]
|
||||||
: licenses : -x .svn ;
|
: licenses ;
|
||||||
|
|
||||||
# Copy documentation as per DiskUsage's license requirement.
|
# Copy documentation as per DiskUsage's license requirement.
|
||||||
CopyDirectoryToHaikuImage system documentation
|
CopyDirectoryToHaikuImage system documentation
|
||||||
: [ FDirName $(HAIKU_TOP) docs apps diskusage ]
|
: [ FDirName $(HAIKU_TOP) docs apps diskusage ]
|
||||||
: diskusage : -x .svn ;
|
: diskusage ;
|
||||||
|
|
||||||
# Copy documentation as per PDFlib Lite's license requirement.
|
# Copy documentation as per PDFlib Lite's license requirement.
|
||||||
CopyDirectoryToHaikuImage system documentation
|
CopyDirectoryToHaikuImage system documentation
|
||||||
: [ FDirName $(HAIKU_TOP) src libs pdflib doc ]
|
: [ FDirName $(HAIKU_TOP) src libs pdflib doc ]
|
||||||
: pdflib : -x .svn ;
|
: pdflib ;
|
||||||
|
|
||||||
# Copy sample programs as per PDFlib Lite's license requirement.
|
# Copy sample programs as per PDFlib Lite's license requirement.
|
||||||
CopyDirectoryToHaikuImage develop sample-code
|
CopyDirectoryToHaikuImage develop sample-code
|
||||||
: [ FDirName $(HAIKU_TOP) src libs pdflib bind pdflib ]
|
: [ FDirName $(HAIKU_TOP) src libs pdflib bind pdflib ]
|
||||||
: pdflib : -x .svn ;
|
: pdflib ;
|
||||||
|
|
||||||
# Copy Mesa3D GL headers into image
|
# Copy Mesa3D GL headers into image
|
||||||
if $(TARGET_ARCH) = x86 {
|
if $(TARGET_ARCH) = x86 {
|
||||||
CopyDirectoryToHaikuImage develop headers os opengl
|
CopyDirectoryToHaikuImage develop headers os opengl
|
||||||
: [ FDirName $(HAIKU_MESA_HEADERS) GL ] : : -x .svn ;
|
: [ FDirName $(HAIKU_MESA_HEADERS) GL ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Optional Packages
|
#pragma mark - Optional Packages
|
||||||
|
@ -705,7 +705,7 @@ rule AddSourceDirectoryToHaikuImage dirTokens : alwaysUpdate
|
|||||||
|
|
||||||
CopyDirectoryToHaikuImage home HaikuSources
|
CopyDirectoryToHaikuImage home HaikuSources
|
||||||
: [ FDirName $(HAIKU_TOP) $(dirTokens) ]
|
: [ FDirName $(HAIKU_TOP) $(dirTokens) ]
|
||||||
: : -x .svn : $(alwaysUpdate) ;
|
: : : $(alwaysUpdate) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : alwaysUpdate
|
rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : alwaysUpdate
|
||||||
@ -715,7 +715,7 @@ rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : alwaysUpdate
|
|||||||
|
|
||||||
CopyDirectoryToHaikuImage develop headers
|
CopyDirectoryToHaikuImage develop headers
|
||||||
: [ FDirName $(HAIKU_TOP) headers $(dirTokens) ]
|
: [ FDirName $(HAIKU_TOP) headers $(dirTokens) ]
|
||||||
: $(dirName) : -x .svn : $(alwaysUpdate) ;
|
: $(dirName) : : $(alwaysUpdate) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule AddWifiFirmwareToHaikuImage driver : package : archive : extract
|
rule AddWifiFirmwareToHaikuImage driver : package : archive : extract
|
||||||
|
@ -581,3 +581,43 @@ if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 {
|
|||||||
} else {
|
} else {
|
||||||
Echo "jpeg support not available on $(TARGET_ARCH)" ;
|
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)" ;
|
||||||
|
}
|
||||||
|
@ -782,7 +782,8 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
|
|||||||
|
|
||||||
# library symlinks
|
# library symlinks
|
||||||
local lib ;
|
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
|
AddSymlinkToHaikuHybridImage $(abiDirTokens) lib
|
||||||
: /system/lib $(lib:BS) : : true ;
|
: /system/lib $(lib:BS) : : true ;
|
||||||
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;
|
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 ncurses : 3rdparty ;
|
||||||
AddHeaderDirectoryToHaikuImage libs termcap : 3rdparty ;
|
AddHeaderDirectoryToHaikuImage libs termcap : 3rdparty ;
|
||||||
AddHeaderDirectoryToHaikuImage libs tiff : 3rdparty ;
|
AddHeaderDirectoryToHaikuImage libs tiff : 3rdparty ;
|
||||||
AddHeaderDirectoryToHaikuImage libs zlib : 3rdparty ;
|
|
||||||
|
|
||||||
CopyDirectoryToHaikuImage develop headers :
|
CopyDirectoryToHaikuImage develop headers :
|
||||||
[ FDirName $(HAIKU_FREETYPE_DIR) develop headers 3rdparty ] ;
|
[ FDirName $(HAIKU_FREETYPE_DIR) develop headers 3rdparty ] ;
|
||||||
@ -854,14 +854,16 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
|
|||||||
: 3rdparty ;
|
: 3rdparty ;
|
||||||
CopyDirectoryToHaikuImage develop headers : $(HAIKU_LIBPNG_HEADERS)
|
CopyDirectoryToHaikuImage develop headers : $(HAIKU_LIBPNG_HEADERS)
|
||||||
: 3rdparty ;
|
: 3rdparty ;
|
||||||
|
CopyDirectoryToHaikuImage develop headers : $(HAIKU_ZLIB_HEADERS)
|
||||||
|
: 3rdparty ;
|
||||||
|
|
||||||
# cpp headers
|
# cpp headers
|
||||||
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
||||||
# GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
|
# GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
|
||||||
CopyDirectoryToHaikuImage $(abiDirTokens) headers
|
CopyDirectoryToHaikuImage $(abiDirTokens) headers
|
||||||
: [ FDirName $(HAIKU_TOP) headers cpp ] : : -x .svn ;
|
: [ FDirName $(HAIKU_TOP) headers cpp ] ;
|
||||||
CopyDirectoryToAlternativeGCCArchive $(abiDirTokens) headers
|
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 ] {
|
if [ IsOptionalHaikuImagePackageAdded Welcome ] {
|
||||||
CopyDirectoryToHaikuImage system documentation
|
CopyDirectoryToHaikuImage system documentation
|
||||||
: [ FDirName $(HAIKU_TOP) docs welcome ]
|
: [ FDirName $(HAIKU_TOP) docs welcome ]
|
||||||
: welcome : -x .svn ;
|
: welcome ;
|
||||||
CopyDirectoryToHaikuImage system documentation
|
CopyDirectoryToHaikuImage system documentation
|
||||||
: [ FDirName $(HAIKU_TOP) docs userguide ]
|
: [ FDirName $(HAIKU_TOP) docs userguide ]
|
||||||
: userguide : -x .svn ;
|
: userguide ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ copy_headers()
|
|||||||
sourceDir=$1
|
sourceDir=$1
|
||||||
targetDir=$2
|
targetDir=$2
|
||||||
|
|
||||||
headers="`find $sourceDir -name \*\.h | grep -v /.svn`"
|
headers="`find $sourceDir -name \*\.h`"
|
||||||
headers="`echo $headers | sed -e s@$sourceDir/@@g`"
|
headers="`echo $headers | sed -e s@$sourceDir/@@g`"
|
||||||
for f in $headers; do
|
for f in $headers; do
|
||||||
headerTargetDir=$targetDir/`dirname $f`
|
headerTargetDir=$targetDir/`dirname $f`
|
||||||
|
@ -130,7 +130,7 @@ copy_headers()
|
|||||||
sourceDir=$1
|
sourceDir=$1
|
||||||
targetDir=$2
|
targetDir=$2
|
||||||
|
|
||||||
headers="$(find $sourceDir -name \*\.h | grep -v /.svn)"
|
headers="$(find $sourceDir -name \*\.h)"
|
||||||
headers="$(echo $headers | sed -e s@$sourceDir/@@g)"
|
headers="$(echo $headers | sed -e s@$sourceDir/@@g)"
|
||||||
for f in $headers; do
|
for f in $headers; do
|
||||||
headerTargetDir=$targetDir/$(dirname $f)
|
headerTargetDir=$targetDir/$(dirname $f)
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -327,7 +327,7 @@ HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy`
|
|||||||
SFDISK_BINARY=sfdisk
|
SFDISK_BINARY=sfdisk
|
||||||
HOST_SFDISK=$SFDISK_BINARY
|
HOST_SFDISK=$SFDISK_BINARY
|
||||||
|
|
||||||
haikuRequiredLegacyGCCVersion="2.95.3-haiku-121012"
|
haikuRequiredLegacyGCCVersion="2.95.3-haiku-121101"
|
||||||
export haikuRequiredLegacyGCCVersion
|
export haikuRequiredLegacyGCCVersion
|
||||||
# version of legacy gcc required to build haiku
|
# version of legacy gcc required to build haiku
|
||||||
|
|
||||||
|
@ -350,7 +350,10 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
const charT* c_str () const
|
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, charT c);
|
||||||
void resize (size_type n)
|
void resize (size_type n)
|
||||||
{ resize (n, eos ()); }
|
{ resize (n, eos ()); }
|
||||||
|
@ -387,6 +387,22 @@ template <class _FLT> complex<_FLT>
|
|||||||
template <class _FLT> complex<_FLT>
|
template <class _FLT> complex<_FLT>
|
||||||
sqrt (const complex<_FLT>&) __attribute__ ((const));
|
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> istream& operator >> (istream&, complex<_FLT>&);
|
||||||
template <class _FLT> ostream& operator << (ostream&, const complex<_FLT>&);
|
template <class _FLT> ostream& operator << (ostream&, const complex<_FLT>&);
|
||||||
} // extern "C++"
|
} // extern "C++"
|
||||||
|
@ -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 exect(const char *path, char *const *argv);
|
||||||
extern int execvp(const char *file, 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 pid_t tcgetpgrp(int fd);
|
||||||
extern int tcsetpgrp(int fd, pid_t pgrpid);
|
extern int tcsetpgrp(int fd, pid_t pgrpid);
|
||||||
|
@ -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 generic_ide_pci ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel busses ata ide_isa ;
|
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 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 silicon_image_3112 ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel busses ata legacy_sata ;
|
SubInclude HAIKU_TOP src add-ons kernel busses ata legacy_sata ;
|
||||||
|
@ -21,65 +21,70 @@
|
|||||||
|
|
||||||
#include "wrapper.h"
|
#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"
|
#define PROMISE_TX2_CHANNEL_MODULE_NAME "busses/ata/promise_tx2/channel/v1"
|
||||||
|
|
||||||
|
|
||||||
static ata_for_controller_interface *ide;
|
static ata_for_controller_interface *sATA;
|
||||||
static ata_adapter_interface *ata_adapter;
|
static ata_adapter_interface *sATAAdapter;
|
||||||
static device_manager_info *pnp;
|
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
|
static status_t
|
||||||
write_command_block_regs(void *channel_cookie, ata_task_file *tf, ata_reg_mask mask)
|
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
|
static status_t
|
||||||
read_command_block_regs(void *channel_cookie, ata_task_file *tf, ata_reg_mask mask)
|
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
|
static uint8
|
||||||
get_altstatus(void *channel_cookie)
|
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
|
static status_t
|
||||||
write_device_control(void *channel_cookie, uint8 val)
|
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
|
static status_t
|
||||||
write_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
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
|
static status_t
|
||||||
read_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
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
|
static int32
|
||||||
inthand(void *arg)
|
handle_interrupt(void *arg)
|
||||||
{
|
{
|
||||||
ata_adapter_channel_info *channel = (ata_adapter_channel_info *)arg;
|
ata_adapter_channel_info *channel = (ata_adapter_channel_info *)arg;
|
||||||
pci_device_module_info *pci = channel->pci;
|
pci_device_module_info *pci = channel->pci;
|
||||||
pci_device device = channel->device;
|
pci_device *device = channel->device;
|
||||||
ide_bm_status bm_status;
|
|
||||||
uint8 status;
|
|
||||||
|
|
||||||
SHOW_FLOW0( 3, "" );
|
SHOW_FLOW0( 3, "" );
|
||||||
|
|
||||||
@ -91,7 +96,7 @@ inthand(void *arg)
|
|||||||
if ((pci->read_io_8(device, channel->bus_master_base + 3) & 0x20) == 0)
|
if ((pci->read_io_8(device, channel->bus_master_base + 3) & 0x20) == 0)
|
||||||
return B_UNHANDLED_INTERRUPT;
|
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,
|
prepare_dma(void *channel_cookie, const physical_entry *sg_list,
|
||||||
size_t sg_list_count, bool to_device)
|
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
|
static status_t
|
||||||
start_dma(void *channel_cookie)
|
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
|
static status_t
|
||||||
finish_dma(void *channel_cookie)
|
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
|
static status_t
|
||||||
init_channel(device_node_handle node, ata_channel ata_channel,
|
init_channel(device_node *node, void **channel_cookie)
|
||||||
void **channel_cookie)
|
|
||||||
{
|
{
|
||||||
return ata_adapter->init_channel(node, ata_channel, (ata_adapter_channel_info **)channel_cookie,
|
return sATAAdapter->init_channel(node,
|
||||||
sizeof(ata_adapter_channel_info), inthand);
|
(ata_adapter_channel_info **)channel_cookie,
|
||||||
}
|
sizeof(ata_adapter_channel_info), handle_interrupt);
|
||||||
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
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
|
// publish node of ide controller
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
publish_controller(device_node_handle parent, uint16 bus_master_base, uint8 intnum,
|
publish_controller(device_node *parent, uint16 bus_master_base, uint8 intnum,
|
||||||
io_resource_handle *resources, device_node_handle *node)
|
io_resource *resources, device_node **node)
|
||||||
{
|
{
|
||||||
device_attr attrs[] = {
|
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
|
// properties of this controller for ide bus manager
|
||||||
// there are always max. 2 devices
|
// 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
|
// of course we can DMA
|
||||||
{ IDE_CONTROLLER_CAN_DMA_ITEM, B_UINT8_TYPE, { ui8: 1 }},
|
{ ATA_CONTROLLER_CAN_DMA_ITEM, B_UINT8_TYPE, { ui8: 1 }},
|
||||||
// command queuing always works
|
|
||||||
{ IDE_CONTROLLER_CAN_CQ_ITEM, B_UINT8_TYPE, { ui8: 1 }},
|
|
||||||
// choose any name here
|
// 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
|
// DMA properties
|
||||||
// some say it must be dword-aligned, others that it can be byte-aligned;
|
// 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, "");
|
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
|
// detect pure IDE controller, i.e. without channels
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
detect_controller(pci_device_module_info *pci, pci_device pci_device,
|
detect_controller(pci_device_module_info *pci, pci_device *pci_device,
|
||||||
device_node_handle parent, uint16 bus_master_base, int8 intnum,
|
device_node *parent, uint16 bus_master_base, int8 intnum,
|
||||||
device_node_handle *node)
|
device_node **node)
|
||||||
{
|
{
|
||||||
io_resource_handle resource_handles[2];
|
|
||||||
|
|
||||||
SHOW_FLOW0(3, "");
|
SHOW_FLOW0(3, "");
|
||||||
|
|
||||||
if ((bus_master_base & PCI_address_space) != 1)
|
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_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 publish_controller(parent, bus_master_base, intnum, resources,
|
||||||
return B_ERROR;
|
node);
|
||||||
}
|
}
|
||||||
|
|
||||||
return publish_controller(parent, bus_master_base, intnum, resource_handles, node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
probe_controller(device_node_handle parent)
|
probe_controller(device_node *parent)
|
||||||
{
|
{
|
||||||
pci_device_module_info *pci;
|
pci_device_module_info *pci;
|
||||||
pci_device device;
|
pci_device *device;
|
||||||
uint16 command_block_base[2];
|
uint16 command_block_base[2];
|
||||||
uint16 control_block_base[2];
|
uint16 control_block_base[2];
|
||||||
uint16 bus_master_base;
|
uint16 bus_master_base;
|
||||||
device_node_handle controller_node, channels[2];
|
device_node *controller_node;
|
||||||
|
device_node *channels[2];
|
||||||
uint8 intnum;
|
uint8 intnum;
|
||||||
status_t res;
|
status_t status;
|
||||||
|
|
||||||
SHOW_FLOW0(3, "");
|
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;
|
return B_ERROR;
|
||||||
|
|
||||||
command_block_base[0] = pci->read_pci_config(device, PCI_base_registers, 4);
|
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;
|
control_block_base[1] &= PCI_address_io_mask;
|
||||||
bus_master_base &= PCI_address_io_mask;
|
bus_master_base &= PCI_address_io_mask;
|
||||||
|
|
||||||
res = detect_controller(pci, device, parent, bus_master_base, intnum, &controller_node);
|
status = detect_controller(pci, device, parent, bus_master_base, intnum,
|
||||||
if (res != B_OK || controller_node == NULL)
|
&controller_node);
|
||||||
goto err;
|
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,
|
PROMISE_TX2_CHANNEL_MODULE_NAME, true,
|
||||||
command_block_base[0], control_block_base[0], bus_master_base, intnum,
|
command_block_base[0], control_block_base[0], bus_master_base, intnum,
|
||||||
0, "Primary Channel", &channels[0], false);
|
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,
|
PROMISE_TX2_CHANNEL_MODULE_NAME, true,
|
||||||
command_block_base[1], control_block_base[1], bus_master_base, intnum,
|
command_block_base[1], control_block_base[1], bus_master_base, intnum,
|
||||||
1, "Secondary Channel", &channels[1], false);
|
1, "Secondary Channel", &channels[1], false);
|
||||||
|
|
||||||
pnp->uninit_driver(parent);
|
|
||||||
|
|
||||||
return B_OK;
|
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[] = {
|
module_dependency module_dependencies[] = {
|
||||||
{ IDE_FOR_CONTROLLER_MODULE_NAME, (module_info **)&ide },
|
{ ATA_FOR_CONTROLLER_MODULE_NAME, (module_info **)&sATA },
|
||||||
{ B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&pnp },
|
{ B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&sDeviceManager },
|
||||||
{ ATA_ADAPTER_MODULE_NAME, (module_info **)&ata_adapter },
|
{ ATA_ADAPTER_MODULE_NAME, (module_info **)&sATAAdapter },
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// exported interface
|
// exported interface
|
||||||
static ide_controller_interface channel_interface = {
|
static ata_controller_interface sChannelInterface = {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
PROMISE_TX2_CHANNEL_MODULE_NAME,
|
PROMISE_TX2_CHANNEL_MODULE_NAME,
|
||||||
0,
|
0,
|
||||||
std_ops
|
NULL
|
||||||
},
|
},
|
||||||
|
|
||||||
NULL, // supported devices
|
NULL, // supports_device()
|
||||||
NULL,
|
NULL, // register_device()
|
||||||
(status_t (*)( device_node_handle , void *, void ** )) init_channel,
|
init_channel,
|
||||||
uninit_channel,
|
uninit_channel,
|
||||||
|
NULL, // register_child_devices()
|
||||||
|
NULL, // rescan_child_devices()
|
||||||
channel_removed
|
channel_removed
|
||||||
},
|
},
|
||||||
|
|
||||||
&write_command_block_regs,
|
set_channel,
|
||||||
&read_command_block_regs,
|
|
||||||
|
|
||||||
&get_altstatus,
|
write_command_block_regs,
|
||||||
&write_device_control,
|
read_command_block_regs,
|
||||||
|
|
||||||
&write_pio,
|
get_altstatus,
|
||||||
&read_pio,
|
write_device_control,
|
||||||
|
|
||||||
&prepare_dma,
|
write_pio,
|
||||||
&start_dma,
|
read_pio,
|
||||||
&finish_dma,
|
|
||||||
|
prepare_dma,
|
||||||
|
start_dma,
|
||||||
|
finish_dma,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static driver_module_info controller_interface = {
|
static driver_module_info sControllerInterface = {
|
||||||
{
|
{
|
||||||
PROMISE_TX2_CONTROLLER_MODULE_NAME,
|
PROMISE_TX2_CONTROLLER_MODULE_NAME,
|
||||||
0,
|
0,
|
||||||
std_ops
|
NULL
|
||||||
},
|
},
|
||||||
|
|
||||||
NULL,
|
NULL,
|
||||||
probe_controller,
|
probe_controller,
|
||||||
(status_t (*)(device_node_handle, void *, void **)) init_controller,
|
init_controller,
|
||||||
(status_t (*)(void *)) uninit_controller,
|
uninit_controller,
|
||||||
(void (*)(device_node_handle, void *)) controller_removed
|
NULL,
|
||||||
|
NULL,
|
||||||
|
controller_removed
|
||||||
};
|
};
|
||||||
|
|
||||||
module_info *modules[] = {
|
module_info *modules[] = {
|
||||||
(module_info *)&controller_interface,
|
(module_info *)&sControllerInterface,
|
||||||
(module_info *)&channel_interface,
|
(module_info *)&sChannelInterface,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define MIME_STRING_TYPE 'MIMS'
|
|
||||||
|
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
#include <TypeConstants.h>
|
#include <TypeConstants.h>
|
||||||
@ -23,7 +21,9 @@
|
|||||||
#include "mime_table.h"
|
#include "mime_table.h"
|
||||||
#include "ntfs.h"
|
#include "ntfs.h"
|
||||||
|
|
||||||
//TODO: notify*()
|
|
||||||
|
const char* kHaikuAttrPrefix={"HAIKU-XATTR:"};
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
fs_open_attrib_dir(fs_volume *_vol, fs_vnode *_node, void **_cookie)
|
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:
|
exit:
|
||||||
|
|
||||||
if (ctx)
|
if (ctx != NULL)
|
||||||
ntfs_attr_put_search_ctx(ctx);
|
ntfs_attr_put_search_ctx(ctx);
|
||||||
if (ni)
|
if (ni != NULL)
|
||||||
ntfs_inode_close(ni);
|
ntfs_inode_close(ni);
|
||||||
|
|
||||||
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
|
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__);
|
TRACE("%s - ENTER\n", __FUNCTION__);
|
||||||
|
|
||||||
|
|
||||||
while (!(result = ntfs_attrs_walk(cookie->ctx))) {
|
while (!(result = ntfs_attrs_walk(cookie->ctx))) {
|
||||||
ATTR_RECORD *attr = cookie->ctx->attr;
|
ATTR_RECORD *attr = cookie->ctx->attr;
|
||||||
if (attr->type == AT_DATA) {
|
if (attr->type == AT_DATA) {
|
||||||
|
const char *real_name;
|
||||||
// it's the actual file body
|
// it's the actual file body
|
||||||
if (attr->name_length == 0)
|
if (attr->name_length == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
name = ntfs_attr_name_get((const ntfschar *)(((char *)attr)
|
name = ntfs_attr_name_get((const ntfschar *)(((char *)attr)
|
||||||
+ attr->name_offset), attr->name_length);
|
+ 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_ino = node->vnid;
|
||||||
entry->d_dev = ns->id;
|
entry->d_dev = ns->id;
|
||||||
entry->d_reclen = sizeof(struct dirent) + strlen(name);
|
entry->d_reclen = sizeof(struct dirent) + strlen(real_name);
|
||||||
//XXX size
|
//XXX size
|
||||||
strcpy(entry->d_name, name);
|
strcpy(entry->d_name, real_name);
|
||||||
ntfs_attr_name_free(&name);
|
ntfs_attr_name_free(&name);
|
||||||
numEntries++;
|
numEntries++;
|
||||||
if (numEntries >= *num)
|
if (numEntries >= *num)
|
||||||
@ -212,7 +220,11 @@ fs_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
|
|||||||
ntfs_attr *na = 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);
|
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);
|
ni = ntfs_inode_open(ns->ntvol, node->vnid);
|
||||||
if (ni == NULL) {
|
if (ni == NULL) {
|
||||||
result = errno;
|
result = errno;
|
||||||
ERROR("%s - inode_open: %s\n", __FUNCTION__, strerror(result));
|
TRACE("%s - inode_open: %s\n", __FUNCTION__, strerror(result));
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,59 +247,66 @@ fs_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
|
|||||||
|
|
||||||
// check for a named stream
|
// check for a named stream
|
||||||
if (true) {
|
if (true) {
|
||||||
|
char ntfs_attr_name[MAX_PATH] = {0};
|
||||||
|
strcat(ntfs_attr_name, kHaikuAttrPrefix);
|
||||||
|
strcat(ntfs_attr_name,name);
|
||||||
|
|
||||||
uname = ntfs_calloc(MAX_PATH);
|
uname = ntfs_calloc(MAX_PATH);
|
||||||
ulen = ntfs_mbstoucs(name, &uname);
|
ulen = ntfs_mbstoucs(ntfs_attr_name, &uname);
|
||||||
if (ulen < 0) {
|
if (ulen < 0) {
|
||||||
result = EILSEQ;
|
result = EILSEQ;
|
||||||
ERROR("%s - mb alloc: %s\n", __FUNCTION__, strerror(result));
|
TRACE("%s - mb alloc: %s\n", __FUNCTION__, strerror(result));
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
|
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
|
||||||
if (na) {
|
if (na != NULL) {
|
||||||
result = EEXIST;
|
if (ntfs_attr_truncate(na, 0)) {
|
||||||
ERROR("%s - ntfs_attr_open: %s\n", __FUNCTION__,
|
result = errno;
|
||||||
strerror(result));
|
goto exit;
|
||||||
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,
|
if(ntfs_attr_pwrite(na, 0, sizeof(uint32), &type) < 0 ) {
|
||||||
// 0) < 0) {
|
|
||||||
if (ntfs_attr_add(ni, AT_DATA, uname, ulen, NULL, 0) < 0) {
|
|
||||||
result = errno;
|
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;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cookie = (attrcookie*)ntfs_calloc(sizeof(attrcookie));
|
cookie = (attrcookie*)ntfs_calloc(sizeof(attrcookie));
|
||||||
|
|
||||||
if (cookie != NULL) {
|
if (cookie != NULL) {
|
||||||
cookie->omode = openMode;
|
cookie->omode = openMode;
|
||||||
*_cookie = (void*)cookie;
|
*_cookie = (void*)cookie;
|
||||||
cookie->inode = ni;
|
cookie->vnid = node->vnid;
|
||||||
cookie->stream = na;
|
cookie->uname = uname;
|
||||||
ni = NULL;
|
cookie->uname_len = ulen;
|
||||||
na = NULL;
|
cookie->type = type;
|
||||||
|
uname = NULL;
|
||||||
} else
|
} else
|
||||||
result = ENOMEM;
|
result = ENOMEM;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (uname)
|
if (uname != NULL)
|
||||||
free(uname);
|
free(uname);
|
||||||
|
|
||||||
if (na)
|
if (na != NULL)
|
||||||
ntfs_attr_close(na);
|
ntfs_attr_close(na);
|
||||||
|
|
||||||
if (ni)
|
if (ni != NULL)
|
||||||
ntfs_inode_close(ni);
|
ntfs_inode_close(ni);
|
||||||
|
|
||||||
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
|
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_inode *ni = NULL;
|
||||||
ntfs_attr *na = NULL;
|
ntfs_attr *na = NULL;
|
||||||
status_t result = B_NO_ERROR;
|
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);
|
LOCK_VOL(ns);
|
||||||
|
|
||||||
@ -333,18 +353,33 @@ fs_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
|
|||||||
|
|
||||||
// check for a named stream
|
// check for a named stream
|
||||||
if (true) {
|
if (true) {
|
||||||
|
char ntfs_attr_name[MAX_PATH] = {0};
|
||||||
|
strcat(ntfs_attr_name, kHaikuAttrPrefix);
|
||||||
|
strcat(ntfs_attr_name, name);
|
||||||
|
|
||||||
uname = ntfs_calloc(MAX_PATH);
|
uname = ntfs_calloc(MAX_PATH);
|
||||||
ulen = ntfs_mbstoucs(name, &uname);
|
ulen = ntfs_mbstoucs(ntfs_attr_name, &uname);
|
||||||
if (ulen < 0) {
|
if (ulen < 0) {
|
||||||
result = EILSEQ;
|
result = EILSEQ;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
|
na = ntfs_attr_open(ni, AT_DATA, uname, ulen);
|
||||||
if (na) {
|
if (na != NULL) {
|
||||||
if (openMode & O_TRUNC) {
|
if (openMode & O_TRUNC) {
|
||||||
if (ntfs_attr_truncate(na, 0))
|
if (ns->flags & B_FS_IS_READONLY) {
|
||||||
result = errno;
|
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 {
|
} else {
|
||||||
result = ENOENT;
|
result = ENOENT;
|
||||||
@ -357,22 +392,23 @@ fs_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
|
|||||||
|
|
||||||
if (cookie != NULL) {
|
if (cookie != NULL) {
|
||||||
cookie->omode = openMode;
|
cookie->omode = openMode;
|
||||||
|
cookie->vnid = node->vnid;
|
||||||
|
cookie->uname = uname;
|
||||||
|
cookie->uname_len = ulen;
|
||||||
|
cookie->type = type;
|
||||||
*_cookie = (void*)cookie;
|
*_cookie = (void*)cookie;
|
||||||
cookie->inode = ni;
|
uname = NULL;
|
||||||
cookie->stream = na;
|
|
||||||
ni = NULL;
|
|
||||||
na = NULL;
|
|
||||||
} else
|
} else
|
||||||
result = ENOMEM;
|
result = ENOMEM;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (uname)
|
if (uname != NULL)
|
||||||
free(uname);
|
free(uname);
|
||||||
|
|
||||||
if (na)
|
if (na != NULL)
|
||||||
ntfs_attr_close(na);
|
ntfs_attr_close(na);
|
||||||
|
|
||||||
if (ni)
|
if (ni != NULL)
|
||||||
ntfs_inode_close(ni);
|
ntfs_inode_close(ni);
|
||||||
|
|
||||||
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
|
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
|
||||||
@ -386,6 +422,7 @@ exit:
|
|||||||
status_t
|
status_t
|
||||||
fs_close_attrib(fs_volume *_vol, fs_vnode *_node, void *cookie)
|
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;
|
return B_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,10 +435,8 @@ fs_free_attrib_cookie(fs_volume *_vol, fs_vnode *_node, void *_cookie)
|
|||||||
|
|
||||||
LOCK_VOL(ns);
|
LOCK_VOL(ns);
|
||||||
|
|
||||||
if (cookie->stream)
|
if (cookie->uname != NULL)
|
||||||
ntfs_attr_close(cookie->stream);
|
free(cookie->uname);
|
||||||
if (cookie->inode)
|
|
||||||
ntfs_inode_close(cookie->inode);
|
|
||||||
|
|
||||||
UNLOCK_VOL(ns);
|
UNLOCK_VOL(ns);
|
||||||
|
|
||||||
@ -415,21 +450,33 @@ fs_read_attrib_stat(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
|||||||
struct stat *stat)
|
struct stat *stat)
|
||||||
{
|
{
|
||||||
nspace *ns = (nspace *)_vol->private_volume;
|
nspace *ns = (nspace *)_vol->private_volume;
|
||||||
//vnode *node = (vnode *)_node->private_node;
|
vnode *node = (vnode *)_node->private_node;
|
||||||
attrcookie *cookie = (attrcookie *)_cookie;
|
attrcookie *cookie = (attrcookie *)_cookie;
|
||||||
//ntfs_inode *ni = cookie->inode;
|
ntfs_inode *ni = NULL;
|
||||||
ntfs_attr *na = cookie->stream;
|
ntfs_attr *na = NULL;
|
||||||
|
status_t result = B_NO_ERROR;
|
||||||
//status_t result = B_NO_ERROR;
|
|
||||||
|
|
||||||
LOCK_VOL(ns);
|
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_type = cookie->type;
|
||||||
stat->st_size = na ? na->data_size : 0;
|
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);
|
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)
|
void *buffer, size_t *len)
|
||||||
{
|
{
|
||||||
nspace *ns = (nspace *)_vol->private_volume;
|
nspace *ns = (nspace *)_vol->private_volume;
|
||||||
//vnode *node = (vnode *)_node->private_node;
|
vnode *node = (vnode *)_node->private_node;
|
||||||
attrcookie *cookie = (attrcookie *)_cookie;
|
attrcookie *cookie = (attrcookie *)_cookie;
|
||||||
ntfs_inode *ni = cookie->inode;
|
ntfs_inode *ni = NULL;
|
||||||
ntfs_attr *na = cookie->stream;
|
ntfs_attr *na = NULL;
|
||||||
size_t size = *len;
|
size_t size = *len;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
status_t result = B_NO_ERROR;
|
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;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOCK_VOL(ns);
|
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
|
// it is a named stream
|
||||||
if (na) {
|
if (na != NULL) {
|
||||||
if (pos + size > na->data_size)
|
if (pos + size > na->data_size)
|
||||||
size = na->data_size - pos;
|
size = na->data_size - pos;
|
||||||
|
|
||||||
while (size) {
|
while (size) {
|
||||||
off_t bytesRead = ntfs_attr_pread(na, pos, size, buffer);
|
off_t bytesRead = ntfs_attr_pread(na, pos, size, buffer);
|
||||||
if (bytesRead < (s64)size) {
|
if (bytesRead < (s64)size) {
|
||||||
ntfs_log_error("ntfs_attr_pread returned less bytes than "
|
ERROR("ntfs_attr_pread returned less bytes than "
|
||||||
"requested.\n");
|
"requested.\n");
|
||||||
}
|
}
|
||||||
if (bytesRead <= 0) {
|
if (bytesRead <= 0) {
|
||||||
@ -487,9 +546,11 @@ fs_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
|
|||||||
result = ENOENT; // TODO
|
result = ENOENT; // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
fs_ntfs_update_times(_vol, ni, NTFS_UPDATE_ATIME); // XXX needed ?
|
|
||||||
|
|
||||||
exit:
|
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));
|
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
|
||||||
|
|
||||||
@ -500,22 +561,24 @@ exit:
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
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)
|
const void *buffer, size_t *_length)
|
||||||
{
|
{
|
||||||
nspace *ns = (nspace *)_vol->private_volume;
|
nspace *ns = (nspace *)_vol->private_volume;
|
||||||
//vnode *node = (vnode *)_node->private_node;
|
vnode *node = (vnode *)_node->private_node;
|
||||||
attrcookie *cookie = (attrcookie *)_cookie;
|
attrcookie *cookie = (attrcookie *)_cookie;
|
||||||
ntfs_inode *ni = cookie->inode;
|
ntfs_inode *ni = NULL;
|
||||||
ntfs_attr *na = cookie->stream;
|
ntfs_attr *na = NULL;
|
||||||
size_t size = *_length;
|
size_t size = *_length;
|
||||||
|
char *attr_name = NULL;
|
||||||
|
char *real_name = NULL;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
status_t result = B_NO_ERROR;
|
status_t result = B_NO_ERROR;
|
||||||
|
|
||||||
TRACE("%s - ENTER!!\n", __FUNCTION__);
|
TRACE("%s - ENTER vnode: %d\n", __FUNCTION__, node->vnid);
|
||||||
|
|
||||||
if (ns->flags & B_FS_IS_READONLY) {
|
if (ns->flags & B_FS_IS_READONLY) {
|
||||||
ERROR("ntfs is read-only\n");
|
return B_READ_ONLY_DEVICE;
|
||||||
return EROFS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
@ -523,13 +586,23 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,off_t pos,
|
|||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOCK_VOL(ns);
|
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
|
// it is a named stream
|
||||||
if (na) {
|
if (na != NULL) {
|
||||||
if (cookie->omode & O_APPEND)
|
if (cookie->omode & O_APPEND)
|
||||||
pos = na->data_size;
|
pos = na->data_size;
|
||||||
|
|
||||||
@ -560,14 +633,26 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,off_t pos,
|
|||||||
*_length = total;
|
*_length = total;
|
||||||
} else {
|
} else {
|
||||||
*_length = 0;
|
*_length = 0;
|
||||||
return EINVAL;
|
result = EINVAL;
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ntfs_ucstombs(na->name, na->name_len, &attr_name, 0) >= 0) {
|
||||||
if (total > 0)
|
if (attr_name != NULL) {
|
||||||
fs_ntfs_update_times(_vol, ni, NTFS_UPDATE_ATIME); // XXX needed ?
|
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:
|
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));
|
TRACE("%s - EXIT, result is %s\n", __FUNCTION__, strerror(result));
|
||||||
|
|
||||||
@ -576,3 +661,68 @@ exit:
|
|||||||
return result;
|
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;
|
||||||
|
}
|
||||||
|
@ -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);
|
off_t pos, void *buffer, size_t *_length);
|
||||||
status_t fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *cookie,
|
status_t fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *cookie,
|
||||||
off_t pos, const void *buffer, size_t *_length);
|
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
|
#endif // NTFS_ATTRIBUTES_H
|
||||||
|
|
||||||
|
@ -21,13 +21,27 @@
|
|||||||
#include "fake_attributes.h"
|
#include "fake_attributes.h"
|
||||||
#include "mime_table.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)
|
status_t set_mime(vnode *node, const char *filename)
|
||||||
{
|
{
|
||||||
struct ext_mime *p;
|
struct ext_mime *p;
|
||||||
int32 namelen, ext_len;
|
int32 namelen;
|
||||||
node->mime = NULL;
|
int32 ext_len;
|
||||||
|
node->mime = kFailBackMime;
|
||||||
|
|
||||||
|
if (filename == NULL)
|
||||||
|
{
|
||||||
|
node->mime = kDirectoryMime;
|
||||||
|
return B_NO_ERROR;
|
||||||
|
}
|
||||||
namelen = strlen(filename);
|
namelen = strlen(filename);
|
||||||
|
|
||||||
for (p=mimes; p->extension; p++) {
|
for (p=mimes; p->extension; p++) {
|
||||||
@ -63,17 +77,18 @@ fake_open_attrib_dir(fs_volume *_vol, fs_vnode *_node, void **_cookie)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(int32 *)(*_cookie) = 0;
|
*(int32 *)(*_cookie) = kOpenTypeCookie;
|
||||||
|
|
||||||
exit:
|
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);
|
UNLOCK_VOL(ns);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
fake_close_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
|
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);
|
LOCK_VOL(ns);
|
||||||
|
|
||||||
*(int32 *)_cookie = 1;
|
*(int32 *)_cookie = kCloseTypeCookie;
|
||||||
|
|
||||||
TRACE("fake_close_attrdir - EXIT\n");
|
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;
|
return B_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
fake_free_attrib_dir_cookie(fs_volume *_vol, fs_vnode *_node, void *_cookie)
|
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;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(int32 *)_cookie = 0x87654321;
|
*(int32 *)_cookie = kFreeTypeCookie;
|
||||||
free(_cookie);
|
free(_cookie);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
@ -122,6 +138,7 @@ exit:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
fake_rewind_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
|
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");
|
TRACE("fake_rewind_attrcookie - ENTER\n");
|
||||||
|
|
||||||
if (_cookie == NULL) {
|
if (_cookie == NULL) {
|
||||||
TRACE("fake_rewind_attrcookie - error: fs_rewind_attrcookie"
|
TRACE("fake_rewind_attrcookie - error: fake_rewind_attrcookie"
|
||||||
"called with null cookie\n");
|
"called with null cookie\n");
|
||||||
result = EINVAL;
|
result = EINVAL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(uint32 *)_cookie = 0;
|
*(uint32 *)_cookie = kOpenTypeCookie;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
@ -167,16 +184,16 @@ fake_read_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
|||||||
|
|
||||||
*num = 0;
|
*num = 0;
|
||||||
|
|
||||||
if ((*cookie == 0) && (node->mime)) {
|
if ((*cookie == kOpenTypeCookie) && (node->mime)) {
|
||||||
*num = 1;
|
*num = 1;
|
||||||
|
|
||||||
entry->d_ino = node->vnid;
|
entry->d_ino = node->vnid;
|
||||||
entry->d_dev = ns->id;
|
entry->d_dev = ns->id;
|
||||||
entry->d_reclen = 10;
|
entry->d_reclen = sizeof(struct dirent) + 10;
|
||||||
strcpy(entry->d_name, "BEOS:TYPE");
|
strcpy(entry->d_name, "BEOS:TYPE");
|
||||||
}
|
}
|
||||||
|
|
||||||
*cookie = 1;
|
*cookie = kCloseTypeCookie;
|
||||||
|
|
||||||
TRACE("fake_read_attrdir - EXIT\n");
|
TRACE("fake_read_attrdir - EXIT\n");
|
||||||
|
|
||||||
@ -186,28 +203,45 @@ fake_read_attrib_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
fake_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
|
fake_create_attrib(fs_volume *_vol, fs_vnode *_node, const char* name,
|
||||||
int openMode, void **_cookie)
|
uint32 type, int openMode, void** _cookie)
|
||||||
{
|
{
|
||||||
nspace *ns = (nspace *)_vol->private_volume;
|
nspace *ns = (nspace *)_vol->private_volume;
|
||||||
vnode *node = (vnode *)_node->private_node;
|
|
||||||
int result = B_NO_ERROR;
|
int result = B_NO_ERROR;
|
||||||
|
|
||||||
LOCK_VOL(ns);
|
LOCK_VOL(ns);
|
||||||
|
|
||||||
TRACE("fake_open_attrib - ENTER\n");
|
TRACE("fake_create_attrib - ENTER (name = [%s])\n",name);
|
||||||
|
|
||||||
if (strcmp(name, "BEOS:TYPE")) {
|
if (strcmp(name, "BEOS:TYPE") != 0)
|
||||||
result = ENOENT;
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
|
||||||
|
|
||||||
if (node->mime == NULL) {
|
*_cookie = &kSetTypeCookie;
|
||||||
result = ENOENT;
|
|
||||||
|
exit:
|
||||||
|
|
||||||
|
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;
|
goto exit;
|
||||||
}
|
|
||||||
|
|
||||||
*_cookie = &kBeOSTypeCookie;
|
*_cookie = &kSetTypeCookie;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
@ -245,18 +279,16 @@ fake_read_attrib_stat(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
|||||||
|
|
||||||
TRACE("fake_read_attr_stat - ENTER\n");
|
TRACE("fake_read_attr_stat - ENTER\n");
|
||||||
|
|
||||||
if (_cookie != &kBeOSTypeCookie) {
|
if (_cookie != &kSetTypeCookie) {
|
||||||
result = ENOENT;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node->mime == NULL) {
|
|
||||||
result = ENOENT;
|
result = ENOENT;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
stat->st_type = MIME_STRING_TYPE;
|
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:
|
exit:
|
||||||
|
|
||||||
@ -282,7 +314,7 @@ fake_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
|||||||
|
|
||||||
TRACE("fake_read_attr - ENTER\n");
|
TRACE("fake_read_attr - ENTER\n");
|
||||||
|
|
||||||
if (_cookie != &kBeOSTypeCookie) {
|
if (_cookie != &kSetTypeCookie) {
|
||||||
result = ENOENT;
|
result = ENOENT;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
@ -315,23 +347,5 @@ status_t
|
|||||||
fake_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
|
fake_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
|
||||||
const void *buffer, size_t *_length)
|
const void *buffer, size_t *_length)
|
||||||
{
|
{
|
||||||
nspace *ns = (nspace *)_vol->private_volume;
|
return B_NO_ERROR;
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@ status_t fake_rewind_attrib_dir(fs_volume *_vol, fs_vnode *_node,
|
|||||||
void *_cookie);
|
void *_cookie);
|
||||||
status_t fake_read_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);
|
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,
|
status_t fake_open_attrib(fs_volume *_vol, fs_vnode *_node, const char *name,
|
||||||
int openMode, void **_cookie);
|
int openMode, void **_cookie);
|
||||||
status_t fake_close_attrib(fs_volume *_vol, fs_vnode *_node, 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
@ -156,7 +156,7 @@ fs_vnode_ops gNTFSVnodeOps = {
|
|||||||
&fs_read_attrib_stat,
|
&fs_read_attrib_stat,
|
||||||
NULL, //&fs_write_attr_stat,
|
NULL, //&fs_write_attr_stat,
|
||||||
NULL, //&fs_rename_attr,
|
NULL, //&fs_rename_attr,
|
||||||
NULL, //&fs_remove_attr,
|
&fs_remove_attrib,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
This file may be used under the terms of the Be Sample Code License.
|
This file may be used under the terms of the Be Sample Code License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
struct ext_mime {
|
struct ext_mime {
|
||||||
char *extension;
|
char *extension;
|
||||||
char *mime;
|
char *mime;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ext_mime mimes[] = {
|
struct ext_mime mimes[] = {
|
||||||
{ "***", "application/x-vnd.Be-directory"},
|
|
||||||
|
|
||||||
{ "gz", "application/x-gzip" },
|
{ "gz", "application/x-gzip" },
|
||||||
{ "hqx", "application/x-binhex40" },
|
{ "hqx", "application/x-binhex40" },
|
||||||
{ "lha", "application/x-lharc" },
|
{ "lha", "application/x-lharc" },
|
||||||
@ -24,8 +24,13 @@ struct ext_mime mimes[] = {
|
|||||||
{ "z", "application/x-compress" },
|
{ "z", "application/x-compress" },
|
||||||
{ "zip", "application/zip" },
|
{ "zip", "application/zip" },
|
||||||
{ "zoo", "application/x-zoo" },
|
{ "zoo", "application/x-zoo" },
|
||||||
{ "rar", "application/x-rar-compressed" },
|
{ "rar", "application/x-rar" },
|
||||||
{ "pkg", "application/x-scode-UPkg" },
|
{ "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" },
|
{ "aif", "audio/x-aiff" },
|
||||||
{ "aiff", "audio/x-aiff" },
|
{ "aiff", "audio/x-aiff" },
|
||||||
@ -37,13 +42,20 @@ struct ext_mime mimes[] = {
|
|||||||
{ "wav", "audio/x-wav" },
|
{ "wav", "audio/x-wav" },
|
||||||
{ "mp3", "audio/x-mpeg" },
|
{ "mp3", "audio/x-mpeg" },
|
||||||
{ "ogg", "audio/x-vorbis" },
|
{ "ogg", "audio/x-vorbis" },
|
||||||
|
{ "flac", "audio/x-flac" },
|
||||||
|
{ "wma", "audio/x-ms-wma" },
|
||||||
|
|
||||||
{ "avi", "video/x-msvideo" },
|
{ "avi", "video/x-msvideo" },
|
||||||
{ "mov", "video/quicktime" },
|
{ "mov", "video/quicktime" },
|
||||||
|
{ "qt", "video/quicktime" },
|
||||||
{ "mpg", "video/mpeg" },
|
{ "mpg", "video/mpeg" },
|
||||||
{ "mpeg", "video/mpeg" },
|
{ "mpeg", "video/mpeg" },
|
||||||
|
{ "flv", "video/x-flv" },
|
||||||
|
{ "mp4", "video/mp4" },
|
||||||
|
{ "mkv", "video/x-matroska" },
|
||||||
{ "asf", "application/x-asf" },
|
{ "asf", "application/x-asf" },
|
||||||
{ "rm", "video/vnd.rn-realvideo" },
|
{ "rm", "video/vnd.rn-realvideo" },
|
||||||
|
{ "wmv", "video/x-ms-wmv" },
|
||||||
|
|
||||||
{ "bmp", "image/x-bmp" },
|
{ "bmp", "image/x-bmp" },
|
||||||
{ "fax", "image/g3fax" },
|
{ "fax", "image/g3fax" },
|
||||||
@ -62,10 +74,20 @@ struct ext_mime mimes[] = {
|
|||||||
{ "tiff", "image/tiff" },
|
{ "tiff", "image/tiff" },
|
||||||
{ "xbm", "image/x-xbitmap" },
|
{ "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" },
|
{ "txt", "text/plain" },
|
||||||
{ "xml", "text/plain" },
|
{ "xml", "text/plain" },
|
||||||
{ "doc", "text/plain" },
|
|
||||||
{ "htm", "text/html" },
|
{ "htm", "text/html" },
|
||||||
{ "html", "text/html" },
|
{ "html", "text/html" },
|
||||||
{ "rtf", "text/rtf" },
|
{ "rtf", "text/rtf" },
|
||||||
@ -74,15 +96,15 @@ struct ext_mime mimes[] = {
|
|||||||
{ "c++", "text/x-source-code" },
|
{ "c++", "text/x-source-code" },
|
||||||
{ "h", "text/x-source-code" },
|
{ "h", "text/x-source-code" },
|
||||||
{ "hh", "text/x-source-code" },
|
{ "hh", "text/x-source-code" },
|
||||||
|
{ "hpp", "text/x-source-code" },
|
||||||
{ "cxx", "text/x-source-code" },
|
{ "cxx", "text/x-source-code" },
|
||||||
{ "cpp", "text/x-source-code" },
|
{ "cpp", "text/x-source-code" },
|
||||||
{ "S", "text/x-source-code" },
|
{ "S", "text/x-source-code" },
|
||||||
{ "java", "text/x-source-code" },
|
{ "java", "text/x-source-code" },
|
||||||
|
{ "ini", "text/plain" },
|
||||||
{ "exe", "application/x-vnd.Be-elfexecutable" },
|
{ "inf", "text/plain" },
|
||||||
{ "dll", "application/x-vnd.Be.ELF-object" },
|
|
||||||
|
|
||||||
{ "ttf", "application/x-truetype" },
|
{ "ttf", "application/x-truetype" },
|
||||||
|
|
||||||
{ 0, 0 }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
@ -87,19 +87,20 @@ typedef struct vnode {
|
|||||||
} vnode;
|
} vnode;
|
||||||
|
|
||||||
typedef struct filecookie {
|
typedef struct filecookie {
|
||||||
int omode;
|
int omode;
|
||||||
off_t last_size;
|
off_t last_size;
|
||||||
} filecookie;
|
} filecookie;
|
||||||
|
|
||||||
typedef struct attrcookie {
|
typedef struct attrcookie {
|
||||||
int omode;
|
int omode;
|
||||||
ntfs_inode *inode;
|
ino_t vnid;
|
||||||
ntfs_attr *stream;
|
ntfschar* uname;
|
||||||
// MFT ref for EA ?
|
int uname_len;
|
||||||
|
uint32 type;
|
||||||
} attrcookie;
|
} attrcookie;
|
||||||
|
|
||||||
typedef struct attrdircookie {
|
typedef struct attrdircookie {
|
||||||
ntfs_inode *inode;
|
ntfs_inode* inode;
|
||||||
ntfs_attr_search_ctx *ctx;
|
ntfs_attr_search_ctx *ctx;
|
||||||
} attrdircookie;
|
} attrdircookie;
|
||||||
|
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|
||||||
//callback function for readdir()
|
static int
|
||||||
static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name,
|
_ntfs_dirent_filler(void *_dirent, const ntfschar *name,
|
||||||
const int name_len, const int name_type, const s64 pos, const MFT_REF mref,
|
const int name_len, const int name_type, const s64 pos, const MFT_REF mref,
|
||||||
const unsigned dt_type)
|
const unsigned dt_type)
|
||||||
{
|
{
|
||||||
@ -45,42 +45,64 @@ static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user
|
if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user
|
||||||
|| cookie->show_sys_files) {
|
|| cookie->show_sys_files) {
|
||||||
if (cookie->readed == 1) {
|
int len = ntfs_ucstombs(name, name_len, &filename, 0);
|
||||||
cookie->pos=pos;
|
if (len >= 0 && filename != NULL) {
|
||||||
cookie->readed = 0;
|
cache_entry* new_entry =
|
||||||
return -1;
|
(cache_entry*)ntfs_calloc(sizeof(cache_entry));
|
||||||
} else {
|
if (new_entry == NULL) {
|
||||||
if (ntfs_ucstombs(name, name_len, &filename, 0) >= 0) {
|
free(filename);
|
||||||
if (filename) {
|
return -1;
|
||||||
strcpy(cookie->name,filename);
|
|
||||||
cookie->ino=MREF(mref);
|
|
||||||
cookie->readed = 1;
|
|
||||||
free(filename);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(filename);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
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;
|
nspace *ns = (nspace*)_vol->private_volume;
|
||||||
|
dircookie *cookie = (dircookie*)_cookie;
|
||||||
|
|
||||||
LOCK_VOL(ns);
|
LOCK_VOL(ns);
|
||||||
TRACE("fs_free_dircookie - ENTER\n");
|
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);
|
free(cookie);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("fs_free_dircookie - EXIT\n");
|
TRACE("fs_free_dircookie - EXIT\n");
|
||||||
|
|
||||||
UNLOCK_VOL(ns);
|
UNLOCK_VOL(ns);
|
||||||
|
|
||||||
return B_NO_ERROR;
|
return B_NO_ERROR;
|
||||||
@ -93,11 +115,10 @@ fs_opendir(fs_volume *_vol, fs_vnode *_node, void** _cookie)
|
|||||||
nspace *ns = (nspace*)_vol->private_volume;
|
nspace *ns = (nspace*)_vol->private_volume;
|
||||||
vnode *node = (vnode*)_node->private_node;
|
vnode *node = (vnode*)_node->private_node;
|
||||||
dircookie *cookie = NULL;
|
dircookie *cookie = NULL;
|
||||||
int result = B_NO_ERROR;
|
|
||||||
ntfs_inode *ni = NULL;
|
ntfs_inode *ni = NULL;
|
||||||
|
int result = B_NO_ERROR;
|
||||||
|
|
||||||
LOCK_VOL(ns);
|
LOCK_VOL(ns);
|
||||||
|
|
||||||
TRACE("fs_opendir - ENTER\n");
|
TRACE("fs_opendir - ENTER\n");
|
||||||
|
|
||||||
ni = ntfs_inode_open(ns->ntvol, node->vnid);
|
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));
|
cookie = (dircookie*)ntfs_calloc(sizeof(dircookie));
|
||||||
if (cookie != NULL) {
|
if (cookie != NULL) {
|
||||||
cookie->pos = 0;
|
cookie->pos = 0;
|
||||||
cookie->ino = 0;
|
cookie->dev_id = ns->id;
|
||||||
cookie->readed = 0;
|
|
||||||
cookie->last = 0;
|
|
||||||
cookie->name[0] = 0;
|
|
||||||
cookie->show_sys_files = ns->show_sys_files;
|
cookie->show_sys_files = ns->show_sys_files;
|
||||||
|
cookie->cache_root = NULL;
|
||||||
|
cookie->entry = cookie->cache_root;
|
||||||
*_cookie = (void*)cookie;
|
*_cookie = (void*)cookie;
|
||||||
} else
|
} else
|
||||||
result = ENOMEM;
|
result = ENOMEM;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (ni)
|
if (ni != NULL)
|
||||||
ntfs_inode_close(ni);
|
ntfs_inode_close(ni);
|
||||||
|
|
||||||
TRACE("fs_opendir - EXIT\n");
|
TRACE("fs_opendir - EXIT\n");
|
||||||
|
|
||||||
UNLOCK_VOL(ns);
|
UNLOCK_VOL(ns);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -138,32 +157,7 @@ exit:
|
|||||||
status_t
|
status_t
|
||||||
fs_closedir(fs_volume *_vol, fs_vnode *_node, void *cookie)
|
fs_closedir(fs_volume *_vol, fs_vnode *_node, void *cookie)
|
||||||
{
|
{
|
||||||
nspace *ns = (nspace*)_vol->private_volume;
|
return B_NO_ERROR;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -174,12 +168,12 @@ fs_readdir(fs_volume *_vol, fs_vnode *_node, void *_cookie, struct dirent *buf,
|
|||||||
nspace *ns = (nspace*)_vol->private_volume;
|
nspace *ns = (nspace*)_vol->private_volume;
|
||||||
vnode *node = (vnode*)_node->private_node;
|
vnode *node = (vnode*)_node->private_node;
|
||||||
dircookie *cookie = (dircookie*)_cookie;
|
dircookie *cookie = (dircookie*)_cookie;
|
||||||
uint32 nameLength = bufsize - sizeof(struct dirent), realLen;
|
|
||||||
int result = B_NO_ERROR;
|
|
||||||
ntfs_inode *ni = NULL;
|
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",
|
TRACE("fs_readdir - ENTER (sizeof(buf)=%d, bufsize=%d, num=%d\n",
|
||||||
sizeof(buf), bufsize, *num);
|
sizeof(buf), bufsize, *num);
|
||||||
|
|
||||||
@ -188,36 +182,47 @@ fs_readdir(fs_volume *_vol, fs_vnode *_node, void *_cookie, struct dirent *buf,
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cookie->readed == 1 || cookie->last == 1) {
|
|
||||||
result = ENOENT;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
ni = ntfs_inode_open(ns->ntvol, node->vnid);
|
ni = ntfs_inode_open(ns->ntvol, node->vnid);
|
||||||
if (ni == NULL) {
|
if (ni == NULL) {
|
||||||
ERROR("fs_readdir - dir not opened\n");
|
TRACE("fs_readdir - dir not opened\n");
|
||||||
result = ENOENT;
|
result = ENOENT;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ntfs_readdir(ni, &cookie->pos, cookie,
|
if(cookie->cache_root == NULL) {
|
||||||
(ntfs_filldir_t)_ntfs_dirent_filler);
|
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;
|
realLen = nameLength > 255 ? 255 : nameLength;
|
||||||
|
|
||||||
buf->d_dev = ns->id;
|
buf->d_dev = ns->id;
|
||||||
buf->d_ino = cookie->ino;
|
buf->d_ino = cookie->entry->ent->d_ino;
|
||||||
strlcpy(buf->d_name, cookie->name, realLen + 1);
|
strlcpy(buf->d_name, cookie->entry->ent->d_name, realLen + 1);
|
||||||
buf->d_reclen = sizeof(struct dirent) + realLen;
|
buf->d_reclen = sizeof(struct dirent) + realLen;
|
||||||
|
|
||||||
if (result == 0)
|
cookie->entry = (cache_entry*)cookie->entry->next;
|
||||||
cookie->last = 1;
|
|
||||||
|
|
||||||
result = B_NO_ERROR;
|
|
||||||
|
|
||||||
TRACE("fs_readdir - FILE: [%s]\n",buf->d_name);
|
TRACE("fs_readdir - FILE: [%s]\n",buf->d_name);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (ni)
|
if (ni != NULL)
|
||||||
ntfs_inode_close(ni);
|
ntfs_inode_close(ni);
|
||||||
|
|
||||||
if (result == B_NO_ERROR)
|
if (result == B_NO_ERROR)
|
||||||
@ -228,8 +233,7 @@ exit:
|
|||||||
if (result == ENOENT)
|
if (result == ENOENT)
|
||||||
result = B_NO_ERROR;
|
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);
|
UNLOCK_VOL(ns);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -237,26 +241,33 @@ exit:
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
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;
|
nspace *ns = (nspace*)_vol->private_volume;
|
||||||
dircookie *cookie = (dircookie*)_cookie;
|
dircookie *cookie = (dircookie*)_cookie;
|
||||||
int result = EINVAL;
|
int result = EINVAL;
|
||||||
|
|
||||||
LOCK_VOL(ns);
|
LOCK_VOL(ns);
|
||||||
|
|
||||||
TRACE("fs_rewinddir - ENTER\n");
|
TRACE("fs_rewinddir - 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;
|
||||||
|
}
|
||||||
cookie->pos = 0;
|
cookie->pos = 0;
|
||||||
cookie->ino = 0;
|
cookie->dev_id = ns->id;
|
||||||
cookie->readed = 0;
|
cookie->show_sys_files = ns->show_sys_files;
|
||||||
cookie->last = 0;
|
cookie->cache_root = NULL;
|
||||||
cookie->name[0] = 0;
|
cookie->entry = cookie->cache_root;
|
||||||
result = B_NO_ERROR;
|
result = B_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("fs_rewinddir - EXIT, result is %s\n", strerror(result));
|
TRACE("fs_rewinddir - EXIT, result is %s\n", strerror(result));
|
||||||
|
|
||||||
UNLOCK_VOL(ns);
|
UNLOCK_VOL(ns);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -24,15 +24,21 @@
|
|||||||
#include "ntfs.h"
|
#include "ntfs.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct cache_entry {
|
||||||
|
struct dirent *ent;
|
||||||
|
struct cache_entry *next;
|
||||||
|
} cache_entry;
|
||||||
|
|
||||||
|
|
||||||
typedef struct dircookie {
|
typedef struct dircookie {
|
||||||
u64 pos;
|
u64 pos;
|
||||||
int readed;
|
dev_t dev_id;
|
||||||
int last;
|
|
||||||
ino_t ino;
|
|
||||||
BOOL show_sys_files;
|
BOOL show_sys_files;
|
||||||
char name[MAX_PATH];
|
cache_entry *cache_root;
|
||||||
|
cache_entry *entry;
|
||||||
} dircookie;
|
} dircookie;
|
||||||
|
|
||||||
|
|
||||||
status_t fs_closedir(fs_volume *volume, fs_vnode *vnode, void *cookie);
|
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_free_dircookie(fs_volume *volume, fs_vnode *vnode, void *cookie);
|
||||||
status_t fs_opendir(fs_volume *volume, fs_vnode *vnode, void** cookie);
|
status_t fs_opendir(fs_volume *volume, fs_vnode *vnode, void** cookie);
|
||||||
|
@ -56,7 +56,7 @@ Addon ffmpeg :
|
|||||||
|
|
||||||
be
|
be
|
||||||
media
|
media
|
||||||
libz.a
|
$(HAIKU_ZLIB_LIB)
|
||||||
$(TARGET_LIBSUPC++)
|
$(TARGET_LIBSUPC++)
|
||||||
$(TARGET_NETWORK_LIBS)
|
$(TARGET_NETWORK_LIBS)
|
||||||
;
|
;
|
||||||
|
@ -11,7 +11,10 @@ if $(HAIKU_LIBSTDC++) = libstdc++.r4.so {
|
|||||||
SubDirC++Flags -Dios_base=ios -ftemplate-depth-24 ;
|
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 :
|
#StaticLibrary libilmimf.a :
|
||||||
SharedLibrary libilmimf.so :
|
SharedLibrary libilmimf.so :
|
||||||
@ -73,6 +76,7 @@ ImfVecAttribute.cpp
|
|||||||
ImfVersion.cpp
|
ImfVersion.cpp
|
||||||
ImfWav.cpp
|
ImfWav.cpp
|
||||||
ImfZipCompressor.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)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@ SubDir HAIKU_TOP src add-ons translators hpgs ;
|
|||||||
|
|
||||||
SubDirSysHdrs [ FDirName $(SUBDIR) lib ] ;
|
SubDirSysHdrs [ FDirName $(SUBDIR) lib ] ;
|
||||||
SubDirCcFlags -DHPGS_SHARED -std=c99 ;
|
SubDirCcFlags -DHPGS_SHARED -std=c99 ;
|
||||||
UseLibraryHeaders zlib ;
|
UseLibraryHeaders iconv ;
|
||||||
|
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
|
||||||
UseHeaders $(HAIKU_LIBPNG_HEADERS) : true ;
|
UseHeaders $(HAIKU_LIBPNG_HEADERS) : true ;
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
@ -42,13 +43,15 @@ hpgszostream.c
|
|||||||
|
|
||||||
Includes [ FGristFiles hpgsimage.c ]
|
Includes [ FGristFiles hpgsimage.c ]
|
||||||
: $(HAIKU_LIBPNG_HEADERS_DEPENDENCY) ;
|
: $(HAIKU_LIBPNG_HEADERS_DEPENDENCY) ;
|
||||||
|
Includes [ FGristFiles hpgszostream.c ]
|
||||||
|
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
|
||||||
|
|
||||||
Translator HPGSTranslator :
|
Translator HPGSTranslator :
|
||||||
# HPGSTranslator classes
|
# HPGSTranslator classes
|
||||||
ConfigView.cpp
|
ConfigView.cpp
|
||||||
HPGSTranslator.cpp
|
HPGSTranslator.cpp
|
||||||
$(sources)
|
$(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)
|
libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#if (defined(__BEOS__) || defined(__HAIKU__))
|
#if (defined(__BEOS__) || defined(__HAIKU__))
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
|
#define png_infopp_NULL (png_infopp)NULL
|
||||||
#else
|
#else
|
||||||
#include <libpng12/png.h>
|
#include <libpng12/png.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons translators png ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
UseLibraryHeaders zlib ;
|
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
|
||||||
UseHeaders $(HAIKU_LIBPNG_HEADERS) : true ;
|
UseHeaders $(HAIKU_LIBPNG_HEADERS) : true ;
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
@ -20,7 +20,8 @@ Translator PNGTranslator :
|
|||||||
PNGTranslator.cpp
|
PNGTranslator.cpp
|
||||||
PNGView.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)
|
$(HAIKU_LOCALE_LIBS)
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
@ -5,11 +5,14 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
# Include support sub folder
|
# Include support sub folder
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons translators wonderbrush support ] ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons translators wonderbrush support ] ;
|
||||||
|
|
||||||
UseLibraryHeaders zlib ;
|
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
AddResources WonderBrushTranslator : WonderBrushTranslator.rdef ;
|
AddResources WonderBrushTranslator : WonderBrushTranslator.rdef ;
|
||||||
|
|
||||||
|
Includes [ FGristFiles bitmap_compression.cpp ]
|
||||||
|
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
|
||||||
|
|
||||||
Translator WonderBrushTranslator :
|
Translator WonderBrushTranslator :
|
||||||
Canvas.cpp
|
Canvas.cpp
|
||||||
Layer.cpp
|
Layer.cpp
|
||||||
@ -23,8 +26,8 @@ Translator WonderBrushTranslator :
|
|||||||
blending.cpp
|
blending.cpp
|
||||||
lab_convert.cpp
|
lab_convert.cpp
|
||||||
|
|
||||||
: be translation z libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
: be translation $(HAIKU_ZLIB_LIB) libtranslatorsutils.a
|
||||||
$(HAIKU_LOCALE_LIBS)
|
$(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ Application InstalledPackages :
|
|||||||
main.cpp
|
main.cpp
|
||||||
UninstallWindow.cpp
|
UninstallWindow.cpp
|
||||||
UninstallView.cpp
|
UninstallView.cpp
|
||||||
: be tracker translation z $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
: be tracker translation $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
;
|
;
|
||||||
|
|
||||||
DoCatalogs InstalledPackages :
|
DoCatalogs InstalledPackages :
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
SubDir HAIKU_TOP src apps packageinstaller ;
|
SubDir HAIKU_TOP src apps packageinstaller ;
|
||||||
|
|
||||||
UsePrivateHeaders shared interface ;
|
UsePrivateHeaders shared interface ;
|
||||||
SubDirHdrs $(HAIKU_TOP) headers libs zlib ;
|
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
|
||||||
|
|
||||||
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
|
|
||||||
|
Includes [ FGristFiles PackageItem.cpp ]
|
||||||
|
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
|
||||||
|
|
||||||
Application PackageInstaller :
|
Application PackageInstaller :
|
||||||
main.cpp
|
main.cpp
|
||||||
PackageWindow.cpp
|
PackageWindow.cpp
|
||||||
@ -16,7 +19,8 @@ Application PackageInstaller :
|
|||||||
PackageTextViewer.cpp
|
PackageTextViewer.cpp
|
||||||
PackageImageViewer.cpp
|
PackageImageViewer.cpp
|
||||||
InstalledPackageInfo.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
|
: PackageInstaller.rdef
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
SubDir HAIKU_TOP src kits package ;
|
SubDir HAIKU_TOP src kits package ;
|
||||||
|
|
||||||
UseLibraryHeaders zlib ;
|
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
|
||||||
|
|
||||||
UsePrivateHeaders
|
UsePrivateHeaders
|
||||||
kernel
|
kernel
|
||||||
@ -8,6 +8,9 @@ UsePrivateHeaders
|
|||||||
|
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package hpkg ] ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits package hpkg ] ;
|
||||||
|
|
||||||
|
Includes [ FGristFiles ZlibCompressionBase.cpp ]
|
||||||
|
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
|
||||||
|
|
||||||
HPKG_SOURCES =
|
HPKG_SOURCES =
|
||||||
AttributeDataReader.cpp
|
AttributeDataReader.cpp
|
||||||
BlockBufferCache.cpp
|
BlockBufferCache.cpp
|
||||||
@ -72,5 +75,5 @@ SharedLibrary libpackage.so
|
|||||||
|
|
||||||
$(HPKG_SOURCES)
|
$(HPKG_SOURCES)
|
||||||
:
|
:
|
||||||
libshared.a be z $(TARGET_LIBSTDC++)
|
libshared.a be $(HAIKU_ZLIB_LIB) $(TARGET_LIBSTDC++)
|
||||||
;
|
;
|
||||||
|
@ -24,4 +24,4 @@ SubInclude HAIKU_TOP src libs termcap ;
|
|||||||
SubInclude HAIKU_TOP src libs tiff ;
|
SubInclude HAIKU_TOP src libs tiff ;
|
||||||
SubInclude HAIKU_TOP src libs udis86 ;
|
SubInclude HAIKU_TOP src libs udis86 ;
|
||||||
SubInclude HAIKU_TOP src libs util ;
|
SubInclude HAIKU_TOP src libs util ;
|
||||||
SubInclude HAIKU_TOP src libs zlib ;
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
SubDir HAIKU_TOP src libs tiff ;
|
SubDir HAIKU_TOP src libs tiff ;
|
||||||
|
|
||||||
UseLibraryHeaders tiff zlib ;
|
UseLibraryHeaders tiff ;
|
||||||
UseHeaders $(HAIKU_JPEG_HEADERS) : true ;
|
UseHeaders $(HAIKU_JPEG_HEADERS) : true ;
|
||||||
|
UseHeaders $(HAIKU_ZLIB_HEADERS) : true ;
|
||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
@ -47,10 +48,12 @@ local shared_files =
|
|||||||
|
|
||||||
Includes [ FGristFiles tif_jpeg.c tif_ojpeg.c ]
|
Includes [ FGristFiles tif_jpeg.c tif_ojpeg.c ]
|
||||||
: $(HAIKU_JPEG_HEADERS_DEPENDENCY) ;
|
: $(HAIKU_JPEG_HEADERS_DEPENDENCY) ;
|
||||||
|
Includes [ FGristFiles tif_pixarlog.c tif_zip.c ]
|
||||||
|
: $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
|
||||||
|
|
||||||
Objects $(shared_files) ;
|
Objects $(shared_files) ;
|
||||||
|
|
||||||
SharedLibrary libtiff.so : [ FGristFiles $(shared_files:S=.o) ]
|
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) ] ;
|
StaticLibrary libtiff.a : [ FGristFiles $(shared_files:S=.o) ] ;
|
||||||
|
Loading…
Reference in New Issue
Block a user