Lines Matching full:pattern
629 * tomoyo_const_part_length - Evaluate the initial length without a pattern in a token.
633 * Returns the initial length without a pattern in @filename.
689 * tomoyo_file_matches_pattern2 - Pattern matching without '/' character and "\-" pattern.
693 * @pattern: The start of pattern to compare.
694 * @pattern_end: The end of pattern to compare.
696 * Returns true if @filename matches @pattern, false otherwise.
700 const char *pattern, in tomoyo_file_matches_pattern2() argument
703 while (filename < filename_end && pattern < pattern_end) { in tomoyo_file_matches_pattern2()
708 if (*pattern != '\\') { in tomoyo_file_matches_pattern2()
709 if (*filename++ != *pattern++) in tomoyo_file_matches_pattern2()
714 pattern++; in tomoyo_file_matches_pattern2()
715 switch (*pattern) { in tomoyo_file_matches_pattern2()
751 && strncmp(filename + 1, pattern, 3) == 0) { in tomoyo_file_matches_pattern2()
753 pattern += 2; in tomoyo_file_matches_pattern2()
762 pattern + 1, pattern_end)) in tomoyo_file_matches_pattern2()
765 if (c == '.' && *pattern == '@') in tomoyo_file_matches_pattern2()
774 break; /* Bad pattern. */ in tomoyo_file_matches_pattern2()
779 c = *pattern; in tomoyo_file_matches_pattern2()
793 pattern + 1, pattern_end)) in tomoyo_file_matches_pattern2()
796 return false; /* Not matched or bad pattern. */ in tomoyo_file_matches_pattern2()
799 pattern++; in tomoyo_file_matches_pattern2()
801 while (*pattern == '\\' && in tomoyo_file_matches_pattern2()
802 (*(pattern + 1) == '*' || *(pattern + 1) == '@')) in tomoyo_file_matches_pattern2()
803 pattern += 2; in tomoyo_file_matches_pattern2()
804 return filename == filename_end && pattern == pattern_end; in tomoyo_file_matches_pattern2()
808 * tomoyo_file_matches_pattern - Pattern matching without '/' character.
812 * @pattern: The start of pattern to compare.
813 * @pattern_end: The end of pattern to compare.
815 * Returns true if @filename matches @pattern, false otherwise.
819 const char *pattern, in tomoyo_file_matches_pattern() argument
822 const char *pattern_start = pattern; in tomoyo_file_matches_pattern()
826 while (pattern < pattern_end - 1) { in tomoyo_file_matches_pattern()
827 /* Split at "\-" pattern. */ in tomoyo_file_matches_pattern()
828 if (*pattern++ != '\\' || *pattern++ != '-') in tomoyo_file_matches_pattern()
833 pattern - 2); in tomoyo_file_matches_pattern()
839 pattern_start = pattern; in tomoyo_file_matches_pattern()
847 * tomoyo_path_matches_pattern2 - Do pathname pattern matching.
850 * @p: The start of pattern to compare.
878 /* Ignore trailing "\*" and "\@" in @pattern. */ in tomoyo_path_matches_pattern2()
885 * The "\{" pattern is permitted only after '/' character. in tomoyo_path_matches_pattern2()
887 * Also, the "\}" pattern is permitted only before '/' character in tomoyo_path_matches_pattern2()
892 return false; /* Bad pattern. */ in tomoyo_path_matches_pattern2()
894 /* Compare current component with pattern. */ in tomoyo_path_matches_pattern2()
912 * tomoyo_path_matches_pattern - Check whether the given filename matches the given pattern.
915 * @pattern: The pattern to compare.
938 const struct tomoyo_path_info *pattern) in tomoyo_path_matches_pattern() argument
941 const char *p = pattern->name; in tomoyo_path_matches_pattern()
942 const int len = pattern->const_len; in tomoyo_path_matches_pattern()
944 /* If @pattern doesn't contain pattern, I can use strcmp(). */ in tomoyo_path_matches_pattern()
945 if (!pattern->is_patterned) in tomoyo_path_matches_pattern()
946 return !tomoyo_pathcmp(filename, pattern); in tomoyo_path_matches_pattern()
948 if (filename->is_dir != pattern->is_dir) in tomoyo_path_matches_pattern()