X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fff-utf8.h;h=af7543f26c32b46c468d32ed89ada342fa94cc79;hb=7462f9e27978542b37e1745b9a8fa80fb07dab3d;hp=296fb9d74d5dde203ca38779ba9c85dd46dedd2d;hpb=82c74ae17858622bfaadbe96d1d5408a2cdb29a3;p=libucw.git diff --git a/lib/ff-utf8.h b/lib/ff-utf8.h index 296fb9d7..af7543f2 100644 --- a/lib/ff-utf8.h +++ b/lib/ff-utf8.h @@ -1,43 +1,15 @@ /* - * Sherlock Library: Reading and writing of UTF-8 on Fastbuf Streams + * UCW Library: An alias for lib/ff-unicode.h (for backwards compatibility) * - * (c) 2001--2004 Martin Mares + * (c) 2008 Pavel Charvat * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. */ -#ifndef _FF_UTF8_H -#define _FF_UTF8_H +#ifndef _UCW_FF_UTF8_H +#define _UCW_FF_UTF8_H -#include "lib/fastbuf.h" -#include "lib/unicode.h" - -int bget_utf8_slow(struct fastbuf *b); -void bput_utf8_slow(struct fastbuf *b, uns u); - -static inline int -bget_utf8(struct fastbuf *b) -{ - uns u; - - if (b->bptr + 5 <= b->bstop) - { - GET_UTF8(b->bptr, u); - return u; - } - else - return bget_utf8_slow(b); -} - -static inline void -bput_utf8(struct fastbuf *b, uns u) -{ - ASSERT(u < 65536); - if (b->bptr + 5 <= b->bufend) - PUT_UTF8(b->bptr, u); - else - bput_utf8_slow(b, u); -} +#include "lib/ff-unicode.h" #endif