From 1a1fcf8362d0202766b1ee31a9ae35c3342b0967 Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Date: Sat, 26 Jan 2008 13:15:15 +0100 Subject: [PATCH] Add version field to all structs that will remain public. --- demo/iso_grow.c | 1 + src/data_source.c | 1 + src/fs_image.c | 2 ++ src/fs_local.c | 2 ++ src/libisofs.h | 9 +++++++++ 5 files changed, 15 insertions(+) diff --git a/demo/iso_grow.c b/demo/iso_grow.c index 18c7b99..26b37a0 100644 --- a/demo/iso_grow.c +++ b/demo/iso_grow.c @@ -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; diff --git a/src/data_source.c b/src/data_source.c index 57fea33..7510a89 100644 --- a/src/data_source.c +++ b/src/data_source.c @@ -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; diff --git a/src/fs_image.c b/src/fs_image.c index 8e725c8..0315ee4 100644 --- a/src/fs_image.c +++ b/src/fs_image.c @@ -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; diff --git a/src/fs_local.c b/src/fs_local.c index e2e6aba..90f9c0d 100644 --- a/src/fs_local.c +++ b/src/fs_local.c @@ -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; diff --git a/src/libisofs.h b/src/libisofs.h index c92e650..b48a06d 100644 --- a/src/libisofs.h +++ b/src/libisofs.h @@ -109,6 +109,9 @@ typedef struct iso_data_source IsoDataSource; * drive. */ 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 @@ -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. *