Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: stringprep.h
/* stringprep.h --- Header file for stringprep functions.
[0] Fix | Delete
Copyright (C) 2002-2016 Simon Josefsson
[1] Fix | Delete
[2] Fix | Delete
This file is part of GNU Libidn.
[3] Fix | Delete
[4] Fix | Delete
GNU Libidn is free software: you can redistribute it and/or
[5] Fix | Delete
modify it under the terms of either:
[6] Fix | Delete
[7] Fix | Delete
* the GNU Lesser General Public License as published by the Free
[8] Fix | Delete
Software Foundation; either version 3 of the License, or (at
[9] Fix | Delete
your option) any later version.
[10] Fix | Delete
[11] Fix | Delete
or
[12] Fix | Delete
[13] Fix | Delete
* the GNU General Public License as published by the Free
[14] Fix | Delete
Software Foundation; either version 2 of the License, or (at
[15] Fix | Delete
your option) any later version.
[16] Fix | Delete
[17] Fix | Delete
or both in parallel, as here.
[18] Fix | Delete
[19] Fix | Delete
GNU Libidn is distributed in the hope that it will be useful,
[20] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[21] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[22] Fix | Delete
General Public License for more details.
[23] Fix | Delete
[24] Fix | Delete
You should have received copies of the GNU General Public License and
[25] Fix | Delete
the GNU Lesser General Public License along with this program. If
[26] Fix | Delete
not, see <http://www.gnu.org/licenses/>. */
[27] Fix | Delete
[28] Fix | Delete
#ifndef STRINGPREP_H
[29] Fix | Delete
# define STRINGPREP_H
[30] Fix | Delete
[31] Fix | Delete
# ifndef IDNAPI
[32] Fix | Delete
# if defined LIBIDN_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY
[33] Fix | Delete
# define IDNAPI __attribute__((__visibility__("default")))
[34] Fix | Delete
# elif defined LIBIDN_BUILDING && defined _MSC_VER && ! defined LIBIDN_STATIC
[35] Fix | Delete
# define IDNAPI __declspec(dllexport)
[36] Fix | Delete
# elif defined _MSC_VER && ! defined LIBIDN_STATIC
[37] Fix | Delete
# define IDNAPI __declspec(dllimport)
[38] Fix | Delete
# else
[39] Fix | Delete
# define IDNAPI
[40] Fix | Delete
# endif
[41] Fix | Delete
# endif
[42] Fix | Delete
[43] Fix | Delete
# include <stddef.h> /* size_t */
[44] Fix | Delete
# include <sys/types.h> /* ssize_t */
[45] Fix | Delete
# include <idn-int.h> /* uint32_t */
[46] Fix | Delete
[47] Fix | Delete
# ifdef __cplusplus
[48] Fix | Delete
extern "C"
[49] Fix | Delete
{
[50] Fix | Delete
# endif
[51] Fix | Delete
[52] Fix | Delete
# define STRINGPREP_VERSION "1.34"
[53] Fix | Delete
[54] Fix | Delete
/* Error codes. */
[55] Fix | Delete
typedef enum
[56] Fix | Delete
{
[57] Fix | Delete
STRINGPREP_OK = 0,
[58] Fix | Delete
/* Stringprep errors. */
[59] Fix | Delete
STRINGPREP_CONTAINS_UNASSIGNED = 1,
[60] Fix | Delete
STRINGPREP_CONTAINS_PROHIBITED = 2,
[61] Fix | Delete
STRINGPREP_BIDI_BOTH_L_AND_RAL = 3,
[62] Fix | Delete
STRINGPREP_BIDI_LEADTRAIL_NOT_RAL = 4,
[63] Fix | Delete
STRINGPREP_BIDI_CONTAINS_PROHIBITED = 5,
[64] Fix | Delete
/* Error in calling application. */
[65] Fix | Delete
STRINGPREP_TOO_SMALL_BUFFER = 100,
[66] Fix | Delete
STRINGPREP_PROFILE_ERROR = 101,
[67] Fix | Delete
STRINGPREP_FLAG_ERROR = 102,
[68] Fix | Delete
STRINGPREP_UNKNOWN_PROFILE = 103,
[69] Fix | Delete
STRINGPREP_ICONV_ERROR = 104,
[70] Fix | Delete
/* Internal errors. */
[71] Fix | Delete
STRINGPREP_NFKC_FAILED = 200,
[72] Fix | Delete
STRINGPREP_MALLOC_ERROR = 201
[73] Fix | Delete
} Stringprep_rc;
[74] Fix | Delete
[75] Fix | Delete
/* Flags used when calling stringprep(). */
[76] Fix | Delete
typedef enum
[77] Fix | Delete
{
[78] Fix | Delete
STRINGPREP_NO_NFKC = 1,
[79] Fix | Delete
STRINGPREP_NO_BIDI = 2,
[80] Fix | Delete
STRINGPREP_NO_UNASSIGNED = 4
[81] Fix | Delete
} Stringprep_profile_flags;
[82] Fix | Delete
[83] Fix | Delete
/* Steps in a stringprep profile. */
[84] Fix | Delete
typedef enum
[85] Fix | Delete
{
[86] Fix | Delete
STRINGPREP_NFKC = 1,
[87] Fix | Delete
STRINGPREP_BIDI = 2,
[88] Fix | Delete
STRINGPREP_MAP_TABLE = 3,
[89] Fix | Delete
STRINGPREP_UNASSIGNED_TABLE = 4,
[90] Fix | Delete
STRINGPREP_PROHIBIT_TABLE = 5,
[91] Fix | Delete
STRINGPREP_BIDI_PROHIBIT_TABLE = 6,
[92] Fix | Delete
STRINGPREP_BIDI_RAL_TABLE = 7,
[93] Fix | Delete
STRINGPREP_BIDI_L_TABLE = 8
[94] Fix | Delete
} Stringprep_profile_steps;
[95] Fix | Delete
[96] Fix | Delete
# define STRINGPREP_MAX_MAP_CHARS 4
[97] Fix | Delete
[98] Fix | Delete
struct Stringprep_table_element
[99] Fix | Delete
{
[100] Fix | Delete
uint32_t start;
[101] Fix | Delete
uint32_t end; /* 0 if only one character */
[102] Fix | Delete
uint32_t map[STRINGPREP_MAX_MAP_CHARS]; /* NULL if end is not 0 */
[103] Fix | Delete
};
[104] Fix | Delete
typedef struct Stringprep_table_element Stringprep_table_element;
[105] Fix | Delete
[106] Fix | Delete
struct Stringprep_table
[107] Fix | Delete
{
[108] Fix | Delete
Stringprep_profile_steps operation;
[109] Fix | Delete
Stringprep_profile_flags flags;
[110] Fix | Delete
const Stringprep_table_element *table;
[111] Fix | Delete
};
[112] Fix | Delete
typedef struct Stringprep_table Stringprep_profile;
[113] Fix | Delete
[114] Fix | Delete
struct Stringprep_profiles
[115] Fix | Delete
{
[116] Fix | Delete
const char *name;
[117] Fix | Delete
const Stringprep_profile *tables;
[118] Fix | Delete
};
[119] Fix | Delete
typedef struct Stringprep_profiles Stringprep_profiles;
[120] Fix | Delete
[121] Fix | Delete
extern IDNAPI const Stringprep_profiles stringprep_profiles[];
[122] Fix | Delete
[123] Fix | Delete
/* Profiles */
[124] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_A_1[];
[125] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_B_1[];
[126] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_B_2[];
[127] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_B_3[];
[128] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_1_1[];
[129] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_1_2[];
[130] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_2_1[];
[131] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_2_2[];
[132] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_3[];
[133] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_4[];
[134] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_5[];
[135] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_6[];
[136] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_7[];
[137] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_8[];
[138] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_C_9[];
[139] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_D_1[];
[140] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_rfc3454_D_2[];
[141] Fix | Delete
[142] Fix | Delete
/* Nameprep */
[143] Fix | Delete
[144] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_nameprep[];
[145] Fix | Delete
[146] Fix | Delete
# define stringprep_nameprep(in, maxlen) \
[147] Fix | Delete
stringprep(in, maxlen, 0, stringprep_nameprep)
[148] Fix | Delete
[149] Fix | Delete
# define stringprep_nameprep_no_unassigned(in, maxlen) \
[150] Fix | Delete
stringprep(in, maxlen, STRINGPREP_NO_UNASSIGNED, stringprep_nameprep)
[151] Fix | Delete
[152] Fix | Delete
/* SASL */
[153] Fix | Delete
[154] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_saslprep[];
[155] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_saslprep_space_map[];
[156] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_plain[];
[157] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_trace[];
[158] Fix | Delete
[159] Fix | Delete
# define stringprep_plain(in, maxlen) \
[160] Fix | Delete
stringprep(in, maxlen, 0, stringprep_plain)
[161] Fix | Delete
[162] Fix | Delete
/* Kerberos */
[163] Fix | Delete
[164] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_kerberos5[];
[165] Fix | Delete
[166] Fix | Delete
# define stringprep_kerberos5(in, maxlen) \
[167] Fix | Delete
stringprep(in, maxlen, 0, stringprep_kerberos5)
[168] Fix | Delete
[169] Fix | Delete
/* XMPP */
[170] Fix | Delete
[171] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_xmpp_nodeprep[];
[172] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_xmpp_resourceprep[];
[173] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_xmpp_nodeprep_prohibit[];
[174] Fix | Delete
[175] Fix | Delete
# define stringprep_xmpp_nodeprep(in, maxlen) \
[176] Fix | Delete
stringprep(in, maxlen, 0, stringprep_xmpp_nodeprep)
[177] Fix | Delete
# define stringprep_xmpp_resourceprep(in, maxlen) \
[178] Fix | Delete
stringprep(in, maxlen, 0, stringprep_xmpp_resourceprep)
[179] Fix | Delete
[180] Fix | Delete
/* iSCSI */
[181] Fix | Delete
[182] Fix | Delete
extern IDNAPI const Stringprep_profile stringprep_iscsi[];
[183] Fix | Delete
extern IDNAPI const Stringprep_table_element stringprep_iscsi_prohibit[];
[184] Fix | Delete
[185] Fix | Delete
# define stringprep_iscsi(in, maxlen) \
[186] Fix | Delete
stringprep(in, maxlen, 0, stringprep_iscsi)
[187] Fix | Delete
[188] Fix | Delete
/* API */
[189] Fix | Delete
[190] Fix | Delete
extern IDNAPI int stringprep_4i (uint32_t * ucs4, size_t * len,
[191] Fix | Delete
size_t maxucs4len,
[192] Fix | Delete
Stringprep_profile_flags flags,
[193] Fix | Delete
const Stringprep_profile * profile);
[194] Fix | Delete
extern IDNAPI int stringprep_4zi (uint32_t * ucs4, size_t maxucs4len,
[195] Fix | Delete
Stringprep_profile_flags flags,
[196] Fix | Delete
const Stringprep_profile * profile);
[197] Fix | Delete
extern IDNAPI int stringprep (char *in, size_t maxlen,
[198] Fix | Delete
Stringprep_profile_flags flags,
[199] Fix | Delete
const Stringprep_profile * profile);
[200] Fix | Delete
[201] Fix | Delete
extern IDNAPI int stringprep_profile (const char *in,
[202] Fix | Delete
char **out,
[203] Fix | Delete
const char *profile,
[204] Fix | Delete
Stringprep_profile_flags flags);
[205] Fix | Delete
[206] Fix | Delete
extern IDNAPI const char *stringprep_strerror (Stringprep_rc rc);
[207] Fix | Delete
[208] Fix | Delete
extern IDNAPI const char *stringprep_check_version (const char
[209] Fix | Delete
*req_version);
[210] Fix | Delete
[211] Fix | Delete
/* Utility */
[212] Fix | Delete
[213] Fix | Delete
extern IDNAPI int stringprep_unichar_to_utf8 (uint32_t c, char *outbuf);
[214] Fix | Delete
extern IDNAPI uint32_t stringprep_utf8_to_unichar (const char *p);
[215] Fix | Delete
[216] Fix | Delete
extern IDNAPI uint32_t *stringprep_utf8_to_ucs4 (const char *str,
[217] Fix | Delete
ssize_t len,
[218] Fix | Delete
size_t * items_written);
[219] Fix | Delete
extern IDNAPI char *stringprep_ucs4_to_utf8 (const uint32_t * str,
[220] Fix | Delete
ssize_t len,
[221] Fix | Delete
size_t * items_read,
[222] Fix | Delete
size_t * items_written);
[223] Fix | Delete
[224] Fix | Delete
extern IDNAPI char *stringprep_utf8_nfkc_normalize (const char *str,
[225] Fix | Delete
ssize_t len);
[226] Fix | Delete
extern IDNAPI uint32_t *stringprep_ucs4_nfkc_normalize (const uint32_t * str,
[227] Fix | Delete
ssize_t len);
[228] Fix | Delete
[229] Fix | Delete
extern IDNAPI const char *stringprep_locale_charset (void);
[230] Fix | Delete
extern IDNAPI char *stringprep_convert (const char *str,
[231] Fix | Delete
const char *to_codeset,
[232] Fix | Delete
const char *from_codeset);
[233] Fix | Delete
extern IDNAPI char *stringprep_locale_to_utf8 (const char *str);
[234] Fix | Delete
extern IDNAPI char *stringprep_utf8_to_locale (const char *str);
[235] Fix | Delete
[236] Fix | Delete
# ifdef __cplusplus
[237] Fix | Delete
}
[238] Fix | Delete
# endif
[239] Fix | Delete
[240] Fix | Delete
#endif /* STRINGPREP_H */
[241] Fix | Delete
[242] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function