acl  3.5.3.0
acl_define.h
浏览该文件的文档.
1 #ifndef ACL_DEFINE_INCLUDE_H
2 #define ACL_DEFINE_INCLUDE_H
3 
4 #ifdef MINGW
5 # undef _WIN32
6 # undef _WIN64
7 #else
8 # include "acl_define_win32.h"
9 #endif
10 #include "acl_define_unix.h"
11 
12 typedef acl_int64 acl_off_t;
13 typedef struct acl_stat acl_stat_t;
14 
15 /*
16  * Making the ctype.h macros not more expensive than necessary. On some
17  * systems, ctype.h misbehaves with non-ASCII and/or negative characters.
18  */
19 
20 #include <ctype.h>
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <errno.h>
24 #include <string.h>
25 
26 #define _ACL_UCHAR_(c) ((unsigned char)(c))
27 
28 #ifdef UNSAFE_CTYPE
29 #define ACL_ISASCII(c) isascii(_ACL_UCHAR_(c))
30 #define ACL_ISALNUM(c) (ISASCII(c) && isalnum(c))
31 #define ACL_ISALPHA(c) (ISASCII(c) && isalpha(c))
32 #define ACL_ISCNTRL(c) (ISASCII(c) && iscntrl(c))
33 #define ACL_ISDIGIT(c) (ISASCII(c) && isdigit(c))
34 #define ACL_ISGRAPH(c) (ISASCII(c) && isgraph(c))
35 #define ACL_ISLOWER(c) (ISASCII(c) && islower(c))
36 #define ACL_ISPRINT(c) (ISASCII(c) && isprint(c))
37 #define ACL_ISPUNCT(c) (ISASCII(c) && ispunct(c))
38 #define ACL_ISSPACE(c) (ISASCII(c) && isspace(c))
39 #define ACL_ISUPPER(c) (ISASCII(c) && isupper(c))
40 #define ACL_TOLOWER(c) (ISUPPER(c) ? tolower(c) : (c))
41 #define ACL_TOUPPER(c) (ISLOWER(c) ? toupper(c) : (c))
42 #else
43 #define ACL_ISASCII(c) isascii(_ACL_UCHAR_(c))
44 #define ACL_ISALNUM(c) isalnum(_ACL_UCHAR_(c))
45 #define ACL_ISALPHA(c) isalpha(_ACL_UCHAR_(c))
46 #define ACL_ISCNTRL(c) iscntrl(_ACL_UCHAR_(c))
47 #define ACL_ISDIGIT(c) isdigit(_ACL_UCHAR_(c))
48 #define ACL_ISGRAPH(c) isgraph(_ACL_UCHAR_(c))
49 #define ACL_ISLOWER(c) islower(_ACL_UCHAR_(c))
50 #define ACL_ISPRINT(c) isprint(_ACL_UCHAR_(c))
51 #define ACL_ISPUNCT(c) ispunct(_ACL_UCHAR_(c))
52 #define ACL_ISSPACE(c) isspace(_ACL_UCHAR_(c))
53 #define ACL_ISUPPER(c) isupper(_ACL_UCHAR_(c))
54 #define ACL_TOLOWER(c) tolower(_ACL_UCHAR_(c))
55 #define ACL_TOUPPER(c) toupper(_ACL_UCHAR_(c))
56 #endif
57 
58 #ifndef acl_unused
59 # ifdef __GNUC__
60 # define acl_unused __attribute__ ((__unused__))
61 # else
62 # define acl_unused /* Ignore */
63 # endif
64 #endif
65 
66 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
67 #define ACL_PRINTF(format_idx, arg_idx) \
68  __attribute__((__format__ (__printf__, (format_idx), (arg_idx))))
69 #define ACL_SCANF(format_idx, arg_idx) \
70  __attribute__((__format__ (__scanf__, (format_idx), (arg_idx))))
71 #define ACL_NORETURN __attribute__((__noreturn__))
72 #define ACL_UNUSED __attribute__((__unused__))
73 #else
74 #define ACL_PRINTF(format_idx, arg_idx)
75 #define ACL_SCANF
76 #define ACL_NORETURN
77 #define ACL_UNUSED
78 #endif /* __GNUC__ */
79 
80 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
81 #define ACL_DEPRECATED __attribute__((__deprecated__))
82 #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
83 #define ACL_DEPRECATED __declspec(deprecated)
84 #else
85 #define ACL_DEPRECATED
86 #endif /* __GNUC__ */
87 
88 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
89 #define ACL_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead")))
90 #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
91 #define ACL_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
92 #else
93 #define ACL_DEPRECATED_FOR(f) ACL_DEPRECATED
94 #endif /* __GNUC__ */
95 
96 #ifndef ACL_ADDR_SEP
97 #define ACL_ADDR_SEP '|'
98 #endif
99 
100 #endif /* __ACL_DEFINE_INCLUDE_H__ */
101 
struct acl_stat acl_stat_t
Definition: acl_define.h:13
acl_int64 acl_off_t
Definition: acl_define.h:12