Changeset 4c53333 in mainline for uspace/lib/posix/source/fnmatch.c


Ignore:
Timestamp:
2013-07-11T08:21:10Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64e63ce1
Parents:
80445cf (diff), c8bb1633 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

File:
1 moved

Legend:

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

    r80445cf r4c53333  
    4242 */
    4343
    44 #include "stdbool.h"
    45 #include "ctype.h"
    46 #include "string.h"
    47 #include "stdlib.h"
    48 #include "assert.h"
    49 
    5044#define LIBPOSIX_INTERNAL
     45#define __POSIX_DEF__(x) posix_##x
     46
     47#include "libc/stdbool.h"
     48#include "posix/ctype.h"
     49#include "posix/string.h"
     50#include "posix/stdlib.h"
     51#include "posix/assert.h"
    5152
    5253#include "internal/common.h"
    53 #include "fnmatch.h"
     54#include "posix/fnmatch.h"
    5455
    5556/* Returned by _match... functions. */
     
    182183        { "alnum", isalnum },
    183184        { "alpha", isalpha },
    184         { "blank", isblank },
    185         { "cntrl", iscntrl },
     185        { "blank", posix_isblank },
     186        { "cntrl", posix_iscntrl },
    186187        { "digit", isdigit },
    187         { "graph", isgraph },
     188        { "graph", posix_isgraph },
    188189        { "lower", islower },
    189         { "print", isprint },
    190         { "punct", ispunct },
     190        { "print", posix_isprint },
     191        { "punct", posix_ispunct },
    191192        { "space", isspace },
    192193        { "upper", isupper },
    193         { "xdigit", isxdigit }
     194        { "xdigit", posix_isxdigit }
    194195};
    195196
     
    204205{
    205206        const struct _char_class *class = elem;
    206         return strcmp((const char *) key, class->name);
     207        return posix_strcmp((const char *) key, class->name);
    207208}
    208209
     
    217218{
    218219        /* Search for class in the array of supported character classes. */
    219         const struct _char_class *class = bsearch(cname, _char_classes,
     220        const struct _char_class *class = posix_bsearch(cname, _char_classes,
    220221            sizeof(_char_classes) / sizeof(struct _char_class),
    221222            sizeof(struct _char_class), _class_compare);
     
    549550                        end = string;
    550551                } else {
    551                         end = strchrnul(string, pathname ? '/' : '\0');
     552                        end = gnu_strchrnul(string, pathname ? '/' : '\0');
    552553                }
    553554
     
    581582{
    582583        assert(s != NULL);
    583         char *result = strdup(s);
     584        char *result = posix_strdup(s);
    584585        for (char *i = result; *i != '\0'; ++i) {
    585586                *i = tolower(*i);
Note: See TracChangeset for help on using the changeset viewer.