int __fwriting (FILE *__fp) __THROW; /* Return non-zero value iff stream FP is not opened write-only or append-only. */ extern int __freadable (FILE *__fp) __THROW; /* Return non-zero value iff stream FP is not opened read-only. */ extern int __fwritable (FILE *__fp) __THROW; /* Return non-zero value iff the stream FP is line-buffered. */ extern int __flbf (FILE *__fp) __THROW; /* Discard all pending buffered I/O on the stream FP. */ extern void __fpurge (FILE *__fp) __THROW; /* Return amount of output in bytes pending on a stream FP. */ extern size_t __fpending (FILE *__fp) __THROW; /* Flush all line-buffered files. */ extern void _flushlbf (void); /* Set locking status of stream FP to TYPE. */ extern int __fsetlocking (FILE *__fp, int __type) __THROW; __END_DECLS #endif /* stdio_ext.h */ #include /* Copyright (C) 1991-93,96,97,98,99,2001,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _FNMATCH_H #define _FNMATCH_H 1 #ifdef __cplusplus extern "C" { #endif #ifndef const # if (defined __STDC__ && __STDC__) || defined __cplusplus # define __const const # else # define __const # endif #endif /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME #undef FNM_NOESCAPE #undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ # define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ #define FNM_NOMATCH 1 /* This value is returned if the implementation does not support `fnmatch'. Since this is not the case here it will never be returned but the conformance test suites still require the symbol to be defined. */ #ifdef _XOPEN_SOURCE # define FNM_NOSYS (-1) #endif /* Match NAME against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch (__const char *__pattern, __const char *__name, int __flags); #ifdef __cplusplus } #endif #endif /* fnmatch.h */ /* Extended tar format from POSIX.1. Copyright (C) 1992, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by David J. MacKenzie. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _TAR_H #define _TAR_H 1 /* A tar archive consists of 512-byte blocks. Each file in the archive has a header block followed by 0+ data blocks. Two blocks of NUL bytes indicate the end of the archive. */ /* The fields of header blocks: All strings are stored as ISO 646 (approximately ASCII) strings. Fields are numeric unless otherwise noted below; numbers are ISO 646 representations of octal numbers, with leading zeros as needed. linkname is only valid when typeflag==LNKTYPE. It doesn't use prefix; files that are links to pathnames >100 chars long can not be stored in a tar archive. If typeflag=={LNKTYPE,SYMTYPE,DIRTYPE} then size must be 0. devmajor and devminor are only valid for typeflag=={BLKTYPE,CHRTYPE}. chksum contains the sum of all 512 bytes in the header block, treating each byte as an 8-bit unsigned value and treating the 8 bytes of chksum as blank characters. uname and gname are used in preference to uid and gid, if those names exist locally. Field Name Byte Offset Length in Bytes Field Type name 0 100 NUL-terminated if NUL fits mode 100 8 uid 108 8 gid 116 8 size 124 12 mtime 136 12 chksum 148 8 typeflag 156 1 see below linkname 157 100 NUL-terminated if NUL fits magic 257 6 must be TMAGIC (NUL term.) version 263 2 must be TVERSION uname 265 32 NUL-terminated gname 297 32 NUL-terminated devmajor 329 8 devminor 337 8 prefix 345 155 NUL-terminated if NUL fits If the first character of prefix is '\0', the file name is name; otherwise, it is prefix/name. Files whose pathnames don't fit in that length can not be stored in a tar archive. */ /* The bits in mode: */ #define TSUID 04000 #define TSGID 02000 #define TSVTX 01000 #define TUREAD 00400 #define TUWRITE 00200 #define TUEXEC 00100 #define TGREAD 00040 #define TGWRITE 00020 #define TGEXEC 00010 #define TOREAD 00004 #define TOWRITE 00002 #define TOEXEC 00001 /* The values for typeflag: Values 'A'-'Z' are reserved for custom implementations. All other values are reserved for future POSIX.1 revisions. */ #define REGTYPE '0' /* Regular file (preferred code). */ #define AREGTYPE '\0' /* Regular file (alternate code). */ #define LNKTYPE '1' /* Hard link. */ #define SYMTYPE '2' /* Symbolic link (hard if not supported). */ #define CHRTYPE '3' /* Character special. */ #define BLKTYPE '4' /* Block special. */ #define DIRTYPE '5' /* Directory. */ #define FIFOTYPE '6' /* Named pipe. */ #define CONTTYPE '7' /* Contiguous file */ /* (regular file if not supported). */ /* Contents of magic field and its length. */ #define TMAGIC "ustar" #define TMAGLEN 6 /* Contents of the version field and its length. */ #define TVERSION "00" #define TVERSLEN 2 #endif /* tar.h */ /* Copyright (C) 1991,92,95-99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * ISO C99 Standard: 7.11 Localization */ #ifndef _LOCALE_H #define _LOCALE_H 1 #include #define __need_NULL #include #include __BEGIN_DECLS /* These are the possibilities for the first argument to setlocale. The code assumes that the lowest LC_* symbol has the value zero. */ #define LC_CTYPE __LC_CTYPE #define LC_NUMERIC __LC_NUMERIC #define LC_TIME __LC_TIME #define LC_COLLATE __LC_COLLATE #define LC_MONETARY __LC_MONETARY #define LC_MESSAGES __LC_MESSAGES #define LC_ALL __LC_ALL #if 0 #define LC_PAPER __LC_PAPER #define LC_NAME __LC_NAME #define LC_ADDRESS __LC_ADDRESS #define LC_TELEPHONE __LC_TELEPHONE #define LC_MEASUREMENT __LC_MEASUREMENT #define LC_IDENTIFICATION __LC_IDENTIFICATION #endif __BEGIN_NAMESPACE_STD /* Structure giving information about numeric and monetary notation. */ struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 iff a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 iff a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string follows the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately follows the currency_symbol. */ char p_sign_posn; char n_sign_posn; #ifdef __USE_ISOC99 /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ char int_p_cs_precedes; /* 1 iff a space separates int_curr_symbol from a positive value. */ char int_p_sep_by_space; /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ char int_n_cs_precedes; /* 1 iff a space separates int_curr_symbol from a negative value. */ char int_n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and int_curr_symbol. 1 The sign string precedes the quantity and int_curr_symbol. 2 The sign string follows the quantity and int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately follows the int_curr_symbol. */ char int_p_sign_posn; char int_n_sign_posn; #else char __int_p_cs_precedes; char __int_p_sep_by_space; char __int_n_cs_precedes; char __int_n_sep_by_space; char __int_p_sign_posn; char __int_n_sign_posn; #endif }; /* Set and/or return the current locale. */ extern char *setlocale (int __category, __const char *__locale) __THROW; /* Return the numeric/monetary information for the current locale. */ extern struct lconv *localeconv (void) __THROW; __END_NAMESPACE_STD #if defined __USE_GNU && defined __UCLIBC_HAS_LOCALE__ /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ #ifdef __UCLIBC_HAS_XLOCALE__ /* Get locale datatype definition. */ # include #endif typedef __locale_t locale_t; /* Return a reference to a data structure representing a set of locale datasets. Unlike for the CATEGORY parameter for `setlocale' the CATEGORY_MASK parameter here uses a single bit for each category, made by OR'ing together LC_*_MASK bits above. */ extern __locale_t newlocale (int __category_mask, __const char *__locale, __locale_t __base) __THROW; /* These are the bits that can be set in the CATEGORY_MASK argument to `newlocale'. In the GNU implementation, LC_FOO_MASK has the value of (1 << LC_FOO), but this is not a part of the interface that callers can assume will be true. */ # define LC_CTYPE_MASK (1 << __LC_CTYPE) # define LC_NUMERIC_MASK (1 << __LC_NUMERIC) # define LC_TIME_MASK (1 << __LC_TIME) # define LC_COLLATE_MASK (1 << __LC_COLLATE) # define LC_MONETARY_MASK (1 << __LC_MONETARY) # define LC_MESSAGES_MASK (1 << __LC_MESSAGES) #ifdef L_newlocale #warning mask defines for extra locale categories #endif /* L_newlocale - uClibc note */ #ifdef LC_PAPER # define LC_PAPER_MASK (1 << __LC_PAPER) # define LC_NAME_MASK (1 << __LC_NAME) # define LC_ADDRESS_MASK (1 << __LC_ADDRESS) # define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) # define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) # define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) # define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ | LC_PAPER_MASK \ | LC_NAME_MASK \ | LC_ADDRESS_MASK \ | LC_TELEPHONE_MASK \ | LC_MEASUREMENT_MASK \ | LC_IDENTIFICATION_MASK \ ) #else /* LC_PAPER */ # define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ ) #endif /* LC_PAPER */ /* Return a duplicate of the set of locale in DATASET. All usage counters are increased if necessary. */ extern __locale_t duplocale (__locale_t __dataset) __THROW; /* Free the data associated with a locale dataset previously returned by a call to `setlocale_r'. */ extern void freelocale (__locale_t __dataset) __THROW; /* Switch the current thread's locale to DATASET. If DATASET is null, instead just return the current setting. The special value LC_GLOBAL_LOCALE is the initial setting for all threads and can also be installed any time, meaning the thread uses the global settings controlled by `setlocale'. */ extern __locale_t uselocale (__locale_t __dataset) __THROW; /* This value can be passed to `uselocale' and may be returned by it. Passing this value to any other function has undefined behavior. */ # define LC_GLOBAL_LOCALE ((__locale_t) -1L) #endif __END_DECLS #endif /* locale.h */ /* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * ISO C99 Standard: 7.22 Type-generic math */ #ifndef _TGMATH_H #define _TGMATH_H 1 /* Include the needed headers. */ #include #include /* Since `complex' is currently not really implemented in most C compilers and if it is implemented, the implementations differ. This makes it quite difficult to write a generic implementation of this header. We do not try this for now and instead concentrate only on GNU CC. Once we have more information support for other compilers might follow. */ #if __GNUC_PREREQ (2, 7) # ifdef __NO_LONG_DOUBLE_MATH # define __tgml(fct) fct # else # define __tgml(fct) fct ## l # endif /* This is ugly but unless gcc gets appropriate builtins we have to do something like this. Don't ask how it works. */ /* 1 if 'type' is a floating type, 0 if 'type' is an integer type. Allows for _Bool. Expands to an integer constant expression. */ # define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1)) /* The tgmath real type for T, where E is 0 if T is an integer type and 1 for a floating type. */ # define __tgmath_real_type_sub(T, E) \ __typeof__(*(0 ? (__typeof__ (0 ? (double *) 0 : (void *) (E))) 0 \ : (__typeof__ (0 ? (T *) 0 : (void *) (!(E)))) 0)) /* The tgmath real type of EXPR. */ # define __tgmath_real_type(expr) \ __tgmath_real_type_sub(__typeof__(expr), __floating_type(__typeof__(expr))) /* We have two kinds of generic macros: to support functions which are only defined on real valued parameters and those which are defined for complex functions as well. */ # define __TGMATH_UNARY_REAL_ONLY(Val, Fct) \ (__extension__ ({ __tgmath_real_type (Val) __tgmres; \ if (sizeof (Val) == sizeof (double) \ || __builtin_classify_type (Val) != 8) \ __tgmres = Fct (Val); \ else if (sizeof (Val) == sizeof (float)) \ __tgmres = Fct##f (Val); \ else \ __tgmres = __tgml(Fct) (Val); \ __tgmres; })) # define __TGMATH_BINARY_FIRST_REAL_ONLY(Val1, Val2, Fct) \ (__extension__ ({ __tgmath_real_type (Val1) __tgmres; \ if (sizeof (Val1) == sizeof (double) \ || __builtin_classify_type (Val1) != 8) \ __tgmres = Fct (Val1, Val2); \ else if (sizeof (Val1) == sizeof (float)) \ __tgmres = Fct##f (Val1, Val2); \ else \ __tgmres = __tgml(Fct) (Val1, Val2); \ __tgmres; })) # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \ if ((sizeof (Val1) > sizeof (double) \ || sizeof (Val2) > sizeof (double)) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ __tgmres = __tgml(Fct) (Val1, Val2); \ else if (sizeof (Val1) == sizeof (double) \ || sizeof (Val2) == sizeof (double) \ || __builtin_classify_type (Val1) != 8 \ || __builtin_classify_type (Val2) != 8) \ __tgmres = Fct (Val1, Val2); \ else \ __tgmres = Fct##f (Val1, Val2); \ __tgmres; })) # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \ if ((sizeof (Val1) > sizeof (double) \ || sizeof (Val2) > sizeof (double)) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ __tgmres = __tgml(Fct) (Val1, Val2, Val3); \ else if (sizeof (Val1) == sizeof (double) \ || sizeof (Val2) == sizeof (double) \ || __builtin_classify_type (Val1) != 8 \ || __builtin_classify_type (Val2) != 8) \ __tgmres = Fct (Val1, Val2, Val3); \ else \ __tgmres = Fct##f (Val1, Val2, Val3); \ __tgmres; })) # define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2) + (Val3)) __tgmres;\ if ((sizeof (Val1) > sizeof (double) \ || sizeof (Val2) > sizeof (double) \ || sizeof (Val3) > sizeof (double)) \ && __builtin_classify_type ((Val1) + (Val2) \ + (Val3)) == 8) \ __tgmres = __tgml(Fct) (Val1, Val2, Val3); \ else if (sizeof (Val1) == sizeof (double) \ || sizeof (Val2) == sizeof (double) \ || sizeof (Val3) == sizeof (double) \ || __builtin_classify_type (Val1) != 8 \ || __builtin_classify_type (Val2) != 8 \ || __builtin_classify_type (Val3) != 8) \ __tgmres = Fct (Val1, Val2, Val3); \ else \ __tgmres = Fct##f (Val1, Val2, Val3); \ __tgmres; })) /* XXX This definition has to be changed as soon as the compiler understands the imaginary keyword. */ # define __TGMATH_UNARY_REAL_IMAG(Val, Fct, Cfct) \ (__extension__ ({ __tgmath_real_type (Val) __tgmres; \ if (sizeof (__real__ (Val)) > sizeof (double) \ && __builtin_classify_type (__real__ (Val)) == 8) \ { \ if (sizeof (__real__ (Val)) == sizeof (Val)) \ __tgmres = __tgml(Fct) (Val); \ else \ __tgmres = __tgml(Cfct) (Val); \ } \ else if (sizeof (__real__ (Val)) == sizeof (double) \ || __builtin_classify_type (__real__ (Val)) \ != 8) \ { \ if (sizeof (__real__ (Val)) == sizeof (Val)) \ __tgmres = Fct (Val); \ else \ __tgmres = Cfct (Val); \ } \ else \ { \ if (sizeof (__real__ (Val)) == sizeof (Val)) \ __tgmres = Fct##f (Val); \ else \ __tgmres = Cfct##f (Val); \ } \ __tgmres; })) /* XXX This definition has to be changed as soon as the compiler understands the imaginary keyword. */ # define __TGMATH_UNARY_IMAG_ONLY(Val, Fct) \ (__extension__ ({ __tgmath_real_type (Val) __tgmres; \ if (sizeof (Val) == sizeof (__complex__ double) \ || __builtin_classify_type (__real__ (Val)) != 8) \ __tgmres = Fct (Val); \ else if (sizeof (Val) == sizeof (__complex__ float)) \ __tgmres = Fct##f (Val); \ else \ __tgmres = __tgml(Fct) (Val); \ __tgmres; })) /* XXX This definition has to be changed as soon as the compiler understands the imaginary keyword. */ # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \ if ((sizeof (__real__ (Val1)) > sizeof (double) \ || sizeof (__real__ (Val2)) > sizeof (double)) \ && __builtin_classify_type (__real__ (Val1) \ + __real__ (Val2)) \ == 8) \ { \ if (sizeof (__real__ (Val1)) == sizeof (Val1) \ && sizeof (__real__ (Val2)) == sizeof (Val2)) \ __tgmres = __tgml(Fct) (Val1, Val2); \ else \ __tgmres = __tgml(Cfct) (Val1, Val2); \ } \ else if (sizeof (__real__ (Val1)) == sizeof (double) \ || sizeof (__real__ (Val2)) == sizeof(double) \ || (__builtin_classify_type (__real__ (Val1)) \ != 8) \ || (__builtin_classify_type (__real__ (Val2)) \ != 8)) \ { \ if (sizeof (__real__ (Val1)) == sizeof (Val1) \ && sizeof (__real__ (Val2)) == sizeof (Val2)) \ __tgmres = Fct (Val1, Val2); \ else \ __tgmres = Cfct (Val1, Val2); \ } \ else \ { \ if (sizeof (__real__ (Val1)) == sizeof (Val1) \ && sizeof (__real__ (Val2)) == sizeof (Val2)) \ __tgmres = Fct##f (Val1, Val2); \ else \ __tgmres = Cfct##f (Val1, Val2); \ } \ __tgmres; })) #else # error "Unsupported compiler; you cannot use " #endif /* Unary functions defined for real and complex values. */ /* Trigonometric functions. */ /* Arc cosine of X. */ #define acos(Val) __TGMATH_UNARY_REAL_IMAG (Val, acos, cacos) /* Arc sine of X. */ #define asin(Val) __TGMATH_UNARY_REAL_IMAG (Val, asin, casin) /* Arc tangent of X. */ #define atan(Val) __TGMATH_UNARY_REAL_IMAG (Val, atan, catan) /* Arc tangent of Y/X. */ #define atan2(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, atan2) /* Cosine of X. */ #define cos(Val) __TGMATH_UNARY_REAL_IMAG (Val, cos, ccos) /* Sine of X. */ #define sin(Val) __TGMATH_UNARY_REAL_IMAG (Val, sin, csin) /* Tangent of X. */ #define tan(Val) __TGMATH_UNARY_REAL_IMAG (Val, tan, ctan) /* Hyperbolic functions. */ /* Hyperbolic arc cosine of X. */ #define acosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, acosh, cacosh) /* Hyperbolic arc sine of X. */ #define asinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, asinh, casinh) /* Hyperbolic arc tangent of X. */ #define atanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, atanh, catanh) /* Hyperbolic cosine of X. */ #define cosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, cosh, ccosh) /* Hyperbolic sine of X. */ #define sinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, sinh, csinh) /* Hyperbolic tangent of X. */ #define tanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, tanh, ctanh) /* Exponential and logarithmic functions. */ /* Exponential function of X. */ #define exp(Val) __TGMATH_UNARY_REAL_IMAG (Val, exp, cexp) /* Break VALUE into a normalized fraction and an integral power of 2. */ #define frexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, frexp) /* X times (two to the EXP power). */ #define ldexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, ldexp) /* Natural logarithm of X. */ #define log(Val) __TGMATH_UNARY_REAL_IMAG (Val, log, clog) /* Base-ten logarithm of X. */ #ifdef __USE_GNU # define log10(Val) __TGMATH_UNARY_REAL_IMAG (Val, log10, __clog10) #else # define log10(Val) __TGMATH_UNARY_REAL_ONLY (Val, log10) #endif /* Return exp(X) - 1. */ #define expm1(Val) __TGMATH_UNARY_REAL_ONLY (Val, expm1) /* Return log(1 + X). */ #define log1p(Val) __TGMATH_UNARY_REAL_ONLY (Val, log1p) /* Return the base 2 signed integral exponent of X. */ #define logb(Val) __TGMATH_UNARY_REAL_ONLY (Val, logb) /* Compute base-2 exponential of X. */ #define exp2(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp2) /* Compute base-2 logarithm of X. */ #define log2(Val) __TGMATH_UNARY_REAL_ONLY (Val, log2) /* Power functions. */ /* Return X to the Y power. */ #define pow(Val1, Val2) __TGMATH_BINARY_REAL_IMAG (Val1, Val2, pow, cpow) /* Return the square root of X. */ #define sqrt(Val) __TGMATH_UNARY_REAL_IMAG (Val, sqrt, csqrt) /* Return `sqrt(X*X + Y*Y)'. */ #define hypot(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, hypot) /* Return the cube root of X. */ #define cbrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, cbrt) /* Nearest integer, absolute value, and remainder functions. */ /* Smallest integral value not less than X. */ #define ceil(Val) __TGMATH_UNARY_REAL_ONLY (Val, c¸ ¸!¸"¸#¸eil) /* Absolute value of X. */ #define fabs(Val) __TGMATH_UNARY_REAL_IMAG (Val, fabs, cabs) /* Largest integer not greater than X. */ #define floor(Val) __TGMATH_UNARY_REAL_ONLY (Val, floor) /* Floating-point modulo remainder of X/Y. */ #define fmod(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmod) /* Round X to integral valuein floating-point format using current rounding direction, but do not raise inexact exception. */ #define nearbyint(Val) __TGMATH_UNARY_REAL_ONLY (Val, nearbyint) /* Round X to nearest integral value, rounding halfway cases away from zero. */ #define round(Val) __TGMATH_UNARY_REAL_ONLY (Val, round) /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ #define trunc(Val) __TGMATH_UNARY_REAL_ONLY (Val, trunc) /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ #define remquo(Val1, Val2, Val3) \ __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY (Val1, Val2, Val3, remquo) /* Round X to nearest integral value according to current rounding direction. */ #define lrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, lrint) #define llrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, llrint) /* Round X to nearest integral value, rounding halfway cases away from zero. */ #define lround(Val) __TGMATH_UNARY_REAL_ONLY (Val, lround) #define llround(Val) __TGMATH_UNARY_REAL_ONLY (Val, llround) /* Return X with its signed changed to Y's. */ #define copysign(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, copysign) /* Error and gamma functions. */ #define erf(Val) __TGMATH_UNARY_REAL_ONLY (Val, erf) #define erfc(Val) __TGMATH_UNARY_REAL_ONLY (Val, erfc) #define tgamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, tgamma) #define lgamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, lgamma) /* Return the integer nearest X in the direction of the prevailing rounding mode. */ #define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint) /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ #define nextafter(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, nextafter) #define nexttoward(Val1, Val2) \ __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, nexttoward) /* Return the remainder of integer divison X / Y with infinite precision. */ #define remainder(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, remainder) #if defined __UCLIBC_SUSV3_LEGACY__ /* Return X times (2 to the Nth power). */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED # define scalb(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, scalb) #endif /* Return X times (2 to the Nth power). */ #define scalbn(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbn) /* Return X times (2 to the Nth power). */ #define scalbln(Val1, Val2) \ __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbln) #endif /* UCLIBC_SUSV3_LEGACY */ /* Return the binary exponent of X, which must be nonzero. */ #define ilogb(Val) __TGMATH_UNARY_REAL_ONLY (Val, ilogb) /* Return positive difference between X and Y. */ #define fdim(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fdim) /* Return maximum numeric value from X and Y. */ #define fmax(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmax) /* Return minimum numeric value from X and Y. */ #define fmin(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmin) /* Multiply-add function computed as a ternary operation. */ #define fma(Val1, Val2, Val3) \ __TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma) /* Absolute value, conjugates, and projection. */ /* Argument value of Z. */ #define carg(Val) __TGMATH_UNARY_IMAG_ONLY (Val, carg) /* Complex conjugate of Z. */ #define conj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, conj) /* Projection of Z onto the Riemann sphere. */ #define cproj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cproj) /* Decomposing complex values. */ /* Imaginary part of Z. */ #define cimag(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cimag) /* Real part of Z. */ #define creal(Val) __TGMATH_UNARY_IMAG_ONLY (Val, creal) #endif /* tgmath.h */ /* * Copyright (c) 1983, 1987, 1989 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 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. */ /* * Portions Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * @(#)resolv.h 8.1 (Berkeley) 6/2/93 * $BINDId: resolv.h,v 8.31 2000/03/30 20:16:50 vixie Exp $ */ #ifndef _RESOLV_H_ /* These headers are needed for types used in the `struct res_state' declaration. */ #include #include #ifndef __need_res_state # define _RESOLV_H_ # include # include # include # include #endif #ifndef __res_state_defined # define __res_state_defined typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error } res_sendhookact; typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns, const u_char **query, int *querylen, u_char *ans, int anssiz, int *resplen); typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns, const u_char *query, int querylen, u_char *ans, int anssiz, int *resplen); /* * Global defines and variables for resolver stub. */ # define MAXNS 3 /* max # name servers we'll track */ # define MAXDFLSRCH 3 /* # default domain levels to try */ # define MAXDNSRCH 6 /* max # domains in search path */ # define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ # define RES_TIMEOUT 5 /* min. seconds between retries */ # define MAXRESOLVSORT 10 /* number of net to sort on */ # define RES_MAXNDOTS 15 /* should reflect bit field size */ # define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */ # define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */ # define RES_DFLRETRY 3 /* Default #/tries. */ /* (glibc uses RES_DFLRETRY of 2 but also does _res.retry = 4 sometimes (!) */ # define RES_MAXTIME 65535 /* Infinity, in milliseconds. */ /* _res (an instance of this structure) uses 0.5kb in bss * in "ordinary" libc's (glibc, xBSD). We want to be less wasteful. * We (1) shuffle and shrink some integer fields, * and (2) can switch off stuff we don't support. * Everything inside __UCLIBC_HAS_COMPAT_RES_STATE__ * is not actually used by uclibc and can be configured off. * However, this will prevent some programs from building. * Really obscure stuff with no observed users in the wild is under * __UCLIBC_HAS_EXTRA_COMPAT_RES_STATE__. * I guess it's safe to set that to N. */ struct __res_state { /*int retrans, retry; - moved, was here */ u_int32_t options; /* (was: ulong) option flags - see below. */ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ #define nsaddr nsaddr_list[0] /* for backward compatibility */ char *dnsrch[MAXDNSRCH + 1]; /* components of domain to search */ /*char defdname[256]; - moved, was here */ u_int8_t nscount; /* (was: int) number of name servers */ u_int8_t ndots; /* (was: unsigned:4) threshold for initial abs. query */ u_int8_t retrans; /* (was: int) retransmission time interval */ u_int8_t retry; /* (was: int) number of times to retransmit */ #ifdef __UCLIBC_HAS_COMPAT_RES_STATE__ /* googling for "_res.defdname" says it's still sometimes used. * Pity. It's huge, I want to move it to EXTRA_COMPAT... */ char defdname[256]; /* default domain (deprecated) */ u_int8_t nsort; /* (was: unsigned:4) number of elements in sort_list[] */ u_int16_t pfcode; /* (was: ulong) RES_PRF_ flags. Used by dig. */ unsigned short id; /* current message id */ int res_h_errno; /* last one set for this context */ struct { struct in_addr addr; u_int32_t mask; } sort_list[MAXRESOLVSORT]; #endif #ifdef __UCLIBC_HAS_IPV6__ /* I assume that the intention is to store all * DNS servers' addresses here, and duplicate in nsaddr_list[] * those which have IPv4 address. In the case of IPv4 address * _u._ext.nsaddrs[x] will point to some nsaddr_list[y], * otherwise it will point into malloc'ed sockaddr_in6. * nscount is the number of IPv4 addresses and _u._ext.nscount * is the number of addresses of all kinds. * * If this differs from established usage and you need * to change this, please describe how it is supposed to work. */ union { struct { struct sockaddr_in6 *nsaddrs[MAXNS]; u_int8_t nscount; /* (was: u_int16_t) */ #ifdef __UCLIBC_HAS_COMPAT_RES_STATE__ /* rather obscure, and differs in BSD and glibc */ u_int16_t nstimes[MAXNS]; int nssocks[MAXNS]; u_int16_t nscount6; u_int16_t nsinit; /* glibc also has: */ /*u_int16_t nsmap[MAXNS];*/ /*unsigned long long initstamp;*/ #endif } _ext; } _u; #endif #ifdef __UCLIBC_HAS_EXTRA_COMPAT_RES_STATE__ /* Truly obscure stuff. * Googling for "_res.XXX" for these members * turned up basically empty */ res_send_qhook qhook; /* query hook */ res_send_rhook rhook; /* response hook */ int _vcsock; /* PRIVATE: for res_send VC i/o */ unsigned _flags; /* PRIVATE: see below */ #endif }; typedef struct __res_state *res_state; # undef __need_res_state #endif #ifdef _RESOLV_H_ /* * Revision information. This is the release date in YYYYMMDD format. * It can change every day so the right thing to do with it is use it * in preprocessor commands such as "#if (__RES > 19931104)". Do not * compare for equality; rather, use it to determine whether your resolver * is new enough to contain a certain feature. */ #if 0 #define __RES 19991006 #else #define __RES 19960801 #endif /* * Resolver configuration file. * Normally not present, but may contain the address of the * inital name server(s) to query and the domain search list. */ #ifndef _PATH_RESCONF #define _PATH_RESCONF "/etc/resolv.conf" #endif struct res_sym { int number; /* Identifying number, like T_MX */ char * name; /* Its symbolic name, like "MX" */ char * humanname; /* Its fun name, like "mail exchanger" */ }; /* * Resolver flags (used to be discrete per-module statics ints). */ #define RES_F_VC 0x00000001 /* socket is TCP */ #define RES_F_CONN 0x00000002 /* socket is connected */ /* res_findzonecut() options */ #define RES_EXHAUSTIVE 0x00000001 /* always do all queries */ /* * Resolver options (keep these in synch with res_debug.c, please) * (which of these do we really implement??) */ #define RES_INIT 0x00000001 /* address initialized */ #define RES_DEBUG 0x00000002 /* print debug messages */ #define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/ #define RES_USEVC 0x00000008 /* use virtual circuit */ #define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */ #define RES_IGNTC 0x00000020 /* ignore trucation errors */ #define RES_RECURSE 0x00000040 /* recursion desired */ #define RES_DEFNAMES 0x00000080 /* use default domain name */ #define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */ #define RES_DNSRCH 0x00000200 /* search up local domain tree */ #define RES_INSECURE1 0x00000400 /* type 1 security disabled */ #define RES_INSECURE2 0x00000800 /* type 2 security disabled */ #define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */ #define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */ #define RES_ROTATE 0x00004000 /* rotate ns list after each query */ #define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */ #define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */ #define RES_BLAST 0x00020000 /* blast all recursive servers */ #if 0 #define RES_USEBSTRING 0x00040000 /* IPv6 reverse lookup with byte strings */ #define RES_NOIP6DOTINT 0x00080000 /* Do not use .ip6.int in IPv6 reverse lookup */ #define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT) #else #define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH) #endif /* * Resolver "pfcode" values. Used by dig. */ #define RES_PRF_STATS 0x00000001 #define RES_PRF_UPDATE 0x00000002 #define RES_PRF_CLASS 0x00000004 #define RES_PRF_CMD 0x00000008 #define RES_PRF_QUES 0x00000010 #define RES_PRF_ANS 0x00000020 #define RES_PRF_AUTH 0x00000040 #define RES_PRF_ADD 0x00000080 #define RES_PRF_HEAD1 0x00000100 #define RES_PRF_HEAD2 0x00000200 #define RES_PRF_TTLID 0x00000400 #define RES_PRF_HEADX 0x00000800 #define RES_PRF_QUERY 0x00001000 #define RES_PRF_REPLY 0x00002000 #define RES_PRF_INIT 0x00004000 /* 0x00008000 */ /* Things involving an internal (static) resolver context. */ __BEGIN_DECLS extern struct __res_state *__res_state(void) __attribute__ ((__const__)); __END_DECLS #define _res (*__res_state()) #define fp_nquery __fp_nquery #define fp_query __fp_query #define hostalias __hostalias #define p_query __p_query #define res_close __res_close #define res_init __res_init #define res_isourserver __res_isourserver #define res_mkquery __res_mkquery #define res_query __res_query #define res_querydomain __res_querydomain #define res_search __res_search #define res_send __res_send __BEGIN_DECLS void fp_nquery (const u_char *, int, FILE *) __THROW; void fp_query (const u_char *, FILE *) __THROW; const char * hostalias (const char *) __THROW; void p_query (const u_char *) __THROW; #ifdef __UCLIBC_HAS_BSD_RES_CLOSE__ void res_close (void) __THROW; #endif int res_init (void) __THROW; int res_isourserver (const struct sockaddr_in *) __THROW; int res_mkquery (int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int) __THROW; int res_query (const char *, int, int, u_char *, int) __THROW; int res_querydomain (const char *, const char *, int, int, u_char *, int) __THROW; int res_search (const char *, int, int, u_char *, int) __THROW; int res_send (const u_char *, int, u_char *, int) __THROW; __END_DECLS #define b64_ntop __b64_ntop #define b64_pton __b64_pton #define dn_comp __dn_comp #define dn_count_labels __dn_count_labels #define dn_expand __dn_expand #define dn_skipname __dn_skipname #define fp_resstat __fp_resstat #define loc_aton __loc_aton #define loc_ntoa __loc_ntoa #define p_cdname __p_cdname #defi1¸2¸3¸4¸ne p_cdnname __p_cdnname #define p_class __p_class #define p_fqname __p_fqname #define p_fqnname __p_fqnname #define p_option __p_option #define p_secstodate __p_secstodate #define p_section __p_section #define p_time __p_time #define p_type __p_type #define p_rcode __p_rcode #define putlong __putlong #define putshort __putshort #define res_dnok __res_dnok #define res_hnok __res_hnok #define res_hostalias __res_hostalias #define res_mailok __res_mailok #define res_nameinquery __res_nameinquery #define res_nclose __res_nclose #define res_ninit __res_ninit #define res_nmkquery __res_nmkquery #define res_npquery __res_npquery #define res_nquery __res_nquery #define res_nquerydomain __res_nquerydomain #define res_nsearch __res_nsearch #define res_nsend __res_nsend #define res_nisourserver __res_nisourserver #define res_ownok __res_ownok #define res_queriesmatch __res_queriesmatch #define res_randomid __res_randomid #define sym_ntop __sym_ntop #define sym_ntos __sym_ntos #define sym_ston __sym_ston __BEGIN_DECLS int res_hnok (const char *) __THROW; int res_ownok (const char *) __THROW; int res_mailok (const char *) __THROW; int res_dnok (const char *) __THROW; int sym_ston (const struct res_sym *, const char *, int *) __THROW; const char * sym_ntos (const struct res_sym *, int, int *) __THROW; const char * sym_ntop (const struct res_sym *, int, int *) __THROW; int b64_ntop (u_char const *, size_t, char *, size_t) __THROW; int b64_pton (char const *, u_char *, size_t) __THROW; int loc_aton (const char *ascii, u_char *binary) __THROW; const char * loc_ntoa (const u_char *binary, char *ascii) __THROW; int dn_skipname (const u_char *, const u_char *) __THROW; void putlong (u_int32_t, u_char *) __THROW; void putshort (u_int16_t, u_char *) __THROW; const char * p_class (int) __THROW; const char * p_time (u_int32_t) __THROW; const char * p_type (int) __THROW; const char * p_rcode (int) __THROW; const u_char * p_cdnname (const u_char *, const u_char *, int, FILE *) __THROW; const u_char * p_cdname (const u_char *, const u_char *, FILE *) __THROW; const u_char * p_fqnname (const u_char *cp, const u_char *msg, int, char *, int) __THROW; const u_char * p_fqname (const u_char *, const u_char *, FILE *) __THROW; const char * p_option (u_long option) __THROW; char * p_secstodate (u_long) __THROW; int dn_count_labels (const char *) __THROW; int dn_comp (const char *, u_char *, int, u_char **, u_char **) __THROW; int dn_expand (const u_char *, const u_char *, const u_char *, char *, int) __THROW; u_int res_randomid (void) __THROW; int res_nameinquery (const char *, int, int, const u_char *, const u_char *) __THROW; int res_queriesmatch (const u_char *, const u_char *, const u_char *, const u_char *) __THROW; const char * p_section (int section, int opcode) __THROW; /* Things involving a resolver context. */ int res_ninit (res_state) __THROW; int res_nisourserver (const res_state, const struct sockaddr_in *) __THROW; void fp_resstat (const res_state, FILE *) __THROW; void res_npquery (const res_state, const u_char *, int, FILE *) __THROW; const char * res_hostalias (const res_state, const char *, char *, size_t) __THROW; int res_nquery (res_state, const char *, int, int, u_char *, int) __THROW; int res_nsearch (res_state, const char *, int, int, u_char *, int) __THROW; int res_nquerydomain (res_state, const char *, const char *, int, int, u_char *, int) __THROW; int res_nmkquery (res_state, int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int) __THROW; int res_nsend (res_state, const u_char *, int, u_char *, int) __THROW; void res_nclose (res_state) __THROW; __END_DECLS # endif /* _LIBC */ #endif /* !_RESOLV_H_ */ /* Prototypes and definition for malloc implementation. Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _MALLOC_H #define _MALLOC_H 1 #include /* `ptmalloc', a malloc implementation for multiple threads without lock contention, by Wolfram Gloger . See the files `ptmalloc.c' or `COPYRIGHT' for copying conditions. VERSION 2.6.4-pt Wed Dec 4 00:35:54 MET 1996 This work is mainly derived from malloc-2.6.4 by Doug Lea , which is available from: ftp://g.oswego.edu/pub/misc/malloc.c This trimmed-down header file only provides function prototypes and the exported data structures. For more detailed function descriptions and compile-time options, see the source file `ptmalloc.c'. */ #if defined(__STDC__) || defined (__cplusplus) # include # define __malloc_ptr_t void * #else # undef size_t # define size_t unsigned int # undef ptrdiff_t # define ptrdiff_t int # define __malloc_ptr_t char * #endif #if !defined __attribute_malloc__ # define __attribute_malloc__ #endif #ifdef __GNUC__ /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. */ #ifndef __THROW # if defined __cplusplus && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 8) # define __THROW throw () # else # define __THROW # endif #endif # define __MALLOC_P(args) args __THROW /* This macro will be used for functions which might take C++ callback functions. */ # define __MALLOC_PMT(args) args #else /* Not GCC. */ # define __THROW # if (defined __STDC__ && __STDC__) || defined __cplusplus # define __MALLOC_P(args) args # define __MALLOC_PMT(args) args # else /* Not ANSI C or C++. */ # define __MALLOC_P(args) () /* No prototypes. */ # define __MALLOC_PMT(args) () # endif /* ANSI C or C++. */ #endif /* GCC. */ #ifndef NULL # ifdef __cplusplus # define NULL 0 # else # define NULL ((__malloc_ptr_t) 0) # endif #endif #ifdef __cplusplus extern "C" { #endif /* Allocate SIZE bytes of memory. */ extern __malloc_ptr_t malloc __MALLOC_P ((size_t __size)) __attribute_malloc__; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern __malloc_ptr_t calloc __MALLOC_P ((size_t __nmemb, size_t __size)) __attribute_malloc__; /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ extern __malloc_ptr_t realloc __MALLOC_P ((__malloc_ptr_t __ptr, size_t __size)) __attribute_malloc__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free __MALLOC_P ((__malloc_ptr_t __ptr)); /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ extern __malloc_ptr_t memalign __MALLOC_P ((size_t __alignment, size_t __size)); /* Allocate SIZE bytes on a page boundary. */ extern __malloc_ptr_t valloc __MALLOC_P ((size_t __size)) __attribute_malloc__; #ifdef __MALLOC_STANDARD__ /* SVID2/XPG mallinfo structure */ struct mallinfo { int arena; /* total space allocated from system */ int ordblks; /* number of non-inuse chunks */ int smblks; /* unused -- always zero */ int hblks; /* number of mmapped regions */ int hblkhd; /* total space in mmapped regions */ int usmblks; /* unused -- always zero */ int fsmblks; /* unused -- always zero */ int uordblks; /* total allocated space */ int fordblks; /* total non-inuse space */ int keepcost; /* top-most, releasable (via malloc_trim) space */ }; /* Returns a copy of the updated current mallinfo. */ extern struct mallinfo mallinfo __MALLOC_P ((void)); /* Release all but __pad bytes of freed top-most memory back to the system. Return 1 if successful, else 0. */ extern int malloc_trim(size_t pad); #include /* Prints brief summary statistics to the specified file. * Writes to stderr if file is NULL. */ extern void malloc_stats(FILE *file); /* SVID2/XPG mallopt options */ #ifndef M_MXFAST # define M_MXFAST 1 /* UNUSED in this malloc */ #endif #ifndef M_NLBLKS # define M_NLBLKS 2 /* UNUSED in this malloc */ #endif #ifndef M_GRAIN # define M_GRAIN 3 /* UNUSED in this malloc */ #endif #ifndef M_KEEP # define M_KEEP 4 /* UNUSED in this malloc */ #endif /* mallopt options that actually do something */ #define M_TRIM_THRESHOLD -1 #define M_TOP_PAD -2 #define M_MMAP_THRESHOLD -3 #define M_MMAP_MAX -4 #define M_CHECK_ACTION -5 #define M_PERTURB -6 /* General SVID/XPG interface to tunable parameters. */ extern int mallopt __MALLOC_P ((int __param, int __val)); #endif /* __MALLOC_STANDARD__ */ /* uClibc may use malloc internally in situations where user can not be * notified about out-of-memory condition. In this situation uClibc will * call __uc_malloc_failed if it is non-NULL, and retry allocation * if it returns. If __uc_malloc_failed is NULL, uclibc will _exit(1). * NB: do not use stdio in __uc_malloc_failed handler! */ extern void *__uc_malloc(size_t size); extern void (*__uc_malloc_failed)(size_t size); #ifdef __cplusplus } /* end of extern "C" */ #endif #endif /* malloc.h */ /* Interface between the opcode library and its callers. Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. Written by Cygnus Support, 1993. The opcode library (libopcodes.a) provides instruction decoders for a large variety of instruction sets, callable with an identical interface, for making instruction-processing programs more independent of the instruction set being processed. */ #ifndef DIS_ASM_H #define DIS_ASM_H #ifdef __cplusplus extern "C" { #endif #include #include "bfd.h" typedef int (*fprintf_ftype) (void *, const char*, ...) /*ATTRIBUTE_FPTR_PRINTF_2*/; enum dis_insn_type { dis_noninsn, /* Not a valid instruction. */ dis_nonbranch, /* Not a branch instruction. */ dis_branch, /* Unconditional branch. */ dis_condbranch, /* Conditional branch. */ dis_jsr, /* Jump to subroutine. */ dis_condjsr, /* Conditional jump to subroutine. */ dis_dref, /* Data reference instruction. */ dis_dref2 /* Two data references in instruction. */ }; /* This struct is passed into the instruction decoding routine, and is passed back out into each callback. The various fields are used for conveying information from your main routine into your callbacks, for passing information into the instruction decoders (such as the addresses of the callback functions), or for passing information back from the instruction decoders to their callers. It must be initialized before it is first passed; this can be done by hand, or using one of the initialization macros below. */ typedef struct disassemble_info { fprintf_ftype fprintf_func; void *stream; void *application_data; /* Target description. We could replace this with a pointer to the bfd, but that would require one. There currently isn't any such requirement so to avoid introducing one we record these explicitly. */ /* The bfd_flavour. This can be bfd_target_unknown_flavour. */ enum bfd_flavour flavour; /* The bfd_arch value. */ enum bfd_architecture arch; /* The bfd_mach value. */ unsigned long mach; /* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */ enum bfd_endian endian; /* Endianness of code, for mixed-endian situations such as ARM BE8. */ enum bfd_endian endian_code; /* An arch/mach-specific bitmask of selected instruction subsets, mainly for processors with run-time-switchable instruction sets. The default, zero, means that there is no constraint. CGEN-based opcodes ports may use ISA_foo masks. */ void *insn_sets; /* Some targets need information about the current section to accurately display insns. If this is NULL, the target disassembler function will have to make its best guess. */ asection *section; /* An array of pointers to symbols either at the location being disassembled or at the start of the function being disassembled. The array is sorted so that the first symbol is intended to be the one used. The others are present for any misc. purposes. This is not set reliably, but if it is not NULL, it is correct. */ asymbol **symbols; /* Number of symbols in array. */ int num_symbols; /* Symbol table provided for targets that want to look at it. This is used on Arm to find mapping symbols and determine Arm/Thumb code. */ asymbol **symtab; int symtab_pos; int symtab_size; /* For use by the disassembler. The top 16 bits are reserved for public use (and are documented here). The bottom 16 bits are for the internal use of the disassembler. */ unsigned long flags; /* Set if the disassembler has determined that there are one or more relocations associated with the instruction being disassembled. */ #define INSN_HAS_RELOC (1 << 31) /* Set if the user has requested the disassembly of data as well as code. */ #define DISASSEMBLE_DATA (1 << 30) /* Set if the user has specifically set the machine type encoded in the mach field of this structure. */ #define USER_SPECIFIED_MACHINE_TYPE (1 << 29) /* Use internally by the target specific disassembly code. */ void *private_data; /* Function used to get bytes to disassemble. MEMADDR is the address of the stuff to be disassembled, MYADDR is the address to put the bytes in, and LENGTH is the number of byt