Changeset b888d5f in mainline for kernel/generic/include/string.h


Ignore:
Timestamp:
2009-04-03T07:52:29Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
043eca0
Parents:
7ce3cb2
Message:

cleanup and extend string functions according to agreed conventions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/string.h

    r7ce3cb2 rb888d5f  
    3838#include <typedefs.h>
    3939
    40 #define UTF8_NO_LIMIT  ((size_t) -1)
     40#define STR_NO_LIMIT  ((size_t) -1)
     41
     42/**< Maximum size of a string containing cnt characters */
     43#define STR_BOUNDS(cnt)  (cnt << 2)
    4144
    4245extern char invalch;
    4346
    44 extern wchar_t chr_decode(const char *, size_t *, size_t);
    45 extern int chr_encode(wchar_t, char *, size_t *, size_t);
    46 extern count_t chr_width(wchar_t);
     47extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
     48extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz);
    4749
    48 extern size_t str_size(const char *);
    49 extern size_t str_lsize(const char *, count_t);
    50 extern size_t str_wsize(const char *, count_t);
     50extern size_t str_size(const char *str);
     51extern size_t wstr_size(const wchar_t *str);
    5152
    52 extern count_t str_length(const char *);
    53 extern count_t wstr_length(const wchar_t *);
    54 extern count_t wstr_wlength(const wchar_t *, count_t);
     53extern size_t str_lsize(const char *str, count_t max_len);
     54extern size_t wstr_lsize(const wchar_t *str, count_t max_len);
     55
     56extern count_t str_length(const char *str);
     57extern count_t wstr_length(const wchar_t *wstr);
     58
     59extern count_t str_nlength(const char *str, size_t size);
     60extern count_t wstr_nlength(const wchar_t *str, size_t size);
    5561
    5662extern bool ascii_check(const wchar_t ch);
    57 extern bool unicode_check(const wchar_t ch);
     63extern bool chr_check(const wchar_t ch);
    5864
    59 extern int strcmp(const char *src, const char *dst);
    60 extern int strncmp(const char *src, const char *dst, size_t len);
    61 extern void strncpy(char *dest, const char *src, size_t len);
     65extern int str_cmp(const char *s1, const char *s2);
     66extern int str_lcmp(const char *s1, const char *s2, count_t max_len);
    6267
    63 extern char *strchr(const char *s, int i);
     68extern void str_ncpy(char *dst, const char *src, size_t size);
     69extern void wstr_nstr(char *dst, const wchar_t *src, size_t size);
     70
     71extern const char *str_chr(const char *str, wchar_t ch);
     72
     73extern bool wstr_linsert(wchar_t *str, wchar_t ch, count_t pos, count_t max_pos);
     74extern bool wstr_remove(wchar_t *str, count_t pos);
    6475
    6576#endif
Note: See TracChangeset for help on using the changeset viewer.