Changeset 7f9df7b9 in mainline for uspace/lib/posix/src/fnmatch.c


Ignore:
Timestamp:
2018-01-22T22:42:57Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7a08c70
Parents:
e0f47f5
Message:

Remove unnecessary symbol renaming from libposix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/fnmatch.c

    re0f47f5 r7f9df7b9  
    4141 * will be fairly straightforward.
    4242 */
    43 
    44 #define LIBPOSIX_INTERNAL
    45 #define __POSIX_DEF__(x) posix_##x
    4643
    4744#include "libc/stdbool.h"
     
    205202{
    206203        const struct _char_class *class = elem;
    207         return posix_strcmp((const char *) key, class->name);
     204        return strcmp((const char *) key, class->name);
    208205}
    209206
     
    218215{
    219216        /* Search for class in the array of supported character classes. */
    220         const struct _char_class *class = posix_bsearch(cname, _char_classes,
     217        const struct _char_class *class = bsearch(cname, _char_classes,
    221218            sizeof(_char_classes) / sizeof(struct _char_class),
    222219            sizeof(struct _char_class), _class_compare);
     
    582579{
    583580        assert(s != NULL);
    584         char *result = posix_strdup(s);
     581        char *result = strdup(s);
    585582        for (char *i = result; *i != '\0'; ++i) {
    586583                *i = tolower(*i);
     
    598595 * @return Zero if the string matches the pattern, FNM_NOMATCH otherwise.
    599596 */
    600 int posix_fnmatch(const char *pattern, const char *string, int flags)
     597int fnmatch(const char *pattern, const char *string, int flags)
    601598{
    602599        assert(pattern != NULL);
     
    637634        #undef assert
    638635        #define assert(x) { if (x) printf("SUCCESS: "#x"\n"); else { printf("FAILED: "#x"\n"); fail++; } }
    639         #define match(s1, s2, flags) assert(posix_fnmatch(s1, s2, flags) == 0)
    640         #define nomatch(s1, s2, flags) assert(posix_fnmatch(s1, s2, flags) == FNM_NOMATCH)
     636        #define match(s1, s2, flags) assert(fnmatch(s1, s2, flags) == 0)
     637        #define nomatch(s1, s2, flags) assert(fnmatch(s1, s2, flags) == FNM_NOMATCH)
    641638
    642639        static_assert(FNM_PATHNAME == FNM_FILE_NAME);
Note: See TracChangeset for help on using the changeset viewer.