summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/include
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils/include')
-rw-r--r--util/libreboot-utils/include/common.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/util/libreboot-utils/include/common.h b/util/libreboot-utils/include/common.h
index abd153be..8276d6da 100644
--- a/util/libreboot-utils/include/common.h
+++ b/util/libreboot-utils/include/common.h
@@ -301,8 +301,6 @@ struct xstate {
struct macaddr mac;
struct xfile f;
- char *argv0;
-
size_t i; /* index to cmd[] for current command */
int no_cmd;
@@ -374,21 +372,26 @@ void write_mac_part(size_t partnum);
/* string functions
*/
+size_t page_remain(const void *p);
+long pagesize(void);
int xunveilx(const char *path, const char *permissions);
int xpledgex(const char *promises, const char *execpromises);
char *smalloc(char **buf, size_t size);
void *vmalloc(void **buf, size_t size);
-int slen(const char *scmp, size_t maxlen,
+size_t slen(const char *scmp, size_t maxlen,
size_t *rval);
+int vcmp(const void *s1, const void *s2, size_t n);
int scmp(const char *a, const char *b,
size_t maxlen, int *rval);
-int sdup(const char *s,
+int ccmp(const char *a, const char *b, size_t i,
+ int *rval);
+char *sdup(const char *s,
size_t n, char **dest);
-int scatn(ssize_t sc, const char **sv,
+char *scatn(ssize_t sc, const char **sv,
size_t max, char **rval);
-int scat(const char *s1, const char *s2,
+char *scat(const char *s1, const char *s2,
size_t n, char **dest);
-int dcat(const char *s, size_t n,
+void dcat(const char *s, size_t n,
size_t off, char **dest1,
char **dest2);
/* numerical functions
@@ -396,10 +399,10 @@ int dcat(const char *s, size_t n,
unsigned short hextonum(char ch_s);
void spew_hex(const void *data, size_t len);
-void *mkrbuf(size_t n);
+void *rmalloc(size_t n);
void rset(void *buf, size_t n);
-void *mkrbuf(size_t n);
-char *mkrstr(size_t n);
+void *rmalloc(size_t n);
+char *rchars(size_t n);
size_t rsize(size_t n);
/* Helper functions for command: dump
@@ -484,6 +487,14 @@ ssize_t rw_over_nrw(ssize_t r, size_t nrw);
off_t lseek_on_eintr(int fd, off_t off,
int whence, int loop_eagain, int loop_eintr);
int try_err(int loop_err, int errval);
+ssize_t read_on_eintr(int fd,
+ void *buf, size_t count);
+ssize_t write_on_eintr(int fd,
+ void *buf, size_t count);
+ssize_t pread_on_eintr(int fd,
+ void *buf, size_t count, off_t off);
+ssize_t pwrite_on_eintr(int fd,
+ void *buf, size_t count, off_t off);
/* Error handling and cleanup
*/
@@ -524,7 +535,6 @@ mkhtemp_tmpfile_linux(int dirfd,
int mkhtemp(int *fd, struct stat *st,
char *template, int dirfd, const char *fname,
struct stat *st_dir_initial, int type);
-int mkhtemp_fill_random(char *p, size_t xc);
int world_writeable_and_sticky(const char *s,
int sticky_allowed, int always_sticky);
int same_dir(const char *a, const char *b);