-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathString.h
57 lines (47 loc) · 1.24 KB
/
String.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* CLCL
*
* String.h
*
* Copyright (C) 1996-2019 by Ohno Tomoaki. All rights reserved.
* https://www.nakka.com/
*/
#ifndef _INC_STRING_H
#define _INC_STRING_H
/* Include Files */
/* Define */
#ifdef UNICODE
#define tchar_to_char_size(wbuf) (WideCharToMultiByte(CP_ACP, 0, wbuf, -1, NULL, 0, NULL, NULL) - 1)
#else
#define tchar_to_char_size(wbuf) (lstrlen(wbuf))
#endif
#ifdef UNICODE
#define tchar_to_char(wbuf, ret, len) (WideCharToMultiByte(CP_ACP, 0, wbuf, -1, ret, len + 1, NULL, NULL))
#else
#define tchar_to_char(wbuf, ret, len) (lstrcpyn(ret, wbuf, len + 1))
#endif
#ifdef UNICODE
#define char_to_tchar_size(buf) (MultiByteToWideChar(CP_ACP, 0, buf, -1, NULL, 0) - 1)
#else
#define char_to_tchar_size(buf) (lstrlen(buf))
#endif
#ifdef UNICODE
#define char_to_tchar(buf, wret, len) (MultiByteToWideChar(CP_ACP, 0, buf, -1, wret, len + 1))
#else
#define char_to_tchar(buf, wret, len) (lstrcpyn(wret, buf, len + 1))
#endif
/* Struct */
/* Function Prototypes */
int a2i(const char *str);
int x2i(const char *str);
#ifdef UNICODE
int tx2i(const TCHAR *str);
#else
#define tx2i x2i
#endif
int str2hash(const TCHAR *str);
BOOL str_match(const TCHAR *Ptn, const TCHAR *Str);
BOOL Trim(TCHAR *buf);
#endif
/* End of source */