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)  

stream.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 Vreixo Formoso
3  * Copyright (c) 2009 - 2016 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_STREAM_H_
11 #define LIBISO_STREAM_H_
12 
13 /*
14  * Definitions of streams.
15  */
16 #include "fsource.h"
17 
18 /* IMPORTANT: Any change must be reflected by fsrc_clone_stream */
19 typedef struct
20 {
22 
23  /* key for file identification inside filesystem */
24  dev_t dev_id;
25  ino_t ino_id;
26  off_t size; /**< size of this file */
28 
29 /**
30  * Get an identifier for the file of the source, for debug purposes
31  * @param name
32  * Must provide at least PATH_MAX bytes. If no PATH_MAX is defined
33  * then assume PATH_MAX = Libisofs_default_path_maX from libisofs.h
34  */
35 void iso_stream_get_file_name(IsoStream *stream, char *name);
36 
37 /**
38  * Create a stream to read from a IsoFileSource.
39  * The stream will take the ref. to the IsoFileSource, so after a successfully
40  * execution of this function, you must not unref() the source, unless you
41  * take an extra ref.
42  *
43  * @return
44  * 1 success, < 0 error
45  * Possible errors:
46  *
47  */
49 
50 /**
51  * Create a new stream to read a chunk of an IsoFileSource..
52  * The stream will add a ref. to the IsoFileSource.
53  *
54  * @return
55  * 1 success, < 0 error
56  */
57 int iso_cut_out_stream_new(IsoFileSource *src, off_t offset, off_t size,
58  IsoStream **stream);
59 
60 /**
61  * Obtain eventual zisofs ZF field entry parameters from a file source out
62  * of a loaded ISO image.
63  * To make hope for non-zero reply the stream has to be the original stream
64  * of an IsoFile with .from_old_session==1. The call is safe with any stream
65  * type, though, unless fsrc_stream_class would be used without FSrcStreamData.
66  * @return 1= returned parameters are valid, 0=no ZF info found , <0 error
67  */
68 int iso_stream_get_src_zf(IsoStream *stream, uint8_t zisofs_algo[2],
69  int *header_size_div4, int *block_size_log2,
70  uint64_t *uncompressed_size, int flag);
71 
72 /**
73  * Set the inode number of a stream that is based on FSrcStreamData, i.e.
74  * stems from the imported ISO image.
75  * @return 1 = ok , 0 = not an ISO image stream , <0 = error
76  */
77 int iso_stream_set_image_ino(IsoStream *stream, ino_t ino, int flag);
78 
79 
80 /**
81  * Read the full required amount of data unless error or EOF occurs.
82  * Fill missing bytes by 0s.
83  * @param count Required amount
84  * @param got Returns number of actually read bytes
85  * @return
86  * 1 no problem encountered, 0 EOF encountered, < 0 error
87  */
88 int iso_stream_read_buffer(IsoStream *stream, char *buf, size_t count,
89  size_t *got);
90 
91 /**
92  * @return 1=ok, md5 is valid,
93  * 0= not ok
94  * <0 fatal error, abort
95  */
96 int iso_stream_make_md5(IsoStream *stream, char md5[16], int flag);
97 
98 
99 /**
100  * Create a clone of the input stream of old_stream and a roughly initialized
101  * clone of old_stream which has the same class and refcount 1. Its data
102  * pointer will be NULL and needs to be filled by an expert which knows how
103  * to clone the data of old_stream.
104  * @param old_stream The existing stream which is in process of cloning
105  * @param new_stream Will return the uninitialized memory object which shall
106  * later become the clone of old_stream.
107  * @param new_input The clone of the input stream of old stream.
108  * @param flag Submit 0 for now.
109  * @return ISO_SUCCESS or an error code <0
110  */
112  IsoStream **new_stream,
113  IsoStream **new_input, int flag);
114 
115 
116 /**
117  * Dispose the internal list of stream class cmp_ino() functions. It is
118  * a static global of stream.c, created and used by iso_stream_cmp_ino().
119  * This function is supposed to be called by iso_finish() only.
120  */
121 int iso_stream_destroy_cmpranks(int flag);
122 
123 
124 #endif /*STREAM_H_*/
int iso_stream_read_buffer(IsoStream *stream, char *buf, size_t count, size_t *got)
Definition: stream.c:1197
int iso_file_source_stream_new(IsoFileSource *src, IsoStream **stream)
Definition: stream.c:225
void iso_stream_get_file_name(IsoStream *stream, char *name)
Definition: stream.c:841
int iso_stream_get_src_zf(IsoStream *stream, uint8_t zisofs_algo[2], int *header_size_div4, int *block_size_log2, uint64_t *uncompressed_size, int flag)
Definition: stream.c:293
int iso_stream_make_md5(IsoStream *stream, char md5[16], int flag)
Definition: stream.c:1227
int iso_stream_set_image_ino(IsoStream *stream, ino_t ino, int flag)
Definition: stream.c:923
int iso_cut_out_stream_new(IsoFileSource *src, off_t offset, off_t size, IsoStream **stream)
Definition: stream.c:507
int iso_stream_destroy_cmpranks(int flag)
Definition: stream.c:1028
int iso_stream_clone_filter_common(IsoStream *old_stream, IsoStream **new_stream, IsoStream **new_input, int flag)
Definition: stream.c:1292
off_t size
Definition: stream.h:26
ino_t ino_id
Definition: stream.h:25
IsoFileSource * src
Definition: stream.h:21
dev_t dev_id
Definition: stream.h:24