fnmatch.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (C) 1991-2020 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>. */
  14. #ifndef _FNMATCH_H
  15. #define _FNMATCH_H 1
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* We #undef these before defining them because some losing systems
  20. (HP-UX A.08.07 for example) define these in <unistd.h>. */
  21. #undef FNM_PATHNAME
  22. #undef FNM_NOESCAPE
  23. #undef FNM_PERIOD
  24. /* Bits set in the FLAGS argument to `fnmatch'. */
  25. #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
  26. #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
  27. #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
  28. #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
  29. # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
  30. # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
  31. # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
  32. # define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */
  33. #endif
  34. /* Value returned by `fnmatch' if STRING does not match PATTERN. */
  35. #define FNM_NOMATCH 1
  36. /* This value is returned if the implementation does not support
  37. `fnmatch'. Since this is not the case here it will never be
  38. returned but the conformance test suites still require the symbol
  39. to be defined. */
  40. #ifdef _XOPEN_SOURCE
  41. # define FNM_NOSYS (-1)
  42. #endif
  43. /* Match NAME against the filename pattern PATTERN,
  44. returning zero if it matches, FNM_NOMATCH if not. */
  45. extern int fnmatch (const char *__pattern, const char *__name, int __flags);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* fnmatch.h */