2007-12-15 12:13:49 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Vreixo Formoso
|
|
|
|
*
|
|
|
|
* This file is part of the libisofs project; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation. See COPYING file for details.
|
|
|
|
*/
|
|
|
|
#ifndef LIBISO_IMAGE_WRITER_H_
|
|
|
|
#define LIBISO_IMAGE_WRITER_H_
|
|
|
|
|
2007-12-16 18:10:47 +00:00
|
|
|
#include "ecma119.h"
|
2007-12-15 12:13:49 +00:00
|
|
|
|
|
|
|
struct Iso_Image_Writer
|
|
|
|
{
|
2007-12-16 18:10:47 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int (*compute_data_blocks)(IsoImageWriter *writer);
|
2007-12-15 12:13:49 +00:00
|
|
|
|
2007-12-17 22:22:19 +00:00
|
|
|
int (*write_vol_desc)(IsoImageWriter *writer);
|
2007-12-15 12:13:49 +00:00
|
|
|
|
2007-12-17 22:22:19 +00:00
|
|
|
int (*write_data)(IsoImageWriter *writer);
|
2007-12-15 12:13:49 +00:00
|
|
|
|
2007-12-16 18:10:47 +00:00
|
|
|
int (*free_data)(IsoImageWriter *writer);
|
2007-12-15 12:13:49 +00:00
|
|
|
|
|
|
|
void *data;
|
2007-12-17 22:22:19 +00:00
|
|
|
Ecma119Image *target;
|
2007-12-15 12:13:49 +00:00
|
|
|
};
|
|
|
|
|
2007-12-17 23:37:24 +00:00
|
|
|
/**
|
|
|
|
* This is the function all Writers shoudl call to write data to
|
|
|
|
* image.
|
|
|
|
* Currently, it is just a wrapper for write(2) Unix system call.
|
|
|
|
*
|
|
|
|
* It is implemented in ecma119.c
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* 1 on sucess, < 0 error
|
|
|
|
*/
|
|
|
|
int iso_write(Ecma119Image *target, void *buf, size_t count);
|
|
|
|
|
2007-12-17 22:22:19 +00:00
|
|
|
int ecma119_writer_create(Ecma119Image *target);
|
|
|
|
|
2007-12-15 12:13:49 +00:00
|
|
|
#endif /*LIBISO_IMAGE_WRITER_H_*/
|