libtld: /home/snapwebsites/snapcpp/contrib/libtld/src/tld_data.h Source File

libtld  1.5.13
A library to determine the Top-Level Domain name of any URL.
tld_data.h
Go to the documentation of this file.
1 /* TLD library -- TLD, domain name, and sub-domain extraction
2  * Copyright (c) 2011-2019 Made to Order Software Corp. All Rights Reserved
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 #ifndef LIB_TLD_DATA_H
24 #define LIB_TLD_DATA_H
25 
40 {
45  unsigned char f_category;
46 
55  unsigned char f_status;
56 
70  unsigned short f_start_offset;
71 
81  unsigned short f_end_offset;
82 
83  /* \brief The TLD this exception applies to.
84  *
85  * Exceptions refer to the actual TLD that needs to be returned when
86  * found. For example, the UK library uses library.uk instead of the
87  * expected library.org.uk. The exception is the sub-TLD "british-library"
88  * and the apply-to TLD is "uk". By default "uk" is considered
89  * invalid and would return an error. When found through an exception
90  * though, it is returned as a valid TLD.
91  *
92  * Note that means the british-library.uk website can set a cookie
93  * using ".uk" as the domain name.
94  *
95  * \note
96  * This field is only defined if f_status is TLD_STATUS_EXCEPTION.
97  */
98  unsigned short f_exception_apply_to;
99 
108  unsigned char f_exception_level;
109 
121  const char * f_tld;
122 
132  const char * f_country;
133 };
134 
140 extern const struct tld_description tld_descriptions[];
141 
147 extern unsigned short tld_start_offset;
148 
161 extern unsigned short tld_end_offset;
162 
172 extern int tld_max_level;
173 
174 #endif
175 //#ifndef LIB_TLD_DATA_H
176 // vim: ts=4 sw=4 et
unsigned short f_exception_apply_to
This TLD is an exception of the "apply to" TLD.
Definition: tld_data.h:98
unsigned char f_category
One of the enum tld_category values.
Definition: tld_data.h:45
const char * f_tld
The concerned TLD part without periods.
Definition: tld_data.h:121
int tld_max_level
The maximum number of levels defined in the TLD table.
Definition: tld_data.c:10273
unsigned short f_start_offset
The offset to the start of the array of next TLD levels.
Definition: tld_data.h:70
unsigned char f_exception_level
The TLD level to be returned with this exception.
Definition: tld_data.h:108
unsigned char f_status
One of the enum tld_status values.
Definition: tld_data.h:55
Description of a TLD.
Definition: tld_data.h:39
unsigned short tld_start_offset
The start offset of the top-most top-level-domain names.
Definition: tld_data.c:10271
const char * f_country
The name of the country owning this extension.
Definition: tld_data.h:132
const struct tld_description tld_descriptions[]
Array of all the TLDs defined in the tld_data.c file.
Definition: tld_data.c:537
unsigned short tld_end_offset
The end offset of the top-most top-level domain names.
Definition: tld_data.c:10272
unsigned short f_end_offset
The offset to the end of the array of next TLD levels.
Definition: tld_data.h:81

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly