Changeset 2b3dd78 in mainline for uspace/lib/posix/src/strings.c


Ignore:
Timestamp:
2018-01-31T12:02:00Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5595841
Parents:
a0a9cc2 (diff), 14d789c (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 remote-tracking branch 'upstream/master' into forwardport

change tmon includes because of new stdlib

File:
1 moved

Legend:

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

    ra0a9cc2 r2b3dd78  
    3434 */
    3535
    36 #define LIBPOSIX_INTERNAL
    37 #define __POSIX_DEF__(x) posix_##x
    38 
    3936#include "internal/common.h"
    4037#include "posix/strings.h"
     
    4441
    4542#include "libc/mem.h"
     43#include "libc/str.h"
    4644
    4745/**
     
    5149 * @return Index of first set bit. Bits are numbered starting at one.
    5250 */
    53 int posix_ffs(int i)
     51int ffs(int i)
    5452{
    5553        if (i == 0) {
     
    9189 *     or 0 if strings have the same content.
    9290 */
    93 int posix_strcasecmp(const char *s1, const char *s2)
     91int strcasecmp(const char *s1, const char *s2)
    9492{
    95         return posix_strncasecmp(s1, s2, STR_NO_LIMIT);
     93        return strncasecmp(s1, s2, STR_NO_LIMIT);
    9694}
    9795
     
    105103 *     or 0 if strings have the same content.
    106104 */
    107 int posix_strncasecmp(const char *s1, const char *s2, size_t n)
     105int strncasecmp(const char *s1, const char *s2, size_t n)
    108106{
    109107        for (size_t i = 0; i < n; ++i) {
     
    130128 *     zero. Otherwise return non-zero.
    131129 */
    132 int posix_bcmp(const void *mem1, const void *mem2, size_t n)
     130int bcmp(const void *mem1, const void *mem2, size_t n)
    133131{
    134132        return memcmp(mem1, mem2, n);
     
    142140 * @param n Number of bytes to copy.
    143141 */
    144 void posix_bcopy(const void *src, void *dest, size_t n)
     142void bcopy(const void *src, void *dest, size_t n)
    145143{
    146144        /* Note that memmove has different order of arguments. */
     
    154152 * @param n Number of bytes to reset.
    155153 */
    156 void posix_bzero(void *mem, size_t n)
     154void bzero(void *mem, size_t n)
    157155{
    158156        memset(mem, 0, n);
     
    167165 *     NULL pointer otherwise.
    168166 */
    169 char *posix_index(const char *s, int c)
     167char *index(const char *s, int c)
    170168{
    171         return posix_strchr(s, c);
     169        return strchr(s, c);
    172170}
    173171
     
    180178 *     NULL pointer otherwise.
    181179 */
    182 char *posix_rindex(const char *s, int c)
     180char *rindex(const char *s, int c)
    183181{
    184         return posix_strrchr(s, c);
     182        return strrchr(s, c);
    185183}
    186184
Note: See TracChangeset for help on using the changeset viewer.