Subversion Repositories HelenOS

Rev

Rev 4209 | Rev 4223 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4209 Rev 4212
Line 35... Line 35...
35
#ifndef KERN_STRING_H_
35
#ifndef KERN_STRING_H_
36
#define KERN_STRING_H_
36
#define KERN_STRING_H_
37
 
37
 
38
#include <typedefs.h>
38
#include <typedefs.h>
39
 
39
 
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)
41
 
44
 
42
extern char invalch;
45
extern char invalch;
43
 
46
 
44
extern wchar_t chr_decode(const char *, size_t *, size_t);
47
extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
45
extern int chr_encode(wchar_t, char *, size_t *, size_t);
48
extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz);
46
extern count_t chr_width(wchar_t);
-
 
47
 
49
 
48
extern size_t str_size(const char *);
50
extern size_t str_size(const char *str);
49
extern size_t str_lsize(const char *, count_t);
51
extern size_t wstr_size(const wchar_t *str);
-
 
52
 
50
extern size_t str_wsize(const char *, count_t);
53
extern size_t str_lsize(const char *str, count_t max_len);
-
 
54
extern size_t wstr_lsize(const wchar_t *str, count_t max_len);
51
 
55
 
52
extern count_t str_length(const char *);
56
extern count_t str_length(const char *str);
53
extern count_t wstr_length(const wchar_t *);
57
extern count_t wstr_length(const wchar_t *wstr);
-
 
58
 
-
 
59
extern count_t str_nlength(const char *str, size_t size);
54
extern count_t wstr_wlength(const wchar_t *, count_t);
60
extern count_t wstr_nlength(const wchar_t *str, size_t size);
55
 
61
 
56
extern bool ascii_check(const wchar_t ch);
62
extern bool ascii_check(const wchar_t ch);
57
extern bool unicode_check(const wchar_t ch);
63
extern bool chr_check(const wchar_t ch);
-
 
64
 
-
 
65
extern int str_cmp(const char *s1, const char *s2);
-
 
66
extern int str_lcmp(const char *s1, const char *s2, count_t max_len);
-
 
67
 
-
 
68
extern void str_ncpy(char *dst, const char *src, size_t size);
-
 
69
extern void wstr_nstr(char *dst, const wchar_t *src, size_t size);
58
 
70
 
59
extern int strcmp(const char *src, const char *dst);
-
 
60
extern int strncmp(const char *src, const char *dst, size_t len);
71
extern const char *str_chr(const char *str, wchar_t ch);
61
extern void strncpy(char *dest, const char *src, size_t len);
-
 
62
 
72
 
-
 
73
extern bool wstr_linsert(wchar_t *str, wchar_t ch, count_t pos, count_t max_pos);
63
extern char *strchr(const char *s, int i);
74
extern bool wstr_remove(wchar_t *str, count_t pos);
64
 
75
 
65
#endif
76
#endif
66
 
77
 
67
/** @}
78
/** @}
68
 */
79
 */