memutil.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // Copyright 2017 The Abseil Authors.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // https://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. #ifndef Y_ABSL_STRINGS_INTERNAL_MEMUTIL_H_
  17. #define Y_ABSL_STRINGS_INTERNAL_MEMUTIL_H_
  18. #include <cstddef>
  19. #include <cstring>
  20. #include "y_absl/base/port.h" // disable some warnings on Windows
  21. #include "y_absl/strings/ascii.h" // for y_absl::ascii_tolower
  22. namespace y_absl {
  23. Y_ABSL_NAMESPACE_BEGIN
  24. namespace strings_internal {
  25. // Performs a byte-by-byte comparison of `len` bytes of the strings `s1` and
  26. // `s2`, ignoring the case of the characters. It returns an integer less than,
  27. // equal to, or greater than zero if `s1` is found, respectively, to be less
  28. // than, to match, or be greater than `s2`.
  29. int memcasecmp(const char* s1, const char* s2, size_t len);
  30. } // namespace strings_internal
  31. Y_ABSL_NAMESPACE_END
  32. } // namespace y_absl
  33. #endif // Y_ABSL_STRINGS_INTERNAL_MEMUTIL_H_