diff options
author | Sam Bingner <sam@bingner.com> | 2019-05-27 15:43:29 -1000 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2019-05-27 15:43:29 -1000 |
commit | 1d744444486fc66c8f12e2a8f0e81773a65bf545 (patch) | |
tree | 7337e2e70e15ff4cecfcbaedb450ce157b699751 /apt.h | |
parent | d84dcba99f5c2657d2df37518feb59312bcc59fc (diff) |
Make it actually compile with saurik's updates
Diffstat (limited to 'apt.h')
-rw-r--r-- | apt.h | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +#ifndef APT_H +#define APT_H + +#include <unistd.h> + +template <typename Type_> +Type_ *memrchr(Type_ *data, int value, int size) { + for (int i = 0; i != size; ++i) + if (data[size - i - 1] == value) + return data + size - i - 1; + return 0; +} + +template <typename Type_> +static Type_ *strchrnul(Type_ *s, int c) { + while (*s != c && *s != '\0') + ++s; + return s; +} + +#define faccessat(arg0, arg1, arg2, arg3) \ + access(arg1, arg2) + +#if 0 +#include <syslog.h> +static unsigned nonce(0); +#define _trace() syslog(LOG_ERR, "_trace():%s[%u] #%u\n", __FILE__, __LINE__, ++nonce) +#endif + +#endif//APT_H |