xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

filesrc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 Vreixo Formoso
3  * 2012 Thomas Schmitt
4  *
5  * This file is part of the libisofs project; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License version 2
7  * or later as published by the Free Software Foundation.
8  * See COPYING file for details.
9  */
10 #ifndef LIBISO_FILESRC_H_
11 #define LIBISO_FILESRC_H_
12 
13 #include "libisofs.h"
14 #include "stream.h"
15 #include "ecma119.h"
16 
17 #ifdef HAVE_STDINT_H
18 #include <stdint.h>
19 #else
20 #ifdef HAVE_INTTYPES_H
21 #include <inttypes.h>
22 #endif
23 #endif
24 
25 
26 /* Abstraction of data file content in the emerging image.
27 */
29 {
30  /* This marks an IsoFileSrc which shall only expose its extent addresses
31  and sizes but shall not be counted or written by filesrc_writer.
32  */
33  unsigned int no_write :1;
34 
35  /* Is 1 if the object was already put into the filelist array.
36  */
37  unsigned int taken :1;
38 
39  unsigned int checksum_index :31;
40 
41  /** File Sections of the file in the image */
42  /* Special sections[0].block values while they are relative
43  before filesrc_writer_compute_data_blocks().
44  Valid only with .no_write == 0:
45  0xfffffffe This Iso_File_Src is claimed as external partition.
46  Others will take care of the content data.
47  filesrc_writer shall neither count nor write it.
48  At write_data time it is already converted to
49  a fileadress between Ecma119Image.ms_block and
50  Ecma119Image.filesrc_start - 1.
51  0xffffffff This is the block to which empty files shall point.
52  Normal data files have relative addresses from 0 to 0xffffffdf.
53  They cannot be higher, because mspad_writer forces the absolute
54  filesrc addresses to start at least at 0x20.
55  */
57  int nsections;
58 
61 };
62 
63 int iso_file_src_cmp(const void *n1, const void *n2);
64 
65 /**
66  * Create a new IsoFileSrc to get data from a specific IsoFile.
67  *
68  * The IsoFileSrc will be cached in a tree to prevent the same file for
69  * being written several times to image. If you call again this function
70  * with a node that refers to the same source file, the previously
71  * created one will be returned. No new IsoFileSrc is created in that case.
72  *
73  * @param img
74  * The image where this file is to be written
75  * @param file
76  * The IsoNode we want to write
77  * @param src
78  * Will be filled with a pointer to the IsoFileSrc
79  * @return
80  * 1 if new object was created, 0 if object existed, < 0 on error
81  */
82 int iso_file_src_create(Ecma119Image *img, IsoFile *file, IsoFileSrc **src);
83 
84 /**
85  * Add a given IsoFileSrc to the given image target.
86  *
87  * The IsoFileSrc will be cached in a tree to prevent the same file for
88  * being written several times to image. If you call again this function
89  * with a node that refers to the same source file, the previously
90  * created one will be returned.
91  *
92  * @param img
93  * The image where this file is to be written
94  * @param new
95  * The IsoFileSrc to add
96  * @param src
97  * Will be filled with a pointer to the IsoFileSrc really present in
98  * the tree. It could be different than new if the same file already
99  * exists in the tree.
100  * @return
101  * 1 on success, 0 if file already exists on tree, < 0 error
102  */
103 int iso_file_src_add(Ecma119Image *img, IsoFileSrc *new, IsoFileSrc **src);
104 
105 /**
106  * Free the IsoFileSrc especific data
107  */
108 void iso_file_src_free(void *node);
109 
110 /**
111  * Get the size of the file this IsoFileSrc represents
112  */
113 off_t iso_file_src_get_size(IsoFileSrc *file);
114 
115 /**
116  * Create a Writer for file contents.
117  *
118  * It takes care of written the files in the correct order.
119  */
121 
122 /**
123  * Determine number of filesrc blocks in the image and compute extent addresses
124  * relative to start of the file source writer area.
125  * filesrc_writer_compute_data_blocks() later makes them absolute.
126  */
128 
129 /**
130  * Write the content of file into the output stream of t.
131  * name must be NULL or offer at least PATH_MAX characters of storage.
132  * buffer must be NULL or offer at least BLOCK_SIZE characters of storage.
133  * flag is not used yet, submit 0.
134  */
136  char *name, char *buffer, int flag);
137 
138 
139 #endif /*LIBISO_FILESRC_H_*/
int iso_file_src_cmp(const void *n1, const void *n2)
Definition: filesrc.c:52
int iso_file_src_create(Ecma119Image *img, IsoFile *file, IsoFileSrc **src)
Definition: filesrc.c:69
int iso_file_src_writer_create(Ecma119Image *target)
Definition: filesrc.c:721
void iso_file_src_free(void *node)
Definition: filesrc.c:205
off_t iso_file_src_get_size(IsoFileSrc *file)
Definition: filesrc.c:212
int iso_filesrc_write_data(Ecma119Image *t, IsoFileSrc *file, char *name, char *buffer, int flag)
Definition: filesrc.c:430
int iso_file_src_add(Ecma119Image *img, IsoFileSrc *new, IsoFileSrc **src)
Definition: filesrc.c:192
int filesrc_writer_pre_compute(IsoImageWriter *writer)
Definition: filesrc.c:239
IsoStream * stream
Definition: filesrc.h:60
struct iso_file_section * sections
Definition: filesrc.h:56
unsigned int checksum_index
Definition: filesrc.h:39
int sort_weight
Definition: filesrc.h:59
int nsections
Definition: filesrc.h:57
unsigned int no_write
Definition: filesrc.h:33
unsigned int taken
Definition: filesrc.h:37
Definition: node.h:149