Add version field to all structs that will remain public.

This commit is contained in:
Vreixo Formoso 2008-01-26 13:15:15 +01:00
parent 764e99e34b
commit 1a1fcf8362
5 changed files with 15 additions and 0 deletions

View File

@ -247,6 +247,7 @@ libburn_data_source_new(struct burn_drive *d)
IsoDataSource *ret;
ret = malloc(sizeof(IsoDataSource));
ret->version = 0;
ret->refcount = 1;
ret->read_block = libburn_ds_read_block;
ret->open = libburn_ds_open;

View File

@ -182,6 +182,7 @@ int iso_data_source_new_from_file(const char *path, IsoDataSource **src)
}
data->fd = -1;
ds->version = 0;
ds->refcount = 1;
ds->data = data;

View File

@ -683,6 +683,7 @@ void ifs_free(IsoFileSource *src)
}
IsoFileSourceIface ifs_class = {
0, /* version */
ifs_get_path,
ifs_get_name,
ifs_lstat,
@ -1685,6 +1686,7 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
strncpy(ifs->type, "iso ", 4);
ifs->data = data;
ifs->refcount = 1;
ifs->version = 0;
ifs->get_root = ifs_get_root;
ifs->get_by_path = ifs_get_by_path;
ifs->get_id = ifs_get_id;

View File

@ -422,6 +422,7 @@ void lfs_free(IsoFileSource *src)
}
IsoFileSourceIface lfs_class = {
0, /* version */
lfs_get_path,
lfs_get_name,
lfs_lstat,
@ -631,6 +632,7 @@ int iso_local_filesystem_new(IsoFilesystem **fs)
/* fill struct */
strncpy(lfs->type, "file", 4);
lfs->refcount = 1;
lfs->version = 0;
lfs->data = NULL; /* we don't need private data */
lfs->get_root = lfs_get_root;
lfs->get_by_path = lfs_get_by_path;

View File

@ -110,6 +110,9 @@ typedef struct iso_data_source IsoDataSource;
*/
struct iso_data_source {
/* reserved for future usage, set to 0 */
int version;
/**
* Reference count for the data source. Should be 1 when a new source
* is created. Don't access it directly, but with iso_data_source_ref()
@ -281,6 +284,9 @@ struct iso_filesystem
*/
char type[4];
/* reserved for future usage, set to 0 */
int version;
/**
* Get the root of a filesystem.
*
@ -358,6 +364,9 @@ struct iso_filesystem
*/
struct IsoFileSource_Iface
{
/* reserved for future usage, set to 0 */
int version;
/**
* Get the path, relative to the filesystem this file source belongs to.
*