summaryrefslogtreecommitdiff
path: root/arm9/lib/include
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/lib/include')
-rw-r--r--arm9/lib/include/FS_archive.h7
-rw-r--r--arm9/lib/include/FSi_util.h33
2 files changed, 39 insertions, 1 deletions
diff --git a/arm9/lib/include/FS_archive.h b/arm9/lib/include/FS_archive.h
index b39e7738..baf11add 100644
--- a/arm9/lib/include/FS_archive.h
+++ b/arm9/lib/include/FS_archive.h
@@ -110,8 +110,8 @@ typedef struct FSArchive
char ptr[4];
u32 pack;
} name;
- struct FSArchive * prev;
struct FSArchive * next;
+ struct FSArchive * prev;
OSThreadQueue sync_q;
OSThreadQueue stat_q;
u32 flag;
@@ -163,6 +163,11 @@ static inline BOOL FSi_IsArchiveRunning(volatile const FSArchive * p_arc)
return (p_arc->flag & FS_ARCHIVE_FLAG_RUNNING) != 0;
}
+static inline BOOL FSi_IsArchiveUnloading(volatile const FSArchive * p_arc)
+{
+ return (p_arc->flag & FS_ARCHIVE_FLAG_UNLOADING) != 0;
+}
+
BOOL FSi_SendCommand(struct FSFile * file, FSCommandType command);
BOOL FSi_ExecuteSyncCommand(struct FSFile * file);
diff --git a/arm9/lib/include/FSi_util.h b/arm9/lib/include/FSi_util.h
new file mode 100644
index 00000000..babb6d75
--- /dev/null
+++ b/arm9/lib/include/FSi_util.h
@@ -0,0 +1,33 @@
+#ifndef NITRO_FSI_UTIL_H_
+#define NITRO_FSI_UTIL_H_
+
+static inline BOOL FSi_IsSlash(u32 c)
+{
+ return (c == '/') || (c == '\\');
+}
+
+static inline void FSi_CutFromListCore(FSFileLink *trg)
+{
+ FSFile *const pr = trg->prev;
+ FSFile *const nx = trg->next;
+ if (pr)
+ pr->link.next = nx;
+ if (nx)
+ nx->link.prev = pr;
+}
+
+static inline void FSi_AppendToList(FSFile *elem, FSFile *list)
+{
+ FSFileLink *const trg = &elem->link;
+ FSi_CutFromListCore(trg);
+ {
+ while (list->link.next)
+ list = list->link.next;
+ list->link.next = elem;
+ trg->prev = list;
+ trg->next = NULL;
+ }
+}
+
+
+#endif //NITRO_FSI_UTIL_H_