view ffstools/tiffs-mkfs/struct.h @ 995:74024eb17e04

fc-loadtool help: improve language regarding 16 MiB flash chips In FC project history, 16 MiB flash originally meant Pirelli DP-L10. Then we got FCDEV3B with the same flash (our own design), but now we are discovering more Calypso devices that used such large flash, both late Calypso era (Sony Ericsson K2x0) as well as much earlier ones (FIC FLUID devices.txt file with 2004 dates, Leonardo+ rev 5). Hence we need to migrate to more generic or neutral language in associated documentation, without giving elevated status to specific examples that drove our early project history.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 03 Dec 2023 21:11:12 +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