Expose IsoFilesystem and IsoFileSource.
This commit is contained in:
@ -11,12 +11,9 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libisofs.h"
|
||||
#include "fsource.h"
|
||||
#include "fs_image.h"
|
||||
#include "messages.h"
|
||||
|
||||
/*
|
||||
* Little test program to test filesystem implementations.
|
||||
* Little test program that extracts a file form a given ISO image.
|
||||
* Outputs file contents to stdout!
|
||||
*/
|
||||
|
||||
@ -27,11 +24,11 @@ int main(int argc, char **argv)
|
||||
IsoFileSource *file;
|
||||
struct stat info;
|
||||
IsoDataSource *src;
|
||||
struct libiso_msgs *messenger;
|
||||
struct iso_read_opts opts = {
|
||||
0, /* block */
|
||||
0, /* norock */
|
||||
0, /* nojoliet */
|
||||
0, /* noiso1999 */
|
||||
0, /* preferjoliet */
|
||||
0, /* uid; */
|
||||
0, /* gid; */
|
||||
@ -44,23 +41,21 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = libiso_msgs_new(&messenger, 0);
|
||||
if (res <= 0) {
|
||||
printf ("Can't create messenger\n");
|
||||
res = iso_init();
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "Can't init libisofs\n");
|
||||
return 1;
|
||||
}
|
||||
libiso_msgs_set_severities(messenger, LIBISO_MSGS_SEV_NEVER,
|
||||
LIBISO_MSGS_SEV_ALL, "", 0);
|
||||
|
||||
res = iso_data_source_new_from_file(argv[1], &src);
|
||||
if (res < 0) {
|
||||
printf ("Error creating data source\n");
|
||||
fprintf(stderr, "Error creating data source\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = iso_image_filesystem_new(src, &opts, messenger, &fs);
|
||||
res = iso_image_filesystem_new(src, &opts, 1, &fs);
|
||||
if (res < 0) {
|
||||
printf ("Error creating filesystem\n");
|
||||
fprintf(stderr, "Error creating filesystem\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -99,6 +94,6 @@ int main(int argc, char **argv)
|
||||
iso_file_source_unref(file);
|
||||
iso_filesystem_unref(fs);
|
||||
iso_data_source_unref(src);
|
||||
libiso_msgs_destroy(&messenger, 0);
|
||||
iso_finish();
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <limits.h>
|
||||
|
||||
#include "libisofs.h"
|
||||
#include "fs_image.h"
|
||||
|
||||
static void
|
||||
print_permissions(mode_t mode)
|
||||
|
Reference in New Issue
Block a user