Compare commits

...

7 Commits

Author SHA1 Message Date
46e96ee616 Version leap to 1.3.2 2013-08-07 15:10:10 +02:00
7e60e60e62 Updated changelog 2013-08-07 10:56:23 +02:00
d55ed2d1ca New API calls iso_image_get_app_use() and iso_image_set_app_use() 2013-08-04 12:32:31 +02:00
77c8349c56 Bug fix: iso_finish() left an invalid global pointer, which a subsequent call of iso_init() would try to dereference. 2013-07-31 09:53:43 +02:00
b1c7ed6e29 Avoided a confusing error message from iso_image_update_sizes(),
prepared macro for non-confusing error message,
and introduced flag bit0 to iso_stream_get_input_stream()
2013-06-25 14:56:29 +02:00
e886722d65 The sort weight of data files loaded from ISO image is now 2 exp 28 to 1
rather than 2 exp 31 - 1 to - 2 exp 31
2013-05-24 12:35:43 +02:00
b80b339de3 Version leap to 1.3.1 2013-05-17 19:51:39 +02:00
11 changed files with 159 additions and 31 deletions

View File

@ -1,3 +1,10 @@
libisofs-1.3.2.tar.gz Wed Aug 07 2013
===============================================================================
* Bug fix: iso_finish() left an invalid global pointer, which a subsequent
call of iso_init() would try to dereference.
* The sort weight of data files loaded from ISO image is now 2 exp 28 to 1
rather than 2 exp 31 - 1 to - 2 exp 31
libisofs-1.3.0.tar.gz Fri May 17 2013 libisofs-1.3.0.tar.gz Fri May 17 2013
=============================================================================== ===============================================================================
* Bug fix: GPT header CRC was computed from all 512 bytes rather than from 92. * Bug fix: GPT header CRC was computed from all 512 bytes rather than from 92.

View File

@ -1,4 +1,4 @@
AC_INIT([libisofs], [1.3.0], [http://libburnia-project.org]) AC_INIT([libisofs], [1.3.2], [http://libburnia-project.org])
AC_PREREQ([2.50]) AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h]) dnl AC_CONFIG_HEADER([config.h])
@ -41,7 +41,7 @@ dnl If LIBISOFS_*_VERSION changes, be sure to change AC_INIT above to match.
dnl dnl
LIBISOFS_MAJOR_VERSION=1 LIBISOFS_MAJOR_VERSION=1
LIBISOFS_MINOR_VERSION=3 LIBISOFS_MINOR_VERSION=3
LIBISOFS_MICRO_VERSION=0 LIBISOFS_MICRO_VERSION=2
LIBISOFS_VERSION=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION.$LIBISOFS_MICRO_VERSION LIBISOFS_VERSION=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION.$LIBISOFS_MICRO_VERSION
AC_SUBST(LIBISOFS_MAJOR_VERSION) AC_SUBST(LIBISOFS_MAJOR_VERSION)
@ -51,10 +51,10 @@ AC_SUBST(LIBISOFS_VERSION)
dnl Libtool versioning dnl Libtool versioning
LT_RELEASE=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION LT_RELEASE=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION
# 2013.05.17 development jump has not yet happened # 2013.08.07 development jump has not yet happened
# SONAME = 72 - 66 = 6 . Library name = libisofs.6.66.0 # SONAME = 74 - 68 = 6 . Library name = libisofs.6.68.0
LT_CURRENT=72 LT_CURRENT=74
LT_AGE=66 LT_AGE=68
LT_REVISION=0 LT_REVISION=0
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`

View File

@ -597,6 +597,8 @@ int ecma119_writer_write_vol_desc(IsoImageWriter *writer)
ecma119_set_voldescr_times(writer, &vol); ecma119_set_voldescr_times(writer, &vol);
vol.file_structure_version[0] = 1; vol.file_structure_version[0] = 1;
memcpy(vol.app_use, image->application_use, 512);
free(vol_id); free(vol_id);
free(volset_id); free(volset_id);
free(pub_id); free(pub_id);

View File

@ -3104,8 +3104,19 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
/* /*
* and we set the sort weight based on the block on image, to * and we set the sort weight based on the block on image, to
* improve performance on image modifying. * improve performance on image modifying.
*
* This was too obtrusive because it occupied the highest
* possible weight ranks:
* file->sort_weight = INT_MAX - data->sections[0].block;
*
* So a try to be more nice and rely on caching with tiles
* of at least 16 blocks. This occupies a range within
* the interval of 1 to 2 exp 28 = 268,435,456.
* (Dividing each number separately saves from integer
* rollover problems.)
*/ */
file->sort_weight = INT_MAX - data->sections[0].block; file->sort_weight =
fsdata->nblocks / 16 - data->sections[0].block / 16 + 1;
file->stream = stream; file->stream = stream;
file->node.type = LIBISO_FILE; file->node.type = LIBISO_FILE;

View File

@ -78,6 +78,7 @@ int iso_image_new(const char *name, IsoImage **image)
img->volset_id = strdup(name); img->volset_id = strdup(name);
img->volume_id = strdup(name); img->volume_id = strdup(name);
} }
memset(img->application_use, 0, 512);
img->system_area_data = NULL; img->system_area_data = NULL;
img->system_area_options = 0; img->system_area_options = 0;
img->num_mips_boot_files = 0; img->num_mips_boot_files = 0;
@ -373,6 +374,19 @@ int iso_image_get_pvd_times(IsoImage *image,
return ISO_SUCCESS; return ISO_SUCCESS;
} }
void iso_image_set_app_use(IsoImage *image, const char *app_use_data,
int count)
{
if (count < 0)
count= 0;
else if(count > 512)
count= 512;
if (count > 0)
memcpy(image->application_use, app_use_data, count);
if (count < 512)
memset(image->application_use + count, 0, 512 - count);
}
int iso_image_get_msg_id(IsoImage *image) int iso_image_get_msg_id(IsoImage *image)
{ {
return image->id; return image->id;
@ -392,6 +406,14 @@ static
int dir_update_size(IsoImage *image, IsoDir *dir) int dir_update_size(IsoImage *image, IsoDir *dir)
{ {
IsoNode *pos; IsoNode *pos;
#ifdef Libisofs_update_sizes_abortablE
char *path= NULL;
IsoStream *base_stream;
int cancel_ret, ret;
uint32_t lba;
#endif
pos = dir->children; pos = dir->children;
while (pos) { while (pos) {
int ret = 1; int ret = 1;
@ -400,13 +422,51 @@ int dir_update_size(IsoImage *image, IsoDir *dir)
} else if (pos->type == LIBISO_DIR) { } else if (pos->type == LIBISO_DIR) {
/* recurse */ /* recurse */
ret = dir_update_size(image, ISO_DIR(pos)); ret = dir_update_size(image, ISO_DIR(pos));
#ifdef Libisofs_update_sizes_abortablE
if (ret == ISO_CANCELED)
return ret; /* Message already issued by dir_update_size */
#endif
} }
#ifdef Libisofs_update_sizes_abortablE
/* This would report error and abort according to severity threshold.
But it is desirable to let the update_size crawler continue
its work after e.g. a file has vanished from hard disk.
So normally this macro case should be disabled.
*/
if (ret < 0) { if (ret < 0) {
ret = iso_msg_submit(image->id, ret, 0, NULL); cancel_ret = iso_msg_submit(image->id, ret, 0, NULL);
if (ret < 0) { path = iso_tree_get_node_path(pos);
return ret; /* cancel due error threshold */ if (path != NULL) {
iso_msg_submit(image->id, ret, 0,
"ISO path : %s", path);
free(path);
} }
/* Report source path with streams which do not come from
the loaded ISO filesystem */
if (pos->type == LIBISO_FILE &&
iso_node_get_old_image_lba(pos, &lba, 0) == 0) {
base_stream = iso_stream_get_input_stream(
ISO_FILE(pos)->stream, 1);
if (base_stream == NULL)
base_stream = ISO_FILE(pos)->stream;
path = iso_stream_get_source_path(base_stream, 0);
if (path != NULL) {
iso_msg_submit(image->id, ret, 0,
"Local path: %s", path);
free(path);
}
}
if (cancel_ret < 0)
return cancel_ret; /* cancel due error threshold */
} }
#endif /* Libisofs_update_sizes_abortablE */
pos = pos->next; pos = pos->next;
} }
return ISO_SUCCESS; return ISO_SUCCESS;

View File

@ -53,6 +53,7 @@ struct Iso_Image
char *modification_time; char *modification_time;
char *expiration_time; char *expiration_time;
char *effective_time; char *effective_time;
char application_use[512];
/* el-torito boot catalog */ /* el-torito boot catalog */
struct el_torito_boot_catalog *bootcat; struct el_torito_boot_catalog *bootcat;

View File

@ -84,7 +84,7 @@
*/ */
#define iso_lib_header_version_major 1 #define iso_lib_header_version_major 1
#define iso_lib_header_version_minor 3 #define iso_lib_header_version_minor 3
#define iso_lib_header_version_micro 0 #define iso_lib_header_version_micro 2
/** /**
* Get version of the libisofs library at runtime. * Get version of the libisofs library at runtime.
@ -2895,7 +2895,7 @@ void iso_image_set_volset_id(IsoImage *image, const char *volset_id);
/** /**
* Get the volset identifier. * Get the volset identifier.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -2911,7 +2911,7 @@ void iso_image_set_volume_id(IsoImage *image, const char *volume_id);
/** /**
* Get the volume identifier. * Get the volume identifier.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -2927,7 +2927,7 @@ void iso_image_set_publisher_id(IsoImage *image, const char *publisher_id);
/** /**
* Get the publisher of a image. * Get the publisher of a image.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -2944,7 +2944,7 @@ void iso_image_set_data_preparer_id(IsoImage *image,
/** /**
* Get the data preparer of a image. * Get the data preparer of a image.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -2960,7 +2960,7 @@ void iso_image_set_system_id(IsoImage *image, const char *system_id);
/** /**
* Get the system id of a image. * Get the system id of a image.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -2976,7 +2976,7 @@ void iso_image_set_application_id(IsoImage *image, const char *application_id);
/** /**
* Get the application id of a image. * Get the application id of a image.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -2994,7 +2994,7 @@ void iso_image_set_copyright_file_id(IsoImage *image,
/** /**
* Get the copyright information of a image. * Get the copyright information of a image.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -3012,7 +3012,7 @@ void iso_image_set_abstract_file_id(IsoImage *image,
/** /**
* Get the abstract information of a image. * Get the abstract information of a image.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed nor
* changed. * changed.
* *
* @since 0.6.2 * @since 0.6.2
@ -3029,13 +3029,42 @@ void iso_image_set_biblio_file_id(IsoImage *image, const char *biblio_file_id);
/** /**
* Get the biblio information of a image. * Get the biblio information of a image.
* The returned string is owned by the image and should not be freed nor * The returned string is owned by the image and must not be freed or changed.
* changed.
* *
* @since 0.6.2 * @since 0.6.2
*/ */
const char *iso_image_get_biblio_file_id(const IsoImage *image); const char *iso_image_get_biblio_file_id(const IsoImage *image);
/**
* Fill Application Use field of the Primary Volume Descriptor.
* ECMA-119 8.4.32 Application Use (BP 884 to 1395)
* "This field shall be reserved for application use. Its content
* is not specified by this Standard."
*
* @param image
* The image to manipulate.
* @param app_use_data
* Up to 512 bytes of data.
* @param count
* The number of bytes in app_use_data. If the number is smaller than 512,
* then the remaining bytes will be set to 0.
* @since 1.3.2
*/
void iso_image_set_app_use(IsoImage *image, const char *app_use_data,
int count);
/**
* Get the current setting for the Application Use field of the Primary Volume
* Descriptor.
* The returned char array of 512 bytes is owned by the image and must not
* be freed or changed.
*
* @param image
* The image to inquire
* @since 1.3.2
*/
const char *iso_image_get_app_use(IsoImage *image);
/** /**
* Get the four timestamps from the Primary Volume Descriptor of the imported * Get the four timestamps from the Primary Volume Descriptor of the imported
* ISO image. The timestamps are strings which are either empty or consist * ISO image. The timestamps are strings which are either empty or consist
@ -3094,7 +3123,7 @@ int iso_image_get_pvd_times(IsoImage *image,
* creation time. * creation time.
* @param boot * @param boot
* Location where a pointer to the added boot image will be stored. That * Location where a pointer to the added boot image will be stored. That
* object is owned by the IsoImage and should not be freed by the user, * object is owned by the IsoImage and must not be freed by the user,
* nor dereferenced once the last reference to the IsoImage was disposed * nor dereferenced once the last reference to the IsoImage was disposed
* via iso_image_unref(). A NULL value is allowed if you don't need a * via iso_image_unref(). A NULL value is allowed if you don't need a
* reference to the boot image. * reference to the boot image.
@ -3144,7 +3173,7 @@ int iso_image_add_boot_image(IsoImage *image, const char *image_path,
* the image and catalog tree nodes. An application would want those, for * the image and catalog tree nodes. An application would want those, for
* example, to prevent the user removing it. * example, to prevent the user removing it.
* *
* Both nodes are owned by libisofs and should not be freed. You can get your * Both nodes are owned by libisofs and must not be freed. You can get your
* own ref with iso_node_ref(). You can also check if the node is already * own ref with iso_node_ref(). You can also check if the node is already
* on the tree by getting its parent (note that when reading El-Torito info * on the tree by getting its parent (note that when reading El-Torito info
* from a previous image, the nodes might not be on the tree even if you haven't * from a previous image, the nodes might not be on the tree even if you haven't
@ -3156,7 +3185,7 @@ int iso_image_add_boot_image(IsoImage *image, const char *image_path,
* The image from which to get the boot image. * The image from which to get the boot image.
* @param boot * @param boot
* If not NULL, it will be filled with a pointer to the boot image, if * If not NULL, it will be filled with a pointer to the boot image, if
* any. That object is owned by the IsoImage and should not be freed by * any. That object is owned by the IsoImage and must not be freed by
* the user, nor dereferenced once the last reference to the IsoImage was * the user, nor dereferenced once the last reference to the IsoImage was
* disposed via iso_image_unref(). * disposed via iso_image_unref().
* @param imgnode * @param imgnode
@ -3924,7 +3953,7 @@ int iso_node_set_name(IsoNode *node, const char *name);
/** /**
* Get the name of a node. * Get the name of a node.
* The returned string belongs to the node and should not be modified nor * The returned string belongs to the node and must not be modified nor
* freed. Use strdup if you really need your own copy. * freed. Use strdup if you really need your own copy.
* *
* @since 0.6.2 * @since 0.6.2
@ -4503,7 +4532,7 @@ int iso_dir_find_children(IsoDir* dir, IsoFindCondition *cond,
/** /**
* Get the destination of a node. * Get the destination of a node.
* The returned string belongs to the node and should not be modified nor * The returned string belongs to the node and must not be modified nor
* freed. Use strdup if you really need your own copy. * freed. Use strdup if you really need your own copy.
* *
* @since 0.6.2 * @since 0.6.2
@ -6421,7 +6450,10 @@ int iso_file_remove_filter(IsoFile *file, int flag);
* @param stream * @param stream
* The eventual filter stream to be inquired. * The eventual filter stream to be inquired.
* @param flag * @param flag
* Bitfield for control purposes. Submit 0 for now. * Bitfield for control purposes.
* bit0= Follow the chain of input streams and return the one at the
* end of the chain.
* @since 1.3.2
* @return * @return
* The input stream, if one exists. Elsewise NULL. * The input stream, if one exists. Elsewise NULL.
* No extra reference to the stream is taken by this call. * No extra reference to the stream is taken by this call.

View File

@ -88,6 +88,7 @@ iso_image_fs_get_volume_id;
iso_image_generator_is_running; iso_image_generator_is_running;
iso_image_get_abstract_file_id; iso_image_get_abstract_file_id;
iso_image_get_all_boot_imgs; iso_image_get_all_boot_imgs;
iso_image_get_app_use;
iso_image_get_application_id; iso_image_get_application_id;
iso_image_get_attached_data; iso_image_get_attached_data;
iso_image_get_biblio_file_id; iso_image_get_biblio_file_id;
@ -114,6 +115,7 @@ iso_image_new;
iso_image_ref; iso_image_ref;
iso_image_remove_boot_image; iso_image_remove_boot_image;
iso_image_set_abstract_file_id; iso_image_set_abstract_file_id;
iso_image_set_app_use;
iso_image_set_application_id; iso_image_set_application_id;
iso_image_set_biblio_file_id; iso_image_set_biblio_file_id;
iso_image_set_boot_catalog_hidden; iso_image_set_boot_catalog_hidden;

View File

@ -139,6 +139,7 @@ int iso_node_xinfo_dispose_cloners(int flag)
next = assoc->next; next = assoc->next;
free((char *) assoc); free((char *) assoc);
} }
iso_xinfo_cloner_list= NULL;
return(1); return(1);
} }

View File

@ -890,17 +890,27 @@ void iso_stream_get_file_name(IsoStream *stream, char *name)
} }
} }
/* @param flag bit0= Obtain most fundamental stream */
IsoStream *iso_stream_get_input_stream(IsoStream *stream, int flag) IsoStream *iso_stream_get_input_stream(IsoStream *stream, int flag)
{ {
IsoStreamIface* class; IsoStreamIface* class;
IsoStream *result = NULL, *next;
if (stream == NULL) { if (stream == NULL) {
return NULL; return NULL;
} }
class = stream->class; while (1) {
if (class->version < 2) class = stream->class;
return NULL; if (class->version < 2)
return class->get_input_stream(stream, 0); return result;
next = class->get_input_stream(stream, 0);
if (next == NULL)
return result;
result = next;
if (!(flag & 1))
return result;
stream = result;
}
} }
char *iso_stream_get_source_path(IsoStream *stream, int flag) char *iso_stream_get_source_path(IsoStream *stream, int flag)

View File

@ -803,6 +803,8 @@ int iso_add_dir_src_rec(IsoImage *image, IsoDir *parent, IsoFileSource *dir)
ret = iso_file_source_lstat(file, &info); ret = iso_file_source_lstat(file, &info);
} }
if (ret < 0) { if (ret < 0) {
ret = iso_msg_submit(image->id, ISO_FILE_CANT_ADD, ret,
"Error when adding file %s", path);
goto dir_rec_continue; goto dir_rec_continue;
} }