Lines Matching full:pattern
624 * tomoyo_const_part_length - Evaluate the initial length without a pattern in a token.
628 * Returns the initial length without a pattern in @filename.
684 * tomoyo_file_matches_pattern2 - Pattern matching without '/' character and "\-" pattern.
688 * @pattern: The start of pattern to compare.
689 * @pattern_end: The end of pattern to compare.
691 * Returns true if @filename matches @pattern, false otherwise.
695 const char *pattern, in tomoyo_file_matches_pattern2() argument
698 while (filename < filename_end && pattern < pattern_end) { in tomoyo_file_matches_pattern2()
703 if (*pattern != '\\') { in tomoyo_file_matches_pattern2()
704 if (*filename++ != *pattern++) in tomoyo_file_matches_pattern2()
709 pattern++; in tomoyo_file_matches_pattern2()
710 switch (*pattern) { in tomoyo_file_matches_pattern2()
746 && strncmp(filename + 1, pattern, 3) == 0) { in tomoyo_file_matches_pattern2()
748 pattern += 2; in tomoyo_file_matches_pattern2()
757 pattern + 1, pattern_end)) in tomoyo_file_matches_pattern2()
760 if (c == '.' && *pattern == '@') in tomoyo_file_matches_pattern2()
769 break; /* Bad pattern. */ in tomoyo_file_matches_pattern2()
774 c = *pattern; in tomoyo_file_matches_pattern2()
788 pattern + 1, pattern_end)) in tomoyo_file_matches_pattern2()
791 return false; /* Not matched or bad pattern. */ in tomoyo_file_matches_pattern2()
794 pattern++; in tomoyo_file_matches_pattern2()
796 while (*pattern == '\\' && in tomoyo_file_matches_pattern2()
797 (*(pattern + 1) == '*' || *(pattern + 1) == '@')) in tomoyo_file_matches_pattern2()
798 pattern += 2; in tomoyo_file_matches_pattern2()
799 return filename == filename_end && pattern == pattern_end; in tomoyo_file_matches_pattern2()
803 * tomoyo_file_matches_pattern - Pattern matching without '/' character.
807 * @pattern: The start of pattern to compare.
808 * @pattern_end: The end of pattern to compare.
810 * Returns true if @filename matches @pattern, false otherwise.
814 const char *pattern, in tomoyo_file_matches_pattern() argument
817 const char *pattern_start = pattern; in tomoyo_file_matches_pattern()
821 while (pattern < pattern_end - 1) { in tomoyo_file_matches_pattern()
822 /* Split at "\-" pattern. */ in tomoyo_file_matches_pattern()
823 if (*pattern++ != '\\' || *pattern++ != '-') in tomoyo_file_matches_pattern()
828 pattern - 2); in tomoyo_file_matches_pattern()
834 pattern_start = pattern; in tomoyo_file_matches_pattern()
842 * tomoyo_path_matches_pattern2 - Do pathname pattern matching.
845 * @p: The start of pattern to compare.
873 /* Ignore trailing "\*" and "\@" in @pattern. */ in tomoyo_path_matches_pattern2()
880 * The "\{" pattern is permitted only after '/' character. in tomoyo_path_matches_pattern2()
882 * Also, the "\}" pattern is permitted only before '/' character in tomoyo_path_matches_pattern2()
887 return false; /* Bad pattern. */ in tomoyo_path_matches_pattern2()
889 /* Compare current component with pattern. */ in tomoyo_path_matches_pattern2()
907 * tomoyo_path_matches_pattern - Check whether the given filename matches the given pattern.
910 * @pattern: The pattern to compare.
933 const struct tomoyo_path_info *pattern) in tomoyo_path_matches_pattern() argument
936 const char *p = pattern->name; in tomoyo_path_matches_pattern()
937 const int len = pattern->const_len; in tomoyo_path_matches_pattern()
939 /* If @pattern doesn't contain pattern, I can use strcmp(). */ in tomoyo_path_matches_pattern()
940 if (!pattern->is_patterned) in tomoyo_path_matches_pattern()
941 return !tomoyo_pathcmp(filename, pattern); in tomoyo_path_matches_pattern()
943 if (filename->is_dir != pattern->is_dir) in tomoyo_path_matches_pattern()