FreeBSD Bugzilla – Attachment 195110 Details for
Bug 229754
devel/libslang2 crash during build
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
The C file after preprocessing
stats_kendall-bc8f2f.c (text/plain), 236.82 KB, created by
Mikhail Teterin
on 2018-07-13 13:30:27 UTC
(
hide
)
Description:
The C file after preprocessing
Filename:
MIME Type:
Creator:
Mikhail Teterin
Created:
2018-07-13 13:30:27 UTC
Size:
236.82 KB
patch
obsolete
># 1 "<built-in>" 1 ># 1 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 1 >/* >Copyright (C) 2017,2018 John E. Davis > >This file is part of the S-Lang Library. > >The S-Lang Library 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. > >The S-Lang Library 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 library; if not, write to the Free Software >Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, >USA. >*/ >#if 0 /* expanded by -frewrite-includes */ >#include "config.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" 1 >/* src/sysconf.h. Generated from config.hin by configure. */ >/* -*- c -*- */ >/* Note: this is for unix only. */ > >#ifndef SL_CONFIG_H >#define SL_CONFIG_H > >/* Files used by the slang-readline interface. The interface first tries > * to read SLRLINE_USER_INIT_FILE from $HOME, and if that does not exist, it > * will read SLRLINE_SYS_INIT_FILE from the interpreter's load path. > */ >#define SLRLINE_USER_INIT_FILE ".slrlinerc" >#define SLRLINE_SYS_INIT_FILE "rline/slrline.rc" > >/* define if you have long long type */ >#define HAVE_LONG_LONG 1 > >/* The following set defines may be necessary to activate long file support */ >/* #undef _FILE_OFFSET_BITS */ >/* #undef _LARGE_FILES */ >/* #undef _LARGEFILE_SOURCE */ > >/* define if you have stdlib.h */ >#define HAVE_STDLIB_H 1 > >/* define if you have unistd.h */ >#define HAVE_UNISTD_H 1 > >/* define if you have termios.h */ >#define HAVE_TERMIOS_H 1 > >/* define if you have memory.h */ >#define HAVE_MEMORY_H 1 > >/* define if you have malloc.h */ >/* #undef HAVE_MALLOC_H */ > >/* define if you have memset */ >#define HAVE_MEMSET 1 > >/* define if you have memcpy */ >#define HAVE_MEMCPY 1 > >#define HAVE_SETLOCALE 1 >#define HAVE_NEWLOCALE 1 >#define HAVE_LOCALECONV 1 >#define HAVE_LOCALE_H 1 >#define HAVE_XLOCALE_H 1 >#define HAVE_LANGINFO_H 1 >#define HAVE_NL_LANGINFO_CODESET 1 > >#define HAVE_FLOATINGPOINT_H 1 >/* #undef HAVE_NAN_H */ >#define HAVE_IEEEFP_H 1 >#define HAVE_FENV_H 1 > >#define HAVE_FECLEAREXCEPT 1 >/* #undef HAVE_FPSETSTICKY */ > >#define HAVE_VFSCANF 1 >#define HAVE_STRTOD 1 >#define HAVE_ATOLL 1 >#define HAVE_STRTOLL 1 >#define HAVE_STRTOD_L 1 > >/* define if you have fcntl.h */ >#define HAVE_FCNTL_H 1 > >/* Define if you have the vsnprintf, snprintf functions and they return > * EOF upon failure. > */ >#define HAVE_VSNPRINTF 1 >#define HAVE_SNPRINTF 1 > >/* define if you have sys/fcntl.h */ >#define HAVE_SYS_FCNTL_H 1 > >#define HAVE_SYS_STATVFS_H 1 > >#define HAVE_SYS_TYPES_H 1 >#define HAVE_SYS_WAIT_H 1 >#define HAVE_SYS_TIMES_H 1 >#define HAVE_SYS_TIME_H 1 > >#define HAVE_UTIME_H 1 >#define HAVE_UTIME 1 >#define HAVE_UTIMES 1 > >#define HAVE_GETITIMER 1 >#define HAVE_SETITIMER 1 >#define HAVE_SYS_MMAN_H 1 > >#define HAVE_SYS_RESOURCE_H 1 >#define HAVE_GETRUSAGE 1 > > >/* Set these to the appropriate values */ >#define SIZEOF_SHORT 2 >#define SIZEOF_INT 4 >#define SIZEOF_LONG 4 >#define SIZEOF_FLOAT 4 >#define SIZEOF_DOUBLE 8 >#define SIZEOF_LONG_LONG 8 > >/* #undef off_t */ >#define SIZEOF_OFF_T 8 >/* #undef size_t */ >#define SIZEOF_SIZE_T 4 > >/* define if you have these. */ >#define HAVE_ATEXIT 1 >/* #undef HAVE_ON_EXIT */ >#define HAVE_PUTENV 1 >#define HAVE_GETCWD 1 >#define HAVE_TCGETATTR 1 >#define HAVE_TCSETATTR 1 >#define HAVE_CFGETOSPEED 1 >#define HAVE_LSTAT 1 >#define HAVE_KILL 1 >#define HAVE_KILLPG 1 >#define HAVE_CHOWN 1 >#define HAVE_LCHOWN 1 >#define HAVE_VSNPRINTF 1 >#define HAVE_POPEN 1 >#define HAVE_UMASK 1 >#define HAVE_READLINK 1 >#define HAVE_SYMLINK 1 >#define HAVE_LINK 1 >#define HAVE_TIMES 1 >#define HAVE_GMTIME 1 >#define HAVE_GMTIME_R 1 >#define HAVE_LOCALTIME_R 1 >#define HAVE_CTIME_R 1 >#define HAVE_GETTIMEOFDAY 1 >#define HAVE_MKTIME 1 >#define HAVE_MKFIFO 1 >#define HAVE_MMAP 1 >#define HAVE_TTYNAME_R 1 >#define HAVE_TTYNAME 1 >#define HAVE_STATVFS 1 >#define HAVE_GETPPID 1 >#define HAVE_GETGID 1 >#define HAVE_GETEGID 1 >#define HAVE_GETEUID 1 >#define HAVE_GETUID 1 > >#define HAVE_SETGID 1 >#define HAVE_SETUID 1 > >#define HAVE_GETPGID 1 >#define HAVE_GETPGRP 1 >#define HAVE_SETPGID 1 >#define HAVE_SETPGRP 1 >#define HAVE_GETSID 1 >#define HAVE_SETSID 1 > >#define HAVE_GETPRIORITY 1 >#define HAVE_SETPRIORITY 1 > >#define HAVE_ISSETUGID 1 > >#define HAVE_ACOSH 1 >#define HAVE_ASINH 1 >#define HAVE_ATANH 1 > >/* #undef HAVE_ROUND */ >/* #undef HAVE_FINITE */ >#define HAVE_ISINF 1 >#define HAVE_ISNAN 1 >#define HAVE_HYPOT 1 >#define HAVE_ATAN2 1 >#define HAVE_FREXP 1 >#define HAVE_FREXPF 1 >#define HAVE_LDEXP 1 >#define HAVE_LDEXPF 1 >/* #undef HAVE_SINCOS */ >/* #undef HAVE_SINCOSF */ > >#define HAVE_DIRENT_H 1 >/* #undef HAVE_SYS_NDIR_H */ >/* #undef HAVE_SYS_DIR_H */ >/* #undef HAVE_NDIR_H */ > >#define HAVE_FSEEKO 1 >#define HAVE_SETVBUF 1 > >#define HAVE_DLFCN_H 1 > >#define HAVE_SYS_UTSNAME_H 1 >#define HAVE_UNAME 1 > >#define HAVE_ALARM 1 >#define HAVE_PAUSE 1 > >/* These are used by the socket module */ >#define HAVE_SOCKET 1 >#define HAVE_SOCKETPAIR 1 >#define HAVE_SYS_SOCKET_H 1 >/* #undef HAVE_SOCKET_H */ >#define HAVE_NETINET_IN_H 1 >#define HAVE_ARPA_INET_H 1 >#define HAVE_SYS_UN_H 1 >/* #undef socklen_t */ > >#define HAVE_CONFSTR 1 >#define HAVE_SYSCONF 1 >#define HAVE_PATHCONF 1 > >#define HAVE_ENVIRON 1 > >/* These two are needed on DOS-like systems. Unix does not require them. > * They are included here for consistency. > * >#define HAVE_IO_H >#define HAVE_PROCESS_H > */ > >#define HAVE_PCRE_H 1 > >#define USE_TERMCAP 1 > >/* #undef mode_t */ >/* #undef uid_t */ >/* #undef pid_t */ >/* #undef gid_t */ >/* #undef ptrdiff_t */ > >#define HAVE_SIGLONGJMP 1 > >/* Do we have posix signals? */ >#define HAVE_SIGACTION 1 >#define HAVE_SIGPROCMASK 1 >#define HAVE_SIGEMPTYSET 1 >#define HAVE_SIGADDSET 1 > >#define HAVE_ICONV 1 >#define ICONV_CONST > >#define HAVE_FORK 1 >#define HAVE_WAITPID 1 > >#if defined(HAVE_SIGADDSET) && defined(HAVE_SIGEMPTYSET) ># if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK) ># define SLANG_POSIX_SIGNALS ># endif ># 246 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" >#endif ># 247 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >/* Define if you need to in order for stat and other things to work. */ >/* #undef _POSIX_SOURCE */ > >#ifdef _AIX ># ifndef _POSIX_SOURCE ># define _POSIX_SOURCE 1 ># endif ># 255 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" ># ifndef _ALL_SOURCE ># define _ALL_SOURCE 1 ># endif ># 258 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" >/* This may generate warnings but the fact is that without it, xlc will > * INCORRECTLY inline many str* functions. */ >/* # undef __STR__ */ >#endif ># 262 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >/* define USE_TERMCAP if you want to use it instead of terminfo. */ >#if defined(sequent) || defined(NeXT) ># ifndef USE_TERMCAP ># define USE_TERMCAP 1 ># endif ># 268 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" >#endif ># 269 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >#if defined(ultrix) && !defined(__GNUC__) ># ifndef NO_PROTOTYPES ># define NO_PROTOTYPES ># endif ># 274 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" >#endif ># 275 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >#ifndef unix ># define unix 1 >#endif ># 279 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >#ifndef __unix__ ># define __unix__ 1 >#endif ># 283 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >#ifndef HAVE_LONG_LONG ># define SIZEOF_LONG_LONG 8 ># define SIZEOF_LONG_LONG 8 >#endif ># 288 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >#if defined(BUILD_DLL) && BUILD_DLL ># ifdef __CYGWIN32__ >/* # undef SLANG_DLL */ ># define SLANG_DLL 1 ># endif ># 294 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" >#endif ># 295 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" > >#endif /* SL_CONFIG_H */ ># 297 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/config.h" ># 22 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> >#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: stable/10/include/stdio.h 306846 2016-10-08 14:10:45Z vangyzen $ > */ > >#ifndef _STDIO_H_ >#define _STDIO_H_ > >#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: stable/10/sys/sys/cdefs.h 314494 2017-03-01 13:47:36Z avg $ > */ > >#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 !defined(__cplusplus) && !__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 ># 284 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__cplusplus) && __cplusplus >= 201103L >#define _Noreturn [[noreturn]] >#else ># 288 "/usr/include/sys/cdefs.h" 3 4 >#define _Noreturn __dead2 >#endif ># 290 "/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__) ># 296 "/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 ># 301 "/usr/include/sys/cdefs.h" 3 4 >#define _Static_assert(x, y) struct __hack >#endif ># 303 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 304 "/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 ># 311 "/usr/include/sys/cdefs.h" 3 4 >#define _Thread_local __thread >#endif ># 313 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 314 "/usr/include/sys/cdefs.h" 3 4 > >#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */ ># 316 "/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) ># 330 "/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 ># 334 "/usr/include/sys/cdefs.h" 3 4 > >/* > * C99 Static array indices in function parameter declarations. Syntax such as: > * void bar(int myArray[static 10]); > * is allowed in C99 but not in C++. Define __min_size appropriately so > * headers using it can be compiled in either language. Use like this: > * void bar(int myArray[__min_size(10)]); > */ >#if !defined(__cplusplus) && \ > (defined(__clang__) || __GNUC_PREREQ__(4, 6)) && \ > (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901)) >#define __min_size(x) static (x) >#else ># 347 "/usr/include/sys/cdefs.h" 3 4 >#define __min_size(x) (x) >#endif ># 349 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(2, 96) >#define __malloc_like __attribute__((__malloc__)) >#define __pure __attribute__((__pure__)) >#else ># 354 "/usr/include/sys/cdefs.h" 3 4 >#define __malloc_like >#define __pure >#endif ># 357 "/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 ># 361 "/usr/include/sys/cdefs.h" 3 4 >#define __always_inline >#endif ># 363 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(3, 1) >#define __noinline __attribute__ ((__noinline__)) >#else ># 367 "/usr/include/sys/cdefs.h" 3 4 >#define __noinline >#endif ># 369 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(3, 3) >#define __nonnull(x) __attribute__((__nonnull__(x))) >#else ># 373 "/usr/include/sys/cdefs.h" 3 4 >#define __nonnull(x) >#endif ># 375 "/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 ># 380 "/usr/include/sys/cdefs.h" 3 4 >#define __fastcall >#define __result_use_check >#endif ># 383 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(4, 1) >#define __returns_twice __attribute__((__returns_twice__)) >#else ># 387 "/usr/include/sys/cdefs.h" 3 4 >#define __returns_twice >#endif ># 389 "/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 ># 394 "/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 ># 398 "/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 ># 405 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __STDC_CONSTANT_MACROS >#define __STDC_CONSTANT_MACROS >#endif ># 408 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 409 "/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 ># 420 "/usr/include/sys/cdefs.h" 3 4 >#define __restrict restrict >#endif ># 422 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 423 "/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 ># 456 "/usr/include/sys/cdefs.h" 3 4 >#define __predict_true(exp) (exp) >#define __predict_false(exp) (exp) >#endif ># 459 "/usr/include/sys/cdefs.h" 3 4 > >#if __GNUC_PREREQ__(4, 0) >#define __hidden __attribute__((__visibility__("hidden"))) >#define __exported __attribute__((__visibility__("default"))) >#else ># 464 "/usr/include/sys/cdefs.h" 3 4 >#define __hidden >#define __exported >#endif ># 467 "/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 ># 475 "/usr/include/sys/cdefs.h" 3 4 >#ifndef __cplusplus >#define __offsetof(type, field) \ > ((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field)) >#else ># 479 "/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 ># 484 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 485 "/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 ># 500 "/usr/include/sys/cdefs.h" 3 4 >#define __containerof(x, s, m) \ > __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) >#endif ># 503 "/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 ># 517 "/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 ># 527 "/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 ># 534 "/usr/include/sys/cdefs.h" 3 4 >#define __printf0like(fmtarg, firstvararg) >#endif ># 536 "/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 ># 542 "/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 ># 555 "/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__ */ ># 567 "/usr/include/sys/cdefs.h" 3 4 >#endif /* __GNUC__ || __INTEL_COMPILER */ ># 568 "/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 ># 575 "/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 ># 583 "/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: stable/10/sys/sys/cdefs.h 314494 2017-03-01 13:47:36Z avg $"); > */ >#ifndef __FBSDID >#if !defined(lint) && !defined(STRIP_FBSDID) >#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) >#else ># 594 "/usr/include/sys/cdefs.h" 3 4 >#define __FBSDID(s) struct __hack >#endif ># 596 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 597 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __RCSID >#ifndef NO__RCSID >#define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) >#else ># 602 "/usr/include/sys/cdefs.h" 3 4 >#define __RCSID(s) struct __hack >#endif ># 604 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 605 "/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 ># 610 "/usr/include/sys/cdefs.h" 3 4 >#define __RCSID_SOURCE(s) struct __hack >#endif ># 612 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 613 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __SCCSID >#ifndef NO__SCCSID >#define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s) >#else ># 618 "/usr/include/sys/cdefs.h" 3 4 >#define __SCCSID(s) struct __hack >#endif ># 620 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 621 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __COPYRIGHT >#ifndef NO__COPYRIGHT >#define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s) >#else ># 626 "/usr/include/sys/cdefs.h" 3 4 >#define __COPYRIGHT(s) struct __hack >#endif ># 628 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 629 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __DECONST >#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var)) >#endif ># 633 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __DEVOLATILE >#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var)) >#endif ># 637 "/usr/include/sys/cdefs.h" 3 4 > >#ifndef __DEQUALIFY >#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) >#endif ># 641 "/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 ># 670 "/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 ># 676 "/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 ># 684 "/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 ># 688 "/usr/include/sys/cdefs.h" 3 4 >#define __XSI_VISIBLE 500 >#undef _POSIX_C_SOURCE >#define _POSIX_C_SOURCE 199506 >#endif ># 692 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 693 "/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 ># 701 "/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 ># 706 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 200112 >#define __ISO_C_VISIBLE 1999 >#elif _POSIX_C_SOURCE >= 199506 ># 709 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199506 >#define __ISO_C_VISIBLE 1990 >#elif _POSIX_C_SOURCE >= 199309 ># 712 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199309 >#define __ISO_C_VISIBLE 1990 >#elif _POSIX_C_SOURCE >= 199209 ># 715 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199209 >#define __ISO_C_VISIBLE 1990 >#elif _POSIX_C_SOURCE >= 199009 ># 718 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 199009 >#define __ISO_C_VISIBLE 1990 >#else ># 721 "/usr/include/sys/cdefs.h" 3 4 >#define __POSIX_VISIBLE 198808 >#define __ISO_C_VISIBLE 0 >#endif /* _POSIX_C_SOURCE */ ># 724 "/usr/include/sys/cdefs.h" 3 4 >#else ># 725 "/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. */ ># 743 "/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. */ ># 748 "/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. */ ># 753 "/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 ># 758 "/usr/include/sys/cdefs.h" 3 4 >#endif ># 759 "/usr/include/sys/cdefs.h" 3 4 > >#if defined(__mips) || defined(__powerpc64__) >#define __NO_TLS 1 >#endif ># 763 "/usr/include/sys/cdefs.h" 3 4 > >#endif /* !_SYS_CDEFS_H_ */ ># 765 "/usr/include/sys/cdefs.h" 3 4 ># 40 "/usr/include/stdio.h" 2 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: stable/10/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 ># 41 "/usr/include/stdio.h" 2 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: stable/10/sys/sys/_types.h 309258 2016-11-28 18:36:37Z jhb $ > */ > >#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: stable/10/sys/i386/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: stable/10/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 ># 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 struct { > long long __max_align1 __aligned(_Alignof(long long)); > long double __max_align2 __aligned(_Alignof(long double)); >} __max_align_t; > >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_ */ ># 121 "/usr/include/sys/_types.h" 3 4 ># 42 "/usr/include/stdio.h" 2 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) __printflike(2, 0); > >/* > * 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, ...) __printflike(2, 3); >#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 ># 23 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 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: stable/10/include/stdlib.h 313971 2017-02-19 21:10:34Z pfg $ > */ > >#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 || defined(__cplusplus) >#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. */ >__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 ># 24 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 2 >#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: stable/10/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 */ ># 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: stable/10/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: stable/10/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 ># 46 "/usr/include/string.h" 2 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: stable/10/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 ># 25 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include <math.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/math.h" 1 3 4 >/* > * ==================================================== > * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > * > * Developed at SunPro, a Sun Microsystems, Inc. business. > * Permission to use, copy, modify, and distribute this > * software is freely granted, provided that this notice > * is preserved. > * ==================================================== > */ > >/* > * from: @(#)fdlibm.h 5.1 93/09/24 > * $FreeBSD: stable/10/lib/msun/src/math.h 309510 2016-12-03 20:01:12Z trasz $ > */ > >#ifndef _MATH_H_ >#define _MATH_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 21 "/usr/include/math.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 22 "/usr/include/math.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: stable/10/sys/i386/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: stable/10/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 ># 23 "/usr/include/math.h" 2 3 4 > >/* > * ANSI/POSIX > */ >extern const union __infinity_un { > unsigned char __uc[8]; > double __ud; >} __infinity; > >extern const union __nan_un { > unsigned char __uc[sizeof(float)]; > float __uf; >} __nan; > >#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) >#define __MATH_BUILTIN_CONSTANTS >#endif ># 40 "/usr/include/math.h" 3 4 > >#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) >#define __MATH_BUILTIN_RELOPS >#endif ># 44 "/usr/include/math.h" 3 4 > >#ifdef __MATH_BUILTIN_CONSTANTS >#define HUGE_VAL __builtin_huge_val() >#else ># 48 "/usr/include/math.h" 3 4 >#define HUGE_VAL (__infinity.__ud) >#endif ># 50 "/usr/include/math.h" 3 4 > >#if __ISO_C_VISIBLE >= 1999 >#define FP_ILOGB0 (-__INT_MAX) >#define FP_ILOGBNAN __INT_MAX > >#ifdef __MATH_BUILTIN_CONSTANTS >#define HUGE_VALF __builtin_huge_valf() >#define HUGE_VALL __builtin_huge_vall() >#define INFINITY __builtin_inff() >#define NAN __builtin_nanf("") >#else ># 61 "/usr/include/math.h" 3 4 >#define HUGE_VALF (float)HUGE_VAL >#define HUGE_VALL (long double)HUGE_VAL >#define INFINITY HUGE_VALF >#define NAN (__nan.__uf) >#endif /* __MATH_BUILTIN_CONSTANTS */ ># 66 "/usr/include/math.h" 3 4 > >#define MATH_ERRNO 1 >#define MATH_ERREXCEPT 2 >#define math_errhandling MATH_ERREXCEPT > >#define FP_FAST_FMAF 1 >#ifdef __ia64__ >#define FP_FAST_FMA 1 >#define FP_FAST_FMAL 1 >#endif ># 76 "/usr/include/math.h" 3 4 > >/* Symbolic constants to classify floating point numbers. */ >#define FP_INFINITE 0x01 >#define FP_NAN 0x02 >#define FP_NORMAL 0x04 >#define FP_SUBNORMAL 0x08 >#define FP_ZERO 0x10 > >#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ > __has_extension(c_generic_selections) >#define __fp_type_select(x, f, d, ld) _Generic((x), \ > float: f(x), \ > double: d(x), \ > long double: ld(x), \ > volatile float: f(x), \ > volatile double: d(x), \ > volatile long double: ld(x), \ > volatile const float: f(x), \ > volatile const double: d(x), \ > volatile const long double: ld(x), \ > const float: f(x), \ > const double: d(x), \ > const long double: ld(x)) >#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) ># 100 "/usr/include/math.h" 3 4 >#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ > __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ > __builtin_choose_expr( \ > __builtin_types_compatible_p(__typeof(x), double), d(x), \ > __builtin_choose_expr( \ > __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) >#else ># 107 "/usr/include/math.h" 3 4 >#define __fp_type_select(x, f, d, ld) \ > ((sizeof(x) == sizeof(float)) ? f(x) \ > : (sizeof(x) == sizeof(double)) ? d(x) \ > : ld(x)) >#endif ># 112 "/usr/include/math.h" 3 4 > >#define fpclassify(x) \ > __fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyl) >#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel) >#define isinf(x) __fp_type_select(x, __isinff, __isinf, __isinfl) >#define isnan(x) \ > __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl) >#define isnormal(x) __fp_type_select(x, __isnormalf, __isnormal, __isnormall) > >#ifdef __MATH_BUILTIN_RELOPS >#define isgreater(x, y) __builtin_isgreater((x), (y)) >#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) >#define isless(x, y) __builtin_isless((x), (y)) >#define islessequal(x, y) __builtin_islessequal((x), (y)) >#define islessgreater(x, y) __builtin_islessgreater((x), (y)) >#define isunordered(x, y) __builtin_isunordered((x), (y)) >#else ># 129 "/usr/include/math.h" 3 4 >#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y)) >#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y)) >#define isless(x, y) (!isunordered((x), (y)) && (x) < (y)) >#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y)) >#define islessgreater(x, y) (!isunordered((x), (y)) && \ > ((x) > (y) || (y) > (x))) >#define isunordered(x, y) (isnan(x) || isnan(y)) >#endif /* __MATH_BUILTIN_RELOPS */ ># 137 "/usr/include/math.h" 3 4 > >#define signbit(x) __fp_type_select(x, __signbitf, __signbit, __signbitl) > >typedef __double_t double_t; >typedef __float_t float_t; >#endif /* __ISO_C_VISIBLE >= 1999 */ ># 143 "/usr/include/math.h" 3 4 > >/* > * XOPEN/SVID > */ >#if __BSD_VISIBLE || __XSI_VISIBLE >#define M_E 2.7182818284590452354 /* e */ >#define M_LOG2E 1.4426950408889634074 /* log 2e */ >#define M_LOG10E 0.43429448190325182765 /* log 10e */ >#define M_LN2 0.69314718055994530942 /* log e2 */ >#define M_LN10 2.30258509299404568402 /* log e10 */ >#define M_PI 3.14159265358979323846 /* pi */ >#define M_PI_2 1.57079632679489661923 /* pi/2 */ >#define M_PI_4 0.78539816339744830962 /* pi/4 */ >#define M_1_PI 0.31830988618379067154 /* 1/pi */ >#define M_2_PI 0.63661977236758134308 /* 2/pi */ >#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ >#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ >#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ > >#define MAXFLOAT ((float)3.40282346638528860e+38) >extern int signgam; >#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ ># 165 "/usr/include/math.h" 3 4 > >#if __BSD_VISIBLE >#if 0 >/* Old value from 4.4BSD-Lite math.h; this is probably better. */ >#define HUGE HUGE_VAL >#else ># 171 "/usr/include/math.h" 3 4 >#define HUGE MAXFLOAT >#endif ># 173 "/usr/include/math.h" 3 4 >#endif /* __BSD_VISIBLE */ ># 174 "/usr/include/math.h" 3 4 > >/* > * Most of these functions depend on the rounding mode and have the side > * effect of raising floating-point exceptions, so they are not declared > * as __pure2. In C99, FENV_ACCESS affects the purity of these functions. > */ >__BEGIN_DECLS >/* > * ANSI/POSIX > */ >int __fpclassifyd(double) __pure2; >int __fpclassifyf(float) __pure2; >int __fpclassifyl(long double) __pure2; >int __isfinitef(float) __pure2; >int __isfinite(double) __pure2; >int __isfinitel(long double) __pure2; >int __isinff(float) __pure2; >int __isinf(double) __pure2; >int __isinfl(long double) __pure2; >int __isnormalf(float) __pure2; >int __isnormal(double) __pure2; >int __isnormall(long double) __pure2; >int __signbit(double) __pure2; >int __signbitf(float) __pure2; >int __signbitl(long double) __pure2; > >static __inline int >__inline_isnan(__const double __x) >{ > > return (__x != __x); >} > >static __inline int >__inline_isnanf(__const float __x) >{ > > return (__x != __x); >} > >static __inline int >__inline_isnanl(__const long double __x) >{ > > return (__x != __x); >} > >/* > * Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and > * isinf() as functions taking double. C99, and the subsequent POSIX revisions > * (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating > * point type. If we are targeting SUSv2 and C99 or C11 (or C++11) then we > * expose the newer definition, assuming that the language spec takes > * precedence over the operating system interface spec. > */ >#if __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999 >#undef isinf >#undef isnan >int isinf(double); >int isnan(double); >#endif ># 235 "/usr/include/math.h" 3 4 > >double acos(double); >double asin(double); >double atan(double); >double atan2(double, double); >double cos(double); >double sin(double); >double tan(double); > >double cosh(double); >double sinh(double); >double tanh(double); > >double exp(double); >double frexp(double, int *); /* fundamentally !__pure2 */ >double ldexp(double, int); >double log(double); >double log10(double); >double modf(double, double *); /* fundamentally !__pure2 */ > >double pow(double, double); >double sqrt(double); > >double ceil(double); >double fabs(double) __pure2; >double floor(double); >double fmod(double, double); > >/* > * These functions are not in C90. > */ >#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE >double acosh(double); >double asinh(double); >double atanh(double); >double cbrt(double); >double erf(double); >double erfc(double); >double exp2(double); >double expm1(double); >double fma(double, double, double); >double hypot(double, double); >int ilogb(double) __pure2; >double lgamma(double); >long long llrint(double); >long long llround(double); >double log1p(double); >double log2(double); >double logb(double); >long lrint(double); >long lround(double); >double nan(const char *) __pure2; >double nextafter(double, double); >double remainder(double, double); >double remquo(double, double, int *); >double rint(double); >#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */ ># 292 "/usr/include/math.h" 3 4 > >#if __BSD_VISIBLE || __XSI_VISIBLE >double j0(double); >double j1(double); >double jn(int, double); >double y0(double); >double y1(double); >double yn(int, double); > >#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE >double gamma(double); >#endif ># 304 "/usr/include/math.h" 3 4 > >#if __XSI_VISIBLE <= 600 || __BSD_VISIBLE >double scalb(double, double); >#endif ># 308 "/usr/include/math.h" 3 4 >#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ ># 309 "/usr/include/math.h" 3 4 > >#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 >double copysign(double, double) __pure2; >double fdim(double, double); >double fmax(double, double) __pure2; >double fmin(double, double) __pure2; >double nearbyint(double); >double round(double); >double scalbln(double, long); >double scalbn(double, int); >double tgamma(double); >double trunc(double); >#endif ># 322 "/usr/include/math.h" 3 4 > >/* > * BSD math library entry points > */ >#if __BSD_VISIBLE >double drem(double, double); >int finite(double) __pure2; >int isnanf(float) __pure2; > >/* > * Reentrant version of gamma & lgamma; passes signgam back by reference > * as the second argument; user must allocate space for signgam. > */ >double gamma_r(double, int *); >double lgamma_r(double, int *); > >/* > * IEEE Test Vector > */ >double significand(double); >#endif /* __BSD_VISIBLE */ ># 343 "/usr/include/math.h" 3 4 > >/* float versions of ANSI/POSIX functions */ >#if __ISO_C_VISIBLE >= 1999 >float acosf(float); >float asinf(float); >float atanf(float); >float atan2f(float, float); >float cosf(float); >float sinf(float); >float tanf(float); > >float coshf(float); >float sinhf(float); >float tanhf(float); > >float exp2f(float); >float expf(float); >float expm1f(float); >float frexpf(float, int *); /* fundamentally !__pure2 */ >int ilogbf(float) __pure2; >float ldexpf(float, int); >float log10f(float); >float log1pf(float); >float log2f(float); >float logf(float); >float modff(float, float *); /* fundamentally !__pure2 */ > >float powf(float, float); >float sqrtf(float); > >float ceilf(float); >float fabsf(float) __pure2; >float floorf(float); >float fmodf(float, float); >float roundf(float); > >float erff(float); >float erfcf(float); >float hypotf(float, float); >float lgammaf(float); >float tgammaf(float); > >float acoshf(float); >float asinhf(float); >float atanhf(float); >float cbrtf(float); >float logbf(float); >float copysignf(float, float) __pure2; >long long llrintf(float); >long long llroundf(float); >long lrintf(float); >long lroundf(float); >float nanf(const char *) __pure2; >float nearbyintf(float); >float nextafterf(float, float); >float remainderf(float, float); >float remquof(float, float, int *); >float rintf(float); >float scalblnf(float, long); >float scalbnf(float, int); >float truncf(float); > >float fdimf(float, float); >float fmaf(float, float, float); >float fmaxf(float, float) __pure2; >float fminf(float, float) __pure2; >#endif ># 410 "/usr/include/math.h" 3 4 > >/* > * float versions of BSD math library entry points > */ >#if __BSD_VISIBLE >float dremf(float, float); >int finitef(float) __pure2; >float gammaf(float); >float j0f(float); >float j1f(float); >float jnf(int, float); >float scalbf(float, float); >float y0f(float); >float y1f(float); >float ynf(int, float); > >/* > * Float versions of reentrant version of gamma & lgamma; passes > * signgam back by reference as the second argument; user must > * allocate space for signgam. > */ >float gammaf_r(float, int *); >float lgammaf_r(float, int *); > >/* > * float version of IEEE Test Vector > */ >float significandf(float); >#endif /* __BSD_VISIBLE */ ># 439 "/usr/include/math.h" 3 4 > >/* > * long double versions of ISO/POSIX math functions > */ >#if __ISO_C_VISIBLE >= 1999 >long double acoshl(long double); >long double acosl(long double); >long double asinhl(long double); >long double asinl(long double); >long double atan2l(long double, long double); >long double atanhl(long double); >long double atanl(long double); >long double cbrtl(long double); >long double ceill(long double); >long double copysignl(long double, long double) __pure2; >long double coshl(long double); >long double cosl(long double); >long double erfcl(long double); >long double erfl(long double); >long double exp2l(long double); >long double expl(long double); >long double expm1l(long double); >long double fabsl(long double) __pure2; >long double fdiml(long double, long double); >long double floorl(long double); >long double fmal(long double, long double, long double); >long double fmaxl(long double, long double) __pure2; >long double fminl(long double, long double) __pure2; >long double fmodl(long double, long double); >long double frexpl(long double, int *); /* fundamentally !__pure2 */ >long double hypotl(long double, long double); >int ilogbl(long double) __pure2; >long double ldexpl(long double, int); >long double lgammal(long double); >long long llrintl(long double); >long long llroundl(long double); >long double log10l(long double); >long double log1pl(long double); >long double log2l(long double); >long double logbl(long double); >long double logl(long double); >long lrintl(long double); >long lroundl(long double); >long double modfl(long double, long double *); /* fundamentally !__pure2 */ >long double nanl(const char *) __pure2; >long double nearbyintl(long double); >long double nextafterl(long double, long double); >double nexttoward(double, long double); >float nexttowardf(float, long double); >long double nexttowardl(long double, long double); >long double powl(long double, long double); >long double remainderl(long double, long double); >long double remquol(long double, long double, int *); >long double rintl(long double); >long double roundl(long double); >long double scalblnl(long double, long); >long double scalbnl(long double, int); >long double sinhl(long double); >long double sinl(long double); >long double sqrtl(long double); >long double tanhl(long double); >long double tanl(long double); >long double tgammal(long double); >long double truncl(long double); >#endif /* __ISO_C_VISIBLE >= 1999 */ ># 504 "/usr/include/math.h" 3 4 > >#if __BSD_VISIBLE >long double lgammal_r(long double, int *); >#endif ># 508 "/usr/include/math.h" 3 4 > >__END_DECLS > >#endif /* !_MATH_H_ */ ># 512 "/usr/include/math.h" 3 4 ># 26 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include <slang.h> >#endif /* expanded by -frewrite-includes */ ># 1 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" 1 >#ifndef DAVIS_SLANG_H_ >#define DAVIS_SLANG_H_ >/* -*- mode: C; mode: fold; -*- */ >/* >Copyright (C) 2004-2017,2018 John E. Davis > >This file is part of the S-Lang Library. > >The S-Lang Library 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. > >The S-Lang Library 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 library; if not, write to the Free Software >Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, >USA. >*/ > >#define SLANG_VERSION 20302 >#define SLANG_VERSION_STRING "2.3.2" >/* #ifdef __DATE__ */ >/* # define SLANG_VERSION_STRING SLANG_VERSION_STRING0 " " __DATE__ */ >/* #else */ >/* # define SLANG_VERSION_STRING SLANG_VERSION_STRING0 */ >/* #endif */ >/*{{{ System Dependent Macros and Typedefs */ > >#if defined(__WATCOMC__) && defined(DOS) ># ifndef __MSDOS__ ># define __MSDOS__ ># endif ># 38 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># ifndef DOS386 ># define DOS386 ># endif ># 41 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># ifndef IBMPC_SYSTEM ># define IBMPC_SYSTEM ># endif ># 44 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif /* __watcomc__ */ ># 45 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(unix) || defined(__unix) ># ifndef __unix__ ># define __unix__ 1 ># endif ># 50 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 51 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(__APPLE__) ># ifndef __unix__ ># define __unix__ 1 /* cough */ ># endif ># 56 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 57 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if !defined(__GO32__) ># ifdef __unix__ ># define REAL_UNIX_SYSTEM ># endif ># 62 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 63 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >/* Set of the various defines for pc systems. This includes OS/2 */ >#ifdef __GO32__ ># ifndef __DJGPP__ ># define __DJGPP__ 1 ># endif ># 69 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># ifndef IBMPC_SYSTEM ># define IBMPC_SYSTEM ># endif ># 72 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 73 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifdef __BORLANDC__ ># ifndef IBMPC_SYSTEM ># define IBMPC_SYSTEM ># endif ># 78 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 79 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifdef __MSDOS__ ># ifndef IBMPC_SYSTEM ># define IBMPC_SYSTEM ># endif ># 84 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 85 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(OS2) || defined(__os2__) ># ifndef IBMPC_SYSTEM ># define IBMPC_SYSTEM ># endif ># 90 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># ifndef __os2__ ># define __os2__ ># endif ># 93 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 94 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(__NT__) || defined(__MINGW32__) /* || defined(__CYGWIN32__) */ ># ifndef IBMPC_SYSTEM ># define IBMPC_SYSTEM ># endif ># 99 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 100 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(WIN32) || defined(__WIN32__) ># ifndef IBMPC_SYSTEM ># define IBMPC_SYSTEM ># endif ># 105 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># ifndef __WIN32__ ># define __WIN32__ ># endif ># 108 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 109 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(IBMPC_SYSTEM) || defined(VMS) ># ifdef REAL_UNIX_SYSTEM ># undef REAL_UNIX_SYSTEM ># endif ># 114 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 115 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifdef __cplusplus >extern "C" { >#endif ># 119 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#if 0 >} >#endif ># 122 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if 0 /* expanded by -frewrite-includes */ >#include <stdio.h> >#endif /* expanded by -frewrite-includes */ ># 124 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#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: stable/10/sys/i386/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: stable/10/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 ># 125 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" 2 >#if defined(__STDC__) || defined(__BORLANDC__) || defined(__cplusplus) >#if 0 /* expanded by -frewrite-includes */ ># include <stddef.h> /* for offsetof */ >#endif /* expanded by -frewrite-includes */ ># 1 "/usr/include/stddef.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. > * > * @(#)stddef.h 8.1 (Berkeley) 6/2/93 > * > * $FreeBSD: stable/10/include/stddef.h 325090 2017-10-29 04:33:50Z cy $ > */ > >#ifndef _STDDEF_H_ >#define _STDDEF_H_ > >#if 0 /* expanded by -frewrite-includes */ >#include <sys/cdefs.h> >#endif /* expanded by -frewrite-includes */ ># 38 "/usr/include/stddef.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_null.h> >#endif /* expanded by -frewrite-includes */ ># 39 "/usr/include/stddef.h" 3 4 >#if 0 /* expanded by -frewrite-includes */ >#include <sys/_types.h> >#endif /* expanded by -frewrite-includes */ ># 40 "/usr/include/stddef.h" 3 4 > >typedef __ptrdiff_t ptrdiff_t; > >#if __BSD_VISIBLE >#ifndef _RUNE_T_DECLARED >typedef __rune_t rune_t; >#define _RUNE_T_DECLARED >#endif ># 48 "/usr/include/stddef.h" 3 4 >#endif ># 49 "/usr/include/stddef.h" 3 4 > >#ifndef _SIZE_T_DECLARED >typedef __size_t size_t; >#define _SIZE_T_DECLARED >#endif ># 54 "/usr/include/stddef.h" 3 4 > >#ifndef __cplusplus >#ifndef _WCHAR_T_DECLARED >typedef ___wchar_t wchar_t; >#define _WCHAR_T_DECLARED >#endif ># 60 "/usr/include/stddef.h" 3 4 >#endif ># 61 "/usr/include/stddef.h" 3 4 > >#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L >#ifndef __CLANG_MAX_ALIGN_T_DEFINED >typedef __max_align_t max_align_t; >#define __CLANG_MAX_ALIGN_T_DEFINED >#define _GCC_MAX_ALIGN_T >#endif ># 68 "/usr/include/stddef.h" 3 4 >#endif ># 69 "/usr/include/stddef.h" 3 4 > >#define offsetof(type, field) __offsetof(type, field) > >#endif /* _STDDEF_H_ */ ># 73 "/usr/include/stddef.h" 3 4 ># 127 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" 2 >#endif ># 128 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifdef SIZEOF_SHORT ># define SLANG_SIZEOF_SHORT SIZEOF_SHORT >#endif ># 132 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifdef SIZEOF_INT ># define SLANG_SIZEOF_INT SIZEOF_INT >#endif ># 135 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifdef SIZEOF_FLOAT ># define SLANG_SIZEOF_FLOAT SIZEOF_FLOAT >#endif ># 138 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifdef SIZEOF_DOUBLE ># define SLANG_SIZEOF_DOUBLE SIZEOF_DOUBLE >#endif ># 141 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if !defined(SIZEOF_SHORT) || !defined(SIZEOF_INT) || !defined(SIZEOF_LONG) || !defined(SIZEOF_FLOAT) || !defined(SIZEOF_DOUBLE) >#if 0 /* expanded by -frewrite-includes */ ># include <limits.h> >#endif /* expanded by -frewrite-includes */ ># 144 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if !defined(SIZEOF_SHORT) && defined(SHRT_MAX) ># if SHRT_MAX == 32767 ># define SLANG_SIZEOF_SHORT 2 ># else ># 148 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if SHRT_MAX == 2147483647L ># define SLANG_SIZEOF_SHORT 4 ># endif ># 151 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># endif ># 152 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># endif ># 153 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if !defined(SIZEOF_INT) && defined(INT_MAX) ># if INT_MAX == 32767 ># define SLANG_SIZEOF_INT 2 ># else ># 157 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if INT_MAX == 2147483647L ># define SLANG_SIZEOF_INT 4 ># endif ># 160 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># endif ># 161 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># endif ># 162 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if !defined(SIZEOF_LONG) && defined(LONG_MAX) ># if LONG_MAX == 32767 ># define SLANG_SIZEOF_LONG 2 ># else ># 166 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if LONG_MAX == 2147483647L ># define SLANG_SIZEOF_LONG 4 ># else ># 169 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SLANG_SIZEOF_LONG 8 ># endif ># 171 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># endif ># 172 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># endif ># 173 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 174 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifndef SLANG_SIZEOF_SHORT ># define SLANG_SIZEOF_SHORT 2 >#endif ># 178 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifndef SLANG_SIZEOF_INT ># define SLANG_SIZEOF_INT 4 >#endif ># 181 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifndef SLANG_SIZEOF_LONG ># define SLANG_SIZEOF_LONG 4 >#endif ># 184 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifndef SLANG_SIZEOF_FLOAT ># define SLANG_SIZEOF_FLOAT 4 >#endif ># 187 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifndef SLANG_SIZEOF_DOUBLE ># define SLANG_SIZEOF_DOUBLE 8 >#endif ># 190 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >/* ---------------------------- Generic Macros ----------------------------- */ > >/* __SC__ is defined for Symantec C++ > DOS386 is defined for -mx memory model, 32 bit DOS extender. */ > >#if defined(__SC__) && !defined(DOS386) >#if 0 /* expanded by -frewrite-includes */ ># include <dos.h> >#endif /* expanded by -frewrite-includes */ ># 198 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 199 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(__BORLANDC__) >#if 0 /* expanded by -frewrite-includes */ ># include <alloc.h> >#endif /* expanded by -frewrite-includes */ ># 202 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 203 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifdef __GNUC__ ># define SLATTRIBUTE_(x) __attribute__ (x) >#else ># 207 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SLATTRIBUTE_(x) >#endif ># 209 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#define SLATTRIBUTE_PRINTF(a,b) SLATTRIBUTE_((format(printf,a,b))) > >#if defined (__cplusplus) || defined(__STDC__) || defined(IBMPC_SYSTEM) >typedef void *VOID_STAR; >#define SLCONST const >#else ># 215 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >typedef unsigned char *VOID_STAR; >#define SLCONST >#endif ># 218 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifdef ENABLE_SLFUTURE_CONST ># define SLFUTURE_CONST SLCONST >#else ># 222 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SLFUTURE_CONST >#endif ># 224 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifdef ENABLE_SLFUTURE_VOID ># define SLFUTURE_VOID void >#else ># 228 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SLFUTURE_VOID char >#endif ># 230 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >typedef int (*FVOID_STAR)(void); > >#if defined(__MSDOS__) && defined(__BORLANDC__) ># define SLFREE(buf) farfree((void far *)(buf)) ># define SLMALLOC(x) farmalloc((unsigned long) (x)) ># define SLREALLOC(buf, n) farrealloc((void far *) (buf), (unsigned long) (n)) ># define SLCALLOC(n, m) farcalloc((unsigned long) (n), (unsigned long) (m)) >#else ># 239 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if defined(VMS) && !defined(__DECC) ># define SLFREE VAXC$FREE_OPT ># define SLMALLOC VAXC$MALLOC_OPT ># define SLREALLOC VAXC$REALLOC_OPT ># define SLCALLOC VAXC$CALLOC_OPT ># else ># 245 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SLFREE(x) free((char *)(x)) ># define SLMALLOC malloc ># define SLREALLOC realloc ># define SLCALLOC calloc ># endif ># 250 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 251 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if (defined(__WIN32__) || defined(__CYGWIN32__)) && defined(SLANG_DLL) && SLANG_DLL ># define SL_EXPORT __declspec(dllexport) ># define SL_IMPORT __declspec(dllimport) >#else ># 256 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SL_EXPORT ># define SL_IMPORT >#endif ># 259 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifdef SLANG_SOURCE_ ># define SL_EXTERN extern SL_EXPORT >#else ># 262 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SL_EXTERN extern SL_IMPORT >#endif ># 264 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN SLFUTURE_VOID *SLdebug_malloc (unsigned long); >SL_EXTERN SLFUTURE_VOID *SLdebug_calloc (unsigned long, unsigned long); >SL_EXTERN SLFUTURE_VOID *SLdebug_realloc (SLFUTURE_VOID *, unsigned long); >SL_EXTERN void SLdebug_free (SLFUTURE_VOID *); >SL_EXTERN void SLmalloc_dump_statistics (void); >SL_EXTERN char *SLstrcpy(register char *, register char *); >SL_EXTERN int SLstrcmp(register char *, register char *); >SL_EXTERN char *SLstrncpy(char *, register char *, register int); > >SL_EXTERN void SLmemset (char *, char, int); >SL_EXTERN char *SLmemchr (register char *, register char, register int); >SL_EXTERN char *SLmemcpy (char *, char *, int); >SL_EXTERN int SLmemcmp (char *, char *, int); > >/*}}}*/ > >typedef unsigned int SLstrlen_Type; /* Eventually this will become size_t */ >#define SLANG_STRLEN_TYPE SLANG_UINT_TYPE >typedef int SLindex_Type; >typedef unsigned int SLuindex_Type; >#define SLANG_ARRAY_INDEX_TYPE SLANG_INT_TYPE > >/* SLstrings */ >typedef char SLstr_Type; >SL_EXTERN int SLang_pop_strlen_type (SLstrlen_Type *); >SL_EXTERN int SLang_push_strlen_type (SLstrlen_Type); > >/* An SLstr_Type object must be treated as a constant and may only be freed > * by the SLang_free_slstring function and nothing else. > */ >SL_EXTERN SLstr_Type *SLang_create_nslstring (SLFUTURE_CONST char *, SLstrlen_Type); >SL_EXTERN SLstr_Type *SLang_create_slstring (SLFUTURE_CONST char *); >SL_EXTERN void SLang_free_slstring (SLCONST SLstr_Type *); /* handles NULL */ >SL_EXTERN int SLang_pop_slstring (SLstr_Type **); /* free with SLang_free_slstring */ >SL_EXTERN SLstr_Type *SLang_concat_slstrings (SLstr_Type *a, SLstr_Type *b); >typedef unsigned long SLstr_Hash_Type; >SL_EXTERN SLstr_Hash_Type SLcompute_string_hash (SLCONST SLstr_Type *); > > >/* SL_EXTERN void SLstring_dump_stats (void); // is not (yet?) defined by S-Lang library */ > >/*{{{ UTF-8 and Wide Char support */ > >#if SLANG_SIZEOF_INT == 4 >typedef unsigned int SLwchar_Type; ># define SLANG_WCHAR_TYPE SLANG_UINT_TYPE ># define SLang_push_wchar SLang_push_uint ># define SLang_pop_wchar SLang_pop_uint >#else ># 314 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >typedef unsigned long SLwchar_Type; ># define SLANG_WCHAR_TYPE SLANG_ULONG_TYPE ># define SLang_push_wchar SLang_push_ulong ># define SLang_pop_wchar SLang_pop_ulong >#endif ># 319 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >typedef unsigned char SLuchar_Type; > >/* Maximum multi-byte len for a unicode wchar */ >#define SLUTF8_MAX_MBLEN 6 > >/* If argument is 1, force UTF-8 mode on. If argument is 0, force mode off. > * If -1, determine mode from the locale. > * Returns 1 if enabled, 0 if not. > */ >SL_EXTERN int SLutf8_enable (int); >SL_EXTERN int SLutf8_is_utf8_mode (void); >SL_EXTERN int SLtt_utf8_enable (int); >SL_EXTERN int SLtt_is_utf8_mode (void); >SL_EXTERN int SLsmg_utf8_enable (int); >SL_EXTERN int SLsmg_is_utf8_mode (void); >SL_EXTERN int SLinterp_utf8_enable (int); >SL_EXTERN int SLinterp_is_utf8_mode (void); > >SL_EXTERN SLwchar_Type SLwchar_toupper (SLwchar_Type); >SL_EXTERN SLwchar_Type SLwchar_tolower (SLwchar_Type); > >SL_EXTERN int SLwchar_wcwidth (SLwchar_Type); >SL_EXTERN int SLwchar_isalnum (SLwchar_Type); >SL_EXTERN int SLwchar_isalpha (SLwchar_Type); >SL_EXTERN int SLwchar_isblank (SLwchar_Type); >SL_EXTERN int SLwchar_iscntrl (SLwchar_Type); >SL_EXTERN int SLwchar_isdigit (SLwchar_Type); >SL_EXTERN int SLwchar_isgraph (SLwchar_Type); >SL_EXTERN int SLwchar_islower (SLwchar_Type); >SL_EXTERN int SLwchar_isprint (SLwchar_Type); >SL_EXTERN int SLwchar_ispunct (SLwchar_Type); >SL_EXTERN int SLwchar_isspace (SLwchar_Type); >SL_EXTERN int SLwchar_isupper (SLwchar_Type); >SL_EXTERN int SLwchar_isxdigit (SLwchar_Type); > >#define SLWCWIDTH_SINGLE_WIDTH 0x0001 /* all double width characters given as single width */ >#define SLWCWIDTH_CJK_LEGACY 0x0002 /* Ambiguous characters given width of 2 */ >SL_EXTERN int SLwchar_set_wcwidth_flags (int flags); > >/* The skip_char functions also skip over malformed strings counting each byte > * in the malformed sequence. > */ >SL_EXTERN SLuchar_Type *SLutf8_skip_char (SLuchar_Type *u, SLuchar_Type *umax); >SL_EXTERN SLuchar_Type *SLutf8_bskip_char (SLuchar_Type *umin, SLuchar_Type *u); >SL_EXTERN SLuchar_Type *SLutf8_skip_chars (SLuchar_Type *u, SLuchar_Type *umax, > SLstrlen_Type num, SLstrlen_Type *dnum, > int ignore_combining ); >SL_EXTERN SLuchar_Type *SLutf8_bskip_chars (SLuchar_Type *umin, SLuchar_Type *u, > SLstrlen_Type num, SLstrlen_Type *dnum, > int ignore_combining); > >/* The SLutf8_strup/lo functions return slstrings -- free with SLang_free_slstring */ >SL_EXTERN SLuchar_Type *SLutf8_strup (SLuchar_Type *u, SLuchar_Type *umax); >SL_EXTERN SLuchar_Type *SLutf8_strlo (SLuchar_Type *u, SLuchar_Type *umax); > >SL_EXTERN SLstr_Type *SLutf8_subst_wchar (SLuchar_Type *u, SLuchar_Type *umax, > SLwchar_Type wch, SLstrlen_Type pos, > int ignore_combining); > >SL_EXTERN SLstrlen_Type SLutf8_strlen (SLuchar_Type *s, int ignore_combining); >SL_EXTERN SLuchar_Type *SLutf8_decode (SLuchar_Type *u, SLuchar_Type *umax, > SLwchar_Type *w, SLstrlen_Type *nconsumedp); >SL_EXTERN SLuchar_Type *SLutf8_encode (SLwchar_Type w, SLuchar_Type *u, SLstrlen_Type ulen); > >SL_EXTERN int SLutf8_compare (SLuchar_Type *a, SLuchar_Type *amax, > SLuchar_Type *b, SLuchar_Type *bmax, > SLstrlen_Type nchars, int case_sensitive); > >/* In these functions, buf is assumed to contain at least SLUTF8_MAX_MBLEN+1 > * bytes > */ >SL_EXTERN SLuchar_Type *SLutf8_extract_utf8_char (SLuchar_Type *u, SLuchar_Type *umax, SLuchar_Type *buf); >SL_EXTERN SLuchar_Type *SLutf8_encode_null_terminate (SLwchar_Type w, SLuchar_Type *buf); > >typedef struct SLwchar_Lut_Type SLwchar_Lut_Type; >SL_EXTERN SLwchar_Lut_Type *SLwchar_create_lut (unsigned int num_entries); >SL_EXTERN int SLwchar_add_range_to_lut (SLwchar_Lut_Type *r, SLwchar_Type a, SLwchar_Type b); >SL_EXTERN SLuchar_Type *SLwchar_skip_range (SLwchar_Lut_Type *r, SLuchar_Type *p, > SLuchar_Type *pmax, int ignore_combining, > int invert); >SL_EXTERN SLwchar_Lut_Type *SLwchar_strtolut (SLuchar_Type *u, > int allow_range, int allow_charclass); >SL_EXTERN void SLwchar_free_lut (SLwchar_Lut_Type *r); >SL_EXTERN SLuchar_Type *SLwchar_bskip_range (SLwchar_Lut_Type *r, SLuchar_Type *pmin, > SLuchar_Type *p, > int ignore_combining, > int invert); >SL_EXTERN int SLwchar_in_lut (SLwchar_Lut_Type *r, SLwchar_Type wch); > >typedef struct SLwchar_Map_Type SLwchar_Map_Type; >SL_EXTERN void SLwchar_free_char_map (SLwchar_Map_Type *map); >SL_EXTERN SLwchar_Map_Type *SLwchar_allocate_char_map (SLuchar_Type *from, SLuchar_Type *to); >SL_EXTERN int SLwchar_apply_char_map (SLwchar_Map_Type *map, SLwchar_Type *input, SLwchar_Type *output, unsigned int num); > >/* This function returns a malloced string */ >SLuchar_Type *SLuchar_apply_char_map (SLwchar_Map_Type *map, SLuchar_Type *str); > >/*}}}*/ > >/*{{{ Interpreter Typedefs */ > >typedef unsigned int SLtype; >#define SLANG_SLTYPE_INT_TYPE SLANG_UINT_TYPE > >typedef struct _pSLang_Name_Type >{ > SLFUTURE_CONST char *name; > struct _pSLang_Name_Type *next; > unsigned char name_type; > /* These values here map directly to byte codes. See _slang.h. > */ >#define SLANG_LVARIABLE 0x01 >#define SLANG_GVARIABLE 0x02 >#define SLANG_IVARIABLE 0x03 /* intrinsic variables */ > /* Note!!! For Macro MAKE_VARIABLE below to work, SLANG_IVARIABLE Must > be 1 less than SLANG_RVARIABLE!!! */ >#define SLANG_RVARIABLE 0x04 /* read only variable */ >#define SLANG_INTRINSIC 0x05 >#define SLANG_FUNCTION 0x06 >#define SLANG_MATH_UNARY 0x07 >#define SLANG_APP_UNARY 0x08 >#define SLANG_ARITH_UNARY 0x09 /* private */ >#define SLANG_ARITH_BINARY 0x0A >#define SLANG_ICONSTANT 0x0B >#define SLANG_DCONSTANT 0x0C >#define SLANG_FCONSTANT 0x0D >#define SLANG_LLCONSTANT 0x0E >#define SLANG_PVARIABLE 0x0F /* private */ >#define SLANG_PFUNCTION 0x10 /* private */ >#define SLANG_HCONSTANT 0x11 >#define SLANG_LCONSTANT 0x12 > /* Rest of fields depend on name type */ >} >SLang_Name_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > struct _pSLang_Name_Type *next; /* this is for the hash table */ > char name_type; > > FVOID_STAR i_fun; /* address of object */ > > /* Do not change this without modifying slang.c:execute_intrinsic_fun */ >#define SLANG_MAX_INTRIN_ARGS 7 > SLtype arg_types [SLANG_MAX_INTRIN_ARGS]; > unsigned char num_args; > SLtype return_type; >} >SLang_Intrin_Fun_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > > VOID_STAR addr; > SLtype type; >} >SLang_Intrin_Var_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > > int unary_op; >} >SLang_App_Unary_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > > int unary_op; >} >SLang_Math_Unary_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > > SLtype data_type; > short value; >} >SLang_HConstant_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > > SLtype data_type; > int value; >} >SLang_IConstant_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > > SLtype data_type; > long value; >} >SLang_LConstant_Type; > >#ifdef HAVE_LONG_LONG >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > > long long ll; >} >SLang_LLConstant_Type; >#endif ># 545 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > double d; >} >SLang_DConstant_Type; > >typedef struct >{ > SLFUTURE_CONST char *name; > SLang_Name_Type *next; > char name_type; > float f; >} >SLang_FConstant_Type; > >typedef struct >{ > SLFUTURE_CONST char *field_name; /* gets replaced by slstring at run-time */ > unsigned int offset; > SLtype type; > unsigned char read_only; >} >SLang_IStruct_Field_Type; > >typedef SLCONST struct _pSLang_CStruct_Field_Type /* a g++ bug?? yuk*/ >{ > SLFUTURE_CONST char *field_name; > unsigned int offset; > SLtype type; > unsigned char read_only; >} >SLang_CStruct_Field_Type; > >SL_EXTERN int SLadd_intrin_fun_table (SLang_Intrin_Fun_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLadd_intrin_var_table (SLang_Intrin_Var_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLadd_app_unary_table (SLang_App_Unary_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLadd_math_unary_table (SLang_Math_Unary_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLadd_iconstant_table (SLang_IConstant_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLadd_lconstant_table (SLang_LConstant_Type *, SLFUTURE_CONST char *pp); >SL_EXTERN int SLadd_dconstant_table (SLang_DConstant_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLadd_fconstant_table (SLang_FConstant_Type *, SLFUTURE_CONST char *); >#ifdef HAVE_LONG_LONG >SL_EXTERN int SLadd_llconstant_table (SLang_LLConstant_Type *, SLFUTURE_CONST char *); >#endif ># 593 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >SL_EXTERN int SLadd_istruct_table (SLang_IStruct_Field_Type *, VOID_STAR, SLFUTURE_CONST char *); > >typedef struct _pSLang_NameSpace_Type SLang_NameSpace_Type; > >SL_EXTERN int SLns_add_intrin_fun_table (SLang_NameSpace_Type *, SLang_Intrin_Fun_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLns_add_intrin_var_table (SLang_NameSpace_Type *, SLang_Intrin_Var_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLns_add_app_unary_table (SLang_NameSpace_Type *, SLang_App_Unary_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLns_add_math_unary_table (SLang_NameSpace_Type *, SLang_Math_Unary_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLns_add_hconstant_table (SLang_NameSpace_Type *, SLang_HConstant_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLns_add_iconstant_table (SLang_NameSpace_Type *, SLang_IConstant_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLns_add_lconstant_table (SLang_NameSpace_Type *, SLang_LConstant_Type *, SLFUTURE_CONST char *); >/* SL_EXTERN int SLns_add_fconstant_table (SLang_NameSpace_Type *, SLang_FConstant_Type *, SLFUTURE_CONST char *); // is not (yet?) defined by S-Lang library */ >SL_EXTERN int SLns_add_dconstant_table (SLang_NameSpace_Type *, SLang_DConstant_Type *, SLFUTURE_CONST char *); >#ifdef HAVE_LONG_LONG >/* SL_EXTERN int SLns_add_llconstant_table (SLang_NameSpace_Type *, SLang_LLConstant_Type *, SLFUTURE_CONST char *); // is not (yet?) defined by S-Lang library */ >#endif ># 609 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >SL_EXTERN int SLns_add_istruct_table (SLang_NameSpace_Type *, SLang_IStruct_Field_Type *, VOID_STAR, SLFUTURE_CONST char *); > >SL_EXTERN int SLns_add_hconstant (SLang_NameSpace_Type *, SLFUTURE_CONST char *, SLtype, short); >SL_EXTERN int SLns_add_iconstant (SLang_NameSpace_Type *, SLFUTURE_CONST char *, SLtype, int); >SL_EXTERN int SLns_add_lconstant (SLang_NameSpace_Type *, SLFUTURE_CONST char *, SLtype, long); >SL_EXTERN int SLns_add_fconstant (SLang_NameSpace_Type *, SLFUTURE_CONST char *, float); >SL_EXTERN int SLns_add_dconstant (SLang_NameSpace_Type *, SLFUTURE_CONST char *, double); >#ifdef HAVE_LONG_LONG >SL_EXTERN int SLns_add_llconstant (SLang_NameSpace_Type *, SLFUTURE_CONST char *, long long); >#endif ># 619 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >SL_EXTERN SLang_NameSpace_Type *SLns_create_namespace (SLFUTURE_CONST char *); >SL_EXTERN void SLns_delete_namespace (SLang_NameSpace_Type *); > >SL_EXTERN int SLns_load_file (SLFUTURE_CONST char *, SLFUTURE_CONST char *); >SL_EXTERN int SLns_load_string (SLFUTURE_CONST char *, SLFUTURE_CONST char *); >SL_EXTERN int (*SLns_Load_File_Hook) (SLFUTURE_CONST char *, SLFUTURE_CONST char *); > >#define SLANG_LOAD_FILE_VERBOSE 0x1 >#define SLANG_LOAD_MODULE_VERBOSE 0x2 >SL_EXTERN int SLang_load_file_verbose (int); >/* Bitmapped value that controls loading messages */ > >typedef struct SLang_Load_Type >{ > int type; > > VOID_STAR client_data; > /* Pointer to data that client needs for loading */ > > int auto_declare_globals; > /* if non-zero, undefined global variables are declared as static */ > > char *(*read)(struct SLang_Load_Type *); > /* function to call to read next line from obj. */ > > unsigned int line_num; > /* Number of lines read, used for error reporting */ > > int parse_level; > /* 0 if at top level of parsing */ > > SLFUTURE_CONST char *name; > /* Name of this object, e.g., filename. This name should be unique because > * it alone determines the name space for static objects associated with > * the compilable unit. > */ > > SLFUTURE_CONST char *namespace_name; > unsigned long reserved[3]; > /* For future expansion */ >} SLang_Load_Type; > >SL_EXTERN SLang_Load_Type *SLallocate_load_type (SLFUTURE_CONST char *); >SL_EXTERN void SLdeallocate_load_type (SLang_Load_Type *); >SL_EXTERN SLang_Load_Type *SLns_allocate_load_type (SLFUTURE_CONST char *, SLFUTURE_CONST char *); > >/* Returns SLang_Error upon failure */ >SL_EXTERN int SLang_load_object (SLang_Load_Type *); >SL_EXTERN int (*SLang_Load_File_Hook)(SLFUTURE_CONST char *); >SL_EXTERN int (*SLang_Auto_Declare_Var_Hook) (SLFUTURE_CONST char *); > >SL_EXTERN int SLang_generate_debug_info (int); > >#if defined(ultrix) && !defined(__GNUC__) ># ifndef NO_PROTOTYPES ># define NO_PROTOTYPES ># endif ># 676 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 677 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifndef NO_PROTOTYPES ># define _PROTO(x) x >#else ># 681 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define _PROTO(x) () >#endif ># 683 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN int SLang_pop_array_index (SLindex_Type *); >SL_EXTERN int SLang_push_array_index (SLindex_Type); > >typedef struct _pSLang_Struct_Type SLang_Struct_Type; >SL_EXTERN void SLang_free_struct (SLang_Struct_Type *); >SL_EXTERN int SLang_push_struct (SLang_Struct_Type *); >SL_EXTERN int SLang_pop_struct (SLang_Struct_Type **); > >SL_EXTERN SLang_Struct_Type *SLang_create_struct (SLFUTURE_CONST char **field_names, unsigned int nfields); >/* Push the specified field value onto the stack */ >SL_EXTERN int SLang_push_struct_field (SLang_Struct_Type *s, char *name); >/* Pop the value from the stack into the specified field */ >SL_EXTERN int SLang_pop_struct_field (SLang_Struct_Type *s, char *name); >/* Set the first n fields of the struct from the stack. If n < 0, pop all fields. */ >SL_EXTERN int SLang_pop_struct_fields (SLang_Struct_Type *s, int n); > > >typedef struct _pSLang_Assoc_Array_Type SLang_Assoc_Array_Type; > >SL_EXTERN SLang_Assoc_Array_Type *SLang_create_assoc (SLtype type, int has_default); >/* If has_default is non-zero, take the default value from the stack */ >SL_EXTERN void SLang_free_assoc (SLang_Assoc_Array_Type *); >SL_EXTERN int SLang_push_assoc (SLang_Assoc_Array_Type *, int free_flag); >SL_EXTERN int SLang_pop_assoc (SLang_Assoc_Array_Type **); >SL_EXTERN int SLang_assoc_get (SLang_Assoc_Array_Type *, SLstr_Type *, SLtype *); >/* SLang_assoc_get leaves the object on the stack */ >SL_EXTERN int SLang_assoc_put (SLang_Assoc_Array_Type *, SLstr_Type *); >/* SLang_assoc_put takes the object from the stack */ > >SL_EXTERN int SLang_assoc_key_exists (SLang_Assoc_Array_Type *, SLstr_Type *); > >typedef struct _pSLang_List_Type SLang_List_Type; >SL_EXTERN SLang_List_Type *SLang_create_list (int); >SL_EXTERN int SLang_list_append (SLang_List_Type *, int); >SL_EXTERN int SLang_list_insert (SLang_List_Type *, int); >SL_EXTERN int SLang_push_list (SLang_List_Type *, int free_list); >SL_EXTERN int SLang_pop_list (SLang_List_Type **); >SL_EXTERN void SLang_free_list (SLang_List_Type *); > >typedef struct _pSLang_Foreach_Context_Type SLang_Foreach_Context_Type; > >typedef struct _pSLang_Class_Type SLang_Class_Type; > >/* These are the low-level functions for building push/pop methods. They > * know nothing about memory management. For SLANG_CLASS_TYPE_MMT, use the > * MMT push/pop functions instead. > */ >SL_EXTERN int SLclass_push_double_obj (SLtype, double); >SL_EXTERN int SLclass_push_float_obj (SLtype, float); >SL_EXTERN int SLclass_push_long_obj (SLtype, long); >SL_EXTERN int SLclass_push_int_obj (SLtype, int); >SL_EXTERN int SLclass_push_short_obj (SLtype, short); >SL_EXTERN int SLclass_push_char_obj (SLtype, char); >SL_EXTERN int SLclass_push_ptr_obj (SLtype, VOID_STAR); >SL_EXTERN int SLclass_pop_double_obj (SLtype, double *); >SL_EXTERN int SLclass_pop_float_obj (SLtype, float *); >SL_EXTERN int SLclass_pop_long_obj (SLtype, long *); >SL_EXTERN int SLclass_pop_int_obj (SLtype, int *); >SL_EXTERN int SLclass_pop_short_obj (SLtype, short *); >SL_EXTERN int SLclass_pop_char_obj (SLtype, char *); >SL_EXTERN int SLclass_pop_ptr_obj (SLtype, VOID_STAR *); > >#ifdef HAVE_LONG_LONG >SL_EXTERN int SLang_pop_long_long (long long *); >SL_EXTERN int SLang_push_long_long (long long); >SL_EXTERN int SLang_pop_ulong_long (unsigned long long *); >SL_EXTERN int SLang_push_ulong_long (unsigned long long); >/* SL_EXTERN int SLclass_pop_llong_obj (SLtype, long long *); // is not (yet?) defined by S-Lang library */ >SL_EXTERN int SLclass_push_llong_obj (SLtype, long long); >#endif ># 754 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN SLang_Class_Type *SLclass_allocate_class (SLFUTURE_CONST char *); >SL_EXTERN int SLclass_get_class_id (SLang_Class_Type *cl); >SL_EXTERN int SLclass_create_synonym (SLFUTURE_CONST char *, SLtype); >SL_EXTERN int SLclass_is_class_defined (SLtype); >SL_EXTERN int SLclass_dup_object (SLtype type, VOID_STAR from, VOID_STAR to); > >typedef int SLclass_Type; >#define SLANG_CLASS_TYPE_MMT 0 >#define SLANG_CLASS_TYPE_SCALAR 1 >#define SLANG_CLASS_TYPE_VECTOR 2 >#define SLANG_CLASS_TYPE_PTR 3 >SL_EXTERN int SLclass_register_class (SLang_Class_Type *, SLtype, unsigned int, SLclass_Type); > >SL_EXTERN int SLclass_set_string_function (SLang_Class_Type *, char *(*)(SLtype, VOID_STAR)); >SL_EXTERN int SLclass_set_destroy_function (SLang_Class_Type *, void (*)(SLtype, VOID_STAR)); >SL_EXTERN int SLclass_set_push_function (SLang_Class_Type *, int (*)(SLtype, VOID_STAR)); >SL_EXTERN int SLclass_set_apush_function (SLang_Class_Type *, int (*)(SLtype, VOID_STAR)); >SL_EXTERN int SLclass_set_pop_function (SLang_Class_Type *, int (*)(SLtype, VOID_STAR)); > >SL_EXTERN int SLclass_set_aget_function (SLang_Class_Type *, int (*)(SLtype, unsigned int)); >SL_EXTERN int SLclass_set_aput_function (SLang_Class_Type *, int (*)(SLtype, unsigned int)); >SL_EXTERN int SLclass_set_anew_function (SLang_Class_Type *, int (*)(SLtype, unsigned int)); > >SL_EXTERN int SLclass_set_sget_function (SLang_Class_Type *, int (*)(SLtype, SLFUTURE_CONST char *)); >SL_EXTERN int SLclass_set_sput_function (SLang_Class_Type *, int (*)(SLtype, SLFUTURE_CONST char *)); > >SL_EXTERN int SLclass_set_acopy_function (SLang_Class_Type *, int (*)(SLtype, VOID_STAR, VOID_STAR)); >SL_EXTERN int SLclass_set_deref_function (SLang_Class_Type *, int (*)(SLtype, VOID_STAR)); >SL_EXTERN int SLclass_set_eqs_function (SLang_Class_Type *, int (*)(SLtype, VOID_STAR, SLtype, VOID_STAR)); > >SL_EXTERN int SLclass_set_length_function (SLang_Class_Type *, int(*)(SLtype, VOID_STAR, SLuindex_Type *)); > >SL_EXTERN int SLclass_set_is_container (SLang_Class_Type *, int); >SL_EXTERN int SLclass_set_foreach_functions ( > SLang_Class_Type *, > SLang_Foreach_Context_Type *(*)(SLtype, unsigned int), /* open method */ > int (*)(SLtype, SLang_Foreach_Context_Type *), /* foreach method */ > void (*)(SLtype, SLang_Foreach_Context_Type *));/* close method */ > >/* When an array is created, this callback function is called to initialize the data > * at the specified address. > */ >SL_EXTERN int SLclass_set_aelem_init_function (SLang_Class_Type *cl, int (*f)(SLtype, VOID_STAR)); > >/* Typecast object on the stack to type p1. p2 and p3 should be set to 1 */ >SL_EXTERN int SLclass_typecast (SLtype, int, int); > >#define SLMATH_SIN 1 >#define SLMATH_COS 2 >#define SLMATH_TAN 3 >#define SLMATH_ATAN 4 >#define SLMATH_ASIN 5 >#define SLMATH_ACOS 6 >#define SLMATH_EXP 7 >#define SLMATH_LOG 8 >#define SLMATH_SQRT 9 >#define SLMATH_LOG10 10 >#define SLMATH_REAL 11 >#define SLMATH_IMAG 12 >#define SLMATH_SINH 13 >#define SLMATH_COSH 14 >#define SLMATH_TANH 15 >#define SLMATH_ATANH 16 >#define SLMATH_ASINH 17 >#define SLMATH_ACOSH 18 >#define SLMATH_TODOUBLE 19 >#define SLMATH_CONJ 20 >#define SLMATH_ISINF 21 >#define SLMATH_ISNAN 22 >#define SLMATH_FLOOR 23 >#define SLMATH_CEIL 24 >#define SLMATH_ROUND 25 >#define SLMATH_EXPM1 26 >#define SLMATH_LOG1P 27 > >SL_EXTERN int SLclass_add_unary_op (SLtype, > int (*) (int, > SLtype, VOID_STAR, SLuindex_Type, > VOID_STAR), > int (*) (int, SLtype, SLtype *)); > >SL_EXTERN int >SLclass_add_app_unary_op (SLtype, > int (*) (int, > SLtype, VOID_STAR, SLuindex_Type, > VOID_STAR), > int (*) (int, SLtype, SLtype *)); > >SL_EXTERN int >SLclass_add_binary_op (SLtype, SLtype, > int (*) (int, > SLtype, VOID_STAR, SLuindex_Type, > SLtype, VOID_STAR, SLuindex_Type, > VOID_STAR), > int (*) (int, SLtype, SLtype, SLtype *)); > >SL_EXTERN int >SLclass_add_math_op (SLtype, > int (*)(int, > SLtype, VOID_STAR, SLuindex_Type, > VOID_STAR), > int (*)(int, SLtype, SLtype *)); > >SL_EXTERN int >SLclass_add_typecast (SLtype /* from */, SLtype /* to */, > int (*)_PROTO((SLtype, VOID_STAR, SLuindex_Type, > SLtype, VOID_STAR)), > int /* allow implicit typecasts */ > ); > >SL_EXTERN SLFUTURE_CONST char *SLclass_get_datatype_name (SLtype); > >SL_EXTERN double SLcomplex_abs (double *); >SL_EXTERN double *SLcomplex_times (double *, double *, double *); >SL_EXTERN double *SLcomplex_divide (double *, double *, double *); >SL_EXTERN double *SLcomplex_sin (double *, double *); >SL_EXTERN double *SLcomplex_cos (double *, double *); >SL_EXTERN double *SLcomplex_tan (double *, double *); >SL_EXTERN double *SLcomplex_asin (double *, double *); >SL_EXTERN double *SLcomplex_acos (double *, double *); >SL_EXTERN double *SLcomplex_atan (double *, double *); >SL_EXTERN double *SLcomplex_exp (double *, double *); >SL_EXTERN double *SLcomplex_log (double *, double *); >SL_EXTERN double *SLcomplex_log10 (double *, double *); >SL_EXTERN double *SLcomplex_sqrt (double *, double *); >SL_EXTERN double *SLcomplex_sinh (double *, double *); >SL_EXTERN double *SLcomplex_cosh (double *, double *); >SL_EXTERN double *SLcomplex_tanh (double *, double *); >SL_EXTERN double *SLcomplex_pow (double *, double *, double *); >SL_EXTERN double SLmath_hypot (double x, double y); > >/* Not implemented yet */ >SL_EXTERN double *SLcomplex_asinh (double *, double *); >SL_EXTERN double *SLcomplex_acosh (double *, double *); >SL_EXTERN double *SLcomplex_atanh (double *, double *); > >#ifdef SLANG_SOURCE_ >typedef struct _pSLang_MMT_Type SLang_MMT_Type; >#else ># 894 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >typedef int SLang_MMT_Type; >#endif ># 896 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN void SLang_free_mmt (SLang_MMT_Type *); >SL_EXTERN VOID_STAR SLang_object_from_mmt (SLang_MMT_Type *); >SL_EXTERN SLang_MMT_Type *SLang_create_mmt (SLtype, VOID_STAR); >SL_EXTERN int SLang_push_mmt (SLang_MMT_Type *); >SL_EXTERN SLang_MMT_Type *SLang_pop_mmt (SLtype); >SL_EXTERN void SLang_inc_mmt (SLang_MMT_Type *); > >/* Maximum number of dimensions of an array. */ >#define SLARRAY_MAX_DIMS 7 >typedef struct _pSLang_Array_Type >{ > SLtype data_type; > unsigned int sizeof_type; > VOID_STAR data; > SLuindex_Type num_elements; > unsigned int num_dims; > SLindex_Type dims [SLARRAY_MAX_DIMS]; > VOID_STAR (*index_fun)_PROTO((struct _pSLang_Array_Type *, SLindex_Type *)); > /* This function is designed to allow a type to store an array in > * any manner it chooses. This function returns the address of the data > * value at the specified index location. > */ > unsigned int flags; >#define SLARR_DATA_VALUE_IS_READ_ONLY 0x0001 >#define SLARR_DATA_VALUE_IS_POINTER 0x0002 >#define SLARR_DATA_VALUE_IS_RANGE 0x0004 >#define SLARR_DATA_VALUE_IS_INTRINSIC 0x0008 >#define SLARR_DERIVED_FROM_SCALAR 0x0100 > SLang_Class_Type *cl; > unsigned int num_refs; > void (*free_fun)_PROTO((struct _pSLang_Array_Type *)); > VOID_STAR client_data; >} >SLang_Array_Type; > >SL_EXTERN int _pSLarray_convert_to_array (VOID_STAR cd, > int (*get_type)(VOID_STAR, SLuindex_Type, SLtype *), > int (*push)(VOID_STAR, SLuindex_Type), > SLuindex_Type num_objects, SLtype type); > >SL_EXTERN int SLang_pop_array_of_type (SLang_Array_Type **atp, SLtype type); >SL_EXTERN int SLang_pop_array (SLang_Array_Type **atp, int convert_scalar); >SL_EXTERN int SLang_push_array (SLang_Array_Type *at, int do_free); >SL_EXTERN void SLang_free_array (SLang_Array_Type *at); >SL_EXTERN SLang_Array_Type *SLang_create_array (SLtype, int, VOID_STAR, SLindex_Type *, unsigned int); >SL_EXTERN SLang_Array_Type *SLang_create_array1 (SLtype, int, VOID_STAR, SLindex_Type *, unsigned int, int); >SL_EXTERN SLang_Array_Type *SLang_duplicate_array (SLang_Array_Type *); >SL_EXTERN int SLang_get_array_element (SLang_Array_Type *, SLindex_Type *, VOID_STAR); >SL_EXTERN int SLang_set_array_element (SLang_Array_Type *, SLindex_Type *, VOID_STAR); > >typedef int SLarray_Contract_Fun_Type (VOID_STAR xp, unsigned int increment, unsigned int num, VOID_STAR yp); >typedef struct >{ > SLtype from_type; /* if array is this type */ > SLtype typecast_to_type; /* typecast it to this */ > SLtype result_type; /* to produce this */ > SLarray_Contract_Fun_Type *f; /* via this function */ >} >SLarray_Contract_Type; >SL_EXTERN int SLarray_contract_array (SLCONST SLarray_Contract_Type *); > >typedef int SLarray_Map_Fun_Type (SLtype xtype, VOID_STAR xp, > unsigned int increment, unsigned int num, > SLtype ytype, VOID_STAR yp, VOID_STAR clientdata); >typedef struct >{ > SLtype from_type; /* if array is this type */ > SLtype typecast_to_type; /* typecast it to this */ > SLtype result_type; /* to produce this */ > SLarray_Map_Fun_Type *f; /* via this function */ >} >SLarray_Map_Type; > >SL_EXTERN int SLarray_map_array_1 (SLCONST SLarray_Map_Type *, > int *use_this_dim, > VOID_STAR clientdata); >SL_EXTERN int SLarray_map_array (SLCONST SLarray_Map_Type *); > >/*}}}*/ > >/*{{{ Interpreter Function Prototypes */ > >SL_EXTERN int SLerr_throw (int err, SLFUTURE_CONST char *msg, SLtype obj_type, VOID_STAR objptr); >SL_EXTERN void SLang_verror (int, SLFUTURE_CONST char *, ...) SLATTRIBUTE_PRINTF(2,3); >SL_EXTERN void SLang_verror_va (int errcode, SLFUTURE_CONST char *fmt, va_list va); >SL_EXTERN int SLang_get_error (void); >SL_EXTERN int SLang_set_error (int); >SL_EXTERN SLFUTURE_CONST char *SLerr_strerror (int errcode); >SL_EXTERN int SLerr_new_exception (int baseclass, SLFUTURE_CONST char *name, SLFUTURE_CONST char *descript); >SL_EXTERN int SLerr_exception_eqs (int, int); > >SL_EXTERN int SL_Any_Error; >SL_EXTERN int SL_OS_Error; >SL_EXTERN int SL_Malloc_Error; >SL_EXTERN int SL_IO_Error; >SL_EXTERN int SL_Write_Error; >SL_EXTERN int SL_Read_Error; >SL_EXTERN int SL_Open_Error; >SL_EXTERN int SL_RunTime_Error; >SL_EXTERN int SL_InvalidParm_Error; >SL_EXTERN int SL_TypeMismatch_Error; >SL_EXTERN int SL_UserBreak_Error; >SL_EXTERN int SL_Stack_Error; >SL_EXTERN int SL_StackOverflow_Error; >SL_EXTERN int SL_StackUnderflow_Error; >SL_EXTERN int SL_ReadOnly_Error; >SL_EXTERN int SL_VariableUninitialized_Error; >SL_EXTERN int SL_NumArgs_Error; >SL_EXTERN int SL_Index_Error; >SL_EXTERN int SL_Parse_Error; >SL_EXTERN int SL_Syntax_Error; >SL_EXTERN int SL_DuplicateDefinition_Error; >SL_EXTERN int SL_UndefinedName_Error; >SL_EXTERN int SL_Usage_Error; >SL_EXTERN int SL_Application_Error; >SL_EXTERN int SL_Internal_Error; >SL_EXTERN int SL_NotImplemented_Error; >SL_EXTERN int SL_LimitExceeded_Error; >SL_EXTERN int SL_Forbidden_Error; >SL_EXTERN int SL_Math_Error; >SL_EXTERN int SL_DivideByZero_Error; >SL_EXTERN int SL_ArithOverflow_Error; >SL_EXTERN int SL_ArithUnderflow_Error; >SL_EXTERN int SL_Domain_Error; >SL_EXTERN int SL_Data_Error; >SL_EXTERN int SL_Unicode_Error; >SL_EXTERN int SL_InvalidUTF8_Error; >SL_EXTERN int SL_Namespace_Error; >SL_EXTERN int SL_Unknown_Error; >SL_EXTERN int SL_Import_Error; > >/* Non zero if error occurs. Must be reset to zero to continue. */ > >/* Compatibility */ >#define USER_BREAK SL_UserBreak_Error >#define INTRINSIC_ERROR SL_RunTime_Error >#define SL_OBJ_NOPEN SL_Open_Error > >#define SL_UNKNOWN_ERROR SL_Unknown_Error >#define SL_APPLICATION_ERROR SL_Application_Error >#define SL_INTERNAL_ERROR SL_Internal_Error >#define SL_INTRINSIC_ERROR SL_RunTime_Error >#define SL_NOT_IMPLEMENTED SL_NotImplemented_Error >#define SL_BUILTIN_LIMIT_EXCEEDED SL_LimitExceeded_Error >#define SL_MALLOC_ERROR SL_Malloc_Error >#define SL_USER_BREAK SL_UserBreak_Error >#define SL_IO_WRITE_ERROR SL_Write_Error >#define SL_IO_READ_ERROR SL_Read_Error >#define SL_IO_OPEN_ERROR SL_Open_Error >#define SL_SYNTAX_ERROR SL_Syntax_Error >#define SL_STACK_OVERFLOW SL_StackOverflow_Error >#define SL_STACK_UNDERFLOW SL_StackUnderflow_Error >#define SL_TYPE_MISMATCH SL_TypeMismatch_Error >#define SL_READONLY_ERROR SL_ReadOnly_Error >#define SL_VARIABLE_UNINITIALIZED SL_VariableUninitialized_Error >#define SL_DUPLICATE_DEFINITION SL_DuplicateDefinition_Error >#define SL_INVALID_PARM SL_InvalidParm_Error >#define SL_UNDEFINED_NAME SL_UndefinedName_Error >#define SL_NUM_ARGS_ERROR SL_NumArgs_Error >#define SL_INDEX_ERROR SL_Index_Error >#define SL_DIVIDE_ERROR SL_DivideByZero_Error >#define SL_MATH_ERROR SL_Math_Error >#define SL_ARITH_OVERFLOW_ERROR SL_ArithOverflow_Error >#define SL_ARITH_UNDERFLOW_ERROR SL_ArithUnderflow_Error >#define SL_USAGE_ERROR SL_Usage_Error >#define SL_INVALID_DATA_ERROR SL_Data_Error >#define SL_UNICODE_ERROR SL_Unicode_Error >#define SL_INVALID_UTF8 SL_InvalidUTF8_Error > > SL_EXTERN int SLang_Traceback; >#define SL_TB_NONE 0x0 >#define SL_TB_FULL 0x1 /* full traceback */ >#define SL_TB_OMIT_LOCALS 0x2 /* full, but omit local vars */ >#define SL_TB_PARTIAL 0x4 /* show just on line of traceback */ > > /* If non-zero, dump an S-Lang traceback upon error. Available as > _traceback in S-Lang. */ > > SL_EXTERN char *SLang_User_Prompt; > /* Prompt to use when reading from stdin */ > SL_EXTERN int SLang_Version; > SL_EXTERN SLFUTURE_CONST char *SLang_Version_String; >SL_EXTERN SLFUTURE_CONST char *SLang_Doc_Dir; > >SL_EXTERN void (*SLang_VMessage_Hook) (SLFUTURE_CONST char *, va_list); >SL_EXTERN void SLang_vmessage (SLFUTURE_CONST char *, ...) SLATTRIBUTE_PRINTF(1,2); > > SL_EXTERN void (*SLang_Error_Hook)(SLFUTURE_CONST char *); > /* Pointer to application dependent error messaging routine. By default, > messages are displayed on stderr. */ > > SL_EXTERN void (*SLang_Exit_Error_Hook)(SLFUTURE_CONST char *, va_list); >SL_EXTERN void SLang_exit_error (SLFUTURE_CONST char *, ...) SLATTRIBUTE_((format (printf, 1, 2), noreturn)); > SL_EXTERN void (*SLang_Dump_Routine)(SLFUTURE_CONST char *); > /* Called if S-Lang traceback is enabled as well as other debugging > routines (e.g., trace). By default, these messages go to stderr. */ > > SL_EXTERN void (*SLang_Interrupt)(void); > /* function to call whenever inner interpreter is entered. This is > a good place to set SLang_Error to USER_BREAK. */ > > SL_EXTERN void (*SLang_User_Clear_Error)(void); > /* function that gets called when '_clear_error' is called. */ > > /* If non null, these call C functions before and after a slang function. */ > SL_EXTERN void (*SLang_Enter_Function)(SLFUTURE_CONST char *); >SL_EXTERN void (*SLang_Exit_Function)(SLFUTURE_CONST char *); > >SL_EXTERN int SLang_Num_Function_Args; > >/* This function should be called when a system call is interrupted. It > * runs a set of hooks. If any of the hooks returns -1, then the system call > * should not be restarted. > */ >SL_EXTERN int SLang_handle_interrupt (void); >SL_EXTERN int SLang_add_interrupt_hook (int (*)(VOID_STAR), VOID_STAR); >SL_EXTERN void SLang_remove_interrupt_hook (int (*)(VOID_STAR), VOID_STAR); > >/* Functions: */ > >SL_EXTERN int SLang_init_all (void); >/* Initializes interpreter and all modules */ > >SL_EXTERN int SLang_init_slang (void); >/* This function is mandatory and must be called by all applications that > * use the interpreter > */ >SL_EXTERN int SLang_init_posix_process (void); /* process specific intrinsics */ >SL_EXTERN int SLang_init_stdio (void); /* fgets, etc. stdio functions */ >SL_EXTERN int SLang_init_posix_dir (void); >SL_EXTERN int SLang_init_ospath (void); > >SL_EXTERN int SLang_init_slmath (void); >/* called if math functions sin, cos, etc... are needed. */ > >/* These functions are obsolete. Use init_stdio, posix_process, etc. */ >SL_EXTERN int SLang_init_slfile (void); >SL_EXTERN int SLang_init_slunix (void); > >SL_EXTERN int SLang_init_slassoc (void); >/* Assoc Arrays (Hashes) */ > >SL_EXTERN int SLang_init_array (void); >/* Additional arrays functions: transpose, etc... */ > >SL_EXTERN int SLang_init_array_extra (void); >/* Additional arrays functions, if any */ > >SL_EXTERN int SLang_init_signal (void); >/* signal handling within the interpreter */ > >/* Dynamic linking facility */ >SL_EXTERN int SLang_init_import (void); > > SL_EXTERN int SLang_load_file (SLFUTURE_CONST char *); > /* Load a file of S-Lang code for interpreting. If the parameter is > * NULL, input comes from stdin. */ > > SL_EXTERN void SLang_restart(int); > /* should be called if an error occurs. If the passed integer is > * non-zero, items are popped off the stack; otherwise, the stack is > * left intact. Any time the stack is believed to be trashed, this routine > * should be called with a non-zero argument (e.g., if setjmp/longjmp is > * called). */ > > SL_EXTERN int SLang_byte_compile_file(SLFUTURE_CONST char *, int); > /* takes a file of S-Lang code and ``byte-compiles'' it for faster > * loading. The new filename is equivalent to the old except that a `c' is > * appended to the name. (e.g., init.sl --> init.slc). The second > * specified the method; currently, it is not used. > */ > > SL_EXTERN int SLang_autoload(SLFUTURE_CONST char *, SLFUTURE_CONST char *); > /* Automatically load S-Lang function p1 from file p2. This function > is also available via S-Lang */ > > SL_EXTERN int SLang_load_string(SLFUTURE_CONST char *); > /* Like SLang_load_file except input is from a null terminated string. */ > >SL_EXTERN int SLstack_depth(void); > >SL_EXTERN int SLdo_pop(void); >SL_EXTERN int SLdo_pop_n(unsigned int); > >SL_EXTERN int SLang_push_char (char); >SL_EXTERN int SLang_push_uchar (unsigned char); >SL_EXTERN int SLang_pop_char (char *); >SL_EXTERN int SLang_pop_uchar (unsigned char *); > >#define SLang_push_integer SLang_push_int >#define SLang_push_uinteger SLang_push_uint >#define SLang_pop_integer SLang_pop_int >#define SLang_pop_uinteger SLang_pop_uint >SL_EXTERN int SLang_push_int(int); >SL_EXTERN int SLang_push_uint(unsigned int); >SL_EXTERN int SLang_pop_int(int *); >SL_EXTERN int SLang_pop_uint(unsigned int *); > >SL_EXTERN int SLang_pop_short(short *); >SL_EXTERN int SLang_pop_ushort(unsigned short *); >SL_EXTERN int SLang_push_short(short); >SL_EXTERN int SLang_push_ushort(unsigned short); > >SL_EXTERN int SLang_pop_long(long *); >SL_EXTERN int SLang_pop_ulong(unsigned long *); >SL_EXTERN int SLang_push_long(long); >SL_EXTERN int SLang_push_ulong(unsigned long); > >SL_EXTERN int SLang_pop_float(float *); >SL_EXTERN int SLang_push_float(float); > >SL_EXTERN int SLang_pop_double(double *); >SL_EXTERN int SLang_push_double(double); > >SL_EXTERN int SLang_push_complex (double, double); >SL_EXTERN int SLang_pop_complex (double *, double *); > >SL_EXTERN int SLang_push_datatype (SLtype); >SL_EXTERN int SLang_pop_datatype (SLtype *); > >SL_EXTERN int SLang_push_malloced_string(char *); >/* The normal SLang_push_string pushes an slstring. This one converts > * a normally malloced string to an slstring, and then frees the > * malloced string. So, do NOT use the malloced string after calling > * this routine because it will be freed! The routine returns -1 upon > * error, but the string will be freed. > */ > >SL_EXTERN int SLang_push_string(SLFUTURE_CONST char *); >SL_EXTERN int SLpop_string (char **); /* malloced -- free with SLfree */ > >SL_EXTERN int SLang_push_null (void); >SL_EXTERN int SLang_pop_null (void); > >SL_EXTERN int SLang_push_value (SLtype type, VOID_STAR); >SL_EXTERN int SLang_pop_value (SLtype type, VOID_STAR); >SL_EXTERN void SLang_free_value (SLtype type, VOID_STAR); > >typedef struct _pSLang_Object_Type SLang_Any_Type; >SL_EXTERN int SLang_pop_anytype (SLang_Any_Type **); >SL_EXTERN int SLang_push_anytype (SLang_Any_Type *); >SL_EXTERN void SLang_free_anytype (SLang_Any_Type *); > >#ifdef SLANG_SOURCE_ >typedef struct _pSLang_Ref_Type SLang_Ref_Type; >#else ># 1243 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >typedef int SLang_Ref_Type; >#endif ># 1245 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN int SLang_pop_ref (SLang_Ref_Type **); >SL_EXTERN void SLang_free_ref (SLang_Ref_Type *); >SL_EXTERN int SLang_assign_to_ref (SLang_Ref_Type *, SLtype, VOID_STAR); >SL_EXTERN int SLang_assign_nametype_to_ref (SLang_Ref_Type *, SLang_Name_Type *); >SL_EXTERN SLang_Name_Type *SLang_pop_function (void); >SL_EXTERN int SLang_push_function (SLang_Name_Type *); >SL_EXTERN SLang_Name_Type *SLang_get_fun_from_ref (SLang_Ref_Type *); >SL_EXTERN void SLang_free_function (SLang_Name_Type *f); >SL_EXTERN SLang_Name_Type *SLang_copy_function (SLang_Name_Type *); > >/* C structure interface */ >SL_EXTERN int SLang_push_cstruct (VOID_STAR, SLang_CStruct_Field_Type *); >SL_EXTERN int SLang_pop_cstruct (VOID_STAR, SLang_CStruct_Field_Type *); >SL_EXTERN void SLang_free_cstruct (VOID_STAR, SLang_CStruct_Field_Type *); >SL_EXTERN int SLang_assign_cstruct_to_ref (SLang_Ref_Type *, VOID_STAR, SLang_CStruct_Field_Type *); > > SL_EXTERN int SLang_is_defined(SLFUTURE_CONST char *); > /* Return non-zero is p1 is defined otherwise returns 0. */ > > SL_EXTERN int SLang_run_hooks(SLFUTURE_CONST char *, unsigned int, ...); > /* calls S-Lang function p1 pushing p2 strings in the variable argument > * list onto the stack first. > * Returns -1 upon error, 1 if hooks exists and it ran, > * or 0 if hook does not exist. Thus it returns non-zero is hook was called. > */ > >/* These functions return 1 if the indicated function exists and the function > * runs without error. If the function does not exist, the function returns > * 0. Otherwise -1 is returned with SLang_Error set appropriately. > */ >SL_EXTERN int SLexecute_function (SLang_Name_Type *); >SL_EXTERN int SLang_execute_function(SLFUTURE_CONST char *); > >SL_EXTERN int SLang_end_arg_list (void); >SL_EXTERN int SLang_start_arg_list (void); > >SL_EXTERN int SLang_add_intrinsic_array (SLFUTURE_CONST char *, /* name */ > SLtype, /* type */ > int, /* readonly */ > VOID_STAR, /* data */ > unsigned int, ...); /* num dims */ > >SL_EXTERN int SLextract_list_element (SLFUTURE_CONST char *, unsigned int, char, > char *, unsigned int); > >/* If utf8_encode is >1, then byte values > 127 will be utf8-encoded. > * If the string is already in utf8 form, and utf8 is desired, then use with > * utf8_encode set to 0. A value of -1 implies use the value appropriate for > * the current state of the interpreter. > */ >SL_EXTERN int SLexpand_escaped_string (char *dest, char *src, char *src_max, > int utf8_encode); > >SL_EXTERN SLang_Name_Type *SLang_get_function (SLFUTURE_CONST char *); >SL_EXTERN void SLang_release_function (SLang_Name_Type *); > >SL_EXTERN int SLreverse_stack (int); >SL_EXTERN int SLroll_stack (int); >/* If argument p is positive, the top p objects on the stack are rolled > * up. If negative, the stack is rolled down. > */ > >/* exchange two items on the stack. The top item is given by 0 */ >SL_EXTERN int SLstack_exch (unsigned int, unsigned int); > >SL_EXTERN int SLdup_n (int n); >/* Duplicate top n elements of stack */ > >SL_EXTERN int SLang_peek_at_stack1 (void); >SL_EXTERN int SLang_peek_at_stack (void); >SL_EXTERN int SLang_peek_at_stack_n (unsigned int n); >SL_EXTERN int SLang_peek_at_stack1_n (unsigned int n); > >/* Returns type of next object on stack-- -1 upon stack underflow. */ >SL_EXTERN void SLmake_lut (unsigned char *, unsigned char *, unsigned char); > > SL_EXTERN int SLang_guess_type (SLFUTURE_CONST char *); > >SL_EXTERN int SLstruct_create_struct (unsigned int, > SLFUTURE_CONST char **, > SLtype *, > VOID_STAR *); > >/*}}}*/ > >/*{{{ Misc Functions */ > >/* This is an interface to atexit */ >SL_EXTERN int SLang_add_cleanup_function (void (*)(void)); > >SL_EXTERN char *SLmake_string (SLFUTURE_CONST char *); >SL_EXTERN char *SLmake_nstring (SLFUTURE_CONST char *, SLstrlen_Type); >/* Returns a null terminated string made from the first n characters of the > * string. > */ > >/* Binary strings */ >/* The binary string is an opaque type. Use the SLbstring_get_pointer function > * to get a pointer and length. > */ >typedef struct _pSLang_BString_Type SLang_BString_Type; >SL_EXTERN unsigned char *SLbstring_get_pointer (SLang_BString_Type *, SLstrlen_Type *); > >SL_EXTERN SLang_BString_Type *SLbstring_dup (SLang_BString_Type *); >SL_EXTERN SLang_BString_Type *SLbstring_create (unsigned char *, SLstrlen_Type); > >/* The create_malloced function uses the first argument which is assumed > * to be a pointer to a len + 1 malloced string. The extra byte is for > * \0 termination. > */ >SL_EXTERN SLang_BString_Type *SLbstring_create_malloced (unsigned char *s, SLstrlen_Type len, int free_on_error); > >/* Create a bstring from an slstring */ >SL_EXTERN SLang_BString_Type *SLbstring_create_slstring (SLFUTURE_CONST char *); > >SL_EXTERN void SLbstring_free (SLang_BString_Type *); >SL_EXTERN int SLang_pop_bstring (SLang_BString_Type **); >SL_EXTERN int SLang_push_bstring (SLang_BString_Type *); > >SL_EXTERN SLFUTURE_VOID *SLmalloc (SLstrlen_Type); >SL_EXTERN SLFUTURE_VOID *SLcalloc (SLstrlen_Type, SLstrlen_Type); >SL_EXTERN void SLfree(SLFUTURE_VOID *); /* This function handles NULL */ >SL_EXTERN SLFUTURE_VOID *SLrealloc (SLFUTURE_VOID *, SLstrlen_Type); > >SL_EXTERN char *SLcurrent_time_string (void); > >SL_EXTERN int SLatoi(unsigned char *); >SL_EXTERN long SLatol (unsigned char *); >SL_EXTERN unsigned long SLatoul (unsigned char *); > >#ifdef HAVE_LONG_LONG >SL_EXTERN long long SLatoll (unsigned char *s); >SL_EXTERN unsigned long long SLatoull (unsigned char *s); >#endif ># 1380 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >SL_EXTERN int SLang_pop_fileptr (SLang_MMT_Type **, FILE **); >SL_EXTERN SLFUTURE_CONST char *SLang_get_name_from_fileptr (SLang_MMT_Type *); > >SL_EXTERN int SLang_get_fileptr (SLang_MMT_Type *, FILE **); >/* This function may be used to obtain the FILE* object associated with an MMT. > * It returns 0 if no-errors were encountered, and -1 otherwise. > * If FILE* object has been closed, this function will return 0 and set the FILE* > * parameter to NULL. > */ > >typedef struct _pSLFile_FD_Type SLFile_FD_Type; >SL_EXTERN SLFile_FD_Type *SLfile_create_fd (SLFUTURE_CONST char *, int); >SL_EXTERN void SLfile_free_fd (SLFile_FD_Type *); >SL_EXTERN int SLfile_push_fd (SLFile_FD_Type *); >SL_EXTERN int SLfile_pop_fd (SLFile_FD_Type **); >SL_EXTERN int SLfile_get_fd (SLFile_FD_Type *, int *); >SL_EXTERN SLFile_FD_Type *SLfile_dup_fd (SLFile_FD_Type *f0); >SL_EXTERN int SLang_init_posix_io (void); > >/* These routines allow an application to attach an object to a file-descriptor > * as well a provide read/write/close/etc methods. To allow the coexistence of > * different types of objects, a clientdata-id must be used. > */ >SL_EXTERN int SLfile_set_getfd_method (SLFile_FD_Type *f, int (*func)(VOID_STAR, int *)); >SL_EXTERN int SLfile_set_close_method (SLFile_FD_Type *f, int (*func)(VOID_STAR)); >SL_EXTERN int SLfile_set_read_method (SLFile_FD_Type *f, int (*func)(VOID_STAR, char*, unsigned int)); >SL_EXTERN int SLfile_set_write_method (SLFile_FD_Type *f, int (*func)(VOID_STAR, char*, unsigned int)); >SL_EXTERN int SLfile_set_dup_method (SLFile_FD_Type *f, SLFile_FD_Type *(*func)(VOID_STAR)); >SL_EXTERN int SLfile_create_clientdata_id (int *id); >SL_EXTERN int SLfile_set_clientdata (SLFile_FD_Type *f, void (*free_func)(VOID_STAR), VOID_STAR cd, int id); >SL_EXTERN int SLfile_get_clientdata (SLFile_FD_Type *f, int id, VOID_STAR *cdp); > >typedef double (*SLang_To_Double_Fun_Type)(VOID_STAR); >SL_EXTERN SLang_To_Double_Fun_Type SLarith_get_to_double_fun (SLtype, unsigned int *); > >SL_EXTERN int SLang_set_argc_argv (int, char **); > >/*}}}*/ > >/*{{{ Qualifier Functions */ > >SL_EXTERN int SLang_qualifier_exists (SLCONST char *name); >SL_EXTERN int SLang_get_int_qualifier (SLCONST char *name, int *val, int defval); >SL_EXTERN int SLang_get_long_qualifier (SLCONST char *name, long *val, long defval); >SL_EXTERN int SLang_get_double_qualifier (SLCONST char *name, double *val, double defval); >SL_EXTERN int SLang_get_string_qualifier (SLCONST char *name, char **val, SLFUTURE_CONST char *defval); > >/*}}}*/ > >/*{{{ SLang getkey interface Functions */ > >#ifdef REAL_UNIX_SYSTEM >SL_EXTERN int SLang_TT_Baud_Rate; >SL_EXTERN int SLang_TT_Read_FD; >#else ># 1435 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if defined(__WIN32__) >/* I do not want to include windows.h just to get the typedef for HANDLE. > * Make this conditional upon the inclusion of windows.h. > */ ># ifdef _WINDOWS_ >SL_EXTERN HANDLE SLw32_Hstdin; ># endif ># 1442 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># endif ># 1443 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 1444 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN int SLang_init_tty (int, int, int); >/* Initializes the tty for single character input. If the first parameter *p1 > * is in the range 0-255, it will be used for the abort character; > * otherwise, (unix only) if it is -1, the abort character will be the one > * used by the terminal. If the second parameter p2 is non-zero, flow > * control is enabled. If the last parmeter p3 is zero, output processing > * is NOT turned on. A value of zero is required for the screen management > * routines. Returns 0 upon success. In addition, if SLang_TT_Baud_Rate == > * 0 when this function is called, SLang will attempt to determine the > * terminals baud rate. As far as the SLang library is concerned, if > * SLang_TT_Baud_Rate is less than or equal to zero, the baud rate is > * effectively infinite. > */ > >SL_EXTERN void SLang_reset_tty (void); >/* Resets tty to what it was prior to a call to SLang_init_tty */ >#ifdef REAL_UNIX_SYSTEM >SL_EXTERN void SLtty_set_suspend_state (int); > /* If non-zero argument, terminal driver will be told to react to the > * suspend character. If 0, it will not. > */ >SL_EXTERN int (*SLang_getkey_intr_hook) (void); >#endif ># 1468 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#define SLANG_GETKEY_ERROR 0xFFFF >SL_EXTERN unsigned int SLang_getkey (void); >/* reads a single key from the tty. If the read fails, 0xFFFF is returned. */ > >#ifdef IBMPC_SYSTEM >SL_EXTERN int SLgetkey_map_to_ansi (int); >#endif ># 1476 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN int SLang_ungetkey_string (unsigned char *, unsigned int); >SL_EXTERN int SLang_buffer_keystring (unsigned char *, unsigned int); >SL_EXTERN int SLang_ungetkey (unsigned char); >SL_EXTERN void SLang_flush_input (void); >SL_EXTERN int SLang_input_pending (int); >SL_EXTERN int SLang_Abort_Char; >/* The value of the character (0-255) used to trigger SIGINT */ >SL_EXTERN int SLang_Ignore_User_Abort; >/* If non-zero, pressing the abort character will not result in USER_BREAK > * SLang_Error. */ > >SL_EXTERN int SLang_set_abort_signal (void (*)(int)); >/* If SIGINT is generated, the function p1 will be called. If p1 is NULL > * the SLang_default signal handler is called. This sets SLang_Error to > * USER_BREAK. I suspect most users will simply want to pass NULL. > */ >SL_EXTERN unsigned int SLang_Input_Buffer_Len; > >SL_EXTERN volatile int SLKeyBoard_Quit; > >#ifdef VMS >/* If this function returns -1, ^Y will be added to input buffer. */ >SL_EXTERN int (*SLtty_VMS_Ctrl_Y_Hook) (void); >#endif ># 1501 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >/*}}}*/ > >/*{{{ SLang Keymap routines */ > >typedef struct SLKeymap_Function_Type >{ > SLFUTURE_CONST char *name; > int (*f)(void); >} >SLKeymap_Function_Type; > >#define SLANG_MAX_KEYMAP_KEY_SEQ 14 >typedef struct SLang_Key_Type >{ > struct SLang_Key_Type *next; > union > { > char *s; > FVOID_STAR f; > unsigned int keysym; > SLang_Name_Type *slang_fun; > } > f; > unsigned char type; /* type of function */ >#define SLKEY_F_INTERPRET 0x01 >#define SLKEY_F_INTRINSIC 0x02 >#define SLKEY_F_KEYSYM 0x03 >#define SLKEY_F_SLANG 0x04 > unsigned char str[SLANG_MAX_KEYMAP_KEY_SEQ + 1];/* key sequence */ >} >SLang_Key_Type; > >int SLkm_set_free_method (int, void (*)(int, VOID_STAR)); > >typedef struct _pSLkeymap_Type >{ > SLFUTURE_CONST char *name; /* hashed string */ > SLang_Key_Type *keymap; > SLKeymap_Function_Type *functions; /* intrinsic functions */ > struct _pSLkeymap_Type *next; >} SLkeymap_Type; > >SL_EXTERN SLkeymap_Type *SLKeyMap_List_Root; /* linked list of keymaps */ > >/* backward compat */ >typedef SLkeymap_Type SLKeyMap_List_Type; > >SL_EXTERN char *SLang_process_keystring(SLFUTURE_CONST char *); > >SL_EXTERN int SLkm_define_key (SLFUTURE_CONST char *, FVOID_STAR, SLkeymap_Type *); > >SL_EXTERN int SLang_define_key(SLFUTURE_CONST char *, SLFUTURE_CONST char *, SLkeymap_Type *); >/* Like define_key1 except that p2 is a string that is to be associated with > * a function in the functions field of p3. > */ > >SL_EXTERN int SLkm_define_keysym (SLFUTURE_CONST char *, unsigned int, SLkeymap_Type *); >SL_EXTERN int SLkm_define_slkey (SLFUTURE_CONST char *keysequence, SLang_Name_Type *func, SLkeymap_Type *); >SL_EXTERN void SLang_undefine_key(SLFUTURE_CONST char *, SLkeymap_Type *); > >SL_EXTERN SLkeymap_Type *SLang_create_keymap(SLFUTURE_CONST char *, SLkeymap_Type *); >/* create and returns a pointer to a new keymap named p1 created by copying > * keymap p2. If p2 is NULL, it is up to the calling routine to initialize > * the keymap. > */ > >SL_EXTERN char *SLang_make_keystring(unsigned char *); > >SL_EXTERN SLang_Key_Type *SLang_do_key(SLkeymap_Type *, int (*)(void)); >/* read a key using keymap p1 with getkey function p2 */ > >SL_EXTERN FVOID_STAR SLang_find_key_function(SLFUTURE_CONST char *, SLkeymap_Type *); > >SL_EXTERN SLkeymap_Type *SLang_find_keymap(SLFUTURE_CONST char *); > >SL_EXTERN int SLang_Last_Key_Char; >/* Despite the name of this variable, its value is the last BYTE of a key-sequence */ > >SL_EXTERN int SLang_Key_TimeOut_Flag; > >/*}}}*/ > >/*{{{ SLang Readline Interface */ > >typedef struct _pSLrline_Type SLrline_Type; >SL_EXTERN SLrline_Type *SLrline_open (unsigned int width, unsigned int flags); >SL_EXTERN SLrline_Type *SLrline_open2 (SLFUTURE_CONST char *, unsigned int width, unsigned int flags); >#define SL_RLINE_NO_ECHO 0x0001 >#define SL_RLINE_USE_ANSI 0x0002 >#define SL_RLINE_BLINK_MATCH 0x0004 >#define SL_RLINE_UTF8_MODE 0x0008 >#define SL_RLINE_USE_MULTILINE 0x0010 > >SL_EXTERN void SLrline_close (SLrline_Type *); > >/* This returns a malloced string */ >SL_EXTERN char *SLrline_read_line (SLrline_Type *, SLFUTURE_CONST char *prompt, unsigned int *lenp); > >SL_EXTERN int SLrline_bol (SLrline_Type *); >SL_EXTERN int SLrline_eol (SLrline_Type *); >SL_EXTERN int SLrline_del (SLrline_Type *, unsigned int len); >SL_EXTERN int SLrline_ins (SLrline_Type *, SLFUTURE_CONST char *s, unsigned int len); >SL_EXTERN int SLrline_move (SLrline_Type *, int); > >SL_EXTERN int SLrline_set_echo (SLrline_Type *, int); >SL_EXTERN int SLrline_set_tab (SLrline_Type *, unsigned int tabwidth); >SL_EXTERN int SLrline_set_point (SLrline_Type *, unsigned int); >SL_EXTERN int SLrline_set_line (SLrline_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLrline_set_hscroll (SLrline_Type *, unsigned int); >SL_EXTERN int SLrline_set_display_width (SLrline_Type *, unsigned int); > >SL_EXTERN int SLrline_get_echo (SLrline_Type *, int *); >SL_EXTERN int SLrline_get_tab (SLrline_Type *, unsigned int *); >SL_EXTERN int SLrline_get_point (SLrline_Type *, unsigned int *); >SL_EXTERN char *SLrline_get_line (SLrline_Type *); >SL_EXTERN int SLrline_get_hscroll (SLrline_Type *, unsigned int *); >SL_EXTERN int SLrline_get_display_width (SLrline_Type *, unsigned int *); > >SL_EXTERN int SLrline_set_update_hook (SLrline_Type *, > void (*)(SLrline_Type *rli, > SLFUTURE_CONST char *prompt, > SLFUTURE_CONST char *buf, unsigned int len, > unsigned int point, VOID_STAR client_data), > VOID_STAR client_data); >/* free update_hook client_data */ >SL_EXTERN void SLrline_set_free_update_cb (SLrline_Type *, void (*)(SLrline_Type *, VOID_STAR)); > >/* These functions are passed a pointer to the update_hook client_data */ >SL_EXTERN void SLrline_set_update_clear_cb(SLrline_Type *, void (*)(SLrline_Type *, VOID_STAR)); >SL_EXTERN void SLrline_set_update_preread_cb (SLrline_Type *, void (*)(SLrline_Type *, VOID_STAR)); >SL_EXTERN void SLrline_set_update_postread_cb (SLrline_Type *, void (*)(SLrline_Type *, VOID_STAR)); >SL_EXTERN void SLrline_set_update_width_cb (SLrline_Type *, void (*)(SLrline_Type *, int, VOID_STAR)); >SL_EXTERN int SLrline_get_update_client_data (SLrline_Type *, VOID_STAR *); > >SL_EXTERN SLkeymap_Type *SLrline_get_keymap (SLrline_Type *); > >SL_EXTERN void SLrline_redraw (SLrline_Type *); >SL_EXTERN int SLrline_save_line (SLrline_Type *); >SL_EXTERN int SLrline_add_to_history (SLrline_Type *, SLFUTURE_CONST char *); > >/* Interpreter interface */ >SL_EXTERN int SLrline_init (SLFUTURE_CONST char *appname, SLFUTURE_CONST char *user_initfile, SLFUTURE_CONST char *sys_initfile); > >/* Compatibility */ >typedef SLrline_Type SLang_RLine_Info_Type; > >/*}}}*/ > >/*{{{ Low Level Screen Output Interface */ > >SL_EXTERN unsigned long SLtt_Num_Chars_Output; >SL_EXTERN int SLtt_Baud_Rate; > >typedef unsigned long SLtt_Char_Type; > >#define SLTT_BOLD_MASK 0x01000000UL >#define SLTT_BLINK_MASK 0x02000000UL >#define SLTT_ULINE_MASK 0x04000000UL >#define SLTT_REV_MASK 0x08000000UL >#define SLTT_ALTC_MASK 0x10000000UL >#define SLTT_ITALIC_MASK 0x20000000UL > >SL_EXTERN int SLtt_Screen_Rows; >SL_EXTERN int SLtt_Screen_Cols; >SL_EXTERN int SLtt_Term_Cannot_Insert; >SL_EXTERN int SLtt_Term_Cannot_Scroll; >SL_EXTERN int SLtt_Use_Ansi_Colors; >SL_EXTERN int SLtt_Ignore_Beep; >#if defined(REAL_UNIX_SYSTEM) >SL_EXTERN int SLtt_Force_Keypad_Init; >SL_EXTERN int SLang_TT_Write_FD; >#endif ># 1673 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifndef IBMPC_SYSTEM >SL_EXTERN char *SLtt_Graphics_Char_Pairs; >#endif ># 1677 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifndef __GO32__ >#if defined(VMS) || defined(REAL_UNIX_SYSTEM) >SL_EXTERN int SLtt_Blink_Mode; >SL_EXTERN int SLtt_Use_Blink_For_ACS; >SL_EXTERN int SLtt_Newline_Ok; >SL_EXTERN int SLtt_Has_Alt_Charset; >SL_EXTERN int SLtt_Has_Status_Line; /* if 0, NO. If > 0, YES, IF -1, ?? */ ># ifndef VMS >SL_EXTERN int SLtt_Try_Termcap; ># endif ># 1688 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 1689 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 1690 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#if defined(IBMPC_SYSTEM) >SL_EXTERN int SLtt_Msdos_Cheap_Video; >#endif ># 1694 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >typedef unsigned short SLsmg_Color_Type; >#define SLSMG_MAX_COLORS 0x7FFE /* keep one for BCE */ >#define SLSMG_COLOR_MASK 0x7FFF >#define SLSMG_ACS_MASK 0x8000 > >#define SLSMG_MAX_CHARS_PER_CELL 5 >typedef struct >{ > unsigned int nchars; > SLwchar_Type wchars[SLSMG_MAX_CHARS_PER_CELL]; > SLsmg_Color_Type color; >} >SLsmg_Char_Type; > >#define SLSMG_EXTRACT_COLOR(x) ((x).color) >#define SLSMG_EXTRACT_CHAR(x) ((x).wchars[0]) > >SL_EXTERN int SLtt_flush_output (void); >SL_EXTERN void SLtt_set_scroll_region(int, int); >SL_EXTERN void SLtt_reset_scroll_region(void); >SL_EXTERN void SLtt_reverse_video (int); >SL_EXTERN void SLtt_bold_video (void); >SL_EXTERN void SLtt_begin_insert(void); >SL_EXTERN void SLtt_end_insert(void); >SL_EXTERN void SLtt_del_eol(void); >SL_EXTERN void SLtt_goto_rc (int, int); >SL_EXTERN void SLtt_delete_nlines(int); >SL_EXTERN void SLtt_delete_char(void); >SL_EXTERN void SLtt_erase_line(void); >SL_EXTERN void SLtt_normal_video(void); >SL_EXTERN void SLtt_cls(void); >SL_EXTERN void SLtt_beep(void); >SL_EXTERN void SLtt_reverse_index(int); >SL_EXTERN void SLtt_smart_puts(SLsmg_Char_Type *, SLsmg_Char_Type *, int, int); >SL_EXTERN void SLtt_write_string (SLFUTURE_CONST char *); >SL_EXTERN void SLtt_putchar(char); >SL_EXTERN int SLtt_init_video (void); >SL_EXTERN int SLtt_reset_video (void); >SL_EXTERN void SLtt_get_terminfo(void); >SL_EXTERN void SLtt_get_screen_size (void); >SL_EXTERN int SLtt_set_cursor_visibility (int); > >SL_EXTERN int SLtt_set_mouse_mode (int, int); > >#if defined(VMS) || defined(REAL_UNIX_SYSTEM) >SL_EXTERN int SLtt_initialize (SLFUTURE_CONST char *); >SL_EXTERN void SLtt_enable_cursor_keys(void); >SL_EXTERN void SLtt_set_term_vtxxx(int *); >SL_EXTERN void SLtt_wide_width(void); >SL_EXTERN void SLtt_narrow_width(void); >SL_EXTERN void SLtt_set_alt_char_set (int); >SL_EXTERN int SLtt_write_to_status_line (SLFUTURE_CONST char *, int); >SL_EXTERN void SLtt_disable_status_line (void); ># ifdef REAL_UNIX_SYSTEM >/* These are termcap/terminfo routines that assume SLtt_initialize has > * been called. > */ >SL_EXTERN char *SLtt_tgetstr (SLFUTURE_CONST char *); >SL_EXTERN int SLtt_tgetnum (SLFUTURE_CONST char *); >SL_EXTERN int SLtt_tgetflag (SLFUTURE_CONST char *); >SL_EXTERN int SLtt_tgetent(char *name); >SL_EXTERN char *SLtt_tgoto(char *cap, int col, int row); >SL_EXTERN int SLtt_tputs(char *str, int affcnt, int (*putcfun)(int)); > >/* The following are terminfo-only routines -- these prototypes will change > * in V2.x. > */ >SL_EXTERN char *SLtt_tigetent (SLFUTURE_CONST char *); >SL_EXTERN char *SLtt_tigetstr (SLFUTURE_CONST char *, char **); >SL_EXTERN int SLtt_tigetnum (SLFUTURE_CONST char *, char **); ># endif ># 1766 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif ># 1767 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN SLtt_Char_Type SLtt_get_color_object (int); >SL_EXTERN int SLtt_set_color_object (int, SLtt_Char_Type); >SL_EXTERN int SLtt_set_color (int, SLFUTURE_CONST char *, SLFUTURE_CONST char *, SLFUTURE_CONST char *); >SL_EXTERN int SLtt_set_mono (int, SLFUTURE_CONST char *, SLtt_Char_Type); >SL_EXTERN int SLtt_add_color_attribute (int, SLtt_Char_Type); >SL_EXTERN int SLtt_set_color_fgbg (int, SLtt_Char_Type, SLtt_Char_Type); > >/*}}}*/ > >/*{{{ SLang Preprocessor Interface */ > >/* #define SLPreprocess_Type SLprep_Type; */ >typedef struct _pSLprep_Type SLprep_Type; > >SL_EXTERN SLprep_Type *SLprep_new (void); >SL_EXTERN void SLprep_delete (SLprep_Type *); >SL_EXTERN int SLprep_line_ok (SLFUTURE_CONST char *, SLprep_Type *); >SL_EXTERN int SLprep_set_flags (SLprep_Type *, unsigned int flags); >#define SLPREP_BLANK_LINES_OK 0x1 >#define SLPREP_COMMENT_LINES_OK 0x2 > >SL_EXTERN int SLprep_set_comment (SLprep_Type *, SLFUTURE_CONST char *, SLFUTURE_CONST char *); >SL_EXTERN int SLprep_set_prefix (SLprep_Type *, SLFUTURE_CONST char *); >SL_EXTERN int SLprep_set_exists_hook (SLprep_Type *, > int (*)(SLprep_Type *, SLFUTURE_CONST char *)); >SL_EXTERN int SLprep_set_eval_hook (SLprep_Type *, > int (*)(SLprep_Type *, SLFUTURE_CONST char *)); > >SL_EXTERN int SLdefine_for_ifdef (SLFUTURE_CONST char *); > /* Adds a string to the SLang #ifdef preparsing defines. SLang already > defines MSDOS, UNIX, and VMS on the appropriate system. */ > >/*}}}*/ > >/*{{{ SLsmg Screen Management Functions */ > >SL_EXTERN void SLsmg_fill_region (int, int, unsigned int, unsigned int, > SLwchar_Type); >SL_EXTERN void SLsmg_set_char_set (int); >#ifndef IBMPC_SYSTEM >SL_EXTERN int SLsmg_Scroll_Hash_Border; >#endif ># 1810 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >SL_EXTERN int SLsmg_suspend_smg (void); >SL_EXTERN int SLsmg_resume_smg (void); >SL_EXTERN void SLsmg_erase_eol (void); >SL_EXTERN void SLsmg_gotorc (int, int); >SL_EXTERN void SLsmg_erase_eos (void); >SL_EXTERN void SLsmg_reverse_video (void); >SL_EXTERN void SLsmg_set_color (SLsmg_Color_Type); >SL_EXTERN void SLsmg_normal_video (void); >SL_EXTERN void SLsmg_printf (SLFUTURE_CONST char *, ...) SLATTRIBUTE_PRINTF(1,2); >/* SL_EXTERN void SLsmg_printf (SLFUTURE_CONST char *, ...) SLATTRIBUTE_PRINTF(1,2); */ >SL_EXTERN void SLsmg_vprintf (SLFUTURE_CONST char *, va_list); >SL_EXTERN void SLsmg_write_string (SLFUTURE_CONST char *); >SL_EXTERN void SLsmg_write_nstring (SLFUTURE_CONST char *, unsigned int); >SL_EXTERN void SLsmg_write_chars (SLuchar_Type *u, SLuchar_Type *umax); >SL_EXTERN void SLsmg_write_nchars (SLFUTURE_CONST char *str, unsigned int len); >SL_EXTERN void SLsmg_write_char (SLwchar_Type ch); >SL_EXTERN void SLsmg_write_wrapped_string (SLuchar_Type *, int, int, unsigned int, unsigned int, int); >SL_EXTERN void SLsmg_cls (void); >SL_EXTERN void SLsmg_refresh (void); >SL_EXTERN void SLsmg_touch_lines (int, unsigned int); >SL_EXTERN void SLsmg_touch_screen (void); >SL_EXTERN int SLsmg_init_smg (void); >SL_EXTERN int SLsmg_reinit_smg (void); >SL_EXTERN void SLsmg_reset_smg (void); >SL_EXTERN int SLsmg_char_at (SLsmg_Char_Type *); >SL_EXTERN void SLsmg_set_screen_start (int *, int *); >SL_EXTERN void SLsmg_draw_hline (unsigned int); >SL_EXTERN void SLsmg_draw_vline (int); >SL_EXTERN void SLsmg_draw_object (int, int, SLwchar_Type); >SL_EXTERN void SLsmg_draw_box (int, int, unsigned int, unsigned int); >SL_EXTERN int SLsmg_get_column(void); >SL_EXTERN int SLsmg_get_row(void); >SL_EXTERN void SLsmg_forward (int); >SL_EXTERN void SLsmg_write_color_chars (SLsmg_Char_Type *, unsigned int); >SL_EXTERN unsigned int SLsmg_read_raw (SLsmg_Char_Type *, unsigned int); >SL_EXTERN unsigned int SLsmg_write_raw (SLsmg_Char_Type *, unsigned int); >SL_EXTERN void SLsmg_set_color_in_region (int, int, int, unsigned int, unsigned int); > >SL_EXTERN unsigned int SLsmg_strwidth (SLuchar_Type *u, SLuchar_Type *max); >SL_EXTERN unsigned int SLsmg_strbytes (SLuchar_Type *u, SLuchar_Type *max, unsigned int width); >SL_EXTERN int SLsmg_embedded_escape_mode (int on_or_off); >SL_EXTERN int SLsmg_Display_Eight_Bit; >SL_EXTERN int SLsmg_Tab_Width; > >#define SLSMG_NEWLINE_IGNORED 0 /* default */ >#define SLSMG_NEWLINE_MOVES 1 /* moves to next line, column 0 */ >#define SLSMG_NEWLINE_SCROLLS 2 /* moves but scrolls at bottom of screen */ >#define SLSMG_NEWLINE_PRINTABLE 3 /* prints as ^J */ >SL_EXTERN int SLsmg_Newline_Behavior; > >SL_EXTERN int SLsmg_Backspace_Moves; > >#ifdef IBMPC_SYSTEM ># define SLSMG_HLINE_CHAR 0xC4 ># define SLSMG_VLINE_CHAR 0xB3 ># define SLSMG_ULCORN_CHAR 0xDA ># define SLSMG_URCORN_CHAR 0xBF ># define SLSMG_LLCORN_CHAR 0xC0 ># define SLSMG_LRCORN_CHAR 0xD9 ># define SLSMG_RTEE_CHAR 0xB4 ># define SLSMG_LTEE_CHAR 0xC3 ># define SLSMG_UTEE_CHAR 0xC2 ># define SLSMG_DTEE_CHAR 0xC1 ># define SLSMG_PLUS_CHAR 0xC5 >/* There are several to choose from: 0xB0, 0xB1, and 0xB2 */ ># define SLSMG_CKBRD_CHAR 0xB0 ># define SLSMG_DIAMOND_CHAR 0x04 ># define SLSMG_DEGREE_CHAR 0xF8 ># define SLSMG_PLMINUS_CHAR 0xF1 ># define SLSMG_BULLET_CHAR 0xF9 ># define SLSMG_LARROW_CHAR 0x1B ># define SLSMG_RARROW_CHAR 0x1A ># define SLSMG_DARROW_CHAR 0x19 ># define SLSMG_UARROW_CHAR 0x18 ># define SLSMG_BOARD_CHAR 0xB2 ># define SLSMG_BLOCK_CHAR 0xDB >#else ># 1887 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># if defined(AMIGA) ># define SLSMG_HLINE_CHAR ((unsigned char)'-') ># define SLSMG_VLINE_CHAR ((unsigned char)'|') ># define SLSMG_ULCORN_CHAR ((unsigned char)'+') ># define SLSMG_URCORN_CHAR ((unsigned char)'+') ># define SLSMG_LLCORN_CHAR ((unsigned char)'+') ># define SLSMG_LRCORN_CHAR ((unsigned char)'+') ># define SLSMG_CKBRD_CHAR ((unsigned char)'#') ># define SLSMG_RTEE_CHAR ((unsigned char)'+') ># define SLSMG_LTEE_CHAR ((unsigned char)'+') ># define SLSMG_UTEE_CHAR ((unsigned char)'+') ># define SLSMG_DTEE_CHAR ((unsigned char)'+') ># define SLSMG_PLUS_CHAR ((unsigned char)'+') ># define SLSMG_DIAMOND_CHAR ((unsigned char)'+') ># define SLSMG_DEGREE_CHAR ((unsigned char)'\\') ># define SLSMG_PLMINUS_CHAR ((unsigned char)'#') ># define SLSMG_BULLET_CHAR ((unsigned char)'o') ># define SLSMG_LARROW_CHAR ((unsigned char)'<') ># define SLSMG_RARROW_CHAR ((unsigned char)'>') ># define SLSMG_DARROW_CHAR ((unsigned char)'v') ># define SLSMG_UARROW_CHAR ((unsigned char)'^') ># define SLSMG_BOARD_CHAR ((unsigned char)'#') ># define SLSMG_BLOCK_CHAR ((unsigned char)'#') ># else ># 1911 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SLSMG_HLINE_CHAR ((unsigned char)'q') ># define SLSMG_VLINE_CHAR ((unsigned char)'x') ># define SLSMG_ULCORN_CHAR ((unsigned char)'l') ># define SLSMG_URCORN_CHAR ((unsigned char)'k') ># define SLSMG_LLCORN_CHAR ((unsigned char)'m') ># define SLSMG_LRCORN_CHAR ((unsigned char)'j') ># define SLSMG_CKBRD_CHAR ((unsigned char)'a') ># define SLSMG_RTEE_CHAR ((unsigned char)'u') ># define SLSMG_LTEE_CHAR ((unsigned char)'t') ># define SLSMG_UTEE_CHAR ((unsigned char)'w') ># define SLSMG_DTEE_CHAR ((unsigned char)'v') ># define SLSMG_PLUS_CHAR ((unsigned char)'n') ># define SLSMG_DIAMOND_CHAR ((unsigned char)'`') ># define SLSMG_DEGREE_CHAR ((unsigned char)'f') ># define SLSMG_PLMINUS_CHAR ((unsigned char)'g') ># define SLSMG_BULLET_CHAR ((unsigned char)'~') ># define SLSMG_LARROW_CHAR ((unsigned char)',') ># define SLSMG_RARROW_CHAR ((unsigned char)'+') ># define SLSMG_DARROW_CHAR ((unsigned char)'.') ># define SLSMG_UARROW_CHAR ((unsigned char)'-') ># define SLSMG_BOARD_CHAR ((unsigned char)'h') ># define SLSMG_BLOCK_CHAR ((unsigned char)'0') ># endif /* AMIGA */ ># 1934 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#endif /* IBMPC_SYSTEM */ ># 1935 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#ifndef IBMPC_SYSTEM ># define SLSMG_COLOR_BLACK 0x000000 ># define SLSMG_COLOR_RED 0x000001 ># define SLSMG_COLOR_GREEN 0x000002 ># define SLSMG_COLOR_BROWN 0x000003 ># define SLSMG_COLOR_BLUE 0x000004 ># define SLSMG_COLOR_MAGENTA 0x000005 ># define SLSMG_COLOR_CYAN 0x000006 ># define SLSMG_COLOR_LGRAY 0x000007 ># define SLSMG_COLOR_GRAY 0x000008 ># define SLSMG_COLOR_BRIGHT_RED 0x000009 ># define SLSMG_COLOR_BRIGHT_GREEN 0x00000A ># define SLSMG_COLOR_BRIGHT_BROWN 0x00000B ># define SLSMG_COLOR_BRIGHT_BLUE 0x00000C ># define SLSMG_COLOR_BRIGHT_MAGENTA 0x00000D ># define SLSMG_COLOR_BRIGHT_CYAN 0x00000E ># define SLSMG_COLOR_BRIGHT_WHITE 0x00000F >#endif ># 1954 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >typedef struct >{ > void (*tt_normal_video)(void); > void (*tt_set_scroll_region)(int, int); > void (*tt_goto_rc)(int, int); > void (*tt_reverse_index)(int); > void (*tt_reset_scroll_region)(void); > void (*tt_delete_nlines)(int); > void (*tt_cls) (void); > void (*tt_del_eol) (void); > void (*tt_smart_puts) (SLsmg_Char_Type *, SLsmg_Char_Type *, int, int); > int (*tt_flush_output) (void); > int (*tt_reset_video) (void); > int (*tt_init_video) (void); > > int *tt_screen_rows; > int *tt_screen_cols; > > int *tt_term_cannot_scroll; >#if 0 > int *tt_use_blink_for_acs; >#endif ># 1977 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > int *tt_has_alt_charset; > char **tt_graphic_char_pairs; > int *unicode_ok; > > long reserved[4]; >} >SLsmg_Term_Type; >SL_EXTERN void SLsmg_set_terminal_info (SLsmg_Term_Type *); > >/*}}}*/ > >/*{{{ SLang Keypad Interface */ > >#define SL_KEY_ERR 0xFFFF > >#define SL_KEY_UP 0x101 >#define SL_KEY_DOWN 0x102 >#define SL_KEY_LEFT 0x103 >#define SL_KEY_RIGHT 0x104 >#define SL_KEY_PPAGE 0x105 >#define SL_KEY_NPAGE 0x106 >#define SL_KEY_HOME 0x107 >#define SL_KEY_END 0x108 >#define SL_KEY_A1 0x109 >#define SL_KEY_A3 0x10A >#define SL_KEY_B2 0x10B >#define SL_KEY_C1 0x10C >#define SL_KEY_C3 0x10D >#define SL_KEY_REDO 0x10E >#define SL_KEY_UNDO 0x10F >#define SL_KEY_BACKSPACE 0x110 >#define SL_KEY_ENTER 0x111 >#define SL_KEY_IC 0x112 >#define SL_KEY_DELETE 0x113 > >#define SL_KEY_F0 0x200 >#define SL_KEY_F(X) (SL_KEY_F0 + X) > >/* I do not intend to use keysymps > 0x1000. Applications can use those. */ >/* Returns 0 upon success or -1 upon error. */ >SL_EXTERN int SLkp_define_keysym (SLFUTURE_CONST char *, unsigned int); > >/* This function must be called AFTER SLtt_get_terminfo and not before. */ >SL_EXTERN int SLkp_init (void); > >/* By default, SLang_getkey is used as the low-level function. This hook > * allows you to specify something else. > */ >SL_EXTERN void SLkp_set_getkey_function (int (*)(void)); > >/* This function uses SLang_getkey and assumes that what ever initialization > * is required for SLang_getkey has been performed. If you do not want > * SLang_getkey to be used, then specify another function via > * SLkp_set_getkey_function. > */ >SL_EXTERN int SLkp_getkey (void); > >/*}}}*/ > >/*{{{ SLang Scroll Interface */ > >typedef struct _pSLscroll_Type >{ > struct _pSLscroll_Type *next; > struct _pSLscroll_Type *prev; > unsigned int flags; >} >SLscroll_Type; > >typedef struct >{ > unsigned int flags; > SLscroll_Type *top_window_line; /* list element at top of window */ > SLscroll_Type *bot_window_line; /* list element at bottom of window */ > SLscroll_Type *current_line; /* current list element */ > SLscroll_Type *lines; /* first list element */ > unsigned int nrows; /* number of rows in window */ > unsigned int hidden_mask; /* applied to flags in SLscroll_Type */ > unsigned int line_num; /* current line number (visible) */ > unsigned int num_lines; /* total number of lines (visible) */ > unsigned int window_row; /* row of current_line in window */ > unsigned int border; /* number of rows that form scroll border */ > int cannot_scroll; /* should window scroll or recenter */ >} >SLscroll_Window_Type; > >SL_EXTERN int SLscroll_find_top (SLscroll_Window_Type *); >SL_EXTERN int SLscroll_find_line_num (SLscroll_Window_Type *); >SL_EXTERN unsigned int SLscroll_next_n (SLscroll_Window_Type *, unsigned int); >SL_EXTERN unsigned int SLscroll_prev_n (SLscroll_Window_Type *, unsigned int); >SL_EXTERN int SLscroll_pageup (SLscroll_Window_Type *); >SL_EXTERN int SLscroll_pagedown (SLscroll_Window_Type *); > >/*}}}*/ > >/*{{{ Signal Routines */ > >typedef void SLSig_Fun_Type (int); >SL_EXTERN SLSig_Fun_Type *SLsignal (int, SLSig_Fun_Type *); >SL_EXTERN SLSig_Fun_Type *SLsignal_intr (int, SLSig_Fun_Type *); >SL_EXTERN int SLsig_block_signals (void); >SL_EXTERN int SLsig_unblock_signals (void); >SL_EXTERN int SLsystem (SLFUTURE_CONST char *); >SL_EXTERN int SLsystem_intr (SLFUTURE_CONST char *); > >/* Make a signal off-limits to the interpreter */ >SL_EXTERN int SLsig_forbid_signal (int); > >SL_EXTERN SLFUTURE_CONST char *SLerrno_strerror (int); >SL_EXTERN int SLerrno_set_errno (int); > >/*}}}*/ > >/* Functions for dealing with the FPU */ >SL_EXTERN void SLfpu_clear_except_bits (void); >SL_EXTERN unsigned int SLfpu_test_except_bits (unsigned int bits); >#define SL_FE_DIVBYZERO 0x01 >#define SL_FE_INVALID 0x02 >#define SL_FE_OVERFLOW 0x04 >#define SL_FE_UNDERFLOW 0x08 >#define SL_FE_INEXACT 0x10 >#define SL_FE_ALLEXCEPT 0x1F > >SL_EXTERN SLtype SLang_get_int_type (int nbits); >/* if nbits is negative it gets the signed int type, else unsigned int type */ >SL_EXTERN int SLang_get_int_size (SLtype); >/* Opposite of SLang_get_int_type */ > >/*{{{ Interpreter Macro Definitions */ > >/* The definitions here are for objects that may be on the run-time stack. > * They are actually sub_types of literal and data main_types. The actual > * numbers are historical. > */ >#define SLANG_UNDEFINED_TYPE 0x00 /* MUST be 0 */ >#define SLANG_VOID_TYPE 0x01 /* also matches ANY type */ >#define SLANG_NULL_TYPE (0x02) >#define SLANG_ANY_TYPE (0x03) >#define SLANG_DATATYPE_TYPE (0x04) >/* SLANG_REF_TYPE refers to an object on the stack that is a pointer (reference) > * to some other object. > */ >#define SLANG_REF_TYPE (0x05) >#define SLANG_STRING_TYPE (0x06) >#define SLANG_BSTRING_TYPE (0x07) >#define SLANG_FILE_PTR_TYPE (0x08) >#define SLANG_FILE_FD_TYPE (0x09) >#define SLANG_MD5_TYPE (0x0A) >#define SLANG_INTP_TYPE (0x0F) > >/* Integer types */ >/* The integer and floating point types are arranged in order of arithmetic > * precedence. > */ >#define SLANG_CHAR_TYPE (0x10) >#define SLANG_UCHAR_TYPE (0x11) >#define SLANG_SHORT_TYPE (0x12) >#define SLANG_USHORT_TYPE (0x13) >#define SLANG_INT_TYPE (0x14) >#define SLANG_UINT_TYPE (0x15) >#define SLANG_LONG_TYPE (0x16) >#define SLANG_ULONG_TYPE (0x17) >#define SLANG_LLONG_TYPE (0x18) >#define SLANG_ULLONG_TYPE (0x19) >/* floating point types */ >#define SLANG_FLOAT_TYPE (0x1A) >#define SLANG_DOUBLE_TYPE (0x1B) >#define SLANG_LDOUBLE_TYPE (0x1C) > >#define SLANG_COMPLEX_TYPE (0x20) > >/* An object of SLANG_INTP_TYPE should never really occur on the stack. Rather, > * the integer to which it refers will be there instead. It is defined here > * because it is a valid type for MAKE_VARIABLE. > */ > >/* Container types */ >#define SLANG_ISTRUCT_TYPE (0x2A) >#define SLANG_STRUCT_TYPE (0x2B) >#define SLANG_ASSOC_TYPE (0x2C) >#define SLANG_ARRAY_TYPE (0x2D) >#define SLANG_LIST_TYPE (0x2E) > >#define SLANG_MIN_UNUSED_TYPE (0x30) > >/* Compatibility */ >#ifdef FLOAT_TYPE ># undef FLOAT_TYPE >#endif ># 2166 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#define VOID_TYPE SLANG_VOID_TYPE >#define INT_TYPE SLANG_INT_TYPE >#define INTP_TYPE SLANG_INTP_TYPE >#define FLOAT_TYPE SLANG_DOUBLE_TYPE >#define ARRAY_TYPE SLANG_ARRAY_TYPE >#define CHAR_TYPE SLANG_CHAR_TYPE >#define STRING_TYPE SLANG_STRING_TYPE > >/* I am reserving values greater than or equal to 128 for user applications. > * The first 127 are reserved for S-Lang. > */ > >/* Binary and Unary Subtypes */ >/* Since the application can define new types and can overload the binary > * and unary operators, these definitions must be present in this file. > * The current implementation assumes both unary and binary are distinct. > */ >#define SLANG_BINARY_OP_MIN 0x01 >#define SLANG_PLUS 0x01 >#define SLANG_MINUS 0x02 >#define SLANG_TIMES 0x03 >#define SLANG_DIVIDE 0x04 >#define SLANG_EQ 0x05 >#define SLANG_NE 0x06 >#define SLANG_GT 0x07 >#define SLANG_GE 0x08 >#define SLANG_LT 0x09 >#define SLANG_LE 0x0A >#define SLANG_POW 0x0B >#define SLANG_OR 0x0C >#define SLANG_AND 0x0D >#define SLANG_BAND 0x0E >#define SLANG_BOR 0x0F >#define SLANG_BXOR 0x10 >#define SLANG_SHL 0x11 >#define SLANG_SHR 0x12 >#define SLANG_MOD 0x13 >#define SLANG_BINARY_OP_MAX 0x13 > >/* UNARY subtypes (may be overloaded) */ >#define SLANG_UNARY_OP_MIN 0x20 > >#define SLANG_PLUSPLUS 0x20 >#define SLANG_MINUSMINUS 0x21 >#define SLANG_CHS 0x22 >#define SLANG_NOT 0x23 >#define SLANG_BNOT 0x24 >/* These are implemented as unary function calls */ >#define SLANG_ABS 0x25 >#define SLANG_SIGN 0x26 >#define SLANG_SQR 0x27 >#define SLANG_MUL2 0x28 >#define SLANG_ISPOS 0x29 >#define SLANG_ISNEG 0x2A >#define SLANG_ISNONNEG 0x2B > >#define SLANG_UNARY_OP_MAX 0x2B > >/* SL_EXTERN SLFUTURE_CONST char *SLang_Error_Message; */ > >SL_EXTERN int SLadd_intrinsic_variable (SLFUTURE_CONST char *, VOID_STAR, SLtype, int); >SL_EXTERN int SLadd_intrinsic_function (SLFUTURE_CONST char *, FVOID_STAR, SLtype, unsigned int,...); > >SL_EXTERN int SLns_add_intrinsic_variable (SLang_NameSpace_Type *, SLFUTURE_CONST char *, VOID_STAR, SLtype, int); >SL_EXTERN int SLns_add_intrinsic_function (SLang_NameSpace_Type *, SLFUTURE_CONST char *, FVOID_STAR, SLtype, unsigned int,...); > >/* These functions are used to patch intrinsic tables that make use of > * dynamically allocated types whose type id is determined at > * run-time. The second version is useful for the most common case of a > * single mapping. > */ >SL_EXTERN int SLclass_patch_intrin_fun_table (SLang_Intrin_Fun_Type *table, > SLtype *from_types, SLtype *to_types, unsigned int num); >SL_EXTERN int SLclass_patch_intrin_fun_table1 (SLang_Intrin_Fun_Type *table, > SLtype from_type, SLtype to_type); > >#define MAKE_INTRINSIC_N(n,f,out,in,a1,a2,a3,a4,a5,a6,a7) \ > {(n), NULL, SLANG_INTRINSIC, (FVOID_STAR) (f), \ > {a1,a2,a3,a4,a5,a6,a7}, (in), (out)} > >#define MAKE_INTRINSIC_7(n,f,out,a1,a2,a3,a4,a5,a6,a7) \ > MAKE_INTRINSIC_N(n,f,out,7,a1,a2,a3,a4,a5,a6,a7) >#define MAKE_INTRINSIC_6(n,f,out,a1,a2,a3,a4,a5,a6) \ > MAKE_INTRINSIC_N(n,f,out,6,a1,a2,a3,a4,a5,a6,0) >#define MAKE_INTRINSIC_5(n,f,out,a1,a2,a3,a4,a5) \ > MAKE_INTRINSIC_N(n,f,out,5,a1,a2,a3,a4,a5,0,0) >#define MAKE_INTRINSIC_4(n,f,out,a1,a2,a3,a4) \ > MAKE_INTRINSIC_N(n,f,out,4,a1,a2,a3,a4,0,0,0) >#define MAKE_INTRINSIC_3(n,f,out,a1,a2,a3) \ > MAKE_INTRINSIC_N(n,f,out,3,a1,a2,a3,0,0,0,0) >#define MAKE_INTRINSIC_2(n,f,out,a1,a2) \ > MAKE_INTRINSIC_N(n,f,out,2,a1,a2,0,0,0,0,0) >#define MAKE_INTRINSIC_1(n,f,out,a1) \ > MAKE_INTRINSIC_N(n,f,out,1,a1,0,0,0,0,0,0) >#define MAKE_INTRINSIC_0(n,f,out) \ > MAKE_INTRINSIC_N(n,f,out,0,0,0,0,0,0,0,0) > >#define MAKE_INTRINSIC_S(n,f,r) \ > MAKE_INTRINSIC_1(n,f,r,SLANG_STRING_TYPE) >#define MAKE_INTRINSIC_I(n,f,r) \ > MAKE_INTRINSIC_1(n,f,r,SLANG_INT_TYPE) > >#define MAKE_INTRINSIC_SS(n,f,r) \ > MAKE_INTRINSIC_2(n,f,r,SLANG_STRING_TYPE,SLANG_STRING_TYPE) >#define MAKE_INTRINSIC_SI(n,f,r) \ > MAKE_INTRINSIC_2(n,f,r,SLANG_STRING_TYPE,SLANG_INT_TYPE) >#define MAKE_INTRINSIC_IS(n,f,r) \ > MAKE_INTRINSIC_2(n,f,r,SLANG_INT_TYPE,SLANG_STRING_TYPE) >#define MAKE_INTRINSIC_II(n,f,r) \ > MAKE_INTRINSIC_2(n,f,r,SLANG_INT_TYPE,SLANG_INT_TYPE) > >#define MAKE_INTRINSIC_SSS(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_STRING_TYPE,SLANG_STRING_TYPE,SLANG_STRING_TYPE) >#define MAKE_INTRINSIC_SSI(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_STRING_TYPE,SLANG_STRING_TYPE,SLANG_INT_TYPE) >#define MAKE_INTRINSIC_SIS(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_STRING_TYPE,SLANG_INT_TYPE,SLANG_STRING_TYPE) >#define MAKE_INTRINSIC_SII(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_STRING_TYPE,SLANG_INT_TYPE,SLANG_INT_TYPE) >#define MAKE_INTRINSIC_ISS(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_INT_TYPE,SLANG_STRING_TYPE,SLANG_STRING_TYPE) >#define MAKE_INTRINSIC_ISI(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_INT_TYPE,SLANG_STRING_TYPE,SLANG_INT_TYPE) >#define MAKE_INTRINSIC_IIS(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_INT_TYPE,SLANG_INT_TYPE,SLANG_STRING_TYPE) >#define MAKE_INTRINSIC_III(n,f,r) \ > MAKE_INTRINSIC_3(n,f,r,SLANG_INT_TYPE,SLANG_INT_TYPE,SLANG_INT_TYPE) > >#define MAKE_INTRINSIC(n, f, out, in) \ > MAKE_INTRINSIC_N(n,f,out,in,0,0,0,0,0,0,0) > >#define MAKE_VARIABLE(n, v, t, r) \ > {n, NULL, SLANG_IVARIABLE + (r), (VOID_STAR)(v), (t)} > >#define MAKE_APP_UNARY(n,op) \ > {(n), NULL, SLANG_APP_UNARY, (op)} > >#define MAKE_ARITH_UNARY(n,op) \ > {(n), NULL, SLANG_ARITH_UNARY, (op)} > >#define MAKE_ARITH_BINARY(n,op) \ > {(n), NULL, SLANG_ARITH_BINARY, (op)} > >#define MAKE_MATH_UNARY(n,op) \ > {(n), NULL, SLANG_MATH_UNARY, (op)} > >#define MAKE_HCONSTANT_T(n,val,T) \ > {(n),NULL, SLANG_HCONSTANT, T, (short)(val)} >#define MAKE_HCONSTANT(n,val) MAKE_HCONSTANT_T(n,val,SLANG_SHORT_TYPE) > >#define MAKE_ICONSTANT_T(n,val,T) \ > {(n),NULL, SLANG_ICONSTANT, T, (int)(val)} >#define MAKE_ICONSTANT(n,val) MAKE_ICONSTANT_T(n,val,SLANG_INT_TYPE) > >#define MAKE_LCONSTANT_T(n,val,T) \ > {(n),NULL, SLANG_LCONSTANT, T, (long)(val)} >#define MAKE_LCONSTANT(n,val) MAKE_LCONSTANT_T(n,val,SLANG_LONG_TYPE) > >#ifdef HAVE_LONG_LONG ># define MAKE_LLCONSTANT_T(n,val,T) \ > {(n),NULL, T, (long long)(val)} ># define MAKE_LLCONSTANT(n,val) MAKE_LLCONSTANT_T(n,val,SLANG_LLONG_TYPE) >#endif ># 2329 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#define MAKE_FCONSTANT(n,val) \ > {(n),NULL, SLANG_FCONSTANT, (val)} > >#define MAKE_DCONSTANT(n,val) \ > {(n),NULL, SLANG_DCONSTANT, (val)} > >#ifndef offsetof ># define offsetof(T,F) ((unsigned int)((char *)&((T *)0L)->F - (char *)0L)) >#endif ># 2339 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#define MAKE_ISTRUCT_FIELD(s,f,n,t,r) {(n), offsetof(s,f), (t), (r)} >#define MAKE_CSTRUCT_FIELD(s,f,n,t,r) {(n), offsetof(s,f), (t), (r)} > >#define MAKE_CSTRUCT_INT_FIELD(s,f,n,r) {(n), offsetof(s,f),\ > (sizeof(((s*)0L)->f)==sizeof(int))?(SLANG_INT_TYPE): \ > (sizeof(((s*)0L)->f)==sizeof(short))?(SLANG_SHORT_TYPE): \ > (sizeof(((s*)0L)->f)==sizeof(char))?(SLANG_CHAR_TYPE): \ > (sizeof(((s*)0L)->f)==sizeof(long))?(SLANG_LONG_TYPE): \ > SLANG_LLONG_TYPE, (r)\ >} >#define MAKE_CSTRUCT_UINT_FIELD(s,f,n,r) {(n), offsetof(s,f),\ > (sizeof(((s*)0L)->f)==sizeof(int))?(SLANG_UINT_TYPE): \ > (sizeof(((s*)0L)->f)==sizeof(short))?(SLANG_USHORT_TYPE): \ > (sizeof(((s*)0L)->f)==sizeof(char))?(SLANG_UCHAR_TYPE): \ > (sizeof(((s*)0L)->f)==sizeof(long))?(SLANG_ULONG_TYPE): \ > SLANG_ULLONG_TYPE, (r)\ >} > >#define MAKE_CSTRUCT_FLOAT_FIELD(s,f,n,r) {(n), offsetof(s,f),\ > (sizeof(((s*)0L)->f)==sizeof(float))?(SLANG_FLOAT_TYPE): \ > SLANG_DOUBLE_TYPE, (r)\ >} > >#define SLANG_END_TABLE {NULL} >#define SLANG_END_INTRIN_FUN_TABLE MAKE_INTRINSIC_0(NULL,NULL,0) >#define SLANG_END_FCONST_TABLE MAKE_DCONSTANT(NULL,0) >#define SLANG_END_DCONST_TABLE MAKE_DCONSTANT(NULL,0) >#define SLANG_END_MATH_UNARY_TABLE MAKE_MATH_UNARY(NULL,0) >#define SLANG_END_ARITH_UNARY_TABLE MAKE_ARITH_UNARY(NULL,0) >#define SLANG_END_ARITH_BINARY_TABLE MAKE_ARITH_BINARY(NULL,0) >#define SLANG_END_APP_UNARY_TABLE MAKE_APP_UNARY(NULL,0) >#define SLANG_END_INTRIN_VAR_TABLE MAKE_VARIABLE(NULL,NULL,0,0) >#define SLANG_END_ICONST_TABLE MAKE_ICONSTANT(NULL,0) >#define SLANG_END_LCONST_TABLE MAKE_LCONSTANT(NULL,0) >#define SLANG_END_LLCONST_TABLE MAKE_LLCONSTANT(NULL,0) >#define SLANG_END_ISTRUCT_TABLE {NULL, 0, 0, 0} >#define SLANG_END_CSTRUCT_TABLE {NULL, 0, 0, 0} > >/*}}}*/ > >/*{{{ Upper/Lowercase Functions */ > >SL_EXTERN void SLang_define_case(int *, int *); >SL_EXTERN void SLang_init_case_tables (void); > >SL_EXTERN unsigned char _pSLChg_UCase_Lut[256]; >SL_EXTERN unsigned char _pSLChg_LCase_Lut[256]; >#define UPPER_CASE(x) (_pSLChg_UCase_Lut[(unsigned char) (x)]) >#define LOWER_CASE(x) (_pSLChg_LCase_Lut[(unsigned char) (x)]) >#define CHANGE_CASE(x) (((x) == _pSLChg_LCase_Lut[(unsigned char) (x)]) ?\ > _pSLChg_UCase_Lut[(unsigned char) (x)] : _pSLChg_LCase_Lut[(unsigned char) (x)]) > >/*}}}*/ > >/*{{{ Regular Expression Interface */ >typedef struct _pSLRegexp_Type SLRegexp_Type; >SL_EXTERN SLRegexp_Type *SLregexp_compile (SLFUTURE_CONST char *pattern, unsigned int flags); >#define SLREGEXP_CASELESS 0x01 >#define SLREGEXP_UTF8 0x10 > >SL_EXTERN void SLregexp_free (SLRegexp_Type *); >SL_EXTERN char *SLregexp_match (SLRegexp_Type *compiled_regexp, SLFUTURE_CONST char *str, SLstrlen_Type len); >SL_EXTERN int SLregexp_nth_match (SLRegexp_Type *, unsigned int nth, SLstrlen_Type *ofsp, SLstrlen_Type *lenp); > >SL_EXTERN int SLregexp_get_hints (SLRegexp_Type *, unsigned int *flagsp); >#define SLREGEXP_HINT_BOL 0x01 /* pattern must match bol */ >#define SLREGEXP_HINT_OSEARCH 0x02 /* ordinary search will do */ > >SL_EXTERN char *SLregexp_quote_string (SLFUTURE_CONST char *pattern, char *buf, unsigned int buflen); > >/*}}}*/ > >/*{{{ SLang Command Interface */ > >struct _pSLcmd_Cmd_Type; /* Pre-declaration is needed below */ >typedef struct >{ > struct _pSLcmd_Cmd_Type *table; > int argc; > /* Version 2.0 needs to use a union!! */ > SLFUTURE_CONST char **string_args; > int *int_args; > double *double_args; > SLtype *arg_type; > unsigned long reserved[4]; >} SLcmd_Cmd_Table_Type; > >typedef struct _pSLcmd_Cmd_Type >{ > int (*cmdfun)(int, SLcmd_Cmd_Table_Type *); > SLFUTURE_CONST char *cmd; > SLFUTURE_CONST char *arg_type; >} SLcmd_Cmd_Type; > >SL_EXTERN int SLcmd_execute_string (SLFUTURE_CONST char *, SLcmd_Cmd_Table_Type *); > >/*}}}*/ > >/*{{{ SLang Search Interface */ > >typedef struct _pSLsearch_Type SLsearch_Type; >SL_EXTERN SLsearch_Type *SLsearch_new (SLuchar_Type *u, int search_flags); >#define SLSEARCH_CASELESS 0x1 >#define SLSEARCH_UTF8 0x2 > >SL_EXTERN void SLsearch_delete (SLsearch_Type *); > >SL_EXTERN SLuchar_Type *SLsearch_forward (SLsearch_Type *st, > SLuchar_Type *pmin, SLuchar_Type *pmax); >SL_EXTERN SLuchar_Type *SLsearch_backward (SLsearch_Type *st, > SLuchar_Type *pmin, SLuchar_Type *pstart, SLuchar_Type *pmax); >SL_EXTERN SLstrlen_Type SLsearch_match_len (SLsearch_Type *); > >/*}}}*/ > >/*{{{ SLang Pathname Interface */ > >/* These function return pointers to the original space */ >SL_EXTERN char *SLpath_basename (SLFUTURE_CONST char *); >SL_EXTERN char *SLpath_extname (SLFUTURE_CONST char *); > >SL_EXTERN int SLpath_is_absolute_path (SLFUTURE_CONST char *); > >/* Get and set the character delimiter for search paths */ >SL_EXTERN int SLpath_get_delimiter (void); >SL_EXTERN int SLpath_set_delimiter (int); > >/* search path for loading .sl files */ >SL_EXTERN int SLpath_set_load_path (SLFUTURE_CONST char *); >/* search path for loading .sl files --- returns slstring */ >SL_EXTERN char *SLpath_get_load_path (void); > >/* These return malloced strings--- NOT slstrings */ >SL_EXTERN char *SLpath_dircat (SLFUTURE_CONST char *, SLFUTURE_CONST char *); >SL_EXTERN char *SLpath_find_file_in_path (SLFUTURE_CONST char *, SLFUTURE_CONST char *); >SL_EXTERN char *SLpath_dirname (SLFUTURE_CONST char *); >SL_EXTERN int SLpath_file_exists (SLFUTURE_CONST char *); >SL_EXTERN char *SLpath_pathname_sans_extname (SLFUTURE_CONST char *); >SL_EXTERN char *SLpath_getcwd (void); /* return NULL on error, sets errno */ > >/*}}}*/ > >SL_EXTERN int SLang_set_module_load_path (SLFUTURE_CONST char *); > >#ifdef __cplusplus ># define SLANG_MODULE(name) \ > extern SL_EXPORT "C" int init_##name##_module_ns (char *); \ > extern SL_EXPORT "C" void deinit_##name##_module (void); \ > extern SL_EXPORT "C" int SLmodule_##name##_api_version; \ > SL_EXPORT int SLmodule_##name##_api_version = SLANG_VERSION >#else ># 2491 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># define SLANG_MODULE(name) \ > extern SL_EXPORT int init_##name##_module_ns (char *); \ > extern SL_EXPORT void deinit_##name##_module (void); \ > SL_EXPORT int SLmodule_##name##_api_version = SLANG_VERSION >#endif ># 2496 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >SL_EXTERN int SLvsnprintf (char *, unsigned int, SLFUTURE_CONST char *, va_list); >SL_EXTERN int SLsnprintf (char *, unsigned int, SLFUTURE_CONST char *, ...) SLATTRIBUTE_PRINTF(3,4); > >#if 0 >{ >#endif ># 2503 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" >#ifdef __cplusplus >} >#endif ># 2506 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" > >#endif /* DAVIS_SLANG_H_ */ ># 2508 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/slang.h" ># 27 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 2 > >#if 0 /* expanded by -frewrite-includes */ >#include "_slint.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" 1 >#ifndef PRIVATE_SLINT_H_ ># define PRIVATE_SLINT_H_ > >/* This file defines macros and types for ints of various types. > * Eventually it will make use of stdint.h. > */ > >/* If long or short are ints, then map the slang types to ints. This is > * done because slang has some optimizations for ints. > */ >#define LONG_IS_INT (SIZEOF_INT == SIZEOF_LONG) >#define LONG_IS_NOT_INT (SIZEOF_INT != SIZEOF_LONG) >#define SHORT_IS_INT (SIZEOF_INT == SIZEOF_SHORT) >#define SHORT_IS_NOT_INT (SIZEOF_INT != SIZEOF_SHORT) >#define LLONG_IS_LONG (SIZEOF_LONG == SIZEOF_LONG_LONG) >#define LLONG_IS_NOT_LONG (SIZEOF_LONG != SIZEOF_LONG_LONG) > >#if LONG_IS_INT ># define _pSLANG_LONG_TYPE SLANG_INT_TYPE ># define _pSLANG_ULONG_TYPE SLANG_UINT_TYPE >#else ># 22 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define _pSLANG_LONG_TYPE SLANG_LONG_TYPE ># define _pSLANG_ULONG_TYPE SLANG_ULONG_TYPE >#endif ># 25 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >#if SHORT_IS_INT ># define _pSLANG_SHORT_TYPE SLANG_INT_TYPE ># define _pSLANG_USHORT_TYPE SLANG_UINT_TYPE >#else ># 29 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define _pSLANG_SHORT_TYPE SLANG_SHORT_TYPE ># define _pSLANG_USHORT_TYPE SLANG_USHORT_TYPE >#endif ># 32 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >#if LLONG_IS_LONG ># define _pSLANG_LLONG_TYPE _pSLANG_LONG_TYPE ># define _pSLANG_ULLONG_TYPE _pSLANG_ULONG_TYPE >#else ># 36 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define _pSLANG_LLONG_TYPE SLANG_LLONG_TYPE ># define _pSLANG_ULLONG_TYPE SLANG_ULLONG_TYPE >#endif ># 39 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" > >/* Map off_t to a slang type */ >#if defined(HAVE_LONG_LONG) && (SIZEOF_OFF_T == SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG > SIZEOF_LONG) ># define SLANG_C_OFF_T_TYPE _pSLANG_LLONG_TYPE >typedef long long _pSLc_off_t_Type; ># define SLANG_PUSH_OFF_T SLang_push_long_long >#else ># 46 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if (SIZEOF_OFF_T == SIZEOF_INT) ># define SLANG_C_OFF_T_TYPE SLANG_INT_TYPE ># define SLANG_PUSH_OFF_T SLang_push_int >typedef int _pSLc_off_t_Type; ># else ># 51 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define SLANG_C_OFF_T_TYPE _pSLANG_LONG_TYPE ># define SLANG_PUSH_OFF_T SLang_push_long >typedef long _pSLc_off_t_Type; ># endif ># 55 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >#endif ># 56 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" > >#if SIZEOF_INT == 2 ># define _pSLANG_INT16_TYPE SLANG_INT_TYPE ># define _pSLANG_UINT16_TYPE SLANG_UINT_TYPE >typedef int _pSLint16_Type; >typedef unsigned int _pSLuint16_Type; >#else ># 63 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if SIZEOF_SHORT == 2 ># define _pSLANG_INT16_TYPE SLANG_SHORT_TYPE ># define _pSLANG_UINT16_TYPE SLANG_USHORT_TYPE >typedef short _pSLint16_Type; >typedef unsigned short _pSLuint16_Type; ># else ># 69 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if SIZEOF_LONG == 2 ># define _pSLANG_INT16_TYPE SLANG_LONG_TYPE ># define _pSLANG_UINT16_TYPE SLANG_ULONG_TYPE >typedef long _pSLInt16_Type; >typedef unsigned long _pSLuint16_Type; ># else ># 75 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define _pSLANG_INT16_TYPE 0 ># define _pSLANG_UINT16_TYPE 0 ># endif ># 78 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># endif ># 79 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >#endif ># 80 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" > >#if SIZEOF_INT == 4 ># define _pSLANG_INT32_TYPE SLANG_INT_TYPE ># define _pSLANG_UINT32_TYPE SLANG_UINT_TYPE >typedef int _pSLint32_Type; >typedef unsigned int _pSLuint32_Type; >#else ># 87 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if SIZEOF_SHORT == 4 ># define _pSLANG_INT32_TYPE SLANG_SHORT_TYPE ># define _pSLANG_UINT32_TYPE SLANG_USHORT_TYPE >typedef short _pSLInt32_Type; >typedef unsigned short _pSLuint32_Type; ># else ># 93 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if SIZEOF_LONG == 4 ># define _pSLANG_INT32_TYPE SLANG_LONG_TYPE ># define _pSLANG_UINT32_TYPE SLANG_ULONG_TYPE >typedef long _pSLInt32_Type; >typedef unsigned long _pSLuint32_Type; ># else ># 99 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define _pSLANG_INT32_TYPE 0 ># define _pSLANG_UINT32_TYPE 0 ># endif ># 102 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># endif ># 103 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >#endif ># 104 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" > >#if SIZEOF_INT == 8 ># define _pSLANG_INT64_TYPE SLANG_INT_TYPE ># define _pSLANG_UINT64_TYPE SLANG_UINT_TYPE >typedef int _pSLint64_Type; >typedef unsigned int _pSLuint64_Type; >#else ># 111 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if SIZEOF_SHORT == 8 ># define _pSLANG_INT64_TYPE SLANG_SHORT_TYPE ># define _pSLANG_UINT64_TYPE SLANG_USHORT_TYPE >typedef int _pSLint64_Type; >typedef unsigned int _pSLuint64_Type; ># else ># 117 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if SIZEOF_LONG == 8 ># define _pSLANG_INT64_TYPE SLANG_LONG_TYPE ># define _pSLANG_UINT64_TYPE SLANG_ULONG_TYPE >typedef long _pSLint64_Type; >typedef unsigned long _pSLuint64_Type; ># else ># 123 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># if SIZEOF_LONG_LONG == 8 ># define _pSLANG_INT64_TYPE SLANG_LLONG_TYPE ># define _pSLANG_UINT64_TYPE SLANG_ULLONG_TYPE >typedef long long _pSLint64_Type; >typedef unsigned long long _pSLuint64_Type; ># else ># 129 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define _pSLANG_INT64_TYPE 0 ># define _pSLANG_UINT64_TYPE 0 ># endif ># 132 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># endif ># 133 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># endif ># 134 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >#endif ># 135 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" > >/* The following are commented out because they are not used by the library */ >/* extern int _pSLang_pop_int16 (_pSLint16_Type *); */ >/* extern int _pSLang_pop_uint16 (_pSLuint16_Type *); */ >/* extern int _pSLang_pop_int32 (_pSLint32_Type *); */ >/* extern int _pSLang_pop_uint32 (_pSLuint32_Type *); */ >#if _pSLANG_INT64_TYPE >extern int _pSLang_pop_int64(_pSLint64_Type *); >extern int _pSLang_pop_uint64 (_pSLuint64_Type *); >#endif ># 145 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >/* extern int _pSLang_push_int16 (_pSLint16_Type); */ >/* extern int _pSLang_push_uint16 (_pSLuint16_Type); */ >/* extern int _pSLang_push_int32 (_pSLint32_Type); */ >/* extern int _pSLang_push_uint32 (_pSLuint32_Type); */ >#if _pSLANG_INT64_TYPE >/* extern int _pSLang_push_int64(_pSLint64_Type); */ >/* extern int _pSLang_push_uint64 (_pSLuint64_Type); */ >#endif ># 153 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" > >#ifdef HAVE_LONG_LONG ># ifdef __WIN32__ ># define SLFMT_LLD "%I64d" ># define SLFMT_LLU "%I64u" ># else ># 159 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># define SLFMT_LLD "%lld" ># define SLFMT_LLU "%llu" ># endif ># 162 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" >#endif ># 163 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" > >#endif /* PRIVATE_SLINT_H_ */ ># 165 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/src/_slint.h" ># 29 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 2 >#if 0 /* expanded by -frewrite-includes */ >#include "stats-module.h" >#endif /* expanded by -frewrite-includes */ ># 1 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats-module.h" 1 >#ifndef SLSTATS_MODULE_H_ ># define SLSTATS_MODULE_H_ 1 >/* >Copyright (C) 2017,2018 John E. Davis > >This file is part of the S-Lang Library. > >The S-Lang Library 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. > >The S-Lang Library 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 library; if not, write to the Free Software >Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, >USA. >*/ > >/* It is assumed that the array a has already been sorted in ascending or and that b > * has been rearranged accordingly > */ >extern double _pSLstats_kendall_tau (SLindex_Type *a, SLindex_Type *b, size_t n, double *taup); > >#endif /* SLSTATS_MODULE_H_ */ ># 30 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats-module.h" ># 30 "/home/usr/ports/devel/libslang2/work/slang-2.3.2/modules/stats_kendall.c" 2 > >static double alnorm (double x, int use_upper) >{ > double cdf; > cdf = 0.5 * (1.0 + erf (x/sqrt(2.0))); > if (use_upper) return 1.0 - cdf; > return cdf; >} > >static int prtaus_large_n (_pSLint64_Type is, _pSLint64_Type n, double *probp) >{ > double h[15]; > double x, r, sc, p; > int i; > > /* PROBABILITIES CALCULATED BY MODIFIED EDGEWORTH SERIES FOR N GREATER THAN 8 */ > /* CALCULATION OF TCHEBYCHEFF-HERMITE POLYNOMIALS */ > x = (is-1.0) / sqrt((6.0 + n*(5.0-n*(3.0+2*n)))/(-18.0)); > h[0] = x; > h[1] = x*x - 1.0; > for (i = 2; i < 15; i++) > { > h[i] = x * h[i-1] - (i-1.0)*h[i-2]; > } > > r = 1.0 / n; > sc = r*(h[2]*(r*(r*(r*0.506f - 0.5325f) + 0.045f) - 0.09f) > + r*(h[4]*(r*(r*0.3214f - 0.036735f) + 0.036735f) > + h[6]*(r*(r*0.07787f - 0.023336f) + 0.00405f) > + r*(h[8]*(-.0033061f - r*0.0065166f) > + h[10]*(r*0.0025927f - 1.215e-4f) > + r*(h[12]*1.4878e-4f + h[14]*2.7338e-6f)))); > > p = alnorm (x,1) + sc*0.398942*exp(-0.5*x*x); > if (p < 0.0) p = 0.0; > if (p > 1.0) p = 1.0; > *probp = p; > > return 0; >} > > >/* > * ALGORITHM AS 71 APPL. STATIST. (1974) VOL.23, NO.1 > * > * GIVEN A VALUE OF IS CALCULATED FROM TWO RANKINGS (WITHOUT TIES) > * OF N OBJECTS, THE FUNCTION COMPUTES THE PROBABILITY OF > * OBTAINING A VALUE GREATER THAN, OR EQUAL TO, IS. > * > */ >static int prtaus (_pSLint64_Type is, _pSLint64_Type n, double *probp) >{ >#define MAX_N_EXACT 30 >#define MAX_L_COLS ((MAX_N_EXACT)*(MAX_N_EXACT-1)/4 + 2) > _pSLint64_Type row0[MAX_L_COLS]; /* allow 1-based indexing */ > _pSLint64_Type row1[MAX_L_COLS]; /* allow 1-based indexing */ > _pSLint64_Type *curr, *prev; > _pSLint64_Type i, il, k, m, im; > > if (n > MAX_N_EXACT) > return prtaus_large_n (is, n, probp); > > /* Use recurrence relation for n <= MAX_N_EXACT */ > > *probp = 1.0; > > m = n*(n-1)/2; > if (is >= 0) m -= is; else m += is; > if ((m == 0) && (is <= 0)) return 0; > > if (is < 0) m = m - 2; > im = m/2; > > memset (row0, 0, (im+1)*sizeof(_pSLint64_Type)); > memset (row1, 0, (im+1)*sizeof(_pSLint64_Type)); > prev = row0; prev[0] = 1; > curr = row1; curr[0] = 1; > > il = 0; > i = 1; > m = 1; > while (i < n) > { > _pSLint64_Type *tmp; > _pSLint64_Type in, io; > > tmp = curr; curr = prev; prev = tmp; > il += i; > i++; > m = m*i; > k = (im < il) ? im : il; > > k++; > in = 1; > io = (i <= k) ? i : k; > while (in < io) > { > curr[in] = curr[in-1] + prev[in]; > in++; > } > io = 0; > while (in < k) > { > curr[in] = curr[in-1] + prev[in] - prev[io]; > io++; > in++; > } > } > > k = 0; > for (i = 0; i <= im; i++) > k += curr[i]; > > *probp = ((double) k)/m; > if (is < 0) *probp = 1.0 - *probp; > > return 0; >} > >static _pSLuint64_Type kendall_insertion_sort (SLindex_Type *arr, size_t num) >{ > size_t maxj, i; > _pSLuint64_Type nexch; > > if (num < 2) return 0; > > nexch = 0; > i = maxj = num - 1; > while (i--) > { > size_t j = i; > SLindex_Type val = arr[i]; > > while ((j < maxj) && (arr[j+1] < val)) > { > arr[j] = arr[j+1]; > j++; > } > arr[j] = val; > nexch += (j - i); > } > return nexch; >} > >static _pSLuint64_Type kendall_merge (SLindex_Type *left, size_t left_num, > SLindex_Type *right, size_t right_num, > SLindex_Type *work) >{ > _pSLuint64_Type nexch = 0; > > while (left_num && right_num) > { > if (*right < *left) > { > *work++ = *right++; > right_num--; > nexch += left_num; > continue; > } > > *work++ = *left++; > left_num--; > } > > if (left_num) > memcpy(work, left, left_num * sizeof(SLindex_Type)); > else if (right_num) > memcpy(work, right, right_num * sizeof(SLindex_Type)); > > return nexch; >} > >static _pSLuint64_Type kendall_merge_sort(SLindex_Type *a, size_t num, SLindex_Type *work) >{ > _pSLuint64_Type nexch; > size_t left_num, right_num; > SLindex_Type *left, *right; > > if (num < 8) > return kendall_insertion_sort (a, num); > > left = a; > left_num = num/2; > right = a + left_num; > right_num = num - left_num; > > nexch = kendall_merge_sort(left, left_num, work); > nexch += kendall_merge_sort(right, right_num, work); > nexch += kendall_merge(left, left_num, right, right_num, work); > > memcpy(a, work, num * sizeof(SLindex_Type)); > return nexch; >} > >/* This also computes the quantities needed for the p-value. From wikipedia: > * v = sum(x*(x-1)*(2*x+5)) > * v1 = sum (x*(x-1)) > * v2 = sum(x*(x-1)*(x-2)) > * where x is the number of tied values in a group. > */ >static _pSLuint64_Type >kendall_count_tied_pairs (SLindex_Type *a, size_t num, > _pSLuint64_Type *v, _pSLuint64_Type *v1, _pSLuint64_Type *v2) >{ > _pSLuint64_Type n = 0; > size_t i; > > i = 1; > while (i < num) > { > _pSLuint64_Type di, dn; > size_t i0; > > if (a[i] != a[i-1]) > { > i++; > continue; > } > > /* In a group with ties */ > i0 = i-1; > i++; > while ((i < num) && (a[i] == a[i-1])) > i++; > > di = i-i0; > dn = di*(di-1); > *v1 += dn; > *v2 += dn*(di-2); > *v += dn * (2*di+5); > n += dn/2; > > i++; > } > > return n; >} > >/* > * This function assumes that the input arrays are sorted on the first array. > * That is, the slang code that wraps this will have to do: > * > * i = array_sort (a); > * a = a[i]; b = [i]; > * > * The basic idea is the following: > * > * The total number of pairs formed from an array of size N is > * n0 = N*(N-1)/2. Consider 2 such arrays A and B. Then consider the ith and > * jth elemnts of the arrays, where j>i. One of the following will be true: > * > * A[i]>A[j] and B[i]>B[j] "concordent" > * A[i]<A[j] and B[i]<B[j] "concordent" > * A[i]>A[j] and B[i]<B[j] "disconcordent" > * A[i]<A[j] and B[i]>B[j] "disconcordent" > * A[i]=A[j] and B[i]!=B[j] "A is tied" > * A[i]!=A[j] and B[i]=B[j] "B is tied" > * A[i]=A[j] and B[i]=B[j] "joint tie" > * > * Then: n0 = nc + nd + (t + v) + u > * n0 = nc + nd + (u + v) + t > * where nc=num concordent, nd = num disconcordent, t=A ties, u=B ties, v=joint ties > * > * Let t+v = nA = total number of ties in A (includes joint) > * u+v = nB = total number of ties in B (includes joint) > * Then: n0 = nc + nd + nA + u > * > * nc + nd = n0 - nA - u > * = n0 - nA - (nB - v) > * = n0 + v - (nA + nB) > * Knight indicates that nd is equal to the number of exchanges (ne) in sorting B. > * Hence: > * > * nc - nd = (nc + nd) - 2*ne > * = (n0 + v) - (nA + nB + 2*ne) > */ >double _pSLstats_kendall_tau (SLindex_Type *a, SLindex_Type *b, size_t num, double *taup) >{ > double tau, sigma, prob; > _pSLuint64_Type n0, na, nb, ne, v; > _pSLuint64_Type va, va1, va2, vb, vb1, vb2; > size_t i; > > n0 = num; > n0 = n0*(n0-1)/2; > > na = v = 0; > va = va1 = va2 = 0; > vb = vb1 = vb2 = 0; > > i = 1; > while (i < num) > { > _pSLuint64_Type di; > size_t i0; > > if (a[i-1] != a[i]) > { > i++; > continue; > } > > i0 = i - 1; > i++; > while ((i < num) && (a[i-1] == a[i])) > i++; > > di = i-i0; > na += di*(di-1)/2; > > (void) kendall_insertion_sort (b+i0, di); > v += kendall_count_tied_pairs(b+i0, di, &va, &va1, &va2); > i++; /* ok to do since if i<num, the a[i-1]!=a[i] */ > } > > /* Sort b, using a as workspace */ > ne = kendall_merge_sort (b, num, a); > nb = kendall_count_tied_pairs (b, num, &vb, &vb1, &vb2); > > /* Of no ties, use exact probability distribution */ > if ((na == 0) && (nb == 0)) > { > _pSLint64_Type is; > > if (n0 < 2*ne) > is = -(_pSLint64_Type)(2*ne - n0); > else > is = (_pSLint64_Type)(n0 - 2*ne); > > *taup = ((double)is)/n0; > > /* prob is probability of getting a statistic >= is. */ > (void) prtaus (is, num, &prob); > prob = 1.0 - prob; /* prob of statistic < is */ > /* fprintf (stdout, "prtaus: num=%lu, is=%lu, prob=%g\n", num, is, prob); */ > return prob; > } > > /* Otherwise, use normal distributuon */ > tau = (n0 + v - na - nb - ne); /* This should be >= 0 */ > tau -= ne; /* may be < 0 */ > > /* From wikipedia */ > sigma = (n0*(4.0*num+10.0) - va - vb)/18.0; > sigma += va1*(double)vb1/(4.0*n0); > sigma += va2*(double)vb2/(18.0*n0*(num-2)); > sigma = sqrt (sigma); > > *taup = tau/sqrt(n0-na)/sqrt(n0-nb); /* avoid overflow */ > > /* To compute the probability use the continuity correction recommended by Kendall */ > if (tau > 0) tau -= 1; else if (tau < 0) tau += 1; > return 0.5 * (1.0 + erf (tau/sigma/sqrt(2.0))); >}
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 229754
: 195110