int xfs_dir (char *dirname);
/* Exported in struct fs_t */
-static int xfs_open(struct boot_file_t *file, const char *dev_name,
- struct partition_t *part, const char *file_name);
+static int xfs_open(struct boot_file_t *file,
+ struct partition_t *part, struct boot_fspec_t *fspec);
static int xfs_read(struct boot_file_t *file, unsigned int size, void *buffer);
static int xfs_seek(struct boot_file_t *file, unsigned int newpos);
static int xfs_close(struct boot_file_t *file);
int errnum;
static int
-xfs_open(struct boot_file_t *file, const char *dev_name,
- struct partition_t *part, const char *file_name)
+xfs_open(struct boot_file_t *file,
+ struct partition_t *part, struct boot_fspec_t *fspec)
{
static char buffer[1024];
else
partition_offset = 0;
- strncpy(buffer, dev_name, 1020);
+ strncpy(buffer, fspec->dev, 1020);
if (_machine != _MACH_bplan)
strcat(buffer, ":0"); /* 0 is full disk in (non-buggy) OF */
DEBUG_F("Trying to open dev_name=%s; filename=%s; partition offset=%Lu\n",
- buffer, file_name, partition_offset);
+ buffer, fspec->file, partition_offset);
file->of_device = prom_open(buffer);
if (file->of_device == PROM_INVALID_HANDLE || file->of_device == NULL)
return FILE_ERR_BAD_FSYS;
}
- DEBUG_F("Attempting to open %s\n", file_name);
- strcpy(buffer, file_name); /* xfs_dir modifies argument */
+ DEBUG_F("Attempting to open %s\n", fspec->file);
+ strcpy(buffer, fspec->file); /* xfs_dir modifies argument */
if(!xfs_dir(buffer))
{
DEBUG_F("xfs_dir() failed. errnum = %d\n", errnum);
return errnum;
}
- DEBUG_F("Successfully opened %s\n", file_name);
+ DEBUG_F("Successfully opened %s\n", fspec->file);
DEBUG_LEAVE(FILE_ERR_OK);
return FILE_ERR_OK;
int toread;
static char *usual[2] = {".", ".."};
static xfs_dir2_sf_entry_t *sfe;
- char *name = usual[0];
+ unsigned char *name = (unsigned char *)usual[0];
if (xfs.dirpos >= xfs.dirmax) {
if (xfs.forw == 0)
#undef dau
toread = roundup8 (namelen + 11) - 9;
xfs_read_data (dirbuf, toread);
- name = (char *)dirbuf;
+ name = (unsigned char *)dirbuf;
xfs.blkoff += toread + 5;
break;
}
++xfs.dirpos;
name[namelen] = 0;
- return name;
+ return (char *)name;
}
static char *