~ubuntu-branches/ubuntu/raring/unrar-nonfree/raring-proposed

« back to all changes in this revision

Viewing changes to unicode.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Chris Anderson
  • Date: 2004-12-01 02:22:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041201022256-c3pj5nufp88tdyw6
Tags: 3.4.3-1
* New upstream release 
* Applied Ulf Harnhammar's patch to solve overflows when $HOME was too
  large (closes: #280263).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#define MBFUNCTIONS
6
6
#endif
7
7
 
8
 
#if defined(MBFUNCTIONS) || defined(_WIN_32)
 
8
#if defined(MBFUNCTIONS) || defined(_WIN_32) || defined(_EMX) && !defined(_DJGPP)
9
9
#define UNICODE_SUPPORTED
10
10
#endif
11
11
 
13
13
#define DBCS_SUPPORTED
14
14
#endif
15
15
 
 
16
#ifdef _EMX
 
17
int uni_init(int codepage);
 
18
int uni_done();
 
19
#endif
 
20
 
16
21
void WideToChar(const wchar *Src,char *Dest,int DestSize=0x10000000);
17
22
void CharToWide(const char *Src,wchar *Dest,int DestSize=0x10000000);
18
23
byte* WideToRaw(const wchar *Src,byte *Dest,int DestSize=0x10000000);
19
24
wchar* RawToWide(const byte *Src,wchar *Dest,int DestSize=0x10000000);
20
25
void WideToUtf(const wchar *Src,char *Dest,int DestSize);
21
26
void UtfToWide(const char *Src,wchar *Dest,int DestSize);
 
27
bool UnicodeEnabled();
22
28
 
23
29
int strlenw(const wchar *str);
24
30
wchar* strcpyw(wchar *dest,const wchar *src);
45
51
    void Init();
46
52
 
47
53
    char* charnext(const char *s);
 
54
    uint strlend(const char *s);
48
55
    char *strchrd(const char *s, int c);
49
56
    char *strrchrd(const char *s, int c);
50
57
    void copychrd(char *dest,const char *src);
56
63
extern SupportDBCS gdbcs;
57
64
 
58
65
inline char* charnext(const char *s) {return (char *)(gdbcs.DBCSMode ? gdbcs.charnext(s):s+1);}
 
66
inline uint strlend(const char *s) {return (gdbcs.DBCSMode ? gdbcs.strlend(s):strlen(s));}
59
67
inline char* strchrd(const char *s, int c) {return (char *)(gdbcs.DBCSMode ? gdbcs.strchrd(s,c):strchr(s,c));}
60
68
inline char* strrchrd(const char *s, int c) {return (char *)(gdbcs.DBCSMode ? gdbcs.strrchrd(s,c):strrchr(s,c));}
61
69
inline void copychrd(char *dest,const char *src) {if (gdbcs.DBCSMode) gdbcs.copychrd(dest,src); else *dest=*src;}
64
72
 
65
73
#else
66
74
#define charnext(s) ((s)+1)
 
75
#define strlend strlen
67
76
#define strchrd strchr
68
77
#define strrchrd strrchr
69
78
#define IsDBCSMode() (true)