FreeBASIC  0.91.0
fb_unicode.h File Reference
#include <wchar.h>
#include <wctype.h>
Include dependency graph for fb_unicode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UTF8_BYTEMASK   0xBF
 
#define UTF8_BYTEMARK   0x80
 
#define UTF16_MAX_BMP   (UTF_32)0x0000FFFF
 
#define UTF16_SUR_HIGH_START   (UTF_32)0xD800
 
#define UTF16_SUR_HIGH_END   (UTF_32)0xDBFF
 
#define UTF16_SUR_LOW_START   (UTF_32)0xDC00
 
#define UTF16_SUR_LOW_END   (UTF_32)0xDFFF
 
#define UTF16_HALFSHIFT   10
 
#define UTF16_HALFBASE   (UTF_32)0x0010000UL
 
#define UTF16_HALFMASK   (UTF_32)0x3FFUL
 
#define __USE_ISOC99   1
 
#define __USE_ISOC95   1
 
#define FB_WCHAR   wchar_t
 
#define _LC(c)   L ## c
 
#define FB_WEOF   WEOF
 
#define FB_WSTR_FROM_INT(buffer, num)   swprintf( buffer, sizeof( int ) * 3 + 1, _LC("%d"), (int) (num) )
 
#define FB_WSTR_FROM_UINT(buffer, num)   swprintf( buffer, sizeof( unsigned int ) * 3 + 1, _LC("%u"), (unsigned) (num) )
 
#define FB_WSTR_FROM_UINT_OCT(buffer, num)   swprintf( buffer, sizeof( int ) * 4 + 1, _LC("%o"), (unsigned) (num) )
 
#define FB_WSTR_FROM_INT64(buffer, num)   swprintf( buffer, sizeof( long long ) * 3 + 1, _LC("%lld"), (long long) (num) )
 
#define FB_WSTR_FROM_UINT64(buffer, num)   swprintf( buffer, sizeof( unsigned long long ) * 3 + 1, _LC("%llu"), (unsigned long long) (num) )
 
#define FB_WSTR_FROM_UINT64_OCT(buffer, num)   swprintf( buffer, sizeof( long long ) * 4 + 1, _LC("%llo"), (unsigned long long) (num) )
 
#define FB_WSTR_FROM_FLOAT(buffer, num)   swprintf( buffer, 7+8 + 1, _LC("%.7g"), (double) (num) )
 
#define FB_WSTR_FROM_DOUBLE(buffer, num)   swprintf( buffer, 16+8 + 1, _LC("%.16g"), (double) (num) )
 
#define FB_WSTR_WCHARTOCHAR   fb_wstr_WcharToChar
 

Typedefs

typedef uint32_t UTF_32
 
typedef uint16_t UTF_16
 
typedef uint8_t UTF_8
 

Functions

static __inline__ void fb_wstr_WcharToChar (char *dst, const FB_WCHAR *src, ssize_t chars)
 
static __inline__ ssize_t fb_wstr_CalcDiff (const FB_WCHAR *ini, const FB_WCHAR *end)
 
static __inline__ FB_WCHARfb_wstr_AllocTemp (ssize_t chars)
 
static __inline__ void fb_wstr_Del (FB_WCHAR *s)
 
static __inline__ ssize_t fb_wstr_Len (const FB_WCHAR *s)
 
static __inline__ void fb_wstr_ConvFromA (FB_WCHAR *dst, ssize_t dst_chars, const char *src)
 
static __inline__ void fb_wstr_ConvToA (char *dst, const FB_WCHAR *src, ssize_t chars)
 
static __inline__ int fb_wstr_IsLower (FB_WCHAR c)
 
static __inline__ int fb_wstr_IsUpper (FB_WCHAR c)
 
static __inline__ FB_WCHAR fb_wstr_ToLower (FB_WCHAR c)
 
static __inline__ FB_WCHAR fb_wstr_ToUpper (FB_WCHAR c)
 
static __inline__ void fb_wstr_Copy (FB_WCHAR *dst, const FB_WCHAR *src, ssize_t chars)
 
static __inline__ FB_WCHARfb_wstr_Move (FB_WCHAR *dst, const FB_WCHAR *src, ssize_t chars)
 
static __inline__ void fb_wstr_Fill (FB_WCHAR *dst, FB_WCHAR c, ssize_t chars)
 
static __inline__ const FB_WCHARfb_wstr_SkipChar (const FB_WCHAR *s, ssize_t chars, FB_WCHAR c)
 
static __inline__ const FB_WCHARfb_wstr_SkipCharRev (const FB_WCHAR *s, ssize_t chars, FB_WCHAR c)
 
static __inline__ FB_WCHARfb_wstr_Instr (const FB_WCHAR *s, const FB_WCHAR *patt)
 
static __inline__ size_t fb_wstr_InstrAny (const FB_WCHAR *s, const FB_WCHAR *sset)
 
static __inline__ int fb_wstr_Compare (const FB_WCHAR *str1, const FB_WCHAR *str2, ssize_t chars)
 

Macro Definition Documentation

#define __USE_ISOC95   1

Definition at line 96 of file fb_unicode.h.

#define __USE_ISOC99   1

Definition at line 95 of file fb_unicode.h.

#define _LC (   c)    L ## c

Definition at line 100 of file fb_unicode.h.

#define FB_WCHAR   wchar_t

Definition at line 99 of file fb_unicode.h.

#define FB_WEOF   WEOF

Definition at line 101 of file fb_unicode.h.

#define FB_WSTR_FROM_DOUBLE (   buffer,
  num 
)    swprintf( buffer, 16+8 + 1, _LC("%.16g"), (double) (num) )

Definition at line 140 of file fb_unicode.h.

#define FB_WSTR_FROM_FLOAT (   buffer,
  num 
)    swprintf( buffer, 7+8 + 1, _LC("%.7g"), (double) (num) )

Definition at line 135 of file fb_unicode.h.

#define FB_WSTR_FROM_INT (   buffer,
  num 
)    swprintf( buffer, sizeof( int ) * 3 + 1, _LC("%d"), (int) (num) )

Definition at line 105 of file fb_unicode.h.

#define FB_WSTR_FROM_INT64 (   buffer,
  num 
)    swprintf( buffer, sizeof( long long ) * 3 + 1, _LC("%lld"), (long long) (num) )

Definition at line 120 of file fb_unicode.h.

#define FB_WSTR_FROM_UINT (   buffer,
  num 
)    swprintf( buffer, sizeof( unsigned int ) * 3 + 1, _LC("%u"), (unsigned) (num) )

Definition at line 110 of file fb_unicode.h.

#define FB_WSTR_FROM_UINT64 (   buffer,
  num 
)    swprintf( buffer, sizeof( unsigned long long ) * 3 + 1, _LC("%llu"), (unsigned long long) (num) )

Definition at line 125 of file fb_unicode.h.

#define FB_WSTR_FROM_UINT64_OCT (   buffer,
  num 
)    swprintf( buffer, sizeof( long long ) * 4 + 1, _LC("%llo"), (unsigned long long) (num) )

Definition at line 130 of file fb_unicode.h.

#define FB_WSTR_FROM_UINT_OCT (   buffer,
  num 
)    swprintf( buffer, sizeof( int ) * 4 + 1, _LC("%o"), (unsigned) (num) )

Definition at line 115 of file fb_unicode.h.

#define FB_WSTR_WCHARTOCHAR   fb_wstr_WcharToChar

Definition at line 145 of file fb_unicode.h.

#define UTF16_HALFBASE   (UTF_32)0x0010000UL

Definition at line 16 of file fb_unicode.h.

#define UTF16_HALFMASK   (UTF_32)0x3FFUL

Definition at line 17 of file fb_unicode.h.

#define UTF16_HALFSHIFT   10

Definition at line 15 of file fb_unicode.h.

#define UTF16_MAX_BMP   (UTF_32)0x0000FFFF

Definition at line 10 of file fb_unicode.h.

#define UTF16_SUR_HIGH_END   (UTF_32)0xDBFF

Definition at line 12 of file fb_unicode.h.

#define UTF16_SUR_HIGH_START   (UTF_32)0xD800

Definition at line 11 of file fb_unicode.h.

#define UTF16_SUR_LOW_END   (UTF_32)0xDFFF

Definition at line 14 of file fb_unicode.h.

#define UTF16_SUR_LOW_START   (UTF_32)0xDC00

Definition at line 13 of file fb_unicode.h.

#define UTF8_BYTEMARK   0x80

Definition at line 8 of file fb_unicode.h.

#define UTF8_BYTEMASK   0xBF

Definition at line 7 of file fb_unicode.h.

Typedef Documentation

typedef uint16_t UTF_16

Definition at line 4 of file fb_unicode.h.

typedef uint32_t UTF_32

Definition at line 3 of file fb_unicode.h.

typedef uint8_t UTF_8

Definition at line 5 of file fb_unicode.h.

Function Documentation

static __inline__ FB_WCHAR* fb_wstr_AllocTemp ( ssize_t  chars)
static

Definition at line 164 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ ssize_t fb_wstr_CalcDiff ( const FB_WCHAR ini,
const FB_WCHAR end 
)
static

Definition at line 159 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ int fb_wstr_Compare ( const FB_WCHAR str1,
const FB_WCHAR str2,
ssize_t  chars 
)
static

Definition at line 321 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ void fb_wstr_ConvFromA ( FB_WCHAR dst,
ssize_t  dst_chars,
const char *  src 
)
static

Definition at line 182 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ void fb_wstr_ConvToA ( char *  dst,
const FB_WCHAR src,
ssize_t  chars 
)
static

Definition at line 203 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ void fb_wstr_Copy ( FB_WCHAR dst,
const FB_WCHAR src,
ssize_t  chars 
)
static

Definition at line 250 of file fb_unicode.h.

Here is the call graph for this function:

Here is the caller graph for this function:

static __inline__ void fb_wstr_Del ( FB_WCHAR s)
static

Definition at line 170 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ void fb_wstr_Fill ( FB_WCHAR dst,
FB_WCHAR  c,
ssize_t  chars 
)
static

Definition at line 265 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ FB_WCHAR* fb_wstr_Instr ( const FB_WCHAR s,
const FB_WCHAR patt 
)
static

Definition at line 311 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ size_t fb_wstr_InstrAny ( const FB_WCHAR s,
const FB_WCHAR sset 
)
static

Definition at line 316 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ int fb_wstr_IsLower ( FB_WCHAR  c)
static

Definition at line 229 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ int fb_wstr_IsUpper ( FB_WCHAR  c)
static

Definition at line 234 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ ssize_t fb_wstr_Len ( const FB_WCHAR s)
static

Definition at line 176 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ FB_WCHAR* fb_wstr_Move ( FB_WCHAR dst,
const FB_WCHAR src,
ssize_t  chars 
)
static

Definition at line 260 of file fb_unicode.h.

Here is the call graph for this function:

Here is the caller graph for this function:

static __inline__ const FB_WCHAR* fb_wstr_SkipChar ( const FB_WCHAR s,
ssize_t  chars,
FB_WCHAR  c 
)
static

Definition at line 275 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ const FB_WCHAR* fb_wstr_SkipCharRev ( const FB_WCHAR s,
ssize_t  chars,
FB_WCHAR  c 
)
static

Definition at line 293 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ FB_WCHAR fb_wstr_ToLower ( FB_WCHAR  c)
static

Definition at line 239 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ FB_WCHAR fb_wstr_ToUpper ( FB_WCHAR  c)
static

Definition at line 244 of file fb_unicode.h.

Here is the caller graph for this function:

static __inline__ void fb_wstr_WcharToChar ( char *  dst,
const FB_WCHAR src,
ssize_t  chars 
)
static

Definition at line 146 of file fb_unicode.h.