unicode.h revision af062818b47340eef15700d2f0211576ba3506ee
/*
* Wine internal Unicode definitions
*
* Copyright 2000 Alexandre Julliard
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_WINE_UNICODE_H
#define __WINE_WINE_UNICODE_H
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#ifdef __WINE_WINE_TEST_H
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef WINE_UNICODE_API
# if defined(_MSC_VER) || defined(__MINGW32__)
# define WINE_UNICODE_API DECLSPEC_IMPORT
# else
# define WINE_UNICODE_API
# endif
#endif
/*#ifndef WINE_UNICODE_INLINE
#define WINE_UNICODE_INLINE extern inline
#endif*/
/* code page info common to SBCS and DBCS */
struct cp_info
{
unsigned int codepage; /* codepage id */
unsigned int char_size; /* char size (1 or 2 bytes) */
const char *name; /* code page name */
};
struct sbcs_table
{
const unsigned char *uni2cp_low; /* Unicode -> code page map */
const unsigned short *uni2cp_high;
};
struct dbcs_table
{
const unsigned char *cp2uni_leadbytes;
const unsigned short *uni2cp_low; /* Unicode -> code page map */
const unsigned short *uni2cp_high;
};
union cptable
{
struct sbcs_table sbcs;
struct dbcs_table dbcs;
};
extern int wine_compare_string( int flags, const WCHAR *str1, int len1, const WCHAR *str2, int len2 );
#ifdef WINE_UNICODE_INLINE
{
}
{
}
{
}
/* the character type contains the C1_* flags in the low 12 bits */
/* and the C2_* type in the high 4 bits */
{
extern WINE_UNICODE_API const unsigned short wine_wctype_table[];
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
/* some useful string manipulation routines */
{
while (*s) s++;
return s - str;
}
{
while ((*p++ = *src++));
return dst;
}
/* strncpy doesn't do what you think, don't use it */
{
}
{
if (n <= 0) return 0;
}
{
return dst;
}
{
return NULL;
}
{
return ret;
}
{
return NULL;
}
{
}
{
}
{
return ret;
}
{
return ret;
}
{
return NULL;
}
{
return ret;
}
{
}
{
}
#endif //#ifdef WINE_UNICODE_INLINE
#ifdef __cplusplus
}
#endif
#endif /* __WINE_WINE_UNICODE_H */