X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/cd4a5fcb0685b8a12915d22efc5c1e0cc8b40d9b..d0edcc0ef0b6ef695ce96d2be84f1ebb02453b51:/GRUB2/grub-2.04/grub-core/ventoy/ventoy_def.h diff --git a/GRUB2/grub-2.04/grub-core/ventoy/ventoy_def.h b/GRUB2/grub-2.04/grub-core/ventoy/ventoy_def.h index 8e26150..085fd1e 100644 --- a/GRUB2/grub-2.04/grub-core/ventoy/ventoy_def.h +++ b/GRUB2/grub-2.04/grub-core/ventoy/ventoy_def.h @@ -21,10 +21,13 @@ #ifndef __VENTOY_DEF_H__ #define __VENTOY_DEF_H__ +#define VTOY_MAX_SCRIPT_BUF (4 * 1024 * 1024) + #define JSON_SUCCESS 0 #define JSON_FAILED 1 #define JSON_NOT_FOUND 2 +#define ulong unsigned long #define ulonglong unsigned long long #define vtoy_to_upper(c) (((char)(c) >= 'a' && (char)(c) <= 'z') ? ((char)(c) - 'a' + 'A') : (char)(c)) @@ -115,11 +118,15 @@ typedef struct ventoy_udf_override #pragma pack() - typedef struct img_info { char path[512]; char name[256]; + int id; + grub_uint64_t size; + int select; + + void *parent; struct img_info *next; struct img_info *prev; @@ -130,8 +137,19 @@ typedef struct img_iterator_node struct img_iterator_node *next; img_info **tail; char dir[400]; + int dirlen; + int isocnt; + int done; + int select; + + struct img_iterator_node *parent; + struct img_iterator_node *firstchild; + + void *firstiso; }img_iterator_node; + + typedef struct initrd_info { char name[256]; @@ -400,7 +418,7 @@ grub_err_t ventoy_cmd_linux_locate_initrd(grub_extcmd_context_t ctxt, int argc, grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **args); -int ventoy_cpio_newc_fill_head(void *buf, int filesize, void *filedata, const char *name); +int ventoy_cpio_newc_fill_head(void *buf, int filesize, const void *filedata, const char *name); grub_file_t ventoy_grub_file_open(enum grub_file_type type, const char *fmt, ...); int ventoy_is_file_exist(const char *fmt, ...); int ventoy_fill_data(grub_uint32_t buflen, char *buffer); @@ -504,5 +522,54 @@ static inline int ventoy_is_word_end(int c) return (c == 0 || c == ',' || ventoy_isspace(c)); } +#pragma pack(1) +typedef struct ventoy_part_table +{ + grub_uint8_t Active; // 0x00 0x80 + + grub_uint8_t StartHead; + grub_uint16_t StartSector : 6; + grub_uint16_t StartCylinder : 10; + + grub_uint8_t FsFlag; + + grub_uint8_t EndHead; + grub_uint16_t EndSector : 6; + grub_uint16_t EndCylinder : 10; + + grub_uint32_t StartSectorId; + grub_uint32_t SectorCount; +}ventoy_part_table; + +typedef struct ventoy_mbr_head +{ + grub_uint8_t BootCode[446]; + ventoy_part_table PartTbl[4]; + grub_uint8_t Byte55; + grub_uint8_t ByteAA; +}ventoy_mbr_head; +#pragma pack() + + +typedef struct install_template +{ + char isopath[256]; + char templatepath[256]; + + struct install_template *next; +}install_template; + +extern int g_ventoy_last_entry; +extern int g_ventoy_memdisk_mode; +extern int g_ventoy_iso_raw; +extern int g_ventoy_iso_uefi_drv; + +int ventoy_cmp_img(img_info *img1, img_info *img2); +void ventoy_swap_img(img_info *img1, img_info *img2); +char * ventoy_plugin_get_install_template(const char *isopath); +void ventoy_plugin_dump_auto_install(void); +int ventoy_fill_windows_rtdata(void *buf, char *isopath); + + #endif /* __VENTOY_DEF_H__ */