Changeset 55b1efd in mainline for uspace/lib/posix/fnmatch.c
- Timestamp:
- 2011-08-17T19:56:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6921178
- Parents:
- e6165be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/fnmatch.c
re6165be r55b1efd 66 66 #define COLL_ELM_INVALID -1 67 67 68 /** Get collating element matching a string. 69 * 70 * @param str 68 /** 69 * Get collating element matching a string. 70 * 71 * @param str String representation of the element. 71 72 * @return Matching collating element or COLL_ELM_INVALID. 72 73 */ … … 79 80 } 80 81 81 /** Get collating element matching a single character. 82 * 83 * @param c 84 * @return 82 /** 83 * Get collating element matching a single character. 84 * 85 * @param c Character representation of the element. 86 * @return Matching collating element. 85 87 */ 86 88 static coll_elm_t _coll_elm_char(int c) … … 89 91 } 90 92 91 /** Match collating element with a beginning of a string. 92 * 93 * @param elm 94 * @param str 93 /** 94 * Match collating element with a beginning of a string. 95 * 96 * @param elm Collating element to match. 97 * @param str String which beginning should match the element. 95 98 * @return 0 if the element doesn't match, or the number of characters matched. 96 99 */ … … 100 103 } 101 104 102 /** Checks whether a string begins with a collating element in the given range. 103 * Ordering depends on the locale (if locales are supported). 105 /** 106 * Checks whether a string begins with a collating element in the given range. 107 * Ordering depends on the locale (if locales are supported). 104 108 * 105 109 * @param first First element of the range. … … 114 118 } 115 119 116 /** Read a string delimited by [? and ?]. 120 /** 121 * Read a string delimited by [? and ?]. 117 122 * 118 123 * @param pattern Pointer to the string to read from. Its position is moved … … 189 194 }; 190 195 191 /** Compare function for binary search in the _char_classes array. 196 /** 197 * Compare function for binary search in the _char_classes array. 192 198 * 193 * @param key 194 * @param elem 195 * @return 199 * @param key Key of the searched element. 200 * @param elem Element of _char_classes array. 201 * @return Ordering indicator (-1 less than, 0 equal, 1 greater than). 196 202 */ 197 203 static int _class_compare(const void *key, const void *elem) … … 201 207 } 202 208 203 /** Returns whether the given character belongs to the specified character class. 209 /** 210 * Returns whether the given character belongs to the specified character class. 204 211 * 205 212 * @param cname Name of the character class. … … 223 230 } 224 231 225 /** Tries to parse an initial part of the pattern as a character class pattern, 226 * and if successful, matches the beginning of the given string against the class. 232 /** 233 * Tries to parse an initial part of the pattern as a character class pattern, 234 * and if successful, matches the beginning of the given string against the class. 227 235 * 228 236 * @param pattern Pointer to the pattern to match. Must begin with a class … … 248 256 /************** END CHARACTER CLASSES ****************/ 249 257 250 /** Reads the next collating element in the pattern, taking into account 251 * locale (if supported) and flags (see fnmatch()). 258 /** 259 * Reads the next collating element in the pattern, taking into account 260 * locale (if supported) and flags (see fnmatch()). 252 261 * 253 262 * @param pattern Pattern. … … 299 308 } 300 309 301 /** Matches the beginning of the given string against a bracket expression 302 * the pattern begins with. 310 /** 311 * Matches the beginning of the given string against a bracket expression 312 * the pattern begins with. 303 313 * 304 314 * @param pattern Pointer to the beginning of a bracket expression in a pattern. … … 394 404 } 395 405 396 /** Matches a portion of the pattern containing no asterisks (*) against 397 * the given string. 406 /** 407 * Matches a portion of the pattern containing no asterisks (*) against 408 * the given string. 398 409 * 399 410 * @param pattern Pointer to the unmatched portion of the pattern. … … 497 508 } 498 509 499 /** Match string against a pattern. 510 /** 511 * Match string against a pattern. 500 512 * 501 513 * @param pattern Pattern. … … 559 571 } 560 572 561 /** Transform the entire string to lowercase. 573 /** 574 * Transform the entire string to lowercase. 562 575 * 563 576 * @param s Input string. … … 578 591 * Filename pattern matching. 579 592 * 580 * @param pattern 581 * @param string 582 * @param flags 583 * @return 593 * @param pattern Pattern to match the string against. 594 * @param string Matched string. 595 * @param flags Flags altering the matching of special characters 596 * (mainly for dot and slash). 597 * @return Zero if the string matches the pattern, FNM_NOMATCH otherwise. 584 598 */ 585 599 int posix_fnmatch(const char *pattern, const char *string, int flags)
Note:
See TracChangeset
for help on using the changeset viewer.