FM

//usr/include UP

/*
 * Copyright(c) 2014-2018 Tim Ruehsen
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 * This file is part of libpsl.
 *
 * Header file for libpsl library routines
 *
 * Changelog
 * 20.03.2014  Tim Ruehsen  created
 *
 */

#ifndef LIBPSL_LIBPSL_H
#define LIBPSL_LIBPSL_H

#include <stdio.h>
#include <time.h>

#define PSL_VERSION "0.20.2"
#define PSL_VERSION_MAJOR 0
#define PSL_VERSION_MINOR 20
#define PSL_VERSION_PATCH 2
#define PSL_VERSION_NUMBER 0x001402

#ifndef PSL_API
#if defined BUILDING_PSL && HAVE_VISIBILITY
#  define PSL_API __attribute__ ((__visibility__("default")))
#elif defined BUILDING_PSL && defined _MSC_VER && !defined PSL_STATIC
#  define PSL_API __declspec(dllexport)
#elif defined _MSC_VER && !defined PSL_STATIC
#  define PSL_API __declspec(dllimport)
#else
#  define PSL_API
#endif
#endif

#ifdef  __cplusplus
extern "C" {
#endif

/* types for psl_is_public_suffix2() */
#define PSL_TYPE_ICANN        (1<<0)
#define PSL_TYPE_PRIVATE      (1<<1)
#define PSL_TYPE_NO_STAR_RULE (1<<2)
#define PSL_TYPE_ANY          (PSL_TYPE_ICANN | PSL_TYPE_PRIVATE)

/**
 * psl_error_t:
 * @PSL_SUCCESS: Successful return.
 * @PSL_ERR_INVALID_ARG: Invalid argument.
 * @PSL_ERR_CONVERTER: Failed to open libicu utf-16 converter.
 * @PSL_ERR_TO_UTF16: Failed to convert to utf-16.
 * @PSL_ERR_TO_LOWER: Failed to convert utf-16 to lowercase.
 * @PSL_ERR_TO_UTF8: Failed to convert utf-16 to utf-8.
 * @PSL_ERR_NO_MEM: Failed to allocate memory.
 *
 * Return codes for PSL functions.
 * Negative return codes mean failure.
 * Positive values are reserved for non-error return codes.
 */
typedef enum {
	PSL_SUCCESS = 0,
	PSL_ERR_INVALID_ARG = -1,
	PSL_ERR_CONVERTER = -2, /* failed to open libicu utf-16 converter */
	PSL_ERR_TO_UTF16 = -3,  /* failed to convert to utf-16 */
	PSL_ERR_TO_LOWER = -4,  /* failed to convert utf-16 to lowercase */
	PSL_ERR_TO_UTF8 = -5,   /* failed to convert utf-16 to utf-8 */
	PSL_ERR_NO_MEM = -6    /* failed to allocate memory */
} psl_error_t;

typedef struct _psl_ctx_st psl_ctx_t;

/* frees PSL context */
PSL_API
void
	psl_free(psl_ctx_t *psl);

/* frees memory allocated by libpsl routines */
PSL_API
void
	psl_free_string(char *str);

/* loads PSL data from file */
PSL_API
psl_ctx_t *
	psl_load_file(const char *fname);

/* loads PSL data from FILE pointer */
PSL_API
psl_ctx_t *
	psl_load_fp(FILE *fp);

/* retrieves builtin PSL data */
PSL_API
const psl_ctx_t *
	psl_builtin(void);

/* retrieves most recent PSL data */
PSL_API
psl_ctx_t *
	psl_latest(const char *fname);

/* checks whether domain is a public suffix or not */
PSL_API
int
	psl_is_public_suffix(const psl_ctx_t *psl, const char *domain);

/* checks whether domain is a public suffix regarding the type or not */
PSL_API
int
	psl_is_public_suffix2(const psl_ctx_t *psl, const char *domain, int type);

/* checks whether cookie_domain is acceptable for domain or not */
PSL_API
int
	psl_is_cookie_domain_acceptable(const psl_ctx_t *psl, const char *hostname, const char *cookie_domain);

/* returns the longest not registrable domain within 'domain' or NULL if none found */
PSL_API
const char *
	psl_unregistrable_domain(const psl_ctx_t *psl, const char *domain);

/* returns the shortest possible registrable domain part or NULL if domain is not registrable at all */
PSL_API
const char *
	psl_registrable_domain(const psl_ctx_t *psl, const char *domain);

/* convert a string into lowercase UTF-8 */
PSL_API
psl_error_t
	psl_str_to_utf8lower(const char *str, const char *encoding, const char *locale, char **lower);

/* does not include exceptions */
PSL_API
int
	psl_suffix_count(const psl_ctx_t *psl);

/* just counts exceptions */
PSL_API
int
	psl_suffix_exception_count(const psl_ctx_t *psl);

/* just counts wildcards */
PSL_API
int
	psl_suffix_wildcard_count(const psl_ctx_t *psl);

/* returns mtime of PSL source file */
PSL_API
time_t
	psl_builtin_file_time(void);

/* returns SHA1 checksum (hex-encoded, lowercase) of PSL source file */
PSL_API
const char *
	psl_builtin_sha1sum(void);

/* returns file name of PSL source file */
PSL_API
const char *
	psl_builtin_filename(void);

/* returns name of distribution PSL data file */
PSL_API
const char *
	psl_dist_filename(void);

/* returns library version string */
PSL_API
const char *
	psl_get_version(void);

/* checks library version number */
PSL_API
int
	psl_check_version_number(int version);

/* returns whether the built-in data is outdated or not */
PSL_API
int
	psl_builtin_outdated(void);

#ifdef  __cplusplus
}
#endif

#endif /* LIBPSL_LIBPSL_H */
FlexLexer.h6893V
GeoIP.h17835V
GeoIPCity.h2298V
a.out.h4350V
aio.h7456V
aliases.h2031V
alloca.h1203V
ar.h1730V
argp.h25414V
argz.h6050V
arpa-
asm-
asm-generic-
assert.h4561V
bits-
bsock-
byteswap.h1404V
c++-
com_err.h2118V
complex.h7163V
cpio.h2267V
cpuidle.h844V
criu-
crypt.h9118V
ctype.h10963V
curl-
dirent.h12484V
dlfcn.h7238V
drm-
elf.h174828V
endian.h3189V
envz.h2866V
err.h2209V
errno.h1678V
error.h2039V
et-
execinfo.h1522V
fcntl.h10958V
features.h16062V
fenv.h5857V
finclude-
fmtmsg.h3239V
fnmatch.h2295V
fpu_control.h3583V
fstab.h3111V
fts.h8372V
ftw.h5251V
gconv.h4410V
gdb-
gelf.h11406V
getopt.h1468V
glob.h6614V
gnu-
gnu-versions.h2342V
gnumake.h2912V
grp.h6686V
gshadow.h4528V
gssapi-
gssapi.h181V
gssrpc-
iconv.h1857V
idn2.h13891V
ieee754.h4910V
ifaddrs.h2840V
inttypes.h11892V
kadm5-
kdb.h69285V
keyutils.h7698V
krad.h8933V
krb5-
krb5.h402V
langinfo.h17848V
lastlog.h126V
lauxlib.h8628V
libelf.h20318V
libgen.h1385V
libintl.h4579V
liblsapi-sha1.h569V
libpsl.h5573V
libxml2-
limits.h5412V
link.h7218V
linux-
locale.h7674V
lsapidef.h4971V
lscapi.h25968V
lscapi_config.h599V
lua.h14833V
lua.hpp191V
luaconf-x86_64.h21614V
luaconf.h1655V
lualib.h1301V
lzma-
lzma.h9817V
malloc.h6102V
math.h53318V
mcheck.h2434V
memory.h955V
misc-
mntent.h3358V
monetary.h1803V
mqueue.h3759V
mtd-
mysql-
net-
netash-
netatalk-
netax25-
netdb.h28099V
neteconet-
netinet-
netipx-
netiucv-
netpacket-
netrom-
netrose-
nfs-
nghttp2-
nl_types.h1752V
nlist.h1601V
nss.h1878V
obstack.h21306V
openssl-
paths.h2977V
pcre2.h44802V
pcre2posix.h5804V
perf-
poll.h22V
printf.h6800V
proc_service.h3476V
profile.h12154V
protocols-
pthread.h41269V
pty.h1569V
pwd.h6158V
python2.7-
python3.11-
python3.6m-
python3.8-
rdma-
re_comp.h962V
regex.h24715V
regexp.h1447V
resolv.h12153V
rpc-
sched.h4732V
scsi-
search.h5223V
selinux-
semaphore.h2399V
sepol-
setjmp.h3669V
sgtty.h1343V
shadow.h5471V
signal.h12243V
sound-
spawn.h6690V
stab.h264V
stdc-predef.h2289V
stdint.h8469V
stdio.h30168V
stdio_ext.h2799V
stdlib.h35653V
string.h17587V
strings.h4752V
sys-
syscall.h25V
sysexits.h5232V
syslog.h24V
tar.h3785V
termio.h214V
termios.h3598V
tgmath.h31489V
thread_db.h16023V
threads.h6655V
time.h10360V
ttyent.h2494V
uchar.h2001V
ucontext.h2036V
ulimit.h1583V
unistd.h42738V
utime.h1501V
utmp.h3222V
utmpx.h4099V
values.h1955V
verto-module.h6640V
verto.h19437V
video-
wait.h22V
wchar.h31111V
wctype.h5548V
wordexp.h2501V
xen-
zbuff.h11500V
zconf.h16262V
zdict.h17203V
zlib.h96261V
zstd.h119972V
zstd_errors.h3751V
Blog - My Melon - Digital Marketing & Creative Agency
Skip to content Skip to footer