2
* Copyright (C) 2006 Giuseppe Torelli - <colossus73@gmail.com>
3
* Salvatore Santagati <salvatore.santagati@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
20
#ifndef __XARCHIVER_ISO_H__
21
#define __XARCHIVER_ISO_H__
26
#include "interface.h"
27
#include "callbacks.h"
31
/* volume descriptor types */
32
#define ISO_VD_PRIMARY 1
33
#define ISO_VD_SUPPLEMENTARY 2 /* Used by Joliet */
34
#define ISO_VD_END 255
36
GtkWidget *iso_properties_window;
38
GtkWidget *name_label;
39
GtkWidget *size_label;
40
GtkWidget *image_type_label;
41
GtkWidget *system_id_label;
42
GtkWidget *volume_id_label;
43
GtkWidget *application_label;
44
GtkWidget *publisher_label;
45
GtkWidget *preparer_label;
46
GtkWidget *volume_set_label;
47
GtkWidget *bibliographic_label;
48
GtkWidget *copyright_label;
49
GtkWidget *abstract_label;
50
GtkWidget *creation_date_label;
51
GtkWidget *modified_date_label;
52
GtkWidget *expiration_date_label;
53
GtkWidget *effective_date_label;
54
GtkWidget *filename_entry;
55
GtkWidget *size_entry;
56
GtkWidget *image_type_entry;
57
GtkWidget *system_id_entry;
58
GtkWidget *volume_id_entry;
59
GtkWidget *application_entry;
60
GtkWidget *publisher_entry;
61
GtkWidget *preparer_entry;
62
GtkWidget *volume_set_entry;
63
GtkWidget *bibliographic_entry;
64
GtkWidget *copyright_entry;
65
GtkWidget *abstract_entry;
66
GtkWidget *creation_date_entry;
67
GtkWidget *modified_date_entry;
68
GtkWidget *expiration_date_entry;
69
GtkWidget *effective_date_entry;
80
#define ISODCL(from, to) (to - from + 1)
82
struct iso_primary_descriptor {
83
char type [ISODCL ( 1, 1)]; /* 711 */
84
char id [ISODCL ( 2, 6)];
85
char version [ISODCL ( 7, 7)]; /* 711 */
86
char unused1 [ISODCL ( 8, 8)];
87
char system_id [ISODCL ( 9, 40)]; /* achars */
88
char volume_id [ISODCL ( 41, 72)]; /* dchars */
89
char unused2 [ISODCL ( 73, 80)];
90
char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
91
char escape_sequences [ISODCL ( 89, 120)];
92
char volume_set_size [ISODCL (121, 124)]; /* 723 */
93
char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
94
char logical_block_size [ISODCL (129, 132)]; /* 723 */
95
char path_table_size [ISODCL (133, 140)]; /* 733 */
96
char type_l_path_table [ISODCL (141, 144)]; /* 731 */
97
char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
98
char type_m_path_table [ISODCL (149, 152)]; /* 732 */
99
char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
100
char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
101
char volume_set_id [ISODCL (191, 318)]; /* dchars */
102
char publisher_id [ISODCL (319, 446)]; /* achars */
103
char preparer_id [ISODCL (447, 574)]; /* achars */
104
char application_id [ISODCL (575, 702)]; /* achars */
105
char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
106
char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
107
char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
108
char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
109
char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
110
char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
111
char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
112
char file_structure_version [ISODCL (882, 882)]; /* 711 */
113
char unused4 [ISODCL (883, 883)];
114
char application_data [ISODCL (884, 1395)];
115
char unused5 [ISODCL (1396, 2048)];
118
struct iso_directory_record {
119
unsigned char length [ISODCL (1, 1)]; /* 711 */
120
unsigned char ext_attr_length [ISODCL (2, 2)]; /* 711 */
121
unsigned char extent [ISODCL (3, 10)]; /* 733 */
122
unsigned char size [ISODCL (11, 18)]; /* 733 */
123
unsigned char date [ISODCL (19, 25)]; /* 7 by 711 */
124
unsigned char flags [ISODCL (26, 26)];
125
unsigned char file_unit_size [ISODCL (27, 27)]; /* 711 */
126
unsigned char interleave [ISODCL (28, 28)]; /* 711 */
127
unsigned char volume_sequence_number [ISODCL (29, 32)]; /* 723 */
128
unsigned char name_len [ISODCL (33, 33)]; /* 711 */
129
unsigned char name [1];
133
* Extended Attributes record according to Yellow Book.
135
struct iso_xa_dir_record
137
char group_id [ISODCL(1, 2)];
138
char user_id [ISODCL(3, 4)];
139
char attributes [ISODCL(5, 6)];
140
char signature [ISODCL(7, 8)];
141
char file_number [ISODCL(9, 9)];
142
char reserved [ISODCL(10, 14)];
146
struct iso_primary_descriptor ipd;
149
int iso_733 ( unsigned char *p);
150
int iso_723 ( unsigned char *p);
151
int iso_731 ( unsigned char *p);
152
int DetectImage (FILE *iso);
153
void OpenISO ( XArchive *archive );
154
void parse_dir (gchar *dir_name , int extent, int len, XArchive *archive);
155
void dump_stat(gchar *dir_name , int extent, XArchive *archive);
156
gboolean xa_extract_single_iso_file (XArchive *archive, gchar *permission, gchar *destination_path, gchar *_filename , unsigned long long int file_size, unsigned long long file_offset );
157
gboolean xa_extract_iso_file (XArchive *archive, gchar *permission, gchar *destination_path, gchar *_filename , unsigned long long int file_size, unsigned long long file_offset );
158
gboolean xa_write_file_to_disk (gchar *source,gchar *dest,unsigned long long int file_size, unsigned long long file_offset );
159
int xa_create_directory_with_parents (const gchar * pathname, int mode);
160
GtkWidget *create_iso_properties_window ();
161
#endif /* __XARCHIVER_ISO_H__ */