Changeset 14201
- Timestamp:
- Sep 8, 2013, 9:25:13 PM (9 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/blocklist.c
r14191 r14201 174 174 } 175 175 176 int 176 bool 177 177 tr_blocklistFileExists (const tr_blocklistFile * b) 178 178 { 179 struct stat st; 180 181 return !stat (b->filename, &st); 179 return tr_fileExists (b->filename, NULL); 182 180 } 183 181 … … 190 188 } 191 189 192 int 190 bool 193 191 tr_blocklistFileIsEnabled (tr_blocklistFile * b) 194 192 { … … 205 203 } 206 204 207 int 205 bool 208 206 tr_blocklistFileHasAddress (tr_blocklistFile * b, const tr_address * addr) 209 207 { … … 214 212 215 213 if (!b->isEnabled || addr->type == TR_AF_INET6) 216 return 0;214 return false; 217 215 218 216 blocklistEnsureLoaded (b); 219 217 220 218 if (!b->rules || !b->ruleCount) 221 return 0;219 return false; 222 220 223 221 needle = ntohl (addr->addr.addr4.s_addr); … … 301 299 } 302 300 303 static int301 static bool 304 302 parseLine (const char * line, struct tr_ipv4_range * range) 305 303 { -
trunk/libtransmission/blocklist.h
r13824 r14201 25 25 bool isEnabled); 26 26 27 inttr_blocklistFileExists (const tr_blocklistFile * b);27 bool tr_blocklistFileExists (const tr_blocklistFile * b); 28 28 29 29 const char * tr_blocklistFileGetFilename (const tr_blocklistFile * b); … … 33 33 void tr_blocklistFileFree (tr_blocklistFile * b); 34 34 35 inttr_blocklistFileIsEnabled (tr_blocklistFile * b);35 bool tr_blocklistFileIsEnabled (tr_blocklistFile * b); 36 36 37 37 void tr_blocklistFileSetEnabled (tr_blocklistFile * b, 38 38 bool isEnabled); 39 39 40 inttr_blocklistFileHasAddress (tr_blocklistFile * b,40 bool tr_blocklistFileHasAddress (tr_blocklistFile * b, 41 41 const struct tr_address * addr); 42 42
Note: See TracChangeset
for help on using the changeset viewer.