annotate ffstools/tiffs-mkfs/struct.h @ 964:a96cb97b66a2

ringtools/imy: fix duplicate definition of tdma_durations[] The bug was reported by Vadim Yanitskiy <fixeria@osmocom.org>, although the present fix is slightly different from the contributed patch: because main.c doesn't need this tdma_durations[] array at all, let's simply remove the reference to this array from main.c rather than turn it into an extern. I no longer remember my original thought flow that resulted (by mistake) in tdma_durations[] being multiply defined in main.c and durations.c. My intent might have been to define all globals in main.c and have the reference in durations.c be an extern - and I missed that extern - but without clear memory, I have no certainty. In any case, having this data array defined in the same module that fills it (durations.c) is sensible, so let's make it the new way.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 31 Aug 2023 19:38:18 +0000
parents 178ed445021d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
705
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /* some general limits */
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #define MAX_FN_COMPONENT 20
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 #define MAX_DIR_NEST 6
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 #define MAX_DIR_ENTRIES 128
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 /* tree of content to be written */
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 struct tree_object {
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 char name[MAX_FN_COMPONENT+1];
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 int is_dir;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 union {
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 struct {
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 struct tree_object *children[MAX_DIR_ENTRIES];
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 unsigned nchildren;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 uint16_t *ffs_link_ptr;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 } d;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 struct {
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 char host_pathname[MAXPATHLEN];
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 } f;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 } u;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 };
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 /* actual TIFFS on-media structure */
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 struct tiffs_inode {
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 uint16_t size;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 uint8_t reserved1;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 uint8_t type;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 uint16_t child;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 uint16_t sibling;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 uint32_t location;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 uint16_t sequence;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 uint16_t updates;
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 };
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 /* TIFFS object types */
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #define OBJTYPE_FILE 0xF1
717
178ed445021d tiffs-mkfs: journal creation implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 705
diff changeset
36 #define OBJTYPE_FILE_RO 0xE1
705
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #define OBJTYPE_DIR 0xF2
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #define OBJTYPE_SYMLINK 0xF3
12ae93940467 tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #define OBJTYPE_SEGMENT 0xF4