1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright (C) 2012 Igalia S.L.
4 */
5
6#ifndef __SOUP_TLD_H__
7#define __SOUP_TLD_H__
8
9#include <libsoup/soup-types.h>
10
11G_BEGIN_DECLS
12
13SOUP_AVAILABLE_IN_2_40
14const char *soup_tld_get_base_domain (const char *hostname,
15 GError **error);
16
17SOUP_AVAILABLE_IN_2_40
18gboolean soup_tld_domain_is_public_suffix (const char *domain);
19
20/* Errors */
21SOUP_AVAILABLE_IN_2_40
22GQuark soup_tld_error_quark (void);
23#define SOUP_TLD_ERROR soup_tld_error_quark()
24
25typedef enum {
26 SOUP_TLD_ERROR_INVALID_HOSTNAME,
27 SOUP_TLD_ERROR_IS_IP_ADDRESS,
28 SOUP_TLD_ERROR_NOT_ENOUGH_DOMAINS,
29 SOUP_TLD_ERROR_NO_BASE_DOMAIN,
30 SOUP_TLD_ERROR_NO_PSL_DATA,
31} SoupTLDError;
32
33G_END_DECLS
34
35#endif /* __SOUP_TLD_H__ */
36