Blame


1 b0003f58 2021-03-08 op /*
2 b0003f58 2021-03-08 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 b0003f58 2021-03-08 op *
4 b0003f58 2021-03-08 op * Permission to use, copy, modify, and distribute this software for any
5 b0003f58 2021-03-08 op * purpose with or without fee is hereby granted, provided that the above
6 b0003f58 2021-03-08 op * copyright notice and this permission notice appear in all copies.
7 b0003f58 2021-03-08 op *
8 b0003f58 2021-03-08 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 b0003f58 2021-03-08 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 b0003f58 2021-03-08 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 b0003f58 2021-03-08 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 b0003f58 2021-03-08 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 b0003f58 2021-03-08 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 b0003f58 2021-03-08 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 b0003f58 2021-03-08 op */
16 b0003f58 2021-03-08 op
17 b0003f58 2021-03-08 op #ifndef COMPAT_H
18 b0003f58 2021-03-08 op #define COMPAT_H
19 b0003f58 2021-03-08 op
20 60c891c2 2021-03-12 op #include "config.h"
21 60c891c2 2021-03-12 op
22 b0003f58 2021-03-08 op #include <sys/types.h>
23 b0003f58 2021-03-08 op #include <sys/uio.h>
24 b0003f58 2021-03-08 op
25 b0003f58 2021-03-08 op #include <stdarg.h>
26 b0003f58 2021-03-08 op #include <stdint.h>
27 b0003f58 2021-03-08 op
28 b0003f58 2021-03-08 op #ifdef HAVE_QUEUE_H
29 b0003f58 2021-03-08 op # include <sys/queue.h>
30 b0003f58 2021-03-08 op #else
31 b0003f58 2021-03-08 op # include "compat/queue.h"
32 b0003f58 2021-03-08 op #endif
33 b0003f58 2021-03-08 op
34 b0003f58 2021-03-08 op #ifdef HAVE_LIBUTIL
35 b0003f58 2021-03-08 op # include <imsg.h>
36 b0003f58 2021-03-08 op #else
37 b0003f58 2021-03-08 op # include "compat/imsg.h"
38 b0003f58 2021-03-08 op #endif
39 b0003f58 2021-03-08 op
40 b0003f58 2021-03-08 op #ifndef HAVE_ASPRINTF
41 b0003f58 2021-03-08 op int asprintf(char**, const char*, ...);
42 b0003f58 2021-03-08 op int vasprintf(char**, const char*, va_list);
43 b0003f58 2021-03-08 op #endif
44 b0003f58 2021-03-08 op
45 b0003f58 2021-03-08 op #ifndef HAVE_ERR
46 b0003f58 2021-03-08 op void err(int, const char*, ...);
47 b0003f58 2021-03-08 op void errx(int, const char*, ...);
48 b0003f58 2021-03-08 op void warn(int, const char*, ...);
49 b0003f58 2021-03-08 op void warnx(int, const char*, ...);
50 b0003f58 2021-03-08 op #endif
51 b0003f58 2021-03-08 op
52 b0003f58 2021-03-08 op #ifndef HAVE_FREEZERO
53 b0003f58 2021-03-08 op void freezero(void*, size_t);
54 b0003f58 2021-03-08 op #endif
55 b0003f58 2021-03-08 op
56 b0003f58 2021-03-08 op #ifndef HAVE_GETDTABLECOUNT
57 b0003f58 2021-03-08 op int getdtablecount(void);
58 b0003f58 2021-03-08 op #endif
59 b0003f58 2021-03-08 op
60 b0003f58 2021-03-08 op #ifndef HAVE_GETDTABLESIZE
61 b0003f58 2021-03-08 op int getdtablesize(void);
62 b0003f58 2021-03-08 op #endif
63 b0003f58 2021-03-08 op
64 60c891c2 2021-03-12 op #ifndef HAVE_GETPROGNAME
65 60c891c2 2021-03-12 op const char *getprogname(void);
66 60c891c2 2021-03-12 op #endif
67 60c891c2 2021-03-12 op
68 e21e40a9 2021-03-13 op #ifndef HAVE_MEMMEM
69 e21e40a9 2021-03-13 op void *memmem(const void*, size_t, const void*, size_t);
70 e21e40a9 2021-03-13 op #endif
71 e21e40a9 2021-03-13 op
72 60c891c2 2021-03-12 op #ifndef HAVE_RECALLOCARRAY
73 60c891c2 2021-03-12 op void *recallocarray(void*, size_t, size_t, size_t);
74 60c891c2 2021-03-12 op #endif
75 60c891c2 2021-03-12 op
76 b0003f58 2021-03-08 op #ifndef HAVE_STRLCPY
77 b0003f58 2021-03-08 op size_t strlcpy(char*, const char*, size_t);
78 b0003f58 2021-03-08 op #endif
79 b0003f58 2021-03-08 op
80 b0003f58 2021-03-08 op #ifndef HAVE_STRLCAT
81 b0003f58 2021-03-08 op size_t strlcat(char*, const char*, size_t);
82 b0003f58 2021-03-08 op #endif
83 b0003f58 2021-03-08 op
84 b0003f58 2021-03-08 op #ifndef HAVE_STRTONUM
85 b0003f58 2021-03-08 op long long strtonum(const char*, long long, long long, const char*);
86 b0003f58 2021-03-08 op #endif
87 b0003f58 2021-03-08 op
88 b0003f58 2021-03-08 op #ifndef HAVE_SETPROCTITLE
89 b0003f58 2021-03-08 op void setproctitle(const char*, ...);
90 b0003f58 2021-03-08 op #endif
91 b0003f58 2021-03-08 op
92 b0003f58 2021-03-08 op #endif /* COMPAT_H */