]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (c) 2016 Apple Inc. All rights reserved. | |
3 | */ | |
4 | ||
5 | #include <stdio.h> | |
6 | #include <inttypes.h> | |
7 | #include <stdbool.h> | |
8 | #include <uuid/uuid.h> | |
9 | #include <mach/mach_types.h> | |
10 | #include <sysexits.h> | |
11 | #include <err.h> | |
12 | #include <fcntl.h> | |
13 | ||
14 | #ifndef _UTILS_H | |
15 | #define _UTILS_H | |
16 | ||
17 | extern const char *pgm; | |
18 | ||
19 | struct vm_range; | |
20 | struct region; | |
21 | ||
22 | extern void err_mach(kern_return_t, const struct region *, const char *, ...) __printflike(3, 4); | |
23 | extern void printvr(const struct vm_range *, const char *, ...) __printflike(2, 3); | |
24 | extern void printr(const struct region *, const char *, ...) __printflike(2, 3); | |
25 | ||
26 | typedef char hsize_str_t[7]; /* e.g. 1008Mib */ | |
27 | ||
28 | extern const char *str_hsize(hsize_str_t hstr, uint64_t); | |
29 | extern const char *str_prot(vm_prot_t); | |
30 | extern const char *str_shared(int); | |
31 | extern const char *str_purgable(int, int); | |
32 | ||
33 | typedef char tag_str_t[24]; | |
34 | ||
35 | extern const char *str_tag(tag_str_t, int, int, vm_prot_t, int); | |
36 | extern const char *str_tagr(tag_str_t, const struct region *); | |
37 | ||
38 | extern char *strconcat(const char *, const char *, size_t); | |
39 | extern unsigned long simple_namehash(const char *); | |
40 | extern int bounded_pwrite(int, const void *, size_t, off_t, bool *, ssize_t *); | |
41 | ||
42 | #endif /* _UTILS_H */ |