bool ntfs_are_names_equal(const ntfschar *s1, size_t s1_len, const ntfschar *s2, size_t s2_len, const IGNORE_CASE_BOOL ic, const ntfschar *upcase, const u32 upcase_size) { if (s1_len != s2_len) return false; if (ic == CASE_SENSITIVE) return !ntfs_ucsncmp(s1, s2, s1_len); return !ntfs_ucsncasecmp(s1, s2, s1_len, upcase, upcase_size); }
/** * ntfs_names_are_equal - compare two Unicode names for equality * @s1: name to compare to @s2 * @s1_len: length in Unicode characters of @s1 * @s2: name to compare to @s1 * @s2_len: length in Unicode characters of @s2 * @ic: ignore case bool * @upcase: upcase table (only if @ic == IGNORE_CASE) * @upcase_size: length in Unicode characters of @upcase (if present) * * Compare the names @s1 and @s2 and return TRUE (1) if the names are * identical, or FALSE (0) if they are not identical. If @ic is IGNORE_CASE, * the @upcase table is used to perform a case insensitive comparison. */ BOOL ntfs_names_are_equal(const ntfschar *s1, size_t s1_len, const ntfschar *s2, size_t s2_len, const IGNORE_CASE_BOOL ic, const ntfschar *upcase, const u32 upcase_size) { if (s1_len != s2_len) return FALSE; if (!s1_len) return TRUE; if (ic == CASE_SENSITIVE) return ntfs_ucsncmp(s1, s2, s1_len) ? FALSE: TRUE; return ntfs_ucsncasecmp(s1, s2, s1_len, upcase, upcase_size) ? FALSE: TRUE; }