sublatin.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _SUBLATIN_H_
  2. #define _SUBLATIN_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. extern const unsigned char deAccentMapTable[];
  7. extern const unsigned char toLowerMapTable[];
  8. extern const unsigned char toUpperMapTable[];
  9. extern const unsigned char toLowerDeaccentedMapTable[];
  10. extern const unsigned char isLowerMapTable[];
  11. extern const unsigned char isUpperMapTable[];
  12. #define deAccentMap(x) deAccentMapTable[((unsigned char)x)]
  13. #define toLowerMap(x) toLowerMapTable[((unsigned char)x)]
  14. #define toUpperMap(x) toUpperMapTable[((unsigned char)x)]
  15. #define toLowerDeaccentedMap(x) toLowerDeaccentedMapTable[((unsigned char)x)]
  16. #define isLowerMap(x) isLowerMapTable[((unsigned char)x)]
  17. #define isUpperMap(x) isUpperMapTable[((unsigned char)x)]
  18. //The functions bellow convert in place, overwiten passed paramters
  19. int strLenSubSetLatinUtf8( const char *str );
  20. int nstrLenSubSetLatinUtf8( const char *str, int n );
  21. int isDeaccentableSubSetLatinUtf8( const char *str );
  22. char *deAccentSubSetLatinUtf8( char *str );
  23. char *toLowerDeaccentSubSetLatinUtf8( char *str );
  24. char *toLowerSubSetLatinUtf8( char *str );
  25. char *toUpperSubSetLatinUtf8( char *str );
  26. int strICmpSubSetLatinUtf8( const char *zLeft, const char *zRight );
  27. int strICmpSubSetLatinUtf8NoAccents( const char *zLeft, const char *zRight );
  28. int strCmpSubSetLatinUtf8NoAccents( const char *zLeft, const char *zRight );
  29. // the N parameter is expected to be utf8 chars count
  30. int strNICmpSubSetLatinUtf8( const char *zLeft, const char *zRight, int n );
  31. int strNICmpSubSetLatinUtf8NoAccents( const char *zLeft, const char *zRight, int n );
  32. int strNCmpSubSetLatinUtf8NoAccents( const char *zLeft, const char *zRight, int n );
  33. int subLatinLikeCompare(
  34. const char *zPattern, //* LIKE pattern */
  35. const char *zString, //* The UTF-8 string to compare against */
  36. char cEsc //* The escape character */
  37. );
  38. int subLatinLikeCompareNoAccents(
  39. const char *zPattern, //* LIKE pattern */
  40. const char *zString, //* The UTF-8 string to compare against */
  41. char cEsc //* The escape character */
  42. );
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif //_SUBLATIN_H_