Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * This file is part of LibParserUtils.
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
  6.  */
  7.  
  8. /** \file
  9.  * UTF-16 manipulation functions (interface).
  10.  */
  11.  
  12. #ifndef parserutils_charset_utf16_h_
  13. #define parserutils_charset_utf16_h_
  14.  
  15. #ifdef __cplusplus
  16. extern "C"
  17. {
  18. #endif
  19.  
  20. #include <inttypes.h>
  21.  
  22. #include <parserutils/errors.h>
  23.  
  24. parserutils_error parserutils_charset_utf16_to_ucs4(const uint8_t *s,
  25.                 size_t len, uint32_t *ucs4, size_t *clen);
  26. parserutils_error parserutils_charset_utf16_from_ucs4(uint32_t ucs4,
  27.                 uint8_t *s, size_t *len);
  28.  
  29. parserutils_error parserutils_charset_utf16_length(const uint8_t *s,
  30.                 size_t max, size_t *len);
  31. parserutils_error parserutils_charset_utf16_char_byte_length(const uint8_t *s,
  32.                 size_t *len);
  33.  
  34. parserutils_error parserutils_charset_utf16_prev(const uint8_t *s,
  35.                 uint32_t off, uint32_t *prevoff);
  36. parserutils_error parserutils_charset_utf16_next(const uint8_t *s,
  37.                 uint32_t len, uint32_t off, uint32_t *nextoff);
  38.  
  39. parserutils_error parserutils_charset_utf16_next_paranoid(const uint8_t *s,
  40.                 uint32_t len, uint32_t off, uint32_t *nextoff);
  41.  
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45.  
  46. #endif
  47.  
  48.