aboutsummaryrefslogtreecommitdiffstats
path: root/Library/UefiShellUfmCommandLib/dir.h
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-11-15 19:48:08 +0300
committerJoursoir <chat@joursoir.net>2021-11-15 19:48:08 +0300
commit2c4ace2c2cf853c85d9b32d42e8bae39d88a7355 (patch)
tree2e7a53fd8832f16c4fa992b1df6070dd108b6508 /Library/UefiShellUfmCommandLib/dir.h
parent3e17a10f5f691159cb9fc778f0a3a463ea0b3bee (diff)
downloadufm-2c4ace2c2cf853c85d9b32d42e8bae39d88a7355.tar.gz
ufm-2c4ace2c2cf853c85d9b32d42e8bae39d88a7355.tar.bz2
ufm-2c4ace2c2cf853c85d9b32d42e8bae39d88a7355.zip
add routines to get dir entries
Diffstat (limited to 'Library/UefiShellUfmCommandLib/dir.h')
-rw-r--r--Library/UefiShellUfmCommandLib/dir.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/Library/UefiShellUfmCommandLib/dir.h b/Library/UefiShellUfmCommandLib/dir.h
new file mode 100644
index 0000000..be560ad
--- /dev/null
+++ b/Library/UefiShellUfmCommandLib/dir.h
@@ -0,0 +1,30 @@
+#ifndef UFM_DIR_H
+#define UFM_DIR_H
+
+#include <Uefi.h>
+
+struct dir_list {
+ EFI_SHELL_FILE_INFO *list_head;
+ int len; // number of elements in list
+};
+
+/*
+ * Opens a directory and gets all its entries
+ *
+ * search_path: the pointer to path string
+ * attr: required file attributes
+ *
+ * return: A pointer to the allocated structure or NULL if allocation fails
+*/
+struct dir_list *dirl_alloc(CHAR16 *search_path, CONST UINT64 attr);
+
+/*
+ * Deletes the directory list, frees the structure
+ *
+ * dl: the pointer to the directory list
+ *
+ * return: VOID
+*/
+VOID dirl_release(struct dir_list *dl);
+
+#endif /* UFM_DIR_H */