Rizin
unix-like reverse engineering framework and cli tools
rz_utf8.h
Go to the documentation of this file.
1 #ifndef RZ_UTF8_H
2 #define RZ_UTF8_H
3 
4 /* For RzStrEnc definition */
5 #include "rz_str.h"
6 
7 typedef struct {
9  const char *name;
10 } RUtfBlock;
11 // extern const RUtfBlock rz_utf_blocks[];
12 
13 typedef ut32 RzRune;
14 RZ_API int rz_utf8_encode(ut8 *ptr, const RzRune ch);
15 RZ_API int rz_utf8_decode(const ut8 *ptr, int ptrlen, RzRune *ch);
16 RZ_API int rz_mutf8_decode(const ut8 *ptr, int ptrlen, RzRune *ch);
17 RZ_API int rz_utf8_encode_str(const RzRune *str, ut8 *dst, const int dst_length);
18 RZ_API int rz_utf8_size(const ut8 *ptr);
19 RZ_API int rz_utf8_strlen(const ut8 *str);
21 RZ_API const char *rz_utf_block_name(int idx);
23 RZ_API int *rz_utf_block_list(const ut8 *str, int len, int **freq_list);
24 RZ_API RzStrEnc rz_utf_bom_encoding(const ut8 *ptr, int ptrlen);
25 #if __WINDOWS__
26 #define rz_utf16_to_utf8(wc) rz_utf16_to_utf8_l((wchar_t *)wc, -1)
27 #define rz_utf8_to_utf16(cstring) rz_utf8_to_utf16_l((char *)cstring, -1)
28 RZ_API char *rz_utf16_to_utf8_l(const wchar_t *wc, int len);
29 RZ_API wchar_t *rz_utf8_to_utf16_l(const char *cstring, int len);
30 RZ_API char *rz_acp_to_utf8_l(const char *str, int len);
31 RZ_API char *rz_utf8_to_acp_l(const char *str, int len);
32 #define rz_acp_to_utf8(str) rz_acp_to_utf8_l((char *)str, -1)
33 #define rz_utf8_to_acp(cstring) rz_utf8_to_acp_l((char *)cstring, -1)
34 #endif // __WINDOWS__
35 
36 #endif // RZ_UTF8_H
size_t len
Definition: 6502dis.c:15
#define RZ_API
uint32_t ut32
uint8_t ut8
Definition: lh5801.h:11
char * dst
Definition: lz4.h:724
int idx
Definition: setup.py:197
RzStrEnc
Definition: rz_str.h:19
RZ_API int rz_utf8_encode_str(const RzRune *str, ut8 *dst, const int dst_length)
Definition: utf8.c:559
RZ_API int * rz_utf_block_list(const ut8 *str, int len, int **freq_list)
Definition: utf8.c:754
RZ_API int rz_utf_block_idx(RzRune ch)
Definition: utf8.c:733
RZ_API int rz_utf8_size(const ut8 *ptr)
Definition: utf8.c:574
RZ_API const char * rz_utf_block_name(int idx)
Definition: utf8.c:484
RZ_API RzStrEnc rz_utf_bom_encoding(const ut8 *ptr, int ptrlen)
Definition: utf8.c:809
RZ_API int rz_utf8_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
Definition: utf8.c:492
RZ_API bool rz_rune_is_printable(const RzRune c)
Returns true when the RzRune is a printable symbol.
Definition: utf8.c:606
RZ_API int rz_mutf8_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
Definition: utf8.c:524
ut32 RzRune
Definition: rz_utf8.h:13
RZ_API int rz_utf8_encode(ut8 *ptr, const RzRune ch)
Definition: utf8.c:535
RZ_API int rz_utf8_strlen(const ut8 *str)
Definition: utf8.c:588
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
Definition: sfsocketcall.h:125
#define c(i)
Definition: sha256.c:43
ut32 from
Definition: rz_utf8.h:8
const char * name
Definition: rz_utf8.h:9