|
36 | 36 | #ifndef _FNMATCH_H_ |
37 | 37 | #define _FNMATCH_H_ |
38 | 38 |
|
39 | | -#define FNM_NOMATCH 1 /* Match failed. */ |
| 39 | +#define FNM_NOMATCH 1 /**< Match failed */ |
40 | 40 | #define FNM_NOSYS 2 /* Function not implemented. */ |
41 | 41 | #define FNM_NORES 3 /* Out of resources */ |
42 | 42 |
|
43 | | -#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ |
44 | | -#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ |
45 | | -#define FNM_PERIOD 0x04 /* Period must be matched by period. */ |
46 | | -#define FNM_CASEFOLD 0x08 /* Pattern is matched case-insensitive */ |
47 | | -#define FNM_LEADING_DIR 0x10 /* Ignore /<tail> after Imatch. */ |
| 43 | +#define FNM_NOESCAPE 0x01 /**< Disable backslash escaping */ |
| 44 | +#define FNM_PATHNAME 0x02 /**< Slash must be matched by slash */ |
| 45 | +#define FNM_PERIOD 0x04 /**< Period must be matched by period */ |
| 46 | +#define FNM_CASEFOLD 0x08 /**< Pattern is matched case-insensitive */ |
| 47 | +#define FNM_LEADING_DIR 0x10 /**< Only match the initial segment of a string up to the first '/' */ |
48 | 48 |
|
49 | 49 | #ifdef __cplusplus |
50 | 50 | extern "C" { |
51 | 51 | #endif |
52 | 52 |
|
53 | | -int fnmatch(const char *, const char *, int); |
| 53 | +/** |
| 54 | + * @brief Check if a filename or input string matches a shell-style matching pattern. |
| 55 | + * |
| 56 | + * @param pattern pattern that is matched against @param string |
| 57 | + * @param string input string to match against @param pattern |
| 58 | + * @param flags flags used to signal special matching conditions such as @ref FNM_NOESCAPE |
| 59 | + * |
| 60 | + * |
| 61 | + * @retval 0 pattern found in string |
| 62 | + * @retval FNM_NOMATCH pattern not found in string |
| 63 | + * @retval FNM_NORES recursion limit reached |
| 64 | + * @retval FNM_NOSYS function not implemented |
| 65 | + */ |
| 66 | +int fnmatch(const char *pattern, const char *string, int flags); |
54 | 67 |
|
55 | 68 | #ifdef __cplusplus |
56 | 69 | } |
|
0 commit comments