FreeBSD Bugzilla – Attachment 176255 Details for
Bug 213870
cc: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
/tmp/url-25219c.c
url-25219c.c (text/plain), 813.76 KB, created by
dp.maxime
on 2016-10-29 00:46:39 UTC
(
hide
)
Description:
/tmp/url-25219c.c
Filename:
MIME Type:
Creator:
dp.maxime
Created:
2016-10-29 00:46:39 UTC
Size:
813.76 KB
patch
obsolete
># 1 "<built-in>" 1 ># 1 "url.c" 1 >/* Copyright (C) 2013 Maxim Zakharov. All rights reserved. > Copyright (C) 2003-2012 DataPark Ltd. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_common.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_common.h" 1 >/* Copyright (C) 2013-2016 Maxim Zakharov. All rights reserved. > Copyright (C) 2004-2012 DataPark Ltd. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_COMMON_H >#define _DPS_COMMON_H > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_config.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_config.h" 1 >/* include/dps_config.h. Generated from dps_config.h.in by configure. */ >/* include/dps_config.h.in. Generated automatically from configure.in by autoheader. */ >/* --- BEGIN 'top' portion of acconfig.h --- */ > >/* acconfig.h is here to make autoheader happy and smile. -kir */ > >#ifndef _DPS_CONFIG_H >#define _DPS_CONFIG_H > >#if defined(APACHE1) || defined(APACHE2) >#if 0 /* expanded by -frewrite-includes */ >#include "httpd.h" >#endif /* expanded by -frewrite-includes */ ># 12 "../include/dps_config.h" >#if 0 /* expanded by -frewrite-includes */ >#include "http_config.h" >#endif /* expanded by -frewrite-includes */ ># 13 "../include/dps_config.h" >#if 0 /* expanded by -frewrite-includes */ >#include "http_core.h" >#endif /* expanded by -frewrite-includes */ ># 14 "../include/dps_config.h" >#if 0 /* expanded by -frewrite-includes */ >#include "http_log.h" >#endif /* expanded by -frewrite-includes */ ># 15 "../include/dps_config.h" >#if 0 /* expanded by -frewrite-includes */ >#include "http_main.h" >#endif /* expanded by -frewrite-includes */ ># 16 "../include/dps_config.h" >#if 0 /* expanded by -frewrite-includes */ >#include "http_protocol.h" >#endif /* expanded by -frewrite-includes */ ># 17 "../include/dps_config.h" >#ifdef APACHE2 >#if 0 /* expanded by -frewrite-includes */ >#include "http_request.h" >#endif /* expanded by -frewrite-includes */ ># 19 "../include/dps_config.h" >#endif ># 20 "../include/dps_config.h" >#if 0 /* expanded by -frewrite-includes */ >#include "util_script.h" >#endif /* expanded by -frewrite-includes */ ># 21 "../include/dps_config.h" >#ifdef APACHE2 >#if 0 /* expanded by -frewrite-includes */ >#include "http_connection.h" >#endif /* expanded by -frewrite-includes */ ># 23 "../include/dps_config.h" >/*#include "apr_strings.h"*/ >#endif ># 25 "../include/dps_config.h" >#endif ># 26 "../include/dps_config.h" > >/* --- END 'top' portion of acconfig.h --- */ > >/* Define to empty if the keyword does not work. */ >/* #undef const */ > >/* Define to `int' if <sys/types.h> doesn't define. */ >/* #undef mode_t */ > >/* Define to `long' if <sys/types.h> doesn't define. */ >/* #undef off_t */ > >/* Define to `int' if <sys/types.h> doesn't define. */ >/* #undef pid_t */ > >/* Define as the return type of signal handlers (int or void). */ >#define RETSIGTYPE void > >/* Define to `unsigned' if <sys/types.h> doesn't define. */ >/* #undef size_t */ > >/* Define to 'long' if hasn't been defined. */ >#define HAVE_LONG_LONG_INT 1 > >/* Define if you have the ANSI C header files. */ >#define STDC_HEADERS 1 > >/* Define if your processor stores words with the most significant > byte first (like Motorola and SPARC, unlike Intel and VAX). */ >/* #undef WORDS_BIGENDIAN */ > >/* Define if you have tm_gmtoff in struct tm */ >#define HAVE_TM_GMTOFF 1 > >/* Define if you have POSIX type signal handling routines */ >#define HAVE_POSIX_SIGNALS 1 > >/* Define if you have union semun in sys/sem.h */ >#define HAVE_UNION_SEMUN 1 > >/* Define if you want to use syslog for logging indexer messages */ >/* #undef WITH_SYSLOG */ > >/* Define if you want tracing for debugging */ >/* #undef WITH_TRACE */ > >/* Define if you want Google-like grouping by site */ >/* #undef WITH_GOOGLEGRP */ > >/* Define if you want multi DBAddr support */ >/* #undef WITH_MULTIDBADDR */ > >/* Define what method of relevance calculation to be used. */ >#define FULL_RELEVANCE 1 >/* #undef FAST_RELEVANCE */ >/* #undef ULTRA_RELEVANCE */ > >/* Define what method of results sorting to be used. */ >#define HEAP_SORTING 1 >/* #undef QUICK_SORTING */ > >/* Define if you want to take hops into account for the Neo Popularity Rank calculation */ >/* #undef WITH_POPHOPS */ > >/* hops factor in the Neo Popularity Rank calculation */ >#define DPS_POPHOPS_FACTOR 0.1 > >/* Define if you want average word distance in relevancy calculation */ >#define WITH_REL_DISTANCE 1 > >/* Define if you want average word position in relevncy calculation */ >#define WITH_REL_POSITION 1 > >/* Define if you want word count in relevancy calculation */ >#define WITH_REL_WRDCOUNT 1 > >/* Define if you want to track relevance commands */ >/* #undef WITH_REL_TRACK */ > >/* best first word position for relevancy calculation */ >#define DPS_BEST_POSITION 13 > >/* best average word position for relevancy calculation */ >#define DPS_AVG_POSITION 390 > >/* best average distance between words for relevancy calculation */ >#define DPS_AVG_DISTANCE 20 > >/* best words count for relevancy calculation */ >#define DPS_BEST_WRD_CNT 30 > >/* word counts factor for relevancy calculation */ >#define DPS_WRD_CNT_FACTOR 3.5 > >/* word less counts factor for relevancy calculation */ >#define DPS_LESS_WRD_CNT_FACTOR 70.5 > >/* first word position factor for relevancy calculation */ >#define DPS_POSITION_FACTOR 1.5 > >/* first word less position factor for relevancy calculation */ >#define DPS_LESS_POSITION_FACTOR 0.31 > >/* first word distance factor for relevancy calculation */ >#define DPS_DISTANCE_FACTOR 25 > >/* first word less distance factor for relevancy calculation */ >#define DPS_LESS_DISTANCE_FACTOR 1.0 > >/* border value for non-uniform word count distribution in relevancy calculation */ >#define DPS_UNICNT_BORDER 10 > >/* non-uniform word count distribution factor for relevancy calculation */ >#define DPS_UNICNT_FACTOR 2000 > >/* non-uniform word less count distribution factor for relevancy calculation */ >#define DPS_LESS_UNICNT_FACTOR 20 > >/* Define if you want to use external parser */ >#define WITH_PARSER 1 > >/* Define if you want to use GNU libidn */ >#define WITH_IDN 1 > >/* Define if you want to use Solaris libidnkit */ >/* #undef WITH_IDNKIT */ > >/* Define if you want mp3 id3 tags support */ >#define WITH_MP3 1 > >/* Define if you want to support file:// URL schema */ >/* #undef WITH_FILE */ > >/* Define if you want to support http:// URL schema */ >#define WITH_HTTP 1 > >/* Define if you want to support https:// URL schema */ >/* #undef WITH_HTTPS */ > >/* Define if you want to support ftp:// URL schema */ >#define WITH_FTP 1 > >/* Define if you want to support news:// URL schema */ >/* #undef WITH_NEWS */ > >/* Define if you want to use MySQL */ >#define HAVE_DP_MYSQL 1 > >/* Define if you want to use PostgreSQL */ >#define HAVE_DP_PGSQL 1 > >/* Define if you want to use mSQL */ >/* #undef HAVE_DP_MSQL */ > >/* Define if you want to use iODBC */ >/* #undef HAVE_IODBC */ > >/* Define if you want to use unixODBC */ >/* #undef HAVE_UNIXODBC */ > >/* Define if you want to use IBM DB2 */ >/* #undef HAVE_DB2 */ > >/* Define if you want to use Solid SQL Server */ >/* #undef HAVE_SOLID */ > >/* Define if you want to use OpenLink ODBC (Virtuoso) */ >/* #undef HAVE_VIRT */ > >/* Define if you want to use EasySoft ODBC */ >/* #undef HAVE_EASYSOFT */ > >/* Define if you want to use SAPDB ODBC library */ >/* #undef HAVE_SAPDB */ > >/* Define if you want to use Interbase SQL Server */ >/* #undef HAVE_IBASE */ > >/* Define if you want to use CT-LIB SyBase SQL Server */ >/* #undef HAVE_CTLIB */ > >/* Define if you want to use sqlite */ >/* #undef HAVE_SQLITE */ > >/* Define if you want to use sqlite3 */ >/* #undef HAVE_SQLITE3 */ > >/* Define if you want to use Oracle 8 SQL Server */ >/* #undef HAVE_ORACLE8 */ > >/* Define if you want to use Oracle 7 SQL Server */ >/* #undef HAVE_ORACLE7 */ > >/* Define VERSION_ID */ >#define DPS_VERSION_ID 454 > >/* Define DPS_DBTYPE */ >#define DPS_DBTYPE "mysql-pqsql" > >/* Define if you havnt socklen_t type */ >/* #undef socklen_t */ > >/* Define if you want DMALLOC */ >/* #undef DMALLOC */ > >/* Define if you want Boehm's garbage collector support */ >/* #undef BOEHMGC */ > >/* Define if you want internal memory debugger based on Electric Fence 2.2 */ >/* #undef EFENCE */ > >/* Define if you want internal file handlers debugger */ >/* #undef FILENCE */ > >/* Define if you want HTTP Content Encoding support */ >#define HAVE_ZLIB 1 > >/* Define if you want readline support */ >/* #undef HAVE_READLINE */ > >/* Define if you want Chinese support */ >/* #undef HAVE_CHARSET_chinese */ > >/* Define if you want Japanese support */ >/* #undef HAVE_CHARSET_japanese */ > >/* Define if you want Korean euc-kr support */ >/* #undef HAVE_CHARSET_euc_kr */ > >/* Define if you want gujarati support */ >/* #undef HAVE_CHARSET_gujarati */ > >/* Define if you want tscii support */ >/* #undef HAVE_CHARSET_tscii */ > >/* Define if you want ChaSen support */ >/* #undef CHASEN */ > >/* Define if you want MeCab support */ >/* #undef MECAB */ > >/* The number of bytes in a char*. */ >#define SIZEOF_CHARP 8 > >/* The number of bytes in a void*. */ >#define SIZEOF_VOIDP 8 > >/* The number of bytes in a int. */ >#define SIZEOF_INT 4 > >/* The number of bytes in a long. */ >#define SIZEOF_LONG 8 > >/* The number of bytes in a long long. */ >#define SIZEOF_LONG_LONG 8 > >/* The number of bytes in a short. */ >#define SIZEOF_SHORT 2 > >/* Define if you have the bzero function. */ >#define HAVE_BZERO 1 > >/* Define if you have the hstrerror function. */ >#define HAVE_HSTRERROR 1 > >/* Define if you have timegm function */ >#define HAVE_TIMEGM 1 > >/* Define if you have the mergesort function. */ >#define HAVE_MERGESORT 1 > >/* Define if you have the heapsort function. */ >#define HAVE_HEAPSORT 1 > >/* Define if you have the putenv function. */ >#define HAVE_PUTENV 1 > >/* Define if you have the regcomp function. */ >#define HAVE_REGCOMP 1 > >/* Define if you have the setenv function. */ >#define HAVE_SETENV 1 > >/* Define if you have the setproctitle function. */ >#define HAVE_SETPROCTITLE 1 > >/* Define if you have the snprintf function. */ >#define HAVE_SNPRINTF 1 > >/* Define if you have the socket function. */ >#define HAVE_SOCKET 1 > >/* Define if you have the strcasecmp function. */ >#define HAVE_STRCASECMP 1 > >/* Define if you have the strcasestr function. */ >#define HAVE_STRCASESTR 1 > >/* Define if you have the strdup function. */ >#define HAVE_STRDUP 1 > >/* Define if you have the strncasecmp function. */ >#define HAVE_STRNCASECMP 1 > >/* Define if you have the strndup function. */ >#define HAVE_STRNDUP 1 > >/* Define if you have the strnlen function. */ >#define HAVE_STRNLEN 1 > >/* Define if you have the strstr function. */ >#define HAVE_STRSTR 1 > >/* Define if you have the strtok_r function. */ >#define HAVE_STRTOK_R 1 > >/* Define if you have the unsetenv function. */ >#define HAVE_UNSETENV 1 > >/* Define if you have the daemon function. */ >#define HAVE_DAEMON 1 > >/* Define if you have the vsnprintf function. */ >#define HAVE_VSNPRINTF 1 > >/* Define if you have the getaddrinfo function. */ >#define HAVE_GETADDRINFO 1 > >/* Define if you have the inet_net_pton function. */ >#define HAVE_INET_NET_PTON_PROTO 1 > >/* Define if you have strerror_r function. */ >#define HAVE_STRERROR_R 1 > >/* Define if you have gmtime_r function. */ >#define HAVE_GMTIME_R 1 > >/* Define to use the three-argument variant of gethostbyname_r */ >/* #undef HAVE_FUNC_GETHOSTBYNAME_R_3 */ > >/* Define to use the five-argument variant of gethostbyname_r */ >/* #undef HAVE_FUNC_GETHOSTBYNAME_R_5 */ > >/* Define to use the six-argument variant of gethostbyname_r */ >#define HAVE_FUNC_GETHOSTBYNAME_R_6 1 > >/* Define if you have the pthread_setconcurrency function. */ >#define HAVE_PTHREAD_SETCONCURRENCY_PROTO 1 > >/* Define if you have the pthread_tryjoin_np function. */ >/* #undef HAVE_PTHREAD_TRYJOIN_NP_PROTO */ > >/* Define if you have the thr_setconcurrency function. */ >/* #undef HAVE_THR_SETCONCURRENCY_PROTO */ > >/* Define if you have the <arpa/inet.h> header file. */ >#define HAVE_ARPA_INET_H 1 > >/* Define if you have the <arpa/nameser.h> header file. */ >#define HAVE_ARPA_NAMESER_H 1 > >/* Define if you have the <fcntl.h> header file. */ >#define HAVE_FCNTL_H 1 > >/* Define if you have the <getopt.h> header file. */ >/* #undef HAVE_GETOPT_H */ > >/* Define if you have the <libutil.h> header file. */ >#define HAVE_LIBUTIL_H 1 > >/* Define if you have the <libutil.h> header file. */ >#define HAVE_LIBUTIL_H 1 > >/* Define if you have the <bsd/libutil.h> header file. */ >/* #undef HAVE_BSD_LIBUTIL_H */ > >/* Define if you have the <netdb.h> header file. */ >#define HAVE_NETDB_H 1 > >/* Define if you have the <netinet/in.h> header file. */ >#define HAVE_NETINET_IN_H 1 > >/* Define if you have the <netinet/in_systm.h> header file. */ >#define HAVE_NETINET_IN_SYSTM_H 1 > >/* Define if you have the <netinet/ip.h> header file. */ >#define HAVE_NETINET_IP_H 1 > >/* Define if you have the <netinet/tcp.h> header file. */ >#define HAVE_NETINET_TCP_H 1 > >/* Define if you have the <resolv.h> header file. */ >#define HAVE_RESOLV_H 1 > >/* Define if you have the <select.h> header file. */ >/* #undef HAVE_SELECT_H */ > >/* Define if you have the <sched.h> header file. */ >#define HAVE_SCHED_H 1 > >/* Define if you have the <sys/ioctl.h> header file. */ >#define HAVE_SYS_IOCTL_H 1 > >/* Define if you have the <sys/mman.h> header file. */ >#define HAVE_SYS_MMAN_H 1 > >/* Define if you have Posix style shared memory interface */ >#define HAVE_SHAREDMEM_POSIX 1 > >/* Define if you have the <sys/shm.h> header file. */ >#define HAVE_SYS_SHM_H 1 > >/* Define if you have SysV style shared memory interface */ >/* #undef HAVE_SHAREDMEM_SYSV */ > >/* Define if you have the <sys/msg.h> header file. */ >#define HAVE_SYS_MSG_H 1 > >#if 0 >/* Define if you have the <semaphore.h> header file. */ >#define HAVE_SEMAPHORE_H 1 >#endif ># 448 "../include/dps_config.h" > >/* Define if you have the <sys/sem.h> header file. */ >#define HAVE_SYS_SEM_H 1 > >#ifndef HAVE_SYS_SEM_H >/* Define if you have the <semaphore.h> header file. */ >#define HAVE_SEMAPHORE_H 1 >#endif ># 456 "../include/dps_config.h" > > >/* Define if you have the <sys/ipc.h> header file. */ >#define HAVE_SYS_IPC_H 1 > >/* Define if you have the <sys/param.h> header file. */ >#define HAVE_SYS_PARAM_H 1 > >/* Define if you have the <sys/select.h> header file. */ >#define HAVE_SYS_SELECT_H 1 > >/* Define if you have the <sys/socket.h> header file. */ >#define HAVE_SYS_SOCKET_H 1 > >/* Define if you have the <sys/un.h> header file. */ >#define HAVE_SYS_UN_H 1 > >/* Define if you have the <sys/time.h> header file. */ >#define HAVE_SYS_TIME_H 1 > >/* Define if you have the <sys/times.h> header file. */ >#define HAVE_SYS_TIMES_H 1 > >/* Define if you have the <sys/wait.h> header file. */ >#define HAVE_SYS_WAIT_H 1 > >/* Define if you have the <sys/sysctl.h> header file. */ >#define HAVE_SYS_SYSCTL_H 1 > >/* Define if you have the <tre/regex.h> header file. */ >/* #undef HAVE_TRE_REGEX_H */ > >/* Define if you have the <syslog.h> header file. */ >#define HAVE_SYSLOG_H 1 > >/* Define if you have the <unistd.h> header file. */ >#define HAVE_UNISTD_H 1 > >/* Define if you have the <bsd/unistd.h> header file. */ >/* #undef HAVE_BSD_UNISTD_H */ > >/* Define if you have the <bsd/stdlib.h> header file. */ >/* #undef HAVE_BSD_STDLIB_H */ > >/* Define if you have the <limits.h> header file. */ >#define HAVE_LIMITS_H 1 > >/* Define if you have the nsl library (-lnsl). */ >/* #undef HAVE_LIBNSL */ > >/* Define if you have the socket library (-lsocket). */ >/* #undef HAVE_LIBSOCKET */ > >/* Define if you have the bind library (-lbind) */ >/* #undef HAVE_LIBBIND */ > >/* Define if you have the dns library (-ldns) */ >/* #undef HAVE_LIBDNS */ > >/* Define if you have the ares library (-lares) */ >/* #undef HAVE_LIBARES */ > >/* Define if you have the c-ares library (-lcares) */ >#define HAVE_LIBCARES 1 > >/* Define if you have the aspell library (libaspell) */ >#define HAVE_ASPELL 1 > >/* Define if you have the libextractor library */ >/* #undef HAVE_LIBEXTRACTOR */ > >/* Name of package */ >#define PACKAGE "dpsearch" > >/* Version number of package */ >#ifndef VERSION >#define VERSION "4.54-2016-10-26" >#endif ># 534 "../include/dps_config.h" > >/* syslog facility */ >/* #undef LOG_FACILITY */ > >/* libparanoia usage */ >/* #undef WITH_PARANOIA */ > >#if defined(APACHE1) || defined(APACHE2) >/* cache mode version of mod_dpsearch */ >/* #undef APACHE_CACHEONLY */ >/* Apache 2.4.x or above */ >/* #undef APACHE2_4 */ >#endif ># 547 "../include/dps_config.h" > >/* Number of bits in a file offset, on hosts where this is settable. */ >/* #undef _FILE_OFFSET_BITS */ > >/* Define to enable large file support on some Linuxes, Red Hat 8.0, for example (e.g. glibc 2.2). */ >/* #undef _LARGEFILE_SOURCE */ > >/* Define for large files, on AIX-style hosts. */ >/* #undef _LARGE_FILES */ > > >/* --- BEGIN 'bottom' portion from acconfig.h --- */ > >/* ODBC Library */ >#if (HAVE_IODBC|| HAVE_UNIXODBC||HAVE_SOLID||HAVE_VIRT||HAVE_EASYSOFT||HAVE_SAPDB||HAVE_DB2) >#define HAVE_ODBC 1 >#endif ># 564 "../include/dps_config.h" > >/* Backend */ >#if (HAVE_ODBC||HAVE_DP_MYSQL||HAVE_DP_PGSQL||HAVE_DP_MSQL||HAVE_IBASE||HAVE_ORACLE8||HAVE_ORACLE7||HAVE_CTLIB||HAVE_SQLITE||HAVE_SQLITE3) && !defined(APACHE_CACHEONLY) >#define HAVE_SQL 1 >#endif ># 569 "../include/dps_config.h" > >#ifdef HAVE_PTHREAD >#if 0 /* expanded by -frewrite-includes */ >#include <pthread.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/pthread.h" 1 3 4 >/* > * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu > * Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au> > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. All advertising materials mentioning features or use of this software > * must display the following acknowledgement: > * This product includes software developed by Chris Provenzano. > * 4. The name of Chris Provenzano may not be used to endorse or promote > * products derived from this software without specific prior written > * permission. > * > * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY > * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/include/pthread.h 257113 2013-10-25 13:27:55Z tijl $ > */ >#ifndef _PTHREAD_H_ >#define _PTHREAD_H_ > >/* > * Header files. > */ >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/cdefs.h" 1 3 4 >/*- > * Copyright (c) 1991, 1993 > * The Regents of the University of California. All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * Berkeley Software Design, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 > * $FreeBSD: releng/10.3/sys/sys/cdefs.h 284948 2015-06-30 08:40:15Z tijl $ > */ > >#ifndef _SYS_CDEFS_H_ >#define _SYS_CDEFS_H_ > >/* > * Testing against Clang-specific extensions. > */ > >#ifndef __has_attribute >#define __has_attribute(x) 0 >#endif ># 46 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __has_extension >#define __has_extension __has_feature >#endif ># 49 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __has_feature >#define __has_feature(x) 0 >#endif ># 52 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __has_include >#define __has_include(x) 0 >#endif ># 55 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __has_builtin >#define __has_builtin(x) 0 >#endif ># 58 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__cplusplus) >#define __BEGIN_DECLS extern "C" { >#define __END_DECLS } >#else ># 63 "/usr/include/sys/cdefs.h" 3 4 >#define __BEGIN_DECLS >#define __END_DECLS >#endif ># 66 "/usr/include/sys/cdefs.h" 3 4 > >/* > * This code has been put in place to help reduce the addition of > * compiler specific defines in FreeBSD code. It helps to aid in > * having a compiler-agnostic source tree. > */ > >#if defined(__GNUC__) || defined(__INTEL_COMPILER) > >#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) >#define __GNUCLIKE_ASM 3 >#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS >#else ># 79 "/usr/include/sys/cdefs.h" 3 4 >#define __GNUCLIKE_ASM 2 >#endif ># 81 "/usr/include/sys/cdefs.h" 3 4 >#define __GNUCLIKE___TYPEOF 1 >#define __GNUCLIKE___OFFSETOF 1 >#define __GNUCLIKE___SECTION 1 > >#ifndef __INTEL_COMPILER ># define __GNUCLIKE_CTOR_SECTION_HANDLING 1 >#endif ># 88 "/usr/include/sys/cdefs.h" 3 4 > >#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 ># if defined(__INTEL_COMPILER) && defined(__cplusplus) \ > && __INTEL_COMPILER < 800 ># undef __GNUCLIKE_BUILTIN_CONSTANT_P ># endif ># 94 "/usr/include/sys/cdefs.h" 3 4 > >#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) ># define __GNUCLIKE_BUILTIN_VARARGS 1 ># define __GNUCLIKE_BUILTIN_STDARG 1 ># define __GNUCLIKE_BUILTIN_VAALIST 1 >#endif ># 100 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__GNUC__) ># define __GNUC_VA_LIST_COMPATIBILITY 1 >#endif ># 104 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Compiler memory barriers, specific to gcc and clang. > */ >#if defined(__GNUC__) >#define __compiler_membar() __asm __volatile(" " : : : "memory") >#endif ># 111 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __INTEL_COMPILER ># define __GNUCLIKE_BUILTIN_NEXT_ARG 1 ># define __GNUCLIKE_MATH_BUILTIN_RELOPS >#endif ># 116 "/usr/include/sys/cdefs.h" 3 4 > >#define __GNUCLIKE_BUILTIN_MEMCPY 1 > >/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ >#define __CC_SUPPORTS_INLINE 1 >#define __CC_SUPPORTS___INLINE 1 >#define __CC_SUPPORTS___INLINE__ 1 > >#define __CC_SUPPORTS___FUNC__ 1 >#define __CC_SUPPORTS_WARNING 1 > >#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ > >#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 > >#endif /* __GNUC__ || __INTEL_COMPILER */ ># 132 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Macro to test if we're using a specific version of gcc or later. > */ >#if defined(__GNUC__) && !defined(__INTEL_COMPILER) >#define __GNUC_PREREQ__(ma, mi) \ > (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) >#else ># 140 "/usr/include/sys/cdefs.h" 3 4 >#define __GNUC_PREREQ__(ma, mi) 0 >#endif ># 142 "/usr/include/sys/cdefs.h" 3 4 > >/* > * The __CONCAT macro is used to concatenate parts of symbol names, e.g. > * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. > * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI > * mode -- there must be no spaces between its arguments, and for nested > * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also > * concatenate double-quoted strings produced by the __STRING macro, but > * this only works with ANSI C. > * > * __XSTRING is like __STRING, but it expands any macros in its argument > * first. It is only available with ANSI C. > */ >#if defined(__STDC__) || defined(__cplusplus) >#define __P(protos) protos /* full-blown ANSI C */ >#define __CONCAT1(x,y) x ## y >#define __CONCAT(x,y) __CONCAT1(x,y) >#define __STRING(x) #x /* stringify without expanding x */ >#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ > >#define __const const /* define reserved names to standard */ >#define __signed signed >#define __volatile volatile >#if defined(__cplusplus) >#define __inline inline /* convert to C++ keyword */ >#else ># 168 "/usr/include/sys/cdefs.h" 3 4 >#if !(defined(__CC_SUPPORTS___INLINE)) >#define __inline /* delete GCC keyword */ >#endif /* ! __CC_SUPPORTS___INLINE */ ># 171 "/usr/include/sys/cdefs.h" 3 4 >#endif /* !__cplusplus */ ># 172 "/usr/include/sys/cdefs.h" 3 4 > >#else /* !(__STDC__ || __cplusplus) */ ># 174 "/usr/include/sys/cdefs.h" 3 4 >#define __P(protos) () /* traditional C preprocessor */ >#define __CONCAT(x,y) x/**/y >#define __STRING(x) "x" > >#if !defined(__CC_SUPPORTS___INLINE) >#define __const /* delete pseudo-ANSI C keywords */ >#define __inline >#define __signed >#define __volatile >/* > * In non-ANSI C environments, new programs will want ANSI-only C keywords > * deleted from the program and old programs will want them left alone. > * When using a compiler other than gcc, programs using the ANSI C keywords > * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. > * When using "gcc -traditional", we assume that this is the intent; if > * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. > */ >#ifndef NO_ANSI_KEYWORDS >#define const /* delete ANSI C keywords */ >#define inline >#define signed >#define volatile >#endif /* !NO_ANSI_KEYWORDS */ ># 197 "/usr/include/sys/cdefs.h" 3 4 >#endif /* !__CC_SUPPORTS___INLINE */ ># 198 "/usr/include/sys/cdefs.h" 3 4 >#endif /* !(__STDC__ || __cplusplus) */ ># 199 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Compiler-dependent macros to help declare dead (non-returning) and > * pure (no side effects) functions, and unused variables. They are > * null except for versions of gcc that are known to support the features > * properly (old versions of gcc-2 supported the dead and pure features > * in a different (wrong) way). If we do not provide an implementation > * for a given compiler, let the compile fail if it is told to use > * a feature that we cannot live without. > */ >#ifdef lint >#define __dead2 >#define __pure2 >#define __unused >#define __packed >#define __aligned(x) >#define __section(x) >#define __weak_symbol >#else ># 218 "/usr/include/sys/cdefs.h" 3 4 >#define __weak_symbol __attribute__((__weak__)) >#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) >#define __dead2 >#define __pure2 >#define __unused >#endif ># 224 "/usr/include/sys/cdefs.h" 3 4 >#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) >#define __dead2 __attribute__((__noreturn__)) >#define __pure2 __attribute__((__const__)) >#define __unused >/* XXX Find out what to do for __packed, __aligned and __section */ >#endif ># 230 "/usr/include/sys/cdefs.h" 3 4 >#if __GNUC_PREREQ__(2, 7) >#define __dead2 __attribute__((__noreturn__)) >#define __pure2 __attribute__((__const__)) >#define __unused __attribute__((__unused__)) >#define __used __attribute__((__used__)) >#define __packed __attribute__((__packed__)) >#define __aligned(x) __attribute__((__aligned__(x))) >#define __section(x) __attribute__((__section__(x))) >#endif ># 239 "/usr/include/sys/cdefs.h" 3 4 >#if defined(__INTEL_COMPILER) >#define __dead2 __attribute__((__noreturn__)) >#define __pure2 __attribute__((__const__)) >#define __unused __attribute__((__unused__)) >#define __used __attribute__((__used__)) >#define __packed __attribute__((__packed__)) >#define __aligned(x) __attribute__((__aligned__(x))) >#define __section(x) __attribute__((__section__(x))) >#endif ># 248 "/usr/include/sys/cdefs.h" 3 4 >#endif /* lint */ ># 249 "/usr/include/sys/cdefs.h" 3 4 > >#if !__GNUC_PREREQ__(2, 95) >#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) >#endif ># 253 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Keywords added in C11. > */ > >#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint) > >#if !__has_extension(c_alignas) >#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ > __has_extension(cxx_alignas) >#define _Alignas(x) alignas(x) >#else ># 265 "/usr/include/sys/cdefs.h" 3 4 >/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */ >#define _Alignas(x) __aligned(x) >#endif ># 268 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 269 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__cplusplus) && __cplusplus >= 201103L >#define _Alignof(x) alignof(x) >#else ># 273 "/usr/include/sys/cdefs.h" 3 4 >#define _Alignof(x) __alignof(x) >#endif ># 275 "/usr/include/sys/cdefs.h" 3 4 > >#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) >/* > * No native support for _Atomic(). Place object in structure to prevent > * most forms of direct non-atomic access. > */ >#define _Atomic(T) struct { T volatile __val; } >#endif ># 283 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__cplusplus) && __cplusplus >= 201103L >#define _Noreturn [[noreturn]] >#else ># 287 "/usr/include/sys/cdefs.h" 3 4 >#define _Noreturn __dead2 >#endif ># 289 "/usr/include/sys/cdefs.h" 3 4 > >#if !__has_extension(c_static_assert) >#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ > __has_extension(cxx_static_assert) >#define _Static_assert(x, y) static_assert(x, y) >#elif defined(__COUNTER__) ># 295 "/usr/include/sys/cdefs.h" 3 4 >#define _Static_assert(x, y) __Static_assert(x, __COUNTER__) >#define __Static_assert(x, y) ___Static_assert(x, y) >#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] \ > __unused >#else ># 300 "/usr/include/sys/cdefs.h" 3 4 >#define _Static_assert(x, y) struct __hack >#endif ># 302 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 303 "/usr/include/sys/cdefs.h" 3 4 > >#if !__has_extension(c_thread_local) >/* XXX: Change this to test against C++11 when clang in base supports it. */ >#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ > __has_extension(cxx_thread_local) >#define _Thread_local thread_local >#else ># 310 "/usr/include/sys/cdefs.h" 3 4 >#define _Thread_local __thread >#endif ># 312 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 313 "/usr/include/sys/cdefs.h" 3 4 > >#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */ ># 315 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Emulation of C11 _Generic(). Unlike the previously defined C11 > * keywords, it is not possible to implement this using exactly the same > * syntax. Therefore implement something similar under the name > * __generic(). Unlike _Generic(), this macro can only distinguish > * between a single type, so it requires nested invocations to > * distinguish multiple cases. > */ > >#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L >#define __generic(expr, t, yes, no) \ > _Generic(expr, t: yes, default: no) >#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) ># 329 "/usr/include/sys/cdefs.h" 3 4 >#define __generic(expr, t, yes, no) \ > __builtin_choose_expr( \ > __builtin_types_compatible_p(__typeof(expr), t), yes, no) >#endif ># 333 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(2, 96) >#define __malloc_like __attribute__((__malloc__)) >#define __pure __attribute__((__pure__)) >#else ># 338 "/usr/include/sys/cdefs.h" 3 4 >#define __malloc_like >#define __pure >#endif ># 341 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) >#define __always_inline __attribute__((__always_inline__)) >#else ># 345 "/usr/include/sys/cdefs.h" 3 4 >#define __always_inline >#endif ># 347 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(3, 1) >#define __noinline __attribute__ ((__noinline__)) >#else ># 351 "/usr/include/sys/cdefs.h" 3 4 >#define __noinline >#endif ># 353 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(3, 3) >#define __nonnull(x) __attribute__((__nonnull__(x))) >#else ># 357 "/usr/include/sys/cdefs.h" 3 4 >#define __nonnull(x) >#endif ># 359 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(3, 4) >#define __fastcall __attribute__((__fastcall__)) >#define __result_use_check __attribute__((__warn_unused_result__)) >#else ># 364 "/usr/include/sys/cdefs.h" 3 4 >#define __fastcall >#define __result_use_check >#endif ># 367 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(4, 1) >#define __returns_twice __attribute__((__returns_twice__)) >#else ># 371 "/usr/include/sys/cdefs.h" 3 4 >#define __returns_twice >#endif ># 373 "/usr/include/sys/cdefs.h" 3 4 > >/* XXX: should use `#if __STDC_VERSION__ < 199901'. */ >#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) >#define __func__ NULL >#endif ># 378 "/usr/include/sys/cdefs.h" 3 4 > >#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 >#define __LONG_LONG_SUPPORTED >#endif ># 382 "/usr/include/sys/cdefs.h" 3 4 > >/* C++11 exposes a load of C99 stuff */ >#if defined(__cplusplus) && __cplusplus >= 201103L >#define __LONG_LONG_SUPPORTED >#ifndef __STDC_LIMIT_MACROS >#define __STDC_LIMIT_MACROS >#endif ># 389 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __STDC_CONSTANT_MACROS >#define __STDC_CONSTANT_MACROS >#endif ># 392 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 393 "/usr/include/sys/cdefs.h" 3 4 > >/* > * GCC 2.95 provides `__restrict' as an extension to C90 to support the > * C99-specific `restrict' type qualifier. We happen to use `__restrict' as > * a way to define the `restrict' type qualifier without disturbing older > * software that is unaware of C99 keywords. > */ >#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) >#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint) >#define __restrict >#else ># 404 "/usr/include/sys/cdefs.h" 3 4 >#define __restrict restrict >#endif ># 406 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 407 "/usr/include/sys/cdefs.h" 3 4 > >/* > * GNU C version 2.96 adds explicit branch prediction so that > * the CPU back-end can hint the processor and also so that > * code blocks can be reordered such that the predicted path > * sees a more linear flow, thus improving cache behavior, etc. > * > * The following two macros provide us with a way to utilize this > * compiler feature. Use __predict_true() if you expect the expression > * to evaluate to true, and __predict_false() if you expect the > * expression to evaluate to false. > * > * A few notes about usage: > * > * * Generally, __predict_false() error condition checks (unless > * you have some _strong_ reason to do otherwise, in which case > * document it), and/or __predict_true() `no-error' condition > * checks, assuming you want to optimize for the no-error case. > * > * * Other than that, if you don't know the likelihood of a test > * succeeding from empirical or other `hard' evidence, don't > * make predictions. > * > * * These are meant to be used in places that are run `a lot'. > * It is wasteful to make predictions in code that is run > * seldomly (e.g. at subsystem initialization time) as the > * basic block reordering that this affects can often generate > * larger code. > */ >#if __GNUC_PREREQ__(2, 96) >#define __predict_true(exp) __builtin_expect((exp), 1) >#define __predict_false(exp) __builtin_expect((exp), 0) >#else ># 440 "/usr/include/sys/cdefs.h" 3 4 >#define __predict_true(exp) (exp) >#define __predict_false(exp) (exp) >#endif ># 443 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(4, 0) >#define __hidden __attribute__((__visibility__("hidden"))) >#define __exported __attribute__((__visibility__("default"))) >#else ># 448 "/usr/include/sys/cdefs.h" 3 4 >#define __hidden >#define __exported >#endif ># 451 "/usr/include/sys/cdefs.h" 3 4 > >/* > * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> > * require it. > */ >#if __GNUC_PREREQ__(4, 1) >#define __offsetof(type, field) __builtin_offsetof(type, field) >#else ># 459 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __cplusplus >#define __offsetof(type, field) \ > ((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field)) >#else ># 463 "/usr/include/sys/cdefs.h" 3 4 >#define __offsetof(type, field) \ > (__offsetof__ (reinterpret_cast <__size_t> \ > (&reinterpret_cast <const volatile char &> \ > (static_cast<type *> (0)->field)))) >#endif ># 468 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 469 "/usr/include/sys/cdefs.h" 3 4 >#define __rangeof(type, start, end) \ > (__offsetof(type, end) - __offsetof(type, start)) > >/* > * Given the pointer x to the member m of the struct s, return > * a pointer to the containing structure. When using GCC, we first > * assign pointer x to a local variable, to check that its type is > * compatible with member m. > */ >#if __GNUC_PREREQ__(3, 1) >#define __containerof(x, s, m) ({ \ > const volatile __typeof(((s *)0)->m) *__x = (x); \ > __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ >}) >#else ># 484 "/usr/include/sys/cdefs.h" 3 4 >#define __containerof(x, s, m) \ > __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) >#endif ># 487 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Compiler-dependent macros to declare that functions take printf-like > * or scanf-like arguments. They are null except for versions of gcc > * that are known to support the features properly (old versions of gcc-2 > * didn't permit keeping the keywords out of the application namespace). > */ >#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) >#define __printflike(fmtarg, firstvararg) >#define __scanflike(fmtarg, firstvararg) >#define __format_arg(fmtarg) >#define __strfmonlike(fmtarg, firstvararg) >#define __strftimelike(fmtarg, firstvararg) >#else ># 501 "/usr/include/sys/cdefs.h" 3 4 >#define __printflike(fmtarg, firstvararg) \ > __attribute__((__format__ (__printf__, fmtarg, firstvararg))) >#define __scanflike(fmtarg, firstvararg) \ > __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) >#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg))) >#define __strfmonlike(fmtarg, firstvararg) \ > __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) >#define __strftimelike(fmtarg, firstvararg) \ > __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) >#endif ># 511 "/usr/include/sys/cdefs.h" 3 4 > >/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ >#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ > defined(__GNUC__) && !defined(__INTEL_COMPILER) >#define __printf0like(fmtarg, firstvararg) \ > __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) >#else ># 518 "/usr/include/sys/cdefs.h" 3 4 >#define __printf0like(fmtarg, firstvararg) >#endif ># 520 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__GNUC__) || defined(__INTEL_COMPILER) >#ifndef __INTEL_COMPILER >#define __strong_reference(sym,aliassym) \ > extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) >#endif ># 526 "/usr/include/sys/cdefs.h" 3 4 >#ifdef __STDC__ >#define __weak_reference(sym,alias) \ > __asm__(".weak " #alias); \ > __asm__(".equ " #alias ", " #sym) >#define __warn_references(sym,msg) \ > __asm__(".section .gnu.warning." #sym); \ > __asm__(".asciz \"" msg "\""); \ > __asm__(".previous") >#define __sym_compat(sym,impl,verid) \ > __asm__(".symver " #impl ", " #sym "@" #verid) >#define __sym_default(sym,impl,verid) \ > __asm__(".symver " #impl ", " #sym "@@" #verid) >#else ># 539 "/usr/include/sys/cdefs.h" 3 4 >#define __weak_reference(sym,alias) \ > __asm__(".weak alias"); \ > __asm__(".equ alias, sym") >#define __warn_references(sym,msg) \ > __asm__(".section .gnu.warning.sym"); \ > __asm__(".asciz \"msg\""); \ > __asm__(".previous") >#define __sym_compat(sym,impl,verid) \ > __asm__(".symver impl, sym@verid") >#define __sym_default(impl,sym,verid) \ > __asm__(".symver impl, sym@@verid") >#endif /* __STDC__ */ ># 551 "/usr/include/sys/cdefs.h" 3 4 >#endif /* __GNUC__ || __INTEL_COMPILER */ ># 552 "/usr/include/sys/cdefs.h" 3 4 > >#define __GLOBL1(sym) __asm__(".globl " #sym) >#define __GLOBL(sym) __GLOBL1(sym) > >#if defined(__GNUC__) || defined(__INTEL_COMPILER) >#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") >#else ># 559 "/usr/include/sys/cdefs.h" 3 4 >/* > * The following definition might not work well if used in header files, > * but it should be better than nothing. If you want a "do nothing" > * version, then it should generate some harmless declaration, such as: > * #define __IDSTRING(name,string) struct __hack > */ >#define __IDSTRING(name,string) static const char name[] __unused = string >#endif ># 567 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Embed the rcs id of a source file in the resulting library. Note that in > * more recent ELF binutils, we use .ident allowing the ID to be stripped. > * Usage: > * __FBSDID("$FreeBSD: releng/10.3/sys/sys/cdefs.h 284948 2015-06-30 08:40:15Z tijl $"); > */ >#ifndef __FBSDID >#if !defined(lint) && !defined(STRIP_FBSDID) >#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) >#else ># 578 "/usr/include/sys/cdefs.h" 3 4 >#define __FBSDID(s) struct __hack >#endif ># 580 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 581 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __RCSID >#ifndef NO__RCSID >#define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) >#else ># 586 "/usr/include/sys/cdefs.h" 3 4 >#define __RCSID(s) struct __hack >#endif ># 588 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 589 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __RCSID_SOURCE >#ifndef NO__RCSID_SOURCE >#define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s) >#else ># 594 "/usr/include/sys/cdefs.h" 3 4 >#define __RCSID_SOURCE(s) struct __hack >#endif ># 596 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 597 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __SCCSID >#ifndef NO__SCCSID >#define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s) >#else ># 602 "/usr/include/sys/cdefs.h" 3 4 >#define __SCCSID(s) struct __hack >#endif ># 604 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 605 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __COPYRIGHT >#ifndef NO__COPYRIGHT >#define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s) >#else ># 610 "/usr/include/sys/cdefs.h" 3 4 >#define __COPYRIGHT(s) struct __hack >#endif ># 612 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 613 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __DECONST >#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var)) >#endif ># 617 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __DEVOLATILE >#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var)) >#endif ># 621 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __DEQUALIFY >#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) >#endif ># 625 "/usr/include/sys/cdefs.h" 3 4 > >/*- > * The following definitions are an extension of the behavior originally > * implemented in <sys/_posix.h>, but with a different level of granularity. > * POSIX.1 requires that the macros we test be defined before any standard > * header file is included. > * > * Here's a quick run-down of the versions: > * defined(_POSIX_SOURCE) 1003.1-1988 > * _POSIX_C_SOURCE == 1 1003.1-1990 > * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option > * _POSIX_C_SOURCE == 199309 1003.1b-1993 > * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, > * and the omnibus ISO/IEC 9945-1: 1996 > * _POSIX_C_SOURCE == 200112 1003.1-2001 > * _POSIX_C_SOURCE == 200809 1003.1-2008 > * > * In addition, the X/Open Portability Guide, which is now the Single UNIX > * Specification, defines a feature-test macro which indicates the version of > * that specification, and which subsumes _POSIX_C_SOURCE. > * > * Our macros begin with two underscores to avoid namespace screwage. > */ > >/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ >#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 >#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ >#define _POSIX_C_SOURCE 199009 >#endif ># 654 "/usr/include/sys/cdefs.h" 3 4 > >/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ >#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 >#undef _POSIX_C_SOURCE >#define _POSIX_C_SOURCE 199209 >#endif ># 660 "/usr/include/sys/cdefs.h" 3 4 > >/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ >#ifdef _XOPEN_SOURCE >#if _XOPEN_SOURCE - 0 >= 700 >#define __XSI_VISIBLE 700 >#undef _POSIX_C_SOURCE >#define _POSIX_C_SOURCE 200809 >#elif _XOPEN_SOURCE - 0 >= 600 ># 668 "/usr/include/sys/cdefs.h" 3 4 >#define __XSI_VISIBLE 600 >#undef _POSIX_C_SOURCE >#define _POSIX_C_SOURCE 200112 >#elif _XOPEN_SOURCE - 0 >= 500 ># 672 "/usr/include/sys/cdefs.h" 3 4 >#define __XSI_VISIBLE 500 >#undef _POSIX_C_SOURCE >#define _POSIX_C_SOURCE 199506 >#endif ># 676 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 677 "/usr/include/sys/cdefs.h" 3 4 > >/* > * Deal with all versions of POSIX. The ordering relative to the tests above is > * important. > */ >#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) >#define _POSIX_C_SOURCE 198808 >#endif ># 685 "/usr/include/sys/cdefs.h" 3 4 >#ifdef _POSIX_C_SOURCE >#if _POSIX_C_SOURCE >= 200809 >#define __POSIX_VISIBLE 200809 >#define __ISO_C_VISIBLE 1999 >#elif _POSIX_C_SOURCE >= 200112 ># 690 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 200112 >#define __ISO_C_VISIBLE 1999 >#elif _POSIX_C_SOURCE >= 199506 ># 693 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199506 >#define __ISO_C_VISIBLE 1990 >#elif _POSIX_C_SOURCE >= 199309 ># 696 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199309 >#define __ISO_C_VISIBLE 1990 >#elif _POSIX_C_SOURCE >= 199209 ># 699 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199209 >#define __ISO_C_VISIBLE 1990 >#elif _POSIX_C_SOURCE >= 199009 ># 702 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199009 >#define __ISO_C_VISIBLE 1990 >#else ># 705 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 198808 >#define __ISO_C_VISIBLE 0 >#endif /* _POSIX_C_SOURCE */ ># 708 "/usr/include/sys/cdefs.h" 3 4 >#else ># 709 "/usr/include/sys/cdefs.h" 3 4 >/*- > * Deal with _ANSI_SOURCE: > * If it is defined, and no other compilation environment is explicitly > * requested, then define our internal feature-test macros to zero. This > * makes no difference to the preprocessor (undefined symbols in preprocessing > * expressions are defined to have value zero), but makes it more convenient for > * a test program to print out the values. > * > * If a program mistakenly defines _ANSI_SOURCE and some other macro such as > * _POSIX_C_SOURCE, we will assume that it wants the broader compilation > * environment (and in fact we will never get here). > */ >#if defined(_ANSI_SOURCE) /* Hide almost everything. */ >#define __POSIX_VISIBLE 0 >#define __XSI_VISIBLE 0 >#define __BSD_VISIBLE 0 >#define __ISO_C_VISIBLE 1990 >#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ ># 727 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 0 >#define __XSI_VISIBLE 0 >#define __BSD_VISIBLE 0 >#define __ISO_C_VISIBLE 1999 >#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ ># 732 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 0 >#define __XSI_VISIBLE 0 >#define __BSD_VISIBLE 0 >#define __ISO_C_VISIBLE 2011 >#else /* Default environment: show everything. */ ># 737 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 200809 >#define __XSI_VISIBLE 700 >#define __BSD_VISIBLE 1 >#define __ISO_C_VISIBLE 2011 >#endif ># 742 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 743 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__mips) || defined(__powerpc64__) >#define __NO_TLS 1 >#endif ># 747 "/usr/include/sys/cdefs.h" 3 4 > >#endif /* !_SYS_CDEFS_H_ */ ># 749 "/usr/include/sys/cdefs.h" 3 4 ># 42 "/usr/include/pthread.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_pthreadtypes.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_pthreadtypes.h" 1 3 4 >/* > * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu > * Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au> > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. All advertising materials mentioning features or use of this software > * must display the following acknowledgement: > * This product includes software developed by Chris Provenzano. > * 4. The name of Chris Provenzano may not be used to endorse or promote > * products derived from this software without specific prior written > * permission. > * > * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY > * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/_pthreadtypes.h 189828 2009-03-14 20:10:14Z das $ > */ > >#ifndef _SYS__PTHREADTYPES_H_ >#define _SYS__PTHREADTYPES_H_ > >/* > * Forward structure definitions. > * > * These are mostly opaque to the user. > */ >struct pthread; >struct pthread_attr; >struct pthread_cond; >struct pthread_cond_attr; >struct pthread_mutex; >struct pthread_mutex_attr; >struct pthread_once; >struct pthread_rwlock; >struct pthread_rwlockattr; >struct pthread_barrier; >struct pthread_barrier_attr; >struct pthread_spinlock; > >/* > * Primitive system data type definitions required by P1003.1c. > * > * Note that P1003.1c specifies that there are no defined comparison > * or assignment operators for the types pthread_attr_t, pthread_cond_t, > * pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. > */ >#ifndef _PTHREAD_T_DECLARED >typedef struct pthread *pthread_t; >#define _PTHREAD_T_DECLARED >#endif ># 68 "/usr/include/sys/_pthreadtypes.h" 3 4 >typedef struct pthread_attr *pthread_attr_t; >typedef struct pthread_mutex *pthread_mutex_t; >typedef struct pthread_mutex_attr *pthread_mutexattr_t; >typedef struct pthread_cond *pthread_cond_t; >typedef struct pthread_cond_attr *pthread_condattr_t; >typedef int pthread_key_t; >typedef struct pthread_once pthread_once_t; >typedef struct pthread_rwlock *pthread_rwlock_t; >typedef struct pthread_rwlockattr *pthread_rwlockattr_t; >typedef struct pthread_barrier *pthread_barrier_t; >typedef struct pthread_barrierattr *pthread_barrierattr_t; >typedef struct pthread_spinlock *pthread_spinlock_t; > >/* > * Additional type definitions: > * > * Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for > * use in header symbols. > */ >typedef void *pthread_addr_t; >typedef void *(*pthread_startroutine_t)(void *); > >/* > * Once definitions. > */ >struct pthread_once { > int state; > pthread_mutex_t mutex; >}; > >#endif /* ! _SYS__PTHREADTYPES_H_ */ ># 99 "/usr/include/sys/_pthreadtypes.h" 3 4 ># 43 "/usr/include/pthread.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <machine/_limits.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/_limits.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/_limits.h 232262 2012-02-28 18:24:28Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/_limits.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/x86/_limits.h" 1 3 4 >/*- > * Copyright (c) 1988, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)limits.h 8.3 (Berkeley) 1/4/94 > * $FreeBSD: releng/10.3/sys/x86/include/_limits.h 235939 2012-05-24 21:44:46Z obrien $ > */ > >#ifndef _MACHINE__LIMITS_H_ >#define _MACHINE__LIMITS_H_ > >/* > * According to ANSI (section 2.2.4.2), the values below must be usable by > * #if preprocessing directives. Additionally, the expression must have the > * same type as would an expression that is an object of the corresponding > * type converted according to the integral promotions. The subtraction for > * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an > * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). > */ > >#define __CHAR_BIT 8 /* number of bits in a char */ > >#define __SCHAR_MAX 0x7f /* max value for a signed char */ >#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ > >#define __UCHAR_MAX 0xff /* max value for an unsigned char */ > >#define __USHRT_MAX 0xffff /* max value for an unsigned short */ >#define __SHRT_MAX 0x7fff /* max value for a short */ >#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */ > >#define __UINT_MAX 0xffffffff /* max value for an unsigned int */ >#define __INT_MAX 0x7fffffff /* max value for an int */ >#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ > >#ifdef __LP64__ >#define __ULONG_MAX 0xffffffffffffffff /* max for an unsigned long */ >#define __LONG_MAX 0x7fffffffffffffff /* max for a long */ >#define __LONG_MIN (-0x7fffffffffffffff - 1) /* min for a long */ >#else ># 65 "/usr/include/x86/_limits.h" 3 4 >#define __ULONG_MAX 0xffffffffUL >#define __LONG_MAX 0x7fffffffL >#define __LONG_MIN (-0x7fffffffL - 1) >#endif ># 69 "/usr/include/x86/_limits.h" 3 4 > > /* max value for an unsigned long long */ >#define __ULLONG_MAX 0xffffffffffffffffULL >#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ >#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ > >#ifdef __LP64__ >#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ >#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ >#define __OFF_MAX __LONG_MAX /* max value for an off_t */ >#define __OFF_MIN __LONG_MIN /* min value for an off_t */ >/* Quads and longs are the same on the amd64. Ensure they stay in sync. */ >#define __UQUAD_MAX __ULONG_MAX /* max value for a uquad_t */ >#define __QUAD_MAX __LONG_MAX /* max value for a quad_t */ >#define __QUAD_MIN __LONG_MIN /* min value for a quad_t */ >#define __LONG_BIT 64 >#else ># 86 "/usr/include/x86/_limits.h" 3 4 >#define __SSIZE_MAX __INT_MAX >#define __SIZE_T_MAX __UINT_MAX >#define __OFF_MAX __LLONG_MAX >#define __OFF_MIN __LLONG_MIN >#define __UQUAD_MAX __ULLONG_MAX >#define __QUAD_MAX __LLONG_MAX >#define __QUAD_MIN __LLONG_MIN >#define __LONG_BIT 32 >#endif ># 95 "/usr/include/x86/_limits.h" 3 4 > >#define __WORD_BIT 32 > >/* Minimum signal stack size. */ >#define __MINSIGSTKSZ (512 * 4) > >#endif /* !_MACHINE__LIMITS_H_ */ ># 102 "/usr/include/x86/_limits.h" 3 4 ># 7 "/usr/include/machine/_limits.h" 2 3 4 ># 44 "/usr/include/pthread.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <machine/_types.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/_types.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/_types.h 232261 2012-02-28 18:15:28Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/_types.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/x86/_types.h" 1 3 4 >/*- > * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> > * Copyright (c) 1990, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. All advertising materials mentioning features or use of this software > * must display the following acknowledgement: > * This product includes software developed by the University of > * California, Berkeley and its contributors. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 > * From: @(#)types.h 8.3 (Berkeley) 1/5/94 > * $FreeBSD: releng/10.3/sys/x86/include/_types.h 287139 2015-08-25 19:18:38Z jkim $ > */ > >#ifndef _MACHINE__TYPES_H_ >#define _MACHINE__TYPES_H_ > >#ifndef _SYS_CDEFS_H_ >#error this file needs sys/cdefs.h as a prerequisite >#endif ># 45 "/usr/include/x86/_types.h" 3 4 > >#define __NO_STRICT_ALIGNMENT > >/* > * Basic types upon which most other types are built. > */ >typedef signed char __int8_t; >typedef unsigned char __uint8_t; >typedef short __int16_t; >typedef unsigned short __uint16_t; >typedef int __int32_t; >typedef unsigned int __uint32_t; >#ifdef __LP64__ >typedef long __int64_t; >typedef unsigned long __uint64_t; >#else ># 61 "/usr/include/x86/_types.h" 3 4 >#ifndef lint >__extension__ >#endif ># 64 "/usr/include/x86/_types.h" 3 4 >/* LONGLONG */ >typedef long long __int64_t; >#ifndef lint >__extension__ >#endif ># 69 "/usr/include/x86/_types.h" 3 4 >/* LONGLONG */ >typedef unsigned long long __uint64_t; >#endif ># 72 "/usr/include/x86/_types.h" 3 4 > >/* > * Standard type definitions. > */ >#ifdef __LP64__ >typedef __int32_t __clock_t; /* clock()... */ >typedef __int64_t __critical_t; >typedef double __double_t; >typedef float __float_t; >typedef __int64_t __intfptr_t; >typedef __int64_t __intptr_t; >#else ># 84 "/usr/include/x86/_types.h" 3 4 >typedef unsigned long __clock_t; >typedef __int32_t __critical_t; >typedef long double __double_t; >typedef long double __float_t; >typedef __int32_t __intfptr_t; >typedef __int32_t __intptr_t; >#endif ># 91 "/usr/include/x86/_types.h" 3 4 >typedef __int64_t __intmax_t; >typedef __int32_t __int_fast8_t; >typedef __int32_t __int_fast16_t; >typedef __int32_t __int_fast32_t; >typedef __int64_t __int_fast64_t; >typedef __int8_t __int_least8_t; >typedef __int16_t __int_least16_t; >typedef __int32_t __int_least32_t; >typedef __int64_t __int_least64_t; >#ifdef __LP64__ >typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ >typedef __int64_t __register_t; >typedef __int64_t __segsz_t; /* segment size (in pages) */ >typedef __uint64_t __size_t; /* sizeof() */ >typedef __int64_t __ssize_t; /* byte count or error */ >typedef __int64_t __time_t; /* time()... */ >typedef __uint64_t __uintfptr_t; >typedef __uint64_t __uintptr_t; >#else ># 110 "/usr/include/x86/_types.h" 3 4 >typedef __int32_t __ptrdiff_t; >typedef __int32_t __register_t; >typedef __int32_t __segsz_t; >typedef __uint32_t __size_t; >typedef __int32_t __ssize_t; >typedef __int32_t __time_t; >typedef __uint32_t __uintfptr_t; >typedef __uint32_t __uintptr_t; >#endif ># 119 "/usr/include/x86/_types.h" 3 4 >typedef __uint64_t __uintmax_t; >typedef __uint32_t __uint_fast8_t; >typedef __uint32_t __uint_fast16_t; >typedef __uint32_t __uint_fast32_t; >typedef __uint64_t __uint_fast64_t; >typedef __uint8_t __uint_least8_t; >typedef __uint16_t __uint_least16_t; >typedef __uint32_t __uint_least32_t; >typedef __uint64_t __uint_least64_t; >#ifdef __LP64__ >typedef __uint64_t __u_register_t; >typedef __uint64_t __vm_offset_t; >typedef __uint64_t __vm_paddr_t; >typedef __uint64_t __vm_size_t; >#else ># 134 "/usr/include/x86/_types.h" 3 4 >typedef __uint32_t __u_register_t; >typedef __uint32_t __vm_offset_t; >#ifdef PAE >typedef __uint64_t __vm_paddr_t; >#else ># 139 "/usr/include/x86/_types.h" 3 4 >typedef __uint32_t __vm_paddr_t; >#endif ># 141 "/usr/include/x86/_types.h" 3 4 >typedef __uint32_t __vm_size_t; >#endif ># 143 "/usr/include/x86/_types.h" 3 4 >typedef __int64_t __vm_ooffset_t; >typedef __uint64_t __vm_pindex_t; >typedef int ___wchar_t; > >#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ >#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ > >/* > * Unusual type definitions. > */ >#ifdef __GNUCLIKE_BUILTIN_VARARGS >typedef __builtin_va_list __va_list; /* internally known to gcc */ >#else ># 156 "/usr/include/x86/_types.h" 3 4 >#ifdef __LP64__ >struct __s_va_list { > __uint32_t _pad1[2]; /* gp_offset, fp_offset */ > __uint64_t _pad2[2]; /* overflow_arg_area, reg_save_area */ >}; >typedef struct __s_va_list __va_list; >#else ># 163 "/usr/include/x86/_types.h" 3 4 >typedef char * __va_list; >#endif ># 165 "/usr/include/x86/_types.h" 3 4 >#endif ># 166 "/usr/include/x86/_types.h" 3 4 >#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ > && !defined(__NO_GNUC_VA_LIST) >#define __GNUC_VA_LIST >typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ >#endif ># 171 "/usr/include/x86/_types.h" 3 4 > >#endif /* !_MACHINE__TYPES_H_ */ ># 173 "/usr/include/x86/_types.h" 3 4 ># 7 "/usr/include/machine/_types.h" 2 3 4 ># 45 "/usr/include/pthread.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_sigset.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_sigset.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1989, 1991, 1993 > * The Regents of the University of California. All rights reserved. > * (c) UNIX System Laboratories, Inc. > * All or some portions of this file are derived from material licensed > * to the University of California by American Telephone and Telegraph > * Co. or Unix System Laboratories, Inc. and are reproduced herein with > * the permission of UNIX System Laboratories, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)signal.h 8.4 (Berkeley) 5/4/95 > * $FreeBSD: releng/10.3/sys/sys/_sigset.h 139825 2005-01-07 02:29:27Z imp $ > */ > >#ifndef _SYS__SIGSET_H_ >#define _SYS__SIGSET_H_ > >/* > * sigset_t macros. > */ >#define _SIG_WORDS 4 >#define _SIG_MAXSIG 128 >#define _SIG_IDX(sig) ((sig) - 1) >#define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5) >#define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31)) >#define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0) > >typedef struct __sigset { > __uint32_t __bits[_SIG_WORDS]; >} __sigset_t; > >#if defined(_KERNEL) && defined(COMPAT_43) >typedef unsigned int osigset_t; >#endif ># 58 "/usr/include/sys/_sigset.h" 3 4 > >#endif /* !_SYS__SIGSET_H_ */ ># 60 "/usr/include/sys/_sigset.h" 3 4 ># 46 "/usr/include/pthread.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sched.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sched.h" 1 3 4 >/*- > * Copyright (c) 1996, 1997 > * HD Associates, Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. All advertising materials mentioning features or use of this software > * must display the following acknowledgement: > * This product includes software developed by HD Associates, Inc > * and Jukka Antero Ukkonen. > * 4. Neither the name of the author nor the names of any co-contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > */ > >/*- > * Copyright (c) 2002-2008, Jeffrey Roberson <jeff@freebsd.org> > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice unmodified, this list of conditions, and the following > * disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/sched.h 253604 2013-07-24 09:45:31Z avg $ > */ > >#ifndef _SCHED_H_ >#define _SCHED_H_ > >#ifdef _KERNEL >/* > * General scheduling info. > * > * sched_load: > * Total runnable non-ithread threads in the system. > * > * sched_runnable: > * Runnable threads for this processor. > */ >int sched_load(void); >int sched_rr_interval(void); >int sched_runnable(void); > >/* > * Proc related scheduling hooks. > */ >void sched_exit(struct proc *p, struct thread *childtd); >void sched_fork(struct thread *td, struct thread *childtd); >void sched_fork_exit(struct thread *td); >void sched_class(struct thread *td, int class); >void sched_nice(struct proc *p, int nice); > >/* > * Threads are switched in and out, block on resources, have temporary > * priorities inherited from their procs, and use up cpu time. > */ >void sched_exit_thread(struct thread *td, struct thread *child); >void sched_fork_thread(struct thread *td, struct thread *child); >void sched_lend_prio(struct thread *td, u_char prio); >void sched_lend_user_prio(struct thread *td, u_char pri); >fixpt_t sched_pctcpu(struct thread *td); >void sched_prio(struct thread *td, u_char prio); >void sched_sleep(struct thread *td, int prio); >void sched_switch(struct thread *td, struct thread *newtd, int flags); >void sched_throw(struct thread *td); >void sched_unlend_prio(struct thread *td, u_char prio); >void sched_user_prio(struct thread *td, u_char prio); >void sched_userret(struct thread *td); >void sched_wakeup(struct thread *td); >void sched_preempt(struct thread *td); >#ifdef RACCT >#ifdef SCHED_4BSD >fixpt_t sched_pctcpu_delta(struct thread *td); >#endif ># 110 "/usr/include/sched.h" 3 4 >#endif ># 111 "/usr/include/sched.h" 3 4 > >/* > * Threads are moved on and off of run queues > */ >void sched_add(struct thread *td, int flags); >void sched_clock(struct thread *td); >void sched_rem(struct thread *td); >void sched_tick(int cnt); >void sched_relinquish(struct thread *td); >struct thread *sched_choose(void); >void sched_idletd(void *); > >/* > * Binding makes cpu affinity permanent while pinning is used to temporarily > * hold a thread on a particular CPU. > */ >void sched_bind(struct thread *td, int cpu); >static __inline void sched_pin(void); >void sched_unbind(struct thread *td); >static __inline void sched_unpin(void); >int sched_is_bound(struct thread *td); >void sched_affinity(struct thread *td); > >/* > * These procedures tell the process data structure allocation code how > * many bytes to actually allocate. > */ >int sched_sizeof_proc(void); >int sched_sizeof_thread(void); > >/* > * This routine provides a consistent thread name for use with KTR graphing > * functions. > */ >char *sched_tdname(struct thread *td); >#ifdef KTR >void sched_clear_tdname(struct thread *td); >#endif ># 149 "/usr/include/sched.h" 3 4 > >static __inline void >sched_pin(void) >{ > curthread->td_pinned++; > __compiler_membar(); >} > >static __inline void >sched_unpin(void) >{ > __compiler_membar(); > curthread->td_pinned--; >} > >/* sched_add arguments (formerly setrunqueue) */ >#define SRQ_BORING 0x0000 /* No special circumstances. */ >#define SRQ_YIELDING 0x0001 /* We are yielding (from mi_switch). */ >#define SRQ_OURSELF 0x0002 /* It is ourself (from mi_switch). */ >#define SRQ_INTR 0x0004 /* It is probably urgent. */ >#define SRQ_PREEMPTED 0x0008 /* has been preempted.. be kind */ >#define SRQ_BORROWING 0x0010 /* Priority updated due to prio_lend */ > >/* Scheduler stats. */ >#ifdef SCHED_STATS >DPCPU_DECLARE(long, sched_switch_stats[SWT_COUNT]); > >#define SCHED_STAT_DEFINE_VAR(name, ptr, descr) \ >static void name ## _add_proc(void *dummy __unused) \ >{ \ > \ > SYSCTL_ADD_PROC(NULL, \ > SYSCTL_STATIC_CHILDREN(_kern_sched_stats), OID_AUTO, \ > #name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \ > ptr, 0, sysctl_dpcpu_long, "LU", descr); \ >} \ >SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL); > >#define SCHED_STAT_DEFINE(name, descr) \ > DPCPU_DEFINE(unsigned long, name); \ > SCHED_STAT_DEFINE_VAR(name, &DPCPU_NAME(name), descr) >/* > * Sched stats are always incremented in critical sections so no atomic > * is necesssary to increment them. > */ >#define SCHED_STAT_INC(var) DPCPU_GET(var)++; >#else ># 196 "/usr/include/sched.h" 3 4 >#define SCHED_STAT_DEFINE_VAR(name, descr, ptr) >#define SCHED_STAT_DEFINE(name, descr) >#define SCHED_STAT_INC(var) (void)0 >#endif ># 200 "/usr/include/sched.h" 3 4 > >/* > * Fixup scheduler state for proc0 and thread0 > */ >void schedinit(void); >#endif /* _KERNEL */ ># 206 "/usr/include/sched.h" 3 4 > >/* POSIX 1003.1b Process Scheduling */ > >/* > * POSIX scheduling policies > */ >#define SCHED_FIFO 1 >#define SCHED_OTHER 2 >#define SCHED_RR 3 > >struct sched_param { > int sched_priority; >}; > >/* > * POSIX scheduling declarations for userland. > */ >#ifndef _KERNEL >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 225 "/usr/include/sched.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_types.h" 1 3 4 >/*- > * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/_types.h 255219 2013-09-05 00:09:56Z pjd $ > */ > >#ifndef _SYS__TYPES_H_ >#define _SYS__TYPES_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 33 "/usr/include/sys/_types.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <machine/_types.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/_types.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/_types.h 232261 2012-02-28 18:15:28Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/_types.h> >#endif /* expanded by -frewrite-includes */ ># 7 "/usr/include/machine/_types.h" 3 4 ># 34 "/usr/include/sys/_types.h" 2 3 4 > >/* > * Standard type definitions. > */ >typedef __uint32_t __blksize_t; /* file block size */ >typedef __int64_t __blkcnt_t; /* file block count */ >typedef __int32_t __clockid_t; /* clock_gettime()... */ >typedef __uint32_t __fflags_t; /* file flags */ >typedef __uint64_t __fsblkcnt_t; >typedef __uint64_t __fsfilcnt_t; >typedef __uint32_t __gid_t; >typedef __int64_t __id_t; /* can hold a gid_t, pid_t, or uid_t */ >typedef __uint32_t __ino_t; /* inode number */ >typedef long __key_t; /* IPC key (for Sys V IPC) */ >typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */ >typedef __uint16_t __mode_t; /* permissions */ >typedef int __accmode_t; /* access permissions */ >typedef int __nl_item; >typedef __uint16_t __nlink_t; /* link count */ >typedef __int64_t __off_t; /* file offset */ >typedef __int32_t __pid_t; /* process [group] */ >typedef __int64_t __rlim_t; /* resource limit - intentionally */ > /* signed, because of legacy code */ > /* that uses -1 for RLIM_INFINITY */ >typedef __uint8_t __sa_family_t; >typedef __uint32_t __socklen_t; >typedef long __suseconds_t; /* microseconds (signed) */ >typedef struct __timer *__timer_t; /* timer_gettime()... */ >typedef struct __mq *__mqd_t; /* mq_open()... */ >typedef __uint32_t __uid_t; >typedef unsigned int __useconds_t; /* microseconds (unsigned) */ >typedef int __cpuwhich_t; /* which parameter for cpuset. */ >typedef int __cpulevel_t; /* level parameter for cpuset. */ >typedef int __cpusetid_t; /* cpuset identifier. */ > >/* > * Unusual type definitions. > */ >/* > * rune_t is declared to be an ``int'' instead of the more natural > * ``unsigned long'' or ``long''. Two things are happening here. It is not > * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, > * it looks like 10646 will be a 31 bit standard. This means that if your > * ints cannot hold 32 bits, you will be in trouble. The reason an int was > * chosen over a long is that the is*() and to*() routines take ints (says > * ANSI C), but they use __ct_rune_t instead of int. > * > * NOTE: rune_t is not covered by ANSI nor other standards, and should not > * be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and > * rune_t must be the same type. Also, wint_t should be able to hold all > * members of the largest character set plus one extra value (WEOF), and > * must be at least 16 bits. > */ >typedef int __ct_rune_t; /* arg type for ctype funcs */ >typedef __ct_rune_t __rune_t; /* rune_t (see above) */ >typedef __ct_rune_t __wint_t; /* wint_t (see above) */ > >/* Clang already provides these types as built-ins, but only in C++ mode. */ >#if !defined(__clang__) || !defined(__cplusplus) >typedef __uint_least16_t __char16_t; >typedef __uint_least32_t __char32_t; >#endif ># 96 "/usr/include/sys/_types.h" 3 4 >/* In C++11, char16_t and char32_t are built-in types. */ >#if defined(__cplusplus) && __cplusplus >= 201103L >#define _CHAR16_T_DECLARED >#define _CHAR32_T_DECLARED >#endif ># 101 "/usr/include/sys/_types.h" 3 4 > >typedef __uint32_t __dev_t; /* device number */ > >typedef __uint32_t __fixpt_t; /* fixed point number */ > >/* > * mbstate_t is an opaque object to keep conversion state during multibyte > * stream conversions. > */ >typedef union { > char __mbstate8[128]; > __int64_t _mbstateL; /* for alignment */ >} __mbstate_t; > >#endif /* !_SYS__TYPES_H_ */ ># 116 "/usr/include/sys/_types.h" 3 4 ># 226 "/usr/include/sched.h" 2 3 4 > >#ifndef _PID_T_DECLARED >typedef __pid_t pid_t; >#define _PID_T_DECLARED >#endif ># 231 "/usr/include/sched.h" 3 4 > >struct timespec; > >__BEGIN_DECLS >int sched_get_priority_max(int); >int sched_get_priority_min(int); >int sched_getparam(pid_t, struct sched_param *); >int sched_getscheduler(pid_t); >int sched_rr_get_interval(pid_t, struct timespec *); >int sched_setparam(pid_t, const struct sched_param *); >int sched_setscheduler(pid_t, int, const struct sched_param *); >int sched_yield(void); >__END_DECLS > >#endif ># 246 "/usr/include/sched.h" 3 4 >#endif /* !_SCHED_H_ */ ># 247 "/usr/include/sched.h" 3 4 ># 47 "/usr/include/pthread.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <time.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/time.h" 1 3 4 >/* > * Copyright (c) 1989, 1993 > * The Regents of the University of California. All rights reserved. > * (c) UNIX System Laboratories, Inc. > * All or some portions of this file are derived from material licensed > * to the University of California by American Telephone and Telegraph > * Co. or Unix System Laboratories, Inc. and are reproduced herein with > * the permission of UNIX System Laboratories, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)time.h 8.3 (Berkeley) 1/21/94 > */ > >/* > * $FreeBSD: releng/10.3/include/time.h 245428 2013-01-14 18:01:19Z dim $ > */ > >#ifndef _TIME_H_ >#define _TIME_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 45 "/usr/include/time.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_null.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_null.h" 1 3 4 >/*- > * Copyright (c) 2003 Marcel Moolenaar > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/_null.h 228918 2011-12-27 21:36:31Z theraven $ > */ > >#ifndef NULL > >#if !defined(__cplusplus) >#define NULL ((void *)0) >#else ># 34 "/usr/include/sys/_null.h" 3 4 >#if __cplusplus >= 201103L >#define NULL nullptr >#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 ># 37 "/usr/include/sys/_null.h" 3 4 >#define NULL __null >#else ># 39 "/usr/include/sys/_null.h" 3 4 >#if defined(__LP64__) >#define NULL (0L) >#else ># 42 "/usr/include/sys/_null.h" 3 4 >#define NULL 0 >#endif /* __LP64__ */ ># 44 "/usr/include/sys/_null.h" 3 4 >#endif /* __GNUG__ */ ># 45 "/usr/include/sys/_null.h" 3 4 >#endif /* !__cplusplus */ ># 46 "/usr/include/sys/_null.h" 3 4 > >#endif ># 48 "/usr/include/sys/_null.h" 3 4 ># 46 "/usr/include/time.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 47 "/usr/include/time.h" 3 4 > >#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE >/* > * Frequency of the clock ticks reported by times(). Deprecated - use > * sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.) > */ >#define CLK_TCK 128 >#endif ># 55 "/usr/include/time.h" 3 4 > >/* Frequency of the clock ticks reported by clock(). */ >#define CLOCKS_PER_SEC 128 > >#ifndef _CLOCK_T_DECLARED >typedef __clock_t clock_t; >#define _CLOCK_T_DECLARED >#endif ># 63 "/usr/include/time.h" 3 4 > >#ifndef _TIME_T_DECLARED >typedef __time_t time_t; >#define _TIME_T_DECLARED >#endif ># 68 "/usr/include/time.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 73 "/usr/include/time.h" 3 4 > >#if __POSIX_VISIBLE >= 199309 >/* > * New in POSIX 1003.1b-1993. > */ >#ifndef _CLOCKID_T_DECLARED >typedef __clockid_t clockid_t; >#define _CLOCKID_T_DECLARED >#endif ># 82 "/usr/include/time.h" 3 4 > >#ifndef _TIMER_T_DECLARED >typedef __timer_t timer_t; >#define _TIMER_T_DECLARED >#endif ># 87 "/usr/include/time.h" 3 4 > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/timespec.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/timespec.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)time.h 8.5 (Berkeley) 5/4/95 > * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp > * $FreeBSD: releng/10.3/sys/sys/timespec.h 205792 2010-03-28 13:13:22Z ed $ > */ > >#ifndef _SYS_TIMESPEC_H_ >#define _SYS_TIMESPEC_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/sys/timespec.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_timespec.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_timespec.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)time.h 8.5 (Berkeley) 5/4/95 > * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp > * $FreeBSD: releng/10.3/sys/sys/_timespec.h 205792 2010-03-28 13:13:22Z ed $ > */ > >#ifndef _SYS__TIMESPEC_H_ >#define _SYS__TIMESPEC_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/sys/_timespec.h" 3 4 > >#ifndef _TIME_T_DECLARED >typedef __time_t time_t; >#define _TIME_T_DECLARED >#endif ># 43 "/usr/include/sys/_timespec.h" 3 4 > >struct timespec { > time_t tv_sec; /* seconds */ > long tv_nsec; /* and nanoseconds */ >}; > >#endif /* !_SYS__TIMESPEC_H_ */ ># 50 "/usr/include/sys/_timespec.h" 3 4 ># 39 "/usr/include/sys/timespec.h" 2 3 4 > >#if __BSD_VISIBLE >#define TIMEVAL_TO_TIMESPEC(tv, ts) \ > do { \ > (ts)->tv_sec = (tv)->tv_sec; \ > (ts)->tv_nsec = (tv)->tv_usec * 1000; \ > } while (0) >#define TIMESPEC_TO_TIMEVAL(tv, ts) \ > do { \ > (tv)->tv_sec = (ts)->tv_sec; \ > (tv)->tv_usec = (ts)->tv_nsec / 1000; \ > } while (0) > >#endif /* __BSD_VISIBLE */ ># 53 "/usr/include/sys/timespec.h" 3 4 > >/* > * Structure defined by POSIX.1b to be like a itimerval, but with > * timespecs. Used in the timer_*() system calls. > */ >struct itimerspec { > struct timespec it_interval; > struct timespec it_value; >}; > >#endif /* _SYS_TIMESPEC_H_ */ ># 64 "/usr/include/sys/timespec.h" 3 4 ># 89 "/usr/include/time.h" 2 3 4 >#endif /* __POSIX_VISIBLE >= 199309 */ ># 90 "/usr/include/time.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >#ifndef _PID_T_DECLARED >typedef __pid_t pid_t; >#define _PID_T_DECLARED >#endif ># 96 "/usr/include/time.h" 3 4 >#endif ># 97 "/usr/include/time.h" 3 4 > >/* These macros are also in sys/time.h. */ >#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 >#define CLOCK_REALTIME 0 >#ifdef __BSD_VISIBLE >#define CLOCK_VIRTUAL 1 >#define CLOCK_PROF 2 >#endif ># 105 "/usr/include/time.h" 3 4 >#define CLOCK_MONOTONIC 4 >#define CLOCK_UPTIME 5 /* FreeBSD-specific. */ >#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ >#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */ >#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */ >#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */ >#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */ >#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ >#define CLOCK_SECOND 13 /* FreeBSD-specific. */ >#define CLOCK_THREAD_CPUTIME_ID 14 >#define CLOCK_PROCESS_CPUTIME_ID 15 >#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */ ># 117 "/usr/include/time.h" 3 4 > >#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 >#if __BSD_VISIBLE >#define TIMER_RELTIME 0x0 /* relative timer */ >#endif ># 122 "/usr/include/time.h" 3 4 >#define TIMER_ABSTIME 0x1 /* absolute timer */ >#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */ ># 124 "/usr/include/time.h" 3 4 > >struct tm { > int tm_sec; /* seconds after the minute [0-60] */ > int tm_min; /* minutes after the hour [0-59] */ > int tm_hour; /* hours since midnight [0-23] */ > int tm_mday; /* day of the month [1-31] */ > int tm_mon; /* months since January [0-11] */ > int tm_year; /* years since 1900 */ > int tm_wday; /* days since Sunday [0-6] */ > int tm_yday; /* days since January 1 [0-365] */ > int tm_isdst; /* Daylight Savings Time flag */ > long tm_gmtoff; /* offset from UTC in seconds */ > char *tm_zone; /* timezone abbreviation */ >}; > >#if __POSIX_VISIBLE >extern char *tzname[]; >#endif ># 142 "/usr/include/time.h" 3 4 > >__BEGIN_DECLS >char *asctime(const struct tm *); >clock_t clock(void); >char *ctime(const time_t *); >double difftime(time_t, time_t); >/* XXX missing: getdate() */ >struct tm *gmtime(const time_t *); >struct tm *localtime(const time_t *); >time_t mktime(struct tm *); >size_t strftime(char * __restrict, size_t, const char * __restrict, > const struct tm * __restrict); >time_t time(time_t *); >#if __POSIX_VISIBLE >= 200112 >struct sigevent; >int timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict); >int timer_delete(timer_t); >int timer_gettime(timer_t, struct itimerspec *); >int timer_getoverrun(timer_t); >int timer_settime(timer_t, int, const struct itimerspec *__restrict, > struct itimerspec *__restrict); >#endif ># 164 "/usr/include/time.h" 3 4 >#if __POSIX_VISIBLE >void tzset(void); >#endif ># 167 "/usr/include/time.h" 3 4 > >#if __POSIX_VISIBLE >= 199309 >int clock_getres(clockid_t, struct timespec *); >int clock_gettime(clockid_t, struct timespec *); >int clock_settime(clockid_t, const struct timespec *); >/* XXX missing: clock_nanosleep() */ >int nanosleep(const struct timespec *, struct timespec *); >#endif /* __POSIX_VISIBLE >= 199309 */ ># 175 "/usr/include/time.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >int clock_getcpuclockid(pid_t, clockid_t *); >#endif ># 179 "/usr/include/time.h" 3 4 > >#if __POSIX_VISIBLE >= 199506 >char *asctime_r(const struct tm *, char *); >char *ctime_r(const time_t *, char *); >struct tm *gmtime_r(const time_t *, struct tm *); >struct tm *localtime_r(const time_t *, struct tm *); >#endif ># 186 "/usr/include/time.h" 3 4 > >#if __XSI_VISIBLE >char *strptime(const char * __restrict, const char * __restrict, > struct tm * __restrict); >#endif ># 191 "/usr/include/time.h" 3 4 > >#if __BSD_VISIBLE >char *timezone(int, int); /* XXX XSI conflict */ >void tzsetwall(void); >time_t timelocal(struct tm * const); >time_t timegm(struct tm * const); >#endif /* __BSD_VISIBLE */ ># 198 "/usr/include/time.h" 3 4 > >#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) >#if 0 /* expanded by -frewrite-includes */ >#include <xlocale/_time.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/xlocale/_time.h" 1 3 4 >/*- > * Copyright (c) 2011, 2012 The FreeBSD Foundation > * All rights reserved. > * > * This software was developed by David Chisnall under sponsorship from > * the FreeBSD Foundation. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/include/xlocale/_time.h 231673 2012-02-14 12:03:23Z theraven $ > */ > >#ifndef _LOCALE_T_DEFINED >#define _LOCALE_T_DEFINED >typedef struct _xlocale *locale_t; >#endif ># 36 "/usr/include/xlocale/_time.h" 3 4 > >/* > * This file is included from both locale.h and xlocale.h. We need to expose > * the declarations unconditionally if we are included from xlocale.h, but only > * if we are in POSIX2008 mode if included from locale.h. > */ >#ifndef _XLOCALE_LOCALE1_H >#define _XLOCALE_LOCALE1_H > >size_t strftime_l(char * __restrict, size_t, const char * __restrict, > const struct tm * __restrict, locale_t) __strftimelike(3, 0); > >#endif /* _XLOCALE_LOCALE1_H */ ># 49 "/usr/include/xlocale/_time.h" 3 4 > >#ifdef _XLOCALE_H_ >#ifndef _XLOCALE_LOCALE2_H >#define _XLOCALE_LOCALE2_H > >char *strptime_l(const char * __restrict, const char * __restrict, > struct tm * __restrict, locale_t); > >#endif /* _XLOCALE_LOCALE2_H */ ># 58 "/usr/include/xlocale/_time.h" 3 4 >#endif /* _XLOCALE_H_ */ ># 59 "/usr/include/xlocale/_time.h" 3 4 ># 201 "/usr/include/time.h" 2 3 4 >#endif ># 202 "/usr/include/time.h" 3 4 >__END_DECLS > >#endif /* !_TIME_H_ */ ># 205 "/usr/include/time.h" 3 4 ># 48 "/usr/include/pthread.h" 2 3 4 > >/* > * Run-time invariant values: > */ >#define PTHREAD_DESTRUCTOR_ITERATIONS 4 >#define PTHREAD_KEYS_MAX 256 >#define PTHREAD_STACK_MIN __MINSIGSTKSZ >#define PTHREAD_THREADS_MAX __ULONG_MAX >#define PTHREAD_BARRIER_SERIAL_THREAD -1 > >/* > * Flags for threads and thread attributes. > */ >#define PTHREAD_DETACHED 0x1 >#define PTHREAD_SCOPE_SYSTEM 0x2 >#define PTHREAD_INHERIT_SCHED 0x4 >#define PTHREAD_NOFLOAT 0x8 > >#define PTHREAD_CREATE_DETACHED PTHREAD_DETACHED >#define PTHREAD_CREATE_JOINABLE 0 >#define PTHREAD_SCOPE_PROCESS 0 >#define PTHREAD_EXPLICIT_SCHED 0 > >/* > * Flags for read/write lock attributes > */ >#define PTHREAD_PROCESS_PRIVATE 0 >#define PTHREAD_PROCESS_SHARED 1 > >/* > * Flags for cancelling threads > */ >#define PTHREAD_CANCEL_ENABLE 0 >#define PTHREAD_CANCEL_DISABLE 1 >#define PTHREAD_CANCEL_DEFERRED 0 >#define PTHREAD_CANCEL_ASYNCHRONOUS 2 >#define PTHREAD_CANCELED ((void *) 1) > >/* > * Flags for once initialization. > */ >#define PTHREAD_NEEDS_INIT 0 >#define PTHREAD_DONE_INIT 1 > >/* > * Static once initialization values. > */ >#define PTHREAD_ONCE_INIT { PTHREAD_NEEDS_INIT, NULL } > >/* > * Static initialization values. > */ >#define PTHREAD_MUTEX_INITIALIZER NULL >#define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP ((pthread_mutex_t)1) >#define PTHREAD_COND_INITIALIZER NULL >#define PTHREAD_RWLOCK_INITIALIZER NULL > >/* > * Default attribute arguments (draft 4, deprecated). > */ >#ifndef PTHREAD_KERNEL >#define pthread_condattr_default NULL >#define pthread_mutexattr_default NULL >#define pthread_attr_default NULL >#endif ># 113 "/usr/include/pthread.h" 3 4 > >#define PTHREAD_PRIO_NONE 0 >#define PTHREAD_PRIO_INHERIT 1 >#define PTHREAD_PRIO_PROTECT 2 > >/* > * Mutex types (Single UNIX Specification, Version 2, 1997). > * > * Note that a mutex attribute with one of the following types: > * > * PTHREAD_MUTEX_NORMAL > * PTHREAD_MUTEX_RECURSIVE > * > * will deviate from POSIX specified semantics. > */ >enum pthread_mutextype { > PTHREAD_MUTEX_ERRORCHECK = 1, /* Default POSIX mutex */ > PTHREAD_MUTEX_RECURSIVE = 2, /* Recursive mutex */ > PTHREAD_MUTEX_NORMAL = 3, /* No error checking */ > PTHREAD_MUTEX_ADAPTIVE_NP = 4, /* Adaptive mutex, spins briefly before blocking on lock */ > PTHREAD_MUTEX_TYPE_MAX >}; > >#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK > >struct _pthread_cleanup_info { > __uintptr_t pthread_cleanup_pad[8]; >}; > >/* > * Thread function prototype definitions: > */ >__BEGIN_DECLS >int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); >int pthread_attr_destroy(pthread_attr_t *); >int pthread_attr_getstack(const pthread_attr_t * __restrict, > void ** __restrict, size_t * __restrict); >int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); >int pthread_attr_getguardsize(const pthread_attr_t *, size_t *); >int pthread_attr_getstackaddr(const pthread_attr_t *, void **); >int pthread_attr_getdetachstate(const pthread_attr_t *, int *); >int pthread_attr_init(pthread_attr_t *); >int pthread_attr_setstacksize(pthread_attr_t *, size_t); >int pthread_attr_setguardsize(pthread_attr_t *, size_t); >int pthread_attr_setstack(pthread_attr_t *, void *, size_t); >int pthread_attr_setstackaddr(pthread_attr_t *, void *); >int pthread_attr_setdetachstate(pthread_attr_t *, int); >int pthread_barrier_destroy(pthread_barrier_t *); >int pthread_barrier_init(pthread_barrier_t *, > const pthread_barrierattr_t *, unsigned); >int pthread_barrier_wait(pthread_barrier_t *); >int pthread_barrierattr_destroy(pthread_barrierattr_t *); >int pthread_barrierattr_getpshared(const pthread_barrierattr_t *, > int *); >int pthread_barrierattr_init(pthread_barrierattr_t *); >int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); > >#define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ > { \ > struct _pthread_cleanup_info __cleanup_info__; \ > __pthread_cleanup_push_imp(cleanup_routine, cleanup_arg,\ > &__cleanup_info__); \ > { > >#define pthread_cleanup_pop(execute) \ > (void)0; \ > } \ > __pthread_cleanup_pop_imp(execute); \ > } > >int pthread_condattr_destroy(pthread_condattr_t *); >int pthread_condattr_getclock(const pthread_condattr_t *, > clockid_t *); >int pthread_condattr_getpshared(const pthread_condattr_t *, int *); >int pthread_condattr_init(pthread_condattr_t *); >int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); >int pthread_condattr_setpshared(pthread_condattr_t *, int); >int pthread_cond_broadcast(pthread_cond_t *); >int pthread_cond_destroy(pthread_cond_t *); >int pthread_cond_init(pthread_cond_t *, > const pthread_condattr_t *); >int pthread_cond_signal(pthread_cond_t *); >int pthread_cond_timedwait(pthread_cond_t *, > pthread_mutex_t *, const struct timespec *); >int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); >int pthread_create(pthread_t *, const pthread_attr_t *, > void *(*) (void *), void *); >int pthread_detach(pthread_t); >int pthread_equal(pthread_t, pthread_t); >void pthread_exit(void *) __dead2; >void *pthread_getspecific(pthread_key_t); >int pthread_getcpuclockid(pthread_t, clockid_t *); >int pthread_join(pthread_t, void **); >int pthread_key_create(pthread_key_t *, > void (*) (void *)); >int pthread_key_delete(pthread_key_t); >int pthread_mutexattr_init(pthread_mutexattr_t *); >int pthread_mutexattr_destroy(pthread_mutexattr_t *); >int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, > int *); >int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); >int pthread_mutexattr_settype(pthread_mutexattr_t *, int); >int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); >int pthread_mutex_destroy(pthread_mutex_t *); >int pthread_mutex_init(pthread_mutex_t *, > const pthread_mutexattr_t *); >int pthread_mutex_lock(pthread_mutex_t *); >int pthread_mutex_trylock(pthread_mutex_t *); >int pthread_mutex_timedlock(pthread_mutex_t *, > const struct timespec *); >int pthread_mutex_unlock(pthread_mutex_t *); >int pthread_once(pthread_once_t *, void (*) (void)); >int pthread_rwlock_destroy(pthread_rwlock_t *); >int pthread_rwlock_init(pthread_rwlock_t *, > const pthread_rwlockattr_t *); >int pthread_rwlock_rdlock(pthread_rwlock_t *); >int pthread_rwlock_timedrdlock(pthread_rwlock_t *, > const struct timespec *); >int pthread_rwlock_timedwrlock(pthread_rwlock_t *, > const struct timespec *); >int pthread_rwlock_tryrdlock(pthread_rwlock_t *); >int pthread_rwlock_trywrlock(pthread_rwlock_t *); >int pthread_rwlock_unlock(pthread_rwlock_t *); >int pthread_rwlock_wrlock(pthread_rwlock_t *); >int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); >int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, > int *); >int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, > int *); >int pthread_rwlockattr_init(pthread_rwlockattr_t *); >int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); >int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); >pthread_t pthread_self(void); >int pthread_setspecific(pthread_key_t, const void *); > >int pthread_spin_init(pthread_spinlock_t *, int); >int pthread_spin_destroy(pthread_spinlock_t *); >int pthread_spin_lock(pthread_spinlock_t *); >int pthread_spin_trylock(pthread_spinlock_t *); >int pthread_spin_unlock(pthread_spinlock_t *); >int pthread_cancel(pthread_t); >int pthread_setcancelstate(int, int *); >int pthread_setcanceltype(int, int *); >void pthread_testcancel(void); > >#if __BSD_VISIBLE >int pthread_getprio(pthread_t); >int pthread_setprio(pthread_t, int); >void pthread_yield(void); >#endif ># 263 "/usr/include/pthread.h" 3 4 > >int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, > int *); >int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, > int); >int pthread_mutex_getprioceiling(pthread_mutex_t *, int *); >int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *); > >int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *); >int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); > >int pthread_attr_getinheritsched(const pthread_attr_t *, int *); >int pthread_attr_getschedparam(const pthread_attr_t *, > struct sched_param *); >int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); >int pthread_attr_getscope(const pthread_attr_t *, int *); >int pthread_attr_setinheritsched(pthread_attr_t *, int); >int pthread_attr_setschedparam(pthread_attr_t *, > const struct sched_param *); >int pthread_attr_setschedpolicy(pthread_attr_t *, int); >int pthread_attr_setscope(pthread_attr_t *, int); >int pthread_getschedparam(pthread_t pthread, int *, > struct sched_param *); >int pthread_setschedparam(pthread_t, int, > const struct sched_param *); >#if __XSI_VISIBLE >int pthread_getconcurrency(void); >int pthread_setconcurrency(int); >#endif ># 292 "/usr/include/pthread.h" 3 4 > >void __pthread_cleanup_push_imp(void (*)(void *), void *, > struct _pthread_cleanup_info *); >void __pthread_cleanup_pop_imp(int); >__END_DECLS > >#endif ># 299 "/usr/include/pthread.h" 3 4 ># 572 "../include/dps_config.h" 2 >#endif ># 573 "../include/dps_config.h" > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/types.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1991, 1993, 1994 > * The Regents of the University of California. All rights reserved. > * (c) UNIX System Laboratories, Inc. > * All or some portions of this file are derived from material licensed > * to the University of California by American Telephone and Telegraph > * Co. or Unix System Laboratories, Inc. and are reproduced herein with > * the permission of UNIX System Laboratories, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)types.h 8.6 (Berkeley) 2/19/95 > * $FreeBSD: releng/10.3/sys/sys/types.h 289107 2015-10-10 05:50:42Z kib $ > */ > >#ifndef _SYS_TYPES_H_ >#define _SYS_TYPES_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 42 "/usr/include/sys/types.h" 3 4 > >/* Machine type dependent parameters. */ >#if 0 /* expanded by -frewrite-includes */ >#include <machine/endian.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/endian.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/endian.h 232266 2012-02-28 19:39:54Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/endian.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/x86/endian.h" 1 3 4 >/*- > * Copyright (c) 1987, 1991 Regents of the University of California. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)endian.h 7.8 (Berkeley) 4/3/91 > * $FreeBSD: releng/10.3/sys/x86/include/endian.h 233684 2012-03-29 23:31:48Z dim $ > */ > >#ifndef _MACHINE_ENDIAN_H_ >#define _MACHINE_ENDIAN_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/x86/endian.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/x86/endian.h" 3 4 > >/* > * Define the order of 32-bit words in 64-bit words. > */ >#define _QUAD_HIGHWORD 1 >#define _QUAD_LOWWORD 0 > >/* > * Definitions for byte order, according to byte significance from low > * address to high. > */ >#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ >#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ >#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ > >#define _BYTE_ORDER _LITTLE_ENDIAN > >/* > * Deprecated variants that don't have enough underscores to be useful in more > * strict namespaces. > */ >#if __BSD_VISIBLE >#define LITTLE_ENDIAN _LITTLE_ENDIAN >#define BIG_ENDIAN _BIG_ENDIAN >#define PDP_ENDIAN _PDP_ENDIAN >#define BYTE_ORDER _BYTE_ORDER >#endif ># 65 "/usr/include/x86/endian.h" 3 4 > >#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) >#define __bswap32_gen(x) \ > (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16)) >#define __bswap64_gen(x) \ > (((__uint64_t)__bswap32((x) & 0xffffffff) << 32) | __bswap32((x) >> 32)) > >#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P >#define __bswap16(x) \ > ((__uint16_t)(__builtin_constant_p(x) ? \ > __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) >#define __bswap32(x) \ > (__builtin_constant_p(x) ? \ > __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) >#define __bswap64(x) \ > (__builtin_constant_p(x) ? \ > __bswap64_gen((__uint64_t)(x)) : __bswap64_var(x)) >#else ># 83 "/usr/include/x86/endian.h" 3 4 >/* XXX these are broken for use in static initializers. */ >#define __bswap16(x) __bswap16_var(x) >#define __bswap32(x) __bswap32_var(x) >#define __bswap64(x) __bswap64_var(x) >#endif ># 88 "/usr/include/x86/endian.h" 3 4 > >/* These are defined as functions to avoid multiple evaluation of x. */ > >static __inline __uint16_t >__bswap16_var(__uint16_t _x) >{ > > return (__bswap16_gen(_x)); >} > >static __inline __uint32_t >__bswap32_var(__uint32_t _x) >{ > >#ifdef __GNUCLIKE_ASM > __asm("bswap %0" : "+r" (_x)); > return (_x); >#else ># 106 "/usr/include/x86/endian.h" 3 4 > return (__bswap32_gen(_x)); >#endif ># 108 "/usr/include/x86/endian.h" 3 4 >} > >static __inline __uint64_t >__bswap64_var(__uint64_t _x) >{ > >#if defined(__amd64__) && defined(__GNUCLIKE_ASM) > __asm("bswap %0" : "+r" (_x)); > return (_x); >#else ># 118 "/usr/include/x86/endian.h" 3 4 > /* > * It is important for the optimizations that the following is not > * really generic, but expands to 2 __bswap32_var()'s. > */ > return (__bswap64_gen(_x)); >#endif ># 124 "/usr/include/x86/endian.h" 3 4 >} > >#define __htonl(x) __bswap32(x) >#define __htons(x) __bswap16(x) >#define __ntohl(x) __bswap32(x) >#define __ntohs(x) __bswap16(x) > >#endif /* !_MACHINE_ENDIAN_H_ */ ># 132 "/usr/include/x86/endian.h" 3 4 ># 7 "/usr/include/machine/endian.h" 2 3 4 ># 45 "/usr/include/sys/types.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 46 "/usr/include/sys/types.h" 3 4 > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_pthreadtypes.h> >#endif /* expanded by -frewrite-includes */ ># 48 "/usr/include/sys/types.h" 3 4 > >#if __BSD_VISIBLE >typedef unsigned char u_char; >typedef unsigned short u_short; >typedef unsigned int u_int; >typedef unsigned long u_long; >#ifndef _KERNEL >typedef unsigned short ushort; /* Sys V compatibility */ >typedef unsigned int uint; /* Sys V compatibility */ >#endif ># 58 "/usr/include/sys/types.h" 3 4 >#endif ># 59 "/usr/include/sys/types.h" 3 4 > >/* > * XXX POSIX sized integrals that should appear only in <sys/stdint.h>. > */ >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_stdint.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_stdint.h" 1 3 4 >/*- > * Copyright (c) 2011 David E. O'Brien <obrien@FreeBSD.org> > * Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org> > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/_stdint.h 291134 2015-11-21 16:21:27Z kib $ > */ > >#ifndef _SYS__STDINT_H_ >#define _SYS__STDINT_H_ > >#ifndef _INT8_T_DECLARED >typedef __int8_t int8_t; >#define _INT8_T_DECLARED >#endif ># 37 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _INT16_T_DECLARED >typedef __int16_t int16_t; >#define _INT16_T_DECLARED >#endif ># 42 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _INT32_T_DECLARED >typedef __int32_t int32_t; >#define _INT32_T_DECLARED >#endif ># 47 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _INT64_T_DECLARED >typedef __int64_t int64_t; >#define _INT64_T_DECLARED >#endif ># 52 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _UINT8_T_DECLARED >typedef __uint8_t uint8_t; >#define _UINT8_T_DECLARED >#endif ># 57 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _UINT16_T_DECLARED >typedef __uint16_t uint16_t; >#define _UINT16_T_DECLARED >#endif ># 62 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _UINT32_T_DECLARED >typedef __uint32_t uint32_t; >#define _UINT32_T_DECLARED >#endif ># 67 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _UINT64_T_DECLARED >typedef __uint64_t uint64_t; >#define _UINT64_T_DECLARED >#endif ># 72 "/usr/include/sys/_stdint.h" 3 4 > >#ifndef _INTPTR_T_DECLARED >typedef __intptr_t intptr_t; >#define _INTPTR_T_DECLARED >#endif ># 77 "/usr/include/sys/_stdint.h" 3 4 >#ifndef _UINTPTR_T_DECLARED >typedef __uintptr_t uintptr_t; >#define _UINTPTR_T_DECLARED >#endif ># 81 "/usr/include/sys/_stdint.h" 3 4 >#ifndef _INTMAX_T_DECLARED >typedef __intmax_t intmax_t; >#define _INTMAX_T_DECLARED >#endif ># 85 "/usr/include/sys/_stdint.h" 3 4 >#ifndef _UINTMAX_T_DECLARED >typedef __uintmax_t uintmax_t; >#define _UINTMAX_T_DECLARED >#endif ># 89 "/usr/include/sys/_stdint.h" 3 4 > >#endif /* !_SYS__STDINT_H_ */ ># 91 "/usr/include/sys/_stdint.h" 3 4 ># 64 "/usr/include/sys/types.h" 2 3 4 > >typedef __uint8_t u_int8_t; /* unsigned integrals (deprecated) */ >typedef __uint16_t u_int16_t; >typedef __uint32_t u_int32_t; >typedef __uint64_t u_int64_t; > >typedef __uint64_t u_quad_t; /* quads (deprecated) */ >typedef __int64_t quad_t; >typedef quad_t * qaddr_t; > >typedef char * caddr_t; /* core address */ >typedef const char * c_caddr_t; /* core address, pointer to const */ > >#ifndef _BLKSIZE_T_DECLARED >typedef __blksize_t blksize_t; >#define _BLKSIZE_T_DECLARED >#endif ># 81 "/usr/include/sys/types.h" 3 4 > >typedef __cpuwhich_t cpuwhich_t; >typedef __cpulevel_t cpulevel_t; >typedef __cpusetid_t cpusetid_t; > >#ifndef _BLKCNT_T_DECLARED >typedef __blkcnt_t blkcnt_t; >#define _BLKCNT_T_DECLARED >#endif ># 90 "/usr/include/sys/types.h" 3 4 > >#ifndef _CLOCK_T_DECLARED >typedef __clock_t clock_t; >#define _CLOCK_T_DECLARED >#endif ># 95 "/usr/include/sys/types.h" 3 4 > >#ifndef _CLOCKID_T_DECLARED >typedef __clockid_t clockid_t; >#define _CLOCKID_T_DECLARED >#endif ># 100 "/usr/include/sys/types.h" 3 4 > >typedef __critical_t critical_t; /* Critical section value */ >typedef __int64_t daddr_t; /* disk address */ > >#ifndef _DEV_T_DECLARED >typedef __dev_t dev_t; /* device number or struct cdev */ >#define _DEV_T_DECLARED >#endif ># 108 "/usr/include/sys/types.h" 3 4 > >#ifndef _FFLAGS_T_DECLARED >typedef __fflags_t fflags_t; /* file flags */ >#define _FFLAGS_T_DECLARED >#endif ># 113 "/usr/include/sys/types.h" 3 4 > >typedef __fixpt_t fixpt_t; /* fixed point number */ > >#ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */ >typedef __fsblkcnt_t fsblkcnt_t; >typedef __fsfilcnt_t fsfilcnt_t; >#define _FSBLKCNT_T_DECLARED >#endif ># 121 "/usr/include/sys/types.h" 3 4 > >#ifndef _GID_T_DECLARED >typedef __gid_t gid_t; /* group id */ >#define _GID_T_DECLARED >#endif ># 126 "/usr/include/sys/types.h" 3 4 > >#ifndef _IN_ADDR_T_DECLARED >typedef __uint32_t in_addr_t; /* base type for internet address */ >#define _IN_ADDR_T_DECLARED >#endif ># 131 "/usr/include/sys/types.h" 3 4 > >#ifndef _IN_PORT_T_DECLARED >typedef __uint16_t in_port_t; >#define _IN_PORT_T_DECLARED >#endif ># 136 "/usr/include/sys/types.h" 3 4 > >#ifndef _ID_T_DECLARED >typedef __id_t id_t; /* can hold a uid_t or pid_t */ >#define _ID_T_DECLARED >#endif ># 141 "/usr/include/sys/types.h" 3 4 > >#ifndef _INO_T_DECLARED >typedef __ino_t ino_t; /* inode number */ >#define _INO_T_DECLARED >#endif ># 146 "/usr/include/sys/types.h" 3 4 > >#ifndef _KEY_T_DECLARED >typedef __key_t key_t; /* IPC key (for Sys V IPC) */ >#define _KEY_T_DECLARED >#endif ># 151 "/usr/include/sys/types.h" 3 4 > >#ifndef _LWPID_T_DECLARED >typedef __lwpid_t lwpid_t; /* Thread ID (a.k.a. LWP) */ >#define _LWPID_T_DECLARED >#endif ># 156 "/usr/include/sys/types.h" 3 4 > >#ifndef _MODE_T_DECLARED >typedef __mode_t mode_t; /* permissions */ >#define _MODE_T_DECLARED >#endif ># 161 "/usr/include/sys/types.h" 3 4 > >#ifndef _ACCMODE_T_DECLARED >typedef __accmode_t accmode_t; /* access permissions */ >#define _ACCMODE_T_DECLARED >#endif ># 166 "/usr/include/sys/types.h" 3 4 > >#ifndef _NLINK_T_DECLARED >typedef __nlink_t nlink_t; /* link count */ >#define _NLINK_T_DECLARED >#endif ># 171 "/usr/include/sys/types.h" 3 4 > >#ifndef _OFF_T_DECLARED >typedef __off_t off_t; /* file offset */ >#define _OFF_T_DECLARED >#endif ># 176 "/usr/include/sys/types.h" 3 4 > >#ifndef _PID_T_DECLARED >typedef __pid_t pid_t; /* process id */ >#define _PID_T_DECLARED >#endif ># 181 "/usr/include/sys/types.h" 3 4 > >typedef __register_t register_t; > >#ifndef _RLIM_T_DECLARED >typedef __rlim_t rlim_t; /* resource limit */ >#define _RLIM_T_DECLARED >#endif ># 188 "/usr/include/sys/types.h" 3 4 > >typedef __int64_t sbintime_t; > >typedef __segsz_t segsz_t; /* segment size (in pages) */ > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 197 "/usr/include/sys/types.h" 3 4 > >#ifndef _SSIZE_T_DECLARED >typedef __ssize_t ssize_t; >#define _SSIZE_T_DECLARED >#endif ># 202 "/usr/include/sys/types.h" 3 4 > >#ifndef _SUSECONDS_T_DECLARED >typedef __suseconds_t suseconds_t; /* microseconds (signed) */ >#define _SUSECONDS_T_DECLARED >#endif ># 207 "/usr/include/sys/types.h" 3 4 > >#ifndef _TIME_T_DECLARED >typedef __time_t time_t; >#define _TIME_T_DECLARED >#endif ># 212 "/usr/include/sys/types.h" 3 4 > >#ifndef _TIMER_T_DECLARED >typedef __timer_t timer_t; >#define _TIMER_T_DECLARED >#endif ># 217 "/usr/include/sys/types.h" 3 4 > >#ifndef _MQD_T_DECLARED >typedef __mqd_t mqd_t; >#define _MQD_T_DECLARED >#endif ># 222 "/usr/include/sys/types.h" 3 4 > >typedef __u_register_t u_register_t; > >#ifndef _UID_T_DECLARED >typedef __uid_t uid_t; /* user id */ >#define _UID_T_DECLARED >#endif ># 229 "/usr/include/sys/types.h" 3 4 > >#ifndef _USECONDS_T_DECLARED >typedef __useconds_t useconds_t; /* microseconds (unsigned) */ >#define _USECONDS_T_DECLARED >#endif ># 234 "/usr/include/sys/types.h" 3 4 > >#ifndef _CAP_RIGHTS_T_DECLARED >#define _CAP_RIGHTS_T_DECLARED >struct cap_rights; > >typedef struct cap_rights cap_rights_t; >#endif ># 241 "/usr/include/sys/types.h" 3 4 > >typedef __vm_offset_t vm_offset_t; >typedef __vm_ooffset_t vm_ooffset_t; >typedef __vm_paddr_t vm_paddr_t; >typedef __vm_pindex_t vm_pindex_t; >typedef __vm_size_t vm_size_t; > >#ifdef _KERNEL >typedef int boolean_t; >typedef struct device *device_t; >typedef __intfptr_t intfptr_t; > >/* > * XXX this is fixed width for historical reasons. It should have had type > * __int_fast32_t. Fixed-width types should not be used unless binary > * compatibility is essential. Least-width types should be used even less > * since they provide smaller benefits. > * > * XXX should be MD. > * > * XXX this is bogus in -current, but still used for spl*(). > */ >typedef __uint32_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */ > >typedef __uintfptr_t uintfptr_t; >typedef __uint64_t uoff_t; >typedef char vm_memattr_t; /* memory attribute codes */ >typedef struct vm_page *vm_page_t; > >#if !defined(__bool_true_false_are_defined) && !defined(__cplusplus) >#define __bool_true_false_are_defined 1 >#define false 0 >#define true 1 >#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) >typedef int _Bool; >#endif ># 277 "/usr/include/sys/types.h" 3 4 >typedef _Bool bool; >#endif /* !__bool_true_false_are_defined && !__cplusplus */ ># 279 "/usr/include/sys/types.h" 3 4 > >#define offsetof(type, field) __offsetof(type, field) > >#endif /* !_KERNEL */ ># 283 "/usr/include/sys/types.h" 3 4 > >/* > * The following are all things that really shouldn't exist in this header, > * since its purpose is to provide typedefs, not miscellaneous doodads. > */ > >#ifdef __POPCNT__ >#define __bitcount64(x) __builtin_popcountll((__uint64_t)(x)) >#define __bitcount32(x) __builtin_popcount((__uint32_t)(x)) >#define __bitcount16(x) __builtin_popcount((__uint16_t)(x)) >#define __bitcountl(x) __builtin_popcountl((unsigned long)(x)) >#define __bitcount(x) __builtin_popcount((unsigned int)(x)) >#else ># 296 "/usr/include/sys/types.h" 3 4 >/* > * Population count algorithm using SWAR approach > * - "SIMD Within A Register". > */ >static __inline __uint16_t >__bitcount16(__uint16_t _x) >{ > > _x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1); > _x = (_x & 0x3333) + ((_x & 0xcccc) >> 2); > _x = (_x + (_x >> 4)) & 0x0f0f; > _x = (_x + (_x >> 8)) & 0x00ff; > return (_x); >} > >static __inline __uint32_t >__bitcount32(__uint32_t _x) >{ > > _x = (_x & 0x55555555) + ((_x & 0xaaaaaaaa) >> 1); > _x = (_x & 0x33333333) + ((_x & 0xcccccccc) >> 2); > _x = (_x + (_x >> 4)) & 0x0f0f0f0f; > _x = (_x + (_x >> 8)); > _x = (_x + (_x >> 16)) & 0x000000ff; > return (_x); >} > >#ifdef __LP64__ >static __inline __uint64_t >__bitcount64(__uint64_t _x) >{ > > _x = (_x & 0x5555555555555555) + ((_x & 0xaaaaaaaaaaaaaaaa) >> 1); > _x = (_x & 0x3333333333333333) + ((_x & 0xcccccccccccccccc) >> 2); > _x = (_x + (_x >> 4)) & 0x0f0f0f0f0f0f0f0f; > _x = (_x + (_x >> 8)); > _x = (_x + (_x >> 16)); > _x = (_x + (_x >> 32)) & 0x000000ff; > return (_x); >} > >#define __bitcountl(x) __bitcount64((unsigned long)(x)) >#else ># 339 "/usr/include/sys/types.h" 3 4 >static __inline __uint64_t >__bitcount64(__uint64_t _x) >{ > > return (__bitcount32(_x >> 32) + __bitcount32(_x)); >} > >#define __bitcountl(x) __bitcount32((unsigned long)(x)) >#endif ># 348 "/usr/include/sys/types.h" 3 4 >#define __bitcount(x) __bitcount32((unsigned int)(x)) >#endif ># 350 "/usr/include/sys/types.h" 3 4 > >#if __BSD_VISIBLE > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/select.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/select.h" 1 3 4 >/*- > * Copyright (c) 1992, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/select.h 154090 2006-01-06 22:12:46Z marcel $ > */ > >#ifndef _SYS_SELECT_H_ >#define _SYS_SELECT_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 36 "/usr/include/sys/select.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/sys/select.h" 3 4 > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_sigset.h> >#endif /* expanded by -frewrite-includes */ ># 39 "/usr/include/sys/select.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_timeval.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_timeval.h" 1 3 4 >/*- > * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/_timeval.h 158471 2006-05-12 05:04:46Z jhb $ > */ > >#ifndef _SYS__TIMEVAL_H_ >#define _SYS__TIMEVAL_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 33 "/usr/include/sys/_timeval.h" 3 4 > >#ifndef _SUSECONDS_T_DECLARED >typedef __suseconds_t suseconds_t; >#define _SUSECONDS_T_DECLARED >#endif ># 38 "/usr/include/sys/_timeval.h" 3 4 > >#ifndef _TIME_T_DECLARED >typedef __time_t time_t; >#define _TIME_T_DECLARED >#endif ># 43 "/usr/include/sys/_timeval.h" 3 4 > >/* > * Structure returned by gettimeofday(2) system call, and used in other calls. > */ >struct timeval { > time_t tv_sec; /* seconds */ > suseconds_t tv_usec; /* and microseconds */ >}; > >#endif /* !_SYS__TIMEVAL_H_ */ ># 53 "/usr/include/sys/_timeval.h" 3 4 ># 40 "/usr/include/sys/select.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/timespec.h> >#endif /* expanded by -frewrite-includes */ ># 41 "/usr/include/sys/select.h" 3 4 > >typedef unsigned long __fd_mask; >#if __BSD_VISIBLE >typedef __fd_mask fd_mask; >#endif ># 46 "/usr/include/sys/select.h" 3 4 > >#ifndef _SIGSET_T_DECLARED >#define _SIGSET_T_DECLARED >typedef __sigset_t sigset_t; >#endif ># 51 "/usr/include/sys/select.h" 3 4 > >/* > * Select uses bit masks of file descriptors in longs. These macros > * manipulate such bit fields (the filesystem macros use chars). > * FD_SETSIZE may be defined by the user, but the default here should > * be enough for most uses. > */ >#ifndef FD_SETSIZE >#define FD_SETSIZE 1024U >#endif ># 61 "/usr/include/sys/select.h" 3 4 > >#define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */ >#if __BSD_VISIBLE >#define NFDBITS _NFDBITS >#endif ># 66 "/usr/include/sys/select.h" 3 4 > >#ifndef _howmany >#define _howmany(x, y) (((x) + ((y) - 1)) / (y)) >#endif ># 70 "/usr/include/sys/select.h" 3 4 > >typedef struct fd_set { > __fd_mask __fds_bits[_howmany(FD_SETSIZE, _NFDBITS)]; >} fd_set; >#if __BSD_VISIBLE >#define fds_bits __fds_bits >#endif ># 77 "/usr/include/sys/select.h" 3 4 > >#define __fdset_mask(n) ((__fd_mask)1 << ((n) % _NFDBITS)) >#define FD_CLR(n, p) ((p)->__fds_bits[(n)/_NFDBITS] &= ~__fdset_mask(n)) >#if __BSD_VISIBLE >#define FD_COPY(f, t) (void)(*(t) = *(f)) >#endif ># 83 "/usr/include/sys/select.h" 3 4 >#define FD_ISSET(n, p) (((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) != 0) >#define FD_SET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] |= __fdset_mask(n)) >#define FD_ZERO(p) do { \ > fd_set *_p; \ > __size_t _n; \ > \ > _p = (p); \ > _n = _howmany(FD_SETSIZE, _NFDBITS); \ > while (_n > 0) \ > _p->__fds_bits[--_n] = 0; \ >} while (0) > >#ifndef _KERNEL > >__BEGIN_DECLS >int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, > const struct timespec *__restrict, const sigset_t *__restrict); >#ifndef _SELECT_DECLARED >#define _SELECT_DECLARED >/* XXX missing restrict type-qualifier */ >int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); >#endif ># 105 "/usr/include/sys/select.h" 3 4 >__END_DECLS >#endif /* !_KERNEL */ ># 107 "/usr/include/sys/select.h" 3 4 > >#endif /* _SYS_SELECT_H_ */ ># 109 "/usr/include/sys/select.h" 3 4 ># 354 "/usr/include/sys/types.h" 2 3 4 > >/* > * minor() gives a cookie instead of an index since we don't want to > * change the meanings of bits 0-15 or waste time and space shifting > * bits 16-31 for devices that don't use them. > */ >#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ >#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ >#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ > >/* > * These declarations belong elsewhere, but are repeated here and in > * <stdio.h> to give broken programs a better chance of working with > * 64-bit off_t's. > */ >#ifndef _KERNEL >__BEGIN_DECLS >#ifndef _FTRUNCATE_DECLARED >#define _FTRUNCATE_DECLARED >int ftruncate(int, off_t); >#endif ># 375 "/usr/include/sys/types.h" 3 4 >#ifndef _LSEEK_DECLARED >#define _LSEEK_DECLARED >off_t lseek(int, off_t, int); >#endif ># 379 "/usr/include/sys/types.h" 3 4 >#ifndef _MMAP_DECLARED >#define _MMAP_DECLARED >void * mmap(void *, size_t, int, int, int, off_t); >#endif ># 383 "/usr/include/sys/types.h" 3 4 >#ifndef _TRUNCATE_DECLARED >#define _TRUNCATE_DECLARED >int truncate(const char *, off_t); >#endif ># 387 "/usr/include/sys/types.h" 3 4 >__END_DECLS >#endif /* !_KERNEL */ ># 389 "/usr/include/sys/types.h" 3 4 > >#endif /* __BSD_VISIBLE */ ># 391 "/usr/include/sys/types.h" 3 4 > >#endif /* !_SYS_TYPES_H_ */ ># 393 "/usr/include/sys/types.h" 3 4 ># 575 "../include/dps_config.h" 2 > > > > >#define __C_LINK >#define __DPSCALL > >#define DPSSLASH '/' >#define DPSSLASHSTR "/" >#define DPSSLEEP(x) sleep(x) >#define DPS_MSLEEP(x) usleep(1000*(x)) >#define DPS_IWRITE 0644 > >#if SIZEOF_SHORT == 2 >typedef unsigned short dps_uint2; >#elif SIZEOF_INT == 2 ># 591 "../include/dps_config.h" >typedef unsigned int dps_uint2; >#else ># 593 "../include/dps_config.h" >typedef unsigned int dps_uint2; >#endif ># 595 "../include/dps_config.h" > >#if SIZEOF_SHORT == 4 >typedef short dpshash32_t; >typedef unsigned short dps_uint4; >typedef short dps_int4; >#elif SIZEOF_INT == 4 ># 601 "../include/dps_config.h" >typedef int dpshash32_t; >typedef unsigned int dps_uint4; >typedef int dps_int4; >#else ># 605 "../include/dps_config.h" >typedef long dpshash32_t; >typedef unsigned long dps_uint4; >typedef long dps_int4; >#endif ># 609 "../include/dps_config.h" > >#if SIZEOF_INT == 8 >typedef unsigned int dpshash64_t; >typedef unsigned int dps_uint8; >#elif SIZEOF_LONG == 8 ># 614 "../include/dps_config.h" >typedef unsigned long dpshash64_t; >typedef unsigned long dps_uint8; >#else ># 617 "../include/dps_config.h" >/*#error No 64-bit integer detected. Giving up.*/ > >typedef unsigned long long dpshash64_t; >typedef unsigned long long dps_uint8; > >#endif ># 623 "../include/dps_config.h" > >#if (SIZEOF_CHARP == SIZEOF_INT) >#define SDPALIGN int >#elif (SIZEOF_CHARP == SIZEOF_LONG) ># 627 "../include/dps_config.h" >#define SDPALIGN long >#elif (SIZEOF_CHARP == SIZEOF_SHORT) ># 629 "../include/dps_config.h" >#define SDPALIGN short >#else ># 631 "../include/dps_config.h" >#define SDPALIGN long long >#endif ># 633 "../include/dps_config.h" > >#if (SIZEOF_VOIDP == SIZEOF_INT) >#define DPS_PNTYPE unsigned int >#elif (SIZEOF_VOIDP == SIZEOF_LONG) ># 637 "../include/dps_config.h" >#define DPS_PNTYPE unsigned long >#elif (SIZEOF_VOIDP == SIZEOF_SHORT) ># 639 "../include/dps_config.h" >#define DPS_PNTYPE short >#else ># 641 "../include/dps_config.h" >#define DPS_PNTYPE unsigned long long >#endif ># 643 "../include/dps_config.h" > > > >typedef dps_uint4 urlid_t; >typedef dps_uint4 dpscrc32_t; >typedef dps_uint4 dpsunicode_t; >typedef unsigned int dps_word; >typedef unsigned int dps_uintptr_t; > > >#define HT_CHAR (char)9 >#define NL_CHAR (char)10 >#define CR_CHAR (char)13 >#define HT_INT (int)9 >#define NL_INT (int)10 >#define CR_INT (int)13 > > > >#ifndef _GNU_SOURCE >#define _GNU_SOURCE >#endif ># 665 "../include/dps_config.h" >#ifndef __USE_GNU >#define __USE_GNU >#endif ># 668 "../include/dps_config.h" > >/* For strtok_r() */ >#ifndef _REENTRANT >#define _REENTRANT >#endif ># 673 "../include/dps_config.h" > > >#ifndef dps_max >#define dps_max(a,b) (((a) > (b)) ? (a) : (b)) >#endif ># 678 "../include/dps_config.h" >#ifndef dps_min >#define dps_min(a,b) (((a) < (b)) ? (a) : (b)) >#endif ># 681 "../include/dps_config.h" > > >#ifdef EFENCE > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_efence.h" >#endif /* expanded by -frewrite-includes */ ># 686 "../include/dps_config.h" > >#elif defined(BOEHMGC) ># 688 "../include/dps_config.h" > >#if 0 /* expanded by -frewrite-includes */ >#include <stdlib.h> >#endif /* expanded by -frewrite-includes */ ># 690 "../include/dps_config.h" >#ifdef HAVE_BSD_STDLIB_H >#if 0 /* expanded by -frewrite-includes */ >#include <bsd/stdlib.h> >#endif /* expanded by -frewrite-includes */ ># 692 "../include/dps_config.h" >#endif ># 693 "../include/dps_config.h" > >#define GC_DEBUG >#if 0 /* expanded by -frewrite-includes */ >#include "gc.h" >#endif /* expanded by -frewrite-includes */ ># 696 "../include/dps_config.h" >#define malloc(n) GC_MALLOC(n) >#define calloc(m,n) GC_MALLOC((m)*(n)) >#define free(p) GC_FREE(p) >#define realloc(p,n) GC_REALLOC((p),(n)) > >#define DpsMalloc(n) GC_MALLOC(n) >#define DpsCalloc(m,n) GC_MALLOC((m)*(n)) >#define DpsFree(p) GC_FREE(p) >#define DpsRealloc(p,n) GC_REALLOC((p),(n)) > >#define CHECK_LEAKS() GC_gcollect() >#define DpsStrdup(x) _DpsStrdup(x) >extern char * _DpsStrdup(const char *str); > >#else ># 711 "../include/dps_config.h" > >extern void *DpsRealloc(void *p, size_t size); > >#define DpsFree free >#define DpsMalloc malloc >#define DpsCalloc calloc >#define DpsValloc valloc >#define DpsStrdup _DpsStrdup >#define DpsStrndup _DpsStrndup > >#endif /* EFENCE */ ># 722 "../include/dps_config.h" > > >#define DpsSort qsort >#define DpsPreSort heapsort > > >#ifdef WITH_PARANOIA >#define DpsViolationExit(h,A) _DpsViolationExit(A, __FILE__, __LINE__, h) >#define DpsViolationCheck(h,A) _DpsViolationCheck(A,__FILE__, __LINE__, h) >extern void *DpsViolationEnter(void *); >extern void _DpsViolationExit(void*, const char*, int, int h); >extern void _DpsViolationCheck(void*, const char*, int, int h); >#endif ># 735 "../include/dps_config.h" > > > > > > >#endif /* _DPS_CONFIG_H */ ># 742 "../include/dps_config.h" >/* --- END 'bottom' portion from acconfig.h --- */ ># 24 "../include/dps_common.h" 2 > >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> /* for FILE etc. */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/stdio.h" 1 3 4 >/*- > * Copyright (c) 1990, 1993 > * The Regents of the University of California. All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * Chris Torek. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)stdio.h 8.5 (Berkeley) 4/29/95 > * $FreeBSD: releng/10.3/include/stdio.h 291602 2015-12-01 18:19:23Z ngie $ > */ > >#ifndef _STDIO_H_ >#define _STDIO_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 40 "/usr/include/stdio.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_null.h> >#endif /* expanded by -frewrite-includes */ ># 41 "/usr/include/stdio.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 42 "/usr/include/stdio.h" 3 4 > >typedef __off_t fpos_t; > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 49 "/usr/include/stdio.h" 3 4 > >#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 >#ifndef _OFF_T_DECLARED >#define _OFF_T_DECLARED >typedef __off_t off_t; >#endif ># 55 "/usr/include/stdio.h" 3 4 >#ifndef _SSIZE_T_DECLARED >#define _SSIZE_T_DECLARED >typedef __ssize_t ssize_t; >#endif ># 59 "/usr/include/stdio.h" 3 4 >#endif ># 60 "/usr/include/stdio.h" 3 4 > >#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >#ifndef _VA_LIST_DECLARED >typedef __va_list va_list; >#define _VA_LIST_DECLARED >#endif ># 66 "/usr/include/stdio.h" 3 4 >#endif ># 67 "/usr/include/stdio.h" 3 4 > >#define _FSTDIO /* Define for new stdio with functions. */ > >/* > * NB: to fit things in six character monocase externals, the stdio > * code uses the prefix `__s' for stdio objects, typically followed > * by a three-character attempt at a mnemonic. > */ > >/* stdio buffers */ >struct __sbuf { > unsigned char *_base; > int _size; >}; > >/* > * stdio state variables. > * > * The following always hold: > * > * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), > * _lbfsize is -_bf._size, else _lbfsize is 0 > * if _flags&__SRD, _w is 0 > * if _flags&__SWR, _r is 0 > * > * This ensures that the getc and putc macros (or inline functions) never > * try to write or read from a file that is in `read' or `write' mode. > * (Moreover, they can, and do, automatically switch from read mode to > * write mode, and back, on "r+" and "w+" files.) > * > * _lbfsize is used only to make the inline line-buffered output stream > * code as compact as possible. > * > * _ub, _up, and _ur are used when ungetc() pushes back more characters > * than fit in the current _bf, or when ungetc() pushes back a character > * that does not match the previous one in _bf. When this happens, > * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff > * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. > * > * Certain members of __sFILE are accessed directly via macros or > * inline functions. To preserve ABI compat, these members must not > * be disturbed. These members are marked below with (*). > */ >struct __sFILE { > unsigned char *_p; /* (*) current position in (some) buffer */ > int _r; /* (*) read space left for getc() */ > int _w; /* (*) write space left for putc() */ > short _flags; /* (*) flags, below; this FILE is free if 0 */ > short _file; /* (*) fileno, if Unix descriptor, else -1 */ > struct __sbuf _bf; /* (*) the buffer (at least 1 byte, if !NULL) */ > int _lbfsize; /* (*) 0 or -_bf._size, for inline putc */ > > /* operations */ > void *_cookie; /* (*) cookie passed to io functions */ > int (*_close)(void *); > int (*_read)(void *, char *, int); > fpos_t (*_seek)(void *, fpos_t, int); > int (*_write)(void *, const char *, int); > > /* separate buffer for long sequences of ungetc() */ > struct __sbuf _ub; /* ungetc buffer */ > unsigned char *_up; /* saved _p when _p is doing ungetc data */ > int _ur; /* saved _r when _r is counting ungetc data */ > > /* tricks to meet minimum requirements even when malloc() fails */ > unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ > unsigned char _nbuf[1]; /* guarantee a getc() buffer */ > > /* separate buffer for fgetln() when line crosses buffer boundary */ > struct __sbuf _lb; /* buffer for fgetln() */ > > /* Unix stdio files get aligned to block boundaries on fseek() */ > int _blksize; /* stat.st_blksize (may be != _bf._size) */ > fpos_t _offset; /* current lseek offset */ > > struct pthread_mutex *_fl_mutex; /* used for MT-safety */ > struct pthread *_fl_owner; /* current owner */ > int _fl_count; /* recursive lock count */ > int _orientation; /* orientation for fwide() */ > __mbstate_t _mbstate; /* multibyte conversion state */ > int _flags2; /* additional flags */ >}; >#ifndef _STDFILE_DECLARED >#define _STDFILE_DECLARED >typedef struct __sFILE FILE; >#endif ># 153 "/usr/include/stdio.h" 3 4 >#ifndef _STDSTREAM_DECLARED >__BEGIN_DECLS >extern FILE *__stdinp; >extern FILE *__stdoutp; >extern FILE *__stderrp; >__END_DECLS >#define _STDSTREAM_DECLARED >#endif ># 161 "/usr/include/stdio.h" 3 4 > >#define __SLBF 0x0001 /* line buffered */ >#define __SNBF 0x0002 /* unbuffered */ >#define __SRD 0x0004 /* OK to read */ >#define __SWR 0x0008 /* OK to write */ > /* RD and WR are never simultaneously asserted */ >#define __SRW 0x0010 /* open for reading & writing */ >#define __SEOF 0x0020 /* found EOF */ >#define __SERR 0x0040 /* found error */ >#define __SMBF 0x0080 /* _bf._base is from malloc */ >#define __SAPP 0x0100 /* fdopen()ed in append mode */ >#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ >#define __SOPT 0x0400 /* do fseek() optimization */ >#define __SNPT 0x0800 /* do not do fseek() optimization */ >#define __SOFF 0x1000 /* set iff _offset is in fact correct */ >#define __SMOD 0x2000 /* true => fgetln modified _p text */ >#define __SALC 0x4000 /* allocate string space dynamically */ >#define __SIGN 0x8000 /* ignore this file in _fwalk */ > >#define __S2OAP 0x0001 /* O_APPEND mode is set */ > >/* > * The following three definitions are for ANSI C, which took them > * from System V, which brilliantly took internal interface macros and > * made them official arguments to setvbuf(), without renaming them. > * Hence, these ugly _IOxxx names are *supposed* to appear in user code. > * > * Although numbered as their counterparts above, the implementation > * does not rely on this. > */ >#define _IOFBF 0 /* setvbuf should set fully buffered */ >#define _IOLBF 1 /* setvbuf should set line buffered */ >#define _IONBF 2 /* setvbuf should set unbuffered */ > >#define BUFSIZ 1024 /* size of buffer used by setbuf */ >#define EOF (-1) > >/* > * FOPEN_MAX is a minimum maximum, and is the number of streams that > * stdio can provide without attempting to allocate further resources > * (which could fail). Do not use this for anything. > */ > /* must be == _POSIX_STREAM_MAX <limits.h> */ >#ifndef FOPEN_MAX >#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */ >#endif ># 207 "/usr/include/stdio.h" 3 4 >#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */ > >/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ >#if __XSI_VISIBLE >#define P_tmpdir "/tmp/" >#endif ># 213 "/usr/include/stdio.h" 3 4 >#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ >#define TMP_MAX 308915776 > >#ifndef SEEK_SET >#define SEEK_SET 0 /* set file offset to offset */ >#endif ># 219 "/usr/include/stdio.h" 3 4 >#ifndef SEEK_CUR >#define SEEK_CUR 1 /* set file offset to current plus offset */ >#endif ># 222 "/usr/include/stdio.h" 3 4 >#ifndef SEEK_END >#define SEEK_END 2 /* set file offset to EOF plus offset */ >#endif ># 225 "/usr/include/stdio.h" 3 4 > >#define stdin __stdinp >#define stdout __stdoutp >#define stderr __stderrp > >__BEGIN_DECLS >#ifdef _XLOCALE_H_ >#if 0 /* expanded by -frewrite-includes */ >#include <xlocale/_stdio.h> >#endif /* expanded by -frewrite-includes */ ># 233 "/usr/include/stdio.h" 3 4 >#endif ># 234 "/usr/include/stdio.h" 3 4 >/* > * Functions defined in ANSI C standard. > */ >void clearerr(FILE *); >int fclose(FILE *); >int feof(FILE *); >int ferror(FILE *); >int fflush(FILE *); >int fgetc(FILE *); >int fgetpos(FILE * __restrict, fpos_t * __restrict); >char *fgets(char * __restrict, int, FILE * __restrict); >FILE *fopen(const char * __restrict, const char * __restrict); >int fprintf(FILE * __restrict, const char * __restrict, ...); >int fputc(int, FILE *); >int fputs(const char * __restrict, FILE * __restrict); >size_t fread(void * __restrict, size_t, size_t, FILE * __restrict); >FILE *freopen(const char * __restrict, const char * __restrict, FILE * __restrict); >int fscanf(FILE * __restrict, const char * __restrict, ...); >int fseek(FILE *, long, int); >int fsetpos(FILE *, const fpos_t *); >long ftell(FILE *); >size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict); >int getc(FILE *); >int getchar(void); >char *gets(char *); >void perror(const char *); >int printf(const char * __restrict, ...); >int putc(int, FILE *); >int putchar(int); >int puts(const char *); >int remove(const char *); >int rename(const char *, const char *); >void rewind(FILE *); >int scanf(const char * __restrict, ...); >void setbuf(FILE * __restrict, char * __restrict); >int setvbuf(FILE * __restrict, char * __restrict, int, size_t); >int sprintf(char * __restrict, const char * __restrict, ...); >int sscanf(const char * __restrict, const char * __restrict, ...); >FILE *tmpfile(void); >char *tmpnam(char *); >int ungetc(int, FILE *); >int vfprintf(FILE * __restrict, const char * __restrict, > __va_list); >int vprintf(const char * __restrict, __va_list); >int vsprintf(char * __restrict, const char * __restrict, > __va_list); > >#if __ISO_C_VISIBLE >= 1999 >int snprintf(char * __restrict, size_t, const char * __restrict, > ...) __printflike(3, 4); >int vfscanf(FILE * __restrict, const char * __restrict, __va_list) > __scanflike(2, 0); >int vscanf(const char * __restrict, __va_list) __scanflike(1, 0); >int vsnprintf(char * __restrict, size_t, const char * __restrict, > __va_list) __printflike(3, 0); >int vsscanf(const char * __restrict, const char * __restrict, __va_list) > __scanflike(2, 0); >#endif ># 292 "/usr/include/stdio.h" 3 4 > >/* > * Functions defined in all versions of POSIX 1003.1. > */ >#if __BSD_VISIBLE || __POSIX_VISIBLE <= 199506 >#define L_cuserid 17 /* size for cuserid(3); MAXLOGNAME, legacy */ >#endif ># 299 "/usr/include/stdio.h" 3 4 > >#if __POSIX_VISIBLE >#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */ > >char *ctermid(char *); >FILE *fdopen(int, const char *); >int fileno(FILE *); >#endif /* __POSIX_VISIBLE */ ># 307 "/usr/include/stdio.h" 3 4 > >#if __POSIX_VISIBLE >= 199209 >int pclose(FILE *); >FILE *popen(const char *, const char *); >#endif ># 312 "/usr/include/stdio.h" 3 4 > >#if __POSIX_VISIBLE >= 199506 >int ftrylockfile(FILE *); >void flockfile(FILE *); >void funlockfile(FILE *); > >/* > * These are normally used through macros as defined below, but POSIX > * requires functions as well. > */ >int getc_unlocked(FILE *); >int getchar_unlocked(void); >int putc_unlocked(int, FILE *); >int putchar_unlocked(int); >#endif ># 327 "/usr/include/stdio.h" 3 4 >#if __BSD_VISIBLE >void clearerr_unlocked(FILE *); >int feof_unlocked(FILE *); >int ferror_unlocked(FILE *); >int fileno_unlocked(FILE *); >#endif ># 333 "/usr/include/stdio.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >int fseeko(FILE *, __off_t, int); >__off_t ftello(FILE *); >#endif ># 338 "/usr/include/stdio.h" 3 4 > >#if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 >int getw(FILE *); >int putw(int, FILE *); >#endif /* BSD or X/Open before issue 6 */ ># 343 "/usr/include/stdio.h" 3 4 > >#if __XSI_VISIBLE >char *tempnam(const char *, const char *); >#endif ># 347 "/usr/include/stdio.h" 3 4 > >#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 >FILE *fmemopen(void * __restrict, size_t, const char * __restrict); >ssize_t getdelim(char ** __restrict, size_t * __restrict, int, > FILE * __restrict); >FILE *open_memstream(char **, size_t *); >int renameat(int, const char *, int, const char *); >int vdprintf(int, const char * __restrict, __va_list); > >/* > * Every programmer and his dog wrote functions called getline() and dprintf() > * before POSIX.1-2008 came along and decided to usurp the names, so we > * don't prototype them by default unless one of the following is true: > * a) the app has requested them specifically by defining _WITH_GETLINE or > * _WITH_DPRINTF, respectively > * b) the app has requested a POSIX.1-2008 environment via _POSIX_C_SOURCE > * c) the app defines a GNUism such as _BSD_SOURCE or _GNU_SOURCE > */ >#ifndef _WITH_GETLINE >#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) >#define _WITH_GETLINE >#elif defined(_POSIX_C_SOURCE) ># 369 "/usr/include/stdio.h" 3 4 >#if _POSIX_C_SOURCE >= 200809 >#define _WITH_GETLINE >#endif ># 372 "/usr/include/stdio.h" 3 4 >#endif ># 373 "/usr/include/stdio.h" 3 4 >#endif ># 374 "/usr/include/stdio.h" 3 4 > >#ifdef _WITH_GETLINE >ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict); >#endif ># 378 "/usr/include/stdio.h" 3 4 > >#ifndef _WITH_DPRINTF >#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) >#define _WITH_DPRINTF >#elif defined(_POSIX_C_SOURCE) ># 383 "/usr/include/stdio.h" 3 4 >#if _POSIX_C_SOURCE >= 200809 >#define _WITH_DPRINTF >#endif ># 386 "/usr/include/stdio.h" 3 4 >#endif ># 387 "/usr/include/stdio.h" 3 4 >#endif ># 388 "/usr/include/stdio.h" 3 4 > >#ifdef _WITH_DPRINTF >int (dprintf)(int, const char * __restrict, ...); >#endif ># 392 "/usr/include/stdio.h" 3 4 > >#endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 */ ># 394 "/usr/include/stdio.h" 3 4 > >/* > * Routines that are purely local. > */ >#if __BSD_VISIBLE >int asprintf(char **, const char *, ...) __printflike(2, 3); >char *ctermid_r(char *); >void fcloseall(void); >int fdclose(FILE *, int *); >char *fgetln(FILE *, size_t *); >const char *fmtcheck(const char *, const char *) __format_arg(2); >int fpurge(FILE *); >void setbuffer(FILE *, char *, int); >int setlinebuf(FILE *); >int vasprintf(char **, const char *, __va_list) > __printflike(2, 0); > >/* > * The system error table contains messages for the first sys_nerr > * positive errno values. Use strerror() or strerror_r() from <string.h> > * instead. > */ >extern const int sys_nerr; >extern const char * const sys_errlist[]; > >/* > * Stdio function-access interface. > */ >FILE *funopen(const void *, > int (*)(void *, char *, int), > int (*)(void *, const char *, int), > fpos_t (*)(void *, fpos_t, int), > int (*)(void *)); >#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) >#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) > >/* > * Portability hacks. See <sys/types.h>. > */ >#ifndef _FTRUNCATE_DECLARED >#define _FTRUNCATE_DECLARED >int ftruncate(int, __off_t); >#endif ># 437 "/usr/include/stdio.h" 3 4 >#ifndef _LSEEK_DECLARED >#define _LSEEK_DECLARED >__off_t lseek(int, __off_t, int); >#endif ># 441 "/usr/include/stdio.h" 3 4 >#ifndef _MMAP_DECLARED >#define _MMAP_DECLARED >void *mmap(void *, size_t, int, int, int, __off_t); >#endif ># 445 "/usr/include/stdio.h" 3 4 >#ifndef _TRUNCATE_DECLARED >#define _TRUNCATE_DECLARED >int truncate(const char *, __off_t); >#endif ># 449 "/usr/include/stdio.h" 3 4 >#endif /* __BSD_VISIBLE */ ># 450 "/usr/include/stdio.h" 3 4 > >/* > * Functions internal to the implementation. > */ >int __srget(FILE *); >int __swbuf(int, FILE *); > >/* > * The __sfoo macros are here so that we can > * define function versions in the C library. > */ >#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) >#if defined(__GNUC__) && defined(__STDC__) >static __inline int __sputc(int _c, FILE *_p) { > if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) > return (*_p->_p++ = _c); > else > return (__swbuf(_c, _p)); >} >#else ># 470 "/usr/include/stdio.h" 3 4 >/* > * This has been tuned to generate reasonable code on the vax using pcc. > */ >#define __sputc(c, p) \ > (--(p)->_w < 0 ? \ > (p)->_w >= (p)->_lbfsize ? \ > (*(p)->_p = (c)), *(p)->_p != '\n' ? \ > (int)*(p)->_p++ : \ > __swbuf('\n', p) : \ > __swbuf((int)(c), p) : \ > (*(p)->_p = (c), (int)*(p)->_p++)) >#endif ># 482 "/usr/include/stdio.h" 3 4 > >extern int __isthreaded; > >#ifndef __cplusplus > >#define __sfeof(p) (((p)->_flags & __SEOF) != 0) >#define __sferror(p) (((p)->_flags & __SERR) != 0) >#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) >#define __sfileno(p) ((p)->_file) > > >#define feof(p) (!__isthreaded ? __sfeof(p) : (feof)(p)) >#define ferror(p) (!__isthreaded ? __sferror(p) : (ferror)(p)) >#define clearerr(p) (!__isthreaded ? __sclearerr(p) : (clearerr)(p)) > >#if __POSIX_VISIBLE >#define fileno(p) (!__isthreaded ? __sfileno(p) : (fileno)(p)) >#endif ># 500 "/usr/include/stdio.h" 3 4 > >#define getc(fp) (!__isthreaded ? __sgetc(fp) : (getc)(fp)) >#define putc(x, fp) (!__isthreaded ? __sputc(x, fp) : (putc)(x, fp)) > >#define getchar() getc(stdin) >#define putchar(x) putc(x, stdout) > >#if __BSD_VISIBLE >/* > * See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12 > * B.8.2.7 for the rationale behind the *_unlocked() macros. > */ >#define feof_unlocked(p) __sfeof(p) >#define ferror_unlocked(p) __sferror(p) >#define clearerr_unlocked(p) __sclearerr(p) >#define fileno_unlocked(p) __sfileno(p) >#endif ># 517 "/usr/include/stdio.h" 3 4 >#if __POSIX_VISIBLE >= 199506 >#define getc_unlocked(fp) __sgetc(fp) >#define putc_unlocked(x, fp) __sputc(x, fp) > >#define getchar_unlocked() getc_unlocked(stdin) >#define putchar_unlocked(x) putc_unlocked(x, stdout) >#endif ># 524 "/usr/include/stdio.h" 3 4 >#endif /* __cplusplus */ ># 525 "/usr/include/stdio.h" 3 4 > >__END_DECLS >#endif /* !_STDIO_H_ */ ># 528 "/usr/include/stdio.h" 3 4 ># 26 "../include/dps_common.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include <strings.h> /* for Solaris? */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/strings.h" 1 3 4 >/*- > * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/include/strings.h 267465 2014-06-14 02:57:40Z pfg $ > */ > >#ifndef _STRINGS_H_ >#define _STRINGS_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 33 "/usr/include/strings.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 34 "/usr/include/strings.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 39 "/usr/include/strings.h" 3 4 > >__BEGIN_DECLS >#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 >int bcmp(const void *, const void *, size_t) __pure; /* LEGACY */ >void bcopy(const void *, void *, size_t); /* LEGACY */ >void bzero(void *, size_t); /* LEGACY */ >#endif ># 46 "/usr/include/strings.h" 3 4 >#if __XSI_VISIBLE >int ffs(int) __pure2; >#endif ># 49 "/usr/include/strings.h" 3 4 >#if __BSD_VISIBLE >int ffsl(long) __pure2; >int ffsll(long long) __pure2; >int fls(int) __pure2; >int flsl(long) __pure2; >int flsll(long long) __pure2; >#endif ># 56 "/usr/include/strings.h" 3 4 >#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 >char *index(const char *, int) __pure; /* LEGACY */ >char *rindex(const char *, int) __pure; /* LEGACY */ >#endif ># 60 "/usr/include/strings.h" 3 4 >int strcasecmp(const char *, const char *) __pure; >int strncasecmp(const char *, const char *, size_t) __pure; > >#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) >#if 0 /* expanded by -frewrite-includes */ >#include <xlocale/_strings.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/xlocale/_strings.h" 1 3 4 >/*- > * Copyright (c) 2011, 2012 The FreeBSD Foundation > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/include/xlocale/_strings.h 267465 2014-06-14 02:57:40Z pfg $ > */ > >#ifndef _LOCALE_T_DEFINED >#define _LOCALE_T_DEFINED >typedef struct _xlocale *locale_t; >#endif ># 33 "/usr/include/xlocale/_strings.h" 3 4 > >/* > * This file is included from both strings.h and xlocale.h. We need to expose > * the declarations unconditionally if we are included from xlocale.h, but only > * if we are in POSIX2008 mode if included from string.h. > */ > >#ifndef _XLOCALE_STRINGS1_H >#define _XLOCALE_STRINGS1_H > >/* > * POSIX2008 functions > */ >int strcasecmp_l(const char *, const char *, locale_t); >int strncasecmp_l(const char *, const char *, size_t, locale_t); >#endif /* _XLOCALE_STRINGS1_H */ ># 49 "/usr/include/xlocale/_strings.h" 3 4 ># 65 "/usr/include/strings.h" 2 3 4 >#endif ># 66 "/usr/include/strings.h" 3 4 >__END_DECLS > >#endif /* _STRINGS_H_ */ ># 69 "/usr/include/strings.h" 3 4 ># 27 "../include/dps_common.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include <time.h> >#endif /* expanded by -frewrite-includes */ ># 28 "../include/dps_common.h" > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 30 "../include/dps_common.h" > >#if defined(APACHE1) || defined(APACHE2) > >#if !defined(_REGEX_H) \ > && !defined(_REGEX_H_) \ > && !defined(_PCREPOSIX_H) \ > && !defined(_RX_H) \ > && !defined(__REGEXP_LIBRARY_H__) \ > && !defined(_H_REGEX) /* This one is for AIX */ >#ifdef HAVE_TRE_REGEX_H >#if 0 /* expanded by -frewrite-includes */ >#include <tre/regex.h> >#endif /* expanded by -frewrite-includes */ ># 41 "../include/dps_common.h" >#else ># 42 "../include/dps_common.h" >#if 0 /* expanded by -frewrite-includes */ >#include <regex.h> >#endif /* expanded by -frewrite-includes */ ># 43 "../include/dps_common.h" >#endif ># 44 "../include/dps_common.h" >#endif ># 45 "../include/dps_common.h" > >#else /* defined(APACHE1) || defined(APACHE2) */ ># 47 "../include/dps_common.h" > >#ifndef _PCREPOSIX_H >#ifdef HAVE_TRE_REGEX_H >#if 0 /* expanded by -frewrite-includes */ >#include <tre/regex.h> >#endif /* expanded by -frewrite-includes */ ># 51 "../include/dps_common.h" >#else ># 52 "../include/dps_common.h" >#if 0 /* expanded by -frewrite-includes */ >#include <regex.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/regex.h" 1 3 4 >/*- > * Copyright (c) 1992 Henry Spencer. > * Copyright (c) 1992, 1993 > * The Regents of the University of California. All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * Henry Spencer of the University of Toronto. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)regex.h 8.2 (Berkeley) 1/3/94 > * $FreeBSD: releng/10.3/include/regex.h 228468 2011-12-13 13:32:56Z ed $ > */ > >#ifndef _REGEX_H_ >#define _REGEX_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 41 "/usr/include/regex.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 42 "/usr/include/regex.h" 3 4 > >/* types */ >typedef __off_t regoff_t; > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 50 "/usr/include/regex.h" 3 4 > >typedef struct { > int re_magic; > size_t re_nsub; /* number of parenthesized subexpressions */ > const char *re_endp; /* end pointer for REG_PEND */ > struct re_guts *re_g; /* none of your business :-) */ >} regex_t; > >typedef struct { > regoff_t rm_so; /* start of match */ > regoff_t rm_eo; /* end of match */ >} regmatch_t; > >/* regcomp() flags */ >#define REG_BASIC 0000 >#define REG_EXTENDED 0001 >#define REG_ICASE 0002 >#define REG_NOSUB 0004 >#define REG_NEWLINE 0010 >#define REG_NOSPEC 0020 >#define REG_PEND 0040 >#define REG_DUMP 0200 > >/* regerror() flags */ >#define REG_ENOSYS (-1) >#define REG_NOMATCH 1 >#define REG_BADPAT 2 >#define REG_ECOLLATE 3 >#define REG_ECTYPE 4 >#define REG_EESCAPE 5 >#define REG_ESUBREG 6 >#define REG_EBRACK 7 >#define REG_EPAREN 8 >#define REG_EBRACE 9 >#define REG_BADBR 10 >#define REG_ERANGE 11 >#define REG_ESPACE 12 >#define REG_BADRPT 13 >#define REG_EMPTY 14 >#define REG_ASSERT 15 >#define REG_INVARG 16 >#define REG_ILLSEQ 17 >#define REG_ATOI 255 /* convert name to number (!) */ >#define REG_ITOA 0400 /* convert number to name (!) */ > >/* regexec() flags */ >#define REG_NOTBOL 00001 >#define REG_NOTEOL 00002 >#define REG_STARTEND 00004 >#define REG_TRACE 00400 /* tracing of execution */ >#define REG_LARGE 01000 /* force large representation */ >#define REG_BACKR 02000 /* force use of backref code */ > >__BEGIN_DECLS >int regcomp(regex_t * __restrict, const char * __restrict, int); >size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t); >/* > * XXX forth parameter should be `regmatch_t [__restrict]', but isn't because > * of a bug in GCC 3.2 (when -std=c99 is specified) which perceives this as a > * syntax error. > */ >int regexec(const regex_t * __restrict, const char * __restrict, size_t, > regmatch_t * __restrict, int); >void regfree(regex_t *); >__END_DECLS > >#endif /* !_REGEX_H_ */ ># 117 "/usr/include/regex.h" 3 4 ># 53 "../include/dps_common.h" 2 >#endif ># 54 "../include/dps_common.h" >#endif ># 55 "../include/dps_common.h" > >#endif /* defined(APACHE1) || defined(APACHE2) */ ># 57 "../include/dps_common.h" > >#ifdef HAVE_LIMITS_H >#if 0 /* expanded by -frewrite-includes */ >#include <limits.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/limits.h" 1 3 4 >/*- > * Copyright (c) 1988, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)limits.h 8.2 (Berkeley) 1/4/94 > * $FreeBSD: releng/10.3/include/limits.h 293800 2016-01-13 01:32:04Z kevlo $ > */ > >#ifndef _LIMITS_H_ >#define _LIMITS_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/limits.h" 3 4 > >#if __POSIX_VISIBLE >#define _POSIX_ARG_MAX 4096 >#define _POSIX_LINK_MAX 8 >#define _POSIX_MAX_CANON 255 >#define _POSIX_MAX_INPUT 255 >#define _POSIX_NAME_MAX 14 >#define _POSIX_PIPE_BUF 512 >#define _POSIX_SSIZE_MAX 32767 >#define _POSIX_STREAM_MAX 8 > >#if __POSIX_VISIBLE >= 200112 >#define _POSIX_CHILD_MAX 25 >#define _POSIX_NGROUPS_MAX 8 >#define _POSIX_OPEN_MAX 20 >#define _POSIX_PATH_MAX 256 >#define _POSIX_TZNAME_MAX 6 >#else ># 55 "/usr/include/limits.h" 3 4 >#define _POSIX_CHILD_MAX 6 >#define _POSIX_NGROUPS_MAX 0 >#define _POSIX_OPEN_MAX 16 >#define _POSIX_PATH_MAX 255 >#define _POSIX_TZNAME_MAX 3 >#endif ># 61 "/usr/include/limits.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ >#define BC_DIM_MAX 2048 /* max array elements in bc(1) */ >#define BC_SCALE_MAX 99 /* max scale value in bc(1) */ >#define BC_STRING_MAX 1000 /* max const string length in bc(1) */ >#define CHARCLASS_NAME_MAX 14 /* max character class name size */ >#define COLL_WEIGHTS_MAX 10 /* max weights for order keyword */ >#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ >#define LINE_MAX 2048 /* max bytes in an input line */ >#define RE_DUP_MAX 255 /* max RE's in interval notation */ > >#define _POSIX2_BC_BASE_MAX 99 >#define _POSIX2_BC_DIM_MAX 2048 >#define _POSIX2_BC_SCALE_MAX 99 >#define _POSIX2_BC_STRING_MAX 1000 >#define _POSIX2_CHARCLASS_NAME_MAX 14 >#define _POSIX2_COLL_WEIGHTS_MAX 2 >#define _POSIX2_EQUIV_CLASS_MAX 2 >#define _POSIX2_EXPR_NEST_MAX 32 >#define _POSIX2_LINE_MAX 2048 >#define _POSIX2_RE_DUP_MAX 255 >#endif ># 84 "/usr/include/limits.h" 3 4 >#endif ># 85 "/usr/include/limits.h" 3 4 > >#if __POSIX_VISIBLE >= 199309 >#define _POSIX_AIO_LISTIO_MAX 2 >#define _POSIX_AIO_MAX 1 >#define _POSIX_DELAYTIMER_MAX 32 >#define _POSIX_MQ_OPEN_MAX 8 >#define _POSIX_MQ_PRIO_MAX 32 >#define _POSIX_RTSIG_MAX 8 >#define _POSIX_SEM_NSEMS_MAX 256 >#define _POSIX_SEM_VALUE_MAX 32767 >#define _POSIX_SIGQUEUE_MAX 32 >#define _POSIX_TIMER_MAX 32 > >#define _POSIX_CLOCKRES_MIN 20000000 >#endif ># 100 "/usr/include/limits.h" 3 4 > >#if __POSIX_VISIBLE >= 199506 >#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 >#define _POSIX_THREAD_KEYS_MAX 128 >#define _POSIX_THREAD_THREADS_MAX 64 >#endif ># 106 "/usr/include/limits.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >#define _POSIX_HOST_NAME_MAX 255 >#define _POSIX_LOGIN_NAME_MAX 9 >#define _POSIX_SS_REPL_MAX 4 >#define _POSIX_SYMLINK_MAX 255 >#define _POSIX_SYMLOOP_MAX 8 >#define _POSIX_TRACE_EVENT_NAME_MAX 30 >#define _POSIX_TRACE_NAME_MAX 8 >#define _POSIX_TRACE_SYS_MAX 8 >#define _POSIX_TRACE_USER_EVENT_MAX 32 >#define _POSIX_TTY_NAME_MAX 9 > >#define _POSIX_RE_DUP_MAX _POSIX2_RE_DUP_MAX >#endif ># 121 "/usr/include/limits.h" 3 4 > >#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809 >#define NL_ARGMAX 99 /* max # of position args for printf */ >#define NL_MSGMAX 32767 >#define NL_SETMAX 255 >#define NL_TEXTMAX 2048 >#endif ># 128 "/usr/include/limits.h" 3 4 > >#if __XSI_VISIBLE >#define _XOPEN_IOV_MAX 16 >#define _XOPEN_NAME_MAX 255 >#define _XOPEN_PATH_MAX 1024 >#define PASS_MAX 128 /* _PASSWORD_LEN from <pwd.h> */ > >#define NL_LANGMAX 31 /* max LANG name length */ >#define NL_NMAX 1 >#endif ># 138 "/usr/include/limits.h" 3 4 > >#define MB_LEN_MAX 6 /* 31-bit UTF-8 */ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/limits.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/limits.h" 1 3 4 >/*- > * Copyright (c) 1988, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/sys/limits.h 219271 2011-03-04 19:28:27Z jilles $ > */ > >#ifndef _SYS_LIMITS_H_ >#define _SYS_LIMITS_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 36 "/usr/include/sys/limits.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <machine/_limits.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/_limits.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/_limits.h 232262 2012-02-28 18:24:28Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/_limits.h> >#endif /* expanded by -frewrite-includes */ ># 7 "/usr/include/machine/_limits.h" 3 4 ># 37 "/usr/include/sys/limits.h" 2 3 4 > >#define CHAR_BIT __CHAR_BIT /* number of bits in a char */ > >#define SCHAR_MAX __SCHAR_MAX /* max value for a signed char */ >#define SCHAR_MIN __SCHAR_MIN /* min value for a signed char */ > >#define UCHAR_MAX __UCHAR_MAX /* max value for an unsigned char */ > >#ifdef __CHAR_UNSIGNED__ >#define CHAR_MAX UCHAR_MAX /* max value for a char */ >#define CHAR_MIN 0 /* min value for a char */ >#else ># 49 "/usr/include/sys/limits.h" 3 4 >#define CHAR_MAX SCHAR_MAX >#define CHAR_MIN SCHAR_MIN >#endif ># 52 "/usr/include/sys/limits.h" 3 4 > >#define USHRT_MAX __USHRT_MAX /* max value for an unsigned short */ >#define SHRT_MAX __SHRT_MAX /* max value for a short */ >#define SHRT_MIN __SHRT_MIN /* min value for a short */ > >#define UINT_MAX __UINT_MAX /* max value for an unsigned int */ >#define INT_MAX __INT_MAX /* max value for an int */ >#define INT_MIN __INT_MIN /* min value for an int */ > >#define ULONG_MAX __ULONG_MAX /* max for an unsigned long */ >#define LONG_MAX __LONG_MAX /* max for a long */ >#define LONG_MIN __LONG_MIN /* min for a long */ > >#ifdef __LONG_LONG_SUPPORTED >#define ULLONG_MAX __ULLONG_MAX /* max for an unsigned long long */ >#define LLONG_MAX __LLONG_MAX /* max for a long long */ >#define LLONG_MIN __LLONG_MIN /* min for a long long */ >#endif ># 70 "/usr/include/sys/limits.h" 3 4 > >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SSIZE_MAX __SSIZE_MAX /* max value for an ssize_t */ >#endif ># 74 "/usr/include/sys/limits.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >#define SIZE_T_MAX __SIZE_T_MAX /* max value for a size_t */ > >#define OFF_MAX __OFF_MAX /* max value for an off_t */ >#define OFF_MIN __OFF_MIN /* min value for an off_t */ >#endif ># 81 "/usr/include/sys/limits.h" 3 4 > >#if __BSD_VISIBLE >#define GID_MAX UINT_MAX /* max value for a gid_t */ >#define UID_MAX UINT_MAX /* max value for a uid_t */ > >#define UQUAD_MAX (__UQUAD_MAX) /* max value for a uquad_t */ >#define QUAD_MAX (__QUAD_MAX) /* max value for a quad_t */ >#define QUAD_MIN (__QUAD_MIN) /* min value for a quad_t */ >#endif ># 90 "/usr/include/sys/limits.h" 3 4 > >#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809 >#define LONG_BIT __LONG_BIT >#define WORD_BIT __WORD_BIT >#endif ># 95 "/usr/include/sys/limits.h" 3 4 > >#if __POSIX_VISIBLE >#define MQ_PRIO_MAX 64 >#endif ># 99 "/usr/include/sys/limits.h" 3 4 > >#endif /* !_SYS_LIMITS_H_ */ ># 101 "/usr/include/sys/limits.h" 3 4 ># 142 "/usr/include/limits.h" 2 3 4 > >#if __POSIX_VISIBLE >#if 0 /* expanded by -frewrite-includes */ >#include <sys/syslimits.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/syslimits.h" 1 3 4 >/*- > * Copyright (c) 1988, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)syslimits.h 8.1 (Berkeley) 6/2/93 > * $FreeBSD: releng/10.3/sys/sys/syslimits.h 194498 2009-06-19 17:10:35Z brooks $ > */ > >#ifndef _SYS_SYSLIMITS_H_ >#define _SYS_SYSLIMITS_H_ > >#if !defined(_KERNEL) && !defined(_LIMITS_H_) && !defined(_SYS_PARAM_H_) >#ifndef _SYS_CDEFS_H_ >#error this file needs sys/cdefs.h as a prerequisite >#endif ># 40 "/usr/include/sys/syslimits.h" 3 4 >#ifdef __CC_SUPPORTS_WARNING >#warning "No user-serviceable parts inside." >#endif ># 43 "/usr/include/sys/syslimits.h" 3 4 >#endif ># 44 "/usr/include/sys/syslimits.h" 3 4 > >/* > * Do not add any new variables here. (See the comment at the end of > * the file for why.) > */ >#define ARG_MAX 262144 /* max bytes for an exec function */ >#ifndef CHILD_MAX >#define CHILD_MAX 40 /* max simultaneous processes */ >#endif ># 53 "/usr/include/sys/syslimits.h" 3 4 >#define LINK_MAX 32767 /* max file link count */ >#define MAX_CANON 255 /* max bytes in term canon input line */ >#define MAX_INPUT 255 /* max bytes in terminal input */ >#define NAME_MAX 255 /* max bytes in a file name */ >#ifndef NGROUPS_MAX >#define NGROUPS_MAX 1023 /* max supplemental group id's */ >#endif ># 60 "/usr/include/sys/syslimits.h" 3 4 >#ifndef OPEN_MAX >#define OPEN_MAX 64 /* max open files per process */ >#endif ># 63 "/usr/include/sys/syslimits.h" 3 4 >#define PATH_MAX 1024 /* max bytes in pathname */ >#define PIPE_BUF 512 /* max bytes for atomic pipe writes */ >#define IOV_MAX 1024 /* max elements in i/o vector */ > >/* > * We leave the following values undefined to force applications to either > * assume conservative values or call sysconf() to get the current value. > * > * HOST_NAME_MAX > * > * (We should do this for most of the values currently defined here, > * but many programs are not prepared to deal with this yet.) > */ >#endif ># 77 "/usr/include/sys/syslimits.h" 3 4 ># 145 "/usr/include/limits.h" 2 3 4 >#endif ># 146 "/usr/include/limits.h" 3 4 > >#endif /* !_LIMITS_H_ */ ># 148 "/usr/include/limits.h" 3 4 ># 60 "../include/dps_common.h" 2 >#endif ># 61 "../include/dps_common.h" >#ifdef HAVE_UNISTD_H >#if 0 /* expanded by -frewrite-includes */ >#include <unistd.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/unistd.h" 1 3 4 >/*- > * Copyright (c) 1991, 1993, 1994 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)unistd.h 8.12 (Berkeley) 4/27/95 > * $FreeBSD: releng/10.3/include/unistd.h 254409 2013-08-16 13:10:30Z jilles $ > */ > >#ifndef _UNISTD_H_ >#define _UNISTD_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/unistd.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> /* XXX adds too much pollution. */ >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/unistd.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/unistd.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/unistd.h" 1 3 4 >/*- > * Copyright (c) 1989, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)unistd.h 8.2 (Berkeley) 1/7/94 > * $FreeBSD: releng/10.3/sys/sys/unistd.h 239347 2012-08-17 02:26:31Z davidxu $ > */ > >#ifndef _SYS_UNISTD_H_ >#define _SYS_UNISTD_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/sys/unistd.h" 3 4 > >/* > * POSIX options and option groups we unconditionally do or don't > * implement. Those options which are implemented (or not) entirely > * in user mode are defined in <unistd.h>. Please keep this list in > * alphabetical order. > * > * Anything which is defined as zero below **must** have an > * implementation for the corresponding sysconf() which is able to > * determine conclusively whether or not the feature is supported. > * Anything which is defined as other than -1 below **must** have > * complete headers, types, and function declarations as specified by > * the POSIX standard; however, if the relevant sysconf() function > * returns -1, the functions may be stubbed out. > */ >#define _POSIX_ADVISORY_INFO 200112L >#define _POSIX_ASYNCHRONOUS_IO 0 >#define _POSIX_CHOWN_RESTRICTED 1 >#define _POSIX_CLOCK_SELECTION (-1) >#define _POSIX_CPUTIME 200112L >#define _POSIX_FSYNC 200112L >#define _POSIX_IPV6 0 >#define _POSIX_JOB_CONTROL 1 >#define _POSIX_MAPPED_FILES 200112L >#define _POSIX_MEMLOCK (-1) >#define _POSIX_MEMLOCK_RANGE 200112L >#define _POSIX_MEMORY_PROTECTION 200112L >#define _POSIX_MESSAGE_PASSING 200112L >#define _POSIX_MONOTONIC_CLOCK 200112L >#define _POSIX_NO_TRUNC 1 >#define _POSIX_PRIORITIZED_IO (-1) >#define _POSIX_PRIORITY_SCHEDULING 200112L >#define _POSIX_RAW_SOCKETS 200112L >#define _POSIX_REALTIME_SIGNALS 200112L >#define _POSIX_SEMAPHORES 200112L >#define _POSIX_SHARED_MEMORY_OBJECTS 200112L >#define _POSIX_SPORADIC_SERVER (-1) >#define _POSIX_SYNCHRONIZED_IO (-1) >#define _POSIX_TIMEOUTS 200112L >#define _POSIX_TIMERS 200112L >#define _POSIX_TYPED_MEMORY_OBJECTS (-1) >#define _POSIX_VDISABLE 0xff > >#if __XSI_VISIBLE >#define _XOPEN_SHM 1 >#define _XOPEN_STREAMS (-1) >#endif ># 84 "/usr/include/sys/unistd.h" 3 4 > >/* > * Although we have saved user/group IDs, we do not use them in setuid > * as described in POSIX 1003.1, because the feature does not work for > * root. We use the saved IDs in seteuid/setegid, which are not currently > * part of the POSIX 1003.1 specification. XXX revisit for 1003.1-2001 > * as this is now mandatory. > */ >#ifdef _NOT_AVAILABLE >#define _POSIX_SAVED_IDS 1 /* saved set-user-ID and set-group-ID */ >#endif ># 95 "/usr/include/sys/unistd.h" 3 4 > >/* Define the POSIX.1 version we target for compliance. */ >#define _POSIX_VERSION 200112L > >/* access function */ >#define F_OK 0 /* test for existence of file */ >#define X_OK 0x01 /* test for execute or search permission */ >#define W_OK 0x02 /* test for write permission */ >#define R_OK 0x04 /* test for read permission */ > >/* whence values for lseek(2) */ >#ifndef SEEK_SET >#define SEEK_SET 0 /* set file offset to offset */ >#define SEEK_CUR 1 /* set file offset to current plus offset */ >#define SEEK_END 2 /* set file offset to EOF plus offset */ >#endif ># 111 "/usr/include/sys/unistd.h" 3 4 >#if __BSD_VISIBLE >#define SEEK_DATA 3 /* set file offset to next data past offset */ >#define SEEK_HOLE 4 /* set file offset to next hole past offset */ >#endif ># 115 "/usr/include/sys/unistd.h" 3 4 > >#ifndef _POSIX_SOURCE >/* whence values for lseek(2); renamed by POSIX 1003.1 */ >#define L_SET SEEK_SET >#define L_INCR SEEK_CUR >#define L_XTND SEEK_END >#endif ># 122 "/usr/include/sys/unistd.h" 3 4 > >/* configurable pathname variables */ >#define _PC_LINK_MAX 1 >#define _PC_MAX_CANON 2 >#define _PC_MAX_INPUT 3 >#define _PC_NAME_MAX 4 >#define _PC_PATH_MAX 5 >#define _PC_PIPE_BUF 6 >#define _PC_CHOWN_RESTRICTED 7 >#define _PC_NO_TRUNC 8 >#define _PC_VDISABLE 9 > >#if __POSIX_VISIBLE >= 199309 >#define _PC_ASYNC_IO 53 >#define _PC_PRIO_IO 54 >#define _PC_SYNC_IO 55 >#endif ># 139 "/usr/include/sys/unistd.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >#define _PC_ALLOC_SIZE_MIN 10 >#define _PC_FILESIZEBITS 12 >#define _PC_REC_INCR_XFER_SIZE 14 >#define _PC_REC_MAX_XFER_SIZE 15 >#define _PC_REC_MIN_XFER_SIZE 16 >#define _PC_REC_XFER_ALIGN 17 >#define _PC_SYMLINK_MAX 18 >#endif ># 149 "/usr/include/sys/unistd.h" 3 4 > >#if __BSD_VISIBLE >#define _PC_ACL_EXTENDED 59 >#define _PC_ACL_PATH_MAX 60 >#define _PC_CAP_PRESENT 61 >#define _PC_INF_PRESENT 62 >#define _PC_MAC_PRESENT 63 >#define _PC_ACL_NFS4 64 >#endif ># 158 "/usr/include/sys/unistd.h" 3 4 > >/* From OpenSolaris, used by SEEK_DATA/SEEK_HOLE. */ >#define _PC_MIN_HOLE_SIZE 21 > >#if __BSD_VISIBLE >/* > * rfork() options. > * > * XXX currently, some operations without RFPROC set are not supported. > */ >#define RFNAMEG (1<<0) /* UNIMPL new plan9 `name space' */ >#define RFENVG (1<<1) /* UNIMPL copy plan9 `env space' */ >#define RFFDG (1<<2) /* copy fd table */ >#define RFNOTEG (1<<3) /* UNIMPL create new plan9 `note group' */ >#define RFPROC (1<<4) /* change child (else changes curproc) */ >#define RFMEM (1<<5) /* share `address space' */ >#define RFNOWAIT (1<<6) /* give child to init */ >#define RFCNAMEG (1<<10) /* UNIMPL zero plan9 `name space' */ >#define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */ >#define RFCFDG (1<<12) /* close all fds, zero fd table */ >#define RFTHREAD (1<<13) /* enable kernel thread support */ >#define RFSIGSHARE (1<<14) /* share signal handlers */ >#define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */ >#define RFSTOPPED (1<<17) /* leave child in a stopped state */ >#define RFHIGHPID (1<<18) /* use a pid higher than 10 (idleproc) */ >#define RFTSIGZMB (1<<19) /* select signal for exit parent notification */ >#define RFTSIGSHIFT 20 /* selected signal number is in bits 20-27 */ >#define RFTSIGMASK 0xFF >#define RFTSIGNUM(flags) (((flags) >> RFTSIGSHIFT) & RFTSIGMASK) >#define RFTSIGFLAGS(signum) ((signum) << RFTSIGSHIFT) >#define RFPROCDESC (1<<28) /* return a process descriptor */ >#define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */ >#define RFFLAGS (RFFDG | RFPROC | RFMEM | RFNOWAIT | RFCFDG | \ > RFTHREAD | RFSIGSHARE | RFLINUXTHPN | RFSTOPPED | RFHIGHPID | RFTSIGZMB | \ > RFPROCDESC | RFPPWAIT) >#define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPPWAIT | RFPROCDESC) > >#endif /* __BSD_VISIBLE */ ># 196 "/usr/include/sys/unistd.h" 3 4 > >#endif /* !_SYS_UNISTD_H_ */ ># 198 "/usr/include/sys/unistd.h" 3 4 ># 39 "/usr/include/unistd.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_null.h> >#endif /* expanded by -frewrite-includes */ ># 40 "/usr/include/unistd.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 41 "/usr/include/unistd.h" 3 4 > >#ifndef _GID_T_DECLARED >typedef __gid_t gid_t; >#define _GID_T_DECLARED >#endif ># 46 "/usr/include/unistd.h" 3 4 > >#ifndef _OFF_T_DECLARED >typedef __off_t off_t; >#define _OFF_T_DECLARED >#endif ># 51 "/usr/include/unistd.h" 3 4 > >#ifndef _PID_T_DECLARED >typedef __pid_t pid_t; >#define _PID_T_DECLARED >#endif ># 56 "/usr/include/unistd.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 61 "/usr/include/unistd.h" 3 4 > >#ifndef _SSIZE_T_DECLARED >typedef __ssize_t ssize_t; >#define _SSIZE_T_DECLARED >#endif ># 66 "/usr/include/unistd.h" 3 4 > >#ifndef _UID_T_DECLARED >typedef __uid_t uid_t; >#define _UID_T_DECLARED >#endif ># 71 "/usr/include/unistd.h" 3 4 > >#ifndef _USECONDS_T_DECLARED >typedef __useconds_t useconds_t; >#define _USECONDS_T_DECLARED >#endif ># 76 "/usr/include/unistd.h" 3 4 > >#define STDIN_FILENO 0 /* standard input file descriptor */ >#define STDOUT_FILENO 1 /* standard output file descriptor */ >#define STDERR_FILENO 2 /* standard error file descriptor */ > >#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 >#define F_ULOCK 0 /* unlock locked section */ >#define F_LOCK 1 /* lock a section for exclusive use */ >#define F_TLOCK 2 /* test and lock a section for exclusive use */ >#define F_TEST 3 /* test a section for locks by other procs */ >#endif ># 87 "/usr/include/unistd.h" 3 4 > >/* > * POSIX options and option groups we unconditionally do or don't > * implement. This list includes those options which are exclusively > * implemented (or not) in user mode. Please keep this list in > * alphabetical order. > * > * Anything which is defined as zero below **must** have an > * implementation for the corresponding sysconf() which is able to > * determine conclusively whether or not the feature is supported. > * Anything which is defined as other than -1 below **must** have > * complete headers, types, and function declarations as specified by > * the POSIX standard; however, if the relevant sysconf() function > * returns -1, the functions may be stubbed out. > */ >#define _POSIX_BARRIERS 200112L >#define _POSIX_CPUTIME 200112L >#define _POSIX_READER_WRITER_LOCKS 200112L >#define _POSIX_REGEXP 1 >#define _POSIX_SHELL 1 >#define _POSIX_SPAWN 200112L >#define _POSIX_SPIN_LOCKS 200112L >#define _POSIX_THREAD_ATTR_STACKADDR 200112L >#define _POSIX_THREAD_ATTR_STACKSIZE 200112L >#define _POSIX_THREAD_CPUTIME 200112L >#define _POSIX_THREAD_PRIO_INHERIT 200112L >#define _POSIX_THREAD_PRIO_PROTECT 200112L >#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L >#define _POSIX_THREAD_PROCESS_SHARED -1 >#define _POSIX_THREAD_SAFE_FUNCTIONS -1 >#define _POSIX_THREAD_SPORADIC_SERVER -1 >#define _POSIX_THREADS 200112L >#define _POSIX_TRACE -1 >#define _POSIX_TRACE_EVENT_FILTER -1 >#define _POSIX_TRACE_INHERIT -1 >#define _POSIX_TRACE_LOG -1 >#define _POSIX2_C_BIND 200112L /* mandatory */ >#define _POSIX2_C_DEV -1 /* need c99 utility */ >#define _POSIX2_CHAR_TERM 1 >#define _POSIX2_FORT_DEV -1 /* need fort77 utility */ >#define _POSIX2_FORT_RUN 200112L >#define _POSIX2_LOCALEDEF -1 >#define _POSIX2_PBS -1 >#define _POSIX2_PBS_ACCOUNTING -1 >#define _POSIX2_PBS_CHECKPOINT -1 >#define _POSIX2_PBS_LOCATE -1 >#define _POSIX2_PBS_MESSAGE -1 >#define _POSIX2_PBS_TRACK -1 >#define _POSIX2_SW_DEV -1 /* XXX ??? */ >#define _POSIX2_UPE 200112L >#define _V6_ILP32_OFF32 -1 >#define _V6_ILP32_OFFBIG 0 >#define _V6_LP64_OFF64 0 >#define _V6_LPBIG_OFFBIG -1 > >#if __XSI_VISIBLE >#define _XOPEN_CRYPT -1 /* XXX ??? */ >#define _XOPEN_ENH_I18N -1 /* mandatory in XSI */ >#define _XOPEN_LEGACY -1 >#define _XOPEN_REALTIME -1 >#define _XOPEN_REALTIME_THREADS -1 >#define _XOPEN_UNIX -1 >#endif ># 150 "/usr/include/unistd.h" 3 4 > >/* Define the POSIX.2 version we target for compliance. */ >#define _POSIX2_VERSION 199212L > >/* > * POSIX-style system configuration variable accessors (for the > * sysconf function). The kernel does not directly implement the > * sysconf() interface; rather, a C library stub translates references > * to sysconf() into calls to sysctl() using a giant switch statement. > * Those that are marked `user' are implemented entirely in the C > * library and never query the kernel. pathconf() is implemented > * directly by the kernel so those are not defined here. > */ >#define _SC_ARG_MAX 1 >#define _SC_CHILD_MAX 2 >#define _SC_CLK_TCK 3 >#define _SC_NGROUPS_MAX 4 >#define _SC_OPEN_MAX 5 >#define _SC_JOB_CONTROL 6 >#define _SC_SAVED_IDS 7 >#define _SC_VERSION 8 >#define _SC_BC_BASE_MAX 9 /* user */ >#define _SC_BC_DIM_MAX 10 /* user */ >#define _SC_BC_SCALE_MAX 11 /* user */ >#define _SC_BC_STRING_MAX 12 /* user */ >#define _SC_COLL_WEIGHTS_MAX 13 /* user */ >#define _SC_EXPR_NEST_MAX 14 /* user */ >#define _SC_LINE_MAX 15 /* user */ >#define _SC_RE_DUP_MAX 16 /* user */ >#define _SC_2_VERSION 17 /* user */ >#define _SC_2_C_BIND 18 /* user */ >#define _SC_2_C_DEV 19 /* user */ >#define _SC_2_CHAR_TERM 20 /* user */ >#define _SC_2_FORT_DEV 21 /* user */ >#define _SC_2_FORT_RUN 22 /* user */ >#define _SC_2_LOCALEDEF 23 /* user */ >#define _SC_2_SW_DEV 24 /* user */ >#define _SC_2_UPE 25 /* user */ >#define _SC_STREAM_MAX 26 /* user */ >#define _SC_TZNAME_MAX 27 /* user */ > >#if __POSIX_VISIBLE >= 199309 >#define _SC_ASYNCHRONOUS_IO 28 >#define _SC_MAPPED_FILES 29 >#define _SC_MEMLOCK 30 >#define _SC_MEMLOCK_RANGE 31 >#define _SC_MEMORY_PROTECTION 32 >#define _SC_MESSAGE_PASSING 33 >#define _SC_PRIORITIZED_IO 34 >#define _SC_PRIORITY_SCHEDULING 35 >#define _SC_REALTIME_SIGNALS 36 >#define _SC_SEMAPHORES 37 >#define _SC_FSYNC 38 >#define _SC_SHARED_MEMORY_OBJECTS 39 >#define _SC_SYNCHRONIZED_IO 40 >#define _SC_TIMERS 41 >#define _SC_AIO_LISTIO_MAX 42 >#define _SC_AIO_MAX 43 >#define _SC_AIO_PRIO_DELTA_MAX 44 >#define _SC_DELAYTIMER_MAX 45 >#define _SC_MQ_OPEN_MAX 46 >#define _SC_PAGESIZE 47 >#define _SC_RTSIG_MAX 48 >#define _SC_SEM_NSEMS_MAX 49 >#define _SC_SEM_VALUE_MAX 50 >#define _SC_SIGQUEUE_MAX 51 >#define _SC_TIMER_MAX 52 >#endif ># 218 "/usr/include/unistd.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >#define _SC_2_PBS 59 /* user */ >#define _SC_2_PBS_ACCOUNTING 60 /* user */ >#define _SC_2_PBS_CHECKPOINT 61 /* user */ >#define _SC_2_PBS_LOCATE 62 /* user */ >#define _SC_2_PBS_MESSAGE 63 /* user */ >#define _SC_2_PBS_TRACK 64 /* user */ >#define _SC_ADVISORY_INFO 65 >#define _SC_BARRIERS 66 /* user */ >#define _SC_CLOCK_SELECTION 67 >#define _SC_CPUTIME 68 >#define _SC_FILE_LOCKING 69 >#define _SC_GETGR_R_SIZE_MAX 70 /* user */ >#define _SC_GETPW_R_SIZE_MAX 71 /* user */ >#define _SC_HOST_NAME_MAX 72 >#define _SC_LOGIN_NAME_MAX 73 >#define _SC_MONOTONIC_CLOCK 74 >#define _SC_MQ_PRIO_MAX 75 >#define _SC_READER_WRITER_LOCKS 76 /* user */ >#define _SC_REGEXP 77 /* user */ >#define _SC_SHELL 78 /* user */ >#define _SC_SPAWN 79 /* user */ >#define _SC_SPIN_LOCKS 80 /* user */ >#define _SC_SPORADIC_SERVER 81 >#define _SC_THREAD_ATTR_STACKADDR 82 /* user */ >#define _SC_THREAD_ATTR_STACKSIZE 83 /* user */ >#define _SC_THREAD_CPUTIME 84 /* user */ >#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */ >#define _SC_THREAD_KEYS_MAX 86 /* user */ >#define _SC_THREAD_PRIO_INHERIT 87 /* user */ >#define _SC_THREAD_PRIO_PROTECT 88 /* user */ >#define _SC_THREAD_PRIORITY_SCHEDULING 89 /* user */ >#define _SC_THREAD_PROCESS_SHARED 90 /* user */ >#define _SC_THREAD_SAFE_FUNCTIONS 91 /* user */ >#define _SC_THREAD_SPORADIC_SERVER 92 /* user */ >#define _SC_THREAD_STACK_MIN 93 /* user */ >#define _SC_THREAD_THREADS_MAX 94 /* user */ >#define _SC_TIMEOUTS 95 /* user */ >#define _SC_THREADS 96 /* user */ >#define _SC_TRACE 97 /* user */ >#define _SC_TRACE_EVENT_FILTER 98 /* user */ >#define _SC_TRACE_INHERIT 99 /* user */ >#define _SC_TRACE_LOG 100 /* user */ >#define _SC_TTY_NAME_MAX 101 /* user */ >#define _SC_TYPED_MEMORY_OBJECTS 102 >#define _SC_V6_ILP32_OFF32 103 /* user */ >#define _SC_V6_ILP32_OFFBIG 104 /* user */ >#define _SC_V6_LP64_OFF64 105 /* user */ >#define _SC_V6_LPBIG_OFFBIG 106 /* user */ >#define _SC_IPV6 118 >#define _SC_RAW_SOCKETS 119 >#define _SC_SYMLOOP_MAX 120 >#endif ># 272 "/usr/include/unistd.h" 3 4 > >#if __XSI_VISIBLE >#define _SC_ATEXIT_MAX 107 /* user */ >#define _SC_IOV_MAX 56 >#define _SC_PAGE_SIZE _SC_PAGESIZE >#define _SC_XOPEN_CRYPT 108 /* user */ >#define _SC_XOPEN_ENH_I18N 109 /* user */ >#define _SC_XOPEN_LEGACY 110 /* user */ >#define _SC_XOPEN_REALTIME 111 >#define _SC_XOPEN_REALTIME_THREADS 112 >#define _SC_XOPEN_SHM 113 >#define _SC_XOPEN_STREAMS 114 >#define _SC_XOPEN_UNIX 115 >#define _SC_XOPEN_VERSION 116 >#define _SC_XOPEN_XCU_VERSION 117 /* user */ >#endif ># 288 "/usr/include/unistd.h" 3 4 > >#if __BSD_VISIBLE >#define _SC_NPROCESSORS_CONF 57 >#define _SC_NPROCESSORS_ONLN 58 >#define _SC_CPUSET_SIZE 122 >#endif ># 294 "/usr/include/unistd.h" 3 4 > >/* Extensions found in Solaris and Linux. */ >#define _SC_PHYS_PAGES 121 > >/* Keys for the confstr(3) function. */ >#if __POSIX_VISIBLE >= 199209 >#define _CS_PATH 1 /* default value of PATH */ >#endif ># 302 "/usr/include/unistd.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 >#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3 >#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4 >#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5 >#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6 >#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7 >#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8 >#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9 >#define _CS_POSIX_V6_LP64_OFF64_LIBS 10 >#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11 >#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12 >#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13 >#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14 >#endif ># 318 "/usr/include/unistd.h" 3 4 > >__BEGIN_DECLS >/* 1003.1-1990 */ >void _exit(int) __dead2; >int access(const char *, int); >unsigned int alarm(unsigned int); >int chdir(const char *); >int chown(const char *, uid_t, gid_t); >int close(int); >void closefrom(int); >int dup(int); >int dup2(int, int); >int execl(const char *, const char *, ...); >int execle(const char *, const char *, ...); >int execlp(const char *, const char *, ...); >int execv(const char *, char * const *); >int execve(const char *, char * const *, char * const *); >int execvp(const char *, char * const *); >pid_t fork(void); >long fpathconf(int, int); >char *getcwd(char *, size_t); >gid_t getegid(void); >uid_t geteuid(void); >gid_t getgid(void); >int getgroups(int, gid_t []); >char *getlogin(void); >pid_t getpgrp(void); >pid_t getpid(void); >pid_t getppid(void); >uid_t getuid(void); >int isatty(int); >int link(const char *, const char *); >#ifndef _LSEEK_DECLARED >#define _LSEEK_DECLARED >off_t lseek(int, off_t, int); >#endif ># 354 "/usr/include/unistd.h" 3 4 >long pathconf(const char *, int); >int pause(void); >int pipe(int *); >ssize_t read(int, void *, size_t); >int rmdir(const char *); >int setgid(gid_t); >int setpgid(pid_t, pid_t); >pid_t setsid(void); >int setuid(uid_t); >unsigned int sleep(unsigned int); >long sysconf(int); >pid_t tcgetpgrp(int); >int tcsetpgrp(int, pid_t); >char *ttyname(int); >int ttyname_r(int, char *, size_t); >int unlink(const char *); >ssize_t write(int, const void *, size_t); > >/* 1003.2-1992 */ >#if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE >size_t confstr(int, char *, size_t); >#ifndef _GETOPT_DECLARED >#define _GETOPT_DECLARED >int getopt(int, char * const [], const char *); > >extern char *optarg; /* getopt(3) external variables */ >extern int optind, opterr, optopt; >#endif /* _GETOPT_DECLARED */ ># 382 "/usr/include/unistd.h" 3 4 >#endif ># 383 "/usr/include/unistd.h" 3 4 > >/* ISO/IEC 9945-1: 1996 */ >#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >int fsync(int); > >/* > * ftruncate() was in the POSIX Realtime Extension (it's used for shared > * memory), but truncate() was not. > */ >#ifndef _FTRUNCATE_DECLARED >#define _FTRUNCATE_DECLARED >int ftruncate(int, off_t); >#endif ># 396 "/usr/include/unistd.h" 3 4 >#endif ># 397 "/usr/include/unistd.h" 3 4 > >#if __POSIX_VISIBLE >= 199506 >int getlogin_r(char *, int); >#endif ># 401 "/usr/include/unistd.h" 3 4 > >/* 1003.1-2001 */ >#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >int fchown(int, uid_t, gid_t); >ssize_t readlink(const char * __restrict, char * __restrict, size_t); >#endif ># 407 "/usr/include/unistd.h" 3 4 >#if __POSIX_VISIBLE >= 200112 >int gethostname(char *, size_t); >int setegid(gid_t); >int seteuid(uid_t); >#endif ># 412 "/usr/include/unistd.h" 3 4 > >/* 1003.1-2008 */ >#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >int getsid(pid_t _pid); >int fchdir(int); >int getpgid(pid_t _pid); >int lchown(const char *, uid_t, gid_t); >ssize_t pread(int, void *, size_t, off_t); >ssize_t pwrite(int, const void *, size_t, off_t); > >/* See comment at ftruncate() above. */ >#ifndef _TRUNCATE_DECLARED >#define _TRUNCATE_DECLARED >int truncate(const char *, off_t); >#endif ># 427 "/usr/include/unistd.h" 3 4 >#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */ ># 428 "/usr/include/unistd.h" 3 4 > >#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE >int faccessat(int, const char *, int, int); >int fchownat(int, const char *, uid_t, gid_t, int); >int fexecve(int, char *const [], char *const []); >int linkat(int, const char *, int, const char *, int); >ssize_t readlinkat(int, const char * __restrict, char * __restrict, size_t); >int symlinkat(const char *, int, const char *); >int unlinkat(int, const char *, int); >#endif /* __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE */ ># 438 "/usr/include/unistd.h" 3 4 > >/* > * symlink() was originally in POSIX.1a, which was withdrawn after > * being overtaken by events (1003.1-2001). It was in XPG4.2, and of > * course has been in BSD since 4.2. > */ >#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE >int symlink(const char * __restrict, const char * __restrict); >#endif ># 447 "/usr/include/unistd.h" 3 4 > >/* X/Open System Interfaces */ >#if __XSI_VISIBLE >char *crypt(const char *, const char *); >/* char *ctermid(char *); */ /* XXX ??? */ >int encrypt(char *, int); >long gethostid(void); >int lockf(int, int, off_t); >int nice(int); >int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ >int setregid(gid_t, gid_t); >int setreuid(uid_t, uid_t); > >#ifndef _SWAB_DECLARED >#define _SWAB_DECLARED >void swab(const void * __restrict, void * __restrict, ssize_t); >#endif /* _SWAB_DECLARED */ ># 464 "/usr/include/unistd.h" 3 4 > >void sync(void); > >#endif /* __XSI_VISIBLE */ ># 468 "/usr/include/unistd.h" 3 4 > >#if (__XSI_VISIBLE && __XSI_VISIBLE <= 500) || __BSD_VISIBLE >int brk(const void *); >int chroot(const char *); >int getdtablesize(void); >int getpagesize(void) __pure2; >char *getpass(const char *); >void *sbrk(intptr_t); >#endif ># 477 "/usr/include/unistd.h" 3 4 > >#if (__XSI_VISIBLE && __XSI_VISIBLE <= 600) || __BSD_VISIBLE >char *getwd(char *); /* obsoleted by getcwd() */ >useconds_t > ualarm(useconds_t, useconds_t); >int usleep(useconds_t); >pid_t vfork(void) __returns_twice; >#endif ># 485 "/usr/include/unistd.h" 3 4 > >#if __BSD_VISIBLE >struct timeval; /* select(2) */ >int acct(const char *); >int async_daemon(void); >int check_utility_compat(const char *); >const char * > crypt_get_format(void); >int crypt_set_format(const char *); >int des_cipher(const char *, char *, long, int); >int des_setkey(const char *key); >int dup3(int, int, int); >int eaccess(const char *, int); >void endusershell(void); >int exect(const char *, char * const *, char * const *); >int execvP(const char *, const char *, char * const *); >int feature_present(const char *); >char *fflagstostr(u_long); >int getdomainname(char *, int); >int getgrouplist(const char *, gid_t, gid_t *, int *); >int getloginclass(char *, size_t); >mode_t getmode(const void *, mode_t); >int getosreldate(void); >int getpeereid(int, uid_t *, gid_t *); >int getresgid(gid_t *, gid_t *, gid_t *); >int getresuid(uid_t *, uid_t *, uid_t *); >char *getusershell(void); >int initgroups(const char *, gid_t); >int iruserok(unsigned long, int, const char *, const char *); >int iruserok_sa(const void *, int, int, const char *, const char *); >int issetugid(void); >void __FreeBSD_libc_enter_restricted_mode(void); >long lpathconf(const char *, int); >#ifndef _MKDTEMP_DECLARED >char *mkdtemp(char *); >#define _MKDTEMP_DECLARED >#endif ># 522 "/usr/include/unistd.h" 3 4 >#ifndef _MKNOD_DECLARED >int mknod(const char *, mode_t, dev_t); >#define _MKNOD_DECLARED >#endif ># 526 "/usr/include/unistd.h" 3 4 >#ifndef _MKSTEMP_DECLARED >int mkstemp(char *); >#define _MKSTEMP_DECLARED >#endif ># 530 "/usr/include/unistd.h" 3 4 >int mkstemps(char *, int); >#ifndef _MKTEMP_DECLARED >char *mktemp(char *); >#define _MKTEMP_DECLARED >#endif ># 535 "/usr/include/unistd.h" 3 4 >int nfssvc(int, void *); >int nlm_syscall(int, int, int, char **); >int pipe2(int *, int); >int profil(char *, size_t, vm_offset_t, int); >int rcmd(char **, int, const char *, const char *, const char *, int *); >int rcmd_af(char **, int, const char *, > const char *, const char *, int *, int); >int rcmdsh(char **, int, const char *, > const char *, const char *, const char *); >char *re_comp(const char *); >int re_exec(const char *); >int reboot(int); >int revoke(const char *); >pid_t rfork(int); >pid_t rfork_thread(int, void *, int (*)(void *), void *); >int rresvport(int *); >int rresvport_af(int *, int); >int ruserok(const char *, int, const char *, const char *); >#if __BSD_VISIBLE >#ifndef _SELECT_DECLARED >#define _SELECT_DECLARED >int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); >#endif ># 558 "/usr/include/unistd.h" 3 4 >#endif ># 559 "/usr/include/unistd.h" 3 4 >int setdomainname(const char *, int); >int setgroups(int, const gid_t *); >void sethostid(long); >int sethostname(const char *, int); >#ifndef _SETKEY_DECLARED >int setkey(const char *); >#define _SETKEY_DECLARED >#endif ># 567 "/usr/include/unistd.h" 3 4 >int setlogin(const char *); >int setloginclass(const char *); >void *setmode(const char *); >void setproctitle(const char *_fmt, ...) __printf0like(1, 2); >int setresgid(gid_t, gid_t, gid_t); >int setresuid(uid_t, uid_t, uid_t); >int setrgid(gid_t); >int setruid(uid_t); >void setusershell(void); >int strtofflags(char **, u_long *, u_long *); >int swapon(const char *); >int swapoff(const char *); >int syscall(int, ...); >off_t __syscall(quad_t, ...); >int undelete(const char *); >int unwhiteout(const char *); >void *valloc(size_t); /* obsoleted by malloc() */ > >#ifndef _OPTRESET_DECLARED >#define _OPTRESET_DECLARED >extern int optreset; /* getopt(3) external variable */ >#endif ># 589 "/usr/include/unistd.h" 3 4 >#endif /* __BSD_VISIBLE */ ># 590 "/usr/include/unistd.h" 3 4 >__END_DECLS > >#endif /* !_UNISTD_H_ */ ># 593 "/usr/include/unistd.h" 3 4 ># 63 "../include/dps_common.h" 2 >#endif ># 64 "../include/dps_common.h" >#ifdef HAVE_BSD_UNISTD_H >#if 0 /* expanded by -frewrite-includes */ >#include <bsd/unistd.h> >#endif /* expanded by -frewrite-includes */ ># 66 "../include/dps_common.h" >#endif ># 67 "../include/dps_common.h" >#ifdef HAVE_SYS_TIME_H >#if 0 /* expanded by -frewrite-includes */ >#include <sys/time.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/time.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)time.h 8.5 (Berkeley) 5/4/95 > * $FreeBSD: releng/10.3/sys/sys/time.h 270240 2014-08-20 18:40:29Z davide $ > */ > >#ifndef _SYS_TIME_H_ >#define _SYS_TIME_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_timeval.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/sys/time.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/sys/time.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/timespec.h> >#endif /* expanded by -frewrite-includes */ ># 39 "/usr/include/sys/time.h" 3 4 > >struct timezone { > int tz_minuteswest; /* minutes west of Greenwich */ > int tz_dsttime; /* type of dst correction */ >}; >#define DST_NONE 0 /* not on dst */ >#define DST_USA 1 /* USA style dst */ >#define DST_AUST 2 /* Australian style dst */ >#define DST_WET 3 /* Western European dst */ >#define DST_MET 4 /* Middle European dst */ >#define DST_EET 5 /* Eastern European dst */ >#define DST_CAN 6 /* Canada */ > >#if __BSD_VISIBLE >struct bintime { > time_t sec; > uint64_t frac; >}; > >static __inline void >bintime_addx(struct bintime *_bt, uint64_t _x) >{ > uint64_t _u; > > _u = _bt->frac; > _bt->frac += _x; > if (_u > _bt->frac) > _bt->sec++; >} > >static __inline void >bintime_add(struct bintime *_bt, const struct bintime *_bt2) >{ > uint64_t _u; > > _u = _bt->frac; > _bt->frac += _bt2->frac; > if (_u > _bt->frac) > _bt->sec++; > _bt->sec += _bt2->sec; >} > >static __inline void >bintime_sub(struct bintime *_bt, const struct bintime *_bt2) >{ > uint64_t _u; > > _u = _bt->frac; > _bt->frac -= _bt2->frac; > if (_u < _bt->frac) > _bt->sec--; > _bt->sec -= _bt2->sec; >} > >static __inline void >bintime_mul(struct bintime *_bt, u_int _x) >{ > uint64_t _p1, _p2; > > _p1 = (_bt->frac & 0xffffffffull) * _x; > _p2 = (_bt->frac >> 32) * _x + (_p1 >> 32); > _bt->sec *= _x; > _bt->sec += (_p2 >> 32); > _bt->frac = (_p2 << 32) | (_p1 & 0xffffffffull); >} > >static __inline void >bintime_shift(struct bintime *_bt, int _exp) >{ > > if (_exp > 0) { > _bt->sec <<= _exp; > _bt->sec |= _bt->frac >> (64 - _exp); > _bt->frac <<= _exp; > } else if (_exp < 0) { > _bt->frac >>= -_exp; > _bt->frac |= (uint64_t)_bt->sec << (64 + _exp); > _bt->sec >>= -_exp; > } >} > >#define bintime_clear(a) ((a)->sec = (a)->frac = 0) >#define bintime_isset(a) ((a)->sec || (a)->frac) >#define bintime_cmp(a, b, cmp) \ > (((a)->sec == (b)->sec) ? \ > ((a)->frac cmp (b)->frac) : \ > ((a)->sec cmp (b)->sec)) > >#define SBT_1S ((sbintime_t)1 << 32) >#define SBT_1M (SBT_1S * 60) >#define SBT_1MS (SBT_1S / 1000) >#define SBT_1US (SBT_1S / 1000000) >#define SBT_1NS (SBT_1S / 1000000000) >#define SBT_MAX 0x7fffffffffffffff > >static __inline int >sbintime_getsec(sbintime_t _sbt) >{ > > return (_sbt >> 32); >} > >static __inline sbintime_t >bttosbt(const struct bintime _bt) >{ > > return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32)); >} > >static __inline struct bintime >sbttobt(sbintime_t _sbt) >{ > struct bintime _bt; > > _bt.sec = _sbt >> 32; > _bt.frac = _sbt << 32; > return (_bt); >} > >/*- > * Background information: > * > * When converting between timestamps on parallel timescales of differing > * resolutions it is historical and scientific practice to round down rather > * than doing 4/5 rounding. > * > * The date changes at midnight, not at noon. > * > * Even at 15:59:59.999999999 it's not four'o'clock. > * > * time_second ticks after N.999999999 not after N.4999999999 > */ > >static __inline void >bintime2timespec(const struct bintime *_bt, struct timespec *_ts) >{ > > _ts->tv_sec = _bt->sec; > _ts->tv_nsec = ((uint64_t)1000000000 * > (uint32_t)(_bt->frac >> 32)) >> 32; >} > >static __inline void >timespec2bintime(const struct timespec *_ts, struct bintime *_bt) >{ > > _bt->sec = _ts->tv_sec; > /* 18446744073 = int(2^64 / 1000000000) */ > _bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL; >} > >static __inline void >bintime2timeval(const struct bintime *_bt, struct timeval *_tv) >{ > > _tv->tv_sec = _bt->sec; > _tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32; >} > >static __inline void >timeval2bintime(const struct timeval *_tv, struct bintime *_bt) >{ > > _bt->sec = _tv->tv_sec; > /* 18446744073709 = int(2^64 / 1000000) */ > _bt->frac = _tv->tv_usec * (uint64_t)18446744073709LL; >} > >static __inline struct timespec >sbttots(sbintime_t _sbt) >{ > struct timespec _ts; > > _ts.tv_sec = _sbt >> 32; > _ts.tv_nsec = ((uint64_t)1000000000 * (uint32_t)_sbt) >> 32; > return (_ts); >} > >static __inline sbintime_t >tstosbt(struct timespec _ts) >{ > > return (((sbintime_t)_ts.tv_sec << 32) + > (_ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32)); >} > >static __inline struct timeval >sbttotv(sbintime_t _sbt) >{ > struct timeval _tv; > > _tv.tv_sec = _sbt >> 32; > _tv.tv_usec = ((uint64_t)1000000 * (uint32_t)_sbt) >> 32; > return (_tv); >} > >static __inline sbintime_t >tvtosbt(struct timeval _tv) >{ > > return (((sbintime_t)_tv.tv_sec << 32) + > (_tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32)); >} >#endif /* __BSD_VISIBLE */ ># 243 "/usr/include/sys/time.h" 3 4 > >#ifdef _KERNEL > >/* Operations on timespecs */ >#define timespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0) >#define timespecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec) >#define timespeccmp(tvp, uvp, cmp) \ > (((tvp)->tv_sec == (uvp)->tv_sec) ? \ > ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ > ((tvp)->tv_sec cmp (uvp)->tv_sec)) >#define timespecadd(vvp, uvp) \ > do { \ > (vvp)->tv_sec += (uvp)->tv_sec; \ > (vvp)->tv_nsec += (uvp)->tv_nsec; \ > if ((vvp)->tv_nsec >= 1000000000) { \ > (vvp)->tv_sec++; \ > (vvp)->tv_nsec -= 1000000000; \ > } \ > } while (0) >#define timespecsub(vvp, uvp) \ > do { \ > (vvp)->tv_sec -= (uvp)->tv_sec; \ > (vvp)->tv_nsec -= (uvp)->tv_nsec; \ > if ((vvp)->tv_nsec < 0) { \ > (vvp)->tv_sec--; \ > (vvp)->tv_nsec += 1000000000; \ > } \ > } while (0) > >/* Operations on timevals. */ > >#define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) >#define timevalisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) >#define timevalcmp(tvp, uvp, cmp) \ > (((tvp)->tv_sec == (uvp)->tv_sec) ? \ > ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ > ((tvp)->tv_sec cmp (uvp)->tv_sec)) > >/* timevaladd and timevalsub are not inlined */ > >#endif /* _KERNEL */ ># 284 "/usr/include/sys/time.h" 3 4 > >#ifndef _KERNEL /* NetBSD/OpenBSD compatible interfaces */ > >#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) >#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) >#define timercmp(tvp, uvp, cmp) \ > (((tvp)->tv_sec == (uvp)->tv_sec) ? \ > ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ > ((tvp)->tv_sec cmp (uvp)->tv_sec)) >#define timeradd(tvp, uvp, vvp) \ > do { \ > (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ > (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ > if ((vvp)->tv_usec >= 1000000) { \ > (vvp)->tv_sec++; \ > (vvp)->tv_usec -= 1000000; \ > } \ > } while (0) >#define timersub(tvp, uvp, vvp) \ > do { \ > (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ > (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ > if ((vvp)->tv_usec < 0) { \ > (vvp)->tv_sec--; \ > (vvp)->tv_usec += 1000000; \ > } \ > } while (0) >#endif ># 312 "/usr/include/sys/time.h" 3 4 > >/* > * Names of the interval timers, and structure > * defining a timer setting. > */ >#define ITIMER_REAL 0 >#define ITIMER_VIRTUAL 1 >#define ITIMER_PROF 2 > >struct itimerval { > struct timeval it_interval; /* timer interval */ > struct timeval it_value; /* current value */ >}; > >/* > * Getkerninfo clock information structure > */ >struct clockinfo { > int hz; /* clock frequency */ > int tick; /* micro-seconds per hz tick */ > int spare; > int stathz; /* statistics clock frequency */ > int profhz; /* profiling clock frequency */ >}; > >/* These macros are also in time.h. */ >#ifndef CLOCK_REALTIME >#define CLOCK_REALTIME 0 >#define CLOCK_VIRTUAL 1 >#define CLOCK_PROF 2 >#define CLOCK_MONOTONIC 4 >#define CLOCK_UPTIME 5 /* FreeBSD-specific. */ >#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ >#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */ >#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */ >#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */ >#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */ >#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ >#define CLOCK_SECOND 13 /* FreeBSD-specific. */ >#define CLOCK_THREAD_CPUTIME_ID 14 >#define CLOCK_PROCESS_CPUTIME_ID 15 >#endif ># 354 "/usr/include/sys/time.h" 3 4 > >#ifndef TIMER_ABSTIME >#define TIMER_RELTIME 0x0 /* relative timer */ >#define TIMER_ABSTIME 0x1 /* absolute timer */ >#endif ># 359 "/usr/include/sys/time.h" 3 4 > >#if __BSD_VISIBLE >#define CPUCLOCK_WHICH_PID 0 >#define CPUCLOCK_WHICH_TID 1 >#endif ># 364 "/usr/include/sys/time.h" 3 4 > >#ifdef _KERNEL > >/* > * Kernel to clock driver interface. > */ >void inittodr(time_t base); >void resettodr(void); > >extern volatile time_t time_second; >extern volatile time_t time_uptime; >extern struct bintime boottimebin; >extern struct timeval boottime; >extern struct bintime tc_tick_bt; >extern sbintime_t tc_tick_sbt; >extern struct bintime tick_bt; >extern sbintime_t tick_sbt; >extern int tc_precexp; >extern int tc_timepercentage; >extern struct bintime bt_timethreshold; >extern struct bintime bt_tickthreshold; >extern sbintime_t sbt_timethreshold; >extern sbintime_t sbt_tickthreshold; > >/* > * Functions for looking at our clock: [get]{bin,nano,micro}[up]time() > * > * Functions without the "get" prefix returns the best timestamp > * we can produce in the given format. > * > * "bin" == struct bintime == seconds + 64 bit fraction of seconds. > * "nano" == struct timespec == seconds + nanoseconds. > * "micro" == struct timeval == seconds + microseconds. > * > * Functions containing "up" returns time relative to boot and > * should be used for calculating time intervals. > * > * Functions without "up" returns GMT time. > * > * Functions with the "get" prefix returns a less precise result > * much faster than the functions without "get" prefix and should > * be used where a precision of 1/hz seconds is acceptable or where > * performance is priority. (NB: "precision", _not_ "resolution" !) > */ > >void binuptime(struct bintime *bt); >void nanouptime(struct timespec *tsp); >void microuptime(struct timeval *tvp); > >static __inline sbintime_t >sbinuptime(void) >{ > struct bintime _bt; > > binuptime(&_bt); > return (bttosbt(_bt)); >} > >void bintime(struct bintime *bt); >void nanotime(struct timespec *tsp); >void microtime(struct timeval *tvp); > >void getbinuptime(struct bintime *bt); >void getnanouptime(struct timespec *tsp); >void getmicrouptime(struct timeval *tvp); > >static __inline sbintime_t >getsbinuptime(void) >{ > struct bintime _bt; > > getbinuptime(&_bt); > return (bttosbt(_bt)); >} > >void getbintime(struct bintime *bt); >void getnanotime(struct timespec *tsp); >void getmicrotime(struct timeval *tvp); > >/* Other functions */ >int itimerdecr(struct itimerval *itp, int usec); >int itimerfix(struct timeval *tv); >int ppsratecheck(struct timeval *, int *, int); >int ratecheck(struct timeval *, const struct timeval *); >void timevaladd(struct timeval *t1, const struct timeval *t2); >void timevalsub(struct timeval *t1, const struct timeval *t2); >int tvtohz(struct timeval *tv); > >#define TC_DEFAULTPERC 5 > >#define BT2FREQ(bt) \ > (((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ > ((bt)->frac >> 1)) > >#define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt)) > >#define FREQ2BT(freq, bt) \ >{ \ > (bt)->sec = 0; \ > (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ >} > >#define TIMESEL(sbt, sbt2) \ > (((sbt2) >= sbt_timethreshold) ? \ > ((*(sbt) = getsbinuptime()), 1) : ((*(sbt) = sbinuptime()), 0)) > >#else /* !_KERNEL */ ># 471 "/usr/include/sys/time.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <time.h> >#endif /* expanded by -frewrite-includes */ ># 472 "/usr/include/sys/time.h" 3 4 > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 474 "/usr/include/sys/time.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/select.h> >#endif /* expanded by -frewrite-includes */ ># 475 "/usr/include/sys/time.h" 3 4 > >__BEGIN_DECLS >int setitimer(int, const struct itimerval *, struct itimerval *); >int utimes(const char *, const struct timeval *); > >#if __BSD_VISIBLE >int adjtime(const struct timeval *, struct timeval *); >int clock_getcpuclockid2(id_t, int, clockid_t *); >int futimes(int, const struct timeval *); >int futimesat(int, const char *, const struct timeval [2]); >int lutimes(const char *, const struct timeval *); >int settimeofday(const struct timeval *, const struct timezone *); >#endif ># 488 "/usr/include/sys/time.h" 3 4 > >#if __XSI_VISIBLE >int getitimer(int, struct itimerval *); >int gettimeofday(struct timeval *, struct timezone *); >#endif ># 493 "/usr/include/sys/time.h" 3 4 > >__END_DECLS > >#endif /* !_KERNEL */ ># 497 "/usr/include/sys/time.h" 3 4 > >#endif /* !_SYS_TIME_H_ */ ># 499 "/usr/include/sys/time.h" 3 4 ># 69 "../include/dps_common.h" 2 >#endif ># 70 "../include/dps_common.h" >#ifdef HAVE_SYS_SOCKET_H >#if 0 /* expanded by -frewrite-includes */ >#include <sys/socket.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/socket.h" 1 3 4 >/*- > * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)socket.h 8.4 (Berkeley) 2/21/94 > * $FreeBSD: releng/10.3/sys/sys/socket.h 254925 2013-08-26 18:16:05Z jhb $ > */ > >#ifndef _SYS_SOCKET_H_ >#define _SYS_SOCKET_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/sys/socket.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/sys/socket.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_iovec.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_iovec.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1993, 1994 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)uio.h 8.5 (Berkeley) 2/22/94 > * $FreeBSD: releng/10.3/sys/sys/_iovec.h 139825 2005-01-07 02:29:27Z imp $ > */ > >#ifndef _SYS__IOVEC_H_ >#define _SYS__IOVEC_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/sys/_iovec.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 42 "/usr/include/sys/_iovec.h" 3 4 > >struct iovec { > void *iov_base; /* Base address. */ > size_t iov_len; /* Length. */ >}; > >#endif /* !_SYS__IOVEC_H_ */ ># 49 "/usr/include/sys/_iovec.h" 3 4 ># 39 "/usr/include/sys/socket.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <machine/_align.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/_align.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/_align.h 215856 2010-11-26 10:59:20Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/_align.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/x86/_align.h" 1 3 4 >/*- > * Copyright (c) 2001 David E. O'Brien > * Copyright (c) 1990 The Regents of the University of California. > * All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * William Jolitz. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. All advertising materials mentioning features or use of this software > * must display the following acknowledgement: > * This product includes software developed by the University of > * California, Berkeley and its contributors. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * from: @(#)param.h 5.8 (Berkeley) 6/28/91 > * $FreeBSD: releng/10.3/sys/x86/include/_align.h 215856 2010-11-26 10:59:20Z tijl $ > */ > >#ifndef _X86_INCLUDE__ALIGN_H_ >#define _X86_INCLUDE__ALIGN_H_ > >/* > * Round p (pointer or byte index) up to a correctly-aligned value > * for all data types (int, long, ...). The result is unsigned int > * and must be cast to any desired pointer type. > */ >#define _ALIGNBYTES (sizeof(register_t) - 1) >#define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) > >#endif /* !_X86_INCLUDE__ALIGN_H_ */ ># 53 "/usr/include/x86/_align.h" 3 4 ># 7 "/usr/include/machine/_align.h" 2 3 4 ># 40 "/usr/include/sys/socket.h" 2 3 4 > >/* > * Definitions related to sockets: types, address families, options. > */ > >/* > * Data types. > */ >#if __BSD_VISIBLE >#ifndef _GID_T_DECLARED >typedef __gid_t gid_t; >#define _GID_T_DECLARED >#endif ># 53 "/usr/include/sys/socket.h" 3 4 > >#ifndef _OFF_T_DECLARED >typedef __off_t off_t; >#define _OFF_T_DECLARED >#endif ># 58 "/usr/include/sys/socket.h" 3 4 > >#ifndef _PID_T_DECLARED >typedef __pid_t pid_t; >#define _PID_T_DECLARED >#endif ># 63 "/usr/include/sys/socket.h" 3 4 >#endif ># 64 "/usr/include/sys/socket.h" 3 4 > >#ifndef _SA_FAMILY_T_DECLARED >typedef __sa_family_t sa_family_t; >#define _SA_FAMILY_T_DECLARED >#endif ># 69 "/usr/include/sys/socket.h" 3 4 > >#ifndef _SOCKLEN_T_DECLARED >typedef __socklen_t socklen_t; >#define _SOCKLEN_T_DECLARED >#endif ># 74 "/usr/include/sys/socket.h" 3 4 > >#ifndef _SSIZE_T_DECLARED >typedef __ssize_t ssize_t; >#define _SSIZE_T_DECLARED >#endif ># 79 "/usr/include/sys/socket.h" 3 4 > >#if __BSD_VISIBLE >#ifndef _UID_T_DECLARED >typedef __uid_t uid_t; >#define _UID_T_DECLARED >#endif ># 85 "/usr/include/sys/socket.h" 3 4 >#endif ># 86 "/usr/include/sys/socket.h" 3 4 > >/* > * Types > */ >#define SOCK_STREAM 1 /* stream socket */ >#define SOCK_DGRAM 2 /* datagram socket */ >#define SOCK_RAW 3 /* raw-protocol interface */ >#if __BSD_VISIBLE >#define SOCK_RDM 4 /* reliably-delivered message */ >#endif ># 96 "/usr/include/sys/socket.h" 3 4 >#define SOCK_SEQPACKET 5 /* sequenced packet stream */ > >#if __BSD_VISIBLE >/* > * Creation flags, OR'ed into socket() and socketpair() type argument. > */ >#define SOCK_CLOEXEC 0x10000000 >#define SOCK_NONBLOCK 0x20000000 >#endif ># 105 "/usr/include/sys/socket.h" 3 4 > >/* > * Option flags per-socket. > */ >#define SO_DEBUG 0x0001 /* turn on debugging info recording */ >#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ >#define SO_REUSEADDR 0x0004 /* allow local address reuse */ >#define SO_KEEPALIVE 0x0008 /* keep connections alive */ >#define SO_DONTROUTE 0x0010 /* just use interface addresses */ >#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ >#if __BSD_VISIBLE >#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ >#endif ># 118 "/usr/include/sys/socket.h" 3 4 >#define SO_LINGER 0x0080 /* linger on close if data present */ >#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ >#if __BSD_VISIBLE >#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ >#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ >#define SO_NOSIGPIPE 0x0800 /* no SIGPIPE from EPIPE */ >#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ >#define SO_BINTIME 0x2000 /* timestamp received dgram traffic */ >#endif ># 127 "/usr/include/sys/socket.h" 3 4 >#define SO_NO_OFFLOAD 0x4000 /* socket cannot be offloaded */ >#define SO_NO_DDP 0x8000 /* disable direct data placement */ > >/* > * Additional options, not kept in so_options. > */ >#define SO_SNDBUF 0x1001 /* send buffer size */ >#define SO_RCVBUF 0x1002 /* receive buffer size */ >#define SO_SNDLOWAT 0x1003 /* send low-water mark */ >#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ >#define SO_SNDTIMEO 0x1005 /* send timeout */ >#define SO_RCVTIMEO 0x1006 /* receive timeout */ >#define SO_ERROR 0x1007 /* get error status and clear */ >#define SO_TYPE 0x1008 /* get socket type */ >#if __BSD_VISIBLE >#define SO_LABEL 0x1009 /* socket's MAC label */ >#define SO_PEERLABEL 0x1010 /* socket's peer's MAC label */ >#define SO_LISTENQLIMIT 0x1011 /* socket's backlog limit */ >#define SO_LISTENQLEN 0x1012 /* socket's complete queue length */ >#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ >#define SO_SETFIB 0x1014 /* use this FIB to route */ >#define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ >#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ >#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ >#endif ># 152 "/usr/include/sys/socket.h" 3 4 > >/* > * Space reserved for new socket options added by third-party vendors. > * This range applies to all socket option levels. New socket options > * in FreeBSD should always use an option value less than SO_VENDOR. > */ >#if __BSD_VISIBLE >#define SO_VENDOR 0x80000000 >#endif ># 161 "/usr/include/sys/socket.h" 3 4 > >/* > * Structure used for manipulating linger option. > */ >struct linger { > int l_onoff; /* option on/off */ > int l_linger; /* linger time */ >}; > >#if __BSD_VISIBLE >struct accept_filter_arg { > char af_name[16]; > char af_arg[256-16]; >}; >#endif ># 176 "/usr/include/sys/socket.h" 3 4 > >/* > * Level number for (get/set)sockopt() to apply to socket itself. > */ >#define SOL_SOCKET 0xffff /* options for socket level */ > >/* > * Address families. > */ >#define AF_UNSPEC 0 /* unspecified */ >#if __BSD_VISIBLE >#define AF_LOCAL AF_UNIX /* local to host (pipes, portals) */ >#endif ># 189 "/usr/include/sys/socket.h" 3 4 >#define AF_UNIX 1 /* standardized name for AF_LOCAL */ >#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ >#if __BSD_VISIBLE >#define AF_IMPLINK 3 /* arpanet imp addresses */ >#define AF_PUP 4 /* pup protocols: e.g. BSP */ >#define AF_CHAOS 5 /* mit CHAOS protocols */ >#define AF_NETBIOS 6 /* SMB protocols */ >#define AF_ISO 7 /* ISO protocols */ >#define AF_OSI AF_ISO >#define AF_ECMA 8 /* European computer manufacturers */ >#define AF_DATAKIT 9 /* datakit protocols */ >#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ >#define AF_SNA 11 /* IBM SNA */ >#define AF_DECnet 12 /* DECnet */ >#define AF_DLI 13 /* DEC Direct data link interface */ >#define AF_LAT 14 /* LAT */ >#define AF_HYLINK 15 /* NSC Hyperchannel */ >#define AF_APPLETALK 16 /* Apple Talk */ >#define AF_ROUTE 17 /* Internal Routing Protocol */ >#define AF_LINK 18 /* Link layer interface */ >#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ >#define AF_COIP 20 /* connection-oriented IP, aka ST II */ >#define AF_CNT 21 /* Computer Network Technology */ >#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ >#define AF_IPX 23 /* Novell Internet Protocol */ >#define AF_SIP 24 /* Simple Internet Protocol */ >#define pseudo_AF_PIP 25 /* Help Identify PIP packets */ >#define AF_ISDN 26 /* Integrated Services Digital Network*/ >#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ >#define pseudo_AF_KEY 27 /* Internal key-management function */ >#endif ># 220 "/usr/include/sys/socket.h" 3 4 >#define AF_INET6 28 /* IPv6 */ >#if __BSD_VISIBLE >#define AF_NATM 29 /* native ATM access */ >#define AF_ATM 30 /* ATM */ >#define pseudo_AF_HDRCMPLT 31 /* Used by BPF to not rewrite headers > * in interface output routine > */ >#define AF_NETGRAPH 32 /* Netgraph sockets */ >#define AF_SLOW 33 /* 802.3ad slow protocol */ >#define AF_SCLUSTER 34 /* Sitara cluster protocol */ >#define AF_ARP 35 >#define AF_BLUETOOTH 36 /* Bluetooth sockets */ >#define AF_IEEE80211 37 /* IEEE 802.11 protocol */ >#define AF_INET_SDP 40 /* OFED Socket Direct Protocol ipv4 */ >#define AF_INET6_SDP 42 /* OFED Socket Direct Protocol ipv6 */ >#define AF_MAX 42 >/* > * When allocating a new AF_ constant, please only allocate > * even numbered constants for FreeBSD until 134 as odd numbered AF_ > * constants 39-133 are now reserved for vendors. > */ >#define AF_VENDOR00 39 >#define AF_VENDOR01 41 >#define AF_VENDOR02 43 >#define AF_VENDOR03 45 >#define AF_VENDOR04 47 >#define AF_VENDOR05 49 >#define AF_VENDOR06 51 >#define AF_VENDOR07 53 >#define AF_VENDOR08 55 >#define AF_VENDOR09 57 >#define AF_VENDOR10 59 >#define AF_VENDOR11 61 >#define AF_VENDOR12 63 >#define AF_VENDOR13 65 >#define AF_VENDOR14 67 >#define AF_VENDOR15 69 >#define AF_VENDOR16 71 >#define AF_VENDOR17 73 >#define AF_VENDOR18 75 >#define AF_VENDOR19 77 >#define AF_VENDOR20 79 >#define AF_VENDOR21 81 >#define AF_VENDOR22 83 >#define AF_VENDOR23 85 >#define AF_VENDOR24 87 >#define AF_VENDOR25 89 >#define AF_VENDOR26 91 >#define AF_VENDOR27 93 >#define AF_VENDOR28 95 >#define AF_VENDOR29 97 >#define AF_VENDOR30 99 >#define AF_VENDOR31 101 >#define AF_VENDOR32 103 >#define AF_VENDOR33 105 >#define AF_VENDOR34 107 >#define AF_VENDOR35 109 >#define AF_VENDOR36 111 >#define AF_VENDOR37 113 >#define AF_VENDOR38 115 >#define AF_VENDOR39 117 >#define AF_VENDOR40 119 >#define AF_VENDOR41 121 >#define AF_VENDOR42 123 >#define AF_VENDOR43 125 >#define AF_VENDOR44 127 >#define AF_VENDOR45 129 >#define AF_VENDOR46 131 >#define AF_VENDOR47 133 >#endif ># 290 "/usr/include/sys/socket.h" 3 4 > >/* > * Structure used by kernel to store most > * addresses. > */ >struct sockaddr { > unsigned char sa_len; /* total length */ > sa_family_t sa_family; /* address family */ > char sa_data[14]; /* actually longer; address value */ >}; >#if __BSD_VISIBLE >#define SOCK_MAXADDRLEN 255 /* longest possible addresses */ > >/* > * Structure used by kernel to pass protocol > * information in raw sockets. > */ >struct sockproto { > unsigned short sp_family; /* address family */ > unsigned short sp_protocol; /* protocol */ >}; >#endif ># 312 "/usr/include/sys/socket.h" 3 4 > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_sockaddr_storage.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/_sockaddr_storage.h" 1 3 4 >/*- > * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)socket.h 8.4 (Berkeley) 2/21/94 > * $FreeBSD: releng/10.3/sys/sys/_sockaddr_storage.h 196967 2009-09-08 10:39:38Z phk $ > */ > >#ifndef _SYS__SOCKADDR_STORAGE_H_ >#define _SYS__SOCKADDR_STORAGE_H_ > >/* > * RFC 2553: protocol-independent placeholder for socket addresses > */ >#define _SS_MAXSIZE 128U >#define _SS_ALIGNSIZE (sizeof(__int64_t)) >#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - \ > sizeof(sa_family_t)) >#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - \ > sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE) > >struct sockaddr_storage { > unsigned char ss_len; /* address length */ > sa_family_t ss_family; /* address family */ > char __ss_pad1[_SS_PAD1SIZE]; > __int64_t __ss_align; /* force desired struct alignment */ > char __ss_pad2[_SS_PAD2SIZE]; >}; > >#endif /* !_SYS__SOCKADDR_STORAGE_H_ */ ># 55 "/usr/include/sys/_sockaddr_storage.h" 3 4 ># 314 "/usr/include/sys/socket.h" 2 3 4 > >#if __BSD_VISIBLE >/* > * Protocol families, same as address families for now. > */ >#define PF_UNSPEC AF_UNSPEC >#define PF_LOCAL AF_LOCAL >#define PF_UNIX PF_LOCAL /* backward compatibility */ >#define PF_INET AF_INET >#define PF_IMPLINK AF_IMPLINK >#define PF_PUP AF_PUP >#define PF_CHAOS AF_CHAOS >#define PF_NETBIOS AF_NETBIOS >#define PF_ISO AF_ISO >#define PF_OSI AF_ISO >#define PF_ECMA AF_ECMA >#define PF_DATAKIT AF_DATAKIT >#define PF_CCITT AF_CCITT >#define PF_SNA AF_SNA >#define PF_DECnet AF_DECnet >#define PF_DLI AF_DLI >#define PF_LAT AF_LAT >#define PF_HYLINK AF_HYLINK >#define PF_APPLETALK AF_APPLETALK >#define PF_ROUTE AF_ROUTE >#define PF_LINK AF_LINK >#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ >#define PF_COIP AF_COIP >#define PF_CNT AF_CNT >#define PF_SIP AF_SIP >#define PF_IPX AF_IPX >#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ >#define PF_PIP pseudo_AF_PIP >#define PF_ISDN AF_ISDN >#define PF_KEY pseudo_AF_KEY >#define PF_INET6 AF_INET6 >#define PF_NATM AF_NATM >#define PF_ATM AF_ATM >#define PF_NETGRAPH AF_NETGRAPH >#define PF_SLOW AF_SLOW >#define PF_SCLUSTER AF_SCLUSTER >#define PF_ARP AF_ARP >#define PF_BLUETOOTH AF_BLUETOOTH >#define PF_IEEE80211 AF_IEEE80211 >#define PF_INET_SDP AF_INET_SDP >#define PF_INET6_SDP AF_INET6_SDP > >#define PF_MAX AF_MAX > >/* > * Definitions for network related sysctl, CTL_NET. > * > * Second level is protocol family. > * Third level is protocol number. > * > * Further levels are defined by the individual families below. > */ >#define NET_MAXID AF_MAX > >/* > * PF_ROUTE - Routing table > * > * Three additional levels are defined: > * Fourth: address family, 0 is wildcard > * Fifth: type of info, defined below > * Sixth: flag(s) to mask with for NET_RT_FLAGS > */ >#define NET_RT_DUMP 1 /* dump; may limit to a.f. */ >#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ >#define NET_RT_IFLIST 3 /* survey interface list */ >#define NET_RT_IFMALIST 4 /* return multicast address list */ >#define NET_RT_IFLISTL 5 /* Survey interface list, using 'l'en > * versions of msghdr structs. */ >#define NET_RT_MAXID 6 > >#endif /* __BSD_VISIBLE */ ># 390 "/usr/include/sys/socket.h" 3 4 > >/* > * Maximum queue length specifiable by listen. > */ >#define SOMAXCONN 128 > >/* > * Message header for recvmsg and sendmsg calls. > * Used value-result for recvmsg, value only for sendmsg. > */ >struct msghdr { > void *msg_name; /* optional address */ > socklen_t msg_namelen; /* size of address */ > struct iovec *msg_iov; /* scatter/gather array */ > int msg_iovlen; /* # elements in msg_iov */ > void *msg_control; /* ancillary data, see below */ > socklen_t msg_controllen; /* ancillary data buffer len */ > int msg_flags; /* flags on received message */ >}; > >#define MSG_OOB 0x1 /* process out-of-band data */ >#define MSG_PEEK 0x2 /* peek at incoming message */ >#define MSG_DONTROUTE 0x4 /* send without using routing tables */ >#define MSG_EOR 0x8 /* data completes record */ >#define MSG_TRUNC 0x10 /* data discarded before delivery */ >#define MSG_CTRUNC 0x20 /* control data lost before delivery */ >#define MSG_WAITALL 0x40 /* wait for full request or error */ >#if __POSIX_VISIBLE >= 200809 >#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */ >#endif ># 420 "/usr/include/sys/socket.h" 3 4 >#if __BSD_VISIBLE >#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ >#define MSG_EOF 0x100 /* data completes connection */ >#define MSG_NOTIFICATION 0x2000 /* SCTP notification */ >#define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */ >#define MSG_COMPAT 0x8000 /* used in sendit() */ >#define MSG_CMSG_CLOEXEC 0x40000 /* make received fds close-on-exec */ >#endif ># 428 "/usr/include/sys/socket.h" 3 4 >#ifdef _KERNEL >#define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */ >#endif ># 431 "/usr/include/sys/socket.h" 3 4 > >/* > * Header for ancillary data objects in msg_control buffer. > * Used for additional information with/about a datagram > * not expressible by flags. The format is a sequence > * of message elements headed by cmsghdr structures. > */ >struct cmsghdr { > socklen_t cmsg_len; /* data byte count, including hdr */ > int cmsg_level; /* originating protocol */ > int cmsg_type; /* protocol-specific type */ >/* followed by u_char cmsg_data[]; */ >}; > >#if __BSD_VISIBLE >/* > * While we may have more groups than this, the cmsgcred struct must > * be able to fit in an mbuf and we have historically supported a > * maximum of 16 groups. >*/ >#define CMGROUP_MAX 16 > >/* > * Credentials structure, used to verify the identity of a peer > * process that has sent us a message. This is allocated by the > * peer process but filled in by the kernel. This prevents the > * peer from lying about its identity. (Note that cmcred_groups[0] > * is the effective GID.) > */ >struct cmsgcred { > pid_t cmcred_pid; /* PID of sending process */ > uid_t cmcred_uid; /* real UID of sending process */ > uid_t cmcred_euid; /* effective UID of sending process */ > gid_t cmcred_gid; /* real GID of sending process */ > short cmcred_ngroups; /* number or groups */ > gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ >}; > >/* > * Socket credentials. > */ >struct sockcred { > uid_t sc_uid; /* real user id */ > uid_t sc_euid; /* effective user id */ > gid_t sc_gid; /* real group id */ > gid_t sc_egid; /* effective group id */ > int sc_ngroups; /* number of supplemental groups */ > gid_t sc_groups[1]; /* variable length */ >}; > >/* > * Compute size of a sockcred structure with groups. > */ >#define SOCKCREDSIZE(ngrps) \ > (sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1))) > >#endif /* __BSD_VISIBLE */ ># 488 "/usr/include/sys/socket.h" 3 4 > >/* given pointer to struct cmsghdr, return pointer to data */ >#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ > _ALIGN(sizeof(struct cmsghdr))) > >/* given pointer to struct cmsghdr, return pointer to next cmsghdr */ >#define CMSG_NXTHDR(mhdr, cmsg) \ > ((char *)(cmsg) == NULL ? CMSG_FIRSTHDR(mhdr) : \ > ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \ > _ALIGN(sizeof(struct cmsghdr)) > \ > (char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \ > (struct cmsghdr *)0 : \ > (struct cmsghdr *)(void *)((char *)(cmsg) + \ > _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len))) > >/* > * RFC 2292 requires to check msg_controllen, in case that the kernel returns > * an empty list for some reasons. > */ >#define CMSG_FIRSTHDR(mhdr) \ > ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ > (struct cmsghdr *)(mhdr)->msg_control : \ > (struct cmsghdr *)NULL) > >#if __BSD_VISIBLE >/* RFC 2292 additions */ >#define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l)) >#define CMSG_LEN(l) (_ALIGN(sizeof(struct cmsghdr)) + (l)) >#endif ># 517 "/usr/include/sys/socket.h" 3 4 > >#ifdef _KERNEL >#define CMSG_ALIGN(n) _ALIGN(n) >#endif ># 521 "/usr/include/sys/socket.h" 3 4 > >/* "Socket"-level control message types: */ >#define SCM_RIGHTS 0x01 /* access rights (array of int) */ >#if __BSD_VISIBLE >#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ >#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */ >#define SCM_BINTIME 0x04 /* timestamp (struct bintime) */ >#endif ># 529 "/usr/include/sys/socket.h" 3 4 > >#if __BSD_VISIBLE >/* > * 4.3 compat sockaddr, move to compat file later > */ >struct osockaddr { > unsigned short sa_family; /* address family */ > char sa_data[14]; /* up to 14 bytes of direct address */ >}; > >/* > * 4.3-compat message header (move to compat file later). > */ >struct omsghdr { > char *msg_name; /* optional address */ > int msg_namelen; /* size of address */ > struct iovec *msg_iov; /* scatter/gather array */ > int msg_iovlen; /* # elements in msg_iov */ > char *msg_accrights; /* access rights sent/received */ > int msg_accrightslen; >}; >#endif ># 551 "/usr/include/sys/socket.h" 3 4 > >/* > * howto arguments for shutdown(2), specified by Posix.1g. > */ >#define SHUT_RD 0 /* shut down the reading side */ >#define SHUT_WR 1 /* shut down the writing side */ >#define SHUT_RDWR 2 /* shut down both sides */ > >#if __BSD_VISIBLE >/* for SCTP */ >/* we cheat and use the SHUT_XX defines for these */ >#define PRU_FLUSH_RD SHUT_RD >#define PRU_FLUSH_WR SHUT_WR >#define PRU_FLUSH_RDWR SHUT_RDWR >#endif ># 566 "/usr/include/sys/socket.h" 3 4 > > >#if __BSD_VISIBLE >/* > * sendfile(2) header/trailer struct > */ >struct sf_hdtr { > struct iovec *headers; /* pointer to an array of header struct iovec's */ > int hdr_cnt; /* number of header iovec's */ > struct iovec *trailers; /* pointer to an array of trailer struct iovec's */ > int trl_cnt; /* number of trailer iovec's */ >}; > >/* > * Sendfile-specific flag(s) > */ >#define SF_NODISKIO 0x00000001 >#define SF_MNOWAIT 0x00000002 >#define SF_SYNC 0x00000004 > >#ifdef _KERNEL >#define SFK_COMPAT 0x00000001 >#endif /* _KERNEL */ ># 589 "/usr/include/sys/socket.h" 3 4 >#endif /* __BSD_VISIBLE */ ># 590 "/usr/include/sys/socket.h" 3 4 > >#ifndef _KERNEL > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 594 "/usr/include/sys/socket.h" 3 4 > >__BEGIN_DECLS >int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); >int bind(int, const struct sockaddr *, socklen_t); >int connect(int, const struct sockaddr *, socklen_t); >#if __BSD_VISIBLE >int accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int); >int bindat(int, int, const struct sockaddr *, socklen_t); >int connectat(int, int, const struct sockaddr *, socklen_t); >#endif ># 604 "/usr/include/sys/socket.h" 3 4 >int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); >int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); >int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); >int listen(int, int); >ssize_t recv(int, void *, size_t, int); >ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); >ssize_t recvmsg(int, struct msghdr *, int); >ssize_t send(int, const void *, size_t, int); >ssize_t sendto(int, const void *, > size_t, int, const struct sockaddr *, socklen_t); >ssize_t sendmsg(int, const struct msghdr *, int); >#if __BSD_VISIBLE >int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int); >int setfib(int); >#endif ># 619 "/usr/include/sys/socket.h" 3 4 >int setsockopt(int, int, int, const void *, socklen_t); >int shutdown(int, int); >int sockatmark(int); >int socket(int, int, int); >int socketpair(int, int, int, int *); >__END_DECLS > >#endif /* !_KERNEL */ ># 627 "/usr/include/sys/socket.h" 3 4 > >#ifdef _KERNEL >struct socket; > >struct tcpcb *so_sototcpcb(struct socket *so); >struct inpcb *so_sotoinpcb(struct socket *so); >struct sockbuf *so_sockbuf_snd(struct socket *); >struct sockbuf *so_sockbuf_rcv(struct socket *); > >int so_state_get(const struct socket *); >void so_state_set(struct socket *, int); > >int so_options_get(const struct socket *); >void so_options_set(struct socket *, int); > >int so_error_get(const struct socket *); >void so_error_set(struct socket *, int); > >int so_linger_get(const struct socket *); >void so_linger_set(struct socket *, int); > >struct protosw *so_protosw_get(const struct socket *); >void so_protosw_set(struct socket *, struct protosw *); > >void so_sorwakeup_locked(struct socket *so); >void so_sowwakeup_locked(struct socket *so); > >void so_sorwakeup(struct socket *so); >void so_sowwakeup(struct socket *so); > >void so_lock(struct socket *so); >void so_unlock(struct socket *so); > >void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg); > >#endif ># 663 "/usr/include/sys/socket.h" 3 4 > > >#endif /* !_SYS_SOCKET_H_ */ ># 666 "/usr/include/sys/socket.h" 3 4 ># 72 "../include/dps_common.h" 2 >#endif ># 73 "../include/dps_common.h" >#ifdef HAVE_NETINET_IN_H >#if 0 /* expanded by -frewrite-includes */ >#include <netinet/in.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/netinet/in.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1990, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)in.h 8.3 (Berkeley) 1/3/94 > * $FreeBSD: releng/10.3/sys/netinet/in.h 273841 2014-10-29 23:10:48Z jilles $ > */ > >#ifndef _NETINET_IN_H_ >#define _NETINET_IN_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/netinet/in.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/netinet/in.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <machine/endian.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/endian.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/endian.h 232266 2012-02-28 19:39:54Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/endian.h> >#endif /* expanded by -frewrite-includes */ ># 7 "/usr/include/machine/endian.h" 3 4 ># 39 "/usr/include/netinet/in.h" 2 3 4 > >/* Protocols common to RFC 1700, POSIX, and X/Open. */ >#define IPPROTO_IP 0 /* dummy for IP */ >#define IPPROTO_ICMP 1 /* control message protocol */ >#define IPPROTO_TCP 6 /* tcp */ >#define IPPROTO_UDP 17 /* user datagram protocol */ > >#define INADDR_ANY (u_int32_t)0x00000000 >#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */ > >#ifndef _UINT8_T_DECLARED >typedef __uint8_t uint8_t; >#define _UINT8_T_DECLARED >#endif ># 53 "/usr/include/netinet/in.h" 3 4 > >#ifndef _UINT16_T_DECLARED >typedef __uint16_t uint16_t; >#define _UINT16_T_DECLARED >#endif ># 58 "/usr/include/netinet/in.h" 3 4 > >#ifndef _UINT32_T_DECLARED >typedef __uint32_t uint32_t; >#define _UINT32_T_DECLARED >#endif ># 63 "/usr/include/netinet/in.h" 3 4 > >#ifndef _IN_ADDR_T_DECLARED >typedef uint32_t in_addr_t; >#define _IN_ADDR_T_DECLARED >#endif ># 68 "/usr/include/netinet/in.h" 3 4 > >#ifndef _IN_PORT_T_DECLARED >typedef uint16_t in_port_t; >#define _IN_PORT_T_DECLARED >#endif ># 73 "/usr/include/netinet/in.h" 3 4 > >#ifndef _SA_FAMILY_T_DECLARED >typedef __sa_family_t sa_family_t; >#define _SA_FAMILY_T_DECLARED >#endif ># 78 "/usr/include/netinet/in.h" 3 4 > >/* Internet address (a structure for historical reasons). */ >#ifndef _STRUCT_IN_ADDR_DECLARED >struct in_addr { > in_addr_t s_addr; >}; >#define _STRUCT_IN_ADDR_DECLARED >#endif ># 86 "/usr/include/netinet/in.h" 3 4 > >#ifndef _SOCKLEN_T_DECLARED >typedef __socklen_t socklen_t; >#define _SOCKLEN_T_DECLARED >#endif ># 91 "/usr/include/netinet/in.h" 3 4 > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_sockaddr_storage.h> >#endif /* expanded by -frewrite-includes */ ># 93 "/usr/include/netinet/in.h" 3 4 > >/* Socket address, internet style. */ >struct sockaddr_in { > uint8_t sin_len; > sa_family_t sin_family; > in_port_t sin_port; > struct in_addr sin_addr; > char sin_zero[8]; >}; > >#if !defined(_KERNEL) && __POSIX_VISIBLE >= 200112 > >#ifndef _BYTEORDER_PROTOTYPED >#define _BYTEORDER_PROTOTYPED >__BEGIN_DECLS >uint32_t htonl(uint32_t); >uint16_t htons(uint16_t); >uint32_t ntohl(uint32_t); >uint16_t ntohs(uint16_t); >__END_DECLS >#endif ># 114 "/usr/include/netinet/in.h" 3 4 > >#ifndef _BYTEORDER_FUNC_DEFINED >#define _BYTEORDER_FUNC_DEFINED >#define htonl(x) __htonl(x) >#define htons(x) __htons(x) >#define ntohl(x) __ntohl(x) >#define ntohs(x) __ntohs(x) >#endif ># 122 "/usr/include/netinet/in.h" 3 4 > >#endif /* !_KERNEL && __POSIX_VISIBLE >= 200112 */ ># 124 "/usr/include/netinet/in.h" 3 4 > >#if __POSIX_VISIBLE >= 200112 >#define IPPROTO_IPV6 41 /* IP6 header */ >#define IPPROTO_RAW 255 /* raw IP packet */ >#define INET_ADDRSTRLEN 16 >#endif ># 130 "/usr/include/netinet/in.h" 3 4 > >#if __BSD_VISIBLE >/* > * Constants and structures defined by the internet system, > * Per RFC 790, September 1981, and numerous additions. > */ > >/* > * Protocols (RFC 1700) > */ >#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ >#define IPPROTO_IGMP 2 /* group mgmt protocol */ >#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ >#define IPPROTO_IPV4 4 /* IPv4 encapsulation */ >#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */ >#define IPPROTO_ST 7 /* Stream protocol II */ >#define IPPROTO_EGP 8 /* exterior gateway protocol */ >#define IPPROTO_PIGP 9 /* private interior gateway */ >#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */ >#define IPPROTO_NVPII 11 /* network voice protocol*/ >#define IPPROTO_PUP 12 /* pup */ >#define IPPROTO_ARGUS 13 /* Argus */ >#define IPPROTO_EMCON 14 /* EMCON */ >#define IPPROTO_XNET 15 /* Cross Net Debugger */ >#define IPPROTO_CHAOS 16 /* Chaos*/ >#define IPPROTO_MUX 18 /* Multiplexing */ >#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */ >#define IPPROTO_HMP 20 /* Host Monitoring */ >#define IPPROTO_PRM 21 /* Packet Radio Measurement */ >#define IPPROTO_IDP 22 /* xns idp */ >#define IPPROTO_TRUNK1 23 /* Trunk-1 */ >#define IPPROTO_TRUNK2 24 /* Trunk-2 */ >#define IPPROTO_LEAF1 25 /* Leaf-1 */ >#define IPPROTO_LEAF2 26 /* Leaf-2 */ >#define IPPROTO_RDP 27 /* Reliable Data */ >#define IPPROTO_IRTP 28 /* Reliable Transaction */ >#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ >#define IPPROTO_BLT 30 /* Bulk Data Transfer */ >#define IPPROTO_NSP 31 /* Network Services */ >#define IPPROTO_INP 32 /* Merit Internodal */ >#define IPPROTO_SEP 33 /* Sequential Exchange */ >#define IPPROTO_3PC 34 /* Third Party Connect */ >#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ >#define IPPROTO_XTP 36 /* XTP */ >#define IPPROTO_DDP 37 /* Datagram Delivery */ >#define IPPROTO_CMTP 38 /* Control Message Transport */ >#define IPPROTO_TPXX 39 /* TP++ Transport */ >#define IPPROTO_IL 40 /* IL transport protocol */ >#define IPPROTO_SDRP 42 /* Source Demand Routing */ >#define IPPROTO_ROUTING 43 /* IP6 routing header */ >#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ >#define IPPROTO_IDRP 45 /* InterDomain Routing*/ >#define IPPROTO_RSVP 46 /* resource reservation */ >#define IPPROTO_GRE 47 /* General Routing Encap. */ >#define IPPROTO_MHRP 48 /* Mobile Host Routing */ >#define IPPROTO_BHA 49 /* BHA */ >#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */ >#define IPPROTO_AH 51 /* IP6 Auth Header */ >#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */ >#define IPPROTO_SWIPE 53 /* IP with encryption */ >#define IPPROTO_NHRP 54 /* Next Hop Resolution */ >#define IPPROTO_MOBILE 55 /* IP Mobility */ >#define IPPROTO_TLSP 56 /* Transport Layer Security */ >#define IPPROTO_SKIP 57 /* SKIP */ >#define IPPROTO_ICMPV6 58 /* ICMP6 */ >#define IPPROTO_NONE 59 /* IP6 no next header */ >#define IPPROTO_DSTOPTS 60 /* IP6 destination option */ >#define IPPROTO_AHIP 61 /* any host internal protocol */ >#define IPPROTO_CFTP 62 /* CFTP */ >#define IPPROTO_HELLO 63 /* "hello" routing protocol */ >#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */ >#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */ >#define IPPROTO_RVD 66 /* Remote Virtual Disk */ >#define IPPROTO_IPPC 67 /* Pluribus Packet Core */ >#define IPPROTO_ADFS 68 /* Any distributed FS */ >#define IPPROTO_SATMON 69 /* Satnet Monitoring */ >#define IPPROTO_VISA 70 /* VISA Protocol */ >#define IPPROTO_IPCV 71 /* Packet Core Utility */ >#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */ >#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */ >#define IPPROTO_WSN 74 /* Wang Span Network */ >#define IPPROTO_PVP 75 /* Packet Video Protocol */ >#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */ >#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ >#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */ >#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ >#define IPPROTO_EON 80 /* ISO cnlp */ >#define IPPROTO_VMTP 81 /* VMTP */ >#define IPPROTO_SVMTP 82 /* Secure VMTP */ >#define IPPROTO_VINES 83 /* Banyon VINES */ >#define IPPROTO_TTP 84 /* TTP */ >#define IPPROTO_IGP 85 /* NSFNET-IGP */ >#define IPPROTO_DGP 86 /* dissimilar gateway prot. */ >#define IPPROTO_TCF 87 /* TCF */ >#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */ >#define IPPROTO_OSPFIGP 89 /* OSPFIGP */ >#define IPPROTO_SRPC 90 /* Strite RPC protocol */ >#define IPPROTO_LARP 91 /* Locus Address Resoloution */ >#define IPPROTO_MTP 92 /* Multicast Transport */ >#define IPPROTO_AX25 93 /* AX.25 Frames */ >#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */ >#define IPPROTO_MICP 95 /* Mobile Int.ing control */ >#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */ >#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */ >#define IPPROTO_ENCAP 98 /* encapsulation header */ >#define IPPROTO_APES 99 /* any private encr. scheme */ >#define IPPROTO_GMTP 100 /* GMTP*/ >#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ >#define IPPROTO_SCTP 132 /* SCTP */ >#define IPPROTO_MH 135 /* IPv6 Mobility Header */ >#define IPPROTO_UDPLITE 136 /* UDP-Lite */ >#define IPPROTO_HIP 139 /* IP6 Host Identity Protocol */ >#define IPPROTO_SHIM6 140 /* IP6 Shim6 Protocol */ >/* 101-254: Partly Unassigned */ >#define IPPROTO_PIM 103 /* Protocol Independent Mcast */ >#define IPPROTO_CARP 112 /* CARP */ >#define IPPROTO_PGM 113 /* PGM */ >#define IPPROTO_MPLS 137 /* MPLS-in-IP */ >#define IPPROTO_PFSYNC 240 /* PFSYNC */ >#define IPPROTO_RESERVED_253 253 /* Reserved */ >#define IPPROTO_RESERVED_254 254 /* Reserved */ >/* 255: Reserved */ >/* BSD Private, local use, namespace incursion, no longer used */ >#define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */ >#define IPPROTO_MAX 256 > >/* last return value of *_input(), meaning "all job for this pkt is done". */ >#define IPPROTO_DONE 257 > >/* Only used internally, so can be outside the range of valid IP protocols. */ >#define IPPROTO_DIVERT 258 /* divert pseudo-protocol */ >#define IPPROTO_SEND 259 /* SeND pseudo-protocol */ > >/* > * Defined to avoid confusion. The master value is defined by > * PROTO_SPACER in sys/protosw.h. > */ >#define IPPROTO_SPACER 32767 /* spacer for loadable protos */ > >/* > * Local port number conventions: > * > * When a user does a bind(2) or connect(2) with a port number of zero, > * a non-conflicting local port address is chosen. > * The default range is IPPORT_HIFIRSTAUTO through > * IPPORT_HILASTAUTO, although that is settable by sysctl. > * > * A user may set the IPPROTO_IP option IP_PORTRANGE to change this > * default assignment range. > * > * The value IP_PORTRANGE_DEFAULT causes the default behavior. > * > * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers > * into the "high" range. These are reserved for client outbound connections > * which do not want to be filtered by any firewalls. > * > * The value IP_PORTRANGE_LOW changes the range to the "low" are > * that is (by convention) restricted to privileged processes. This > * convention is based on "vouchsafe" principles only. It is only secure > * if you trust the remote host to restrict these ports. > * > * The default range of ports and the high range can be changed by > * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto) > * > * Changing those values has bad security implications if you are > * using a stateless firewall that is allowing packets outside of that > * range in order to allow transparent outgoing connections. > * > * Such a firewall configuration will generally depend on the use of these > * default values. If you change them, you may find your Security > * Administrator looking for you with a heavy object. > * > * For a slightly more orthodox text view on this: > * > * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers > * > * port numbers are divided into three ranges: > * > * 0 - 1023 Well Known Ports > * 1024 - 49151 Registered Ports > * 49152 - 65535 Dynamic and/or Private Ports > * > */ > >/* > * Ports < IPPORT_RESERVED are reserved for > * privileged processes (e.g. root). (IP_PORTRANGE_LOW) > */ >#define IPPORT_RESERVED 1024 > >/* > * Default local port range, used by IP_PORTRANGE_DEFAULT > */ >#define IPPORT_EPHEMERALFIRST 10000 >#define IPPORT_EPHEMERALLAST 65535 > >/* > * Dynamic port range, used by IP_PORTRANGE_HIGH. > */ >#define IPPORT_HIFIRSTAUTO 49152 >#define IPPORT_HILASTAUTO 65535 > >/* > * Scanning for a free reserved port return a value below IPPORT_RESERVED, > * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was > * 512, but that conflicts with some well-known-services that firewalls may > * have a fit if we use. > */ >#define IPPORT_RESERVEDSTART 600 > >#define IPPORT_MAX 65535 > >/* > * Definitions of bits in internet address integers. > * On subnets, the decomposition of addresses to host and net parts > * is done according to subnet mask, not the masks here. > */ >#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) >#define IN_CLASSA_NET 0xff000000 >#define IN_CLASSA_NSHIFT 24 >#define IN_CLASSA_HOST 0x00ffffff >#define IN_CLASSA_MAX 128 > >#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) >#define IN_CLASSB_NET 0xffff0000 >#define IN_CLASSB_NSHIFT 16 >#define IN_CLASSB_HOST 0x0000ffff >#define IN_CLASSB_MAX 65536 > >#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) >#define IN_CLASSC_NET 0xffffff00 >#define IN_CLASSC_NSHIFT 8 >#define IN_CLASSC_HOST 0x000000ff > >#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) >#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ >#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ >#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ >#define IN_MULTICAST(i) IN_CLASSD(i) > >#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) >#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) > >#define IN_LINKLOCAL(i) (((u_int32_t)(i) & 0xffff0000) == 0xa9fe0000) >#define IN_LOOPBACK(i) (((u_int32_t)(i) & 0xff000000) == 0x7f000000) >#define IN_ZERONET(i) (((u_int32_t)(i) & 0xff000000) == 0) > >#define IN_PRIVATE(i) ((((u_int32_t)(i) & 0xff000000) == 0x0a000000) || \ > (((u_int32_t)(i) & 0xfff00000) == 0xac100000) || \ > (((u_int32_t)(i) & 0xffff0000) == 0xc0a80000)) > >#define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000) > >#define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i)) > >#define INADDR_LOOPBACK (u_int32_t)0x7f000001 >#ifndef _KERNEL >#define INADDR_NONE 0xffffffff /* -1 return */ >#endif ># 389 "/usr/include/netinet/in.h" 3 4 > >#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ >#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ >#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ >#define INADDR_ALLRPTS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22, IGMPv3 */ >#define INADDR_CARP_GROUP (u_int32_t)0xe0000012 /* 224.0.0.18 */ >#define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0 /* 224.0.0.240 */ >#define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb /* 224.0.0.251 */ >#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ > >#define IN_LOOPBACKNET 127 /* official! */ > >#define IN_RFC3021_MASK (u_int32_t)0xfffffffe > >/* > * Options for use with [gs]etsockopt at the IP level. > * First word of comment is data type; bool is stored in int. > */ >#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ >#define IP_HDRINCL 2 /* int; header is included with data */ >#define IP_TOS 3 /* int; IP type of service and preced. */ >#define IP_TTL 4 /* int; IP time to live */ >#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ >#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ >#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ >#define IP_SENDSRCADDR IP_RECVDSTADDR /* cmsg_type to set src addr */ >#define IP_RETOPTS 8 /* ip_opts; set/get IP options */ >#define IP_MULTICAST_IF 9 /* struct in_addr *or* struct ip_mreqn; > * set/get IP multicast i/f */ >#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ >#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ >#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ >#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ >#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ >#define IP_RSVP_ON 15 /* enable RSVP in kernel */ >#define IP_RSVP_OFF 16 /* disable RSVP in kernel */ >#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ >#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ >#define IP_PORTRANGE 19 /* int; range to choose for unspec port */ >#define IP_RECVIF 20 /* bool; receive reception if w/dgram */ >/* for IPSEC */ >#define IP_IPSEC_POLICY 21 /* int; set/get security policy */ >#define IP_FAITH 22 /* bool; accept FAITH'ed connections */ > >#define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ >#define IP_BINDANY 24 /* bool: allow bind to any address */ > >/* > * Options for controlling the firewall and dummynet. > * Historical options (from 40 to 64) will eventually be > * replaced by only two options, IP_FW3 and IP_DUMMYNET3. > */ >#define IP_FW_TABLE_ADD 40 /* add entry */ >#define IP_FW_TABLE_DEL 41 /* delete entry */ >#define IP_FW_TABLE_FLUSH 42 /* flush table */ >#define IP_FW_TABLE_GETSIZE 43 /* get table size */ >#define IP_FW_TABLE_LIST 44 /* list table contents */ > >#define IP_FW3 48 /* generic ipfw v.3 sockopts */ >#define IP_DUMMYNET3 49 /* generic dummynet v.3 sockopts */ > >#define IP_FW_ADD 50 /* add a firewall rule to chain */ >#define IP_FW_DEL 51 /* delete a firewall rule from chain */ >#define IP_FW_FLUSH 52 /* flush firewall rule chain */ >#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */ >#define IP_FW_GET 54 /* get entire firewall rule chain */ >#define IP_FW_RESETLOG 55 /* reset logging counters */ > >#define IP_FW_NAT_CFG 56 /* add/config a nat rule */ >#define IP_FW_NAT_DEL 57 /* delete a nat rule */ >#define IP_FW_NAT_GET_CONFIG 58 /* get configuration of a nat rule */ >#define IP_FW_NAT_GET_LOG 59 /* get log of a nat rule */ > >#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */ >#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */ >#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ >#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ > >#define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */ >#define IP_MINTTL 66 /* minimum TTL for packet or drop */ >#define IP_DONTFRAG 67 /* don't fragment packet */ >#define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */ > >/* IPv4 Source Filter Multicast API [RFC3678] */ >#define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ >#define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ >#define IP_BLOCK_SOURCE 72 /* block a source */ >#define IP_UNBLOCK_SOURCE 73 /* unblock a source */ > >/* The following option is private; do not use it from user applications. */ >#define IP_MSFILTER 74 /* set/get filter list */ > >/* Protocol Independent Multicast API [RFC3678] */ >#define MCAST_JOIN_GROUP 80 /* join an any-source group */ >#define MCAST_LEAVE_GROUP 81 /* leave all sources for group */ >#define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */ >#define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */ >#define MCAST_BLOCK_SOURCE 84 /* block a source */ >#define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ > >/* > * Defaults and limits for options > */ >#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ >#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ > >/* > * The imo_membership vector for each socket is now dynamically allocated at > * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized > * according to a power-of-two increment. > */ >#define IP_MIN_MEMBERSHIPS 31 >#define IP_MAX_MEMBERSHIPS 4095 >#define IP_MAX_SOURCE_FILTER 1024 /* XXX to be unused */ > >/* > * Default resource limits for IPv4 multicast source filtering. > * These may be modified by sysctl. > */ >#define IP_MAX_GROUP_SRC_FILTER 512 /* sources per group */ >#define IP_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ >#define IP_MAX_SOCK_MUTE_FILTER 128 /* XXX no longer used */ > >/* > * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. > */ >struct ip_mreq { > struct in_addr imr_multiaddr; /* IP multicast address of group */ > struct in_addr imr_interface; /* local IP address of interface */ >}; > >/* > * Modified argument structure for IP_MULTICAST_IF, obtained from Linux. > * This is used to specify an interface index for multicast sends, as > * the IPv4 legacy APIs do not support this (unless IP_SENDIF is available). > */ >struct ip_mreqn { > struct in_addr imr_multiaddr; /* IP multicast address of group */ > struct in_addr imr_address; /* local IP address of interface */ > int imr_ifindex; /* Interface index; cast to uint32_t */ >}; > >/* > * Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678] > */ >struct ip_mreq_source { > struct in_addr imr_multiaddr; /* IP multicast address of group */ > struct in_addr imr_sourceaddr; /* IP address of source */ > struct in_addr imr_interface; /* local IP address of interface */ >}; > >/* > * Argument structures for Protocol-Independent Multicast Source > * Filter APIs. [RFC3678] > */ >struct group_req { > uint32_t gr_interface; /* interface index */ > struct sockaddr_storage gr_group; /* group address */ >}; > >struct group_source_req { > uint32_t gsr_interface; /* interface index */ > struct sockaddr_storage gsr_group; /* group address */ > struct sockaddr_storage gsr_source; /* source address */ >}; > >#ifndef __MSFILTERREQ_DEFINED >#define __MSFILTERREQ_DEFINED >/* > * The following structure is private; do not use it from user applications. > * It is used to communicate IP_MSFILTER/IPV6_MSFILTER information between > * the RFC 3678 libc functions and the kernel. > */ >struct __msfilterreq { > uint32_t msfr_ifindex; /* interface index */ > uint32_t msfr_fmode; /* filter mode for group */ > uint32_t msfr_nsrcs; /* # of sources in msfr_srcs */ > struct sockaddr_storage msfr_group; /* group address */ > struct sockaddr_storage *msfr_srcs; /* pointer to the first member > * of a contiguous array of > * sources to filter in full. > */ >}; >#endif ># 573 "/usr/include/netinet/in.h" 3 4 > >struct sockaddr; > >/* > * Advanced (Full-state) APIs [RFC3678] > * The RFC specifies uint_t for the 6th argument to [sg]etsourcefilter(). > * We use uint32_t here to be consistent. > */ >int setipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t, > uint32_t, struct in_addr *); >int getipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t *, > uint32_t *, struct in_addr *); >int setsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, > uint32_t, uint32_t, struct sockaddr_storage *); >int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, > uint32_t *, uint32_t *, struct sockaddr_storage *); > >/* > * Filter modes; also used to represent per-socket filter mode internally. > */ >#define MCAST_UNDEFINED 0 /* fmode: not yet defined */ >#define MCAST_INCLUDE 1 /* fmode: include these source(s) */ >#define MCAST_EXCLUDE 2 /* fmode: exclude these source(s) */ > >/* > * Argument for IP_PORTRANGE: > * - which range to search when port is unspecified at bind() or connect() > */ >#define IP_PORTRANGE_DEFAULT 0 /* default range */ >#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ >#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ > >/* > * Definitions for inet sysctl operations. > * > * Third level is protocol number. > * Fourth level is desired variable within that protocol. > */ >#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ > >#define CTL_IPPROTO_NAMES { \ > { "ip", CTLTYPE_NODE }, \ > { "icmp", CTLTYPE_NODE }, \ > { "igmp", CTLTYPE_NODE }, \ > { "ggp", CTLTYPE_NODE }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { "tcp", CTLTYPE_NODE }, \ > { 0, 0 }, \ > { "egp", CTLTYPE_NODE }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { "pup", CTLTYPE_NODE }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { "udp", CTLTYPE_NODE }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { "idp", CTLTYPE_NODE }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { "ipsec", CTLTYPE_NODE }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { 0, 0 }, \ > { "pim", CTLTYPE_NODE }, \ >} > >/* > * Names for IP sysctl objects > */ >#define IPCTL_FORWARDING 1 /* act as router */ >#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ >#define IPCTL_DEFTTL 3 /* default TTL */ >#ifdef notyet >#define IPCTL_DEFMTU 4 /* default MTU */ >#endif ># 693 "/usr/include/netinet/in.h" 3 4 >#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */ >#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */ >#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */ >#define IPCTL_SOURCEROUTE 8 /* may perform source routes */ >#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ >#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ >#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */ >#define IPCTL_STATS 12 /* ipstat structure */ >#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ >#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ >#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */ >#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ >#define IPCTL_MAXID 17 > >#endif /* __BSD_VISIBLE */ ># 708 "/usr/include/netinet/in.h" 3 4 > >#ifdef _KERNEL > >struct ifnet; struct mbuf; /* forward declarations for Standard C */ > >int in_broadcast(struct in_addr, struct ifnet *); >int in_canforward(struct in_addr); >int in_localaddr(struct in_addr); >int in_localip(struct in_addr); >int inet_aton(const char *, struct in_addr *); /* in libkern */ >char *inet_ntoa(struct in_addr); /* in libkern */ >char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ >char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */ >int inet_pton(int af, const char *, void *); /* in libkern */ >void in_ifdetach(struct ifnet *); > >#define in_hosteq(s, t) ((s).s_addr == (t).s_addr) >#define in_nullhost(x) ((x).s_addr == INADDR_ANY) >#define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) > >#define satosin(sa) ((struct sockaddr_in *)(sa)) >#define sintosa(sin) ((struct sockaddr *)(sin)) >#define ifatoia(ifa) ((struct in_ifaddr *)(ifa)) >#endif /* _KERNEL */ ># 732 "/usr/include/netinet/in.h" 3 4 > >/* INET6 stuff */ >#if __POSIX_VISIBLE >= 200112 >#define __KAME_NETINET_IN_H_INCLUDED_ >#if 0 /* expanded by -frewrite-includes */ >#include <netinet6/in6.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/netinet6/in6.h" 1 3 4 >/*- > * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the project nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ > */ > >/*- > * Copyright (c) 1982, 1986, 1990, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)in.h 8.3 (Berkeley) 1/3/94 > * $FreeBSD: releng/10.3/sys/netinet6/in6.h 272662 2014-10-06 17:08:19Z tuexen $ > */ > >#ifndef __KAME_NETINET_IN_H_INCLUDED_ >#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553" >#endif ># 67 "/usr/include/netinet6/in6.h" 3 4 > >#ifndef _NETINET6_IN6_H_ >#define _NETINET6_IN6_H_ > >/* > * Identification of the network protocol stack > * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE > * has the table of implementation/integration differences. > */ >#define __KAME__ >#define __KAME_VERSION "FreeBSD" > >/* > * IPv6 port allocation rules should mirror the IPv4 rules and are controlled > * by the net.inet.ip.portrange sysctl tree. The following defines exist > * for compatibility with userland applications that need them. > */ >#if __BSD_VISIBLE >#define IPV6PORT_RESERVED 1024 >#define IPV6PORT_ANONMIN 49152 >#define IPV6PORT_ANONMAX 65535 >#define IPV6PORT_RESERVEDMIN 600 >#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) >#endif ># 91 "/usr/include/netinet6/in6.h" 3 4 > >/* > * IPv6 address > */ >struct in6_addr { > union { > uint8_t __u6_addr8[16]; > uint16_t __u6_addr16[8]; > uint32_t __u6_addr32[4]; > } __u6_addr; /* 128-bit IP6 address */ >}; > >#define s6_addr __u6_addr.__u6_addr8 >#ifdef _KERNEL /* XXX nonstandard */ >#define s6_addr8 __u6_addr.__u6_addr8 >#define s6_addr16 __u6_addr.__u6_addr16 >#define s6_addr32 __u6_addr.__u6_addr32 >#endif ># 109 "/usr/include/netinet6/in6.h" 3 4 > >#define INET6_ADDRSTRLEN 46 > >/* > * XXX missing POSIX.1-2001 macro IPPROTO_IPV6. > */ > >/* > * Socket address for IPv6 > */ >#if __BSD_VISIBLE >#define SIN6_LEN >#endif ># 122 "/usr/include/netinet6/in6.h" 3 4 > >struct sockaddr_in6 { > uint8_t sin6_len; /* length of this struct */ > sa_family_t sin6_family; /* AF_INET6 */ > in_port_t sin6_port; /* Transport layer port # */ > uint32_t sin6_flowinfo; /* IP6 flow information */ > struct in6_addr sin6_addr; /* IP6 address */ > uint32_t sin6_scope_id; /* scope zone index */ >}; > >/* > * Local definition for masks > */ >#ifdef _KERNEL /* XXX nonstandard */ >#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} >#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} >#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} >#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ > 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} >#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ > 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}} >#endif ># 146 "/usr/include/netinet6/in6.h" 3 4 > >#ifdef _KERNEL >extern const struct sockaddr_in6 sa6_any; > >extern const struct in6_addr in6mask0; >extern const struct in6_addr in6mask32; >extern const struct in6_addr in6mask64; >extern const struct in6_addr in6mask96; >extern const struct in6_addr in6mask128; >#endif /* _KERNEL */ ># 156 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Macros started with IPV6_ADDR is KAME local > */ >#ifdef _KERNEL /* XXX nonstandard */ >#if _BYTE_ORDER == _BIG_ENDIAN >#define IPV6_ADDR_INT32_ONE 1 >#define IPV6_ADDR_INT32_TWO 2 >#define IPV6_ADDR_INT32_MNL 0xff010000 >#define IPV6_ADDR_INT32_MLL 0xff020000 >#define IPV6_ADDR_INT32_SMP 0x0000ffff >#define IPV6_ADDR_INT16_ULL 0xfe80 >#define IPV6_ADDR_INT16_USL 0xfec0 >#define IPV6_ADDR_INT16_MLL 0xff02 >#elif _BYTE_ORDER == _LITTLE_ENDIAN ># 171 "/usr/include/netinet6/in6.h" 3 4 >#define IPV6_ADDR_INT32_ONE 0x01000000 >#define IPV6_ADDR_INT32_TWO 0x02000000 >#define IPV6_ADDR_INT32_MNL 0x000001ff >#define IPV6_ADDR_INT32_MLL 0x000002ff >#define IPV6_ADDR_INT32_SMP 0xffff0000 >#define IPV6_ADDR_INT16_ULL 0x80fe >#define IPV6_ADDR_INT16_USL 0xc0fe >#define IPV6_ADDR_INT16_MLL 0x02ff >#endif ># 180 "/usr/include/netinet6/in6.h" 3 4 >#endif ># 181 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Definition of some useful macros to handle IP6 addresses > */ >#if __BSD_VISIBLE >#define IN6ADDR_ANY_INIT \ > {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} >#define IN6ADDR_LOOPBACK_INIT \ > {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} >#define IN6ADDR_NODELOCAL_ALLNODES_INIT \ > {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} >#define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \ > {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} >#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ > {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} >#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ > {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} >#define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \ > {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}} >#endif ># 208 "/usr/include/netinet6/in6.h" 3 4 > >extern const struct in6_addr in6addr_any; >extern const struct in6_addr in6addr_loopback; >#if __BSD_VISIBLE >extern const struct in6_addr in6addr_nodelocal_allnodes; >extern const struct in6_addr in6addr_linklocal_allnodes; >extern const struct in6_addr in6addr_linklocal_allrouters; >extern const struct in6_addr in6addr_linklocal_allv2routers; >#endif ># 217 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Equality > * NOTE: Some of kernel programming environment (for example, openbsd/sparc) > * does not supply memcmp(). For userland memcmp() is preferred as it is > * in ANSI standard. > */ >#ifdef _KERNEL >#define IN6_ARE_ADDR_EQUAL(a, b) \ > (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) >#else ># 228 "/usr/include/netinet6/in6.h" 3 4 >#if __BSD_VISIBLE >#define IN6_ARE_ADDR_EQUAL(a, b) \ > (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) >#endif ># 232 "/usr/include/netinet6/in6.h" 3 4 >#endif ># 233 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Unspecified > */ >#define IN6_IS_ADDR_UNSPECIFIED(a) \ > ((a)->__u6_addr.__u6_addr32[0] == 0 && \ > (a)->__u6_addr.__u6_addr32[1] == 0 && \ > (a)->__u6_addr.__u6_addr32[2] == 0 && \ > (a)->__u6_addr.__u6_addr32[3] == 0) > >/* > * Loopback > */ >#define IN6_IS_ADDR_LOOPBACK(a) \ > ((a)->__u6_addr.__u6_addr32[0] == 0 && \ > (a)->__u6_addr.__u6_addr32[1] == 0 && \ > (a)->__u6_addr.__u6_addr32[2] == 0 && \ > (a)->__u6_addr.__u6_addr32[3] == ntohl(1)) > >/* > * IPv4 compatible > */ >#define IN6_IS_ADDR_V4COMPAT(a) \ > ((a)->__u6_addr.__u6_addr32[0] == 0 && \ > (a)->__u6_addr.__u6_addr32[1] == 0 && \ > (a)->__u6_addr.__u6_addr32[2] == 0 && \ > (a)->__u6_addr.__u6_addr32[3] != 0 && \ > (a)->__u6_addr.__u6_addr32[3] != ntohl(1)) > >/* > * Mapped > */ >#define IN6_IS_ADDR_V4MAPPED(a) \ > ((a)->__u6_addr.__u6_addr32[0] == 0 && \ > (a)->__u6_addr.__u6_addr32[1] == 0 && \ > (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff)) > >/* > * KAME Scope Values > */ > >#ifdef _KERNEL /* XXX nonstandard */ >#define IPV6_ADDR_SCOPE_NODELOCAL 0x01 >#define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 >#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 >#define IPV6_ADDR_SCOPE_SITELOCAL 0x05 >#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ >#define IPV6_ADDR_SCOPE_GLOBAL 0x0e >#else ># 282 "/usr/include/netinet6/in6.h" 3 4 >#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 >#define __IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 >#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 >#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 >#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ >#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e >#endif ># 289 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Unicast Scope > * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). > */ >#define IN6_IS_ADDR_LINKLOCAL(a) \ > (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) >#define IN6_IS_ADDR_SITELOCAL(a) \ > (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) > >/* > * Multicast > */ >#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) > >#ifdef _KERNEL /* XXX nonstandard */ >#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) >#else ># 307 "/usr/include/netinet6/in6.h" 3 4 >#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) >#endif ># 309 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Multicast Scope > */ >#ifdef _KERNEL /* refers nonstandard items */ >#define IN6_IS_ADDR_MC_NODELOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) >#define IN6_IS_ADDR_MC_INTFACELOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL)) >#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) >#define IN6_IS_ADDR_MC_SITELOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL)) >#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL)) >#define IN6_IS_ADDR_MC_GLOBAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL)) >#else ># 333 "/usr/include/netinet6/in6.h" 3 4 >#define IN6_IS_ADDR_MC_NODELOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) >#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) >#define IN6_IS_ADDR_MC_SITELOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) >#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) >#define IN6_IS_ADDR_MC_GLOBAL(a) \ > (IN6_IS_ADDR_MULTICAST(a) && \ > (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) >#endif ># 349 "/usr/include/netinet6/in6.h" 3 4 > >#ifdef _KERNEL /* nonstandard */ >/* > * KAME Scope > */ >#define IN6_IS_SCOPE_LINKLOCAL(a) \ > ((IN6_IS_ADDR_LINKLOCAL(a)) || \ > (IN6_IS_ADDR_MC_LINKLOCAL(a))) >#define IN6_IS_SCOPE_EMBED(a) \ > ((IN6_IS_ADDR_LINKLOCAL(a)) || \ > (IN6_IS_ADDR_MC_LINKLOCAL(a)) || \ > (IN6_IS_ADDR_MC_INTFACELOCAL(a))) > >#define IFA6_IS_DEPRECATED(a) \ > ((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \ > (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ > (a)->ia6_lifetime.ia6t_pltime) >#define IFA6_IS_INVALID(a) \ > ((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \ > (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ > (a)->ia6_lifetime.ia6t_vltime) >#endif /* _KERNEL */ ># 371 "/usr/include/netinet6/in6.h" 3 4 > >/* > * IP6 route structure > */ >#if __BSD_VISIBLE >struct route_in6 { > struct rtentry *ro_rt; > struct llentry *ro_lle; > struct in6_addr *ro_ia6; > int ro_flags; > struct sockaddr_in6 ro_dst; >}; >#endif ># 384 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Options for use with [gs]etsockopt at the IPV6 level. > * First word of comment is data type; bool is stored in int. > */ >/* no hdrincl */ >#if 0 /* the followings are relic in IPv4 and hence are disabled */ >#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ >#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ >#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ >#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ >#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ >#endif ># 397 "/usr/include/netinet6/in6.h" 3 4 >#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ >#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ >#define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ >#define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ >#define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */ >#define IPV6_JOIN_GROUP 12 /* ipv6_mreq; join a group membership */ >#define IPV6_LEAVE_GROUP 13 /* ipv6_mreq; leave a group membership */ >#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ >#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ >/* RFC2292 options */ >#ifdef _KERNEL >#define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ >#define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ >#define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ >#define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ >#define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ >#define IPV6_2292RTHDR 24 /* bool; routing header */ >#define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ >#endif ># 416 "/usr/include/netinet6/in6.h" 3 4 > >#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ >#define IPV6_V6ONLY 27 /* bool; make AF_INET6 sockets v6 only */ >#ifndef _KERNEL >#define IPV6_BINDV6ONLY IPV6_V6ONLY >#endif ># 422 "/usr/include/netinet6/in6.h" 3 4 > >#if 1 /* IPSEC */ >#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ >#endif /* IPSEC */ ># 426 "/usr/include/netinet6/in6.h" 3 4 > >#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ > >#if 1 /* IPV6FIREWALL */ >#define IPV6_FW_ADD 30 /* add a firewall rule to chain */ >#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ >#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ >#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ >#define IPV6_FW_GET 34 /* get entire firewall rule chain */ >#endif ># 436 "/usr/include/netinet6/in6.h" 3 4 > >/* new socket options introduced in RFC3542 */ >#define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ > >#define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ >#define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ >#define IPV6_RECVRTHDR 38 /* bool; recv routing header */ >#define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ >#define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ >#ifdef _KERNEL >#define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ >#endif ># 448 "/usr/include/netinet6/in6.h" 3 4 > >#define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ >#define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ > >#define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), > 4 bytes int; MTU notification (cmsg) */ >#if 0 /*obsoleted during 2292bis -> 3542*/ >#define IPV6_REACHCONF 45 /* no data; ND reachability confirm > (cmsg only/not in of RFC3542) */ >#endif ># 458 "/usr/include/netinet6/in6.h" 3 4 > >/* more new socket options introduced in RFC3542 */ >#define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ >#define IPV6_HOPLIMIT 47 /* int; send hop limit */ >#define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ >#define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ >#define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ >#define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ >#if 0 >#define IPV6_PKTOPTIONS 52 /* buf/cmsghdr; set/get IPv6 options */ > /* obsoleted by RFC3542 */ >#endif ># 470 "/usr/include/netinet6/in6.h" 3 4 > >#define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ > >#define IPV6_AUTOFLOWLABEL 59 /* bool; attach flowlabel automagically */ > >#define IPV6_TCLASS 61 /* int; send traffic class value */ >#define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ > >#define IPV6_PREFER_TEMPADDR 63 /* int; prefer temporary addresses as > * the source address. > */ > >#define IPV6_BINDANY 64 /* bool: allow bind to any address */ > >/* > * The following option is private; do not use it from user applications. > * It is deliberately defined to the same value as IP_MSFILTER. > */ >#define IPV6_MSFILTER 74 /* struct __msfilterreq; > * set/get multicast source filter list. > */ > >/* to define items, should talk with KAME guys first, for *BSD compatibility */ > >#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ >#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ >#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ > >/* > * Defaults and limits for options > */ >#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ >#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ > >/* > * The im6o_membership vector for each socket is now dynamically allocated at > * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized > * according to a power-of-two increment. > */ >#define IPV6_MIN_MEMBERSHIPS 31 >#define IPV6_MAX_MEMBERSHIPS 4095 > >/* > * Default resource limits for IPv6 multicast source filtering. > * These may be modified by sysctl. > */ >#define IPV6_MAX_GROUP_SRC_FILTER 512 /* sources per group */ >#define IPV6_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ > >/* > * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. > */ >struct ipv6_mreq { > struct in6_addr ipv6mr_multiaddr; > unsigned int ipv6mr_interface; >}; > >/* > * IPV6_PKTINFO: Packet information(RFC2292 sec 5) > */ >struct in6_pktinfo { > struct in6_addr ipi6_addr; /* src/dst IPv6 address */ > unsigned int ipi6_ifindex; /* send/recv interface index */ >}; > >/* > * Control structure for IPV6_RECVPATHMTU socket option. > */ >struct ip6_mtuinfo { > struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ > uint32_t ip6m_mtu; >}; > >/* > * Argument for IPV6_PORTRANGE: > * - which range to search when port is unspecified at bind() or connect() > */ >#define IPV6_PORTRANGE_DEFAULT 0 /* default range */ >#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ >#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ > >#if __BSD_VISIBLE >/* > * Definitions for inet6 sysctl operations. > * > * Third level is protocol number. > * Fourth level is desired variable within that protocol. > */ >#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ > >/* > * Names for IP sysctl objects > */ >#define IPV6CTL_FORWARDING 1 /* act as router */ >#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/ >#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ >#ifdef notyet >#define IPV6CTL_DEFMTU 4 /* default MTU */ >#endif ># 569 "/usr/include/netinet6/in6.h" 3 4 >#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ >#define IPV6CTL_STATS 6 /* stats */ >#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ >#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ >#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ >#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ >#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ >#define IPV6CTL_ACCEPT_RTADV 12 >#define IPV6CTL_KEEPFAITH 13 >#define IPV6CTL_LOG_INTERVAL 14 >#define IPV6CTL_HDRNESTLIMIT 15 >#define IPV6CTL_DAD_COUNT 16 >#define IPV6CTL_AUTO_FLOWLABEL 17 >#define IPV6CTL_DEFMCASTHLIM 18 >#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ >#define IPV6CTL_KAME_VERSION 20 >#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ >#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ >#if 0 /* obsolete */ >#define IPV6CTL_MAPPED_ADDR 23 >#endif ># 590 "/usr/include/netinet6/in6.h" 3 4 >#define IPV6CTL_V6ONLY 24 >#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ >#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ >#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ > >#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */ >#define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ >#define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */ >#define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ >#define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */ >#define IPV6CTL_PREFER_TEMPADDR 37 /* prefer temporary addr as src */ >#define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ >#define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ > >#define IPV6CTL_MAXFRAGS 41 /* max fragments */ >#if 0 >#define IPV6CTL_IFQ 42 /* ip6intrq node */ >#define IPV6CTL_ISATAPRTR 43 /* isatap router */ >#endif ># 609 "/usr/include/netinet6/in6.h" 3 4 >#define IPV6CTL_MCAST_PMTU 44 /* enable pMTU discovery for multicast? */ > >/* New entries should be added here from current IPV6CTL_MAXID value. */ >/* to define items, should talk with KAME guys first, for *BSD compatibility */ >#define IPV6CTL_STEALTH 45 > >#define ICMPV6CTL_ND6_ONLINKNSRFC4861 47 >#define IPV6CTL_NO_RADR 48 /* No defroute from RA */ >#define IPV6CTL_NORBIT_RAIF 49 /* Disable R-bit in NA on RA > * receiving IF. */ >#define IPV6CTL_RFC6204W3 50 /* Accept defroute even when forwarding > enabled */ >#define IPV6CTL_MAXID 51 >#endif /* __BSD_VISIBLE */ ># 623 "/usr/include/netinet6/in6.h" 3 4 > >/* > * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, > * the protocol specific mbuf flags are shared between them. > */ >#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ >#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ >#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ >#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing */ >#define M_AUTHIPHDR M_PROTO4 >#define M_DECRYPTED M_PROTO5 >#define M_LOOP M_PROTO6 >#define M_AUTHIPDGM M_PROTO7 >#define M_RTALERT_MLD M_PROTO8 > >#ifdef _KERNEL >struct cmsghdr; >struct ip6_hdr; > >int in6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t); >int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); >int in6_cksum_partial(struct mbuf *, u_int8_t, u_int32_t, u_int32_t, > u_int32_t); >int in6_localaddr(struct in6_addr *); >int in6_localip(struct in6_addr *); >int in6_addrscope(struct in6_addr *); >struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); >extern void in6_if_up(struct ifnet *); >struct sockaddr; >extern u_char ip6_protox[]; > >void in6_sin6_2_sin(struct sockaddr_in *sin, > struct sockaddr_in6 *sin6); >void in6_sin_2_v4mapsin6(struct sockaddr_in *sin, > struct sockaddr_in6 *sin6); >void in6_sin6_2_sin_in_sock(struct sockaddr *nam); >void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **nam); >extern void addrsel_policy_init(void); > >#define satosin6(sa) ((struct sockaddr_in6 *)(sa)) >#define sin6tosa(sin6) ((struct sockaddr *)(sin6)) >#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) > >extern int (*faithprefix_p)(struct in6_addr *); >#endif /* _KERNEL */ ># 668 "/usr/include/netinet6/in6.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 673 "/usr/include/netinet6/in6.h" 3 4 > >#ifndef _SOCKLEN_T_DECLARED >typedef __socklen_t socklen_t; >#define _SOCKLEN_T_DECLARED >#endif ># 678 "/usr/include/netinet6/in6.h" 3 4 > >#if __BSD_VISIBLE > >__BEGIN_DECLS >struct cmsghdr; > >extern int inet6_option_space(int); >extern int inet6_option_init(void *, struct cmsghdr **, int); >extern int inet6_option_append(struct cmsghdr *, const uint8_t *, > int, int); >extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); >extern int inet6_option_next(const struct cmsghdr *, uint8_t **); >extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); > >extern size_t inet6_rthdr_space(int, int); >extern struct cmsghdr *inet6_rthdr_init(void *, int); >extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, > unsigned int); >extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); >#if 0 /* not implemented yet */ >extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); >#endif ># 700 "/usr/include/netinet6/in6.h" 3 4 >extern int inet6_rthdr_segments(const struct cmsghdr *); >extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); >extern int inet6_rthdr_getflags(const struct cmsghdr *, int); > >extern int inet6_opt_init(void *, socklen_t); >extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t, > uint8_t, void **); >extern int inet6_opt_finish(void *, socklen_t, int); >extern int inet6_opt_set_val(void *, int, void *, socklen_t); > >extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *, > void **); >extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *, > void **); >extern int inet6_opt_get_val(void *, int, void *, socklen_t); >extern socklen_t inet6_rth_space(int, int); >extern void *inet6_rth_init(void *, socklen_t, int, int); >extern int inet6_rth_add(void *, const struct in6_addr *); >extern int inet6_rth_reverse(const void *, void *); >extern int inet6_rth_segments(const void *); >extern struct in6_addr *inet6_rth_getaddr(const void *, int); >__END_DECLS > >#endif /* __BSD_VISIBLE */ ># 724 "/usr/include/netinet6/in6.h" 3 4 > >#endif /* !_NETINET6_IN6_H_ */ ># 726 "/usr/include/netinet6/in6.h" 3 4 ># 737 "/usr/include/netinet/in.h" 2 3 4 >#undef __KAME_NETINET_IN_H_INCLUDED_ >#endif ># 739 "/usr/include/netinet/in.h" 3 4 > >#endif /* !_NETINET_IN_H_*/ ># 741 "/usr/include/netinet/in.h" 3 4 ># 75 "../include/dps_common.h" 2 >#endif ># 76 "../include/dps_common.h" >#ifdef HAVE_ARPA_INET_H >#if 0 /* expanded by -frewrite-includes */ >#include <arpa/inet.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/arpa/inet.h" 1 3 4 >/* > * ++Copyright++ 1983, 1993 > * - > * Copyright (c) 1983, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * - > * Portions Copyright (c) 1993 by Digital Equipment Corporation. > * > * Permission to use, copy, modify, and distribute this software for any > * purpose with or without fee is hereby granted, provided that the above > * copyright notice and this permission notice appear in all copies, and that > * the name of Digital Equipment Corporation not be used in advertising or > * publicity pertaining to distribution of the document or software without > * specific, written prior permission. > * > * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL > * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES > * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT > * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL > * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR > * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS > * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS > * SOFTWARE. > * - > * --Copyright-- > */ > >/*% > * @(#)inet.h 8.1 (Berkeley) 6/2/93 > * $Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp $ > * $FreeBSD: releng/10.3/include/arpa/inet.h 270838 2014-08-30 10:16:25Z ume $ > */ > >#ifndef _ARPA_INET_H_ >#define _ARPA_INET_H_ > >/* External definitions for functions in inet(3). */ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 64 "/usr/include/arpa/inet.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 65 "/usr/include/arpa/inet.h" 3 4 > >/* Required for byteorder(3) functions. */ >#if 0 /* expanded by -frewrite-includes */ >#include <machine/endian.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/endian.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/endian.h 232266 2012-02-28 19:39:54Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/endian.h> >#endif /* expanded by -frewrite-includes */ ># 7 "/usr/include/machine/endian.h" 3 4 ># 68 "/usr/include/arpa/inet.h" 2 3 4 > >#define INET_ADDRSTRLEN 16 >#define INET6_ADDRSTRLEN 46 > >#ifndef _UINT16_T_DECLARED >typedef __uint16_t uint16_t; >#define _UINT16_T_DECLARED >#endif ># 76 "/usr/include/arpa/inet.h" 3 4 > >#ifndef _UINT32_T_DECLARED >typedef __uint32_t uint32_t; >#define _UINT32_T_DECLARED >#endif ># 81 "/usr/include/arpa/inet.h" 3 4 > >#ifndef _IN_ADDR_T_DECLARED >typedef uint32_t in_addr_t; >#define _IN_ADDR_T_DECLARED >#endif ># 86 "/usr/include/arpa/inet.h" 3 4 > >#ifndef _IN_PORT_T_DECLARED >typedef uint16_t in_port_t; >#define _IN_PORT_T_DECLARED >#endif ># 91 "/usr/include/arpa/inet.h" 3 4 > >#if __BSD_VISIBLE >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 97 "/usr/include/arpa/inet.h" 3 4 >#endif ># 98 "/usr/include/arpa/inet.h" 3 4 > >/* > * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by > * POSIX.1-2001. > */ >#ifndef _SOCKLEN_T_DECLARED >typedef __socklen_t socklen_t; >#define _SOCKLEN_T_DECLARED >#endif ># 107 "/usr/include/arpa/inet.h" 3 4 > >#ifndef _STRUCT_IN_ADDR_DECLARED >struct in_addr { > in_addr_t s_addr; >}; >#define _STRUCT_IN_ADDR_DECLARED >#endif ># 114 "/usr/include/arpa/inet.h" 3 4 > >/* XXX all new diversions!! argh!! */ >#if __BSD_VISIBLE >#define inet_addr __inet_addr >#define inet_aton __inet_aton >#define inet_lnaof __inet_lnaof >#define inet_makeaddr __inet_makeaddr >#define inet_neta __inet_neta >#define inet_netof __inet_netof >#define inet_network __inet_network >#define inet_net_ntop __inet_net_ntop >#define inet_net_pton __inet_net_pton >#define inet_cidr_ntop __inet_cidr_ntop >#define inet_cidr_pton __inet_cidr_pton >#define inet_ntoa __inet_ntoa >#define inet_ntoa_r __inet_ntoa_r >#define inet_pton __inet_pton >#define inet_ntop __inet_ntop >#define inet_nsap_addr __inet_nsap_addr >#define inet_nsap_ntoa __inet_nsap_ntoa >#endif /* __BSD_VISIBLE */ ># 135 "/usr/include/arpa/inet.h" 3 4 > >__BEGIN_DECLS >#ifndef _BYTEORDER_PROTOTYPED >#define _BYTEORDER_PROTOTYPED >uint32_t htonl(uint32_t); >uint16_t htons(uint16_t); >uint32_t ntohl(uint32_t); >uint16_t ntohs(uint16_t); >#endif ># 144 "/usr/include/arpa/inet.h" 3 4 > >in_addr_t inet_addr(const char *); >/*const*/ char *inet_ntoa(struct in_addr); >const char *inet_ntop(int, const void * __restrict, char * __restrict, > socklen_t); >int inet_pton(int, const char * __restrict, void * __restrict); > >#if __BSD_VISIBLE >int inet_aton(const char *, struct in_addr *); >in_addr_t inet_lnaof(struct in_addr); >struct in_addr inet_makeaddr(in_addr_t, in_addr_t); >char * inet_neta(in_addr_t, char *, size_t); >in_addr_t inet_netof(struct in_addr); >in_addr_t inet_network(const char *); >char *inet_net_ntop(int, const void *, int, char *, size_t); >int inet_net_pton(int, const char *, void *, size_t); >char *inet_ntoa_r(struct in_addr, char *buf, socklen_t size); >char *inet_cidr_ntop(int, const void *, int, char *, size_t); >int inet_cidr_pton(int, const char *, void *, int *); >unsigned inet_nsap_addr(const char *, unsigned char *, int); >char *inet_nsap_ntoa(int, const unsigned char *, char *); >#endif /* __BSD_VISIBLE */ ># 166 "/usr/include/arpa/inet.h" 3 4 >__END_DECLS > >#ifndef _BYTEORDER_FUNC_DEFINED >#define _BYTEORDER_FUNC_DEFINED >#define htonl(x) __htonl(x) >#define htons(x) __htons(x) >#define ntohl(x) __ntohl(x) >#define ntohs(x) __ntohs(x) >#endif ># 175 "/usr/include/arpa/inet.h" 3 4 > >#endif /* !_ARPA_INET_H_ */ ># 177 "/usr/include/arpa/inet.h" 3 4 > >/*! \file */ ># 78 "../include/dps_common.h" 2 >#endif ># 79 "../include/dps_common.h" >#ifdef HAVE_ARPA_NAMESER_H >#if 0 /* expanded by -frewrite-includes */ >#include <arpa/nameser.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/arpa/nameser.h" 1 3 4 >/* > * Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") > * Portions Copyright (C) 1996-2003 Internet Software Consortium. > * > * Permission to use, copy, modify, and/or distribute this software for any > * purpose with or without fee is hereby granted, provided that the above > * copyright notice and this permission notice appear in all copies. > * > * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH > * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY > * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, > * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM > * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE > * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR > * PERFORMANCE OF THIS SOFTWARE. > */ > >/* > * Copyright (c) 1983, 1989, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > */ > >/* > * $Id: nameser.h,v 1.16 2009/03/03 01:52:48 each Exp $ > * $FreeBSD: releng/10.3/include/arpa/nameser.h 270838 2014-08-30 10:16:25Z ume $ > */ > >#ifndef _ARPA_NAMESER_H_ >#define _ARPA_NAMESER_H_ > >/*! \file */ > >#define BIND_4_COMPAT > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/param.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/param.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1989, 1993 > * The Regents of the University of California. All rights reserved. > * (c) UNIX System Laboratories, Inc. > * All or some portions of this file are derived from material licensed > * to the University of California by American Telephone and Telegraph > * Co. or Unix System Laboratories, Inc. and are reproduced herein with > * the permission of UNIX System Laboratories, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)param.h 8.3 (Berkeley) 4/4/95 > * $FreeBSD: releng/10.3/sys/sys/param.h 296373 2016-03-04 01:27:38Z marius $ > */ > >#ifndef _SYS_PARAM_H_ >#define _SYS_PARAM_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_null.h> >#endif /* expanded by -frewrite-includes */ ># 42 "/usr/include/sys/param.h" 3 4 > >#define BSD 199506 /* System version (year & month). */ >#define BSD4_3 1 >#define BSD4_4 1 > >/* > * __FreeBSD_version numbers are documented in the Porter's Handbook. > * If you bump the version for any reason, you should update the documentation > * there. > * Currently this lives here in the doc/ repository: > * > * head/en_US.ISO8859-1/books/porters-handbook/book.xml > * > * scheme is: <major><two digit minor>Rxx > * 'R' is in the range 0 to 4 if this is a release branch or > * x.0-CURRENT before RELENG_*_0 is created, otherwise 'R' is > * in the range 5 to 9. > */ >#undef __FreeBSD_version >#define __FreeBSD_version 1003000 /* Master, propagated to newvers */ > >/* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > * which by definition is always true on FreeBSD. This macro is also defined > * on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD. > * > * It is tempting to use this macro in userland code when we want to enable > * kernel-specific routines, and in fact it's fine to do this in code that > * is part of FreeBSD itself. However, be aware that as presence of this > * macro is still not widespread (e.g. older FreeBSD versions, 3rd party > * compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in > * external applications without also checking for __FreeBSD__ as an > * alternative. > */ >#undef __FreeBSD_kernel__ >#define __FreeBSD_kernel__ > >#ifdef _KERNEL >#define P_OSREL_SIGWAIT 700000 >#define P_OSREL_SIGSEGV 700004 >#define P_OSREL_MAP_ANON 800104 > >#define P_OSREL_MAJOR(x) ((x) / 100000) >#endif ># 86 "/usr/include/sys/param.h" 3 4 > >#ifndef LOCORE >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 89 "/usr/include/sys/param.h" 3 4 >#endif ># 90 "/usr/include/sys/param.h" 3 4 > >/* > * Machine-independent constants (some used in following include files). > * Redefined constants are from POSIX 1003.1 limits file. > * > * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>) > */ >#if 0 /* expanded by -frewrite-includes */ >#include <sys/syslimits.h> >#endif /* expanded by -frewrite-includes */ ># 98 "/usr/include/sys/param.h" 3 4 > >#define MAXCOMLEN 19 /* max command name remembered */ >#define MAXINTERP PATH_MAX /* max interpreter file name length */ >#define MAXLOGNAME 33 /* max login name length (incl. NUL) */ >#define MAXUPRC CHILD_MAX /* max simultaneous processes */ >#define NCARGS ARG_MAX /* max bytes for an exec function */ >#define NGROUPS (NGROUPS_MAX+1) /* max number groups */ >#define NOFILE OPEN_MAX /* max open files per process */ >#define NOGROUP 65535 /* marker for empty group set member */ >#define MAXHOSTNAMELEN 256 /* max hostname size */ >#define SPECNAMELEN 63 /* max length of devicename */ > >/* More types and definitions used throughout the kernel. */ >#ifdef _KERNEL >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 113 "/usr/include/sys/param.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/errno.h> >#endif /* expanded by -frewrite-includes */ ># 114 "/usr/include/sys/param.h" 3 4 >#ifndef LOCORE >#if 0 /* expanded by -frewrite-includes */ >#include <sys/time.h> >#endif /* expanded by -frewrite-includes */ ># 116 "/usr/include/sys/param.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/priority.h> >#endif /* expanded by -frewrite-includes */ ># 117 "/usr/include/sys/param.h" 3 4 >#endif ># 118 "/usr/include/sys/param.h" 3 4 > >#ifndef FALSE >#define FALSE 0 >#endif ># 122 "/usr/include/sys/param.h" 3 4 >#ifndef TRUE >#define TRUE 1 >#endif ># 125 "/usr/include/sys/param.h" 3 4 >#endif ># 126 "/usr/include/sys/param.h" 3 4 > >#ifndef _KERNEL >/* Signals. */ >#if 0 /* expanded by -frewrite-includes */ >#include <sys/signal.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/signal.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1989, 1991, 1993 > * The Regents of the University of California. All rights reserved. > * (c) UNIX System Laboratories, Inc. > * All or some portions of this file are derived from material licensed > * to the University of California by American Telephone and Telegraph > * Co. or Unix System Laboratories, Inc. and are reproduced herein with > * the permission of UNIX System Laboratories, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)signal.h 8.4 (Berkeley) 5/4/95 > * $FreeBSD: releng/10.3/sys/sys/signal.h 233519 2012-03-26 19:12:09Z rmh $ > */ > >#ifndef _SYS_SIGNAL_H_ >#define _SYS_SIGNAL_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 42 "/usr/include/sys/signal.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 43 "/usr/include/sys/signal.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_sigset.h> >#endif /* expanded by -frewrite-includes */ ># 44 "/usr/include/sys/signal.h" 3 4 > >#if 0 /* expanded by -frewrite-includes */ >#include <machine/_limits.h> /* __MINSIGSTKSZ */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/_limits.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/_limits.h 232262 2012-02-28 18:24:28Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/_limits.h> >#endif /* expanded by -frewrite-includes */ ># 7 "/usr/include/machine/_limits.h" 3 4 ># 46 "/usr/include/sys/signal.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <machine/signal.h> /* sig_atomic_t; trap codes; sigcontext */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/signal.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/signal.h 247047 2013-02-20 17:39:52Z kib $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/signal.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/x86/signal.h" 1 3 4 >/*- > * Copyright (c) 1986, 1989, 1991, 1993 > * The Regents of the University of California. All rights reserved. > * Copyright (c) 2003 Peter Wemm. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)signal.h 8.1 (Berkeley) 6/11/93 > * $FreeBSD: releng/10.3/sys/x86/include/signal.h 247047 2013-02-20 17:39:52Z kib $ > */ > >#ifndef _X86_SIGNAL_H >#define _X86_SIGNAL_H 1 > >/* > * Machine-dependent signal definitions > */ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 42 "/usr/include/x86/signal.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_sigset.h> >#endif /* expanded by -frewrite-includes */ ># 43 "/usr/include/x86/signal.h" 3 4 > >#if __BSD_VISIBLE >#if 0 /* expanded by -frewrite-includes */ >#include <machine/trap.h> /* codes for SIGILL, SIGFPE */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/trap.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/trap.h 232492 2012-03-04 14:12:57Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/trap.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/x86/trap.h" 1 3 4 >/*- > * Copyright (c) 1990 The Regents of the University of California. > * All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * William Jolitz. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * from: @(#)trap.h 5.4 (Berkeley) 5/9/91 > * $FreeBSD: releng/10.3/sys/x86/include/trap.h 262042 2014-02-17 12:57:13Z avg $ > */ > >#ifndef _MACHINE_TRAP_H_ >#define _MACHINE_TRAP_H_ > >/* > * Trap type values > * also known in trap.c for name strings > */ > >#define T_PRIVINFLT 1 /* privileged instruction */ >#define T_BPTFLT 3 /* breakpoint instruction */ >#define T_ARITHTRAP 6 /* arithmetic trap */ >#define T_PROTFLT 9 /* protection fault */ >#define T_TRCTRAP 10 /* debug exception (sic) */ >#define T_PAGEFLT 12 /* page fault */ >#define T_ALIGNFLT 14 /* alignment fault */ > >#define T_DIVIDE 18 /* integer divide fault */ >#define T_NMI 19 /* non-maskable trap */ >#define T_OFLOW 20 /* overflow trap */ >#define T_BOUND 21 /* bound instruction fault */ >#define T_DNA 22 /* device not available fault */ >#define T_DOUBLEFLT 23 /* double fault */ >#define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ >#define T_TSSFLT 25 /* invalid tss fault */ >#define T_SEGNPFLT 26 /* segment not present fault */ >#define T_STKFLT 27 /* stack fault */ >#define T_MCHK 28 /* machine check trap */ >#define T_XMMFLT 29 /* SIMD floating-point exception */ >#define T_RESERVED 30 /* reserved (unknown) */ >#define T_DTRACE_RET 32 /* DTrace pid return */ > >/* XXX most of the following codes aren't used, but could be. */ > >/* definitions for <sys/signal.h> */ >#define ILL_RESAD_FAULT T_RESADFLT >#define ILL_PRIVIN_FAULT T_PRIVINFLT >#define ILL_RESOP_FAULT T_RESOPFLT >#define ILL_ALIGN_FAULT T_ALIGNFLT >#define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ > >/* old FreeBSD macros, deprecated */ >#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ >#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ >#define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ >#define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ >#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ >#define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ >#define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ > >/* codes for SIGBUS */ >#define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ >#define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ >#define BUS_STK_FAULT T_STKFLT /* stack segment */ >#define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ > >/* Trap's coming from user mode */ >#define T_USER 0x100 > >#endif /* !_MACHINE_TRAP_H_ */ ># 95 "/usr/include/x86/trap.h" 3 4 ># 7 "/usr/include/machine/trap.h" 2 3 4 ># 46 "/usr/include/x86/signal.h" 2 3 4 >#endif ># 47 "/usr/include/x86/signal.h" 3 4 > >#ifdef __i386__ >typedef int sig_atomic_t; > >#if __BSD_VISIBLE >struct sigcontext { > struct __sigset sc_mask; /* signal mask to restore */ > int sc_onstack; /* sigstack state to restore */ > int sc_gs; /* machine state (struct trapframe) */ > int sc_fs; > int sc_es; > int sc_ds; > int sc_edi; > int sc_esi; > int sc_ebp; > int sc_isp; > int sc_ebx; > int sc_edx; > int sc_ecx; > int sc_eax; > int sc_trapno; > int sc_err; > int sc_eip; > int sc_cs; > int sc_efl; > int sc_esp; > int sc_ss; > int sc_len; /* sizeof(mcontext_t) */ > /* > * See <machine/ucontext.h> and <machine/npx.h> for > * the following fields. > */ > int sc_fpformat; > int sc_ownedfp; > int sc_flags; > int sc_fpstate[128] __aligned(16); > > int sc_fsbase; > int sc_gsbase; > > int sc_xfpustate; > int sc_xfpustate_len; > > int sc_spare2[4]; >}; > >#define sc_sp sc_esp >#define sc_fp sc_ebp >#define sc_pc sc_eip >#define sc_ps sc_efl >#define sc_eflags sc_efl > >#endif /* __BSD_VISIBLE */ ># 100 "/usr/include/x86/signal.h" 3 4 >#endif /* __i386__ */ ># 101 "/usr/include/x86/signal.h" 3 4 > >#ifdef __amd64__ >typedef long sig_atomic_t; > >#if __BSD_VISIBLE >/* > * Information pushed on stack when a signal is delivered. > * This is used by the kernel to restore state following > * execution of the signal handler. It is also made available > * to the handler to allow it to restore state properly if > * a non-standard exit is performed. > * > * The sequence of the fields/registers after sc_mask in struct > * sigcontext must match those in mcontext_t and struct trapframe. > */ >struct sigcontext { > struct __sigset sc_mask; /* signal mask to restore */ > long sc_onstack; /* sigstack state to restore */ > long sc_rdi; /* machine state (struct trapframe) */ > long sc_rsi; > long sc_rdx; > long sc_rcx; > long sc_r8; > long sc_r9; > long sc_rax; > long sc_rbx; > long sc_rbp; > long sc_r10; > long sc_r11; > long sc_r12; > long sc_r13; > long sc_r14; > long sc_r15; > int sc_trapno; > short sc_fs; > short sc_gs; > long sc_addr; > int sc_flags; > short sc_es; > short sc_ds; > long sc_err; > long sc_rip; > long sc_cs; > long sc_rflags; > long sc_rsp; > long sc_ss; > long sc_len; /* sizeof(mcontext_t) */ > /* > * See <machine/ucontext.h> and <machine/fpu.h> for the following > * fields. > */ > long sc_fpformat; > long sc_ownedfp; > long sc_fpstate[64] __aligned(16); > > long sc_fsbase; > long sc_gsbase; > > long sc_xfpustate; > long sc_xfpustate_len; > > long sc_spare[4]; >}; >#endif /* __BSD_VISIBLE */ ># 165 "/usr/include/x86/signal.h" 3 4 >#endif /* __amd64__ */ ># 166 "/usr/include/x86/signal.h" 3 4 > >#endif ># 168 "/usr/include/x86/signal.h" 3 4 ># 7 "/usr/include/machine/signal.h" 2 3 4 ># 47 "/usr/include/sys/signal.h" 2 3 4 > >/* > * System defined signals. > */ >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SIGHUP 1 /* hangup */ >#endif ># 54 "/usr/include/sys/signal.h" 3 4 >#define SIGINT 2 /* interrupt */ >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SIGQUIT 3 /* quit */ >#endif ># 58 "/usr/include/sys/signal.h" 3 4 >#define SIGILL 4 /* illegal instr. (not reset when caught) */ >#if __XSI_VISIBLE >#define SIGTRAP 5 /* trace trap (not reset when caught) */ >#endif ># 62 "/usr/include/sys/signal.h" 3 4 >#define SIGABRT 6 /* abort() */ >#if __BSD_VISIBLE >#define SIGIOT SIGABRT /* compatibility */ >#define SIGEMT 7 /* EMT instruction */ >#endif ># 67 "/usr/include/sys/signal.h" 3 4 >#define SIGFPE 8 /* floating point exception */ >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SIGKILL 9 /* kill (cannot be caught or ignored) */ >#endif ># 71 "/usr/include/sys/signal.h" 3 4 >#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >#define SIGBUS 10 /* bus error */ >#endif ># 74 "/usr/include/sys/signal.h" 3 4 >#define SIGSEGV 11 /* segmentation violation */ >#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >#define SIGSYS 12 /* non-existent system call invoked */ >#endif ># 78 "/usr/include/sys/signal.h" 3 4 >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SIGPIPE 13 /* write on a pipe with no one to read it */ >#define SIGALRM 14 /* alarm clock */ >#endif ># 82 "/usr/include/sys/signal.h" 3 4 >#define SIGTERM 15 /* software termination signal from kill */ >#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >#define SIGURG 16 /* urgent condition on IO channel */ >#endif ># 86 "/usr/include/sys/signal.h" 3 4 >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SIGSTOP 17 /* sendable stop signal not from tty */ >#define SIGTSTP 18 /* stop signal from tty */ >#define SIGCONT 19 /* continue a stopped process */ >#define SIGCHLD 20 /* to parent on child stop or exit */ >#define SIGTTIN 21 /* to readers pgrp upon background tty read */ >#define SIGTTOU 22 /* like TTIN if (tp->t_local<OSTOP) */ >#endif ># 94 "/usr/include/sys/signal.h" 3 4 >#if __BSD_VISIBLE >#define SIGIO 23 /* input/output possible signal */ >#endif ># 97 "/usr/include/sys/signal.h" 3 4 >#if __XSI_VISIBLE >#define SIGXCPU 24 /* exceeded CPU time limit */ >#define SIGXFSZ 25 /* exceeded file size limit */ >#define SIGVTALRM 26 /* virtual time alarm */ >#define SIGPROF 27 /* profiling time alarm */ >#endif ># 103 "/usr/include/sys/signal.h" 3 4 >#if __BSD_VISIBLE >#define SIGWINCH 28 /* window size changes */ >#define SIGINFO 29 /* information request */ >#endif ># 107 "/usr/include/sys/signal.h" 3 4 >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SIGUSR1 30 /* user defined signal 1 */ >#define SIGUSR2 31 /* user defined signal 2 */ >#endif ># 111 "/usr/include/sys/signal.h" 3 4 >#if __BSD_VISIBLE >#define SIGTHR 32 /* reserved by thread library. */ >#define SIGLWP SIGTHR >#define SIGLIBRT 33 /* reserved by real-time library. */ >#endif ># 116 "/usr/include/sys/signal.h" 3 4 > >#define SIGRTMIN 65 >#define SIGRTMAX 126 > >#define SIG_DFL ((__sighandler_t *)0) >#define SIG_IGN ((__sighandler_t *)1) >#define SIG_ERR ((__sighandler_t *)-1) >/* #define SIG_CATCH ((__sighandler_t *)2) See signalvar.h */ >#define SIG_HOLD ((__sighandler_t *)3) > >/* > * Type of a signal handling function. > * > * Language spec sez signal handlers take exactly one arg, even though we > * actually supply three. Ugh! > * > * We don't try to hide the difference by leaving out the args because > * that would cause warnings about conformant programs. Nonconformant > * programs can avoid the warnings by casting to (__sighandler_t *) or > * sig_t before calling signal() or assigning to sa_handler or sv_handler. > * > * The kernel should reverse the cast before calling the function. It > * has no way to do this, but on most machines 1-arg and 3-arg functions > * have the same calling protocol so there is no problem in practice. > * A bit in sa_flags could be used to specify the number of args. > */ >typedef void __sighandler_t(int); > >#if __POSIX_VISIBLE || __XSI_VISIBLE >#ifndef _SIGSET_T_DECLARED >#define _SIGSET_T_DECLARED >typedef __sigset_t sigset_t; >#endif ># 149 "/usr/include/sys/signal.h" 3 4 >#endif ># 150 "/usr/include/sys/signal.h" 3 4 > >#if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE >= 500 >union sigval { > /* Members as suggested by Annex C of POSIX 1003.1b. */ > int sival_int; > void *sival_ptr; > /* 6.0 compatibility */ > int sigval_int; > void *sigval_ptr; >}; >#endif ># 161 "/usr/include/sys/signal.h" 3 4 > >#if __POSIX_VISIBLE >= 199309 >struct sigevent { > int sigev_notify; /* Notification type */ > int sigev_signo; /* Signal number */ > union sigval sigev_value; /* Signal value */ > union { > __lwpid_t _threadid; > struct { > void (*_function)(union sigval); > void *_attribute; /* pthread_attr_t * */ > } _sigev_thread; > unsigned short _kevent_flags; > long __spare__[8]; > } _sigev_un; >}; > >#if __BSD_VISIBLE >#define sigev_notify_kqueue sigev_signo >#define sigev_notify_kevent_flags _sigev_un._kevent_flags >#define sigev_notify_thread_id _sigev_un._threadid >#endif ># 183 "/usr/include/sys/signal.h" 3 4 >#define sigev_notify_function _sigev_un._sigev_thread._function >#define sigev_notify_attributes _sigev_un._sigev_thread._attribute > >#define SIGEV_NONE 0 /* No async notification. */ >#define SIGEV_SIGNAL 1 /* Generate a queued signal. */ >#define SIGEV_THREAD 2 /* Call back from another pthread. */ >#if __BSD_VISIBLE >#define SIGEV_KEVENT 3 /* Generate a kevent. */ >#define SIGEV_THREAD_ID 4 /* Send signal to a kernel thread. */ >#endif ># 193 "/usr/include/sys/signal.h" 3 4 >#endif /* __POSIX_VISIBLE >= 199309 */ ># 194 "/usr/include/sys/signal.h" 3 4 > >#if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE >typedef struct __siginfo { > int si_signo; /* signal number */ > int si_errno; /* errno association */ > /* > * Cause of signal, one of the SI_ macros or signal-specific > * values, i.e. one of the FPE_... values for SIGFPE. This > * value is equivalent to the second argument to an old-style > * FreeBSD signal handler. > */ > int si_code; /* signal code */ > __pid_t si_pid; /* sending process */ > __uid_t si_uid; /* sender's ruid */ > int si_status; /* exit value */ > void *si_addr; /* faulting instruction */ > union sigval si_value; /* signal value */ > union { > struct { > int _trapno;/* machine specific trap code */ > } _fault; > struct { > int _timerid; > int _overrun; > } _timer; > struct { > int _mqd; > } _mesgq; > struct { > long _band; /* band event for SIGPOLL */ > } _poll; /* was this ever used ? */ > struct { > long __spare1__; > int __spare2__[7]; > } __spare__; > } _reason; >} siginfo_t; > >#define si_trapno _reason._fault._trapno >#define si_timerid _reason._timer._timerid >#define si_overrun _reason._timer._overrun >#define si_mqd _reason._mesgq._mqd >#define si_band _reason._poll._band > >/** si_code **/ >/* codes for SIGILL */ >#define ILL_ILLOPC 1 /* Illegal opcode. */ >#define ILL_ILLOPN 2 /* Illegal operand. */ >#define ILL_ILLADR 3 /* Illegal addressing mode. */ >#define ILL_ILLTRP 4 /* Illegal trap. */ >#define ILL_PRVOPC 5 /* Privileged opcode. */ >#define ILL_PRVREG 6 /* Privileged register. */ >#define ILL_COPROC 7 /* Coprocessor error. */ >#define ILL_BADSTK 8 /* Internal stack error. */ > >/* codes for SIGBUS */ >#define BUS_ADRALN 1 /* Invalid address alignment. */ >#define BUS_ADRERR 2 /* Nonexistent physical address. */ >#define BUS_OBJERR 3 /* Object-specific hardware error. */ > >/* codes for SIGSEGV */ >#define SEGV_MAPERR 1 /* Address not mapped to object. */ >#define SEGV_ACCERR 2 /* Invalid permissions for mapped */ > /* object. */ > >/* codes for SIGFPE */ >#define FPE_INTOVF 1 /* Integer overflow. */ >#define FPE_INTDIV 2 /* Integer divide by zero. */ >#define FPE_FLTDIV 3 /* Floating point divide by zero. */ >#define FPE_FLTOVF 4 /* Floating point overflow. */ >#define FPE_FLTUND 5 /* Floating point underflow. */ >#define FPE_FLTRES 6 /* Floating point inexact result. */ >#define FPE_FLTINV 7 /* Invalid floating point operation. */ >#define FPE_FLTSUB 8 /* Subscript out of range. */ > >/* codes for SIGTRAP */ >#define TRAP_BRKPT 1 /* Process breakpoint. */ >#define TRAP_TRACE 2 /* Process trace trap. */ >#define TRAP_DTRACE 3 /* DTrace induced trap. */ > >/* codes for SIGCHLD */ >#define CLD_EXITED 1 /* Child has exited */ >#define CLD_KILLED 2 /* Child has terminated abnormally but */ > /* did not create a core file */ >#define CLD_DUMPED 3 /* Child has terminated abnormally and */ > /* created a core file */ >#define CLD_TRAPPED 4 /* Traced child has trapped */ >#define CLD_STOPPED 5 /* Child has stopped */ >#define CLD_CONTINUED 6 /* Stopped child has continued */ > >/* codes for SIGPOLL */ >#define POLL_IN 1 /* Data input available */ >#define POLL_OUT 2 /* Output buffers available */ >#define POLL_MSG 3 /* Input message available */ >#define POLL_ERR 4 /* I/O Error */ >#define POLL_PRI 5 /* High priority input available */ >#define POLL_HUP 6 /* Device disconnected */ > >#endif ># 293 "/usr/include/sys/signal.h" 3 4 > >#if __POSIX_VISIBLE || __XSI_VISIBLE >struct __siginfo; > >/* > * Signal vector "template" used in sigaction call. > */ >struct sigaction { > union { > void (*__sa_handler)(int); > void (*__sa_sigaction)(int, struct __siginfo *, void *); > } __sigaction_u; /* signal handler */ > int sa_flags; /* see signal options below */ > sigset_t sa_mask; /* signal mask to apply */ >}; > >#define sa_handler __sigaction_u.__sa_handler >#endif ># 311 "/usr/include/sys/signal.h" 3 4 > >#if __XSI_VISIBLE >/* If SA_SIGINFO is set, sa_sigaction must be used instead of sa_handler. */ >#define sa_sigaction __sigaction_u.__sa_sigaction >#endif ># 316 "/usr/include/sys/signal.h" 3 4 > >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ >#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ ># 320 "/usr/include/sys/signal.h" 3 4 > >#if __XSI_VISIBLE >#define SA_ONSTACK 0x0001 /* take signal on signal stack */ >#define SA_RESTART 0x0002 /* restart system call on signal return */ >#define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ >#define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ >#define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */ >#define SA_SIGINFO 0x0040 /* signal handler with SA_SIGINFO args */ >#endif ># 329 "/usr/include/sys/signal.h" 3 4 > >#if __BSD_VISIBLE >#define NSIG 32 /* number of old signals (counting 0) */ >#endif ># 333 "/usr/include/sys/signal.h" 3 4 > >#if __POSIX_VISIBLE || __XSI_VISIBLE >#define SI_NOINFO 0 /* No signal info besides si_signo. */ >#define SI_USER 0x10001 /* Signal sent by kill(). */ >#define SI_QUEUE 0x10002 /* Signal sent by the sigqueue(). */ >#define SI_TIMER 0x10003 /* Signal generated by expiration of */ > /* a timer set by timer_settime(). */ >#define SI_ASYNCIO 0x10004 /* Signal generated by completion of */ > /* an asynchronous I/O request.*/ >#define SI_MESGQ 0x10005 /* Signal generated by arrival of a */ > /* message on an empty message queue. */ >#define SI_KERNEL 0x10006 >#define SI_LWP 0x10007 /* Signal sent by thr_kill */ >#endif ># 347 "/usr/include/sys/signal.h" 3 4 >#if __BSD_VISIBLE >#define SI_UNDEFINED 0 >#endif ># 350 "/usr/include/sys/signal.h" 3 4 > >#if __BSD_VISIBLE >typedef __sighandler_t *sig_t; /* type of pointer to a signal function */ >typedef void __siginfohandler_t(int, struct __siginfo *, void *); >#endif ># 355 "/usr/include/sys/signal.h" 3 4 > >#if __XSI_VISIBLE >/* > * Structure used in sigaltstack call. > */ >#if __BSD_VISIBLE >typedef struct sigaltstack { >#else ># 363 "/usr/include/sys/signal.h" 3 4 >typedef struct { >#endif ># 365 "/usr/include/sys/signal.h" 3 4 > char *ss_sp; /* signal stack base */ > __size_t ss_size; /* signal stack length */ > int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ >} stack_t; > >#define SS_ONSTACK 0x0001 /* take signal on alternate stack */ >#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ >#define MINSIGSTKSZ __MINSIGSTKSZ /* minimum stack size */ >#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ >#endif ># 375 "/usr/include/sys/signal.h" 3 4 > >#if __BSD_VISIBLE >/* > * 4.3 compatibility: > * Signal vector "template" used in sigvec call. > */ >struct sigvec { > __sighandler_t *sv_handler; /* signal handler */ > int sv_mask; /* signal mask to apply */ > int sv_flags; /* see signal options below */ >}; > >#define SV_ONSTACK SA_ONSTACK >#define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */ >#define SV_RESETHAND SA_RESETHAND >#define SV_NODEFER SA_NODEFER >#define SV_NOCLDSTOP SA_NOCLDSTOP >#define SV_SIGINFO SA_SIGINFO >#define sv_onstack sv_flags /* isn't compatibility wonderful! */ >#endif ># 395 "/usr/include/sys/signal.h" 3 4 > >/* Keep this in one place only */ >#if defined(_KERNEL) && defined(COMPAT_43) && \ > !defined(__i386__) >struct osigcontext { > int _not_used; >}; >#endif ># 403 "/usr/include/sys/signal.h" 3 4 > >#if __XSI_VISIBLE >/* > * Structure used in sigstack call. > */ >struct sigstack { > /* XXX ss_sp's type should be `void *'. */ > char *ss_sp; /* signal stack pointer */ > int ss_onstack; /* current status */ >}; >#endif ># 414 "/usr/include/sys/signal.h" 3 4 > >#if __BSD_VISIBLE || __POSIX_VISIBLE > 0 && __POSIX_VISIBLE <= 200112 >/* > * Macro for converting signal number to a mask suitable for > * sigblock(). > */ >#define sigmask(m) (1 << ((m)-1)) >#endif ># 422 "/usr/include/sys/signal.h" 3 4 > >#if __BSD_VISIBLE >#define BADSIG SIG_ERR >#endif ># 426 "/usr/include/sys/signal.h" 3 4 > >#if __POSIX_VISIBLE || __XSI_VISIBLE >/* > * Flags for sigprocmask: > */ >#define SIG_BLOCK 1 /* block specified signal set */ >#define SIG_UNBLOCK 2 /* unblock specified signal set */ >#define SIG_SETMASK 3 /* set specified signal set */ >#endif ># 435 "/usr/include/sys/signal.h" 3 4 > >/* > * For historical reasons; programs expect signal's return value to be > * defined by <sys/signal.h>. > */ >__BEGIN_DECLS >__sighandler_t *signal(int, __sighandler_t *); >__END_DECLS > >#endif /* !_SYS_SIGNAL_H_ */ ># 445 "/usr/include/sys/signal.h" 3 4 ># 130 "/usr/include/sys/param.h" 2 3 4 >#endif ># 131 "/usr/include/sys/param.h" 3 4 > >/* Machine type dependent parameters. */ >#if 0 /* expanded by -frewrite-includes */ >#include <machine/param.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/param.h" 1 3 4 >/*- > * Copyright (c) 2002 David E. O'Brien. All rights reserved. > * Copyright (c) 1992, 1993 > * The Regents of the University of California. All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * the Systems Programming Group of the University of Utah Computer > * Science Department and Ralph Campbell. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. All advertising materials mentioning features or use of this software > * must display the following acknowledgement: > * This product includes software developed by the University of > * California, Berkeley and its contributors. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)param.h 8.1 (Berkeley) 6/10/93 > * $FreeBSD: releng/10.3/sys/amd64/include/param.h 286305 2015-08-05 07:21:44Z kib $ > */ > > >#ifndef _AMD64_INCLUDE_PARAM_H_ >#define _AMD64_INCLUDE_PARAM_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <machine/_align.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/_align.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/_align.h 215856 2010-11-26 10:59:20Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/_align.h> >#endif /* expanded by -frewrite-includes */ ># 7 "/usr/include/machine/_align.h" 3 4 ># 47 "/usr/include/machine/param.h" 2 3 4 > >/* > * Machine dependent constants for AMD64. > */ > > >#define __HAVE_ACPI >#define __PCI_REROUTE_INTERRUPT > >#ifndef MACHINE >#define MACHINE "amd64" >#endif ># 59 "/usr/include/machine/param.h" 3 4 >#ifndef MACHINE_ARCH >#define MACHINE_ARCH "amd64" >#endif ># 62 "/usr/include/machine/param.h" 3 4 >#ifndef MACHINE_ARCH32 >#define MACHINE_ARCH32 "i386" >#endif ># 65 "/usr/include/machine/param.h" 3 4 > >#if defined(SMP) || defined(KLD_MODULE) >#ifndef MAXCPU >#define MAXCPU 64 >#endif ># 70 "/usr/include/machine/param.h" 3 4 >#else ># 71 "/usr/include/machine/param.h" 3 4 >#define MAXCPU 1 >#endif ># 73 "/usr/include/machine/param.h" 3 4 > >#ifndef MAXMEMDOM >#define MAXMEMDOM 1 >#endif ># 77 "/usr/include/machine/param.h" 3 4 > >#define ALIGNBYTES _ALIGNBYTES >#define ALIGN(p) _ALIGN(p) >/* > * ALIGNED_POINTER is a boolean macro that checks whether an address > * is valid to fetch data elements of type t from on this architecture. > * This does not reflect the optimal alignment, just the possibility > * (within reasonable limits). > */ >#define ALIGNED_POINTER(p, t) 1 > >/* > * CACHE_LINE_SIZE is the compile-time maximum cache line size for an > * architecture. It should be used with appropriate caution. > */ >#define CACHE_LINE_SHIFT 7 >#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT) > >/* Size of the level 1 page table units */ >#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t))) >#define NPTEPGSHIFT 9 /* LOG2(NPTEPG) */ >#define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */ >#define PAGE_SIZE (1<<PAGE_SHIFT) /* bytes/page */ >#define PAGE_MASK (PAGE_SIZE-1) >/* Size of the level 2 page directory units */ >#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t))) >#define NPDEPGSHIFT 9 /* LOG2(NPDEPG) */ >#define PDRSHIFT 21 /* LOG2(NBPDR) */ >#define NBPDR (1<<PDRSHIFT) /* bytes/page dir */ >#define PDRMASK (NBPDR-1) >/* Size of the level 3 page directory pointer table units */ >#define NPDPEPG (PAGE_SIZE/(sizeof (pdp_entry_t))) >#define NPDPEPGSHIFT 9 /* LOG2(NPDPEPG) */ >#define PDPSHIFT 30 /* LOG2(NBPDP) */ >#define NBPDP (1<<PDPSHIFT) /* bytes/page dir ptr table */ >#define PDPMASK (NBPDP-1) >/* Size of the level 4 page-map level-4 table units */ >#define NPML4EPG (PAGE_SIZE/(sizeof (pml4_entry_t))) >#define NPML4EPGSHIFT 9 /* LOG2(NPML4EPG) */ >#define PML4SHIFT 39 /* LOG2(NBPML4) */ >#define NBPML4 (1UL<<PML4SHIFT)/* bytes/page map lev4 table */ >#define PML4MASK (NBPML4-1) > >#define MAXPAGESIZES 3 /* maximum number of supported page sizes */ > >#define IOPAGES 2 /* pages of i/o permission bitmap */ > >#ifndef KSTACK_PAGES >#define KSTACK_PAGES 4 /* pages of kstack (with pcb) */ >#endif ># 127 "/usr/include/machine/param.h" 3 4 >#define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ > >/* > * Mach derived conversion macros > */ >#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) >#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK)) >#define trunc_2mpage(x) ((unsigned long)(x) & ~PDRMASK) >#define round_2mpage(x) ((((unsigned long)(x)) + PDRMASK) & ~PDRMASK) >#define trunc_1gpage(x) ((unsigned long)(x) & ~PDPMASK) > >#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) >#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) > >#define amd64_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) >#define amd64_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) > >#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) > >#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ > || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) > >#endif /* !_AMD64_INCLUDE_PARAM_H_ */ ># 150 "/usr/include/machine/param.h" 3 4 ># 134 "/usr/include/sys/param.h" 2 3 4 >#ifndef _KERNEL >#if 0 /* expanded by -frewrite-includes */ >#include <sys/limits.h> >#endif /* expanded by -frewrite-includes */ ># 136 "/usr/include/sys/param.h" 3 4 >#endif ># 137 "/usr/include/sys/param.h" 3 4 > >#ifndef DEV_BSHIFT >#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ >#endif ># 141 "/usr/include/sys/param.h" 3 4 >#define DEV_BSIZE (1<<DEV_BSHIFT) > >#ifndef BLKDEV_IOSIZE >#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */ >#endif ># 146 "/usr/include/sys/param.h" 3 4 >#ifndef DFLTPHYS >#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */ >#endif ># 149 "/usr/include/sys/param.h" 3 4 >#ifndef MAXPHYS >#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */ >#endif ># 152 "/usr/include/sys/param.h" 3 4 >#ifndef MAXDUMPPGS >#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE) >#endif ># 155 "/usr/include/sys/param.h" 3 4 > >/* > * Constants related to network buffer management. > * MCLBYTES must be no larger than PAGE_SIZE. > */ >#ifndef MSIZE >#define MSIZE 256 /* size of an mbuf */ >#endif ># 163 "/usr/include/sys/param.h" 3 4 > >#ifndef MCLSHIFT >#define MCLSHIFT 11 /* convert bytes to mbuf clusters */ >#endif /* MCLSHIFT */ ># 167 "/usr/include/sys/param.h" 3 4 > >#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */ > >#if PAGE_SIZE < 2048 >#define MJUMPAGESIZE MCLBYTES >#elif PAGE_SIZE <= 8192 ># 173 "/usr/include/sys/param.h" 3 4 >#define MJUMPAGESIZE PAGE_SIZE >#else ># 175 "/usr/include/sys/param.h" 3 4 >#define MJUMPAGESIZE (8 * 1024) >#endif ># 177 "/usr/include/sys/param.h" 3 4 > >#define MJUM9BYTES (9 * 1024) /* jumbo cluster 9k */ >#define MJUM16BYTES (16 * 1024) /* jumbo cluster 16k */ > >/* > * Some macros for units conversion > */ > >/* clicks to bytes */ >#ifndef ctob >#define ctob(x) ((x)<<PAGE_SHIFT) >#endif ># 189 "/usr/include/sys/param.h" 3 4 > >/* bytes to clicks */ >#ifndef btoc >#define btoc(x) (((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT) >#endif ># 194 "/usr/include/sys/param.h" 3 4 > >/* > * btodb() is messy and perhaps slow because `bytes' may be an off_t. We > * want to shift an unsigned type to avoid sign extension and we don't > * want to widen `bytes' unnecessarily. Assume that the result fits in > * a daddr_t. > */ >#ifndef btodb >#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ > (sizeof (bytes) > sizeof(long) \ > ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ > : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) >#endif ># 207 "/usr/include/sys/param.h" 3 4 > >#ifndef dbtob >#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ > ((off_t)(db) << DEV_BSHIFT) >#endif ># 212 "/usr/include/sys/param.h" 3 4 > >#define PRIMASK 0x0ff >#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ >#define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */ > >#define NZERO 0 /* default "nice" */ > >#define NBBY 8 /* number of bits in a byte */ >#define NBPW sizeof(int) /* number of bytes per word (integer) */ > >#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ > >#define NODEV (dev_t)(-1) /* non-existent device */ > >/* > * File system parameters and macros. > * > * MAXBSIZE - Filesystems are made out of blocks of at most MAXBSIZE bytes > * per block. MAXBSIZE may be made larger without effecting > * any existing filesystems as long as it does not exceed MAXPHYS, > * and may be made smaller at the risk of not being able to use > * filesystems which require a block size exceeding MAXBSIZE. > * > * MAXBCACHEBUF - Maximum size of a buffer in the buffer cache. This must > * be >= MAXBSIZE and can be set differently for different > * architectures by defining it in <machine/param.h>. > * Making this larger allows NFS to do larger reads/writes. > * > * BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the > * minimum KVM memory reservation the kernel is willing to make. > * Filesystems can of course request smaller chunks. Actual > * backing memory uses a chunk size of a page (PAGE_SIZE). > * The default value here can be overridden on a per-architecture > * basis by defining it in <machine/param.h>. This should > * probably be done to increase its value, when MAXBCACHEBUF is > * defined as a larger value in <machine/param.h>. > * > * If you make BKVASIZE too small you risk seriously fragmenting > * the buffer KVM map which may slow things down a bit. If you > * make it too big the kernel will not be able to optimally use > * the KVM memory reserved for the buffer cache and will wind > * up with too-few buffers. > * > * The default is 16384, roughly 2x the block size used by a > * normal UFS filesystem. > */ >#define MAXBSIZE 65536 /* must be power of 2 */ >#ifndef MAXBCACHEBUF >#define MAXBCACHEBUF MAXBSIZE /* must be a power of 2 >= MAXBSIZE */ >#endif ># 262 "/usr/include/sys/param.h" 3 4 >#ifndef BKVASIZE >#define BKVASIZE 16384 /* must be power of 2 */ >#endif ># 265 "/usr/include/sys/param.h" 3 4 >#define BKVAMASK (BKVASIZE-1) > >/* > * MAXPATHLEN defines the longest permissible path length after expanding > * symbolic links. It is used to allocate a temporary buffer from the buffer > * pool in which to do the name expansion, hence should be a power of two, > * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the > * maximum number of symbolic links that may be expanded in a path name. > * It should be set high enough to allow all legitimate uses, but halt > * infinite loops reasonably quickly. > */ >#define MAXPATHLEN PATH_MAX >#define MAXSYMLINKS 32 > >/* Bit map related macros. */ >#define setbit(a,i) (((unsigned char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY)) >#define clrbit(a,i) (((unsigned char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY))) >#define isset(a,i) \ > (((const unsigned char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) >#define isclr(a,i) \ > ((((const unsigned char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0) > >/* Macros for counting and rounding. */ >#ifndef howmany >#define howmany(x, y) (((x)+((y)-1))/(y)) >#endif ># 291 "/usr/include/sys/param.h" 3 4 >#define nitems(x) (sizeof((x)) / sizeof((x)[0])) >#define rounddown(x, y) (((x)/(y))*(y)) >#define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */ >#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ >#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ >#define powerof2(x) ((((x)-1)&(x))==0) > >/* Macros for min/max. */ >#define MIN(a,b) (((a)<(b))?(a):(b)) >#define MAX(a,b) (((a)>(b))?(a):(b)) > >#ifdef _KERNEL >/* > * Basic byte order function prototypes for non-inline functions. > */ >#ifndef LOCORE >#ifndef _BYTEORDER_PROTOTYPED >#define _BYTEORDER_PROTOTYPED >__BEGIN_DECLS >__uint32_t htonl(__uint32_t); >__uint16_t htons(__uint16_t); >__uint32_t ntohl(__uint32_t); >__uint16_t ntohs(__uint16_t); >__END_DECLS >#endif ># 316 "/usr/include/sys/param.h" 3 4 >#endif ># 317 "/usr/include/sys/param.h" 3 4 > >#ifndef lint >#ifndef _BYTEORDER_FUNC_DEFINED >#define _BYTEORDER_FUNC_DEFINED >#define htonl(x) __htonl(x) >#define htons(x) __htons(x) >#define ntohl(x) __ntohl(x) >#define ntohs(x) __ntohs(x) >#endif /* !_BYTEORDER_FUNC_DEFINED */ ># 326 "/usr/include/sys/param.h" 3 4 >#endif /* lint */ ># 327 "/usr/include/sys/param.h" 3 4 >#endif /* _KERNEL */ ># 328 "/usr/include/sys/param.h" 3 4 > >/* > * Scale factor for scaled integers used to count %cpu time and load avgs. > * > * The number of CPU `tick's that map to a unique `%age' can be expressed > * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that > * can be calculated (assuming 32 bits) can be closely approximated using > * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). > * > * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', > * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. > */ >#define FSHIFT 11 /* bits to right of fixed binary point */ >#define FSCALE (1<<FSHIFT) > >#define dbtoc(db) /* calculates devblks to pages */ \ > ((db + (ctodb(1) - 1)) >> (PAGE_SHIFT - DEV_BSHIFT)) > >#define ctodb(db) /* calculates pages to devblks */ \ > ((db) << (PAGE_SHIFT - DEV_BSHIFT)) > >/* > * Old spelling of __containerof(). > */ >#define member2struct(s, m, x) \ > ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) > >/* > * Access a variable length array that has been declared as a fixed > * length array. > */ >#define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) > >#endif /* _SYS_PARAM_H_ */ ># 362 "/usr/include/sys/param.h" 3 4 ># 60 "/usr/include/arpa/nameser.h" 2 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 61 "/usr/include/arpa/nameser.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 62 "/usr/include/arpa/nameser.h" 3 4 > >/*% > * Revision information. This is the release date in YYYYMMDD format. > * It can change every day so the right thing to do with it is use it > * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not > * compare for equality; rather, use it to determine whether your libbind.a > * contains a new enough lib/nameser/ to support the feature you need. > */ > >#define __NAMESER 20090302 /*%< New interface version stamp. */ >/* > * Define constants based on RFC0883, RFC1034, RFC 1035 > */ >#define NS_PACKETSZ 512 /*%< default UDP packet size */ >#define NS_MAXDNAME 1025 /*%< maximum domain name (presentation format)*/ >#define NS_MAXMSG 65535 /*%< maximum message size */ >#define NS_MAXCDNAME 255 /*%< maximum compressed domain name */ >#define NS_MAXLABEL 63 /*%< maximum length of domain label */ >#define NS_MAXLABELS 128 /*%< theoretical max #/labels per domain name */ >#define NS_MAXNNAME 256 /*%< maximum uncompressed (binary) domain name*/ >#define NS_MAXPADDR (sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") >#define NS_HFIXEDSZ 12 /*%< #/bytes of fixed data in header */ >#define NS_QFIXEDSZ 4 /*%< #/bytes of fixed data in query */ >#define NS_RRFIXEDSZ 10 /*%< #/bytes of fixed data in r record */ >#define NS_INT32SZ 4 /*%< #/bytes of data in a u_int32_t */ >#define NS_INT16SZ 2 /*%< #/bytes of data in a u_int16_t */ >#define NS_INT8SZ 1 /*%< #/bytes of data in a u_int8_t */ >#define NS_INADDRSZ 4 /*%< IPv4 T_A */ >#define NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */ >#define NS_CMPRSFLGS 0xc0 /*%< Flag bits indicating name compression. */ >#define NS_DEFAULTPORT 53 /*%< For both TCP and UDP. */ >/* > * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord() > * in synch with it. > */ >typedef enum __ns_sect { > ns_s_qd = 0, /*%< Query: Question. */ > ns_s_zn = 0, /*%< Update: Zone. */ > ns_s_an = 1, /*%< Query: Answer. */ > ns_s_pr = 1, /*%< Update: Prerequisites. */ > ns_s_ns = 2, /*%< Query: Name servers. */ > ns_s_ud = 2, /*%< Update: Update. */ > ns_s_ar = 3, /*%< Query|Update: Additional records. */ > ns_s_max = 4 >} ns_sect; > >/*% > * Network name (compressed or not) type. Equivilent to a pointer when used > * in a function prototype. Can be const'd. > */ >typedef u_char ns_nname[NS_MAXNNAME]; >typedef const u_char *ns_nname_ct; >typedef u_char *ns_nname_t; > >struct ns_namemap { ns_nname_ct base; int len; }; >typedef struct ns_namemap *ns_namemap_t; >typedef const struct ns_namemap *ns_namemap_ct; > >/*% > * This is a message handle. It is caller allocated and has no dynamic data. > * This structure is intended to be opaque to all but ns_parse.c, thus the > * leading _'s on the member names. Use the accessor functions, not the _'s. > */ >typedef struct __ns_msg { > const u_char *_msg, *_eom; > u_int16_t _id, _flags, _counts[ns_s_max]; > const u_char *_sections[ns_s_max]; > ns_sect _sect; > int _rrnum; > const u_char *_msg_ptr; >} ns_msg; > >/* > * This is a newmsg handle, used when constructing new messages with > * ns_newmsg_init, et al. > */ >struct ns_newmsg { > ns_msg msg; > const u_char *dnptrs[25]; > const u_char **lastdnptr; >}; >typedef struct ns_newmsg ns_newmsg; > >/* Private data structure - do not use from outside library. */ >struct _ns_flagdata { int mask, shift; }; >extern struct _ns_flagdata _ns_flagdata[]; > >/* Accessor macros - this is part of the public interface. */ > >#define ns_msg_id(handle) ((handle)._id + 0) >#define ns_msg_base(handle) ((handle)._msg + 0) >#define ns_msg_end(handle) ((handle)._eom + 0) >#define ns_msg_size(handle) ((handle)._eom - (handle)._msg) >#define ns_msg_count(handle, section) ((handle)._counts[section] + 0) > >/*% > * This is a parsed record. It is caller allocated and has no dynamic data. > */ >typedef struct __ns_rr { > char name[NS_MAXDNAME]; > u_int16_t type; > u_int16_t rr_class; > u_int32_t ttl; > u_int16_t rdlength; > const u_char * rdata; >} ns_rr; > >/* > * Same thing, but using uncompressed network binary names, and real C types. > */ >typedef struct __ns_rr2 { > ns_nname nname; > size_t nnamel; > int type; > int rr_class; > u_int ttl; > int rdlength; > const u_char * rdata; >} ns_rr2; > >/* Accessor macros - this is part of the public interface. */ >#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".") >#define ns_rr_nname(rr) ((const ns_nname_t)(rr).nname) >#define ns_rr_nnamel(rr) ((rr).nnamel + 0) >#define ns_rr_type(rr) ((ns_type)((rr).type + 0)) >#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0)) >#define ns_rr_ttl(rr) ((rr).ttl + 0) >#define ns_rr_rdlen(rr) ((rr).rdlength + 0) >#define ns_rr_rdata(rr) ((rr).rdata + 0) > >/*% > * These don't have to be in the same order as in the packet flags word, > * and they can even overlap in some cases, but they will need to be kept > * in synch with ns_parse.c:ns_flagdata[]. > */ >typedef enum __ns_flag { > ns_f_qr, /*%< Question/Response. */ > ns_f_opcode, /*%< Operation code. */ > ns_f_aa, /*%< Authoritative Answer. */ > ns_f_tc, /*%< Truncation occurred. */ > ns_f_rd, /*%< Recursion Desired. */ > ns_f_ra, /*%< Recursion Available. */ > ns_f_z, /*%< MBZ. */ > ns_f_ad, /*%< Authentic Data (DNSSEC). */ > ns_f_cd, /*%< Checking Disabled (DNSSEC). */ > ns_f_rcode, /*%< Response code. */ > ns_f_max >} ns_flag; > >/*% > * Currently defined opcodes. > */ >typedef enum __ns_opcode { > ns_o_query = 0, /*%< Standard query. */ > ns_o_iquery = 1, /*%< Inverse query (deprecated/unsupported). */ > ns_o_status = 2, /*%< Name server status query (unsupported). */ > /* Opcode 3 is undefined/reserved. */ > ns_o_notify = 4, /*%< Zone change notification. */ > ns_o_update = 5, /*%< Zone update message. */ > ns_o_max = 6 >} ns_opcode; > >/*% > * Currently defined response codes. > */ >typedef enum __ns_rcode { > ns_r_noerror = 0, /*%< No error occurred. */ > ns_r_formerr = 1, /*%< Format error. */ > ns_r_servfail = 2, /*%< Server failure. */ > ns_r_nxdomain = 3, /*%< Name error. */ > ns_r_notimpl = 4, /*%< Unimplemented. */ > ns_r_refused = 5, /*%< Operation refused. */ > /* these are for BIND_UPDATE */ > ns_r_yxdomain = 6, /*%< Name exists */ > ns_r_yxrrset = 7, /*%< RRset exists */ > ns_r_nxrrset = 8, /*%< RRset does not exist */ > ns_r_notauth = 9, /*%< Not authoritative for zone */ > ns_r_notzone = 10, /*%< Zone of record different from zone section */ > ns_r_max = 11, > /* The following are EDNS extended rcodes */ > ns_r_badvers = 16, > /* The following are TSIG errors */ > ns_r_badsig = 16, > ns_r_badkey = 17, > ns_r_badtime = 18 >} ns_rcode; > >/* BIND_UPDATE */ >typedef enum __ns_update_operation { > ns_uop_delete = 0, > ns_uop_add = 1, > ns_uop_max = 2 >} ns_update_operation; > >/*% > * This structure is used for TSIG authenticated messages > */ >struct ns_tsig_key { > char name[NS_MAXDNAME], alg[NS_MAXDNAME]; > unsigned char *data; > int len; >}; >typedef struct ns_tsig_key ns_tsig_key; > >/*% > * This structure is used for TSIG authenticated TCP messages > */ >struct ns_tcp_tsig_state { > int counter; > struct dst_key *key; > void *ctx; > unsigned char sig[NS_PACKETSZ]; > int siglen; >}; >typedef struct ns_tcp_tsig_state ns_tcp_tsig_state; > >#define NS_TSIG_FUDGE 300 >#define NS_TSIG_TCP_COUNT 100 >#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT" > >#define NS_TSIG_ERROR_NO_TSIG -10 >#define NS_TSIG_ERROR_NO_SPACE -11 >#define NS_TSIG_ERROR_FORMERR -12 > >/*% > * Currently defined type values for resources and queries. > */ >typedef enum __ns_type { > ns_t_invalid = 0, /*%< Cookie. */ > ns_t_a = 1, /*%< Host address. */ > ns_t_ns = 2, /*%< Authoritative server. */ > ns_t_md = 3, /*%< Mail destination. */ > ns_t_mf = 4, /*%< Mail forwarder. */ > ns_t_cname = 5, /*%< Canonical name. */ > ns_t_soa = 6, /*%< Start of authority zone. */ > ns_t_mb = 7, /*%< Mailbox domain name. */ > ns_t_mg = 8, /*%< Mail group member. */ > ns_t_mr = 9, /*%< Mail rename name. */ > ns_t_null = 10, /*%< Null resource record. */ > ns_t_wks = 11, /*%< Well known service. */ > ns_t_ptr = 12, /*%< Domain name pointer. */ > ns_t_hinfo = 13, /*%< Host information. */ > ns_t_minfo = 14, /*%< Mailbox information. */ > ns_t_mx = 15, /*%< Mail routing information. */ > ns_t_txt = 16, /*%< Text strings. */ > ns_t_rp = 17, /*%< Responsible person. */ > ns_t_afsdb = 18, /*%< AFS cell database. */ > ns_t_x25 = 19, /*%< X_25 calling address. */ > ns_t_isdn = 20, /*%< ISDN calling address. */ > ns_t_rt = 21, /*%< Router. */ > ns_t_nsap = 22, /*%< NSAP address. */ > ns_t_nsap_ptr = 23, /*%< Reverse NSAP lookup (deprecated). */ > ns_t_sig = 24, /*%< Security signature. */ > ns_t_key = 25, /*%< Security key. */ > ns_t_px = 26, /*%< X.400 mail mapping. */ > ns_t_gpos = 27, /*%< Geographical position (withdrawn). */ > ns_t_aaaa = 28, /*%< IPv6 Address. */ > ns_t_loc = 29, /*%< Location Information. */ > ns_t_nxt = 30, /*%< Next domain (security). */ > ns_t_eid = 31, /*%< Endpoint identifier. */ > ns_t_nimloc = 32, /*%< Nimrod Locator. */ > ns_t_srv = 33, /*%< Server Selection. */ > ns_t_atma = 34, /*%< ATM Address */ > ns_t_naptr = 35, /*%< Naming Authority PoinTeR */ > ns_t_kx = 36, /*%< Key Exchange */ > ns_t_cert = 37, /*%< Certification record */ > ns_t_a6 = 38, /*%< IPv6 address (experimental) */ > ns_t_dname = 39, /*%< Non-terminal DNAME */ > ns_t_sink = 40, /*%< Kitchen sink (experimentatl) */ > ns_t_opt = 41, /*%< EDNS0 option (meta-RR) */ > ns_t_apl = 42, /*%< Address prefix list (RFC3123) */ > ns_t_ds = 43, /*%< Delegation Signer */ > ns_t_sshfp = 44, /*%< SSH Fingerprint */ > ns_t_ipseckey = 45, /*%< IPSEC Key */ > ns_t_rrsig = 46, /*%< RRset Signature */ > ns_t_nsec = 47, /*%< Negative security */ > ns_t_dnskey = 48, /*%< DNS Key */ > ns_t_dhcid = 49, /*%< Dynamic host configuratin identifier */ > ns_t_nsec3 = 50, /*%< Negative security type 3 */ > ns_t_nsec3param = 51, /*%< Negative security type 3 parameters */ > ns_t_hip = 55, /*%< Host Identity Protocol */ > ns_t_spf = 99, /*%< Sender Policy Framework */ > ns_t_tkey = 249, /*%< Transaction key */ > ns_t_tsig = 250, /*%< Transaction signature. */ > ns_t_ixfr = 251, /*%< Incremental zone transfer. */ > ns_t_axfr = 252, /*%< Transfer zone of authority. */ > ns_t_mailb = 253, /*%< Transfer mailbox records. */ > ns_t_maila = 254, /*%< Transfer mail agent records. */ > ns_t_any = 255, /*%< Wildcard match. */ > ns_t_zxfr = 256, /*%< BIND-specific, nonstandard. */ > ns_t_dlv = 32769, /*%< DNSSEC look-aside validatation. */ > ns_t_max = 65536 >} ns_type; > >/* Exclusively a QTYPE? (not also an RTYPE) */ >#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \ > (t) == ns_t_mailb || (t) == ns_t_maila) >/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */ >#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt) >/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */ >#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t)) >#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr) >#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \ > (t) == ns_t_zxfr) > >/*% > * Values for class field > */ >typedef enum __ns_class { > ns_c_invalid = 0, /*%< Cookie. */ > ns_c_in = 1, /*%< Internet. */ > ns_c_2 = 2, /*%< unallocated/unsupported. */ > ns_c_chaos = 3, /*%< MIT Chaos-net. */ > ns_c_hs = 4, /*%< MIT Hesiod. */ > /* Query class values which do not appear in resource records */ > ns_c_none = 254, /*%< for prereq. sections in update requests */ > ns_c_any = 255, /*%< Wildcard match. */ > ns_c_max = 65536 >} ns_class; > >/* DNSSEC constants. */ > >typedef enum __ns_key_types { > ns_kt_rsa = 1, /*%< key type RSA/MD5 */ > ns_kt_dh = 2, /*%< Diffie Hellman */ > ns_kt_dsa = 3, /*%< Digital Signature Standard (MANDATORY) */ > ns_kt_private = 254 /*%< Private key type starts with OID */ >} ns_key_types; > >typedef enum __ns_cert_types { > cert_t_pkix = 1, /*%< PKIX (X.509v3) */ > cert_t_spki = 2, /*%< SPKI */ > cert_t_pgp = 3, /*%< PGP */ > cert_t_url = 253, /*%< URL private type */ > cert_t_oid = 254 /*%< OID private type */ >} ns_cert_types; > >/* Flags field of the KEY RR rdata. */ >#define NS_KEY_TYPEMASK 0xC000 /*%< Mask for "type" bits */ >#define NS_KEY_TYPE_AUTH_CONF 0x0000 /*%< Key usable for both */ >#define NS_KEY_TYPE_CONF_ONLY 0x8000 /*%< Key usable for confidentiality */ >#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /*%< Key usable for authentication */ >#define NS_KEY_TYPE_NO_KEY 0xC000 /*%< No key usable for either; no key */ >/* The type bits can also be interpreted independently, as single bits: */ >#define NS_KEY_NO_AUTH 0x8000 /*%< Key unusable for authentication */ >#define NS_KEY_NO_CONF 0x4000 /*%< Key unusable for confidentiality */ >#define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */ >#define NS_KEY_EXTENDED_FLAGS 0x1000 /*%< reserved - must be zero */ >#define NS_KEY_RESERVED4 0x0800 /*%< reserved - must be zero */ >#define NS_KEY_RESERVED5 0x0400 /*%< reserved - must be zero */ >#define NS_KEY_NAME_TYPE 0x0300 /*%< these bits determine the type */ >#define NS_KEY_NAME_USER 0x0000 /*%< key is assoc. with user */ >#define NS_KEY_NAME_ENTITY 0x0200 /*%< key is assoc. with entity eg host */ >#define NS_KEY_NAME_ZONE 0x0100 /*%< key is zone key */ >#define NS_KEY_NAME_RESERVED 0x0300 /*%< reserved meaning */ >#define NS_KEY_RESERVED8 0x0080 /*%< reserved - must be zero */ >#define NS_KEY_RESERVED9 0x0040 /*%< reserved - must be zero */ >#define NS_KEY_RESERVED10 0x0020 /*%< reserved - must be zero */ >#define NS_KEY_RESERVED11 0x0010 /*%< reserved - must be zero */ >#define NS_KEY_SIGNATORYMASK 0x000F /*%< key can sign RR's of same name */ >#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \ > NS_KEY_RESERVED4 | \ > NS_KEY_RESERVED5 | \ > NS_KEY_RESERVED8 | \ > NS_KEY_RESERVED9 | \ > NS_KEY_RESERVED10 | \ > NS_KEY_RESERVED11 ) >#define NS_KEY_RESERVED_BITMASK2 0xFFFF /*%< no bits defined here */ >/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */ >#define NS_ALG_MD5RSA 1 /*%< MD5 with RSA */ >#define NS_ALG_DH 2 /*%< Diffie Hellman KEY */ >#define NS_ALG_DSA 3 /*%< DSA KEY */ >#define NS_ALG_DSS NS_ALG_DSA >#define NS_ALG_EXPIRE_ONLY 253 /*%< No alg, no security */ >#define NS_ALG_PRIVATE_OID 254 /*%< Key begins with OID giving alg */ >/* Protocol values */ >/* value 0 is reserved */ >#define NS_KEY_PROT_TLS 1 >#define NS_KEY_PROT_EMAIL 2 >#define NS_KEY_PROT_DNSSEC 3 >#define NS_KEY_PROT_IPSEC 4 >#define NS_KEY_PROT_ANY 255 > >/* Signatures */ >#define NS_MD5RSA_MIN_BITS 512 /*%< Size of a mod or exp in bits */ >#define NS_MD5RSA_MAX_BITS 4096 > /* Total of binary mod and exp */ >#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3) > /* Max length of text sig block */ >#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4) >#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8) >#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8) > >#define NS_DSA_SIG_SIZE 41 >#define NS_DSA_MIN_SIZE 213 >#define NS_DSA_MAX_BYTES 405 > >/* Offsets into SIG record rdata to find various values */ >#define NS_SIG_TYPE 0 /*%< Type flags */ >#define NS_SIG_ALG 2 /*%< Algorithm */ >#define NS_SIG_LABELS 3 /*%< How many labels in name */ >#define NS_SIG_OTTL 4 /*%< Original TTL */ >#define NS_SIG_EXPIR 8 /*%< Expiration time */ >#define NS_SIG_SIGNED 12 /*%< Signature time */ >#define NS_SIG_FOOT 16 /*%< Key footprint */ >#define NS_SIG_SIGNER 18 /*%< Domain name of who signed it */ >/* How RR types are represented as bit-flags in NXT records */ >#define NS_NXT_BITS 8 >#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS))) >#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS))) >#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS))) >#define NS_NXT_MAX 127 > >/*% > * EDNS0 extended flags and option codes, host order. > */ >#define NS_OPT_DNSSEC_OK 0x8000U >#define NS_OPT_NSID 3 > >/*% > * Inline versions of get/put short/long. Pointer is advanced. > */ >#define NS_GET16(s, cp) do { \ > register const u_char *t_cp = (const u_char *)(cp); \ > (s) = ((u_int16_t)t_cp[0] << 8) \ > | ((u_int16_t)t_cp[1]) \ > ; \ > (cp) += NS_INT16SZ; \ >} while (0) > >#define NS_GET32(l, cp) do { \ > register const u_char *t_cp = (const u_char *)(cp); \ > (l) = ((u_int32_t)t_cp[0] << 24) \ > | ((u_int32_t)t_cp[1] << 16) \ > | ((u_int32_t)t_cp[2] << 8) \ > | ((u_int32_t)t_cp[3]) \ > ; \ > (cp) += NS_INT32SZ; \ >} while (0) > >#define NS_PUT16(s, cp) do { \ > register u_int16_t t_s = (u_int16_t)(s); \ > register u_char *t_cp = (u_char *)(cp); \ > *t_cp++ = t_s >> 8; \ > *t_cp = t_s; \ > (cp) += NS_INT16SZ; \ >} while (0) > >#define NS_PUT32(l, cp) do { \ > register u_int32_t t_l = (u_int32_t)(l); \ > register u_char *t_cp = (u_char *)(cp); \ > *t_cp++ = t_l >> 24; \ > *t_cp++ = t_l >> 16; \ > *t_cp++ = t_l >> 8; \ > *t_cp = t_l; \ > (cp) += NS_INT32SZ; \ >} while (0) > >/*% > * ANSI C identifier hiding for bind's lib/nameser. > */ >#define ns_msg_getflag __ns_msg_getflag >#define ns_get16 __ns_get16 >#define ns_get32 __ns_get32 >#define ns_put16 __ns_put16 >#define ns_put32 __ns_put32 >#define ns_initparse __ns_initparse >#define ns_skiprr __ns_skiprr >#define ns_parserr __ns_parserr >#define ns_parserr2 __ns_parserr2 >#define ns_sprintrr __ns_sprintrr >#define ns_sprintrrf __ns_sprintrrf >#define ns_format_ttl __ns_format_ttl >#define ns_parse_ttl __ns_parse_ttl >#if 0 >#define ns_datetosecs __ns_datetosecs >#endif ># 539 "/usr/include/arpa/nameser.h" 3 4 >#define ns_name_ntol __ns_name_ntol >#define ns_name_ntop __ns_name_ntop >#define ns_name_pton __ns_name_pton >#define ns_name_pton2 __ns_name_pton2 >#define ns_name_unpack __ns_name_unpack >#define ns_name_unpack2 __ns_name_unpack2 >#define ns_name_pack __ns_name_pack >#define ns_name_compress __ns_name_compress >#define ns_name_uncompress __ns_name_uncompress >#define ns_name_skip __ns_name_skip >#define ns_name_rollback __ns_name_rollback >#define ns_name_length __ns_name_length >#define ns_name_eq __ns_name_eq >#define ns_name_owned __ns_name_owned >#define ns_name_map __ns_name_map >#define ns_name_labels __ns_name_labels >#if 0 >#define ns_sign __ns_sign >#define ns_sign2 __ns_sign2 >#define ns_sign_tcp __ns_sign_tcp >#define ns_sign_tcp2 __ns_sign_tcp2 >#define ns_sign_tcp_init __ns_sign_tcp_init >#define ns_find_tsig __ns_find_tsig >#define ns_verify __ns_verify >#define ns_verify_tcp __ns_verify_tcp >#define ns_verify_tcp_init __ns_verify_tcp_init >#endif ># 566 "/usr/include/arpa/nameser.h" 3 4 >#define ns_samedomain __ns_samedomain >#if 0 >#define ns_subdomain __ns_subdomain >#endif ># 570 "/usr/include/arpa/nameser.h" 3 4 >#define ns_makecanon __ns_makecanon >#define ns_samename __ns_samename >#define ns_newmsg_init __ns_newmsg_init >#define ns_newmsg_copy __ns_newmsg_copy >#define ns_newmsg_id __ns_newmsg_id >#define ns_newmsg_flag __ns_newmsg_flag >#define ns_newmsg_q __ns_newmsg_q >#define ns_newmsg_rr __ns_newmsg_rr >#define ns_newmsg_done __ns_newmsg_done >#define ns_rdata_unpack __ns_rdata_unpack >#define ns_rdata_equal __ns_rdata_equal >#define ns_rdata_refers __ns_rdata_refers > >__BEGIN_DECLS >int ns_msg_getflag(ns_msg, int); >u_int ns_get16(const u_char *); >u_long ns_get32(const u_char *); >void ns_put16(u_int, u_char *); >void ns_put32(u_long, u_char *); >int ns_initparse(const u_char *, int, ns_msg *); >int ns_skiprr(const u_char *, const u_char *, ns_sect, int); >int ns_parserr(ns_msg *, ns_sect, int, ns_rr *); >int ns_parserr2(ns_msg *, ns_sect, int, ns_rr2 *); >int ns_sprintrr(const ns_msg *, const ns_rr *, > const char *, const char *, char *, size_t); >int ns_sprintrrf(const u_char *, size_t, const char *, > ns_class, ns_type, u_long, const u_char *, > size_t, const char *, const char *, > char *, size_t); >int ns_format_ttl(u_long, char *, size_t); >int ns_parse_ttl(const char *, u_long *); >#if 0 >u_int32_t ns_datetosecs(const char *cp, int *errp); >#endif ># 604 "/usr/include/arpa/nameser.h" 3 4 >int ns_name_ntol(const u_char *, u_char *, size_t); >int ns_name_ntop(const u_char *, char *, size_t); >int ns_name_pton(const char *, u_char *, size_t); >int ns_name_pton2(const char *, u_char *, size_t, size_t *); >int ns_name_unpack(const u_char *, const u_char *, > const u_char *, u_char *, size_t); >int ns_name_unpack2(const u_char *, const u_char *, > const u_char *, u_char *, size_t, > size_t *); >int ns_name_pack(const u_char *, u_char *, int, > const u_char **, const u_char **); >int ns_name_uncompress(const u_char *, const u_char *, > const u_char *, char *, size_t); >int ns_name_compress(const char *, u_char *, size_t, > const u_char **, const u_char **); >int ns_name_skip(const u_char **, const u_char *); >void ns_name_rollback(const u_char *, const u_char **, > const u_char **); >ssize_t ns_name_length(ns_nname_ct, size_t); >int ns_name_eq(ns_nname_ct, size_t, ns_nname_ct, size_t); >int ns_name_owned(ns_namemap_ct, int, ns_namemap_ct, int); >int ns_name_map(ns_nname_ct, size_t, ns_namemap_t, int); >int ns_name_labels(ns_nname_ct, size_t); >#if 0 >int ns_sign(u_char *, int *, int, int, void *, > const u_char *, int, u_char *, int *, time_t); >int ns_sign2(u_char *, int *, int, int, void *, > const u_char *, int, u_char *, int *, time_t, > u_char **, u_char **); >int ns_sign_tcp(u_char *, int *, int, int, > ns_tcp_tsig_state *, int); >int ns_sign_tcp2(u_char *, int *, int, int, > ns_tcp_tsig_state *, int, > u_char **, u_char **); >int ns_sign_tcp_init(void *, const u_char *, int, > ns_tcp_tsig_state *); >u_char *ns_find_tsig(u_char *, u_char *); >int ns_verify(u_char *, int *, void *, > const u_char *, int, u_char *, int *, > time_t *, int); >int ns_verify_tcp(u_char *, int *, ns_tcp_tsig_state *, int); >int ns_verify_tcp_init(void *, const u_char *, int, > ns_tcp_tsig_state *); >#endif ># 648 "/usr/include/arpa/nameser.h" 3 4 >int ns_samedomain(const char *, const char *); >#if 0 >int ns_subdomain(const char *, const char *); >#endif ># 652 "/usr/include/arpa/nameser.h" 3 4 >int ns_makecanon(const char *, char *, size_t); >int ns_samename(const char *, const char *); >int ns_newmsg_init(u_char *buffer, size_t bufsiz, ns_newmsg *); >int ns_newmsg_copy(ns_newmsg *, ns_msg *); >void ns_newmsg_id(ns_newmsg *handle, u_int16_t id); >void ns_newmsg_flag(ns_newmsg *handle, ns_flag flag, u_int value); >int ns_newmsg_q(ns_newmsg *handle, ns_nname_ct qname, > ns_type qtype, ns_class qclass); >int ns_newmsg_rr(ns_newmsg *handle, ns_sect sect, > ns_nname_ct name, ns_type type, > ns_class rr_class, u_int32_t ttl, > u_int16_t rdlen, const u_char *rdata); >size_t ns_newmsg_done(ns_newmsg *handle); >ssize_t ns_rdata_unpack(const u_char *, const u_char *, ns_type, > const u_char *, size_t, u_char *, size_t); >int ns_rdata_equal(ns_type, > const u_char *, size_t, > const u_char *, size_t); >int ns_rdata_refers(ns_type, > const u_char *, size_t, > const u_char *); >__END_DECLS > >#ifdef BIND_4_COMPAT >#if 0 /* expanded by -frewrite-includes */ >#include <arpa/nameser_compat.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/arpa/nameser_compat.h" 1 3 4 >/* Copyright (c) 1983, 1989 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > */ > >/*% > * from nameser.h 8.1 (Berkeley) 6/2/93 > * $Id: nameser_compat.h,v 1.8 2006/05/19 02:33:40 marka Exp $ > * $FreeBSD: releng/10.3/include/arpa/nameser_compat.h 270838 2014-08-30 10:16:25Z ume $ > */ > >#ifndef _ARPA_NAMESER_COMPAT_ >#define _ARPA_NAMESER_COMPAT_ > >#define __BIND 19950621 /*%< (DEAD) interface version stamp. */ > >#if 0 /* expanded by -frewrite-includes */ >#include <machine/endian.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/machine/endian.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/endian.h 232266 2012-02-28 19:39:54Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/endian.h> >#endif /* expanded by -frewrite-includes */ ># 7 "/usr/include/machine/endian.h" 3 4 ># 41 "/usr/include/arpa/nameser_compat.h" 2 3 4 > >#if !defined(_BYTE_ORDER) || \ > (_BYTE_ORDER != _BIG_ENDIAN && _BYTE_ORDER != _LITTLE_ENDIAN && \ > _BYTE_ORDER != _PDP_ENDIAN) > /* you must determine what the correct bit order is for > * your compiler - the next line is an intentional error > * which will force your compiles to bomb until you fix > * the above macros. > */ >#error "Undefined or invalid _BYTE_ORDER"; >#endif ># 52 "/usr/include/arpa/nameser_compat.h" 3 4 > >/*% > * Structure for query header. The order of the fields is machine- and > * compiler-dependent, depending on the byte/bit order and the layout > * of bit fields. We use bit fields only in int variables, as this > * is all ANSI requires. This requires a somewhat confusing rearrangement. > */ > >typedef struct { > unsigned id :16; /*%< query identification number */ >#if _BYTE_ORDER == _BIG_ENDIAN > /* fields in third byte */ > unsigned qr: 1; /*%< response flag */ > unsigned opcode: 4; /*%< purpose of message */ > unsigned aa: 1; /*%< authoritative answer */ > unsigned tc: 1; /*%< truncated message */ > unsigned rd: 1; /*%< recursion desired */ > /* fields in fourth byte */ > unsigned ra: 1; /*%< recursion available */ > unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */ > unsigned ad: 1; /*%< authentic data from named */ > unsigned cd: 1; /*%< checking disabled by resolver */ > unsigned rcode :4; /*%< response code */ >#endif ># 76 "/usr/include/arpa/nameser_compat.h" 3 4 >#if _BYTE_ORDER == _LITTLE_ENDIAN || _BYTE_ORDER == _PDP_ENDIAN > /* fields in third byte */ > unsigned rd :1; /*%< recursion desired */ > unsigned tc :1; /*%< truncated message */ > unsigned aa :1; /*%< authoritative answer */ > unsigned opcode :4; /*%< purpose of message */ > unsigned qr :1; /*%< response flag */ > /* fields in fourth byte */ > unsigned rcode :4; /*%< response code */ > unsigned cd: 1; /*%< checking disabled by resolver */ > unsigned ad: 1; /*%< authentic data from named */ > unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */ > unsigned ra :1; /*%< recursion available */ >#endif ># 90 "/usr/include/arpa/nameser_compat.h" 3 4 > /* remaining bytes */ > unsigned qdcount :16; /*%< number of question entries */ > unsigned ancount :16; /*%< number of answer entries */ > unsigned nscount :16; /*%< number of authority entries */ > unsigned arcount :16; /*%< number of resource entries */ >} HEADER; > >#define PACKETSZ NS_PACKETSZ >#define MAXDNAME NS_MAXDNAME >#define MAXCDNAME NS_MAXCDNAME >#define MAXLABEL NS_MAXLABEL >#define HFIXEDSZ NS_HFIXEDSZ >#define QFIXEDSZ NS_QFIXEDSZ >#define RRFIXEDSZ NS_RRFIXEDSZ >#define INT32SZ NS_INT32SZ >#define INT16SZ NS_INT16SZ >#define INT8SZ NS_INT8SZ >#define INADDRSZ NS_INADDRSZ >#define IN6ADDRSZ NS_IN6ADDRSZ >#define INDIR_MASK NS_CMPRSFLGS >#define NAMESERVER_PORT NS_DEFAULTPORT > >#define S_ZONE ns_s_zn >#define S_PREREQ ns_s_pr >#define S_UPDATE ns_s_ud >#define S_ADDT ns_s_ar > >#define QUERY ns_o_query >#define IQUERY ns_o_iquery >#define STATUS ns_o_status >#define NS_NOTIFY_OP ns_o_notify >#define NS_UPDATE_OP ns_o_update > >#define NOERROR ns_r_noerror >#define FORMERR ns_r_formerr >#define SERVFAIL ns_r_servfail >#define NXDOMAIN ns_r_nxdomain >#define NOTIMP ns_r_notimpl >#define REFUSED ns_r_refused >#define YXDOMAIN ns_r_yxdomain >#define YXRRSET ns_r_yxrrset >#define NXRRSET ns_r_nxrrset >#define NOTAUTH ns_r_notauth >#define NOTZONE ns_r_notzone >/*#define BADSIG ns_r_badsig*/ >/*#define BADKEY ns_r_badkey*/ >/*#define BADTIME ns_r_badtime*/ > > >#define DELETE ns_uop_delete >#define ADD ns_uop_add > >#define T_A ns_t_a >#define T_NS ns_t_ns >#define T_MD ns_t_md >#define T_MF ns_t_mf >#define T_CNAME ns_t_cname >#define T_SOA ns_t_soa >#define T_MB ns_t_mb >#define T_MG ns_t_mg >#define T_MR ns_t_mr >#define T_NULL ns_t_null >#define T_WKS ns_t_wks >#define T_PTR ns_t_ptr >#define T_HINFO ns_t_hinfo >#define T_MINFO ns_t_minfo >#define T_MX ns_t_mx >#define T_TXT ns_t_txt >#define T_RP ns_t_rp >#define T_AFSDB ns_t_afsdb >#define T_X25 ns_t_x25 >#define T_ISDN ns_t_isdn >#define T_RT ns_t_rt >#define T_NSAP ns_t_nsap >#define T_NSAP_PTR ns_t_nsap_ptr >#define T_SIG ns_t_sig >#define T_KEY ns_t_key >#define T_PX ns_t_px >#define T_GPOS ns_t_gpos >#define T_AAAA ns_t_aaaa >#define T_LOC ns_t_loc >#define T_NXT ns_t_nxt >#define T_EID ns_t_eid >#define T_NIMLOC ns_t_nimloc >#define T_SRV ns_t_srv >#define T_ATMA ns_t_atma >#define T_NAPTR ns_t_naptr >#define T_A6 ns_t_a6 >#define T_OPT ns_t_opt >#define T_TSIG ns_t_tsig >#define T_IXFR ns_t_ixfr >#define T_AXFR ns_t_axfr >#define T_MAILB ns_t_mailb >#define T_MAILA ns_t_maila >#define T_ANY ns_t_any > >#define C_IN ns_c_in >#define C_CHAOS ns_c_chaos >#define C_HS ns_c_hs >/* BIND_UPDATE */ >#define C_NONE ns_c_none >#define C_ANY ns_c_any > >#define GETSHORT NS_GET16 >#define GETLONG NS_GET32 >#define PUTSHORT NS_PUT16 >#define PUTLONG NS_PUT32 > >#endif /* _ARPA_NAMESER_COMPAT_ */ ># 199 "/usr/include/arpa/nameser_compat.h" 3 4 >/*! \file */ ># 677 "/usr/include/arpa/nameser.h" 2 3 4 >#endif ># 678 "/usr/include/arpa/nameser.h" 3 4 > >#endif /* !_ARPA_NAMESER_H_ */ ># 680 "/usr/include/arpa/nameser.h" 3 4 >/*! \file */ ># 81 "../include/dps_common.h" 2 >#endif ># 82 "../include/dps_common.h" >#ifdef HAVE_RESOLV_H >#if 0 /* expanded by -frewrite-includes */ >#include <resolv.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/resolv.h" 1 3 4 >/* > * Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") > * Portions Copyright (C) 1995-2003 Internet Software Consortium. > * > * Permission to use, copy, modify, and/or distribute this software for any > * purpose with or without fee is hereby granted, provided that the above > * copyright notice and this permission notice appear in all copies. > * > * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH > * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY > * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, > * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM > * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE > * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR > * PERFORMANCE OF THIS SOFTWARE. > */ > >/* > * Copyright (c) 1983, 1987, 1989 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > */ > >/*% > * @(#)resolv.h 8.1 (Berkeley) 6/2/93 > * $Id: resolv.h,v 1.30 2009/03/03 01:52:48 each Exp $ > * $FreeBSD: releng/10.3/include/resolv.h 270838 2014-08-30 10:16:25Z ume $ > */ > >#ifndef _RESOLV_H_ >#define _RESOLV_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/param.h> >#endif /* expanded by -frewrite-includes */ ># 57 "/usr/include/resolv.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 58 "/usr/include/resolv.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 59 "/usr/include/resolv.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/socket.h> >#endif /* expanded by -frewrite-includes */ ># 60 "/usr/include/resolv.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> >#endif /* expanded by -frewrite-includes */ ># 61 "/usr/include/resolv.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <arpa/nameser.h> >#endif /* expanded by -frewrite-includes */ ># 62 "/usr/include/resolv.h" 3 4 > >/*% > * Revision information. This is the release date in YYYYMMDD format. > * It can change every day so the right thing to do with it is use it > * in preprocessor commands such as "#if (__RES > 19931104)". Do not > * compare for equality; rather, use it to determine whether your resolver > * is new enough to contain a certain feature. > */ > >#define __RES 20090302 > >/*% > * This used to be defined in res_query.c, now it's in herror.c. > * [XXX no it's not. It's in irs/irs_data.c] > * It was > * never extern'd by any *.h file before it was placed here. For thread > * aware programs, the last h_errno value set is stored in res->h_errno. > * > * XXX: There doesn't seem to be a good reason for exposing RES_SET_H_ERRNO > * (and __h_errno_set) to the public via <resolv.h>. > * XXX: __h_errno_set is really part of IRS, not part of the resolver. > * If somebody wants to build and use a resolver that doesn't use IRS, > * what do they do? Perhaps something like > * #ifdef WANT_IRS > * # define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x) > * #else > * # define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x)) > * #endif > */ > >#define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x) >struct __res_state; /*%< forward */ >__BEGIN_DECLS >void __h_errno_set(struct __res_state *, int); >__END_DECLS > >/*% > * Resolver configuration file. > * Normally not present, but may contain the address of the > * initial name server(s) to query and the domain search list. > */ > >#ifndef _PATH_RESCONF >#define _PATH_RESCONF "/etc/resolv.conf" >#endif ># 107 "/usr/include/resolv.h" 3 4 > >typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error } > res_sendhookact; > >typedef res_sendhookact (*res_send_qhook)(struct sockaddr * const *, > const u_char **, int *, > u_char *, int, int *); > >typedef res_sendhookact (*res_send_rhook)(const struct sockaddr *, > const u_char *, int, u_char *, > int, int *); > >struct res_sym { > int number; /*%< Identifying number, like T_MX */ > const char * name; /*%< Its symbolic name, like "MX" */ > const char * humanname; /*%< Its fun name, like "mail exchanger" */ >}; > >/*% > * Global defines and variables for resolver stub. > */ >#define MAXNS 3 /*%< max # name servers we'll track */ >#define MAXDFLSRCH 3 /*%< # default domain levels to try */ >#define MAXDNSRCH 6 /*%< max # domains in search path */ >#define LOCALDOMAINPARTS 2 /*%< min levels in name that is "local" */ >#define RES_TIMEOUT 5 /*%< min. seconds between retries */ >#define MAXRESOLVSORT 10 /*%< number of net to sort on */ >#define RES_MAXNDOTS 15 /*%< should reflect bit field size */ >#define RES_MAXRETRANS 30 /*%< only for resolv.conf/RES_OPTIONS */ >#define RES_MAXRETRY 5 /*%< only for resolv.conf/RES_OPTIONS */ >#define RES_DFLRETRY 2 /*%< Default #/tries. */ >#define RES_MAXTIME 65535 /*%< Infinity, in milliseconds. */ >struct __res_state_ext; > >struct __res_state { > int retrans; /*%< retransmission time interval */ > int retry; /*%< number of times to retransmit */ > /* > * XXX: If `sun' is defined, `options' and `pfcode' are > * defined as u_int in original BIND9 distribution. However, > * it breaks binary backward compatibility against FreeBSD's > * resolver. So, we changed not to see `sun'. > */ >#if defined(sun) && 0 > u_int options; /*%< option flags - see below. */ >#else ># 153 "/usr/include/resolv.h" 3 4 > u_long options; /*%< option flags - see below. */ >#endif ># 155 "/usr/include/resolv.h" 3 4 > int nscount; /*%< number of name servers */ > struct sockaddr_in > nsaddr_list[MAXNS]; /*%< address of name server */ >#define nsaddr nsaddr_list[0] /*%< for backward compatibility */ > u_short id; /*%< current message id */ > char *dnsrch[MAXDNSRCH+1]; /*%< components of domain to search */ > char defdname[256]; /*%< default domain (deprecated) */ >#if defined(sun) && 0 > u_int pfcode; /*%< RES_PRF_ flags - see below. */ >#else ># 165 "/usr/include/resolv.h" 3 4 > u_long pfcode; /*%< RES_PRF_ flags - see below. */ >#endif ># 167 "/usr/include/resolv.h" 3 4 > unsigned ndots:4; /*%< threshold for initial abs. query */ > unsigned nsort:4; /*%< number of elements in sort_list[] */ > char unused[3]; > struct { > struct in_addr addr; > u_int32_t mask; > } sort_list[MAXRESOLVSORT]; > res_send_qhook qhook; /*%< query hook */ > res_send_rhook rhook; /*%< response hook */ > int res_h_errno; /*%< last one set for this context */ > int _vcsock; /*%< PRIVATE: for res_send VC i/o */ > u_int _flags; /*%< PRIVATE: see below */ > u_int _pad; /*%< make _u 64 bit aligned */ > union { > /* On an 32-bit arch this means 512b total. */ > char pad[72 - 4*sizeof (int) - 3*sizeof (void *)]; > struct { > u_int16_t nscount; > u_int16_t nstimes[MAXNS]; /*%< ms. */ > int nssocks[MAXNS]; > struct __res_state_ext *ext; /*%< extension for IPv6 */ > } _ext; > } _u; > u_char *_rnd; /*%< PRIVATE: random state */ >}; > >typedef struct __res_state *res_state; > >union res_sockaddr_union { > struct sockaddr_in sin; >#ifdef IN6ADDR_ANY_INIT > struct sockaddr_in6 sin6; >#endif ># 200 "/usr/include/resolv.h" 3 4 >#ifdef ISC_ALIGN64 > int64_t __align64; /*%< 64bit alignment */ >#else ># 203 "/usr/include/resolv.h" 3 4 > int32_t __align32; /*%< 32bit alignment */ >#endif ># 205 "/usr/include/resolv.h" 3 4 > char __space[128]; /*%< max size */ >}; > >/*% > * Resolver flags (used to be discrete per-module statics ints). > */ >#define RES_F_VC 0x00000001 /*%< socket is TCP */ >#define RES_F_CONN 0x00000002 /*%< socket is connected */ >#define RES_F_EDNS0ERR 0x00000004 /*%< EDNS0 caused errors */ >#define RES_F__UNUSED 0x00000008 /*%< (unused) */ >#define RES_F_LASTMASK 0x000000F0 /*%< ordinal server of last res_nsend */ >#define RES_F_LASTSHIFT 4 /*%< bit position of LASTMASK "flag" */ >#define RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT) > >/* res_findzonecut2() options */ >#define RES_EXHAUSTIVE 0x00000001 /*%< always do all queries */ >#define RES_IPV4ONLY 0x00000002 /*%< IPv4 only */ >#define RES_IPV6ONLY 0x00000004 /*%< IPv6 only */ > >/*% > * Resolver options (keep these in synch with res_debug.c, please) > */ >#define RES_INIT 0x00000001 /*%< address initialized */ >#define RES_DEBUG 0x00000002 /*%< print debug messages */ >#define RES_AAONLY 0x00000004 /*%< authoritative answers only (!IMPL)*/ >#define RES_USEVC 0x00000008 /*%< use virtual circuit */ >#define RES_PRIMARY 0x00000010 /*%< query primary server only (!IMPL) */ >#define RES_IGNTC 0x00000020 /*%< ignore truncation errors */ >#define RES_RECURSE 0x00000040 /*%< recursion desired */ >#define RES_DEFNAMES 0x00000080 /*%< use default domain name */ >#define RES_STAYOPEN 0x00000100 /*%< Keep TCP socket open */ >#define RES_DNSRCH 0x00000200 /*%< search up local domain tree */ >#define RES_INSECURE1 0x00000400 /*%< type 1 security disabled */ >#define RES_INSECURE2 0x00000800 /*%< type 2 security disabled */ >#define RES_NOALIASES 0x00001000 /*%< shuts off HOSTALIASES feature */ >#define RES_USE_INET6 0x00002000 /*%< use/map IPv6 in gethostbyname() */ >#define RES_ROTATE 0x00004000 /*%< rotate ns list after each query */ >#define RES_NOCHECKNAME 0x00008000 /*%< do not check names for sanity. */ >#define RES_KEEPTSIG 0x00010000 /*%< do not strip TSIG records */ >#define RES_BLAST 0x00020000 /*%< blast all recursive servers */ >#define RES_NSID 0x00040000 /*%< request name server ID */ >#define RES_NOTLDQUERY 0x00100000 /*%< don't unqualified name as a tld */ >#define RES_USE_DNSSEC 0x00200000 /*%< use DNSSEC using OK bit in OPT */ >/* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */ >/* KAME extensions: use higher bit to avoid conflict with ISC use */ >#define RES_USE_DNAME 0x10000000 /*%< use DNAME */ >#define RES_USE_EDNS0 0x40000000 /*%< use EDNS0 if configured */ >#define RES_NO_NIBBLE2 0x80000000 /*%< disable alternate nibble lookup */ > >#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | \ > RES_DNSRCH | RES_NO_NIBBLE2) > >/*% > * Resolver "pfcode" values. Used by dig. > */ >#define RES_PRF_STATS 0x00000001 >#define RES_PRF_UPDATE 0x00000002 >#define RES_PRF_CLASS 0x00000004 >#define RES_PRF_CMD 0x00000008 >#define RES_PRF_QUES 0x00000010 >#define RES_PRF_ANS 0x00000020 >#define RES_PRF_AUTH 0x00000040 >#define RES_PRF_ADD 0x00000080 >#define RES_PRF_HEAD1 0x00000100 >#define RES_PRF_HEAD2 0x00000200 >#define RES_PRF_TTLID 0x00000400 >#define RES_PRF_HEADX 0x00000800 >#define RES_PRF_QUERY 0x00001000 >#define RES_PRF_REPLY 0x00002000 >#define RES_PRF_INIT 0x00004000 >#define RES_PRF_TRUNC 0x00008000 >/* 0x00010000 */ > >/* Things involving an internal (static) resolver context. */ >__BEGIN_DECLS >extern struct __res_state *__res_state(void); >__END_DECLS >#define _res (*__res_state()) > >#ifndef __BIND_NOSTATIC >#define fp_nquery __fp_nquery >#define fp_query __fp_query >#define hostalias __hostalias >#define p_query __p_query >#define res_close __res_close >#define res_init __res_init >#define res_isourserver __res_isourserver >#define res_mkquery __res_mkquery >#define res_opt __res_opt >#define res_query __res_query >#define res_querydomain __res_querydomain >#define res_search __res_search >#define res_send __res_send >#define res_sendsigned __res_sendsigned > >__BEGIN_DECLS >void fp_nquery(const u_char *, int, FILE *); >void fp_query(const u_char *, FILE *); >const char * hostalias(const char *); >void p_query(const u_char *); >void res_close(void); >int res_init(void); >int res_isourserver(const struct sockaddr_in *); >int res_mkquery(int, const char *, int, int, const u_char *, > int, const u_char *, u_char *, int); >int res_opt(int, u_char *, int, int); >int res_query(const char *, int, int, u_char *, int); >int res_querydomain(const char *, const char *, int, int, > u_char *, int); >int res_search(const char *, int, int, u_char *, int); >int res_send(const u_char *, int, u_char *, int); >int res_sendsigned(const u_char *, int, ns_tsig_key *, > u_char *, int); >__END_DECLS >#endif ># 320 "/usr/include/resolv.h" 3 4 > >#if !defined(SHARED_LIBBIND) || defined(LIB) >/* > * If libbind is a shared object (well, DLL anyway) > * these externs break the linker when resolv.h is > * included by a lib client (like named) > * Make them go away if a client is including this > * > */ >extern const struct res_sym __p_key_syms[]; >extern const struct res_sym __p_cert_syms[]; >extern const struct res_sym __p_class_syms[]; >extern const struct res_sym __p_type_syms[]; >extern const struct res_sym __p_rcode_syms[]; >#endif /* SHARED_LIBBIND */ ># 335 "/usr/include/resolv.h" 3 4 > >#define b64_ntop __b64_ntop >#define b64_pton __b64_pton >#define dn_comp __dn_comp >#define dn_count_labels __dn_count_labels >#define dn_expand __dn_expand >#define dn_skipname __dn_skipname >#define fp_resstat __fp_resstat >#define loc_aton __loc_aton >#define loc_ntoa __loc_ntoa >#define p_cdname __p_cdname >#define p_cdnname __p_cdnname >#define p_class __p_class >#define p_fqname __p_fqname >#define p_fqnname __p_fqnname >#define p_option __p_option >#define p_secstodate __p_secstodate >#define p_section __p_section >#define p_time __p_time >#define p_type __p_type >#define p_rcode __p_rcode >#define p_sockun __p_sockun >#define putlong __putlong >#define putshort __putshort >#define res_dnok __res_dnok >#if 0 >#define res_findzonecut __res_findzonecut >#endif ># 363 "/usr/include/resolv.h" 3 4 >#define res_findzonecut2 __res_findzonecut2 >#define res_hnok __res_hnok >#define res_hostalias __res_hostalias >#define res_mailok __res_mailok >#define res_nameinquery __res_nameinquery >#define res_nclose __res_nclose >#define res_ninit __res_ninit >#define res_nmkquery __res_nmkquery >#define res_pquery __res_pquery >#define res_nquery __res_nquery >#define res_nquerydomain __res_nquerydomain >#define res_nsearch __res_nsearch >#define res_nsend __res_nsend >#if 0 >#define res_nsendsigned __res_nsendsigned >#endif ># 379 "/usr/include/resolv.h" 3 4 >#define res_nisourserver __res_nisourserver >#define res_ownok __res_ownok >#define res_queriesmatch __res_queriesmatch >#define res_rndinit __res_rndinit >#define res_randomid __res_randomid >#define res_nrandomid __res_nrandomid >#define sym_ntop __sym_ntop >#define sym_ntos __sym_ntos >#define sym_ston __sym_ston >#define res_nopt __res_nopt >#define res_nopt_rdata __res_nopt_rdata >#define res_ndestroy __res_ndestroy >#define res_nametoclass __res_nametoclass >#define res_nametotype __res_nametotype >#define res_setservers __res_setservers >#define res_getservers __res_getservers >#if 0 >#define res_buildprotolist __res_buildprotolist >#define res_destroyprotolist __res_destroyprotolist >#define res_destroyservicelist __res_destroyservicelist >#define res_get_nibblesuffix __res_get_nibblesuffix >#define res_get_nibblesuffix2 __res_get_nibblesuffix2 >#endif ># 402 "/usr/include/resolv.h" 3 4 >#define res_ourserver_p __res_ourserver_p >#if 0 >#define res_protocolname __res_protocolname >#define res_protocolnumber __res_protocolnumber >#endif ># 407 "/usr/include/resolv.h" 3 4 >#define res_send_setqhook __res_send_setqhook >#define res_send_setrhook __res_send_setrhook >#if 0 >#define res_servicename __res_servicename >#define res_servicenumber __res_servicenumber >#endif ># 413 "/usr/include/resolv.h" 3 4 >__BEGIN_DECLS >int res_hnok(const char *); >int res_ownok(const char *); >int res_mailok(const char *); >int res_dnok(const char *); >int sym_ston(const struct res_sym *, const char *, int *); >const char * sym_ntos(const struct res_sym *, int, int *); >const char * sym_ntop(const struct res_sym *, int, int *); >int b64_ntop(u_char const *, size_t, char *, size_t); >int b64_pton(char const *, u_char *, size_t); >int loc_aton(const char *, u_char *); >const char * loc_ntoa(const u_char *, char *); >int dn_skipname(const u_char *, const u_char *); >void putlong(u_int32_t, u_char *); >void putshort(u_int16_t, u_char *); >#ifndef __ultrix__ >u_int16_t _getshort(const u_char *); >u_int32_t _getlong(const u_char *); >#endif ># 432 "/usr/include/resolv.h" 3 4 >const char * p_class(int); >const char * p_time(u_int32_t); >const char * p_type(int); >const char * p_rcode(int); >const char * p_sockun(union res_sockaddr_union, char *, size_t); >const u_char * p_cdnname(const u_char *, const u_char *, int, FILE *); >const u_char * p_cdname(const u_char *, const u_char *, FILE *); >const u_char * p_fqnname(const u_char *, const u_char *, int, char *, int); >const u_char * p_fqname(const u_char *, const u_char *, FILE *); >const char * p_option(u_long); >char * p_secstodate(u_long); >int dn_count_labels(const char *); >int dn_comp(const char *, u_char *, int, u_char **, u_char **); >int dn_expand(const u_char *, const u_char *, const u_char *, > char *, int); >void res_rndinit(res_state); >u_int res_randomid(void); >u_int res_nrandomid(res_state); >int res_nameinquery(const char *, int, int, const u_char *, > const u_char *); >int res_queriesmatch(const u_char *, const u_char *, > const u_char *, const u_char *); >const char * p_section(int, int); >/* Things involving a resolver context. */ >int res_ninit(res_state); >int res_nisourserver(const res_state, const struct sockaddr_in *); >void fp_resstat(const res_state, FILE *); >void res_pquery(const res_state, const u_char *, int, FILE *); >const char * res_hostalias(const res_state, const char *, char *, size_t); >int res_nquery(res_state, const char *, int, int, u_char *, int); >int res_nsearch(res_state, const char *, int, int, u_char *, int); >int res_nquerydomain(res_state, const char *, const char *, > int, int, u_char *, int); >int res_nmkquery(res_state, int, const char *, int, int, > const u_char *, int, const u_char *, > u_char *, int); >int res_nsend(res_state, const u_char *, int, u_char *, int); >#if 0 >int res_nsendsigned(res_state, const u_char *, int, > ns_tsig_key *, u_char *, int); >int res_findzonecut(res_state, const char *, ns_class, int, > char *, size_t, struct in_addr *, int); >#endif ># 475 "/usr/include/resolv.h" 3 4 >int res_findzonecut2(res_state, const char *, ns_class, int, > char *, size_t, > union res_sockaddr_union *, int); >void res_nclose(res_state); >int res_nopt(res_state, int, u_char *, int, int); >int res_nopt_rdata(res_state, int, u_char *, int, u_char *, > u_short, u_short, u_char *); >void res_send_setqhook(res_send_qhook); >void res_send_setrhook(res_send_rhook); >int __res_vinit(res_state, int); >#if 0 >void res_destroyservicelist(void); >const char * res_servicename(u_int16_t, const char *); >const char * res_protocolname(int); >void res_destroyprotolist(void); >void res_buildprotolist(void); >const char * res_get_nibblesuffix(res_state); >const char * res_get_nibblesuffix2(res_state); >#endif ># 494 "/usr/include/resolv.h" 3 4 >void res_ndestroy(res_state); >u_int16_t res_nametoclass(const char *, int *); >u_int16_t res_nametotype(const char *, int *); >void res_setservers(res_state, const union res_sockaddr_union *, > int); >int res_getservers(res_state, union res_sockaddr_union *, int); >__END_DECLS > >#endif /* !_RESOLV_H_ */ ># 503 "/usr/include/resolv.h" 3 4 >/*! \file */ ># 84 "../include/dps_common.h" 2 >#endif ># 85 "../include/dps_common.h" >#ifdef HAVE_NETDB_H >#if 0 /* expanded by -frewrite-includes */ >#include <netdb.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/netdb.h" 1 3 4 >/*- > * Copyright (c) 1980, 1983, 1988, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * - > * Portions Copyright (c) 1993 by Digital Equipment Corporation. > * > * Permission to use, copy, modify, and distribute this software for any > * purpose with or without fee is hereby granted, provided that the above > * copyright notice and this permission notice appear in all copies, and that > * the name of Digital Equipment Corporation not be used in advertising or > * publicity pertaining to distribution of the document or software without > * specific, written prior permission. > * > * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL > * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES > * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT > * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL > * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR > * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS > * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS > * SOFTWARE. > * - > * --Copyright-- > */ > >/* > * @(#)netdb.h 8.1 (Berkeley) 6/2/93 > * From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $ > * $FreeBSD: releng/10.3/include/netdb.h 292760 2015-12-27 00:37:04Z ume $ > */ > >#ifndef _NETDB_H_ >#define _NETDB_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 61 "/usr/include/netdb.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 62 "/usr/include/netdb.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 67 "/usr/include/netdb.h" 3 4 > >#ifndef _SOCKLEN_T_DECLARED >typedef __socklen_t socklen_t; >#define _SOCKLEN_T_DECLARED >#endif ># 72 "/usr/include/netdb.h" 3 4 > >#ifndef _UINT32_T_DECLARED >typedef __uint32_t uint32_t; >#define _UINT32_T_DECLARED >#endif ># 77 "/usr/include/netdb.h" 3 4 > >#ifndef _PATH_HEQUIV ># define _PATH_HEQUIV "/etc/hosts.equiv" >#endif ># 81 "/usr/include/netdb.h" 3 4 >#define _PATH_HOSTS "/etc/hosts" >#define _PATH_NETWORKS "/etc/networks" >#define _PATH_PROTOCOLS "/etc/protocols" >#define _PATH_SERVICES "/etc/services" >#define _PATH_SERVICES_DB "/var/db/services.db" > >#define h_errno (*__h_errno()) > >/* > * Structures returned by network data base library. All addresses are > * supplied in host order, and returned in network order (suitable for > * use in system calls). > */ >struct hostent { > char *h_name; /* official name of host */ > char **h_aliases; /* alias list */ > int h_addrtype; /* host address type */ > int h_length; /* length of address */ > char **h_addr_list; /* list of addresses from name server */ >#define h_addr h_addr_list[0] /* address, for backward compatibility */ >}; > >struct netent { > char *n_name; /* official name of net */ > char **n_aliases; /* alias list */ > int n_addrtype; /* net address type */ > uint32_t n_net; /* network # */ >}; > >struct servent { > char *s_name; /* official service name */ > char **s_aliases; /* alias list */ > int s_port; /* port # */ > char *s_proto; /* protocol to use */ >}; > >struct protoent { > char *p_name; /* official protocol name */ > char **p_aliases; /* alias list */ > int p_proto; /* protocol # */ >}; > >struct addrinfo { > int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */ > int ai_family; /* AF_xxx */ > int ai_socktype; /* SOCK_xxx */ > int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ > socklen_t ai_addrlen; /* length of ai_addr */ > char *ai_canonname; /* canonical name for hostname */ > struct sockaddr *ai_addr; /* binary address */ > struct addrinfo *ai_next; /* next structure in linked list */ >}; > >/* > * Error return codes from gethostbyname() and gethostbyaddr() > * (left in h_errno). > */ > >#define NETDB_INTERNAL -1 /* see errno */ >#define NETDB_SUCCESS 0 /* no problem */ >#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ >#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ >#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ >#define NO_DATA 4 /* Valid name, no data record of requested type */ >#define NO_ADDRESS NO_DATA /* no address, look for MX record */ > >/* > * Error return codes from getaddrinfo() > */ >#if 0 >/* obsoleted */ >#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ >#endif ># 154 "/usr/include/netdb.h" 3 4 >#define EAI_AGAIN 2 /* temporary failure in name resolution */ >#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ >#define EAI_FAIL 4 /* non-recoverable failure in name resolution */ >#define EAI_FAMILY 5 /* ai_family not supported */ >#define EAI_MEMORY 6 /* memory allocation failure */ >#if 0 >/* obsoleted */ >#define EAI_NODATA 7 /* no address associated with hostname */ >#endif ># 163 "/usr/include/netdb.h" 3 4 >#define EAI_NONAME 8 /* hostname nor servname provided, or not known */ >#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ >#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ >#define EAI_SYSTEM 11 /* system error returned in errno */ >#define EAI_BADHINTS 12 /* invalid value for hints */ >#define EAI_PROTOCOL 13 /* resolved protocol is unknown */ >#define EAI_OVERFLOW 14 /* argument buffer overflow */ >#define EAI_MAX 15 > >/* > * Flag values for getaddrinfo() > */ >#define AI_PASSIVE 0x00000001 /* get address to use bind() */ >#define AI_CANONNAME 0x00000002 /* fill ai_canonname */ >#define AI_NUMERICHOST 0x00000004 /* prevent host name resolution */ >#define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */ >/* valid flags for addrinfo (not a standard def, apps should not use it) */ >#define AI_MASK \ > (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ > AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED) > >#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ >#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ >#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */ >#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */ >/* special recommended flags for getipnodebyname */ >#define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG) > >/* > * Constants for getnameinfo() > */ >#define NI_MAXHOST 1025 >#define NI_MAXSERV 32 > >/* > * Flag values for getnameinfo() > */ >#define NI_NOFQDN 0x00000001 >#define NI_NUMERICHOST 0x00000002 >#define NI_NAMEREQD 0x00000004 >#define NI_NUMERICSERV 0x00000008 >#define NI_DGRAM 0x00000010 >#if 0 /* obsolete */ >#define NI_WITHSCOPEID 0x00000020 >#endif ># 208 "/usr/include/netdb.h" 3 4 > >/* > * Scope delimit character > */ >#define SCOPE_DELIMITER '%' > >__BEGIN_DECLS >void endhostent(void); >void endnetent(void); >void endprotoent(void); >void endservent(void); >#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE <= 200112) >struct hostent *gethostbyaddr(const void *, socklen_t, int); >struct hostent *gethostbyname(const char *); >#endif ># 223 "/usr/include/netdb.h" 3 4 >struct hostent *gethostent(void); >struct netent *getnetbyaddr(uint32_t, int); >struct netent *getnetbyname(const char *); >struct netent *getnetent(void); >struct protoent *getprotobyname(const char *); >struct protoent *getprotobynumber(int); >struct protoent *getprotoent(void); >struct servent *getservbyname(const char *, const char *); >struct servent *getservbyport(int, const char *); >struct servent *getservent(void); >void sethostent(int); >/* void sethostfile(const char *); */ >void setnetent(int); >void setprotoent(int); >int getaddrinfo(const char *, const char *, > const struct addrinfo *, struct addrinfo **); >int getnameinfo(const struct sockaddr *, socklen_t, char *, > size_t, char *, size_t, int); >void freeaddrinfo(struct addrinfo *); >const char *gai_strerror(int); >void setservent(int); > >#if __BSD_VISIBLE >void endnetgrent(void); >void freehostent(struct hostent *); >int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, > char *, size_t, struct hostent **, int *); >int gethostbyname_r(const char *, struct hostent *, char *, size_t, > struct hostent **, int *); >struct hostent *gethostbyname2(const char *, int); >int gethostbyname2_r(const char *, int, struct hostent *, char *, > size_t, struct hostent **, int *); >int gethostent_r(struct hostent *, char *, size_t, > struct hostent **, int *); >struct hostent *getipnodebyaddr(const void *, size_t, int, int *); >struct hostent *getipnodebyname(const char *, int, int, int *); >int getnetbyaddr_r(uint32_t, int, struct netent *, char *, size_t, > struct netent**, int *); >int getnetbyname_r(const char *, struct netent *, char *, size_t, > struct netent **, int *); >int getnetent_r(struct netent *, char *, size_t, struct netent **, > int *); >int getnetgrent(char **, char **, char **); >int getprotobyname_r(const char *, struct protoent *, char *, > size_t, struct protoent **); >int getprotobynumber_r(int, struct protoent *, char *, size_t, > struct protoent **); >int getprotoent_r(struct protoent *, char *, size_t, > struct protoent **); >int getservbyname_r(const char *, const char *, struct servent *, > char *, size_t, struct servent **); >int getservbyport_r(int, const char *, struct servent *, char *, > size_t, struct servent **); >int getservent_r(struct servent *, char *, size_t, > struct servent **); >void herror(const char *); >const char *hstrerror(int); >int innetgr(const char *, const char *, const char *, const char *); >void setnetgrent(const char *); >#endif ># 283 "/usr/include/netdb.h" 3 4 > > >/* > * PRIVATE functions specific to the FreeBSD implementation > */ > >/* DO NOT USE THESE, THEY ARE SUBJECT TO CHANGE AND ARE NOT PORTABLE!!! */ >int * __h_errno(void); >__END_DECLS > >#endif /* !_NETDB_H_ */ ># 294 "/usr/include/netdb.h" 3 4 ># 87 "../include/dps_common.h" 2 >#endif ># 88 "../include/dps_common.h" >#ifdef MECAB >#if 0 /* expanded by -frewrite-includes */ >#include <mecab.h> >#endif /* expanded by -frewrite-includes */ ># 90 "../include/dps_common.h" >#endif ># 91 "../include/dps_common.h" >#ifdef HAVE_ASPELL >#if 0 /* expanded by -frewrite-includes */ >#include "aspell.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/aspell.h" 1 >/* Automatically generated file. Do not edit directly. */ > >/* This file is part of The New Aspell > * Copyright (C) 2001-2002 by Kevin Atkinson under the GNU LGPL > * license version 2.0 or 2.1. You should have received a copy of the > * LGPL license along with this library if you did not you can find it > * at http://www.gnu.org/. */ > >#ifndef ASPELL_ASPELL__H >#define ASPELL_ASPELL__H > >#ifdef __cplusplus >extern "C" { >#endif ># 15 "/usr/local/include/aspell.h" > >/******************************* type id *******************************/ > > >union AspellTypeId { > > unsigned int num; > > char str[4]; > >}; > > >typedef union AspellTypeId AspellTypeId; > > >/************************** mutable container **************************/ > > >typedef struct AspellMutableContainer AspellMutableContainer; > > >int aspell_mutable_container_add(struct AspellMutableContainer * ths, const char * to_add); > >int aspell_mutable_container_remove(struct AspellMutableContainer * ths, const char * to_rem); > >void aspell_mutable_container_clear(struct AspellMutableContainer * ths); > >struct AspellMutableContainer * aspell_mutable_container_to_mutable_container(struct AspellMutableContainer * ths); > > > >/******************************* key info *******************************/ > > > >enum AspellKeyInfoType {AspellKeyInfoString, AspellKeyInfoInt, AspellKeyInfoBool, AspellKeyInfoList}; >typedef enum AspellKeyInfoType AspellKeyInfoType; > > >struct AspellKeyInfo { > > /* The name of the key. */ > const char * name; > > /* The key type. */ > enum AspellKeyInfoType type; > > /* The default value of the key. */ > const char * def; > > /* A brief description of the key or NULL if internal value. */ > const char * desc; > > int flags; > > int other_data; > >}; > > >typedef struct AspellKeyInfo AspellKeyInfo; > > >/******************************** config ********************************/ > > >typedef struct AspellKeyInfoEnumeration AspellKeyInfoEnumeration; > > >int aspell_key_info_enumeration_at_end(const struct AspellKeyInfoEnumeration * ths); > >const struct AspellKeyInfo * aspell_key_info_enumeration_next(struct AspellKeyInfoEnumeration * ths); > >void delete_aspell_key_info_enumeration(struct AspellKeyInfoEnumeration * ths); > >struct AspellKeyInfoEnumeration * aspell_key_info_enumeration_clone(const struct AspellKeyInfoEnumeration * ths); > >void aspell_key_info_enumeration_assign(struct AspellKeyInfoEnumeration * ths, const struct AspellKeyInfoEnumeration * other); > > > >typedef struct AspellConfig AspellConfig; > > >struct AspellConfig * new_aspell_config(); > >void delete_aspell_config(struct AspellConfig * ths); > >struct AspellConfig * aspell_config_clone(const struct AspellConfig * ths); > >void aspell_config_assign(struct AspellConfig * ths, const struct AspellConfig * other); > >unsigned int aspell_config_error_number(const struct AspellConfig * ths); > >const char * aspell_config_error_message(const struct AspellConfig * ths); > >const struct AspellError * aspell_config_error(const struct AspellConfig * ths); > >/* Sets extra keys which this config class should > * accept. begin and end are expected to point to > * the beginning and ending of an array of Aspell > * Key Info. */ >void aspell_config_set_extra(struct AspellConfig * ths, const struct AspellKeyInfo * begin, const struct AspellKeyInfo * end); > >/* Returns the KeyInfo object for the > * corresponding key or returns NULL and sets > * error_num to PERROR_UNKNOWN_KEY if the key is > * not valid. The pointer returned is valid for > * the lifetime of the object. */ >const struct AspellKeyInfo * aspell_config_keyinfo(struct AspellConfig * ths, const char * key); > >/* Returns a newly allocated enumeration of all > * the possible objects this config class uses. */ >struct AspellKeyInfoEnumeration * aspell_config_possible_elements(struct AspellConfig * ths, int include_extra); > >/* Returns the default value for given key which > * may involve substituting variables, thus it is > * not the same as keyinfo(key)->def returns NULL > * and sets error_num to PERROR_UNKNOWN_KEY if > * the key is not valid. Uses the temporary > * string. */ >const char * aspell_config_get_default(struct AspellConfig * ths, const char * key); > >/* Returns a newly allocated enumeration of all > * the key/value pairs. This DOES not include ones > * which are set to their default values. */ >struct AspellStringPairEnumeration * aspell_config_elements(struct AspellConfig * ths); > >/* Inserts an item, if the item already exists it > * will be replaced. Returns TRUE if it succeeded > * or FALSE on error. If the key is not valid it > * sets error_num to PERROR_UNKNOWN_KEY, if the > * value is not valid it will set error_num to > * PERROR_BAD_VALUE, if the value can not be > * changed it sets error_num to > * PERROR_CANT_CHANGE_VALUE, and if the value is > * a list and you are trying to set its directory, > * it sets error_num to PERROR_LIST_SET */ >int aspell_config_replace(struct AspellConfig * ths, const char * key, const char * value); > >/* Remove a key and returns TRUE if it exists > * otherwise return FALSE. This effectively sets > * the key to its default value. Calling replace > * with a value of "<default>" will also call > * remove. If the key does not exist then it sets > * error_num to 0 or PERROR_NOT, if the key is > * not valid then it sets error_num to > * PERROR_UNKNOWN_KEY, if the value can not be > * changed then it sets error_num to > * PERROR_CANT_CHANGE_VALUE */ >int aspell_config_remove(struct AspellConfig * ths, const char * key); > >int aspell_config_have(const struct AspellConfig * ths, const char * key); > >/* Returns NULL on error. */ >const char * aspell_config_retrieve(struct AspellConfig * ths, const char * key); > >int aspell_config_retrieve_list(struct AspellConfig * ths, const char * key, struct AspellMutableContainer * lst); > >/* In "ths" Aspell configuration, search for a > * character string matching "key" string. > * If "key" is found then return 1 else return 0. > * If error encountered, then return -1. */ >int aspell_config_retrieve_bool(struct AspellConfig * ths, const char * key); > >/* In "ths" Aspell configuration, search for an > * integer value matching "key" string. > * Return -1 on error. */ >int aspell_config_retrieve_int(struct AspellConfig * ths, const char * key); > > > >/******************************** error ********************************/ > > >struct AspellError { > > const char * mesg; > > const struct AspellErrorInfo * err; > >}; > > >typedef struct AspellError AspellError; > >int aspell_error_is_a(const struct AspellError * ths, const struct AspellErrorInfo * e); > > >struct AspellErrorInfo { > > const struct AspellErrorInfo * isa; > > const char * mesg; > > unsigned int num_parms; > > const char * parms[3]; > >}; > > >typedef struct AspellErrorInfo AspellErrorInfo; > > >/**************************** can have error ****************************/ > > >typedef struct AspellCanHaveError AspellCanHaveError; > > >unsigned int aspell_error_number(const struct AspellCanHaveError * ths); > >const char * aspell_error_message(const struct AspellCanHaveError * ths); > >const struct AspellError * aspell_error(const struct AspellCanHaveError * ths); > >void delete_aspell_can_have_error(struct AspellCanHaveError * ths); > > > >/******************************** errors ********************************/ > >#ifndef ASPELL_ERRORS__HPP >extern const struct AspellErrorInfo * const aerror_other; >extern const struct AspellErrorInfo * const aerror_operation_not_supported; >extern const struct AspellErrorInfo * const aerror_cant_copy; >extern const struct AspellErrorInfo * const aerror_unimplemented_method; >extern const struct AspellErrorInfo * const aerror_file; >extern const struct AspellErrorInfo * const aerror_cant_open_file; >extern const struct AspellErrorInfo * const aerror_cant_read_file; >extern const struct AspellErrorInfo * const aerror_cant_write_file; >extern const struct AspellErrorInfo * const aerror_invalid_name; >extern const struct AspellErrorInfo * const aerror_bad_file_format; >extern const struct AspellErrorInfo * const aerror_dir; >extern const struct AspellErrorInfo * const aerror_cant_read_dir; >extern const struct AspellErrorInfo * const aerror_config; >extern const struct AspellErrorInfo * const aerror_unknown_key; >extern const struct AspellErrorInfo * const aerror_cant_change_value; >extern const struct AspellErrorInfo * const aerror_bad_key; >extern const struct AspellErrorInfo * const aerror_bad_value; >extern const struct AspellErrorInfo * const aerror_duplicate; >extern const struct AspellErrorInfo * const aerror_key_not_string; >extern const struct AspellErrorInfo * const aerror_key_not_int; >extern const struct AspellErrorInfo * const aerror_key_not_bool; >extern const struct AspellErrorInfo * const aerror_key_not_list; >extern const struct AspellErrorInfo * const aerror_no_value_reset; >extern const struct AspellErrorInfo * const aerror_no_value_enable; >extern const struct AspellErrorInfo * const aerror_no_value_disable; >extern const struct AspellErrorInfo * const aerror_no_value_clear; >extern const struct AspellErrorInfo * const aerror_language_related; >extern const struct AspellErrorInfo * const aerror_unknown_language; >extern const struct AspellErrorInfo * const aerror_unknown_soundslike; >extern const struct AspellErrorInfo * const aerror_language_not_supported; >extern const struct AspellErrorInfo * const aerror_no_wordlist_for_lang; >extern const struct AspellErrorInfo * const aerror_mismatched_language; >extern const struct AspellErrorInfo * const aerror_affix; >extern const struct AspellErrorInfo * const aerror_corrupt_affix; >extern const struct AspellErrorInfo * const aerror_invalid_cond; >extern const struct AspellErrorInfo * const aerror_invalid_cond_strip; >extern const struct AspellErrorInfo * const aerror_incorrect_encoding; >extern const struct AspellErrorInfo * const aerror_encoding; >extern const struct AspellErrorInfo * const aerror_unknown_encoding; >extern const struct AspellErrorInfo * const aerror_encoding_not_supported; >extern const struct AspellErrorInfo * const aerror_conversion_not_supported; >extern const struct AspellErrorInfo * const aerror_pipe; >extern const struct AspellErrorInfo * const aerror_cant_create_pipe; >extern const struct AspellErrorInfo * const aerror_process_died; >extern const struct AspellErrorInfo * const aerror_bad_input; >extern const struct AspellErrorInfo * const aerror_invalid_string; >extern const struct AspellErrorInfo * const aerror_invalid_word; >extern const struct AspellErrorInfo * const aerror_invalid_affix; >extern const struct AspellErrorInfo * const aerror_inapplicable_affix; >extern const struct AspellErrorInfo * const aerror_unknown_unichar; >extern const struct AspellErrorInfo * const aerror_word_list_flags; >extern const struct AspellErrorInfo * const aerror_invalid_flag; >extern const struct AspellErrorInfo * const aerror_conflicting_flags; >extern const struct AspellErrorInfo * const aerror_version_control; >extern const struct AspellErrorInfo * const aerror_bad_version_string; >extern const struct AspellErrorInfo * const aerror_filter; >extern const struct AspellErrorInfo * const aerror_cant_dlopen_file; >extern const struct AspellErrorInfo * const aerror_empty_filter; >extern const struct AspellErrorInfo * const aerror_no_such_filter; >extern const struct AspellErrorInfo * const aerror_confusing_version; >extern const struct AspellErrorInfo * const aerror_bad_version; >extern const struct AspellErrorInfo * const aerror_identical_option; >extern const struct AspellErrorInfo * const aerror_options_only; >extern const struct AspellErrorInfo * const aerror_invalid_option_modifier; >extern const struct AspellErrorInfo * const aerror_cant_describe_filter; >extern const struct AspellErrorInfo * const aerror_filter_mode_file; >extern const struct AspellErrorInfo * const aerror_mode_option_name; >extern const struct AspellErrorInfo * const aerror_no_filter_to_option; >extern const struct AspellErrorInfo * const aerror_bad_mode_key; >extern const struct AspellErrorInfo * const aerror_expect_mode_key; >extern const struct AspellErrorInfo * const aerror_mode_version_requirement; >extern const struct AspellErrorInfo * const aerror_confusing_mode_version; >extern const struct AspellErrorInfo * const aerror_bad_mode_version; >extern const struct AspellErrorInfo * const aerror_missing_magic_expression; >extern const struct AspellErrorInfo * const aerror_empty_file_ext; >extern const struct AspellErrorInfo * const aerror_filter_mode_expand; >extern const struct AspellErrorInfo * const aerror_unknown_mode; >extern const struct AspellErrorInfo * const aerror_mode_extend_expand; >extern const struct AspellErrorInfo * const aerror_filter_mode_magic; >extern const struct AspellErrorInfo * const aerror_file_magic_pos; >extern const struct AspellErrorInfo * const aerror_file_magic_range; >extern const struct AspellErrorInfo * const aerror_missing_magic; >extern const struct AspellErrorInfo * const aerror_bad_magic; >extern const struct AspellErrorInfo * const aerror_expression; >extern const struct AspellErrorInfo * const aerror_invalid_expression; >#endif ># 326 "/usr/local/include/aspell.h" > >/******************************* speller *******************************/ > > >typedef struct AspellSpeller AspellSpeller; > > >struct AspellCanHaveError * new_aspell_speller(struct AspellConfig * config); > >struct AspellSpeller * to_aspell_speller(struct AspellCanHaveError * obj); > >void delete_aspell_speller(struct AspellSpeller * ths); > >unsigned int aspell_speller_error_number(const struct AspellSpeller * ths); > >const char * aspell_speller_error_message(const struct AspellSpeller * ths); > >const struct AspellError * aspell_speller_error(const struct AspellSpeller * ths); > >struct AspellConfig * aspell_speller_config(struct AspellSpeller * ths); > >/* Returns 0 if it is not in the dictionary, > * 1 if it is, or -1 on error. */ >int aspell_speller_check(struct AspellSpeller * ths, const char * word, int word_size); > >/* Add this word to your own personal word list. */ >int aspell_speller_add_to_personal(struct AspellSpeller * ths, const char * word, int word_size); > >/* Add this word to the current spelling session. */ >int aspell_speller_add_to_session(struct AspellSpeller * ths, const char * word, int word_size); > >/* This is your own personal word list file plus > * any extra words added during this session to > * your own personal word list. */ >const struct AspellWordList * aspell_speller_personal_word_list(struct AspellSpeller * ths); > >/* This is a list of words added to this session > * that are not in the main word list or in your > * own personal list but are considered valid for > * this spelling session. */ >const struct AspellWordList * aspell_speller_session_word_list(struct AspellSpeller * ths); > >/* This is the main list of words used during this > * spelling session. */ >const struct AspellWordList * aspell_speller_main_word_list(struct AspellSpeller * ths); > >int aspell_speller_save_all_word_lists(struct AspellSpeller * ths); > >int aspell_speller_clear_session(struct AspellSpeller * ths); > >/* Return NULL on error. > * The word list returned by suggest is only > * valid until the next call to suggest. */ >const struct AspellWordList * aspell_speller_suggest(struct AspellSpeller * ths, const char * word, int word_size); > >int aspell_speller_store_replacement(struct AspellSpeller * ths, const char * mis, int mis_size, const char * cor, int cor_size); > > > >/******************************** filter ********************************/ > > >typedef struct AspellFilter AspellFilter; > > >void delete_aspell_filter(struct AspellFilter * ths); > >unsigned int aspell_filter_error_number(const struct AspellFilter * ths); > >const char * aspell_filter_error_message(const struct AspellFilter * ths); > >const struct AspellError * aspell_filter_error(const struct AspellFilter * ths); > >struct AspellFilter * to_aspell_filter(struct AspellCanHaveError * obj); > > > >/*************************** document checker ***************************/ > > >struct AspellToken { > > unsigned int offset; > > unsigned int len; > >}; > > >typedef struct AspellToken AspellToken; > > >typedef struct AspellDocumentChecker AspellDocumentChecker; > > >void delete_aspell_document_checker(struct AspellDocumentChecker * ths); > >unsigned int aspell_document_checker_error_number(const struct AspellDocumentChecker * ths); > >const char * aspell_document_checker_error_message(const struct AspellDocumentChecker * ths); > >const struct AspellError * aspell_document_checker_error(const struct AspellDocumentChecker * ths); > >/* Creates a new document checker. > * The speller class is expected to last until > * this class is destroyed. > * If config is given it will be used to override > * any relevent options set by this speller class. > * The config class is not once this function is done. > * If filter is given then it will take ownership of > * the filter class and use it to do the filtering. > * You are expected to free the checker when done. */ >struct AspellCanHaveError * new_aspell_document_checker(struct AspellSpeller * speller); > >struct AspellDocumentChecker * to_aspell_document_checker(struct AspellCanHaveError * obj); > >/* Reset the internal state of the filter. > * Should be called whenever a new document is > * being filtered. */ >void aspell_document_checker_reset(struct AspellDocumentChecker * ths); > >/* Process a string. > * The string passed in should only be split on > * white space characters. Furthermore, between > * calls to reset, each string should be passed > * in exactly once and in the order they appeared > * in the document. Passing in strings out of > * order, skipping strings or passing them in > * more than once may lead to undefined results. */ >void aspell_document_checker_process(struct AspellDocumentChecker * ths, const char * str, int size); > >/* Returns the next misspelled word in the > * processed string. If there are no more > * misspelled words, then token.word will be > * NULL and token.size will be 0 */ >struct AspellToken aspell_document_checker_next_misspelling(struct AspellDocumentChecker * ths); > >/* Returns the underlying filter class. */ >struct AspellFilter * aspell_document_checker_filter(struct AspellDocumentChecker * ths); > > > >/****************************** word list ******************************/ > > >typedef struct AspellWordList AspellWordList; > > >int aspell_word_list_empty(const struct AspellWordList * ths); > >unsigned int aspell_word_list_size(const struct AspellWordList * ths); > >struct AspellStringEnumeration * aspell_word_list_elements(const struct AspellWordList * ths); > > > >/************************** string enumeration **************************/ > > >typedef struct AspellStringEnumeration AspellStringEnumeration; > > >void delete_aspell_string_enumeration(struct AspellStringEnumeration * ths); > >struct AspellStringEnumeration * aspell_string_enumeration_clone(const struct AspellStringEnumeration * ths); > >void aspell_string_enumeration_assign(struct AspellStringEnumeration * ths, const struct AspellStringEnumeration * other); > >int aspell_string_enumeration_at_end(const struct AspellStringEnumeration * ths); > >const char * aspell_string_enumeration_next(struct AspellStringEnumeration * ths); > > > >/********************************* info *********************************/ > > >struct AspellModuleInfo { > > const char * name; > > double order_num; > > const char * lib_dir; > > struct AspellStringList * dict_dirs; > > struct AspellStringList * dict_exts; > >}; > > >typedef struct AspellModuleInfo AspellModuleInfo; > > >struct AspellDictInfo { > > /* The Name to identify this dictionary by. */ > const char * name; > > /* The language code to identify this dictionary. > * A two letter UPPER-CASE ISO 639 language code > * and an optional two letter ISO 3166 country > * code after a dash or underscore. */ > const char * code; > > /* Any extra information to distinguish this > * variety of dictionary from other dictionaries > * which may have the same language and size. */ > const char * jargon; > > int size; > > /* A two char digit code describing the size of > * the dictionary: 10=tiny, 20=really small, > * 30=small, 40=med-small, 50=med, 60=med-large, > * 70=large, 80=huge, 90=insane. Please check > * the README in aspell-lang-200?????.tar.bz2 or > * see SCOWL (http://wordlist.sourceforge.net) > * for an example of how these sizes are used. */ > const char * size_str; > > struct AspellModuleInfo * module; > >}; > > >typedef struct AspellDictInfo AspellDictInfo; > > >typedef struct AspellModuleInfoList AspellModuleInfoList; > > >struct AspellModuleInfoList * get_aspell_module_info_list(struct AspellConfig * config); > >int aspell_module_info_list_empty(const struct AspellModuleInfoList * ths); > >unsigned int aspell_module_info_list_size(const struct AspellModuleInfoList * ths); > >struct AspellModuleInfoEnumeration * aspell_module_info_list_elements(const struct AspellModuleInfoList * ths); > > > >typedef struct AspellDictInfoList AspellDictInfoList; > > >struct AspellDictInfoList * get_aspell_dict_info_list(struct AspellConfig * config); > >int aspell_dict_info_list_empty(const struct AspellDictInfoList * ths); > >unsigned int aspell_dict_info_list_size(const struct AspellDictInfoList * ths); > >struct AspellDictInfoEnumeration * aspell_dict_info_list_elements(const struct AspellDictInfoList * ths); > > > >typedef struct AspellModuleInfoEnumeration AspellModuleInfoEnumeration; > > >int aspell_module_info_enumeration_at_end(const struct AspellModuleInfoEnumeration * ths); > >const struct AspellModuleInfo * aspell_module_info_enumeration_next(struct AspellModuleInfoEnumeration * ths); > >void delete_aspell_module_info_enumeration(struct AspellModuleInfoEnumeration * ths); > >struct AspellModuleInfoEnumeration * aspell_module_info_enumeration_clone(const struct AspellModuleInfoEnumeration * ths); > >void aspell_module_info_enumeration_assign(struct AspellModuleInfoEnumeration * ths, const struct AspellModuleInfoEnumeration * other); > > > >typedef struct AspellDictInfoEnumeration AspellDictInfoEnumeration; > > >int aspell_dict_info_enumeration_at_end(const struct AspellDictInfoEnumeration * ths); > >const struct AspellDictInfo * aspell_dict_info_enumeration_next(struct AspellDictInfoEnumeration * ths); > >void delete_aspell_dict_info_enumeration(struct AspellDictInfoEnumeration * ths); > >struct AspellDictInfoEnumeration * aspell_dict_info_enumeration_clone(const struct AspellDictInfoEnumeration * ths); > >void aspell_dict_info_enumeration_assign(struct AspellDictInfoEnumeration * ths, const struct AspellDictInfoEnumeration * other); > > > >/***************************** string list *****************************/ > > >typedef struct AspellStringList AspellStringList; > > >struct AspellStringList * new_aspell_string_list(); > >int aspell_string_list_empty(const struct AspellStringList * ths); > >unsigned int aspell_string_list_size(const struct AspellStringList * ths); > >struct AspellStringEnumeration * aspell_string_list_elements(const struct AspellStringList * ths); > >int aspell_string_list_add(struct AspellStringList * ths, const char * to_add); > >int aspell_string_list_remove(struct AspellStringList * ths, const char * to_rem); > >void aspell_string_list_clear(struct AspellStringList * ths); > >struct AspellMutableContainer * aspell_string_list_to_mutable_container(struct AspellStringList * ths); > >void delete_aspell_string_list(struct AspellStringList * ths); > >struct AspellStringList * aspell_string_list_clone(const struct AspellStringList * ths); > >void aspell_string_list_assign(struct AspellStringList * ths, const struct AspellStringList * other); > > > >/****************************** string map ******************************/ > > >typedef struct AspellStringMap AspellStringMap; > > >struct AspellStringMap * new_aspell_string_map(); > >int aspell_string_map_add(struct AspellStringMap * ths, const char * to_add); > >int aspell_string_map_remove(struct AspellStringMap * ths, const char * to_rem); > >void aspell_string_map_clear(struct AspellStringMap * ths); > >struct AspellMutableContainer * aspell_string_map_to_mutable_container(struct AspellStringMap * ths); > >void delete_aspell_string_map(struct AspellStringMap * ths); > >struct AspellStringMap * aspell_string_map_clone(const struct AspellStringMap * ths); > >void aspell_string_map_assign(struct AspellStringMap * ths, const struct AspellStringMap * other); > >int aspell_string_map_empty(const struct AspellStringMap * ths); > >unsigned int aspell_string_map_size(const struct AspellStringMap * ths); > >struct AspellStringPairEnumeration * aspell_string_map_elements(const struct AspellStringMap * ths); > >/* Insert a new element. > * Will NOT overwrite an existing entry. > * Returns FALSE if the element already exists. */ >int aspell_string_map_insert(struct AspellStringMap * ths, const char * key, const char * value); > >/* Insert a new element. > * Will overwrite an existing entry. > * Always returns TRUE. */ >int aspell_string_map_replace(struct AspellStringMap * ths, const char * key, const char * value); > >/* Looks up an element and returns the value. > * Returns NULL if the element does not exist. > * Returns an empty string if the element exists > * but has a NULL value. */ >const char * aspell_string_map_lookup(const struct AspellStringMap * ths, const char * key); > > > >/***************************** string pair *****************************/ > > >struct AspellStringPair { > > const char * first; > > const char * second; > >}; > > >typedef struct AspellStringPair AspellStringPair; > > >/*********************** string pair enumeration ***********************/ > > >typedef struct AspellStringPairEnumeration AspellStringPairEnumeration; > > >int aspell_string_pair_enumeration_at_end(const struct AspellStringPairEnumeration * ths); > >struct AspellStringPair aspell_string_pair_enumeration_next(struct AspellStringPairEnumeration * ths); > >void delete_aspell_string_pair_enumeration(struct AspellStringPairEnumeration * ths); > >struct AspellStringPairEnumeration * aspell_string_pair_enumeration_clone(const struct AspellStringPairEnumeration * ths); > >void aspell_string_pair_enumeration_assign(struct AspellStringPairEnumeration * ths, const struct AspellStringPairEnumeration * other); > > > >/******************************** cache ********************************/ > > >/* Reset the global cache(s) so that cache queries will > * create a new object. If existing objects are still in > * use they are not deleted. If which is NULL then all > * caches will be reset. Current caches are "encode", > * "decode", "dictionary", "language", and "keyboard". */ >int aspell_reset_cache(const char * which); > >#ifdef __cplusplus >} >#endif ># 734 "/usr/local/include/aspell.h" >#endif /* ASPELL_ASPELL__H */ ># 735 "/usr/local/include/aspell.h" ># 93 "../include/dps_common.h" 2 >#endif ># 94 "../include/dps_common.h" >#if defined(HAVE_LIBCARES) >#if 0 /* expanded by -frewrite-includes */ >#include "ares.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/ares.h" 1 > >/* Copyright 1998 by the Massachusetts Institute of Technology. > * Copyright (C) 2007-2013 by Daniel Stenberg > * > * Permission to use, copy, modify, and distribute this > * software and its documentation for any purpose and without > * fee is hereby granted, provided that the above copyright > * notice appear in all copies and that both that copyright > * notice and this permission notice appear in supporting > * documentation, and that the name of M.I.T. not be used in > * advertising or publicity pertaining to distribution of the > * software without specific, written prior permission. > * M.I.T. makes no representations about the suitability of > * this software for any purpose. It is provided "as is" > * without express or implied warranty. > */ > >#ifndef ARES__H >#define ARES__H > >#if 0 /* expanded by -frewrite-includes */ >#include "ares_version.h" /* c-ares version defines */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/ares_version.h" 1 > >#ifndef ARES__VERSION_H >#define ARES__VERSION_H > >/* This is the global package copyright */ >#define ARES_COPYRIGHT "2004 - 2013 Daniel Stenberg, <daniel@haxx.se>." > >#define ARES_VERSION_MAJOR 1 >#define ARES_VERSION_MINOR 10 >#define ARES_VERSION_PATCH 0 >#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\ > (ARES_VERSION_MINOR<<8)|\ > (ARES_VERSION_PATCH)) >#define ARES_VERSION_STR "1.10.0" > >#if (ARES_VERSION >= 0x010700) ># define CARES_HAVE_ARES_LIBRARY_INIT 1 ># define CARES_HAVE_ARES_LIBRARY_CLEANUP 1 >#else ># 20 "/usr/local/include/ares_version.h" ># undef CARES_HAVE_ARES_LIBRARY_INIT ># undef CARES_HAVE_ARES_LIBRARY_CLEANUP >#endif ># 23 "/usr/local/include/ares_version.h" > >#endif ># 25 "/usr/local/include/ares_version.h" ># 22 "/usr/local/include/ares.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "ares_build.h" /* c-ares build definitions */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/ares_build.h" 1 >/* ares_build.h. Generated from ares_build.h.in by configure. */ >#ifndef __CARES_BUILD_H >#define __CARES_BUILD_H > > >/* Copyright (C) 2009 by Daniel Stenberg et al > * > * Permission to use, copy, modify, and distribute this software and its > * documentation for any purpose and without fee is hereby granted, provided > * that the above copyright notice appear in all copies and that both that > * copyright notice and this permission notice appear in supporting > * documentation, and that the name of M.I.T. not be used in advertising or > * publicity pertaining to distribution of the software without specific, > * written prior permission. M.I.T. makes no representations about the > * suitability of this software for any purpose. It is provided "as is" > * without express or implied warranty. > */ > >/* ================================================================ */ >/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ >/* ================================================================ */ > >/* > * NOTE 1: > * ------- > * > * Nothing in this file is intended to be modified or adjusted by the > * c-ares library user nor by the c-ares library builder. > * > * If you think that something actually needs to be changed, adjusted > * or fixed in this file, then, report it on the c-ares development > * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/ > * > * This header file shall only export symbols which are 'cares' or 'CARES' > * prefixed, otherwise public name space would be polluted. > * > * NOTE 2: > * ------- > * > * Right now you might be staring at file ares_build.h.in or ares_build.h, > * this is due to the following reason: > * > * On systems capable of running the configure script, the configure process > * will overwrite the distributed ares_build.h file with one that is suitable > * and specific to the library being configured and built, which is generated > * from the ares_build.h.in template file. > * > */ > >/* ================================================================ */ >/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ >/* ================================================================ */ > >#ifdef CARES_SIZEOF_LONG ># error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h" > Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined >#endif ># 58 "/usr/local/include/ares_build.h" > >#ifdef CARES_TYPEOF_ARES_SOCKLEN_T ># error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" > Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined >#endif ># 63 "/usr/local/include/ares_build.h" > >#ifdef CARES_SIZEOF_ARES_SOCKLEN_T ># error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" > Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined >#endif ># 68 "/usr/local/include/ares_build.h" > >/* ================================================================ */ >/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ >/* ================================================================ */ > >/* Configure process defines this to 1 when it finds out that system */ >/* header file ws2tcpip.h must be included by the external interface. */ >/* #undef CARES_PULL_WS2TCPIP_H */ >#ifdef CARES_PULL_WS2TCPIP_H ># ifndef WIN32_LEAN_AND_MEAN ># define WIN32_LEAN_AND_MEAN ># endif ># 80 "/usr/local/include/ares_build.h" >#if 0 /* expanded by -frewrite-includes */ ># include <windows.h> >#endif /* expanded by -frewrite-includes */ ># 81 "/usr/local/include/ares_build.h" >#if 0 /* expanded by -frewrite-includes */ ># include <winsock2.h> >#endif /* expanded by -frewrite-includes */ ># 82 "/usr/local/include/ares_build.h" >#if 0 /* expanded by -frewrite-includes */ ># include <ws2tcpip.h> >#endif /* expanded by -frewrite-includes */ ># 83 "/usr/local/include/ares_build.h" >#endif ># 84 "/usr/local/include/ares_build.h" > >/* Configure process defines this to 1 when it finds out that system */ >/* header file sys/types.h must be included by the external interface. */ >#define CARES_PULL_SYS_TYPES_H 1 >#ifdef CARES_PULL_SYS_TYPES_H >#if 0 /* expanded by -frewrite-includes */ ># include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 90 "/usr/local/include/ares_build.h" >#endif ># 91 "/usr/local/include/ares_build.h" > >/* Configure process defines this to 1 when it finds out that system */ >/* header file sys/socket.h must be included by the external interface. */ >#define CARES_PULL_SYS_SOCKET_H 1 >#ifdef CARES_PULL_SYS_SOCKET_H >#if 0 /* expanded by -frewrite-includes */ ># include <sys/socket.h> >#endif /* expanded by -frewrite-includes */ ># 97 "/usr/local/include/ares_build.h" >#endif ># 98 "/usr/local/include/ares_build.h" > >/* The size of `long', as computed by sizeof. */ >#define CARES_SIZEOF_LONG 8 > >/* Integral data type used for ares_socklen_t. */ >#define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t > >/* The size of `ares_socklen_t', as computed by sizeof. */ >#define CARES_SIZEOF_ARES_SOCKLEN_T 4 > >/* Data type definition of ares_socklen_t. */ >typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; > >#endif /* __CARES_BUILD_H */ ># 112 "/usr/local/include/ares_build.h" ># 23 "/usr/local/include/ares.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "ares_rules.h" /* c-ares rules enforcement */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/ares_rules.h" 1 >#ifndef __CARES_RULES_H >#define __CARES_RULES_H > > >/* Copyright (C) 2009 by Daniel Stenberg et al > * > * Permission to use, copy, modify, and distribute this software and its > * documentation for any purpose and without fee is hereby granted, provided > * that the above copyright notice appear in all copies and that both that > * copyright notice and this permission notice appear in supporting > * documentation, and that the name of M.I.T. not be used in advertising or > * publicity pertaining to distribution of the software without specific, > * written prior permission. M.I.T. makes no representations about the > * suitability of this software for any purpose. It is provided "as is" > * without express or implied warranty. > */ > >/* ================================================================ */ >/* COMPILE TIME SANITY CHECKS */ >/* ================================================================ */ > >/* > * NOTE 1: > * ------- > * > * All checks done in this file are intentionally placed in a public > * header file which is pulled by ares.h when an application is > * being built using an already built c-ares library. Additionally > * this file is also included and used when building the library. > * > * If compilation fails on this file it is certainly sure that the > * problem is elsewhere. It could be a problem in the ares_build.h > * header file, or simply that you are using different compilation > * settings than those used to build the library. > * > * Nothing in this file is intended to be modified or adjusted by the > * c-ares library user nor by the c-ares library builder. > * > * Do not deactivate any check, these are done to make sure that the > * library is properly built and used. > * > * You can find further help on the c-ares development mailing list: > * http://cool.haxx.se/mailman/listinfo/c-ares/ > * > * NOTE 2 > * ------ > * > * Some of the following compile time checks are based on the fact > * that the dimension of a constant array can not be a negative one. > * In this way if the compile time verification fails, the compilation > * will fail issuing an error. The error description wording is compiler > * dependent but it will be quite similar to one of the following: > * > * "negative subscript or subscript is too large" > * "array must have at least one element" > * "-1 is an illegal array size" > * "size of array is negative" > * > * If you are building an application which tries to use an already > * built c-ares library and you are getting this kind of errors on > * this file, it is a clear indication that there is a mismatch between > * how the library was built and how you are trying to use it for your > * application. Your already compiled or binary library provider is the > * only one who can give you the details you need to properly use it. > */ > >/* > * Verify that some macros are actually defined. > */ > >#ifndef CARES_SIZEOF_LONG ># error "CARES_SIZEOF_LONG definition is missing!" > Error Compilation_aborted_CARES_SIZEOF_LONG_is_missing >#endif ># 75 "/usr/local/include/ares_rules.h" > >#ifndef CARES_TYPEOF_ARES_SOCKLEN_T ># error "CARES_TYPEOF_ARES_SOCKLEN_T definition is missing!" > Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_is_missing >#endif ># 80 "/usr/local/include/ares_rules.h" > >#ifndef CARES_SIZEOF_ARES_SOCKLEN_T ># error "CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!" > Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_is_missing >#endif ># 85 "/usr/local/include/ares_rules.h" > >/* > * Macros private to this header file. > */ > >#define CareschkszEQ(t, s) sizeof(t) == s ? 1 : -1 > >#define CareschkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 > >/* > * Verify that the size previously defined and expected for long > * is the same as the one reported by sizeof() at compile time. > */ > >typedef char > __cares_rule_01__ > [CareschkszEQ(long, CARES_SIZEOF_LONG)]; > >/* > * Verify that the size previously defined and expected for > * ares_socklen_t is actually the the same as the one reported > * by sizeof() at compile time. > */ > >typedef char > __cares_rule_02__ > [CareschkszEQ(ares_socklen_t, CARES_SIZEOF_ARES_SOCKLEN_T)]; > >/* > * Verify at compile time that the size of ares_socklen_t as reported > * by sizeof() is greater or equal than the one reported for int for > * the current compilation. > */ > >typedef char > __cares_rule_03__ > [CareschkszGE(ares_socklen_t, int)]; > >/* ================================================================ */ >/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ >/* ================================================================ */ > >/* > * Get rid of macros private to this header file. > */ > >#undef CareschkszEQ >#undef CareschkszGE > >/* > * Get rid of macros not intended to exist beyond this point. > */ > >#undef CARES_PULL_WS2TCPIP_H >#undef CARES_PULL_SYS_TYPES_H >#undef CARES_PULL_SYS_SOCKET_H > >#undef CARES_TYPEOF_ARES_SOCKLEN_T > >#endif /* __CARES_RULES_H */ ># 145 "/usr/local/include/ares_rules.h" ># 24 "/usr/local/include/ares.h" 2 > >/* > * Define WIN32 when build target is Win32 API > */ > >#if (defined(_WIN32) || defined(__WIN32__)) && \ > !defined(WIN32) && !defined(__SYMBIAN32__) ># define WIN32 >#endif ># 33 "/usr/local/include/ares.h" > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 35 "/usr/local/include/ares.h" > >/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish > libc5-based Linux systems. Only include it on system that are known to > require it! */ >#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ > defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ > defined(ANDROID) || defined(__ANDROID__) >#if 0 /* expanded by -frewrite-includes */ >#include <sys/select.h> >#endif /* expanded by -frewrite-includes */ ># 43 "/usr/local/include/ares.h" >#endif ># 44 "/usr/local/include/ares.h" >#if (defined(NETWARE) && !defined(__NOVELL_LIBC__)) >#if 0 /* expanded by -frewrite-includes */ >#include <sys/bsdskt.h> >#endif /* expanded by -frewrite-includes */ ># 46 "/usr/local/include/ares.h" >#endif ># 47 "/usr/local/include/ares.h" > >#if defined(WATT32) >#if 0 /* expanded by -frewrite-includes */ ># include <netinet/in.h> >#endif /* expanded by -frewrite-includes */ ># 50 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <sys/socket.h> >#endif /* expanded by -frewrite-includes */ ># 51 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <tcp.h> >#endif /* expanded by -frewrite-includes */ ># 52 "/usr/local/include/ares.h" >#elif defined(_WIN32_WCE) ># 53 "/usr/local/include/ares.h" ># ifndef WIN32_LEAN_AND_MEAN ># define WIN32_LEAN_AND_MEAN ># endif ># 56 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <windows.h> >#endif /* expanded by -frewrite-includes */ ># 57 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <winsock.h> >#endif /* expanded by -frewrite-includes */ ># 58 "/usr/local/include/ares.h" >#elif defined(WIN32) ># 59 "/usr/local/include/ares.h" ># ifndef WIN32_LEAN_AND_MEAN ># define WIN32_LEAN_AND_MEAN ># endif ># 62 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <windows.h> >#endif /* expanded by -frewrite-includes */ ># 63 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <winsock2.h> >#endif /* expanded by -frewrite-includes */ ># 64 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <ws2tcpip.h> >#endif /* expanded by -frewrite-includes */ ># 65 "/usr/local/include/ares.h" >#else ># 66 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <sys/socket.h> >#endif /* expanded by -frewrite-includes */ ># 67 "/usr/local/include/ares.h" >#if 0 /* expanded by -frewrite-includes */ ># include <netinet/in.h> >#endif /* expanded by -frewrite-includes */ ># 68 "/usr/local/include/ares.h" >#endif ># 69 "/usr/local/include/ares.h" > >#ifdef __cplusplus >extern "C" { >#endif ># 73 "/usr/local/include/ares.h" > >/* >** c-ares external API function linkage decorations. >*/ > >#ifdef CARES_STATICLIB ># define CARES_EXTERN >#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) ># 81 "/usr/local/include/ares.h" ># if defined(CARES_BUILDING_LIBRARY) ># define CARES_EXTERN __declspec(dllexport) ># else ># 84 "/usr/local/include/ares.h" ># define CARES_EXTERN __declspec(dllimport) ># endif ># 86 "/usr/local/include/ares.h" >#elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING) ># 87 "/usr/local/include/ares.h" ># define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN >#else ># 89 "/usr/local/include/ares.h" ># define CARES_EXTERN >#endif ># 91 "/usr/local/include/ares.h" > > >#define ARES_SUCCESS 0 > >/* Server error codes (ARES_ENODATA indicates no relevant answer) */ >#define ARES_ENODATA 1 >#define ARES_EFORMERR 2 >#define ARES_ESERVFAIL 3 >#define ARES_ENOTFOUND 4 >#define ARES_ENOTIMP 5 >#define ARES_EREFUSED 6 > >/* Locally generated error codes */ >#define ARES_EBADQUERY 7 >#define ARES_EBADNAME 8 >#define ARES_EBADFAMILY 9 >#define ARES_EBADRESP 10 >#define ARES_ECONNREFUSED 11 >#define ARES_ETIMEOUT 12 >#define ARES_EOF 13 >#define ARES_EFILE 14 >#define ARES_ENOMEM 15 >#define ARES_EDESTRUCTION 16 >#define ARES_EBADSTR 17 > >/* ares_getnameinfo error codes */ >#define ARES_EBADFLAGS 18 > >/* ares_getaddrinfo error codes */ >#define ARES_ENONAME 19 >#define ARES_EBADHINTS 20 > >/* Uninitialized library error code */ >#define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */ > >/* ares_library_init error codes */ >#define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */ >#define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */ > >/* More error codes */ >#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */ > >/* Flag values */ >#define ARES_FLAG_USEVC (1 << 0) >#define ARES_FLAG_PRIMARY (1 << 1) >#define ARES_FLAG_IGNTC (1 << 2) >#define ARES_FLAG_NORECURSE (1 << 3) >#define ARES_FLAG_STAYOPEN (1 << 4) >#define ARES_FLAG_NOSEARCH (1 << 5) >#define ARES_FLAG_NOALIASES (1 << 6) >#define ARES_FLAG_NOCHECKRESP (1 << 7) >#define ARES_FLAG_EDNS (1 << 8) > >/* Option mask values */ >#define ARES_OPT_FLAGS (1 << 0) >#define ARES_OPT_TIMEOUT (1 << 1) >#define ARES_OPT_TRIES (1 << 2) >#define ARES_OPT_NDOTS (1 << 3) >#define ARES_OPT_UDP_PORT (1 << 4) >#define ARES_OPT_TCP_PORT (1 << 5) >#define ARES_OPT_SERVERS (1 << 6) >#define ARES_OPT_DOMAINS (1 << 7) >#define ARES_OPT_LOOKUPS (1 << 8) >#define ARES_OPT_SOCK_STATE_CB (1 << 9) >#define ARES_OPT_SORTLIST (1 << 10) >#define ARES_OPT_SOCK_SNDBUF (1 << 11) >#define ARES_OPT_SOCK_RCVBUF (1 << 12) >#define ARES_OPT_TIMEOUTMS (1 << 13) >#define ARES_OPT_ROTATE (1 << 14) >#define ARES_OPT_EDNSPSZ (1 << 15) > >/* Nameinfo flag values */ >#define ARES_NI_NOFQDN (1 << 0) >#define ARES_NI_NUMERICHOST (1 << 1) >#define ARES_NI_NAMEREQD (1 << 2) >#define ARES_NI_NUMERICSERV (1 << 3) >#define ARES_NI_DGRAM (1 << 4) >#define ARES_NI_TCP 0 >#define ARES_NI_UDP ARES_NI_DGRAM >#define ARES_NI_SCTP (1 << 5) >#define ARES_NI_DCCP (1 << 6) >#define ARES_NI_NUMERICSCOPE (1 << 7) >#define ARES_NI_LOOKUPHOST (1 << 8) >#define ARES_NI_LOOKUPSERVICE (1 << 9) >/* Reserved for future use */ >#define ARES_NI_IDN (1 << 10) >#define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11) >#define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12) > >/* Addrinfo flag values */ >#define ARES_AI_CANONNAME (1 << 0) >#define ARES_AI_NUMERICHOST (1 << 1) >#define ARES_AI_PASSIVE (1 << 2) >#define ARES_AI_NUMERICSERV (1 << 3) >#define ARES_AI_V4MAPPED (1 << 4) >#define ARES_AI_ALL (1 << 5) >#define ARES_AI_ADDRCONFIG (1 << 6) >/* Reserved for future use */ >#define ARES_AI_IDN (1 << 10) >#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11) >#define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12) >#define ARES_AI_CANONIDN (1 << 13) > >#define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \ > ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \ > ARES_AI_ADDRCONFIG) >#define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this > many sockets */ >#define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num))) >#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \ > ARES_GETSOCK_MAXNUM))) > >/* c-ares library initialization flag values */ >#define ARES_LIB_INIT_NONE (0) >#define ARES_LIB_INIT_WIN32 (1 << 0) >#define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32) > > >/* > * Typedef our socket type > */ > >#ifndef ares_socket_typedef >#ifdef WIN32 >typedef SOCKET ares_socket_t; >#define ARES_SOCKET_BAD INVALID_SOCKET >#else ># 218 "/usr/local/include/ares.h" >typedef int ares_socket_t; >#define ARES_SOCKET_BAD -1 >#endif ># 221 "/usr/local/include/ares.h" >#define ares_socket_typedef >#endif /* ares_socket_typedef */ ># 223 "/usr/local/include/ares.h" > >typedef void (*ares_sock_state_cb)(void *data, > ares_socket_t socket_fd, > int readable, > int writable); > >struct apattern; > >/* NOTE about the ares_options struct to users and developers. > > This struct will remain looking like this. It will not be extended nor > shrunk in future releases, but all new options will be set by ares_set_*() > options instead of with the ares_init_options() function. > > Eventually (in a galaxy far far away), all options will be settable by > ares_set_*() options and the ares_init_options() function will become > deprecated. > > When new options are added to c-ares, they are not added to this > struct. And they are not "saved" with the ares_save_options() function but > instead we encourage the use of the ares_dup() function. Needless to say, > if you add config options to c-ares you need to make sure ares_dup() > duplicates this new option. > > */ >struct ares_options { > int flags; > int timeout; /* in seconds or milliseconds, depending on options */ > int tries; > int ndots; > unsigned short udp_port; > unsigned short tcp_port; > int socket_send_buffer_size; > int socket_receive_buffer_size; > struct in_addr *servers; > int nservers; > char **domains; > int ndomains; > char *lookups; > ares_sock_state_cb sock_state_cb; > void *sock_state_cb_data; > struct apattern *sortlist; > int nsort; > int ednspsz; >}; > >/** Public available config (readonly) interface for ares_get_config(). */ >struct ares_config_info { > int timeout; > int tries; > int numservers; > char **servers; >}; > >struct hostent; >struct timeval; >struct sockaddr; >struct ares_channeldata; > >typedef struct ares_channeldata *ares_channel; > >typedef void (*ares_callback)(void *arg, > int status, > int timeouts, > unsigned char *abuf, > int alen); > >typedef void (*ares_host_callback)(void *arg, > int status, > int timeouts, > struct hostent *hostent); > >typedef void (*ares_nameinfo_callback)(void *arg, > int status, > int timeouts, > char *node, > char *service); > >typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd, > int type, > void *data); > >CARES_EXTERN int ares_library_init(int flags); > >CARES_EXTERN void ares_library_cleanup(void); > >CARES_EXTERN const char *ares_version(int *version); > >CARES_EXTERN int ares_init(ares_channel *channelptr); > >CARES_EXTERN int ares_init_options(ares_channel *channelptr, > struct ares_options *options, > int optmask); > >CARES_EXTERN int ares_save_options(ares_channel channel, > struct ares_options *options, > int *optmask); > >CARES_EXTERN void ares_destroy_options(struct ares_options *options); > >CARES_EXTERN int ares_dup(ares_channel *dest, > ares_channel src); > >CARES_EXTERN void ares_destroy(ares_channel channel); > >CARES_EXTERN void ares_cancel(ares_channel channel); > >/* These next 3 configure local binding for the out-going socket > * connection. Use these to specify source IP and/or network device > * on multi-homed systems. > */ >CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip); > >/* local_ip6 should be 16 bytes in length */ >CARES_EXTERN void ares_set_local_ip6(ares_channel channel, > const unsigned char* local_ip6); > >/* local_dev_name should be null terminated. */ >CARES_EXTERN void ares_set_local_dev(ares_channel channel, > const char* local_dev_name); > >CARES_EXTERN void ares_set_socket_callback(ares_channel channel, > ares_sock_create_callback callback, > void *user_data); > >CARES_EXTERN void ares_send(ares_channel channel, > const unsigned char *qbuf, > int qlen, > ares_callback callback, > void *arg); > >CARES_EXTERN void ares_query(ares_channel channel, > const char *name, > int dnsclass, > int type, > ares_callback callback, > void *arg); > >CARES_EXTERN void ares_search(ares_channel channel, > const char *name, > int dnsclass, > int type, > ares_callback callback, > void *arg); > >CARES_EXTERN void ares_gethostbyname(ares_channel channel, > const char *name, > int family, > ares_host_callback callback, > void *arg); > >CARES_EXTERN int ares_gethostbyname_file(ares_channel channel, > const char *name, > int family, > struct hostent **host); > >CARES_EXTERN void ares_gethostbyaddr(ares_channel channel, > const void *addr, > int addrlen, > int family, > ares_host_callback callback, > void *arg); > >CARES_EXTERN void ares_getnameinfo(ares_channel channel, > const struct sockaddr *sa, > ares_socklen_t salen, > int flags, > ares_nameinfo_callback callback, > void *arg); > >CARES_EXTERN int ares_fds(ares_channel channel, > fd_set *read_fds, > fd_set *write_fds); > >CARES_EXTERN int ares_getsock(ares_channel channel, > ares_socket_t *socks, > int numsocks); > >CARES_EXTERN struct timeval *ares_timeout(ares_channel channel, > struct timeval *maxtv, > struct timeval *tv); > >CARES_EXTERN void ares_process(ares_channel channel, > fd_set *read_fds, > fd_set *write_fds); > >CARES_EXTERN void ares_process_fd(ares_channel channel, > ares_socket_t read_fd, > ares_socket_t write_fd); > >CARES_EXTERN int ares_create_query(const char *name, > int dnsclass, > int type, > unsigned short id, > int rd, > unsigned char **buf, > int *buflen, > int max_udp_size); > >CARES_EXTERN int ares_mkquery(const char *name, > int dnsclass, > int type, > unsigned short id, > int rd, > unsigned char **buf, > int *buflen); > >CARES_EXTERN int ares_expand_name(const unsigned char *encoded, > const unsigned char *abuf, > int alen, > char **s, > long *enclen); > >CARES_EXTERN int ares_expand_string(const unsigned char *encoded, > const unsigned char *abuf, > int alen, > unsigned char **s, > long *enclen); > >/* > * NOTE: before c-ares 1.7.0 we would most often use the system in6_addr > * struct below when ares itself was built, but many apps would use this > * private version since the header checked a HAVE_* define for it. Starting > * with 1.7.0 we always declare and use our own to stop relying on the > * system's one. > */ >struct ares_in6_addr { > union { > unsigned char _S6_u8[16]; > } _S6_un; >}; > >struct ares_addrttl { > struct in_addr ipaddr; > int ttl; >}; > >struct ares_addr6ttl { > struct ares_in6_addr ip6addr; > int ttl; >}; > >struct ares_srv_reply { > struct ares_srv_reply *next; > char *host; > unsigned short priority; > unsigned short weight; > unsigned short port; >}; > >struct ares_mx_reply { > struct ares_mx_reply *next; > char *host; > unsigned short priority; >}; > >struct ares_txt_reply { > struct ares_txt_reply *next; > unsigned char *txt; > size_t length; /* length excludes null termination */ >}; > >struct ares_naptr_reply { > struct ares_naptr_reply *next; > unsigned char *flags; > unsigned char *service; > unsigned char *regexp; > char *replacement; > unsigned short order; > unsigned short preference; >}; > >struct ares_soa_reply { > char *nsname; > char *hostmaster; > unsigned int serial; > unsigned int refresh; > unsigned int retry; > unsigned int expire; > unsigned int minttl; >}; > >/* >** Parse the buffer, starting at *abuf and of length alen bytes, previously >** obtained from an ares_search call. Put the results in *host, if nonnull. >** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with >** their TTLs in that array, and set *naddrttls to the number of addresses >** so written. >*/ > >CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf, > int alen, > struct hostent **host, > struct ares_addrttl *addrttls, > int *naddrttls); > >CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf, > int alen, > struct hostent **host, > struct ares_addr6ttl *addrttls, > int *naddrttls); > >CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, > int alen, > const void *addr, > int addrlen, > int family, > struct hostent **host); > >CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf, > int alen, > struct hostent **host); > >CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf, > int alen, > struct ares_srv_reply** srv_out); > >CARES_EXTERN int ares_parse_mx_reply(const unsigned char* abuf, > int alen, > struct ares_mx_reply** mx_out); > >CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf, > int alen, > struct ares_txt_reply** txt_out); > >CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf, > int alen, > struct ares_naptr_reply** naptr_out); > >CARES_EXTERN int ares_parse_soa_reply(const unsigned char* abuf, > int alen, > struct ares_soa_reply** soa_out); > >CARES_EXTERN void ares_free_string(void *str); > >CARES_EXTERN void ares_free_hostent(struct hostent *host); > >CARES_EXTERN void ares_free_data(void *dataptr); > >CARES_EXTERN const char *ares_strerror(int code); > >/* TODO: Hold port here as well. */ >struct ares_addr_node { > struct ares_addr_node *next; > int family; > union { > struct in_addr addr4; > struct ares_in6_addr addr6; > } addr; >}; > >CARES_EXTERN int ares_set_servers(ares_channel channel, > struct ares_addr_node *servers); > >/* Incomming string format: host[:port][,host[:port]]... */ >CARES_EXTERN int ares_set_servers_csv(ares_channel channel, > const char* servers); > >CARES_EXTERN int ares_get_servers(ares_channel channel, > struct ares_addr_node **servers); > >CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst, > ares_socklen_t size); > >CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst); > > >CARES_EXTERN int ares_get_config(struct ares_config_info *d, ares_channel c); > >#ifdef __cplusplus >} >#endif ># 595 "/usr/local/include/ares.h" > >#endif /* ARES__H */ ># 597 "/usr/local/include/ares.h" ># 96 "../include/dps_common.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "ares_version.h" >#endif /* expanded by -frewrite-includes */ ># 97 "../include/dps_common.h" >#elif defined(HAVE_LIBARES) ># 98 "../include/dps_common.h" >#if 0 /* expanded by -frewrite-includes */ >#include "ares.h" >#endif /* expanded by -frewrite-includes */ ># 99 "../include/dps_common.h" >#endif ># 100 "../include/dps_common.h" > >#ifdef DEBUG_CONF_LOCK >#if 0 /* expanded by -frewrite-includes */ >#include <assert.h> >#endif /* expanded by -frewrite-includes */ ># 103 "../include/dps_common.h" >#endif ># 104 "../include/dps_common.h" > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_filence.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_filence.h" 1 >/* Copyright (C) 2006-2008 DataPark Ltd. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ >#ifndef _DPS_FILENCE_H >#define _DPS_FILENCE_H > >#ifdef FILENCE > >#if 0 /* expanded by -frewrite-includes */ >#include <fcntl.h> >#endif /* expanded by -frewrite-includes */ ># 23 "../include/dps_filence.h" >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 24 "../include/dps_filence.h" >#if 0 /* expanded by -frewrite-includes */ >#include <sys/param.h> >#endif /* expanded by -frewrite-includes */ ># 25 "../include/dps_filence.h" >#if 0 /* expanded by -frewrite-includes */ >#include <stdarg.h> >#endif /* expanded by -frewrite-includes */ ># 26 "../include/dps_filence.h" >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> >#endif /* expanded by -frewrite-includes */ ># 27 "../include/dps_filence.h" > >#if defined(USE_LONG_LONG) >typedef unsigned long long fe_number; >#else ># 31 "../include/dps_filence.h" >typedef unsigned long fe_number; >#endif ># 33 "../include/dps_filence.h" > >extern int _DpsOpen2(const char *path, int flags, char *filename, size_t fileline); >extern int _DpsOpen3(const char *path, int flags, int mode, char *filename, size_t fileline); >extern int _DpsClose(int fd, char *filename, size_t fileline); >extern void DpsFilenceCheckLeaks(FILE *f); > >#define DpsOpen2(n, f) _DpsOpen2(n, f, __FILE__, __LINE__) >#define DpsOpen3(n, f, m) _DpsOpen3(n, f, m, __FILE__, __LINE__) >#define DpsClose(d) _DpsClose(d, __FILE__, __LINE__) > >void FE_Abort(const char * message, ...); >void FE_Abortv(const char * message, va_list args); >void FE_Exit(const char * message, ...); >void FE_Exitv(const char * message, va_list args); >void FE_Print(const char * message, ...); >void FE_Printv(const char * message, va_list args); >void FE_InternalError(const char * message, ...); > >#else ># 52 "../include/dps_filence.h" > >#define DpsOpen2(n, f) open(n, f) >#define DpsOpen3(n, f, m) open(n, f, m) >#define DpsClose(d) close(d) > >#endif ># 58 "../include/dps_filence.h" > > >#endif /* _DPS_FILENCE_H */ ># 61 "../include/dps_filence.h" > ># 106 "../include/dps_common.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_unicode.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_unicode.h" 1 >/* Copyright (C) 2003-2012 DataPark Ltd. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef DPS_UNICODE_H >#define DPS_UNICODE_H > >static const dpsunicode_t dps_uninullstr[] = {0}; > >#define DPS_UNINULL2EMPTY(x) ((x)?(x):dps_uninullstr) > >extern size_t __DPSCALL DpsUniLen(register const dpsunicode_t *u); >int DpsUniStrCmp(register const dpsunicode_t * s1, register const dpsunicode_t *s2); >int DpsUniStrCaseCmp(register const dpsunicode_t * s1, register const dpsunicode_t *s2); >int DpsUniStrBCmp(const dpsunicode_t *s1, const dpsunicode_t *s2); >int DpsUniStrBNCmp(const dpsunicode_t *s1, const dpsunicode_t *s2, size_t count); >int DpsUniStrNCaseCmp(const dpsunicode_t *s1, const dpsunicode_t *s2, size_t len); >int DpsUniStrNCmp(const dpsunicode_t *s1, const dpsunicode_t *s2, size_t len); > >dpsunicode_t *DpsUniStrCpy(dpsunicode_t *dst, const dpsunicode_t *src); >dpsunicode_t *DpsUniStrRCpy(dpsunicode_t *dst, const dpsunicode_t *src); >dpsunicode_t *DpsUniStrNCpy(dpsunicode_t *dst, const dpsunicode_t *src, size_t len); >dpsunicode_t *DpsUniStrCat(dpsunicode_t *s, const dpsunicode_t *append); >dpsunicode_t *DpsUniDup(const dpsunicode_t *s); >dpsunicode_t *DpsUniRDup(const dpsunicode_t *s); >dpsunicode_t *DpsUniNDup(const dpsunicode_t *s, size_t len); >dpsunicode_t *DpsUniAccentStrip(dpsunicode_t *str); >dpsunicode_t *DpsUniGermanReplace(dpsunicode_t *str); >dpsunicode_t *DpsUniStrChr(const dpsunicode_t *str, dpsunicode_t ch); >dpsunicode_t *DpsUniStrChrLower(const dpsunicode_t *str, dpsunicode_t ch); >dpsunicode_t *DpsUniRTrim(dpsunicode_t *p, dpsunicode_t *delim); > >dpsunicode_t *DpsUniStrTok_SEA(dpsunicode_t *s, dpsunicode_t **last); > >#endif ># 50 "../include/dps_unicode.h" ># 107 "../include/dps_common.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_uniconv.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_uniconv.h" 1 >/* Copyright (C) 2013 Maxim Zakharov. All rights reserved. > Copyright (C) 2003-2012 DataPark Ltd. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef DPS_UNICONV_H >#define DPS_UNICONV_H >/* >#define DEBUG_CONV 1 >*/ >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 26 "../include/dps_uniconv.h" > >#define DPS_RECODE_TEXT_FROM 1 >#define DPS_RECODE_TEXT_TO 2 >#define DPS_RECODE_TEXT 3 /* DPS_RECODE_TEXT_FROM | DPS_RECODE_TEXT_TO */ >#define DPS_RECODE_HTML_FROM 4 >#define DPS_RECODE_HTML_TO 8 >#define DPS_RECODE_HTML 12 /* DPS_RECODE_HTML_FROM | DPS_RECODE_HTML_TO */ >#define DPS_RECODE_URL_FROM 16 >#define DPS_RECODE_URL_TO 32 >#define DPS_RECODE_URL 48 /* DPS_RECODE_URL_FROM | DPS_RECODE_URL_TO */ >#define DPS_RECODE_JSON_FROM 64 >#define DPS_RECODE_JSON_TO 128 >#define DPS_RECODE_JSON 192 /* DPS_RECODE_JSON_FROM | DPS_RECODE_JSON_TO */ > > >#define DPS_CHARSET_UNKNOWN 0 >#define DPS_CHARSET_ARABIC 1 >#define DPS_CHARSET_ARMENIAN 2 >#define DPS_CHARSET_BALTIC 3 >#define DPS_CHARSET_CELTIC 4 >#define DPS_CHARSET_CENTRAL 5 >#define DPS_CHARSET_CHINESE_SIMPLIFIED 6 >#define DPS_CHARSET_CHINESE_TRADITIONAL 7 >#define DPS_CHARSET_CYRILLIC 8 >#define DPS_CHARSET_GREEK 9 >#define DPS_CHARSET_HEBREW 10 >#define DPS_CHARSET_ICELANDIC 11 >#define DPS_CHARSET_JAPANESE 12 >#define DPS_CHARSET_KOREAN 13 >#define DPS_CHARSET_NORDIC 14 >#define DPS_CHARSET_SOUTHERN 15 >#define DPS_CHARSET_THAI 16 >#define DPS_CHARSET_TURKISH 17 >#define DPS_CHARSET_UNICODE 18 >#define DPS_CHARSET_VIETNAMESE 19 >#define DPS_CHARSET_WESTERN 20 >#define DPS_CHARSET_INDIAN 21 >#define DPS_CHARSET_GEORGIAN 22 >#define DPS_CHARSET_LAO 23 >#define DPS_CHARSET_IRANIAN 24 >#define DPS_CHARSET_TAJIK 25 > >typedef struct { > int id; > const char * name; >} DPS_CHARSETGROUP; > >typedef struct { > const char *name; > int id; >} DPS_CHARSET_ALIAS; > >#define DPS_CHARSET_8859_1 0 >#define DPS_CHARSET_8859_10 1 >#define DPS_CHARSET_8859_11 2 >#define DPS_CHARSET_8859_13 3 >#define DPS_CHARSET_8859_14 4 >#define DPS_CHARSET_8859_15 5 >#define DPS_CHARSET_8859_16 6 >#define DPS_CHARSET_8859_2 7 >#define DPS_CHARSET_8859_3 8 >#define DPS_CHARSET_8859_4 9 >#define DPS_CHARSET_8859_5 10 >#define DPS_CHARSET_8859_6 11 >#define DPS_CHARSET_8859_7 12 >#define DPS_CHARSET_8859_8 13 >#define DPS_CHARSET_8859_9 14 >#define DPS_CHARSET_ARMSCII_8 15 >#define DPS_CHARSET_CP1250 16 >#define DPS_CHARSET_CP1251 17 >#define DPS_CHARSET_CP1252 18 >#define DPS_CHARSET_CP1253 19 >#define DPS_CHARSET_CP1254 20 >#define DPS_CHARSET_CP1255 21 >#define DPS_CHARSET_CP1256 22 >#define DPS_CHARSET_CP1257 23 >#define DPS_CHARSET_CP1258 24 >#define DPS_CHARSET_CP437 25 >#define DPS_CHARSET_CP850 26 >#define DPS_CHARSET_CP852 27 >#define DPS_CHARSET_CP855 28 >#define DPS_CHARSET_CP857 29 >#define DPS_CHARSET_CP860 30 >#define DPS_CHARSET_CP861 31 >#define DPS_CHARSET_CP862 32 >#define DPS_CHARSET_CP863 33 >#define DPS_CHARSET_CP864 34 >#define DPS_CHARSET_CP865 35 >#define DPS_CHARSET_CP866 36 >#define DPS_CHARSET_CP869 37 >#define DPS_CHARSET_CP874 38 >#define DPS_CHARSET_KOI8_R 39 >#define DPS_CHARSET_KOI8_U 40 >#define DPS_CHARSET_MACARABIC 41 >#define DPS_CHARSET_MACCE 42 >#define DPS_CHARSET_MACCROATIAN 43 >#define DPS_CHARSET_MACCYRILLIC 44 >#define DPS_CHARSET_MACGREEK 45 >#define DPS_CHARSET_MACHEBREW 46 >#define DPS_CHARSET_MACICELAND 47 >#define DPS_CHARSET_MACROMAN 48 >#define DPS_CHARSET_MACROMANIA 49 >#define DPS_CHARSET_MACTHAI 50 >#define DPS_CHARSET_MACTURKISH 51 >#define DPS_CHARSET_US_ASCII 52 >#define DPS_CHARSET_VISCII 53 >#define DPS_CHARSET_UTF8 54 >#define DPS_CHARSET_GB2312 55 >#define DPS_CHARSET_BIG5 56 >#define DPS_CHARSET_SJIS 57 >#define DPS_CHARSET_EUC_KR 58 >#define DPS_CHARSET_EUC_JP 60 >#define DPS_CHARSET_GBK 61 >#define DPS_CHARSET_GUJARATI 62 >#define DPS_CHARSET_TSCII 63 >#define DPS_CHARSET_ISO2022JP 64 >#define DPS_CHARSET_GEOSTD8 65 >#define DPS_CHARSET_CP950 66 >#define DPS_CHARSET_BIG5HKSCS 67 >#define DPS_CHARSET_CP037 68 >#define DPS_CHARSET_CP1026 69 >#define DPS_CHARSET_CP500 70 >#define DPS_CHARSET_CP875 71 >#define DPS_CHARSET_CP1133 72 >#define DPS_CHARSET_ISIRI3342 73 >#define DPS_CHARSET_CP866U 74 >#define DPS_CHARSET_KOI_7 75 >#define DPS_CHARSET_UTF7 76 >#define DPS_CHARSET_UTF16LE 77 >#define DPS_CHARSET_UTF16BE 78 >#define DPS_CHARSET_GB18030 79 >#define DPS_CHARSET_CP775 80 >#define DPS_CHARSET_KOI8_T 81 >#define DPS_CHARSET_GEO_ACADEMY 82 >#define DPS_CHARSET_GEO_PS 83 >#define DPS_CHARSET_KOI8_C 84 >#define DPS_CHARSET_SYS_INT 255 > >typedef struct { > dpsunicode_t from; > dpsunicode_t to; > unsigned char *tab; >} DPS_UNI_IDX; > >struct dps_conv_st; > >typedef struct dps_cset_st{ > int id; > int (*mb_wc)(struct dps_conv_st *conv, struct dps_cset_st *cs, dpsunicode_t *wc, const unsigned char *s, const unsigned char *e); > int (*wc_mb)(struct dps_conv_st *conv, struct dps_cset_st *cs, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); > const char * name; > int family; > dpsunicode_t *tab_to_uni; > DPS_UNI_IDX *tab_from_uni; >} DPS_CHARSET; > >typedef struct dps_conv_st { > DPS_CHARSET *from; > DPS_CHARSET *to; > char *CharsToEscape; > size_t ibytes; > size_t obytes; > size_t icodes; > size_t ocodes; > int flags; > int istate; > int ostate; >} DPS_CONV; > > >/************** Language and charset guesser *************/ > > >#define DPS_LM_MAXGRAM1 3 >#define DPS_LM_MAXGRAM2 (3 * sizeof(dpsunicode_t)) >#define DPS_LM_HASHMASK 0x07FF >#define DPS_LM_TOPCNT 150 > >typedef struct { > size_t count, index; >} DPS_LANGITEM; > >typedef struct { > DPS_LANGITEM memb3[DPS_LM_HASHMASK+1]; /**< Items 3-list */ > DPS_LANGITEM memb6[DPS_LM_HASHMASK+1]; /**< Items 6-list */ > float expectation; /**< Average value */ > size_t nbytes; /**< number of bytes processed */ > size_t lang_len; > int needsave; > char *lang; /**< Map Language */ > char *charset; /**< Map charset */ > char *filename; /**< Filename to write updates, if need */ >} DPS_LANGMAP; > >typedef struct { > size_t nmaps; > DPS_LANGMAP *Map; >} DPS_LANGMAPLIST; > >/*****************************************************/ > >/* Input string in xxx2uni */ >/* convertion has bad multi-byte sequence */ >#define DPS_CHARSET_ILSEQ -1 >#define DPS_CHARSET_ILSEQ2 -2 >#define DPS_CHARSET_ILSEQ3 -3 >#define DPS_CHARSET_ILSEQ4 -4 >#define DPS_CHARSET_ILSEQ5 -5 >#define DPS_CHARSET_ILSEQ6 -6 > >/* Input buffer in xxx2uni was terminated */ >/* in the middle of multi-byte sequence */ >#define DPS_CHARSET_TOOFEW(n) (-7-(n)) > >/* Can't convert unicode into given charset */ >#define DPS_CHARSET_ILUNI 0 > >/* Output buffer in uni2xxx is too small */ >#define DPS_CHARSET_TOOSMALL -1 > > >extern DPS_CHARSET_ALIAS dps_cs_alias[]; > >extern __C_LINK const char * __DPSCALL DpsCsGroup(const DPS_CHARSET *cs); > >extern int dps_mb_wc_utf8(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >extern int dps_wc_mb_utf8(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); > >extern int dps_mb_wc_utf7(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >extern int dps_wc_mb_utf7(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); > >extern int dps_mb_wc_utf16be(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >extern int dps_wc_mb_utf16be(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); > >extern int dps_mb_wc_utf16le(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >extern int dps_wc_mb_utf16le(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); > >extern int dps_mb_wc_8bit(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >extern int dps_wc_mb_8bit(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); > >extern int dps_mb_wc_sys_int(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >extern int dps_wc_mb_sys_int(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); > > >#ifdef HAVE_CHARSET_chinese >int dps_mb_wc_gb2312(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s,const unsigned char *e); >int dps_wc_mb_gb2312(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s,unsigned char *e); >#endif ># 274 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_japanese >int dps_mb_wc_sjis(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s,const unsigned char *e); >int dps_wc_mb_sjis(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char*s,unsigned char *e); >#endif ># 279 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_euc_kr >int dps_mb_wc_euc_kr(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_euc_kr(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s,unsigned char *e); >#endif ># 284 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_japanese >int dps_mb_wc_euc_jp(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_euc_jp(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >#endif ># 289 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_chinese >int dps_mb_wc_big5(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_big5(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >int dps_mb_wc_cp950(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_cp950(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >int dps_mb_wc_big5hkscs(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_big5hkscs(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >#endif ># 298 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_chinese >int dps_mb_wc_gbk(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_gbk(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >int dps_mb_wc_gb18030(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_gb18030(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >#endif ># 305 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_gujarati >int dps_mb_wc_gujarati(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_gujarati(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >#endif ># 310 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_tscii >int dps_mb_wc_tscii(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_tscii(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >#endif ># 315 "../include/dps_uniconv.h" > >#ifdef HAVE_CHARSET_japanese >int dps_mb_wc_iso2022jp(DPS_CONV *conv, DPS_CHARSET *c, dpsunicode_t *pwc, const unsigned char *s, const unsigned char *e); >int dps_wc_mb_iso2022jp(DPS_CONV *conv, DPS_CHARSET *c, const dpsunicode_t *wc, unsigned char *s, unsigned char *e); >#endif ># 320 "../include/dps_uniconv.h" > > >extern __C_LINK DPS_CHARSET * __DPSCALL DpsGetCharSet(const char * name); >extern __C_LINK DPS_CHARSET * __DPSCALL DpsGetCharSetByID(int id); >extern const char * DpsCharsetCanonicalName(const char * alias); > >extern __C_LINK void __DPSCALL DpsConvInit(DPS_CONV *c, DPS_CHARSET *from, DPS_CHARSET *to, const char *CharsToEscape, int fl); >#ifdef DEBUG_CONV >extern __C_LINK int __DPSCALL _DpsConv(DPS_CONV *c, char *d, size_t dlen, const char *s, size_t slen, const char *file, int line); >#define DpsConv(c, d, dl, s, sl) _DpsConv(c, d, dl, s, sl, __FILE__, __LINE__) >#else ># 331 "../include/dps_uniconv.h" >extern __C_LINK int __DPSCALL DpsConv(DPS_CONV *c, char *d, size_t dlen, const char *s, size_t slen); >#endif ># 333 "../include/dps_uniconv.h" >extern int DpsNConv(DPS_CONV *c, size_t n, char *d, size_t dlen, const char *s, size_t slen); >extern size_t DpsUniConvLength(DPS_CONV *c, const char *s); >extern void DpsConvFree(DPS_CONV *c); > >#endif ># 338 "../include/dps_uniconv.h" ># 108 "../include/dps_common.h" 2 > >/* Some constants */ >#define DPS_LANGPERDOC 16 /* FIXME */ >#define DPS_USER_AGENT "DataparkSearch/" VERSION " (+http://dataparksearch.org/bot)" >#define DPS_MAXWORDPERQUERY 256 > >/* Some sizes and others definitions */ >#define DPS_MAXDOCSIZE 2*1024*1024 /**< 2 MB */ >#define DPS_DEFAULT_REINDEX_TIME 7*24*60*60 /**< 1week */ >#define DPS_MAXWORDSIZE 32 >#define DPS_MAXDISCWORDSIZE 64 >#define DPS_DEFAULT_MAX_HOPS 256 >#define DPS_DEFAULT_MAX_DEPTH 16 >#define DPS_DEFAULT_MAX_URLENGTH 256 >#define DPS_DEFAULT_PS 10 >#define DPS_DEFAULT_MAX_ASPELL 16 >#define DPS_READ_TIMEOUT 30 >#define DPS_DOC_TIMEOUT 90 >#define DPS_MAXNETERRORS 16 >#define DPS_DEFAULT_NET_ERROR_DELAY_TIME 86400 >#define DPS_DEFAULT_BAD_SINCE_TIME 15*24*60*60 /**< 15 days */ >#define DPS_FINDURL_CACHE_SIZE 1024 >#define DPS_SERVERID_CACHE_SIZE 256 >#define DPS_ROBOTS_CACHE_SIZE 64 >#define DPS_NET_BUF_SIZE 65536 >#define DPS_MAX_HOST_ADDR 16 >#define DPS_POPRANKSKIPSAMESITE "yes" >#define DPS_CROSSWORDSSKIPSAMESITE "yes" >#define DPS_DETECTCLONES "no" > >/***********************************/ > >#define DPS_LOGDIR "raw" >#define DPS_TREEDIR "tree" >#define DPS_SPLDIR "splitter" >#define DPS_URLDIR "url" > > >/** Forward declaration of DPS_AGENT */ >struct dps_indexer_struct; >/** Forward declaration of DPS_STACK_ITEM */ >struct dps_stack_item_struct; > > >/************************ Statistics **********************/ >typedef struct stat_struct { > int status; > int expired; > int total; > dps_uint8 expired_size; > dps_uint8 total_size; >} DPS_STAT; > >typedef struct stat_list_struct{ > size_t nstats; > DPS_STAT *Stat; >} DPS_STATLIST; > >/* Unicode regex lite BEGIN */ > >typedef struct{ > int type; > int rm_so, rm_eo; > dpsunicode_t *str; >} DPS_UNIREG_TOK; > >typedef struct { > size_t ntokens; > DPS_UNIREG_TOK *Token; >} DPS_UNIREG_EXP; > >/* Unicode regex lite END */ > >/************************ VARLISTs ************************/ > >typedef struct dps_var_st { > char *val; /**< Field Value */ > char *txt_val; /**< Field Value in plain text */ > char *name; /**< Field Name */ > int strict; /**< strict word splitting */ > int single; /**< single valued section, we will drop any second occurence to be processed.*/ > size_t maxlen; /**< Max length */ > size_t curlen; /**< Cur length */ > unsigned char section; /**< Number 0..255 */ >} DPS_VAR; > >typedef struct dps_varlist_st { > int freeme; > struct { > size_t nvars, mvars; > DPS_VAR *Var; > } Root[256]; >} DPS_VARLIST; > > > >typedef struct { > char *str; > char *href; > const char *section_name; > int section; > int strict; > int marked; > size_t len; >} DPS_TEXTITEM; > >typedef struct { > size_t nitems, mitems; > DPS_TEXTITEM *Items; >} DPS_TEXTLIST; > >/*****************************************************************/ >typedef struct { > int match_type; > int nomatch; > int compiled; > char *section; > char *subsection; > char *pattern; > size_t pat_len; >#if (defined(WITH_IDN) || defined(WITH_IDNKIT)) && !defined(APACHE1) && !defined(APACHE2) > char *idn_pattern; > size_t idn_len; >#endif ># 232 "../include/dps_common.h" > char *arg; > char *dbaddr; > regex_t *reg; > DPS_UNIREG_EXP UniReg; > urlid_t server_id; /**< server.rec_id */ > dps_uint2 case_sense; > dps_uint2 last; > dps_uint2 loose; >} DPS_MATCH; > > >typedef struct { > int match_type; > int nomatch; > int compiled; > char *section; > char *subsection; > dpsunicode_t *pattern; >#if (defined(WITH_IDN) || defined(WITH_IDNKIT)) && !defined(APACHE1) && !defined(APACHE2) > dpsunicode_t *idn_pattern; >#endif ># 253 "../include/dps_common.h" > char *arg; > char *dbaddr; > DPS_UNIREG_EXP UniReg; > urlid_t server_id; /**< server.rec_id */ > dps_uint2 case_sense; > dps_uint2 last; >} DPS_UNIMATCH; > > >typedef struct { > size_t nmatches; > DPS_MATCH *Match; >} DPS_MATCHLIST; > > >typedef struct { > size_t nmatches; > DPS_UNIMATCH *Match; >} DPS_UNIMATCHLIST; > > >typedef struct { > int beg; > int end; >} DPS_MATCH_PART; >/*****************************************************************/ > >/* word match type */ >enum { > DPS_MATCH_min = 0, > DPS_MATCH_FULL = 0, > DPS_MATCH_BEGIN = 1, > DPS_MATCH_SUBSTR = 2, > DPS_MATCH_END = 3, > DPS_MATCH_REGEX = 4, > DPS_MATCH_WILD = 5, > DPS_MATCH_SUBNET = 6, > DPS_MATCH_max = 7 >}; > >/*****************************************************/ > >/** StopList unit */ >typedef struct dps_stopword_struct { > char *word; > char *lang; > dpsunicode_t *uword; > size_t len, ulen; >} DPS_STOPWORD; > >typedef struct { > size_t nstopwords; > DPS_STOPWORD *StopWord; > DPS_UNIMATCHLIST StopMatch; /**< Stopword patterns list */ >} DPS_STOPLIST; > >/*****************************************************/ > >/** Words parameters */ >typedef struct { > size_t min_word_len; > size_t max_word_len; > size_t correct_factor; > size_t incorrect_factor; >} DPS_WORDPARAM; > > >#define DPS_N_COUNT 0 >#define DPS_N_ORIGIN 1 >#define DPS_N_PHRASE 2 >#define DPS_N_EXACT 3 >#ifdef WITH_REL_DISTANCE >#define DPS_N_DISTANCE (DPS_N_EXACT + 1) >#else ># 327 "../include/dps_common.h" >#define DPS_N_DISTANCE DPS_N_EXACT >#endif ># 329 "../include/dps_common.h" > >#ifdef WITH_REL_POSITION >#define DPS_N_POSITION (DPS_N_DISTANCE + 1) >#define DPS_N_FIRSTPOS (DPS_N_DISTANCE + 2) >#else ># 334 "../include/dps_common.h" >#define DPS_N_POSITION DPS_N_DISTANCE >#define DPS_N_FIRSTPOS DPS_N_DISTANCE >#endif ># 337 "../include/dps_common.h" > >#ifdef WITH_REL_WRDCOUNT >#define DPS_N_WRDCOUNT (DPS_N_FIRSTPOS + 1) >#else ># 341 "../include/dps_common.h" >#define DPS_N_WRDCOUNT DPS_N_FIRSTPOS >#endif ># 343 "../include/dps_common.h" > >#define DPS_N_ADD (DPS_N_WRDCOUNT + 1) > > >/** Main search structure */ >typedef struct{ > urlid_t url_id; > dps_uint4 coord; >} DPS_URL_CRD; > > >#ifdef WITH_MULTIDBADDR >typedef struct{ > urlid_t url_id; > dps_uint4 coord; > dps_uint2 dbnum; >} DPS_URL_CRD_DB; >#else ># 361 "../include/dps_common.h" >#define DPS_URL_CRD_DB DPS_URL_CRD >#endif ># 363 "../include/dps_common.h" > >typedef struct { > urlid_t url_id; > urlid_t site_id; > dps_uint8 last_mod_time; > double pop_rank; >} DPS_URLDATA; > > >#ifdef WITH_REL_TRACK >typedef struct { > double x, xy, y; >#ifdef WITH_REL_DISTANCE > dps_uint4 D_distance; >#endif ># 378 "../include/dps_common.h" >#ifdef WITH_REL_POSITION > dps_uint4 D_position; > dps_uint4 D_firstpos; >#endif ># 382 "../include/dps_common.h" >#ifdef WITH_REL_WRDCOUNT > dps_uint4 D_wrdcount; >#endif ># 385 "../include/dps_common.h" > dps_uint4 D_n_count; > dps_uint4 D_n_origin; >} DPS_URLTRACK; >#endif ># 389 "../include/dps_common.h" > > >typedef struct { > size_t nrec; >/* time_t mtime;*/ > DPS_URLDATA *URLData; >} DPS_URLDATA_FILE; > >typedef struct { > size_t ncoords; > size_t order; > char *word; >#ifdef WITH_MULTIDBADDR > DPS_URL_CRD_DB *Coords; >#else ># 404 "../include/dps_common.h" > DPS_URL_CRD *Coords; >#endif ># 406 "../include/dps_common.h" > DPS_URLDATA *Data; >#ifdef WITH_REL_TRACK > DPS_URLTRACK *Track; >#endif ># 410 "../include/dps_common.h" >} DPS_URLCRDLIST; > >typedef struct { > int freeme; > size_t nlists; > DPS_URLCRDLIST *List; >} DPS_URLCRDLISTLIST; > >/** Word list unit */ >typedef struct { > dps_uint4 coord; >/* dpshash32_t crcword;*/ >/* char *word;*/ > dpsunicode_t *uword; >/* size_t len;*/ > size_t ulen; >} DPS_WORD; > >typedef struct { > size_t mwords; /**< Number of memory allocated for words */ > size_t nwords; /**< Real number of words in list */ > size_t swords; /**< Number of words in sorted list */ > size_t wordpos;/**< For phrases, number of current word */ > DPS_WORD *Word; /**< Word list itself */ >} DPS_WORDLIST; > > >#define DPS_WRDCOORD(p,w) ( (((dps_uint4)(p)) << 16) + (((dps_uint4)(w)) << 8) ) >#define DPS_WRDCOORDL(p,w,l) ( (((dps_uint4)(p)) << 16) + (((dps_uint4)(w)) << 8) + (((dps_uint4)(l)) & 255) ) >#define DPS_WRDSEC(c) ( ((c) >> 8) & 0xFF ) >#define DPS_WRDPOS(c) ( (c) >> 16 ) >#define DPS_WRDNUM(c) ( (c) & 0xFF ) >#define DPS_WRDMASK(c) ( 1L << (((dps_uint4)(c)) & 0xFF) ) > > >/***************************************************************/ > >/** Cross-word list unit */ >typedef struct { > size_t pos; > char *url; > urlid_t referree_id; > dpsunicode_t *uword; > size_t ulen; > short weight; >} DPS_CROSSWORD; > >typedef struct { > size_t ncrosswords; > size_t mcrosswords; > size_t wordpos; > DPS_CROSSWORD *CrossWord; >} DPS_CROSSLIST; > >/*****************************************************************/ > >typedef union { > struct { > char min; /* minute, 0-59 */ > char hour; /* hour, 0-23 */ > char day; /* day of month, 1-31 */ > char month;/* month, 1-12 */ > char wday; /* day of week, 0-6, 0 - Sunday */ > } cron; > dps_uint8 eight; >} DPS_EXPIRE; > >/** Structure to store server parameters */ >typedef struct { > time_t period[DPS_DEFAULT_MAX_HOPS]; /**< Reindex period by hops */ > DPS_MATCH Match; > DPS_MATCHLIST HTDBsec; > urlid_t site_id; /**< server.rec_id */ > size_t ordre; /**< order in list to find */ > urlid_t parent; /**< parent rec_id for grouping by site */ > float weight; /**< server weight for popularity rank calculation */ > float MinServerWeight;/**< minimum weight for Server/Realm/Subnet to be indexed */ > float MinSiteWeight; /**< minimum weight for site to be indexed */ > DPS_VARLIST Vars; /**< Default lang, charset,etc*/ > DPS_EXPIRE ExpireAt; > dps_uint4 MaxHops; > dps_uint4 ndocs; > dps_uint4 nhrefs; > dps_uint4 MaxDocsPerServer;/**< Maximum number of document from Server at one indexer run */ > dps_uint4 MaxDocsPerSite;/**< Maximum number of document from Server at one indexer run */ > dps_uint4 MaxHrefsPerServer;/**< Maximum number of href from Server at one indexer run */ > dps_uint4 MaxDepth; > dps_uint4 MaxURLength; > time_t crawl_delay; /**< Delay between consecutive fetches from this server, in seconds */ > time_t *last_crawled; > int need_free; /**< =1, if need to free last_crawled */ > int use_robots; > int bad_urls_checked; > char command; /**< 'S' - server,realm, 'F' - disallow,allow */ >} DPS_SERVER; > >typedef struct { > size_t nservers; > size_t mservers; > size_t min_ordre; > int sorted; > DPS_SERVER *Server; >} DPS_SERVERLIST; > > >typedef struct { > DPS_EXPIRE ExpireAt; > int max_net_errors; > int net_error_delay_time; > size_t read_timeout; > size_t doc_timeout; > int maxhops; /**< Max way in mouse clicks */ > int index; /**< Whether to index words */ > int follow; /**< Whether to follow links */ > int use_robots; /**< Whether to use robots.txt*/ > int use_clones; /**< Whether to detect clones */ > int use_cookies; /**< Whether to store cookies */ > DPS_SERVER *Server; >} DPS_SPIDERPARAM; > > >/*******************************************************/ >/* All links are stored in the cache of this structure */ >/* before actual INSERT into database */ > >typedef struct { > char *url; > urlid_t referrer; > dps_uint4 hops; > int stored; > int checked; > int method; > int charset_id; > int delay; > urlid_t site_id; > urlid_t server_id; > float weight; >} DPS_HREF; > >typedef struct { > size_t mhrefs; > size_t nhrefs; > size_t shrefs; > size_t dhrefs; > DPS_HREF *Href; >} DPS_HREFLIST; > >/*******************************************************/ > >/** Resolve stuff */ >typedef struct dps_host_addr_struct { > const char *hostname; > struct sockaddr_in addr[DPS_MAX_HOST_ADDR]; > size_t naddr; > int net_errors; > int charset_id; > time_t last_used; >} DPS_HOST_ADDR; > >typedef struct { > size_t nhost_addr; > size_t mhost_addr; > DPS_HOST_ADDR *host_addr; >} DPS_HOSTLIST; > > >typedef struct { > struct sockaddr_in addr; > time_t last_used; > int neterrors; >} DPS_IP_ADDR; > >typedef struct { > size_t nip_addr; > size_t mip_addr; > DPS_IP_ADDR *ip_addr; >} DPS_IPLIST; > > >/** Used in FTP sessions */ >typedef struct dps_conn_struct { > int status; > int connected; > int err; > int retry; > int conn_fd; > int port; > size_t timeout; > char *hostname; > char *user; > char *pass; > struct sockaddr_in sin; > struct sockaddr_in sinaddr[DPS_MAX_HOST_ADDR]; > size_t n_sinaddr; >/* size_t naddr;*/ > size_t buf_len_total; > int buf_len; > int len; > int charset_id; > char *buf; > DPS_HOST_ADDR *Host; > DPS_IP_ADDR *IP; > struct dps_conn_struct *connp; >} DPS_CONN; > >/** Parsed URL string */ >typedef struct dps_url { > char *schema; > char *specific; > char *hostinfo; > char *auth; > char *hostname; > char *path; > char *directory; > char *filename; > char *anchor; > char *query_string; > int port; > int default_port; > int charset_id; > int freeme; > int domain_level; > size_t len; >} DPS_URL; > > >/***************************************************/ > >typedef struct { > char *buf; /**< Buffer to download document to */ > char *content; /**< Pointer to content, after headers */ > char *pattern; /**< content with a pattern applied */ > size_t size; /**< Number of bytes loaded */ > size_t allocated_size; /**< Number of bytes allocated */ > size_t max_size; /**< Maximum bytes to load into buf */ >} DPS_HTTPBUF; > >typedef struct { > int freeme; /**< Whether memory was allocated for doc */ > int stored; /**< If it is already stored, forAddHref() */ > int method; /**< How to download document: GET, HEAD etc */ > int fetched; /**< Whether Doc's info was fetched or VaryLang is processing */ > int charset_id; /**< Document's charset ID */ > int subdoc; /**< Subdocument level */ > int sd_cnt; /**< Number of subdocuments */ > dpshash32_t id; /**< Hash32(url) for seding and rec_id in special mode */ > > DPS_SERVER *Server; > > DPS_HTTPBUF Buf; /**< Buffer */ > > DPS_HREFLIST Hrefs; /**< Link list */ > DPS_WORDLIST Words; /**< Word list */ > DPS_CROSSLIST CrossWords; /**< Crosswords */ > > DPS_VARLIST RequestHeaders; /**< Extra headers*/ > DPS_VARLIST Sections; /**< User sections*/ > > DPS_TEXTLIST TextList; /**< Text list */ > DPS_TEXTLIST ExtractorList; /**< Text list */ > > DPS_URL CurURL; /**< Parsed URL */ > DPS_CHARSET *lcs; /**< LocalCharser */ > DPS_SPIDERPARAM Spider; /**< Spider prms */ > DPS_CONN connp; /**< For FTP */ > DPS_LANGMAP *lang_cs_map; /**< Language map for detected language and charset, used in SEA */ > > dps_uint2 dbnum; >} DPS_DOCUMENT; > >/********************************************************/ > >/** External Parsers */ >typedef struct dps_parser_struct{ > const char *from_mime; > const char *to_mime; > const char *cmd; >} DPS_PARSER; > >typedef struct { > size_t nparsers; > DPS_PARSER *Parser; >} DPS_PARSERLIST; > > >/* Ispell BEGIN */ > > >typedef struct spell_struct { > dpsunicode_t *word; > char flag[11]; > char lang[6]; >} DPS_SPELL; > > >typedef struct aff_struct { > DPS_UNIREG_EXP reg; > dpsunicode_t mask[41]; > dpsunicode_t find[16]; > dpsunicode_t repl[16]; > size_t replen; > size_t findlen; > char flag[3]; /**< 2 bytes for japanese extension */ > char type; > char lang[6]; > char compile; >} DPS_AFFIX; > > >typedef struct Tree_struct { > int Left[256]; > int Right[256]; > char lang[3]; >} Tree_struct; > >typedef struct { > Tree_struct PrefixTree[DPS_LANGPERDOC]; > Tree_struct SuffixTree[DPS_LANGPERDOC]; > DPS_AFFIX *Affix; > size_t naffixes; > size_t maffixes; > int sorted; >} DPS_AFFIXLIST; > >typedef struct { > Tree_struct SpellTree[DPS_LANGPERDOC]; > DPS_SPELL *Spell; > size_t nspell; > size_t mspell; > size_t nLang; > int sorted; >} DPS_SPELLLIST; > >/* Ispell END */ > >typedef struct qreg_struct { > DPS_UNIREG_EXP reg; > dpsunicode_t mask[41]; > dpsunicode_t find[16]; > dpsunicode_t repl[16]; > size_t replen; > size_t findlen; > char flag[3]; /**< 2 bytes for japanese extension */ > char lang[6]; > char compile; >} DPS_QUFFIX; > >typedef struct { > Tree_struct PrefixTree[DPS_LANGPERDOC]; > Tree_struct SuffixTree[DPS_LANGPERDOC]; > DPS_QUFFIX *Quffix; > size_t nrecs; > size_t mrecs; > int sorted; >} DPS_QUFFIXLIST; > > > >typedef struct{ > int cmd; /**< 'allow' or 'disallow' */ > char *path; > size_t len; >} DPS_ROBOT_RULE; > >typedef struct { > time_t time; > size_t ref_cnt; >} DPS_ROBOT_CRAWL; > >typedef struct{ > const char *hostinfo; > size_t nrules; > time_t crawl_delay; > DPS_ROBOT_CRAWL *last_crawled; > DPS_ROBOT_RULE *Rule; >} DPS_ROBOT; > >typedef struct{ > size_t nrobots; > DPS_ROBOT *Robot; >} DPS_ROBOTS; > > >typedef struct { > char *domain; > char *name; > char *value; > char *path; > char secure; > char from_config; >} DPS_COOKIE; > >typedef struct { > size_t ncookies; > DPS_COOKIE *Cookie; >} DPS_COOKIES; > > >typedef struct dps_search_limit { > char file_name[PATH_MAX]; > char cgi_var[32]; > int type; > int origin; > int need_free; > int second_hand; > size_t size; > size_t total_size; > size_t start; > size_t next; > dps_uint4 hi; > dps_uint4 lo; > dps_uint4 f_hi; > dps_uint4 f_lo; > urlid_t *data; >#ifdef HAVE_PTHREAD > pthread_t tid; >#endif ># 827 "../include/dps_common.h" >} DPS_SEARCH_LIMIT; > > >typedef struct { > dps_uint4 order, order_inquery; > dps_uint4 count; > dps_uint4 len, ulen; > dps_int4 origin; > dpshash32_t crcword; > char *word; > dpsunicode_t *uword; >} DPS_WIDEWORD; > >typedef struct { > dps_uint4 order, order_inquery; > dps_uint4 count; > dps_uint4 len, ulen; > dps_int4 origin; > dpshash32_t crcword; >} DPS_WIDEWORD_EX; > > >typedef struct { > dps_uint4 nuniq; > dps_uint4 nwords; > dps_uint4 maxulen; > DPS_WIDEWORD *Word; >} DPS_WIDEWORDLIST; > >typedef struct { > dps_uint4 nuniq; > dps_uint4 nwords; > dps_uint4 maxulen; >} DPS_WIDEWORDLIST_EX; > > >typedef struct { > DPS_WIDEWORD p; > DPS_WIDEWORD s; >} DPS_SYNONYM; > >typedef struct { > DPS_SYNONYM *Synonym; > DPS_SYNONYM **Back; > size_t nsynonyms; > size_t msynonyms; > int sorted; >} DPS_SYNONYMLIST; > > > >typedef struct { > DPS_WIDEWORD a; > DPS_WIDEWORDLIST unroll; >} DPS_ACRONYM; > >typedef struct { > DPS_ACRONYM *Acronym; > size_t nacronyms; > size_t macronyms; > int sorted; >} DPS_ACRONYMLIST; > > > >typedef struct dps_chinaword_struct { > dpsunicode_t *word; > int freq; >} DPS_CHINAWORD; > >typedef struct { > size_t nwords, mwords; > size_t total; > DPS_CHINAWORD *ChiWord; > size_t *hash; >} DPS_CHINALIST; > > >typedef struct dps_category_struct { > int rec_id; > char path[128]; > char link[128]; > char name[128]; >} DPS_CATITEM; > >typedef struct { > char addr[128]; > size_t ncategories; > DPS_CATITEM *Category; >} DPS_CATEGORY; > > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_db_int.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_db_int.h" 1 >/* Copyright (C) 2013 Maxim Zakharov. All rights reserved. > Copyright (C) 2003-2012 Datapark corp. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_DB_INT_H >#define _DPS_DB_INT_H > >#if 0 /* expanded by -frewrite-includes */ >#include <limits.h> >#endif /* expanded by -frewrite-includes */ ># 24 "../include/dps_db_int.h" > >typedef struct { > dps_uint8 stamp; > dps_uint4 cmd; > dps_uint4 nwords; > urlid_t url_id; >} DPS_LOGD_CMD; > >typedef struct { > dps_uint4 wrd_id; > dps_uint4 coord; >} DPS_LOGD_WRD; > >typedef struct { > time_t stamp; > urlid_t url_id; > dps_uint4 wrd_id; > dps_uint4 coord; >} DPS_LOGWORD; > >typedef struct { > time_t stamp; > urlid_t url_id; >} DPS_LOGDEL; > >/************************** Logd stuff **************************/ >/*#define DPS_MAX_LOG 4096*/ /* should be power of 2 */ >/*#define DPS_MAX_WRD 1024*/ /* 256 => 4Kb */ >/*#define DPS_MAX_DEL 1024*/ >#define DPS_INF_DEL 11 > >#define open_flags O_WRONLY|O_CREAT|O_APPEND|DPS_BINARY >#define open_perm DPS_IWRITE > >typedef struct{ > DPS_LOGWORD *data; > DPS_LOGDEL *del_buf; > size_t nrec; > size_t ndel; >} dps_wrd_buf; > >typedef struct { > dps_wrd_buf *wrd_buf; > size_t cur_del_buf; >} DPS_LOGD; > > >#if (HAVE_DP_MYSQL) > >#if 0 /* expanded by -frewrite-includes */ >#include <mysql.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/mysql/mysql.h" 1 >/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; version 2 of the License. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ > >/* > This file defines the client API to MySQL and also the ABI of the > dynamically linked libmysqlclient. > > The ABI should never be changed in a released product of MySQL, > thus you need to take great care when changing the file. In case > the file is changed so the ABI is broken, you must also update > the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake >*/ > >#ifndef _mysql_h >#define _mysql_h > >#ifdef _AIX /* large-file support will break without this */ >#if 0 /* expanded by -frewrite-includes */ >#include <standards.h> >#endif /* expanded by -frewrite-includes */ ># 31 "/usr/local/include/mysql/mysql.h" >#endif ># 32 "/usr/local/include/mysql/mysql.h" > >#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */ >#undef WIN >#undef _WIN >#undef _WIN32 >#undef _WIN64 >#undef __WIN__ >#endif ># 40 "/usr/local/include/mysql/mysql.h" > >#ifdef __cplusplus >extern "C" { >#endif ># 44 "/usr/local/include/mysql/mysql.h" > >#ifndef _global_h /* If not standard header */ >#ifndef MYSQL_ABI_CHECK >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 48 "/usr/local/include/mysql/mysql.h" >#endif ># 49 "/usr/local/include/mysql/mysql.h" >#ifdef __LCC__ >#if 0 /* expanded by -frewrite-includes */ >#include <winsock2.h> /* For windows */ >#endif /* expanded by -frewrite-includes */ ># 51 "/usr/local/include/mysql/mysql.h" >#endif ># 52 "/usr/local/include/mysql/mysql.h" >typedef char my_bool; >#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) >#define __WIN__ >#endif ># 56 "/usr/local/include/mysql/mysql.h" >#if !defined(__WIN__) >#define STDCALL >#else ># 59 "/usr/local/include/mysql/mysql.h" >#define STDCALL __stdcall >#endif ># 61 "/usr/local/include/mysql/mysql.h" > >#ifndef my_socket_defined >#ifdef __WIN__ >#define my_socket SOCKET >#else ># 66 "/usr/local/include/mysql/mysql.h" >typedef int my_socket; >#endif /* __WIN__ */ ># 68 "/usr/local/include/mysql/mysql.h" >#endif /* my_socket_defined */ ># 69 "/usr/local/include/mysql/mysql.h" >#endif /* _global_h */ ># 70 "/usr/local/include/mysql/mysql.h" > >#if 0 /* expanded by -frewrite-includes */ >#include "mysql_version.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/mysql/mysql_version.h" 1 >/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB > & Detron HB, 1996, 1999-2004, 2007 MySQL AB. > This file is public domain and comes with NO WARRANTY of any kind >*/ > >/* Version numbers for protocol & mysqld */ > >#ifndef _mysql_version_h >#define _mysql_version_h >#ifdef _CUSTOMCONFIG_ >#if 0 /* expanded by -frewrite-includes */ >#include <custom_conf.h> >#endif /* expanded by -frewrite-includes */ ># 12 "/usr/local/include/mysql/mysql_version.h" >#else ># 13 "/usr/local/include/mysql/mysql_version.h" >#define PROTOCOL_VERSION 10 >#define MYSQL_SERVER_VERSION "5.5.46" >#define MYSQL_BASE_VERSION "mysqld-5.5" >#define MYSQL_SERVER_SUFFIX_DEF "" >#define FRM_VER 6 >#define MYSQL_VERSION_ID 50546 >#define MYSQL_PORT 3306 >#define MYSQL_PORT_DEFAULT 0 >#define MYSQL_UNIX_ADDR "/tmp/mysql.sock" >#define MYSQL_CONFIG_NAME "my" >#define MYSQL_COMPILATION_COMMENT "Source distribution" > >/* mysqld compile time options */ >#endif /* _CUSTOMCONFIG_ */ ># 27 "/usr/local/include/mysql/mysql_version.h" > >#ifndef LICENSE >#define LICENSE GPL >#endif /* LICENSE */ ># 31 "/usr/local/include/mysql/mysql_version.h" > >#endif /* _mysql_version_h */ ># 33 "/usr/local/include/mysql/mysql_version.h" ># 72 "/usr/local/include/mysql/mysql.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "mysql_com.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/mysql/mysql_com.h" 1 >/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; version 2 of the License. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ > >/* >** Common definition between mysql server & client >*/ > >#ifndef _mysql_com_h >#define _mysql_com_h > >#define HOSTNAME_LENGTH 60 >#define SYSTEM_CHARSET_MBMAXLEN 3 >#define NAME_CHAR_LEN 64 /* Field/table name length */ >#define USERNAME_CHAR_LENGTH 16 >#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) >#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) > >#define MYSQL_AUTODETECT_CHARSET_NAME "auto" > >#define SERVER_VERSION_LENGTH 60 >#define SQLSTATE_LENGTH 5 > >/* > Maximum length of comments >*/ >#define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 characters */ >#define TABLE_COMMENT_MAXLEN 2048 >#define COLUMN_COMMENT_MAXLEN 1024 >#define INDEX_COMMENT_MAXLEN 1024 > >/* > USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain > username and hostname parts of the user identifier with trailing zero in > MySQL standard format: > user_name_part@host_name_part\0 >*/ >#define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2 > >#define LOCAL_HOST "localhost" >#define LOCAL_HOST_NAMEDPIPE "." > > >#if defined(__WIN__) && !defined( _CUSTOMCONFIG_) >#define MYSQL_NAMEDPIPE "MySQL" >#define MYSQL_SERVICENAME "MySQL" >#endif /* __WIN__ */ ># 59 "/usr/local/include/mysql/mysql_com.h" > >/* > You should add new commands to the end of this list, otherwise old > servers won't be able to handle them as 'unsupported'. >*/ > >enum enum_server_command >{ > COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, > COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, > COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, > COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, > COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, > COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, > COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, > /* don't forget to update const char *command_name[] in sql_parse.cc */ > > /* Must be last */ > COM_END >}; > > >/* > Length of random string sent by server on handshake; this is also length of > obfuscated password, recieved from client >*/ >#define SCRAMBLE_LENGTH 20 >#define SCRAMBLE_LENGTH_323 8 >/* length of password stored in the db: new passwords are preceeded with '*' */ >#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1) >#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2) > > >#define NOT_NULL_FLAG 1 /* Field can't be NULL */ >#define PRI_KEY_FLAG 2 /* Field is part of a primary key */ >#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */ >#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */ >#define BLOB_FLAG 16 /* Field is a blob */ >#define UNSIGNED_FLAG 32 /* Field is unsigned */ >#define ZEROFILL_FLAG 64 /* Field is zerofill */ >#define BINARY_FLAG 128 /* Field is binary */ > >/* The following are only sent to new clients */ >#define ENUM_FLAG 256 /* field is an enum */ >#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ >#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ >#define SET_FLAG 2048 /* field is a set */ >#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */ >#define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */ >#define NUM_FLAG 32768 /* Field is num (for clients) */ >#define PART_KEY_FLAG 16384 /* Intern; Part of some key */ >#define GROUP_FLAG 32768 /* Intern: Group field */ >#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ >#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ >#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */ >#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ >#define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */ >#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */ >#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23, > reserved by MySQL Cluster */ >#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25, > reserved by MySQL Cluster */ > >#define REFRESH_GRANT 1 /* Refresh grant tables */ >#define REFRESH_LOG 2 /* Start on new log file */ >#define REFRESH_TABLES 4 /* close all tables */ >#define REFRESH_HOSTS 8 /* Flush host cache */ >#define REFRESH_STATUS 16 /* Flush status variables */ >#define REFRESH_THREADS 32 /* Flush thread cache */ >#define REFRESH_SLAVE 64 /* Reset master info and restart slave > thread */ >#define REFRESH_MASTER 128 /* Remove all bin logs in the index > and truncate the index */ >#define REFRESH_ERROR_LOG 256 /* Rotate only the erorr log */ >#define REFRESH_ENGINE_LOG 512 /* Flush all storage engine logs */ >#define REFRESH_BINARY_LOG 1024 /* Flush the binary log */ >#define REFRESH_RELAY_LOG 2048 /* Flush the relay log */ >#define REFRESH_GENERAL_LOG 4096 /* Flush the general log */ >#define REFRESH_SLOW_LOG 8192 /* Flush the slow query log */ > >/* The following can't be set with mysql_refresh() */ >#define REFRESH_READ_LOCK 16384 /* Lock tables for read */ >#define REFRESH_FAST 32768 /* Intern flag */ > >/* RESET (remove all queries) from query cache */ >#define REFRESH_QUERY_CACHE 65536 >#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */ >#define REFRESH_DES_KEY_FILE 0x40000L >#define REFRESH_USER_RESOURCES 0x80000L > >#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */ >#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */ >#define CLIENT_LONG_FLAG 4 /* Get all column flags */ >#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */ >#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */ >#define CLIENT_COMPRESS 32 /* Can use compression protocol */ >#define CLIENT_ODBC 64 /* Odbc client */ >#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ >#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ >#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */ >#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */ >#define CLIENT_SSL 2048 /* Switch to SSL after handshake */ >#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ >#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */ >#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ >#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ >#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */ >#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ >#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */ > >#define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */ > >#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) >#define CLIENT_REMEMBER_OPTIONS (1UL << 31) > >#ifdef HAVE_COMPRESS >#define CAN_CLIENT_COMPRESS CLIENT_COMPRESS >#else ># 177 "/usr/local/include/mysql/mysql_com.h" >#define CAN_CLIENT_COMPRESS 0 >#endif ># 179 "/usr/local/include/mysql/mysql_com.h" > >/* Gather all possible capabilites (flags) supported by the server */ >#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \ > CLIENT_FOUND_ROWS | \ > CLIENT_LONG_FLAG | \ > CLIENT_CONNECT_WITH_DB | \ > CLIENT_NO_SCHEMA | \ > CLIENT_COMPRESS | \ > CLIENT_ODBC | \ > CLIENT_LOCAL_FILES | \ > CLIENT_IGNORE_SPACE | \ > CLIENT_PROTOCOL_41 | \ > CLIENT_INTERACTIVE | \ > CLIENT_SSL | \ > CLIENT_IGNORE_SIGPIPE | \ > CLIENT_TRANSACTIONS | \ > CLIENT_RESERVED | \ > CLIENT_SECURE_CONNECTION | \ > CLIENT_MULTI_STATEMENTS | \ > CLIENT_MULTI_RESULTS | \ > CLIENT_PS_MULTI_RESULTS | \ > CLIENT_SSL_VERIFY_SERVER_CERT | \ > CLIENT_REMEMBER_OPTIONS | \ > CLIENT_PLUGIN_AUTH) > >/* > Switch off the flags that are optional and depending on build flags > If any of the optional flags is supported by the build it will be switched > on before sending to the client during the connection handshake. >*/ >#define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \ > & ~CLIENT_COMPRESS) \ > & ~CLIENT_SSL_VERIFY_SERVER_CERT) > >/** > Is raised when a multi-statement transaction > has been started, either explicitly, by means > of BEGIN or COMMIT AND CHAIN, or > implicitly, by the first transactional > statement, when autocommit=off. >*/ >#define SERVER_STATUS_IN_TRANS 1 >#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ >#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ >#define SERVER_QUERY_NO_GOOD_INDEX_USED 16 >#define SERVER_QUERY_NO_INDEX_USED 32 >/** > The server was able to fulfill the clients request and opened a > read-only non-scrollable cursor for a query. This flag comes > in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. >*/ >#define SERVER_STATUS_CURSOR_EXISTS 64 >/** > This flag is sent when a read-only cursor is exhausted, in reply to > COM_STMT_FETCH command. >*/ >#define SERVER_STATUS_LAST_ROW_SENT 128 >#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */ >#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512 >/** > Sent to the client if after a prepared statement reprepare > we discovered that the new statement returns a different > number of result set columns. >*/ >#define SERVER_STATUS_METADATA_CHANGED 1024 >#define SERVER_QUERY_WAS_SLOW 2048 > >/** > To mark ResultSet containing output parameter values. >*/ >#define SERVER_PS_OUT_PARAMS 4096 > >/** > Server status flags that must be cleared when starting > execution of a new SQL statement. > Flags from this set are only added to the > current server status by the execution engine, but > never removed -- the execution engine expects them > to disappear automagically by the next command. >*/ >#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \ > SERVER_QUERY_NO_INDEX_USED|\ > SERVER_MORE_RESULTS_EXISTS|\ > SERVER_STATUS_METADATA_CHANGED |\ > SERVER_QUERY_WAS_SLOW |\ > SERVER_STATUS_DB_DROPPED |\ > SERVER_STATUS_CURSOR_EXISTS|\ > SERVER_STATUS_LAST_ROW_SENT) > >#define MYSQL_ERRMSG_SIZE 512 >#define NET_READ_TIMEOUT 30 /* Timeout on read */ >#define NET_WRITE_TIMEOUT 60 /* Timeout on write */ >#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */ > >#define ONLY_KILL_QUERY 1 > > >struct st_vio; /* Only C */ >typedef struct st_vio Vio; > >#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */ >#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */ >#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */ >#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */ >#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ >#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ >#define MAX_BLOB_WIDTH 16777216 /* Default width for blob */ > >typedef struct st_net { >#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY) > Vio *vio; > unsigned char *buff,*buff_end,*write_pos,*read_pos; > my_socket fd; /* For Perl DBI/dbd */ > /* > The following variable is set if we are doing several queries in one > command ( as in LOAD TABLE ... FROM MASTER ), > and do not want to confuse the client with OK at the wrong time > */ > unsigned long remain_in_buf,length, buf_length, where_b; > unsigned long max_packet,max_packet_size; > unsigned int pkt_nr,compress_pkt_nr; > unsigned int write_timeout, read_timeout, retry_count; > int fcntl; > unsigned int *return_status; > unsigned char reading_or_writing; > char save_char; > my_bool unused1; /* Please remove with the next incompatible ABI change. */ > my_bool unused2; /* Please remove with the next incompatible ABI change */ > my_bool compress; > my_bool unused3; /* Please remove with the next incompatible ABI change. */ > /* > Pointer to query object in query cache, do not equal NULL (0) for > queries in cache that have not stored its results yet > */ >#endif ># 314 "/usr/local/include/mysql/mysql_com.h" > /* > Unused, please remove with the next incompatible ABI change. > */ > unsigned char *unused; > unsigned int last_errno; > unsigned char error; > my_bool unused4; /* Please remove with the next incompatible ABI change. */ > my_bool unused5; /* Please remove with the next incompatible ABI change. */ > /** Client library error message buffer. Actually belongs to struct MYSQL. */ > char last_error[MYSQL_ERRMSG_SIZE]; > /** Client library sqlstate buffer. Set along with the error message. */ > char sqlstate[SQLSTATE_LENGTH+1]; > void *extension; >#if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) > /* > Controls whether a big packet should be skipped. > > Initially set to FALSE by default. Unauthenticated sessions must have > this set to FALSE so that the server can't be tricked to read packets > indefinitely. > */ > my_bool skip_big_packet; >#endif ># 337 "/usr/local/include/mysql/mysql_com.h" >} NET; > > >#define packet_error (~(unsigned long) 0) > >enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, > MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, > MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, > MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, > MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, > MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, > MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, > MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, > MYSQL_TYPE_BIT, > MYSQL_TYPE_NEWDECIMAL=246, > MYSQL_TYPE_ENUM=247, > MYSQL_TYPE_SET=248, > MYSQL_TYPE_TINY_BLOB=249, > MYSQL_TYPE_MEDIUM_BLOB=250, > MYSQL_TYPE_LONG_BLOB=251, > MYSQL_TYPE_BLOB=252, > MYSQL_TYPE_VAR_STRING=253, > MYSQL_TYPE_STRING=254, > MYSQL_TYPE_GEOMETRY=255 > >}; > >/* For backward compatibility */ >#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS >#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL >#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL >#define FIELD_TYPE_TINY MYSQL_TYPE_TINY >#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT >#define FIELD_TYPE_LONG MYSQL_TYPE_LONG >#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT >#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE >#define FIELD_TYPE_NULL MYSQL_TYPE_NULL >#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP >#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG >#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24 >#define FIELD_TYPE_DATE MYSQL_TYPE_DATE >#define FIELD_TYPE_TIME MYSQL_TYPE_TIME >#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME >#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR >#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE >#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM >#define FIELD_TYPE_SET MYSQL_TYPE_SET >#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB >#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB >#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB >#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB >#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING >#define FIELD_TYPE_STRING MYSQL_TYPE_STRING >#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY >#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM >#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY >#define FIELD_TYPE_BIT MYSQL_TYPE_BIT > > >/* Shutdown/kill enums and constants */ > >/* Bits for THD::killable. */ >#define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0) >#define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1) >#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2) >#define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3) > >enum mysql_enum_shutdown_level { > /* > We want levels to be in growing order of hardness (because we use number > comparisons). Note that DEFAULT does not respect the growing property, but > it's ok. > */ > SHUTDOWN_DEFAULT = 0, > /* wait for existing connections to finish */ > SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT, > /* wait for existing trans to finish */ > SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS, > /* wait for existing updates to finish (=> no partial MyISAM update) */ > SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE, > /* flush InnoDB buffers and other storage engines' buffers*/ > SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), > /* don't flush InnoDB buffers, flush other storage engines' buffers*/ > SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1, > /* Now the 2 levels of the KILL command */ >#if MYSQL_VERSION_ID >= 50000 > KILL_QUERY= 254, >#endif ># 425 "/usr/local/include/mysql/mysql_com.h" > KILL_CONNECTION= 255 >}; > > >enum enum_cursor_type >{ > CURSOR_TYPE_NO_CURSOR= 0, > CURSOR_TYPE_READ_ONLY= 1, > CURSOR_TYPE_FOR_UPDATE= 2, > CURSOR_TYPE_SCROLLABLE= 4 >}; > > >/* options for mysql_set_option */ >enum enum_mysql_set_option >{ > MYSQL_OPTION_MULTI_STATEMENTS_ON, > MYSQL_OPTION_MULTI_STATEMENTS_OFF >}; > >#define net_new_transaction(net) ((net)->pkt_nr=0) > >#ifdef __cplusplus >extern "C" { >#endif ># 450 "/usr/local/include/mysql/mysql_com.h" > >my_bool my_net_init(NET *net, Vio* vio); >void my_net_local_init(NET *net); >void net_end(NET *net); > void net_clear(NET *net, my_bool clear_buffer); >my_bool net_realloc(NET *net, size_t length); >my_bool net_flush(NET *net); >my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); >my_bool net_write_command(NET *net,unsigned char command, > const unsigned char *header, size_t head_len, > const unsigned char *packet, size_t len); >int net_real_write(NET *net,const unsigned char *packet, size_t len); >unsigned long my_net_read(NET *net); > >#ifdef _global_h >void my_net_set_write_timeout(NET *net, uint timeout); >void my_net_set_read_timeout(NET *net, uint timeout); >#endif ># 468 "/usr/local/include/mysql/mysql_com.h" > >struct sockaddr; >int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, > unsigned int timeout); > >struct rand_struct { > unsigned long seed1,seed2,max_value; > double max_value_dbl; >}; > >#ifdef __cplusplus >} >#endif ># 481 "/usr/local/include/mysql/mysql_com.h" > > /* The following is for user defined functions */ > >enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, > DECIMAL_RESULT}; > >typedef struct st_udf_args >{ > unsigned int arg_count; /* Number of arguments */ > enum Item_result *arg_type; /* Pointer to item_results */ > char **args; /* Pointer to argument */ > unsigned long *lengths; /* Length of string arguments */ > char *maybe_null; /* Set to 1 for all maybe_null args */ > char **attributes; /* Pointer to attribute name */ > unsigned long *attribute_lengths; /* Length of attribute arguments */ > void *extension; >} UDF_ARGS; > > /* This holds information about the result */ > >typedef struct st_udf_init >{ > my_bool maybe_null; /* 1 if function can return NULL */ > unsigned int decimals; /* for real functions */ > unsigned long max_length; /* For string functions */ > char *ptr; /* free pointer for function data */ > my_bool const_item; /* 1 if function always returns the same value */ > void *extension; >} UDF_INIT; >/* > TODO: add a notion for determinism of the UDF. > See Item_udf_func::update_used_tables () >*/ > > /* Constants when using compression */ >#define NET_HEADER_SIZE 4 /* standard header size */ >#define COMP_HEADER_SIZE 3 /* compression header extra size */ > > /* Prototypes to password functions */ > >#ifdef __cplusplus >extern "C" { >#endif ># 524 "/usr/local/include/mysql/mysql_com.h" > >/* > These functions are used for authentication by client and server and > implemented in sql/password.c >*/ > >void randominit(struct rand_struct *, unsigned long seed1, > unsigned long seed2); >double my_rnd(struct rand_struct *); >void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); > >void hash_password(unsigned long *to, const char *password, unsigned int password_len); >void make_scrambled_password_323(char *to, const char *password); >void scramble_323(char *to, const char *message, const char *password); >my_bool check_scramble_323(const unsigned char *reply, const char *message, > unsigned long *salt); >void get_salt_from_password_323(unsigned long *res, const char *password); >void make_password_from_salt_323(char *to, const unsigned long *salt); > >void make_scrambled_password(char *to, const char *password); >void scramble(char *to, const char *message, const char *password); >my_bool check_scramble(const unsigned char *reply, const char *message, > const unsigned char *hash_stage2); >void get_salt_from_password(unsigned char *res, const char *password); >void make_password_from_salt(char *to, const unsigned char *hash_stage2); >char *octet2hex(char *to, const char *str, unsigned int len); > >/* end of password.c */ > >char *get_tty_password(const char *opt_message); >const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); > >/* Some other useful functions */ > >my_bool my_thread_init(void); >void my_thread_end(void); > >#ifdef _global_h >ulong STDCALL net_field_length(uchar **packet); >my_ulonglong net_field_length_ll(uchar **packet); >uchar *net_store_length(uchar *pkg, ulonglong length); >#endif ># 566 "/usr/local/include/mysql/mysql_com.h" > >#ifdef __cplusplus >} >#endif ># 570 "/usr/local/include/mysql/mysql_com.h" > >#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ >#define MYSQL_STMT_HEADER 4 >#define MYSQL_LONG_DATA_HEADER 6 > >#define NOT_FIXED_DEC 31 >#endif ># 577 "/usr/local/include/mysql/mysql_com.h" ># 73 "/usr/local/include/mysql/mysql.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "mysql_time.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/mysql/mysql_time.h" 1 >/* Copyright (c) 2004, 2006 MySQL AB > Use is subject to license terms > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; version 2 of the License. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ > >#ifndef _mysql_time_h_ >#define _mysql_time_h_ > >/* > Time declarations shared between the server and client API: > you should not add anything to this header unless it's used > (and hence should be visible) in mysql.h. > If you're looking for a place to add new time-related declaration, > it's most likely my_time.h. See also "C API Handling of Date > and Time Values" chapter in documentation. >*/ > >enum enum_mysql_timestamp_type >{ > MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, > MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 >}; > > >/* > Structure which is used to represent datetime values inside MySQL. > > We assume that values in this structure are normalized, i.e. year <= 9999, > month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions > in server such as my_system_gmt_sec() or make_time() family of functions > rely on this (actually now usage of make_*() family relies on a bit weaker > restriction). Also functions that produce MYSQL_TIME as result ensure this. > There is one exception to this rule though if this structure holds time > value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold > bigger values. >*/ >typedef struct st_mysql_time >{ > unsigned int year, month, day, hour, minute, second; > unsigned long second_part; > my_bool neg; > enum enum_mysql_timestamp_type time_type; >} MYSQL_TIME; > >#endif /* _mysql_time_h_ */ ># 57 "/usr/local/include/mysql/mysql_time.h" ># 74 "/usr/local/include/mysql/mysql.h" 2 > >#if 0 /* expanded by -frewrite-includes */ >#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/mysql/my_list.h" 1 >/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; version 2 of the License. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ > >#ifndef _list_h_ >#define _list_h_ > >#ifdef __cplusplus >extern "C" { >#endif ># 22 "/usr/local/include/mysql/my_list.h" > >typedef struct st_list { > struct st_list *prev,*next; > void *data; >} LIST; > >typedef int (*list_walk_action)(void *,void *); > >extern LIST *list_add(LIST *root,LIST *element); >extern LIST *list_delete(LIST *root,LIST *element); >extern LIST *list_cons(void *data,LIST *root); >extern LIST *list_reverse(LIST *root); >extern void list_free(LIST *root,unsigned int free_data); >extern unsigned int list_length(LIST *); >extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); > >#define list_rest(a) ((a)->next) >#define list_push(a,b) (a)=list_cons((b),(a)) >#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); } > >#ifdef __cplusplus >} >#endif ># 45 "/usr/local/include/mysql/my_list.h" >#endif ># 46 "/usr/local/include/mysql/my_list.h" ># 76 "/usr/local/include/mysql/mysql.h" 2 > >extern unsigned int mysql_port; >extern char *mysql_unix_port; > >#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */ >#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ > >#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) >#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) >#define IS_BLOB(n) ((n) & BLOB_FLAG) >/** > Returns true if the value is a number which does not need quotes for > the sql_lex.cc parser to parse correctly. >*/ >#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL) >#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING) > > >typedef struct st_mysql_field { > char *name; /* Name of column */ > char *org_name; /* Original column name, if an alias */ > char *table; /* Table of column if column was a field */ > char *org_table; /* Org table name, if table was an alias */ > char *db; /* Database for table */ > char *catalog; /* Catalog for table */ > char *def; /* Default value (set by mysql_list_fields) */ > unsigned long length; /* Width of column (create length) */ > unsigned long max_length; /* Max width for selected set */ > unsigned int name_length; > unsigned int org_name_length; > unsigned int table_length; > unsigned int org_table_length; > unsigned int db_length; > unsigned int catalog_length; > unsigned int def_length; > unsigned int flags; /* Div flags */ > unsigned int decimals; /* Number of decimals in field */ > unsigned int charsetnr; /* Character set */ > enum enum_field_types type; /* Type of field. See mysql_com.h for types */ > void *extension; >} MYSQL_FIELD; > >typedef char **MYSQL_ROW; /* return data as array of strings */ >typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ > >#ifndef _global_h >#if defined(NO_CLIENT_LONG_LONG) >typedef unsigned long my_ulonglong; >#elif defined (__WIN__) ># 125 "/usr/local/include/mysql/mysql.h" >typedef unsigned __int64 my_ulonglong; >#else ># 127 "/usr/local/include/mysql/mysql.h" >typedef unsigned long long my_ulonglong; >#endif ># 129 "/usr/local/include/mysql/mysql.h" >#endif ># 130 "/usr/local/include/mysql/mysql.h" > >#if 0 /* expanded by -frewrite-includes */ >#include "typelib.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/mysql/typelib.h" 1 >/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; version 2 of the License. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ > > >#ifndef _typelib_h >#define _typelib_h > >#if 0 /* expanded by -frewrite-includes */ >#include "my_alloc.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/mysql/my_alloc.h" 1 >/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; version 2 of the License. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ > >/* > Data structures for mysys/my_alloc.c (root memory allocator) >*/ > >#ifndef _my_alloc_h >#define _my_alloc_h > >#define ALLOC_MAX_BLOCK_TO_DROP 4096 >#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 > >#ifdef __cplusplus >extern "C" { >#endif ># 29 "/usr/local/include/mysql/my_alloc.h" > >typedef struct st_used_mem >{ /* struct for once_alloc (block) */ > struct st_used_mem *next; /* Next block in use */ > unsigned int left; /* memory left in block */ > unsigned int size; /* size of block */ >} USED_MEM; > > >typedef struct st_mem_root >{ > USED_MEM *free; /* blocks with free memory in it */ > USED_MEM *used; /* blocks almost without free memory */ > USED_MEM *pre_alloc; /* preallocated block */ > /* if block have less memory it will be put in 'used' list */ > size_t min_malloc; > size_t block_size; /* initial block size */ > unsigned int block_num; /* allocated blocks counter */ > /* > first free block in queue test counter (if it exceed > MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) > */ > unsigned int first_block_usage; > > void (*error_handler)(void); >} MEM_ROOT; > >#ifdef __cplusplus >} >#endif ># 59 "/usr/local/include/mysql/my_alloc.h" > >#endif ># 61 "/usr/local/include/mysql/my_alloc.h" ># 21 "/usr/local/include/mysql/typelib.h" 2 > >typedef struct st_typelib { /* Different types saved here */ > unsigned int count; /* How many types */ > const char *name; /* Name of typelib */ > const char **type_names; > unsigned int *type_lengths; >} TYPELIB; > >extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); >extern int find_type_or_exit(const char *x, TYPELIB *typelib, > const char *option); >#define FIND_TYPE_BASIC 0 >/** makes @c find_type() require the whole name, no prefix */ >#define FIND_TYPE_NO_PREFIX (1 << 0) >/** always implicitely on, so unused, but old code may pass it */ >#define FIND_TYPE_NO_OVERWRITE (1 << 1) >/** makes @c find_type() accept a number */ >#define FIND_TYPE_ALLOW_NUMBER (1 << 2) >/** makes @c find_type() treat ',' as terminator */ >#define FIND_TYPE_COMMA_TERM (1 << 3) > >extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); >extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); >extern const char *get_type(TYPELIB *typelib,unsigned int nr); >extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); > >extern TYPELIB sql_protocol_typelib; > >my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name, > my_ulonglong cur_set, my_ulonglong default_set, > const char *str, unsigned int length, > char **err_pos, unsigned int *err_len); > >#endif /* _typelib_h */ ># 55 "/usr/local/include/mysql/typelib.h" ># 132 "/usr/local/include/mysql/mysql.h" 2 > >#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0) > >/* backward compatibility define - to be removed eventually */ >#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED > >typedef struct st_mysql_rows { > struct st_mysql_rows *next; /* list of rows */ > MYSQL_ROW data; > unsigned long length; >} MYSQL_ROWS; > >typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ > >#if 0 /* expanded by -frewrite-includes */ >#include "my_alloc.h" >#endif /* expanded by -frewrite-includes */ ># 147 "/usr/local/include/mysql/mysql.h" > >typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; >typedef struct st_mysql_data { > MYSQL_ROWS *data; > struct embedded_query_result *embedded_info; > MEM_ROOT alloc; > my_ulonglong rows; > unsigned int fields; > /* extra info for embedded library */ > void *extension; >} MYSQL_DATA; > >enum mysql_option >{ > MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, > MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, > MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, > MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, > MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, > MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, > MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, > MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, > MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, > MYSQL_ENABLE_CLEARTEXT_PLUGIN >}; > >/** > @todo remove the "extension", move st_mysql_options completely > out of mysql.h >*/ >struct st_mysql_options_extention; > >struct st_mysql_options { > unsigned int connect_timeout, read_timeout, write_timeout; > unsigned int port, protocol; > unsigned long client_flag; > char *host,*user,*password,*unix_socket,*db; > struct st_dynamic_array *init_commands; > char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; > char *ssl_key; /* PEM key file */ > char *ssl_cert; /* PEM cert file */ > char *ssl_ca; /* PEM CA file */ > char *ssl_capath; /* PEM directory of CA-s? */ > char *ssl_cipher; /* cipher to use */ > char *shared_memory_base_name; > unsigned long max_allowed_packet; > my_bool use_ssl; /* if to use SSL or not */ > my_bool compress,named_pipe; > my_bool unused1; > my_bool unused2; > my_bool unused3; > my_bool unused4; > enum mysql_option methods_to_use; > char *client_ip; > /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */ > my_bool secure_auth; > /* 0 - never report, 1 - always report (default) */ > my_bool report_data_truncation; > > /* function pointers for local infile support */ > int (*local_infile_init)(void **, const char *, void *); > int (*local_infile_read)(void *, char *, unsigned int); > void (*local_infile_end)(void *); > int (*local_infile_error)(void *, char *, unsigned int); > void *local_infile_userdata; > struct st_mysql_options_extention *extension; >}; > >enum mysql_status >{ > MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT, > MYSQL_STATUS_STATEMENT_GET_RESULT >}; > >enum mysql_protocol_type >{ > MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, > MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY >}; > >typedef struct character_set >{ > unsigned int number; /* character set number */ > unsigned int state; /* character set state */ > const char *csname; /* collation name */ > const char *name; /* character set name */ > const char *comment; /* comment */ > const char *dir; /* character set directory */ > unsigned int mbminlen; /* min. length for multibyte strings */ > unsigned int mbmaxlen; /* max. length for multibyte strings */ >} MY_CHARSET_INFO; > >struct st_mysql_methods; >struct st_mysql_stmt; > >typedef struct st_mysql >{ > NET net; /* Communication parameters */ > unsigned char *connector_fd; /* ConnectorFd for SSL */ > char *host,*user,*passwd,*unix_socket,*server_version,*host_info; > char *info, *db; > struct charset_info_st *charset; > MYSQL_FIELD *fields; > MEM_ROOT field_alloc; > my_ulonglong affected_rows; > my_ulonglong insert_id; /* id if insert on table with NEXTNR */ > my_ulonglong extra_info; /* Not used */ > unsigned long thread_id; /* Id for connection in server */ > unsigned long packet_length; > unsigned int port; > unsigned long client_flag,server_capabilities; > unsigned int protocol_version; > unsigned int field_count; > unsigned int server_status; > unsigned int server_language; > unsigned int warning_count; > struct st_mysql_options options; > enum mysql_status status; > my_bool free_me; /* If free in mysql_close */ > my_bool reconnect; /* set to 1 if automatic reconnect */ > > /* session-wide random string */ > char scramble[SCRAMBLE_LENGTH+1]; > my_bool unused1; > void *unused2, *unused3, *unused4, *unused5; > > LIST *stmts; /* list of all statements */ > const struct st_mysql_methods *methods; > void *thd; > /* > Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag > from mysql_stmt_close if close had to cancel result set of this object. > */ > my_bool *unbuffered_fetch_owner; > /* needed for embedded server - no net buffer to store the 'info' */ > char *info_buffer; > void *extension; >} MYSQL; > > >typedef struct st_mysql_res { > my_ulonglong row_count; > MYSQL_FIELD *fields; > MYSQL_DATA *data; > MYSQL_ROWS *data_cursor; > unsigned long *lengths; /* column lengths of current row */ > MYSQL *handle; /* for unbuffered reads */ > const struct st_mysql_methods *methods; > MYSQL_ROW row; /* If unbuffered read */ > MYSQL_ROW current_row; /* buffer to current row */ > MEM_ROOT field_alloc; > unsigned int field_count, current_field; > my_bool eof; /* Used by mysql_fetch_row */ > /* mysql_stmt_close() had to cancel this result */ > my_bool unbuffered_fetch_cancelled; > void *extension; >} MYSQL_RES; > > >#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) >#define MYSQL_CLIENT >#endif ># 309 "/usr/local/include/mysql/mysql.h" > > >typedef struct st_mysql_parameters >{ > unsigned long *p_max_allowed_packet; > unsigned long *p_net_buffer_length; > void *extension; >} MYSQL_PARAMETERS; > >#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) >#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) >#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) >#endif ># 322 "/usr/local/include/mysql/mysql.h" > >/* > Set up and bring down the server; to ensure that applications will > work when linked against either the standard client library or the > embedded server library, these functions should be called. >*/ >int STDCALL mysql_server_init(int argc, char **argv, char **groups); >void STDCALL mysql_server_end(void); > >/* > mysql_server_init/end need to be called when using libmysqld or > libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so > you don't need to call it explicitely; but you need to call > mysql_server_end() to free memory). The names are a bit misleading > (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general > names which suit well whether you're using libmysqld or libmysqlclient. We > intend to promote these aliases over the mysql_server* ones. >*/ >#define mysql_library_init mysql_server_init >#define mysql_library_end mysql_server_end > >MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); > >/* > Set up and bring down a thread; these function should be called > for each thread in an application which opens at least one MySQL > connection. All uses of the connection(s) should be between these > function calls. >*/ >my_bool STDCALL mysql_thread_init(void); >void STDCALL mysql_thread_end(void); > >/* > Functions to get information from the MYSQL and MYSQL_RES structures > Should definitely be used if one uses shared libraries. >*/ > >my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res); >unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); >my_bool STDCALL mysql_eof(MYSQL_RES *res); >MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, > unsigned int fieldnr); >MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); >MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res); >MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res); > >unsigned int STDCALL mysql_field_count(MYSQL *mysql); >my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql); >my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql); >unsigned int STDCALL mysql_errno(MYSQL *mysql); >const char * STDCALL mysql_error(MYSQL *mysql); >const char *STDCALL mysql_sqlstate(MYSQL *mysql); >unsigned int STDCALL mysql_warning_count(MYSQL *mysql); >const char * STDCALL mysql_info(MYSQL *mysql); >unsigned long STDCALL mysql_thread_id(MYSQL *mysql); >const char * STDCALL mysql_character_set_name(MYSQL *mysql); >int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); > >MYSQL * STDCALL mysql_init(MYSQL *mysql); >my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, > const char *cert, const char *ca, > const char *capath, const char *cipher); >const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql); >my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, > const char *passwd, const char *db); >MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, > const char *user, > const char *passwd, > const char *db, > unsigned int port, > const char *unix_socket, > unsigned long clientflag); >int STDCALL mysql_select_db(MYSQL *mysql, const char *db); >int STDCALL mysql_query(MYSQL *mysql, const char *q); >int STDCALL mysql_send_query(MYSQL *mysql, const char *q, > unsigned long length); >int STDCALL mysql_real_query(MYSQL *mysql, const char *q, > unsigned long length); >MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); >MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); > >void STDCALL mysql_get_character_set_info(MYSQL *mysql, > MY_CHARSET_INFO *charset); > >/* local infile support */ > >#define LOCAL_INFILE_ERROR_LEN 512 > >void >mysql_set_local_infile_handler(MYSQL *mysql, > int (*local_infile_init)(void **, const char *, > void *), > int (*local_infile_read)(void *, char *, > unsigned int), > void (*local_infile_end)(void *), > int (*local_infile_error)(void *, char*, > unsigned int), > void *); > >void >mysql_set_local_infile_default(MYSQL *mysql); > >int STDCALL mysql_shutdown(MYSQL *mysql, > enum mysql_enum_shutdown_level > shutdown_level); >int STDCALL mysql_dump_debug_info(MYSQL *mysql); >int STDCALL mysql_refresh(MYSQL *mysql, > unsigned int refresh_options); >int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); >int STDCALL mysql_set_server_option(MYSQL *mysql, > enum enum_mysql_set_option > option); >int STDCALL mysql_ping(MYSQL *mysql); >const char * STDCALL mysql_stat(MYSQL *mysql); >const char * STDCALL mysql_get_server_info(MYSQL *mysql); >const char * STDCALL mysql_get_client_info(void); >unsigned long STDCALL mysql_get_client_version(void); >const char * STDCALL mysql_get_host_info(MYSQL *mysql); >unsigned long STDCALL mysql_get_server_version(MYSQL *mysql); >unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); >MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); >MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); >MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); >int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, > const void *arg); >void STDCALL mysql_free_result(MYSQL_RES *result); >void STDCALL mysql_data_seek(MYSQL_RES *result, > my_ulonglong offset); >MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, > MYSQL_ROW_OFFSET offset); >MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, > MYSQL_FIELD_OFFSET offset); >MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); >unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); >MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); >MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, > const char *wild); >unsigned long STDCALL mysql_escape_string(char *to,const char *from, > unsigned long from_length); >unsigned long STDCALL mysql_hex_string(char *to,const char *from, > unsigned long from_length); >unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, > char *to,const char *from, > unsigned long length); >void STDCALL mysql_debug(const char *debug); >void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); >unsigned int STDCALL mysql_thread_safe(void); >my_bool STDCALL mysql_embedded(void); >my_bool STDCALL mysql_read_query_result(MYSQL *mysql); > > >/* > The following definitions are added for the enhanced > client-server protocol >*/ > >/* statement state */ >enum enum_mysql_stmt_state >{ > MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, > MYSQL_STMT_FETCH_DONE >}; > > >/* > This structure is used to define bind information, and > internally by the client library. > Public members with their descriptions are listed below > (conventionally `On input' refers to the binds given to > mysql_stmt_bind_param, `On output' refers to the binds given > to mysql_stmt_bind_result): > > buffer_type - One of the MYSQL_* types, used to describe > the host language type of buffer. > On output: if column type is different from > buffer_type, column value is automatically converted > to buffer_type before it is stored in the buffer. > buffer - On input: points to the buffer with input data. > On output: points to the buffer capable to store > output data. > The type of memory pointed by buffer must correspond > to buffer_type. See the correspondence table in > the comment to mysql_stmt_bind_param. > > The two above members are mandatory for any kind of bind. > > buffer_length - the length of the buffer. You don't have to set > it for any fixed length buffer: float, double, > int, etc. It must be set however for variable-length > types, such as BLOBs or STRINGs. > > length - On input: in case when lengths of input values > are different for each execute, you can set this to > point at a variable containining value length. This > way the value length can be different in each execute. > If length is not NULL, buffer_length is not used. > Note, length can even point at buffer_length if > you keep bind structures around while fetching: > this way you can change buffer_length before > each execution, everything will work ok. > On output: if length is set, mysql_stmt_fetch will > write column length into it. > > is_null - On input: points to a boolean variable that should > be set to TRUE for NULL values. > This member is useful only if your data may be > NULL in some but not all cases. > If your data is never NULL, is_null should be set to 0. > If your data is always NULL, set buffer_type > to MYSQL_TYPE_NULL, and is_null will not be used. > > is_unsigned - On input: used to signify that values provided for one > of numeric types are unsigned. > On output describes signedness of the output buffer. > If, taking into account is_unsigned flag, column data > is out of range of the output buffer, data for this column > is regarded truncated. Note that this has no correspondence > to the sign of result set column, if you need to find it out > use mysql_stmt_result_metadata. > error - where to write a truncation error if it is present. > possible error value is: > 0 no truncation > 1 value is out of range or buffer is too small > > Please note that MYSQL_BIND also has internals members. >*/ > >typedef struct st_mysql_bind >{ > unsigned long *length; /* output length pointer */ > my_bool *is_null; /* Pointer to null indicator */ > void *buffer; /* buffer to get/put data */ > /* set this if you want to track data truncations happened during fetch */ > my_bool *error; > unsigned char *row_ptr; /* for the current data position */ > void (*store_param_func)(NET *net, struct st_mysql_bind *param); > void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, > unsigned char **row); > void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, > unsigned char **row); > /* output buffer length, must be set when fetching str/binary */ > unsigned long buffer_length; > unsigned long offset; /* offset position for char/binary fetch */ > unsigned long length_value; /* Used if length is 0 */ > unsigned int param_number; /* For null count and error messages */ > unsigned int pack_length; /* Internal length for packed data */ > enum enum_field_types buffer_type; /* buffer type */ > my_bool error_value; /* used if error is 0 */ > my_bool is_unsigned; /* set if integer type is unsigned */ > my_bool long_data_used; /* If used with mysql_send_long_data */ > my_bool is_null_value; /* Used if is_null is 0 */ > void *extension; >} MYSQL_BIND; > > >struct st_mysql_stmt_extension; > >/* statement handler */ >typedef struct st_mysql_stmt >{ > MEM_ROOT mem_root; /* root allocations */ > LIST list; /* list to keep track of all stmts */ > MYSQL *mysql; /* connection handle */ > MYSQL_BIND *params; /* input parameters */ > MYSQL_BIND *bind; /* output parameters */ > MYSQL_FIELD *fields; /* result set metadata */ > MYSQL_DATA result; /* cached result set */ > MYSQL_ROWS *data_cursor; /* current row in cached result */ > /* > mysql_stmt_fetch() calls this function to fetch one row (it's different > for buffered, unbuffered and cursor fetch). > */ > int (*read_row_func)(struct st_mysql_stmt *stmt, > unsigned char **row); > /* copy of mysql->affected_rows after statement execution */ > my_ulonglong affected_rows; > my_ulonglong insert_id; /* copy of mysql->insert_id */ > unsigned long stmt_id; /* Id for prepared statement */ > unsigned long flags; /* i.e. type of cursor to open */ > unsigned long prefetch_rows; /* number of rows per one COM_FETCH */ > /* > Copied from mysql->server_status after execute/fetch to know > server-side cursor status for this statement. > */ > unsigned int server_status; > unsigned int last_errno; /* error code */ > unsigned int param_count; /* input parameter count */ > unsigned int field_count; /* number of columns in result set */ > enum enum_mysql_stmt_state state; /* statement state */ > char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ > char sqlstate[SQLSTATE_LENGTH+1]; > /* Types of input parameters should be sent to server */ > my_bool send_types_to_server; > my_bool bind_param_done; /* input buffers were supplied */ > unsigned char bind_result_done; /* output buffers were supplied */ > /* mysql_stmt_close() had to cancel this result */ > my_bool unbuffered_fetch_cancelled; > /* > Is set to true if we need to calculate field->max_length for > metadata fields when doing mysql_stmt_store_result. > */ > my_bool update_max_length; > struct st_mysql_stmt_extension *extension; >} MYSQL_STMT; > >enum enum_stmt_attr_type >{ > /* > When doing mysql_stmt_store_result calculate max_length attribute > of statement metadata. This is to be consistent with the old API, > where this was done automatically. > In the new API we do that only by request because it slows down > mysql_stmt_store_result sufficiently. > */ > STMT_ATTR_UPDATE_MAX_LENGTH, > /* > unsigned long with combination of cursor flags (read only, for update, > etc) > */ > STMT_ATTR_CURSOR_TYPE, > /* > Amount of rows to retrieve from server per one fetch if using cursors. > Accepts unsigned long attribute in the range 1 - ulong_max > */ > STMT_ATTR_PREFETCH_ROWS >}; > > >MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); >int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, > unsigned long length); >int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); >int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); >int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, > unsigned int column, > unsigned long offset); >int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); >unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt); >my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, > enum enum_stmt_attr_type attr_type, > const void *attr); >my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, > enum enum_stmt_attr_type attr_type, > void *attr); >my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); >my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); >my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt); >my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt); >my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); >my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, > unsigned int param_number, > const char *data, > unsigned long length); >MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt); >MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt); >unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt); >const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt); >const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt); >MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, > MYSQL_ROW_OFFSET offset); >MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt); >void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); >my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt); >my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); >my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt); >unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); > >my_bool STDCALL mysql_commit(MYSQL * mysql); >my_bool STDCALL mysql_rollback(MYSQL * mysql); >my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); >my_bool STDCALL mysql_more_results(MYSQL *mysql); >int STDCALL mysql_next_result(MYSQL *mysql); >int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt); >void STDCALL mysql_close(MYSQL *sock); > > >/* status return codes */ >#define MYSQL_NO_DATA 100 >#define MYSQL_DATA_TRUNCATED 101 > >#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) > >#ifdef USE_OLD_FUNCTIONS >MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, > const char *user, const char *passwd); >int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); >int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); >#endif ># 710 "/usr/local/include/mysql/mysql.h" >#define HAVE_MYSQL_REAL_CONNECT > >#ifdef __cplusplus >} >#endif ># 715 "/usr/local/include/mysql/mysql.h" > >#endif /* _mysql_h */ ># 717 "/usr/local/include/mysql/mysql.h" ># 74 "../include/dps_db_int.h" 2 >#define ER_DUP_ENTRY 1062 >#define ER_DUP_KEY 1022 >#define CR_SERVER_LOST 2013 >#define CR_SERVER_GONE_ERROR 2006 >#define ER_SERVER_SHUTDOWN 1053 >#endif ># 80 "../include/dps_db_int.h" > >#if (HAVE_DP_PGSQL) >#if 0 /* expanded by -frewrite-includes */ >#include "libpq-fe.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/libpq-fe.h" 1 >/*------------------------------------------------------------------------- > * > * libpq-fe.h > * This file contains definitions for structures and > * externs for functions used by frontend postgres applications. > * > * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group > * Portions Copyright (c) 1994, Regents of the University of California > * > * src/interfaces/libpq/libpq-fe.h > * > *------------------------------------------------------------------------- > */ > >#ifndef LIBPQ_FE_H >#define LIBPQ_FE_H > >#ifdef __cplusplus >extern "C" >{ >#endif ># 22 "/usr/local/include/libpq-fe.h" > >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> >#endif /* expanded by -frewrite-includes */ ># 24 "/usr/local/include/libpq-fe.h" > >/* > * postgres_ext.h defines the backend's externally visible types, > * such as Oid. > */ >#if 0 /* expanded by -frewrite-includes */ >#include "postgres_ext.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/postgres_ext.h" 1 >/*------------------------------------------------------------------------- > * > * postgres_ext.h > * > * This file contains declarations of things that are visible everywhere > * in PostgreSQL *and* are visible to clients of frontend interface libraries. > * For example, the Oid type is part of the API of libpq and other libraries. > * > * Declarations which are specific to a particular interface should > * go in the header file for that interface (such as libpq-fe.h). This > * file is only for fundamental Postgres declarations. > * > * User-written C functions don't count as "external to Postgres." > * Those function much as local modifications to the backend itself, and > * use header files that are otherwise internal to Postgres to interface > * with the backend. > * > * src/include/postgres_ext.h > * > *------------------------------------------------------------------------- > */ > >#ifndef POSTGRES_EXT_H >#define POSTGRES_EXT_H > >#if 0 /* expanded by -frewrite-includes */ >#include "pg_config_ext.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/local/include/pg_config_ext.h" 1 >/* src/include/pg_config_ext.h. Generated from pg_config_ext.h.in by configure. */ >/* > * src/include/pg_config_ext.h.in. This is generated manually, not by > * autoheader, since we want to limit which symbols get defined here. > */ > >/* Define to the name of a signed 64-bit integer type. */ >#define PG_INT64_TYPE long int ># 27 "/usr/local/include/postgres_ext.h" 2 > >/* > * Object ID is a fundamental type in Postgres. > */ >typedef unsigned int Oid; > >#ifdef __cplusplus >#define InvalidOid (Oid(0)) >#else ># 36 "/usr/local/include/postgres_ext.h" >#define InvalidOid ((Oid) 0) >#endif ># 38 "/usr/local/include/postgres_ext.h" > >#define OID_MAX UINT_MAX >/* you will need to include <limits.h> to use the above #define */ > >/* Define a signed 64-bit integer type for use in client API declarations. */ >typedef PG_INT64_TYPE pg_int64; > > >/* > * Identifiers of error message fields. Kept here to keep common > * between frontend and backend, and also to export them to libpq > * applications. > */ >#define PG_DIAG_SEVERITY 'S' >#define PG_DIAG_SQLSTATE 'C' >#define PG_DIAG_MESSAGE_PRIMARY 'M' >#define PG_DIAG_MESSAGE_DETAIL 'D' >#define PG_DIAG_MESSAGE_HINT 'H' >#define PG_DIAG_STATEMENT_POSITION 'P' >#define PG_DIAG_INTERNAL_POSITION 'p' >#define PG_DIAG_INTERNAL_QUERY 'q' >#define PG_DIAG_CONTEXT 'W' >#define PG_DIAG_SCHEMA_NAME 's' >#define PG_DIAG_TABLE_NAME 't' >#define PG_DIAG_COLUMN_NAME 'c' >#define PG_DIAG_DATATYPE_NAME 'd' >#define PG_DIAG_CONSTRAINT_NAME 'n' >#define PG_DIAG_SOURCE_FILE 'F' >#define PG_DIAG_SOURCE_LINE 'L' >#define PG_DIAG_SOURCE_FUNCTION 'R' > >#endif /* POSTGRES_EXT_H */ ># 70 "/usr/local/include/postgres_ext.h" ># 30 "/usr/local/include/libpq-fe.h" 2 > >/* > * Option flags for PQcopyResult > */ >#define PG_COPYRES_ATTRS 0x01 >#define PG_COPYRES_TUPLES 0x02 /* Implies PG_COPYRES_ATTRS */ >#define PG_COPYRES_EVENTS 0x04 >#define PG_COPYRES_NOTICEHOOKS 0x08 > >/* Application-visible enum types */ > >/* > * Although it is okay to add to these lists, values which become unused > * should never be removed, nor should constants be redefined - that would > * break compatibility with existing code. > */ > >typedef enum >{ > CONNECTION_OK, > CONNECTION_BAD, > /* Non-blocking mode only below here */ > > /* > * The existence of these should never be relied upon - they should only > * be used for user feedback or similar purposes. > */ > CONNECTION_STARTED, /* Waiting for connection to be made. */ > CONNECTION_MADE, /* Connection OK; waiting to send. */ > CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the > * postmaster. */ > CONNECTION_AUTH_OK, /* Received authentication; waiting for > * backend startup. */ > CONNECTION_SETENV, /* Negotiating environment. */ > CONNECTION_SSL_STARTUP, /* Negotiating SSL. */ > CONNECTION_NEEDED /* Internal state: connect() needed */ >} ConnStatusType; > >typedef enum >{ > PGRES_POLLING_FAILED = 0, > PGRES_POLLING_READING, /* These two indicate that one may */ > PGRES_POLLING_WRITING, /* use select before polling again. */ > PGRES_POLLING_OK, > PGRES_POLLING_ACTIVE /* unused; keep for awhile for backwards > * compatibility */ >} PostgresPollingStatusType; > >typedef enum >{ > PGRES_EMPTY_QUERY = 0, /* empty query string was executed */ > PGRES_COMMAND_OK, /* a query command that doesn't return > * anything was executed properly by the > * backend */ > PGRES_TUPLES_OK, /* a query command that returns tuples was > * executed properly by the backend, PGresult > * contains the result tuples */ > PGRES_COPY_OUT, /* Copy Out data transfer in progress */ > PGRES_COPY_IN, /* Copy In data transfer in progress */ > PGRES_BAD_RESPONSE, /* an unexpected response was recv'd from the > * backend */ > PGRES_NONFATAL_ERROR, /* notice or warning message */ > PGRES_FATAL_ERROR, /* query failed */ > PGRES_COPY_BOTH, /* Copy In/Out data transfer in progress */ > PGRES_SINGLE_TUPLE /* single tuple from larger resultset */ >} ExecStatusType; > >typedef enum >{ > PQTRANS_IDLE, /* connection idle */ > PQTRANS_ACTIVE, /* command in progress */ > PQTRANS_INTRANS, /* idle, within transaction block */ > PQTRANS_INERROR, /* idle, within failed transaction */ > PQTRANS_UNKNOWN /* cannot determine status */ >} PGTransactionStatusType; > >typedef enum >{ > PQERRORS_TERSE, /* single-line error messages */ > PQERRORS_DEFAULT, /* recommended style */ > PQERRORS_VERBOSE /* all the facts, ma'am */ >} PGVerbosity; > >/* > * PGPing - The ordering of this enum should not be altered because the > * values are exposed externally via pg_isready. > */ > >typedef enum >{ > PQPING_OK, /* server is accepting connections */ > PQPING_REJECT, /* server is alive but rejecting connections */ > PQPING_NO_RESPONSE, /* could not establish connection */ > PQPING_NO_ATTEMPT /* connection not attempted (bad params) */ >} PGPing; > >/* PGconn encapsulates a connection to the backend. > * The contents of this struct are not supposed to be known to applications. > */ >typedef struct pg_conn PGconn; > >/* PGresult encapsulates the result of a query (or more precisely, of a single > * SQL command --- a query string given to PQsendQuery can contain multiple > * commands and thus return multiple PGresult objects). > * The contents of this struct are not supposed to be known to applications. > */ >typedef struct pg_result PGresult; > >/* PGcancel encapsulates the information needed to cancel a running > * query on an existing connection. > * The contents of this struct are not supposed to be known to applications. > */ >typedef struct pg_cancel PGcancel; > >/* PGnotify represents the occurrence of a NOTIFY message. > * Ideally this would be an opaque typedef, but it's so simple that it's > * unlikely to change. > * NOTE: in Postgres 6.4 and later, the be_pid is the notifying backend's, > * whereas in earlier versions it was always your own backend's PID. > */ >typedef struct pgNotify >{ > char *relname; /* notification condition name */ > int be_pid; /* process ID of notifying server process */ > char *extra; /* notification parameter */ > /* Fields below here are private to libpq; apps should not use 'em */ > struct pgNotify *next; /* list link */ >} PGnotify; > >/* Function types for notice-handling callbacks */ >typedef void (*PQnoticeReceiver) (void *arg, const PGresult *res); >typedef void (*PQnoticeProcessor) (void *arg, const char *message); > >/* Print options for PQprint() */ >typedef char pqbool; > >typedef struct _PQprintOpt >{ > pqbool header; /* print output field headings and row count */ > pqbool align; /* fill align the fields */ > pqbool standard; /* old brain dead format */ > pqbool html3; /* output html tables */ > pqbool expanded; /* expand tables */ > pqbool pager; /* use pager for output if needed */ > char *fieldSep; /* field separator */ > char *tableOpt; /* insert to HTML <table ...> */ > char *caption; /* HTML <caption> */ > char **fieldName; /* null terminated array of replacement field > * names */ >} PQprintOpt; > >/* ---------------- > * Structure for the conninfo parameter definitions returned by PQconndefaults > * or PQconninfoParse. > * > * All fields except "val" point at static strings which must not be altered. > * "val" is either NULL or a malloc'd current-value string. PQconninfoFree() > * will release both the val strings and the PQconninfoOption array itself. > * ---------------- > */ >typedef struct _PQconninfoOption >{ > char *keyword; /* The keyword of the option */ > char *envvar; /* Fallback environment variable name */ > char *compiled; /* Fallback compiled in default value */ > char *val; /* Option's current value, or NULL */ > char *label; /* Label for field in connect dialog */ > char *dispchar; /* Indicates how to display this field in a > * connect dialog. Values are: "" Display > * entered value as is "*" Password field - > * hide value "D" Debug option - don't show > * by default */ > int dispsize; /* Field size in characters for dialog */ >} PQconninfoOption; > >/* ---------------- > * PQArgBlock -- structure for PQfn() arguments > * ---------------- > */ >typedef struct >{ > int len; > int isint; > union > { > int *ptr; /* can't use void (dec compiler barfs) */ > int integer; > } u; >} PQArgBlock; > >/* ---------------- > * PGresAttDesc -- Data about a single attribute (column) of a query result > * ---------------- > */ >typedef struct pgresAttDesc >{ > char *name; /* column name */ > Oid tableid; /* source table, if known */ > int columnid; /* source column, if known */ > int format; /* format code for value (text/binary) */ > Oid typid; /* type id */ > int typlen; /* type size */ > int atttypmod; /* type-specific modifier info */ >} PGresAttDesc; > >/* ---------------- > * Exported functions of libpq > * ---------------- > */ > >/* === in fe-connect.c === */ > >/* make a new client connection to the backend */ >/* Asynchronous (non-blocking) */ >extern PGconn *PQconnectStart(const char *conninfo); >extern PGconn *PQconnectStartParams(const char *const * keywords, > const char *const * values, int expand_dbname); >extern PostgresPollingStatusType PQconnectPoll(PGconn *conn); > >/* Synchronous (blocking) */ >extern PGconn *PQconnectdb(const char *conninfo); >extern PGconn *PQconnectdbParams(const char *const * keywords, > const char *const * values, int expand_dbname); >extern PGconn *PQsetdbLogin(const char *pghost, const char *pgport, > const char *pgoptions, const char *pgtty, > const char *dbName, > const char *login, const char *pwd); > >#define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME) \ > PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL) > >/* close the current connection and free the PGconn data structure */ >extern void PQfinish(PGconn *conn); > >/* get info about connection options known to PQconnectdb */ >extern PQconninfoOption *PQconndefaults(void); > >/* parse connection options in same way as PQconnectdb */ >extern PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg); > >/* return the connection options used by a live connection */ >extern PQconninfoOption *PQconninfo(PGconn *conn); > >/* free the data structure returned by PQconndefaults() or PQconninfoParse() */ >extern void PQconninfoFree(PQconninfoOption *connOptions); > >/* > * close the current connection and restablish a new one with the same > * parameters > */ >/* Asynchronous (non-blocking) */ >extern int PQresetStart(PGconn *conn); >extern PostgresPollingStatusType PQresetPoll(PGconn *conn); > >/* Synchronous (blocking) */ >extern void PQreset(PGconn *conn); > >/* request a cancel structure */ >extern PGcancel *PQgetCancel(PGconn *conn); > >/* free a cancel structure */ >extern void PQfreeCancel(PGcancel *cancel); > >/* issue a cancel request */ >extern int PQcancel(PGcancel *cancel, char *errbuf, int errbufsize); > >/* backwards compatible version of PQcancel; not thread-safe */ >extern int PQrequestCancel(PGconn *conn); > >/* Accessor functions for PGconn objects */ >extern char *PQdb(const PGconn *conn); >extern char *PQuser(const PGconn *conn); >extern char *PQpass(const PGconn *conn); >extern char *PQhost(const PGconn *conn); >extern char *PQport(const PGconn *conn); >extern char *PQtty(const PGconn *conn); >extern char *PQoptions(const PGconn *conn); >extern ConnStatusType PQstatus(const PGconn *conn); >extern PGTransactionStatusType PQtransactionStatus(const PGconn *conn); >extern const char *PQparameterStatus(const PGconn *conn, > const char *paramName); >extern int PQprotocolVersion(const PGconn *conn); >extern int PQserverVersion(const PGconn *conn); >extern char *PQerrorMessage(const PGconn *conn); >extern int PQsocket(const PGconn *conn); >extern int PQbackendPID(const PGconn *conn); >extern int PQconnectionNeedsPassword(const PGconn *conn); >extern int PQconnectionUsedPassword(const PGconn *conn); >extern int PQclientEncoding(const PGconn *conn); >extern int PQsetClientEncoding(PGconn *conn, const char *encoding); > >/* Get the OpenSSL structure associated with a connection. Returns NULL for > * unencrypted connections or if any other TLS library is in use. */ >extern void *PQgetssl(PGconn *conn); > >/* Tell libpq whether it needs to initialize OpenSSL */ >extern void PQinitSSL(int do_init); > >/* More detailed way to tell libpq whether it needs to initialize OpenSSL */ >extern void PQinitOpenSSL(int do_ssl, int do_crypto); > >/* Set verbosity for PQerrorMessage and PQresultErrorMessage */ >extern PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity); > >/* Enable/disable tracing */ >extern void PQtrace(PGconn *conn, FILE *debug_port); >extern void PQuntrace(PGconn *conn); > >/* Override default notice handling routines */ >extern PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn, > PQnoticeReceiver proc, > void *arg); >extern PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn, > PQnoticeProcessor proc, > void *arg); > >/* > * Used to set callback that prevents concurrent access to > * non-thread safe functions that libpq needs. > * The default implementation uses a libpq internal mutex. > * Only required for multithreaded apps that use kerberos > * both within their app and for postgresql connections. > */ >typedef void (*pgthreadlock_t) (int acquire); > >extern pgthreadlock_t PQregisterThreadLock(pgthreadlock_t newhandler); > >/* === in fe-exec.c === */ > >/* Simple synchronous query */ >extern PGresult *PQexec(PGconn *conn, const char *query); >extern PGresult *PQexecParams(PGconn *conn, > const char *command, > int nParams, > const Oid *paramTypes, > const char *const * paramValues, > const int *paramLengths, > const int *paramFormats, > int resultFormat); >extern PGresult *PQprepare(PGconn *conn, const char *stmtName, > const char *query, int nParams, > const Oid *paramTypes); >extern PGresult *PQexecPrepared(PGconn *conn, > const char *stmtName, > int nParams, > const char *const * paramValues, > const int *paramLengths, > const int *paramFormats, > int resultFormat); > >/* Interface for multiple-result or asynchronous queries */ >extern int PQsendQuery(PGconn *conn, const char *query); >extern int PQsendQueryParams(PGconn *conn, > const char *command, > int nParams, > const Oid *paramTypes, > const char *const * paramValues, > const int *paramLengths, > const int *paramFormats, > int resultFormat); >extern int PQsendPrepare(PGconn *conn, const char *stmtName, > const char *query, int nParams, > const Oid *paramTypes); >extern int PQsendQueryPrepared(PGconn *conn, > const char *stmtName, > int nParams, > const char *const * paramValues, > const int *paramLengths, > const int *paramFormats, > int resultFormat); >extern int PQsetSingleRowMode(PGconn *conn); >extern PGresult *PQgetResult(PGconn *conn); > >/* Routines for managing an asynchronous query */ >extern int PQisBusy(PGconn *conn); >extern int PQconsumeInput(PGconn *conn); > >/* LISTEN/NOTIFY support */ >extern PGnotify *PQnotifies(PGconn *conn); > >/* Routines for copy in/out */ >extern int PQputCopyData(PGconn *conn, const char *buffer, int nbytes); >extern int PQputCopyEnd(PGconn *conn, const char *errormsg); >extern int PQgetCopyData(PGconn *conn, char **buffer, int async); > >/* Deprecated routines for copy in/out */ >extern int PQgetline(PGconn *conn, char *string, int length); >extern int PQputline(PGconn *conn, const char *string); >extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize); >extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes); >extern int PQendcopy(PGconn *conn); > >/* Set blocking/nonblocking connection to the backend */ >extern int PQsetnonblocking(PGconn *conn, int arg); >extern int PQisnonblocking(const PGconn *conn); >extern int PQisthreadsafe(void); >extern PGPing PQping(const char *conninfo); >extern PGPing PQpingParams(const char *const * keywords, > const char *const * values, int expand_dbname); > >/* Force the write buffer to be written (or at least try) */ >extern int PQflush(PGconn *conn); > >/* > * "Fast path" interface --- not really recommended for application > * use > */ >extern PGresult *PQfn(PGconn *conn, > int fnid, > int *result_buf, > int *result_len, > int result_is_int, > const PQArgBlock *args, > int nargs); > >/* Accessor functions for PGresult objects */ >extern ExecStatusType PQresultStatus(const PGresult *res); >extern char *PQresStatus(ExecStatusType status); >extern char *PQresultErrorMessage(const PGresult *res); >extern char *PQresultErrorField(const PGresult *res, int fieldcode); >extern int PQntuples(const PGresult *res); >extern int PQnfields(const PGresult *res); >extern int PQbinaryTuples(const PGresult *res); >extern char *PQfname(const PGresult *res, int field_num); >extern int PQfnumber(const PGresult *res, const char *field_name); >extern Oid PQftable(const PGresult *res, int field_num); >extern int PQftablecol(const PGresult *res, int field_num); >extern int PQfformat(const PGresult *res, int field_num); >extern Oid PQftype(const PGresult *res, int field_num); >extern int PQfsize(const PGresult *res, int field_num); >extern int PQfmod(const PGresult *res, int field_num); >extern char *PQcmdStatus(PGresult *res); >extern char *PQoidStatus(const PGresult *res); /* old and ugly */ >extern Oid PQoidValue(const PGresult *res); /* new and improved */ >extern char *PQcmdTuples(PGresult *res); >extern char *PQgetvalue(const PGresult *res, int tup_num, int field_num); >extern int PQgetlength(const PGresult *res, int tup_num, int field_num); >extern int PQgetisnull(const PGresult *res, int tup_num, int field_num); >extern int PQnparams(const PGresult *res); >extern Oid PQparamtype(const PGresult *res, int param_num); > >/* Describe prepared statements and portals */ >extern PGresult *PQdescribePrepared(PGconn *conn, const char *stmt); >extern PGresult *PQdescribePortal(PGconn *conn, const char *portal); >extern int PQsendDescribePrepared(PGconn *conn, const char *stmt); >extern int PQsendDescribePortal(PGconn *conn, const char *portal); > >/* Delete a PGresult */ >extern void PQclear(PGresult *res); > >/* For freeing other alloc'd results, such as PGnotify structs */ >extern void PQfreemem(void *ptr); > >/* Exists for backward compatibility. bjm 2003-03-24 */ >#define PQfreeNotify(ptr) PQfreemem(ptr) > >/* Error when no password was given. */ >/* Note: depending on this is deprecated; use PQconnectionNeedsPassword(). */ >#define PQnoPasswordSupplied "fe_sendauth: no password supplied\n" > >/* Create and manipulate PGresults */ >extern PGresult *PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status); >extern PGresult *PQcopyResult(const PGresult *src, int flags); >extern int PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs); >extern void *PQresultAlloc(PGresult *res, size_t nBytes); >extern int PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len); > >/* Quoting strings before inclusion in queries. */ >extern size_t PQescapeStringConn(PGconn *conn, > char *to, const char *from, size_t length, > int *error); >extern char *PQescapeLiteral(PGconn *conn, const char *str, size_t len); >extern char *PQescapeIdentifier(PGconn *conn, const char *str, size_t len); >extern unsigned char *PQescapeByteaConn(PGconn *conn, > const unsigned char *from, size_t from_length, > size_t *to_length); >extern unsigned char *PQunescapeBytea(const unsigned char *strtext, > size_t *retbuflen); > >/* These forms are deprecated! */ >extern size_t PQescapeString(char *to, const char *from, size_t length); >extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_length, > size_t *to_length); > > > >/* === in fe-print.c === */ > >extern void PQprint(FILE *fout, /* output stream */ > const PGresult *res, > const PQprintOpt *ps); /* option structure */ > >/* > * really old printing routines > */ >extern void PQdisplayTuples(const PGresult *res, > FILE *fp, /* where to send the output */ > int fillAlign, /* pad the fields with spaces */ > const char *fieldSep, /* field separator */ > int printHeader, /* display headers? */ > int quiet); > >extern void PQprintTuples(const PGresult *res, > FILE *fout, /* output stream */ > int printAttName, /* print attribute names */ > int terseOutput, /* delimiter bars */ > int width); /* width of column, if 0, use variable width */ > > >/* === in fe-lobj.c === */ > >/* Large-object access routines */ >extern int lo_open(PGconn *conn, Oid lobjId, int mode); >extern int lo_close(PGconn *conn, int fd); >extern int lo_read(PGconn *conn, int fd, char *buf, size_t len); >extern int lo_write(PGconn *conn, int fd, const char *buf, size_t len); >extern int lo_lseek(PGconn *conn, int fd, int offset, int whence); >extern pg_int64 lo_lseek64(PGconn *conn, int fd, pg_int64 offset, int whence); >extern Oid lo_creat(PGconn *conn, int mode); >extern Oid lo_create(PGconn *conn, Oid lobjId); >extern int lo_tell(PGconn *conn, int fd); >extern pg_int64 lo_tell64(PGconn *conn, int fd); >extern int lo_truncate(PGconn *conn, int fd, size_t len); >extern int lo_truncate64(PGconn *conn, int fd, pg_int64 len); >extern int lo_unlink(PGconn *conn, Oid lobjId); >extern Oid lo_import(PGconn *conn, const char *filename); >extern Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId); >extern int lo_export(PGconn *conn, Oid lobjId, const char *filename); > >/* === in fe-misc.c === */ > >/* Get the version of the libpq library in use */ >extern int PQlibVersion(void); > >/* Determine length of multibyte encoded char at *s */ >extern int PQmblen(const char *s, int encoding); > >/* Determine display length of multibyte encoded char at *s */ >extern int PQdsplen(const char *s, int encoding); > >/* Get encoding id from environment variable PGCLIENTENCODING */ >extern int PQenv2encoding(void); > >/* === in fe-auth.c === */ > >extern char *PQencryptPassword(const char *passwd, const char *user); > >/* === in encnames.c === */ > >extern int pg_char_to_encoding(const char *name); >extern const char *pg_encoding_to_char(int encoding); >extern int pg_valid_server_encoding_id(int encoding); > >#ifdef __cplusplus >} >#endif ># 586 "/usr/local/include/libpq-fe.h" > >#endif /* LIBPQ_FE_H */ ># 588 "/usr/local/include/libpq-fe.h" ># 83 "../include/dps_db_int.h" 2 >#endif ># 84 "../include/dps_db_int.h" > >#if HAVE_DP_MSQL >#if 0 /* expanded by -frewrite-includes */ >#include "msql.h" >#endif /* expanded by -frewrite-includes */ ># 87 "../include/dps_db_int.h" >#endif ># 88 "../include/dps_db_int.h" > >#if HAVE_IODBC >#if 0 /* expanded by -frewrite-includes */ >#include "sql.h" >#endif /* expanded by -frewrite-includes */ ># 91 "../include/dps_db_int.h" >#if 0 /* expanded by -frewrite-includes */ >#include "sqlext.h" >#endif /* expanded by -frewrite-includes */ ># 92 "../include/dps_db_int.h" >#endif ># 93 "../include/dps_db_int.h" > >#if HAVE_EASYSOFT >#if 0 /* expanded by -frewrite-includes */ >#include "sql.h" >#endif /* expanded by -frewrite-includes */ ># 96 "../include/dps_db_int.h" >#if 0 /* expanded by -frewrite-includes */ >#include "sqlext.h" >#endif /* expanded by -frewrite-includes */ ># 97 "../include/dps_db_int.h" >#endif ># 98 "../include/dps_db_int.h" > >#if HAVE_VIRT >#if 0 /* expanded by -frewrite-includes */ >#include "iodbc.h" >#endif /* expanded by -frewrite-includes */ ># 101 "../include/dps_db_int.h" >#if 0 /* expanded by -frewrite-includes */ >#include "isql.h" >#endif /* expanded by -frewrite-includes */ ># 102 "../include/dps_db_int.h" >#if 0 /* expanded by -frewrite-includes */ >#include "isqlext.h" >#endif /* expanded by -frewrite-includes */ ># 103 "../include/dps_db_int.h" >#endif ># 104 "../include/dps_db_int.h" > >#if HAVE_UNIXODBC >#if 0 /* expanded by -frewrite-includes */ >#include "sql.h" >#endif /* expanded by -frewrite-includes */ ># 107 "../include/dps_db_int.h" >#if 0 /* expanded by -frewrite-includes */ >#include "sqlext.h" >#endif /* expanded by -frewrite-includes */ ># 108 "../include/dps_db_int.h" >#endif ># 109 "../include/dps_db_int.h" > >#if HAVE_SAPDB >#if 0 /* expanded by -frewrite-includes */ >#include "WINDOWS.H" >#endif /* expanded by -frewrite-includes */ ># 112 "../include/dps_db_int.h" >#if 0 /* expanded by -frewrite-includes */ >#include "sql.h" >#endif /* expanded by -frewrite-includes */ ># 113 "../include/dps_db_int.h" >#if 0 /* expanded by -frewrite-includes */ >#include "sqlext.h" >#endif /* expanded by -frewrite-includes */ ># 114 "../include/dps_db_int.h" >#endif ># 115 "../include/dps_db_int.h" > >#if HAVE_SOLID >#if 0 /* expanded by -frewrite-includes */ >#include "cli0cli.h" >#endif /* expanded by -frewrite-includes */ ># 118 "../include/dps_db_int.h" >#endif ># 119 "../include/dps_db_int.h" > >#if HAVE_DB2 >#if 0 /* expanded by -frewrite-includes */ >#include "sqlcli1.h" >#endif /* expanded by -frewrite-includes */ ># 122 "../include/dps_db_int.h" >#endif ># 123 "../include/dps_db_int.h" > >#if HAVE_IBASE >#if 0 /* expanded by -frewrite-includes */ >#include "ibase.h" >#endif /* expanded by -frewrite-includes */ ># 126 "../include/dps_db_int.h" >#endif ># 127 "../include/dps_db_int.h" > >#if HAVE_CTLIB >#if 0 /* expanded by -frewrite-includes */ >#include <ctpublic.h> >#endif /* expanded by -frewrite-includes */ ># 130 "../include/dps_db_int.h" >#endif ># 131 "../include/dps_db_int.h" > >#if HAVE_SQLITE >#if 0 /* expanded by -frewrite-includes */ >#include <sqlite.h> >#endif /* expanded by -frewrite-includes */ ># 134 "../include/dps_db_int.h" >#endif ># 135 "../include/dps_db_int.h" > >#if HAVE_SQLITE3 >#if 0 /* expanded by -frewrite-includes */ >#include <sqlite3.h> >#endif /* expanded by -frewrite-includes */ ># 138 "../include/dps_db_int.h" >#endif ># 139 "../include/dps_db_int.h" > >#if HAVE_ORACLE8 >#if 0 /* expanded by -frewrite-includes */ >#include "oci.h" >#endif /* expanded by -frewrite-includes */ ># 142 "../include/dps_db_int.h" >#endif ># 143 "../include/dps_db_int.h" > >#if HAVE_ORACLE7 > #if 0 /* expanded by -frewrite-includes */ >#include "ocidfn.h" >#endif /* expanded by -frewrite-includes */ ># 146 "../include/dps_db_int.h" > #if 0 /* expanded by -frewrite-includes */ >#include "oratypes.h" >#endif /* expanded by -frewrite-includes */ ># 147 "../include/dps_db_int.h" > #ifdef __STDC__ > #if 0 /* expanded by -frewrite-includes */ >#include <ociapr.h> >#endif /* expanded by -frewrite-includes */ ># 149 "../include/dps_db_int.h" > #else ># 150 "../include/dps_db_int.h" > #if 0 /* expanded by -frewrite-includes */ >#include <ocikpr.h> >#endif /* expanded by -frewrite-includes */ ># 151 "../include/dps_db_int.h" > #endif ># 152 "../include/dps_db_int.h" >#endif ># 153 "../include/dps_db_int.h" > > > >#ifdef HAVE_ORACLE8 > >#define MAX_COLS_IN_TABLE 32 >#define MAX_BIND_PARAM 4 >#define BUF_OUT_SIZE 128 >struct param_struct{ > int out_rec; > int out_pos[MAX_BIND_PARAM]; > int out_pos_val[MAX_BIND_PARAM][BUF_OUT_SIZE]; >}; >#endif ># 167 "../include/dps_db_int.h" > > >/* Multi-dict mode defines */ >#define MAXMULTI 32 >#define NDICTS 18 >#define MINDICT 2 >#define MAXDICT NDICTS >#define DICTNUM(l) (((l) > 16) ? dictlen[17] : dictlen[(l)]) > >static const size_t dictlen[NDICTS]={2,2,2,3,4,5,6,7,8,9,10,11,12,16,16,16,16,32}; > > >#define DPS_URL_DELETE_CACHE_SIZE 128 >#define DPS_URL_SELECT_CACHE_SIZE 1024 >#define DPS_URL_DUMP_CACHE_SIZE 100000 >#define URL_LOCK_TIME 4*60*60 >#define DPS_MAX_MULTI_INSERT_QSIZE 60*1024 >#define NDOCS_QUERY "SELECT count(*) FROM url" > >#define DPS_SQL_UNKNOWN 0 >#define DPS_SQL_SELECT 1 >#define DPS_SQL_UPDATE 2 > >typedef struct { > char *sqlname; > int sqltype; > int sqllen; >} DPS_SQLFIELD; > >typedef struct { > size_t len; > char *val; >} DPS_PSTR; > >typedef struct { > size_t nRows; > size_t nCols; > int DBDriver; > int qtype; > char ** items; > > DPS_SQLFIELD *Fields; > DPS_PSTR *Items; > >#ifdef HAVE_DP_PGSQL > PGresult *pgsqlres; >#endif ># 214 "../include/dps_db_int.h" > >#ifdef HAVE_DP_MSQL > m_result *msqlres; >#endif ># 218 "../include/dps_db_int.h" > >#ifdef HAVE_ORACLE8 > char *defbuff[MAX_COLS_IN_TABLE]; /* Buffers for OCIStmtFetch */ > int col_size[MAX_COLS_IN_TABLE]; /* Size of column */ > sb2 indbuff[MAX_COLS_IN_TABLE][BUF_OUT_SIZE]; /* Indicators for NULLs */ >#endif ># 224 "../include/dps_db_int.h" > >} DPS_SQLRES; > > > > >typedef struct struct_dps_db { > DPS_SQLRES Res; > DPS_URL addrURL; > size_t dbnum; > int freeme; > char *DBADDR; > char *DBName; > char *DBUser; > char *DBPass; > char *DBSock; > char *DBCharset; > int DBMode; > char *where; > char *from; > char *label; > int DBType; > int DBDriver; > > int DBSQL_IN; > int DBSQL_LIMIT; > int DBSQL_GROUP; > int DBSQL_TRUNCATE; > int DBSQL_SELECT_FROM_DELETE; > int DBSQL_SUBSELECT; > int DBSQL_MULTINSERT; > > int connected; > int TrackQuery; /* =1, if track queries into this db */ > int open_mode; > int res_limit; > int commit_fl; > unsigned int numtables; > int errcode; > char errstr[2048]; > >/* int urld_fd;*/ /* URL server socket descriptor */ > int searchd; /* Searchd daemon descriptors */ > int del_fd; /* Cache mode dellog descriptor */ > int cat_fd; /* Cache mode category log descriptor */ > int tag_fd; /* Cache mode tag log descriptor */ > int time_fd; /* Cache mode time log descriptor */ > int lang_fd; /* Cache mode language log descriptor */ > int ctype_fd; /* Cache mode content-type log descriptor */ > int site_fd; /* Cache mode site log descriptor */ > char log_dir[PATH_MAX]; /* Where to store logs */ > DPS_LOGD LOGD; /* Cache mode local descriptors */ > int logd_fd; /* connection to cached file descriptor */ > struct sockaddr_in stored_addr; /* stored address */ > struct sockaddr_in cached_addr; /* cached address */ > DPS_VARLIST Vars; /* optional parameters and variables*/ > > char *vardir; > size_t WrdFiles, StoredFiles, URLDataFiles; > > /** Cache mode limits */ > DPS_SEARCH_LIMIT *limits; > size_t nlimits; > >#if defined(HAVE_DP_PGSQL) || defined(HAVE_DP_MYSQL) > int async_in_process; >#endif ># 291 "../include/dps_db_int.h" > >#ifdef HAVE_DP_MYSQL > MYSQL mysql; >#endif ># 295 "../include/dps_db_int.h" > >#ifdef HAVE_DP_PGSQL > PGconn *pgsql; >#endif ># 299 "../include/dps_db_int.h" > >#ifdef HAVE_DP_MSQL > int msql; >#endif ># 303 "../include/dps_db_int.h" > >#if (HAVE_IODBC || HAVE_UNIXODBC || HAVE_SOLID || HAVE_VIRT || HAVE_EASYSOFT || HAVE_SAPDB) > HDBC hDbc; > HENV hEnv; > HSTMT hstmt; >#endif ># 309 "../include/dps_db_int.h" > >#if HAVE_DB2 > SQLHANDLE hDbc; > SQLHANDLE hEnv; > SQLHANDLE hstmt; >#endif ># 315 "../include/dps_db_int.h" > >#ifdef HAVE_IBASE > isc_db_handle DBH; /* database handle */ > ISC_STATUS status[20]; /* status vector */ > isc_tr_handle tr_handle; /* transaction handle */ >#endif ># 321 "../include/dps_db_int.h" > >#ifdef HAVE_ORACLE7 > Lda_Def lda; > ub1 hda[HDA_SIZE]; > Cda_Def cursor; >#endif ># 327 "../include/dps_db_int.h" > >#ifdef HAVE_CTLIB > CS_CONTEXT *ctx; > CS_CONNECTION *conn; >#endif ># 332 "../include/dps_db_int.h" > >#ifdef HAVE_SQLITE > struct sqlite *sqlt; >#endif ># 336 "../include/dps_db_int.h" > >#ifdef HAVE_SQLITE3 > struct sqlite3 *sqlt3; >#endif ># 340 "../include/dps_db_int.h" > >#ifdef HAVE_ORACLE8 > OCIEnv *envhp; > OCIError *errhp; > OCISvcCtx *svchp; > OCIStmt *stmthp; > OCIParam *param; > OCIDefine *defb[MAX_COLS_IN_TABLE]; > OCIBind *bndhp[MAX_BIND_PARAM]; > struct param_struct *par; >#endif ># 351 "../include/dps_db_int.h" > > >} DPS_DB; > > >extern int DpsCmpurldellog(const void *s1, const void *s2); >extern int DpsCmplog(const DPS_LOGWORD *s1, const DPS_LOGWORD *s2); >extern int DpsCmplog_wrd(const DPS_LOGWORD *s1, const DPS_LOGWORD *s2); >extern int DpsCmpURLData(DPS_URLDATA *d1, DPS_URLDATA *d2); > >#endif ># 362 "../include/dps_db_int.h" ># 920 "../include/dps_common.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_base.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_base.h" 1 >/* Copyright (C) 2013 Maxim Zakharov. All rights reserved. > Copyright (C) 2004-2012 DataPark Ltd. All rights reserved. > Copyright (C) 2003 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_BASE_H >#define _DPS_BASE_H > > >#define DPS_BASE_BITS 16 /* bits of rec_id for file no. */ >#define DPS_BASE_MASK ((1UL << DPS_BASE_BITS) - 1) > >#define DPS_HASH_PRIME 4093UL >/*#define DPS_HASH(x) (((size_t)x) % DPS_HASH_PRIME)*/ >#define DPS_HASH(x) ((((unsigned long)(x)) & DPS_BASE_MASK) % DPS_HASH_PRIME) >#define DPS_FILENO(x, NFILES) (((((unsigned long)(x)) >> DPS_BASE_BITS) & DPS_BASE_MASK) % ((unsigned long)(NFILES))) > >#define DPS_READ_LOCK 0 >#define DPS_WRITE_LOCK 1 > >#ifdef HAVE_ZLIB >#define DPS_BASE_WRD_WINDOWBITS 11 >#define DPS_BASE_WRD_STRATEGY Z_DEFAULT_STRATEGY >#define DPS_BASE_INFO_WINDOWBITS 11 >#define DPS_BASE_INFO_STRATEGY Z_DEFAULT_STRATEGY >#endif ># 41 "../include/dps_base.h" > >typedef struct BaseItem { > urlid_t rec_id; > dps_uint8 offset; > dps_uint8 next; > size_t size; > size_t orig_size; >} DPS_BASEITEM; > >typedef struct BaseItem_4_23 { > urlid_t rec_id; > dps_uint8 offset; > dps_uint8 next; > size_t size; >} DPS_BASEITEM_4_23; > >typedef struct SortBaseItem { >/* dps_uint8 offset;*/ > DPS_BASEITEM Item; >} DPS_SORTBASEITEM; > >typedef struct { > DPS_BASEITEM Item; > struct dps_indexer_struct *A; > dps_uint8 CurrentItemPos, PreviousItemPos; > const char *subdir; > const char *basename; > const char *indname; > const char *vardir; > char *Ifilename; > char *Sfilename; > urlid_t rec_id; > size_t NFiles, FileNo; > int Ifd, Sfd; > int mode, mishash, opened, locked; > int zlib_level, zlib_method, zlib_windowBits, zlib_memLevel, zlib_strategy; >} DPS_BASE_PARAM; > >extern __C_LINK int __DPSCALL DpsBaseOpen(DPS_BASE_PARAM *P, int mode); >extern __C_LINK int __DPSCALL DpsBaseSeek(DPS_BASE_PARAM *P, int mode); >extern __C_LINK int __DPSCALL DpsBaseClose(DPS_BASE_PARAM *P); > >extern __C_LINK int __DPSCALL DpsBaseWrite(DPS_BASE_PARAM *P, void *data, size_t len); >extern __C_LINK int __DPSCALL DpsBaseRead(DPS_BASE_PARAM *P, void *buf, size_t len); >extern __C_LINK void * __DPSCALL DpsBaseARead(DPS_BASE_PARAM *P, size_t *len); >extern __C_LINK int __DPSCALL DpsBaseDelete(DPS_BASE_PARAM *P); >extern __C_LINK int __DPSCALL DpsBaseCheckup(DPS_BASE_PARAM *P, int (*checkrec) (struct dps_indexer_struct *A, const urlid_t rec_id)); >extern __C_LINK int __DPSCALL DpsBaseOptimize(DPS_BASE_PARAM *P, int base); >extern __C_LINK int __DPSCALL DpsBaseFsync(DPS_BASE_PARAM *P); >extern __C_LINK int __DPSCALL DpsBaseRelocate(struct dps_indexer_struct *Agent, int base_type); > > >#endif ># 94 "../include/dps_base.h" ># 921 "../include/dps_common.h" 2 > >typedef struct { > DPS_BASE_PARAM BASEP; > struct dps_stack_item_struct **pmerg; > DPS_LOGDEL *del_buf; > int *wf; > size_t del_count; > int flag_null_wf; >} DPS_WRD_CFG; > > >typedef struct dps_stack_item_struct { > int cmd, secno; > int origin, order_origin; > /* unsigned long arg; .order now */ >#ifndef S_SPLINT_S > DPS_URL_CRD_DB *pbegin, *pcur, *plast, *pchecked; >#endif ># 939 "../include/dps_common.h" > /* char gap[8192];*/ > DPS_URL_CRD *db_pbegin; > /* char gap2[8192];*/ > DPS_URL_CRD *db_pcur, *db_plast, *db_pchecked; > size_t order, order_inquery; > size_t wordnum; > size_t count; > size_t len, ulen; > size_t order_from, order_to; > dpshash32_t crcword; > char *word; > dpsunicode_t *uword; >#ifdef HAVE_PTHREAD > pthread_t thread; > DPS_WRD_CFG WrdCfg; >#endif ># 955 "../include/dps_common.h" >} DPS_STACK_ITEM; > >typedef struct { > size_t ncstack, mcstack; > int *cstack; > size_t nastack, mastack; > DPS_STACK_ITEM *astack; > int freeme; >} DPS_BOOLSTACK; > >typedef struct { > size_t total_found, grand_total; > size_t work_time; > size_t first; > size_t last; > size_t fetched; > size_t num_rows; > size_t cur_row; > size_t offset; > size_t memused; > size_t *PerSite; > int freeme; > DPS_DOCUMENT *Doc; > char *Suggest; > > DPS_WIDEWORDLIST WWList; > DPS_URLCRDLIST CoordList; > > /* Bool stuff */ > size_t nitems, mitems, ncmds, orig_nitems, max_order, max_order_inquery; > int phrase, prepared; > DPS_STACK_ITEM *items; > >} DPS_RESULT; > > > >typedef struct { > size_t nitems; > size_t currdbnum; > size_t cnt_db; > size_t dbfrom; > size_t dbto; > DPS_DB **db; >} DPS_DBLIST; > > >enum dps_indcmd { > DPS_IND_INDEX, > DPS_IND_STAT, > DPS_IND_CREATE, > DPS_IND_DROP, > DPS_IND_DELETE, > DPS_IND_REFERERS, > DPS_IND_SQLMON, > DPS_IND_CHECKCONF, > DPS_IND_CONVERT, > DPS_IND_DOCINFO, > DPS_IND_POPRANK, > DPS_IND_RESORT, > DPS_IND_REHASHSTORED, > DPS_IND_SITEMAP, > DPS_IND_FILTER >}; > >enum dps_prmethod { > DPS_POPRANK_GOO, > DPS_POPRANK_NEO >}; > >typedef struct { > struct sockaddr_in bind_addr; /**< address for outbound connections */ > time_t hold_cache; /**< How time in secs hold search cache */ > time_t robots_period; /**< How time in secs hold robots.txt data */ > size_t GuesserBytes; /**< Number of bytes used for language and charset guessing */ > size_t SEASentences; /**< Maximal number of sentenses using by SEA */ > size_t SEASentenceMinLength; /**< minimal length of the sentence to use in SEA */ > size_t MaxCrawlDelay; /**< Maximum Crawl-delay seconds to wait */ > int do_store; /**< Compressed copies storage flag */ > int do_excerpt; /**< Document Excerpts making flag */ > int CVS_ignore; /**< Skip CVS directgories - for tests */ > int collect_links; /**< Collect links flag */ > int use_crc32_url_id; /**< UseCRC32URLId */ > int use_crosswords; > int use_newsext; > int use_accentext; > int use_aspellext; > int use_meta; > int update_lm; > int provide_referer; > int make_prefixes; /**< Make word prefixes for cache mode */ > int make_suffixes; /**< Make word suffixes for cache mode */ > int fill_dictionary; /**< Fill "dict" table in dbmode cache */ > int OptimizeAtUpdate; > int PreloadURLData; > int cold_var; /**< Do not use file locking for read-only operations */ > int PopRankNeoIterations; > int skip_unreferred; > int rel_nofollow; /**< Flag to obi rel="nofollow" attribute */ > int track_hops; > int poprank_postpone; /**< Skip the Neo PopRank calculation at indexing */ > int limits; /**< mask of defined cache mode limits */ > int nmaps; > int URLInfoSQL; /**< Store URLInfo into SQL-base for cache mode */ > int SRVInfoSQL; /**< Store SRVInfo into SQL-base */ > int CheckInsertSQL; /**< Check before INSERT new record */ > int mark_for_index; > int use_date_header; /**< Use Date: HTTP header if Last-Modified: is not specified */ > int MaxSiteLevel; /**< Maximum level of hostname for site_id */ > int Resegment; /**< Resegmenting flags for East-Asian languages */ > int PagesInGroup; /**< Number of additional pages from same site when google-like groupping is enabled */ > int LongestTextItems; /**< Number of longest text items to index */ > int SubDocLevel; /**< Maximum nested level for sub-documents */ > int SubDocCnt; /**< Maximum number of subdocuments to be indexed */ > dps_uint4 SkipHrefIn; /**< Flag to skip some HTML tags from new href lookup */ > dps_uint4 expire; /**< Flag to process to expired documents */ > enum dps_prmethod poprank_method; > enum dps_indcmd cmd; >} DPS_FLAGS; > >/** Config file */ >typedef struct dps_config_struct { > int freeme; > char errstr[2048]; > DPS_CHARSET *bcs; > DPS_CHARSET *lcs; > > int url_number; /**< For indexer -nXXX */ > int url_size; /**< For indexer -GXXX */ > > DPS_SERVERLIST Servers[DPS_MATCH_max]; /**< List of servers and realms */ > DPS_SERVER *Cfg_Srv; > DPS_SERVER **SrvPnt; > int total_srv_cnt; /**< total number of servers */ > DPS_ROBOTS Robots; /**< robots.txt information */ > > DPS_MATCHLIST Aliases; /**< Straight aliases */ > DPS_MATCHLIST ReverseAliases; /**< Reverse aliases */ > DPS_MATCHLIST MimeTypes; /**< For AddType commands */ > DPS_MATCHLIST Filters; /**< Allow, Disallow,etc */ > DPS_MATCHLIST SectionFilters; /**< IndexIf, NoIndexIf, etc */ > DPS_MATCHLIST StoreFilters; /**< Store, NoStore, etc */ > DPS_MATCHLIST SectionMatch; /**< Section's patterns */ > DPS_MATCHLIST HrefSectionMatch; /**< HrefSection's patterns */ > DPS_MATCHLIST SubSectionMatch;/**< TagIf, CategoryIf */ > DPS_MATCHLIST BodyPatterns; /**< Body extraction patterns */ > DPS_MATCHLIST ActionSQLMatch; /**< ActionSQL patterns */ > DPS_MATCHLIST QAliases; /**< query word aliases */ > DPS_MATCHLIST SectionSQLMatch;/**< SectionSQL queries */ > > DPS_RESULT Targets; /**< Targets cache */ > > DPS_VARLIST Sections; /**< document sections to parse */ > DPS_VARLIST HrefSections; /**< document href sections */ > DPS_VARLIST Vars; /**< Config parameters */ > > DPS_LANGMAPLIST LangMaps; /**< For lang+charset quesser */ > DPS_SYNONYMLIST Synonyms; /**< Synonyms list */ > DPS_ACRONYMLIST Acronyms; /**< Acronyms list */ > DPS_STOPLIST StopWords; /**< Stopwords list */ > DPS_PARSERLIST Parsers; /**< External parsers */ > DPS_DBLIST dbl; /**< DB addresses */ > DPS_SPELLLIST Spells; /**< For ispell dictionaries */ > DPS_AFFIXLIST Affixes; /**< For ispell affixes */ > DPS_QUFFIXLIST Quffixes; /**< For query regular expressions */ > DPS_WORDPARAM WordParam; /**< Word limits */ > DPS_CHINALIST Chi; /**< Chinese words list */ > DPS_CHINALIST Thai; /**< Thai words list */ > DPS_CHINALIST Korean; /**< Korean words list */ > DPS_FLAGS Flags; > dps_uint8 flags; > DPS_URLDATA_FILE **URLDataFile; /**< url data preloaded */ > char *CharsToEscape; /**< characters to escape in output */ > > /* Various file descriptors */ > int logs_only; /**< Cache mode writes mode */ > int is_log_open; /**< if DpsOpenLog is already called */ > FILE *logFD; /**< FILE structure, syslog descriptor */ > > void (*ThreadInfo)(struct dps_indexer_struct *,const char * state,const char * str); > void (*LockProc)(struct dps_indexer_struct *, int command, size_t type, const char *fname, int lineno); > void (*RefInfo)(int code,const char *url, const char *ref); > >#ifdef MECAB > mecab_t *mecab; >#endif ># 1141 "../include/dps_common.h" > >} DPS_ENV; > > >typedef struct { > int stored_sd; /* stored connection socket descriptors */ > int stored_rv; > int cached_sd; /* cached connection socket descriptors */ > int cached_rv; >} DPS_DEMONCONN; > >typedef struct { > size_t nitems; > DPS_DEMONCONN *Demon; >} DPS_DEMONCONNLIST; > >typedef struct { > DPS_VARLIST vars; > DPS_VARLIST *Env_Vars; > const char *HlBeg, *HlEnd; /**< template highlighting */ > const char *GrBeg, *GrEnd; /**< template same site quoting for grouping a-la google */ > const char *SpBeg, *SpEnd; /**< template spelling error highlighting */ > const char *ExcerptMark; /**< delimiting mark for excerpts */ >} DPS_TEMPLATE; > >typedef struct { > float Weight; > char *Match_Pattern; > urlid_t Id; > size_t Ndocs; > char Command; > char OnErrored; >} DPS_SERVERCACHE; > >/** Indexer */ >typedef struct dps_indexer_struct{ > int freeme; /**< whenever it was allocated */ > int handle; /**< Handler for threaded version */ > time_t start_time; /**< Time of allocation, for stat */ > time_t now; /**< Time of current document processing */ > size_t ndocs; /**< Number of documents indexed */ > size_t poprank_docs; /**< Number of documents popranked*/ > size_t nbytes; /**< Number of bytes downloaded */ > size_t poprank_pas; /**< Number of rounds of PopRank */ > dps_uint8 nsleepsecs; /**> Number of sleep seconds */ > dps_uint8 flags; /**< Running flags */ > int action; > int doccount; /**< for DpsGetDocCount() */ > DPS_ENV *Conf; /**< Configuration */ > DPS_LANGMAP *LangMap; /**< LangMap for current document */ > DPS_RESULT *Res; /**< Search result pointer */ > DPS_RESULT Indexed; /**< Indexed cache */ > DPS_HREFLIST Hrefs; /**< Links cache */ > DPS_DEMONCONNLIST Demons; /**< Daemons connections */ > DPS_HOSTLIST Hosts; /**< Resolve cache */ > DPS_DBLIST dbl; /**< DB addresses */ > DPS_TEMPLATE tmpl; /**< parsed template */ > DPS_TEMPLATE st_tmpl; /**< storedoc parsed template */ > DPS_VARLIST Vars; /**< Config parameters */ > DPS_ROBOTS Robots; /**< robots.txt information */ > DPS_COOKIES Cookies; /**< HTTP cookies information */ > > DPS_FLAGS Flags; > DPS_WORDPARAM WordParam; /**< Word limits */ > > DPS_SEARCH_LIMIT *limits; > size_t nlimits; > > int SpellLang; > > char *DpsFindURLCache[DPS_FINDURL_CACHE_SIZE]; > urlid_t DpsFindURLCacheId[DPS_FINDURL_CACHE_SIZE]; > urlid_t DpsFindURLCacheSiteId[DPS_FINDURL_CACHE_SIZE]; > int DpsFindURLCacheHops[DPS_FINDURL_CACHE_SIZE]; > size_t pURLCache; > > DPS_SERVERCACHE ServerIdCache[DPS_SERVERID_CACHE_SIZE]; > size_t pServerIdCache; > > int *Locked; /**< is locked, how many times */ > void *request; /**< Apache request */ > > pid_t resolver_pid; /**< 0 in resolver process, pid of resolver in parent process */ > int rcv_pipe[2]; /**< pipe to receive resolving requests */ > int snd_pipe[2]; /**< pipe to send resolving results */ > > DPS_CONV uni_lc, lc_uni, lc_uni_text; > >#ifdef HAVE_ASPELL > DPS_CONV uni_utf, utf_uni, utf_lc; > AspellConfig *aspell_config; > pid_t aspell_pid[DPS_DEFAULT_MAX_ASPELL]; > size_t naspell; >#endif ># 1235 "../include/dps_common.h" > >#if defined(HAVE_LIBARES) || defined(HAVE_LIBCARES) > ares_channel channel; >#endif ># 1239 "../include/dps_common.h" > >#ifdef WITH_TRACE > FILE *TR; > int level; >/* char timebuf[32];*/ >#endif ># 1245 "../include/dps_common.h" > >#ifdef HAVE_PTHREAD > unsigned int seed; >#endif ># 1249 "../include/dps_common.h" > >} DPS_AGENT; > > >typedef struct { > DPS_AGENT Agent; > pid_t pid; > int status; > int generation; >} DPS_CHILD; > >#define DPS_CHILDREN_LIMIT 16 > > >typedef struct { > char *url; > int status; >} DPS_URLSTATE; > >typedef int (*qsort_cmp)(const void*, const void*); > >typedef struct { > dps_uint4 hi,lo; > dps_uint8 pos; > size_t len; >/* size_t orig_len;*/ >} DPS_UINT8_POS_LEN; > >typedef struct { > dps_uint4 val; > dps_uint8 pos; > size_t len; >/* size_t orig_len;*/ >} DPS_UINT4_POS_LEN; > >typedef struct { > dps_uint4 val; > urlid_t url_id; >} DPS_UINT4URLID; > >typedef struct { > char shm_name[PATH_MAX]; > size_t nitems; > int mapped; > DPS_UINT4URLID *Item; >} DPS_UINT4URLIDLIST; > >typedef struct { > dps_uint4 hi,lo; > urlid_t url_id; >} DPS_UINT8URLID; > >typedef struct { > char shm_name[PATH_MAX]; > size_t nitems, mitems; > int mapped; > DPS_UINT8URLID *Item; >} DPS_UINT8URLIDLIST; > > >typedef struct { > dps_uint4 cmd; > dps_uint4 len; >} DPS_SEARCHD_PACKET_HEADER; > > >#define DPS_MAXTAGVAL 64 > >typedef struct { > int type; > int script; > int style; > int title; > int body; > int follow; > int index; > int comment; > int comment_inside; > int noindex; > int select; > int frameset; > int br; > char *lasthref; > void (*next_b)(void *t); > void (*next_e)(void *t); > const char *e; > const char *b; > const char **lt; > const char *s; > int socket_sd, socket_rv; > int chunks; > char *Content; > int finished; > size_t level; > size_t ntoks; > struct { > const char *name; > const char *val; > size_t nlen; > size_t vlen; > } toks[DPS_MAXTAGVAL+1]; > unsigned char visible[1024]; > char trail[4096]; > char *trailend; > unsigned char section[1024], strict[1024]; > char *section_name[1024]; >} DPS_HTMLTOK; > >typedef struct dps_cfg_st { > DPS_AGENT *Indexer; > DPS_SERVER *Srv; > dps_uint8 flags; > int level; > int ordre; > int flush_server; >} DPS_CFG; > >typedef int (*DPS_OUTPUTFUNCTION)(void*, const char *fmt, ...); > > >typedef struct { > int cmd; > int add_cmd; > int origin; > int sp; > int sy; > int have_bukva_forte; > int *secno, p_secno, n_secno; > int nphrasecmd; > int autophrase; > ssize_t order, order_inquery; > const char *qlang; >} DPS_PREPARE_STATE; > > > >/* Indexer return codes */ >enum { > DPS_OK = 0, > DPS_ERROR = 1, > DPS_NOTARGET = 2, > DPS_TERMINATED = 3, > DPS_RELOADCONFIG = 4 >}; > >/* storage types */ >enum { > > DPS_DBMODE_SINGLE = 0, > DPS_DBMODE_MULTI = 1, > DPS_DBMODE_SINGLE_CRC = 2, > DPS_DBMODE_MULTI_CRC = 3, > DPS_DBMODE_CACHE = 4 >}; > >/* database open modes */ >enum { > DPS_OPEN_MODE_READ = 0, > DPS_OPEN_MODE_WRITE = 1 >}; > >/* search modes */ >enum { > DPS_MODE_ALL = 0, > DPS_MODE_ANY = 1, > DPS_MODE_BOOL = 2, > DPS_MODE_PHRASE = 3, > DPS_MODE_NEAR = 4 >}; > >/* group by site modes */ >enum { > DPS_GROUP_NO = 0, > DPS_GROUP_YES = 1, > DPS_GROUP_FULL = 2 >}; > > >/* Flags for indexing */ >enum { > DPS_FLAG_SORT_EXPIRED = 1, > DPS_FLAG_SORT_EXPIRED_REV = 2, > DPS_FLAG_SORT_HOPS = 4, > DPS_FLAG_SORT_HOPS_REV = 8, > DPS_FLAG_SORT_SEED = 16, > DPS_FLAG_SORT_SEED2 = 32, > DPS_FLAG_SORT_POPRANK = 64, > DPS_FLAG_SORT_POPRANK_REV = 128, > > DPS_FLAG_REINDEX = 1024, > DPS_FLAG_ADD_SERV = 2048, > DPS_FLAG_SPELL = 4096, > DPS_FLAG_LOAD_LANGMAP = 8192, > DPS_FLAG_ADD_SERVURL = 16384, > DPS_FLAG_UNOCON = 32768, > DPS_FLAG_FROM_STORED = 65536, > DPS_FLAG_FAST_HREF_CHECK = 131072, > DPS_FLAG_STOPWORDS_LOOSE = 262144 >}; > >/* URLFile actions */ >enum { > DPS_URL_FILE_REINDEX = 1, > DPS_URL_FILE_CLEAR = 2, > DPS_URL_FILE_INSERT = 3, > DPS_URL_FILE_PARSE = 4, > DPS_URL_FILE_TARGET = 5 >}; > >/* Action type: HTTP methods */ >enum { > DPS_METHOD_UNKNOWN = 0, > DPS_METHOD_GET = 1, > DPS_METHOD_DISALLOW = 2, > DPS_METHOD_HEAD = 3, > DPS_METHOD_HREFONLY = 4, > DPS_METHOD_CHECKMP3 = 5, > DPS_METHOD_CHECKMP3ONLY = 6, > DPS_METHOD_VISITLATER = 7, > DPS_METHOD_INDEX = 8, > DPS_METHOD_NOINDEX = 9, > DPS_METHOD_TAG = 10, > DPS_METHOD_CATEGORY = 11, > DPS_METHOD_CRAWLDELAY = 12, > DPS_METHOD_STORE = 13, > DPS_METHOD_NOSTORE = 14, > DPS_METHOD_HOST = 15, > DPS_METHOD_POST = 16 >}; > >/* Words origins */ >enum { > DPS_WORD_ORIGIN_QUERY = 1, > DPS_WORD_ORIGIN_SPELL = 2, > DPS_WORD_ORIGIN_SYNONYM = 4, > DPS_WORD_ORIGIN_ACRONYM = 8, > DPS_WORD_ORIGIN_STOP = 16, > DPS_WORD_ORIGIN_ACCENT = 32, > DPS_WORD_ORIGIN_ASPELL = 64, > DPS_WORD_ORIGIN_COMMON = 128 >}; > >/* Locking mutex numbers */ >enum { > DPS_LOCK_CONF = 0, > DPS_LOCK_THREAD = 1, > DPS_LOCK_SEGMENTER = 2, > DPS_LOCK_DB = 3, > DPS_LOCK_RESOLV = 4, > DPS_LOCK_ROBOTS = 5, > DPS_LOCK_ASPELL = 6, > DPS_LOCK_BASE = 7, > DPS_LOCK_CACHED = 8, /* should be the last */ > DPS_LOCK_MAX = 9 >}; > > >enum { > DPS_DT_BACK = 1, > DPS_DT_ER = 2, > DPS_DT_RANGE = 3, > DPS_DT_UNKNOWN = 4 >}; > >enum { > DPS_UNIREG_SUB = 1, > DPS_UNIREG_BEG = 2, > DPS_UNIREG_END = 3, > DPS_UNIREG_INC = 4, > DPS_UNIREG_EXC = 5 >}; > >enum { > DPS_SEARCHD_CMD_ERROR = 1, > DPS_SEARCHD_CMD_MESSAGE = 2, > DPS_SEARCHD_CMD_WORDS = 3, > DPS_SEARCHD_CMD_GOODBYE = 4, > DPS_SEARCHD_CMD_DOCINFO = 5, > DPS_SEARCHD_CMD_WITHOFFSET = 7, > DPS_SEARCHD_CMD_WWL = 8, > DPS_SEARCHD_CMD_CATINFO = 9, > DPS_SEARCHD_CMD_URLACTION = 10, > DPS_SEARCHD_CMD_DOCCOUNT = 11, > DPS_SEARCHD_CMD_PERSITE = 12, > DPS_SEARCHD_CMD_DATA = 13, > DPS_SEARCHD_CMD_CLONES = 14, > DPS_SEARCHD_CMD_QLC = 15, > DPS_SEARCHD_CMD_SUGGEST = 16, > DPS_SEARCHD_CMD_TRACKDATA = 17, > DPS_SEARCHD_CMD_WORDS_ALL = 18 >}; > >enum { > DPS_LOGD_CMD_WORD = 0, > DPS_LOGD_CMD_DATA = 1, > DPS_LOGD_CMD_CHECK = 2, > DPS_LOGD_CMD_URLINFO = 3, > DPS_LOGD_CMD_FLUSH = 4, > DPS_LOGD_CMD_BYE = 5, > DPS_LOGD_CMD_DELETE = 6, > DPS_LOGD_CMD_NEWORD = 7 >}; > >enum { > DPS_LOGDEL_FLAG_DELETE = 1 >}; > >enum { > DPS_RESEGMENT_CHINESE = 1, > DPS_RESEGMENT_JAPANESE = 2, > DPS_RESEGMENT_KOREAN = 4, > DPS_RESEGMENT_THAI = 8 >}; > >enum dps_href_from { > DPS_HREF_FROM_UNKNOWN = 0, > DPS_HREF_FROM_A = 1, > DPS_HREF_FROM_AREA = 2, > DPS_HREF_FROM_BASE = 4, > DPS_HREF_FROM_FRAME = 8, > DPS_HREF_FROM_IFRAME = 16, > DPS_HREF_FROM_INPUT = 32, > DPS_HREF_FROM_IMG = 64, > DPS_HREF_FROM_LINK = 128, > DPS_HREF_FROM_SCRIPT = 256 >}; > >enum dps_use_robots { > DPS_ROBOTS_NO = 0, > DPS_ROBOTS_YES = 1, > DPS_ROBOTS_COLLECT = 2 >}; > > >extern char dps_pid_name[]; >extern unsigned int milliseconds; /* To sleep between documents */ >extern int log2stderr; > > >#define DPS_DBL_DB(A, i) ((A)->flags & DPS_FLAG_UNOCON) ? (A)->Conf->dbl.db[i] : (A)->dbl.db[i] >#define DPS_DBL_TO(A) ((A)->flags & DPS_FLAG_UNOCON) ? (A)->Conf->dbl.nitems : (A)->dbl.nitems > >#define DPS_STATUS_UPPER(I) (((I)->Flags.SubDocLevel > 0) ? 400 : 300) >#define DPS_STATUS_IN_INDEX(u,s) ((s >= 200 && s < u) || s == 304) >#define DPS_STATUS_NOT_INDEX(u,s) ((s < 200 || s >= u) && s != 304) > >#endif /* _DPS_COMMON_H */ ># 1596 "../include/dps_common.h" ># 21 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_url.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_url.h" 1 >/* Copyright (C) 2013 Maxim Zakharov. All rights reserved. > Copyright (C) 2003-2009 Datapark corp. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_URL_H >#define _DPS_URL_H > >#define DPS_URL_OK 0 >#define DPS_URL_LONG 1 >#define DPS_URL_BAD 2 >/* >#define DEBUG_URL >*/ >extern __C_LINK DPS_URL * __DPSCALL DpsURLInit(DPS_URL *url); >extern __C_LINK void __DPSCALL DpsURLFree(DPS_URL *url); >#ifdef DEBUG_URL >extern int _DpsURLParse(DPS_URL *url, const char *s, const char *file, int line); >#define DpsURLParse(u, s) _DpsURLParse(u, s, __FILE__, __LINE__) >#else ># 35 "../include/dps_url.h" >extern int DpsURLParse(DPS_URL *url,const char *s); >#endif ># 37 "../include/dps_url.h" >extern char * DpsURLNormalizePath(char * path); >extern void RelLink(DPS_AGENT *Indexer, DPS_URL *curURL, DPS_URL *newURL, char **str, int ReverseAliasFlag, int ConfFlag); > >#endif ># 41 "../include/dps_url.h" > ># 22 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_utils.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_utils.h" 1 >/* Copyright (C) 2013-2016 Maxim Zakharov. All rights reserved. > Copyright (C) 2003-2011 DataPark Ltd. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_UTILS_H >#define _DPS_UTILS_H > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_config.h" >#endif /* expanded by -frewrite-includes */ ># 24 "../include/dps_utils.h" > >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> >#endif /* expanded by -frewrite-includes */ ># 26 "../include/dps_utils.h" > >/* for time_t */ >#if 0 /* expanded by -frewrite-includes */ >#include <time.h> >#endif /* expanded by -frewrite-includes */ ># 29 "../include/dps_utils.h" > >/* for va_list */ >#if 0 /* expanded by -frewrite-includes */ >#include <stdarg.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/stdarg.h" 1 3 4 >/*- > * This file is in the public domain. > */ >/* $FreeBSD: releng/10.3/sys/amd64/include/stdarg.h 232276 2012-02-28 22:30:58Z tijl $ */ > >#if 0 /* expanded by -frewrite-includes */ >#include <x86/stdarg.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/x86/stdarg.h" 1 3 4 >/*- > * Copyright (c) 2002 David E. O'Brien. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/sys/x86/include/stdarg.h 256105 2013-10-07 10:01:23Z phk $ > */ > >#ifndef _MACHINE_STDARG_H_ >#define _MACHINE_STDARG_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 35 "/usr/include/x86/stdarg.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 36 "/usr/include/x86/stdarg.h" 3 4 > >#ifndef _VA_LIST_DECLARED >#define _VA_LIST_DECLARED >typedef __va_list va_list; >#endif ># 41 "/usr/include/x86/stdarg.h" 3 4 > >#ifdef __GNUCLIKE_BUILTIN_STDARG > >#define va_start(ap, last) \ > __builtin_va_start((ap), (last)) > >#define va_arg(ap, type) \ > __builtin_va_arg((ap), type) > >#define __va_copy(dest, src) \ > __builtin_va_copy((dest), (src)) > >#if __ISO_C_VISIBLE >= 1999 >#define va_copy(dest, src) \ > __va_copy(dest, src) >#endif ># 57 "/usr/include/x86/stdarg.h" 3 4 > >#define va_end(ap) \ > __builtin_va_end(ap) > >#elif defined(lint) ># 62 "/usr/include/x86/stdarg.h" 3 4 >/* Provide a fake implementation for lint's benefit */ >#define __va_size(type) \ > (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) >#define va_start(ap, last) \ > ((ap) = (va_list)&(last) + __va_size(last)) >#define va_copy(dst, src) \ > ((dst) = (src)) >#define va_arg(ap, type) \ > (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) >#define va_end(ap) > >#else ># 74 "/usr/include/x86/stdarg.h" 3 4 >#error this file needs to be ported to your compiler >#endif ># 76 "/usr/include/x86/stdarg.h" 3 4 > >#endif /* !_MACHINE_STDARG_H_ */ ># 78 "/usr/include/x86/stdarg.h" 3 4 ># 7 "/usr/include/stdarg.h" 2 3 4 ># 32 "../include/dps_utils.h" 2 > >#if 0 /* expanded by -frewrite-includes */ >#include <stdlib.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/stdlib.h" 1 3 4 >/*- > * Copyright (c) 1990, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)stdlib.h 8.5 (Berkeley) 5/19/95 > * $FreeBSD: releng/10.3/include/stdlib.h 264496 2014-04-15 09:41:52Z tijl $ > */ > >#ifndef _STDLIB_H_ >#define _STDLIB_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/stdlib.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_null.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/stdlib.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 39 "/usr/include/stdlib.h" 3 4 > >#if __BSD_VISIBLE >#ifndef _RUNE_T_DECLARED >typedef __rune_t rune_t; >#define _RUNE_T_DECLARED >#endif ># 45 "/usr/include/stdlib.h" 3 4 >#endif ># 46 "/usr/include/stdlib.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 51 "/usr/include/stdlib.h" 3 4 > >#ifndef __cplusplus >#ifndef _WCHAR_T_DECLARED >typedef ___wchar_t wchar_t; >#define _WCHAR_T_DECLARED >#endif ># 57 "/usr/include/stdlib.h" 3 4 >#endif ># 58 "/usr/include/stdlib.h" 3 4 > >typedef struct { > int quot; /* quotient */ > int rem; /* remainder */ >} div_t; > >typedef struct { > long quot; > long rem; >} ldiv_t; > >#define EXIT_FAILURE 1 >#define EXIT_SUCCESS 0 > >#define RAND_MAX 0x7ffffffd > >__BEGIN_DECLS >#ifdef _XLOCALE_H_ >#if 0 /* expanded by -frewrite-includes */ >#include <xlocale/_stdlib.h> >#endif /* expanded by -frewrite-includes */ ># 77 "/usr/include/stdlib.h" 3 4 >#endif ># 78 "/usr/include/stdlib.h" 3 4 >extern int __mb_cur_max; >extern int ___mb_cur_max(void); >#define MB_CUR_MAX (___mb_cur_max()) > >_Noreturn void abort(void); >int abs(int) __pure2; >int atexit(void (*)(void)); >double atof(const char *); >int atoi(const char *); >long atol(const char *); >void *bsearch(const void *, const void *, size_t, > size_t, int (*)(const void *, const void *)); >void *calloc(size_t, size_t) __malloc_like; >div_t div(int, int) __pure2; >_Noreturn void exit(int); >void free(void *); >char *getenv(const char *); >long labs(long) __pure2; >ldiv_t ldiv(long, long) __pure2; >void *malloc(size_t) __malloc_like; >int mblen(const char *, size_t); >size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); >int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); >void qsort(void *, size_t, size_t, > int (*)(const void *, const void *)); >int rand(void); >void *realloc(void *, size_t); >void srand(unsigned); >double strtod(const char * __restrict, char ** __restrict); >float strtof(const char * __restrict, char ** __restrict); >long strtol(const char * __restrict, char ** __restrict, int); >long double > strtold(const char * __restrict, char ** __restrict); >unsigned long > strtoul(const char * __restrict, char ** __restrict, int); >int system(const char *); >int wctomb(char *, wchar_t); >size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t); > >/* > * Functions added in C99 which we make conditionally available in the > * BSD^C89 namespace if the compiler supports `long long'. > * The #if test is more complicated than it ought to be because > * __BSD_VISIBLE implies __ISO_C_VISIBLE == 1999 *even if* `long long' > * is not supported in the compilation environment (which therefore means > * that it can't really be ISO C99). > * > * (The only other extension made by C99 in thie header is _Exit().) > */ >#if __ISO_C_VISIBLE >= 1999 >#ifdef __LONG_LONG_SUPPORTED >/* LONGLONG */ >typedef struct { > long long quot; > long long rem; >} lldiv_t; > >/* LONGLONG */ >long long > atoll(const char *); >/* LONGLONG */ >long long > llabs(long long) __pure2; >/* LONGLONG */ >lldiv_t lldiv(long long, long long) __pure2; >/* LONGLONG */ >long long > strtoll(const char * __restrict, char ** __restrict, int); >/* LONGLONG */ >unsigned long long > strtoull(const char * __restrict, char ** __restrict, int); >#endif /* __LONG_LONG_SUPPORTED */ ># 150 "/usr/include/stdlib.h" 3 4 > >_Noreturn void _Exit(int); >#endif /* __ISO_C_VISIBLE >= 1999 */ ># 153 "/usr/include/stdlib.h" 3 4 > >/* > * If we're in a mode greater than C99, expose C11 functions. > */ >#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L >void * aligned_alloc(size_t, size_t) __malloc_like; >int at_quick_exit(void (*)(void)); >_Noreturn void > quick_exit(int); >#endif /* __ISO_C_VISIBLE >= 2011 */ ># 163 "/usr/include/stdlib.h" 3 4 >/* > * Extensions made by POSIX relative to C. > */ >#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >char *realpath(const char * __restrict, char * __restrict); >#endif ># 169 "/usr/include/stdlib.h" 3 4 >#if __POSIX_VISIBLE >= 199506 >int rand_r(unsigned *); /* (TSF) */ >#endif ># 172 "/usr/include/stdlib.h" 3 4 >#if __POSIX_VISIBLE >= 200112 >int posix_memalign(void **, size_t, size_t); /* (ADV) */ >int setenv(const char *, const char *, int); >int unsetenv(const char *); >#endif ># 177 "/usr/include/stdlib.h" 3 4 > >#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >int getsubopt(char **, char *const *, char **); >#ifndef _MKDTEMP_DECLARED >char *mkdtemp(char *); >#define _MKDTEMP_DECLARED >#endif ># 184 "/usr/include/stdlib.h" 3 4 >#ifndef _MKSTEMP_DECLARED >int mkstemp(char *); >#define _MKSTEMP_DECLARED >#endif ># 188 "/usr/include/stdlib.h" 3 4 >#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */ ># 189 "/usr/include/stdlib.h" 3 4 > >/* > * The only changes to the XSI namespace in revision 6 were the deletion > * of the ttyslot() and valloc() functions, which FreeBSD never declared > * in this header. For revision 7, ecvt(), fcvt(), and gcvt(), which > * FreeBSD also does not have, and mktemp(), are to be deleted. > */ >#if __XSI_VISIBLE >/* XXX XSI requires pollution from <sys/wait.h> here. We'd rather not. */ >long a64l(const char *); >double drand48(void); >/* char *ecvt(double, int, int * __restrict, int * __restrict); */ >double erand48(unsigned short[3]); >/* char *fcvt(double, int, int * __restrict, int * __restrict); */ >/* char *gcvt(double, int, int * __restrict, int * __restrict); */ >int grantpt(int); >char *initstate(unsigned long /* XSI requires u_int */, char *, long); >long jrand48(unsigned short[3]); >char *l64a(long); >void lcong48(unsigned short[7]); >long lrand48(void); >#if !defined(_MKTEMP_DECLARED) && (__BSD_VISIBLE || __XSI_VISIBLE <= 600) >char *mktemp(char *); >#define _MKTEMP_DECLARED >#endif ># 214 "/usr/include/stdlib.h" 3 4 >long mrand48(void); >long nrand48(unsigned short[3]); >int posix_openpt(int); >char *ptsname(int); >int putenv(char *); >long random(void); >unsigned short > *seed48(unsigned short[3]); >#ifndef _SETKEY_DECLARED >int setkey(const char *); >#define _SETKEY_DECLARED >#endif ># 226 "/usr/include/stdlib.h" 3 4 >char *setstate(/* const */ char *); >void srand48(long); >void srandom(unsigned long); >int unlockpt(int); >#endif /* __XSI_VISIBLE */ ># 231 "/usr/include/stdlib.h" 3 4 > >#if __BSD_VISIBLE >extern const char *malloc_conf; >extern void (*malloc_message)(void *, const char *); > >/* > * The alloca() function can't be implemented in C, and on some > * platforms it can't be implemented at all as a callable function. > * The GNU C compiler provides a built-in alloca() which we can use; > * in all other cases, provide a prototype, mainly to pacify various > * incarnations of lint. On platforms where alloca() is not in libc, > * programs which use it will fail to link when compiled with non-GNU > * compilers. > */ >#if __GNUC__ >= 2 || defined(__INTEL_COMPILER) >#undef alloca /* some GNU bits try to get cute and define this on their own */ >#define alloca(sz) __builtin_alloca(sz) >#elif defined(lint) ># 249 "/usr/include/stdlib.h" 3 4 >void *alloca(size_t); >#endif ># 251 "/usr/include/stdlib.h" 3 4 > >void abort2(const char *, int, void **) __dead2; >__uint32_t > arc4random(void); >void arc4random_addrandom(unsigned char *, int); >void arc4random_buf(void *, size_t); >void arc4random_stir(void); >__uint32_t > arc4random_uniform(__uint32_t); >char *getbsize(int *, long *); > /* getcap(3) functions */ >char *cgetcap(char *, const char *, int); >int cgetclose(void); >int cgetent(char **, char **, const char *); >int cgetfirst(char **, char **); >int cgetmatch(const char *, const char *); >int cgetnext(char **, char **); >int cgetnum(char *, const char *, long *); >int cgetset(const char *); >int cgetstr(char *, const char *, char **); >int cgetustr(char *, const char *, char **); > >int daemon(int, int); >char *devname(__dev_t, __mode_t); >char *devname_r(__dev_t, __mode_t, char *, int); >char *fdevname(int); >char *fdevname_r(int, char *, int); >int getloadavg(double [], int); >const char * > getprogname(void); > >int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); >int l64a_r(long, char *, int); >int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); >int mkostemp(char *, int); >int mkostemps(char *, int, int); >void qsort_r(void *, size_t, size_t, void *, > int (*)(void *, const void *, const void *)); >int radixsort(const unsigned char **, int, const unsigned char *, > unsigned); >void *reallocf(void *, size_t); >int rpmatch(const char *); >void setprogname(const char *); >int sradixsort(const unsigned char **, int, const unsigned char *, > unsigned); >void sranddev(void); >void srandomdev(void); >long long > strtonum(const char *, long long, long long, const char **); > >/* Deprecated interfaces, to be removed in FreeBSD 6.0. */ >__int64_t > strtoq(const char *, char **, int); >__uint64_t > strtouq(const char *, char **, int); > >extern char *suboptarg; /* getsubopt(3) external variable */ >#endif /* __BSD_VISIBLE */ ># 309 "/usr/include/stdlib.h" 3 4 >__END_DECLS > >#endif /* !_STDLIB_H_ */ ># 312 "/usr/include/stdlib.h" 3 4 ># 34 "../include/dps_utils.h" 2 >#if 0 /* expanded by -frewrite-includes */ >#include <limits.h> >#endif /* expanded by -frewrite-includes */ ># 35 "../include/dps_utils.h" >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 36 "../include/dps_utils.h" >#ifdef HAVE_UNISTD_H >#if 0 /* expanded by -frewrite-includes */ ># include <unistd.h> >#endif /* expanded by -frewrite-includes */ ># 38 "../include/dps_utils.h" >#elif HAVE_BSD_UNISTD_H ># 39 "../include/dps_utils.h" >#if 0 /* expanded by -frewrite-includes */ ># include <bsd/unistd.h> >#endif /* expanded by -frewrite-includes */ ># 40 "../include/dps_utils.h" >#else ># 41 "../include/dps_utils.h" >extern char **environ; >#endif ># 43 "../include/dps_utils.h" > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_common.h" >#endif /* expanded by -frewrite-includes */ ># 45 "../include/dps_utils.h" >#if 0 /* expanded by -frewrite-includes */ >#include "dps_charsetutils.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_charsetutils.h" 1 >/* Copyright (C) 2013-2016 Maxim Zakharov. All rights reserved. > Copyright (C) 2005-2012 Datapark corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_CHARSETUTILS_H >#define _DPS_CHARSETUTILS_H > >#if 0 /* expanded by -frewrite-includes */ >#include <string.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/string.h" 1 3 4 >/*- > * Copyright (c) 1990, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)string.h 8.1 (Berkeley) 6/2/93 > * $FreeBSD: releng/10.3/include/string.h 246803 2013-02-14 19:26:58Z zeising $ > */ > >#ifndef _STRING_H_ >#define _STRING_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/string.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_null.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/string.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 39 "/usr/include/string.h" 3 4 > >/* > * Prototype functions which were historically defined in <string.h>, but > * are required by POSIX to be prototyped in <strings.h>. > */ >#if __BSD_VISIBLE >#if 0 /* expanded by -frewrite-includes */ >#include <strings.h> >#endif /* expanded by -frewrite-includes */ ># 46 "/usr/include/string.h" 3 4 >#endif ># 47 "/usr/include/string.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 52 "/usr/include/string.h" 3 4 > >__BEGIN_DECLS >#if __XSI_VISIBLE >= 600 >void *memccpy(void * __restrict, const void * __restrict, int, size_t); >#endif ># 57 "/usr/include/string.h" 3 4 >void *memchr(const void *, int, size_t) __pure; >#if __BSD_VISIBLE >void *memrchr(const void *, int, size_t) __pure; >#endif ># 61 "/usr/include/string.h" 3 4 >int memcmp(const void *, const void *, size_t) __pure; >void *memcpy(void * __restrict, const void * __restrict, size_t); >#if __BSD_VISIBLE >void *memmem(const void *, size_t, const void *, size_t) __pure; >#endif ># 66 "/usr/include/string.h" 3 4 >void *memmove(void *, const void *, size_t); >void *memset(void *, int, size_t); >#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE >char *stpcpy(char * __restrict, const char * __restrict); >char *stpncpy(char * __restrict, const char * __restrict, size_t); >#endif ># 72 "/usr/include/string.h" 3 4 >#if __BSD_VISIBLE >char *strcasestr(const char *, const char *) __pure; >#endif ># 75 "/usr/include/string.h" 3 4 >char *strcat(char * __restrict, const char * __restrict); >char *strchr(const char *, int) __pure; >#if __BSD_VISIBLE >char *strchrnul(const char*, int) __pure; >#endif ># 80 "/usr/include/string.h" 3 4 >int strcmp(const char *, const char *) __pure; >int strcoll(const char *, const char *); >char *strcpy(char * __restrict, const char * __restrict); >size_t strcspn(const char *, const char *) __pure; >#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >char *strdup(const char *) __malloc_like; >#endif ># 87 "/usr/include/string.h" 3 4 >char *strerror(int); >#if __POSIX_VISIBLE >= 200112 >int strerror_r(int, char *, size_t); >#endif ># 91 "/usr/include/string.h" 3 4 >#if __BSD_VISIBLE >size_t strlcat(char * __restrict, const char * __restrict, size_t); >size_t strlcpy(char * __restrict, const char * __restrict, size_t); >#endif ># 95 "/usr/include/string.h" 3 4 >size_t strlen(const char *) __pure; >#if __BSD_VISIBLE >void strmode(int, char *); >#endif ># 99 "/usr/include/string.h" 3 4 >char *strncat(char * __restrict, const char * __restrict, size_t); >int strncmp(const char *, const char *, size_t) __pure; >char *strncpy(char * __restrict, const char * __restrict, size_t); >#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE >char *strndup(const char *, size_t) __malloc_like; >size_t strnlen(const char *, size_t) __pure; >#endif ># 106 "/usr/include/string.h" 3 4 >#if __BSD_VISIBLE >char *strnstr(const char *, const char *, size_t) __pure; >#endif ># 109 "/usr/include/string.h" 3 4 >char *strpbrk(const char *, const char *) __pure; >char *strrchr(const char *, int) __pure; >#if __BSD_VISIBLE >char *strsep(char **, const char *); >#endif ># 114 "/usr/include/string.h" 3 4 >#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE >char *strsignal(int); >#endif ># 117 "/usr/include/string.h" 3 4 >size_t strspn(const char *, const char *) __pure; >char *strstr(const char *, const char *) __pure; >char *strtok(char * __restrict, const char * __restrict); >#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 >char *strtok_r(char *, const char *, char **); >#endif ># 123 "/usr/include/string.h" 3 4 >size_t strxfrm(char * __restrict, const char * __restrict, size_t); >#if __BSD_VISIBLE > >#ifndef _SWAB_DECLARED >#define _SWAB_DECLARED > >#ifndef _SSIZE_T_DECLARED >typedef __ssize_t ssize_t; >#define _SSIZE_T_DECLARED >#endif /* _SIZE_T_DECLARED */ ># 133 "/usr/include/string.h" 3 4 > >void swab(const void * __restrict, void * __restrict, ssize_t); >#endif /* _SWAB_DECLARED */ ># 136 "/usr/include/string.h" 3 4 > >#endif /* __BSD_VISIBLE */ ># 138 "/usr/include/string.h" 3 4 > >#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) >#if 0 /* expanded by -frewrite-includes */ >#include <xlocale/_string.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/xlocale/_string.h" 1 3 4 >/*- > * Copyright (c) 2011, 2012 The FreeBSD Foundation > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/include/xlocale/_string.h 267465 2014-06-14 02:57:40Z pfg $ > */ > >#ifndef _LOCALE_T_DEFINED >#define _LOCALE_T_DEFINED >typedef struct _xlocale *locale_t; >#endif ># 33 "/usr/include/xlocale/_string.h" 3 4 > >/* > * This file is included from both string.h and xlocale.h. We need to expose > * the declarations unconditionally if we are included from xlocale.h, but only > * if we are in POSIX2008 mode if included from string.h. > */ > >#ifndef _XLOCALE_STRING1_H >#define _XLOCALE_STRING1_H > >/* > * POSIX2008 functions > */ >int strcoll_l(const char *, const char *, locale_t); >size_t strxfrm_l(char *, const char *, size_t, locale_t); >#endif /* _XLOCALE_STRING1_H */ ># 49 "/usr/include/xlocale/_string.h" 3 4 > >/* > * xlocale extensions > */ >#ifdef _XLOCALE_H_ >#ifndef _XLOCALE_STRING2_H >#define _XLOCALE_STRING2_H >char *strcasestr_l(const char *, const char *, locale_t); > >#endif /* _XLOCALE_STRING2_H */ ># 59 "/usr/include/xlocale/_string.h" 3 4 >#endif /* _XLOCALE_H_ */ ># 60 "/usr/include/xlocale/_string.h" 3 4 ># 141 "/usr/include/string.h" 2 3 4 >#endif ># 142 "/usr/include/string.h" 3 4 >__END_DECLS > >#endif /* _STRING_H_ */ ># 145 "/usr/include/string.h" 3 4 ># 23 "../include/dps_charsetutils.h" 2 > >#define dps_memmove memmove >#define dps_memcpy memcpy >#define dps_strcpy strcpy >#define dps_strncpy strncpy >#define dps_strcat strcat >#define dps_strncat strncat >#define dps_strlen strlen > >/*extern __C_LINK void* dps_memmove(void *dst0, const void *src0, size_t length);*/ >/* >#define dps_memmove dps_memcpy >extern __C_LINK void* dps_memcpy(void *dst0, const void *src0, size_t length); >extern __C_LINK void* dps_strcpy(void *dst0, const void *src0); >extern __C_LINK void* dps_strncpy(void *dst0, const void *src0, size_t length); >extern __C_LINK void* dps_strcat(void *dst0, const void *src0); >extern __C_LINK void* dps_strncat(void *dst0, const void *src0, size_t length); >extern __C_LINK size_t dps_strlen(const char *src); >*/ > >extern char *dps_strtolower(char *str); >extern __C_LINK int dps_tolower(int c); >extern __C_LINK void dps_mstr(char *s, const char *src, size_t l1, size_t l2); > >#ifndef DPS_NULL2EMPTY >#define DPS_NULL2EMPTY(x) ((x)?(x):"") >#endif ># 50 "../include/dps_charsetutils.h" > >#ifndef DPS_NULL2STR >#define DPS_NULL2STR(x) ((x)?(x):"<NULL>") >#endif ># 54 "../include/dps_charsetutils.h" > >typedef struct { > size_t allocated_size; > size_t data_size; > size_t page_size; > int freeme; > char *data; >} DPS_DSTR; > > >DPS_DSTR *DpsDSTRInit(DPS_DSTR *dstr, size_t page_size); >void DpsDSTRFree(DPS_DSTR *dstr); >size_t DpsDSTRAppend(DPS_DSTR *dstr, const void *, size_t append_size); >size_t DpsDSTRAppendStr(DPS_DSTR *dstr, const char *); >size_t DpsDSTRAppendStrWithSpace(DPS_DSTR *dstr, const char *); >size_t DpsDSTRAppendUni(DPS_DSTR *dstr, const dpsunicode_t); >size_t DpsDSTRAppendUniStr(DPS_DSTR *dstr, const dpsunicode_t *); >size_t DpsDSTRAppendUniWithSpace(DPS_DSTR *dstr, const dpsunicode_t *data); > >int DpsUniNSpace(dpsunicode_t c); > >#endif /* _DPS_CHARSETUTILS_H */ ># 76 "../include/dps_charsetutils.h" ># 46 "../include/dps_utils.h" 2 > >/* This is used in DpsTime_t2Str and in its callers */ >#define DPS_MAXTIMESTRLEN 35 > > >/* Some useful MACROs */ >#define DPS_STREND(s) (s+strlen(s)) >#define DPS_FREE(x) {if((x)!=NULL){DpsFree((void*)(x));x=NULL;}} >#define DPS_SKIP(s,set) while((*s)&&(strchr(set,*s)))s++; >#define DPS_SKIPN(s,set) while((*s)&&(!strchr(set,*s)))s++; > > > >extern int ARGC; >extern char **ARGV; >extern char **ENVP; >#ifdef HAVE_SETPROCTITLE >#define dps_setproctitle setproctitle >#else ># 65 "../include/dps_utils.h" >void dps_setproctitle(const char *fmt, ...); >#endif ># 67 "../include/dps_utils.h" > > >/* Misc functions */ >extern int DpsInit(int argc, char **argv, char **envp); >extern void DpsDeInit(void); >extern char * DpsGetStrToken(char * s, char ** last); >extern char * DpsTrim(char * p, const char * delim); >extern char * DpsRTrim(char* p, const char * delim); >extern char * DpsUnescapeCGIQuery(char *d, const char *s); >extern char * DpsEscapeURL(char *d,const char *s); >extern char * DpsEscapeURI(char *d,const char *s); >extern char * DpsRemove2Dot(char *path); >extern char * DpsBuildParamStr(char * dst,size_t len,const char * src,char ** argv,size_t argc); >extern char * DpsStrRemoveChars(char * str, const char * sep); >extern char * DpsStrRemoveDoubleChars(char * str, const char * sep); > >/* This should convert Last-Modified time returned by webserver > * to time_t (seconds since the Epoch). -kir > */ >extern time_t DpsHttpDate2Time_t(const char * date); > >extern time_t DpsFTPDate2Time_t(char *date); > >/*********************************************************** > * converts time_str to time_t (seconds) > * time_str can be exactly number of seconds > * or in the form 'xxxA[yyyB[zzzC]]' > * (Spaces are allowed between xxx and A and yyy and so on) > * there xxx, yyy, zzz are numbers (can be negative!) > * A, B, C can be one of the following: > * s - second > * M - minute > * h - hour > * d - day > * m - month > * y - year > * (these letters are as in strptime/strftime functions) > * > * Examples: > * 1234 - 1234 seconds > * 4h30M - 4 hours and 30 minutes (will return 9000 seconds) > * 1y6m-15d - 1 year and six month minus 15 days (will return 45792000 s) > * 1h-60M+1s - 1 hour minus 60 minutes plus 1 second (will return 1 s) > */ >time_t Dps_dp2time_t(const char * time_str); > > >/* This one for printing HTTP Last-Modified: header */ >extern void DpsTime_t2HttpStr(time_t t, char * time_str); >/* This one deals with timezone offset */ >extern int DpsInitTZ(void); >extern unsigned long DpsStartTimer(void); > > >/* Probably string missing functions */ > >#ifndef HAVE_BZERO >extern __C_LINK void __DPSCALL bzero(void *b, size_t len); >#endif ># 126 "../include/dps_utils.h" > >#ifndef HAVE_STRCASECMP >extern __C_LINK int __DPSCALL strcasecmp(const char *s1, const char *s2); >#endif ># 130 "../include/dps_utils.h" > >#ifndef HAVE_STRNCASECMP >extern int strncasecmp(const char *s1, const char *s2, size_t n); >#endif ># 134 "../include/dps_utils.h" > >#ifndef HAVE_STRCASESTR >extern char * strcasestr(register const char *s1, register const char *s2); >#endif ># 138 "../include/dps_utils.h" > >#ifndef HAVE_VSNPRINTF >extern int vsnprintf(char *str, size_t size, const char *fmt, va_list ap); >#endif ># 142 "../include/dps_utils.h" > >extern __C_LINK int __DPSCALL dps_snprintf(char *str, size_t size, const char *fmt, ...); >#ifndef HAVE_SNPRINTF >#define snprintf dps_snprintf >#endif ># 147 "../include/dps_utils.h" > >extern char *dps_strtok_r(char *s, const char *delim, char **last, char *save); >#ifndef HAVE_STRTOK_R >#define strtok_r(x,y,z) dps_rstok_r((x), (y), (z), NULL); >#endif ># 152 "../include/dps_utils.h" > >extern double dps_strtod (const char *nptr, char **endptr); >#define dps_atof(x) ((x) ? dps_strtod((x), (char **)NULL):0.0) > >extern void dps_strerror(DPS_AGENT *Agent, int level, const char *fmt, ...); > > > >extern char *_DpsStrndup(const char *str, size_t len); >#ifndef EFENCE >extern char *_DpsStrdup(const char *str); >#endif ># 164 "../include/dps_utils.h" > >#if !defined(HAVE_STRNDUP) || defined(EFENCE) >#define strndup _DpsStrndup >#define DpsStrndup _DpsStrndup >#endif ># 169 "../include/dps_utils.h" > >#ifndef HAVE_HSTRERROR >extern const char *h_errlist[]; ># define hstrerror(err) ((err) <= 4 ? h_errlist[(err)] : "unknown error") >#endif ># 174 "../include/dps_utils.h" > >#ifndef HAVE_INET_NET_PTON_PROTO >int inet_net_pton(int af, const char *src, void *dst, size_t size); >#endif ># 178 "../include/dps_utils.h" > >extern __C_LINK int __DPSCALL DpsHex2Int(int h); >extern __C_LINK int __DPSCALL DpsInt2Hex(int i); > > >#define BASE64_LEN(len) (4 * (((len) + 2) / 3) +2) >extern __C_LINK size_t __DPSCALL dps_base64_encode (const char *s, char *store, size_t length); >extern __C_LINK size_t __DPSCALL dps_base64_decode (char * dst, const char * src, size_t len); >extern char * dps_rfc1522_decode(char * dst, const char *src); > >/* Build directory */ >extern int DpsBuild(const char * path, int mode); > >/* SetEnv */ >extern int DpsSetEnv(const char * name,const char * value); >extern void DpsUnsetEnv(const char * name); > >extern void DpsUniRemoveDoubleSpaces(dpsunicode_t * ustr); >extern void DpsUniPrint(const char *head, dpsunicode_t * ustr); > >extern void DpsWriteLock(int fd); >extern void DpsUnLock(int fd); >extern void DpsReadLock(int fd); >extern void DpsReadLockFILE(FILE *f); >extern __C_LINK void __DPSCALL DpsWriteLockFILE(FILE *f); >extern __C_LINK void __DPSCALL DpsUnLockFILE(FILE *f); > >extern FILE * dps_fopen(const char *path, const char *mode); >extern int dps_demonize(void); >extern void * dps_bsearch(const void *key, const void *base0, size_t nmemb0, size_t size, int (*compar)(const void *, const void *)); >#if HAVE_HEAPSORT >#if HAVE_BSD_STDLIB_H >#if 0 /* expanded by -frewrite-includes */ >#include <bsd/stdlib.h> >#endif /* expanded by -frewrite-includes */ ># 211 "../include/dps_utils.h" >#else ># 212 "../include/dps_utils.h" >#if 0 /* expanded by -frewrite-includes */ >#include <stdlib.h> >#endif /* expanded by -frewrite-includes */ ># 213 "../include/dps_utils.h" >#endif ># 214 "../include/dps_utils.h" >#else ># 215 "../include/dps_utils.h" >extern int heapsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); >#endif ># 217 "../include/dps_utils.h" > > >/* NULL safe atoi*/ >/*#define DPS_ATOI(x) ((x)?atoi(x):0)*/ >#define DPS_ATOI(x) ((x)?(int)strtol((x), (char **)NULL, 0):0) >#define DPS_HTOI(x) ((x)?(int)strtol((x), (char **)NULL, 16):0) >/*#define DPS_ATOF(x) ((x)?atof(x):0.0)*/ >#define DPS_ATOF(x) ((x)?strtod(x, (char **)NULL):0.0) >#define DPS_ATOU(x) ((x)?(urlid_t)strtoll((x), (char**)NULL,0):0) >#define DPS_NULL2EMPTY(x) ((x)?(x):"") >#define DPD_NULL2STR(x) ((x)?(x):"<NULL>") > > > >#ifdef WITH_TRACE > > >#define TRACE_IN(A, fn) { \ > register int trace_i; \ > register unsigned long trace_ticks = DpsStartTimer(); \ > fprintf(A->TR, "%lu [%d] in ", trace_ticks, A->handle); \ > for (trace_i = 0; trace_i < A->level; trace_i++) fprintf(A->TR, "-"); \ > A->level++; \ > fprintf(A->TR, "%s at %s:%d\n", fn, __FILE__, __LINE__); \ > fflush(A->TR); \ >} >#define TRACE_OUT(A) { \ > register int trace_i; \ > register unsigned long trace_ticks = DpsStartTimer(); \ > fprintf(A->TR, "%lu [%d] out", trace_ticks, A->handle); \ > if (A->level) A->level--; \ > for (trace_i = 0; trace_i < A->level; trace_i++) fprintf(A->TR, "-"); \ > fprintf(A->TR, "at %s:%d\n", __FILE__, __LINE__); \ > fflush(A->TR); \ >} > >#define TRACE_LINE(A) { \ > register int trace_i; \ > register unsigned long trace_ticks = DpsStartTimer(); \ > fprintf(A->TR, "%lu [%d] got", trace_ticks, A->handle); \ > for (trace_i = 0; trace_i < A->level; trace_i++) fprintf(A->TR, "-"); \ > fprintf(A->TR, "the %s:%d\n", __FILE__, __LINE__); \ > fflush(A->TR); \ >} > > >#else ># 264 "../include/dps_utils.h" > >#define TRACE_IN(A, fn) >#define TRACE_OUT(A) >#define TRACE_LINE(A) > >#endif ># 270 "../include/dps_utils.h" > > >#define __ fprintf(stderr, " == %s:%d\n", __FILE__, __LINE__); > > >#endif /* _DPS_UTILS_H */ ># 276 "../include/dps_utils.h" ># 23 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_charsetutils.h" >#endif /* expanded by -frewrite-includes */ ># 24 "url.c" >#if 0 /* expanded by -frewrite-includes */ >#include "dps_log.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_log.h" 1 >/* Copyright (C) 2003-2009 Datapark corp. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_LOG_H >#define _DPS_LOG_H >/* >#define DEBUG_LOG 1 >*/ >#if 0 /* expanded by -frewrite-includes */ >#include "dps_config.h" >#endif /* expanded by -frewrite-includes */ ># 25 "../include/dps_log.h" >#if 0 /* expanded by -frewrite-includes */ >#include "dps_common.h" /* for DPS_ENV etc. */ >#endif /* expanded by -frewrite-includes */ ># 26 "../include/dps_log.h" >#ifdef HAVE_SYSLOG_H >#if 0 /* expanded by -frewrite-includes */ >#include <syslog.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/syslog.h" 1 3 4 >/*- > * Copyright (c) 1982, 1986, 1988, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)syslog.h 8.1 (Berkeley) 6/2/93 > * $FreeBSD: releng/10.3/sys/sys/syslog.h 249311 2013-04-09 16:16:34Z ed $ > */ > >#ifndef _SYS_SYSLOG_H_ >#define _SYS_SYSLOG_H_ > >#define _PATH_LOG "/var/run/log" >#define _PATH_LOG_PRIV "/var/run/logpriv" >#define _PATH_OLDLOG "/dev/log" /* backward compatibility */ > >/* > * priorities/facilities are encoded into a single 32-bit quantity, where the > * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility > * (0-big number). Both the priorities and the facilities map roughly > * one-to-one to strings in the syslogd(8) source code. This mapping is > * included in this file. > * > * priorities (these are ordered) > */ >#define LOG_EMERG 0 /* system is unusable */ >#define LOG_ALERT 1 /* action must be taken immediately */ >#define LOG_CRIT 2 /* critical conditions */ >#define LOG_ERR 3 /* error conditions */ >#define LOG_WARNING 4 /* warning conditions */ >#define LOG_NOTICE 5 /* normal but significant condition */ >#define LOG_INFO 6 /* informational */ >#define LOG_DEBUG 7 /* debug-level messages */ > >#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ > /* extract priority */ >#define LOG_PRI(p) ((p) & LOG_PRIMASK) >#define LOG_MAKEPRI(fac, pri) ((fac) | (pri)) > >#ifdef SYSLOG_NAMES >#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ > /* mark "facility" */ >#define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0) >typedef struct _code { > const char *c_name; > int c_val; >} CODE; > >static const CODE prioritynames[] = { > { "alert", LOG_ALERT, }, > { "crit", LOG_CRIT, }, > { "debug", LOG_DEBUG, }, > { "emerg", LOG_EMERG, }, > { "err", LOG_ERR, }, > { "error", LOG_ERR, }, /* DEPRECATED */ > { "info", LOG_INFO, }, > { "none", INTERNAL_NOPRI, }, /* INTERNAL */ > { "notice", LOG_NOTICE, }, > { "panic", LOG_EMERG, }, /* DEPRECATED */ > { "warn", LOG_WARNING, }, /* DEPRECATED */ > { "warning", LOG_WARNING, }, > { NULL, -1, } >}; >#endif ># 88 "/usr/include/syslog.h" 3 4 > >/* facility codes */ >#define LOG_KERN (0<<3) /* kernel messages */ >#define LOG_USER (1<<3) /* random user-level messages */ >#define LOG_MAIL (2<<3) /* mail system */ >#define LOG_DAEMON (3<<3) /* system daemons */ >#define LOG_AUTH (4<<3) /* authorization messages */ >#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ >#define LOG_LPR (6<<3) /* line printer subsystem */ >#define LOG_NEWS (7<<3) /* network news subsystem */ >#define LOG_UUCP (8<<3) /* UUCP subsystem */ >#define LOG_CRON (9<<3) /* clock daemon */ >#define LOG_AUTHPRIV (10<<3) /* authorization messages (private) */ > /* Facility #10 clashes in DEC UNIX, where */ > /* it's defined as LOG_MEGASAFE for AdvFS */ > /* event logging. */ >#define LOG_FTP (11<<3) /* ftp daemon */ >#define LOG_NTP (12<<3) /* NTP subsystem */ >#define LOG_SECURITY (13<<3) /* security subsystems (firewalling, etc.) */ >#define LOG_CONSOLE (14<<3) /* /dev/console output */ > > /* other codes through 15 reserved for system use */ >#define LOG_LOCAL0 (16<<3) /* reserved for local use */ >#define LOG_LOCAL1 (17<<3) /* reserved for local use */ >#define LOG_LOCAL2 (18<<3) /* reserved for local use */ >#define LOG_LOCAL3 (19<<3) /* reserved for local use */ >#define LOG_LOCAL4 (20<<3) /* reserved for local use */ >#define LOG_LOCAL5 (21<<3) /* reserved for local use */ >#define LOG_LOCAL6 (22<<3) /* reserved for local use */ >#define LOG_LOCAL7 (23<<3) /* reserved for local use */ > >#define LOG_NFACILITIES 24 /* current number of facilities */ >#define LOG_FACMASK 0x03f8 /* mask to extract facility part */ > /* facility of pri */ >#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) > >#ifdef SYSLOG_NAMES >static const CODE facilitynames[] = { > { "auth", LOG_AUTH, }, > { "authpriv", LOG_AUTHPRIV, }, > { "console", LOG_CONSOLE, }, > { "cron", LOG_CRON, }, > { "daemon", LOG_DAEMON, }, > { "ftp", LOG_FTP, }, > { "kern", LOG_KERN, }, > { "lpr", LOG_LPR, }, > { "mail", LOG_MAIL, }, > { "mark", INTERNAL_MARK, }, /* INTERNAL */ > { "news", LOG_NEWS, }, > { "ntp", LOG_NTP, }, > { "security", LOG_SECURITY, }, > { "syslog", LOG_SYSLOG, }, > { "user", LOG_USER, }, > { "uucp", LOG_UUCP, }, > { "local0", LOG_LOCAL0, }, > { "local1", LOG_LOCAL1, }, > { "local2", LOG_LOCAL2, }, > { "local3", LOG_LOCAL3, }, > { "local4", LOG_LOCAL4, }, > { "local5", LOG_LOCAL5, }, > { "local6", LOG_LOCAL6, }, > { "local7", LOG_LOCAL7, }, > { NULL, -1, } >}; >#endif ># 153 "/usr/include/syslog.h" 3 4 > >#ifdef _KERNEL >#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */ >#endif ># 157 "/usr/include/syslog.h" 3 4 > >/* > * arguments to setlogmask. > */ >#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ >#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ > >/* > * Option flags for openlog. > * > * LOG_ODELAY no longer does anything. > * LOG_NDELAY is the inverse of what it used to be. > */ >#define LOG_PID 0x01 /* log the pid with each message */ >#define LOG_CONS 0x02 /* log on the console if errors in sending */ >#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ >#define LOG_NDELAY 0x08 /* don't delay open */ >#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ >#define LOG_PERROR 0x20 /* log to stderr as well */ > >#ifdef _KERNEL > >#else /* not _KERNEL */ ># 180 "/usr/include/syslog.h" 3 4 > >/* > * Don't use va_list in the vsyslog() prototype. Va_list is typedef'd in two > * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one > * of them here we may collide with the utility's includes. It's unreasonable > * for utilities to have to include one of them to include syslog.h, so we get > * __va_list from <sys/_types.h> and use it. > */ >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 189 "/usr/include/syslog.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 190 "/usr/include/syslog.h" 3 4 > >__BEGIN_DECLS >void closelog(void); >void openlog(const char *, int, int); >int setlogmask(int); >void syslog(int, const char *, ...) __printflike(2, 3); >#if __BSD_VISIBLE >void vsyslog(int, const char *, __va_list) __printflike(2, 0); >#endif ># 199 "/usr/include/syslog.h" 3 4 >__END_DECLS > >#endif /* !_KERNEL */ ># 202 "/usr/include/syslog.h" 3 4 > >#endif ># 204 "/usr/include/syslog.h" 3 4 ># 28 "../include/dps_log.h" 2 >#endif ># 29 "../include/dps_log.h" > >/* Define default log facility */ >#ifdef HAVE_SYSLOG_H >#ifndef LOG_FACILITY >#define LOG_FACILITY LOG_LOCAL7 >#endif /* LOG_FACILITY */ ># 35 "../include/dps_log.h" >#else ># 36 "../include/dps_log.h" >#define LOG_FACILITY 0 >#endif ># 38 "../include/dps_log.h" > >/* According to some recommendations, try not to exceed about 800 bytes > or you might have problems with old syslog implementations */ >#define DPS_LOG_BUF_LEN 480 > >/* Verbose levels */ >#define DPS_LOG_NONE 0 >#define DPS_LOG_ERROR 1 >#define DPS_LOG_WARN 2 >#define DPS_LOG_INFO 3 >#define DPS_LOG_EXTRA 4 >#define DPS_LOG_DEBUG 5 > >extern int DpsOpenLog(const char * appname,DPS_ENV *Env, int log2stderr_fl); > >extern void DpsLog(DPS_AGENT *Agent, int level, const char *fmt, ...); >/* if you do not have DPS_AGENT struct yet, use DpsLog_noagent */ >extern void DpsLog_noagent(DPS_ENV *Env, int level, const char *fmt, ...); > >extern __C_LINK void __DPSCALL DpsSetLogLevel(DPS_AGENT *A, int level); >extern __C_LINK void __DPSCALL DpsIncLogLevel(DPS_AGENT *A); >extern __C_LINK void __DPSCALL DpsDecLogLevel(DPS_AGENT *A); >extern __C_LINK int __DPSCALL DpsSetThreadProc(DPS_ENV * Conf,void (*_ThreadInfo)(DPS_AGENT* A,const char *state, const char* str)); >extern __C_LINK int __DPSCALL DpsSetRefProc(DPS_ENV * Conf,void (*_RefProc)(int code,const char *url, const char *ref)); >extern __C_LINK int __DPSCALL DpsNeedLog(int level); > >#endif /* _DPS_LOG_H */ ># 65 "../include/dps_log.h" ># 25 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_match.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_match.h" 1 >/* Copyright (C) 2003-2009, Datapark corp. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_MATCH_H >#define _DPS_MATCH_H > >extern int DpsMatchComp(DPS_MATCH *Match, char *errstr, size_t errstrsize); >extern void DpsMatchFree(DPS_MATCH *Match); >extern int DpsMatchExec(DPS_MATCH *Match, const char *string, const char *net_string, > struct sockaddr_in *sin, size_t nparts, DPS_MATCH_PART *Parts); >extern int DpsMatchApply(char *res,size_t ressize,const char *src,const char *rpl,DPS_MATCH *Match,size_t nparts, DPS_MATCH_PART *Parts); > >extern DPS_MATCHLIST *DpsMatchListInit(DPS_MATCHLIST *L); >extern void DpsMatchListFree(DPS_MATCHLIST *L); >extern int DpsMatchListAdd(DPS_AGENT *A, DPS_MATCHLIST *L, DPS_MATCH *M, char *err, size_t errsize, int ordre); > >extern __C_LINK DPS_MATCH * __DPSCALL DpsMatchListFind(DPS_MATCHLIST * List,const char *string,size_t nparts, DPS_MATCH_PART *Parts); >extern DPS_MATCH * __DPSCALL DpsSectionMatchListFind(DPS_MATCHLIST *L, DPS_DOCUMENT *Doc, size_t nparts, DPS_MATCH_PART *Parts); > >extern const char *DpsMatchTypeStr(int m); > >extern DPS_MATCH *DpsMatchInit(DPS_MATCH *M); > > > >extern void DpsUniMatchFree(DPS_UNIMATCH *Match); >extern DPS_UNIMATCHLIST *DpsUniMatchListInit(DPS_UNIMATCHLIST *L); >extern void DpsUniMatchListFree(DPS_UNIMATCHLIST *L); >extern int DpsUniMatchListAdd(DPS_AGENT *A, DPS_UNIMATCHLIST *L, DPS_UNIMATCH *M, char *err, size_t errsize, int ordre); >extern DPS_UNIMATCH * DpsUniMatchListFind(DPS_UNIMATCHLIST *L, const dpsunicode_t *str, size_t nparts, DPS_MATCH_PART *Parts); >extern int DpsUniMatchComp(DPS_UNIMATCH *Match, char *errstr, size_t errstrsize); >extern int DpsUniMatchExec(DPS_UNIMATCH *Match, const dpsunicode_t *string, const dpsunicode_t *net_string, struct sockaddr_in *sin, > size_t nparts, DPS_MATCH_PART * Parts); >extern DPS_UNIMATCH *DpsUniMatchInit(DPS_UNIMATCH *M); > > > > >#endif ># 55 "../include/dps_match.h" ># 26 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_vars.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_vars.h" 1 >/* Copyright (C) 2003-2005 Datapark corp. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_VARS_H >#define _DPS_VARS_H > >extern DPS_VARLIST *DpsVarListInit(DPS_VARLIST * vars); >extern void DpsVarListFree(DPS_VARLIST * vars); >extern void DpsVarFree(DPS_VAR *); > >extern int DpsVarListAddEnviron(DPS_VARLIST *vars, const char *name); > >extern int DpsVarListAddStr(DPS_VARLIST * vars,const char * name, const char * val); >extern int DpsVarListAddInt(DPS_VARLIST * vars,const char * name, int val); >extern int DpsVarListAddUnsigned(DPS_VARLIST * vars, const char * name, dps_uint4 val); >extern int DpsVarListAddDouble(DPS_VARLIST * vars, const char * name, double val); >extern int DpsVarListAdd(DPS_VARLIST * Lst,DPS_VAR * S); >extern int DpsVarListDel(DPS_VARLIST * Lst,const char *name); >extern int DpsVarListReplace(DPS_VARLIST * Lst,DPS_VAR * S); > >extern int DpsVarListAddLst(DPS_VARLIST * Lst,DPS_VARLIST *Src, const char *name, const char *w); >extern int DpsVarListInsLst(DPS_VARLIST * Lst,DPS_VARLIST *Src, const char *name, const char *w); >extern int DpsVarListReplaceLst(DPS_VARLIST * Lst,DPS_VARLIST *Src, const char *name, const char *w); >extern int DpsVarListDelLst(DPS_VARLIST *D, DPS_VARLIST *S, const char *name, const char *mask); > >extern __C_LINK int __DPSCALL DpsVarListReplaceStr(DPS_VARLIST * vars,const char * name,const char * val); >extern __C_LINK int __DPSCALL DpsVarListReplaceInt(DPS_VARLIST * vars,const char * name,int val); >extern __C_LINK int __DPSCALL DpsVarListReplaceUnsigned(DPS_VARLIST * vars, const char * name, unsigned val); >extern int DpsVarListReplaceDouble(DPS_VARLIST * vars, const char * name, double val); > >extern int DpsVarListInsStr(DPS_VARLIST * vars,const char * name,const char * val); >extern int DpsVarListInsInt(DPS_VARLIST * vars,const char * name,int val); > >extern DPS_VAR *DpsVarListFind(DPS_VARLIST * vars,const char * name); >extern DPS_VAR *DpsVarListFindWithValue(DPS_VARLIST * vars,const char * name,const char * val); > >extern char * DpsVarListFindStr(DPS_VARLIST * vars,const char * name,const char * defval); >extern char * DpsVarListFindStrTxt(DPS_VARLIST * vars,const char * name,const char * defval); >extern int DpsVarListFindInt(DPS_VARLIST * vars,const char * name,int defval); >extern unsigned DpsVarListFindUnsigned(DPS_VARLIST * vars, const char * name, unsigned defval); >extern double DpsVarListFindDouble(DPS_VARLIST * vars, const char * name, double defval); > >extern int DpsVarListLog(DPS_AGENT *A,DPS_VARLIST *V,int l,const char *pre); > > >#endif ># 62 "../include/dps_vars.h" ># 27 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_mutex.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_mutex.h" 1 >/* Copyright (C) 2013-2016 Maxim Zakharov. All rights reserved. > Copyright (C) 2003-2011 DataPark Ltd. All rights reserved. > Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _DPS_MUTEX_H >#define _DPS_MUTEX_H > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 24 "../include/dps_mutex.h" > >#ifdef HAVE_SYS_SYSCTL_H >#if 0 /* expanded by -frewrite-includes */ >#include <sys/sysctl.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/sysctl.h" 1 3 4 >/*- > * Copyright (c) 1989, 1993 > * The Regents of the University of California. All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * Mike Karels at Berkeley Software Design, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 > * $FreeBSD: releng/10.3/sys/sys/sysctl.h 273736 2014-10-27 14:38:00Z hselasky $ > */ > >#ifndef _SYS_SYSCTL_H_ >#define _SYS_SYSCTL_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/queue.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/sys/queue.h" 1 3 4 >/*- > * Copyright (c) 1991, 1993 > * The Regents of the University of California. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 4. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)queue.h 8.5 (Berkeley) 8/20/94 > * $FreeBSD: releng/10.3/sys/sys/queue.h 289018 2015-10-08 07:50:50Z hselasky $ > */ > >#ifndef _SYS_QUEUE_H_ >#define _SYS_QUEUE_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 37 "/usr/include/sys/queue.h" 3 4 > >/* > * This file defines four types of data structures: singly-linked lists, > * singly-linked tail queues, lists and tail queues. > * > * A singly-linked list is headed by a single forward pointer. The elements > * are singly linked for minimum space and pointer manipulation overhead at > * the expense of O(n) removal for arbitrary elements. New elements can be > * added to the list after an existing element or at the head of the list. > * Elements being removed from the head of the list should use the explicit > * macro for this purpose for optimum efficiency. A singly-linked list may > * only be traversed in the forward direction. Singly-linked lists are ideal > * for applications with large datasets and few or no removals or for > * implementing a LIFO queue. > * > * A singly-linked tail queue is headed by a pair of pointers, one to the > * head of the list and the other to the tail of the list. The elements are > * singly linked for minimum space and pointer manipulation overhead at the > * expense of O(n) removal for arbitrary elements. New elements can be added > * to the list after an existing element, at the head of the list, or at the > * end of the list. Elements being removed from the head of the tail queue > * should use the explicit macro for this purpose for optimum efficiency. > * A singly-linked tail queue may only be traversed in the forward direction. > * Singly-linked tail queues are ideal for applications with large datasets > * and few or no removals or for implementing a FIFO queue. > * > * A list is headed by a single forward pointer (or an array of forward > * pointers for a hash table header). The elements are doubly linked > * so that an arbitrary element can be removed without a need to > * traverse the list. New elements can be added to the list before > * or after an existing element or at the head of the list. A list > * may be traversed in either direction. > * > * A tail queue is headed by a pair of pointers, one to the head of the > * list and the other to the tail of the list. The elements are doubly > * linked so that an arbitrary element can be removed without a need to > * traverse the list. New elements can be added to the list before or > * after an existing element, at the head of the list, or at the end of > * the list. A tail queue may be traversed in either direction. > * > * For details on the use of these macros, see the queue(3) manual page. > * > * > * SLIST LIST STAILQ TAILQ > * _HEAD + + + + > * _CLASS_HEAD + + + + > * _HEAD_INITIALIZER + + + + > * _ENTRY + + + + > * _CLASS_ENTRY + + + + > * _INIT + + + + > * _EMPTY + + + + > * _FIRST + + + + > * _NEXT + + + + > * _PREV - + - + > * _LAST - - + + > * _FOREACH + + + + > * _FOREACH_FROM + + + + > * _FOREACH_SAFE + + + + > * _FOREACH_FROM_SAFE + + + + > * _FOREACH_REVERSE - - - + > * _FOREACH_REVERSE_FROM - - - + > * _FOREACH_REVERSE_SAFE - - - + > * _FOREACH_REVERSE_FROM_SAFE - - - + > * _INSERT_HEAD + + + + > * _INSERT_BEFORE - + - + > * _INSERT_AFTER + + + + > * _INSERT_TAIL - - + + > * _CONCAT - - + + > * _REMOVE_AFTER + - + - > * _REMOVE_HEAD + - + - > * _REMOVE + + + + > * _SWAP + + + + > * > */ >#ifdef QUEUE_MACRO_DEBUG >/* Store the last 2 places the queue element or head was altered */ >struct qm_trace { > unsigned long lastline; > unsigned long prevline; > const char *lastfile; > const char *prevfile; >}; > >#define TRACEBUF struct qm_trace trace; >#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } , >#define TRASHIT(x) do {(x) = (void *)-1;} while (0) >#define QMD_SAVELINK(name, link) void **name = (void *)&(link) > >#define QMD_TRACE_HEAD(head) do { \ > (head)->trace.prevline = (head)->trace.lastline; \ > (head)->trace.prevfile = (head)->trace.lastfile; \ > (head)->trace.lastline = __LINE__; \ > (head)->trace.lastfile = __FILE__; \ >} while (0) > >#define QMD_TRACE_ELEM(elem) do { \ > (elem)->trace.prevline = (elem)->trace.lastline; \ > (elem)->trace.prevfile = (elem)->trace.lastfile; \ > (elem)->trace.lastline = __LINE__; \ > (elem)->trace.lastfile = __FILE__; \ >} while (0) > >#else ># 140 "/usr/include/sys/queue.h" 3 4 >#define QMD_TRACE_ELEM(elem) >#define QMD_TRACE_HEAD(head) >#define QMD_SAVELINK(name, link) >#define TRACEBUF >#define TRACEBUF_INITIALIZER >#define TRASHIT(x) >#endif /* QUEUE_MACRO_DEBUG */ ># 147 "/usr/include/sys/queue.h" 3 4 > >#ifdef __cplusplus >/* > * In C++ there can be structure lists and class lists: > */ >#define QUEUE_TYPEOF(type) type >#else ># 154 "/usr/include/sys/queue.h" 3 4 >#define QUEUE_TYPEOF(type) struct type >#endif ># 156 "/usr/include/sys/queue.h" 3 4 > >/* > * Singly-linked List declarations. > */ >#define SLIST_HEAD(name, type) \ >struct name { \ > struct type *slh_first; /* first element */ \ >} > >#define SLIST_CLASS_HEAD(name, type) \ >struct name { \ > class type *slh_first; /* first element */ \ >} > >#define SLIST_HEAD_INITIALIZER(head) \ > { NULL } > >#define SLIST_ENTRY(type) \ >struct { \ > struct type *sle_next; /* next element */ \ >} > >#define SLIST_CLASS_ENTRY(type) \ >struct { \ > class type *sle_next; /* next element */ \ >} > >/* > * Singly-linked List functions. > */ >#define SLIST_EMPTY(head) ((head)->slh_first == NULL) > >#define SLIST_FIRST(head) ((head)->slh_first) > >#define SLIST_FOREACH(var, head, field) \ > for ((var) = SLIST_FIRST((head)); \ > (var); \ > (var) = SLIST_NEXT((var), field)) > >#define SLIST_FOREACH_FROM(var, head, field) \ > for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \ > (var); \ > (var) = SLIST_NEXT((var), field)) > >#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ > for ((var) = SLIST_FIRST((head)); \ > (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ > for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \ > (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ > for ((varp) = &SLIST_FIRST((head)); \ > ((var) = *(varp)) != NULL; \ > (varp) = &SLIST_NEXT((var), field)) > >#define SLIST_INIT(head) do { \ > SLIST_FIRST((head)) = NULL; \ >} while (0) > >#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ > SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ > SLIST_NEXT((slistelm), field) = (elm); \ >} while (0) > >#define SLIST_INSERT_HEAD(head, elm, field) do { \ > SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ > SLIST_FIRST((head)) = (elm); \ >} while (0) > >#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) > >#define SLIST_REMOVE(head, elm, type, field) do { \ > QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ > if (SLIST_FIRST((head)) == (elm)) { \ > SLIST_REMOVE_HEAD((head), field); \ > } \ > else { \ > QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \ > while (SLIST_NEXT(curelm, field) != (elm)) \ > curelm = SLIST_NEXT(curelm, field); \ > SLIST_REMOVE_AFTER(curelm, field); \ > } \ > TRASHIT(*oldnext); \ >} while (0) > >#define SLIST_REMOVE_AFTER(elm, field) do { \ > SLIST_NEXT(elm, field) = \ > SLIST_NEXT(SLIST_NEXT(elm, field), field); \ >} while (0) > >#define SLIST_REMOVE_HEAD(head, field) do { \ > SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ >} while (0) > >#define SLIST_SWAP(head1, head2, type) do { \ > QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \ > SLIST_FIRST(head1) = SLIST_FIRST(head2); \ > SLIST_FIRST(head2) = swap_first; \ >} while (0) > >/* > * Singly-linked Tail queue declarations. > */ >#define STAILQ_HEAD(name, type) \ >struct name { \ > struct type *stqh_first;/* first element */ \ > struct type **stqh_last;/* addr of last next element */ \ >} > >#define STAILQ_CLASS_HEAD(name, type) \ >struct name { \ > class type *stqh_first; /* first element */ \ > class type **stqh_last; /* addr of last next element */ \ >} > >#define STAILQ_HEAD_INITIALIZER(head) \ > { NULL, &(head).stqh_first } > >#define STAILQ_ENTRY(type) \ >struct { \ > struct type *stqe_next; /* next element */ \ >} > >#define STAILQ_CLASS_ENTRY(type) \ >struct { \ > class type *stqe_next; /* next element */ \ >} > >/* > * Singly-linked Tail queue functions. > */ >#define STAILQ_CONCAT(head1, head2) do { \ > if (!STAILQ_EMPTY((head2))) { \ > *(head1)->stqh_last = (head2)->stqh_first; \ > (head1)->stqh_last = (head2)->stqh_last; \ > STAILQ_INIT((head2)); \ > } \ >} while (0) > >#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) > >#define STAILQ_FIRST(head) ((head)->stqh_first) > >#define STAILQ_FOREACH(var, head, field) \ > for((var) = STAILQ_FIRST((head)); \ > (var); \ > (var) = STAILQ_NEXT((var), field)) > >#define STAILQ_FOREACH_FROM(var, head, field) \ > for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ > (var); \ > (var) = STAILQ_NEXT((var), field)) > >#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ > for ((var) = STAILQ_FIRST((head)); \ > (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ > for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ > (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define STAILQ_INIT(head) do { \ > STAILQ_FIRST((head)) = NULL; \ > (head)->stqh_last = &STAILQ_FIRST((head)); \ >} while (0) > >#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ > if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ > (head)->stqh_last = &STAILQ_NEXT((elm), field); \ > STAILQ_NEXT((tqelm), field) = (elm); \ >} while (0) > >#define STAILQ_INSERT_HEAD(head, elm, field) do { \ > if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ > (head)->stqh_last = &STAILQ_NEXT((elm), field); \ > STAILQ_FIRST((head)) = (elm); \ >} while (0) > >#define STAILQ_INSERT_TAIL(head, elm, field) do { \ > STAILQ_NEXT((elm), field) = NULL; \ > *(head)->stqh_last = (elm); \ > (head)->stqh_last = &STAILQ_NEXT((elm), field); \ >} while (0) > >#define STAILQ_LAST(head, type, field) \ > (STAILQ_EMPTY((head)) ? NULL : \ > __containerof((head)->stqh_last, \ > QUEUE_TYPEOF(type), field.stqe_next)) > >#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) > >#define STAILQ_REMOVE(head, elm, type, field) do { \ > QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ > if (STAILQ_FIRST((head)) == (elm)) { \ > STAILQ_REMOVE_HEAD((head), field); \ > } \ > else { \ > QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \ > while (STAILQ_NEXT(curelm, field) != (elm)) \ > curelm = STAILQ_NEXT(curelm, field); \ > STAILQ_REMOVE_AFTER(head, curelm, field); \ > } \ > TRASHIT(*oldnext); \ >} while (0) > >#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ > if ((STAILQ_NEXT(elm, field) = \ > STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ > (head)->stqh_last = &STAILQ_NEXT((elm), field); \ >} while (0) > >#define STAILQ_REMOVE_HEAD(head, field) do { \ > if ((STAILQ_FIRST((head)) = \ > STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ > (head)->stqh_last = &STAILQ_FIRST((head)); \ >} while (0) > >#define STAILQ_SWAP(head1, head2, type) do { \ > QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \ > QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \ > STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ > (head1)->stqh_last = (head2)->stqh_last; \ > STAILQ_FIRST(head2) = swap_first; \ > (head2)->stqh_last = swap_last; \ > if (STAILQ_EMPTY(head1)) \ > (head1)->stqh_last = &STAILQ_FIRST(head1); \ > if (STAILQ_EMPTY(head2)) \ > (head2)->stqh_last = &STAILQ_FIRST(head2); \ >} while (0) > > >/* > * List declarations. > */ >#define LIST_HEAD(name, type) \ >struct name { \ > struct type *lh_first; /* first element */ \ >} > >#define LIST_CLASS_HEAD(name, type) \ >struct name { \ > class type *lh_first; /* first element */ \ >} > >#define LIST_HEAD_INITIALIZER(head) \ > { NULL } > >#define LIST_ENTRY(type) \ >struct { \ > struct type *le_next; /* next element */ \ > struct type **le_prev; /* address of previous next element */ \ >} > >#define LIST_CLASS_ENTRY(type) \ >struct { \ > class type *le_next; /* next element */ \ > class type **le_prev; /* address of previous next element */ \ >} > >/* > * List functions. > */ > >#if (defined(_KERNEL) && defined(INVARIANTS)) >#define QMD_LIST_CHECK_HEAD(head, field) do { \ > if (LIST_FIRST((head)) != NULL && \ > LIST_FIRST((head))->field.le_prev != \ > &LIST_FIRST((head))) \ > panic("Bad list head %p first->prev != head", (head)); \ >} while (0) > >#define QMD_LIST_CHECK_NEXT(elm, field) do { \ > if (LIST_NEXT((elm), field) != NULL && \ > LIST_NEXT((elm), field)->field.le_prev != \ > &((elm)->field.le_next)) \ > panic("Bad link elm %p next->prev != elm", (elm)); \ >} while (0) > >#define QMD_LIST_CHECK_PREV(elm, field) do { \ > if (*(elm)->field.le_prev != (elm)) \ > panic("Bad link elm %p prev->next != elm", (elm)); \ >} while (0) >#else ># 445 "/usr/include/sys/queue.h" 3 4 >#define QMD_LIST_CHECK_HEAD(head, field) >#define QMD_LIST_CHECK_NEXT(elm, field) >#define QMD_LIST_CHECK_PREV(elm, field) >#endif /* (_KERNEL && INVARIANTS) */ ># 449 "/usr/include/sys/queue.h" 3 4 > >#define LIST_EMPTY(head) ((head)->lh_first == NULL) > >#define LIST_FIRST(head) ((head)->lh_first) > >#define LIST_FOREACH(var, head, field) \ > for ((var) = LIST_FIRST((head)); \ > (var); \ > (var) = LIST_NEXT((var), field)) > >#define LIST_FOREACH_FROM(var, head, field) \ > for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ > (var); \ > (var) = LIST_NEXT((var), field)) > >#define LIST_FOREACH_SAFE(var, head, field, tvar) \ > for ((var) = LIST_FIRST((head)); \ > (var) && ((tvar) = LIST_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define LIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ > for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ > (var) && ((tvar) = LIST_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define LIST_INIT(head) do { \ > LIST_FIRST((head)) = NULL; \ >} while (0) > >#define LIST_INSERT_AFTER(listelm, elm, field) do { \ > QMD_LIST_CHECK_NEXT(listelm, field); \ > if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ > LIST_NEXT((listelm), field)->field.le_prev = \ > &LIST_NEXT((elm), field); \ > LIST_NEXT((listelm), field) = (elm); \ > (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ >} while (0) > >#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ > QMD_LIST_CHECK_PREV(listelm, field); \ > (elm)->field.le_prev = (listelm)->field.le_prev; \ > LIST_NEXT((elm), field) = (listelm); \ > *(listelm)->field.le_prev = (elm); \ > (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ >} while (0) > >#define LIST_INSERT_HEAD(head, elm, field) do { \ > QMD_LIST_CHECK_HEAD((head), field); \ > if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ > LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ > LIST_FIRST((head)) = (elm); \ > (elm)->field.le_prev = &LIST_FIRST((head)); \ >} while (0) > >#define LIST_NEXT(elm, field) ((elm)->field.le_next) > >#define LIST_PREV(elm, head, type, field) \ > ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ > __containerof((elm)->field.le_prev, \ > QUEUE_TYPEOF(type), field.le_next)) > >#define LIST_REMOVE(elm, field) do { \ > QMD_SAVELINK(oldnext, (elm)->field.le_next); \ > QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ > QMD_LIST_CHECK_NEXT(elm, field); \ > QMD_LIST_CHECK_PREV(elm, field); \ > if (LIST_NEXT((elm), field) != NULL) \ > LIST_NEXT((elm), field)->field.le_prev = \ > (elm)->field.le_prev; \ > *(elm)->field.le_prev = LIST_NEXT((elm), field); \ > TRASHIT(*oldnext); \ > TRASHIT(*oldprev); \ >} while (0) > >#define LIST_SWAP(head1, head2, type, field) do { \ > QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \ > LIST_FIRST((head1)) = LIST_FIRST((head2)); \ > LIST_FIRST((head2)) = swap_tmp; \ > if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ > swap_tmp->field.le_prev = &LIST_FIRST((head1)); \ > if ((swap_tmp = LIST_FIRST((head2))) != NULL) \ > swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ >} while (0) > >/* > * Tail queue declarations. > */ >#define TAILQ_HEAD(name, type) \ >struct name { \ > struct type *tqh_first; /* first element */ \ > struct type **tqh_last; /* addr of last next element */ \ > TRACEBUF \ >} > >#define TAILQ_CLASS_HEAD(name, type) \ >struct name { \ > class type *tqh_first; /* first element */ \ > class type **tqh_last; /* addr of last next element */ \ > TRACEBUF \ >} > >#define TAILQ_HEAD_INITIALIZER(head) \ > { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } > >#define TAILQ_ENTRY(type) \ >struct { \ > struct type *tqe_next; /* next element */ \ > struct type **tqe_prev; /* address of previous next element */ \ > TRACEBUF \ >} > >#define TAILQ_CLASS_ENTRY(type) \ >struct { \ > class type *tqe_next; /* next element */ \ > class type **tqe_prev; /* address of previous next element */ \ > TRACEBUF \ >} > >/* > * Tail queue functions. > */ >#if (defined(_KERNEL) && defined(INVARIANTS)) >#define QMD_TAILQ_CHECK_HEAD(head, field) do { \ > if (!TAILQ_EMPTY(head) && \ > TAILQ_FIRST((head))->field.tqe_prev != \ > &TAILQ_FIRST((head))) \ > panic("Bad tailq head %p first->prev != head", (head)); \ >} while (0) > >#define QMD_TAILQ_CHECK_TAIL(head, field) do { \ > if (*(head)->tqh_last != NULL) \ > panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \ >} while (0) > >#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ > if (TAILQ_NEXT((elm), field) != NULL && \ > TAILQ_NEXT((elm), field)->field.tqe_prev != \ > &((elm)->field.tqe_next)) \ > panic("Bad link elm %p next->prev != elm", (elm)); \ >} while (0) > >#define QMD_TAILQ_CHECK_PREV(elm, field) do { \ > if (*(elm)->field.tqe_prev != (elm)) \ > panic("Bad link elm %p prev->next != elm", (elm)); \ >} while (0) >#else ># 595 "/usr/include/sys/queue.h" 3 4 >#define QMD_TAILQ_CHECK_HEAD(head, field) >#define QMD_TAILQ_CHECK_TAIL(head, headname) >#define QMD_TAILQ_CHECK_NEXT(elm, field) >#define QMD_TAILQ_CHECK_PREV(elm, field) >#endif /* (_KERNEL && INVARIANTS) */ ># 600 "/usr/include/sys/queue.h" 3 4 > >#define TAILQ_CONCAT(head1, head2, field) do { \ > if (!TAILQ_EMPTY(head2)) { \ > *(head1)->tqh_last = (head2)->tqh_first; \ > (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ > (head1)->tqh_last = (head2)->tqh_last; \ > TAILQ_INIT((head2)); \ > QMD_TRACE_HEAD(head1); \ > QMD_TRACE_HEAD(head2); \ > } \ >} while (0) > >#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) > >#define TAILQ_FIRST(head) ((head)->tqh_first) > >#define TAILQ_FOREACH(var, head, field) \ > for ((var) = TAILQ_FIRST((head)); \ > (var); \ > (var) = TAILQ_NEXT((var), field)) > >#define TAILQ_FOREACH_FROM(var, head, field) \ > for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ > (var); \ > (var) = TAILQ_NEXT((var), field)) > >#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ > for ((var) = TAILQ_FIRST((head)); \ > (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ > for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ > (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ > (var) = (tvar)) > >#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ > for ((var) = TAILQ_LAST((head), headname); \ > (var); \ > (var) = TAILQ_PREV((var), headname, field)) > >#define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field) \ > for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ > (var); \ > (var) = TAILQ_PREV((var), headname, field)) > >#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ > for ((var) = TAILQ_LAST((head), headname); \ > (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ > (var) = (tvar)) > >#define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \ > for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ > (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ > (var) = (tvar)) > >#define TAILQ_INIT(head) do { \ > TAILQ_FIRST((head)) = NULL; \ > (head)->tqh_last = &TAILQ_FIRST((head)); \ > QMD_TRACE_HEAD(head); \ >} while (0) > >#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ > QMD_TAILQ_CHECK_NEXT(listelm, field); \ > if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ > TAILQ_NEXT((elm), field)->field.tqe_prev = \ > &TAILQ_NEXT((elm), field); \ > else { \ > (head)->tqh_last = &TAILQ_NEXT((elm), field); \ > QMD_TRACE_HEAD(head); \ > } \ > TAILQ_NEXT((listelm), field) = (elm); \ > (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ > QMD_TRACE_ELEM(&(elm)->field); \ > QMD_TRACE_ELEM(&(listelm)->field); \ >} while (0) > >#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ > QMD_TAILQ_CHECK_PREV(listelm, field); \ > (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ > TAILQ_NEXT((elm), field) = (listelm); \ > *(listelm)->field.tqe_prev = (elm); \ > (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ > QMD_TRACE_ELEM(&(elm)->field); \ > QMD_TRACE_ELEM(&(listelm)->field); \ >} while (0) > >#define TAILQ_INSERT_HEAD(head, elm, field) do { \ > QMD_TAILQ_CHECK_HEAD(head, field); \ > if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ > TAILQ_FIRST((head))->field.tqe_prev = \ > &TAILQ_NEXT((elm), field); \ > else \ > (head)->tqh_last = &TAILQ_NEXT((elm), field); \ > TAILQ_FIRST((head)) = (elm); \ > (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ > QMD_TRACE_HEAD(head); \ > QMD_TRACE_ELEM(&(elm)->field); \ >} while (0) > >#define TAILQ_INSERT_TAIL(head, elm, field) do { \ > QMD_TAILQ_CHECK_TAIL(head, field); \ > TAILQ_NEXT((elm), field) = NULL; \ > (elm)->field.tqe_prev = (head)->tqh_last; \ > *(head)->tqh_last = (elm); \ > (head)->tqh_last = &TAILQ_NEXT((elm), field); \ > QMD_TRACE_HEAD(head); \ > QMD_TRACE_ELEM(&(elm)->field); \ >} while (0) > >#define TAILQ_LAST(head, headname) \ > (*(((struct headname *)((head)->tqh_last))->tqh_last)) > >#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) > >#define TAILQ_PREV(elm, headname, field) \ > (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) > >#define TAILQ_REMOVE(head, elm, field) do { \ > QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ > QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ > QMD_TAILQ_CHECK_NEXT(elm, field); \ > QMD_TAILQ_CHECK_PREV(elm, field); \ > if ((TAILQ_NEXT((elm), field)) != NULL) \ > TAILQ_NEXT((elm), field)->field.tqe_prev = \ > (elm)->field.tqe_prev; \ > else { \ > (head)->tqh_last = (elm)->field.tqe_prev; \ > QMD_TRACE_HEAD(head); \ > } \ > *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ > TRASHIT(*oldnext); \ > TRASHIT(*oldprev); \ > QMD_TRACE_ELEM(&(elm)->field); \ >} while (0) > >#define TAILQ_SWAP(head1, head2, type, field) do { \ > QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \ > QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \ > (head1)->tqh_first = (head2)->tqh_first; \ > (head1)->tqh_last = (head2)->tqh_last; \ > (head2)->tqh_first = swap_first; \ > (head2)->tqh_last = swap_last; \ > if ((swap_first = (head1)->tqh_first) != NULL) \ > swap_first->field.tqe_prev = &(head1)->tqh_first; \ > else \ > (head1)->tqh_last = &(head1)->tqh_first; \ > if ((swap_first = (head2)->tqh_first) != NULL) \ > swap_first->field.tqe_prev = &(head2)->tqh_first; \ > else \ > (head2)->tqh_last = &(head2)->tqh_first; \ >} while (0) > >#endif /* !_SYS_QUEUE_H_ */ ># 754 "/usr/include/sys/queue.h" 3 4 ># 40 "/usr/include/sys/sysctl.h" 2 3 4 > >struct thread; >/* > * Definitions for sysctl call. The sysctl call uses a hierarchical name > * for objects that can be examined or modified. The name is expressed as > * a sequence of integers. Like a file path name, the meaning of each > * component depends on its place in the hierarchy. The top-level and kern > * identifiers are defined here, and other identifiers are defined in the > * respective subsystem header files. > */ > >#define CTL_MAXNAME 24 /* largest number of components supported */ > >/* > * Each subsystem defined by sysctl defines a list of variables > * for that subsystem. Each name is either a node with further > * levels defined below it, or it is a leaf of some particular > * type given below. Each sysctl level defines a set of name/type > * pairs to be used by sysctl(8) in manipulating the subsystem. > */ >struct ctlname { > char *ctl_name; /* subsystem name */ > int ctl_type; /* type of name */ >}; > >#define CTLTYPE 0xf /* mask for the type */ >#define CTLTYPE_NODE 1 /* name is a node */ >#define CTLTYPE_INT 2 /* name describes an integer */ >#define CTLTYPE_STRING 3 /* name describes a string */ >#define CTLTYPE_S64 4 /* name describes a signed 64-bit number */ >#define CTLTYPE_OPAQUE 5 /* name describes a structure */ >#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */ >#define CTLTYPE_UINT 6 /* name describes an unsigned integer */ >#define CTLTYPE_LONG 7 /* name describes a long */ >#define CTLTYPE_ULONG 8 /* name describes an unsigned long */ >#define CTLTYPE_U64 9 /* name describes an unsigned 64-bit number */ > >#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ >#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ >#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) >#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */ >#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */ >#define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */ >#define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */ >#define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */ >#define CTLMASK_SECURE 0x00F00000 /* Secure level */ >#define CTLFLAG_TUN 0x00080000 /* Tunable variable */ >#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) >#define CTLFLAG_RWTUN (CTLFLAG_RW|CTLFLAG_TUN) >#define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */ >#define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */ >#define CTLFLAG_DYING 0x00010000 /* Oid is being removed */ >#define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ >#define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ >#define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */ >#define CTLFLAG_NOFETCH 0x00001000 /* Don't fetch tunable from getenv() */ >#define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR) > >/* > * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1. > * > * Secure when the securelevel is raised to at least N. > */ >#define CTLSHIFT_SECURE 20 >#define CTLFLAG_SECURE1 (CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE)) >#define CTLFLAG_SECURE2 (CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE)) >#define CTLFLAG_SECURE3 (CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE)) > >/* > * USE THIS instead of a hardwired number from the categories below > * to get dynamically assigned sysctl entries using the linker-set > * technology. This is the way nearly all new sysctl variables should > * be implemented. > * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, ""); > */ >#define OID_AUTO (-1) > >/* > * The starting number for dynamically-assigned entries. WARNING! > * ALL static sysctl entries should have numbers LESS than this! > */ >#define CTL_AUTO_START 0x100 > >#ifdef _KERNEL >#if 0 /* expanded by -frewrite-includes */ >#include <sys/linker_set.h> >#endif /* expanded by -frewrite-includes */ ># 125 "/usr/include/sys/sysctl.h" 3 4 > >#ifdef KLD_MODULE >/* XXX allow overspecification of type in external kernel modules */ >#define SYSCTL_CT_ASSERT_MASK CTLTYPE >#else ># 130 "/usr/include/sys/sysctl.h" 3 4 >#define SYSCTL_CT_ASSERT_MASK 0 >#endif ># 132 "/usr/include/sys/sysctl.h" 3 4 > >#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \ > intptr_t arg2, struct sysctl_req *req > >/* definitions for sysctl_req 'lock' member */ >#define REQ_UNWIRED 1 >#define REQ_WIRED 2 > >/* definitions for sysctl_req 'flags' member */ >#if defined(__amd64__) || defined(__ia64__) || defined(__powerpc64__) ||\ > (defined(__mips__) && defined(__mips_n64)) >#define SCTL_MASK32 1 /* 32 bit emulation */ >#endif ># 145 "/usr/include/sys/sysctl.h" 3 4 > >/* > * This describes the access space for a sysctl request. This is needed > * so that we can use the interface from the kernel or from user-space. > */ >struct sysctl_req { > struct thread *td; /* used for access checking */ > int lock; /* wiring state */ > void *oldptr; > size_t oldlen; > size_t oldidx; > int (*oldfunc)(struct sysctl_req *, const void *, size_t); > void *newptr; > size_t newlen; > size_t newidx; > int (*newfunc)(struct sysctl_req *, void *, size_t); > size_t validlen; > int flags; >}; > >SLIST_HEAD(sysctl_oid_list, sysctl_oid); > >/* > * This describes one "oid" in the MIB tree. Potentially more nodes can > * be hidden behind it, expanded by the handler. > */ >struct sysctl_oid { > struct sysctl_oid_list *oid_parent; > SLIST_ENTRY(sysctl_oid) oid_link; > int oid_number; > u_int oid_kind; > void *oid_arg1; > intptr_t oid_arg2; > const char *oid_name; > int (*oid_handler)(SYSCTL_HANDLER_ARGS); > const char *oid_fmt; > int oid_refcnt; > u_int oid_running; > const char *oid_descr; >}; > >#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l) >#define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l) > >int sysctl_handle_int(SYSCTL_HANDLER_ARGS); >int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS); >int sysctl_handle_long(SYSCTL_HANDLER_ARGS); >int sysctl_handle_64(SYSCTL_HANDLER_ARGS); >int sysctl_handle_string(SYSCTL_HANDLER_ARGS); >int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); >int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); > >int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); >int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); > >int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS); >int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS); >int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); > >/* > * These functions are used to add/remove an oid from the mib. > */ >void sysctl_register_oid(struct sysctl_oid *oidp); >void sysctl_unregister_oid(struct sysctl_oid *oidp); > >/* Declare a static oid to allow child oids to be added to it. */ >#define SYSCTL_DECL(name) \ > extern struct sysctl_oid_list sysctl_##name##_children > >/* Hide these in macros. */ >#define SYSCTL_CHILDREN(oid_ptr) \ > (struct sysctl_oid_list *)(oid_ptr)->oid_arg1 >#define SYSCTL_PARENT(oid_ptr) NULL /* not supported */ >#define SYSCTL_CHILDREN_SET(oid_ptr, val) (oid_ptr)->oid_arg1 = (val) >#define SYSCTL_STATIC_CHILDREN(oid_name) (&sysctl_##oid_name##_children) > >/* === Structs and macros related to context handling. === */ > >/* All dynamically created sysctls can be tracked in a context list. */ >struct sysctl_ctx_entry { > struct sysctl_oid *entry; > TAILQ_ENTRY(sysctl_ctx_entry) link; >}; > >TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); > >#define SYSCTL_NODE_CHILDREN(parent, name) \ > sysctl_##parent##_##name##_children > >#ifndef NO_SYSCTL_DESCR >#define __DESCR(d) d >#else ># 237 "/usr/include/sys/sysctl.h" 3 4 >#define __DESCR(d) "" >#endif ># 239 "/usr/include/sys/sysctl.h" 3 4 > >/* This constructs a "raw" MIB oid. */ >#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\ > static struct sysctl_oid sysctl__##parent##_##name = { \ > &sysctl_##parent##_children, \ > { NULL }, \ > nbr, \ > kind, \ > a1, \ > a2, \ > #name, \ > handler, \ > fmt, \ > 0, \ > 0, \ > __DESCR(descr) \ > }; \ > DATA_SET(sysctl_set, sysctl__##parent##_##name) > >#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ > sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr)) > >/* This constructs a root node from which other nodes can hang. */ >#define SYSCTL_ROOT_NODE(nbr, name, access, handler, descr) \ > SYSCTL_NODE(, nbr, name, access, handler, descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE) > >/* This constructs a node from which other oids can hang. */ >#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \ > struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \ > SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \ > (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, "N", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE) > >#define SYSCTL_ADD_ROOT_NODE(ctx, nbr, name, access, handler, descr) \ > SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(), nbr, name, access, handler, descr) > >#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \ >({ \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE); \ > sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \ > NULL, 0, handler, "N", __DESCR(descr)); \ >}) > >/* Oid for a string. len can be 0 to indicate '\0' termination. */ >#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \ > SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \ > arg, len, sysctl_handle_string, "A", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING) > >#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \ >({ \ > char *__arg = (arg); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING); \ > sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \ > __arg, len, sysctl_handle_string, "A", __DESCR(descr)); \ >}) > >/* Oid for an int. If ptr is SYSCTL_NULL_INT_PTR, val is returned. */ >#define SYSCTL_NULL_INT_PTR ((int *)NULL) >#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ > ptr, val, sysctl_handle_int, "I", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \ > CTASSERT(sizeof(int) == sizeof(*(ptr))) > >#define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \ >({ \ > int *__ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ > __ptr, val, sysctl_handle_int, "I", __DESCR(descr)); \ >}) > >/* Oid for an unsigned int. If ptr is NULL, val is returned. */ >#define SYSCTL_NULL_UINT_PTR ((unsigned *)NULL) >#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \ > ptr, val, sysctl_handle_int, "IU", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT);\ > CTASSERT(sizeof(unsigned) == sizeof(*(ptr))) > >#define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \ >({ \ > unsigned *__ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \ > __ptr, val, sysctl_handle_int, "IU", __DESCR(descr)); \ >}) > >/* Oid for a long. The pointer must be non NULL. */ >#define SYSCTL_NULL_LONG_PTR ((long *)NULL) >#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \ > ptr, val, sysctl_handle_long, "L", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG);\ > CTASSERT(sizeof(long) == sizeof(*(ptr))) > >#define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > long *__ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \ > __ptr, 0, sysctl_handle_long, "L", __DESCR(descr)); \ >}) > >/* Oid for an unsigned long. The pointer must be non NULL. */ >#define SYSCTL_NULL_ULONG_PTR ((unsigned long *)NULL) >#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \ > ptr, val, sysctl_handle_long, "LU", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG); \ > CTASSERT(sizeof(unsigned long) == sizeof(*(ptr))) > >#define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > unsigned long *__ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \ > __ptr, 0, sysctl_handle_long, "LU", __DESCR(descr)); \ >}) > >/* Oid for a quad. The pointer must be non NULL. */ >#define SYSCTL_NULL_QUAD_PTR ((int64_t *)NULL) >#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \ > ptr, val, sysctl_handle_64, "Q", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \ > CTASSERT(sizeof(int64_t) == sizeof(*(ptr))) > >#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > int64_t *__ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \ > __ptr, 0, sysctl_handle_64, "Q", __DESCR(descr)); \ >}) > >#define SYSCTL_NULL_UQUAD_PTR ((uint64_t *)NULL) >#define SYSCTL_UQUAD(parent, nbr, name, access, ptr, val, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ > ptr, val, sysctl_handle_64, "QU", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ > CTASSERT(sizeof(uint64_t) == sizeof(*(ptr))) > >#define SYSCTL_ADD_UQUAD(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > uint64_t *__ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ > __ptr, 0, sysctl_handle_64, "QU", __DESCR(descr)); \ >}) > >/* Oid for a CPU dependant variable */ >#define SYSCTL_ADD_UAUTO(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > struct sysctl_oid *__ret; \ > CTASSERT(sizeof(uint64_t) == sizeof(*(ptr)) || \ > sizeof(unsigned) == sizeof(*(ptr))); \ > CTASSERT(((access) & CTLTYPE) == 0); \ > if (sizeof(uint64_t) == sizeof(*(ptr))) { \ > __ret = sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ > (ptr), 0, sysctl_handle_64, "QU", \ > __DESCR(descr)); \ > } else { \ > __ret = sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \ > (ptr), 0, sysctl_handle_int, "IU", \ > __DESCR(descr)); \ > } \ > __ret; \ >}) > >/* Oid for a 64-bit unsigned counter(9). The pointer must be non NULL. */ >#define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ > (ptr), 0, sysctl_handle_counter_u64, "QU", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ > CTASSERT(sizeof(counter_u64_t) == sizeof(*(ptr))); \ > CTASSERT(sizeof(uint64_t) == sizeof(**(ptr))) > >#define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > counter_u64_t *__ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ > __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ >}) > >/* Oid for an opaque object. Specified by a pointer and a length. */ >#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ > SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ > ptr, len, sysctl_handle_opaque, fmt, descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) > >#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr) \ >({ \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ > sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \ > ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr)); \ >}) > >/* Oid for a struct. Specified by a pointer and a type. */ >#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \ > SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ > ptr, sizeof(struct type), sysctl_handle_opaque, \ > "S," #type, descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) > >#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \ >({ \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ > sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \ > (ptr), sizeof(struct type), \ > sysctl_handle_opaque, "S," #type, __DESCR(descr)); \ >}) > >/* Oid for a procedure. Specified by a pointer and an arg. */ >#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ > SYSCTL_OID(parent, nbr, name, (access), \ > ptr, arg, handler, fmt, descr); \ > CTASSERT(((access) & CTLTYPE) != 0) > >#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ >({ \ > CTASSERT(((access) & CTLTYPE) != 0); \ > sysctl_add_oid(ctx, parent, nbr, name, (access), \ > (ptr), (arg), (handler), (fmt), __DESCR(descr)); \ >}) > >/* Oid to handle limits on uma(9) zone specified by pointer. */ >#define SYSCTL_UMA_MAX(parent, nbr, name, access, ptr, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ > (ptr), 0, sysctl_handle_uma_zone_max, "I", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) > >#define SYSCTL_ADD_UMA_MAX(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > uma_zone_t __ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ > __ptr, 0, sysctl_handle_uma_zone_max, "I", __DESCR(descr)); \ >}) > >/* Oid to obtain current use of uma(9) zone specified by pointer. */ >#define SYSCTL_UMA_CUR(parent, nbr, name, access, ptr, descr) \ > SYSCTL_OID(parent, nbr, name, \ > CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ > (ptr), 0, sysctl_handle_uma_zone_cur, "I", descr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) > >#define SYSCTL_ADD_UMA_CUR(ctx, parent, nbr, name, access, ptr, descr) \ >({ \ > uma_zone_t __ptr = (ptr); \ > CTASSERT(((access) & CTLTYPE) == 0 || \ > ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \ > sysctl_add_oid(ctx, parent, nbr, name, \ > CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ > __ptr, 0, sysctl_handle_uma_zone_cur, "I", __DESCR(descr)); \ >}) > >/* > * A macro to generate a read-only sysctl to indicate the presense of optional > * kernel features. > */ >#define FEATURE(name, desc) \ > SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \ > SYSCTL_NULL_INT_PTR, 1, desc) > >#endif /* _KERNEL */ ># 552 "/usr/include/sys/sysctl.h" 3 4 > >/* > * Top-level identifiers > */ >#define CTL_UNSPEC 0 /* unused */ >#define CTL_KERN 1 /* "high kernel": proc, limits */ >#define CTL_VM 2 /* virtual memory */ >#define CTL_VFS 3 /* filesystem, mount type is next */ >#define CTL_NET 4 /* network, see socket.h */ >#define CTL_DEBUG 5 /* debugging parameters */ >#define CTL_HW 6 /* generic cpu/io */ >#define CTL_MACHDEP 7 /* machine dependent */ >#define CTL_USER 8 /* user-level */ >#define CTL_P1003_1B 9 /* POSIX 1003.1B */ >#define CTL_MAXID 10 /* number of valid top-level ids */ > >/* > * CTL_KERN identifiers > */ >#define KERN_OSTYPE 1 /* string: system version */ >#define KERN_OSRELEASE 2 /* string: system release */ >#define KERN_OSREV 3 /* int: system revision */ >#define KERN_VERSION 4 /* string: compile time info */ >#define KERN_MAXVNODES 5 /* int: max vnodes */ >#define KERN_MAXPROC 6 /* int: max processes */ >#define KERN_MAXFILES 7 /* int: max open files */ >#define KERN_ARGMAX 8 /* int: max arguments to exec */ >#define KERN_SECURELVL 9 /* int: system security level */ >#define KERN_HOSTNAME 10 /* string: hostname */ >#define KERN_HOSTID 11 /* int: host identifier */ >#define KERN_CLOCKRATE 12 /* struct: struct clockrate */ >#define KERN_VNODE 13 /* struct: vnode structures */ >#define KERN_PROC 14 /* struct: process entries */ >#define KERN_FILE 15 /* struct: file entries */ >#define KERN_PROF 16 /* node: kernel profiling info */ >#define KERN_POSIX1 17 /* int: POSIX.1 version */ >#define KERN_NGROUPS 18 /* int: # of supplemental group ids */ >#define KERN_JOB_CONTROL 19 /* int: is job control available */ >#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */ >#define KERN_BOOTTIME 21 /* struct: time kernel was booted */ >#define KERN_NISDOMAINNAME 22 /* string: YP domain name */ >#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */ >#define KERN_OSRELDATE 24 /* int: kernel release date */ >#define KERN_NTP_PLL 25 /* node: NTP PLL control */ >#define KERN_BOOTFILE 26 /* string: name of booted kernel */ >#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */ >#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */ >#define KERN_DUMPDEV 29 /* struct cdev *: device to dump on */ >#define KERN_IPC 30 /* node: anything related to IPC */ >#define KERN_DUMMY 31 /* unused */ >#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */ >#define KERN_USRSTACK 33 /* int: address of USRSTACK */ >#define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */ >#define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */ >#define KERN_HOSTUUID 36 /* string: host UUID identifier */ >#define KERN_ARND 37 /* int: from arc4rand() */ >#define KERN_MAXID 38 /* number of valid kern ids */ >/* > * KERN_PROC subtypes > */ >#define KERN_PROC_ALL 0 /* everything */ >#define KERN_PROC_PID 1 /* by process id */ >#define KERN_PROC_PGRP 2 /* by process group id */ >#define KERN_PROC_SESSION 3 /* by session of pid */ >#define KERN_PROC_TTY 4 /* by controlling tty */ >#define KERN_PROC_UID 5 /* by effective uid */ >#define KERN_PROC_RUID 6 /* by real uid */ >#define KERN_PROC_ARGS 7 /* get/set arguments/proctitle */ >#define KERN_PROC_PROC 8 /* only return procs */ >#define KERN_PROC_SV_NAME 9 /* get syscall vector name */ >#define KERN_PROC_RGID 10 /* by real group id */ >#define KERN_PROC_GID 11 /* by effective group id */ >#define KERN_PROC_PATHNAME 12 /* path to executable */ >#define KERN_PROC_OVMMAP 13 /* Old VM map entries for process */ >#define KERN_PROC_OFILEDESC 14 /* Old file descriptors for process */ >#define KERN_PROC_KSTACK 15 /* Kernel stacks for process */ >#define KERN_PROC_INC_THREAD 0x10 /* > * modifier for pid, pgrp, tty, > * uid, ruid, gid, rgid and proc > * This effectively uses 16-31 > */ >#define KERN_PROC_VMMAP 32 /* VM map entries for process */ >#define KERN_PROC_FILEDESC 33 /* File descriptors for process */ >#define KERN_PROC_GROUPS 34 /* process groups */ >#define KERN_PROC_ENV 35 /* get environment */ >#define KERN_PROC_AUXV 36 /* get ELF auxiliary vector */ >#define KERN_PROC_RLIMIT 37 /* process resource limits */ >#define KERN_PROC_PS_STRINGS 38 /* get ps_strings location */ >#define KERN_PROC_UMASK 39 /* process umask */ >#define KERN_PROC_OSREL 40 /* osreldate for process binary */ >#define KERN_PROC_SIGTRAMP 41 /* signal trampoline location */ > >/* > * KERN_IPC identifiers > */ >#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */ >#define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */ >#define KIPC_SOMAXCONN 3 /* int: max length of connection q */ >#define KIPC_MAX_LINKHDR 4 /* int: max length of link header */ >#define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */ >#define KIPC_MAX_HDR 6 /* int: max total length of headers */ >#define KIPC_MAX_DATALEN 7 /* int: max length of data? */ > >/* > * CTL_HW identifiers > */ >#define HW_MACHINE 1 /* string: machine class */ >#define HW_MODEL 2 /* string: specific machine model */ >#define HW_NCPU 3 /* int: number of cpus */ >#define HW_BYTEORDER 4 /* int: machine byte order */ >#define HW_PHYSMEM 5 /* int: total memory */ >#define HW_USERMEM 6 /* int: non-kernel memory */ >#define HW_PAGESIZE 7 /* int: software page size */ >#define HW_DISKNAMES 8 /* strings: disk drive names */ >#define HW_DISKSTATS 9 /* struct: diskstats[] */ >#define HW_FLOATINGPT 10 /* int: has HW floating point? */ >#define HW_MACHINE_ARCH 11 /* string: machine architecture */ >#define HW_REALMEM 12 /* int: 'real' memory */ >#define HW_MAXID 13 /* number of valid hw ids */ > >/* > * CTL_USER definitions > */ >#define USER_CS_PATH 1 /* string: _CS_PATH */ >#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */ >#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */ >#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */ >#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */ >#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */ >#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */ >#define USER_LINE_MAX 8 /* int: LINE_MAX */ >#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */ >#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */ >#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */ >#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */ >#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */ >#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */ >#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */ >#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */ >#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */ >#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */ >#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */ >#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */ >#define USER_MAXID 21 /* number of valid user ids */ > >#define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */ >#define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */ >#define CTL_P1003_1B_MEMLOCK 3 /* boolean */ >#define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */ >#define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */ >#define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */ >#define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */ >#define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */ >#define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */ >#define CTL_P1003_1B_SEMAPHORES 10 /* boolean */ >#define CTL_P1003_1B_FSYNC 11 /* boolean */ >#define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */ >#define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */ >#define CTL_P1003_1B_TIMERS 14 /* boolean */ >#define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */ >#define CTL_P1003_1B_AIO_MAX 16 /* int */ >#define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */ >#define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */ >#define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */ >#define CTL_P1003_1B_PAGESIZE 20 /* int */ >#define CTL_P1003_1B_RTSIG_MAX 21 /* int */ >#define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */ >#define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */ >#define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */ >#define CTL_P1003_1B_TIMER_MAX 25 /* int */ > >#define CTL_P1003_1B_MAXID 26 > >#ifdef _KERNEL > >/* > * Declare some common oids. > */ >extern struct sysctl_oid_list sysctl__children; >SYSCTL_DECL(_kern); >SYSCTL_DECL(_kern_features); >SYSCTL_DECL(_kern_ipc); >SYSCTL_DECL(_kern_proc); >SYSCTL_DECL(_kern_sched); >SYSCTL_DECL(_kern_sched_stats); >SYSCTL_DECL(_sysctl); >SYSCTL_DECL(_vm); >SYSCTL_DECL(_vm_stats); >SYSCTL_DECL(_vm_stats_misc); >SYSCTL_DECL(_vfs); >SYSCTL_DECL(_net); >SYSCTL_DECL(_debug); >SYSCTL_DECL(_debug_sizeof); >SYSCTL_DECL(_dev); >SYSCTL_DECL(_hw); >SYSCTL_DECL(_hw_bus); >SYSCTL_DECL(_hw_bus_devices); >SYSCTL_DECL(_hw_bus_info); >SYSCTL_DECL(_machdep); >SYSCTL_DECL(_user); >SYSCTL_DECL(_compat); >SYSCTL_DECL(_regression); >SYSCTL_DECL(_security); >SYSCTL_DECL(_security_bsd); > >extern char machine[]; >extern char osrelease[]; >extern char ostype[]; >extern char kern_ident[]; > >/* Dynamic oid handling */ >struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist, > struct sysctl_oid_list *parent, int nbr, const char *name, int kind, > void *arg1, intptr_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS), > const char *fmt, const char *descr); >int sysctl_remove_name(struct sysctl_oid *parent, const char *name, int del, > int recurse); >void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name); >int sysctl_move_oid(struct sysctl_oid *oidp, > struct sysctl_oid_list *parent); >int sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse); >int sysctl_ctx_init(struct sysctl_ctx_list *clist); >int sysctl_ctx_free(struct sysctl_ctx_list *clist); >struct sysctl_ctx_entry *sysctl_ctx_entry_add(struct sysctl_ctx_list *clist, > struct sysctl_oid *oidp); >struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist, > struct sysctl_oid *oidp); >int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist, > struct sysctl_oid *oidp); > >int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old, > size_t *oldlenp, void *new, size_t newlen, size_t *retval, > int flags); >int kernel_sysctlbyname(struct thread *td, char *name, void *old, > size_t *oldlenp, void *new, size_t newlen, size_t *retval, > int flags); >int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, > size_t *oldlenp, int inkernel, void *new, size_t newlen, > size_t *retval, int flags); >int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, > int *nindx, struct sysctl_req *req); >void sysctl_lock(void); >void sysctl_unlock(void); >int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); > >struct sbuf; >struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int, > struct sysctl_req *); >#else /* !_KERNEL */ ># 801 "/usr/include/sys/sysctl.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 802 "/usr/include/sys/sysctl.h" 3 4 > >__BEGIN_DECLS >int sysctl(const int *, u_int, void *, size_t *, const void *, size_t); >int sysctlbyname(const char *, void *, size_t *, const void *, size_t); >int sysctlnametomib(const char *, int *, size_t *); >__END_DECLS >#endif /* _KERNEL */ ># 809 "/usr/include/sys/sysctl.h" 3 4 > >#endif /* !_SYS_SYSCTL_H_ */ ># 811 "/usr/include/sys/sysctl.h" 3 4 ># 27 "../include/dps_mutex.h" 2 >#endif ># 28 "../include/dps_mutex.h" > >#ifdef HAVE_UNISTD_H >#if 0 /* expanded by -frewrite-includes */ >#include <unistd.h> >#endif /* expanded by -frewrite-includes */ ># 31 "../include/dps_mutex.h" >#endif ># 32 "../include/dps_mutex.h" > >#ifdef HAVE_BSD_UNISTD_H >#if 0 /* expanded by -frewrite-includes */ >#include <bsd/unistd.h> >#endif /* expanded by -frewrite-includes */ ># 35 "../include/dps_mutex.h" >#endif ># 36 "../include/dps_mutex.h" > >#ifdef WITH_HTTPS >#if 0 /* expanded by -frewrite-includes */ >#include <openssl/err.h> >#endif /* expanded by -frewrite-includes */ ># 39 "../include/dps_mutex.h" >#endif ># 40 "../include/dps_mutex.h" > >#if defined(__i386) || defined(__x86_64__) || defined(__amd64__) || defined(__ia64__) > >#define CAS_MUTEX 1 > >#endif ># 46 "../include/dps_mutex.h" > >#if defined(CAS_MUTEX) > >#define dps_mutex_t DPS_AGENT* >#define InitMutex(x) (*(x) = NULL) >#define DestroyMutex(x) >#define DPS_MUTEX_LOCK(A,x) DpsCAS_lock(A,x) >#define DPS_MUTEX_UNLOCK(A,x) DpsCAS_unlock(A,x) >#if defined HAVE_PTHREAD >#define DPS_THREAD_ID (pthread_self()) >#else ># 57 "../include/dps_mutex.h" >#define DPS_THREAD_ID ((unsigned long)1117) >#endif ># 59 "../include/dps_mutex.h" > >#elif defined HAVE_PTHREAD ># 61 "../include/dps_mutex.h" >#if 0 /* expanded by -frewrite-includes */ >#include <pthread.h> >#endif /* expanded by -frewrite-includes */ ># 62 "../include/dps_mutex.h" >#define dps_mutex_t pthread_mutex_t >#define InitMutex(x) pthread_mutex_init(x,NULL) >#define DestroyMutex(x) pthread_mutex_destroy(x) >#define DPS_MUTEX_LOCK(A,x) pthread_mutex_lock(x) >#define DPS_MUTEX_UNLOCK(A,x) pthread_mutex_unlock(x) >#define DPS_THREAD_ID pthread_self() > >#elif defined HAVE_SYS_SEM_H ># 70 "../include/dps_mutex.h" >#if 0 /* expanded by -frewrite-includes */ >#include <sys/ipc.h> >#endif /* expanded by -frewrite-includes */ ># 71 "../include/dps_mutex.h" >#if 0 /* expanded by -frewrite-includes */ >#include <sys/sem.h> >#endif /* expanded by -frewrite-includes */ ># 72 "../include/dps_mutex.h" >#define dps_mutex_t int >void InitMutex(dps_mutex_t *); >void DPS_MUTEX_LOCK(DPS_AGENT *A, dps_mutex_t *x); >void DPS_MUTEX_UNLOCK(DPS_AGENT *A, dps_mutex_t *x); >#define DPS_THREAD_ID ((unsigned long)1117) > > >#elif defined HAVE_SEMAPHORE_H ># 80 "../include/dps_mutex.h" >#if 0 /* expanded by -frewrite-includes */ >#include <semaphore.h> >#endif /* expanded by -frewrite-includes */ ># 81 "../include/dps_mutex.h" >#define dps_mutex_t sem_t* >void InitMutex(dps_mutex_t *); >#define DestroyMutex(x) sem_close(x) >#define DPS_MUTEX_LOCK(A,x) sem_wait(x) >#define DPS_MUTEX_UNLOCK(A,x) sem_post(x) >#define DPS_THREAD_ID ((unsigned long)1117) > > >#else ># 90 "../include/dps_mutex.h" >#define dps_mutex_t int >#define InitMutex(x) *(x)=0 >#define DestroyMutex(x) >#define DPS_MUTEX_LOCK(A,x) >#define DPS_MUTEX_UNLOCK(A,x) >#define DPS_THREAD_ID ((unsigned long)1117) >#endif ># 97 "../include/dps_mutex.h" > > >typedef struct { > int handle; > int cnt; > dps_mutex_t mutex; >} DPS_MUTEX; > > >#if 1 >#define DPS_HALF ((DpsNsems - DPS_LOCK_MAX) >> 1) >#define DPS_LOCK_CACHED_N(n) ((DpsNsems == DPS_LOCK_MAX) ? DPS_LOCK_CACHED : (DPS_LOCK_MAX + (n % DPS_HALF))) >#define DPS_LOCK_BASE_N(n) ((DpsNsems == DPS_LOCK_MAX) ? DPS_LOCK_BASE : (DPS_LOCK_MAX + DPS_HALF + (n % DPS_HALF))) >#else ># 111 "../include/dps_mutex.h" >#define DPS_LOCK_CACHED_N(n) ((DpsNsems == DPS_LOCK_MAX) ? DPS_LOCK_CACHED : (DPS_LOCK_MAX + (n % (DpsNsems - DPS_LOCK_MAX)))) >#endif ># 113 "../include/dps_mutex.h" > > >/* MUTEX stuff to lock dangerous places in multi-threaded mode */ > >extern __C_LINK int __DPSCALL DpsSetLockProc(DPS_ENV * Conf, > void (*proc)(DPS_AGENT *A, int command, size_t type, const char *fname, int lineno)); >extern __C_LINK void __DPSCALL DpsLockProc(DPS_AGENT *A, int command, size_t type, const char *fn, int ln); > >extern __C_LINK void __DPSCALL DpsInitMutexes(void); >extern __C_LINK void __DPSCALL DpsDestroyMutexes(void); >extern void DpsGetSemLimit(void); > > >extern size_t DpsNsems; > >#define DPS_GETLOCK(A,mutex) if(A->Conf->LockProc)A->Conf->LockProc(A,DPS_LOCK,mutex,__FILE__,__LINE__) >#define DPS_RELEASELOCK(A,mutex) if(A->Conf->LockProc)A->Conf->LockProc(A,DPS_UNLOCK,mutex,__FILE__,__LINE__) > >/* Locking commands */ >#define DPS_LOCK 1 >#define DPS_UNLOCK 2 > >/* Accept global locking */ >void DpsAcceptMutexChildCleanup(void); >void DpsAcceptMutexCleanup(void); >void DpsAcceptMutexInit(const char *var_dir, const char *app); >void DpsAcceptMutexChildInit(void); >void DpsAcceptMutexLock(DPS_AGENT *Agent); >void DpsAcceptMutexUnlock(DPS_AGENT *Agent); > >#endif ># 144 "../include/dps_mutex.h" ># 28 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "dps_alias.h" >#endif /* expanded by -frewrite-includes */ ># 1 "../include/dps_alias.h" 1 >/* Copyright (C) 2000-2002 Lavtech.com corp. All rights reserved. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >*/ > >#ifndef _UDM_ALIAS_H >#define _UDM_ALIAS_H > >#if 0 /* expanded by -frewrite-includes */ >#include "dps_common.h" >#endif /* expanded by -frewrite-includes */ ># 22 "../include/dps_alias.h" > >extern __C_LINK int __DPSCALL DpsAliasProg(DPS_AGENT *Indexer, const char *alias_prog, const char *argument, char *res, size_t rsize); > >#endif ># 26 "../include/dps_alias.h" ># 29 "url.c" 2 > >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> >#endif /* expanded by -frewrite-includes */ ># 31 "url.c" >#if 0 /* expanded by -frewrite-includes */ >#include <stdlib.h> >#endif /* expanded by -frewrite-includes */ ># 32 "url.c" >#if 0 /* expanded by -frewrite-includes */ >#include <strings.h> >#endif /* expanded by -frewrite-includes */ ># 33 "url.c" >#if 0 /* expanded by -frewrite-includes */ >#include <string.h> >#endif /* expanded by -frewrite-includes */ ># 34 "url.c" >#if 0 /* expanded by -frewrite-includes */ >#include <ctype.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/ctype.h" 1 3 4 >/* > * Copyright (c) 1989, 1993 > * The Regents of the University of California. All rights reserved. > * (c) UNIX System Laboratories, Inc. > * All or some portions of this file are derived from material licensed > * to the University of California by American Telephone and Telegraph > * Co. or Unix System Laboratories, Inc. and are reproduced herein with > * the permission of UNIX System Laboratories, Inc. > * > * This code is derived from software contributed to Berkeley by > * Paul Borman at Krystal Technologies. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)ctype.h 8.4 (Berkeley) 1/21/94 > * $FreeBSD: releng/10.3/include/ctype.h 233600 2012-03-28 12:11:54Z theraven $ > */ > >#ifndef _CTYPE_H_ >#define _CTYPE_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 45 "/usr/include/ctype.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 46 "/usr/include/ctype.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <_ctype.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/_ctype.h" 1 3 4 >/* > * Copyright (c) 1989, 1993 > * The Regents of the University of California. All rights reserved. > * (c) UNIX System Laboratories, Inc. > * All or some portions of this file are derived from material licensed > * to the University of California by American Telephone and Telegraph > * Co. or Unix System Laboratories, Inc. and are reproduced herein with > * the permission of UNIX System Laboratories, Inc. > * > * This code is derived from software contributed to Berkeley by > * Paul Borman at Krystal Technologies. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * From @(#)ctype.h 8.4 (Berkeley) 1/21/94 > * From FreeBSD: src/include/ctype.h,v 1.27 2004/06/23 07:11:39 tjr Exp > * $FreeBSD: releng/10.3/include/_ctype.h 203964 2010-02-16 19:39:50Z imp $ > */ > >#ifndef __CTYPE_H_ >#define __CTYPE_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 46 "/usr/include/_ctype.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 47 "/usr/include/_ctype.h" 3 4 > >#define _CTYPE_A 0x00000100L /* Alpha */ >#define _CTYPE_C 0x00000200L /* Control */ >#define _CTYPE_D 0x00000400L /* Digit */ >#define _CTYPE_G 0x00000800L /* Graph */ >#define _CTYPE_L 0x00001000L /* Lower */ >#define _CTYPE_P 0x00002000L /* Punct */ >#define _CTYPE_S 0x00004000L /* Space */ >#define _CTYPE_U 0x00008000L /* Upper */ >#define _CTYPE_X 0x00010000L /* X digit */ >#define _CTYPE_B 0x00020000L /* Blank */ >#define _CTYPE_R 0x00040000L /* Print */ >#define _CTYPE_I 0x00080000L /* Ideogram */ >#define _CTYPE_T 0x00100000L /* Special */ >#define _CTYPE_Q 0x00200000L /* Phonogram */ >#define _CTYPE_SW0 0x20000000L /* 0 width character */ >#define _CTYPE_SW1 0x40000000L /* 1 width character */ >#define _CTYPE_SW2 0x80000000L /* 2 width character */ >#define _CTYPE_SW3 0xc0000000L /* 3 width character */ >#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */ >#define _CTYPE_SWS 30 /* Bits to shift to get width */ > >/* See comments in <sys/_types.h> about __ct_rune_t. */ >__BEGIN_DECLS >unsigned long ___runetype(__ct_rune_t) __pure; >__ct_rune_t ___tolower(__ct_rune_t) __pure; >__ct_rune_t ___toupper(__ct_rune_t) __pure; >__END_DECLS > >/* > * _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us > * to generate code for extern versions of all our inline functions. > */ >#ifdef _EXTERNALIZE_CTYPE_INLINES_ >#define _USE_CTYPE_INLINE_ >#define static >#define __inline >#endif ># 85 "/usr/include/_ctype.h" 3 4 > >extern int __mb_sb_limit; > >/* > * Use inline functions if we are allowed to and the compiler supports them. > */ >#if !defined(_DONT_USE_CTYPE_INLINE_) && \ > (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) > >#if 0 /* expanded by -frewrite-includes */ >#include <runetype.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/runetype.h" 1 3 4 >/*- > * Copyright (c) 1993 > * The Regents of the University of California. All rights reserved. > * > * This code is derived from software contributed to Berkeley by > * Paul Borman at Krystal Technologies. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * 3. Neither the name of the University nor the names of its contributors > * may be used to endorse or promote products derived from this software > * without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * @(#)runetype.h 8.1 (Berkeley) 6/2/93 > * $FreeBSD: releng/10.3/include/runetype.h 232620 2012-03-06 20:15:23Z dim $ > */ > >#ifndef _RUNETYPE_H_ >#define _RUNETYPE_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 40 "/usr/include/runetype.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 41 "/usr/include/runetype.h" 3 4 > >#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */ >#define _CRMASK (~(_CACHED_RUNES - 1)) > >/* > * The lower 8 bits of runetype[] contain the digit value of the rune. > */ >typedef struct { > __rune_t __min; /* First rune of the range */ > __rune_t __max; /* Last rune (inclusive) of the range */ > __rune_t __map; /* What first maps to in maps */ > unsigned long *__types; /* Array of types in range */ >} _RuneEntry; > >typedef struct { > int __nranges; /* Number of ranges stored */ > _RuneEntry *__ranges; /* Pointer to the ranges */ >} _RuneRange; > >typedef struct { > char __magic[8]; /* Magic saying what version we are */ > char __encoding[32]; /* ASCII name of this encoding */ > > __rune_t (*__sgetrune)(const char *, __size_t, char const **); > int (*__sputrune)(__rune_t, char *, __size_t, char **); > __rune_t __invalid_rune; > > unsigned long __runetype[_CACHED_RUNES]; > __rune_t __maplower[_CACHED_RUNES]; > __rune_t __mapupper[_CACHED_RUNES]; > > /* > * The following are to deal with Runes larger than _CACHED_RUNES - 1. > * Their data is actually contiguous with this structure so as to make > * it easier to read/write from/to disk. > */ > _RuneRange __runetype_ext; > _RuneRange __maplower_ext; > _RuneRange __mapupper_ext; > > void *__variable; /* Data which depends on the encoding */ > int __variable_len; /* how long that data is */ >} _RuneLocale; > >#define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */ >__BEGIN_DECLS >extern const _RuneLocale _DefaultRuneLocale; >extern const _RuneLocale *_CurrentRuneLocale; >#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) >extern const _RuneLocale *__getCurrentRuneLocale(void); >#else ># 92 "/usr/include/runetype.h" 3 4 >extern _Thread_local const _RuneLocale *_ThreadRuneLocale; >static __inline const _RuneLocale *__getCurrentRuneLocale(void) >{ > > if (_ThreadRuneLocale) > return _ThreadRuneLocale; > if (_CurrentRuneLocale) > return _CurrentRuneLocale; > return &_DefaultRuneLocale; >} >#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ ># 103 "/usr/include/runetype.h" 3 4 >#define _CurrentRuneLocale (__getCurrentRuneLocale()) >__END_DECLS > >#endif /* !_RUNETYPE_H_ */ ># 107 "/usr/include/runetype.h" 3 4 ># 95 "/usr/include/_ctype.h" 2 3 4 > >static __inline int >__maskrune(__ct_rune_t _c, unsigned long _f) >{ > return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : > _CurrentRuneLocale->__runetype[_c]) & _f; >} > >static __inline int >__sbmaskrune(__ct_rune_t _c, unsigned long _f) >{ > return (_c < 0 || _c >= __mb_sb_limit) ? 0 : > _CurrentRuneLocale->__runetype[_c] & _f; >} > >static __inline int >__istype(__ct_rune_t _c, unsigned long _f) >{ > return (!!__maskrune(_c, _f)); >} > >static __inline int >__sbistype(__ct_rune_t _c, unsigned long _f) >{ > return (!!__sbmaskrune(_c, _f)); >} > >static __inline int >__isctype(__ct_rune_t _c, unsigned long _f) >{ > return (_c < 0 || _c >= 128) ? 0 : > !!(_DefaultRuneLocale.__runetype[_c] & _f); >} > >static __inline __ct_rune_t >__toupper(__ct_rune_t _c) >{ > return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : > _CurrentRuneLocale->__mapupper[_c]; >} > >static __inline __ct_rune_t >__sbtoupper(__ct_rune_t _c) >{ > return (_c < 0 || _c >= __mb_sb_limit) ? _c : > _CurrentRuneLocale->__mapupper[_c]; >} > >static __inline __ct_rune_t >__tolower(__ct_rune_t _c) >{ > return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : > _CurrentRuneLocale->__maplower[_c]; >} > >static __inline __ct_rune_t >__sbtolower(__ct_rune_t _c) >{ > return (_c < 0 || _c >= __mb_sb_limit) ? _c : > _CurrentRuneLocale->__maplower[_c]; >} > >static __inline int >__wcwidth(__ct_rune_t _c) >{ > unsigned int _x; > > if (_c == 0) > return (0); > _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R); > if ((_x & _CTYPE_SWM) != 0) > return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); > return ((_x & _CTYPE_R) != 0 ? 1 : -1); >} > >#else /* not using inlines */ ># 171 "/usr/include/_ctype.h" 3 4 > >__BEGIN_DECLS >int __maskrune(__ct_rune_t, unsigned long); >int __sbmaskrune(__ct_rune_t, unsigned long); >int __istype(__ct_rune_t, unsigned long); >int __sbistype(__ct_rune_t, unsigned long); >int __isctype(__ct_rune_t, unsigned long); >__ct_rune_t __toupper(__ct_rune_t); >__ct_rune_t __sbtoupper(__ct_rune_t); >__ct_rune_t __tolower(__ct_rune_t); >__ct_rune_t __sbtolower(__ct_rune_t); >int __wcwidth(__ct_rune_t); >__END_DECLS >#endif /* using inlines */ ># 185 "/usr/include/_ctype.h" 3 4 > >#endif /* !__CTYPE_H_ */ ># 187 "/usr/include/_ctype.h" 3 4 ># 47 "/usr/include/ctype.h" 2 3 4 > >__BEGIN_DECLS >int isalnum(int); >int isalpha(int); >int iscntrl(int); >int isdigit(int); >int isgraph(int); >int islower(int); >int isprint(int); >int ispunct(int); >int isspace(int); >int isupper(int); >int isxdigit(int); >int tolower(int); >int toupper(int); > >#if __XSI_VISIBLE >int isascii(int); >int toascii(int); >#endif ># 67 "/usr/include/ctype.h" 3 4 > >#if __ISO_C_VISIBLE >= 1999 >int isblank(int); >#endif ># 71 "/usr/include/ctype.h" 3 4 > >#if __BSD_VISIBLE >int digittoint(int); >int ishexnumber(int); >int isideogram(int); >int isnumber(int); >int isphonogram(int); >int isrune(int); >int isspecial(int); >#endif ># 81 "/usr/include/ctype.h" 3 4 > >#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) >#if 0 /* expanded by -frewrite-includes */ >#include <xlocale/_ctype.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/xlocale/_ctype.h" 1 3 4 >/*- > * Copyright (c) 2011 The FreeBSD Foundation > * All rights reserved. > * > * This software was developed by David Chisnall under sponsorship from > * the FreeBSD Foundation. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > * $FreeBSD: releng/10.3/include/xlocale/_ctype.h 243032 2012-11-14 17:44:37Z demon $ > */ > > >#if (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \ > (!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H)) > >#ifdef _XLOCALE_WCTYPES >#define _XLOCALE_WCTYPE_H >#else ># 39 "/usr/include/xlocale/_ctype.h" 3 4 >#define _XLOCALE_CTYPE_H >#endif ># 41 "/usr/include/xlocale/_ctype.h" 3 4 > >#ifndef _LOCALE_T_DEFINED >#define _LOCALE_T_DEFINED >typedef struct _xlocale *locale_t; >#endif ># 46 "/usr/include/xlocale/_ctype.h" 3 4 > >#ifndef _XLOCALE_RUN_FUNCTIONS_DEFINED >#define _XLOCALE_RUN_FUNCTIONS_DEFINED 1 >unsigned long ___runetype_l(__ct_rune_t, locale_t) __pure; >__ct_rune_t ___tolower_l(__ct_rune_t, locale_t) __pure; >__ct_rune_t ___toupper_l(__ct_rune_t, locale_t) __pure; >_RuneLocale *__runes_for_locale(locale_t, int*); >#endif ># 54 "/usr/include/xlocale/_ctype.h" 3 4 > >#ifndef _XLOCALE_INLINE >#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) >/* GNU89 inline has nonstandard semantics. */ >#define _XLOCALE_INLINE extern __inline >#else ># 60 "/usr/include/xlocale/_ctype.h" 3 4 >/* Hack to work around people who define inline away */ >#ifdef inline >#define _XLOCALE_INLINE static __inline >#else ># 64 "/usr/include/xlocale/_ctype.h" 3 4 >/* Define with C++ / C99 compatible semantics */ >#define _XLOCALE_INLINE inline >#endif ># 67 "/usr/include/xlocale/_ctype.h" 3 4 >#endif ># 68 "/usr/include/xlocale/_ctype.h" 3 4 >#endif /* _XLOCALE_INLINE */ ># 69 "/usr/include/xlocale/_ctype.h" 3 4 > >#ifdef _XLOCALE_WCTYPES >_XLOCALE_INLINE int >__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); >_XLOCALE_INLINE int >__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); > >_XLOCALE_INLINE int >__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) >{ > int __limit; > _RuneLocale *runes = __runes_for_locale(__loc, &__limit); > return ((__c < 0 || __c >= _CACHED_RUNES) ? ___runetype_l(__c, __loc) : > runes->__runetype[__c]) & __f; >} > >_XLOCALE_INLINE int >__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) >{ > return (!!__maskrune_l(__c, __f, __loc)); >} > >#define XLOCALE_ISCTYPE(fname, cat) \ > _XLOCALE_INLINE int isw##fname##_l(int, locale_t);\ > _XLOCALE_INLINE int isw##fname##_l(int __c, locale_t __l)\ > { return __istype_l(__c, cat, __l); } >#else ># 96 "/usr/include/xlocale/_ctype.h" 3 4 >_XLOCALE_INLINE int >__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); >_XLOCALE_INLINE int >__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); > >_XLOCALE_INLINE int >__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) >{ > int __limit; > _RuneLocale *runes = __runes_for_locale(__loc, &__limit); > return (__c < 0 || __c >= __limit) ? 0 : > runes->__runetype[__c] & __f; >} > >_XLOCALE_INLINE int >__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) >{ > return (!!__sbmaskrune_l(__c, __f, __loc)); >} > >#define XLOCALE_ISCTYPE(__fname, __cat) \ > _XLOCALE_INLINE int is##__fname##_l(int, locale_t); \ > _XLOCALE_INLINE int is##__fname##_l(int __c, locale_t __l)\ > { return __sbistype_l(__c, __cat, __l); } >#endif ># 121 "/usr/include/xlocale/_ctype.h" 3 4 > >XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D) >XLOCALE_ISCTYPE(alpha, _CTYPE_A) >XLOCALE_ISCTYPE(blank, _CTYPE_B) >XLOCALE_ISCTYPE(cntrl, _CTYPE_C) >XLOCALE_ISCTYPE(digit, _CTYPE_D) >XLOCALE_ISCTYPE(graph, _CTYPE_G) >XLOCALE_ISCTYPE(hexnumber, _CTYPE_X) >XLOCALE_ISCTYPE(ideogram, _CTYPE_I) >XLOCALE_ISCTYPE(lower, _CTYPE_L) >XLOCALE_ISCTYPE(number, _CTYPE_D) >XLOCALE_ISCTYPE(phonogram, _CTYPE_Q) >XLOCALE_ISCTYPE(print, _CTYPE_R) >XLOCALE_ISCTYPE(punct, _CTYPE_P) >XLOCALE_ISCTYPE(rune, 0xFFFFFF00L) >XLOCALE_ISCTYPE(space, _CTYPE_S) >XLOCALE_ISCTYPE(special, _CTYPE_T) >XLOCALE_ISCTYPE(upper, _CTYPE_U) >XLOCALE_ISCTYPE(xdigit, _CTYPE_X) >#undef XLOCALE_ISCTYPE > >#ifdef _XLOCALE_WCTYPES >_XLOCALE_INLINE int towlower_l(int, locale_t); >_XLOCALE_INLINE int __wcwidth_l(__ct_rune_t, locale_t); >_XLOCALE_INLINE int towupper_l(int, locale_t); > >_XLOCALE_INLINE int towlower_l(int __c, locale_t __l) >{ > int __limit; > _RuneLocale *__runes = __runes_for_locale(__l, &__limit); > return (__c < 0 || __c >= _CACHED_RUNES) ? ___tolower_l(__c, __l) : > __runes->__maplower[__c]; >} >_XLOCALE_INLINE int towupper_l(int __c, locale_t __l) >{ > int __limit; > _RuneLocale *__runes = __runes_for_locale(__l, &__limit); > return (__c < 0 || __c >= _CACHED_RUNES) ? ___toupper_l(__c, __l) : > __runes->__mapupper[__c]; >} >_XLOCALE_INLINE int >__wcwidth_l(__ct_rune_t _c, locale_t __l) >{ > unsigned int _x; > > if (_c == 0) > return (0); > _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, __l); > if ((_x & _CTYPE_SWM) != 0) > return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); > return ((_x & _CTYPE_R) != 0 ? 1 : -1); >} >int iswctype_l(wint_t __wc, wctype_t __charclass, locale_t __l); >wctype_t wctype_l(const char *property, locale_t __l); >wint_t towctrans_l(wint_t __wc, wctrans_t desc, locale_t __l); >wint_t nextwctype_l(wint_t __wc, wctype_t wct, locale_t __l); >wctrans_t wctrans_l(const char *__charclass, locale_t __l); >#undef _XLOCALE_WCTYPES >#else ># 180 "/usr/include/xlocale/_ctype.h" 3 4 >_XLOCALE_INLINE int digittoint_l(int, locale_t); >_XLOCALE_INLINE int tolower_l(int, locale_t); >_XLOCALE_INLINE int toupper_l(int, locale_t); > >_XLOCALE_INLINE int digittoint_l(int __c, locale_t __l) >{ return __sbmaskrune_l((__c), 0xFF, __l); } > >_XLOCALE_INLINE int tolower_l(int __c, locale_t __l) >{ > int __limit; > _RuneLocale *__runes = __runes_for_locale(__l, &__limit); > return (__c < 0 || __c >= __limit) ? __c : > __runes->__maplower[__c]; >} >_XLOCALE_INLINE int toupper_l(int __c, locale_t __l) >{ > int __limit; > _RuneLocale *__runes = __runes_for_locale(__l, &__limit); > return (__c < 0 || __c >= __limit) ? __c : > __runes->__mapupper[__c]; >} >#endif ># 202 "/usr/include/xlocale/_ctype.h" 3 4 >#endif /* (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \ > (!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H)) */ ># 204 "/usr/include/xlocale/_ctype.h" 3 4 ># 84 "/usr/include/ctype.h" 2 3 4 >#endif ># 85 "/usr/include/ctype.h" 3 4 >__END_DECLS > >#ifndef __cplusplus >#define isalnum(c) __sbistype((c), _CTYPE_A|_CTYPE_D) >#define isalpha(c) __sbistype((c), _CTYPE_A) >#define iscntrl(c) __sbistype((c), _CTYPE_C) >#define isdigit(c) __isctype((c), _CTYPE_D) /* ANSI -- locale independent */ >#define isgraph(c) __sbistype((c), _CTYPE_G) >#define islower(c) __sbistype((c), _CTYPE_L) >#define isprint(c) __sbistype((c), _CTYPE_R) >#define ispunct(c) __sbistype((c), _CTYPE_P) >#define isspace(c) __sbistype((c), _CTYPE_S) >#define isupper(c) __sbistype((c), _CTYPE_U) >#define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */ >#define tolower(c) __sbtolower(c) >#define toupper(c) __sbtoupper(c) >#endif /* !__cplusplus */ ># 102 "/usr/include/ctype.h" 3 4 > >#if __XSI_VISIBLE >/* > * POSIX.1-2001 specifies _tolower() and _toupper() to be macros equivalent to > * tolower() and toupper() respectively, minus extra checking to ensure that > * the argument is a lower or uppercase letter respectively. We've chosen to > * implement these macros with the same error checking as tolower() and > * toupper() since this doesn't violate the specification itself, only its > * intent. We purposely leave _tolower() and _toupper() undocumented to > * discourage their use. > * > * XXX isascii() and toascii() should similarly be undocumented. > */ >#define _tolower(c) __sbtolower(c) >#define _toupper(c) __sbtoupper(c) >#define isascii(c) (((c) & ~0x7F) == 0) >#define toascii(c) ((c) & 0x7F) >#endif ># 120 "/usr/include/ctype.h" 3 4 > >#if __ISO_C_VISIBLE >= 1999 && !defined(__cplusplus) >#define isblank(c) __sbistype((c), _CTYPE_B) >#endif ># 124 "/usr/include/ctype.h" 3 4 > >#if __BSD_VISIBLE >#define digittoint(c) __sbmaskrune((c), 0xFF) >#define ishexnumber(c) __sbistype((c), _CTYPE_X) >#define isideogram(c) __sbistype((c), _CTYPE_I) >#define isnumber(c) __sbistype((c), _CTYPE_D) >#define isphonogram(c) __sbistype((c), _CTYPE_Q) >#define isrune(c) __sbistype((c), 0xFFFFFF00L) >#define isspecial(c) __sbistype((c), _CTYPE_T) >#endif ># 134 "/usr/include/ctype.h" 3 4 > >#endif /* !_CTYPE_H_ */ ># 136 "/usr/include/ctype.h" 3 4 ># 35 "url.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/types.h> >#endif /* expanded by -frewrite-includes */ ># 36 "url.c" > >DPS_URL * __DPSCALL DpsURLInit(DPS_URL *url) { > if (url == NULL) { > url = (DPS_URL*)DpsMalloc(sizeof(DPS_URL)); > if (url == NULL) return NULL; > bzero((void*)url, sizeof(DPS_URL)); > url->freeme = 1; > } else { > int fr = url->freeme; > bzero((void*)url, sizeof(DPS_URL)); > url->freeme = fr; > } > return url; >} > >void __DPSCALL DpsURLFree(DPS_URL *url) { > DPS_FREE(url->schema); > DPS_FREE(url->specific); > DPS_FREE(url->hostinfo); > DPS_FREE(url->auth); > DPS_FREE(url->hostname); > DPS_FREE(url->path); > DPS_FREE(url->directory); > DPS_FREE(url->filename); > DPS_FREE(url->anchor); > DPS_FREE(url->query_string); > if(url->freeme){ > DPS_FREE(url); > } else { > url->port = url->default_port = 0; > } >} > >#ifdef DEBUG_URL >int _DpsURLParse(DPS_URL *url, const char *str, const char *filename, int line) { >#else ># 72 "url.c" >int DpsURLParse(DPS_URL *url, const char *str) { >#endif ># 74 "url.c" > char *schema,*anchor,*file,*query; > char *s; >/* size_t len = dps_strlen(str);*/ >#ifdef WITH_PARANOIA > void * paran = DpsViolationEnter(paran); >#endif ># 80 "url.c" > >#ifdef DEBUG_URL > fprintf(stderr, " -- %s:%d Parser url: %s\n", filename, line, str); >#endif ># 84 "url.c" > > DPS_FREE(url->schema); > DPS_FREE(url->specific); > DPS_FREE(url->hostinfo); > DPS_FREE(url->hostname); > DPS_FREE(url->anchor); > DPS_FREE(url->auth); > url->port=0; > url->default_port=0; > DPS_FREE(url->path); > DPS_FREE(url->directory); > DPS_FREE(url->filename); > DPS_FREE(url->query_string); > >/* if(len >= DPS_URLSIZE)return(DPS_URL_LONG); FIXME: Chage this cheking for configured parameter, not DPS_URLSIZE */ > s = (char*)DpsStrdup(str); > if (s == NULL) { >#ifdef WITH_PARANOIA > DpsViolationExit(-1, paran); >#endif ># 104 "url.c" > return DPS_ERROR; > } > > url->len = dps_strlen(str); > > /* Find possible schema end than */ > /* Check that it is really schema */ > /* It must consist of alphas only */ > /* We will take in account digits */ > /* also for oracle8:// for example */ > /* We must check it because */ > /* It might be anchor also */ > /* For example: */ > /* "mod/index.html#a:1" */ > > if((schema=strchr(s,':'))){ > const char * ch; > for(ch=s;ch<schema;ch++){ > if(!isalnum(*ch)){ > /* Bad character */ > /* so it is not schema */ > schema=0;break; > } > } > } > > if(schema){ > /* Have scheme - absolute path */ > *schema=0; > url->schema = (char*)DpsStrdup(s); > url->specific = (char*)DpsStrdup(schema + 1); > *schema=':'; > if(!strcasecmp(url->schema,"http"))url->default_port=80; > else > if(!strcasecmp(url->schema,"https"))url->default_port=443; > else > if(!strcasecmp(url->schema,"nntp"))url->default_port=119; > else > if(!strcasecmp(url->schema,"news"))url->default_port=119; > else > if(!strcasecmp(url->schema,"ftp"))url->default_port=21; > > if(!strncmp(url->specific,"//",2)){ > char *ss,*hostname; > > /* Have hostinfo */ > if((ss=strchr(url->specific+2,'/'))){ > /* Have hostname with path */ > *ss=0; > url->hostinfo = (char*)DpsStrdup(url->specific + 2); > *ss='/'; > url->path = (char*)DpsStrdup(ss); > }else{ > /* Hostname without path */ > if ((ss = strchr(url->specific + 2, '?'))) { > /* Have hostname with parameters */ > *ss = 0; > url->hostinfo = (char*)DpsStrdup(url->specific + 2); > *ss='?'; > url->path = (char*)DpsStrdup("/"); > }else { > url->hostinfo = (char*)DpsStrdup(url->specific + 2); > url->path = (char*)DpsStrdup("/"); > } > } > if((hostname=strrchr(url->hostinfo,'@'))){ > /* Username and password is given */ > /* Store auth string user:password */ > *hostname=0; > url->auth = (char*)DpsStrdup(url->hostinfo); > *hostname='@'; > hostname++; > }else{ > hostname = url->hostinfo; > } > /* > FIXME: > for(h=hostname;*h;h++){ > if( *h>='A' && *h<='Z') > *h=(*h)-'A'+'a'; > } > */ > > if((ss=strchr(hostname,':'))){ > *ss=0; > url->hostname = (char*)DpsStrdup(hostname); > *ss=':'; > url->port=atoi(ss+1); > }else{ > url->hostname = (char*)DpsStrdup(hostname); > url->port=0; > } > }else{ > /* Have not host but have schema */ > /* This is possible for: */ > /* file: mailto: htdb: news: */ > /* As far as we do not need mailto: just ignore it */ > > if(!strcasecmp(url->schema,"mailto") > || !strcasecmp(url->schema,"javascript") > || !strcasecmp(url->schema,"feed") > ) { > DPS_FREE(s); >#ifdef WITH_PARANOIA > DpsViolationExit(-1, paran); >#endif ># 210 "url.c" > return(DPS_URL_BAD); > } else > if(!strcasecmp(url->schema,"file")) > url->path = (char*)DpsStrdup(url->specific); > else > if(!strcasecmp(url->schema,"exec")) > url->path = (char*)DpsStrdup(url->specific); > else > if(!strcasecmp(url->schema,"cgi")) > url->path = (char*)DpsStrdup(url->specific); > else > if(!strcasecmp(url->schema,"htdb")) > url->path = (char*)DpsStrdup(url->specific); > else > if(!strcasecmp(url->schema,"news")){ > /* Now we will use localhost as NNTP */ > /* server as it is not indicated in URL */ > url->hostname = (char*)DpsStrdup("localhost"); > url->path = (char*)DpsMalloc(dps_strlen(url->specific) + 2); > if (url->path == NULL) { > DPS_FREE(s); >#ifdef WITH_PARANOIA > DpsViolationExit(-1, paran); >#endif ># 234 "url.c" > return DPS_ERROR; > } > sprintf(url->path,"/%s",url->specific); > url->default_port=119; > }else{ > /* Unknown strange schema */ > DPS_FREE(s); >#ifdef WITH_PARANOIA > DpsViolationExit(-1, paran); >#endif ># 244 "url.c" > return(DPS_URL_BAD); > } > } > }else{ > if (s[0] == '/' && s[1] == '/') { /* have hostinfo without scheme */ > char *ss,*hostname; > url->specific = (char*)DpsStrdup(s); > /* Have hostinfo */ > if((ss = strchr(url->specific+2, '/'))) { > /* Have hostname with path */ > *ss = 0; > url->hostinfo = (char*)DpsStrdup(url->specific + 2); > *ss = '/'; > url->path = (char*)DpsStrdup(ss); > } else { > /* Hostname without path */ > if ((ss = strchr(url->specific + 2, '?'))) { > /* Have hostname with parameters */ > *ss = 0; > url->hostinfo = (char*)DpsStrdup(url->specific + 2); > *ss='?'; > url->path = (char*)DpsStrdup("/"); > }else { > url->hostinfo = (char*)DpsStrdup(url->specific + 2); > url->path = (char*)DpsStrdup("/"); > } > } > if((hostname=strrchr(url->hostinfo,'@'))){ > /* Username and password is given */ > /* Store auth string user:password */ > *hostname=0; > url->auth = (char*)DpsStrdup(url->hostinfo); > *hostname='@'; > hostname++; > }else{ > hostname = url->hostinfo; > } > /* > FIXME: > for(h=hostname;*h;h++){ > if( *h>='A' && *h<='Z') > *h=(*h)-'A'+'a'; > } > */ > > if((ss=strchr(hostname,':'))){ > *ss=0; > url->hostname = (char*)DpsStrdup(hostname); > *ss=':'; > url->port = atoi(ss+1); > }else{ > url->hostname = (char*)DpsStrdup(hostname); > url->port=0; > } > } else { > url->path = (char*)DpsStrdup(s); > } > } > > /* Cat an anchor if exist */ > if((anchor=strstr(url->path,"#"))) { > url->anchor = (char*)DpsStrdup(anchor); > *anchor=0; > } > > > /* If path is not full just copy it to filename */ > /* i.e. neither /usr/local/ nor c:/windows/temp/ */ > > if((url->path != NULL) && (url->path[0] != '\0') && (url->path[0] != '/') && (url->path[0] != '?') && (url->path[1] != ':')) { > /* Relative path */ > if(!strncmp(url->path,"./",2)) > url->filename = (char*)DpsStrdup(url->path + 2); > else > url->filename = (char*)DpsStrdup(url->path); > url->path[0] = 0; > } > > /* truncate path to query_string */ > /* and store query_string */ > > if((query = strrchr(url->path, '?'))){ > url->query_string = (char*)DpsStrdup(query); > *(query) = 0; > } else if((query = strrchr(DPS_NULL2EMPTY(url->specific), '?'))) { > url->query_string = (char*)DpsStrdup(query); > } > > DpsURLNormalizePath(url->path); > > /* Now find right '/' sign and copy the rest to filename */ > > if((file=strrchr(url->path,'/'))&&(strcmp(file,"/"))){ > url->filename = (char*)DpsStrdup(file + 1); > *(file+1)=0; > } > > /* Now find right '/' sign and copy the rest to directory */ > > if ((file = strrchr(url->path,'/'))) { > char *p_save = file; > for(file--; (file > url->path) && (*file != '/'); file--); > file++; > if (*file) { > *p_save = '\0'; > url->directory = (char*)DpsStrdup(file); > *p_save = '/'; > } > } > > DPS_FREE(s); > if (url->hostname != NULL) { > DpsRTrim(url->hostname, "."); > url->domain_level = 1; > for (s = url->hostname; *s; s++) { > *s = (char)dps_tolower((int)*s); > if (*s == '.') url->domain_level++; > if (strchr(",'\";", (int)*s)) { >#ifdef WITH_PARANOIA > DpsViolationExit(-1, paran); >#endif ># 365 "url.c" > return DPS_URL_BAD; > } > } > } > if (url->hostinfo != NULL) { > DpsRTrim(url->hostinfo, "."); > s = strrchr(url->hostinfo, '@'); > for (s = (s == NULL) ? url->hostinfo : s + 1; *s; s++) *s = (char)dps_tolower((int)*s); > } > if (url->schema != NULL) for (s = url->schema; *s; s++) *s = (char)dps_tolower((int)*s); > >/* fprintf(stderr, "url: .path: %s port:%d\n", url->path, url->port);*/ > >#ifdef WITH_PARANOIA > DpsViolationExit(-1, paran); >#endif ># 381 "url.c" > return DPS_OK; >} > > > >char * DpsURLNormalizePath(char * str){ > char * s=str; > char * q; > char * d; > > /* Hide query string */ > > if((q=strchr(s,'?'))){ > *q++='\0'; > if(!*q)q=NULL; > } > > /* Remove all "/../" entries */ > > while((d=strstr(str,"/../"))){ > char * p; > > if(d>str){ > /* Skip non-slashes */ > for(p=d-1;(*p!='/')&&(p>str);p--); > > /* Skip slashes */ > while((p>(str+1))&&(*(p-1)=='/'))p--; > }else{ > /* We are at the top level and have ../ */ > /* Remove it too to avoid loops */ > p=str; > } > dps_memmove(p,d+3,dps_strlen(d)-2); > } > > /* Remove remove trailig "/.." */ > > d=str+dps_strlen(str); > if (( d - str > 2) && (!strcmp(d - 3, "/.."))) { > d -= (d - str > 3) ? 4 : 3; > while((d>str)&&(*d!='/'))d--; > if(*d=='/')d[1]='\0'; > else dps_strcpy(str,"/"); > } > > /* Remove all "/./" entries */ > > while((d=strstr(str,"/./"))){ > dps_memmove(d,d+2,dps_strlen(d)-1); > } > > /* Remove the trailing "/." */ > > if((d=str+dps_strlen(str))>(str+2)) > if(!strcmp(d-2,"/.")) > *(d-1)='\0'; > > /* Remove all "//" entries */ > while((d=strstr(str,"//"))){ > dps_memmove(d,d+1,dps_strlen(d)); > } > > > /* Replace "%7E" with "~" */ > /* Actually it is to be done */ > /* for all valid characters */ > /* which do not require escaping */ > /* However I'm lazy, do it for 7E */ > /* as the most often "abused" */ > > while((d=strstr(str,"%7E"))){ > *d='~'; > dps_memmove(d+1,d+3,dps_strlen(d+3)+1); > } > > /* Restore query string */ > > if(q){ > char * e=str+dps_strlen(str); > *e='?'; > dps_memmove(e+1,q,dps_strlen(q)+1); > } > > return str; >} > >/* RFC3986: http://www.ietf.org/rfc/rfc3986.txt > >5.2.2. Transform References > > For each URI reference (R), the following pseudocode describes an > algorithm for transforming R into its target URI (T): > > -- The URI reference is parsed into the five URI components > -- > (R.scheme, R.authority, R.path, R.query, R.fragment) = parse(R); > > -- A non-strict parser may ignore a scheme in the reference > -- if it is identical to the base URI's scheme. > -- > if ((not strict) and (R.scheme == Base.scheme)) then > undefine(R.scheme); > endif; > > if defined(R.scheme) then > T.scheme = R.scheme; > T.authority = R.authority; > T.path = remove_dot_segments(R.path); > T.query = R.query; > else > if defined(R.authority) then > T.authority = R.authority; > T.path = remove_dot_segments(R.path); > T.query = R.query; > else > if (R.path == "") then > T.path = Base.path; > if defined(R.query) then > T.query = R.query; > else > T.query = Base.query; > endif; > else > if (R.path starts-with "/") then > T.path = remove_dot_segments(R.path); > else > T.path = merge(Base.path, R.path); > T.path = remove_dot_segments(T.path); > endif; > T.query = R.query; > endif; > T.authority = Base.authority; > endif; > T.scheme = Base.scheme; > endif; > > T.fragment = R.fragment; > >*/ >void RelLink(DPS_AGENT *Indexer, DPS_URL *curURL, DPS_URL *newURL, char **str, int ReverseAliasFlag, int ConfFlag) { > const char *schema = newURL->schema ? newURL->schema : curURL->schema; > const char *hostname = newURL->hostname ? newURL->hostname : curURL->hostname; > const char *auth = NULL; > const char *path = (newURL->path && newURL->path[0]) ? newURL->path : curURL->path; > const char *fname = ((newURL->filename && newURL->filename[0]) || (newURL->path && newURL->path[0])) ? > newURL->filename : curURL->filename; > const char *query_string = (newURL->query_string || !ConfFlag) ? newURL->query_string : curURL->query_string; > char *anchor = newURL->anchor; > char *pathfile = (char*)DpsMalloc(dps_strlen(DPS_NULL2EMPTY(path)) + dps_strlen(DPS_NULL2EMPTY(fname)) + > dps_strlen(DPS_NULL2EMPTY(query_string)) + +dps_strlen(DPS_NULL2EMPTY(anchor)) + 5); > int cascade; > DPS_MATCH *Alias; > char *alias = NULL; > size_t aliassize, nparts = 10; > DPS_MATCH_PART Parts[10]; > > if (pathfile == NULL) return; > > if (newURL->hostinfo == NULL) newURL->charset_id = curURL->charset_id; > > if (newURL->hostname == NULL) { > auth = newURL->auth ? newURL->auth : curURL->auth; > } else auth = newURL->auth; > >/* sprintf(pathfile, "/%s%s%s", DPS_NULL2EMPTY(path), DPS_NULL2EMPTY(fname), DPS_NULL2EMPTY(query_string));*/ > pathfile[0] = '/'; > dps_strcpy(pathfile + 1, DPS_NULL2EMPTY(path)); dps_strcat(pathfile, DPS_NULL2EMPTY(fname)); dps_strcat(pathfile, DPS_NULL2EMPTY(query_string)); > if (anchor != NULL) { > dps_strcat(pathfile, anchor); > } > > DpsURLNormalizePath(pathfile); > > if (!strcasecmp(DPS_NULL2EMPTY(schema), "mailto") > || !strcasecmp(DPS_NULL2EMPTY(schema), "javascript") > || !strcasecmp(DPS_NULL2EMPTY(schema), "feed") > ) { > *str = (char*)DpsMalloc(dps_strlen(DPS_NULL2EMPTY(schema)) + dps_strlen(DPS_NULL2EMPTY(newURL->specific)) + 4); > if (*str == NULL) { > DPS_FREE(pathfile); > return; > } >/* sprintf(*str, "%s:%s", DPS_NULL2EMPTY(schema), DPS_NULL2EMPTY(newURL->specific));*/ > dps_strcpy(*str, DPS_NULL2EMPTY(schema)); dps_strcat(*str, ":"); dps_strcat(*str, DPS_NULL2EMPTY(newURL->specific)); > } else if(/*!strcasecmp(DPS_NULL2EMPTY(schema), "file") ||*/ !strcasecmp(DPS_NULL2EMPTY(schema), "htdb")) { > *str = (char*)DpsMalloc(dps_strlen(DPS_NULL2EMPTY(schema)) + dps_strlen(pathfile) + 4); > if (*str == NULL) { > DPS_FREE(pathfile); > return; > } >/* sprintf(*str, "%s:%s", DPS_NULL2EMPTY(schema), pathfile);*/ > dps_strcpy(*str, DPS_NULL2EMPTY(schema)); dps_strcat(*str, ":"); dps_strcat(*str, pathfile); > }else{ > *str = (char*)DpsMalloc(dps_strlen(DPS_NULL2EMPTY(schema)) + dps_strlen(pathfile) + dps_strlen(DPS_NULL2EMPTY(hostname)) + dps_strlen(DPS_NULL2EMPTY(auth)) + 8); > if (*str == NULL) { > DPS_FREE(pathfile); > return; > } >/* sprintf(*str, "%s://%s%s", DPS_NULL2EMPTY(schema), DPS_NULL2EMPTY(hostinfo), pathfile);*/ > dps_strcpy(*str, DPS_NULL2EMPTY(schema)); dps_strcat(*str, "://"); > if (auth) { > dps_strcat(*str, auth); dps_strcat(*str,"@"); > } > dps_strcat(*str, DPS_NULL2EMPTY(hostname)); dps_strcat(*str, pathfile); > } > > if(!strncmp(*str, "ftp://", 6) && (strstr(*str, ";type="))) > *(strstr(*str, ";type")) = '\0'; > DPS_FREE(pathfile); > > if (ReverseAliasFlag) { > const char *alias_prog = DpsVarListFindStr(&Indexer->Vars, "ReverseAliasProg", NULL); > > if (alias_prog) { > int result; > aliassize = 256 + 2 * dps_strlen(*str); > alias = (char*)DpsRealloc(alias, aliassize); > if (alias == NULL) { > DpsLog(Indexer, DPS_LOG_ERROR, "No memory (%d bytes). %s line %d", aliassize, __FILE__, __LINE__); > goto ret; > } > alias[0] = '\0'; > result = DpsAliasProg(Indexer, alias_prog, *str, alias, aliassize - 1); > DpsLog(Indexer, DPS_LOG_EXTRA, "ReverseAliasProg result: '%s'", alias); > if(result != DPS_OK) goto ret; > DPS_FREE(*str); > *str = (char*)DpsStrdup(alias); > } > > DPS_GETLOCK(Indexer, DPS_LOCK_CONF); > for(cascade = 0; ((Alias=DpsMatchListFind(&Indexer->Conf->ReverseAliases,*str,nparts,Parts))) && (cascade < 1024); cascade++) { > aliassize = dps_strlen(Alias->arg) + dps_strlen(Alias->pattern) + dps_strlen(*str) + 128; > alias = (char*)DpsRealloc(alias, aliassize); > if (alias == NULL) { > DpsLog(Indexer, DPS_LOG_ERROR, "No memory (%d bytes). %s line %d", aliassize, __FILE__, __LINE__); > DPS_RELEASELOCK(Indexer, DPS_LOCK_CONF); > goto ret; > } > DpsMatchApply(alias,aliassize,*str,Alias->arg,Alias,nparts,Parts); > if(alias[0]){ > DpsLog(Indexer,DPS_LOG_DEBUG,"ReverseAlias%d: pattern:%s, arg:%s -> '%s'", cascade, Alias->pattern, Alias->arg, alias); > DPS_FREE(*str); > *str = (char*)DpsStrdup(alias); > } else break; > if (Alias->last) break; > } > DPS_RELEASELOCK(Indexer, DPS_LOCK_CONF); > } > > /* Cat an anchor if exist */ > if((anchor=strstr(*str, "#"))) *anchor = 0; > >ret: > DPS_FREE(alias); > >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 213870
: 176255 |
176256