mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
Merge pull request #1522 from npwoods/imgtool_partition_refs
[Imgtool] Bulk change: 'imgtool::partition *' ==> 'imgtool::partition &'
This commit is contained in:
commit
9b5c5f607a
@ -69,7 +69,7 @@ struct basictokens
|
||||
-------------------------------------------------*/
|
||||
|
||||
static imgtoolerr_t basic_readfile(const basictokens *tokens,
|
||||
imgtool::partition *partition, const char *filename,
|
||||
imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
@ -91,7 +91,7 @@ static imgtoolerr_t basic_readfile(const basictokens *tokens,
|
||||
}
|
||||
|
||||
/* read actual file */
|
||||
err = partition->read_file(filename, fork, *mem_stream, nullptr);
|
||||
err = partition.read_file(filename, fork, *mem_stream, nullptr);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -174,7 +174,7 @@ done:
|
||||
-------------------------------------------------*/
|
||||
|
||||
static imgtoolerr_t basic_writefile(const basictokens *tokens,
|
||||
imgtool::partition *partition, const char *filename,
|
||||
imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
@ -343,7 +343,7 @@ static imgtoolerr_t basic_writefile(const basictokens *tokens,
|
||||
}
|
||||
|
||||
/* write actual file */
|
||||
err = partition->write_file(filename, fork, *mem_stream, opts, nullptr);
|
||||
err = partition.write_file(filename, fork, *mem_stream, opts, nullptr);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -2958,13 +2958,13 @@ static const basictokens cocobas_tokens =
|
||||
ARRAY_LENGTH(cocobas_tokenents)
|
||||
};
|
||||
|
||||
static imgtoolerr_t cocobas_readfile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t cocobas_readfile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
return basic_readfile(&cocobas_tokens, partition, filename, fork, destf);
|
||||
}
|
||||
|
||||
static imgtoolerr_t cocobas_writefile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t cocobas_writefile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
return basic_writefile(&cocobas_tokens, partition, filename, fork, sourcef, opts);
|
||||
@ -3002,13 +3002,13 @@ static const basictokens dragonbas_tokens =
|
||||
ARRAY_LENGTH(dragonbas_tokenents)
|
||||
};
|
||||
|
||||
static imgtoolerr_t dragonbas_readfile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t dragonbas_readfile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
return basic_readfile(&dragonbas_tokens, partition, filename, fork, destf);
|
||||
}
|
||||
|
||||
static imgtoolerr_t dragonbas_writefile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t dragonbas_writefile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
return basic_writefile(&dragonbas_tokens, partition, filename, fork, sourcef, opts);
|
||||
@ -3047,13 +3047,13 @@ static const basictokens vzbas_tokens =
|
||||
ARRAY_LENGTH(vzbas_tokenents)
|
||||
};
|
||||
|
||||
static imgtoolerr_t vzbas_readfile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t vzbas_readfile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
return basic_readfile(&vzbas_tokens, partition, filename, fork, destf);
|
||||
}
|
||||
|
||||
static imgtoolerr_t vzbas_writefile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t vzbas_writefile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
return basic_writefile(&vzbas_tokens, partition, filename, fork, sourcef, opts);
|
||||
@ -3091,13 +3091,13 @@ static const basictokens bml3bas_tokens =
|
||||
ARRAY_LENGTH(bml3bas_tokenents)
|
||||
};
|
||||
|
||||
static imgtoolerr_t bml3bas_readfile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t bml3bas_readfile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
return basic_readfile(&bml3bas_tokens, partition, filename, fork, destf);
|
||||
}
|
||||
|
||||
static imgtoolerr_t bml3bas_writefile(imgtool::partition *partition, const char *filename,
|
||||
static imgtoolerr_t bml3bas_writefile(imgtool::partition &partition, const char *filename,
|
||||
const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
return basic_writefile(&bml3bas_tokens, partition, filename, fork, sourcef, opts);
|
||||
|
@ -53,7 +53,7 @@ static imgtoolerr_t convert_stream_eolns(imgtool::stream &source, imgtool::strea
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t ascii_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t ascii_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::stream *mem_stream;
|
||||
@ -65,7 +65,7 @@ static imgtoolerr_t ascii_readfile(imgtool::partition *partition, const char *fi
|
||||
goto done;
|
||||
}
|
||||
|
||||
err = partition->read_file(filename, fork, *mem_stream, nullptr);
|
||||
err = partition.read_file(filename, fork, *mem_stream, nullptr);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -82,7 +82,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t ascii_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t ascii_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::stream *mem_stream = nullptr;
|
||||
@ -96,14 +96,14 @@ static imgtoolerr_t ascii_writefile(imgtool::partition *partition, const char *f
|
||||
goto done;
|
||||
}
|
||||
|
||||
eoln = partition->get_info_string(IMGTOOLINFO_STR_EOLN);
|
||||
eoln = partition.get_info_string(IMGTOOLINFO_STR_EOLN);
|
||||
|
||||
err = convert_stream_eolns(sourcef, *mem_stream, eoln);
|
||||
if (err)
|
||||
goto done;
|
||||
mem_stream->seek(SEEK_SET, 0);
|
||||
|
||||
err = partition->write_file(filename, fork, *mem_stream, opts, nullptr);
|
||||
err = partition.write_file(filename, fork, *mem_stream, opts, nullptr);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
|
@ -572,20 +572,20 @@ imgtool::partition::partition(imgtool::image &image, imgtool_class &imgclass, in
|
||||
m_begin_enum = (imgtoolerr_t(*)(imgtool::directory *, const char *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_BEGIN_ENUM);
|
||||
m_next_enum = (imgtoolerr_t(*)(imgtool::directory *, imgtool_dirent *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_NEXT_ENUM);
|
||||
m_close_enum = (void(*)(imgtool::directory *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_CLOSE_ENUM);
|
||||
m_free_space = (imgtoolerr_t(*)(imgtool::partition *, UINT64 *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_FREE_SPACE);
|
||||
m_read_file = (imgtoolerr_t(*)(imgtool::partition *, const char *, const char *, imgtool::stream &)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_READ_FILE);
|
||||
m_write_file = (imgtoolerr_t(*)(imgtool::partition *, const char *, const char *, imgtool::stream &, util::option_resolution *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_WRITE_FILE);
|
||||
m_delete_file = (imgtoolerr_t(*)(imgtool::partition *, const char *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_DELETE_FILE);
|
||||
m_list_forks = (imgtoolerr_t(*)(imgtool::partition *, const char *, imgtool_forkent *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_LIST_FORKS);
|
||||
m_create_dir = (imgtoolerr_t(*)(imgtool::partition *, const char *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_CREATE_DIR);
|
||||
m_delete_dir = (imgtoolerr_t(*)(imgtool::partition *, const char *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_DELETE_DIR);
|
||||
m_list_attrs = (imgtoolerr_t(*)(imgtool::partition *, const char *, UINT32 *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_LIST_ATTRS);
|
||||
m_get_attrs = (imgtoolerr_t(*)(imgtool::partition *, const char *, const UINT32 *, imgtool_attribute *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_GET_ATTRS);
|
||||
m_set_attrs = (imgtoolerr_t(*)(imgtool::partition *, const char *, const UINT32 *, const imgtool_attribute *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_SET_ATTRS);
|
||||
m_free_space = (imgtoolerr_t(*)(imgtool::partition &, UINT64 *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_FREE_SPACE);
|
||||
m_read_file = (imgtoolerr_t(*)(imgtool::partition &, const char *, const char *, imgtool::stream &)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_READ_FILE);
|
||||
m_write_file = (imgtoolerr_t(*)(imgtool::partition &, const char *, const char *, imgtool::stream &, util::option_resolution *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_WRITE_FILE);
|
||||
m_delete_file = (imgtoolerr_t(*)(imgtool::partition &, const char *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_DELETE_FILE);
|
||||
m_list_forks = (imgtoolerr_t(*)(imgtool::partition &, const char *, imgtool_forkent *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_LIST_FORKS);
|
||||
m_create_dir = (imgtoolerr_t(*)(imgtool::partition &, const char *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_CREATE_DIR);
|
||||
m_delete_dir = (imgtoolerr_t(*)(imgtool::partition &, const char *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_DELETE_DIR);
|
||||
m_list_attrs = (imgtoolerr_t(*)(imgtool::partition &, const char *, UINT32 *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_LIST_ATTRS);
|
||||
m_get_attrs = (imgtoolerr_t(*)(imgtool::partition &, const char *, const UINT32 *, imgtool_attribute *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_GET_ATTRS);
|
||||
m_set_attrs = (imgtoolerr_t(*)(imgtool::partition &, const char *, const UINT32 *, const imgtool_attribute *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_SET_ATTRS);
|
||||
m_attr_name = (imgtoolerr_t(*)(UINT32, const imgtool_attribute *, char *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_ATTR_NAME);
|
||||
m_get_iconinfo = (imgtoolerr_t(*)(imgtool::partition *, const char *, imgtool_iconinfo *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_GET_ICON_INFO);
|
||||
m_suggest_transfer = (imgtoolerr_t(*)(imgtool::partition *, const char *, imgtool_transfer_suggestion *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_SUGGEST_TRANSFER);
|
||||
m_get_chain = (imgtoolerr_t(*)(imgtool::partition *, const char *, imgtool_chainent *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_GET_CHAIN);
|
||||
m_get_iconinfo = (imgtoolerr_t(*)(imgtool::partition &, const char *, imgtool_iconinfo *)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_GET_ICON_INFO);
|
||||
m_suggest_transfer = (imgtoolerr_t(*)(imgtool::partition &, const char *, imgtool_transfer_suggestion *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_SUGGEST_TRANSFER);
|
||||
m_get_chain = (imgtoolerr_t(*)(imgtool::partition &, const char *, imgtool_chainent *, size_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_GET_CHAIN);
|
||||
m_writefile_optguide = (const util::option_guide *) imgtool_get_info_ptr(&imgclass, IMGTOOLINFO_PTR_WRITEFILE_OPTGUIDE);
|
||||
|
||||
const char *writefile_optspec = (const char *)imgtool_get_info_ptr(&imgclass, IMGTOOLINFO_STR_WRITEFILE_OPTSPEC);
|
||||
@ -625,7 +625,7 @@ imgtoolerr_t imgtool::partition::open(imgtool::image &image, int partition_index
|
||||
imgtool_class imgclass;
|
||||
imgtool_partition_info partition_info[32];
|
||||
UINT64 base_block, block_count;
|
||||
imgtoolerr_t (*open_partition)(imgtool::partition *partition, UINT64 first_block, UINT64 block_count);
|
||||
imgtoolerr_t (*open_partition)(imgtool::partition &partition, UINT64 first_block, UINT64 block_count);
|
||||
|
||||
if (image.module().list_partitions)
|
||||
{
|
||||
@ -671,11 +671,11 @@ imgtoolerr_t imgtool::partition::open(imgtool::image &image, int partition_index
|
||||
|
||||
|
||||
// call the partition open function, if present
|
||||
open_partition = (imgtoolerr_t (*)(imgtool::partition *, UINT64, UINT64)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_OPEN_PARTITION);
|
||||
open_partition = (imgtoolerr_t (*)(imgtool::partition &, UINT64, UINT64)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_OPEN_PARTITION);
|
||||
if (open_partition)
|
||||
{
|
||||
/* we have an open partition function */
|
||||
err = (*open_partition)(p.get(), base_block, block_count);
|
||||
err = (*open_partition)(*p, base_block, block_count);
|
||||
if (err)
|
||||
goto done;
|
||||
}
|
||||
@ -1330,7 +1330,7 @@ imgtoolerr_t imgtool::partition::list_file_attributes(const char *path, UINT32 *
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = m_list_attrs(this, path, attrs, len);
|
||||
err = m_list_attrs(*this, path, attrs, len);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -1374,7 +1374,7 @@ imgtoolerr_t imgtool::partition::get_file_attributes(const char *path, const UIN
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = m_get_attrs(this, path, attrs, values);
|
||||
err = m_get_attrs(*this, path, attrs, values);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -1408,7 +1408,7 @@ imgtoolerr_t imgtool::partition::put_file_attributes(const char *path, const UIN
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = m_set_attrs(this, path, attrs, values);
|
||||
err = m_set_attrs(*this, path, attrs, values);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -1479,7 +1479,7 @@ imgtoolerr_t imgtool::partition::get_icon_info(const char *path, imgtool_iconinf
|
||||
goto done;
|
||||
|
||||
memset(iconinfo, 0, sizeof(*iconinfo));
|
||||
err = m_get_iconinfo(this, path, iconinfo);
|
||||
err = m_get_iconinfo(*this, path, iconinfo);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -1522,7 +1522,7 @@ imgtoolerr_t imgtool::partition::suggest_file_filters(const char *path,
|
||||
goto done;
|
||||
|
||||
// invoke the module's suggest call
|
||||
err = m_suggest_transfer(this, path, suggestions, suggestions_length);
|
||||
err = m_suggest_transfer(*this, path, suggestions, suggestions_length);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -1595,7 +1595,7 @@ imgtoolerr_t imgtool::partition::get_chain(const char *path, imgtool_chainent *c
|
||||
chain[i].block = ~0;
|
||||
}
|
||||
|
||||
return m_get_chain(this, path, chain, chain_size - 1);
|
||||
return m_get_chain(*this, path, chain, chain_size - 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1681,7 +1681,7 @@ imgtoolerr_t imgtool::partition::get_free_space(UINT64 &sz)
|
||||
if (!m_free_space)
|
||||
return (imgtoolerr_t)(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
|
||||
|
||||
err = m_free_space(this, &sz);
|
||||
err = m_free_space(*this, &sz);
|
||||
if (err)
|
||||
return (imgtoolerr_t)(err | IMGTOOLERR_SRC_IMAGEFILE);
|
||||
|
||||
@ -1716,7 +1716,7 @@ imgtoolerr_t imgtool::partition::read_file(const char *filename, const char *for
|
||||
goto done;
|
||||
}
|
||||
|
||||
err = u.read_file(this, filename, fork, destf);
|
||||
err = u.read_file(*this, filename, fork, destf);
|
||||
if (err)
|
||||
{
|
||||
err = markerrorsource(err);
|
||||
@ -1735,7 +1735,7 @@ imgtoolerr_t imgtool::partition::read_file(const char *filename, const char *for
|
||||
goto done;
|
||||
|
||||
// invoke the actual module
|
||||
err = m_read_file(this, filename, fork, destf);
|
||||
err = m_read_file(*this, filename, fork, destf);
|
||||
if (err)
|
||||
{
|
||||
err = markerrorsource(err);
|
||||
@ -1782,7 +1782,7 @@ imgtoolerr_t imgtool::partition::write_file(const char *filename, const char *fo
|
||||
goto done;
|
||||
}
|
||||
|
||||
err = u.write_file(this, filename, fork, sourcef, opts);
|
||||
err = u.write_file(*this, filename, fork, sourcef, opts);
|
||||
if (err)
|
||||
{
|
||||
err = markerrorsource(err);
|
||||
@ -1832,7 +1832,7 @@ imgtoolerr_t imgtool::partition::write_file(const char *filename, const char *fo
|
||||
// if free_space is implemented; do a quick check to see if space is available
|
||||
if (m_free_space)
|
||||
{
|
||||
err = m_free_space(this, &free_space);
|
||||
err = m_free_space(*this, &free_space);
|
||||
if (err)
|
||||
{
|
||||
err = markerrorsource(err);
|
||||
@ -1849,7 +1849,7 @@ imgtoolerr_t imgtool::partition::write_file(const char *filename, const char *fo
|
||||
}
|
||||
|
||||
// actually invoke the write file handler
|
||||
err = m_write_file(this, filename, fork, sourcef, opts);
|
||||
err = m_write_file(*this, filename, fork, sourcef, opts);
|
||||
if (err)
|
||||
{
|
||||
err = markerrorsource(err);
|
||||
@ -2015,7 +2015,7 @@ imgtoolerr_t imgtool::partition::delete_file(const char *fname)
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = m_delete_file(this, fname);
|
||||
err = m_delete_file(*this, fname);
|
||||
if (err)
|
||||
{
|
||||
err = markerrorsource(err);
|
||||
@ -2062,7 +2062,7 @@ imgtoolerr_t imgtool::partition::list_file_forks(const char *path, imgtool_forke
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = m_list_forks(this, path, ents, len);
|
||||
err = m_list_forks(*this, path, ents, len);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -2107,7 +2107,7 @@ imgtoolerr_t imgtool::partition::create_directory(const char *path)
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = m_create_dir(this, path);
|
||||
err = m_create_dir(*this, path);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
@ -2152,7 +2152,7 @@ imgtoolerr_t imgtool::partition::delete_directory(const char *path)
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = m_delete_dir(this, path);
|
||||
err = m_delete_dir(*this, path);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
|
@ -206,20 +206,20 @@ namespace imgtool
|
||||
std::function<imgtoolerr_t(imgtool::directory *enumeration, const char *path)> m_begin_enum;
|
||||
std::function<imgtoolerr_t(imgtool::directory *enumeration, imgtool_dirent *ent)> m_next_enum;
|
||||
std::function<void(imgtool::directory *enumeration)> m_close_enum;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, UINT64 *size)> m_free_space;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)> m_read_file;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)> m_write_file;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *filename)> m_delete_file;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path, imgtool_forkent *ents, size_t len)> m_list_forks;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path)> m_create_dir;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path)> m_delete_dir;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path, UINT32 *attrs, size_t len)> m_list_attrs;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)> m_get_attrs;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)> m_set_attrs;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, UINT64 *size)> m_free_space;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)> m_read_file;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)> m_write_file;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *filename)> m_delete_file;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path, imgtool_forkent *ents, size_t len)> m_list_forks;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path)> m_create_dir;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path)> m_delete_dir;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path, UINT32 *attrs, size_t len)> m_list_attrs;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)> m_get_attrs;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)> m_set_attrs;
|
||||
std::function<imgtoolerr_t(UINT32 attribute, const imgtool_attribute *attr, char *buffer, size_t buffer_len)> m_attr_name;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path, imgtool_iconinfo *iconinfo)> m_get_iconinfo;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)> m_suggest_transfer;
|
||||
std::function<imgtoolerr_t(imgtool::partition *partition, const char *path, imgtool_chainent *chain, size_t chain_size)> m_get_chain;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path, imgtool_iconinfo *iconinfo)> m_get_iconinfo;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)> m_suggest_transfer;
|
||||
std::function<imgtoolerr_t(imgtool::partition &partition, const char *path, imgtool_chainent *chain, size_t chain_size)> m_get_chain;
|
||||
|
||||
const util::option_guide *m_writefile_optguide;
|
||||
std::string m_writefile_optspec;
|
||||
|
@ -48,8 +48,8 @@ union filterinfo
|
||||
void * f; /* generic function pointers */
|
||||
const char *s; /* generic strings */
|
||||
|
||||
imgtoolerr_t (*read_file)(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
imgtoolerr_t (*write_file)(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts);
|
||||
imgtoolerr_t (*read_file)(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
imgtoolerr_t (*write_file)(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts);
|
||||
imgtoolerr_t (*check_stream)(imgtool::stream &stream, imgtool_suggestion_viability_t *viability);
|
||||
};
|
||||
|
||||
@ -262,21 +262,21 @@ union imgtoolinfo
|
||||
imgtoolerr_t (*begin_enum) (imgtool::directory *enumeration, const char *path);
|
||||
imgtoolerr_t (*next_enum) (imgtool::directory *enumeration, imgtool_dirent *ent);
|
||||
void (*close_enum) (imgtool::directory *enumeration);
|
||||
imgtoolerr_t (*open_partition) (imgtool::partition *partition, UINT64 first_block, UINT64 block_count);
|
||||
imgtoolerr_t (*free_space) (imgtool::partition *partition, UINT64 *size);
|
||||
imgtoolerr_t (*read_file) (imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
imgtoolerr_t (*write_file) (imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts);
|
||||
imgtoolerr_t (*delete_file) (imgtool::partition *partition, const char *filename);
|
||||
imgtoolerr_t (*list_forks) (imgtool::partition *partition, const char *path, imgtool_forkent *ents, size_t len);
|
||||
imgtoolerr_t (*create_dir) (imgtool::partition *partition, const char *path);
|
||||
imgtoolerr_t (*delete_dir) (imgtool::partition *partition, const char *path);
|
||||
imgtoolerr_t (*list_attrs) (imgtool::partition *partition, const char *path, UINT32 *attrs, size_t len);
|
||||
imgtoolerr_t (*get_attrs) (imgtool::partition *partition, const char *path, const UINT32 *attrs, imgtool_attribute *values);
|
||||
imgtoolerr_t (*set_attrs) (imgtool::partition *partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values);
|
||||
imgtoolerr_t (*open_partition) (imgtool::partition &partition, UINT64 first_block, UINT64 block_count);
|
||||
imgtoolerr_t (*free_space) (imgtool::partition &partition, UINT64 *size);
|
||||
imgtoolerr_t (*read_file) (imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
imgtoolerr_t (*write_file) (imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts);
|
||||
imgtoolerr_t (*delete_file) (imgtool::partition &partition, const char *filename);
|
||||
imgtoolerr_t (*list_forks) (imgtool::partition &partition, const char *path, imgtool_forkent *ents, size_t len);
|
||||
imgtoolerr_t (*create_dir) (imgtool::partition &partition, const char *path);
|
||||
imgtoolerr_t (*delete_dir) (imgtool::partition &partition, const char *path);
|
||||
imgtoolerr_t (*list_attrs) (imgtool::partition &partition, const char *path, UINT32 *attrs, size_t len);
|
||||
imgtoolerr_t (*get_attrs) (imgtool::partition &partition, const char *path, const UINT32 *attrs, imgtool_attribute *values);
|
||||
imgtoolerr_t (*set_attrs) (imgtool::partition &partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values);
|
||||
imgtoolerr_t (*attr_name) (UINT32 attribute, const imgtool_attribute *attr, char *buffer, size_t buffer_len);
|
||||
imgtoolerr_t (*get_iconinfo) (imgtool::partition *partition, const char *path, imgtool_iconinfo *iconinfo);
|
||||
imgtoolerr_t (*suggest_transfer) (imgtool::partition *partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length);
|
||||
imgtoolerr_t (*get_chain) (imgtool::partition *partition, const char *path, imgtool_chainent *chain, size_t chain_size);
|
||||
imgtoolerr_t (*get_iconinfo) (imgtool::partition &partition, const char *path, imgtool_iconinfo *iconinfo);
|
||||
imgtoolerr_t (*suggest_transfer) (imgtool::partition &partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length);
|
||||
imgtoolerr_t (*get_chain) (imgtool::partition &partition, const char *path, imgtool_chainent *chain, size_t chain_size);
|
||||
imgtoolerr_t (*get_geometry) (imgtool::image &image, UINT32 *tracks, UINT32 *heads, UINT32 *sectors);
|
||||
imgtoolerr_t (*read_sector) (imgtool::image &image, UINT32 track, UINT32 head, UINT32 sector, std::vector<UINT8> &buffer);
|
||||
imgtoolerr_t (*write_sector) (imgtool::image &image, UINT32 track, UINT32 head, UINT32 sector, const void *buffer, size_t len, int ddam);
|
||||
|
@ -2035,10 +2035,10 @@ static void amiga_image_closeenum(imgtool::directory *enumeration)
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t amiga_image_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
const int data_size = is_ffs(image) ? BSIZE : BSIZE-24;
|
||||
root_block root;
|
||||
bitmap_block bm;
|
||||
@ -2089,9 +2089,9 @@ static imgtoolerr_t amiga_image_freespace(imgtool::partition *partition, UINT64
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t amiga_image_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
imgtoolerr_t ret;
|
||||
file_block file;
|
||||
int filesize, block;
|
||||
@ -2126,9 +2126,9 @@ static imgtoolerr_t amiga_image_readfile(imgtool::partition *partition, const ch
|
||||
* the Directory block (or from the same-hash-value list) and the bitmap is
|
||||
* updated. File header block, Data blocks and File extension blocks are not
|
||||
* cleared, but the bitmap blocks are updated. */
|
||||
static imgtoolerr_t amiga_image_deletefile(imgtool::partition *partition, const char *fname)
|
||||
static imgtoolerr_t amiga_image_deletefile(imgtool::partition &partition, const char *fname)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
imgtoolerr_t ret;
|
||||
int parent, block;
|
||||
char filename[31];
|
||||
@ -2199,7 +2199,7 @@ static imgtoolerr_t amiga_image_deletefile(imgtool::partition *partition, const
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t amiga_image_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
return IMGTOOLERR_UNIMPLEMENTED;
|
||||
}
|
||||
@ -2311,9 +2311,9 @@ static imgtoolerr_t amiga_image_create(imgtool::image &img, imgtool::stream::ptr
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_createdir(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t amiga_image_createdir(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
imgtoolerr_t ret;
|
||||
|
||||
/* Create directories */
|
||||
@ -2328,25 +2328,25 @@ static imgtoolerr_t amiga_image_createdir(imgtool::partition *partition, const c
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_getattrs(imgtool::partition *partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)
|
||||
static imgtoolerr_t amiga_image_getattrs(imgtool::partition &partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)
|
||||
{
|
||||
return IMGTOOLERR_UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_setattrs(imgtool::partition *partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)
|
||||
static imgtoolerr_t amiga_image_setattrs(imgtool::partition &partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)
|
||||
{
|
||||
return IMGTOOLERR_UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_geticoninfo(imgtool::partition *partition, const char *path, imgtool_iconinfo *iconinfo)
|
||||
static imgtoolerr_t amiga_image_geticoninfo(imgtool::partition &partition, const char *path, imgtool_iconinfo *iconinfo)
|
||||
{
|
||||
return IMGTOOLERR_UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
static imgtoolerr_t amiga_image_suggesttransfer(imgtool::partition *partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
static imgtoolerr_t amiga_image_suggesttransfer(imgtool::partition &partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
{
|
||||
return IMGTOOLERR_UNIMPLEMENTED;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ struct granule_list_t {
|
||||
#define BML3_OPTIONS_FTYPE 'T'
|
||||
#define BML3_OPTIONS_ASCII 'M'
|
||||
|
||||
static imgtoolerr_t bml3_diskimage_deletefile(imgtool::partition *partition, const char *fname);
|
||||
static imgtoolerr_t bml3_diskimage_deletefile(imgtool::partition &partition, const char *fname);
|
||||
|
||||
|
||||
|
||||
@ -612,14 +612,14 @@ eof:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t bml3_diskimage_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t bml3_diskimage_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
floperr_t ferr;
|
||||
UINT8 i;
|
||||
size_t s = 0;
|
||||
UINT8 granule_count;
|
||||
UINT8 granule_map[MAX_GRANULEMAP_SIZE];
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
bml3_diskinfo *info = bml3_get_diskinfo(image);
|
||||
|
||||
ferr = get_granule_map(image, granule_map, &granule_count);
|
||||
@ -672,12 +672,12 @@ static imgtoolerr_t delete_entry(imgtool::image &img, struct bml3_dirent *ent, i
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t bml3_diskimage_readfile(imgtool::partition *partition, const char *fname, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t bml3_diskimage_readfile(imgtool::partition &partition, const char *fname, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
struct bml3_dirent ent;
|
||||
size_t size;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
|
||||
err = lookup_bml3_file(img, fname, &ent, nullptr);
|
||||
if (err)
|
||||
@ -695,11 +695,11 @@ static imgtoolerr_t bml3_diskimage_readfile(imgtool::partition *partition, const
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t bml3_diskimage_writefile(imgtool::partition *partition, const char *fname, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
static imgtoolerr_t bml3_diskimage_writefile(imgtool::partition &partition, const char *fname, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
{
|
||||
floperr_t ferr;
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
bml3_diskinfo *info = bml3_get_diskinfo(img);
|
||||
struct bml3_dirent ent, ent2;
|
||||
size_t i;
|
||||
@ -816,10 +816,10 @@ static imgtoolerr_t bml3_diskimage_writefile(imgtool::partition *partition, cons
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t bml3_diskimage_deletefile(imgtool::partition *partition, const char *fname)
|
||||
static imgtoolerr_t bml3_diskimage_deletefile(imgtool::partition &partition, const char *fname)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
int pos = 0;
|
||||
struct bml3_dirent ent;
|
||||
|
||||
@ -832,10 +832,10 @@ static imgtoolerr_t bml3_diskimage_deletefile(imgtool::partition *partition, con
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t bml3_diskimage_suggesttransfer(imgtool::partition *partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
static imgtoolerr_t bml3_diskimage_suggesttransfer(imgtool::partition &partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
struct bml3_dirent ent;
|
||||
int pos;
|
||||
|
||||
|
@ -132,11 +132,11 @@ static void concept_image_info(imgtool::image &img, char *string, size_t len);
|
||||
static imgtoolerr_t concept_image_beginenum(imgtool::directory *enumeration, const char *path);
|
||||
static imgtoolerr_t concept_image_nextenum(imgtool::directory *enumeration, imgtool_dirent *ent);
|
||||
static void concept_image_closeenum(imgtool::directory *enumeration);
|
||||
static imgtoolerr_t concept_image_freespace(imgtool::partition *partition, UINT64 *size);
|
||||
static imgtoolerr_t concept_image_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
static imgtoolerr_t concept_image_freespace(imgtool::partition &partition, UINT64 *size);
|
||||
static imgtoolerr_t concept_image_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
#if 0
|
||||
static imgtoolerr_t concept_image_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream *sourcef, util::option_resolution *writeoptions);
|
||||
static imgtoolerr_t concept_image_deletefile(imgtool::partition *partition, const char *filename);
|
||||
static imgtoolerr_t concept_image_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream *sourcef, util::option_resolution *writeoptions);
|
||||
static imgtoolerr_t concept_image_deletefile(imgtool::partition &partition, const char *filename);
|
||||
static imgtoolerr_t concept_image_create(const imgtool_module *mod, imgtool::stream *f, util::option_resolution *createoptions);
|
||||
#endif
|
||||
|
||||
@ -404,9 +404,9 @@ static void concept_image_closeenum(imgtool::directory *enumeration)
|
||||
/*
|
||||
Compute free space on disk image
|
||||
*/
|
||||
static imgtoolerr_t concept_image_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t concept_image_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
concept_image *image = get_concept_image(img);
|
||||
int free_blocks;
|
||||
int i;
|
||||
@ -430,9 +430,9 @@ static imgtoolerr_t concept_image_freespace(imgtool::partition *partition, UINT6
|
||||
/*
|
||||
Extract a file from a concept_image.
|
||||
*/
|
||||
static imgtoolerr_t concept_image_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t concept_image_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
concept_image *image = get_concept_image(img);
|
||||
size_t filename_len = strlen(filename);
|
||||
unsigned char concept_fname[16];
|
||||
@ -467,7 +467,7 @@ static imgtoolerr_t concept_image_readfile(imgtool::partition *partition, const
|
||||
/*
|
||||
Add a file to a concept_image.
|
||||
*/
|
||||
static imgtoolerr_t concept_image_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream *sourcef, util::option_resolution *writeoptions)
|
||||
static imgtoolerr_t concept_image_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream *sourcef, util::option_resolution *writeoptions)
|
||||
{
|
||||
/* ... */
|
||||
|
||||
@ -477,7 +477,7 @@ static imgtoolerr_t concept_image_writefile(imgtool::partition *partition, const
|
||||
/*
|
||||
Delete a file from a concept_image.
|
||||
*/
|
||||
static imgtoolerr_t concept_image_deletefile(imgtool::partition *partition, const char *filename)
|
||||
static imgtoolerr_t concept_image_deletefile(imgtool::partition &partition, const char *filename)
|
||||
{
|
||||
/* ... */
|
||||
|
||||
|
@ -428,17 +428,17 @@ static void cybiko_image_close_enum( imgtool::directory *enumeration)
|
||||
// nothing
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_free_space(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t cybiko_image_free_space(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
if (size) *size = cfs_calc_free_space( cfs, cfs_calc_free_blocks( cfs));
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_read_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t cybiko_image_read_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
UINT8 buffer[MAX_PAGE_SIZE];
|
||||
UINT16 file_id, part_id = 0, old_part_id;
|
||||
@ -463,9 +463,9 @@ static imgtoolerr_t cybiko_image_read_file(imgtool::partition *partition, const
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_write_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t cybiko_image_write_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
UINT8 buffer[MAX_PAGE_SIZE];
|
||||
UINT16 file_id, part_id = 0, free_blocks;
|
||||
@ -523,9 +523,9 @@ static imgtoolerr_t cybiko_image_write_file(imgtool::partition *partition, const
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_delete_file( imgtool::partition *partition, const char *filename)
|
||||
static imgtoolerr_t cybiko_image_delete_file(imgtool::partition &partition, const char *filename)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
UINT16 file_id;
|
||||
// find file
|
||||
|
@ -398,17 +398,17 @@ static void cybiko_image_close_enum( imgtool::directory *enumeration)
|
||||
// nothing
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_free_space( imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t cybiko_image_free_space(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
if (size) *size = cfs_calc_free_space( cfs, cfs_calc_free_blocks( cfs));
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_read_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t cybiko_image_read_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
UINT8 buffer[MAX_PAGE_SIZE];
|
||||
UINT16 file_id, part_id = 0, old_part_id;
|
||||
@ -435,9 +435,9 @@ static imgtoolerr_t cybiko_image_read_file(imgtool::partition *partition, const
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_write_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t cybiko_image_write_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
UINT8 buffer[MAX_PAGE_SIZE];
|
||||
UINT16 file_id, part_id = 0, free_blocks;
|
||||
@ -498,9 +498,9 @@ static imgtoolerr_t cybiko_image_write_file(imgtool::partition *partition, const
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t cybiko_image_delete_file( imgtool::partition *partition, const char *filename)
|
||||
static imgtoolerr_t cybiko_image_delete_file(imgtool::partition &partition, const char *filename)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
cybiko_file_system *cfs = get_cfs(image);
|
||||
UINT16 file_id;
|
||||
// check filename
|
||||
|
@ -275,14 +275,14 @@ static const char fat32_string[8] = { 'F', 'A', 'T', '3', '2', ' ', ' ', ' ' };
|
||||
|
||||
|
||||
|
||||
static fat_partition_info *fat_get_partition_info(imgtool::partition *partition)
|
||||
static fat_partition_info *fat_get_partition_info(imgtool::partition &partition)
|
||||
{
|
||||
return (fat_partition_info *)partition->extra_bytes();
|
||||
return (fat_partition_info *)partition.extra_bytes();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_read_sector(imgtool::partition *partition, UINT32 sector_index,
|
||||
static imgtoolerr_t fat_read_sector(imgtool::partition &partition, UINT32 sector_index,
|
||||
int offset, void *buffer, size_t buffer_len)
|
||||
{
|
||||
//const fat_partition_info *disk_info;
|
||||
@ -294,14 +294,14 @@ static imgtoolerr_t fat_read_sector(imgtool::partition *partition, UINT32 sector
|
||||
//disk_info = fat_get_partition_info(partition);
|
||||
|
||||
/* sanity check */
|
||||
err = partition->get_block_size(block_size);
|
||||
err = partition.get_block_size(block_size);
|
||||
if (err)
|
||||
return err;
|
||||
assert(block_size == sizeof(data));
|
||||
|
||||
while(buffer_len > 0)
|
||||
{
|
||||
err = partition->read_block(sector_index++, data);
|
||||
err = partition.read_block(sector_index++, data);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@ -317,7 +317,7 @@ static imgtoolerr_t fat_read_sector(imgtool::partition *partition, UINT32 sector
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_write_sector(imgtool::partition *partition, UINT32 sector_index,
|
||||
static imgtoolerr_t fat_write_sector(imgtool::partition &partition, UINT32 sector_index,
|
||||
int offset, const void *buffer, size_t buffer_len)
|
||||
{
|
||||
//const fat_partition_info *disk_info;
|
||||
@ -330,7 +330,7 @@ static imgtoolerr_t fat_write_sector(imgtool::partition *partition, UINT32 secto
|
||||
//disk_info = fat_get_partition_info(partition);
|
||||
|
||||
/* sanity check */
|
||||
err = partition->get_block_size(block_size);
|
||||
err = partition.get_block_size(block_size);
|
||||
if (err)
|
||||
return err;
|
||||
assert(block_size == sizeof(data));
|
||||
@ -341,7 +341,7 @@ static imgtoolerr_t fat_write_sector(imgtool::partition *partition, UINT32 secto
|
||||
|
||||
if ((offset != 0) || (buffer_len < sizeof(data)))
|
||||
{
|
||||
err = partition->read_block(sector_index, data);
|
||||
err = partition.read_block(sector_index, data);
|
||||
if (err)
|
||||
return err;
|
||||
memcpy(data + offset, buffer, len);
|
||||
@ -352,7 +352,7 @@ static imgtoolerr_t fat_write_sector(imgtool::partition *partition, UINT32 secto
|
||||
write_data = buffer;
|
||||
}
|
||||
|
||||
err = partition->write_block(sector_index++, write_data);
|
||||
err = partition.write_block(sector_index++, write_data);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@ -365,7 +365,7 @@ static imgtoolerr_t fat_write_sector(imgtool::partition *partition, UINT32 secto
|
||||
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
static imgtoolerr_t fat_clear_sector(imgtool::partition *partition, UINT32 sector_index, UINT8 data)
|
||||
static imgtoolerr_t fat_clear_sector(imgtool::partition &partition, UINT32 sector_index, UINT8 data)
|
||||
{
|
||||
char buf[FAT_SECLEN];
|
||||
memset(buf, data, sizeof(buf));
|
||||
@ -374,7 +374,7 @@ static imgtoolerr_t fat_clear_sector(imgtool::partition *partition, UINT32 secto
|
||||
#endif
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_open(imgtool::partition *partition, UINT64 first_block, UINT64 block_count)
|
||||
static imgtoolerr_t fat_partition_open(imgtool::partition &partition, UINT64 first_block, UINT64 block_count)
|
||||
{
|
||||
UINT8 header[FAT_SECLEN];
|
||||
imgtoolerr_t err;
|
||||
@ -593,7 +593,7 @@ static imgtoolerr_t fat_partition_create(imgtool::image &image, UINT64 first_blo
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_load_fat(imgtool::partition *partition, UINT8 **fat_table)
|
||||
static imgtoolerr_t fat_load_fat(imgtool::partition &partition, UINT8 **fat_table)
|
||||
{
|
||||
imgtoolerr_t err = IMGTOOLERR_SUCCESS;
|
||||
const fat_partition_info *disk_info;
|
||||
@ -641,7 +641,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_save_fat(imgtool::partition *partition, const UINT8 *fat_table)
|
||||
static imgtoolerr_t fat_save_fat(imgtool::partition &partition, const UINT8 *fat_table)
|
||||
{
|
||||
imgtoolerr_t err = IMGTOOLERR_SUCCESS;
|
||||
const fat_partition_info *disk_info;
|
||||
@ -673,7 +673,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static UINT32 fat_get_fat_entry(imgtool::partition *partition, const UINT8 *fat_table, UINT32 fat_entry)
|
||||
static UINT32 fat_get_fat_entry(imgtool::partition &partition, const UINT8 *fat_table, UINT32 fat_entry)
|
||||
{
|
||||
const fat_partition_info *disk_info;
|
||||
UINT64 entry;
|
||||
@ -720,7 +720,7 @@ static UINT32 fat_get_fat_entry(imgtool::partition *partition, const UINT8 *fat_
|
||||
|
||||
|
||||
|
||||
static void fat_set_fat_entry(imgtool::partition *partition, UINT8 *fat_table, UINT32 fat_entry, UINT32 value)
|
||||
static void fat_set_fat_entry(imgtool::partition &partition, UINT8 *fat_table, UINT32 fat_entry, UINT32 value)
|
||||
{
|
||||
const fat_partition_info *disk_info;
|
||||
UINT64 entry;
|
||||
@ -747,7 +747,7 @@ static void fat_set_fat_entry(imgtool::partition *partition, UINT8 *fat_table, U
|
||||
|
||||
|
||||
|
||||
static void fat_debug_integrity_check(imgtool::partition *partition, const UINT8 *fat_table, const fat_file *file)
|
||||
static void fat_debug_integrity_check(imgtool::partition &partition, const UINT8 *fat_table, const fat_file *file)
|
||||
{
|
||||
#ifdef MAME_DEBUG
|
||||
/* debug function to test the integrity of a file */
|
||||
@ -770,7 +770,7 @@ static void fat_debug_integrity_check(imgtool::partition *partition, const UINT8
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_seek_file(imgtool::partition *partition, fat_file *file, UINT32 pos)
|
||||
static imgtoolerr_t fat_seek_file(imgtool::partition &partition, fat_file *file, UINT32 pos)
|
||||
{
|
||||
imgtoolerr_t err = IMGTOOLERR_SUCCESS;
|
||||
const fat_partition_info *disk_info;
|
||||
@ -831,7 +831,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static UINT32 fat_get_filepos_sector_index(imgtool::partition *partition, fat_file *file)
|
||||
static UINT32 fat_get_filepos_sector_index(imgtool::partition &partition, fat_file *file)
|
||||
{
|
||||
UINT32 sector_index;
|
||||
const fat_partition_info *disk_info;
|
||||
@ -873,7 +873,7 @@ static imgtoolerr_t fat_corrupt_file_error(const fat_file *file)
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_readwrite_file(imgtool::partition *partition, fat_file *file,
|
||||
static imgtoolerr_t fat_readwrite_file(imgtool::partition &partition, fat_file *file,
|
||||
void *buffer, size_t buffer_len, size_t *bytes_read, int read_or_write)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
@ -921,7 +921,7 @@ static imgtoolerr_t fat_readwrite_file(imgtool::partition *partition, fat_file *
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_read_file(imgtool::partition *partition, fat_file *file,
|
||||
static imgtoolerr_t fat_read_file(imgtool::partition &partition, fat_file *file,
|
||||
void *buffer, size_t buffer_len, size_t *bytes_read)
|
||||
{
|
||||
return fat_readwrite_file(partition, file, buffer, buffer_len, bytes_read, 0);
|
||||
@ -929,7 +929,7 @@ static imgtoolerr_t fat_read_file(imgtool::partition *partition, fat_file *file,
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_write_file(imgtool::partition *partition, fat_file *file,
|
||||
static imgtoolerr_t fat_write_file(imgtool::partition &partition, fat_file *file,
|
||||
const void *buffer, size_t buffer_len, size_t *bytes_read)
|
||||
{
|
||||
return fat_readwrite_file(partition, file, (void *) buffer, buffer_len, bytes_read, 1);
|
||||
@ -937,7 +937,7 @@ static imgtoolerr_t fat_write_file(imgtool::partition *partition, fat_file *file
|
||||
|
||||
|
||||
|
||||
static UINT32 fat_allocate_cluster(imgtool::partition *partition, UINT8 *fat_table)
|
||||
static UINT32 fat_allocate_cluster(imgtool::partition &partition, UINT8 *fat_table)
|
||||
{
|
||||
const fat_partition_info *disk_info;
|
||||
UINT32 i, val;
|
||||
@ -959,7 +959,7 @@ static UINT32 fat_allocate_cluster(imgtool::partition *partition, UINT8 *fat_tab
|
||||
|
||||
|
||||
/* sets the size of a file; ~0 means 'delete' */
|
||||
static imgtoolerr_t fat_set_file_size(imgtool::partition *partition, fat_file *file,
|
||||
static imgtoolerr_t fat_set_file_size(imgtool::partition &partition, fat_file *file,
|
||||
UINT32 new_size)
|
||||
{
|
||||
imgtoolerr_t err = IMGTOOLERR_SUCCESS;
|
||||
@ -1277,7 +1277,7 @@ static UINT32 fat_setup_time(time_t ansi_time)
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_read_dirent(imgtool::partition *partition, fat_file *file,
|
||||
static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *file,
|
||||
fat_dirent *ent, fat_freeentry_info *freeent)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
@ -1600,7 +1600,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static void fat_bump_dirent(imgtool::partition *partition, UINT8 *entry, size_t entry_len)
|
||||
static void fat_bump_dirent(imgtool::partition &partition, UINT8 *entry, size_t entry_len)
|
||||
{
|
||||
UINT8 *sfn_entry;
|
||||
int pos, digit_count, i;
|
||||
@ -1661,7 +1661,7 @@ static void fat_bump_dirent(imgtool::partition *partition, UINT8 *entry, size_t
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_lookup_path(imgtool::partition *partition, const char *path,
|
||||
static imgtoolerr_t fat_lookup_path(imgtool::partition &partition, const char *path,
|
||||
creation_policy_t create, fat_file *file)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
@ -1816,7 +1816,7 @@ static imgtoolerr_t fat_partition_beginenum(imgtool::directory *enumeration, con
|
||||
|
||||
file = (fat_file *) enumeration->extra_bytes();
|
||||
|
||||
err = fat_lookup_path(&enumeration->partition(), path, CREATE_NONE, file);
|
||||
err = fat_lookup_path(enumeration->partition(), path, CREATE_NONE, file);
|
||||
if (err)
|
||||
return err;
|
||||
if (!file->directory)
|
||||
@ -1833,7 +1833,7 @@ static imgtoolerr_t fat_partition_nextenum(imgtool::directory *enumeration, imgt
|
||||
fat_dirent fatent;
|
||||
|
||||
file = (fat_file *) enumeration->extra_bytes();
|
||||
err = fat_read_dirent(&enumeration->partition(), file, &fatent, NULL);
|
||||
err = fat_read_dirent(enumeration->partition(), file, &fatent, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@ -1850,7 +1850,7 @@ static imgtoolerr_t fat_partition_nextenum(imgtool::directory *enumeration, imgt
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_read_bootblock(imgtool::partition *partition, imgtool::stream &stream)
|
||||
static imgtoolerr_t fat_read_bootblock(imgtool::partition &partition, imgtool::stream &stream)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
UINT8 block[FAT_SECLEN];
|
||||
@ -1865,7 +1865,7 @@ static imgtoolerr_t fat_read_bootblock(imgtool::partition *partition, imgtool::s
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_write_bootblock(imgtool::partition *partition, imgtool::stream &stream)
|
||||
static imgtoolerr_t fat_write_bootblock(imgtool::partition &partition, imgtool::stream &stream)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
UINT8 block[FAT_SECLEN];
|
||||
@ -1899,7 +1899,7 @@ static imgtoolerr_t fat_write_bootblock(imgtool::partition *partition, imgtool::
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t fat_partition_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
fat_file file;
|
||||
@ -1931,7 +1931,7 @@ static imgtoolerr_t fat_partition_readfile(imgtool::partition *partition, const
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t fat_partition_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
fat_file file;
|
||||
@ -1971,7 +1971,7 @@ static imgtoolerr_t fat_partition_writefile(imgtool::partition *partition, const
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_delete(imgtool::partition *partition, const char *filename, unsigned int dir)
|
||||
static imgtoolerr_t fat_partition_delete(imgtool::partition &partition, const char *filename, unsigned int dir)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
fat_file file;
|
||||
@ -2001,14 +2001,14 @@ static imgtoolerr_t fat_partition_delete(imgtool::partition *partition, const ch
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_deletefile(imgtool::partition *partition, const char *filename)
|
||||
static imgtoolerr_t fat_partition_deletefile(imgtool::partition &partition, const char *filename)
|
||||
{
|
||||
return fat_partition_delete(partition, filename, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t fat_partition_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
const fat_partition_info *disk_info;
|
||||
@ -2036,7 +2036,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_createdir(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t fat_partition_createdir(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
fat_file file;
|
||||
@ -2070,7 +2070,7 @@ static imgtoolerr_t fat_partition_createdir(imgtool::partition *partition, const
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t fat_partition_deletedir(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t fat_partition_deletedir(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
return fat_partition_delete(partition, path, 1);
|
||||
}
|
||||
|
@ -443,12 +443,12 @@ static imgtoolerr_t hp48_list_partitions(imgtool::image &img,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t hp48_open_partition(imgtool::partition *part,
|
||||
static imgtoolerr_t hp48_open_partition(imgtool::partition &part,
|
||||
UINT64 first_block, UINT64 block_count)
|
||||
{
|
||||
imgtool::image &img(part->image());
|
||||
imgtool::image &img(part.image());
|
||||
hp48_card* c = get_hp48_card(img);
|
||||
hp48_partition* p = (hp48_partition*) part->extra_bytes();
|
||||
hp48_partition* p = (hp48_partition*) part.extra_bytes();
|
||||
|
||||
if ( first_block + block_count > c->size )
|
||||
return IMGTOOLERR_INVALIDPARTITION;
|
||||
@ -477,10 +477,10 @@ static imgtoolerr_t hp48_beginenum(imgtool::directory *enumeration,
|
||||
static imgtoolerr_t hp48_nextenum(imgtool::directory *enumeration,
|
||||
imgtool_dirent *ent)
|
||||
{
|
||||
imgtool::partition *part = &enumeration->partition();
|
||||
//imgtool::image &img(part->image());
|
||||
imgtool::partition &part(enumeration->partition());
|
||||
//imgtool::image &img(part.image());
|
||||
//hp48_card* c = get_hp48_card(img);
|
||||
hp48_partition* p = (hp48_partition*) part->extra_bytes();
|
||||
hp48_partition* p = (hp48_partition*) part.extra_bytes();
|
||||
hp48_directory* d = (hp48_directory*) enumeration->extra_bytes();
|
||||
|
||||
UINT8* data = p->data;
|
||||
@ -533,11 +533,11 @@ static imgtoolerr_t hp48_nextenum(imgtool::directory *enumeration,
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t hp48_freespace(imgtool::partition *part, UINT64 *size)
|
||||
static imgtoolerr_t hp48_freespace(imgtool::partition &part, UINT64 *size)
|
||||
{
|
||||
//imgtool::image &img(part->image());
|
||||
//imgtool::image &img(part.image());
|
||||
//hp48_card* c = get_hp48_card(img);
|
||||
hp48_partition* p = (hp48_partition*) part->extra_bytes();
|
||||
hp48_partition* p = (hp48_partition*) part.extra_bytes();
|
||||
|
||||
*size = p->size - (find_end(p)+1)/2;
|
||||
|
||||
@ -546,14 +546,14 @@ static imgtoolerr_t hp48_freespace(imgtool::partition *part, UINT64 *size)
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t hp48_readfile(imgtool::partition *part,
|
||||
static imgtoolerr_t hp48_readfile(imgtool::partition &part,
|
||||
const char *filename,
|
||||
const char *fork,
|
||||
imgtool::stream &destf)
|
||||
{
|
||||
//imgtool::image &img(part->image());
|
||||
//imgtool::image &img(part.image());
|
||||
//hp48_card* c = get_hp48_card(img);
|
||||
hp48_partition* p = (hp48_partition*) part->extra_bytes();
|
||||
hp48_partition* p = (hp48_partition*) part.extra_bytes();
|
||||
|
||||
/* find entry */
|
||||
int totalsize, start, size;
|
||||
@ -591,12 +591,12 @@ static imgtoolerr_t hp48_readfile(imgtool::partition *part,
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t hp48_deletefile(imgtool::partition *part,
|
||||
static imgtoolerr_t hp48_deletefile(imgtool::partition &part,
|
||||
const char *filename)
|
||||
{
|
||||
imgtool::image &img(part->image());
|
||||
imgtool::image &img(part.image());
|
||||
hp48_card* c = get_hp48_card(img);
|
||||
hp48_partition* p = (hp48_partition*) part->extra_bytes();
|
||||
hp48_partition* p = (hp48_partition*) part.extra_bytes();
|
||||
|
||||
/* find entry */
|
||||
int totalsize;
|
||||
@ -617,15 +617,15 @@ static imgtoolerr_t hp48_deletefile(imgtool::partition *part,
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t hp48_writefile(imgtool::partition *part,
|
||||
static imgtoolerr_t hp48_writefile(imgtool::partition &part,
|
||||
const char *filename,
|
||||
const char *fork,
|
||||
imgtool::stream &sourcef,
|
||||
util::option_resolution *opts)
|
||||
{
|
||||
imgtool::image &img(part->image());
|
||||
imgtool::image &img(part.image());
|
||||
hp48_card* c = get_hp48_card(img);
|
||||
hp48_partition* p = (hp48_partition*) part->extra_bytes();
|
||||
hp48_partition* p = (hp48_partition*) part.extra_bytes();
|
||||
|
||||
/* check header */
|
||||
char head[8];
|
||||
|
@ -1120,9 +1120,9 @@ static imgtoolerr_t hp9845_tape_next_enum (imgtool::directory *enumeration, imgt
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t hp9845_tape_free_space(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t hp9845_tape_free_space(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
tape_state_t& state = get_tape_state(partition->image());
|
||||
tape_state_t& state = get_tape_state(partition.image());
|
||||
tape_image_t& tape_image = get_tape_image(state);
|
||||
|
||||
*size = tape_image.free_sectors() * SECTOR_LEN;
|
||||
@ -1130,9 +1130,9 @@ static imgtoolerr_t hp9845_tape_free_space(imgtool::partition *partition, UINT64
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t hp9845_tape_read_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t hp9845_tape_read_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
tape_state_t& state = get_tape_state(partition->image());
|
||||
tape_state_t& state = get_tape_state(partition.image());
|
||||
tape_image_t& tape_image = get_tape_image(state);
|
||||
|
||||
unsigned idx;
|
||||
@ -1164,9 +1164,9 @@ static imgtoolerr_t hp9845_tape_read_file(imgtool::partition *partition, const c
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t hp9845_tape_write_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t hp9845_tape_write_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
tape_state_t& state = get_tape_state(partition->image());
|
||||
tape_state_t& state = get_tape_state(partition.image());
|
||||
tape_image_t& tape_image = get_tape_image(state);
|
||||
|
||||
unsigned idx;
|
||||
@ -1250,9 +1250,9 @@ static imgtoolerr_t hp9845_tape_write_file(imgtool::partition *partition, const
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t hp9845_tape_delete_file(imgtool::partition *partition, const char *filename)
|
||||
static imgtoolerr_t hp9845_tape_delete_file(imgtool::partition &partition, const char *filename)
|
||||
{
|
||||
tape_state_t& state = get_tape_state(partition->image());
|
||||
tape_state_t& state = get_tape_state(partition.image());
|
||||
tape_image_t& tape_image = get_tape_image(state);
|
||||
|
||||
unsigned idx;
|
||||
@ -1397,7 +1397,7 @@ static bool dump_string(imgtool::stream &inp, imgtool::stream &out , unsigned le
|
||||
return true;
|
||||
}
|
||||
|
||||
static imgtoolerr_t hp9845data_read_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t hp9845data_read_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtool::stream *inp_data;
|
||||
imgtoolerr_t res;
|
||||
@ -1538,7 +1538,7 @@ static bool split_string_n_dump(const char *s , imgtool::stream &dest)
|
||||
return true;
|
||||
}
|
||||
|
||||
static imgtoolerr_t hp9845data_write_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t hp9845data_write_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtool::stream *out_data;
|
||||
|
||||
|
@ -5276,9 +5276,9 @@ static void mac_image_exit(imgtool::image *img);
|
||||
static void mac_image_info(imgtool::image &img, char *string, size_t len);
|
||||
static imgtoolerr_t mac_image_beginenum(imgtool::directory *enumeration, const char *path);
|
||||
static imgtoolerr_t mac_image_nextenum(imgtool::directory *enumeration, imgtool_dirent *ent);
|
||||
static imgtoolerr_t mac_image_freespace(imgtool::partition *partition, UINT64 *size);
|
||||
static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions);
|
||||
static imgtoolerr_t mac_image_freespace(imgtool::partition &partition, UINT64 *size);
|
||||
static imgtoolerr_t mac_image_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf);
|
||||
static imgtoolerr_t mac_image_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions);
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
/*
|
||||
@ -5571,9 +5571,9 @@ static imgtoolerr_t mac_image_nextenum(imgtool::directory *enumeration, imgtool_
|
||||
/*
|
||||
Compute free space on disk image in bytes
|
||||
*/
|
||||
static imgtoolerr_t mac_image_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t mac_image_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
*size = ((UINT64) get_imgref(image)->freeABs) * 512;
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
@ -5610,10 +5610,10 @@ static imgtoolerr_t mac_get_comment(struct mac_l2_imgref *image, mac_str255 file
|
||||
/*
|
||||
Extract a file from a disk image.
|
||||
*/
|
||||
static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t mac_image_readfile(imgtool::partition &partition, const char *fpath, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct mac_l2_imgref *image = get_imgref(img);
|
||||
UINT32 parID;
|
||||
mac_str255 filename;
|
||||
@ -5661,9 +5661,9 @@ static imgtoolerr_t mac_image_readfile(imgtool::partition *partition, const char
|
||||
/*
|
||||
Add a file to a disk image.
|
||||
*/
|
||||
static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
static imgtoolerr_t mac_image_writefile(imgtool::partition &partition, const char *fpath, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct mac_l2_imgref *image = get_imgref(img);
|
||||
UINT32 parID;
|
||||
mac_str255 filename;
|
||||
@ -5738,14 +5738,14 @@ static imgtoolerr_t mac_image_writefile(imgtool::partition *partition, const cha
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t mac_image_listforks(imgtool::partition *partition, const char *path, imgtool_forkent *ents, size_t len)
|
||||
static imgtoolerr_t mac_image_listforks(imgtool::partition &partition, const char *path, imgtool_forkent *ents, size_t len)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
UINT32 parID;
|
||||
mac_str255 filename;
|
||||
mac_dirent cat_info;
|
||||
int fork_num = 0;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct mac_l2_imgref *image = get_imgref(img);
|
||||
|
||||
/* resolve path and fetch file info from directory/catalog */
|
||||
@ -5776,10 +5776,10 @@ static imgtoolerr_t mac_image_listforks(imgtool::partition *partition, const cha
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t mac_image_getattrs(imgtool::partition *partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)
|
||||
static imgtoolerr_t mac_image_getattrs(imgtool::partition &partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
UINT32 parID;
|
||||
mac_str255 filename;
|
||||
mac_dirent cat_info;
|
||||
@ -5844,13 +5844,13 @@ static imgtoolerr_t mac_image_getattrs(imgtool::partition *partition, const char
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t mac_image_setattrs(imgtool::partition *partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)
|
||||
static imgtoolerr_t mac_image_setattrs(imgtool::partition &partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
UINT32 parID;
|
||||
mac_str255 filename;
|
||||
mac_dirent cat_info;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct mac_l2_imgref *image = get_imgref(img);
|
||||
int i;
|
||||
|
||||
@ -6111,7 +6111,7 @@ static int load_icon(UINT32 *dest, const void *resource_fork, UINT64 resource_fo
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t mac_image_geticoninfo(imgtool::partition *partition, const char *path, imgtool_iconinfo *iconinfo)
|
||||
static imgtoolerr_t mac_image_geticoninfo(imgtool::partition &partition, const char *path, imgtool_iconinfo *iconinfo)
|
||||
{
|
||||
static const UINT32 mac_palette_1bpp[2] = { 0xFFFFFF, 0x000000 };
|
||||
|
||||
@ -6317,13 +6317,13 @@ done:
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static imgtoolerr_t mac_image_suggesttransfer(imgtool::partition *partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
static imgtoolerr_t mac_image_suggesttransfer(imgtool::partition &partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
UINT32 parID;
|
||||
mac_str255 filename;
|
||||
mac_dirent cat_info;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct mac_l2_imgref *image = get_imgref(img);
|
||||
mac_filecategory_t file_category = MAC_FILECATEGORY_DATA;
|
||||
|
||||
|
@ -63,7 +63,7 @@ static UINT32 pad128(UINT32 length)
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t macbinary_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
static const UINT32 attrs[] =
|
||||
{
|
||||
@ -101,7 +101,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char
|
||||
imgtool_attribute attr_values[10];
|
||||
|
||||
/* get the forks */
|
||||
err = partition->list_file_forks(filename, fork_entries, sizeof(fork_entries));
|
||||
err = partition.list_file_forks(filename, fork_entries, sizeof(fork_entries));
|
||||
if (err)
|
||||
return err;
|
||||
for (i = 0; fork_entries[i].type != FORK_END; i++)
|
||||
@ -113,7 +113,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char
|
||||
}
|
||||
|
||||
/* get the attributes */
|
||||
err = partition->get_file_attributes(filename, attrs, attr_values);
|
||||
err = partition.get_file_attributes(filename, attrs, attr_values);
|
||||
if (err && (ERRORCODE(err) != IMGTOOLERR_UNIMPLEMENTED))
|
||||
return err;
|
||||
if (err == IMGTOOLERR_SUCCESS)
|
||||
@ -160,7 +160,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char
|
||||
|
||||
if (data_fork)
|
||||
{
|
||||
err = partition->read_file(filename, "", destf, NULL);
|
||||
err = partition.read_file(filename, "", destf, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@ -169,7 +169,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char
|
||||
|
||||
if (resource_fork)
|
||||
{
|
||||
err = partition->read_file(filename, "RESOURCE_FORK", destf, NULL);
|
||||
err = partition.read_file(filename, "RESOURCE_FORK", destf, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@ -181,7 +181,7 @@ static imgtoolerr_t macbinary_readfile(imgtool::partition *partition, const char
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t write_fork(imgtool::partition *partition, const char *filename, const char *fork,
|
||||
static imgtoolerr_t write_fork(imgtool::partition &partition, const char *filename, const char *fork,
|
||||
imgtool::stream &sourcef, UINT64 pos, UINT64 fork_len, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t err = IMGTOOLERR_SUCCESS;
|
||||
@ -203,7 +203,7 @@ static imgtoolerr_t write_fork(imgtool::partition *partition, const char *filena
|
||||
mem_stream->fill(0, fork_len);
|
||||
|
||||
mem_stream->seek(0, SEEK_SET);
|
||||
err = partition->write_file(filename, fork, *mem_stream, opts, NULL);
|
||||
err = partition.write_file(filename, fork, *mem_stream, opts, NULL);
|
||||
if (err)
|
||||
goto done;
|
||||
}
|
||||
@ -216,7 +216,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t macbinary_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
static const UINT32 attrs[] =
|
||||
{
|
||||
@ -233,7 +233,7 @@ static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const cha
|
||||
0
|
||||
};
|
||||
imgtoolerr_t err;
|
||||
imgtool::image *image = &partition->image();
|
||||
imgtool::image *image = &partition.image();
|
||||
UINT8 header[128];
|
||||
UINT32 datafork_size;
|
||||
UINT32 resourcefork_size;
|
||||
@ -332,7 +332,7 @@ static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const cha
|
||||
attr_values[8].i = script_code;
|
||||
attr_values[9].i = extended_flags;
|
||||
|
||||
err = partition->put_file_attributes(filename, attrs, attr_values);
|
||||
err = partition.put_file_attributes(filename, attrs, attr_values);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
@ -341,7 +341,8 @@ static imgtoolerr_t macbinary_writefile(imgtool::partition *partition, const cha
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this was completely broken - it was calling macbinary_writefile() with a nullptr partition
|
||||
#if 0
|
||||
static imgtoolerr_t macbinary_checkstream(imgtool::stream &stream, imgtool_suggestion_viability_t *viability)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
@ -360,6 +361,7 @@ static imgtoolerr_t macbinary_checkstream(imgtool::stream &stream, imgtool_sugge
|
||||
}
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -372,6 +374,6 @@ void filter_macbinary_getinfo(UINT32 state, union filterinfo *info)
|
||||
case FILTINFO_STR_EXTENSION: info->s = "bin"; break;
|
||||
case FILTINFO_PTR_READFILE: info->read_file = macbinary_readfile; break;
|
||||
case FILTINFO_PTR_WRITEFILE: info->write_file = macbinary_writefile; break;
|
||||
case FILTINFO_PTR_CHECKSTREAM: info->check_stream = macbinary_checkstream; break;
|
||||
//case FILTINFO_PTR_CHECKSTREAM: info->check_stream = macbinary_checkstream; break;
|
||||
}
|
||||
}
|
||||
|
@ -971,9 +971,9 @@ static imgtoolerr_t os9_diskimage_nextenum(imgtool::directory *enumeration, imgt
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t os9_diskimage_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t os9_diskimage_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
const os9_diskinfo *disk_info;
|
||||
UINT32 free_lsns;
|
||||
|
||||
@ -986,10 +986,10 @@ static imgtoolerr_t os9_diskimage_freespace(imgtool::partition *partition, UINT6
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t os9_diskimage_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t os9_diskimage_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
const os9_diskinfo *disk_info;
|
||||
struct os9_fileinfo file_info;
|
||||
UINT8 buffer[256];
|
||||
@ -1024,10 +1024,10 @@ static imgtoolerr_t os9_diskimage_readfile(imgtool::partition *partition, const
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t os9_diskimage_writefile(imgtool::partition *partition, const char *path, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t os9_diskimage_writefile(imgtool::partition &partition, const char *path, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
struct os9_fileinfo file_info;
|
||||
size_t write_size;
|
||||
dynamic_buffer buf;
|
||||
@ -1079,11 +1079,11 @@ done:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t os9_diskimage_delete(imgtool::partition *partition, const char *path,
|
||||
static imgtoolerr_t os9_diskimage_delete(imgtool::partition &partition, const char *path,
|
||||
unsigned int delete_directory)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
struct os9_fileinfo file_info;
|
||||
UINT32 dirent_lsn, dirent_index;
|
||||
UINT32 entry_lsn, entry_index;
|
||||
@ -1160,17 +1160,17 @@ static imgtoolerr_t os9_diskimage_delete(imgtool::partition *partition, const ch
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t os9_diskimage_deletefile(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t os9_diskimage_deletefile(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
return os9_diskimage_delete(partition, path, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t os9_diskimage_createdir(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t os9_diskimage_createdir(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
struct os9_fileinfo file_info;
|
||||
UINT8 dir_data[64];
|
||||
UINT32 parent_lsn;
|
||||
@ -1200,7 +1200,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t os9_diskimage_deletedir(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t os9_diskimage_deletedir(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
return os9_diskimage_delete(partition, path, 1);
|
||||
}
|
||||
|
@ -1673,10 +1673,10 @@ static imgtoolerr_t prodos_write_file_tree(imgtool::image &image, UINT32 *filesi
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t prodos_diskimage_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_diskinfo *di;
|
||||
UINT8 *bitmap = NULL;
|
||||
UINT16 i;
|
||||
@ -1702,10 +1702,10 @@ done:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t prodos_diskimage_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
UINT16 key_pointer;
|
||||
int nest_level;
|
||||
@ -1742,10 +1742,10 @@ static imgtoolerr_t prodos_diskimage_readfile(imgtool::partition *partition, con
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t prodos_diskimage_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
prodos_direnum direnum;
|
||||
UINT64 file_size;
|
||||
@ -1780,10 +1780,10 @@ static imgtoolerr_t prodos_diskimage_writefile(imgtool::partition *partition, co
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_deletefile(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t prodos_diskimage_deletefile(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
prodos_direnum direnum;
|
||||
|
||||
@ -1813,10 +1813,10 @@ static imgtoolerr_t prodos_diskimage_deletefile(imgtool::partition *partition, c
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_listforks(imgtool::partition *partition, const char *path, imgtool_forkent *ents, size_t len)
|
||||
static imgtoolerr_t prodos_diskimage_listforks(imgtool::partition &partition, const char *path, imgtool_forkent *ents, size_t len)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
prodos_direnum direnum;
|
||||
int fork_num = 0;
|
||||
@ -1849,10 +1849,10 @@ static imgtoolerr_t prodos_diskimage_listforks(imgtool::partition *partition, co
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_createdir(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t prodos_diskimage_createdir(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
prodos_direnum direnum;
|
||||
|
||||
@ -1907,10 +1907,10 @@ static imgtoolerr_t prodos_free_directory(imgtool::image &image, UINT8 *volume_b
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_deletedir(imgtool::partition *partition, const char *path)
|
||||
static imgtoolerr_t prodos_diskimage_deletedir(imgtool::partition &partition, const char *path)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
prodos_direnum direnum;
|
||||
UINT8 *volume_bitmap = NULL;
|
||||
@ -1997,10 +1997,10 @@ static imgtoolerr_t prodos_get_file_tree(imgtool::image &image, imgtool_chainent
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_getattrs(imgtool::partition *partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)
|
||||
static imgtoolerr_t prodos_diskimage_getattrs(imgtool::partition &partition, const char *path, const UINT32 *attrs, imgtool_attribute *values)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
int i;
|
||||
|
||||
@ -2060,10 +2060,10 @@ static imgtoolerr_t prodos_diskimage_getattrs(imgtool::partition *partition, con
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_setattrs(imgtool::partition *partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)
|
||||
static imgtoolerr_t prodos_diskimage_setattrs(imgtool::partition &partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
prodos_direnum direnum;
|
||||
int i;
|
||||
@ -2128,10 +2128,10 @@ static imgtoolerr_t prodos_diskimage_setattrs(imgtool::partition *partition, con
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_suggesttransfer(imgtool::partition *partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
static imgtoolerr_t prodos_diskimage_suggesttransfer(imgtool::partition &partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
mac_filecategory_t file_category = MAC_FILECATEGORY_DATA;
|
||||
|
||||
@ -2151,10 +2151,10 @@ static imgtoolerr_t prodos_diskimage_suggesttransfer(imgtool::partition *partiti
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t prodos_diskimage_getchain(imgtool::partition *partition, const char *path, imgtool_chainent *chain, size_t chain_size)
|
||||
static imgtoolerr_t prodos_diskimage_getchain(imgtool::partition &partition, const char *path, imgtool_chainent *chain, size_t chain_size)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
prodos_dirent ent;
|
||||
size_t chain_pos = 0;
|
||||
int fork_num;
|
||||
|
@ -511,9 +511,9 @@ static void datapack_close_enum( imgtool::directory *enumeration)
|
||||
{
|
||||
}
|
||||
|
||||
static imgtoolerr_t datapack_free_space( imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t datapack_free_space(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
psion_pack *pack = get_psion_pack(image);
|
||||
UINT32 pack_size = 0;
|
||||
|
||||
@ -526,9 +526,9 @@ static imgtoolerr_t datapack_free_space( imgtool::partition *partition, UINT64 *
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t datapack_read_file(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t datapack_read_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
psion_pack *pack = get_psion_pack(image);
|
||||
int index = seek_file_name(pack, filename);
|
||||
|
||||
@ -558,9 +558,9 @@ static imgtoolerr_t datapack_read_file(imgtool::partition *partition, const char
|
||||
return IMGTOOLERR_FILENOTFOUND;
|
||||
}
|
||||
|
||||
static imgtoolerr_t datapack_write_file( imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t datapack_write_file(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
psion_pack *pack = get_psion_pack(image);
|
||||
static const UINT8 data_head[4] = {0x02, 0x80, 0x00, 0x00};
|
||||
UINT8 head[3];
|
||||
@ -620,9 +620,9 @@ static imgtoolerr_t datapack_write_file( imgtool::partition *partition, const ch
|
||||
return IMGTOOLERR_CORRUPTIMAGE;
|
||||
}
|
||||
|
||||
static imgtoolerr_t datapack_delete_file( imgtool::partition *partition, const char *filename)
|
||||
static imgtoolerr_t datapack_delete_file(imgtool::partition &partition, const char *filename)
|
||||
{
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
psion_pack *pack = get_psion_pack(image);
|
||||
int index = seek_file_name(pack, filename);
|
||||
|
||||
|
@ -326,14 +326,14 @@ eof:
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t rsdos_diskimage_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t rsdos_diskimage_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
floperr_t ferr;
|
||||
UINT8 i;
|
||||
size_t s = 0;
|
||||
UINT8 granule_count;
|
||||
UINT8 granule_map[MAX_GRANULEMAP_SIZE];
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
|
||||
ferr = get_granule_map(image, granule_map, &granule_count);
|
||||
if (ferr)
|
||||
@ -385,12 +385,12 @@ static imgtoolerr_t delete_entry(imgtool::image &img, struct rsdos_dirent *ent,
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t rsdos_diskimage_readfile(imgtool::partition *partition, const char *fname, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t rsdos_diskimage_readfile(imgtool::partition &partition, const char *fname, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
struct rsdos_dirent ent;
|
||||
size_t size;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
|
||||
err = lookup_rsdos_file(img, fname, &ent, NULL);
|
||||
if (err)
|
||||
@ -408,11 +408,11 @@ static imgtoolerr_t rsdos_diskimage_readfile(imgtool::partition *partition, cons
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t rsdos_diskimage_writefile(imgtool::partition *partition, const char *fname, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
static imgtoolerr_t rsdos_diskimage_writefile(imgtool::partition &partition, const char *fname, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
{
|
||||
floperr_t ferr;
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct rsdos_dirent ent, ent2;
|
||||
size_t i;
|
||||
UINT64 sz;
|
||||
@ -513,10 +513,10 @@ static imgtoolerr_t rsdos_diskimage_writefile(imgtool::partition *partition, con
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t rsdos_diskimage_deletefile(imgtool::partition *partition, const char *fname)
|
||||
static imgtoolerr_t rsdos_diskimage_deletefile(imgtool::partition &partition, const char *fname)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
int pos;
|
||||
struct rsdos_dirent ent;
|
||||
|
||||
@ -529,10 +529,10 @@ static imgtoolerr_t rsdos_diskimage_deletefile(imgtool::partition *partition, co
|
||||
|
||||
|
||||
|
||||
static imgtoolerr_t rsdos_diskimage_suggesttransfer(imgtool::partition *partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
static imgtoolerr_t rsdos_diskimage_suggesttransfer(imgtool::partition &partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
{
|
||||
imgtoolerr_t err;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
struct rsdos_dirent ent;
|
||||
int pos;
|
||||
|
||||
|
@ -881,14 +881,14 @@ static imgtoolerr_t thom_list_partitions(imgtool::image &img,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thom_open_partition(imgtool::partition *part,
|
||||
static imgtoolerr_t thom_open_partition(imgtool::partition &part,
|
||||
UINT64 first_block, UINT64 block_count)
|
||||
{
|
||||
imgtool::image &img(part->image());
|
||||
imgtool::image &img(part.image());
|
||||
thom_floppy* f = get_thom_floppy(img);
|
||||
if ( first_block >= f->heads )
|
||||
return IMGTOOLERR_INVALIDPARTITION;
|
||||
* ( (int*) part->extra_bytes() ) = first_block;
|
||||
* ( (int*) part.extra_bytes() ) = first_block;
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
@ -904,9 +904,9 @@ static imgtoolerr_t thom_begin_enum(imgtool::directory *enumeration,
|
||||
static imgtoolerr_t thom_next_enum(imgtool::directory *enumeration,
|
||||
imgtool_dirent *ent)
|
||||
{
|
||||
imgtool::partition *part = &enumeration->partition();
|
||||
int head = *( (int*) part->extra_bytes() );
|
||||
imgtool::image &img(part->image());
|
||||
imgtool::partition &part(enumeration->partition());
|
||||
int head = *( (int*) part.extra_bytes() );
|
||||
imgtool::image &img(part.image());
|
||||
thom_floppy* f = get_thom_floppy(img);
|
||||
int* n = (int*) enumeration->extra_bytes();
|
||||
thom_dirent d;
|
||||
@ -939,23 +939,23 @@ static imgtoolerr_t thom_next_enum(imgtool::directory *enumeration,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thom_free_space(imgtool::partition *part, UINT64 *size)
|
||||
static imgtoolerr_t thom_free_space(imgtool::partition &part, UINT64 *size)
|
||||
{
|
||||
int head = *( (int*) part->extra_bytes() );
|
||||
imgtool::image &img(part->image());
|
||||
int head = *( (int*) part.extra_bytes() );
|
||||
imgtool::image &img(part.image());
|
||||
thom_floppy* f = get_thom_floppy(img);
|
||||
int nb = thom_get_free_blocks( f, head );
|
||||
(*size) = nb * f->sectuse_size * 8;
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thom_read_file(imgtool::partition *part,
|
||||
static imgtoolerr_t thom_read_file(imgtool::partition &part,
|
||||
const char *filename,
|
||||
const char *fork,
|
||||
imgtool::stream &destf)
|
||||
{
|
||||
int head = *( (int*) part->extra_bytes() );
|
||||
imgtool::image &img(part->image());
|
||||
int head = *( (int*) part.extra_bytes() );
|
||||
imgtool::image &img(part.image());
|
||||
thom_floppy* f = get_thom_floppy(img);
|
||||
thom_dirent d;
|
||||
char name[9], ext[4], fname[14];
|
||||
@ -973,11 +973,11 @@ static imgtoolerr_t thom_read_file(imgtool::partition *part,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thom_delete_file(imgtool::partition *part,
|
||||
static imgtoolerr_t thom_delete_file(imgtool::partition &part,
|
||||
const char *filename)
|
||||
{
|
||||
int head = *( (int*) part->extra_bytes() );
|
||||
imgtool::image &img(part->image());
|
||||
int head = *( (int*) part.extra_bytes() );
|
||||
imgtool::image &img(part.image());
|
||||
thom_floppy* f = get_thom_floppy(img);
|
||||
thom_dirent d;
|
||||
char name[9], ext[4], fname[14];
|
||||
@ -994,14 +994,14 @@ static imgtoolerr_t thom_delete_file(imgtool::partition *part,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thom_write_file(imgtool::partition *part,
|
||||
static imgtoolerr_t thom_write_file(imgtool::partition &part,
|
||||
const char *filename,
|
||||
const char *fork,
|
||||
imgtool::stream &sourcef,
|
||||
util::option_resolution *opts)
|
||||
{
|
||||
int head = *( (int*) part->extra_bytes() );
|
||||
imgtool::image &img(part->image());
|
||||
int head = *( (int*) part.extra_bytes() );
|
||||
imgtool::image &img(part.image());
|
||||
thom_floppy* f = get_thom_floppy(img);
|
||||
thom_dirent d;
|
||||
int size = sourcef.size();
|
||||
@ -1078,13 +1078,13 @@ static imgtoolerr_t thom_write_file(imgtool::partition *part,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thom_suggest_transfer(imgtool::partition *part,
|
||||
static imgtoolerr_t thom_suggest_transfer(imgtool::partition &part,
|
||||
const char *fname,
|
||||
imgtool_transfer_suggestion *suggestions,
|
||||
size_t suggestions_length)
|
||||
{
|
||||
int head = *( (int*) part->extra_bytes() );
|
||||
imgtool::image &img(part->image());
|
||||
int head = *( (int*) part.extra_bytes() );
|
||||
imgtool::image &img(part.image());
|
||||
thom_floppy* f = get_thom_floppy(img);
|
||||
thom_dirent d;
|
||||
int is_basic = 0;
|
||||
@ -1321,7 +1321,7 @@ static void thom_encrypt(imgtool::stream &out, imgtool::stream &in)
|
||||
}
|
||||
}
|
||||
|
||||
static imgtoolerr_t thomcrypt_read_file(imgtool::partition *part,
|
||||
static imgtoolerr_t thomcrypt_read_file(imgtool::partition &part,
|
||||
const char *name,
|
||||
const char *fork, imgtool::stream &dst)
|
||||
{
|
||||
@ -1356,7 +1356,7 @@ static imgtoolerr_t thomcrypt_read_file(imgtool::partition *part,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thomcrypt_write_file(imgtool::partition *part,
|
||||
static imgtoolerr_t thomcrypt_write_file(imgtool::partition &part,
|
||||
const char *name,
|
||||
const char *fork, imgtool::stream &src,
|
||||
util::option_resolution *opts)
|
||||
@ -1404,7 +1404,7 @@ void filter_thomcrypt_getinfo(UINT32 state, union filterinfo *info)
|
||||
}
|
||||
|
||||
/* untokenization automatically decrypt protected files */
|
||||
static imgtoolerr_t thom_basic_read_file(imgtool::partition *part,
|
||||
static imgtoolerr_t thom_basic_read_file(imgtool::partition &part,
|
||||
const char *name,
|
||||
const char *fork,
|
||||
imgtool::stream &dst,
|
||||
@ -1481,7 +1481,7 @@ static imgtoolerr_t thom_basic_read_file(imgtool::partition *part,
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t thom_basic_write_file(imgtool::partition *part,
|
||||
static imgtoolerr_t thom_basic_write_file(imgtool::partition &part,
|
||||
const char *name,
|
||||
const char *fork,
|
||||
imgtool::stream &src,
|
||||
@ -1493,14 +1493,14 @@ static imgtoolerr_t thom_basic_write_file(imgtool::partition *part,
|
||||
|
||||
|
||||
#define FILTER(short,long) \
|
||||
static imgtoolerr_t short##_read_file(imgtool::partition *part, \
|
||||
static imgtoolerr_t short##_read_file(imgtool::partition &part, \
|
||||
const char *name, \
|
||||
const char *fork, \
|
||||
imgtool::stream &dst) \
|
||||
{ \
|
||||
return thom_basic_read_file( part, name, fork, dst, short ); \
|
||||
} \
|
||||
static imgtoolerr_t short##_write_file(imgtool::partition *part, \
|
||||
static imgtoolerr_t short##_write_file(imgtool::partition &part, \
|
||||
const char *name, \
|
||||
const char *fork, \
|
||||
imgtool::stream &src, \
|
||||
|
@ -3864,11 +3864,11 @@ static imgtoolerr_t dsk_image_beginenum(imgtool::directory *enumeration, const c
|
||||
static imgtoolerr_t dsk_image_nextenum(imgtool::directory *enumeration, imgtool_dirent *ent);
|
||||
static imgtoolerr_t win_image_beginenum(imgtool::directory *enumeration, const char *path);
|
||||
static imgtoolerr_t win_image_nextenum(imgtool::directory *enumeration, imgtool_dirent *ent);
|
||||
static imgtoolerr_t ti99_image_freespace(imgtool::partition *partition, UINT64 *size);
|
||||
static imgtoolerr_t ti99_image_readfile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &destf);
|
||||
static imgtoolerr_t ti99_image_writefile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions);
|
||||
static imgtoolerr_t dsk_image_deletefile(imgtool::partition *partition, const char *fpath);
|
||||
static imgtoolerr_t win_image_deletefile(imgtool::partition *partition, const char *fpath);
|
||||
static imgtoolerr_t ti99_image_freespace(imgtool::partition &partition, UINT64 *size);
|
||||
static imgtoolerr_t ti99_image_readfile(imgtool::partition &partition, const char *fpath, const char *fork, imgtool::stream &destf);
|
||||
static imgtoolerr_t ti99_image_writefile(imgtool::partition &partition, const char *fpath, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions);
|
||||
static imgtoolerr_t dsk_image_deletefile(imgtool::partition &partition, const char *fpath);
|
||||
static imgtoolerr_t win_image_deletefile(imgtool::partition &partition, const char *fpath);
|
||||
static imgtoolerr_t dsk_image_create_mess(imgtool::image &image, imgtool::stream::ptr &&stream, util::option_resolution *createoptions);
|
||||
static imgtoolerr_t dsk_image_create_v9t9(imgtool::image &image, imgtool::stream::ptr &&stream, util::option_resolution *createoptions);
|
||||
|
||||
@ -4483,9 +4483,9 @@ static imgtoolerr_t win_image_nextenum(imgtool::directory *enumeration, imgtool_
|
||||
/*
|
||||
Compute free space on disk image (in AUs)
|
||||
*/
|
||||
static imgtoolerr_t ti99_image_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t ti99_image_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct ti99_lvl2_imgref *image = get_lvl2_imgref(img);
|
||||
size_t freeAUs;
|
||||
int i;
|
||||
@ -4507,9 +4507,9 @@ static imgtoolerr_t ti99_image_freespace(imgtool::partition *partition, UINT64 *
|
||||
/*
|
||||
Extract a file from a ti99_image. The file is saved in tifile format.
|
||||
*/
|
||||
static imgtoolerr_t ti99_image_readfile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t ti99_image_readfile(imgtool::partition &partition, const char *fpath, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
#if 1
|
||||
|
||||
/* extract data as TIFILES */
|
||||
@ -4649,9 +4649,9 @@ static imgtoolerr_t ti99_image_readfile(imgtool::partition *partition, const cha
|
||||
/*
|
||||
Add a file to a ti99_image. The file must be in tifile format.
|
||||
*/
|
||||
static imgtoolerr_t ti99_image_writefile(imgtool::partition *partition, const char *fpath, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
static imgtoolerr_t ti99_image_writefile(imgtool::partition &partition, const char *fpath, const char *fork, imgtool::stream &sourcef, util::option_resolution *writeoptions)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct ti99_lvl2_imgref *image = get_lvl2_imgref(img);
|
||||
const char *filename;
|
||||
char ti_fname[10];
|
||||
@ -4875,9 +4875,9 @@ static imgtoolerr_t ti99_image_writefile(imgtool::partition *partition, const ch
|
||||
/*
|
||||
Delete a file from a ti99_image.
|
||||
*/
|
||||
static imgtoolerr_t dsk_image_deletefile(imgtool::partition *partition, const char *fpath)
|
||||
static imgtoolerr_t dsk_image_deletefile(imgtool::partition &partition, const char *fpath)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct ti99_lvl2_imgref *image = get_lvl2_imgref(img);
|
||||
dsk_fdr fdr;
|
||||
int i, cluster_index;
|
||||
@ -5017,9 +5017,9 @@ static imgtoolerr_t dsk_image_deletefile(imgtool::partition *partition, const ch
|
||||
return (imgtoolerr_t)0;
|
||||
}
|
||||
|
||||
static imgtoolerr_t win_image_deletefile(imgtool::partition *partition, const char *fpath)
|
||||
static imgtoolerr_t win_image_deletefile(imgtool::partition &partition, const char *fpath)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
struct ti99_lvl2_imgref *image = get_lvl2_imgref(img);
|
||||
int parent_ddr_AU, is_dir, catalog_index;
|
||||
win_fdr fdr;
|
||||
|
@ -397,11 +397,11 @@ static void ti990_image_info(imgtool::image &img, char *string, size_t len);
|
||||
static imgtoolerr_t ti990_image_beginenum(imgtool::directory *enumeration, const char *path);
|
||||
static imgtoolerr_t ti990_image_nextenum(imgtool::directory *enumeration, imgtool_dirent *ent);
|
||||
static void ti990_image_closeenum(imgtool::directory *enumeration);
|
||||
static imgtoolerr_t ti990_image_freespace(imgtool::partition *partition, UINT64 *size);
|
||||
static imgtoolerr_t ti990_image_freespace(imgtool::partition &partition, UINT64 *size);
|
||||
#ifdef UNUSED_FUNCTION
|
||||
static imgtoolerr_t ti990_image_readfile(imgtool::partition *partition, const char *fpath, imgtool::stream *destf);
|
||||
static imgtoolerr_t ti990_image_writefile(imgtool::partition *partition, const char *fpath, imgtool::stream *sourcef, util::option_resolution *writeoptions);
|
||||
static imgtoolerr_t ti990_image_deletefile(imgtool::partition *partition, const char *fpath);
|
||||
static imgtoolerr_t ti990_image_readfile(imgtool::partition &partition, const char *fpath, imgtool::stream *destf);
|
||||
static imgtoolerr_t ti990_image_writefile(imgtool::partition &partition, const char *fpath, imgtool::stream *sourcef, util::option_resolution *writeoptions);
|
||||
static imgtoolerr_t ti990_image_deletefile(imgtool::partition &partition, const char *fpath);
|
||||
#endif
|
||||
static imgtoolerr_t ti990_image_create(imgtool::image &image, imgtool::stream::ptr &&stream, util::option_resolution *createoptions);
|
||||
|
||||
@ -1419,9 +1419,9 @@ static void ti990_image_closeenum(imgtool::directory *enumeration)
|
||||
/*
|
||||
Compute free space on disk image (in ADUs)
|
||||
*/
|
||||
static imgtoolerr_t ti990_image_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t ti990_image_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
ti990_image *image = get_ti990_image(img);
|
||||
int totadus = get_UINT16BE(image->sec0.tna);
|
||||
int adu, record, sub_adu;
|
||||
@ -1459,7 +1459,7 @@ static imgtoolerr_t ti990_image_freespace(imgtool::partition *partition, UINT64
|
||||
/*
|
||||
Extract a file from a ti990_image.
|
||||
*/
|
||||
static imgtoolerr_t ti990_image_readfile(imgtool::partition *partition, const char *fpath, imgtool::stream *destf)
|
||||
static imgtoolerr_t ti990_image_readfile(imgtool::partition &partition, const char *fpath, imgtool::stream *destf)
|
||||
{
|
||||
imgtool::image *img = &partition->image();
|
||||
ti990_image *image = get_ti990_image(img);
|
||||
@ -1556,7 +1556,7 @@ static imgtoolerr_t ti990_image_readfile(imgtool::partition *partition, const ch
|
||||
/*
|
||||
Add a file to a ti990_image.
|
||||
*/
|
||||
static imgtoolerr_t ti990_image_writefile(imgtool::partition *partition, const char *fpath, imgtool::stream *sourcef, util::option_resolution *writeoptions)
|
||||
static imgtoolerr_t ti990_image_writefile(imgtool::partition &partition, const char *fpath, imgtool::stream *sourcef, util::option_resolution *writeoptions)
|
||||
{
|
||||
imgtool::image *img = &partition->image();
|
||||
ti990_image *image = get_ti990_image(img);
|
||||
@ -1680,7 +1680,7 @@ static imgtoolerr_t ti990_image_writefile(imgtool::partition *partition, const c
|
||||
/*
|
||||
Delete a file from a ti990_image.
|
||||
*/
|
||||
static imgtoolerr_t ti990_image_deletefile(imgtool::partition *partition, const char *fpath)
|
||||
static imgtoolerr_t ti990_image_deletefile(imgtool::partition &partition, const char *fpath)
|
||||
{
|
||||
imgtool::image *img = &partition->image();
|
||||
ti990_image *image = get_ti990_image(img);
|
||||
|
@ -455,11 +455,11 @@ static imgtoolerr_t vzdos_diskimage_nextenum(imgtool::directory *enumeration, im
|
||||
|
||||
/* TRK 0 sector 15 is used to hold the track map of the disk with one bit
|
||||
corresponding to a sector used. */
|
||||
static imgtoolerr_t vzdos_diskimage_freespace(imgtool::partition *partition, UINT64 *size)
|
||||
static imgtoolerr_t vzdos_diskimage_freespace(imgtool::partition &partition, UINT64 *size)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
int i;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
UINT8 c, v, buffer[DATA_SIZE + 2];
|
||||
*size = 0;
|
||||
|
||||
@ -478,10 +478,10 @@ static imgtoolerr_t vzdos_diskimage_freespace(imgtool::partition *partition, UIN
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t vzdos_diskimage_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t vzdos_diskimage_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
int filesize, track, sector;
|
||||
vzdos_dirent ent;
|
||||
UINT8 buffer[DATA_SIZE + 2];
|
||||
@ -524,10 +524,10 @@ static imgtoolerr_t vzdos_diskimage_readfile(imgtool::partition *partition, cons
|
||||
}
|
||||
|
||||
/* deletes directory entry, clears trackmap entries and sectors */
|
||||
static imgtoolerr_t vzdos_diskimage_deletefile(imgtool::partition *partition, const char *fname)
|
||||
static imgtoolerr_t vzdos_diskimage_deletefile(imgtool::partition &partition, const char *fname)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
int index, filesize, track, sector, next_track, next_sector;
|
||||
vzdos_dirent entry, next_entry;
|
||||
UINT8 buffer[DATA_SIZE + 2];
|
||||
@ -602,10 +602,10 @@ static imgtoolerr_t vzdos_diskimage_deletefile(imgtool::partition *partition, co
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t vzdos_writefile(imgtool::partition *partition, int offset, imgtool::stream &sourcef, vzdos_dirent *entry)
|
||||
static imgtoolerr_t vzdos_writefile(imgtool::partition &partition, int offset, imgtool::stream &sourcef, vzdos_dirent *entry)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
imgtool::image &img(partition->image());
|
||||
imgtool::image &img(partition.image());
|
||||
int index, track, sector, toread, next_track, next_sector;
|
||||
vzdos_dirent temp_entry;
|
||||
UINT64 filesize = 0, freespace = 0;
|
||||
@ -700,7 +700,7 @@ static imgtoolerr_t vzdos_writefile(imgtool::partition *partition, int offset, i
|
||||
}
|
||||
|
||||
/* create a new file or overwrite a file */
|
||||
static imgtoolerr_t vzdos_diskimage_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t vzdos_diskimage_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
int ftype;
|
||||
@ -741,10 +741,10 @@ static imgtoolerr_t vzdos_diskimage_writefile(imgtool::partition *partition, con
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t vzdos_diskimage_suggesttransfer(imgtool::partition *partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
static imgtoolerr_t vzdos_diskimage_suggesttransfer(imgtool::partition &partition, const char *fname, imgtool_transfer_suggestion *suggestions, size_t suggestions_length)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
vzdos_dirent entry;
|
||||
|
||||
if (fname) {
|
||||
@ -808,10 +808,10 @@ static imgtoolerr_t vzdos_diskimage_create(imgtool::image &img, imgtool::stream:
|
||||
Imgtool vz filter code
|
||||
*********************************************************************/
|
||||
|
||||
static imgtoolerr_t vzsnapshot_readfile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
static imgtoolerr_t vzsnapshot_readfile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &destf)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
imgtool::image &image(partition->image());
|
||||
imgtool::image &image(partition.image());
|
||||
vzdos_dirent entry;
|
||||
UINT8 header[24];
|
||||
|
||||
@ -852,7 +852,7 @@ static imgtoolerr_t vzsnapshot_readfile(imgtool::partition *partition, const cha
|
||||
return IMGTOOLERR_SUCCESS;
|
||||
}
|
||||
|
||||
static imgtoolerr_t vzsnapshot_writefile(imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
static imgtoolerr_t vzsnapshot_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts)
|
||||
{
|
||||
imgtoolerr_t ret;
|
||||
int fnameopt;
|
||||
|
Loading…
Reference in New Issue
Block a user