view ffstools/tiffs-mkfs/struct.h @ 1001:7df4c9ae6ba4

loadtools/scripts: w220.{config,init} => chimei.{config,init} Motorola W220, first touched by FreeCalypso in 2019-05, is an ODM phone made by Chi-Mei, and its peculiar property of relevance to loadtools is that it has XRAM on Calypso nCS3 instead of the usual nCS1 - which matters for fc-xram. We are now discovering other Chi-Mei phones including Sony Ericsson J120, and they share the same quirk of XRAM on nCS3 - hence we rename this loadtools target from w220 to chimei.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 09 Dec 2023 17:53:44 +0000
parents 178ed445021d
children
line wrap: on
line source

/* some general limits */
#define	MAX_FN_COMPONENT	20
#define	MAX_DIR_NEST		6
#define	MAX_DIR_ENTRIES		128

/* tree of content to be written */
struct tree_object {
	char	name[MAX_FN_COMPONENT+1];
	int	is_dir;
	union {
		struct {
			struct tree_object *children[MAX_DIR_ENTRIES];
			unsigned nchildren;
			uint16_t *ffs_link_ptr;
		} d;
		struct {
			char host_pathname[MAXPATHLEN];
		} f;
	} u;
};

/* actual TIFFS on-media structure */
struct tiffs_inode {
	uint16_t	size;
	uint8_t		reserved1;
	uint8_t		type;
	uint16_t	child;
	uint16_t	sibling;
	uint32_t	location;
	uint16_t	sequence;
	uint16_t	updates;
};

/* TIFFS object types */
#define	OBJTYPE_FILE	0xF1
#define	OBJTYPE_FILE_RO	0xE1
#define	OBJTYPE_DIR	0xF2
#define	OBJTYPE_SYMLINK	0xF3
#define	OBJTYPE_SEGMENT	0xF4