fnmatch.hin 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* Copyright (C) 1991, 92, 93, 96, 97, 98 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 Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. 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. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  15. #ifndef _FNMATCH_H
  16. #define _FNMATCH_H 1
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
  21. # if !defined __GLIBC__ || !defined __P
  22. # undef __P
  23. # define __P(protos) protos
  24. # endif
  25. #else /* Not C++ or ANSI C. */
  26. # undef __P
  27. # define __P(protos) ()
  28. /* We can get away without defining `const' here only because in this file
  29. it is used only inside the prototype for `fnmatch', which is elided in
  30. non-ANSI C where `const' is problematical. */
  31. #endif /* C++ or ANSI C. */
  32. #ifndef const
  33. # if (defined __STDC__ && __STDC__) || defined __cplusplus
  34. # define __const const
  35. # else
  36. # define __const
  37. # endif
  38. #endif
  39. /* We #undef these before defining them because some losing systems
  40. (HP-UX A.08.07 for example) define these in <unistd.h>. */
  41. #undef FNM_PATHNAME
  42. #undef FNM_NOESCAPE
  43. #undef FNM_PERIOD
  44. /* Bits set in the FLAGS argument to `fnmatch'. */
  45. #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
  46. #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
  47. #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
  48. #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
  49. # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
  50. # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
  51. # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
  52. #endif
  53. /* Value returned by `fnmatch' if STRING does not match PATTERN. */
  54. #define FNM_NOMATCH 1
  55. /* This value is returned if the implementation does not support
  56. `fnmatch'. Since this is not the case here it will never be
  57. returned but the conformance test suites still require the symbol
  58. to be defined. */
  59. #ifdef _XOPEN_SOURCE
  60. # define FNM_NOSYS (-1)
  61. #endif
  62. /* Match STRING against the filename pattern PATTERN,
  63. returning zero if it matches, FNM_NOMATCH if not. */
  64. extern int fnmatch __P ((__const char *__pattern, __const char *__string,
  65. int __flags));
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif /* fnmatch.h */