| 1 |
|
| #define PERL_constant_NOTFOUND 1 |
| 2 |
|
| #define PERL_constant_NOTDEF 2 |
| 3 |
|
| #define PERL_constant_ISIV 3 |
| 4 |
|
| #define PERL_constant_ISNO 4 |
| 5 |
|
| #define PERL_constant_ISNV 5 |
| 6 |
|
| #define PERL_constant_ISPV 6 |
| 7 |
|
| #define PERL_constant_ISPVN 7 |
| 8 |
|
| #define PERL_constant_ISSV 8 |
| 9 |
|
| #define PERL_constant_ISUNDEF 9 |
| 10 |
|
| #define PERL_constant_ISUV 10 |
| 11 |
|
| #define PERL_constant_ISYES 11 |
| 12 |
|
| |
| 13 |
|
| #ifndef NVTYPE |
| 14 |
|
| typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */ |
| 15 |
|
| #endif |
| 16 |
|
| #ifndef aTHX_ |
| 17 |
|
| #define aTHX_ /* 5.6 or later define this for threading support. */ |
| 18 |
|
| #endif |
| 19 |
|
| #ifndef pTHX_ |
| 20 |
|
| #define pTHX_ /* 5.6 or later define this for threading support. */ |
| 21 |
|
| #endif |
| 22 |
|
| |
| 23 |
|
| /* This allows slightly more efficient code on !USE_ITHREADS: */ |
| 24 |
|
| #ifdef USE_ITHREADS |
| 25 |
|
| # define COP_FILE(c) CopFILE(c) |
| 26 |
|
| # define COP_FILE_F "s" |
| 27 |
|
| #else |
| 28 |
|
| # define COP_FILE(c) CopFILESV(c) |
| 29 |
|
| # define COP_FILE_F SVf |
| 30 |
|
| #endif |
| 31 |
|
| |
| 32 |
|
| static void |
| 33 |
144 |
| constant_add_symbol(pTHX_ HV *hash, const char *name, I32 namelen, SV *value) { |
| 34 |
144 |
| HE *he = (HE*) hv_common_key_len(hash, name, namelen, HV_FETCH_LVALUE, NULL, |
| 35 |
|
| 0); |
| 36 |
|
| SV *sv; |
| 37 |
|
| |
| 38 |
144 |
▶ | if (!he) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!he) { |
0 |
144 |
144 |
|
| 39 |
0 |
| croak("Couldn't add key '%s' to %%Linux::Fanotify::", |
| 40 |
|
| name); |
| 41 |
|
| } |
| 42 |
144 |
| sv = HeVAL(he); |
| 43 |
144 |
▶ | if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
Branch: 2 branches
| Branch | True | False | Total |
| if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
144 |
0 |
144 |
| if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
0 |
144 |
144 |
|
| 44 |
|
| /* Someone has been here before us - have to make a real sub. */ |
| 45 |
0 |
| newCONSTSUB(hash, name, value); |
| 46 |
|
| } else { |
| 47 |
144 |
▶ | SvUPGRADE(sv, SVt_RV); |
Branch: 1 branch
| Branch | True | False | Total |
| SvUPGRADE(sv, SVt_RV); |
144 |
0 |
144 |
|
| 48 |
144 |
| SvRV_set(sv, value); |
| 49 |
144 |
| SvROK_on(sv); |
| 50 |
144 |
| SvREADONLY_on(value); |
| 51 |
|
| } |
| 52 |
144 |
| } |
| 53 |
|
| |
| 54 |
|
| |
| 55 |
|
| |
| 56 |
|
| #ifndef SYMBIAN |
| 57 |
|
| |
| 58 |
|
| /* Store a hash of all symbols missing from the package. To avoid trampling on |
| 59 |
|
| the package namespace (uninvited) put each package's hash in our namespace. |
| 60 |
|
| To avoid creating lots of typeblogs and symbol tables for sub-packages, put |
| 61 |
|
| each package's hash into one hash in our namespace. */ |
| 62 |
|
| |
| 63 |
|
| static HV * |
| 64 |
0 |
| get_missing_hash(pTHX) { |
| 65 |
|
| HV *const parent |
| 66 |
0 |
| = get_hv("ExtUtils::Constant::ProxySubs::Missing", GVf_MULTI); |
| 67 |
|
| /* We could make a hash of hashes directly, but this would confuse anything |
| 68 |
|
| at Perl space that looks at us, and as we're visible in Perl space, |
| 69 |
|
| best to play nice. */ |
| 70 |
|
| SV *const *const ref |
| 71 |
0 |
| = hv_fetch(parent, "Linux::Fanotify", 15, TRUE); |
| 72 |
|
| HV *new_hv; |
| 73 |
|
| |
| 74 |
0 |
▶ | if (!ref) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ref) |
0 |
0 |
0 |
|
| 75 |
0 |
| return NULL; |
| 76 |
|
| |
| 77 |
0 |
▶ | if (SvROK(*ref)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvROK(*ref)) |
0 |
0 |
0 |
|
| 78 |
0 |
| return (HV*) SvRV(*ref); |
| 79 |
|
| |
| 80 |
0 |
| new_hv = newHV(); |
| 81 |
0 |
▶ | SvUPGRADE(*ref, SVt_RV); |
Branch: 1 branch
| Branch | True | False | Total |
| SvUPGRADE(*ref, SVt_RV); |
0 |
0 |
0 |
|
| 82 |
0 |
| SvRV_set(*ref, (SV *)new_hv); |
| 83 |
0 |
| SvROK_on(*ref); |
| 84 |
0 |
| return new_hv; |
| 85 |
|
| } |
| 86 |
|
| |
| 87 |
|
| #endif |
| 88 |
|
| |
| 89 |
|
| struct notfound_s {const char *name; I32 namelen;} ; |
| 90 |
|
| |
| 91 |
|
| static const struct notfound_s values_for_notfound[] = |
| 92 |
|
| { |
| 93 |
|
| #ifndef FAN_ACCESS |
| 94 |
|
| { "FAN_ACCESS", 10 }, |
| 95 |
|
| #endif |
| 96 |
|
| #ifndef FAN_MODIFY |
| 97 |
|
| { "FAN_MODIFY", 10 }, |
| 98 |
|
| #endif |
| 99 |
|
| #ifndef FAN_CLOSE_WRITE |
| 100 |
|
| { "FAN_CLOSE_WRITE", 15 }, |
| 101 |
|
| #endif |
| 102 |
|
| #ifndef FAN_CLOSE_NOWRITE |
| 103 |
|
| { "FAN_CLOSE_NOWRITE", 17 }, |
| 104 |
|
| #endif |
| 105 |
|
| #ifndef FAN_OPEN |
| 106 |
|
| { "FAN_OPEN", 8 }, |
| 107 |
|
| #endif |
| 108 |
|
| #ifndef FAN_Q_OVERFLOW |
| 109 |
|
| { "FAN_Q_OVERFLOW", 14 }, |
| 110 |
|
| #endif |
| 111 |
|
| #ifndef FAN_OPEN_PERM |
| 112 |
|
| { "FAN_OPEN_PERM", 13 }, |
| 113 |
|
| #endif |
| 114 |
|
| #ifndef FAN_ACCESS_PERM |
| 115 |
|
| { "FAN_ACCESS_PERM", 15 }, |
| 116 |
|
| #endif |
| 117 |
|
| #ifndef FAN_ONDIR |
| 118 |
|
| { "FAN_ONDIR", 9 }, |
| 119 |
|
| #endif |
| 120 |
|
| #ifndef FAN_EVENT_ON_CHILD |
| 121 |
|
| { "FAN_EVENT_ON_CHILD", 18 }, |
| 122 |
|
| #endif |
| 123 |
|
| #ifndef FAN_CLOSE |
| 124 |
|
| { "FAN_CLOSE", 9 }, |
| 125 |
|
| #endif |
| 126 |
|
| #ifndef FAN_CLOEXEC |
| 127 |
|
| { "FAN_CLOEXEC", 11 }, |
| 128 |
|
| #endif |
| 129 |
|
| #ifndef FAN_NONBLOCK |
| 130 |
|
| { "FAN_NONBLOCK", 12 }, |
| 131 |
|
| #endif |
| 132 |
|
| #ifndef FAN_CLASS_NOTIF |
| 133 |
|
| { "FAN_CLASS_NOTIF", 15 }, |
| 134 |
|
| #endif |
| 135 |
|
| #ifndef FAN_CLASS_CONTENT |
| 136 |
|
| { "FAN_CLASS_CONTENT", 17 }, |
| 137 |
|
| #endif |
| 138 |
|
| #ifndef FAN_CLASS_PRE_CONTENT |
| 139 |
|
| { "FAN_CLASS_PRE_CONTENT", 21 }, |
| 140 |
|
| #endif |
| 141 |
|
| #ifndef FAN_ALL_CLASS_BITS |
| 142 |
|
| { "FAN_ALL_CLASS_BITS", 18 }, |
| 143 |
|
| #endif |
| 144 |
|
| #ifndef FAN_UNLIMITED_QUEUE |
| 145 |
|
| { "FAN_UNLIMITED_QUEUE", 19 }, |
| 146 |
|
| #endif |
| 147 |
|
| #ifndef FAN_UNLIMITED_MARKS |
| 148 |
|
| { "FAN_UNLIMITED_MARKS", 19 }, |
| 149 |
|
| #endif |
| 150 |
|
| #ifndef FAN_ALL_INIT_FLAGS |
| 151 |
|
| { "FAN_ALL_INIT_FLAGS", 18 }, |
| 152 |
|
| #endif |
| 153 |
|
| #ifndef FAN_MARK_ADD |
| 154 |
|
| { "FAN_MARK_ADD", 12 }, |
| 155 |
|
| #endif |
| 156 |
|
| #ifndef FAN_MARK_REMOVE |
| 157 |
|
| { "FAN_MARK_REMOVE", 15 }, |
| 158 |
|
| #endif |
| 159 |
|
| #ifndef FAN_MARK_DONT_FOLLOW |
| 160 |
|
| { "FAN_MARK_DONT_FOLLOW", 20 }, |
| 161 |
|
| #endif |
| 162 |
|
| #ifndef FAN_MARK_ONLYDIR |
| 163 |
|
| { "FAN_MARK_ONLYDIR", 16 }, |
| 164 |
|
| #endif |
| 165 |
|
| #ifndef FAN_MARK_MOUNT |
| 166 |
|
| { "FAN_MARK_MOUNT", 14 }, |
| 167 |
|
| #endif |
| 168 |
|
| #ifndef FAN_MARK_IGNORED_MASK |
| 169 |
|
| { "FAN_MARK_IGNORED_MASK", 21 }, |
| 170 |
|
| #endif |
| 171 |
|
| #ifndef FAN_MARK_IGNORED_SURV_MODIFY |
| 172 |
|
| { "FAN_MARK_IGNORED_SURV_MODIFY", 28 }, |
| 173 |
|
| #endif |
| 174 |
|
| #ifndef FAN_MARK_FLUSH |
| 175 |
|
| { "FAN_MARK_FLUSH", 14 }, |
| 176 |
|
| #endif |
| 177 |
|
| #ifndef FAN_ALL_MARK_FLAGS |
| 178 |
|
| { "FAN_ALL_MARK_FLAGS", 18 }, |
| 179 |
|
| #endif |
| 180 |
|
| #ifndef FAN_ALL_EVENTS |
| 181 |
|
| { "FAN_ALL_EVENTS", 14 }, |
| 182 |
|
| #endif |
| 183 |
|
| #ifndef FAN_ALL_PERM_EVENTS |
| 184 |
|
| { "FAN_ALL_PERM_EVENTS", 19 }, |
| 185 |
|
| #endif |
| 186 |
|
| #ifndef FAN_ALL_OUTGOING_EVENTS |
| 187 |
|
| { "FAN_ALL_OUTGOING_EVENTS", 23 }, |
| 188 |
|
| #endif |
| 189 |
|
| #ifndef FANOTIFY_METADATA_VERSION |
| 190 |
|
| { "FANOTIFY_METADATA_VERSION", 25 }, |
| 191 |
|
| #endif |
| 192 |
|
| #ifndef FAN_ALLOW |
| 193 |
|
| { "FAN_ALLOW", 9 }, |
| 194 |
|
| #endif |
| 195 |
|
| #ifndef FAN_DENY |
| 196 |
|
| { "FAN_DENY", 8 }, |
| 197 |
|
| #endif |
| 198 |
|
| #ifndef FAN_NOFD |
| 199 |
|
| { "FAN_NOFD", 8 }, |
| 200 |
|
| #endif |
| 201 |
|
| { NULL, 0 } }; |
| 202 |
|
| struct iv_s {const char *name; I32 namelen; IV value;}; |