Loading...
Searching...
No Matches
buniutil.h
Go to the documentation of this file.
/* Copyright 2002-2015 Paul Hsieh
* This file is part of Bstrlib.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of bstrlib nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, the contents of this file may be used under the terms of
* GNU General Public License Version 2 (the "GPL").
*/
#ifndef BSTRLIB_UNICODE_UTILITIES
#define BSTRLIB_UNICODE_UTILITIES
#include "bstrlib.h"
#include "utf8util.h"
#ifdef __cplusplus
extern "C" {
#endif
BSTR_PUBLIC int
buIsUTF8Content(const bstring bu);
BSTR_PUBLIC int
buAppendBlkUcs4(bstring b, const cpUcs4 *bu, int len, cpUcs4 errCh);
/* For those unfortunate enough to be stuck supporting UTF-16. */
BSTR_PUBLIC int
buGetBlkUTF16(/* @out */ cpUcs2 *ucs2, int len, cpUcs4 errCh,
const bstring bu, int pos);
BSTR_PUBLIC int
buAppendBlkUTF16(bstring bu, const cpUcs2 *utf16, int len, cpUcs2 *bom,
cpUcs4 errCh);
#ifdef __cplusplus
}
#endif
#endif /* BSTRLIB_UNICODE_UTILITIES */
bstrlib.h
C implementaion of bstring functions.
buIsUTF8Content
BSTR_PUBLIC int buIsUTF8Content(const bstring bu)
buGetBlkUTF16
BSTR_PUBLIC int buGetBlkUTF16(cpUcs2 *ucs2, int len, cpUcs4 errCh, const bstring bu, int pos)
buAppendBlkUTF16
BSTR_PUBLIC int buAppendBlkUTF16(bstring bu, const cpUcs2 *utf16, int len, cpUcs2 *bom, cpUcs4 errCh)
buAppendBlkUcs4
BSTR_PUBLIC int buAppendBlkUcs4(bstring b, const cpUcs4 *bu, int len, cpUcs4 errCh)
utf8util.h
Interface for low-level UTF-8 utility functions.