[773] | 1 | /* "$Id: utf.h 4115 2005-03-14 04:48:51Z spitzak $" |
---|
| 2 | * |
---|
| 3 | * Copyright 1998-2005 by Bill Spitzak and others. |
---|
| 4 | * |
---|
| 5 | * Permission to use, copy, modify, and distribute this software for any |
---|
| 6 | * purpose with or without fee is hereby granted, provided that the above |
---|
| 7 | * copyright notice and this permission notice appear in all copies. |
---|
| 8 | * |
---|
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
---|
| 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
---|
| 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
---|
| 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
---|
| 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
---|
| 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
---|
| 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
---|
| 16 | * |
---|
| 17 | * Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
| 18 | */ |
---|
| 19 | |
---|
| 20 | #ifndef fltk_utf_h |
---|
| 21 | #define fltk_utf_h |
---|
| 22 | |
---|
| 23 | #include "FL_API.h" |
---|
| 24 | #include <stdlib.h> |
---|
| 25 | |
---|
| 26 | /*! \addtogroup utilities |
---|
| 27 | \{ */ |
---|
| 28 | |
---|
| 29 | #ifdef __cplusplus |
---|
| 30 | extern "C" { |
---|
| 31 | #endif /* __cplusplus */ |
---|
| 32 | |
---|
| 33 | FL_API int utf8bytes(unsigned ucs); |
---|
| 34 | FL_API int utf8len(char firstbyte); /* depreciated */ |
---|
| 35 | |
---|
| 36 | FL_API unsigned utf8decode(const char*, const char* end, int* len); |
---|
| 37 | FL_API int utf8encode(unsigned, char*); |
---|
| 38 | FL_API const char* utf8fwd(const char*, const char* start, const char* end); |
---|
| 39 | FL_API const char* utf8back(const char*, const char* start, const char* end); |
---|
| 40 | |
---|
| 41 | FL_API unsigned utf8towc(const char*, unsigned, wchar_t*, unsigned); |
---|
| 42 | FL_API unsigned utf8tomb(const char*, unsigned, char*, unsigned); |
---|
| 43 | FL_API unsigned utf8toa (const char*, unsigned, char*, unsigned); |
---|
| 44 | FL_API unsigned utf8fromwc(char*, unsigned, const wchar_t*, unsigned); |
---|
| 45 | FL_API unsigned utf8frommb(char*, unsigned, const char*, unsigned); |
---|
| 46 | FL_API unsigned utf8froma (char*, unsigned, const char*, unsigned); |
---|
| 47 | FL_API int utf8locale(); |
---|
| 48 | FL_API int utf8test(const char*, unsigned); |
---|
| 49 | |
---|
| 50 | #ifdef __cplusplus |
---|
| 51 | } |
---|
| 52 | #endif /* __cplusplus */ |
---|
| 53 | |
---|
| 54 | /*! \} */ |
---|
| 55 | |
---|
| 56 | #endif |
---|