Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../proc/self/root/usr/include
File: tld.h
/* tld.h --- Declarations for TLD restriction checking.
[0] Fix | Delete
Copyright (C) 2004-2016 Simon Josefsson.
[1] Fix | Delete
Copyright (C) 2003-2014, 2016 Free Software Foundation, Inc.
[2] Fix | Delete
[3] Fix | Delete
Author: Thomas Jacob, Internet24.de
[4] Fix | Delete
[5] Fix | Delete
This file is part of GNU Libidn.
[6] Fix | Delete
[7] Fix | Delete
GNU Libidn is free software: you can redistribute it and/or
[8] Fix | Delete
modify it under the terms of either:
[9] Fix | Delete
[10] Fix | Delete
* the GNU Lesser General Public License as published by the Free
[11] Fix | Delete
Software Foundation; either version 3 of the License, or (at
[12] Fix | Delete
your option) any later version.
[13] Fix | Delete
[14] Fix | Delete
or
[15] Fix | Delete
[16] Fix | Delete
* the GNU General Public License as published by the Free
[17] Fix | Delete
Software Foundation; either version 2 of the License, or (at
[18] Fix | Delete
your option) any later version.
[19] Fix | Delete
[20] Fix | Delete
or both in parallel, as here.
[21] Fix | Delete
[22] Fix | Delete
GNU Libidn is distributed in the hope that it will be useful,
[23] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[24] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[25] Fix | Delete
General Public License for more details.
[26] Fix | Delete
[27] Fix | Delete
You should have received copies of the GNU General Public License and
[28] Fix | Delete
the GNU Lesser General Public License along with this program. If
[29] Fix | Delete
not, see <http://www.gnu.org/licenses/>. */
[30] Fix | Delete
[31] Fix | Delete
#ifndef TLD_H
[32] Fix | Delete
# define TLD_H
[33] Fix | Delete
[34] Fix | Delete
# ifndef IDNAPI
[35] Fix | Delete
# if defined LIBIDN_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY
[36] Fix | Delete
# define IDNAPI __attribute__((__visibility__("default")))
[37] Fix | Delete
# elif defined LIBIDN_BUILDING && defined _MSC_VER && ! defined LIBIDN_STATIC
[38] Fix | Delete
# define IDNAPI __declspec(dllexport)
[39] Fix | Delete
# elif defined _MSC_VER && ! defined LIBIDN_STATIC
[40] Fix | Delete
# define IDNAPI __declspec(dllimport)
[41] Fix | Delete
# else
[42] Fix | Delete
# define IDNAPI
[43] Fix | Delete
# endif
[44] Fix | Delete
# endif
[45] Fix | Delete
[46] Fix | Delete
# ifdef __cplusplus
[47] Fix | Delete
extern "C"
[48] Fix | Delete
{
[49] Fix | Delete
# endif
[50] Fix | Delete
[51] Fix | Delete
/* Get size_t. */
[52] Fix | Delete
# include <stdlib.h>
[53] Fix | Delete
[54] Fix | Delete
/* Get uint32_t. */
[55] Fix | Delete
# include <idn-int.h>
[56] Fix | Delete
[57] Fix | Delete
/* Interval of valid code points in the TLD. */
[58] Fix | Delete
struct Tld_table_element
[59] Fix | Delete
{
[60] Fix | Delete
uint32_t start; /* Start of range. */
[61] Fix | Delete
uint32_t end; /* End of range, end == start if single. */
[62] Fix | Delete
};
[63] Fix | Delete
typedef struct Tld_table_element Tld_table_element;
[64] Fix | Delete
[65] Fix | Delete
/* List valid code points in a TLD. */
[66] Fix | Delete
struct Tld_table
[67] Fix | Delete
{
[68] Fix | Delete
const char *name; /* TLD name, e.g., "no". */
[69] Fix | Delete
const char *version; /* Version string from TLD file. */
[70] Fix | Delete
size_t nvalid; /* Number of entries in data. */
[71] Fix | Delete
const Tld_table_element *valid; /* Sorted array of valid code points. */
[72] Fix | Delete
};
[73] Fix | Delete
typedef struct Tld_table Tld_table;
[74] Fix | Delete
[75] Fix | Delete
/* Error codes. */
[76] Fix | Delete
typedef enum
[77] Fix | Delete
{
[78] Fix | Delete
TLD_SUCCESS = 0,
[79] Fix | Delete
TLD_INVALID = 1, /* Invalid character found. */
[80] Fix | Delete
TLD_NODATA = 2, /* Char, domain or inlen = 0. */
[81] Fix | Delete
TLD_MALLOC_ERROR = 3,
[82] Fix | Delete
TLD_ICONV_ERROR = 4,
[83] Fix | Delete
TLD_NO_TLD = 5,
[84] Fix | Delete
/* Workaround typo in earlier versions. */
[85] Fix | Delete
TLD_NOTLD = TLD_NO_TLD
[86] Fix | Delete
} Tld_rc;
[87] Fix | Delete
[88] Fix | Delete
extern IDNAPI const char *tld_strerror (Tld_rc rc);
[89] Fix | Delete
[90] Fix | Delete
/* Extract TLD, as ASCII string, of UCS4 domain name into "out". */
[91] Fix | Delete
extern IDNAPI int tld_get_4 (const uint32_t * in, size_t inlen,
[92] Fix | Delete
char **out);
[93] Fix | Delete
extern IDNAPI int tld_get_4z (const uint32_t * in, char **out);
[94] Fix | Delete
extern IDNAPI int tld_get_z (const char *in, char **out);
[95] Fix | Delete
[96] Fix | Delete
/* Return structure corresponding to the named TLD from specified
[97] Fix | Delete
* list of TLD tables, or return NULL if no matching TLD can be
[98] Fix | Delete
* found. */
[99] Fix | Delete
extern IDNAPI const Tld_table *tld_get_table (const char *tld,
[100] Fix | Delete
const Tld_table ** tables);
[101] Fix | Delete
[102] Fix | Delete
/* Return structure corresponding to the named TLD, first looking
[103] Fix | Delete
* thru overrides then thru built-in list, or return NULL if no
[104] Fix | Delete
* matching TLD can be found. */
[105] Fix | Delete
extern IDNAPI const Tld_table * tld_default_table (const char *tld,
[106] Fix | Delete
const Tld_table ** overrides);
[107] Fix | Delete
[108] Fix | Delete
/* Check NAMEPREPPED domain name for valid characters as defined by
[109] Fix | Delete
* the relevant registering body (plus [a-z0-9.-]). If error is
[110] Fix | Delete
* TLD_INVALID, set errpos to position of offending character. */
[111] Fix | Delete
extern IDNAPI int tld_check_4t (const uint32_t * in, size_t inlen,
[112] Fix | Delete
size_t * errpos, const Tld_table * tld);
[113] Fix | Delete
extern IDNAPI int tld_check_4tz (const uint32_t * in, size_t * errpos,
[114] Fix | Delete
const Tld_table * tld);
[115] Fix | Delete
[116] Fix | Delete
/* Utility interfaces that uses tld_get_4* to find TLD of string,
[117] Fix | Delete
then tld_default_table (with overrides) to find proper TLD table
[118] Fix | Delete
for the string, and then hands over to tld_check_4t*. */
[119] Fix | Delete
extern IDNAPI int tld_check_4 (const uint32_t * in, size_t inlen,
[120] Fix | Delete
size_t * errpos,
[121] Fix | Delete
const Tld_table ** overrides);
[122] Fix | Delete
extern IDNAPI int tld_check_4z (const uint32_t * in, size_t * errpos,
[123] Fix | Delete
const Tld_table ** overrides);
[124] Fix | Delete
extern IDNAPI int tld_check_8z (const char *in, size_t * errpos,
[125] Fix | Delete
const Tld_table ** overrides);
[126] Fix | Delete
extern IDNAPI int tld_check_lz (const char *in, size_t * errpos,
[127] Fix | Delete
const Tld_table ** overrides);
[128] Fix | Delete
[129] Fix | Delete
# ifdef __cplusplus
[130] Fix | Delete
}
[131] Fix | Delete
# endif
[132] Fix | Delete
[133] Fix | Delete
#endif /* TLD_H */
[134] Fix | Delete
[135] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function