libisoburn  1.5.4
About: libisoburn is a frontend for the libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all media and file types supported by libburn. It implements the API and command interpreter of program xorriso, and installs this program as small dynamically linked binary. xorriso is suitable for incremental data backup and for production of bootable ISO 9660 images. A statically linked version is available as GNU xorriso.
  Fossies Dox: libisoburn-1.5.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

check_media.h
Go to the documentation of this file.
1 
2 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
3 
4  Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
5 
6  Provided under GPL version 2 or later.
7 
8  This file contains declarations of classes SpotlistiteM, SpotlisT,
9  SectorbitmaP, CheckmediajoB which represent media checks and their outcome.
10 */
11 
12 
13 #ifndef Xorriso_pvt_check_includeD
14 #define Xorriso_pvt_check_includeD yes
15 
16 struct SpotlisT; /* List of intervals with different read qualities */
17 struct CheckmediajoB; /* Parameters for Xorriso_check_media() */
18 
19 int Xorriso_check_media_setup_job(struct XorrisO *xorriso,
20  struct CheckmediajoB *job,
21  char **argv, int old_idx, int end_idx, int flag);
22 
23 int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso,
24  struct CheckmediajoB *job,
25  struct SpotlisT **spotlist,
26  int flag);
27 
28 /* @param flag bit0= mark untested areas as valid
29 */
30 int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
31  struct SpotlisT *spotlist,
32  int read_chunk,
33  struct SectorbitmaP **map,
34  int flag);
35 
36 /* Opens the -check_media data copy in for reading and writing
37 */
38 int Xorriso_open_job_data_to(struct XorrisO *xorriso,
39  struct CheckmediajoB *job, int flag);
40 
41 /* @param report Buffer of at least 10*SfileadrL
42  @param flag bit0= only report non-default settings
43  @return <=0 error , 1 ok , 2 with bit0: every option is on default setting
44 */
45 int Xorriso_check_media_list_job(struct XorrisO *xorriso,
46  struct CheckmediajoB *job,
47  char *report, int flag);
48 
49 int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
50  struct SpotlisT *spotlist, int read_chunk,
51  struct CheckmediajoB *job, int flag);
52 
53 
54 /* Distiniction between valid and invalid sectors */
55 struct SectorbitmaP {
56  int sectors;
58  unsigned char *map;
59  int map_size;
60 };
61 
62 int Spotlist_new(struct SpotlisT **o, int flag);
63 
64 int Spotlist_destroy(struct SpotlisT **o, int flag);
65 
66 int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
67  int quality, int flag);
68 
69 int Spotlist_count(struct SpotlisT *o, int flag);
70 
71 int Spotlist_block_count(struct SpotlisT *o, int flag);
72 
73 int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag);
74 
75 int Spotlist_get_item(struct SpotlisT *o, int idx,
76  int *start_lba, int *blocks, int *quality, int flag);
77 
78 char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
79  int flag);
80 
81 
82 #define Xorriso_read_quality_gooD 0x7fffffff
83 #define Xorriso_read_quality_md5_matcH 0x70000000
84 #define Xorriso_read_quality_sloW 0x60000000
85 #define Xorriso_read_quality_partiaL 0x50000000
86 #define Xorriso_read_quality_valiD 0x40000000
87 #define Xorriso_read_quality_untesteD 0x3fffffff
88 #define Xorriso_read_quality_md5_mismatcH 0x38000000
89 #define Xorriso_read_quality_invaliD 0x30000000
90 #define Xorriso_read_quality_tao_enD 0x20000000
91 #define Xorriso_read_quality_off_tracK 0x10000000
92 #define Xorriso_read_quality_unreadablE 0x00000000
93 
94 
95 struct CheckmediajoB {
96  int use_dev; /* 0= use indev , 1= use outdev , 2= use sector map*/
97 
98  int min_lba; /* if >=0 : begin checking at this address */
99  int max_lba; /* if >=0 : read up to this address, else use mode */
100 
101  int min_block_size; /* granularity desired by user
102  */
103  int async_chunks; /* >= 2 : run MD5 thread, use given number of chunks
104  else : synchronous
105  */
106  int mode; /* 0= track by track
107  1= single sweep over libisoburn medium capacity
108  2= single sweep over libburn medium capacity
109  */
110  time_t start_time;
111  int time_limit; /* Number of seconds after which to abort */
112 
113  int item_limit; /* Maximum number of medium check list items as result */
114 
116 
119  off_t data_to_offset; /* usually 0 with image copy, negative with file copy */
120  off_t data_to_limit; /* used with file copy */
121  int data_to_skip; /* number of bytes to skip on writing. < 2048 */
124 
127  int map_with_volid; /* 0=add quick toc to map file,
128  1=read ISO heads for toc
129  */
130 
131  int retry; /* -1= only try full read_chunk, 1=retry with 2k blocks
132  0= retry with CD, full chunk else
133  */
134 
135  int report_mode; /* 0= print MCL items
136  1= print damaged files
137  */
138 
139  char event_severity[20]; /* If not "ALL": trigger event of given severity
140  at the end of a check job if bad blocks were
141  discovered.
142  */
143 
144  double slow_threshold_seq; /* Time limit in seconds for the decision whether
145  a read operation is considered slow. This does
146  not apply to thr first read of an interval.
147  */
148 };
149 
150 int Checkmediajob_new(struct CheckmediajoB **o, int flag);
151 
152 int Checkmediajob_destroy(struct CheckmediajoB **o, int flag);
153 
154 int Checkmediajob_copy(struct CheckmediajoB *from, struct CheckmediajoB *to,
155  int flag);
156 
157 int Sectorbitmap_new(struct SectorbitmaP **o, int sectors, int sector_size,
158  int flag);
159 int Sectorbitmap_destroy(struct SectorbitmaP **o, int flag);
160 int Sectorbitmap_from_file(struct SectorbitmaP **o, char *path, char *msg,
161  int *os_errno, int flag);
162 int Sectorbitmap_to_file(struct SectorbitmaP *o, char *path, char *info,
163  char *msg, int *os_errno, int flag);
164 int Sectorbitmap_set(struct SectorbitmaP *o, int sector, int flag);
166  int start_sector, int sectors, int flag);
167 int Sectorbitmap_is_set(struct SectorbitmaP *o, int sector, int flag);
169  off_t start_byte, off_t end_byte, int flag);
170 
172  int *sectors, int *sector_size, int flag);
173 
174 int Sectorbitmap_copy(struct SectorbitmaP *from, struct SectorbitmaP *to,
175  int flag);
176 
177 int Sectorbitmap_clone(struct SectorbitmaP *from, struct SectorbitmaP **clone,
178  int flag);
179 
180 #endif /* ! Xorriso_pvt_check_includeD */
181 
int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso, struct SpotlisT *spotlist, int read_chunk, struct SectorbitmaP **map, int flag)
Definition: check_media.c:1006
int Spotlist_get_item(struct SpotlisT *o, int idx, int *start_lba, int *blocks, int *quality, int flag)
Definition: check_media.c:182
int Sectorbitmap_from_file(struct SectorbitmaP **o, char *path, char *msg, int *os_errno, int flag)
Definition: check_media.c:288
int Sectorbitmap_copy(struct SectorbitmaP *from, struct SectorbitmaP *to, int flag)
Definition: check_media.c:507
int Xorriso_check_media_list_job(struct XorrisO *xorriso, struct CheckmediajoB *job, char *report, int flag)
Definition: check_media.c:841
int Xorriso_update_in_sector_map(struct XorrisO *xorriso, struct SpotlisT *spotlist, int read_chunk, struct CheckmediajoB *job, int flag)
Definition: check_media.c:1104
int Checkmediajob_destroy(struct CheckmediajoB **o, int flag)
Definition: check_media.c:604
int Sectorbitmap_set(struct SectorbitmaP *o, int sector, int flag)
Definition: check_media.c:438
int Xorriso_check_media_setup_job(struct XorrisO *xorriso, struct CheckmediajoB *job, char **argv, int old_idx, int end_idx, int flag)
Definition: check_media.c:649
int Xorriso_open_job_data_to(struct XorrisO *xorriso, struct CheckmediajoB *job, int flag)
Definition: check_media.c:1082
int Sectorbitmap_new(struct SectorbitmaP **o, int sectors, int sector_size, int flag)
Definition: check_media.c:252
int Sectorbitmap_to_file(struct SectorbitmaP *o, char *path, char *info, char *msg, int *os_errno, int flag)
Definition: check_media.c:375
int Sectorbitmap_is_set(struct SectorbitmaP *o, int sector, int flag)
Definition: check_media.c:477
char * Spotlist__quality_name(int quality, char name[80], int bad_limit, int flag)
Definition: check_media.c:208
int Sectorbitmap_get_layout(struct SectorbitmaP *o, int *sectors, int *sector_size, int flag)
Definition: check_media.c:498
int Sectorbitmap_clone(struct SectorbitmaP *from, struct SectorbitmaP **clone, int flag)
Definition: check_media.c:549
int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks, int quality, int flag)
Definition: check_media.c:120
int Spotlist_destroy(struct SpotlisT **o, int flag)
Definition: check_media.c:102
int Checkmediajob_copy(struct CheckmediajoB *from, struct CheckmediajoB *to, int flag)
Definition: check_media.c:617
int Spotlist_count(struct SpotlisT *o, int flag)
Definition: check_media.c:147
int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag)
Definition: check_media.c:166
int Spotlist_block_count(struct SpotlisT *o, int flag)
Definition: check_media.c:153
int Checkmediajob_new(struct CheckmediajoB **o, int flag)
Definition: check_media.c:568
int Sectorbitmap_bytes_are_set(struct SectorbitmaP *o, off_t start_byte, off_t end_byte, int flag)
Definition: check_media.c:485
int Spotlist_new(struct SpotlisT **o, int flag)
Definition: check_media.c:85
int Sectorbitmap_destroy(struct SectorbitmaP **o, int flag)
Definition: check_media.c:276
int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso, struct CheckmediajoB *job, struct SpotlisT **spotlist, int flag)
Definition: check_media.c:939
int Sectorbitmap_set_range(struct SectorbitmaP *o, int start_sector, int sectors, int flag)
Definition: check_media.c:452
#define SfileadrL
off_t data_to_offset
Definition: check_media.h:119
struct SectorbitmaP * sector_map
Definition: check_media.h:126
char data_to_path[SfileadrL]
Definition: check_media.h:117
char event_severity[20]
Definition: check_media.h:139
char abort_file_path[SfileadrL]
Definition: check_media.h:115
double slow_threshold_seq
Definition: check_media.h:144
off_t data_to_limit
Definition: check_media.h:120
char sector_map_path[SfileadrL]
Definition: check_media.h:125
time_t start_time
Definition: check_media.h:110
unsigned char * map
Definition: check_media.h:58