Blame


1 eeddf8e6 2022-01-13 op /*
2 eeddf8e6 2022-01-13 op * Copyright (c) 2022 Omar Polo <op@omarpolo.com>
3 eeddf8e6 2022-01-13 op *
4 eeddf8e6 2022-01-13 op * Permission to use, copy, modify, and distribute this software for any
5 eeddf8e6 2022-01-13 op * purpose with or without fee is hereby granted, provided that the above
6 eeddf8e6 2022-01-13 op * copyright notice and this permission notice appear in all copies.
7 eeddf8e6 2022-01-13 op *
8 eeddf8e6 2022-01-13 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 eeddf8e6 2022-01-13 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 eeddf8e6 2022-01-13 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 eeddf8e6 2022-01-13 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 eeddf8e6 2022-01-13 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 eeddf8e6 2022-01-13 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 eeddf8e6 2022-01-13 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 eeddf8e6 2022-01-13 op */
16 eeddf8e6 2022-01-13 op
17 eeddf8e6 2022-01-13 op #ifndef UTILS_H
18 eeddf8e6 2022-01-13 op #define UTILS_H
19 eeddf8e6 2022-01-13 op
20 eeddf8e6 2022-01-13 op int mark_nonblock(int);
21 eeddf8e6 2022-01-13 op
22 eeddf8e6 2022-01-13 op int has_prefix(const char*, const char*);
23 eeddf8e6 2022-01-13 op int has_suffix(const char *, const char *);
24 eeddf8e6 2022-01-13 op int unicode_isspace(uint32_t);
25 eeddf8e6 2022-01-13 op int unicode_isgraph(uint32_t);
26 eeddf8e6 2022-01-13 op
27 eeddf8e6 2022-01-13 op int dispatch_imsg(struct imsgev *, short, imsg_handlerfn **, size_t);
28 eeddf8e6 2022-01-13 op int imsg_compose_event(struct imsgev *, uint16_t, uint32_t, pid_t, int, const void *, uint16_t);
29 eeddf8e6 2022-01-13 op
30 eeddf8e6 2022-01-13 op void *hash_alloc(size_t, void *);
31 eeddf8e6 2022-01-13 op void *hash_calloc(size_t, size_t, void *);
32 eeddf8e6 2022-01-13 op void hash_free(void *, void *);
33 eeddf8e6 2022-01-13 op
34 eeddf8e6 2022-01-13 op #endif /* UTILS_H */