diff options
author | B. Watson <yalhcru@gmail.com> | 2015-05-07 16:32:32 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2015-05-07 16:32:32 -0400 |
commit | 013ac7742311556022304e8b30ca170d48b3a016 (patch) | |
tree | 53faa33e75991363f1a6dcc7edc83a66b70e6995 /include | |
download | bsd-games-extra-013ac7742311556022304e8b30ca170d48b3a016.tar.gz |
initial commit
Diffstat (limited to 'include')
-rw-r--r-- | include/bsdcompat.h | 61 | ||||
-rw-r--r-- | include/sys/tty.h | 1 |
2 files changed, 62 insertions, 0 deletions
diff --git a/include/bsdcompat.h b/include/bsdcompat.h new file mode 100644 index 0000000..54be106 --- /dev/null +++ b/include/bsdcompat.h @@ -0,0 +1,61 @@ +#include <stdlib.h> +#include <stdio.h> +#include <time.h> + +const char *getprogname(void); + +#ifndef __RCSID +# define __RCSID(x) +#endif + +#ifndef __COPYRIGHT +# define __COPYRIGHT(x) +#endif + +#ifndef __dead +# define __dead +#endif + +#ifndef __USE +# define __USE(x) +#endif + +#ifndef CTRL +# define CTRL(x) ((x & 0x1f)) +#endif + +#ifndef __printflike +# define __printflike(x, y) +#endif + +#ifndef INFTIM +# define INFTIM (-1) +#endif + +#define srandomdev() (srandom(time(NULL))) +#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) +#define OXTABS TAB3 + +#define bswap32(x) ( \ + ((x << 24) & 0xff000000 ) | \ + ((x << 8) & 0x00ff0000 ) | \ + ((x >> 8) & 0x0000ff00 ) | \ + ((x >> 24) & 0x000000ff ) ) + +#define bswap64(x) ( \ + ( (x << 56) & 0xff00000000000000UL ) | \ + ( (x << 40) & 0x00ff000000000000UL ) | \ + ( (x << 24) & 0x0000ff0000000000UL ) | \ + ( (x << 8) & 0x000000ff00000000UL ) | \ + ( (x >> 8) & 0x00000000ff000000UL ) | \ + ( (x >> 24) & 0x0000000000ff0000UL ) | \ + ( (x >> 40) & 0x000000000000ff00UL ) | \ + ( (x >> 56) & 0x00000000000000ffUL ) ) + +size_t strlcpy(char *dst, const char *src, size_t siz); +size_t strlcat(char *dst, const char *src, size_t siz); +char *strnstr(const char *str, const char *find, size_t str_len); + +int fpurge(FILE *fp); + +#define __DECONST(x, y) (x)y diff --git a/include/sys/tty.h b/include/sys/tty.h new file mode 100644 index 0000000..545eb34 --- /dev/null +++ b/include/sys/tty.h @@ -0,0 +1 @@ +/* placeholder */ |