MCPcopy Index your code
hub / github.com/RsyncProject/rsync / set_compression

Function set_compression

token.c:225–279  ·  view source on GitHub ↗

determine the compression level based on a wildcard filename list */

Source from the content-addressed store, hash-verified

223
224/* determine the compression level based on a wildcard filename list */
225void set_compression(const char *fname)
226{
227#if 0 /* No compression algorithms currently allow mid-stream changing of the level. */
228 const struct suffix_tree *node;
229 const char *s;
230 char ltr;
231#endif
232
233 if (!do_compression)
234 return;
235
236 if (!match_list)
237 init_set_compression();
238
239#if 0
240 compression_level = per_file_default_level;
241
242 if (!*match_list && !suftree)
243 return;
244
245 if ((s = strrchr(fname, '/')) != NULL)
246 fname = s + 1;
247
248 for (s = match_list; *s; s += strlen(s) + 1) {
249 if (iwildmatch(s, fname)) {
250 compression_level = skip_compression_level;
251 return;
252 }
253 }
254
255 if (!(node = suftree) || !(s = strrchr(fname, '.'))
256 || s == fname || !(ltr = *++s))
257 return;
258
259 while (1) {
260 if (isUpper(&ltr))
261 ltr = toLower(&ltr);
262 while (node->letter != ltr) {
263 if (node->letter > ltr)
264 return;
265 if (!(node = node->sibling))
266 return;
267 }
268 if ((ltr = *++s) == '\0') {
269 if (node->word_end)
270 compression_level = skip_compression_level;
271 return;
272 }
273 if (!(node = node->child))
274 return;
275 }
276#else
277 (void)fname;
278#endif
279}
280
281/* non-compressing recv token */
282static int32 simple_recv_token(int f, char **data)

Callers 1

send_filesFunction · 0.85

Calls 4

init_set_compressionFunction · 0.85
iwildmatchFunction · 0.85
isUpperFunction · 0.85
toLowerFunction · 0.85

Tested by

no test coverage detected