支持解析脚步中的应用并自动执行
This commit is contained in:
zhangzheng
2023-11-27 22:25:21 +08:00
parent 5fc71a7f98
commit 3a10b63e5f
14 changed files with 128 additions and 138 deletions

View File

@@ -47,7 +47,7 @@ int htoi(char *str, int len)
return n;
}
umword_t cpio_find_file(umword_t st, umword_t en, const char *name)
umword_t cpio_find_file(umword_t st, umword_t en, const char *name, umword_t *size)
{
uint8_t rByte;
int32_t bk_inx;
@@ -65,6 +65,10 @@ umword_t cpio_find_file(umword_t st, umword_t en, const char *name)
const char *f_name = (char *)(i + sizeof(cpio_fs_t));
if (strcmp(f_name, name) == 0)
{
if (size)
{
*size = htoi(file_info->c_filesize, 8);
}
return (umword_t)(ALIGN(i + sizeof(cpio_fs_t) + name_size, 4));
}