mirror of
https://github.com/vivier/EMILE.git
synced 2025-04-07 12:38:58 +00:00
use stream_* structures instead of specific ones
This commit is contained in:
parent
98bd88c574
commit
68b7b1f4dd
@ -199,8 +199,9 @@ static int create_apple_driver(char *temp, char *appledriver, char *first_level)
|
||||
static int get_second_position(char *image, char *name, int *second_offset, int *second_size)
|
||||
{
|
||||
device_io_t device;
|
||||
iso9660_FILE* file;
|
||||
iso9660_VOLUME *volume;
|
||||
stream_FILE* file;
|
||||
stream_VOLUME *volume;
|
||||
struct stream_stat st;
|
||||
|
||||
device_sector_size = 2048;
|
||||
device.data = (void*)device_open(image, O_RDONLY);
|
||||
@ -222,8 +223,10 @@ static int get_second_position(char *image, char *name, int *second_offset, int
|
||||
return 2;
|
||||
}
|
||||
|
||||
*second_offset = file->base * 4;
|
||||
*second_size = file->size;
|
||||
iso9660_fstat(file, &st);
|
||||
|
||||
*second_offset = st.st_base * 4;
|
||||
*second_size = st.st_size;
|
||||
|
||||
iso9660_close(file);
|
||||
iso9660_umount(volume);
|
||||
|
@ -24,8 +24,8 @@ int main(int argc, char **argv)
|
||||
{
|
||||
char *path;
|
||||
device_io_t device;
|
||||
ext2_FILE* file;
|
||||
ext2_VOLUME *volume;
|
||||
stream_FILE* file;
|
||||
stream_VOLUME *volume;
|
||||
char buffer[512];
|
||||
ssize_t size;
|
||||
int arg = 1;
|
||||
|
@ -15,13 +15,14 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
#include <libext2.h>
|
||||
|
||||
#include "device.h"
|
||||
|
||||
static void list(ext2_VOLUME *volume, char *path)
|
||||
static void list(stream_VOLUME *volume, char *path)
|
||||
{
|
||||
ext2_DIR *dir;
|
||||
stream_DIR *dir;
|
||||
struct ext2_dir_entry_2 *entry;
|
||||
|
||||
dir = ext2_opendir(volume, path);
|
||||
@ -41,7 +42,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
char *path;
|
||||
device_io_t device;
|
||||
ext2_VOLUME *volume;
|
||||
stream_VOLUME *volume;
|
||||
int arg = 1;
|
||||
|
||||
device_sector_size = 512;
|
||||
|
@ -24,8 +24,8 @@ int main(int argc, char **argv)
|
||||
{
|
||||
char *path;
|
||||
device_io_t device;
|
||||
iso9660_FILE* file;
|
||||
iso9660_VOLUME *volume;
|
||||
stream_FILE* file;
|
||||
stream_VOLUME *volume;
|
||||
char buffer[512];
|
||||
size_t size;
|
||||
int get_info = 0;
|
||||
@ -65,7 +65,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (get_info) {
|
||||
printf("%d %d\n", file->base * 4, file->size);
|
||||
struct stream_stat st;
|
||||
iso9660_fstat(file, &st);
|
||||
printf("%zd %zd\n", st.st_base * 4, st.st_size);
|
||||
} else {
|
||||
while((size = iso9660_read(file, buffer, 512)) > 0)
|
||||
write(STDOUT_FILENO, buffer, size);
|
||||
|
@ -19,10 +19,10 @@
|
||||
|
||||
#include "device.h"
|
||||
|
||||
static void list(iso9660_VOLUME *volume, char *path)
|
||||
static void list(stream_VOLUME *volume, char *path)
|
||||
{
|
||||
char name_buf[256];
|
||||
iso9660_DIR *dir;
|
||||
stream_DIR *dir;
|
||||
struct iso_directory_record *idr;
|
||||
|
||||
dir = iso9660_opendir(volume, path);
|
||||
@ -31,7 +31,7 @@ static void list(iso9660_VOLUME *volume, char *path)
|
||||
|
||||
while ((idr = iso9660_readdir(dir)) != NULL)
|
||||
{
|
||||
iso9660_name(volume->ucs_level, name_buf, idr);
|
||||
iso9660_name(volume, idr, name_buf);
|
||||
|
||||
if (iso9660_is_directory(idr)) {
|
||||
printf("%s/\n", name_buf);
|
||||
@ -46,7 +46,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
char *path;
|
||||
device_io_t device;
|
||||
iso9660_VOLUME *volume;
|
||||
stream_VOLUME *volume;
|
||||
int arg = 1;
|
||||
|
||||
device_sector_size = 2048;
|
||||
|
Loading…
x
Reference in New Issue
Block a user