forked from rumpkernel/fs-utils
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fs-utils.h
79 lines (63 loc) · 1.4 KB
/
fs-utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef FSUTILS_H_
#define FSUTILS_H_
#include "config.h"
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
#ifndef __BEGIN_DECLS
# ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# else
# define __BEGIN_DECLS
# define __END_DECLS
# endif
#endif
#include <sys/types.h>
#include <stdint.h>
/* compat funcs */
#ifndef HAVE_SETMODE
void *setmode(const char *);
mode_t getmode(const void *, mode_t);
#endif
#ifndef HAVE_STRMODE
void strmode(mode_t, char *);
#endif
#ifndef HAVE_STRLCPY
size_t strlcpy(char *, const char *, size_t);
size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRVIS
char *vis(char *, int, int, int);
int strvis(char *, const char *, int);
int strvisx(char *, const char *, size_t, int);
int strnvis(char *, const char *, size_t, int);
#endif
#ifdef HAVE_ERR_H
#include <err.h>
#else
void err(int, const char *, ...);
void errx(int, const char *, ...);
void warn(const char *, ...);
void warnx(const char *, ...);
#endif
#ifndef HAVE_STRSEP
char *strsep(char **, const char *);
#endif
#ifndef HAVE_U_INT16_T
typedef uint16_t u_int16_t;
#endif
#ifndef HAVE_U_INT32_T
typedef uint32_t u_int32_t;
#endif
#if defined(HAVE_SYS_SYSMACROS_H)
#include <sys/sysmacros.h>
#endif
#ifndef HAVE_GETPROGNAME
const char *getprogname(void);
void setprogname(const char *);
#endif
#ifndef __dead
#define __dead __attribute__((noreturn))
#endif
#endif /* FSUTILS_H_ */