git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1123551 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
parent
c64d5699b0
commit
1219be788a
@ -0,0 +1,67 @@
|
|||||||
|
kde_module_LTLIBRARIES = kio_iso.la
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDES = $(all_includes)
|
||||||
|
|
||||||
|
|
||||||
|
#LDFLAGS =
|
||||||
|
|
||||||
|
kio_iso_la_METASOURCES=AUTO
|
||||||
|
|
||||||
|
kio_iso_la_SOURCES = kisodirectory.cpp kisofile.cpp qfilehack.cpp kiso.cpp iso.cpp
|
||||||
|
kio_iso_la_LIBADD = libisofs/libisofs.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KIO)
|
||||||
|
|
||||||
|
kio_iso_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
|
||||||
|
|
||||||
|
|
||||||
|
SUBDIRS = libisofs
|
||||||
|
|
||||||
|
noinst_HEADERS = iso.h kiso.h qfilehack.h kisofile.h kisodirectory.h
|
||||||
|
EXTRA_DIST = iso.protocol isoservice.desktop kio_iso.desktop
|
||||||
|
|
||||||
|
install-data-local:
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(kde_servicesdir)/
|
||||||
|
$(INSTALL_DATA) $(srcdir)/iso.protocol $(DESTDIR)$(kde_servicesdir)/iso.protocol
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(kde_datadir)/konqueror/servicemenus/
|
||||||
|
$(INSTALL_DATA) $(srcdir)/isoservice.desktop $(DESTDIR)$(kde_datadir)/konqueror/servicemenus/isoservice.desktop
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(kde_confdir)/
|
||||||
|
$(INSTALL_DATA) $(srcdir)/kio_isorc $(DESTDIR)$(kde_confdir)/kio_isorc
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(kde_appsdir)/
|
||||||
|
$(INSTALL_DATA) $(srcdir)/kio_iso.desktop $(DESTDIR)$(kde_appsdir)/kio_iso.desktop
|
||||||
|
|
||||||
|
uninstall-local:
|
||||||
|
-rm -f $(DESTDIR)$(kde_servicesdir)/iso.protocol
|
||||||
|
-rm -f $(DESTDIR)$(kde_datadir)/konqueror/servicemenus/isoservice.desktop
|
||||||
|
-rm -f $(DESTDIR)$(kde_confdir)/kio_isorc
|
||||||
|
-rm -f $(DESTDIR)$(kde_appsdir)/kio_iso.desktop
|
||||||
|
|
||||||
|
# These paths are KDE specific. Use them:
|
||||||
|
# kde_appsdir Where your application's menu entry (.desktop) should go to.
|
||||||
|
# kde_icondir Where your icon should go to - better use KDE_ICON.
|
||||||
|
# kde_sounddir Where your sounds should go to.
|
||||||
|
# kde_htmldir Where your docs should go to. (contains lang subdirs)
|
||||||
|
# kde_datadir Where you install application data. (Use a subdir)
|
||||||
|
# kde_locale Where translation files should go to. (contains lang subdirs)
|
||||||
|
# kde_cgidir Where cgi-bin executables should go to.
|
||||||
|
# kde_confdir Where config files should go to (system-wide ones with default values).
|
||||||
|
# kde_mimedir Where mimetypes .desktop files should go to.
|
||||||
|
# kde_servicesdir Where services .desktop files should go to.
|
||||||
|
# kde_servicetypesdir Where servicetypes .desktop files should go to.
|
||||||
|
# kde_toolbardir Where general toolbar icons should go to (deprecated, use KDE_ICON).
|
||||||
|
# kde_wallpaperdir Where general wallpapers should go to.
|
||||||
|
# kde_templatesdir Where templates for the "New" menu (Konqueror/KDesktop) should go to.
|
||||||
|
# kde_bindir Where executables should go to. Use bin_PROGRAMS or bin_SCRIPTS.
|
||||||
|
# kde_libdir Where shared libraries should go to. Use lib_LTLIBRARIES.
|
||||||
|
# kde_moduledir Where modules (e.g. parts) should go to. Use kde_module_LTLIBRARIES.
|
||||||
|
# kde_styledir Where Qt/KDE widget styles should go to (new in KDE 3).
|
||||||
|
# kde_designerdir Where Qt Designer plugins should go to (new in KDE 3).
|
||||||
|
|
||||||
|
|
||||||
|
# make messages.po. Move this one to ../po/ and "make merge" in po
|
||||||
|
# the -x is for skipping messages already translated in kdelibs
|
||||||
|
messages:
|
||||||
|
LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
|
||||||
|
if test -n "$$LIST"; then \
|
||||||
|
$(XGETTEXT) -C -ki18n -x $(kde_includes)/kde.pot $$LIST -o ../po/iso.pot; \
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,51 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
iso.h
|
||||||
|
-------------------
|
||||||
|
begin : Oct 25 2002
|
||||||
|
copyright : (C) 2002 by Szombathelyi György
|
||||||
|
email : gyurco@users.sourceforge.net
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/* This file is heavily based on tar.h from kdebase
|
||||||
|
* (c) David Faure <faure@kde.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ISO_H
|
||||||
|
#define _ISO_H
|
||||||
|
|
||||||
|
#include <kio/slavebase.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include "kisofile.h"
|
||||||
|
|
||||||
|
class KIso;
|
||||||
|
|
||||||
|
class kio_isoProtocol : public KIO::SlaveBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
kio_isoProtocol( const QCString &pool, const QCString &app );
|
||||||
|
virtual ~kio_isoProtocol();
|
||||||
|
|
||||||
|
virtual void listDir( const KURL & url );
|
||||||
|
virtual void stat( const KURL & url );
|
||||||
|
virtual void get( const KURL & url );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void getFile( const KIsoFile *isoFileEntry, const QString &path );
|
||||||
|
void createUDSEntry( const KArchiveEntry * isoEntry, KIO::UDSEntry & entry );
|
||||||
|
bool checkNewFile( QString fullPath, QString & path, int startsec );
|
||||||
|
|
||||||
|
KIso * m_isoFile;
|
||||||
|
time_t m_mtime;
|
||||||
|
int m_mode;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,11 @@
|
|||||||
|
[Protocol]
|
||||||
|
exec=kio_iso
|
||||||
|
protocol=iso
|
||||||
|
listing=Name,Type,Size,Date,AccessDate,CreationDate,Access,Owner,Group,Link
|
||||||
|
input=filesystem
|
||||||
|
output=filesystem
|
||||||
|
reading=true
|
||||||
|
source=true
|
||||||
|
Icon=cd
|
||||||
|
Description=A kioslave for ISO9660 filesystems
|
||||||
|
MimeType=application/x-iso
|
@ -0,0 +1,14 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Encoding=UTF-8
|
||||||
|
Actions=OpenISO
|
||||||
|
ServiceTypes=inode/blockdevice,application/x-iso
|
||||||
|
|
||||||
|
[Desktop Action OpenISO]
|
||||||
|
Comment=ISO9660 View
|
||||||
|
Comment[hu]=ISO9660 Nézet
|
||||||
|
Comment[fr]=Lecteur ISO9660
|
||||||
|
Icon=cd
|
||||||
|
Name=ISO9660 View
|
||||||
|
Name[hu]=ISO9660 Nézet
|
||||||
|
Name[fr]=Lecteur ISO9660
|
||||||
|
Exec=kfmclient exec iso:%f
|
@ -0,0 +1,13 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Exec=konqueror iso:%f
|
||||||
|
Icon=cd
|
||||||
|
Terminal=false
|
||||||
|
MimeType=application/x-iso;
|
||||||
|
InitialPreference=10
|
||||||
|
NoDisplay=true
|
||||||
|
Name=ISO9660 Image Viewer
|
||||||
|
Name[hu]=ISO9660 Nézet
|
||||||
|
Name[fr]=Lecteur ISO9660
|
||||||
|
X-DCOP-ServiceType=None
|
||||||
|
Categories=Qt;KDE;System;
|
@ -0,0 +1,2 @@
|
|||||||
|
showhidden=false
|
||||||
|
showrr=true
|
@ -0,0 +1,31 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kisodirectory.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Wed Oct 30 2002
|
||||||
|
copyright : (C) 2002 by Szombathelyi György
|
||||||
|
email : gyurco@users.sourceforge.net
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "kisodirectory.h"
|
||||||
|
|
||||||
|
KIsoDirectory::KIsoDirectory( KArchive* archive, const QString& name, int access,
|
||||||
|
int date, int adate, int cdate, const QString& user, const QString& group,
|
||||||
|
const QString& symlink) :
|
||||||
|
KArchiveDirectory(archive, name, access, date, user, group, symlink) {
|
||||||
|
|
||||||
|
|
||||||
|
m_adate=adate;
|
||||||
|
m_cdate=cdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
KIsoDirectory::~KIsoDirectory(){
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kisodirectory.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Wed Oct 30 2002
|
||||||
|
copyright : (C) 2002 by Szombathelyi György
|
||||||
|
email : gyurco@users.sourceforge.net
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KISODIRECTORY_H
|
||||||
|
#define KISODIRECTORY_H
|
||||||
|
|
||||||
|
#include <qstring.h>
|
||||||
|
#include <karchive.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@author Szombathelyi György
|
||||||
|
*/
|
||||||
|
|
||||||
|
class KIsoDirectory : public KArchiveDirectory {
|
||||||
|
public:
|
||||||
|
KIsoDirectory( KArchive* archive, const QString& name, int access, int date,
|
||||||
|
int adate,int cdate, const QString& user, const QString& group,
|
||||||
|
const QString& symlink);
|
||||||
|
~KIsoDirectory();
|
||||||
|
int adate() const { return m_adate; }
|
||||||
|
int cdate() const { return m_cdate; }
|
||||||
|
private:
|
||||||
|
int m_adate, m_cdate;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,6 @@
|
|||||||
|
0.1 -> 0.2
|
||||||
|
|
||||||
|
- Critical directory parsing bug fixed
|
||||||
|
- Call backs only if some sanity checks on the directory entry succeeds
|
||||||
|
(length checks to avoid buffer overrun if received corrupt data)
|
||||||
|
- Preliminary El Torito boot specification support (No multiple boot entries yet)
|
@ -0,0 +1,18 @@
|
|||||||
|
noinst_LTLIBRARIES = libisofs.la
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDES = $(all_includes)
|
||||||
|
|
||||||
|
|
||||||
|
#LDFLAGS =
|
||||||
|
|
||||||
|
libisofs_la_METASOURCES=AUTO
|
||||||
|
|
||||||
|
libisofs_la_SOURCES = isofs.c
|
||||||
|
#libisofs_la_LIBADD = $(LIB_KIO)
|
||||||
|
|
||||||
|
#libisofs_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
noinst_HEADERS = bswap.h el_torito.h iso_fs.h isofs.h rock.h
|
@ -0,0 +1,24 @@
|
|||||||
|
This is the 0.2 release of libisofs. For changes, see the ChangeLog.
|
||||||
|
|
||||||
|
Libisofs implements the reading of the famous ISO-9660 (ECMA-119) file system,
|
||||||
|
found on CD-ROM media. It also supports the Rock Ridge Interchange Protocol and
|
||||||
|
Microsoft Joliet extensions. It allows user-mode programs to query the
|
||||||
|
filesystem volume descriptors and traverse through the directory structure.
|
||||||
|
Preliminary support for El-Torito boot CDs are added in version 0.2.
|
||||||
|
|
||||||
|
To use it in your project, I recommend to copy bswap.h, isofs.h, iso_fs.h,
|
||||||
|
el_torito.h rock.h and isofs.c to your sources, and include isofs.h in the
|
||||||
|
appropriate places.
|
||||||
|
|
||||||
|
Currently only the directory tables are parsed, the path tables are not.
|
||||||
|
(The path tables contain redundant information.)
|
||||||
|
|
||||||
|
Also a sample program can be compiled with the supplied Makefile. Simply
|
||||||
|
execute 'make', it should create the executable file isofs.
|
||||||
|
|
||||||
|
On big-endian systems, you need to define WORDS_BIGENDIAN (either in the
|
||||||
|
compiler command-line, or if you defined HAVE_CONFIG_H, in config.h)
|
||||||
|
|
||||||
|
|
||||||
|
György Szombathelyi <gyurco@users.sourceforge.net>
|
||||||
|
http://libcdrom.sourceforge.net/libisofs.html
|
@ -0,0 +1,94 @@
|
|||||||
|
/* From the mplayer project (www.mplayerhq.hu) */
|
||||||
|
|
||||||
|
#ifndef __BSWAP_H__
|
||||||
|
#define __BSWAP_H__
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_BYTESWAP_H
|
||||||
|
#include <byteswap.h>
|
||||||
|
#else
|
||||||
|
|
||||||
|
#ifdef ARCH_X86
|
||||||
|
inline static unsigned short ByteSwap16(unsigned short x)
|
||||||
|
{
|
||||||
|
__asm("xchgb %b0,%h0" :
|
||||||
|
"=q" (x) :
|
||||||
|
"0" (x));
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
#define bswap_16(x) ByteSwap16(x)
|
||||||
|
|
||||||
|
inline static unsigned int ByteSwap32(unsigned int x)
|
||||||
|
{
|
||||||
|
#if __CPU__ > 386
|
||||||
|
__asm("bswap %0":
|
||||||
|
"=r" (x) :
|
||||||
|
#else
|
||||||
|
__asm("xchgb %b0,%h0\n"
|
||||||
|
" rorl $16,%0\n"
|
||||||
|
" xchgb %b0,%h0":
|
||||||
|
"=q" (x) :
|
||||||
|
#endif
|
||||||
|
"0" (x));
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
#define bswap_32(x) ByteSwap32(x)
|
||||||
|
|
||||||
|
inline static unsigned long long int ByteSwap64(unsigned long long int x)
|
||||||
|
{
|
||||||
|
register union { __extension__ unsigned long long int __ll;
|
||||||
|
unsigned int __l[2]; } __x;
|
||||||
|
asm("xchgl %0,%1":
|
||||||
|
"=r"(__x.__l[0]),"=r"(__x.__l[1]):
|
||||||
|
"0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32))));
|
||||||
|
return __x.__ll;
|
||||||
|
}
|
||||||
|
#define bswap_64(x) ByteSwap64(x)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8)
|
||||||
|
|
||||||
|
|
||||||
|
/* code from bits/byteswap.h (C) 1997, 1998 Free Software Foundation, Inc. */
|
||||||
|
#define bswap_32(x) \
|
||||||
|
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
|
||||||
|
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
|
||||||
|
|
||||||
|
#define bswap_64(x) \
|
||||||
|
(__extension__ \
|
||||||
|
({ union { __extension__ unsigned long long int __ll; \
|
||||||
|
unsigned int __l[2]; } __w, __r; \
|
||||||
|
__w.__ll = (x); \
|
||||||
|
__r.__l[0] = bswap_32 (__w.__l[1]); \
|
||||||
|
__r.__l[1] = bswap_32 (__w.__l[0]); \
|
||||||
|
__r.__ll; }))
|
||||||
|
#endif /* !ARCH_X86 */
|
||||||
|
|
||||||
|
#endif /* !HAVE_BYTESWAP_H */
|
||||||
|
|
||||||
|
/*
|
||||||
|
be2me ... BigEndian to MachineEndian
|
||||||
|
le2me ... LittleEndian to MachineEndian
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
#define be2me_16(x) (x)
|
||||||
|
#define be2me_32(x) (x)
|
||||||
|
#define be2me_64(x) (x)
|
||||||
|
#define le2me_16(x) bswap_16(x)
|
||||||
|
#define le2me_32(x) bswap_32(x)
|
||||||
|
#define le2me_64(x) bswap_64(x)
|
||||||
|
#else
|
||||||
|
#define be2me_16(x) bswap_16(x)
|
||||||
|
#define be2me_32(x) bswap_32(x)
|
||||||
|
#define be2me_64(x) bswap_64(x)
|
||||||
|
#define le2me_16(x) (x)
|
||||||
|
#define le2me_32(x) (x)
|
||||||
|
#define le2me_64(x) (x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,63 @@
|
|||||||
|
#ifndef ELTORITO_H
|
||||||
|
#define ELTORITO_H 1
|
||||||
|
|
||||||
|
#include "iso_fs.h"
|
||||||
|
|
||||||
|
#define EL_TORITO_ID "EL TORITO SPECIFICATION\0\0\0\0\0\0\0\0\0"
|
||||||
|
|
||||||
|
struct el_torito_boot_descriptor {
|
||||||
|
char type [ISODCL ( 1, 1)]; /* 711 */
|
||||||
|
char id [ISODCL ( 2, 6)];
|
||||||
|
char version [ISODCL ( 7, 7)]; /* 711 */
|
||||||
|
char system_id [ISODCL ( 8, 39)]; /* achars */
|
||||||
|
char unused [ISODCL ( 40, 71)];
|
||||||
|
char boot_catalog [ISODCL ( 72, 75)]; /* 731 */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct validation_entry {
|
||||||
|
char type [ISODCL ( 1, 1)]; /* 1 */
|
||||||
|
char platform [ISODCL ( 2, 2)];
|
||||||
|
char unused [ISODCL ( 3, 4)];
|
||||||
|
char id [ISODCL ( 5, 28)];
|
||||||
|
char cheksum [ISODCL ( 29, 30)];
|
||||||
|
char key [ISODCL ( 31, 31)]; /* 0x55 */
|
||||||
|
char key2 [ISODCL ( 32, 32)]; /* 0xaa */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct default_entry {
|
||||||
|
char bootid [ISODCL ( 1, 1)];
|
||||||
|
char media [ISODCL ( 2, 2)];
|
||||||
|
char loadseg [ISODCL ( 3, 4)];
|
||||||
|
char systype [ISODCL ( 5, 5)];
|
||||||
|
char unused [ISODCL ( 6, 6)];
|
||||||
|
char seccount [ISODCL ( 7, 8)];
|
||||||
|
char start [ISODCL ( 9, 12)];
|
||||||
|
char unused2 [ISODCL ( 13, 32)];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct section_header {
|
||||||
|
char headerid [ISODCL ( 1, 1)];
|
||||||
|
char platform [ISODCL ( 2, 2)];
|
||||||
|
char entries [ISODCL ( 3, 4)];
|
||||||
|
char id [ISODCL ( 5, 32)];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct section_entry {
|
||||||
|
char bootid [ISODCL ( 1, 1)];
|
||||||
|
char media [ISODCL ( 2, 2)];
|
||||||
|
char loadseg [ISODCL ( 3, 4)];
|
||||||
|
char systype [ISODCL ( 5, 5)];
|
||||||
|
char unused [ISODCL ( 6, 6)];
|
||||||
|
char seccount [ISODCL ( 7, 8)];
|
||||||
|
char start [ISODCL ( 9, 12)];
|
||||||
|
char selcrit [ISODCL ( 13, 13)];
|
||||||
|
char vendor_selcrit [ISODCL ( 14, 32)];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct section_entry_ext {
|
||||||
|
char extid [ISODCL ( 1, 1)];
|
||||||
|
char extrec [ISODCL ( 2, 2)];
|
||||||
|
char vendor_selcrit [ISODCL ( 3, 32)];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,219 @@
|
|||||||
|
/* From the linux kernel */
|
||||||
|
|
||||||
|
#ifndef _ISO_FS_H
|
||||||
|
#define _ISO_FS_H 1
|
||||||
|
|
||||||
|
#include "bswap.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The isofs filesystem constants/structures
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* This part borrowed from the bsd386 isofs */
|
||||||
|
#define ISODCL(from, to) (to - from + 1)
|
||||||
|
|
||||||
|
struct iso_volume_descriptor {
|
||||||
|
char type[ISODCL(1,1)]; /* 711 */
|
||||||
|
char id[ISODCL(2,6)];
|
||||||
|
char version[ISODCL(7,7)];
|
||||||
|
char data[ISODCL(8,2048)];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* volume descriptor types */
|
||||||
|
#define ISO_VD_BOOT 0
|
||||||
|
#define ISO_VD_PRIMARY 1
|
||||||
|
#define ISO_VD_SUPPLEMENTARY 2
|
||||||
|
#define ISO_VD_END 255
|
||||||
|
|
||||||
|
#define ISO_STANDARD_ID "CD001"
|
||||||
|
|
||||||
|
struct iso_primary_descriptor {
|
||||||
|
char type [ISODCL ( 1, 1)]; /* 711 */
|
||||||
|
char id [ISODCL ( 2, 6)];
|
||||||
|
char version [ISODCL ( 7, 7)]; /* 711 */
|
||||||
|
char unused1 [ISODCL ( 8, 8)];
|
||||||
|
char system_id [ISODCL ( 9, 40)]; /* achars */
|
||||||
|
char volume_id [ISODCL ( 41, 72)]; /* dchars */
|
||||||
|
char unused2 [ISODCL ( 73, 80)];
|
||||||
|
char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
|
||||||
|
char unused3 [ISODCL ( 89, 120)];
|
||||||
|
char volume_set_size [ISODCL (121, 124)]; /* 723 */
|
||||||
|
char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
|
||||||
|
char logical_block_size [ISODCL (129, 132)]; /* 723 */
|
||||||
|
char path_table_size [ISODCL (133, 140)]; /* 733 */
|
||||||
|
char type_l_path_table [ISODCL (141, 144)]; /* 731 */
|
||||||
|
char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
|
||||||
|
char type_m_path_table [ISODCL (149, 152)]; /* 732 */
|
||||||
|
char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
|
||||||
|
char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
|
||||||
|
char volume_set_id [ISODCL (191, 318)]; /* dchars */
|
||||||
|
char publisher_id [ISODCL (319, 446)]; /* achars */
|
||||||
|
char preparer_id [ISODCL (447, 574)]; /* achars */
|
||||||
|
char application_id [ISODCL (575, 702)]; /* achars */
|
||||||
|
char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
|
||||||
|
char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
|
||||||
|
char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
|
||||||
|
char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
|
||||||
|
char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
|
||||||
|
char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
|
||||||
|
char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
|
||||||
|
char file_structure_version [ISODCL (882, 882)]; /* 711 */
|
||||||
|
char unused4 [ISODCL (883, 883)];
|
||||||
|
char application_data [ISODCL (884, 1395)];
|
||||||
|
char unused5 [ISODCL (1396, 2048)];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Almost the same as the primary descriptor but two fields are specified */
|
||||||
|
struct iso_supplementary_descriptor {
|
||||||
|
char type [ISODCL ( 1, 1)]; /* 711 */
|
||||||
|
char id [ISODCL ( 2, 6)];
|
||||||
|
char version [ISODCL ( 7, 7)]; /* 711 */
|
||||||
|
char flags [ISODCL ( 8, 8)]; /* 853 */
|
||||||
|
char system_id [ISODCL ( 9, 40)]; /* achars */
|
||||||
|
char volume_id [ISODCL ( 41, 72)]; /* dchars */
|
||||||
|
char unused2 [ISODCL ( 73, 80)];
|
||||||
|
char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
|
||||||
|
char escape [ISODCL ( 89, 120)]; /* 856 */
|
||||||
|
char volume_set_size [ISODCL (121, 124)]; /* 723 */
|
||||||
|
char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
|
||||||
|
char logical_block_size [ISODCL (129, 132)]; /* 723 */
|
||||||
|
char path_table_size [ISODCL (133, 140)]; /* 733 */
|
||||||
|
char type_l_path_table [ISODCL (141, 144)]; /* 731 */
|
||||||
|
char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
|
||||||
|
char type_m_path_table [ISODCL (149, 152)]; /* 732 */
|
||||||
|
char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
|
||||||
|
char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
|
||||||
|
char volume_set_id [ISODCL (191, 318)]; /* dchars */
|
||||||
|
char publisher_id [ISODCL (319, 446)]; /* achars */
|
||||||
|
char preparer_id [ISODCL (447, 574)]; /* achars */
|
||||||
|
char application_id [ISODCL (575, 702)]; /* achars */
|
||||||
|
char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
|
||||||
|
char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
|
||||||
|
char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
|
||||||
|
char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
|
||||||
|
char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
|
||||||
|
char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
|
||||||
|
char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
|
||||||
|
char file_structure_version [ISODCL (882, 882)]; /* 711 */
|
||||||
|
char unused4 [ISODCL (883, 883)];
|
||||||
|
char application_data [ISODCL (884, 1395)];
|
||||||
|
char unused5 [ISODCL (1396, 2048)];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define HS_STANDARD_ID "CDROM"
|
||||||
|
|
||||||
|
struct hs_volume_descriptor {
|
||||||
|
char foo [ISODCL ( 1, 8)]; /* 733 */
|
||||||
|
char type [ISODCL ( 9, 9)]; /* 711 */
|
||||||
|
char id [ISODCL ( 10, 14)];
|
||||||
|
char version [ISODCL ( 15, 15)]; /* 711 */
|
||||||
|
char data[ISODCL(16,2048)];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct hs_primary_descriptor {
|
||||||
|
char foo [ISODCL ( 1, 8)]; /* 733 */
|
||||||
|
char type [ISODCL ( 9, 9)]; /* 711 */
|
||||||
|
char id [ISODCL ( 10, 14)];
|
||||||
|
char version [ISODCL ( 15, 15)]; /* 711 */
|
||||||
|
char unused1 [ISODCL ( 16, 16)]; /* 711 */
|
||||||
|
char system_id [ISODCL ( 17, 48)]; /* achars */
|
||||||
|
char volume_id [ISODCL ( 49, 80)]; /* dchars */
|
||||||
|
char unused2 [ISODCL ( 81, 88)]; /* 733 */
|
||||||
|
char volume_space_size [ISODCL ( 89, 96)]; /* 733 */
|
||||||
|
char unused3 [ISODCL ( 97, 128)]; /* 733 */
|
||||||
|
char volume_set_size [ISODCL (129, 132)]; /* 723 */
|
||||||
|
char volume_sequence_number [ISODCL (133, 136)]; /* 723 */
|
||||||
|
char logical_block_size [ISODCL (137, 140)]; /* 723 */
|
||||||
|
char path_table_size [ISODCL (141, 148)]; /* 733 */
|
||||||
|
char type_l_path_table [ISODCL (149, 152)]; /* 731 */
|
||||||
|
char unused4 [ISODCL (153, 180)]; /* 733 */
|
||||||
|
char root_directory_record [ISODCL (181, 214)]; /* 9.1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* We use this to help us look up the parent inode numbers. */
|
||||||
|
|
||||||
|
struct iso_path_table{
|
||||||
|
char name_len[1]; /* 711 */
|
||||||
|
char ext_attr_length[1]; /* 711 */
|
||||||
|
char extent[4]; /* 731 */
|
||||||
|
char parent[2]; /* 721 */
|
||||||
|
char name[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* high sierra is identical to iso, except that the date is only 6 bytes, and
|
||||||
|
there is an extra reserved byte after the flags */
|
||||||
|
|
||||||
|
struct iso_directory_record {
|
||||||
|
char length [ISODCL (1, 1)]; /* 711 */
|
||||||
|
char ext_attr_length [ISODCL (2, 2)]; /* 711 */
|
||||||
|
char extent [ISODCL (3, 10)]; /* 733 */
|
||||||
|
char size [ISODCL (11, 18)]; /* 733 */
|
||||||
|
char date [ISODCL (19, 25)]; /* 7 by 711 */
|
||||||
|
char flags [ISODCL (26, 26)];
|
||||||
|
char file_unit_size [ISODCL (27, 27)]; /* 711 */
|
||||||
|
char interleave [ISODCL (28, 28)]; /* 711 */
|
||||||
|
char volume_sequence_number [ISODCL (29, 32)]; /* 723 */
|
||||||
|
char name_len [ISODCL (33, 33)]; /* 711 */
|
||||||
|
char name [1];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 8 bit numbers */
|
||||||
|
__inline unsigned char isonum_711(char *p);
|
||||||
|
__inline char isonum_712(char *p);
|
||||||
|
|
||||||
|
/* 16 bit numbers */
|
||||||
|
__inline unsigned short isonum_721(char *p);
|
||||||
|
__inline unsigned short isonum_722(char *p);
|
||||||
|
__inline unsigned short isonum_723(char *p);
|
||||||
|
|
||||||
|
/* 32 bit numbers */
|
||||||
|
__inline unsigned int isonum_731(char *p);
|
||||||
|
__inline unsigned int isonum_732(char *p);
|
||||||
|
__inline unsigned int isonum_733(char *p);
|
||||||
|
|
||||||
|
|
||||||
|
/* 8 bit numbers */
|
||||||
|
__inline unsigned char isonum_711(char *p)
|
||||||
|
{
|
||||||
|
return *(unsigned char *)p;
|
||||||
|
}
|
||||||
|
__inline char isonum_712(char *p)
|
||||||
|
{
|
||||||
|
return *p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 16 bit numbers */
|
||||||
|
__inline unsigned short isonum_721(char *p)
|
||||||
|
{
|
||||||
|
return le2me_16(*(unsigned short *)p);
|
||||||
|
}
|
||||||
|
__inline unsigned short isonum_722(char *p)
|
||||||
|
{
|
||||||
|
return be2me_16(*(unsigned short *)p);
|
||||||
|
}
|
||||||
|
__inline unsigned short isonum_723(char *p)
|
||||||
|
{
|
||||||
|
/* Ignore bigendian datum due to broken mastering programs */
|
||||||
|
return le2me_16(*(unsigned short *)p);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 32 bit numbers */
|
||||||
|
__inline unsigned int isonum_731(char *p)
|
||||||
|
{
|
||||||
|
return le2me_32(*(unsigned int *)p);
|
||||||
|
}
|
||||||
|
|
||||||
|
__inline unsigned int isonum_732(char *p)
|
||||||
|
{
|
||||||
|
return be2me_32(*(unsigned int *)p);
|
||||||
|
}
|
||||||
|
|
||||||
|
__inline unsigned int isonum_733(char *p)
|
||||||
|
{
|
||||||
|
/* Ignore bigendian datum due to broken mastering programs */
|
||||||
|
return le2me_32(*(unsigned int *)p);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /*_ISOFS_H*/
|
||||||
|
|
@ -0,0 +1,127 @@
|
|||||||
|
/* this header is from the linux kernel */
|
||||||
|
|
||||||
|
#ifndef ROCK_H
|
||||||
|
#define ROCK_H 1
|
||||||
|
|
||||||
|
/* These structs are used by the system-use-sharing protocol, in which the
|
||||||
|
Rock Ridge extensions are embedded. It is quite possible that other
|
||||||
|
extensions are present on the disk, and this is fine as long as they
|
||||||
|
all use SUSP */
|
||||||
|
|
||||||
|
struct SU_SP{
|
||||||
|
unsigned char magic[2];
|
||||||
|
unsigned char skip;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SU_CE{
|
||||||
|
char extent[8];
|
||||||
|
char offset[8];
|
||||||
|
char size[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SU_ER{
|
||||||
|
unsigned char len_id;
|
||||||
|
unsigned char len_des;
|
||||||
|
unsigned char len_src;
|
||||||
|
unsigned char ext_ver;
|
||||||
|
char data[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_RR{
|
||||||
|
char flags[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_PX{
|
||||||
|
char mode[8];
|
||||||
|
char n_links[8];
|
||||||
|
char uid[8];
|
||||||
|
char gid[8];
|
||||||
|
char serno[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_PN{
|
||||||
|
char dev_high[8];
|
||||||
|
char dev_low[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct SL_component{
|
||||||
|
unsigned char flags;
|
||||||
|
unsigned char len;
|
||||||
|
char text[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_SL{
|
||||||
|
unsigned char flags;
|
||||||
|
struct SL_component link;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_NM{
|
||||||
|
unsigned char flags;
|
||||||
|
char name[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_CL{
|
||||||
|
char location[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_PL{
|
||||||
|
char location[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct stamp{
|
||||||
|
char time[7];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RR_TF{
|
||||||
|
char flags;
|
||||||
|
struct stamp times[1]; /* Variable number of these beasts */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Linux-specific extension for transparent decompression */
|
||||||
|
struct RR_ZF{
|
||||||
|
char algorithm[2];
|
||||||
|
char parms[2];
|
||||||
|
char real_size[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
/* These are the bits and their meanings for flags in the TF structure. */
|
||||||
|
#define TF_CREATE 1
|
||||||
|
#define TF_MODIFY 2
|
||||||
|
#define TF_ACCESS 4
|
||||||
|
#define TF_ATTRIBUTES 8
|
||||||
|
#define TF_BACKUP 16
|
||||||
|
#define TF_EXPIRATION 32
|
||||||
|
#define TF_EFFECTIVE 64
|
||||||
|
#define TF_LONG_FORM 128
|
||||||
|
|
||||||
|
struct rock_ridge{
|
||||||
|
char signature[2];
|
||||||
|
char len; /* 711 */
|
||||||
|
char version; /* 711 */
|
||||||
|
union{
|
||||||
|
struct SU_SP SP;
|
||||||
|
struct SU_CE CE;
|
||||||
|
struct SU_ER ER;
|
||||||
|
struct RR_RR RR;
|
||||||
|
struct RR_PX PX;
|
||||||
|
struct RR_PN PN;
|
||||||
|
struct RR_SL SL;
|
||||||
|
struct RR_NM NM;
|
||||||
|
struct RR_CL CL;
|
||||||
|
struct RR_PL PL;
|
||||||
|
struct RR_TF TF;
|
||||||
|
struct RR_ZF ZF;
|
||||||
|
} u;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define RR_PX 1 /* POSIX attributes */
|
||||||
|
#define RR_PN 2 /* POSIX devices */
|
||||||
|
#define RR_SL 4 /* Symbolic link */
|
||||||
|
#define RR_NM 8 /* Alternate Name */
|
||||||
|
#define RR_CL 16 /* Child link */
|
||||||
|
#define RR_PL 32 /* Parent link */
|
||||||
|
#define RR_RE 64 /* Relocation directory */
|
||||||
|
#define RR_TF 128 /* Timestamps */
|
||||||
|
|
||||||
|
#endif /* ROCK_H */
|
@ -0,0 +1,40 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
qfilehack.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Tue Oct 29 2002
|
||||||
|
copyright : (C) 2002 by Szombathelyi György
|
||||||
|
email : gyurco@users.sourceforge.net
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "qfilehack.h"
|
||||||
|
|
||||||
|
QFileHack::QFileHack(){
|
||||||
|
}
|
||||||
|
|
||||||
|
QFileHack::QFileHack( const QString & name ) : QFile(name) {
|
||||||
|
}
|
||||||
|
|
||||||
|
QFileHack::~QFileHack(){
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QFileHack::open ( int m ) {
|
||||||
|
bool ret;
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
m |= IO_Async; //On linux, set O_NONBLOCK, opens CD-ROMs faster
|
||||||
|
#endif
|
||||||
|
ret=QFile::open(m);
|
||||||
|
if (ret && isSequentialAccess() ) {
|
||||||
|
setType(IO_Direct);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
qfilehack.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Tue Oct 29 2002
|
||||||
|
copyright : (C) 2002 by Szombathelyi György
|
||||||
|
email : gyurco@users.sourceforge.net
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QFILEHACK_H
|
||||||
|
#define QFILEHACK_H
|
||||||
|
|
||||||
|
#include <qfile.h>
|
||||||
|
#include <qstring.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@author Szombathelyi György
|
||||||
|
* Qt thinks if a file is not S_IFREG, you cannot seek in it. It's false (what about
|
||||||
|
* block devices for example?
|
||||||
|
*/
|
||||||
|
|
||||||
|
class QFileHack : public QFile {
|
||||||
|
public:
|
||||||
|
QFileHack();
|
||||||
|
QFileHack( const QString & name );
|
||||||
|
~QFileHack();
|
||||||
|
virtual bool open ( int m );
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in new issue