1 /*
2  * Copyright (c) 2007 Vreixo Formoso
3  *
4  * This file is part of the libisofs project; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License version 2
6  * or later as published by the Free Software Foundation.
7  * See COPYING file for details.
8  */
9 #ifndef LIBISO_IMAGE_WRITER_H_
10 #define LIBISO_IMAGE_WRITER_H_
11 
12 #include "ecma119.h"
13 
14 struct Iso_Image_Writer
15 {
16     /**
17      *
18      */
19     int (*compute_data_blocks)(IsoImageWriter *writer);
20 
21     int (*write_vol_desc)(IsoImageWriter *writer);
22 
23     int (*write_data)(IsoImageWriter *writer);
24 
25     int (*free_data)(IsoImageWriter *writer);
26 
27     void *data;
28     Ecma119Image *target;
29 };
30 
31 /**
32  * This is the function all Writers should call to write data to image.
33  * Currently, it is just a wrapper for write(2) Unix system call.
34  *
35  * It is implemented in ecma119.c
36  *
37  * @return
38  *      1 on success, < 0 error
39  */
40 int iso_write(Ecma119Image *target, void *buf, size_t count);
41 
42 int ecma119_writer_create(Ecma119Image *target);
43 
44 #endif /*LIBISO_IMAGE_WRITER_H_*/
45