summaryrefslogtreecommitdiff
path: root/include/file-list.h
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-05-03 13:48:50 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-12 07:59:59 +0200
commit15e26bb72b334da1830c26917e28ffcac64e8e4c (patch)
treec2d334fe86fb95e1b963172e349ea00a6249ad4f /include/file-list.h
parentfab1f406fdb82f2876f48c3c9e33672c963809e2 (diff)
downloadbarebox-15e26bb72b334da1830c26917e28ffcac64e8e4c.tar.gz
param: introduce file-list parameter type
DFU, fastboot and incoming mass storage support all use file lists as input, but individually check syntax correctness only on use. A dedicated file list parameter would improve the user experience and makes the code using it easier to handle: the struct file_list can be passed around directly instead of having to parse it first on use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/file-list.h')
-rw-r--r--include/file-list.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/file-list.h b/include/file-list.h
index 9a9edfa378..7264a3e2c6 100644
--- a/include/file-list.h
+++ b/include/file-list.h
@@ -2,6 +2,8 @@
#ifndef __FILE_LIST
#define __FILE_LIST
+#include <linux/list.h>
+
#define FILE_LIST_FLAG_SAFE (1 << 0)
#define FILE_LIST_FLAG_READBACK (1 << 1)
#define FILE_LIST_FLAG_CREATE (1 << 2)
@@ -20,6 +22,7 @@ struct file_list {
};
struct file_list *file_list_parse(const char *str);
+char *file_list_to_str(const struct file_list *files);
void file_list_free(struct file_list *);
int file_list_add_entry(struct file_list *files, const char *name, const char *filename,