Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 295891 Details for
Bug 394317
sys-devel/gcc-4.6.2 segfaults while compiling media-sound/mixxx-9999
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
preprocessed source - unreduced
fidlib.i (text/plain), 183.31 KB, created by
Ryan Hill (RETIRED)
on 2011-12-15 05:24:06 UTC
(
hide
)
Description:
preprocessed source - unreduced
Filename:
MIME Type:
Creator:
Ryan Hill (RETIRED)
Created:
2011-12-15 05:24:06 UTC
Size:
183.31 KB
patch
obsolete
># 1 "lib/fidlib-0.9.9/fidlib.c" ># 1 "<built-in>" ># 1 "<command-line>" ># 1 "lib/fidlib-0.9.9/fidlib.c" ># 243 "lib/fidlib-0.9.9/fidlib.c" ># 1 "/usr/include/stdlib.h" 1 3 4 ># 25 "/usr/include/stdlib.h" 3 4 ># 1 "/usr/include/features.h" 1 3 4 ># 358 "/usr/include/features.h" 3 4 ># 1 "/usr/include/sys/cdefs.h" 1 3 4 ># 353 "/usr/include/sys/cdefs.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 354 "/usr/include/sys/cdefs.h" 2 3 4 ># 359 "/usr/include/features.h" 2 3 4 ># 382 "/usr/include/features.h" 3 4 ># 1 "/usr/include/gnu/stubs.h" 1 3 4 > > > ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 5 "/usr/include/gnu/stubs.h" 2 3 4 > > > > ># 1 "/usr/include/gnu/stubs-64.h" 1 3 4 ># 10 "/usr/include/gnu/stubs.h" 2 3 4 ># 383 "/usr/include/features.h" 2 3 4 ># 26 "/usr/include/stdlib.h" 2 3 4 > > > > > > > ># 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 1 3 4 ># 212 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 3 4 >typedef long unsigned int size_t; ># 324 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 3 4 >typedef int wchar_t; ># 34 "/usr/include/stdlib.h" 2 3 4 > > > > > > > > ># 1 "/usr/include/bits/waitflags.h" 1 3 4 ># 43 "/usr/include/stdlib.h" 2 3 4 ># 1 "/usr/include/bits/waitstatus.h" 1 3 4 ># 65 "/usr/include/bits/waitstatus.h" 3 4 ># 1 "/usr/include/endian.h" 1 3 4 ># 37 "/usr/include/endian.h" 3 4 ># 1 "/usr/include/bits/endian.h" 1 3 4 ># 38 "/usr/include/endian.h" 2 3 4 ># 61 "/usr/include/endian.h" 3 4 ># 1 "/usr/include/bits/byteswap.h" 1 3 4 ># 28 "/usr/include/bits/byteswap.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 29 "/usr/include/bits/byteswap.h" 2 3 4 ># 62 "/usr/include/endian.h" 2 3 4 ># 66 "/usr/include/bits/waitstatus.h" 2 3 4 > >union wait > { > int w_status; > struct > { > > unsigned int __w_termsig:7; > unsigned int __w_coredump:1; > unsigned int __w_retcode:8; > unsigned int:16; > > > > > > > > } __wait_terminated; > struct > { > > unsigned int __w_stopval:8; > unsigned int __w_stopsig:8; > unsigned int:16; > > > > > > > } __wait_stopped; > }; ># 44 "/usr/include/stdlib.h" 2 3 4 ># 68 "/usr/include/stdlib.h" 3 4 >typedef union > { > union wait *__uptr; > int *__iptr; > } __WAIT_STATUS __attribute__ ((__transparent_union__)); ># 96 "/usr/include/stdlib.h" 3 4 > > >typedef struct > { > int quot; > int rem; > } div_t; > > > >typedef struct > { > long int quot; > long int rem; > } ldiv_t; > > > > > > > >__extension__ typedef struct > { > long long int quot; > long long int rem; > } lldiv_t; > > ># 140 "/usr/include/stdlib.h" 3 4 >extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > >extern double atof (__const char *__nptr) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > >extern int atoi (__const char *__nptr) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > >extern long int atol (__const char *__nptr) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > > >__extension__ extern long long int atoll (__const char *__nptr) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > > >extern double strtod (__const char *__restrict __nptr, > char **__restrict __endptr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > > >extern float strtof (__const char *__restrict __nptr, > char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > >extern long double strtold (__const char *__restrict __nptr, > char **__restrict __endptr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > > >extern long int strtol (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > >extern unsigned long int strtoul (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > >__extension__ >extern long long int strtoq (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > >__extension__ >extern unsigned long long int strtouq (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > > >__extension__ >extern long long int strtoll (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > >__extension__ >extern unsigned long long int strtoull (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > ># 277 "/usr/include/stdlib.h" 3 4 > >extern __inline double >__attribute__ ((__nothrow__)) atof (__const char *__nptr) >{ > return strtod (__nptr, (char **) ((void *)0)); >} >extern __inline int >__attribute__ ((__nothrow__)) atoi (__const char *__nptr) >{ > return (int) strtol (__nptr, (char **) ((void *)0), 10); >} >extern __inline long int >__attribute__ ((__nothrow__)) atol (__const char *__nptr) >{ > return strtol (__nptr, (char **) ((void *)0), 10); >} > > > > >__extension__ extern __inline long long int >__attribute__ ((__nothrow__)) atoll (__const char *__nptr) >{ > return strtoll (__nptr, (char **) ((void *)0), 10); >} > ># 311 "/usr/include/stdlib.h" 3 4 >extern char *l64a (long int __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > >extern long int a64l (__const char *__s) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > ># 1 "/usr/include/sys/types.h" 1 3 4 ># 28 "/usr/include/sys/types.h" 3 4 > > ># 1 "/usr/include/bits/types.h" 1 3 4 ># 28 "/usr/include/bits/types.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 29 "/usr/include/bits/types.h" 2 3 4 > > >typedef unsigned char __u_char; >typedef unsigned short int __u_short; >typedef unsigned int __u_int; >typedef unsigned long int __u_long; > > >typedef signed char __int8_t; >typedef unsigned char __uint8_t; >typedef signed short int __int16_t; >typedef unsigned short int __uint16_t; >typedef signed int __int32_t; >typedef unsigned int __uint32_t; > >typedef signed long int __int64_t; >typedef unsigned long int __uint64_t; > > > > > > > >typedef long int __quad_t; >typedef unsigned long int __u_quad_t; ># 131 "/usr/include/bits/types.h" 3 4 ># 1 "/usr/include/bits/typesizes.h" 1 3 4 ># 132 "/usr/include/bits/types.h" 2 3 4 > > >typedef unsigned long int __dev_t; >typedef unsigned int __uid_t; >typedef unsigned int __gid_t; >typedef unsigned long int __ino_t; >typedef unsigned long int __ino64_t; >typedef unsigned int __mode_t; >typedef unsigned long int __nlink_t; >typedef long int __off_t; >typedef long int __off64_t; >typedef int __pid_t; >typedef struct { int __val[2]; } __fsid_t; >typedef long int __clock_t; >typedef unsigned long int __rlim_t; >typedef unsigned long int __rlim64_t; >typedef unsigned int __id_t; >typedef long int __time_t; >typedef unsigned int __useconds_t; >typedef long int __suseconds_t; > >typedef int __daddr_t; >typedef long int __swblk_t; >typedef int __key_t; > > >typedef int __clockid_t; > > >typedef void * __timer_t; > > >typedef long int __blksize_t; > > > > >typedef long int __blkcnt_t; >typedef long int __blkcnt64_t; > > >typedef unsigned long int __fsblkcnt_t; >typedef unsigned long int __fsblkcnt64_t; > > >typedef unsigned long int __fsfilcnt_t; >typedef unsigned long int __fsfilcnt64_t; > >typedef long int __ssize_t; > > > >typedef __off64_t __loff_t; >typedef __quad_t *__qaddr_t; >typedef char *__caddr_t; > > >typedef long int __intptr_t; > > >typedef unsigned int __socklen_t; ># 31 "/usr/include/sys/types.h" 2 3 4 > > > >typedef __u_char u_char; >typedef __u_short u_short; >typedef __u_int u_int; >typedef __u_long u_long; >typedef __quad_t quad_t; >typedef __u_quad_t u_quad_t; >typedef __fsid_t fsid_t; > > > > >typedef __loff_t loff_t; > > > >typedef __ino_t ino_t; ># 61 "/usr/include/sys/types.h" 3 4 >typedef __dev_t dev_t; > > > > >typedef __gid_t gid_t; > > > > >typedef __mode_t mode_t; > > > > >typedef __nlink_t nlink_t; > > > > >typedef __uid_t uid_t; > > > > > >typedef __off_t off_t; ># 99 "/usr/include/sys/types.h" 3 4 >typedef __pid_t pid_t; > > > > > >typedef __id_t id_t; > > > > >typedef __ssize_t ssize_t; > > > > > >typedef __daddr_t daddr_t; >typedef __caddr_t caddr_t; > > > > > >typedef __key_t key_t; ># 133 "/usr/include/sys/types.h" 3 4 ># 1 "/usr/include/time.h" 1 3 4 ># 58 "/usr/include/time.h" 3 4 > > >typedef __clock_t clock_t; > > > ># 74 "/usr/include/time.h" 3 4 > > >typedef __time_t time_t; > > > ># 92 "/usr/include/time.h" 3 4 >typedef __clockid_t clockid_t; ># 104 "/usr/include/time.h" 3 4 >typedef __timer_t timer_t; ># 134 "/usr/include/sys/types.h" 2 3 4 ># 147 "/usr/include/sys/types.h" 3 4 ># 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 1 3 4 ># 148 "/usr/include/sys/types.h" 2 3 4 > > > >typedef unsigned long int ulong; >typedef unsigned short int ushort; >typedef unsigned int uint; ># 195 "/usr/include/sys/types.h" 3 4 >typedef int int8_t __attribute__ ((__mode__ (__QI__))); >typedef int int16_t __attribute__ ((__mode__ (__HI__))); >typedef int int32_t __attribute__ ((__mode__ (__SI__))); >typedef int int64_t __attribute__ ((__mode__ (__DI__))); > > >typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); >typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); >typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); >typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); > >typedef int register_t __attribute__ ((__mode__ (__word__))); ># 220 "/usr/include/sys/types.h" 3 4 ># 1 "/usr/include/sys/select.h" 1 3 4 ># 31 "/usr/include/sys/select.h" 3 4 ># 1 "/usr/include/bits/select.h" 1 3 4 ># 23 "/usr/include/bits/select.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 24 "/usr/include/bits/select.h" 2 3 4 ># 32 "/usr/include/sys/select.h" 2 3 4 > > ># 1 "/usr/include/bits/sigset.h" 1 3 4 ># 24 "/usr/include/bits/sigset.h" 3 4 >typedef int __sig_atomic_t; > > > > >typedef struct > { > unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; > } __sigset_t; ># 35 "/usr/include/sys/select.h" 2 3 4 > > > >typedef __sigset_t sigset_t; > > > > > ># 1 "/usr/include/time.h" 1 3 4 ># 120 "/usr/include/time.h" 3 4 >struct timespec > { > __time_t tv_sec; > long int tv_nsec; > }; ># 45 "/usr/include/sys/select.h" 2 3 4 > ># 1 "/usr/include/bits/time.h" 1 3 4 ># 31 "/usr/include/bits/time.h" 3 4 >struct timeval > { > __time_t tv_sec; > __suseconds_t tv_usec; > }; ># 47 "/usr/include/sys/select.h" 2 3 4 > > >typedef __suseconds_t suseconds_t; > > > > > >typedef long int __fd_mask; ># 67 "/usr/include/sys/select.h" 3 4 >typedef struct > { > > > > > > > __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; > > > } fd_set; > > > > > > >typedef __fd_mask fd_mask; ># 99 "/usr/include/sys/select.h" 3 4 > ># 109 "/usr/include/sys/select.h" 3 4 >extern int select (int __nfds, fd_set *__restrict __readfds, > fd_set *__restrict __writefds, > fd_set *__restrict __exceptfds, > struct timeval *__restrict __timeout); ># 121 "/usr/include/sys/select.h" 3 4 >extern int pselect (int __nfds, fd_set *__restrict __readfds, > fd_set *__restrict __writefds, > fd_set *__restrict __exceptfds, > const struct timespec *__restrict __timeout, > const __sigset_t *__restrict __sigmask); > > > ># 221 "/usr/include/sys/types.h" 2 3 4 > > ># 1 "/usr/include/sys/sysmacros.h" 1 3 4 ># 30 "/usr/include/sys/sysmacros.h" 3 4 > > >__extension__ >extern unsigned int gnu_dev_major (unsigned long long int __dev) > __attribute__ ((__nothrow__)); >__extension__ >extern unsigned int gnu_dev_minor (unsigned long long int __dev) > __attribute__ ((__nothrow__)); >__extension__ >extern unsigned long long int gnu_dev_makedev (unsigned int __major, > unsigned int __minor) > __attribute__ ((__nothrow__)); > > >__extension__ extern __inline unsigned int >__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev) >{ > return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); >} > >__extension__ extern __inline unsigned int >__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev) >{ > return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); >} > >__extension__ extern __inline unsigned long long int >__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) >{ > return ((__minor & 0xff) | ((__major & 0xfff) << 8) > | (((unsigned long long int) (__minor & ~0xff)) << 12) > | (((unsigned long long int) (__major & ~0xfff)) << 32)); >} > > ># 224 "/usr/include/sys/types.h" 2 3 4 > > > > > >typedef __blksize_t blksize_t; > > > > > > >typedef __blkcnt_t blkcnt_t; > > > >typedef __fsblkcnt_t fsblkcnt_t; > > > >typedef __fsfilcnt_t fsfilcnt_t; ># 271 "/usr/include/sys/types.h" 3 4 ># 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 ># 23 "/usr/include/bits/pthreadtypes.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 24 "/usr/include/bits/pthreadtypes.h" 2 3 4 ># 50 "/usr/include/bits/pthreadtypes.h" 3 4 >typedef unsigned long int pthread_t; > > >typedef union >{ > char __size[56]; > long int __align; >} pthread_attr_t; > > > >typedef struct __pthread_internal_list >{ > struct __pthread_internal_list *__prev; > struct __pthread_internal_list *__next; >} __pthread_list_t; ># 76 "/usr/include/bits/pthreadtypes.h" 3 4 >typedef union >{ > struct __pthread_mutex_s > { > int __lock; > unsigned int __count; > int __owner; > > unsigned int __nusers; > > > > int __kind; > > int __spins; > __pthread_list_t __list; ># 101 "/usr/include/bits/pthreadtypes.h" 3 4 > } __data; > char __size[40]; > long int __align; >} pthread_mutex_t; > >typedef union >{ > char __size[4]; > int __align; >} pthread_mutexattr_t; > > > > >typedef union >{ > struct > { > int __lock; > unsigned int __futex; > __extension__ unsigned long long int __total_seq; > __extension__ unsigned long long int __wakeup_seq; > __extension__ unsigned long long int __woken_seq; > void *__mutex; > unsigned int __nwaiters; > unsigned int __broadcast_seq; > } __data; > char __size[48]; > __extension__ long long int __align; >} pthread_cond_t; > >typedef union >{ > char __size[4]; > int __align; >} pthread_condattr_t; > > > >typedef unsigned int pthread_key_t; > > > >typedef int pthread_once_t; > > > > > >typedef union >{ > > struct > { > int __lock; > unsigned int __nr_readers; > unsigned int __readers_wakeup; > unsigned int __writer_wakeup; > unsigned int __nr_readers_queued; > unsigned int __nr_writers_queued; > int __writer; > int __shared; > unsigned long int __pad1; > unsigned long int __pad2; > > > unsigned int __flags; > } __data; ># 187 "/usr/include/bits/pthreadtypes.h" 3 4 > char __size[56]; > long int __align; >} pthread_rwlock_t; > >typedef union >{ > char __size[8]; > long int __align; >} pthread_rwlockattr_t; > > > > > >typedef volatile int pthread_spinlock_t; > > > > >typedef union >{ > char __size[32]; > long int __align; >} pthread_barrier_t; > >typedef union >{ > char __size[4]; > int __align; >} pthread_barrierattr_t; ># 272 "/usr/include/sys/types.h" 2 3 4 > > > ># 321 "/usr/include/stdlib.h" 2 3 4 > > > > > > >extern long int random (void) __attribute__ ((__nothrow__)); > > >extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__)); > > > > > >extern char *initstate (unsigned int __seed, char *__statebuf, > size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); > > > >extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > > > > > > >struct random_data > { > int32_t *fptr; > int32_t *rptr; > int32_t *state; > int rand_type; > int rand_deg; > int rand_sep; > int32_t *end_ptr; > }; > >extern int random_r (struct random_data *__restrict __buf, > int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > >extern int srandom_r (unsigned int __seed, struct random_data *__buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); > >extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, > size_t __statelen, > struct random_data *__restrict __buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); > >extern int setstate_r (char *__restrict __statebuf, > struct random_data *__restrict __buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > > > > > >extern int rand (void) __attribute__ ((__nothrow__)); > >extern void srand (unsigned int __seed) __attribute__ ((__nothrow__)); > > > > >extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__)); > > > > > > > >extern double drand48 (void) __attribute__ ((__nothrow__)); >extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > >extern long int lrand48 (void) __attribute__ ((__nothrow__)); >extern long int nrand48 (unsigned short int __xsubi[3]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > >extern long int mrand48 (void) __attribute__ ((__nothrow__)); >extern long int jrand48 (unsigned short int __xsubi[3]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > >extern void srand48 (long int __seedval) __attribute__ ((__nothrow__)); >extern unsigned short int *seed48 (unsigned short int __seed16v[3]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > > > > >struct drand48_data > { > unsigned short int __x[3]; > unsigned short int __old_x[3]; > unsigned short int __c; > unsigned short int __init; > unsigned long long int __a; > }; > > >extern int drand48_r (struct drand48_data *__restrict __buffer, > double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int erand48_r (unsigned short int __xsubi[3], > struct drand48_data *__restrict __buffer, > double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int lrand48_r (struct drand48_data *__restrict __buffer, > long int *__restrict __result) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int nrand48_r (unsigned short int __xsubi[3], > struct drand48_data *__restrict __buffer, > long int *__restrict __result) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int mrand48_r (struct drand48_data *__restrict __buffer, > long int *__restrict __result) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int jrand48_r (unsigned short int __xsubi[3], > struct drand48_data *__restrict __buffer, > long int *__restrict __result) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int srand48_r (long int __seedval, struct drand48_data *__buffer) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); > >extern int seed48_r (unsigned short int __seed16v[3], > struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > >extern int lcong48_r (unsigned short int __param[7], > struct drand48_data *__buffer) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > > > > > > > > >extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); > >extern void *calloc (size_t __nmemb, size_t __size) > __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); > > > > > > > > > > >extern void *realloc (void *__ptr, size_t __size) > __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > >extern void free (void *__ptr) __attribute__ ((__nothrow__)); > > > > >extern void cfree (void *__ptr) __attribute__ ((__nothrow__)); > > > ># 1 "/usr/include/alloca.h" 1 3 4 ># 25 "/usr/include/alloca.h" 3 4 ># 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 1 3 4 ># 26 "/usr/include/alloca.h" 2 3 4 > > > > > > > >extern void *alloca (size_t __size) __attribute__ ((__nothrow__)); > > > > > > ># 498 "/usr/include/stdlib.h" 2 3 4 > > > > > >extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); > > > > >extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > >extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); > > > >extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); ># 531 "/usr/include/stdlib.h" 3 4 > > > > > >extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > > > > > >extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); ># 554 "/usr/include/stdlib.h" 3 4 > > > > > > >extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); > > > > > > >extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > >extern char *__secure_getenv (__const char *__name) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > > > > > >extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern int setenv (__const char *__name, __const char *__value, int __replace) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); > > >extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > > > > > >extern int clearenv (void) __attribute__ ((__nothrow__)); ># 606 "/usr/include/stdlib.h" 3 4 >extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); ># 620 "/usr/include/stdlib.h" 3 4 >extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); ># 642 "/usr/include/stdlib.h" 3 4 >extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); ># 663 "/usr/include/stdlib.h" 3 4 >extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); ># 712 "/usr/include/stdlib.h" 3 4 > > > > > >extern int system (__const char *__command) __attribute__ ((__warn_unused_result__)); > ># 734 "/usr/include/stdlib.h" 3 4 >extern char *realpath (__const char *__restrict __name, > char *__restrict __resolved) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > > > >typedef int (*__compar_fn_t) (__const void *, __const void *); ># 752 "/usr/include/stdlib.h" 3 4 > > > >extern void *bsearch (__const void *__key, __const void *__base, > size_t __nmemb, size_t __size, __compar_fn_t __compar) > __attribute__ ((__nonnull__ (1, 2, 5))) __attribute__ ((__warn_unused_result__)); > > > >extern void qsort (void *__base, size_t __nmemb, size_t __size, > __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); ># 771 "/usr/include/stdlib.h" 3 4 >extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); >extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); > > > >__extension__ extern long long int llabs (long long int __x) > __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); > > > > > > > >extern div_t div (int __numer, int __denom) > __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); >extern ldiv_t ldiv (long int __numer, long int __denom) > __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); > > > > >__extension__ extern lldiv_t lldiv (long long int __numer, > long long int __denom) > __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); > ># 808 "/usr/include/stdlib.h" 3 4 >extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, > int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); > > > > >extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, > int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); > > > > >extern char *gcvt (double __value, int __ndigit, char *__buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__)); > > > > >extern char *qecvt (long double __value, int __ndigit, > int *__restrict __decpt, int *__restrict __sign) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); >extern char *qfcvt (long double __value, int __ndigit, > int *__restrict __decpt, int *__restrict __sign) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); >extern char *qgcvt (long double __value, int __ndigit, char *__buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__)); > > > > >extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, > int *__restrict __sign, char *__restrict __buf, > size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); >extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, > int *__restrict __sign, char *__restrict __buf, > size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); > >extern int qecvt_r (long double __value, int __ndigit, > int *__restrict __decpt, int *__restrict __sign, > char *__restrict __buf, size_t __len) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); >extern int qfcvt_r (long double __value, int __ndigit, > int *__restrict __decpt, int *__restrict __sign, > char *__restrict __buf, size_t __len) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); > > > > > > > >extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > >extern int mbtowc (wchar_t *__restrict __pwc, > __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > >extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > >extern size_t mbstowcs (wchar_t *__restrict __pwcs, > __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)); > >extern size_t wcstombs (char *__restrict __s, > __const wchar_t *__restrict __pwcs, size_t __n) > __attribute__ ((__nothrow__)); > > > > > > > > >extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); ># 896 "/usr/include/stdlib.h" 3 4 >extern int getsubopt (char **__restrict __optionp, > char *__const *__restrict __tokens, > char **__restrict __valuep) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__)); ># 948 "/usr/include/stdlib.h" 3 4 >extern int getloadavg (double __loadavg[], int __nelem) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > > > > ># 1 "/usr/include/bits/stdlib.h" 1 3 4 ># 24 "/usr/include/bits/stdlib.h" 3 4 >extern char *__realpath_chk (__const char *__restrict __name, > char *__restrict __resolved, > size_t __resolvedlen) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern char *__realpath_alias (__const char *__restrict __name, char *__restrict __resolved) __asm__ ("" "realpath") __attribute__ ((__nothrow__)) > > __attribute__ ((__warn_unused_result__)); >extern char *__realpath_chk_warn (__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __asm__ ("" "__realpath_chk") __attribute__ ((__nothrow__)) > > > __attribute__ ((__warn_unused_result__)) > __attribute__((__warning__ ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer"))) > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * >__attribute__ ((__nothrow__)) realpath (__const char *__restrict __name, char *__restrict __resolved) >{ > if (__builtin_object_size (__resolved, 2 > 1) != (size_t) -1) > { > > > > > return __realpath_chk (__name, __resolved, __builtin_object_size (__resolved, 2 > 1)); > } > > return __realpath_alias (__name, __resolved); >} > > >extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, > size_t __nreal) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int __ptsname_r_alias (int __fd, char *__buf, size_t __buflen) __asm__ ("" "ptsname_r") __attribute__ ((__nothrow__)) > > __attribute__ ((__nonnull__ (2))); >extern int __ptsname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__ptsname_r_chk") __attribute__ ((__nothrow__)) > > > __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ptsname_r called with buflen bigger than " "size of buf"))) > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) ptsname_r (int __fd, char *__buf, size_t __buflen) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__buflen)) > return __ptsname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > if (__buflen > __builtin_object_size (__buf, 2 > 1)) > return __ptsname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > } > return __ptsname_r_alias (__fd, __buf, __buflen); >} > > >extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int __wctomb_alias (char *__s, wchar_t __wchar) __asm__ ("" "wctomb") __attribute__ ((__nothrow__)) > __attribute__ ((__warn_unused_result__)); > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) int >__attribute__ ((__nothrow__)) wctomb (char *__s, wchar_t __wchar) >{ > > > > > > > > if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1)) > return __wctomb_chk (__s, __wchar, __builtin_object_size (__s, 2 > 1)); > return __wctomb_alias (__s, __wchar); >} > > >extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, > __const char *__restrict __src, > size_t __len, size_t __dstlen) __attribute__ ((__nothrow__)); >extern size_t __mbstowcs_alias (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) __asm__ ("" "mbstowcs") __attribute__ ((__nothrow__)) > > > ; >extern size_t __mbstowcs_chk_warn (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__mbstowcs_chk") __attribute__ ((__nothrow__)) > > > > __attribute__((__warning__ ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)"))) > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) size_t >__attribute__ ((__nothrow__)) mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) > >{ > if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__len)) > return __mbstowcs_chk (__dst, __src, __len, > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t)); > > if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t)) > return __mbstowcs_chk_warn (__dst, __src, __len, > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t)); > } > return __mbstowcs_alias (__dst, __src, __len); >} > > >extern size_t __wcstombs_chk (char *__restrict __dst, > __const wchar_t *__restrict __src, > size_t __len, size_t __dstlen) __attribute__ ((__nothrow__)); >extern size_t __wcstombs_alias (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) __asm__ ("" "wcstombs") __attribute__ ((__nothrow__)) > > > ; >extern size_t __wcstombs_chk_warn (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__wcstombs_chk") __attribute__ ((__nothrow__)) > > > > __attribute__((__warning__ ("wcstombs called with dst buffer smaller than len"))); > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) size_t >__attribute__ ((__nothrow__)) wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) > >{ > if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__len)) > return __wcstombs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1)); > if (__len > __builtin_object_size (__dst, 2 > 1)) > return __wcstombs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1)); > } > return __wcstombs_alias (__dst, __src, __len); >} ># 956 "/usr/include/stdlib.h" 2 3 4 ># 964 "/usr/include/stdlib.h" 3 4 > ># 244 "lib/fidlib-0.9.9/fidlib.c" 2 ># 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stdarg.h" 1 3 4 ># 40 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stdarg.h" 3 4 >typedef __builtin_va_list __gnuc_va_list; ># 102 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stdarg.h" 3 4 >typedef __gnuc_va_list va_list; ># 245 "lib/fidlib-0.9.9/fidlib.c" 2 ># 1 "/usr/include/stdio.h" 1 3 4 ># 30 "/usr/include/stdio.h" 3 4 > > > > ># 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 1 3 4 ># 35 "/usr/include/stdio.h" 2 3 4 ># 45 "/usr/include/stdio.h" 3 4 >struct _IO_FILE; > > > >typedef struct _IO_FILE FILE; > > > > > ># 65 "/usr/include/stdio.h" 3 4 >typedef struct _IO_FILE __FILE; ># 75 "/usr/include/stdio.h" 3 4 ># 1 "/usr/include/libio.h" 1 3 4 ># 32 "/usr/include/libio.h" 3 4 ># 1 "/usr/include/_G_config.h" 1 3 4 ># 15 "/usr/include/_G_config.h" 3 4 ># 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 1 3 4 ># 16 "/usr/include/_G_config.h" 2 3 4 > > > > ># 1 "/usr/include/wchar.h" 1 3 4 ># 83 "/usr/include/wchar.h" 3 4 >typedef struct >{ > int __count; > union > { > > unsigned int __wch; > > > > char __wchb[4]; > } __value; >} __mbstate_t; ># 21 "/usr/include/_G_config.h" 2 3 4 > >typedef struct >{ > __off_t __pos; > __mbstate_t __state; >} _G_fpos_t; >typedef struct >{ > __off64_t __pos; > __mbstate_t __state; >} _G_fpos64_t; ># 53 "/usr/include/_G_config.h" 3 4 >typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); >typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); >typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); >typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); ># 33 "/usr/include/libio.h" 2 3 4 ># 172 "/usr/include/libio.h" 3 4 >struct _IO_jump_t; struct _IO_FILE; ># 182 "/usr/include/libio.h" 3 4 >typedef void _IO_lock_t; > > > > > >struct _IO_marker { > struct _IO_marker *_next; > struct _IO_FILE *_sbuf; > > > > int _pos; ># 205 "/usr/include/libio.h" 3 4 >}; > > >enum __codecvt_result >{ > __codecvt_ok, > __codecvt_partial, > __codecvt_error, > __codecvt_noconv >}; ># 273 "/usr/include/libio.h" 3 4 >struct _IO_FILE { > int _flags; > > > > > char* _IO_read_ptr; > char* _IO_read_end; > char* _IO_read_base; > char* _IO_write_base; > char* _IO_write_ptr; > char* _IO_write_end; > char* _IO_buf_base; > char* _IO_buf_end; > > char *_IO_save_base; > char *_IO_backup_base; > char *_IO_save_end; > > struct _IO_marker *_markers; > > struct _IO_FILE *_chain; > > int _fileno; > > > > int _flags2; > > __off_t _old_offset; > > > > unsigned short _cur_column; > signed char _vtable_offset; > char _shortbuf[1]; > > > > _IO_lock_t *_lock; ># 321 "/usr/include/libio.h" 3 4 > __off64_t _offset; ># 330 "/usr/include/libio.h" 3 4 > void *__pad1; > void *__pad2; > void *__pad3; > void *__pad4; > size_t __pad5; > > int _mode; > > char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; > >}; > > >typedef struct _IO_FILE _IO_FILE; > > >struct _IO_FILE_plus; > >extern struct _IO_FILE_plus _IO_2_1_stdin_; >extern struct _IO_FILE_plus _IO_2_1_stdout_; >extern struct _IO_FILE_plus _IO_2_1_stderr_; ># 366 "/usr/include/libio.h" 3 4 >typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); > > > > > > > >typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, > size_t __n); > > > > > > > >typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); > > >typedef int __io_close_fn (void *__cookie); ># 418 "/usr/include/libio.h" 3 4 >extern int __underflow (_IO_FILE *); >extern int __uflow (_IO_FILE *); >extern int __overflow (_IO_FILE *, int); ># 462 "/usr/include/libio.h" 3 4 >extern int _IO_getc (_IO_FILE *__fp); >extern int _IO_putc (int __c, _IO_FILE *__fp); >extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); >extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); > >extern int _IO_peekc_locked (_IO_FILE *__fp); > > > > > >extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); >extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); >extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); ># 492 "/usr/include/libio.h" 3 4 >extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, > __gnuc_va_list, int *__restrict); >extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, > __gnuc_va_list); >extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t); >extern size_t _IO_sgetn (_IO_FILE *, void *, size_t); > >extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int); >extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int); > >extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); ># 76 "/usr/include/stdio.h" 2 3 4 ># 109 "/usr/include/stdio.h" 3 4 > > >typedef _G_fpos_t fpos_t; > > > > ># 161 "/usr/include/stdio.h" 3 4 ># 1 "/usr/include/bits/stdio_lim.h" 1 3 4 ># 162 "/usr/include/stdio.h" 2 3 4 > > > >extern struct _IO_FILE *stdin; >extern struct _IO_FILE *stdout; >extern struct _IO_FILE *stderr; > > > > > > > >extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); > >extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); > > > > >extern int renameat (int __oldfd, __const char *__old, int __newfd, > __const char *__new) __attribute__ ((__nothrow__)); > > > > > > > > >extern FILE *tmpfile (void) __attribute__ ((__warn_unused_result__)); ># 206 "/usr/include/stdio.h" 3 4 >extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > > >extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); ># 224 "/usr/include/stdio.h" 3 4 >extern char *tempnam (__const char *__dir, __const char *__pfx) > __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); > > > > > > > > >extern int fclose (FILE *__stream); > > > > >extern int fflush (FILE *__stream); > ># 249 "/usr/include/stdio.h" 3 4 >extern int fflush_unlocked (FILE *__stream); ># 263 "/usr/include/stdio.h" 3 4 > > > > > > >extern FILE *fopen (__const char *__restrict __filename, > __const char *__restrict __modes) __attribute__ ((__warn_unused_result__)); > > > > >extern FILE *freopen (__const char *__restrict __filename, > __const char *__restrict __modes, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); ># 292 "/usr/include/stdio.h" 3 4 > ># 303 "/usr/include/stdio.h" 3 4 >extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); ># 316 "/usr/include/stdio.h" 3 4 >extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) > __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > >extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > > > >extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); > > > >extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, > int __modes, size_t __n) __attribute__ ((__nothrow__)); > > > > > >extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, > size_t __size) __attribute__ ((__nothrow__)); > > >extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); > > > > > > > > >extern int fprintf (FILE *__restrict __stream, > __const char *__restrict __format, ...); > > > > >extern int printf (__const char *__restrict __format, ...); > >extern int sprintf (char *__restrict __s, > __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); > > > > > >extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, > __gnuc_va_list __arg); > > > > >extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); > >extern int vsprintf (char *__restrict __s, __const char *__restrict __format, > __gnuc_va_list __arg) __attribute__ ((__nothrow__)); > > > > > >extern int snprintf (char *__restrict __s, size_t __maxlen, > __const char *__restrict __format, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); > >extern int vsnprintf (char *__restrict __s, size_t __maxlen, > __const char *__restrict __format, __gnuc_va_list __arg) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); > ># 414 "/usr/include/stdio.h" 3 4 >extern int vdprintf (int __fd, __const char *__restrict __fmt, > __gnuc_va_list __arg) > __attribute__ ((__format__ (__printf__, 2, 0))); >extern int dprintf (int __fd, __const char *__restrict __fmt, ...) > __attribute__ ((__format__ (__printf__, 2, 3))); > > > > > > > > >extern int fscanf (FILE *__restrict __stream, > __const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__)); > > > > >extern int scanf (__const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__)); > >extern int sscanf (__const char *__restrict __s, > __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); ># 445 "/usr/include/stdio.h" 3 4 >extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") > > __attribute__ ((__warn_unused_result__)); >extern int scanf (__const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") > __attribute__ ((__warn_unused_result__)); >extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__)) > > ; ># 465 "/usr/include/stdio.h" 3 4 > > > > > > > > >extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, > __gnuc_va_list __arg) > __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__)); > > > > > >extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) > __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__)); > > >extern int vsscanf (__const char *__restrict __s, > __const char *__restrict __format, __gnuc_va_list __arg) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0))); ># 496 "/usr/include/stdio.h" 3 4 >extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf") > > > > __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__)); >extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf") > > __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__)); >extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__)) > > > > __attribute__ ((__format__ (__scanf__, 2, 0))); ># 524 "/usr/include/stdio.h" 3 4 > > > > > > > > > >extern int fgetc (FILE *__stream); >extern int getc (FILE *__stream); > > > > > >extern int getchar (void); > ># 552 "/usr/include/stdio.h" 3 4 >extern int getc_unlocked (FILE *__stream); >extern int getchar_unlocked (void); ># 563 "/usr/include/stdio.h" 3 4 >extern int fgetc_unlocked (FILE *__stream); > > > > > > > > > > > >extern int fputc (int __c, FILE *__stream); >extern int putc (int __c, FILE *__stream); > > > > > >extern int putchar (int __c); > ># 596 "/usr/include/stdio.h" 3 4 >extern int fputc_unlocked (int __c, FILE *__stream); > > > > > > > >extern int putc_unlocked (int __c, FILE *__stream); >extern int putchar_unlocked (int __c); > > > > > > >extern int getw (FILE *__stream); > > >extern int putw (int __w, FILE *__stream); > > > > > > > > >extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) > __attribute__ ((__warn_unused_result__)); > > > > > > >extern char *gets (char *__s) __attribute__ ((__warn_unused_result__)); > ># 658 "/usr/include/stdio.h" 3 4 >extern __ssize_t __getdelim (char **__restrict __lineptr, > size_t *__restrict __n, int __delimiter, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); >extern __ssize_t getdelim (char **__restrict __lineptr, > size_t *__restrict __n, int __delimiter, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); > > > > > > > >extern __ssize_t getline (char **__restrict __lineptr, > size_t *__restrict __n, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); > > > > > > > > >extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); > > > > > >extern int puts (__const char *__s); > > > > > > >extern int ungetc (int __c, FILE *__stream); > > > > > > >extern size_t fread (void *__restrict __ptr, size_t __size, > size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); > > > > >extern size_t fwrite (__const void *__restrict __ptr, size_t __size, > size_t __n, FILE *__restrict __s) __attribute__ ((__warn_unused_result__)); > ># 730 "/usr/include/stdio.h" 3 4 >extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, > size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); >extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, > size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); > > > > > > > > >extern int fseek (FILE *__stream, long int __off, int __whence); > > > > >extern long int ftell (FILE *__stream) __attribute__ ((__warn_unused_result__)); > > > > >extern void rewind (FILE *__stream); > ># 766 "/usr/include/stdio.h" 3 4 >extern int fseeko (FILE *__stream, __off_t __off, int __whence); > > > > >extern __off_t ftello (FILE *__stream) __attribute__ ((__warn_unused_result__)); ># 785 "/usr/include/stdio.h" 3 4 > > > > > > >extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); > > > > >extern int fsetpos (FILE *__stream, __const fpos_t *__pos); ># 808 "/usr/include/stdio.h" 3 4 > ># 817 "/usr/include/stdio.h" 3 4 > > >extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); > >extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > >extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > >extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); >extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > > > > > >extern void perror (__const char *__s); > > > > > > ># 1 "/usr/include/bits/sys_errlist.h" 1 3 4 ># 27 "/usr/include/bits/sys_errlist.h" 3 4 >extern int sys_nerr; >extern __const char *__const sys_errlist[]; ># 847 "/usr/include/stdio.h" 2 3 4 > > > > >extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > > > >extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); ># 866 "/usr/include/stdio.h" 3 4 >extern FILE *popen (__const char *__command, __const char *__modes) __attribute__ ((__warn_unused_result__)); > > > > > >extern int pclose (FILE *__stream); > > > > > >extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); ># 906 "/usr/include/stdio.h" 3 4 >extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); > > > >extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > > >extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); ># 927 "/usr/include/stdio.h" 3 4 ># 1 "/usr/include/bits/stdio.h" 1 3 4 ># 44 "/usr/include/bits/stdio.h" 3 4 >extern __inline int >getchar (void) >{ > return _IO_getc (stdin); >} > > > > >extern __inline int >fgetc_unlocked (FILE *__fp) >{ > return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); >} > > > > > >extern __inline int >getc_unlocked (FILE *__fp) >{ > return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); >} > > >extern __inline int >getchar_unlocked (void) >{ > return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); >} > > > > >extern __inline int >putchar (int __c) >{ > return _IO_putc (__c, stdout); >} > > > > >extern __inline int >fputc_unlocked (int __c, FILE *__stream) >{ > return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); >} > > > > > >extern __inline int >putc_unlocked (int __c, FILE *__stream) >{ > return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); >} > > >extern __inline int >putchar_unlocked (int __c) >{ > return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); >} ># 125 "/usr/include/bits/stdio.h" 3 4 >extern __inline int >__attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) >{ > return (((__stream)->_flags & 0x10) != 0); >} > > >extern __inline int >__attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) >{ > return (((__stream)->_flags & 0x20) != 0); >} ># 928 "/usr/include/stdio.h" 2 3 4 > > ># 1 "/usr/include/bits/stdio2.h" 1 3 4 ># 24 "/usr/include/bits/stdio2.h" 3 4 >extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, > __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); >extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, > __const char *__restrict __format, > __gnuc_va_list __ap) __attribute__ ((__nothrow__)); > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) sprintf (char *__restrict __s, __const char *__restrict __fmt, ...) >{ > return __builtin___sprintf_chk (__s, 2 - 1, > __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ()); >} > > > > > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) vsprintf (char *__restrict __s, __const char *__restrict __fmt, __gnuc_va_list __ap) > >{ > return __builtin___vsprintf_chk (__s, 2 - 1, > __builtin_object_size (__s, 2 > 1), __fmt, __ap); >} > > > >extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, > size_t __slen, __const char *__restrict __format, > ...) __attribute__ ((__nothrow__)); >extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, > size_t __slen, __const char *__restrict __format, > __gnuc_va_list __ap) __attribute__ ((__nothrow__)); > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) snprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, ...) > >{ > return __builtin___snprintf_chk (__s, __n, 2 - 1, > __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ()); >} > > > > > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) vsnprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, __gnuc_va_list __ap) > >{ > return __builtin___vsnprintf_chk (__s, __n, 2 - 1, > __builtin_object_size (__s, 2 > 1), __fmt, __ap); >} > > > > > >extern int __fprintf_chk (FILE *__restrict __stream, int __flag, > __const char *__restrict __format, ...); >extern int __printf_chk (int __flag, __const char *__restrict __format, ...); >extern int __vfprintf_chk (FILE *__restrict __stream, int __flag, > __const char *__restrict __format, __gnuc_va_list __ap); >extern int __vprintf_chk (int __flag, __const char *__restrict __format, > __gnuc_va_list __ap); > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >fprintf (FILE *__restrict __stream, __const char *__restrict __fmt, ...) >{ > return __fprintf_chk (__stream, 2 - 1, __fmt, > __builtin_va_arg_pack ()); >} > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >printf (__const char *__restrict __fmt, ...) >{ > return __printf_chk (2 - 1, __fmt, __builtin_va_arg_pack ()); >} > > > > > > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >vprintf (__const char *__restrict __fmt, __gnuc_va_list __ap) >{ > > return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap); > > > >} > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >vfprintf (FILE *__restrict __stream, > __const char *__restrict __fmt, __gnuc_va_list __ap) >{ > return __vfprintf_chk (__stream, 2 - 1, __fmt, __ap); >} ># 220 "/usr/include/bits/stdio2.h" 3 4 >extern char *__gets_chk (char *__str, size_t) __attribute__ ((__warn_unused_result__)); >extern char *__gets_warn (char *__str) __asm__ ("" "gets") > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use fgets or getline instead, gets can't " "specify buffer size"))) > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * >gets (char *__str) >{ > if (__builtin_object_size (__str, 2 > 1) != (size_t) -1) > return __gets_chk (__str, __builtin_object_size (__str, 2 > 1)); > return __gets_warn (__str); >} > >extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); >extern char *__fgets_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets") > > __attribute__ ((__warn_unused_result__)); >extern char *__fgets_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_chk") > > > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets called with bigger size than length " "of destination buffer"))) > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * >fgets (char *__restrict __s, int __n, FILE *__restrict __stream) >{ > if (__builtin_object_size (__s, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__n) || __n <= 0) > return __fgets_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream); > > if ((size_t) __n > __builtin_object_size (__s, 2 > 1)) > return __fgets_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream); > } > return __fgets_alias (__s, __n, __stream); >} > >extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen, > size_t __size, size_t __n, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); >extern size_t __fread_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread") > > > __attribute__ ((__warn_unused_result__)); >extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk") > > > > > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer"))) > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t >fread (void *__restrict __ptr, size_t __size, size_t __n, > FILE *__restrict __stream) >{ > if (__builtin_object_size (__ptr, 0) != (size_t) -1) > { > if (!__builtin_constant_p (__size) > || !__builtin_constant_p (__n) > || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2))) > return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); > > if (__size * __n > __builtin_object_size (__ptr, 0)) > return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); > } > return __fread_alias (__ptr, __size, __n, __stream); >} ># 319 "/usr/include/bits/stdio2.h" 3 4 >extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen, > size_t __size, size_t __n, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); >extern size_t __fread_unlocked_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread_unlocked") > > > __attribute__ ((__warn_unused_result__)); >extern size_t __fread_unlocked_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_unlocked_chk") > > > > > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer"))) > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t >fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, > FILE *__restrict __stream) >{ > if (__builtin_object_size (__ptr, 0) != (size_t) -1) > { > if (!__builtin_constant_p (__size) > || !__builtin_constant_p (__n) > || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2))) > return __fread_unlocked_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, > __stream); > > if (__size * __n > __builtin_object_size (__ptr, 0)) > return __fread_unlocked_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, > __stream); > } > > > if (__builtin_constant_p (__size) > && __builtin_constant_p (__n) > && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2)) > && __size * __n <= 8) > { > size_t __cnt = __size * __n; > char *__cptr = (char *) __ptr; > if (__cnt == 0) > return 0; > > for (; __cnt > 0; --__cnt) > { > int __c = (__builtin_expect (((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow (__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++); > if (__c == (-1)) > break; > *__cptr++ = __c; > } > return (__cptr - (char *) __ptr) / __size; > } > > return __fread_unlocked_alias (__ptr, __size, __n, __stream); >} ># 931 "/usr/include/stdio.h" 2 3 4 > > > > > > ># 246 "lib/fidlib-0.9.9/fidlib.c" 2 ># 1 "/usr/include/string.h" 1 3 4 ># 29 "/usr/include/string.h" 3 4 > > > > > ># 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/stddef.h" 1 3 4 ># 35 "/usr/include/string.h" 2 3 4 > > > > > > > > > >extern void *memcpy (void *__restrict __dest, > __const void *__restrict __src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern void *memmove (void *__dest, __const void *__src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > > > > > >extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, > int __c, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > > > > >extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > >extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); ># 95 "/usr/include/string.h" 3 4 >extern void *memchr (__const void *__s, int __c, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > ># 126 "/usr/include/string.h" 3 4 > > >extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > >extern char *strncpy (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern char *strcat (char *__restrict __dest, __const char *__restrict __src) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > >extern char *strncat (char *__restrict __dest, __const char *__restrict __src, > size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int strcmp (__const char *__s1, __const char *__s2) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > >extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int strcoll (__const char *__s1, __const char *__s2) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > >extern size_t strxfrm (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); > > > > > > ># 1 "/usr/include/xlocale.h" 1 3 4 ># 28 "/usr/include/xlocale.h" 3 4 >typedef struct __locale_struct >{ > > struct __locale_data *__locales[13]; > > > const unsigned short int *__ctype_b; > const int *__ctype_tolower; > const int *__ctype_toupper; > > > const char *__names[13]; >} *__locale_t; > > >typedef __locale_t locale_t; ># 163 "/usr/include/string.h" 2 3 4 > > >extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); > >extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, > __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); > > > > > >extern char *strdup (__const char *__s) > __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); > > > > > > >extern char *strndup (__const char *__string, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); ># 210 "/usr/include/string.h" 3 4 > ># 235 "/usr/include/string.h" 3 4 >extern char *strchr (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); ># 262 "/usr/include/string.h" 3 4 >extern char *strrchr (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > ># 281 "/usr/include/string.h" 3 4 > > > >extern size_t strcspn (__const char *__s, __const char *__reject) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern size_t strspn (__const char *__s, __const char *__accept) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); ># 314 "/usr/include/string.h" 3 4 >extern char *strpbrk (__const char *__s, __const char *__accept) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); ># 342 "/usr/include/string.h" 3 4 >extern char *strstr (__const char *__haystack, __const char *__needle) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > > > >extern char *strtok (char *__restrict __s, __const char *__restrict __delim) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); > > > > >extern char *__strtok_r (char *__restrict __s, > __const char *__restrict __delim, > char **__restrict __save_ptr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); > >extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, > char **__restrict __save_ptr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); ># 397 "/usr/include/string.h" 3 4 > > >extern size_t strlen (__const char *__s) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern size_t strnlen (__const char *__string, size_t __maxlen) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); > ># 427 "/usr/include/string.h" 3 4 >extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) > > __attribute__ ((__nonnull__ (2))); ># 445 "/usr/include/string.h" 3 4 >extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__)); > > > > > >extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > > >extern void bcopy (__const void *__src, void *__dest, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > > >extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); ># 489 "/usr/include/string.h" 3 4 >extern char *index (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); ># 517 "/usr/include/string.h" 3 4 >extern char *rindex (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > >extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); ># 536 "/usr/include/string.h" 3 4 >extern int strcasecmp (__const char *__s1, __const char *__s2) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); ># 559 "/usr/include/string.h" 3 4 >extern char *strsep (char **__restrict __stringp, > __const char *__restrict __delim) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > > > >extern char *strsignal (int __sig) __attribute__ ((__nothrow__)); > > >extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > > > >extern char *__stpncpy (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern char *stpncpy (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); ># 634 "/usr/include/string.h" 3 4 ># 1 "/usr/include/bits/string.h" 1 3 4 ># 635 "/usr/include/string.h" 2 3 4 > > ># 1 "/usr/include/bits/string2.h" 1 3 4 ># 394 "/usr/include/bits/string2.h" 3 4 >extern void *__rawmemchr (const void *__s, int __c); ># 969 "/usr/include/bits/string2.h" 3 4 >extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); >extern __inline size_t >__strcspn_c1 (__const char *__s, int __reject) >{ > register size_t __result = 0; > while (__s[__result] != '\0' && __s[__result] != __reject) > ++__result; > return __result; >} > >extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, > int __reject2); >extern __inline size_t >__strcspn_c2 (__const char *__s, int __reject1, int __reject2) >{ > register size_t __result = 0; > while (__s[__result] != '\0' && __s[__result] != __reject1 > && __s[__result] != __reject2) > ++__result; > return __result; >} > >extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, > int __reject2, int __reject3); >extern __inline size_t >__strcspn_c3 (__const char *__s, int __reject1, int __reject2, > int __reject3) >{ > register size_t __result = 0; > while (__s[__result] != '\0' && __s[__result] != __reject1 > && __s[__result] != __reject2 && __s[__result] != __reject3) > ++__result; > return __result; >} ># 1045 "/usr/include/bits/string2.h" 3 4 >extern __inline size_t __strspn_c1 (__const char *__s, int __accept); >extern __inline size_t >__strspn_c1 (__const char *__s, int __accept) >{ > register size_t __result = 0; > > while (__s[__result] == __accept) > ++__result; > return __result; >} > >extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, > int __accept2); >extern __inline size_t >__strspn_c2 (__const char *__s, int __accept1, int __accept2) >{ > register size_t __result = 0; > > while (__s[__result] == __accept1 || __s[__result] == __accept2) > ++__result; > return __result; >} > >extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, > int __accept2, int __accept3); >extern __inline size_t >__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) >{ > register size_t __result = 0; > > while (__s[__result] == __accept1 || __s[__result] == __accept2 > || __s[__result] == __accept3) > ++__result; > return __result; >} ># 1121 "/usr/include/bits/string2.h" 3 4 >extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, > int __accept2); >extern __inline char * >__strpbrk_c2 (__const char *__s, int __accept1, int __accept2) >{ > > while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) > ++__s; > return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; >} > >extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, > int __accept2, int __accept3); >extern __inline char * >__strpbrk_c3 (__const char *__s, int __accept1, int __accept2, > int __accept3) >{ > > while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 > && *__s != __accept3) > ++__s; > return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; >} ># 1172 "/usr/include/bits/string2.h" 3 4 >extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); >extern __inline char * >__strtok_r_1c (char *__s, char __sep, char **__nextp) >{ > char *__result; > if (__s == ((void *)0)) > __s = *__nextp; > while (*__s == __sep) > ++__s; > __result = ((void *)0); > if (*__s != '\0') > { > __result = __s++; > while (*__s != '\0') > if (*__s++ == __sep) > { > __s[-1] = '\0'; > break; > } > } > *__nextp = __s; > return __result; >} ># 1204 "/usr/include/bits/string2.h" 3 4 >extern char *__strsep_g (char **__stringp, __const char *__delim); ># 1222 "/usr/include/bits/string2.h" 3 4 >extern __inline char *__strsep_1c (char **__s, char __reject); >extern __inline char * >__strsep_1c (char **__s, char __reject) >{ > register char *__retval = *__s; > if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) > *(*__s)++ = '\0'; > return __retval; >} > >extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); >extern __inline char * >__strsep_2c (char **__s, char __reject1, char __reject2) >{ > register char *__retval = *__s; > if (__retval != ((void *)0)) > { > register char *__cp = __retval; > while (1) > { > if (*__cp == '\0') > { > __cp = ((void *)0); > break; > } > if (*__cp == __reject1 || *__cp == __reject2) > { > *__cp++ = '\0'; > break; > } > ++__cp; > } > *__s = __cp; > } > return __retval; >} > >extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, > char __reject3); >extern __inline char * >__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) >{ > register char *__retval = *__s; > if (__retval != ((void *)0)) > { > register char *__cp = __retval; > while (1) > { > if (*__cp == '\0') > { > __cp = ((void *)0); > break; > } > if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) > { > *__cp++ = '\0'; > break; > } > ++__cp; > } > *__s = __cp; > } > return __retval; >} ># 1303 "/usr/include/bits/string2.h" 3 4 >extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); ># 1322 "/usr/include/bits/string2.h" 3 4 >extern char *__strndup (__const char *__string, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); ># 638 "/usr/include/string.h" 2 3 4 > > > > ># 1 "/usr/include/bits/string3.h" 1 3 4 ># 23 "/usr/include/bits/string3.h" 3 4 >extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters"))) > ; ># 48 "/usr/include/bits/string3.h" 3 4 >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void * >__attribute__ ((__nothrow__)) memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) > >{ > return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); >} > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void * >__attribute__ ((__nothrow__)) memmove (void *__dest, __const void *__src, size_t __len) >{ > return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); >} ># 76 "/usr/include/bits/string3.h" 3 4 >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void * >__attribute__ ((__nothrow__)) memset (void *__dest, int __ch, size_t __len) >{ > if (__builtin_constant_p (__len) && __len == 0 > && (!__builtin_constant_p (__ch) || __ch != 0)) > { > __warn_memset_zero_len (); > return __dest; > } > return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0)); >} > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void >__attribute__ ((__nothrow__)) bcopy (__const void *__src, void *__dest, size_t __len) >{ > (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); >} > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void >__attribute__ ((__nothrow__)) bzero (void *__dest, size_t __len) >{ > (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0)); >} > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char * >__attribute__ ((__nothrow__)) strcpy (char *__restrict __dest, __const char *__restrict __src) >{ > return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1)); >} ># 117 "/usr/include/bits/string3.h" 3 4 >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char * >__attribute__ ((__nothrow__)) strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __len) > >{ > return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1)); >} > > >extern char *__stpncpy_chk (char *__dest, __const char *__src, size_t __n, > size_t __destlen) __attribute__ ((__nothrow__)); >extern char *__stpncpy_alias (char *__dest, __const char *__src, size_t __n) __asm__ ("" "stpncpy") __attribute__ ((__nothrow__)) > > ; > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char * >__attribute__ ((__nothrow__)) stpncpy (char *__dest, __const char *__src, size_t __n) >{ > if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1 > && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1))) > return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1)); > return __stpncpy_alias (__dest, __src, __n); >} > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char * >__attribute__ ((__nothrow__)) strcat (char *__restrict __dest, __const char *__restrict __src) >{ > return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1)); >} > > >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char * >__attribute__ ((__nothrow__)) strncat (char *__restrict __dest, __const char *__restrict __src, size_t __len) > >{ > return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1)); >} ># 643 "/usr/include/string.h" 2 3 4 > > > > ># 247 "lib/fidlib-0.9.9/fidlib.c" 2 ># 1 "/usr/include/ctype.h" 1 3 4 ># 30 "/usr/include/ctype.h" 3 4 > ># 48 "/usr/include/ctype.h" 3 4 >enum >{ > _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)), > _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)), > _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)), > _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)), > _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)), > _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)), > _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)), > _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)), > _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)), > _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)), > _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)), > _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8)) >}; ># 81 "/usr/include/ctype.h" 3 4 >extern __const unsigned short int **__ctype_b_loc (void) > __attribute__ ((__nothrow__)) __attribute__ ((__const)); >extern __const __int32_t **__ctype_tolower_loc (void) > __attribute__ ((__nothrow__)) __attribute__ ((__const)); >extern __const __int32_t **__ctype_toupper_loc (void) > __attribute__ ((__nothrow__)) __attribute__ ((__const)); ># 96 "/usr/include/ctype.h" 3 4 > > > > > > >extern int isalnum (int) __attribute__ ((__nothrow__)); >extern int isalpha (int) __attribute__ ((__nothrow__)); >extern int iscntrl (int) __attribute__ ((__nothrow__)); >extern int isdigit (int) __attribute__ ((__nothrow__)); >extern int islower (int) __attribute__ ((__nothrow__)); >extern int isgraph (int) __attribute__ ((__nothrow__)); >extern int isprint (int) __attribute__ ((__nothrow__)); >extern int ispunct (int) __attribute__ ((__nothrow__)); >extern int isspace (int) __attribute__ ((__nothrow__)); >extern int isupper (int) __attribute__ ((__nothrow__)); >extern int isxdigit (int) __attribute__ ((__nothrow__)); > > > >extern int tolower (int __c) __attribute__ ((__nothrow__)); > > >extern int toupper (int __c) __attribute__ ((__nothrow__)); > > > > > > > > >extern int isblank (int) __attribute__ ((__nothrow__)); > > ># 142 "/usr/include/ctype.h" 3 4 >extern int isascii (int __c) __attribute__ ((__nothrow__)); > > > >extern int toascii (int __c) __attribute__ ((__nothrow__)); > > > >extern int _toupper (int) __attribute__ ((__nothrow__)); >extern int _tolower (int) __attribute__ ((__nothrow__)); ># 190 "/usr/include/ctype.h" 3 4 >extern __inline int >__attribute__ ((__nothrow__)) tolower (int __c) >{ > return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; >} > >extern __inline int >__attribute__ ((__nothrow__)) toupper (int __c) >{ > return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; >} ># 247 "/usr/include/ctype.h" 3 4 >extern int isalnum_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int isalpha_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int iscntrl_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int isdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int islower_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int isgraph_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int isprint_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int ispunct_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int isspace_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int isupper_l (int, __locale_t) __attribute__ ((__nothrow__)); >extern int isxdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); > >extern int isblank_l (int, __locale_t) __attribute__ ((__nothrow__)); > > > >extern int __tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); >extern int tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); > > >extern int __toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); >extern int toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); ># 323 "/usr/include/ctype.h" 3 4 > ># 248 "lib/fidlib-0.9.9/fidlib.c" 2 ># 1 "/usr/include/math.h" 1 3 4 ># 30 "/usr/include/math.h" 3 4 > > > > ># 1 "/usr/include/bits/huge_val.h" 1 3 4 ># 35 "/usr/include/math.h" 2 3 4 > ># 1 "/usr/include/bits/huge_valf.h" 1 3 4 ># 37 "/usr/include/math.h" 2 3 4 ># 1 "/usr/include/bits/huge_vall.h" 1 3 4 ># 38 "/usr/include/math.h" 2 3 4 > > ># 1 "/usr/include/bits/inf.h" 1 3 4 ># 41 "/usr/include/math.h" 2 3 4 > > ># 1 "/usr/include/bits/nan.h" 1 3 4 ># 44 "/usr/include/math.h" 2 3 4 > > > ># 1 "/usr/include/bits/mathdef.h" 1 3 4 ># 26 "/usr/include/bits/mathdef.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 27 "/usr/include/bits/mathdef.h" 2 3 4 > > > > >typedef float float_t; >typedef double double_t; ># 48 "/usr/include/math.h" 2 3 4 ># 71 "/usr/include/math.h" 3 4 ># 1 "/usr/include/bits/mathcalls.h" 1 3 4 ># 53 "/usr/include/bits/mathcalls.h" 3 4 > > >extern double acos (double __x) __attribute__ ((__nothrow__)); extern double __acos (double __x) __attribute__ ((__nothrow__)); > >extern double asin (double __x) __attribute__ ((__nothrow__)); extern double __asin (double __x) __attribute__ ((__nothrow__)); > >extern double atan (double __x) __attribute__ ((__nothrow__)); extern double __atan (double __x) __attribute__ ((__nothrow__)); > >extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__)); > > >extern double cos (double __x) __attribute__ ((__nothrow__)); extern double __cos (double __x) __attribute__ ((__nothrow__)); > >extern double sin (double __x) __attribute__ ((__nothrow__)); extern double __sin (double __x) __attribute__ ((__nothrow__)); > >extern double tan (double __x) __attribute__ ((__nothrow__)); extern double __tan (double __x) __attribute__ ((__nothrow__)); > > > > >extern double cosh (double __x) __attribute__ ((__nothrow__)); extern double __cosh (double __x) __attribute__ ((__nothrow__)); > >extern double sinh (double __x) __attribute__ ((__nothrow__)); extern double __sinh (double __x) __attribute__ ((__nothrow__)); > >extern double tanh (double __x) __attribute__ ((__nothrow__)); extern double __tanh (double __x) __attribute__ ((__nothrow__)); > ># 87 "/usr/include/bits/mathcalls.h" 3 4 > > >extern double acosh (double __x) __attribute__ ((__nothrow__)); extern double __acosh (double __x) __attribute__ ((__nothrow__)); > >extern double asinh (double __x) __attribute__ ((__nothrow__)); extern double __asinh (double __x) __attribute__ ((__nothrow__)); > >extern double atanh (double __x) __attribute__ ((__nothrow__)); extern double __atanh (double __x) __attribute__ ((__nothrow__)); > > > > > > > >extern double exp (double __x) __attribute__ ((__nothrow__)); extern double __exp (double __x) __attribute__ ((__nothrow__)); > > >extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); > > >extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); > > >extern double log (double __x) __attribute__ ((__nothrow__)); extern double __log (double __x) __attribute__ ((__nothrow__)); > > >extern double log10 (double __x) __attribute__ ((__nothrow__)); extern double __log10 (double __x) __attribute__ ((__nothrow__)); > > >extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); > ># 127 "/usr/include/bits/mathcalls.h" 3 4 > > >extern double expm1 (double __x) __attribute__ ((__nothrow__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__)); > > >extern double log1p (double __x) __attribute__ ((__nothrow__)); extern double __log1p (double __x) __attribute__ ((__nothrow__)); > > >extern double logb (double __x) __attribute__ ((__nothrow__)); extern double __logb (double __x) __attribute__ ((__nothrow__)); > > > > > > >extern double exp2 (double __x) __attribute__ ((__nothrow__)); extern double __exp2 (double __x) __attribute__ ((__nothrow__)); > > >extern double log2 (double __x) __attribute__ ((__nothrow__)); extern double __log2 (double __x) __attribute__ ((__nothrow__)); > > > > > > > > >extern double pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__)); > > >extern double sqrt (double __x) __attribute__ ((__nothrow__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__)); > > > > > >extern double hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__)); > > > > > > >extern double cbrt (double __x) __attribute__ ((__nothrow__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__)); > > > > > > > > >extern double ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern double fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern double floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern double fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__)); > > > > >extern int __isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern int __finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > >extern int isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern int finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern double drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__)); > > > >extern double significand (double __x) __attribute__ ((__nothrow__)); extern double __significand (double __x) __attribute__ ((__nothrow__)); > > > > > >extern double copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > > >extern double nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > >extern int __isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern int isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern double j0 (double) __attribute__ ((__nothrow__)); extern double __j0 (double) __attribute__ ((__nothrow__)); >extern double j1 (double) __attribute__ ((__nothrow__)); extern double __j1 (double) __attribute__ ((__nothrow__)); >extern double jn (int, double) __attribute__ ((__nothrow__)); extern double __jn (int, double) __attribute__ ((__nothrow__)); >extern double y0 (double) __attribute__ ((__nothrow__)); extern double __y0 (double) __attribute__ ((__nothrow__)); >extern double y1 (double) __attribute__ ((__nothrow__)); extern double __y1 (double) __attribute__ ((__nothrow__)); >extern double yn (int, double) __attribute__ ((__nothrow__)); extern double __yn (int, double) __attribute__ ((__nothrow__)); > > > > > > >extern double erf (double) __attribute__ ((__nothrow__)); extern double __erf (double) __attribute__ ((__nothrow__)); >extern double erfc (double) __attribute__ ((__nothrow__)); extern double __erfc (double) __attribute__ ((__nothrow__)); >extern double lgamma (double) __attribute__ ((__nothrow__)); extern double __lgamma (double) __attribute__ ((__nothrow__)); > > > > > > >extern double tgamma (double) __attribute__ ((__nothrow__)); extern double __tgamma (double) __attribute__ ((__nothrow__)); > > > > > >extern double gamma (double) __attribute__ ((__nothrow__)); extern double __gamma (double) __attribute__ ((__nothrow__)); > > > > > > >extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); > > > > > > > >extern double rint (double __x) __attribute__ ((__nothrow__)); extern double __rint (double __x) __attribute__ ((__nothrow__)); > > >extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > >extern double nexttoward (double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern double remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__)); > > > >extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__)); > > > >extern int ilogb (double __x) __attribute__ ((__nothrow__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__)); > > > > >extern double scalbln (double __x, long int __n) __attribute__ ((__nothrow__)); extern double __scalbln (double __x, long int __n) __attribute__ ((__nothrow__)); > > > >extern double nearbyint (double __x) __attribute__ ((__nothrow__)); extern double __nearbyint (double __x) __attribute__ ((__nothrow__)); > > > >extern double round (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __round (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern double trunc (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __trunc (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > >extern double remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__)); extern double __remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__)); > > > > > > >extern long int lrint (double __x) __attribute__ ((__nothrow__)); extern long int __lrint (double __x) __attribute__ ((__nothrow__)); >extern long long int llrint (double __x) __attribute__ ((__nothrow__)); extern long long int __llrint (double __x) __attribute__ ((__nothrow__)); > > > >extern long int lround (double __x) __attribute__ ((__nothrow__)); extern long int __lround (double __x) __attribute__ ((__nothrow__)); >extern long long int llround (double __x) __attribute__ ((__nothrow__)); extern long long int __llround (double __x) __attribute__ ((__nothrow__)); > > > >extern double fdim (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fdim (double __x, double __y) __attribute__ ((__nothrow__)); > > >extern double fmax (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmax (double __x, double __y) __attribute__ ((__nothrow__)); > > >extern double fmin (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmin (double __x, double __y) __attribute__ ((__nothrow__)); > > > >extern int __fpclassify (double __value) __attribute__ ((__nothrow__)) > __attribute__ ((__const__)); > > >extern int __signbit (double __value) __attribute__ ((__nothrow__)) > __attribute__ ((__const__)); > > > >extern double fma (double __x, double __y, double __z) __attribute__ ((__nothrow__)); extern double __fma (double __x, double __y, double __z) __attribute__ ((__nothrow__)); > > > > > > > > >extern double scalb (double __x, double __n) __attribute__ ((__nothrow__)); extern double __scalb (double __x, double __n) __attribute__ ((__nothrow__)); ># 72 "/usr/include/math.h" 2 3 4 ># 94 "/usr/include/math.h" 3 4 ># 1 "/usr/include/bits/mathcalls.h" 1 3 4 ># 53 "/usr/include/bits/mathcalls.h" 3 4 > > >extern float acosf (float __x) __attribute__ ((__nothrow__)); extern float __acosf (float __x) __attribute__ ((__nothrow__)); > >extern float asinf (float __x) __attribute__ ((__nothrow__)); extern float __asinf (float __x) __attribute__ ((__nothrow__)); > >extern float atanf (float __x) __attribute__ ((__nothrow__)); extern float __atanf (float __x) __attribute__ ((__nothrow__)); > >extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__)); > > >extern float cosf (float __x) __attribute__ ((__nothrow__)); extern float __cosf (float __x) __attribute__ ((__nothrow__)); > >extern float sinf (float __x) __attribute__ ((__nothrow__)); extern float __sinf (float __x) __attribute__ ((__nothrow__)); > >extern float tanf (float __x) __attribute__ ((__nothrow__)); extern float __tanf (float __x) __attribute__ ((__nothrow__)); > > > > >extern float coshf (float __x) __attribute__ ((__nothrow__)); extern float __coshf (float __x) __attribute__ ((__nothrow__)); > >extern float sinhf (float __x) __attribute__ ((__nothrow__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__)); > >extern float tanhf (float __x) __attribute__ ((__nothrow__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__)); > ># 87 "/usr/include/bits/mathcalls.h" 3 4 > > >extern float acoshf (float __x) __attribute__ ((__nothrow__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__)); > >extern float asinhf (float __x) __attribute__ ((__nothrow__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__)); > >extern float atanhf (float __x) __attribute__ ((__nothrow__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__)); > > > > > > > >extern float expf (float __x) __attribute__ ((__nothrow__)); extern float __expf (float __x) __attribute__ ((__nothrow__)); > > >extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); > > >extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); > > >extern float logf (float __x) __attribute__ ((__nothrow__)); extern float __logf (float __x) __attribute__ ((__nothrow__)); > > >extern float log10f (float __x) __attribute__ ((__nothrow__)); extern float __log10f (float __x) __attribute__ ((__nothrow__)); > > >extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); > ># 127 "/usr/include/bits/mathcalls.h" 3 4 > > >extern float expm1f (float __x) __attribute__ ((__nothrow__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__)); > > >extern float log1pf (float __x) __attribute__ ((__nothrow__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__)); > > >extern float logbf (float __x) __attribute__ ((__nothrow__)); extern float __logbf (float __x) __attribute__ ((__nothrow__)); > > > > > > >extern float exp2f (float __x) __attribute__ ((__nothrow__)); extern float __exp2f (float __x) __attribute__ ((__nothrow__)); > > >extern float log2f (float __x) __attribute__ ((__nothrow__)); extern float __log2f (float __x) __attribute__ ((__nothrow__)); > > > > > > > > >extern float powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__)); > > >extern float sqrtf (float __x) __attribute__ ((__nothrow__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__)); > > > > > >extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__)); > > > > > > >extern float cbrtf (float __x) __attribute__ ((__nothrow__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__)); > > > > > > > > >extern float ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern float fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern float floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__)); > > > > >extern int __isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern int __finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > >extern int isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern int finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern float dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__)); > > > >extern float significandf (float __x) __attribute__ ((__nothrow__)); extern float __significandf (float __x) __attribute__ ((__nothrow__)); > > > > > >extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > > >extern float nanf (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > >extern int __isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern int isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern float j0f (float) __attribute__ ((__nothrow__)); extern float __j0f (float) __attribute__ ((__nothrow__)); >extern float j1f (float) __attribute__ ((__nothrow__)); extern float __j1f (float) __attribute__ ((__nothrow__)); >extern float jnf (int, float) __attribute__ ((__nothrow__)); extern float __jnf (int, float) __attribute__ ((__nothrow__)); >extern float y0f (float) __attribute__ ((__nothrow__)); extern float __y0f (float) __attribute__ ((__nothrow__)); >extern float y1f (float) __attribute__ ((__nothrow__)); extern float __y1f (float) __attribute__ ((__nothrow__)); >extern float ynf (int, float) __attribute__ ((__nothrow__)); extern float __ynf (int, float) __attribute__ ((__nothrow__)); > > > > > > >extern float erff (float) __attribute__ ((__nothrow__)); extern float __erff (float) __attribute__ ((__nothrow__)); >extern float erfcf (float) __attribute__ ((__nothrow__)); extern float __erfcf (float) __attribute__ ((__nothrow__)); >extern float lgammaf (float) __attribute__ ((__nothrow__)); extern float __lgammaf (float) __attribute__ ((__nothrow__)); > > > > > > >extern float tgammaf (float) __attribute__ ((__nothrow__)); extern float __tgammaf (float) __attribute__ ((__nothrow__)); > > > > > >extern float gammaf (float) __attribute__ ((__nothrow__)); extern float __gammaf (float) __attribute__ ((__nothrow__)); > > > > > > >extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); > > > > > > > >extern float rintf (float __x) __attribute__ ((__nothrow__)); extern float __rintf (float __x) __attribute__ ((__nothrow__)); > > >extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > >extern float nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__)); > > > >extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); > > > >extern int ilogbf (float __x) __attribute__ ((__nothrow__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__)); > > > > >extern float scalblnf (float __x, long int __n) __attribute__ ((__nothrow__)); extern float __scalblnf (float __x, long int __n) __attribute__ ((__nothrow__)); > > > >extern float nearbyintf (float __x) __attribute__ ((__nothrow__)); extern float __nearbyintf (float __x) __attribute__ ((__nothrow__)); > > > >extern float roundf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __roundf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern float truncf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __truncf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > >extern float remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__)); extern float __remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__)); > > > > > > >extern long int lrintf (float __x) __attribute__ ((__nothrow__)); extern long int __lrintf (float __x) __attribute__ ((__nothrow__)); >extern long long int llrintf (float __x) __attribute__ ((__nothrow__)); extern long long int __llrintf (float __x) __attribute__ ((__nothrow__)); > > > >extern long int lroundf (float __x) __attribute__ ((__nothrow__)); extern long int __lroundf (float __x) __attribute__ ((__nothrow__)); >extern long long int llroundf (float __x) __attribute__ ((__nothrow__)); extern long long int __llroundf (float __x) __attribute__ ((__nothrow__)); > > > >extern float fdimf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fdimf (float __x, float __y) __attribute__ ((__nothrow__)); > > >extern float fmaxf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmaxf (float __x, float __y) __attribute__ ((__nothrow__)); > > >extern float fminf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fminf (float __x, float __y) __attribute__ ((__nothrow__)); > > > >extern int __fpclassifyf (float __value) __attribute__ ((__nothrow__)) > __attribute__ ((__const__)); > > >extern int __signbitf (float __value) __attribute__ ((__nothrow__)) > __attribute__ ((__const__)); > > > >extern float fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__)); extern float __fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__)); > > > > > > > > >extern float scalbf (float __x, float __n) __attribute__ ((__nothrow__)); extern float __scalbf (float __x, float __n) __attribute__ ((__nothrow__)); ># 95 "/usr/include/math.h" 2 3 4 ># 141 "/usr/include/math.h" 3 4 ># 1 "/usr/include/bits/mathcalls.h" 1 3 4 ># 53 "/usr/include/bits/mathcalls.h" 3 4 > > >extern long double acosl (long double __x) __attribute__ ((__nothrow__)); extern long double __acosl (long double __x) __attribute__ ((__nothrow__)); > >extern long double asinl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinl (long double __x) __attribute__ ((__nothrow__)); > >extern long double atanl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanl (long double __x) __attribute__ ((__nothrow__)); > >extern long double atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); extern long double __atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); > > >extern long double cosl (long double __x) __attribute__ ((__nothrow__)); extern long double __cosl (long double __x) __attribute__ ((__nothrow__)); > >extern long double sinl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__)); > >extern long double tanl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanl (long double __x) __attribute__ ((__nothrow__)); > > > > >extern long double coshl (long double __x) __attribute__ ((__nothrow__)); extern long double __coshl (long double __x) __attribute__ ((__nothrow__)); > >extern long double sinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinhl (long double __x) __attribute__ ((__nothrow__)); > >extern long double tanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanhl (long double __x) __attribute__ ((__nothrow__)); > ># 87 "/usr/include/bits/mathcalls.h" 3 4 > > >extern long double acoshl (long double __x) __attribute__ ((__nothrow__)); extern long double __acoshl (long double __x) __attribute__ ((__nothrow__)); > >extern long double asinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinhl (long double __x) __attribute__ ((__nothrow__)); > >extern long double atanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanhl (long double __x) __attribute__ ((__nothrow__)); > > > > > > > >extern long double expl (long double __x) __attribute__ ((__nothrow__)); extern long double __expl (long double __x) __attribute__ ((__nothrow__)); > > >extern long double frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); extern long double __frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); > > >extern long double ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); extern long double __ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); > > >extern long double logl (long double __x) __attribute__ ((__nothrow__)); extern long double __logl (long double __x) __attribute__ ((__nothrow__)); > > >extern long double log10l (long double __x) __attribute__ ((__nothrow__)); extern long double __log10l (long double __x) __attribute__ ((__nothrow__)); > > >extern long double modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); extern long double __modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); > ># 127 "/usr/include/bits/mathcalls.h" 3 4 > > >extern long double expm1l (long double __x) __attribute__ ((__nothrow__)); extern long double __expm1l (long double __x) __attribute__ ((__nothrow__)); > > >extern long double log1pl (long double __x) __attribute__ ((__nothrow__)); extern long double __log1pl (long double __x) __attribute__ ((__nothrow__)); > > >extern long double logbl (long double __x) __attribute__ ((__nothrow__)); extern long double __logbl (long double __x) __attribute__ ((__nothrow__)); > > > > > > >extern long double exp2l (long double __x) __attribute__ ((__nothrow__)); extern long double __exp2l (long double __x) __attribute__ ((__nothrow__)); > > >extern long double log2l (long double __x) __attribute__ ((__nothrow__)); extern long double __log2l (long double __x) __attribute__ ((__nothrow__)); > > > > > > > > >extern long double powl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __powl (long double __x, long double __y) __attribute__ ((__nothrow__)); > > >extern long double sqrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __sqrtl (long double __x) __attribute__ ((__nothrow__)); > > > > > >extern long double hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); > > > > > > >extern long double cbrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __cbrtl (long double __x) __attribute__ ((__nothrow__)); > > > > > > > > >extern long double ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern long double fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern long double floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern long double fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); > > > > >extern int __isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern int __finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > >extern int isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern int finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern long double dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); > > > >extern long double significandl (long double __x) __attribute__ ((__nothrow__)); extern long double __significandl (long double __x) __attribute__ ((__nothrow__)); > > > > > >extern long double copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > > >extern long double nanl (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nanl (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > > >extern int __isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern int isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > >extern long double j0l (long double) __attribute__ ((__nothrow__)); extern long double __j0l (long double) __attribute__ ((__nothrow__)); >extern long double j1l (long double) __attribute__ ((__nothrow__)); extern long double __j1l (long double) __attribute__ ((__nothrow__)); >extern long double jnl (int, long double) __attribute__ ((__nothrow__)); extern long double __jnl (int, long double) __attribute__ ((__nothrow__)); >extern long double y0l (long double) __attribute__ ((__nothrow__)); extern long double __y0l (long double) __attribute__ ((__nothrow__)); >extern long double y1l (long double) __attribute__ ((__nothrow__)); extern long double __y1l (long double) __attribute__ ((__nothrow__)); >extern long double ynl (int, long double) __attribute__ ((__nothrow__)); extern long double __ynl (int, long double) __attribute__ ((__nothrow__)); > > > > > > >extern long double erfl (long double) __attribute__ ((__nothrow__)); extern long double __erfl (long double) __attribute__ ((__nothrow__)); >extern long double erfcl (long double) __attribute__ ((__nothrow__)); extern long double __erfcl (long double) __attribute__ ((__nothrow__)); >extern long double lgammal (long double) __attribute__ ((__nothrow__)); extern long double __lgammal (long double) __attribute__ ((__nothrow__)); > > > > > > >extern long double tgammal (long double) __attribute__ ((__nothrow__)); extern long double __tgammal (long double) __attribute__ ((__nothrow__)); > > > > > >extern long double gammal (long double) __attribute__ ((__nothrow__)); extern long double __gammal (long double) __attribute__ ((__nothrow__)); > > > > > > >extern long double lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); extern long double __lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); > > > > > > > >extern long double rintl (long double __x) __attribute__ ((__nothrow__)); extern long double __rintl (long double __x) __attribute__ ((__nothrow__)); > > >extern long double nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > >extern long double nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern long double remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); > > > >extern long double scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); extern long double __scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); > > > >extern int ilogbl (long double __x) __attribute__ ((__nothrow__)); extern int __ilogbl (long double __x) __attribute__ ((__nothrow__)); > > > > >extern long double scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__)); extern long double __scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__)); > > > >extern long double nearbyintl (long double __x) __attribute__ ((__nothrow__)); extern long double __nearbyintl (long double __x) __attribute__ ((__nothrow__)); > > > >extern long double roundl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __roundl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > >extern long double truncl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __truncl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); > > > > >extern long double remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__)); extern long double __remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__)); > > > > > > >extern long int lrintl (long double __x) __attribute__ ((__nothrow__)); extern long int __lrintl (long double __x) __attribute__ ((__nothrow__)); >extern long long int llrintl (long double __x) __attribute__ ((__nothrow__)); extern long long int __llrintl (long double __x) __attribute__ ((__nothrow__)); > > > >extern long int lroundl (long double __x) __attribute__ ((__nothrow__)); extern long int __lroundl (long double __x) __attribute__ ((__nothrow__)); >extern long long int llroundl (long double __x) __attribute__ ((__nothrow__)); extern long long int __llroundl (long double __x) __attribute__ ((__nothrow__)); > > > >extern long double fdiml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fdiml (long double __x, long double __y) __attribute__ ((__nothrow__)); > > >extern long double fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__)); > > >extern long double fminl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fminl (long double __x, long double __y) __attribute__ ((__nothrow__)); > > > >extern int __fpclassifyl (long double __value) __attribute__ ((__nothrow__)) > __attribute__ ((__const__)); > > >extern int __signbitl (long double __value) __attribute__ ((__nothrow__)) > __attribute__ ((__const__)); > > > >extern long double fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__)); extern long double __fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__)); > > > > > > > > >extern long double scalbl (long double __x, long double __n) __attribute__ ((__nothrow__)); extern long double __scalbl (long double __x, long double __n) __attribute__ ((__nothrow__)); ># 142 "/usr/include/math.h" 2 3 4 ># 157 "/usr/include/math.h" 3 4 >extern int signgam; ># 198 "/usr/include/math.h" 3 4 >enum > { > FP_NAN, > > FP_INFINITE, > > FP_ZERO, > > FP_SUBNORMAL, > > FP_NORMAL > > }; ># 291 "/usr/include/math.h" 3 4 >typedef enum >{ > _IEEE_ = -1, > _SVID_, > _XOPEN_, > _POSIX_, > _ISOC_ >} _LIB_VERSION_TYPE; > > > > >extern _LIB_VERSION_TYPE _LIB_VERSION; ># 316 "/usr/include/math.h" 3 4 >struct exception > > { > int type; > char *name; > double arg1; > double arg2; > double retval; > }; > > > > >extern int matherr (struct exception *__exc); ># 416 "/usr/include/math.h" 3 4 ># 1 "/usr/include/bits/mathinline.h" 1 3 4 ># 25 "/usr/include/bits/mathinline.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 26 "/usr/include/bits/mathinline.h" 2 3 4 ># 37 "/usr/include/bits/mathinline.h" 3 4 >extern __inline int >__attribute__ ((__nothrow__)) __signbitf (float __x) >{ > > > > > int __m; > __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x)); > return __m & 0x8; > >} >extern __inline int >__attribute__ ((__nothrow__)) __signbit (double __x) >{ > > > > > int __m; > __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x)); > return __m & 0x80; > >} >extern __inline int >__attribute__ ((__nothrow__)) __signbitl (long double __x) >{ > __extension__ union { long double __l; int __i[3]; } __u = { __l: __x }; > return (__u.__i[2] & 0x8000) != 0; >} ># 417 "/usr/include/math.h" 2 3 4 ># 472 "/usr/include/math.h" 3 4 > ># 249 "lib/fidlib-0.9.9/fidlib.c" 2 ># 1 "lib/fidlib-0.9.9/fidlib.h" 1 > > > > > >typedef struct FidFilter FidFilter; >struct FidFilter { > short typ; > short cbm; > > > int len; > double val[1]; >}; ># 32 "lib/fidlib-0.9.9/fidlib.h" >typedef void FidRun; >typedef double (FidFunc)(void*, double); ># 43 "lib/fidlib-0.9.9/fidlib.h" >extern void fid_set_error_handler(void(*rout)(char *)); >extern char *fid_version(); >extern double fid_response_pha(FidFilter *filt, double freq, double *phase); >extern double fid_response(FidFilter *filt, double freq); >extern int fid_calc_delay(FidFilter *filt); >extern FidFilter *fid_design(const char *spec, double rate, double freq0, double freq1, > int f_adj, char **descp); >extern double fid_design_coef(double *coef, int n_coef, const char *spec, > double rate, double freq0, double freq1, int adj); >extern void fid_list_filters(FILE *out); >extern int fid_list_filters_buf(char *buf, char *bufend); >extern FidFilter *fid_flatten(FidFilter *filt); >extern void fid_rewrite_spec(const char *spec, double freq0, double freq1, int adj, > char **spec1p, char **spec2p, > double *freq0p, double *freq1p, int *adjp); >extern FidFilter *fid_cv_array(double *arr); >extern FidFilter *fid_cat(int freeme, ...); >extern char *fid_parse(double rate, char **pp, FidFilter **ffp); > > > > > >extern void *fid_run_new(FidFilter *filt, double(**funcpp)(void *, double)); >extern void *fid_run_newbuf(void *run); >extern int fid_run_bufsize(void *run); >extern void fid_run_initbuf(void *run, void *buf); >extern void fid_run_zapbuf(void *buf); >extern void fid_run_freebuf(void *runbuf); >extern void fid_run_free(void *run); ># 250 "lib/fidlib-0.9.9/fidlib.c" 2 > > > > > >extern FidFilter *mkfilter(char *, ...); ># 287 "lib/fidlib-0.9.9/fidlib.c" >static void (*error_handler)(char *err)= 0; > >static void >error(char *fmt, ...) { > char buf[1024]; > va_list ap; > __builtin_va_start(ap,fmt); > > vsnprintf(buf, sizeof(buf), fmt, ap); > buf[sizeof(buf)-1]= 0; > if (error_handler) error_handler(buf); > > > fprintf(stderr, "fidlib error: %s\n", buf); > exit(1); >} > >static char * >strdupf(char *fmt, ...) { > va_list ap; > char buf[1024], *rv; > int len; > __builtin_va_start(ap,fmt); > len= vsnprintf(buf, sizeof(buf), fmt, ap); > if (len < 0 || len >= sizeof(buf)-1) > error("strdupf exceeded buffer"); > rv= (__extension__ (__builtin_constant_p (buf) && ((size_t)(const void *)((buf) + 1) - (size_t)(const void *)(buf) == 1) ? (((__const char *) (buf))[0] == '\0' ? (char *) calloc ((size_t) 1, (size_t) 1) : ({ size_t __len = strlen (buf) + 1; char *__retval = (char *) malloc (__len); if (__retval != ((void *)0)) __retval = (char *) memcpy (__retval, buf, __len); __retval; })) : __strdup (buf))); > if (!rv) error("Out of memory"); > return rv; >} > >static void * >Alloc(int size) { > void *vp= calloc(1, size); > if (!vp) error("Out of memory"); > return vp; >} ># 333 "lib/fidlib-0.9.9/fidlib.c" >static inline void >cmul(double *aa, double *bb) { > double rr= aa[0] * bb[0] - aa[1] * bb[1]; > double ii= aa[0] * bb[1] + aa[1] * bb[0]; > aa[0]= rr; > aa[1]= ii; >} > > > > > >static inline void >csqu(double *aa) { > double rr= aa[0] * aa[0] - aa[1] * aa[1]; > double ii= 2 * aa[0] * aa[1]; > aa[0]= rr; > aa[1]= ii; >} > > > > > >static inline void >cmulr(double *aa, double fact) { > aa[0] *= fact; > aa[1] *= fact; >} > > > > > >static inline void >cconj(double *aa) { > aa[1]= -aa[1]; >} > > > > > >static inline void >cdiv(double *aa, double *bb) { > double rr= aa[0] * bb[0] + aa[1] * bb[1]; > double ii= -aa[0] * bb[1] + aa[1] * bb[0]; > double fact= 1.0 / (bb[0] * bb[0] + bb[1] * bb[1]); > aa[0]= rr * fact; > aa[1]= ii * fact; >} > > > > > >static inline void >crecip(double *aa) { > double fact= 1.0 / (aa[0] * aa[0] + aa[1] * aa[1]); > aa[0] *= fact; > aa[1] *= -fact; >} > > > > > >static inline void >cass(double *aa, double *bb) { > memcpy(aa, bb, 2*sizeof(double)); >} > > > > > >static inline void >cassz(double *aa, double rr, double ii) { > aa[0]= rr; > aa[1]= ii; >} > > > > > >static inline void >cadd(double *aa, double *bb) { > aa[0] += bb[0]; > aa[1] += bb[1]; >} > > > > > >static inline void >caddz(double *aa, double rr, double ii) { > aa[0] += rr; > aa[1] += ii; >} > > > > > >static inline void >csub(double *aa, double *bb) { > aa[0] -= bb[0]; > aa[1] -= bb[1]; >} > > > > > >static inline void >csubz(double *aa, double rr, double ii) { > aa[0] -= rr; > aa[1] -= ii; >} > > > > > >static inline void >cneg(double *aa) { > aa[0]= -aa[0]; > aa[1]= -aa[1]; >} > > > > > > > >static inline void >evaluate(double *rv, double *coef, int n_coef, double *in) { > double pz[2]; > > > rv[0]= *coef++; > rv[1]= 0; > > if (--n_coef > 0) { > > pz[0]= in[0]; > pz[1]= in[1]; > rv[0] += *coef * pz[0]; > rv[1] += *coef * pz[1]; > coef++; n_coef--; > > > while (n_coef > 0) { > cmul(pz, in); > rv[0] += *coef * pz[0]; > rv[1] += *coef * pz[1]; > coef++; > n_coef--; > } > } >} > > > > > > >void >fid_set_error_handler(void (*rout)(char*)) { > error_handler= rout; >} > >char * >fid_version() { > return "0.9.9"; >} ># 521 "lib/fidlib-0.9.9/fidlib.c" >double >fid_response_pha(FidFilter *filt, double freq, double *phase) { > double top[2], bot[2]; > double theta= freq * 2 * 3.14159265358979323846; > double zz[2]; > > top[0]= 1; > top[1]= 0; > bot[0]= 1; > bot[1]= 0; > zz[0]= cos(theta); > zz[1]= sin(theta); > > while (filt->len) { > double resp[2]; > int cnt= filt->len; > evaluate(resp, filt->val, cnt, zz); > if (filt->typ == 'I') > cmul(bot, resp); > else if (filt->typ == 'F') > cmul(top, resp); > else > error("Unknown filter type %d in fid_response_pha()", filt->typ); > filt= ((FidFilter*)((filt)->val + (filt)->len)); > } > > cdiv(top, bot); > > if (phase) { > double pha= atan2(top[1], top[0]) / (2 * 3.14159265358979323846); > if (pha < 0) pha += 1.0; > *phase= pha; > } > > return hypot(top[1], top[0]); >} ># 567 "lib/fidlib-0.9.9/fidlib.c" >double >fid_response(FidFilter *filt, double freq) { > double top[2], bot[2]; > double theta= freq * 2 * 3.14159265358979323846; > double zz[2]; > > top[0]= 1; > top[1]= 0; > bot[0]= 1; > bot[1]= 0; > zz[0]= cos(theta); > zz[1]= sin(theta); > > while (filt->len) { > double resp[2]; > int cnt= filt->len; > evaluate(resp, filt->val, cnt, zz); > if (filt->typ == 'I') > cmul(bot, resp); > else if (filt->typ == 'F') > cmul(top, resp); > else > error("Unknown filter type %d in fid_response()", filt->typ); > filt= ((FidFilter*)((filt)->val + (filt)->len)); > } > > cdiv(top, bot); > > return hypot(top[1], top[0]); >} ># 611 "lib/fidlib-0.9.9/fidlib.c" >int >fid_calc_delay(FidFilter *filt) { > FidRun *run; > FidFunc *dostep; > void *f1, *f2; > double tot, tot100, tot50; > int cnt; > > run= fid_run_new(filt, &dostep); > > > > > f1= fid_run_newbuf(run); > f2= fid_run_newbuf(run); > > tot= fabs(dostep(f1, 1.0)); > tot100= fabs(dostep(f2, 1.0)); > tot100 += fabs(dostep(f2, 0.0)); > tot100 += fabs(dostep(f2, 0.0)); > tot100 += fabs(dostep(f2, 0.0)); > > for (cnt= 1; cnt < 0x1000000; cnt++) { > tot += fabs(dostep(f1, 0.0)); > tot100 += fabs(dostep(f2, 0.0)); > tot100 += fabs(dostep(f2, 0.0)); > tot100 += fabs(dostep(f2, 0.0)); > tot100 += fabs(dostep(f2, 0.0)); > > if (tot/tot100 >= 0.999) break; > } > fid_run_freebuf(f1); > fid_run_freebuf(f2); > > > tot50= tot100/2; > f1= fid_run_newbuf(run); > tot= fabs(dostep(f1, 1.0)); > for (cnt= 0; tot < tot50; cnt++) > tot += fabs(dostep(f1, 0.0)); > fid_run_freebuf(f1); > > > fid_run_free(run); > return cnt; >} > > > > > > ># 1 "lib/fidlib-0.9.9/fidmkf.h" 1 ># 157 "lib/fidlib-0.9.9/fidmkf.h" >static inline double >my_sqrt(double aa) { > return aa <= 0.0 ? 0.0 : sqrt(aa); >} > >static inline void >csqrt(double *aa) { > double mag= hypot(aa[0], aa[1]); > double rr= my_sqrt((mag + aa[0]) * 0.5); > double ii= my_sqrt((mag - aa[0]) * 0.5); > if (aa[1] < 0.0) ii= -ii; > aa[0]= rr; > aa[1]= ii; >} > > > > > >static inline void >cexpj(double *aa, double theta) { > aa[0]= cos(theta); > aa[1]= sin(theta); >} > > > > > >static inline void >cexp(double *aa) { > double mag= exp(aa[0]); > aa[0]= mag * cos(aa[1]); > aa[1]= mag * sin(aa[1]); >} ># 212 "lib/fidlib-0.9.9/fidmkf.h" >static int n_pol; >static double pol[64]; >static char poltyp[64]; >static int n_zer; >static double zer[64]; >static char zertyp[64]; > > > > > > >static inline double >prewarp(double val) { > return tan(val * 3.14159265358979323846) / 3.14159265358979323846; >} > > > > > > > >static double bessel_1[]= { > -1.00000000000e+00 >}; > >static double bessel_2[]= { > -1.10160133059e+00, 6.36009824757e-01, >}; > >static double bessel_3[]= { > -1.04740916101e+00, 9.99264436281e-01, > -1.32267579991e+00, >}; > >static double bessel_4[]= { > -9.95208764350e-01, 1.25710573945e+00, > -1.37006783055e+00, 4.10249717494e-01, >}; > >static double bessel_5[]= { > -9.57676548563e-01, 1.47112432073e+00, > -1.38087732586e+00, 7.17909587627e-01, > -1.50231627145e+00, >}; > >static double bessel_6[]= { > -9.30656522947e-01, 1.66186326894e+00, > -1.38185809760e+00, 9.71471890712e-01, > -1.57149040362e+00, 3.20896374221e-01, >}; > >static double bessel_7[]= { > -9.09867780623e-01, 1.83645135304e+00, > -1.37890321680e+00, 1.19156677780e+00, > -1.61203876622e+00, 5.89244506931e-01, > -1.68436817927e+00, >}; > >static double bessel_8[]= { > -8.92869718847e-01, 1.99832584364e+00, > -1.37384121764e+00, 1.38835657588e+00, > -1.63693941813e+00, 8.22795625139e-01, > -1.75740840040e+00, 2.72867575103e-01, >}; > >static double bessel_9[]= { > -8.78399276161e-01, 2.14980052431e+00, > -1.36758830979e+00, 1.56773371224e+00, > -1.65239648458e+00, 1.03138956698e+00, > -1.80717053496e+00, 5.12383730575e-01, > -1.85660050123e+00, >}; > >static double bessel_10[]= { > -8.65756901707e-01, 2.29260483098e+00, > -1.36069227838e+00, 1.73350574267e+00, > -1.66181024140e+00, 1.22110021857e+00, > -1.84219624443e+00, 7.27257597722e-01, > -1.92761969145e+00, 2.41623471082e-01, >}; > >static double *bessel_poles[10]= { > bessel_1, bessel_2, bessel_3, bessel_4, bessel_5, > bessel_6, bessel_7, bessel_8, bessel_9, bessel_10 >}; > > > > > >static void >bessel(int order) { > int a; > > if (order > 10) error("Maximum Bessel order is 10"); > n_pol= order; > memcpy(pol, bessel_poles[order-1], n_pol * sizeof(double)); > > for (a= 0; a<order-1; ) { > poltyp[a++]= 2; > poltyp[a++]= 0; > } > if (a < order) > poltyp[a++]= 1; >} > > > > > > > >static void >butterworth(int order) { > int a; > if (order > 64) > error("Maximum butterworth/chebyshev order is %d", 64); > n_pol= order; > for (a= 0; a<order-1; a += 2) { > poltyp[a]= 2; > poltyp[a+1]= 0; > cexpj(pol+a, 3.14159265358979323846 - (order-a-1) * 0.5 * 3.14159265358979323846 / order); > } > if (a < order) { > poltyp[a]= 1; > pol[a]= -1.0; > } >} > > > > > >static void >chebyshev(int order, double ripple) { > double eps, y; > double sh, ch; > int a; > > butterworth(order); > if (ripple >= 0.0) error("Chebyshev ripple in dB should be -ve"); > > eps= sqrt(-1.0 + pow(10.0, -0.1 * ripple)); > y= asinh(1.0 / eps) / order; > if (y <= 0.0) error("Internal error; chebyshev y-value <= 0.0: %g", y); > sh= sinh(y); > ch= cosh(y); > > for (a= 0; a<n_pol; ) { > if (poltyp[a] == 1) > pol[a++] *= sh; > else { > pol[a++] *= sh; > pol[a++] *= ch; > } > } >} > > > > > > >static void >lowpass(double freq) { > int a; > > > freq *= (2*3.14159265358979323846); > for (a= 0; a<n_pol; a++) > pol[a] *= freq; > > > n_zer= n_pol; > for (a= 0; a<n_zer; a++) { > zer[a]= -(__builtin_huge_val()); > zertyp[a]= 1; > } >} > > > > > >static void >highpass(double freq) { > int a; > > > freq *= (2*3.14159265358979323846); > for (a= 0; a<n_pol; ) { > if (poltyp[a] == 1) { > pol[a]= freq / pol[a]; > a++; > } else { > crecip(pol + a); > pol[a++] *= freq; > pol[a++] *= freq; > } > } > > > n_zer= n_pol; > for (a= 0; a<n_zer; a++) { > zer[a]= 0.0; > zertyp[a]= 1; > } >} > > > > > > >static void >bandpass(double freq1, double freq2) { > double w0= (2*3.14159265358979323846) * sqrt(freq1*freq2); > double bw= 0.5 * (2*3.14159265358979323846) * (freq2-freq1); > int a, b; > > if (n_pol * 2 > 64) > error("Maximum order for bandpass filters is %d", 64/2); > > > for (a= n_pol, b= n_pol*2; a>0; ) { > > > > > > if (poltyp[a-1] == 1) { > double hba; > a--; b -= 2; > poltyp[b]= 2; poltyp[b+1]= 0; > hba= pol[a] * bw; > cassz(pol+b, 1.0 - (w0 / hba) * (w0 / hba), 0.0); > csqrt(pol+b); > caddz(pol+b, 1.0, 0.0); > cmulr(pol+b, hba); > } else { > double hba[2]; > a -= 2; b -= 4; > poltyp[b]= 2; poltyp[b+1]= 0; > poltyp[b+2]= 2; poltyp[b+3]= 0; > cass(hba, pol+a); > cmulr(hba, bw); > cass(pol+b, hba); > crecip(pol+b); > cmulr(pol+b, w0); > csqu(pol+b); > cneg(pol+b); > caddz(pol+b, 1.0, 0.0); > csqrt(pol+b); > cmul(pol+b, hba); > cass(pol+b+2, pol+b); > cneg(pol+b+2); > cadd(pol+b, hba); > cadd(pol+b+2, hba); > } > } > n_pol *= 2; > > > n_zer= n_pol; > for (a= 0; a<n_zer; a++) { > zertyp[a]= 1; > zer[a]= (a<n_zer/2) ? 0.0 : -(__builtin_huge_val()); > } >} > > > > > > >static void >bandstop(double freq1, double freq2) { > double w0= (2*3.14159265358979323846) * sqrt(freq1*freq2); > double bw= 0.5 * (2*3.14159265358979323846) * (freq2-freq1); > int a, b; > > if (n_pol * 2 > 64) > error("Maximum order for bandstop filters is %d", 64/2); > > > for (a= n_pol, b= n_pol*2; a>0; ) { > > > > > > if (poltyp[a-1] == 1) { > double hba; > a--; b -= 2; > poltyp[b]= 2; poltyp[b+1]= 0; > hba= bw / pol[a]; > cassz(pol+b, 1.0 - (w0 / hba) * (w0 / hba), 0.0); > csqrt(pol+b); > caddz(pol+b, 1.0, 0.0); > cmulr(pol+b, hba); > } else { > double hba[2]; > a -= 2; b -= 4; > poltyp[b]= 2; poltyp[b+1]= 0; > poltyp[b+2]= 2; poltyp[b+3]= 0; > cass(hba, pol+a); > crecip(hba); > cmulr(hba, bw); > cass(pol+b, hba); > crecip(pol+b); > cmulr(pol+b, w0); > csqu(pol+b); > cneg(pol+b); > caddz(pol+b, 1.0, 0.0); > csqrt(pol+b); > cmul(pol+b, hba); > cass(pol+b+2, pol+b); > cneg(pol+b+2); > cadd(pol+b, hba); > cadd(pol+b+2, hba); > } > } > n_pol *= 2; > > > n_zer= n_pol; > for (a= 0; a<n_zer; a+=2) { > zertyp[a]= 2; zertyp[a+1]= 0; > zer[a]= 0.0; zer[a+1]= w0; > } >} > > > > > > >static void >s2z_bilinear() { > int a; > for (a= 0; a<n_pol; ) { > > if (poltyp[a] == 1) { > if (pol[a] == -(__builtin_huge_val())) > pol[a]= -1.0; > else > pol[a]= (2 + pol[a]) / (2 - pol[a]); > a++; > } else { > double val[2]; > cass(val, pol+a); > cneg(val); > caddz(val, 2, 0); > caddz(pol+a, 2, 0); > cdiv(pol+a, val); > a += 2; > } > } > for (a= 0; a<n_zer; ) { > > if (zertyp[a] == 1) { > if (zer[a] == -(__builtin_huge_val())) > zer[a]= -1.0; > else > zer[a]= (2 + zer[a]) / (2 - zer[a]); > a++; > } else { > double val[2]; > cass(val, zer+a); > cneg(val); > caddz(val, 2, 0); > caddz(zer+a, 2, 0); > cdiv(zer+a, val); > a += 2; > } > } >} > > > > > >static void >s2z_matchedZ() { > int a; > > for (a= 0; a<n_pol; ) { > > if (poltyp[a] == 1) { > if (pol[a] == -(__builtin_huge_val())) > pol[a]= 0.0; > else > pol[a]= exp(pol[a]); > a++; > } else { > cexp(pol+a); > a += 2; > } > } > > for (a= 0; a<n_zer; ) { > > if (zertyp[a] == 1) { > if (zer[a] == -(__builtin_huge_val())) > zer[a]= 0.0; > else > zer[a]= exp(zer[a]); > a++; > } else { > cexp(zer+a); > a += 2; > } > } >} ># 646 "lib/fidlib-0.9.9/fidmkf.h" >static FidFilter* >z2fidfilter(double gain, int cbm) { > int n_head, n_val; > int a; > FidFilter *rv; > FidFilter *ff; > > n_head= 1 + n_pol + n_zer; > n_val= 1 + 2 * (n_pol+n_zer); > > rv= ff= (FidFilter*)Alloc(((sizeof(FidFilter)-sizeof(double))*((n_head)+1) + sizeof(double)*(n_val))); > > ff->typ= 'F'; > ff->len= 1; > ff->val[0]= gain; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > > > for (a= 0; a <= n_pol-2 && a <= n_zer-2; a += 2) { > > if (poltyp[a] == 1 && poltyp[a+1] == 1) { > > ff->typ= 'I'; > ff->len= 3; > ff->val[0]= 1; > ff->val[1]= -(pol[a] + pol[a+1]); > ff->val[2]= pol[a] * pol[a+1]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } else if (poltyp[a] == 2) { > > ff->typ= 'I'; > ff->len= 3; > ff->val[0]= 1; > ff->val[1]= -2 * pol[a]; > ff->val[2]= pol[a] * pol[a] + pol[a+1] * pol[a+1]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } else error("Internal error -- bad poltyp[] values for z2fidfilter()"); > > > if (zertyp[a] == 1 && zertyp[a+1] == 1) { > > > if (!cbm || zer[a] != 0.0 || zer[a+1] != 0.0) { > ff->typ= 'F'; > ff->cbm= cbm; > ff->len= 3; > ff->val[0]= 1; > ff->val[1]= -(zer[a] + zer[a+1]); > ff->val[2]= zer[a] * zer[a+1]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } > } else if (zertyp[a] == 2) { > > > if (!cbm || zer[a] != 0.0 || zer[a+1] != 0.0) { > ff->typ= 'F'; > ff->cbm= cbm; > ff->len= 3; > ff->val[0]= 1; > ff->val[1]= -2 * zer[a]; > ff->val[2]= zer[a] * zer[a] + zer[a+1] * zer[a+1]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } > } else error("Internal error -- bad zertyp[] values"); > } > > > > if (n_pol-a == 0 && n_zer-a == 0) > ; > else if (n_pol-a == 1 && n_zer-a == 1) { > if (poltyp[a] != 1 || zertyp[a] != 1) > error("Internal error; bad poltyp or zertyp for final pole/zero"); > ff->typ= 'I'; > ff->len= 2; > ff->val[0]= 1; > ff->val[1]= -pol[a]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > > > if (!cbm || zer[a] != 0.0) { > ff->typ= 'F'; > ff->cbm= cbm; > ff->len= 2; > ff->val[0]= 1; > ff->val[1]= -zer[a]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } > } else > error("Internal error: unexpected poles/zeros at end of list"); > > > ff->typ= 0; > ff->len= 0; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > > rv= (FidFilter*) realloc(rv, ((char*)ff)-((char*)rv)); > if (!rv) error("Out of memory"); > return rv; >} > > > > > > > >static void >bandpass_res(double freq, double qfact) { > double mag; > double th0, th1, th2; > double theta= freq * (2*3.14159265358979323846); > double val[2]; > double tmp1[2], tmp2[2], tmp3[2], tmp4[2]; > int cnt; > > n_pol= 2; > poltyp[0]= 2; poltyp[1]= 0; > n_zer= 2; > zertyp[0]= 1; zertyp[1]= 1; > zer[0]= 1; zer[1]= -1; > > if (qfact == 0.0) { > cexpj(pol, theta); > return; > } > > > cexpj(val, theta); > mag= exp(-theta / (2.0 * qfact)); > th0= 0; th2= 3.14159265358979323846; > for (cnt= 60; cnt > 0; cnt--) { > th1= 0.5 * (th0 + th2); > cexpj(pol, th1); > cmulr(pol, mag); > > > memcpy(tmp1, val, 2*sizeof(double)); > memcpy(tmp2, val, 2*sizeof(double)); > memcpy(tmp3, val, 2*sizeof(double)); > memcpy(tmp4, val, 2*sizeof(double)); > csubz(tmp1, 1, 0); > csubz(tmp2, -1, 0); > cmul(tmp1, tmp2); > csub(tmp3, pol); cconj(pol); > csub(tmp4, pol); cconj(pol); > cmul(tmp3, tmp4); > cdiv(tmp1, tmp3); > > if (fabs(tmp1[1] / tmp1[0]) < 1e-10) break; > > > > if (tmp1[1] > 0.0) th2= th1; > else th0= th1; > } > > if (cnt <= 0) fprintf(stderr, "Resonator binary search failed to converge"); >} > > > > > >static void >bandstop_res(double freq, double qfact) { > bandpass_res(freq, qfact); > zertyp[0]= 2; zertyp[1]= 0; > cexpj(zer, (2*3.14159265358979323846) * freq); >} > > > > > >static void >allpass_res(double freq, double qfact) { > bandpass_res(freq, qfact); > zertyp[0]= 2; zertyp[1]= 0; > memcpy(zer, pol, 2*sizeof(double)); > cmulr(zer, 1.0 / (zer[0]*zer[0] + zer[1]*zer[1])); >} > > > > > >static void >prop_integral(double freq) { > n_pol= 1; > poltyp[0]= 1; > pol[0]= 0.0; > n_zer= 1; > zertyp[0]= 1; > zer[0]= -(2*3.14159265358979323846) * freq; >} ># 664 "lib/fidlib-0.9.9/fidlib.c" 2 > > > > > > > >static FidFilter* >stack_filter(int order, int n_head, int n_val, ...) { > FidFilter *rv= (FidFilter*)Alloc(((sizeof(FidFilter)-sizeof(double))*((n_head * order)+1) + sizeof(double)*(n_val * order))); > FidFilter *p, *q; > va_list ap; > int a, b, len; > > if (order == 0) return rv; > > > __builtin_va_start(ap,n_val); > p= q= rv; > for (a= 0; a<n_head; a++) { > p->typ= __builtin_va_arg(ap,int); > p->cbm= __builtin_va_arg(ap,int); > p->len= __builtin_va_arg(ap,int); > for (b= 0; b<p->len; b++) > p->val[b]= __builtin_va_arg(ap,double); > p= ((FidFilter*)((p)->val + (p)->len)); > } > order--; > > > len= ((char*)p)-((char*)q); > if (len != ((sizeof(FidFilter)-sizeof(double))*((n_head-1)+1) + sizeof(double)*(n_val))) > error("Internal error; bad call to stack_filter(); length mismatch (%d,%d)", > len, ((sizeof(FidFilter)-sizeof(double))*((n_head-1)+1) + sizeof(double)*(n_val))); > > > while (order-- > 0) { > memcpy(p, q, len); > p= (FidFilter*)(len + (char*)p); > } > > > return rv; >} ># 719 "lib/fidlib-0.9.9/fidlib.c" >static double >search_peak(FidFilter *ff, double f0, double f3) { > double f1, f2; > double r1, r2; > int a; > > > > > for (a= 0; a<20; a++) { > f1= 0.51 * f0 + 0.49 * f3; > f2= 0.49 * f0 + 0.51 * f3; > if (f1 == f2) break; > r1= fid_response(ff, f1); > r2= fid_response(ff, f2); > if (r1 > r2) > f3= f2; > else > f0= f1; > } > return (f0+f3)*0.5; >} ># 757 "lib/fidlib-0.9.9/fidlib.c" >static FidFilter* >do_lowpass(int mz, double freq) { > FidFilter *rv; > lowpass(prewarp(freq)); > if (mz) s2z_matchedZ(); else s2z_bilinear(); > rv= z2fidfilter(1.0, ~0); > rv->val[0]= 1.0 / fid_response(rv, 0.0); > return rv; >} > >static FidFilter* >do_highpass(int mz, double freq) { > FidFilter *rv; > highpass(prewarp(freq)); > if (mz) s2z_matchedZ(); else s2z_bilinear(); > rv= z2fidfilter(1.0, ~0); > rv->val[0]= 1.0 / fid_response(rv, 0.5); > return rv; >} > >static FidFilter* >do_bandpass(int mz, double f0, double f1) { > FidFilter *rv; > bandpass(prewarp(f0), prewarp(f1)); > if (mz) s2z_matchedZ(); else s2z_bilinear(); > rv= z2fidfilter(1.0, ~0); > rv->val[0]= 1.0 / fid_response(rv, search_peak(rv, f0, f1)); > return rv; >} > >static FidFilter* >do_bandstop(int mz, double f0, double f1) { > FidFilter *rv; > bandstop(prewarp(f0), prewarp(f1)); > if (mz) s2z_matchedZ(); else s2z_bilinear(); > rv= z2fidfilter(1.0, 5); > rv->val[0]= 1.0 / fid_response(rv, 0.0); > return rv; >} ># 823 "lib/fidlib-0.9.9/fidlib.c" >static FidFilter* >des_bpre(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bandpass_res(f0, arg[0]); > return z2fidfilter(1.0, ~0); >} > >static FidFilter* >des_bsre(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bandstop_res(f0, arg[0]); > return z2fidfilter(1.0, 0); >} > >static FidFilter* >des_apre(double rate, double f0, double f1, int order, int n_arg, double *arg) { > allpass_res(f0, arg[0]); > return z2fidfilter(1.0, 0); >} > >static FidFilter* >des_pi(double rate, double f0, double f1, int order, int n_arg, double *arg) { > prop_integral(prewarp(f0)); > s2z_bilinear(); > return z2fidfilter(1.0, 0); >} > >static FidFilter* >des_piz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > prop_integral(prewarp(f0)); > s2z_matchedZ(); > return z2fidfilter(1.0, 0); >} > >static FidFilter* >des_lpbe(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_lowpass(0, f0); >} > >static FidFilter* >des_hpbe(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_highpass(0, f0); >} > >static FidFilter* >des_bpbe(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_bandpass(0, f0, f1); >} > >static FidFilter* >des_bsbe(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_bandstop(0, f0, f1); >} > >static FidFilter* >des_lpbez(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_lowpass(1, f0); >} > >static FidFilter* >des_hpbez(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_highpass(1, f0); >} > >static FidFilter* >des_bpbez(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_bandpass(1, f0, f1); >} > >static FidFilter* >des_bsbez(double rate, double f0, double f1, int order, int n_arg, double *arg) { > bessel(order); > return do_bandstop(1, f0, f1); >} > >static FidFilter* >des_lpbube(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double tmp[64]; > int a; > bessel(order); memcpy(tmp, pol, order * sizeof(double)); > butterworth(order); > for (a= 0; a<order; a++) pol[a] += (tmp[a]-pol[a]) * 0.01 * arg[0]; > > return do_lowpass(0, f0); >} > >static FidFilter* >des_lpbu(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_lowpass(0, f0); >} > >static FidFilter* >des_hpbu(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_highpass(0, f0); >} > >static FidFilter* >des_bpbu(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_bandpass(0, f0, f1); >} > >static FidFilter* >des_bsbu(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_bandstop(0, f0, f1); >} > >static FidFilter* >des_lpbuz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_lowpass(1, f0); >} > >static FidFilter* >des_hpbuz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_highpass(1, f0); >} > >static FidFilter* >des_bpbuz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_bandpass(1, f0, f1); >} > >static FidFilter* >des_bsbuz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > butterworth(order); > return do_bandstop(1, f0, f1); >} > >static FidFilter* >des_lpch(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_lowpass(0, f0); >} > >static FidFilter* >des_hpch(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_highpass(0, f0); >} > >static FidFilter* >des_bpch(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_bandpass(0, f0, f1); >} > >static FidFilter* >des_bsch(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_bandstop(0, f0, f1); >} > >static FidFilter* >des_lpchz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_lowpass(1, f0); >} > >static FidFilter* >des_hpchz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_highpass(1, f0); >} > >static FidFilter* >des_bpchz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_bandpass(1, f0, f1); >} > >static FidFilter* >des_bschz(double rate, double f0, double f1, int order, int n_arg, double *arg) { > chebyshev(order, arg[0]); > return do_bandstop(1, f0, f1); >} > >static FidFilter* >des_lpbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double alpha= sin(omega) / 2 / arg[0]; > return stack_filter(order, 3, 7, > 'I', 0x0, 3, 1 + alpha, -2 * cosv, 1 - alpha, > 'F', 0x7, 3, 1.0, 2.0, 1.0, > 'F', 0x0, 1, (1-cosv) * 0.5); >} > >static FidFilter* >des_hpbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double alpha= sin(omega) / 2 / arg[0]; > return stack_filter(order, 3, 7, > 'I', 0x0, 3, 1 + alpha, -2 * cosv, 1 - alpha, > 'F', 0x7, 3, 1.0, -2.0, 1.0, > 'F', 0x0, 1, (1+cosv) * 0.5); >} > >static FidFilter* >des_bpbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double alpha= sin(omega) / 2 / arg[0]; > return stack_filter(order, 3, 7, > 'I', 0x0, 3, 1 + alpha, -2 * cosv, 1 - alpha, > 'F', 0x7, 3, 1.0, 0.0, -1.0, > 'F', 0x0, 1, alpha); >} > >static FidFilter* >des_bsbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double alpha= sin(omega) / 2 / arg[0]; > return stack_filter(order, 2, 6, > 'I', 0x0, 3, 1 + alpha, -2 * cosv, 1 - alpha, > 'F', 0x5, 3, 1.0, -2 * cosv, 1.0); >} > >static FidFilter* >des_apbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double alpha= sin(omega) / 2 / arg[0]; > return stack_filter(order, 2, 6, > 'I', 0x0, 3, 1 + alpha, -2 * cosv, 1 - alpha, > 'F', 0x0, 3, 1 - alpha, -2 * cosv, 1 + alpha); >} > >static FidFilter* >des_pkbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double alpha= sin(omega) / 2 / arg[0]; > double A= pow(10, arg[1]/40); > return stack_filter(order, 2, 6, > 'I', 0x0, 3, 1 + alpha/A, -2 * cosv, 1 - alpha/A, > 'F', 0x0, 3, 1 + alpha*A, -2 * cosv, 1 - alpha*A); >} > >static FidFilter* >des_lsbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double sinv= sin(omega); > double A= pow(10, arg[1]/40); > double beta= sqrt((A*A+1)/arg[0] - (A-1)*(A-1)); > return stack_filter(order, 2, 6, > 'I', 0x0, 3, > (A+1) + (A-1)*cosv + beta*sinv, > -2 * ((A-1) + (A+1)*cosv), > (A+1) + (A-1)*cosv - beta*sinv, > 'F', 0x0, 3, > A*((A+1) - (A-1)*cosv + beta*sinv), > 2*A*((A-1) - (A+1)*cosv), > A*((A+1) - (A-1)*cosv - beta*sinv)); >} > >static FidFilter* >des_hsbq(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double omega= 2 * 3.14159265358979323846 * f0; > double cosv= cos(omega); > double sinv= sin(omega); > double A= pow(10, arg[1]/40); > double beta= sqrt((A*A+1)/arg[0] - (A-1)*(A-1)); > return stack_filter(order, 2, 6, > 'I', 0x0, 3, > (A+1) - (A-1)*cosv + beta*sinv, > 2 * ((A-1) - (A+1)*cosv), > (A+1) - (A-1)*cosv - beta*sinv, > 'F', 0x0, 3, > A*((A+1) + (A-1)*cosv + beta*sinv), > -2*A*((A-1) + (A+1)*cosv), > A*((A+1) + (A-1)*cosv - beta*sinv)); >} > >static FidFilter* >des_lpbl(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double wid= 0.4109205/f0; > double tot, adj; > int max= (int)floor(wid); > int a; > FidFilter *ff= (FidFilter*) Alloc(((sizeof(FidFilter)-sizeof(double))*((1)+1) + sizeof(double)*(max*2+1))); > ff->typ= 'F'; > ff->cbm= 0; > ff->len= max*2+1; > ff->val[max]= tot= 1.0; > for (a= 1; a<=max; a++) { > double val= 0.42 + > 0.5 * cos(3.14159265358979323846 * a / wid) + > 0.08 * cos(3.14159265358979323846 * 2.0 * a / wid); > ff->val[max-a]= val; > ff->val[max+a]= val; > tot += val * 2.0; > } > adj= 1/tot; > for (a= 0; a<=max*2; a++) ff->val[a] *= adj; > return ff; >} > >static FidFilter* >des_lphm(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double wid= 0.3262096/f0; > double tot, adj; > int max= (int)floor(wid); > int a; > FidFilter *ff= (FidFilter*)Alloc(((sizeof(FidFilter)-sizeof(double))*((1)+1) + sizeof(double)*(max*2+1))); > ff->typ= 'F'; > ff->cbm= 0; > ff->len= max*2+1; > ff->val[max]= tot= 1.0; > for (a= 1; a<=max; a++) { > double val= 0.54 + > 0.46 * cos(3.14159265358979323846 * a / wid); > ff->val[max-a]= val; > ff->val[max+a]= val; > tot += val * 2.0; > } > adj= 1/tot; > for (a= 0; a<=max*2; a++) ff->val[a] *= adj; > return ff; >} > >static FidFilter* >des_lphn(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double wid= 0.360144/f0; > double tot, adj; > int max= (int)floor(wid); > int a; > FidFilter *ff= (FidFilter*) Alloc(((sizeof(FidFilter)-sizeof(double))*((1)+1) + sizeof(double)*(max*2+1))); > ff->typ= 'F'; > ff->cbm= 0; > ff->len= max*2+1; > ff->val[max]= tot= 1.0; > for (a= 1; a<=max; a++) { > double val= 0.5 + > 0.5 * cos(3.14159265358979323846 * a / wid); > ff->val[max-a]= val; > ff->val[max+a]= val; > tot += val * 2.0; > } > adj= 1/tot; > for (a= 0; a<=max*2; a++) ff->val[a] *= adj; > return ff; >} > >static FidFilter* >des_lpba(double rate, double f0, double f1, int order, int n_arg, double *arg) { > double wid= 0.3189435/f0; > double tot, adj; > int max= (int)floor(wid); > int a; > FidFilter *ff= (FidFilter*) Alloc(((sizeof(FidFilter)-sizeof(double))*((1)+1) + sizeof(double)*(max*2+1))); > ff->typ= 'F'; > ff->cbm= 0; > ff->len= max*2+1; > ff->val[max]= tot= 1.0; > for (a= 1; a<=max; a++) { > double val= 1.0 - a/wid; > ff->val[max-a]= val; > ff->val[max+a]= val; > tot += val * 2.0; > } > adj= 1/tot; > for (a= 0; a<=max*2; a++) ff->val[a] *= adj; > return ff; >} > > > > > > >static struct { > FidFilter *(*rout)(double,double,double,int,int,double*); > char *fmt; > char *txt; >} filter[]= { > { des_bpre, "BpRe/#V/#F", > "Bandpass resonator, Q=#V (0 means Inf), frequency #F" }, > { des_bsre, "BsRe/#V/#F", > "Bandstop resonator, Q=#V (0 means Inf), frequency #F" }, > { des_apre, "ApRe/#V/#F", > "Allpass resonator, Q=#V (0 means Inf), frequency #F" }, > { des_pi, "Pi/#F", > "Proportional-integral filter, frequency #F" }, > { des_piz, "PiZ/#F", > "Proportional-integral filter, matched z-transform, frequency #F" }, > { des_lpbe, "LpBe#O/#F", > "Lowpass Bessel filter, order #O, -3.01dB frequency #F" }, > { des_hpbe, "HpBe#O/#F", > "Highpass Bessel filter, order #O, -3.01dB frequency #F" }, > { des_bpbe, "BpBe#O/#R", > "Bandpass Bessel filter, order #O, -3.01dB frequencies #R" }, > { des_bsbe, "BsBe#O/#R", > "Bandstop Bessel filter, order #O, -3.01dB frequencies #R" }, > { des_lpbu, "LpBu#O/#F", > "Lowpass Butterworth filter, order #O, -3.01dB frequency #F" }, > { des_hpbu, "HpBu#O/#F", > "Highpass Butterworth filter, order #O, -3.01dB frequency #F" }, > { des_bpbu, "BpBu#O/#R", > "Bandpass Butterworth filter, order #O, -3.01dB frequencies #R" }, > { des_bsbu, "BsBu#O/#R", > "Bandstop Butterworth filter, order #O, -3.01dB frequencies #R" }, > { des_lpch, "LpCh#O/#V/#F", > "Lowpass Chebyshev filter, order #O, passband ripple #VdB, -3.01dB frequency #F" }, > { des_hpch, "HpCh#O/#V/#F", > "Highpass Chebyshev filter, order #O, passband ripple #VdB, -3.01dB frequency #F" }, > { des_bpch, "BpCh#O/#V/#R", > "Bandpass Chebyshev filter, order #O, passband ripple #VdB, -3.01dB frequencies #R" }, > { des_bsch, "BsCh#O/#V/#R", > "Bandstop Chebyshev filter, order #O, passband ripple #VdB, -3.01dB frequencies #R" }, > { des_lpbez, "LpBeZ#O/#F", > "Lowpass Bessel filter, matched z-transform, order #O, -3.01dB frequency #F" }, > { des_hpbez, "HpBeZ#O/#F", > "Highpass Bessel filter, matched z-transform, order #O, -3.01dB frequency #F" }, > { des_bpbez, "BpBeZ#O/#R", > "Bandpass Bessel filter, matched z-transform, order #O, -3.01dB frequencies #R" }, > { des_bsbez, "BsBeZ#O/#R", > "Bandstop Bessel filter, matched z-transform, order #O, -3.01dB frequencies #R" }, > { des_lpbuz, "LpBuZ#O/#F", > "Lowpass Butterworth filter, matched z-transform, order #O, -3.01dB frequency #F" }, > { des_hpbuz, "HpBuZ#O/#F", > "Highpass Butterworth filter, matched z-transform, order #O, -3.01dB frequency #F" }, > { des_bpbuz, "BpBuZ#O/#R", > "Bandpass Butterworth filter, matched z-transform, order #O, -3.01dB frequencies #R" }, > { des_bsbuz, "BsBuZ#O/#R", > "Bandstop Butterworth filter, matched z-transform, order #O, -3.01dB frequencies #R" }, > { des_lpchz, "LpChZ#O/#V/#F", > "Lowpass Chebyshev filter, matched z-transform, order #O, " > "passband ripple #VdB, -3.01dB frequency #F" }, > { des_hpchz, "HpChZ#O/#V/#F", > "Highpass Chebyshev filter, matched z-transform, order #O, " > "passband ripple #VdB, -3.01dB frequency #F" }, > { des_bpchz, "BpChZ#O/#V/#R", > "Bandpass Chebyshev filter, matched z-transform, order #O, " > "passband ripple #VdB, -3.01dB frequencies #R" }, > { des_bschz, "BsChZ#O/#V/#R", > "Bandstop Chebyshev filter, matched z-transform, order #O, " > "passband ripple #VdB, -3.01dB frequencies #R" }, > { des_lpbube, "LpBuBe#O/#V/#F", > "Lowpass Butterworth-Bessel #V% cross, order #O, -3.01dB frequency #F" }, > { des_lpbq, "LpBq#o/#V/#F", > "Lowpass biquad filter, order #O, Q=#V, -3.01dB frequency #F" }, > { des_hpbq, "HpBq#o/#V/#F", > "Highpass biquad filter, order #O, Q=#V, -3.01dB frequency #F" }, > { des_bpbq, "BpBq#o/#V/#F", > "Bandpass biquad filter, order #O, Q=#V, centre frequency #F" }, > { des_bsbq, "BsBq#o/#V/#F", > "Bandstop biquad filter, order #O, Q=#V, centre frequency #F" }, > { des_apbq, "ApBq#o/#V/#F", > "Allpass biquad filter, order #O, Q=#V, centre frequency #F" }, > { des_pkbq, "PkBq#o/#V/#V/#F", > "Peaking biquad filter, order #O, Q=#V, dBgain=#V, frequency #F" }, > { des_lsbq, "LsBq#o/#V/#V/#F", > "Lowpass shelving biquad filter, S=#V, dBgain=#V, frequency #F" }, > { des_hsbq, "HsBq#o/#V/#V/#F", > "Highpass shelving biquad filter, S=#V, dBgain=#V, frequency #F" }, > { des_lpbl, "LpBl/#F", > "Lowpass Blackman window, -3.01dB frequency #F" }, > { des_lphm, "LpHm/#F", > "Lowpass Hamming window, -3.01dB frequency #F" }, > { des_lphn, "LpHn/#F", > "Lowpass Hann window, -3.01dB frequency #F" }, > { des_lpba, "LpBa/#F", > "Lowpass Bartlet (triangular) window, -3.01dB frequency #F" }, > { 0, 0, 0 } >}; ># 1332 "lib/fidlib-0.9.9/fidlib.c" >typedef struct Spec Spec; >static char* parse_spec(Spec*); >static FidFilter *auto_adjust_single(Spec *sp, double rate, double f0); >static FidFilter *auto_adjust_dual(Spec *sp, double rate, double f0, double f1); >struct Spec { > > char *spec; > double in_f0, in_f1; > int in_adj; > double argarr[10]; > double f0, f1; > int adj; > int n_arg; > int order; > int minlen; > int n_freq; > int fi; >}; > >FidFilter * >fid_design(const char *spec, double rate, double freq0, double freq1, int f_adj, char **descp) { > FidFilter *rv; > Spec sp; > double f0, f1; > char *err; > > > sp.spec= spec; > sp.in_f0= freq0; > sp.in_f1= freq1; > sp.in_adj= f_adj; > err= parse_spec(&sp); > if (err) error("%s", err); > f0= sp.f0; > f1= sp.f1; > > > f0 /= rate; > if (f0 > 0.5) error("Frequency of %gHz out of range with sampling rate of %gHz", f0*rate, rate); > f1 /= rate; > if (f1 > 0.5) error("Frequency of %gHz out of range with sampling rate of %gHz", f1*rate, rate); > > > > > > if (!sp.adj) > rv= filter[sp.fi].rout(rate, f0, f1, sp.order, sp.n_arg, sp.argarr); > else if (strstr(filter[sp.fi].fmt, "#R")) > rv= auto_adjust_dual(&sp, rate, f0, f1); > else > rv= auto_adjust_single(&sp, rate, f0); > > > if (descp) { > char *fmt= filter[sp.fi].txt; > int max= strlen(fmt) + 60 + sp.n_arg * 20; > char *desc= (char*) Alloc(max); > char *p= desc; > char ch; > double *arg= sp.argarr; > int n_arg= sp.n_arg; > > while ((ch= *fmt++)) { > if (ch != '#') { > *p++= ch; > continue; > } > > switch (*fmt++) { > case 'O': > p += sprintf(p, "%d", sp.order); > break; > case 'F': > p += sprintf(p, "%g", f0*rate); > break; > case 'R': > p += sprintf(p, "%g-%g", f0*rate, f1*rate); > break; > case 'V': > if (n_arg <= 0) > error("Internal error -- disagreement between filter short-spec\n" > " and long-description over number of arguments"); > n_arg--; > p += sprintf(p, "%g", *arg++); > break; > default: > error("Internal error: unknown format in long description: #%c", fmt[-1]); > } > } > *p++= 0; > if (p-desc >= max) error("Internal error: exceeded estimated description buffer"); > *descp= desc; > } > > return rv; >} ># 1437 "lib/fidlib-0.9.9/fidlib.c" >static FidFilter * >auto_adjust_single(Spec *sp, double rate, double f0) { > double a0, a1, a2; > FidFilter *(*design)(double,double,double,int,int,double*)= filter[sp->fi].rout; > FidFilter *rv= 0; > double resp; > double r0, r2; > int incr; > int a; > > > > > > a0= f0; { if (rv) {free(rv);rv= 0;} rv= design(rate, a0, a0, sp->order, sp->n_arg, sp->argarr); resp= fid_response(rv, f0); }; r0= resp; > for (a= 2; 1; a*=2) { > a2= f0/a; { if (rv) {free(rv);rv= 0;} rv= design(rate, a2, a2, sp->order, sp->n_arg, sp->argarr); resp= fid_response(rv, f0); }; r2= resp; > if ((r0 < (0.707106781186548)) != (r2 < (0.707106781186548))) break; > a2= 0.5-((0.5-f0)/a); { if (rv) {free(rv);rv= 0;} rv= design(rate, a2, a2, sp->order, sp->n_arg, sp->argarr); resp= fid_response(rv, f0); }; r2= resp; > if ((r0 < (0.707106781186548)) != (r2 < (0.707106781186548))) break; > if (a == 32) > error("auto_adjust_single internal error -- can't establish enclosing range"); > } > > incr= r2 > r0; > if (a0 > a2) { > a1= a0; a0= a2; a2= a1; > incr= !incr; > } > > > while (1) { > a1= 0.5 * (a0 + a2); > if (a1 == a0 || a1 == a2) break; > { if (rv) {free(rv);rv= 0;} rv= design(rate, a1, a1, sp->order, sp->n_arg, sp->argarr); resp= fid_response(rv, f0); }; > if (resp >= 0.9999995 * (0.707106781186548) && resp < 1.0000005 * (0.707106781186548)) break; > if (incr == (resp > (0.707106781186548))) > a2= a1; > else > a0= a1; > } > > > > > return rv; >} > > > > > > > >static FidFilter * >auto_adjust_dual(Spec *sp, double rate, double f0, double f1) { > double mid= 0.5 * (f0+f1); > double wid= 0.5 * fabs(f1-f0); > FidFilter *(*design)(double,double,double,int,int,double*)= filter[sp->fi].rout; > FidFilter *rv= 0; > int bpass= -1; > double delta; > double mid0, mid1; > double wid0, wid1; > double r0, r1, err0, err1; > double perr; > int cnt; > int cnt_design= 0; ># 1516 "lib/fidlib-0.9.9/fidlib.c" > { if (rv) {free(rv);rv= 0;} rv= design(rate, mid-wid, mid+wid, sp->order, sp->n_arg, sp->argarr); r0= fid_response(rv, f0); r1= fid_response(rv, f1); err0= fabs((0.707106781186548)-r0); err1= fabs((0.707106781186548)-r1); cnt_design++; }; > bpass= (fid_response(rv, 0) < 0.5); > delta= wid * 0.5; > > > for (cnt= 0; 1; cnt++, delta *= 0.51) { > { if (rv) {free(rv);rv= 0;} rv= design(rate, mid-wid, mid+wid, sp->order, sp->n_arg, sp->argarr); r0= fid_response(rv, f0); r1= fid_response(rv, f1); err0= fabs((0.707106781186548)-r0); err1= fabs((0.707106781186548)-r1); cnt_design++; }; > perr= (err0+err1); > > mid0= mid; > wid0= wid; > mid1= mid + (((r0 > r1) == bpass) ? delta : -delta); > wid1= wid + (((r0+r1 < 1.0) == bpass) ? delta : -delta); > > if (mid0 - wid1 > 0.0 && mid0 + wid1 < 0.5) { > { if (rv) {free(rv);rv= 0;} rv= design(rate, mid0-wid1, mid0+wid1, sp->order, sp->n_arg, sp->argarr); r0= fid_response(rv, f0); r1= fid_response(rv, f1); err0= fabs((0.707106781186548)-r0); err1= fabs((0.707106781186548)-r1); cnt_design++; }; > if ((err0 < 0.000000499 && err1 < 0.000000499)) break; > if ((err0+err1) < perr) { perr= (err0+err1); mid= mid0; wid= wid1; } > } > > if (mid1 - wid0 > 0.0 && mid1 + wid0 < 0.5) { > { if (rv) {free(rv);rv= 0;} rv= design(rate, mid1-wid0, mid1+wid0, sp->order, sp->n_arg, sp->argarr); r0= fid_response(rv, f0); r1= fid_response(rv, f1); err0= fabs((0.707106781186548)-r0); err1= fabs((0.707106781186548)-r1); cnt_design++; }; > if ((err0 < 0.000000499 && err1 < 0.000000499)) break; > if ((err0+err1) < perr) { perr= (err0+err1); mid= mid1; wid= wid0; } > } > > if (mid1 - wid1 > 0.0 && mid1 + wid1 < 0.5) { > { if (rv) {free(rv);rv= 0;} rv= design(rate, mid1-wid1, mid1+wid1, sp->order, sp->n_arg, sp->argarr); r0= fid_response(rv, f0); r1= fid_response(rv, f1); err0= fabs((0.707106781186548)-r0); err1= fabs((0.707106781186548)-r1); cnt_design++; }; > if ((err0 < 0.000000499 && err1 < 0.000000499)) break; > if ((err0+err1) < perr) { perr= (err0+err1); mid= mid1; wid= wid1; } > } > > if (cnt > 1000) > error("auto_adjust_dual -- design not converging"); > } > > > > > > > > return rv; >} > > > > > > > >static void >expand_spec(char *buf, char *bufend, char *str) { > int ch; > char *p= buf; > > while ((ch= *str++)) { > if (p + 10 >= bufend) > error("Buffer overflow in fidlib expand_spec()"); > if (ch == '#') { > switch (*str++) { > case 'o': p += sprintf(p, "<optional-order>"); break; > case 'O': p += sprintf(p, "<order>"); break; > case 'F': p += sprintf(p, "<freq>"); break; > case 'R': p += sprintf(p, "<range>"); break; > case 'V': p += sprintf(p, "<value>"); break; > default: p += sprintf(p, "<%c>", str[-1]); break; > } > } else { > *p++= ch; > } > } > *p= 0; >} ># 1610 "lib/fidlib-0.9.9/fidlib.c" >double >fid_design_coef(double *coef, int n_coef, const char *spec, double rate, > double freq0, double freq1, int adj) { > FidFilter *filt= fid_design(spec, rate, freq0, freq1, adj, 0); > FidFilter *ff= filt; > int a, len; > int cnt= 0; > double gain= 1.0; > double *iir, *fir, iir_adj; > static double const_one= 1; > int n_iir, n_fir; > int iir_cbm, fir_cbm; > > while (ff->typ) { > if (ff->typ == 'F' && ff->len == 1) { > gain *= ff->val[0]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > continue; > } > > if (ff->typ != 'I' && ff->typ != 'F') > error("fid_design_coef can't handle FidFilter type: %c", ff->typ); > > > iir= fir= &const_one; > n_iir= n_fir= 1; > iir_cbm= fir_cbm= ~0; > > > if (ff->typ == 'I') { > iir= ff->val; > n_iir= ff->len; > iir_cbm= ff->cbm; > iir_adj= 1.0 / ff->val[0]; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > gain *= iir_adj; > } > > > if (ff->typ == 'F') { > fir= ff->val; > n_fir= ff->len; > fir_cbm= ff->cbm; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } > > > len= n_fir > n_iir ? n_fir : n_iir; > for (a= len-1; a>=0; a--) { > > if (a < n_iir && a>0 && > !(iir_cbm & (1<<(a<15?a:15)))) { > if (cnt++ < n_coef) *coef++= iir_adj * iir[a]; > } > > > if (a < n_fir && > !(fir_cbm & (1<<(a<15?a:15)))) { > if (cnt++ < n_coef) *coef++= fir[a]; > } > } > } > > if (cnt != n_coef) > error("fid_design_coef called with the wrong number of coefficients.\n" > " Given %d, expecting %d: (\"%s\",%g,%g,%g,%d)", > n_coef, cnt, spec, rate, freq0, freq1, adj); > > free(filt); > return gain; >} > > > > > >void >fid_list_filters(FILE *out) { > int a; > > for (a= 0; filter[a].fmt; a++) { > char buf[4096]; > expand_spec(buf, buf+sizeof(buf), filter[a].fmt); > fprintf(out, "%s\n ", buf); > expand_spec(buf, buf+sizeof(buf), filter[a].txt); > fprintf(out, "%s\n", buf); > } >} > > > > > > >int >fid_list_filters_buf(char *buf, char *bufend) { > int a, cnt; > char tmp[4096]; > > for (a= 0; filter[a].fmt; a++) { > expand_spec(tmp, tmp+sizeof(tmp), filter[a].fmt); > buf += (cnt= snprintf(buf, bufend-buf, "%s\n ", tmp)); > if (cnt < 0 || buf >= bufend) return 0; > expand_spec(tmp, tmp+sizeof(tmp), filter[a].txt); > buf += (cnt= snprintf(buf, bufend-buf, "%s\n", tmp)); > if (cnt < 0 || buf >= bufend) return 0; > } > return 1; >} > > > > > >static inline int >convolve(double *dst, int n_dst, double *src, int n_src) { > int len= n_dst + n_src - 1; > int a, b; > > for (a= len-1; a>=0; a--) { > double val= 0; > for (b= 0; b<n_src; b++) > if (a-b >= 0 && a-b < n_dst) > val += src[b] * dst[a-b]; > dst[a]= val; > } > > return len; >} > > > > > > > >FidFilter * >fid_flatten(FidFilter *filt) { > int m_fir= 1; > int m_iir= 1; > int n_fir, n_iir; > FidFilter *ff; > FidFilter *rv; > double *fir, *iir; > double adj; > int a; > > > ff= filt; > while (ff->len) { > if (ff->typ == 'I') > m_iir += ff->len-1; > else if (ff->typ == 'F') > m_fir += ff->len-1; > else > error("fid_flatten doesn't know about type %d", ff->typ); > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } > > > rv= (FidFilter*)Alloc(((sizeof(FidFilter)-sizeof(double))*((2)+1) + sizeof(double)*(m_iir + m_fir))); > rv->typ= 'I'; > rv->len= m_iir; > iir= rv->val; > ff= ((FidFilter*)((rv)->val + (rv)->len)); > ff->typ= 'F'; > ff->len= m_fir; > fir= ff->val; > > iir[0]= 1.0; n_iir= 1; > fir[0]= 1.0; n_fir= 1; > > > ff= filt; > while (ff->len) { > if (ff->typ == 'I') > n_iir= convolve(iir, n_iir, ff->val, ff->len); > else > n_fir= convolve(fir, n_fir, ff->val, ff->len); > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } > > > if (n_iir != m_iir || > n_fir != m_fir) > error("Internal error in fid_combine() -- array under/overflow"); > > > adj= 1.0/iir[0]; > for (a= 0; a<n_iir; a++) iir[a] *= adj; > for (a= 0; a<n_fir; a++) fir[a] *= adj; > > return rv; >} > > > > > > >static char * >parse_spec(Spec *sp) { > double *arg; > int a; > > arg= sp->argarr; > sp->n_arg= 0; > sp->order= 0; > sp->f0= 0; > sp->f1= 0; > sp->adj= 0; > sp->minlen= -1; > sp->n_freq= 0; > > for (a= 0; 1; a++) { > char *fmt= filter[a].fmt; > char *p= sp->spec; > char ch, *q; > > if (!fmt) return strdupf("Spec-string \"%s\" matches no known format", sp->spec); > > while (*p && (ch= *fmt++)) { > if (ch != '#') { > if (ch == *p++) continue; > p= 0; break; > } > > if (((*__ctype_b_loc ())[(int) ((*p))] & (unsigned short int) _ISalpha)) { p= 0; break; } > > > switch (ch= *fmt++) { > default: > return strdupf("Internal error: Unknown format #%c in format: %s", > fmt[-1], filter[a].fmt); > case 'o': > case 'O': > sp->order= (int)strtol(p, &q, 10); > if (p == q) { > if (ch == 'O') goto bad; > sp->order= 1; > } > if (sp->order <= 0) > return strdupf("Bad order %d in spec-string \"%s\"", sp->order, sp->spec); > p= q; break; > case 'V': > sp->n_arg++; > *arg++= strtod(p, &q); > if (p == q) goto bad; > p= q; break; > case 'F': > sp->minlen= p-1-sp->spec; > sp->n_freq= 1; > sp->adj= (p[0] == '='); > if (sp->adj) p++; > sp->f0= strtod(p, &q); > sp->f1= 0; > if (p == q) goto bad; > p= q; break; > case 'R': > sp->minlen= p-1-sp->spec; > sp->n_freq= 2; > sp->adj= (p[0] == '='); > if (sp->adj) p++; > sp->f0= strtod(p, &q); > if (p == q) goto bad; > p= q; > if (*p++ != '-') goto bad; > sp->f1= strtod(p, &q); > if (p == q) goto bad; > if (sp->f0 > sp->f1) > return strdupf("Backwards frequency range in spec-string \"%s\"", sp->spec); > p= q; break; > } > } > > if (p == 0) continue; > > if (fmt[0] == '/' && fmt[1] == '#' && fmt[2] == 'F') { > sp->minlen= p-sp->spec; > sp->n_freq= 1; > if (sp->in_f0 < 0.0) > return strdupf("Frequency omitted from filter-spec, and no default provided"); > sp->f0= sp->in_f0; > sp->f1= 0; > sp->adj= sp->in_adj; > fmt += 3; > } else if (fmt[0] == '/' && fmt[1] == '#' && fmt[2] == 'R') { > sp->minlen= p-sp->spec; > sp->n_freq= 2; > if (sp->in_f0 < 0.0 || sp->in_f1 < 0.0) > return strdupf("Frequency omitted from filter-spec, and no default provided"); > sp->f0= sp->in_f0; > sp->f1= sp->in_f1; > sp->adj= sp->in_adj; > fmt += 3; > } > > > if (*fmt) { > bad: > return strdupf("Bad match of spec-string \"%s\" to format \"%s\"", > sp->spec, filter[a].fmt); > } > if (sp->n_arg > 10) > return strdupf("Internal error -- maximum arguments exceeded"); > > > if (sp->minlen < 0) sp->minlen= p-sp->spec; > > > sp->fi= a; > return 0; > } > return 0; >} ># 1937 "lib/fidlib-0.9.9/fidlib.c" >void >fid_rewrite_spec(const char *spec, double freq0, double freq1, int adj, > char **spec1p, > char **spec2p, double *freq0p, double *freq1p, int *adjp) { > Spec sp; > char *err; > sp.spec= spec; > sp.in_f0= freq0; > sp.in_f1= freq1; > sp.in_adj= adj; > err= parse_spec(&sp); > if (err) error("%s", err); > > if (spec1p) { > char buf[128]; > int len; > char *rv; > switch (sp.n_freq) { > case 1: sprintf(buf, "/%s%.15g", sp.adj ? "=" : "", sp.f0); break; > case 2: sprintf(buf, "/%s%.15g-%.15g", sp.adj ? "=" : "", sp.f0, sp.f1); break; > default: buf[0]= 0; > } > len= strlen(buf); > rv= (char*) Alloc(sp.minlen + len + 1); > memcpy(rv, spec, sp.minlen); > strcpy(rv+sp.minlen, buf); > *spec1p= rv; > } > > if (spec2p) { > char *rv= (char *)Alloc(sp.minlen + 1); > memcpy(rv, spec, sp.minlen); > *spec2p= rv; > *freq0p= sp.f0; > *freq1p= sp.f1; > *adjp= sp.adj; > } >} ># 1992 "lib/fidlib-0.9.9/fidlib.c" >FidFilter * >fid_cv_array(double *arr) { > double *dp; > FidFilter *ff, *rv; > int n_head= 0; > int n_val= 0; > > > for (dp= arr; *dp; ) { > int len, typ; > > typ= (int)(*dp++); > if (typ != 'F' && typ != 'I') > error("Bad type in array passed to fid_cv_array: %g", dp[-1]); > > len= (int)(*dp++); > if (len < 1) > error("Bad length in array passed to fid_cv_array: %g", dp[-1]); > > n_head++; > n_val += len; > dp += len; > } > > rv= ff= (FidFilter*)Alloc(((sizeof(FidFilter)-sizeof(double))*((n_head)+1) + sizeof(double)*(n_val))); > > > for (dp= arr; *dp; ) { > int len, typ; > typ= (int)(*dp++); > len= (int)(*dp++); > > ff->typ= typ; > ff->cbm= ~0; > ff->len= len; > memcpy(ff->val, dp, len * sizeof(double)); > dp += len; > ff= ((FidFilter*)((ff)->val + (ff)->len)); > } > > > > return rv; >} ># 2045 "lib/fidlib-0.9.9/fidlib.c" >FidFilter * >fid_cat(int freeme, ...) { > va_list ap; > FidFilter *rv, *ff, *ff0; > int len= 0; > int cnt; > char *dst; > > > __builtin_va_start(ap,freeme); > while ((ff0= __builtin_va_arg(ap,FidFilter*))) { > for (ff= ff0; ff->typ; ff= ((FidFilter*)((ff)->val + (ff)->len))) > ; > len += ((char*)ff) - ((char*)ff0); > } > __builtin_va_end(ap); > > rv= (FidFilter*)Alloc(((sizeof(FidFilter)-sizeof(double))*((0)+1) + sizeof(double)*(0)) + len); > dst= (char*)rv; > > __builtin_va_start(ap,freeme); > while ((ff0= __builtin_va_arg(ap,FidFilter*))) { > for (ff= ff0; ff->typ; ff= ((FidFilter*)((ff)->val + (ff)->len))) > ; > cnt= ((char*)ff) - ((char*)ff0); > memcpy(dst, ff0, cnt); > dst += cnt; > if (freeme) free(ff0); > } > __builtin_va_end(ap); > > > return rv; >} > > > > > > >static void >skipWS(char **pp) { > char *p= *pp; > > while (*p) { > if (((*__ctype_b_loc ())[(int) ((*p))] & (unsigned short int) _ISspace)) { p++; continue; } > if (*p == '#') { > while (*p && *p != '\n') p++; > continue; > } > break; > } > *pp= p; >} > > > > >static int >grabWord(char **pp, char *buf, int buflen) { > char *p, *q; > int len; > > skipWS(pp); > p= *pp; > if (!*p) return 0; > > q= p; > if (*q == ',' || *q == ';' || *q == ')' || *q == ']' || *q == '}') { > q++; > } else { > while (*q && *q != '#' && !((*__ctype_b_loc ())[(int) ((*q))] & (unsigned short int) _ISspace) && > (*q != ',' && *q != ';' && *q != ')' && *q != ']' && *q != '}')) > q++; > } > len= q-p; > if (len >= buflen) return 0; > > memcpy(buf, p, len); > buf[len]= 0; > > *pp= q; > return 1; >} ># 2143 "lib/fidlib-0.9.9/fidlib.c" >char * >fid_parse(double rate, char **pp, FidFilter **ffp) { > char buf[128]; > char *p= *pp, *rew; > > char *rv= (char*) Alloc(128); > char *rvend= rv + 128; > char *rvp= rv; > char *tmp; > > FidFilter *curr; > int xtra= ((sizeof(FidFilter)-sizeof(double))*((0)+1) + sizeof(double)*(0)); > int typ= -1; > double val; > char dmy; > > > > > > > while (1) { > rew= p; > if (!grabWord(&p, buf, sizeof(buf))) { > if (*p) { *pp= p; *ffp= 0; return strdupf("Filter element unexpectedly long -- syntax error?"); }; > buf[0]= 0; > } > if (!buf[0] || !buf[1]) switch (buf[0]) { > default: > break; > case 0: > case ',': > case ';': > case ')': > case ']': > case '}': > > tmp= (char*)realloc(rv, (rvp-rv) + xtra); > if (!tmp) error("Out of memory"); > curr= (FidFilter*)((rvp-rv) + tmp); > curr->typ= 0; curr->cbm= 0; curr->len= 0; > *pp= buf[0] ? (p-1) : p; > *ffp= (FidFilter*)tmp; > return 0; > case '/': > if (typ > 0) { *pp= rew; *ffp= 0; return strdupf("Filter syntax error; unexpected '/'"); }; > typ= 'I'; > continue; > case 'x': > if (typ > 0) { *pp= rew; *ffp= 0; return strdupf("Filter syntax error; unexpected 'x'"); }; > typ= 'F'; > continue; > } > > if (typ < 0) typ= 'F'; > if (!typ) { *pp= p; *ffp= 0; return strdupf("Expecting a 'x' or '/' before this"); }; > > if (1 != sscanf(buf, "%lf %c", &val, &dmy)) { > > FidFilter *ff; > FidFilter *ff1; > Spec sp; > double f0, f1; > char *err; > int len; > > if (typ != 'F') { *pp= rew; *ffp= 0; return strdupf("Predefined filters cannot be used with '/'"); }; > > > memset(&sp, 0, sizeof(sp)); > sp.spec= buf; > sp.in_f0= sp.in_f1= -1; > if ((err= parse_spec(&sp))) { *pp= rew; *ffp= 0; return err; }; > f0= sp.f0; > f1= sp.f1; > > > f0 /= rate; > if (f0 > 0.5) { *pp= rew; *ffp= 0; return strdupf("Frequency of %gHz out of range with " "sampling rate of %gHz", f0*rate, rate); } > ; > f1 /= rate; > if (f1 > 0.5) { *pp= rew; *ffp= 0; return strdupf("Frequency of %gHz out of range with " "sampling rate of %gHz", f1*rate, rate); } > ; > > > > > > if (!sp.adj) > ff= filter[sp.fi].rout(rate, f0, f1, sp.order, sp.n_arg, sp.argarr); > else if (strstr(filter[sp.fi].fmt, "#R")) > ff= auto_adjust_dual(&sp, rate, f0, f1); > else > ff= auto_adjust_single(&sp, rate, f0); > > > for (ff1= ff; ff1->typ; ff1= ((FidFilter*)((ff1)->val + (ff1)->len))) ; > len= ((char*)ff1-(char*)ff); > while (rvp + len + xtra >= rvend) { tmp= (char*)realloc(rv, (rvend-rv) * 2); if (!tmp) error("Out of memory"); rvend= (rvend-rv) * 2 + tmp; rvp= (rvp-rv) + tmp; curr= (FidFilter*)(((char*)curr) - rv + tmp); rv= tmp; }; > memcpy(rvp, ff, len); rvp += len; > free(ff); > typ= 0; > continue; > } > > > curr= (FidFilter*)rvp; > rvp += xtra; > while (rvp + sizeof(double) >= rvend) { tmp= (char*)realloc(rv, (rvend-rv) * 2); if (!tmp) error("Out of memory"); rvend= (rvend-rv) * 2 + tmp; rvp= (rvp-rv) + tmp; curr= (FidFilter*)(((char*)curr) - rv + tmp); rv= tmp; }; > curr->typ= typ; > curr->cbm= ~0; > curr->len= 1; > *(double*)rvp= val; > rvp += sizeof(double); > > > while (1) { > rew= p; > if (!grabWord(&p, buf, sizeof(buf))) { > if (*p) { *pp= p; *ffp= 0; return strdupf("Filter element unexpectedly long -- syntax error?"); }; > buf[0]= 0; > } > if (1 != sscanf(buf, "%lf %c", &val, &dmy)) { > p= rew; > break; > } > while (rvp + sizeof(double) >= rvend) { tmp= (char*)realloc(rv, (rvend-rv) * 2); if (!tmp) error("Out of memory"); rvend= (rvend-rv) * 2 + tmp; rvp= (rvp-rv) + tmp; curr= (FidFilter*)(((char*)curr) - rv + tmp); rv= tmp; }; > curr->len++; > *(double*)rvp= val; > rvp += sizeof(double); > } > typ= 0; > continue; > } > > > > > return strdupf("Internal error, shouldn't reach here"); >} ># 2294 "lib/fidlib-0.9.9/fidlib.c" ># 1 "lib/fidlib-0.9.9/fidrf_cmdlist.h" 1 ># 20 "lib/fidlib-0.9.9/fidrf_cmdlist.h" >typedef struct Run { > int magic; > int buf_size; > double *coef; > char *cmd; >} Run; > >typedef struct RunBuf { > double *coef; > char *cmd; > int mov_cnt; > double buf[0]; >} RunBuf; ># 74 "lib/fidlib-0.9.9/fidrf_cmdlist.h" >typedef unsigned char uchar; > >static double >filter_step(void *fbuf, double iir) { > double *coef= ((RunBuf*)fbuf)->coef; > uchar *cmd= (uchar*) ((RunBuf*)fbuf)->cmd; > double *buf= &((RunBuf*)fbuf)->buf[0]; > uchar ch; > double fir= 0; > double tmp= buf[0]; > int cnt; > > > > memmove(buf, buf+1, ((RunBuf*)fbuf)->mov_cnt); ># 120 "lib/fidlib-0.9.9/fidrf_cmdlist.h" > while ((ch= *cmd++)) switch (ch) { > case 1: > iir -= *coef++ * tmp; tmp= *buf++;; break; > case 2: > iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++;; break; > case 3: > iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++;; break; > case 4: > cnt= *cmd++; > do { iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++;; } while (--cnt > 0); > break; > case 5: > fir += *coef++ * tmp; tmp= *buf++;; break; > case 6: > fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++;; break; > case 7: > fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++;; break; > case 8: > cnt= *cmd++; > do { fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++;; } while (--cnt > 0); > break; > case 9: > iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; break; > case 10: > iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; break; > case 11: > iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; break; > case 12: > cnt= *cmd++; > do { iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; } while (--cnt > 0); > break; > case 13: > iir -= *coef++ * tmp; tmp= *buf++; buf[-1]= iir;; break; > case 14: > fir += *coef++ * tmp; tmp= *buf++; buf[-1]= iir; iir= fir + *coef++ * iir; fir= 0; break; > case 15: > iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++; buf[-1]= iir; iir= fir + *coef++ * iir; fir= 0; break; > case 16: > iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++; buf[-1]= iir;; break; > case 17: > fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++; buf[-1]= iir; iir= fir + *coef++ * iir; fir= 0; break; > case 18: > iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++; buf[-1]= iir; iir= fir + *coef++ * iir; fir= 0; break; > case 19: > cnt= *cmd++; > do { iir -= *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; tmp= *buf++; buf[-1]= iir;; } while (--cnt > 0); > break; > case 20: > cnt= *cmd++; > do { fir += *coef++ * tmp; tmp= *buf++;; fir += *coef++ * tmp; tmp= *buf++; buf[-1]= iir; iir= fir + *coef++ * iir; fir= 0; } while (--cnt > 0); > break; > case 21: > cnt= *cmd++; > do { iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++;; iir -= *coef++ * tmp; fir += *coef++ * tmp; tmp= *buf++; buf[-1]= iir; iir= fir + *coef++ * iir; fir= 0; } while (--cnt > 0); > break; > case 22: > iir *= *coef++; break; > } ># 187 "lib/fidlib-0.9.9/fidrf_cmdlist.h" > return iir; >} ># 211 "lib/fidlib-0.9.9/fidrf_cmdlist.h" >void * >fid_run_new(FidFilter *filt, double (**funcpp)(void *,double)) { > int buf_size= 0; > uchar *cp, prev; > FidFilter *ff; > double *dp; > double gain= 1.0; > int a; > double *coef_tmp; > uchar *cmd_tmp; > int coef_cnt, coef_max; > int cmd_cnt, cmd_max; > int filt_cnt= 0; > Run *rr; > > for (ff= filt; ff->len; ff= ((FidFilter*)((ff)->val + (ff)->len))) > filt_cnt += ff->len; > > > coef_tmp= ((double*)Alloc((coef_max= filt_cnt + 1) * sizeof(double))); > cmd_tmp= (uchar*)((char*)Alloc((cmd_max= filt_cnt + 4) * sizeof(char))); > dp= coef_tmp; > cp= cmd_tmp; > prev= 0; > > > while (filt->len) { > int n_iir, n_fir, cnt; > double *iir, *fir; > double adj; > if (filt->typ == 'F' && filt->len == 1) { > gain *= filt->val[0]; > filt= ((FidFilter*)((filt)->val + (filt)->len)); > continue; > } > if (filt->typ == 'F') { > iir= 0; n_iir= 0; > fir= filt->val; n_fir= filt->len; > filt= ((FidFilter*)((filt)->val + (filt)->len)); > } else if (filt->typ == 'I') { > iir= filt->val; n_iir= filt->len; > fir= 0; n_fir= 0; > filt= ((FidFilter*)((filt)->val + (filt)->len)); > while (filt->typ == 'F' && filt->len == 1) { > gain *= filt->val[0]; > filt= ((FidFilter*)((filt)->val + (filt)->len)); > } > if (filt->typ == 'F') { > fir= filt->val; n_fir= filt->len; > filt= ((FidFilter*)((filt)->val + (filt)->len)); > } > } else > error("Internal error: fid_run_new can only handle IIR + FIR types"); > > > > cnt= n_iir > n_fir ? n_iir : n_fir; > buf_size += cnt-1; > if (n_iir) { > adj= 1.0 / iir[0]; > gain *= adj; > } > if (n_fir == 3 && n_iir == 3) { > if (prev == 18) { cp[-1]= prev= 21; *cp++= 2; } > else if (prev == 21) { cp[-1]++; } > else *cp++= prev= 18; > *dp++= iir[2]*adj; *dp++= fir[2]; > *dp++= iir[1]*adj; *dp++= fir[1]; > *dp++= fir[0]; > } else if (n_fir == 3 && n_iir == 0) { > if (prev == 17) { cp[-1]= prev= 20; *cp++= 2; } > else if (prev == 20) { cp[-1]++; } > else *cp++= prev= 17; > *dp++= fir[2]; > *dp++= fir[1]; > *dp++= fir[0]; > } else if (n_fir == 0 && n_iir == 3) { > if (prev == 16) { cp[-1]= prev= 19; *cp++= 2; } > else if (prev == 19) { cp[-1]++; } > else *cp++= prev= 16; > *dp++= iir[2]*adj; > *dp++= iir[1]*adj; > } else { > prev= 0; > if (cnt > n_fir) { > a= 0; > while (cnt > n_fir && cnt > 2) { > *dp++= iir[--cnt] * adj; a++; > } > while (a >= 4) { > int nn= a/4; if (nn > 255) nn= 255; > *cp++= 4; *cp++= nn; a -= nn*4; > } > if (a) *cp++= a; > } > if (cnt > n_iir) { > a= 0; > while (cnt > n_iir && cnt > 2) { > *dp++= fir[--cnt]; a++; > } > while (a >= 4) { > int nn= a/4; if (nn > 255) nn= 255; > *cp++= 8; *cp++= nn; a -= nn*4; > } > if (a) *cp++= 4+a; > } > a= 0; > while (cnt > 2) { > cnt--; a++; > *dp++= iir[cnt]*adj; *dp++= fir[cnt]; > } > while (a >= 4) { > int nn= a/4; if (nn > 255) nn= 255; > *cp++= 12; *cp++= nn; a -= nn*4; > } > if (a) *cp++= 8+a; > > if (!n_fir) { > *cp++= 13; > *dp++= iir[1]; > } else if (!n_iir) { > *cp++= 14; > *dp++= fir[1]; > *dp++= fir[0]; > } else { > *cp++= 15; > *dp++= iir[1]; > *dp++= fir[1]; > *dp++= fir[0]; > } > } > } > > if (gain != 1.0) { > *cp++= 22; > *dp++= gain; > } > *cp++= 0; > > > coef_cnt= dp-coef_tmp; > cmd_cnt= cp-cmd_tmp; > if (coef_cnt > coef_max || > cmd_cnt > cmd_max) > error("fid_run_new internal error; arrays exceeded"); > > > rr= (Run*)Alloc(sizeof(Run) + > coef_cnt*sizeof(double) + > cmd_cnt*sizeof(char)); > rr->magic= 0x64966325; > rr->buf_size= buf_size; > rr->coef= (double*)(rr+1); > rr->cmd= (char*)(rr->coef + coef_cnt); > memcpy(rr->coef, coef_tmp, coef_cnt*sizeof(double)); > memcpy(rr->cmd, cmd_tmp, cmd_cnt*sizeof(char)); ># 376 "lib/fidlib-0.9.9/fidrf_cmdlist.h" > free(coef_tmp); > free(cmd_tmp); > > *funcpp= filter_step; > return rr; >} > > > > > >void * >fid_run_newbuf(void *run) { > Run *rr= (Run*)run; > RunBuf *rb; > int siz; > > if (rr->magic != 0x64966325) > error("Bad handle passed to fid_run_newbuf()"); > > siz= rr->buf_size ? rr->buf_size : 1; > rb= (RunBuf*)Alloc(sizeof(RunBuf) + siz * sizeof(double)); > rb->coef= rr->coef; > rb->cmd= rr->cmd; > rb->mov_cnt= (siz-1) * sizeof(double); > > > return rb; >} > > > > > >int >fid_run_bufsize(void *run) { > Run *rr= (Run*) run; > int siz; > > if (rr->magic != 0x64966325) > error("Bad handle passed to fid_run_bufsize()"); > > siz= rr->buf_size ? rr->buf_size : 1; > return sizeof(RunBuf) + siz * sizeof(double); >} ># 431 "lib/fidlib-0.9.9/fidrf_cmdlist.h" >void >fid_run_initbuf(void *run, void *buf) { > Run *rr= (Run*) run; > RunBuf *rb= (RunBuf*) buf; > int siz; > > if (rr->magic != 0x64966325) > error("Bad handle passed to fid_run_initbuf()"); > > siz= rr->buf_size ? rr->buf_size : 1; > rb->coef= rr->coef; > rb->cmd= rr->cmd; > rb->mov_cnt= (siz-1) * sizeof(double); > memset(rb->buf, 0, rb->mov_cnt + sizeof(double)); >} ># 454 "lib/fidlib-0.9.9/fidrf_cmdlist.h" >void >fid_run_zapbuf(void *buf) { > RunBuf *rb= (RunBuf*) buf; > memset(rb->buf, 0, rb->mov_cnt + sizeof(double)); >} > > > > > > >void >fid_run_freebuf(void *runbuf) { > free(runbuf); >} > > > > > >void >fid_run_free(void *run) { > free(run); >} ># 2295 "lib/fidlib-0.9.9/fidlib.c" 2
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 394317
:
295453
| 295891