libisofs/src/filesrc.h

64 lines
1.7 KiB
C
Raw Normal View History

2007-12-02 16:59:36 +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_FILESRC_H_
#define LIBISO_FILESRC_H_
#include "libisofs.h"
#include "stream.h"
#include "ecma119.h"
#include <stdint.h>
struct Iso_File_Src
{
unsigned int prev_img :1; /**< if the file comes from a previous image */
uint32_t block; /**< Block where this file will be written on image */
int sort_weight;
IsoStream *stream;
};
int iso_file_src_cmp(const void *n1, const void *n2);
/**
* Create a new IsoFileSrc to get data from a specific IsoFile.
*
* The IsoFileSrc will be cached in a tree to prevent the same file for
* being written several times to image. If you call again this function
* with a node that refers to the same source file, the previously
* created one will be returned. No new IsoFileSrc is created in that case.
2007-12-02 16:59:36 +00:00
*
* @param img
* The image where this file is to be written
* @param file
* The IsoNode we want to write
* @param src
* Will be filled with a pointer to the IsoFileSrc
* @return
* 1 on success, < 0 on error
2007-12-02 16:59:36 +00:00
*/
int iso_file_src_create(Ecma119Image *img, IsoFile *file, IsoFileSrc **src);
2007-12-02 16:59:36 +00:00
/**
* Free the IsoFileSrc especific data
*/
void iso_file_src_free(void *node);
/**
* Get the size of the file this IsoFileSrc represents
*/
off_t iso_file_src_get_size(IsoFileSrc *file);
/**
* Create a Writer for file contents.
*
* It takes care of written the files in the correct order.
2007-12-02 16:59:36 +00:00
*/
int iso_file_src_writer_create(Ecma119Image *target);
2007-12-02 16:59:36 +00:00
#endif /*LIBISO_FILESRC_H_*/