diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-10-06 13:14:26 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-11-01 10:04:01 +0100 |
commit | fd9c7cbfe446b0f04aa66bb198c1769045ba2fe5 (patch) | |
tree | f316c4117004cc98592838cc59beba9f278d7032 /scripts/common.h | |
parent | 4a84948522ce66dfec6a3260b4590fba59bb4262 (diff) | |
download | barebox-fd9c7cbfe446b0f04aa66bb198c1769045ba2fe5.tar.gz |
scripts: Add common library functions
Several functions are duplicated in different host tools. This patch
starts collecting them in a single C file. We start with read_file()
and read_file_2(), others follow in separate commits.
It would be great to compile these functions in a separate library, but
I don't know how this can be archieved in Kbuild. Instead, the C file
is included where needed. Not nice, not beautiful, but at least enough
to get something going.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/common.h')
-rw-r--r-- | scripts/common.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/common.h b/scripts/common.h new file mode 100644 index 0000000000..0153ebe93f --- /dev/null +++ b/scripts/common.h @@ -0,0 +1,7 @@ +#ifndef __COMMON_H +#define __COMMON_H + +int read_file_2(const char *filename, size_t *size, void **outbuf, size_t max_size); +void *read_file(const char *filename, size_t *size); + +#endif /* __COMMON_H */ |