- Update
This commit is contained in:
1 parent
d281d765ea
commit
5b074a5176
1261 files changed
+199158
-7303
No files matched your search
+184
@@ -0,0 +1,184 @@
|
||||
#!/bin/bash
|
||||
# Builds libidn for all three current iPhone targets: iPhoneSimulator-i386,
|
||||
# iPhoneOS-armv7, iPhoneOS-armv7s.
|
||||
#
|
||||
# Copyright 2012 Mike Tigas <mike@tig.as>
|
||||
#
|
||||
# Based on work by Felix Schulze on 16.12.10.
|
||||
# Copyright 2010 Felix Schulze. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
###########################################################################
|
||||
# Choose your libidn version and your currently-installed iOS SDK version:
|
||||
#
|
||||
VERSION="1.25"
|
||||
SDKVERSION="6.0"
|
||||
#
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# Don't change anything under this line!
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# No need to change this since xcode build will only compile in the
|
||||
# necessary bits from the libraries we create
|
||||
ARCHS="i386 armv7 armv7s"
|
||||
|
||||
DEVELOPER=`xcode-select -print-path`
|
||||
|
||||
cd "`dirname \"$0\"`"
|
||||
REPOROOT=$(pwd)
|
||||
|
||||
# Where we'll end up storing things in the end
|
||||
OUTPUTDIR="${REPOROOT}/dependencies"
|
||||
mkdir -p ${OUTPUTDIR}/include
|
||||
mkdir -p ${OUTPUTDIR}/lib
|
||||
mkdir -p ${OUTPUTDIR}/bin
|
||||
|
||||
|
||||
BUILDDIR="${REPOROOT}/build"
|
||||
|
||||
# where we will keep our sources and build from.
|
||||
SRCDIR="${BUILDDIR}/src"
|
||||
mkdir -p $SRCDIR
|
||||
# where we will store intermediary builds
|
||||
INTERDIR="${BUILDDIR}/built"
|
||||
mkdir -p $INTERDIR
|
||||
|
||||
########################################
|
||||
|
||||
cd $SRCDIR
|
||||
|
||||
# Exit the script if an error happens
|
||||
set -e
|
||||
|
||||
if [ ! -e "${SRCDIR}/libidn-${VERSION}.tar.gz" ]; then
|
||||
echo "Downloading libidn-${VERSION}.tar.gz"
|
||||
curl -LO http://ftp.gnu.org/gnu/libidn/libidn-${VERSION}.tar.gz
|
||||
else
|
||||
|
||||
echo "Using libidn-${VERSION}.tar.gz"
|
||||
fi
|
||||
|
||||
tar zxf libidn-${VERSION}.tar.gz -C $SRCDIR
|
||||
cd "${SRCDIR}/libidn-${VERSION}"
|
||||
|
||||
set +e # don't bail out of bash script if ccache doesn't exist
|
||||
CCACHE=`which ccache`
|
||||
if [ $? == "0" ]; then
|
||||
echo "Building with ccache: $CCACHE"
|
||||
CCACHE="${CCACHE} "
|
||||
else
|
||||
echo "Building without ccache"
|
||||
CCACHE=""
|
||||
fi
|
||||
set -e # back to regular "bail out on error" mode
|
||||
|
||||
for ARCH in ${ARCHS}
|
||||
do
|
||||
if [ "${ARCH}" == "i386" ];
|
||||
then
|
||||
PLATFORM="iPhoneSimulator"
|
||||
EXTRA_CONFIG=""
|
||||
EXTRA_CFLAGS=""
|
||||
else
|
||||
PLATFORM="iPhoneOS"
|
||||
EXTRA_CONFIG="--host=arm-apple-darwin10 --disable-asm"
|
||||
EXTRA_CFLAGS="-DNO_ASM"
|
||||
fi
|
||||
|
||||
mkdir -p "${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
|
||||
|
||||
./configure --disable-shared --enable-static ${EXTRA_CONFIG} \
|
||||
--prefix="${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" \
|
||||
CC="${CCACHE}${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/usr/bin/gcc -arch ${ARCH}" \
|
||||
LDFLAGS="$LDFLAGS -L${OUTPUTDIR}/lib" \
|
||||
CFLAGS="$CFLAGS ${EXTRA_CFLAGS} -I${OUTPUTDIR}/include -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk" \
|
||||
CPPFLAGS="$CPPFLAGS -I${OUTPUTDIR}/include -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"
|
||||
|
||||
# Build the application and install it to the fake SDK intermediary dir
|
||||
# we have set up. Make sure to clean up afterward because we will re-use
|
||||
# this source tree to cross-compile other targets.
|
||||
make -j2
|
||||
make install
|
||||
make clean
|
||||
done
|
||||
|
||||
########################################
|
||||
|
||||
echo "Build library..."
|
||||
|
||||
# These are the libs that comprise libidn.
|
||||
OUTPUT_LIBS="libidn.a"
|
||||
for OUTPUT_LIB in ${OUTPUT_LIBS}; do
|
||||
INPUT_LIBS=""
|
||||
for ARCH in ${ARCHS}; do
|
||||
if [ "${ARCH}" == "i386" ];
|
||||
then
|
||||
PLATFORM="iPhoneSimulator"
|
||||
else
|
||||
PLATFORM="iPhoneOS"
|
||||
fi
|
||||
INPUT_ARCH_LIB="${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/${OUTPUT_LIB}"
|
||||
if [ -e $INPUT_ARCH_LIB ]; then
|
||||
INPUT_LIBS="${INPUT_LIBS} ${INPUT_ARCH_LIB}"
|
||||
fi
|
||||
done
|
||||
# Combine the three architectures into a universal library.
|
||||
if [ -n "$INPUT_LIBS" ]; then
|
||||
lipo -create $INPUT_LIBS \
|
||||
-output "${OUTPUTDIR}/lib/${OUTPUT_LIB}"
|
||||
else
|
||||
echo "$OUTPUT_LIB does not exist, skipping (are the dependencies installed?)"
|
||||
fi
|
||||
done
|
||||
|
||||
for ARCH in ${ARCHS}; do
|
||||
if [ "${ARCH}" == "i386" ];
|
||||
then
|
||||
PLATFORM="iPhoneSimulator"
|
||||
else
|
||||
PLATFORM="iPhoneOS"
|
||||
fi
|
||||
cp -R ${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/include/* ${OUTPUTDIR}/include/
|
||||
if [ $? == "0" ]; then
|
||||
# We only need to copy the headers over once. (So break out of forloop
|
||||
# once we get first success.)
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
for ARCH in ${ARCHS}; do
|
||||
if [ "${ARCH}" == "i386" ];
|
||||
then
|
||||
PLATFORM="iPhoneSimulator"
|
||||
else
|
||||
PLATFORM="iPhoneOS"
|
||||
fi
|
||||
cp -R ${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/bin/* ${OUTPUTDIR}/bin/
|
||||
if [ $? == "0" ]; then
|
||||
# We only need to copy the binaries over once. (So break out of forloop
|
||||
# once we get first success.)
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
####################
|
||||
|
||||
echo "Building done."
|
||||
echo "Cleaning up..."
|
||||
rm -fr ${INTERDIR}
|
||||
rm -fr "${SRCDIR}/libidn-${VERSION}"
|
||||
echo "Done."
|
||||
Vendored
+638
@@ -0,0 +1,638 @@
|
||||
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
|
||||
/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
|
||||
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
|
||||
This file is part of gnulib.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C 99 <stdint.h> for platforms that lack it.
|
||||
* <http://www.opengroup.org/susv3xbd/stdint.h.html>
|
||||
*/
|
||||
|
||||
#ifndef _GL_LGL_STDINT_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
|
||||
/* When including a system file that in turn includes <inttypes.h>,
|
||||
use the system <inttypes.h>, not our substitute. This avoids
|
||||
problems with (for example) VMS, whose <sys/bitypes.h> includes
|
||||
<inttypes.h>. */
|
||||
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
|
||||
|
||||
/* On Android (Bionic libc), <sys/types.h> includes this file before
|
||||
having defined 'time_t'. Therefore in this case avoid including
|
||||
other system header files; just include the system's <stdint.h>.
|
||||
Ideally we should test __BIONIC__ here, but it is only defined after
|
||||
<sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
|
||||
#if defined __ANDROID__ \
|
||||
&& defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
|
||||
# include <stdint.h>
|
||||
#else
|
||||
|
||||
/* Get those types that are already defined in other system include
|
||||
files, so that we can "#define int8_t signed char" below without
|
||||
worrying about a later system include file containing a "typedef
|
||||
signed char int8_t;" that will get messed up by our macro. Our
|
||||
macros should all be consistent with the system versions, except
|
||||
for the "fast" types and macros, which we recommend against using
|
||||
in public interfaces due to compiler differences. */
|
||||
|
||||
#if 1
|
||||
# if defined __sgi && ! defined __c99
|
||||
/* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
|
||||
with "This header file is to be used only for c99 mode compilations"
|
||||
diagnostics. */
|
||||
# define __STDINT_H__
|
||||
# endif
|
||||
|
||||
/* Some pre-C++11 <stdint.h> implementations need this. */
|
||||
# ifdef __cplusplus
|
||||
# ifndef __STDC_CONSTANT_MACROS
|
||||
# define __STDC_CONSTANT_MACROS 1
|
||||
# endif
|
||||
# ifndef __STDC_LIMIT_MACROS
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Other systems may have an incomplete or buggy <stdint.h>.
|
||||
Include it before <inttypes.h>, since any "#include <stdint.h>"
|
||||
in <inttypes.h> would reinclude us, skipping our contents because
|
||||
_GL_LGL_STDINT_H is defined.
|
||||
The include requires a split double-inclusion guard. */
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if ! defined _GL_LGL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
|
||||
#define _GL_LGL_STDINT_H
|
||||
|
||||
/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
|
||||
IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
|
||||
AIX 5.2 <sys/types.h> isn't needed and causes troubles.
|
||||
MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
|
||||
relies on the system <stdint.h> definitions, so include
|
||||
<sys/types.h> after <stdint.h>. */
|
||||
#if 1 && ! defined _AIX
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
|
||||
LONG_MIN, LONG_MAX, ULONG_MAX. */
|
||||
#include <limits.h>
|
||||
|
||||
#if 1
|
||||
/* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
|
||||
int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
|
||||
<inttypes.h> also defines intptr_t and uintptr_t. */
|
||||
# include <inttypes.h>
|
||||
#elif 0
|
||||
/* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
|
||||
the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
|
||||
# include <sys/inttypes.h>
|
||||
#endif
|
||||
|
||||
#if 0 && ! defined __BIT_TYPES_DEFINED__
|
||||
/* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
|
||||
int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
|
||||
included by <sys/types.h>. */
|
||||
# include <sys/bitypes.h>
|
||||
#endif
|
||||
|
||||
#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
|
||||
|
||||
/* Minimum and maximum values for an integer type under the usual assumption.
|
||||
Return an unspecified value if BITS == 0, adding a check to pacify
|
||||
picky compilers. */
|
||||
|
||||
#define _STDINT_MIN(signed, bits, zero) \
|
||||
((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
|
||||
|
||||
#define _STDINT_MAX(signed, bits, zero) \
|
||||
((signed) \
|
||||
? ~ _STDINT_MIN (signed, bits, zero) \
|
||||
: /* The expression for the unsigned case. The subtraction of (signed) \
|
||||
is a nop in the unsigned case and avoids "signed integer overflow" \
|
||||
warnings in the signed case. */ \
|
||||
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
|
||||
|
||||
#if !GNULIB_defined_stdint_types
|
||||
|
||||
/* 7.18.1.1. Exact-width integer types */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits. */
|
||||
|
||||
#undef int8_t
|
||||
#undef uint8_t
|
||||
typedef signed char gl_int8_t;
|
||||
typedef unsigned char gl_uint8_t;
|
||||
#define int8_t gl_int8_t
|
||||
#define uint8_t gl_uint8_t
|
||||
|
||||
#undef int16_t
|
||||
#undef uint16_t
|
||||
typedef short int gl_int16_t;
|
||||
typedef unsigned short int gl_uint16_t;
|
||||
#define int16_t gl_int16_t
|
||||
#define uint16_t gl_uint16_t
|
||||
|
||||
#undef int32_t
|
||||
#undef uint32_t
|
||||
typedef int gl_int32_t;
|
||||
typedef unsigned int gl_uint32_t;
|
||||
#define int32_t gl_int32_t
|
||||
#define uint32_t gl_uint32_t
|
||||
|
||||
/* If the system defines INT64_MAX, assume int64_t works. That way,
|
||||
if the underlying platform defines int64_t to be a 64-bit long long
|
||||
int, the code below won't mistakenly define it to be a 64-bit long
|
||||
int, which would mess up C++ name mangling. We must use #ifdef
|
||||
rather than #if, to avoid an error with HP-UX 10.20 cc. */
|
||||
|
||||
#ifdef INT64_MAX
|
||||
# define GL_INT64_T
|
||||
#else
|
||||
/* Do not undefine int64_t if gnulib is not being used with 64-bit
|
||||
types, since otherwise it breaks platforms like Tandem/NSK. */
|
||||
# if LONG_MAX >> 31 >> 31 == 1
|
||||
# undef int64_t
|
||||
typedef long int gl_int64_t;
|
||||
# define int64_t gl_int64_t
|
||||
# define GL_INT64_T
|
||||
# elif defined _MSC_VER
|
||||
# undef int64_t
|
||||
typedef __int64 gl_int64_t;
|
||||
# define int64_t gl_int64_t
|
||||
# define GL_INT64_T
|
||||
# elif 1
|
||||
# undef int64_t
|
||||
typedef long long int gl_int64_t;
|
||||
# define int64_t gl_int64_t
|
||||
# define GL_INT64_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef UINT64_MAX
|
||||
# define GL_UINT64_T
|
||||
#else
|
||||
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
|
||||
# undef uint64_t
|
||||
typedef unsigned long int gl_uint64_t;
|
||||
# define uint64_t gl_uint64_t
|
||||
# define GL_UINT64_T
|
||||
# elif defined _MSC_VER
|
||||
# undef uint64_t
|
||||
typedef unsigned __int64 gl_uint64_t;
|
||||
# define uint64_t gl_uint64_t
|
||||
# define GL_UINT64_T
|
||||
# elif 1
|
||||
# undef uint64_t
|
||||
typedef unsigned long long int gl_uint64_t;
|
||||
# define uint64_t gl_uint64_t
|
||||
# define GL_UINT64_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
|
||||
#define _UINT8_T
|
||||
#define _UINT32_T
|
||||
#define _UINT64_T
|
||||
|
||||
|
||||
/* 7.18.1.2. Minimum-width integer types */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
|
||||
are the same as the corresponding N_t types. */
|
||||
|
||||
#undef int_least8_t
|
||||
#undef uint_least8_t
|
||||
#undef int_least16_t
|
||||
#undef uint_least16_t
|
||||
#undef int_least32_t
|
||||
#undef uint_least32_t
|
||||
#undef int_least64_t
|
||||
#undef uint_least64_t
|
||||
#define int_least8_t int8_t
|
||||
#define uint_least8_t uint8_t
|
||||
#define int_least16_t int16_t
|
||||
#define uint_least16_t uint16_t
|
||||
#define int_least32_t int32_t
|
||||
#define uint_least32_t uint32_t
|
||||
#ifdef GL_INT64_T
|
||||
# define int_least64_t int64_t
|
||||
#endif
|
||||
#ifdef GL_UINT64_T
|
||||
# define uint_least64_t uint64_t
|
||||
#endif
|
||||
|
||||
/* 7.18.1.3. Fastest minimum-width integer types */
|
||||
|
||||
/* Note: Other <stdint.h> substitutes may define these types differently.
|
||||
It is not recommended to use these types in public header files. */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
|
||||
are taken from the same list of types. The following code normally
|
||||
uses types consistent with glibc, as that lessens the chance of
|
||||
incompatibility with older GNU hosts. */
|
||||
|
||||
#undef int_fast8_t
|
||||
#undef uint_fast8_t
|
||||
#undef int_fast16_t
|
||||
#undef uint_fast16_t
|
||||
#undef int_fast32_t
|
||||
#undef uint_fast32_t
|
||||
#undef int_fast64_t
|
||||
#undef uint_fast64_t
|
||||
typedef signed char gl_int_fast8_t;
|
||||
typedef unsigned char gl_uint_fast8_t;
|
||||
|
||||
#ifdef __sun
|
||||
/* Define types compatible with SunOS 5.10, so that code compiled under
|
||||
earlier SunOS versions works with code compiled under SunOS 5.10. */
|
||||
typedef int gl_int_fast32_t;
|
||||
typedef unsigned int gl_uint_fast32_t;
|
||||
#else
|
||||
typedef long int gl_int_fast32_t;
|
||||
typedef unsigned long int gl_uint_fast32_t;
|
||||
#endif
|
||||
typedef gl_int_fast32_t gl_int_fast16_t;
|
||||
typedef gl_uint_fast32_t gl_uint_fast16_t;
|
||||
|
||||
#define int_fast8_t gl_int_fast8_t
|
||||
#define uint_fast8_t gl_uint_fast8_t
|
||||
#define int_fast16_t gl_int_fast16_t
|
||||
#define uint_fast16_t gl_uint_fast16_t
|
||||
#define int_fast32_t gl_int_fast32_t
|
||||
#define uint_fast32_t gl_uint_fast32_t
|
||||
#ifdef GL_INT64_T
|
||||
# define int_fast64_t int64_t
|
||||
#endif
|
||||
#ifdef GL_UINT64_T
|
||||
# define uint_fast64_t uint64_t
|
||||
#endif
|
||||
|
||||
/* 7.18.1.4. Integer types capable of holding object pointers */
|
||||
|
||||
#undef intptr_t
|
||||
#undef uintptr_t
|
||||
typedef long int gl_intptr_t;
|
||||
typedef unsigned long int gl_uintptr_t;
|
||||
#define intptr_t gl_intptr_t
|
||||
#define uintptr_t gl_uintptr_t
|
||||
|
||||
/* 7.18.1.5. Greatest-width integer types */
|
||||
|
||||
/* Note: These types are compiler dependent. It may be unwise to use them in
|
||||
public header files. */
|
||||
|
||||
/* If the system defines INTMAX_MAX, assume that intmax_t works, and
|
||||
similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
|
||||
assuming one type where another is used by the system. */
|
||||
|
||||
#ifndef INTMAX_MAX
|
||||
# undef INTMAX_C
|
||||
# undef intmax_t
|
||||
# if 1 && LONG_MAX >> 30 == 1
|
||||
typedef long long int gl_intmax_t;
|
||||
# define intmax_t gl_intmax_t
|
||||
# elif defined GL_INT64_T
|
||||
# define intmax_t int64_t
|
||||
# else
|
||||
typedef long int gl_intmax_t;
|
||||
# define intmax_t gl_intmax_t
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINTMAX_MAX
|
||||
# undef UINTMAX_C
|
||||
# undef uintmax_t
|
||||
# if 1 && ULONG_MAX >> 31 == 1
|
||||
typedef unsigned long long int gl_uintmax_t;
|
||||
# define uintmax_t gl_uintmax_t
|
||||
# elif defined GL_UINT64_T
|
||||
# define uintmax_t uint64_t
|
||||
# else
|
||||
typedef unsigned long int gl_uintmax_t;
|
||||
# define uintmax_t gl_uintmax_t
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Verify that intmax_t and uintmax_t have the same size. Too much code
|
||||
breaks if this is not the case. If this check fails, the reason is likely
|
||||
to be found in the autoconf macros. */
|
||||
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
|
||||
? 1 : -1];
|
||||
|
||||
#define GNULIB_defined_stdint_types 1
|
||||
#endif /* !GNULIB_defined_stdint_types */
|
||||
|
||||
/* 7.18.2. Limits of specified-width integer types */
|
||||
|
||||
/* 7.18.2.1. Limits of exact-width integer types */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits. */
|
||||
|
||||
#undef INT8_MIN
|
||||
#undef INT8_MAX
|
||||
#undef UINT8_MAX
|
||||
#define INT8_MIN (~ INT8_MAX)
|
||||
#define INT8_MAX 127
|
||||
#define UINT8_MAX 255
|
||||
|
||||
#undef INT16_MIN
|
||||
#undef INT16_MAX
|
||||
#undef UINT16_MAX
|
||||
#define INT16_MIN (~ INT16_MAX)
|
||||
#define INT16_MAX 32767
|
||||
#define UINT16_MAX 65535
|
||||
|
||||
#undef INT32_MIN
|
||||
#undef INT32_MAX
|
||||
#undef UINT32_MAX
|
||||
#define INT32_MIN (~ INT32_MAX)
|
||||
#define INT32_MAX 2147483647
|
||||
#define UINT32_MAX 4294967295U
|
||||
|
||||
#if defined GL_INT64_T && ! defined INT64_MAX
|
||||
/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
|
||||
evaluates the latter incorrectly in preprocessor expressions. */
|
||||
# define INT64_MIN (- INTMAX_C (1) << 63)
|
||||
# define INT64_MAX INTMAX_C (9223372036854775807)
|
||||
#endif
|
||||
|
||||
#if defined GL_UINT64_T && ! defined UINT64_MAX
|
||||
# define UINT64_MAX UINTMAX_C (18446744073709551615)
|
||||
#endif
|
||||
|
||||
/* 7.18.2.2. Limits of minimum-width integer types */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
|
||||
are the same as the corresponding N_t types. */
|
||||
|
||||
#undef INT_LEAST8_MIN
|
||||
#undef INT_LEAST8_MAX
|
||||
#undef UINT_LEAST8_MAX
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
|
||||
#undef INT_LEAST16_MIN
|
||||
#undef INT_LEAST16_MAX
|
||||
#undef UINT_LEAST16_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
|
||||
#undef INT_LEAST32_MIN
|
||||
#undef INT_LEAST32_MAX
|
||||
#undef UINT_LEAST32_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
|
||||
#undef INT_LEAST64_MIN
|
||||
#undef INT_LEAST64_MAX
|
||||
#ifdef GL_INT64_T
|
||||
# define INT_LEAST64_MIN INT64_MIN
|
||||
# define INT_LEAST64_MAX INT64_MAX
|
||||
#endif
|
||||
|
||||
#undef UINT_LEAST64_MAX
|
||||
#ifdef GL_UINT64_T
|
||||
# define UINT_LEAST64_MAX UINT64_MAX
|
||||
#endif
|
||||
|
||||
/* 7.18.2.3. Limits of fastest minimum-width integer types */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
|
||||
are taken from the same list of types. */
|
||||
|
||||
#undef INT_FAST8_MIN
|
||||
#undef INT_FAST8_MAX
|
||||
#undef UINT_FAST8_MAX
|
||||
#define INT_FAST8_MIN SCHAR_MIN
|
||||
#define INT_FAST8_MAX SCHAR_MAX
|
||||
#define UINT_FAST8_MAX UCHAR_MAX
|
||||
|
||||
#undef INT_FAST16_MIN
|
||||
#undef INT_FAST16_MAX
|
||||
#undef UINT_FAST16_MAX
|
||||
#define INT_FAST16_MIN INT_FAST32_MIN
|
||||
#define INT_FAST16_MAX INT_FAST32_MAX
|
||||
#define UINT_FAST16_MAX UINT_FAST32_MAX
|
||||
|
||||
#undef INT_FAST32_MIN
|
||||
#undef INT_FAST32_MAX
|
||||
#undef UINT_FAST32_MAX
|
||||
#ifdef __sun
|
||||
# define INT_FAST32_MIN INT_MIN
|
||||
# define INT_FAST32_MAX INT_MAX
|
||||
# define UINT_FAST32_MAX UINT_MAX
|
||||
#else
|
||||
# define INT_FAST32_MIN LONG_MIN
|
||||
# define INT_FAST32_MAX LONG_MAX
|
||||
# define UINT_FAST32_MAX ULONG_MAX
|
||||
#endif
|
||||
|
||||
#undef INT_FAST64_MIN
|
||||
#undef INT_FAST64_MAX
|
||||
#ifdef GL_INT64_T
|
||||
# define INT_FAST64_MIN INT64_MIN
|
||||
# define INT_FAST64_MAX INT64_MAX
|
||||
#endif
|
||||
|
||||
#undef UINT_FAST64_MAX
|
||||
#ifdef GL_UINT64_T
|
||||
# define UINT_FAST64_MAX UINT64_MAX
|
||||
#endif
|
||||
|
||||
/* 7.18.2.4. Limits of integer types capable of holding object pointers */
|
||||
|
||||
#undef INTPTR_MIN
|
||||
#undef INTPTR_MAX
|
||||
#undef UINTPTR_MAX
|
||||
#define INTPTR_MIN LONG_MIN
|
||||
#define INTPTR_MAX LONG_MAX
|
||||
#define UINTPTR_MAX ULONG_MAX
|
||||
|
||||
/* 7.18.2.5. Limits of greatest-width integer types */
|
||||
|
||||
#ifndef INTMAX_MAX
|
||||
# undef INTMAX_MIN
|
||||
# ifdef INT64_MAX
|
||||
# define INTMAX_MIN INT64_MIN
|
||||
# define INTMAX_MAX INT64_MAX
|
||||
# else
|
||||
# define INTMAX_MIN INT32_MIN
|
||||
# define INTMAX_MAX INT32_MAX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINTMAX_MAX
|
||||
# ifdef UINT64_MAX
|
||||
# define UINTMAX_MAX UINT64_MAX
|
||||
# else
|
||||
# define UINTMAX_MAX UINT32_MAX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* 7.18.3. Limits of other integer types */
|
||||
|
||||
/* ptrdiff_t limits */
|
||||
#undef PTRDIFF_MIN
|
||||
#undef PTRDIFF_MAX
|
||||
#if 0
|
||||
# ifdef _LP64
|
||||
# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
|
||||
# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
|
||||
# else
|
||||
# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
|
||||
# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
|
||||
# endif
|
||||
#else
|
||||
# define PTRDIFF_MIN \
|
||||
_STDINT_MIN (1, 32, 0)
|
||||
# define PTRDIFF_MAX \
|
||||
_STDINT_MAX (1, 32, 0)
|
||||
#endif
|
||||
|
||||
/* sig_atomic_t limits */
|
||||
#undef SIG_ATOMIC_MIN
|
||||
#undef SIG_ATOMIC_MAX
|
||||
#define SIG_ATOMIC_MIN \
|
||||
_STDINT_MIN (1, 32, \
|
||||
0)
|
||||
#define SIG_ATOMIC_MAX \
|
||||
_STDINT_MAX (1, 32, \
|
||||
0)
|
||||
|
||||
|
||||
/* size_t limit */
|
||||
#undef SIZE_MAX
|
||||
#if 0
|
||||
# ifdef _LP64
|
||||
# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
|
||||
# else
|
||||
# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
|
||||
# endif
|
||||
#else
|
||||
# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
|
||||
#endif
|
||||
|
||||
/* wchar_t limits */
|
||||
/* Get WCHAR_MIN, WCHAR_MAX.
|
||||
This include is not on the top, above, because on OSF/1 4.0 we have a
|
||||
sequence of nested includes
|
||||
<wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
|
||||
<stdint.h> and assumes its types are already defined. */
|
||||
#if 1 && ! (defined WCHAR_MIN && defined WCHAR_MAX)
|
||||
/* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
|
||||
included before <wchar.h>. */
|
||||
# include <stddef.h>
|
||||
# include <stdio.h>
|
||||
# include <time.h>
|
||||
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
|
||||
/* We don't need WCHAR_* in libidn, so to avoid problems with
|
||||
missing wchar.h, don't include wchar.h here. */
|
||||
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
|
||||
#endif
|
||||
#undef WCHAR_MIN
|
||||
#undef WCHAR_MAX
|
||||
#define WCHAR_MIN \
|
||||
_STDINT_MIN (1, 32, 0)
|
||||
#define WCHAR_MAX \
|
||||
_STDINT_MAX (1, 32, 0)
|
||||
|
||||
/* wint_t limits */
|
||||
#undef WINT_MIN
|
||||
#undef WINT_MAX
|
||||
#define WINT_MIN \
|
||||
_STDINT_MIN (1, 32, 0)
|
||||
#define WINT_MAX \
|
||||
_STDINT_MAX (1, 32, 0)
|
||||
|
||||
/* 7.18.4. Macros for integer constants */
|
||||
|
||||
/* 7.18.4.1. Macros for minimum-width integer constants */
|
||||
/* According to ISO C 99 Technical Corrigendum 1 */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
|
||||
|
||||
#undef INT8_C
|
||||
#undef UINT8_C
|
||||
#define INT8_C(x) x
|
||||
#define UINT8_C(x) x
|
||||
|
||||
#undef INT16_C
|
||||
#undef UINT16_C
|
||||
#define INT16_C(x) x
|
||||
#define UINT16_C(x) x
|
||||
|
||||
#undef INT32_C
|
||||
#undef UINT32_C
|
||||
#define INT32_C(x) x
|
||||
#define UINT32_C(x) x ## U
|
||||
|
||||
#undef INT64_C
|
||||
#undef UINT64_C
|
||||
#if LONG_MAX >> 31 >> 31 == 1
|
||||
# define INT64_C(x) x##L
|
||||
#elif defined _MSC_VER
|
||||
# define INT64_C(x) x##i64
|
||||
#elif 1
|
||||
# define INT64_C(x) x##LL
|
||||
#endif
|
||||
#if ULONG_MAX >> 31 >> 31 >> 1 == 1
|
||||
# define UINT64_C(x) x##UL
|
||||
#elif defined _MSC_VER
|
||||
# define UINT64_C(x) x##ui64
|
||||
#elif 1
|
||||
# define UINT64_C(x) x##ULL
|
||||
#endif
|
||||
|
||||
/* 7.18.4.2. Macros for greatest-width integer constants */
|
||||
|
||||
#ifndef INTMAX_C
|
||||
# if 1 && LONG_MAX >> 30 == 1
|
||||
# define INTMAX_C(x) x##LL
|
||||
# elif defined GL_INT64_T
|
||||
# define INTMAX_C(x) INT64_C(x)
|
||||
# else
|
||||
# define INTMAX_C(x) x##L
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINTMAX_C
|
||||
# if 1 && ULONG_MAX >> 31 == 1
|
||||
# define UINTMAX_C(x) x##ULL
|
||||
# elif defined GL_UINT64_T
|
||||
# define UINTMAX_C(x) UINT64_C(x)
|
||||
# else
|
||||
# define UINTMAX_C(x) x##UL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _GL_LGL_STDINT_H */
|
||||
#endif /* !(defined __ANDROID__ && ...) */
|
||||
#endif /* !defined _GL_LGL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
|
||||
Vendored
BIN
Binary file not shown.
Vendored
+241
@@ -0,0 +1,241 @@
|
||||
/* stringprep.h --- Header file for stringprep functions.
|
||||
Copyright (C) 2002-2012 Simon Josefsson
|
||||
|
||||
This file is part of GNU Libidn.
|
||||
|
||||
GNU Libidn is free software: you can redistribute it and/or
|
||||
modify it under the terms of either:
|
||||
|
||||
* the GNU Lesser General Public License as published by the Free
|
||||
Software Foundation; either version 3 of the License, or (at
|
||||
your option) any later version.
|
||||
|
||||
or
|
||||
|
||||
* the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at
|
||||
your option) any later version.
|
||||
|
||||
or both in parallel, as here.
|
||||
|
||||
GNU Libidn is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received copies of the GNU General Public License and
|
||||
the GNU Lesser General Public License along with this program. If
|
||||
not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef STRINGPREP_H
|
||||
# define STRINGPREP_H
|
||||
|
||||
# ifndef IDNAPI
|
||||
# if defined LIBIDN_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY
|
||||
# define IDNAPI __attribute__((__visibility__("default")))
|
||||
# elif defined LIBIDN_BUILDING && defined _MSC_VER && ! defined LIBIDN_STATIC
|
||||
# define IDNAPI __declspec(dllexport)
|
||||
# elif defined _MSC_VER && ! defined LIBIDN_STATIC
|
||||
# define IDNAPI __declspec(dllimport)
|
||||
# else
|
||||
# define IDNAPI
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# include <stddef.h> /* size_t */
|
||||
# include <sys/types.h> /* ssize_t */
|
||||
# include "idn-int.h" /* uint32_t */
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
# endif
|
||||
|
||||
# define STRINGPREP_VERSION "1.25"
|
||||
|
||||
/* Error codes. */
|
||||
typedef enum
|
||||
{
|
||||
STRINGPREP_OK = 0,
|
||||
/* Stringprep errors. */
|
||||
STRINGPREP_CONTAINS_UNASSIGNED = 1,
|
||||
STRINGPREP_CONTAINS_PROHIBITED = 2,
|
||||
STRINGPREP_BIDI_BOTH_L_AND_RAL = 3,
|
||||
STRINGPREP_BIDI_LEADTRAIL_NOT_RAL = 4,
|
||||
STRINGPREP_BIDI_CONTAINS_PROHIBITED = 5,
|
||||
/* Error in calling application. */
|
||||
STRINGPREP_TOO_SMALL_BUFFER = 100,
|
||||
STRINGPREP_PROFILE_ERROR = 101,
|
||||
STRINGPREP_FLAG_ERROR = 102,
|
||||
STRINGPREP_UNKNOWN_PROFILE = 103,
|
||||
/* Internal errors. */
|
||||
STRINGPREP_NFKC_FAILED = 200,
|
||||
STRINGPREP_MALLOC_ERROR = 201
|
||||
} Stringprep_rc;
|
||||
|
||||
/* Flags used when calling stringprep(). */
|
||||
typedef enum
|
||||
{
|
||||
STRINGPREP_NO_NFKC = 1,
|
||||
STRINGPREP_NO_BIDI = 2,
|
||||
STRINGPREP_NO_UNASSIGNED = 4
|
||||
} Stringprep_profile_flags;
|
||||
|
||||
/* Steps in a stringprep profile. */
|
||||
typedef enum
|
||||
{
|
||||
STRINGPREP_NFKC = 1,
|
||||
STRINGPREP_BIDI = 2,
|
||||
STRINGPREP_MAP_TABLE = 3,
|
||||
STRINGPREP_UNASSIGNED_TABLE = 4,
|
||||
STRINGPREP_PROHIBIT_TABLE = 5,
|
||||
STRINGPREP_BIDI_PROHIBIT_TABLE = 6,
|
||||
STRINGPREP_BIDI_RAL_TABLE = 7,
|
||||
STRINGPREP_BIDI_L_TABLE = 8
|
||||
} Stringprep_profile_steps;
|
||||
|
||||
# define STRINGPREP_MAX_MAP_CHARS 4
|
||||
|
||||
struct Stringprep_table_element
|
||||
{
|
||||
uint32_t start;
|
||||
uint32_t end; /* 0 if only one character */
|
||||
uint32_t map[STRINGPREP_MAX_MAP_CHARS]; /* NULL if end is not 0 */
|
||||
};
|
||||
typedef struct Stringprep_table_element Stringprep_table_element;
|
||||
|
||||
struct Stringprep_table
|
||||
{
|
||||
Stringprep_profile_steps operation;
|
||||
Stringprep_profile_flags flags;
|
||||
const Stringprep_table_element *table;
|
||||
};
|
||||
typedef struct Stringprep_table Stringprep_profile;
|
||||
|
||||
struct Stringprep_profiles
|
||||
{
|
||||
const char *name;
|
||||
const Stringprep_profile *tables;
|
||||
};
|
||||
typedef struct Stringprep_profiles Stringprep_profiles;
|
||||
|
||||
extern IDNAPI const Stringprep_profiles stringprep_profiles[];
|
||||
|
||||
/* Profiles */
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_A_1[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_B_1[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_B_2[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_B_3[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_1_1[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_1_2[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_2_1[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_2_2[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_3[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_4[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_5[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_6[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_7[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_8[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_9[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_D_1[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_D_2[];
|
||||
|
||||
/* Nameprep */
|
||||
|
||||
extern IDNAPI const Stringprep_profile stringprep_nameprep[];
|
||||
|
||||
# define stringprep_nameprep(in, maxlen) \
|
||||
stringprep(in, maxlen, 0, stringprep_nameprep)
|
||||
|
||||
# define stringprep_nameprep_no_unassigned(in, maxlen) \
|
||||
stringprep(in, maxlen, STRINGPREP_NO_UNASSIGNED, stringprep_nameprep)
|
||||
|
||||
/* SASL */
|
||||
|
||||
extern IDNAPI const Stringprep_profile stringprep_saslprep[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_saslprep_space_map[];
|
||||
extern IDNAPI const Stringprep_profile stringprep_plain[];
|
||||
extern IDNAPI const Stringprep_profile stringprep_trace[];
|
||||
|
||||
# define stringprep_plain(in, maxlen) \
|
||||
stringprep(in, maxlen, 0, stringprep_plain)
|
||||
|
||||
/* Kerberos */
|
||||
|
||||
extern IDNAPI const Stringprep_profile stringprep_kerberos5[];
|
||||
|
||||
# define stringprep_kerberos5(in, maxlen) \
|
||||
stringprep(in, maxlen, 0, stringprep_kerberos5)
|
||||
|
||||
/* XMPP */
|
||||
|
||||
extern IDNAPI const Stringprep_profile stringprep_xmpp_nodeprep[];
|
||||
extern IDNAPI const Stringprep_profile stringprep_xmpp_resourceprep[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_xmpp_nodeprep_prohibit[];
|
||||
|
||||
# define stringprep_xmpp_nodeprep(in, maxlen) \
|
||||
stringprep(in, maxlen, 0, stringprep_xmpp_nodeprep)
|
||||
# define stringprep_xmpp_resourceprep(in, maxlen) \
|
||||
stringprep(in, maxlen, 0, stringprep_xmpp_resourceprep)
|
||||
|
||||
/* iSCSI */
|
||||
|
||||
extern IDNAPI const Stringprep_profile stringprep_iscsi[];
|
||||
extern IDNAPI const Stringprep_table_element stringprep_iscsi_prohibit[];
|
||||
|
||||
# define stringprep_iscsi(in, maxlen) \
|
||||
stringprep(in, maxlen, 0, stringprep_iscsi)
|
||||
|
||||
/* API */
|
||||
|
||||
extern IDNAPI int stringprep_4i (uint32_t * ucs4, size_t * len,
|
||||
size_t maxucs4len,
|
||||
Stringprep_profile_flags flags,
|
||||
const Stringprep_profile * profile);
|
||||
extern IDNAPI int stringprep_4zi (uint32_t * ucs4, size_t maxucs4len,
|
||||
Stringprep_profile_flags flags,
|
||||
const Stringprep_profile * profile);
|
||||
extern IDNAPI int stringprep (char *in, size_t maxlen,
|
||||
Stringprep_profile_flags flags,
|
||||
const Stringprep_profile * profile);
|
||||
|
||||
extern IDNAPI int stringprep_profile (const char *in,
|
||||
char **out,
|
||||
const char *profile,
|
||||
Stringprep_profile_flags flags);
|
||||
|
||||
extern IDNAPI const char *stringprep_strerror (Stringprep_rc rc);
|
||||
|
||||
extern IDNAPI const char *stringprep_check_version (const char
|
||||
*req_version);
|
||||
|
||||
/* Utility */
|
||||
|
||||
extern IDNAPI int stringprep_unichar_to_utf8 (uint32_t c, char *outbuf);
|
||||
extern IDNAPI uint32_t stringprep_utf8_to_unichar (const char *p);
|
||||
|
||||
extern IDNAPI uint32_t *stringprep_utf8_to_ucs4 (const char *str,
|
||||
ssize_t len,
|
||||
size_t * items_written);
|
||||
extern IDNAPI char *stringprep_ucs4_to_utf8 (const uint32_t * str,
|
||||
ssize_t len,
|
||||
size_t * items_read,
|
||||
size_t * items_written);
|
||||
|
||||
extern IDNAPI char *stringprep_utf8_nfkc_normalize (const char *str,
|
||||
ssize_t len);
|
||||
extern IDNAPI uint32_t *stringprep_ucs4_nfkc_normalize (const uint32_t * str,
|
||||
ssize_t len);
|
||||
|
||||
extern IDNAPI const char *stringprep_locale_charset (void);
|
||||
extern IDNAPI char *stringprep_convert (const char *str,
|
||||
const char *to_codeset,
|
||||
const char *from_codeset);
|
||||
extern IDNAPI char *stringprep_locale_to_utf8 (const char *str);
|
||||
extern IDNAPI char *stringprep_utf8_to_locale (const char *str);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* STRINGPREP_H */
|
||||
Reference in new issue
Block a user