Change message functions signature.

This commit is contained in:
Vreixo Formoso
2007-12-30 22:04:41 +01:00
parent d8cb56ecf3
commit e18f5d8898
7 changed files with 71 additions and 57 deletions

View File

@@ -12,6 +12,7 @@
#include "util.h"
#include "writer.h"
#include "messages.h"
#include "image.h"
#include <stdlib.h>
#include <string.h>
@@ -218,7 +219,7 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
t = writer->target;
filelist = writer->data;
iso_msg_debug(t->image, "Writing Files...");
iso_msg_debug(t->image->messenger, "Writing Files...");
nfiles = iso_rbtree_get_size(t->files);
for (i = 0; i < nfiles; ++i) {
@@ -238,8 +239,8 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
* 0's to image
*/
char *name = iso_stream_get_name(file->stream);
iso_msg_sorry(t->image, LIBISO_FILE_CANT_WRITE, "File \"%s\" can't"
" be opened. Filling with 0s.", name);
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
"File \"%s\" can't be opened. Filling with 0s.", name);
free(name);
memset(buffer, 0, BLOCK_SIZE);
for (b = 0; b < nblocks; ++b) {
@@ -268,17 +269,18 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
char *name = iso_stream_get_name(file->stream);
if (res < 0) {
/* error */
iso_msg_sorry(t->image, LIBISO_FILE_CANT_WRITE,
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
"Read error in file %s.", name);
} else {
/* eof */
iso_msg_sorry(t->image, LIBISO_FILE_CANT_WRITE,
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
"Premature end of file %s.", name);
}
free(name);
/* fill with 0s */
iso_msg_sorry(t->image, LIBISO_FILE_CANT_WRITE, "Filling with 0");
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
"Filling with 0");
memset(buffer, 0, BLOCK_SIZE);
while (b++ < nblocks) {
res = iso_write(t, buffer, BLOCK_SIZE);