Add IsoImage, equivalent to old libisofs volume and volset.

IsoImage will be a context for image creation and modification.
This commit is contained in:
Vreixo Formoso
2007-12-02 19:10:30 +01:00
parent f2deae8503
commit c83bac7d9e
4 changed files with 146 additions and 11 deletions

View File

@ -9,7 +9,9 @@
#define LIBISO_LIBISOFS_H_
#include <sys/stat.h>
typedef struct Iso_Image IsoImage;
typedef struct Iso_Node IsoNode;
typedef struct Iso_Dir IsoDir;
typedef struct Iso_Symlink IsoSymlink;
@ -17,6 +19,32 @@ typedef struct Iso_File IsoFile;
typedef struct Iso_Dir_Iter IsoDirIter;
/**
* Create a new image, empty.
*
* The image will be owned by you and should be unref() when no more needed.
*
* @param name
* Name of the image. This will be used as volset_id and volume_id.
* @param image
* Location where the image pointer will be stored.
* @return
* 1 sucess, < 0 error
*/
int iso_image_new(const char *name, IsoImage **image);
/**
* Increments the reference counting of the given image.
*/
void iso_image_ref(IsoImage *image);
/**
* Decrements the reference couting of the given image.
* If it reaches 0, the image is free, together with its tree nodes (whether
* their refcount reach 0 too, of course).
*/
void iso_image_unref(IsoImage *image);
/**
* Increments the reference counting of the given node.
*/