ReactOS 0.4.16-dev-889-g9563c07
tombbmbc.cpp File Reference
#include <corecrt_internal_mbstring.h>
#include <locale.h>
Include dependency graph for tombbmbc.cpp:

Go to the source code of this file.

Macros

#define ASCLOW   0x20
 
#define ASCHIGH   0x7e
 
#define SBLOW   0xA1
 
#define SBHIGH   0xDF
 
#define MBLIMIT   0x8396
 

Functions

unsigned int __cdecl _mbbtombc_l (unsigned int c, _locale_t plocinfo)
 
unsigned int (__cdecl _mbbtombc)(unsigned int c)
 
unsigned int __cdecl _mbctombb_l (unsigned int c, _locale_t plocinfo)
 

Variables

static unsigned short const mbbtable []
 
struct {
   unsigned char   asc
 
   char   synonym
 
   unsigned short   mbccode
 
mbctable []
 

Macro Definition Documentation

◆ ASCHIGH

#define ASCHIGH   0x7e

Definition at line 20 of file tombbmbc.cpp.

◆ ASCLOW

#define ASCLOW   0x20

Definition at line 19 of file tombbmbc.cpp.

◆ MBLIMIT

#define MBLIMIT   0x8396

Definition at line 25 of file tombbmbc.cpp.

◆ SBHIGH

#define SBHIGH   0xDF

Definition at line 23 of file tombbmbc.cpp.

◆ SBLOW

#define SBLOW   0xA1

Definition at line 22 of file tombbmbc.cpp.

Function Documentation

◆ _mbbtombc_l()

unsigned int __cdecl _mbbtombc_l ( unsigned int  c,
_locale_t  plocinfo 
)

Definition at line 222 of file tombbmbc.cpp.

226{
227 int i;
228 _LocaleUpdate _loc_update(plocinfo);
229
230 if (_loc_update.GetLocaleT()->mbcinfo->mbcodepage != _KANJI_CP)
231 return (c);
232
233 /* If c is in the ASCII range, then look up the corresponding value
234 * in the mbbtable. */
235
236 if (c >= ASCLOW && c <= ASCHIGH)
237 return (mbbtable[c-ASCLOW]);
238
239 /* Exception for KANJI */
240
241 if (c == 0xdc)
242 return( 0x838f );
243
244 /* If c is a Katakana character, lookup in mbctable. */
245
246 if (c >= SBLOW && c <= SBHIGH)
247 {
248 for(i = 0; mbctable[i].asc != 0; i++)
249 {
250 if ( c == (unsigned int)mbctable[i].asc ) {
251 c = (unsigned int)mbctable[i].mbccode ;
252 break;
253 }
254 }
255 }
256
257 return(c);
258}
#define _KANJI_CP
Definition: mbctype.h:53
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
const GLubyte * c
Definition: glext.h:8905
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_locale_t plocinfo
Definition: ismbbyte.cpp:75
#define ASCLOW
Definition: tombbmbc.cpp:19
unsigned short mbccode
Definition: tombbmbc.cpp:45
#define SBHIGH
Definition: tombbmbc.cpp:23
static struct @5157 mbctable[]
static unsigned short const mbbtable[]
Definition: tombbmbc.cpp:27
#define SBLOW
Definition: tombbmbc.cpp:22
unsigned char asc
Definition: tombbmbc.cpp:43
#define ASCHIGH
Definition: tombbmbc.cpp:20

Referenced by int().

◆ _mbctombb_l()

unsigned int __cdecl _mbctombb_l ( unsigned int  c,
_locale_t  plocinfo 
)

Definition at line 284 of file tombbmbc.cpp.

288{
289 int i;
290 int result;
291 _LocaleUpdate _loc_update(plocinfo);
292
293 if (_loc_update.GetLocaleT()->mbcinfo->mbcodepage != _KANJI_CP)
294 return (c);
295
296 /* Check to see if c is in the ASCII range. */
297
298 for (i = 0; i <= ASCHIGH - ASCLOW; i++)
299 {
300 if (c == (unsigned int)mbbtable[i])
301 return((unsigned int)i + ASCLOW);
302 }
303
304
305 /* If c is a valid MBCS value, search the mbctable for value. */
306
307 if ( c <= MBLIMIT )
308 {
309 for (i = 0; mbctable[i].asc ; i++)
310 {
311 result = (int)c - (int)mbctable[i].mbccode;
312 if (result == 0)
313 return( (unsigned int)mbctable[i].asc );
314 else if (((c & 0xff00) == (unsigned int)(mbctable[i].mbccode & 0xff00))
315 && (result > 0)
316 && ((result - mbctable[i].synonym) < 0))
317 return( (unsigned int)mbctable[i].asc );
318 }
319 }
320
321 return(c);
322}
GLuint64EXT * result
Definition: glext.h:11304
char synonym
Definition: tombbmbc.cpp:44
#define MBLIMIT
Definition: tombbmbc.cpp:25

◆ int()

unsigned int ( __cdecl  _mbbtombc)

Definition at line 260 of file tombbmbc.cpp.

263{
264 return _mbbtombc_l(c, nullptr);
265}
unsigned int __cdecl _mbbtombc_l(unsigned int c, _locale_t plocinfo)
Definition: tombbmbc.cpp:222

Variable Documentation

◆ asc

◆ mbbtable

unsigned short const mbbtable[]
static
Initial value:
= {
0x8140, 0x8149, 0x8168, 0x8194, 0x8190, 0x8193, 0x8195, 0x8166,
0x8169, 0x816a, 0x8196, 0x817b, 0x8143, 0x817c, 0x8144, 0x815e,
0x824f, 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, 0x8256,
0x8257, 0x8258, 0x8146, 0x8147, 0x8183, 0x8181, 0x8184, 0x8148,
0x8197, 0x8260, 0x8261, 0x8262, 0x8263, 0x8264, 0x8265, 0x8266,
0x8267, 0x8268, 0x8269, 0x826a, 0x826b, 0x826c, 0x826d, 0x826e,
0x826f, 0x8270, 0x8271, 0x8272, 0x8273, 0x8274, 0x8275, 0x8276,
0x8277, 0x8278, 0x8279, 0x816d, 0x818f, 0x816e, 0x814f, 0x8151,
0x8165, 0x8281, 0x8282, 0x8283, 0x8284, 0x8285, 0x8286, 0x8287,
0x8288, 0x8289, 0x828a, 0x828b, 0x828c, 0x828d, 0x828e, 0x828f,
0x8290, 0x8291, 0x8292, 0x8293, 0x8294, 0x8295, 0x8296, 0x8297,
0x8298, 0x8299, 0x829a, 0x816f, 0x8162, 0x8170, 0x8150,
}

Definition at line 27 of file tombbmbc.cpp.

Referenced by _mbbtombc_l(), and _mbctombb_l().

◆ mbccode

unsigned short mbccode

Definition at line 45 of file tombbmbc.cpp.

Referenced by _mbbtombc_l(), and _mbctombb_l().

◆ 

struct { ... } mbctable[]

Referenced by _mbbtombc_l(), and _mbctombb_l().

◆ synonym

char synonym

Definition at line 44 of file tombbmbc.cpp.

Referenced by _mbctombb_l().