Lines Matching full:pattern
595 * tomoyo_const_part_length - Evaluate the initial length without a pattern in a token.
599 * Returns the initial length without a pattern in @filename.
655 * tomoyo_file_matches_pattern2 - Pattern matching without '/' character and "\-" pattern.
659 * @pattern: The start of pattern to compare.
660 * @pattern_end: The end of pattern to compare.
662 * Returns true if @filename matches @pattern, false otherwise.
666 const char *pattern, in tomoyo_file_matches_pattern2() argument
669 while (filename < filename_end && pattern < pattern_end) { in tomoyo_file_matches_pattern2()
671 if (*pattern != '\\') { in tomoyo_file_matches_pattern2()
672 if (*filename++ != *pattern++) in tomoyo_file_matches_pattern2()
677 pattern++; in tomoyo_file_matches_pattern2()
678 switch (*pattern) { in tomoyo_file_matches_pattern2()
716 && strncmp(filename + 1, pattern, 3) == 0) { in tomoyo_file_matches_pattern2()
718 pattern += 2; in tomoyo_file_matches_pattern2()
727 pattern + 1, pattern_end)) in tomoyo_file_matches_pattern2()
730 if (c == '.' && *pattern == '@') in tomoyo_file_matches_pattern2()
739 break; /* Bad pattern. */ in tomoyo_file_matches_pattern2()
744 c = *pattern; in tomoyo_file_matches_pattern2()
758 pattern + 1, pattern_end)) in tomoyo_file_matches_pattern2()
761 return false; /* Not matched or bad pattern. */ in tomoyo_file_matches_pattern2()
764 pattern++; in tomoyo_file_matches_pattern2()
766 while (*pattern == '\\' && in tomoyo_file_matches_pattern2()
767 (*(pattern + 1) == '*' || *(pattern + 1) == '@')) in tomoyo_file_matches_pattern2()
768 pattern += 2; in tomoyo_file_matches_pattern2()
769 return filename == filename_end && pattern == pattern_end; in tomoyo_file_matches_pattern2()
773 * tomoyo_file_matches_pattern - Pattern matching without '/' character.
777 * @pattern: The start of pattern to compare.
778 * @pattern_end: The end of pattern to compare.
780 * Returns true if @filename matches @pattern, false otherwise.
784 const char *pattern, in tomoyo_file_matches_pattern() argument
787 const char *pattern_start = pattern; in tomoyo_file_matches_pattern()
791 while (pattern < pattern_end - 1) { in tomoyo_file_matches_pattern()
792 /* Split at "\-" pattern. */ in tomoyo_file_matches_pattern()
793 if (*pattern++ != '\\' || *pattern++ != '-') in tomoyo_file_matches_pattern()
798 pattern - 2); in tomoyo_file_matches_pattern()
804 pattern_start = pattern; in tomoyo_file_matches_pattern()
812 * tomoyo_path_matches_pattern2 - Do pathname pattern matching.
815 * @p: The start of pattern to compare.
843 /* Ignore trailing "\*" and "\@" in @pattern. */ in tomoyo_path_matches_pattern2()
850 * The "\{" pattern is permitted only after '/' character. in tomoyo_path_matches_pattern2()
852 * Also, the "\}" pattern is permitted only before '/' character in tomoyo_path_matches_pattern2()
857 return false; /* Bad pattern. */ in tomoyo_path_matches_pattern2()
859 /* Compare current component with pattern. */ in tomoyo_path_matches_pattern2()
877 * tomoyo_path_matches_pattern - Check whether the given filename matches the given pattern.
880 * @pattern: The pattern to compare.
903 const struct tomoyo_path_info *pattern) in tomoyo_path_matches_pattern() argument
906 const char *p = pattern->name; in tomoyo_path_matches_pattern()
907 const int len = pattern->const_len; in tomoyo_path_matches_pattern()
909 /* If @pattern doesn't contain pattern, I can use strcmp(). */ in tomoyo_path_matches_pattern()
910 if (!pattern->is_patterned) in tomoyo_path_matches_pattern()
911 return !tomoyo_pathcmp(filename, pattern); in tomoyo_path_matches_pattern()
913 if (filename->is_dir != pattern->is_dir) in tomoyo_path_matches_pattern()