Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 247614 Details for
Bug 337666
sys-devel/gcc-4.4.3 + sys-devel/binutils-2.20.1 on SuperH hits Error: pcrel too far with mysql
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
dict0crea.i
dict0crea.i (text/plain), 458.30 KB, created by
SpanKY
on 2010-09-16 16:58:02 UTC
(
hide
)
Description:
dict0crea.i
Filename:
MIME Type:
Creator:
SpanKY
Created:
2010-09-16 16:58:02 UTC
Size:
458.30 KB
patch
obsolete
>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; >__extension__ typedef signed long long int __int64_t; >__extension__ typedef unsigned long long int __uint64_t; >__extension__ typedef long long int __quad_t; >__extension__ typedef unsigned long long int __u_quad_t; >__extension__ typedef __u_quad_t __dev_t; >__extension__ typedef unsigned int __uid_t; >__extension__ typedef unsigned int __gid_t; >__extension__ typedef unsigned long int __ino_t; >__extension__ typedef __u_quad_t __ino64_t; >__extension__ typedef unsigned int __mode_t; >__extension__ typedef unsigned int __nlink_t; >__extension__ typedef long int __off_t; >__extension__ typedef __quad_t __off64_t; >__extension__ typedef int __pid_t; >__extension__ typedef struct { int __val[2]; } __fsid_t; >__extension__ typedef long int __clock_t; >__extension__ typedef unsigned long int __rlim_t; >__extension__ typedef __u_quad_t __rlim64_t; >__extension__ typedef unsigned int __id_t; >__extension__ typedef long int __time_t; >__extension__ typedef unsigned int __useconds_t; >__extension__ typedef long int __suseconds_t; >__extension__ typedef int __daddr_t; >__extension__ typedef long int __swblk_t; >__extension__ typedef int __key_t; >__extension__ typedef int __clockid_t; >__extension__ typedef void * __timer_t; >__extension__ typedef long int __blksize_t; >__extension__ typedef long int __blkcnt_t; >__extension__ typedef __quad_t __blkcnt64_t; >__extension__ typedef unsigned long int __fsblkcnt_t; >__extension__ typedef __u_quad_t __fsblkcnt64_t; >__extension__ typedef unsigned long int __fsfilcnt_t; >__extension__ typedef __u_quad_t __fsfilcnt64_t; >__extension__ typedef int __ssize_t; >typedef __off64_t __loff_t; >typedef __quad_t *__qaddr_t; >typedef char *__caddr_t; >__extension__ typedef int __intptr_t; >__extension__ typedef unsigned int __socklen_t; >typedef unsigned int size_t; >struct timespec > { > __time_t tv_sec; > long int tv_nsec; > }; >struct sched_param > { > int __sched_priority; > }; > >extern int clone (int (*__fn) (void *__arg), void *__child_stack, > int __flags, void *__arg, ...) __attribute__ ((__nothrow__)); >extern int unshare (int __flags) __attribute__ ((__nothrow__)); >extern int sched_getcpu (void) __attribute__ ((__nothrow__)); > >struct __sched_param > { > int __sched_priority; > }; >typedef unsigned long int __cpu_mask; >typedef struct >{ > __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; >} cpu_set_t; > >extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) > __attribute__ ((__nothrow__)); >extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__)); > > >extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param) > __attribute__ ((__nothrow__)); >extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__)); >extern int sched_setscheduler (__pid_t __pid, int __policy, > __const struct sched_param *__param) __attribute__ ((__nothrow__)); >extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__)); >extern int sched_yield (void) __attribute__ ((__nothrow__)); >extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__)); >extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__)); >extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__)); >extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, > __const cpu_set_t *__cpuset) __attribute__ ((__nothrow__)); >extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize, > cpu_set_t *__cpuset) __attribute__ ((__nothrow__)); > > > >typedef __clock_t clock_t; > > > >typedef __time_t time_t; > > >typedef __clockid_t clockid_t; >typedef __timer_t timer_t; > >struct tm >{ > int tm_sec; > int tm_min; > int tm_hour; > int tm_mday; > int tm_mon; > int tm_year; > int tm_wday; > int tm_yday; > int tm_isdst; > long int tm_gmtoff; > __const char *tm_zone; >}; > > >struct itimerspec > { > struct timespec it_interval; > struct timespec it_value; > }; >struct sigevent; >typedef __pid_t pid_t; > >extern clock_t clock (void) __attribute__ ((__nothrow__)); >extern time_t time (time_t *__timer) __attribute__ ((__nothrow__)); >extern double difftime (time_t __time1, time_t __time0) > __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__)); >extern size_t strftime (char *__restrict __s, size_t __maxsize, > __const char *__restrict __format, > __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); > >extern char *strptime (__const char *__restrict __s, > __const char *__restrict __fmt, struct tm *__tp) > __attribute__ ((__nothrow__)); >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; >extern size_t strftime_l (char *__restrict __s, size_t __maxsize, > __const char *__restrict __format, > __const struct tm *__restrict __tp, > __locale_t __loc) __attribute__ ((__nothrow__)); >extern char *strptime_l (__const char *__restrict __s, > __const char *__restrict __fmt, struct tm *__tp, > __locale_t __loc) __attribute__ ((__nothrow__)); > >extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__)); >extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__)); > >extern struct tm *gmtime_r (__const time_t *__restrict __timer, > struct tm *__restrict __tp) __attribute__ ((__nothrow__)); >extern struct tm *localtime_r (__const time_t *__restrict __timer, > struct tm *__restrict __tp) __attribute__ ((__nothrow__)); > >extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__)); >extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__)); > >extern char *asctime_r (__const struct tm *__restrict __tp, > char *__restrict __buf) __attribute__ ((__nothrow__)); >extern char *ctime_r (__const time_t *__restrict __timer, > char *__restrict __buf) __attribute__ ((__nothrow__)); >extern char *__tzname[2]; >extern int __daylight; >extern long int __timezone; >extern char *tzname[2]; >extern void tzset (void) __attribute__ ((__nothrow__)); >extern int daylight; >extern long int timezone; >extern int stime (__const time_t *__when) __attribute__ ((__nothrow__)); >extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__)); >extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__)); >extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >extern int nanosleep (__const struct timespec *__requested_time, > struct timespec *__remaining); >extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__)); >extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__)); >extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) > __attribute__ ((__nothrow__)); >extern int clock_nanosleep (clockid_t __clock_id, int __flags, > __const struct timespec *__req, > struct timespec *__rem); >extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__)); >extern int timer_create (clockid_t __clock_id, > struct sigevent *__restrict __evp, > timer_t *__restrict __timerid) __attribute__ ((__nothrow__)); >extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__)); >extern int timer_settime (timer_t __timerid, int __flags, > __const struct itimerspec *__restrict __value, > struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__)); >extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) > __attribute__ ((__nothrow__)); >extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__)); >extern int getdate_err; >extern struct tm *getdate (__const char *__string); >extern int getdate_r (__const char *__restrict __string, > struct tm *__restrict __resbufp); > > >typedef int __sig_atomic_t; >typedef struct > { > unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; > } __sigset_t; >typedef __sigset_t sigset_t; > >typedef unsigned long int pthread_t; >typedef union >{ > char __size[36]; > long int __align; >} pthread_attr_t; >typedef struct __pthread_internal_slist >{ > struct __pthread_internal_slist *__next; >} __pthread_slist_t; >typedef union >{ > struct __pthread_mutex_s > { > int __lock; > unsigned int __count; > int __owner; > int __kind; > unsigned int __nusers; > __extension__ union > { > int __spins; > __pthread_slist_t __list; > }; > } __data; > char __size[24]; > long int __align; >} pthread_mutex_t; >typedef union >{ > char __size[4]; > long 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]; > long 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; > unsigned char __flags; > unsigned char __shared; > unsigned char __pad1; > unsigned char __pad2; > pthread_t __writer; > } __data; > char __size[32]; > 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[20]; > long int __align; >} pthread_barrier_t; >typedef union >{ > char __size[4]; > int __align; >} pthread_barrierattr_t; >typedef struct __jmp_buf_internal_tag > { > int __regs[8]; > void * __pc; > void * __gbr; > int __fpscr; > int __fpregs[4]; > } __jmp_buf[1]; >enum >{ > PTHREAD_CREATE_JOINABLE, > PTHREAD_CREATE_DETACHED >}; >enum >{ > PTHREAD_MUTEX_TIMED_NP, > PTHREAD_MUTEX_RECURSIVE_NP, > PTHREAD_MUTEX_ERRORCHECK_NP, > PTHREAD_MUTEX_ADAPTIVE_NP > , > PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, > PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, > PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, > PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL > , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP >}; >enum >{ > PTHREAD_MUTEX_STALLED, > PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, > PTHREAD_MUTEX_ROBUST, > PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST >}; >enum >{ > PTHREAD_PRIO_NONE, > PTHREAD_PRIO_INHERIT, > PTHREAD_PRIO_PROTECT >}; >enum >{ > PTHREAD_RWLOCK_PREFER_READER_NP, > PTHREAD_RWLOCK_PREFER_WRITER_NP, > PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, > PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP >}; >enum >{ > PTHREAD_INHERIT_SCHED, > PTHREAD_EXPLICIT_SCHED >}; >enum >{ > PTHREAD_SCOPE_SYSTEM, > PTHREAD_SCOPE_PROCESS >}; >enum >{ > PTHREAD_PROCESS_PRIVATE, > PTHREAD_PROCESS_SHARED >}; >struct _pthread_cleanup_buffer >{ > void (*__routine) (void *); > void *__arg; > int __canceltype; > struct _pthread_cleanup_buffer *__prev; >}; >enum >{ > PTHREAD_CANCEL_ENABLE, > PTHREAD_CANCEL_DISABLE >}; >enum >{ > PTHREAD_CANCEL_DEFERRED, > PTHREAD_CANCEL_ASYNCHRONOUS >}; > >extern int pthread_create (pthread_t *__restrict __newthread, > __const pthread_attr_t *__restrict __attr, > void *(*__start_routine) (void *), > void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); >extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); >extern int pthread_join (pthread_t __th, void **__thread_return); >extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __attribute__ ((__nothrow__)); >extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, > __const struct timespec *__abstime); >extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__)); >extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__)); >extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_destroy (pthread_attr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, > int *__detachstate) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, > int __detachstate) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr, > size_t *__guardsize) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_setguardsize (pthread_attr_t *__attr, > size_t __guardsize) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict > __attr, > struct sched_param *__restrict __param) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, > __const struct sched_param *__restrict > __param) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict > __attr, int *__restrict __policy) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict > __attr, int *__restrict __inherit) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, > int __inherit) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, > int *__restrict __scope) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict > __attr, void **__restrict __stackaddr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__)); >extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, > void *__stackaddr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)); >extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict > __attr, size_t *__restrict __stacksize) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_attr_setstacksize (pthread_attr_t *__attr, > size_t __stacksize) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr, > void **__restrict __stackaddr, > size_t *__restrict __stacksize) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))); >extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, > size_t __stacksize) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr, > size_t __cpusetsize, > __const cpu_set_t *__cpuset) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); >extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr, > size_t __cpusetsize, > cpu_set_t *__cpuset) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); >extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int pthread_setschedparam (pthread_t __target_thread, int __policy, > __const struct sched_param *__param) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); >extern int pthread_getschedparam (pthread_t __target_thread, > int *__restrict __policy, > struct sched_param *__restrict __param) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); >extern int pthread_setschedprio (pthread_t __target_thread, int __prio) > __attribute__ ((__nothrow__)); >extern int pthread_getconcurrency (void) __attribute__ ((__nothrow__)); >extern int pthread_setconcurrency (int __level) __attribute__ ((__nothrow__)); >extern int pthread_yield (void) __attribute__ ((__nothrow__)); >extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize, > __const cpu_set_t *__cpuset) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); >extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize, > cpu_set_t *__cpuset) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); >extern int pthread_once (pthread_once_t *__once_control, > void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_setcancelstate (int __state, int *__oldstate); >extern int pthread_setcanceltype (int __type, int *__oldtype); >extern int pthread_cancel (pthread_t __th); >extern void pthread_testcancel (void); > > > >typedef struct >{ > struct > { > __jmp_buf __cancel_jmp_buf; > int __mask_was_saved; > } __cancel_jmp_buf[1]; > void *__pad[4]; >} __pthread_unwind_buf_t __attribute__ ((__aligned__)); >struct __pthread_cleanup_frame >{ > void (*__cancel_routine) (void *); > void *__cancel_arg; > int __do_it; > int __cancel_type; >}; >extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) > ; >extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) > ; >extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf) > ; >extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf) > ; >extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) > __attribute__ ((__noreturn__)) > __attribute__ ((__weak__)) > ; >struct __jmp_buf_tag; >extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__)); >extern int pthread_mutex_init (pthread_mutex_t *__mutex, > __const pthread_mutexattr_t *__mutexattr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutex_lock (pthread_mutex_t *__mutex) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, > __const struct timespec *__restrict > __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutex_getprioceiling (__const pthread_mutex_t * > __restrict __mutex, > int *__restrict __prioceiling) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, > int __prioceiling, > int *__restrict __old_ceiling) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); >extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * > __restrict __attr, > int *__restrict __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, > int __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict > __attr, int *__restrict __kind) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t * > __restrict __attr, > int *__restrict __protocol) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, > int __protocol) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t * > __restrict __attr, > int *__restrict __prioceiling) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, > int __prioceiling) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr, > int *__robustness) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr, > int *__robustness) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, > int __robustness) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, > int __robustness) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, > __const pthread_rwlockattr_t *__restrict > __attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, > __const struct timespec *__restrict > __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, > __const struct timespec *__restrict > __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t * > __restrict __attr, > int *__restrict __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, > int __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t * > __restrict __attr, > int *__restrict __pref) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, > int __pref) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_cond_init (pthread_cond_t *__restrict __cond, > __const pthread_condattr_t *__restrict > __cond_attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_cond_destroy (pthread_cond_t *__cond) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_cond_signal (pthread_cond_t *__cond) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_cond_broadcast (pthread_cond_t *__cond) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, > pthread_mutex_t *__restrict __mutex) > __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, > pthread_mutex_t *__restrict __mutex, > __const struct timespec *__restrict > __abstime) __attribute__ ((__nonnull__ (1, 2, 3))); >extern int pthread_condattr_init (pthread_condattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_condattr_destroy (pthread_condattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_condattr_getpshared (__const pthread_condattr_t * > __restrict __attr, > int *__restrict __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, > int __pshared) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_condattr_getclock (__const pthread_condattr_t * > __restrict __attr, > __clockid_t *__restrict __clock_id) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_condattr_setclock (pthread_condattr_t *__attr, > __clockid_t __clock_id) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_spin_destroy (pthread_spinlock_t *__lock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_spin_lock (pthread_spinlock_t *__lock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_spin_trylock (pthread_spinlock_t *__lock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_spin_unlock (pthread_spinlock_t *__lock) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, > __const pthread_barrierattr_t *__restrict > __attr, unsigned int __count) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_barrier_wait (pthread_barrier_t *__barrier) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t * > __restrict __attr, > int *__restrict __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, > int __pshared) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_key_create (pthread_key_t *__key, > void (*__destr_function) (void *)) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__)); >extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__)); >extern int pthread_setspecific (pthread_key_t __key, > __const void *__pointer) __attribute__ ((__nothrow__)) ; >extern int pthread_getcpuclockid (pthread_t __thread_id, > __clockid_t *__clock_id) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int pthread_atfork (void (*__prepare) (void), > void (*__parent) (void), > void (*__child) (void)) __attribute__ ((__nothrow__)); >extern __inline int >__attribute__ ((__nothrow__)) pthread_equal (pthread_t __thread1, pthread_t __thread2) >{ > return __thread1 == __thread2; >} > > >struct _IO_FILE; > >typedef struct _IO_FILE FILE; > > >typedef struct _IO_FILE __FILE; >typedef struct >{ > int __count; > union > { > unsigned int __wch; > char __wchb[4]; > } __value; >} __mbstate_t; >typedef struct >{ > __off_t __pos; > __mbstate_t __state; >} _G_fpos_t; >typedef struct >{ > __off64_t __pos; > __mbstate_t __state; >} _G_fpos64_t; >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__))); >typedef __builtin_va_list __gnuc_va_list; >struct _IO_jump_t; struct _IO_FILE; >typedef void _IO_lock_t; >struct _IO_marker { > struct _IO_marker *_next; > struct _IO_FILE *_sbuf; > int _pos; >}; >enum __codecvt_result >{ > __codecvt_ok, > __codecvt_partial, > __codecvt_error, > __codecvt_noconv >}; >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; > __off64_t _offset; > 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_; >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); >typedef __io_read_fn cookie_read_function_t; >typedef __io_write_fn cookie_write_function_t; >typedef __io_seek_fn cookie_seek_function_t; >typedef __io_close_fn cookie_close_function_t; >typedef struct >{ > __io_read_fn *read; > __io_write_fn *write; > __io_seek_fn *seek; > __io_close_fn *close; >} _IO_cookie_io_functions_t; >typedef _IO_cookie_io_functions_t cookie_io_functions_t; >struct _IO_cookie_file; >extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, > void *__cookie, _IO_cookie_io_functions_t __fns); >extern int __underflow (_IO_FILE *); >extern int __uflow (_IO_FILE *); >extern int __overflow (_IO_FILE *, int); >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__)); >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__)); >typedef __gnuc_va_list va_list; > >typedef _G_fpos64_t fpos_t; > >typedef _G_fpos64_t fpos64_t; >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) __asm__ ("" "tmpfile64") __attribute__ ((__warn_unused_result__)); >extern FILE *tmpfile64 (void) __attribute__ ((__warn_unused_result__)); >extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); > >extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >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); > >extern int fflush_unlocked (FILE *__stream); >extern int fcloseall (void); > >extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) __asm__ ("" "fopen64") > __attribute__ ((__warn_unused_result__)); >extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64") > __attribute__ ((__warn_unused_result__)); > >extern FILE *fopen64 (__const char *__restrict __filename, > __const char *__restrict __modes) __attribute__ ((__warn_unused_result__)); >extern FILE *freopen64 (__const char *__restrict __filename, > __const char *__restrict __modes, > FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); >extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern FILE *fopencookie (void *__restrict __magic_cookie, > __const char *__restrict __modes, > _IO_cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >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))); > >extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f, > __gnuc_va_list __arg) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) __attribute__ ((__warn_unused_result__)); >extern int __asprintf (char **__restrict __ptr, > __const char *__restrict __fmt, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__)); >extern int asprintf (char **__restrict __ptr, > __const char *__restrict __fmt, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__)); >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__)); > > >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))); > > >extern int fgetc (FILE *__stream); >extern int getc (FILE *__stream); >extern int getchar (void); > >extern int getc_unlocked (FILE *__stream); >extern int getchar_unlocked (void); >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); > >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__)); > >extern char *fgets_unlocked (char *__restrict __s, int __n, > 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 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__)); > >extern int fputs_unlocked (__const char *__restrict __s, > FILE *__restrict __stream); >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); > >extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64"); >extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64"); > >extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64"); >extern int fsetpos (FILE *__stream, __const fpos_t *__pos) __asm__ ("" "fsetpos64"); > >extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); >extern __off64_t ftello64 (FILE *__stream) __attribute__ ((__warn_unused_result__)); >extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); >extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos); > >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); > >extern int sys_nerr; >extern __const char *__const sys_errlist[]; >extern int _sys_nerr; >extern __const char *__const _sys_errlist[]; >extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >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__)); >extern char *cuserid (char *__s); >struct obstack; >extern int obstack_printf (struct obstack *__restrict __obstack, > __const char *__restrict __format, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))); >extern int obstack_vprintf (struct obstack *__restrict __obstack, > __const char *__restrict __format, > __gnuc_va_list __args) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))); >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__)); >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))); >} >extern __inline __ssize_t >getline (char **__lineptr, size_t *__n, FILE *__stream) >{ > return __getdelim (__lineptr, __n, '\n', __stream); >} >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); >} >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); >} >extern int __asprintf_chk (char **__restrict __ptr, int __flag, > __const char *__restrict __fmt, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))) __attribute__ ((__warn_unused_result__)); >extern int __vasprintf_chk (char **__restrict __ptr, int __flag, > __const char *__restrict __fmt, __gnuc_va_list __arg) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))) __attribute__ ((__warn_unused_result__)); >extern int __dprintf_chk (int __fd, int __flag, __const char *__restrict __fmt, > ...) __attribute__ ((__format__ (__printf__, 3, 4))); >extern int __vdprintf_chk (int __fd, int __flag, > __const char *__restrict __fmt, __gnuc_va_list __arg) > __attribute__ ((__format__ (__printf__, 3, 0))); >extern int __obstack_printf_chk (struct obstack *__restrict __obstack, > int __flag, __const char *__restrict __format, > ...) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); >extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack, > int __flag, > __const char *__restrict __format, > __gnuc_va_list __args) > __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) >{ > return __asprintf_chk (__ptr, 2 - 1, __fmt, > __builtin_va_arg_pack ()); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) __asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) >{ > return __asprintf_chk (__ptr, 2 - 1, __fmt, > __builtin_va_arg_pack ()); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >dprintf (int __fd, __const char *__restrict __fmt, ...) >{ > return __dprintf_chk (__fd, 2 - 1, __fmt, > __builtin_va_arg_pack ()); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) obstack_printf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, ...) >{ > return __obstack_printf_chk (__obstack, 2 - 1, __fmt, > __builtin_va_arg_pack ()); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) vasprintf (char **__restrict __ptr, __const char *__restrict __fmt, __gnuc_va_list __ap) >{ > return __vasprintf_chk (__ptr, 2 - 1, __fmt, __ap); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >vdprintf (int __fd, __const char *__restrict __fmt, __gnuc_va_list __ap) >{ > return __vdprintf_chk (__fd, 2 - 1, __fmt, __ap); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) obstack_vprintf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, __gnuc_va_list __ap) >{ > return __obstack_vprintf_chk (__obstack, 2 - 1, __fmt, > __ap); >} >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); >} >extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size, > int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); >extern char *__fgets_unlocked_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets_unlocked") __attribute__ ((__warn_unused_result__)); >extern char *__fgets_unlocked_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_unlocked_chk") > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets_unlocked called with bigger size than length " "of destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * >fgets_unlocked (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_unlocked_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream); > if ((size_t) __n > __builtin_object_size (__s, 2 > 1)) > return __fgets_unlocked_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream); > } > return __fgets_unlocked_alias (__s, __n, __stream); >} >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); >} > >typedef long int wchar_t; > >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; > }; >typedef union > { > union wait *__uptr; > int *__iptr; > } __WAIT_STATUS __attribute__ ((__transparent_union__)); > >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; > >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__)); > >extern long int strtol_l (__const char *__restrict __nptr, > char **__restrict __endptr, int __base, > __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__)); >extern unsigned long int strtoul_l (__const char *__restrict __nptr, > char **__restrict __endptr, > int __base, __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__)); >__extension__ >extern long long int strtoll_l (__const char *__restrict __nptr, > char **__restrict __endptr, int __base, > __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__)); >__extension__ >extern unsigned long long int strtoull_l (__const char *__restrict __nptr, > char **__restrict __endptr, > int __base, __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__)); >extern double strtod_l (__const char *__restrict __nptr, > char **__restrict __endptr, __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__)); >extern float strtof_l (__const char *__restrict __nptr, > char **__restrict __endptr, __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__)); >extern long double strtold_l (__const char *__restrict __nptr, > char **__restrict __endptr, > __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__)); > >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); >} > >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__)); > >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 __ino64_t ino_t; >typedef __ino64_t ino64_t; >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 __off64_t off_t; >typedef __off64_t off64_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; >typedef __useconds_t useconds_t; >typedef __suseconds_t suseconds_t; >typedef unsigned long int ulong; >typedef unsigned short int ushort; >typedef unsigned int uint; >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__))); >struct timeval > { > __time_t tv_sec; > __suseconds_t tv_usec; > }; >typedef long int __fd_mask; >typedef struct > { > __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; > } fd_set; >typedef __fd_mask fd_mask; > >extern int select (int __nfds, fd_set *__restrict __readfds, > fd_set *__restrict __writefds, > fd_set *__restrict __exceptfds, > struct timeval *__restrict __timeout); >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); > >__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)); >} >typedef __blksize_t blksize_t; >typedef __blkcnt64_t blkcnt_t; >typedef __fsblkcnt64_t fsblkcnt_t; >typedef __fsfilcnt64_t fsfilcnt_t; >typedef __blkcnt64_t blkcnt64_t; >typedef __fsblkcnt64_t fsblkcnt64_t; >typedef __fsfilcnt64_t fsfilcnt64_t; > >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__)); > >extern void *alloca (size_t __size) __attribute__ ((__nothrow__)); > >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))); >extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); > >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__)); >extern void quick_exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); > > >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__)); >extern int clearenv (void) __attribute__ ((__nothrow__)); >extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkstemp (char *__template) __asm__ ("" "mkstemp64") > __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64") __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkstemps64 (char *__template, int __suffixlen) > __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64") > __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64") > __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int mkostemps64 (char *__template, int __suffixlen, int __flags) > __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); > >extern int system (__const char *__command) __attribute__ ((__warn_unused_result__)); > >extern char *canonicalize_file_name (__const char *__name) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >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 *); >typedef __compar_fn_t comparison_fn_t; >typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *); > >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))); >extern void qsort_r (void *__base, size_t __nmemb, size_t __size, > __compar_d_fn_t __compar, void *__arg) > __attribute__ ((__nonnull__ (1, 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__)); > >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__)); >extern int getsubopt (char **__restrict __optionp, > char *__const *__restrict __tokens, > char **__restrict __valuep) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__)); >extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int posix_openpt (int __oflag) __attribute__ ((__warn_unused_result__)); >extern int grantpt (int __fd) __attribute__ ((__nothrow__)); >extern int unlockpt (int __fd) __attribute__ ((__nothrow__)); >extern char *ptsname (int __fd) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int ptsname_r (int __fd, char *__buf, size_t __buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int getpt (void); >extern int getloadavg (double __loadavg[], int __nelem) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >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); >} > >typedef int ptrdiff_t; > >typedef float float_t; >typedef double double_t; > >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__)); > >extern void sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__)); extern void __sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__)); > >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__)); > >extern double exp10 (double __x) __attribute__ ((__nothrow__)); extern double __exp10 (double __x) __attribute__ ((__nothrow__)); >extern double pow10 (double __x) __attribute__ ((__nothrow__)); extern double __pow10 (double __x) __attribute__ ((__nothrow__)); > >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__)); > >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__)); > >extern void sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__)); extern void __sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__)); > >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__)); > >extern float exp10f (float __x) __attribute__ ((__nothrow__)); extern float __exp10f (float __x) __attribute__ ((__nothrow__)); >extern float pow10f (float __x) __attribute__ ((__nothrow__)); extern float __pow10f (float __x) __attribute__ ((__nothrow__)); > >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__)); >extern int signgam; >enum > { > FP_NAN, > FP_INFINITE, > FP_ZERO, > FP_SUBNORMAL, > FP_NORMAL > }; >typedef enum >{ > _IEEE_ = -1, > _SVID_, > _XOPEN_, > _POSIX_, > _ISOC_ >} _LIB_VERSION_TYPE; >extern _LIB_VERSION_TYPE _LIB_VERSION; >struct exception > { > int type; > char *name; > double arg1; > double arg2; > double retval; > }; >extern int matherr (struct exception *__exc); > > >struct iovec > { > void *iov_base; > size_t iov_len; > }; >struct flock > { > short int l_type; > short int l_whence; > __off64_t l_start; > __off64_t l_len; > __pid_t l_pid; > }; >struct flock64 > { > short int l_type; > short int l_whence; > __off64_t l_start; > __off64_t l_len; > __pid_t l_pid; > }; >enum __pid_type > { > F_OWNER_TID = 0, > F_OWNER_PID, > F_OWNER_GID > }; >struct f_owner_ex > { > enum __pid_type type; > __pid_t pid; > }; > >extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) > __attribute__ ((__nothrow__)); >extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, > unsigned int __flags); >extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, > size_t __count, unsigned int __flags); >extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, > __off64_t *__offout, size_t __len, > unsigned int __flags); >extern ssize_t tee (int __fdin, int __fdout, size_t __len, > unsigned int __flags); >extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64"); >extern int fallocate64 (int __fd, int __mode, __off64_t __offset, > __off64_t __len); > > >struct stat > { > __dev_t st_dev; > unsigned short int __pad1; > __ino_t __st_ino; > __mode_t st_mode; > __nlink_t st_nlink; > __uid_t st_uid; > __gid_t st_gid; > __dev_t st_rdev; > unsigned short int __pad2; > __off64_t st_size; > __blksize_t st_blksize; > __blkcnt64_t st_blocks; > struct timespec st_atim; > struct timespec st_mtim; > struct timespec st_ctim; > __ino64_t st_ino; > }; >struct stat64 > { > __dev_t st_dev; > unsigned int __pad1; > __ino_t __st_ino; > __mode_t st_mode; > __nlink_t st_nlink; > __uid_t st_uid; > __gid_t st_gid; > __dev_t st_rdev; > unsigned int __pad2; > __off64_t st_size; > __blksize_t st_blksize; > __blkcnt64_t st_blocks; > struct timespec st_atim; > struct timespec st_mtim; > struct timespec st_ctim; > __ino64_t st_ino; > }; >extern int stat (__const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (1, 2))); >extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (2))); >extern int stat64 (__const char *__restrict __file, > struct stat64 *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int fstatat (int __fd, __const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); >extern int fstatat64 (int __fd, __const char *__restrict __file, > struct stat64 *__restrict __buf, int __flag) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); >extern int lstat (__const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (1, 2))); >extern int lstat64 (__const char *__restrict __file, > struct stat64 *__restrict __buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern int chmod (__const char *__file, __mode_t __mode) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int lchmod (__const char *__file, __mode_t __mode) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__)); >extern int fchmodat (int __fd, __const char *__file, __mode_t __mode, > int __flag) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__)); >extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__)); >extern __mode_t getumask (void) __attribute__ ((__nothrow__)); >extern int mkdir (__const char *__path, __mode_t __mode) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int mkdirat (int __fd, __const char *__path, __mode_t __mode) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int mknodat (int __fd, __const char *__path, __mode_t __mode, > __dev_t __dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int mkfifo (__const char *__path, __mode_t __mode) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int utimensat (int __fd, __const char *__path, > __const struct timespec __times[2], > int __flags) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int futimens (int __fd, __const struct timespec __times[2]) __attribute__ ((__nothrow__)); >extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) __asm__ ("" "__fxstat64") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (3))); >extern int __xstat (int __ver, __const char *__filename, struct stat *__stat_buf) __asm__ ("" "__xstat64") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (2, 3))); >extern int __lxstat (int __ver, __const char *__filename, struct stat *__stat_buf) __asm__ ("" "__lxstat64") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (2, 3))); >extern int __fxstatat (int __ver, int __fildes, __const char *__filename, struct stat *__stat_buf, int __flag) __asm__ ("" "__fxstatat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))); >extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); >extern int __xstat64 (int __ver, __const char *__filename, > struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); >extern int __lxstat64 (int __ver, __const char *__filename, > struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); >extern int __fxstatat64 (int __ver, int __fildes, __const char *__filename, > struct stat64 *__stat_buf, int __flag) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))); >extern int __xmknod (int __ver, __const char *__path, __mode_t __mode, > __dev_t *__dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); >extern int __xmknodat (int __ver, int __fd, __const char *__path, > __mode_t __mode, __dev_t *__dev) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 5))); >extern __inline int >__attribute__ ((__nothrow__)) stat (__const char *__path, struct stat *__statbuf) >{ > return __xstat (3, __path, __statbuf); >} >extern __inline int >__attribute__ ((__nothrow__)) lstat (__const char *__path, struct stat *__statbuf) >{ > return __lxstat (3, __path, __statbuf); >} >extern __inline int >__attribute__ ((__nothrow__)) fstat (int __fd, struct stat *__statbuf) >{ > return __fxstat (3, __fd, __statbuf); >} >extern __inline int >__attribute__ ((__nothrow__)) fstatat (int __fd, __const char *__filename, struct stat *__statbuf, int __flag) >{ > return __fxstatat (3, __fd, __filename, __statbuf, __flag); >} >extern __inline int >__attribute__ ((__nothrow__)) mknod (__const char *__path, __mode_t __mode, __dev_t __dev) >{ > return __xmknod (1, __path, __mode, &__dev); >} >extern __inline int >__attribute__ ((__nothrow__)) mknodat (int __fd, __const char *__path, __mode_t __mode, __dev_t __dev) >{ > return __xmknodat (1, __fd, __path, __mode, &__dev); >} >extern __inline int >__attribute__ ((__nothrow__)) stat64 (__const char *__path, struct stat64 *__statbuf) >{ > return __xstat64 (3, __path, __statbuf); >} >extern __inline int >__attribute__ ((__nothrow__)) lstat64 (__const char *__path, struct stat64 *__statbuf) >{ > return __lxstat64 (3, __path, __statbuf); >} >extern __inline int >__attribute__ ((__nothrow__)) fstat64 (int __fd, struct stat64 *__statbuf) >{ > return __fxstat64 (3, __fd, __statbuf); >} >extern __inline int >__attribute__ ((__nothrow__)) fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf, int __flag) >{ > return __fxstatat64 (3, __fd, __filename, __statbuf, __flag); >} > >extern int fcntl (int __fd, int __cmd, ...); >extern int open (__const char *__file, int __oflag, ...) __asm__ ("" "open64") > __attribute__ ((__nonnull__ (1))); >extern int open64 (__const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1))); >extern int openat (int __fd, __const char *__file, int __oflag, ...) __asm__ ("" "openat64") __attribute__ ((__nonnull__ (2))); >extern int openat64 (int __fd, __const char *__file, int __oflag, ...) > __attribute__ ((__nonnull__ (2))); >extern int creat (__const char *__file, __mode_t __mode) __asm__ ("" "creat64") __attribute__ ((__nonnull__ (1))); >extern int creat64 (__const char *__file, __mode_t __mode) __attribute__ ((__nonnull__ (1))); >extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64"); >extern int lockf64 (int __fd, int __cmd, __off64_t __len); >extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__)); >extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len, > int __advise) __attribute__ ((__nothrow__)); >extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64"); >extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len); >extern int __open_2 (__const char *__path, int __oflag) __asm__ ("" "__open64_2") __attribute__ ((__nonnull__ (1))); >extern int __open_alias (__const char *__path, int __oflag, ...) __asm__ ("" "open64") __attribute__ ((__nonnull__ (1))); >extern void __open_too_many_args (void) __attribute__((__error__ ("open can be called either with 2 or 3 arguments, not more"))); >extern void __open_missing_mode (void) __attribute__((__error__ ("open with O_CREAT in second argument needs 3 arguments"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >open (__const char *__path, int __oflag, ...) >{ > if (__builtin_va_arg_pack_len () > 1) > __open_too_many_args (); > if (__builtin_constant_p (__oflag)) > { > if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1) > { > __open_missing_mode (); > return __open_2 (__path, __oflag); > } > return __open_alias (__path, __oflag, __builtin_va_arg_pack ()); > } > if (__builtin_va_arg_pack_len () < 1) > return __open_2 (__path, __oflag); > return __open_alias (__path, __oflag, __builtin_va_arg_pack ()); >} >extern int __open64_2 (__const char *__path, int __oflag) __attribute__ ((__nonnull__ (1))); >extern int __open64_alias (__const char *__path, int __oflag, ...) __asm__ ("" "open64") __attribute__ ((__nonnull__ (1))); >extern void __open64_too_many_args (void) __attribute__((__error__ ("open64 can be called either with 2 or 3 arguments, not more"))); >extern void __open64_missing_mode (void) __attribute__((__error__ ("open64 with O_CREAT in second argument needs 3 arguments"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >open64 (__const char *__path, int __oflag, ...) >{ > if (__builtin_va_arg_pack_len () > 1) > __open64_too_many_args (); > if (__builtin_constant_p (__oflag)) > { > if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1) > { > __open64_missing_mode (); > return __open64_2 (__path, __oflag); > } > return __open64_alias (__path, __oflag, __builtin_va_arg_pack ()); > } > if (__builtin_va_arg_pack_len () < 1) > return __open64_2 (__path, __oflag); > return __open64_alias (__path, __oflag, __builtin_va_arg_pack ()); >} >extern int __openat_2 (int __fd, __const char *__path, int __oflag) __asm__ ("" "__openat64_2") > __attribute__ ((__nonnull__ (2))); >extern int __openat_alias (int __fd, __const char *__path, int __oflag, ...) __asm__ ("" "openat64") > __attribute__ ((__nonnull__ (2))); >extern void __openat_too_many_args (void) __attribute__((__error__ ("openat can be called either with 3 or 4 arguments, not more"))); >extern void __openat_missing_mode (void) __attribute__((__error__ ("openat with O_CREAT in third argument needs 4 arguments"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >openat (int __fd, __const char *__path, int __oflag, ...) >{ > if (__builtin_va_arg_pack_len () > 1) > __openat_too_many_args (); > if (__builtin_constant_p (__oflag)) > { > if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1) > { > __openat_missing_mode (); > return __openat_2 (__fd, __path, __oflag); > } > return __openat_alias (__fd, __path, __oflag, __builtin_va_arg_pack ()); > } > if (__builtin_va_arg_pack_len () < 1) > return __openat_2 (__fd, __path, __oflag); > return __openat_alias (__fd, __path, __oflag, __builtin_va_arg_pack ()); >} >extern int __openat64_2 (int __fd, __const char *__path, int __oflag) > __attribute__ ((__nonnull__ (2))); >extern int __openat64_alias (int __fd, __const char *__path, int __oflag, ...) __asm__ ("" "openat64") > __attribute__ ((__nonnull__ (2))); >extern void __openat64_too_many_args (void) __attribute__((__error__ ("openat64 can be called either with 3 or 4 arguments, not more"))); >extern void __openat64_missing_mode (void) __attribute__((__error__ ("openat64 with O_CREAT in third argument needs 4 arguments"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >openat64 (int __fd, __const char *__path, int __oflag, ...) >{ > if (__builtin_va_arg_pack_len () > 1) > __openat64_too_many_args (); > if (__builtin_constant_p (__oflag)) > { > if ((__oflag & 0100) != 0 && __builtin_va_arg_pack_len () < 1) > { > __openat64_missing_mode (); > return __openat64_2 (__fd, __path, __oflag); > } > return __openat64_alias (__fd, __path, __oflag, __builtin_va_arg_pack ()); > } > if (__builtin_va_arg_pack_len () < 1) > return __openat64_2 (__fd, __path, __oflag); > return __openat64_alias (__fd, __path, __oflag, __builtin_va_arg_pack ()); >} > > >struct timeb > { > time_t time; > unsigned short int millitm; > short int timezone; > short int dstflag; > }; >extern int ftime (struct timeb *__timebuf); > > >struct timezone > { > int tz_minuteswest; > int tz_dsttime; > }; >typedef struct timezone *__restrict __timezone_ptr_t; >extern int gettimeofday (struct timeval *__restrict __tv, > __timezone_ptr_t __tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int settimeofday (__const struct timeval *__tv, > __const struct timezone *__tz) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int adjtime (__const struct timeval *__delta, > struct timeval *__olddelta) __attribute__ ((__nothrow__)); >enum __itimer_which > { > ITIMER_REAL = 0, > ITIMER_VIRTUAL = 1, > ITIMER_PROF = 2 > }; >struct itimerval > { > struct timeval it_interval; > struct timeval it_value; > }; >typedef enum __itimer_which __itimer_which_t; >extern int getitimer (__itimer_which_t __which, > struct itimerval *__value) __attribute__ ((__nothrow__)); >extern int setitimer (__itimer_which_t __which, > __const struct itimerval *__restrict __new, > struct itimerval *__restrict __old) __attribute__ ((__nothrow__)); >extern int utimes (__const char *__file, __const struct timeval __tvp[2]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int futimes (int __fd, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)); >extern int futimesat (int __fd, __const char *__file, > __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)); > > >typedef __intptr_t intptr_t; >typedef __socklen_t socklen_t; >extern int access (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int euidaccess (__const char *__name, int __type) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int eaccess (__const char *__name, int __type) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int faccessat (int __fd, __const char *__file, int __type, int __flag) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__)); >extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__)); >extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) > __attribute__ ((__nothrow__)); >extern int close (int __fd); >extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __attribute__ ((__warn_unused_result__)); >extern ssize_t write (int __fd, __const void *__buf, size_t __n) __attribute__ ((__warn_unused_result__)); >extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64") __attribute__ ((__warn_unused_result__)); >extern ssize_t pwrite (int __fd, __const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64") __attribute__ ((__warn_unused_result__)); >extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, > __off64_t __offset) __attribute__ ((__warn_unused_result__)); >extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, > __off64_t __offset) __attribute__ ((__warn_unused_result__)); >extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__)); >extern unsigned int sleep (unsigned int __seconds); >extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) > __attribute__ ((__nothrow__)); >extern int usleep (__useconds_t __useconds); >extern int pause (void); >extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int fchownat (int __fd, __const char *__file, __uid_t __owner, > __gid_t __group, int __flag) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__)); >extern int chdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int fchdir (int __fd) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern char *get_current_dir_name (void) __attribute__ ((__nothrow__)); >extern char *getwd (char *__buf) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) __attribute__ ((__warn_unused_result__)); >extern int dup (int __fd) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__)); >extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__)); >extern char **__environ; >extern char **environ; >extern int execve (__const char *__path, char *__const __argv[], > char *__const __envp[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[]) > __attribute__ ((__nothrow__)); >extern int execv (__const char *__path, char *__const __argv[]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int execle (__const char *__path, __const char *__arg, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int execl (__const char *__path, __const char *__arg, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int execvp (__const char *__file, char *__const __argv[]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int execlp (__const char *__file, __const char *__arg, ...) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int execvpe (__const char *__file, char *__const __argv[], > char *__const __envp[]) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int nice (int __inc) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern void _exit (int __status) __attribute__ ((__noreturn__)); >enum > { > _PC_LINK_MAX, > _PC_MAX_CANON, > _PC_MAX_INPUT, > _PC_NAME_MAX, > _PC_PATH_MAX, > _PC_PIPE_BUF, > _PC_CHOWN_RESTRICTED, > _PC_NO_TRUNC, > _PC_VDISABLE, > _PC_SYNC_IO, > _PC_ASYNC_IO, > _PC_PRIO_IO, > _PC_SOCK_MAXBUF, > _PC_FILESIZEBITS, > _PC_REC_INCR_XFER_SIZE, > _PC_REC_MAX_XFER_SIZE, > _PC_REC_MIN_XFER_SIZE, > _PC_REC_XFER_ALIGN, > _PC_ALLOC_SIZE_MIN, > _PC_SYMLINK_MAX, > _PC_2_SYMLINKS > }; >enum > { > _SC_ARG_MAX, > _SC_CHILD_MAX, > _SC_CLK_TCK, > _SC_NGROUPS_MAX, > _SC_OPEN_MAX, > _SC_STREAM_MAX, > _SC_TZNAME_MAX, > _SC_JOB_CONTROL, > _SC_SAVED_IDS, > _SC_REALTIME_SIGNALS, > _SC_PRIORITY_SCHEDULING, > _SC_TIMERS, > _SC_ASYNCHRONOUS_IO, > _SC_PRIORITIZED_IO, > _SC_SYNCHRONIZED_IO, > _SC_FSYNC, > _SC_MAPPED_FILES, > _SC_MEMLOCK, > _SC_MEMLOCK_RANGE, > _SC_MEMORY_PROTECTION, > _SC_MESSAGE_PASSING, > _SC_SEMAPHORES, > _SC_SHARED_MEMORY_OBJECTS, > _SC_AIO_LISTIO_MAX, > _SC_AIO_MAX, > _SC_AIO_PRIO_DELTA_MAX, > _SC_DELAYTIMER_MAX, > _SC_MQ_OPEN_MAX, > _SC_MQ_PRIO_MAX, > _SC_VERSION, > _SC_PAGESIZE, > _SC_RTSIG_MAX, > _SC_SEM_NSEMS_MAX, > _SC_SEM_VALUE_MAX, > _SC_SIGQUEUE_MAX, > _SC_TIMER_MAX, > _SC_BC_BASE_MAX, > _SC_BC_DIM_MAX, > _SC_BC_SCALE_MAX, > _SC_BC_STRING_MAX, > _SC_COLL_WEIGHTS_MAX, > _SC_EQUIV_CLASS_MAX, > _SC_EXPR_NEST_MAX, > _SC_LINE_MAX, > _SC_RE_DUP_MAX, > _SC_CHARCLASS_NAME_MAX, > _SC_2_VERSION, > _SC_2_C_BIND, > _SC_2_C_DEV, > _SC_2_FORT_DEV, > _SC_2_FORT_RUN, > _SC_2_SW_DEV, > _SC_2_LOCALEDEF, > _SC_PII, > _SC_PII_XTI, > _SC_PII_SOCKET, > _SC_PII_INTERNET, > _SC_PII_OSI, > _SC_POLL, > _SC_SELECT, > _SC_UIO_MAXIOV, > _SC_IOV_MAX = _SC_UIO_MAXIOV, > _SC_PII_INTERNET_STREAM, > _SC_PII_INTERNET_DGRAM, > _SC_PII_OSI_COTS, > _SC_PII_OSI_CLTS, > _SC_PII_OSI_M, > _SC_T_IOV_MAX, > _SC_THREADS, > _SC_THREAD_SAFE_FUNCTIONS, > _SC_GETGR_R_SIZE_MAX, > _SC_GETPW_R_SIZE_MAX, > _SC_LOGIN_NAME_MAX, > _SC_TTY_NAME_MAX, > _SC_THREAD_DESTRUCTOR_ITERATIONS, > _SC_THREAD_KEYS_MAX, > _SC_THREAD_STACK_MIN, > _SC_THREAD_THREADS_MAX, > _SC_THREAD_ATTR_STACKADDR, > _SC_THREAD_ATTR_STACKSIZE, > _SC_THREAD_PRIORITY_SCHEDULING, > _SC_THREAD_PRIO_INHERIT, > _SC_THREAD_PRIO_PROTECT, > _SC_THREAD_PROCESS_SHARED, > _SC_NPROCESSORS_CONF, > _SC_NPROCESSORS_ONLN, > _SC_PHYS_PAGES, > _SC_AVPHYS_PAGES, > _SC_ATEXIT_MAX, > _SC_PASS_MAX, > _SC_XOPEN_VERSION, > _SC_XOPEN_XCU_VERSION, > _SC_XOPEN_UNIX, > _SC_XOPEN_CRYPT, > _SC_XOPEN_ENH_I18N, > _SC_XOPEN_SHM, > _SC_2_CHAR_TERM, > _SC_2_C_VERSION, > _SC_2_UPE, > _SC_XOPEN_XPG2, > _SC_XOPEN_XPG3, > _SC_XOPEN_XPG4, > _SC_CHAR_BIT, > _SC_CHAR_MAX, > _SC_CHAR_MIN, > _SC_INT_MAX, > _SC_INT_MIN, > _SC_LONG_BIT, > _SC_WORD_BIT, > _SC_MB_LEN_MAX, > _SC_NZERO, > _SC_SSIZE_MAX, > _SC_SCHAR_MAX, > _SC_SCHAR_MIN, > _SC_SHRT_MAX, > _SC_SHRT_MIN, > _SC_UCHAR_MAX, > _SC_UINT_MAX, > _SC_ULONG_MAX, > _SC_USHRT_MAX, > _SC_NL_ARGMAX, > _SC_NL_LANGMAX, > _SC_NL_MSGMAX, > _SC_NL_NMAX, > _SC_NL_SETMAX, > _SC_NL_TEXTMAX, > _SC_XBS5_ILP32_OFF32, > _SC_XBS5_ILP32_OFFBIG, > _SC_XBS5_LP64_OFF64, > _SC_XBS5_LPBIG_OFFBIG, > _SC_XOPEN_LEGACY, > _SC_XOPEN_REALTIME, > _SC_XOPEN_REALTIME_THREADS, > _SC_ADVISORY_INFO, > _SC_BARRIERS, > _SC_BASE, > _SC_C_LANG_SUPPORT, > _SC_C_LANG_SUPPORT_R, > _SC_CLOCK_SELECTION, > _SC_CPUTIME, > _SC_THREAD_CPUTIME, > _SC_DEVICE_IO, > _SC_DEVICE_SPECIFIC, > _SC_DEVICE_SPECIFIC_R, > _SC_FD_MGMT, > _SC_FIFO, > _SC_PIPE, > _SC_FILE_ATTRIBUTES, > _SC_FILE_LOCKING, > _SC_FILE_SYSTEM, > _SC_MONOTONIC_CLOCK, > _SC_MULTI_PROCESS, > _SC_SINGLE_PROCESS, > _SC_NETWORKING, > _SC_READER_WRITER_LOCKS, > _SC_SPIN_LOCKS, > _SC_REGEXP, > _SC_REGEX_VERSION, > _SC_SHELL, > _SC_SIGNALS, > _SC_SPAWN, > _SC_SPORADIC_SERVER, > _SC_THREAD_SPORADIC_SERVER, > _SC_SYSTEM_DATABASE, > _SC_SYSTEM_DATABASE_R, > _SC_TIMEOUTS, > _SC_TYPED_MEMORY_OBJECTS, > _SC_USER_GROUPS, > _SC_USER_GROUPS_R, > _SC_2_PBS, > _SC_2_PBS_ACCOUNTING, > _SC_2_PBS_LOCATE, > _SC_2_PBS_MESSAGE, > _SC_2_PBS_TRACK, > _SC_SYMLOOP_MAX, > _SC_STREAMS, > _SC_2_PBS_CHECKPOINT, > _SC_V6_ILP32_OFF32, > _SC_V6_ILP32_OFFBIG, > _SC_V6_LP64_OFF64, > _SC_V6_LPBIG_OFFBIG, > _SC_HOST_NAME_MAX, > _SC_TRACE, > _SC_TRACE_EVENT_FILTER, > _SC_TRACE_INHERIT, > _SC_TRACE_LOG, > _SC_LEVEL1_ICACHE_SIZE, > _SC_LEVEL1_ICACHE_ASSOC, > _SC_LEVEL1_ICACHE_LINESIZE, > _SC_LEVEL1_DCACHE_SIZE, > _SC_LEVEL1_DCACHE_ASSOC, > _SC_LEVEL1_DCACHE_LINESIZE, > _SC_LEVEL2_CACHE_SIZE, > _SC_LEVEL2_CACHE_ASSOC, > _SC_LEVEL2_CACHE_LINESIZE, > _SC_LEVEL3_CACHE_SIZE, > _SC_LEVEL3_CACHE_ASSOC, > _SC_LEVEL3_CACHE_LINESIZE, > _SC_LEVEL4_CACHE_SIZE, > _SC_LEVEL4_CACHE_ASSOC, > _SC_LEVEL4_CACHE_LINESIZE, > _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, > _SC_RAW_SOCKETS, > _SC_V7_ILP32_OFF32, > _SC_V7_ILP32_OFFBIG, > _SC_V7_LP64_OFF64, > _SC_V7_LPBIG_OFFBIG, > _SC_SS_REPL_MAX, > _SC_TRACE_EVENT_NAME_MAX, > _SC_TRACE_NAME_MAX, > _SC_TRACE_SYS_MAX, > _SC_TRACE_USER_EVENT_MAX, > _SC_XOPEN_STREAMS, > _SC_THREAD_ROBUST_PRIO_INHERIT, > _SC_THREAD_ROBUST_PRIO_PROTECT > }; >enum > { > _CS_PATH, > _CS_V6_WIDTH_RESTRICTED_ENVS, > _CS_GNU_LIBC_VERSION, > _CS_GNU_LIBPTHREAD_VERSION, > _CS_V5_WIDTH_RESTRICTED_ENVS, > _CS_V7_WIDTH_RESTRICTED_ENVS, > _CS_LFS_CFLAGS = 1000, > _CS_LFS_LDFLAGS, > _CS_LFS_LIBS, > _CS_LFS_LINTFLAGS, > _CS_LFS64_CFLAGS, > _CS_LFS64_LDFLAGS, > _CS_LFS64_LIBS, > _CS_LFS64_LINTFLAGS, > _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, > _CS_XBS5_ILP32_OFF32_LDFLAGS, > _CS_XBS5_ILP32_OFF32_LIBS, > _CS_XBS5_ILP32_OFF32_LINTFLAGS, > _CS_XBS5_ILP32_OFFBIG_CFLAGS, > _CS_XBS5_ILP32_OFFBIG_LDFLAGS, > _CS_XBS5_ILP32_OFFBIG_LIBS, > _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, > _CS_XBS5_LP64_OFF64_CFLAGS, > _CS_XBS5_LP64_OFF64_LDFLAGS, > _CS_XBS5_LP64_OFF64_LIBS, > _CS_XBS5_LP64_OFF64_LINTFLAGS, > _CS_XBS5_LPBIG_OFFBIG_CFLAGS, > _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, > _CS_XBS5_LPBIG_OFFBIG_LIBS, > _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, > _CS_POSIX_V6_ILP32_OFF32_CFLAGS, > _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, > _CS_POSIX_V6_ILP32_OFF32_LIBS, > _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, > _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, > _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, > _CS_POSIX_V6_ILP32_OFFBIG_LIBS, > _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, > _CS_POSIX_V6_LP64_OFF64_CFLAGS, > _CS_POSIX_V6_LP64_OFF64_LDFLAGS, > _CS_POSIX_V6_LP64_OFF64_LIBS, > _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, > _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, > _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, > _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, > _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, > _CS_POSIX_V7_ILP32_OFF32_CFLAGS, > _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, > _CS_POSIX_V7_ILP32_OFF32_LIBS, > _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, > _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, > _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, > _CS_POSIX_V7_ILP32_OFFBIG_LIBS, > _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, > _CS_POSIX_V7_LP64_OFF64_CFLAGS, > _CS_POSIX_V7_LP64_OFF64_LDFLAGS, > _CS_POSIX_V7_LP64_OFF64_LIBS, > _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, > _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, > _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, > _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, > _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS > }; >extern long int pathconf (__const char *__path, int __name) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__)); >extern long int sysconf (int __name) __attribute__ ((__nothrow__)); >extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__)); >extern __pid_t getpid (void) __attribute__ ((__nothrow__)); >extern __pid_t getppid (void) __attribute__ ((__nothrow__)); >extern __pid_t getpgrp (void) __attribute__ ((__nothrow__)); >extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__)); >extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__)); >extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__)); >extern int setpgrp (void) __attribute__ ((__nothrow__)); >extern __pid_t setsid (void) __attribute__ ((__nothrow__)); >extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__)); >extern __uid_t getuid (void) __attribute__ ((__nothrow__)); >extern __uid_t geteuid (void) __attribute__ ((__nothrow__)); >extern __gid_t getgid (void) __attribute__ ((__nothrow__)); >extern __gid_t getegid (void) __attribute__ ((__nothrow__)); >extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__)); >extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__)); >extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__)); >extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__)); >extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__)); >extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__)); >extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__)); >extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid) > __attribute__ ((__nothrow__)); >extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid) > __attribute__ ((__nothrow__)); >extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid) > __attribute__ ((__nothrow__)); >extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) > __attribute__ ((__nothrow__)); >extern __pid_t fork (void) __attribute__ ((__nothrow__)); >extern __pid_t vfork (void) __attribute__ ((__nothrow__)); >extern char *ttyname (int __fd) __attribute__ ((__nothrow__)); >extern int ttyname_r (int __fd, char *__buf, size_t __buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__)); >extern int isatty (int __fd) __attribute__ ((__nothrow__)); >extern int ttyslot (void) __attribute__ ((__nothrow__)); >extern int link (__const char *__from, __const char *__to) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)); >extern int linkat (int __fromfd, __const char *__from, int __tofd, > __const char *__to, int __flags) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))) __attribute__ ((__warn_unused_result__)); >extern int symlink (__const char *__from, __const char *__to) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)); >extern ssize_t readlink (__const char *__restrict __path, > char *__restrict __buf, size_t __len) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)); >extern int symlinkat (__const char *__from, int __tofd, > __const char *__to) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__)); >extern ssize_t readlinkat (int __fd, __const char *__restrict __path, > char *__restrict __buf, size_t __len) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)); >extern int unlink (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int unlinkat (int __fd, __const char *__name, int __flag) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int rmdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__)); >extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__)); >extern char *getlogin (void); >extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); >extern int setlogin (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern char *optarg; >extern int optind; >extern int opterr; >extern int optopt; >extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) > __attribute__ ((__nothrow__)); >extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int sethostname (__const char *__name, size_t __len) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int sethostid (long int __id) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int getdomainname (char *__name, size_t __len) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int setdomainname (__const char *__name, size_t __len) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int vhangup (void) __attribute__ ((__nothrow__)); >extern int revoke (__const char *__file) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int profil (unsigned short int *__sample_buffer, size_t __size, > size_t __offset, unsigned int __scale) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int acct (__const char *__name) __attribute__ ((__nothrow__)); >extern char *getusershell (void) __attribute__ ((__nothrow__)); >extern void endusershell (void) __attribute__ ((__nothrow__)); >extern void setusershell (void) __attribute__ ((__nothrow__)); >extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int chroot (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1))); >extern int fsync (int __fd); >extern long int gethostid (void); >extern void sync (void) __attribute__ ((__nothrow__)); >extern int getpagesize (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >extern int getdtablesize (void) __attribute__ ((__nothrow__)); >extern int truncate (__const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int truncate64 (__const char *__file, __off64_t __length) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int brk (void *__addr) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__)); >extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__)); >extern int fdatasync (int __fildes); >extern char *crypt (__const char *__key, __const char *__salt) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern void encrypt (char *__block, int __edflag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern void swab (__const void *__restrict __from, void *__restrict __to, > ssize_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); >extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, > size_t __buflen) __attribute__ ((__warn_unused_result__)); >extern ssize_t __read_alias (int __fd, void *__buf, size_t __nbytes) __asm__ ("" "read") __attribute__ ((__warn_unused_result__)); >extern ssize_t __read_chk_warn (int __fd, void *__buf, size_t __nbytes, size_t __buflen) __asm__ ("" "__read_chk") > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("read called with bigger length than size of " "the destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t >read (int __fd, void *__buf, size_t __nbytes) >{ > if (__builtin_object_size (__buf, 0) != (size_t) -1) > { > if (!__builtin_constant_p (__nbytes)) > return __read_chk (__fd, __buf, __nbytes, __builtin_object_size (__buf, 0)); > if (__nbytes > __builtin_object_size (__buf, 0)) > return __read_chk_warn (__fd, __buf, __nbytes, __builtin_object_size (__buf, 0)); > } > return __read_alias (__fd, __buf, __nbytes); >} >extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes, > __off_t __offset, size_t __bufsize) __attribute__ ((__warn_unused_result__)); >extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes, > __off64_t __offset, size_t __bufsize) __attribute__ ((__warn_unused_result__)); >extern ssize_t __pread_alias (int __fd, void *__buf, size_t __nbytes, __off_t __offset) __asm__ ("" "pread") __attribute__ ((__warn_unused_result__)); >extern ssize_t __pread64_alias (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64") __attribute__ ((__warn_unused_result__)); >extern ssize_t __pread_chk_warn (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize) __asm__ ("" "__pread_chk") > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("pread called with bigger length than size of " "the destination buffer"))); >extern ssize_t __pread64_chk_warn (int __fd, void *__buf, size_t __nbytes, __off64_t __offset, size_t __bufsize) __asm__ ("" "__pread64_chk") > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("pread64 called with bigger length than size of " "the destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t >pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) >{ > if (__builtin_object_size (__buf, 0) != (size_t) -1) > { > if (!__builtin_constant_p (__nbytes)) > return __pread64_chk (__fd, __buf, __nbytes, __offset, __builtin_object_size (__buf, 0)); > if ( __nbytes > __builtin_object_size (__buf, 0)) > return __pread64_chk_warn (__fd, __buf, __nbytes, __offset, > __builtin_object_size (__buf, 0)); > } > return __pread64_alias (__fd, __buf, __nbytes, __offset); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t >pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) >{ > if (__builtin_object_size (__buf, 0) != (size_t) -1) > { > if (!__builtin_constant_p (__nbytes)) > return __pread64_chk (__fd, __buf, __nbytes, __offset, __builtin_object_size (__buf, 0)); > if ( __nbytes > __builtin_object_size (__buf, 0)) > return __pread64_chk_warn (__fd, __buf, __nbytes, __offset, > __builtin_object_size (__buf, 0)); > } > return __pread64_alias (__fd, __buf, __nbytes, __offset); >} >extern ssize_t __readlink_chk (__const char *__restrict __path, > char *__restrict __buf, size_t __len, > size_t __buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)); >extern ssize_t __readlink_alias (__const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("" "readlink") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)); >extern ssize_t __readlink_chk_warn (__const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("" "__readlink_chk") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("readlink called with bigger length " "than size of destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)) ssize_t >__attribute__ ((__nothrow__)) readlink (__const char *__restrict __path, char *__restrict __buf, size_t __len) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__len)) > return __readlink_chk (__path, __buf, __len, __builtin_object_size (__buf, 2 > 1)); > if ( __len > __builtin_object_size (__buf, 2 > 1)) > return __readlink_chk_warn (__path, __buf, __len, __builtin_object_size (__buf, 2 > 1)); > } > return __readlink_alias (__path, __buf, __len); >} >extern ssize_t __readlinkat_chk (int __fd, __const char *__restrict __path, > char *__restrict __buf, size_t __len, > size_t __buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)); >extern ssize_t __readlinkat_alias (int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("" "readlinkat") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)); >extern ssize_t __readlinkat_chk_warn (int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("" "__readlinkat_chk") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("readlinkat called with bigger " "length than size of destination " "buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)) ssize_t >__attribute__ ((__nothrow__)) readlinkat (int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__len)) > return __readlinkat_chk (__fd, __path, __buf, __len, __builtin_object_size (__buf, 2 > 1)); > if (__len > __builtin_object_size (__buf, 2 > 1)) > return __readlinkat_chk_warn (__fd, __path, __buf, __len, > __builtin_object_size (__buf, 2 > 1)); > } > return __readlinkat_alias (__fd, __path, __buf, __len); >} >extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern char *__getcwd_alias (char *__buf, size_t __size) __asm__ ("" "getcwd") __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern char *__getcwd_chk_warn (char *__buf, size_t __size, size_t __buflen) __asm__ ("" "__getcwd_chk") __attribute__ ((__nothrow__)) > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getcwd caller with bigger length than size of " "destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * >__attribute__ ((__nothrow__)) getcwd (char *__buf, size_t __size) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__size)) > return __getcwd_chk (__buf, __size, __builtin_object_size (__buf, 2 > 1)); > if (__size > __builtin_object_size (__buf, 2 > 1)) > return __getcwd_chk_warn (__buf, __size, __builtin_object_size (__buf, 2 > 1)); > } > return __getcwd_alias (__buf, __size); >} >extern char *__getwd_chk (char *__buf, size_t buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern char *__getwd_warn (char *__buf) __asm__ ("" "getwd") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use getcwd instead, as getwd " "doesn't specify buffer size"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) __attribute__ ((__warn_unused_result__)) char * >__attribute__ ((__nothrow__)) getwd (char *__buf) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > return __getwd_chk (__buf, __builtin_object_size (__buf, 2 > 1)); > return __getwd_warn (__buf); >} >extern size_t __confstr_chk (int __name, char *__buf, size_t __len, > size_t __buflen) __attribute__ ((__nothrow__)); >extern size_t __confstr_alias (int __name, char *__buf, size_t __len) __asm__ ("" "confstr") __attribute__ ((__nothrow__)); >extern size_t __confstr_chk_warn (int __name, char *__buf, size_t __len, size_t __buflen) __asm__ ("" "__confstr_chk") __attribute__ ((__nothrow__)) > __attribute__((__warning__ ("confstr called with bigger length than size of destination " "buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) size_t >__attribute__ ((__nothrow__)) confstr (int __name, char *__buf, size_t __len) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__len)) > return __confstr_chk (__name, __buf, __len, __builtin_object_size (__buf, 2 > 1)); > if (__builtin_object_size (__buf, 2 > 1) < __len) > return __confstr_chk_warn (__name, __buf, __len, __builtin_object_size (__buf, 2 > 1)); > } > return __confstr_alias (__name, __buf, __len); >} >extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen) > __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int __getgroups_alias (int __size, __gid_t __list[]) __asm__ ("" "getgroups") __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); >extern int __getgroups_chk_warn (int __size, __gid_t __list[], size_t __listlen) __asm__ ("" "__getgroups_chk") __attribute__ ((__nothrow__)) > __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getgroups called with bigger group count than what " "can fit into destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) getgroups (int __size, __gid_t __list[]) >{ > if (__builtin_object_size (__list, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__size) || __size < 0) > return __getgroups_chk (__size, __list, __builtin_object_size (__list, 2 > 1)); > if (__size * sizeof (__gid_t) > __builtin_object_size (__list, 2 > 1)) > return __getgroups_chk_warn (__size, __list, __builtin_object_size (__list, 2 > 1)); > } > return __getgroups_alias (__size, __list); >} >extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen, > size_t __nreal) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >extern int __ttyname_r_alias (int __fd, char *__buf, size_t __buflen) __asm__ ("" "ttyname_r") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (2))); >extern int __ttyname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__ttyname_r_chk") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ttyname_r called with bigger buflen than " "size of destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) ttyname_r (int __fd, char *__buf, size_t __buflen) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__buflen)) > return __ttyname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > if (__buflen > __builtin_object_size (__buf, 2 > 1)) > return __ttyname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > } > return __ttyname_r_alias (__fd, __buf, __buflen); >} >extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal) > __attribute__ ((__nonnull__ (1))); >extern int __getlogin_r_alias (char *__buf, size_t __buflen) __asm__ ("" "getlogin_r") __attribute__ ((__nonnull__ (1))); >extern int __getlogin_r_chk_warn (char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__getlogin_r_chk") > __attribute__ ((__nonnull__ (1))) __attribute__((__warning__ ("getlogin_r called with bigger buflen than " "size of destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >getlogin_r (char *__buf, size_t __buflen) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__buflen)) > return __getlogin_r_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > if (__buflen > __builtin_object_size (__buf, 2 > 1)) > return __getlogin_r_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > } > return __getlogin_r_alias (__buf, __buflen); >} >extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int __gethostname_alias (char *__buf, size_t __buflen) __asm__ ("" "gethostname") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int __gethostname_chk_warn (char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__gethostname_chk") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (1))) __attribute__((__warning__ ("gethostname called with bigger buflen than " "size of destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) gethostname (char *__buf, size_t __buflen) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__buflen)) > return __gethostname_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > if (__buflen > __builtin_object_size (__buf, 2 > 1)) > return __gethostname_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > } > return __gethostname_alias (__buf, __buflen); >} >extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int __getdomainname_alias (char *__buf, size_t __buflen) __asm__ ("" "getdomainname") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); >extern int __getdomainname_chk_warn (char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__getdomainname_chk") __attribute__ ((__nothrow__)) > __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getdomainname called with bigger " "buflen than size of destination " "buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int >__attribute__ ((__nothrow__)) getdomainname (char *__buf, size_t __buflen) >{ > if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) > { > if (!__builtin_constant_p (__buflen)) > return __getdomainname_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > if (__buflen > __builtin_object_size (__buf, 2 > 1)) > return __getdomainname_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1)); > } > return __getdomainname_alias (__buf, __buflen); >} > > >extern int *__errno_location (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >extern char *program_invocation_name, *program_invocation_short_name; > >typedef int error_t; > >extern char *crypt (__const char *__key, __const char *__salt) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern void encrypt (char *__block, int __edflag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >struct crypt_data > { > char keysched[16 * 8]; > char sb0[32768]; > char sb1[32768]; > char sb2[32768]; > char sb3[32768]; > char crypt_3_buf[14]; > char current_salt[2]; > long int current_saltbits; > int direction, initialized; > }; >extern char *crypt_r (__const char *__key, __const char *__salt, > struct crypt_data * __restrict __data) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))); >extern void setkey_r (__const char *__key, > struct crypt_data * __restrict __data) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern void encrypt_r (char *__block, int __edflag, > struct crypt_data * __restrict __data) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); > > >extern void __assert_fail (__const char *__assertion, __const char *__file, > unsigned int __line, __const char *__function) > __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); >extern void __assert_perror_fail (int __errnum, __const char *__file, > unsigned int __line, > __const char *__function) > __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); >extern void __assert (const char *__assertion, const char *__file, int __line) > __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); > >typedef int File; >typedef int my_socket; > >typedef void (*sig_return)(); > >typedef char pchar; >typedef char puchar; >typedef char pbool; >typedef short pshort; >typedef float pfloat; > >typedef int (*qsort_cmp)(const void *,const void *); >typedef int (*qsort_cmp2)(void*, const void *,const void *); > > > >extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count) > __attribute__ ((__warn_unused_result__)); >extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count) > __attribute__ ((__warn_unused_result__)); >extern ssize_t preadv (int __fd, __const struct iovec *__iovec, int __count, __off64_t __offset) __asm__ ("" "preadv64") __attribute__ ((__warn_unused_result__)); >extern ssize_t pwritev (int __fd, __const struct iovec *__iovec, int __count, __off64_t __offset) __asm__ ("" "pwritev64") __attribute__ ((__warn_unused_result__)); >extern ssize_t preadv64 (int __fd, __const struct iovec *__iovec, int __count, > __off64_t __offset) __attribute__ ((__warn_unused_result__)); >extern ssize_t pwritev64 (int __fd, __const struct iovec *__iovec, int __count, > __off64_t __offset) __attribute__ ((__warn_unused_result__)); > >enum __socket_type >{ > SOCK_STREAM = 1, > SOCK_DGRAM = 2, > SOCK_RAW = 3, > SOCK_RDM = 4, > SOCK_SEQPACKET = 5, > SOCK_DCCP = 6, > SOCK_PACKET = 10, > SOCK_CLOEXEC = 02000000, > SOCK_NONBLOCK = 04000 >}; >typedef unsigned short int sa_family_t; >struct sockaddr > { > sa_family_t sa_family; > char sa_data[14]; > }; >struct sockaddr_storage > { > sa_family_t ss_family; > unsigned long int __ss_align; > char __ss_padding[(128 - (2 * sizeof (unsigned long int)))]; > }; >enum > { > MSG_OOB = 0x01, > MSG_PEEK = 0x02, > MSG_DONTROUTE = 0x04, > MSG_TRYHARD = MSG_DONTROUTE, > MSG_CTRUNC = 0x08, > MSG_PROXY = 0x10, > MSG_TRUNC = 0x20, > MSG_DONTWAIT = 0x40, > MSG_EOR = 0x80, > MSG_WAITALL = 0x100, > MSG_FIN = 0x200, > MSG_SYN = 0x400, > MSG_CONFIRM = 0x800, > MSG_RST = 0x1000, > MSG_ERRQUEUE = 0x2000, > MSG_NOSIGNAL = 0x4000, > MSG_MORE = 0x8000, > MSG_CMSG_CLOEXEC = 0x40000000 > }; >struct msghdr > { > void *msg_name; > socklen_t msg_namelen; > struct iovec *msg_iov; > size_t msg_iovlen; > void *msg_control; > size_t msg_controllen; > int msg_flags; > }; >struct cmsghdr > { > size_t cmsg_len; > int cmsg_level; > int cmsg_type; > __extension__ unsigned char __cmsg_data []; > }; >extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, > struct cmsghdr *__cmsg) __attribute__ ((__nothrow__)); >extern __inline struct cmsghdr * >__attribute__ ((__nothrow__)) __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) >{ > if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) > return 0; > __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg > + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))); > if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control > + __mhdr->msg_controllen) > || ((unsigned char *) __cmsg + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)) > > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) > return 0; > return __cmsg; >} >enum > { > SCM_RIGHTS = 0x01 > , SCM_CREDENTIALS = 0x02 > }; >struct ucred >{ > pid_t pid; > uid_t uid; > gid_t gid; >}; >struct linger > { > int l_onoff; > int l_linger; > }; >struct osockaddr > { > unsigned short int sa_family; > unsigned char sa_data[14]; > }; >enum >{ > SHUT_RD = 0, > SHUT_WR, > SHUT_RDWR >}; >typedef union { struct sockaddr *__restrict __sockaddr__; struct sockaddr_at *__restrict __sockaddr_at__; struct sockaddr_ax25 *__restrict __sockaddr_ax25__; struct sockaddr_dl *__restrict __sockaddr_dl__; struct sockaddr_eon *__restrict __sockaddr_eon__; struct sockaddr_in *__restrict __sockaddr_in__; struct sockaddr_in6 *__restrict __sockaddr_in6__; struct sockaddr_inarp *__restrict __sockaddr_inarp__; struct sockaddr_ipx *__restrict __sockaddr_ipx__; struct sockaddr_iso *__restrict __sockaddr_iso__; struct sockaddr_ns *__restrict __sockaddr_ns__; struct sockaddr_un *__restrict __sockaddr_un__; struct sockaddr_x25 *__restrict __sockaddr_x25__; > } __SOCKADDR_ARG __attribute__ ((__transparent_union__)); >typedef union { __const struct sockaddr *__restrict __sockaddr__; __const struct sockaddr_at *__restrict __sockaddr_at__; __const struct sockaddr_ax25 *__restrict __sockaddr_ax25__; __const struct sockaddr_dl *__restrict __sockaddr_dl__; __const struct sockaddr_eon *__restrict __sockaddr_eon__; __const struct sockaddr_in *__restrict __sockaddr_in__; __const struct sockaddr_in6 *__restrict __sockaddr_in6__; __const struct sockaddr_inarp *__restrict __sockaddr_inarp__; __const struct sockaddr_ipx *__restrict __sockaddr_ipx__; __const struct sockaddr_iso *__restrict __sockaddr_iso__; __const struct sockaddr_ns *__restrict __sockaddr_ns__; __const struct sockaddr_un *__restrict __sockaddr_un__; __const struct sockaddr_x25 *__restrict __sockaddr_x25__; > } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); >extern int socket (int __domain, int __type, int __protocol) __attribute__ ((__nothrow__)); >extern int socketpair (int __domain, int __type, int __protocol, > int __fds[2]) __attribute__ ((__nothrow__)); >extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) > __attribute__ ((__nothrow__)); >extern int getsockname (int __fd, __SOCKADDR_ARG __addr, > socklen_t *__restrict __len) __attribute__ ((__nothrow__)); >extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); >extern int getpeername (int __fd, __SOCKADDR_ARG __addr, > socklen_t *__restrict __len) __attribute__ ((__nothrow__)); >extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags); >extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags); >extern ssize_t sendto (int __fd, __const void *__buf, size_t __n, > int __flags, __CONST_SOCKADDR_ARG __addr, > socklen_t __addr_len); >extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, > int __flags, __SOCKADDR_ARG __addr, > socklen_t *__restrict __addr_len); >extern ssize_t sendmsg (int __fd, __const struct msghdr *__message, > int __flags); >extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); >extern int getsockopt (int __fd, int __level, int __optname, > void *__restrict __optval, > socklen_t *__restrict __optlen) __attribute__ ((__nothrow__)); >extern int setsockopt (int __fd, int __level, int __optname, > __const void *__optval, socklen_t __optlen) __attribute__ ((__nothrow__)); >extern int listen (int __fd, int __n) __attribute__ ((__nothrow__)); >extern int accept (int __fd, __SOCKADDR_ARG __addr, > socklen_t *__restrict __addr_len); >extern int accept4 (int __fd, __SOCKADDR_ARG __addr, > socklen_t *__restrict __addr_len, int __flags); >extern int shutdown (int __fd, int __how) __attribute__ ((__nothrow__)); >extern int sockatmark (int __fd) __attribute__ ((__nothrow__)); >extern int isfdtype (int __fd, int __fdtype) __attribute__ ((__nothrow__)); >extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen, > int __flags); >extern ssize_t __recv_alias (int __fd, void *__buf, size_t __n, int __flags) __asm__ ("" "recv"); >extern ssize_t __recv_chk_warn (int __fd, void *__buf, size_t __n, size_t __buflen, int __flags) __asm__ ("" "__recv_chk") > __attribute__((__warning__ ("recv called with bigger length than size of destination " "buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) ssize_t >recv (int __fd, void *__buf, size_t __n, int __flags) >{ > if (__builtin_object_size (__buf, 0) != (size_t) -1) > { > if (!__builtin_constant_p (__n)) > return __recv_chk (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags); > if (__n > __builtin_object_size (__buf, 0)) > return __recv_chk_warn (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags); > } > return __recv_alias (__fd, __buf, __n, __flags); >} >extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n, > size_t __buflen, int __flags, > __SOCKADDR_ARG __addr, > socklen_t *__restrict __addr_len); >extern ssize_t __recvfrom_alias (int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) __asm__ ("" "recvfrom"); >extern ssize_t __recvfrom_chk_warn (int __fd, void *__restrict __buf, size_t __n, size_t __buflen, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) __asm__ ("" "__recvfrom_chk") > __attribute__((__warning__ ("recvfrom called with bigger length than size of " "destination buffer"))); >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) ssize_t >recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, > __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) >{ > if (__builtin_object_size (__buf, 0) != (size_t) -1) > { > if (!__builtin_constant_p (__n)) > return __recvfrom_chk (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags, > __addr, __addr_len); > if (__n > __builtin_object_size (__buf, 0)) > return __recvfrom_chk_warn (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags, > __addr, __addr_len); > } > return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len); >} > >typedef socklen_t size_socket; >typedef long my_ptrdiff_t; >typedef char *gptr; >typedef signed char int8; >typedef short int16; >typedef unsigned char uchar; >typedef unsigned char uint8; >typedef unsigned short uint16; >typedef int int32; >typedef unsigned int uint32; >typedef unsigned long long int ulonglong; >typedef long long int longlong; >typedef unsigned long long my_ulonglong; >typedef ulonglong my_off_t; >typedef off_t os_off_t; >typedef uint8 int7; >typedef short int15; >typedef char *my_string; >typedef unsigned long size_s; >typedef int myf; >typedef char byte; >typedef char my_bool; >typedef char bool; >extern int my_pthread_getprio(pthread_t thread_id); >typedef void *(* pthread_handler)(void *); >extern void my_pthread_setprio(pthread_t thread_id,int prior); >extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority); >typedef struct st_safe_mutex_t >{ > pthread_mutex_t global,mutex; > const char *file; > uint line,count; > pthread_t thread; >} safe_mutex_t; >int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, > const char *file, uint line); >int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line); >int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); >int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); >int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, > uint line); >int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, > struct timespec *abstime, const char *file, uint line); >void safe_mutex_global_init(void); >void safe_mutex_end(FILE *file); >extern pthread_mutexattr_t my_fast_mutexattr; >extern pthread_mutexattr_t my_errorcheck_mutexattr; >extern my_bool my_thread_global_init(void); >extern void my_thread_global_end(void); >extern my_bool my_thread_init(void); >extern void my_thread_end(void); >extern const char *my_thread_name(void); >extern long my_thread_id(void); >extern int pthread_no_free(void *); >extern int pthread_dummy(int); >struct st_my_thread_var >{ > int thr_errno; > pthread_cond_t suspend; > pthread_mutex_t mutex; > pthread_mutex_t * volatile current_mutex; > pthread_cond_t * volatile current_cond; > pthread_t pthread_self; > long id; > int cmp_length; > int volatile abort; > my_bool init; > struct st_my_thread_var *next,**prev; > void *opt_info; >}; >extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); >extern uint my_thread_end_wait_time; >extern uint thd_lib_detected; >typedef unsigned long int ulint; >typedef long int lint; >typedef longlong ib_longlong; >typedef unsigned long long int ullint; >typedef double utfloat; >typedef pthread_t os_thread_t; >typedef os_thread_t os_thread_id_t; >typedef void* (*os_posix_f_t) (void*); >ulint >os_thread_eq( > os_thread_id_t a, > os_thread_id_t b); >ulint >os_thread_pf( > os_thread_id_t a); >os_thread_t >os_thread_create( > os_posix_f_t start_f, > void* arg, > os_thread_id_t* thread_id); >int >os_thread_join( > os_thread_id_t thread_id); >void >os_thread_exit( > void* exit_value); >os_thread_id_t >os_thread_get_curr_id(void); >os_thread_t >os_thread_get_curr(void); >void >os_thread_yield(void); >void >os_thread_sleep( > ulint tm); >ulint >os_thread_get_priority( > os_thread_t handle); >void >os_thread_set_priority( > os_thread_t handle, > ulint pri); >ulint >os_thread_get_last_error(void); >void >ut_dbg_assertion_failed( > const char* expr, > const char* file, > ulint line); >extern ulint ut_dbg_stop_threads; >extern ulint* ut_dbg_null_ptr; >void >ut_dbg_stop_thread( > const char* file, > ulint line); > >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)) >}; >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)); > >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__)); > >extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__)); >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__)); >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; >} >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__)); > >typedef time_t ib_time_t; >ulint >ut_get_high32( > ulint a); >static inline >ulint >ut_min( > ulint n1, > ulint n2); >static inline >ulint >ut_max( > ulint n1, > ulint n2); >static inline >void >ut_pair_min( > ulint* a, > ulint* b, > ulint a1, > ulint b1, > ulint a2, > ulint b2); >static inline >int >ut_ulint_cmp( > ulint a, > ulint b); >static inline >int >ut_pair_cmp( > ulint a1, > ulint a2, > ulint b1, > ulint b2); >static inline >ulint >ut_2pow_remainder( > ulint n, > ulint m); >static inline >ulint >ut_2pow_round( > ulint n, > ulint m); >static inline >ulint >ut_2_log( > ulint n); >static inline >ulint >ut_2_exp( > ulint n); >ulint >ut_2_power_up( > ulint n); >void >ut_ulint_sort(ulint* arr, ulint* aux_arr, ulint low, ulint high); >ulint >ut_clock(void); >ib_time_t >ut_time(void); >void >ut_usectime( > ulint* sec, > ulint* ms); >double >ut_difftime( > ib_time_t time2, > ib_time_t time1); >void >ut_print_timestamp( > FILE* file); >void >ut_sprintf_timestamp( > char* buf); >void >ut_sprintf_timestamp_without_extra_chars( > char* buf); >void >ut_get_year_month_day( > ulint* year, > ulint* month, > ulint* day); >ulint >ut_delay( > ulint delay); >void >ut_print_buf( > FILE* file, > const unsigned char* buf, > ulint len); >void >ut_print_filename( > FILE* f, > const char* name); >struct trx_struct; >void >ut_print_name( > FILE* f, > struct trx_struct*trx, > const char* name); >void >ut_print_namel( > FILE* f, > struct trx_struct*trx, > const char* name, > ulint namelen); >void >ut_copy_file( > FILE* dest, > FILE* src); >static inline >ulint >ut_min( > ulint n1, > ulint n2) >{ > return((n1 <= n2) ? n1 : n2); >} >static inline >ulint >ut_max( > ulint n1, > ulint n2) >{ > return((n1 <= n2) ? n2 : n1); >} >static inline >void >ut_pair_min( > ulint* a, > ulint* b, > ulint a1, > ulint b1, > ulint a2, > ulint b2) >{ > if (a1 == a2) { > *a = a1; > *b = ut_min(b1, b2); > } else if (a1 < a2) { > *a = a1; > *b = b1; > } else { > *a = a2; > *b = b2; > } >} >static inline >int >ut_ulint_cmp( > ulint a, > ulint b) >{ > if (a < b) { > return(-1); > } else if (a == b) { > return(0); > } else { > return(1); > } >} >static inline >int >ut_pair_cmp( > ulint a1, > ulint a2, > ulint b1, > ulint b2) >{ > if (a1 > b1) { > return(1); > } else if (a1 < b1) { > return(-1); > } else if (a2 > b2) { > return(1); > } else if (a2 < b2) { > return(-1); > } else { > return(0); > } >} >static inline >ulint >ut_2pow_remainder( > ulint n, > ulint m) >{ > ; > return(n & (m - 1)); >} >static inline >ulint >ut_2pow_round( > ulint n, > ulint m) >{ > ; > return(n & ~(m - 1)); >} >static inline >ulint >ut_2_log( > ulint n) >{ > ulint res; > res = 0; > ; > n = n - 1; > for (;;) { > n = n / 2; > if (n == 0) { > break; > } > res++; > } > return(res + 1); >} >static inline >ulint >ut_2_exp( > ulint n) >{ > return((ulint) 1 << n); >} >typedef struct dict_sys_struct dict_sys_t; >typedef struct dict_col_struct dict_col_t; >typedef struct dict_field_struct dict_field_t; >typedef struct dict_index_struct dict_index_t; >typedef struct dict_tree_struct dict_tree_t; >typedef struct dict_table_struct dict_table_t; >typedef struct dict_foreign_struct dict_foreign_t; >typedef dict_table_t dict_cluster_t; >typedef struct ind_node_struct ind_node_t; >typedef struct tab_node_struct tab_node_t; >extern ulint data_mysql_default_charset_coll; >typedef struct dtype_struct dtype_t; >extern dtype_t* dtype_binary; >static inline >ulint >dtype_get_mysql_type( > dtype_t* type); >ulint >dtype_get_at_most_n_mbchars( > const dtype_t* dtype, > ulint prefix_len, > ulint data_len, > const char* str); >ulint >dtype_is_string_type( > ulint mtype); >ulint >dtype_is_binary_string_type( > ulint mtype, > ulint prtype); >ulint >dtype_is_non_binary_string_type( > ulint mtype, > ulint prtype); >static inline >void >dtype_set( > dtype_t* type, > ulint mtype, > ulint prtype, > ulint len, > ulint prec); >static inline >void >dtype_copy( > dtype_t* type1, > dtype_t* type2); >static inline >ulint >dtype_get_mtype( > dtype_t* type); >static inline >ulint >dtype_get_prtype( > dtype_t* type); >ulint >dtype_get_charset_coll_noninline( > ulint prtype); >static inline >ulint >dtype_get_charset_coll( > ulint prtype); >ulint >dtype_form_prtype( > ulint old_prtype, > ulint charset_coll); >static inline >ulint >dtype_get_len( > dtype_t* type); >static inline >ulint >dtype_get_prec( > dtype_t* type); >static inline >ulint >dtype_get_mbminlen( > const dtype_t* type); >static inline >ulint >dtype_get_mbmaxlen( > const dtype_t* type); >static inline >ulint >dtype_get_pad_char( > const dtype_t* type); >static inline >ulint >dtype_get_fixed_size( > dtype_t* type); >static inline >ulint >dtype_get_min_size( > const dtype_t* type); >static inline >ulint >dtype_get_sql_null_size( > dtype_t* type); >static inline >ulint >dtype_is_fixed_size( > dtype_t* type); >static inline >void >dtype_read_for_order_and_null_size( > dtype_t* type, > unsigned char* buf); >static inline >void >dtype_new_store_for_order_and_null_size( > unsigned char* buf, > dtype_t* type, > ulint prefix_len); >static inline >void >dtype_new_read_for_order_and_null_size( > dtype_t* type, > unsigned char* buf); >ulint >dtype_validate( > dtype_t* type); >void >dtype_print( > dtype_t* type); >struct dtype_struct{ > ulint mtype; > ulint prtype; > ulint len; > ulint prec; > ulint mbminlen; > ulint mbmaxlen; >}; >typedef struct dulint_struct dulint; >struct dulint_struct{ > ulint high; > ulint low; >}; >extern dulint ut_dulint_zero; >extern dulint ut_dulint_max; >static inline >dulint >ut_dulint_create( > ulint high, > ulint low); >static inline >ulint >ut_dulint_get_high( > dulint d); >static inline >ulint >ut_dulint_get_low( > dulint d); >static inline >ib_longlong >ut_conv_dulint_to_longlong( > dulint d); >static inline >ulint >ut_dulint_is_zero( > dulint a); >static inline >int >ut_dulint_cmp( > dulint a, > dulint b); >static inline >dulint >ut_dulint_get_max( > dulint a, > dulint b); >static inline >dulint >ut_dulint_get_min( > dulint a, > dulint b); >static inline >dulint >ut_dulint_add( > dulint a, > ulint b); >static inline >dulint >ut_dulint_subtract( > dulint a, > ulint b); >static inline >ulint >ut_dulint_minus( > dulint a, > dulint b); >static inline >dulint >ut_dulint_align_down( > dulint n, > ulint align_no); >static inline >dulint >ut_dulint_align_up( > dulint n, > ulint align_no); >void >ut_dulint_sort(dulint* arr, dulint* aux_arr, ulint low, ulint high); >static inline >ulint >ut_calc_align( > ulint n, > ulint align_no); >static inline >ulint >ut_calc_align_down( > ulint n, > ulint align_no); >static inline >void* >ut_align( > void* ptr, > ulint align_no); >static inline >void* >ut_align_down( > void* ptr, > ulint align_no) > __attribute__((const)); >static inline >ulint >ut_align_offset( > const void* ptr, > ulint align_no) > __attribute__((const)); >static inline >ulint >ut_bit_get_nth( > ulint a, > ulint n); >static inline >ulint >ut_bit_set_nth( > ulint a, > ulint n, > ulint val); >static inline >dulint >ut_dulint_create( > ulint high, > ulint low) >{ > dulint res; > ; > ; > res.high = high; > res.low = low; > return(res); >} >static inline >ulint >ut_dulint_get_high( > dulint d) >{ > return(d.high); >} >static inline >ulint >ut_dulint_get_low( > dulint d) >{ > return(d.low); >} >static inline >ib_longlong >ut_conv_dulint_to_longlong( > dulint d) >{ > return((ib_longlong)d.low > + (((ib_longlong)d.high) << 32)); >} >static inline >ulint >ut_dulint_is_zero( > dulint a) >{ > if ((a.low == 0) && (a.high == 0)) { > return((1)); > } > return((0)); >} >static inline >int >ut_dulint_cmp( > dulint a, > dulint b) >{ > if (a.high > b.high) { > return(1); > } else if (a.high < b.high) { > return(-1); > } else if (a.low > b.low) { > return(1); > } else if (a.low < b.low) { > return(-1); > } else { > return(0); > } >} >static inline >dulint >ut_dulint_get_max( > dulint a, > dulint b) >{ > if (ut_dulint_cmp(a, b) > 0) { > return(a); > } > return(b); >} >static inline >dulint >ut_dulint_get_min( > dulint a, > dulint b) >{ > if (ut_dulint_cmp(a, b) > 0) { > return(b); > } > return(a); >} >static inline >dulint >ut_dulint_add( > dulint a, > ulint b) >{ > if (0xFFFFFFFFUL - b >= a.low) { > a.low += b; > return(a); > } > a.low = a.low - (0xFFFFFFFFUL - b) - 1; > a.high++; > return(a); >} >static inline >dulint >ut_dulint_subtract( > dulint a, > ulint b) >{ > if (a.low >= b) { > a.low -= b; > return(a); > } > b -= a.low + 1; > a.low = 0xFFFFFFFFUL - b; > ; > a.high--; > return(a); >} >static inline >ulint >ut_dulint_minus( > dulint a, > dulint b) >{ > ulint diff; > if (a.high == b.high) { > ; > return(a.low - b.low); > } > ; > diff = (ulint)(0xFFFFFFFFUL - b.low); > diff += 1 + a.low; > ; > return(diff); >} >static inline >dulint >ut_dulint_align_down( > dulint n, > ulint align_no) >{ > ulint low, high; > ; > ; > low = ut_dulint_get_low(n); > high = ut_dulint_get_high(n); > low = low & ~(align_no - 1); > return(ut_dulint_create(high, low)); >} >static inline >dulint >ut_dulint_align_up( > dulint n, > ulint align_no) >{ > return(ut_dulint_align_down(ut_dulint_add(n, align_no - 1), align_no)); >} >static inline >ulint >ut_calc_align( > ulint n, > ulint align_no) >{ > ; > ; > return((n + align_no - 1) & ~(align_no - 1)); >} >static inline >void* >ut_align( > void* ptr, > ulint align_no) >{ > ; > ; > ; > ; > return((void*)((((ulint)ptr) + align_no - 1) & ~(align_no - 1))); >} >static inline >ulint >ut_calc_align_down( > ulint n, > ulint align_no) >{ > ; > ; > return(n & ~(align_no - 1)); >} >static inline >void* >ut_align_down( > void* ptr, > ulint align_no) >{ > ; > ; > ; > ; > return((void*)((((ulint)ptr)) & ~(align_no - 1))); >} >static inline >ulint >ut_align_offset( > const void* ptr, > ulint align_no) >{ > ; > ; > ; > ; > return(((ulint)ptr) & (align_no - 1)); >} >static inline >ulint >ut_bit_get_nth( > ulint a, > ulint n) >{ > ; > ; > return(1 & (a >> n)); >} >static inline >ulint >ut_bit_set_nth( > ulint a, > ulint n, > ulint val) >{ > ; > ; > if (val) { > return(((ulint) 1 << n) | a); > } else { > return(~((ulint) 1 << n) & a); > } >} >static inline >void >mach_write_to_1( > unsigned char* b, > ulint n); >static inline >ulint >mach_read_from_1( > unsigned char* b); >static inline >void >mach_write_to_2( > unsigned char* b, > ulint n); >static inline >ulint >mach_read_from_2( > unsigned char* b); >static inline >uint16 >mach_encode_2( > ulint n); >static inline >ulint >mach_decode_2( > uint16 n); >static inline >void >mach_write_to_3( > unsigned char* b, > ulint n); >static inline >ulint >mach_read_from_3( > unsigned char* b); >static inline >void >mach_write_to_4( > unsigned char* b, > ulint n); >static inline >ulint >mach_read_from_4( > unsigned char* b); >static inline >ulint >mach_write_compressed( > unsigned char* b, > ulint n); >static inline >ulint >mach_get_compressed_size( > ulint n); >static inline >ulint >mach_read_compressed( > unsigned char* b); >static inline >void >mach_write_to_6( > unsigned char* b, > dulint n); >static inline >dulint >mach_read_from_6( > unsigned char* b); >static inline >void >mach_write_to_7( > unsigned char* b, > dulint n); >static inline >dulint >mach_read_from_7( > unsigned char* b); >static inline >void >mach_write_to_8( > unsigned char* b, > dulint n); >static inline >dulint >mach_read_from_8( > unsigned char* b); >static inline >ulint >mach_dulint_write_compressed( > unsigned char* b, > dulint n); >static inline >ulint >mach_dulint_get_compressed_size( > dulint n); >static inline >dulint >mach_dulint_read_compressed( > unsigned char* b); >static inline >ulint >mach_dulint_write_much_compressed( > unsigned char* b, > dulint n); >static inline >ulint >mach_dulint_get_much_compressed_size( > dulint n); >static inline >dulint >mach_dulint_read_much_compressed( > unsigned char* b); >unsigned char* >mach_parse_compressed( > unsigned char* ptr, > unsigned char* end_ptr, > ulint* val); >unsigned char* >mach_dulint_parse_compressed( > unsigned char* ptr, > unsigned char* end_ptr, > dulint* val); >static inline >double >mach_double_read( > unsigned char* b); >static inline >void >mach_double_write( > unsigned char* b, > double d); >static inline >float >mach_float_read( > unsigned char* b); >static inline >void >mach_float_write( > unsigned char* b, > float d); >static inline >ulint >mach_read_from_n_little_endian( > unsigned char* buf, > ulint buf_size); >static inline >void >mach_write_to_n_little_endian( > unsigned char* dest, > ulint dest_size, > ulint n); >static inline >ulint >mach_read_from_2_little_endian( > unsigned char* buf); >static inline >void >mach_write_to_2_little_endian( > unsigned char* dest, > ulint n); >static inline >void >mach_write_to_1( > unsigned char* b, > ulint n) >{ > ; > ; > b[0] = (unsigned char)n; >} >static inline >ulint >mach_read_from_1( > unsigned char* b) >{ > ; > return((ulint)(b[0])); >} >static inline >void >mach_write_to_2( > unsigned char* b, > ulint n) >{ > ; > ; > b[0] = (unsigned char)(n >> 8); > b[1] = (unsigned char)(n); >} >static inline >ulint >mach_read_from_2( > unsigned char* b) >{ > ; > return( ((ulint)(b[0]) << 8) > + (ulint)(b[1]) > ); >} >static inline >uint16 >mach_encode_2( > ulint n) >{ > uint16 ret; > ; > mach_write_to_2((unsigned char*) &ret, n); > return(ret); >} >static inline >ulint >mach_decode_2( > uint16 n) >{ > ; > return(mach_read_from_2((unsigned char*) &n)); >} >static inline >void >mach_write_to_3( > unsigned char* b, > ulint n) >{ > ; > ; > b[0] = (unsigned char)(n >> 16); > b[1] = (unsigned char)(n >> 8); > b[2] = (unsigned char)(n); >} >static inline >ulint >mach_read_from_3( > unsigned char* b) >{ > ; > return( ((ulint)(b[0]) << 16) > + ((ulint)(b[1]) << 8) > + (ulint)(b[2]) > ); >} >static inline >void >mach_write_to_4( > unsigned char* b, > ulint n) >{ > ; > b[0] = (unsigned char)(n >> 24); > b[1] = (unsigned char)(n >> 16); > b[2] = (unsigned char)(n >> 8); > b[3] = (unsigned char)n; >} >static inline >ulint >mach_read_from_4( > unsigned char* b) >{ > ; > return( ((ulint)(b[0]) << 24) > + ((ulint)(b[1]) << 16) > + ((ulint)(b[2]) << 8) > + (ulint)(b[3]) > ); >} >static inline >ulint >mach_write_compressed( > unsigned char* b, > ulint n) >{ > ; > if (n < 0x80UL) { > mach_write_to_1(b, n); > return(1); > } else if (n < 0x4000UL) { > mach_write_to_2(b, n | 0x8000UL); > return(2); > } else if (n < 0x200000UL) { > mach_write_to_3(b, n | 0xC00000UL); > return(3); > } else if (n < 0x10000000UL) { > mach_write_to_4(b, n | 0xE0000000UL); > return(4); > } else { > mach_write_to_1(b, 0xF0UL); > mach_write_to_4(b + 1, n); > return(5); > } >} >static inline >ulint >mach_get_compressed_size( > ulint n) >{ > if (n < 0x80UL) { > return(1); > } else if (n < 0x4000UL) { > return(2); > } else if (n < 0x200000UL) { > return(3); > } else if (n < 0x10000000UL) { > return(4); > } else { > return(5); > } >} >static inline >ulint >mach_read_compressed( > unsigned char* b) >{ > ulint flag; > ; > flag = mach_read_from_1(b); > if (flag < 0x80UL) { > return(flag); > } else if (flag < 0xC0UL) { > return(mach_read_from_2(b) & 0x7FFFUL); > } else if (flag < 0xE0UL) { > return(mach_read_from_3(b) & 0x3FFFFFUL); > } else if (flag < 0xF0UL) { > return(mach_read_from_4(b) & 0x1FFFFFFFUL); > } else { > ; > return(mach_read_from_4(b + 1)); > } >} >static inline >void >mach_write_to_8( > unsigned char* b, > dulint n) >{ > ; > mach_write_to_4(b, ut_dulint_get_high(n)); > mach_write_to_4(b + 4, ut_dulint_get_low(n)); >} >static inline >dulint >mach_read_from_8( > unsigned char* b) >{ > ulint high; > ulint low; > ; > high = mach_read_from_4(b); > low = mach_read_from_4(b + 4); > return(ut_dulint_create(high, low)); >} >static inline >void >mach_write_to_7( > unsigned char* b, > dulint n) >{ > ; > mach_write_to_3(b, ut_dulint_get_high(n)); > mach_write_to_4(b + 3, ut_dulint_get_low(n)); >} >static inline >dulint >mach_read_from_7( > unsigned char* b) >{ > ulint high; > ulint low; > ; > high = mach_read_from_3(b); > low = mach_read_from_4(b + 3); > return(ut_dulint_create(high, low)); >} >static inline >void >mach_write_to_6( > unsigned char* b, > dulint n) >{ > ; > mach_write_to_2(b, ut_dulint_get_high(n)); > mach_write_to_4(b + 2, ut_dulint_get_low(n)); >} >static inline >dulint >mach_read_from_6( > unsigned char* b) >{ > ulint high; > ulint low; > ; > high = mach_read_from_2(b); > low = mach_read_from_4(b + 2); > return(ut_dulint_create(high, low)); >} >static inline >ulint >mach_dulint_write_compressed( > unsigned char* b, > dulint n) >{ > ulint size; > ; > size = mach_write_compressed(b, ut_dulint_get_high(n)); > mach_write_to_4(b + size, ut_dulint_get_low(n)); > return(size + 4); >} >static inline >ulint >mach_dulint_get_compressed_size( > dulint n) >{ > return(4 + mach_get_compressed_size(ut_dulint_get_high(n))); >} >static inline >dulint >mach_dulint_read_compressed( > unsigned char* b) >{ > ulint high; > ulint low; > ulint size; > ; > high = mach_read_compressed(b); > size = mach_get_compressed_size(high); > low = mach_read_from_4(b + size); > return(ut_dulint_create(high, low)); >} >static inline >ulint >mach_dulint_write_much_compressed( > unsigned char* b, > dulint n) >{ > ulint size; > ; > if (ut_dulint_get_high(n) == 0) { > return(mach_write_compressed(b, ut_dulint_get_low(n))); > } > *b = (unsigned char)0xFF; > size = 1 + mach_write_compressed(b + 1, ut_dulint_get_high(n)); > size += mach_write_compressed(b + size, ut_dulint_get_low(n)); > return(size); >} >static inline >ulint >mach_dulint_get_much_compressed_size( > dulint n) >{ > if (0 == ut_dulint_get_high(n)) { > return(mach_get_compressed_size(ut_dulint_get_low(n))); > } > return(1 + mach_get_compressed_size(ut_dulint_get_high(n)) > + mach_get_compressed_size(ut_dulint_get_low(n))); >} >static inline >dulint >mach_dulint_read_much_compressed( > unsigned char* b) >{ > ulint high; > ulint low; > ulint size; > ; > if (*b != (unsigned char)0xFF) { > high = 0; > size = 0; > } else { > high = mach_read_compressed(b + 1); > size = 1 + mach_get_compressed_size(high); > } > low = mach_read_compressed(b + size); > return(ut_dulint_create(high, low)); >} >static inline >double >mach_double_read( > unsigned char* b) >{ > double d; > ulint i; > unsigned char* ptr; > ptr = (unsigned char*)&d; > for (i = 0; i < sizeof(double); i++) { > ptr[i] = b[i]; > } > return(d); >} >static inline >void >mach_double_write( > unsigned char* b, > double d) >{ > ulint i; > unsigned char* ptr; > ptr = (unsigned char*)&d; > for (i = 0; i < sizeof(double); i++) { > b[i] = ptr[i]; > } >} >static inline >float >mach_float_read( > unsigned char* b) >{ > float d; > ulint i; > unsigned char* ptr; > ptr = (unsigned char*)&d; > for (i = 0; i < sizeof(float); i++) { > ptr[i] = b[i]; > } > return(d); >} >static inline >void >mach_float_write( > unsigned char* b, > float d) >{ > ulint i; > unsigned char* ptr; > ptr = (unsigned char*)&d; > for (i = 0; i < sizeof(float); i++) { > b[i] = ptr[i]; > } >} >static inline >ulint >mach_read_from_n_little_endian( > unsigned char* buf, > ulint buf_size) >{ > ulint n = 0; > unsigned char* ptr; > ; > ; > ptr = buf + buf_size; > for (;;) { > ptr--; > n = n << 8; > n += (ulint)(*ptr); > if (ptr == buf) { > break; > } > } > return(n); >} >static inline >void >mach_write_to_n_little_endian( > unsigned char* dest, > ulint dest_size, > ulint n) >{ > unsigned char* end; > ; > ; > end = dest + dest_size; > for (;;) { > *dest = (unsigned char)(n & 0xFF); > n = n >> 8; > dest++; > if (dest == end) { > break; > } > } > ; >} >static inline >ulint >mach_read_from_2_little_endian( > unsigned char* buf) >{ > return((ulint)(*buf) + ((ulint)(*(buf + 1))) * 256); >} >static inline >void >mach_write_to_2_little_endian( > unsigned char* dest, > ulint n) >{ > ; > *dest = (unsigned char)(n & 0xFFUL); > n = n >> 8; > dest++; > *dest = (unsigned char)(n & 0xFFUL); >} >extern >void >innobase_get_cset_width( > ulint cset, > ulint* mbminlen, > ulint* mbmaxlen); >static inline >ulint >dtype_get_charset_coll( > ulint prtype) >{ > return((prtype >> 16) & 0xFFUL); >} >static inline >ulint >dtype_get_mysql_type( > dtype_t* type) >{ > return(type->prtype & 0xFFUL); >} >static inline >void >dtype_set_mblen( > dtype_t* type) >{ > ; > if (dtype_is_string_type(type->mtype)) { > innobase_get_cset_width(dtype_get_charset_coll(type->prtype), > &type->mbminlen, &type->mbmaxlen); > ; > } else { > type->mbminlen = type->mbmaxlen = 0; > } >} >static inline >void >dtype_set( > dtype_t* type, > ulint mtype, > ulint prtype, > ulint len, > ulint prec) >{ > ; > ; > type->mtype = mtype; > type->prtype = prtype; > type->len = len; > type->prec = prec; > dtype_set_mblen(type); > ; >} >static inline >void >dtype_copy( > dtype_t* type1, > dtype_t* type2) >{ > *type1 = *type2; > ; >} >static inline >ulint >dtype_get_mtype( > dtype_t* type) >{ > ; > return(type->mtype); >} >static inline >ulint >dtype_get_prtype( > dtype_t* type) >{ > ; > return(type->prtype); >} >static inline >ulint >dtype_get_len( > dtype_t* type) >{ > ; > return(type->len); >} >static inline >ulint >dtype_get_prec( > dtype_t* type) >{ > ; > return(type->prec); >} >static inline >ulint >dtype_get_mbminlen( > const dtype_t* type) >{ > ; > return(type->mbminlen); >} >static inline >ulint >dtype_get_mbmaxlen( > const dtype_t* type) >{ > ; > return(type->mbmaxlen); >} >static inline >ulint >dtype_get_pad_char( > const dtype_t* type) >{ > switch (type->mtype) { > case 3: > case 4: > if (__builtin_expect(dtype_get_charset_coll(type->prtype) == 63, (0))) { > return(((ulint)(-1))); > } > case 2: > case 1: > case 13: > case 12: > return(0x20); > case 5: > if ((type->prtype & 1024) == 0) { > return(0x20); > } > default: > return(((ulint)(-1))); > } >} >static inline >void >dtype_new_store_for_order_and_null_size( > unsigned char* buf, > dtype_t* type, > ulint prefix_len) >{ > ulint len; > buf[0] = (unsigned char)(type->mtype & 0xFFUL); > if (type->prtype & 1024) { > buf[0] = buf[0] | 128; > } > buf[1] = (unsigned char)(type->prtype & 0xFFUL); > len = prefix_len ? prefix_len : type->len; > mach_write_to_2(buf + 2, len & 0xFFFFUL); > ; > mach_write_to_2(buf + 4, dtype_get_charset_coll(type->prtype)); > if (type->prtype & 256) { > buf[4] |= 128; > } >} >static inline >void >dtype_read_for_order_and_null_size( > dtype_t* type, > unsigned char* buf) >{ > ; > type->mtype = buf[0] & 63; > type->prtype = buf[1]; > if (buf[0] & 128) { > type->prtype = type->prtype | 1024; > } > type->len = mach_read_from_2(buf + 2); > type->prtype = dtype_form_prtype(type->prtype, > data_mysql_default_charset_coll); > dtype_set_mblen(type); >} >static inline >void >dtype_new_read_for_order_and_null_size( > dtype_t* type, > unsigned char* buf) >{ > ulint charset_coll; > type->mtype = buf[0] & 63; > type->prtype = buf[1]; > if (buf[0] & 128) { > type->prtype |= 1024; > } > if (buf[4] & 128) { > type->prtype |= 256; > } > type->len = mach_read_from_2(buf + 2); > mach_read_from_2(buf + 4); > charset_coll = mach_read_from_2(buf + 4) & 0x7fff; > if (dtype_is_string_type(type->mtype)) { > do { if (__builtin_expect(!((ulint)(charset_coll < 256)), (0))) { ut_dbg_assertion_failed("charset_coll < 256", "./../include/data0type.ic", (ulint) 329); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/data0type.ic", (ulint) 329); } while (0); } while (0); > if (charset_coll == 0) { > charset_coll = data_mysql_default_charset_coll; > } > type->prtype = dtype_form_prtype(type->prtype, charset_coll); > } > dtype_set_mblen(type); >} >static inline >ulint >dtype_get_fixed_size( > dtype_t* type) >{ > ulint mtype; > mtype = dtype_get_mtype(type); > switch (mtype) { > case 8: > case 2: > case 3: > case 6: > case 9: > case 10: > return(dtype_get_len(type)); > case 13: > if (type->prtype & 1024) { > return(dtype_get_len(type)); > } else { > ulint mbminlen, mbmaxlen; > innobase_get_cset_width( > dtype_get_charset_coll(type->prtype), > &mbminlen, &mbmaxlen); > if (__builtin_expect(type->mbminlen != mbminlen, (0)) > || __builtin_expect(type->mbmaxlen != mbmaxlen, (0))) { > ut_print_timestamp(stderr); > fprintf(stderr, " InnoDB: " > "mbminlen=%lu, " > "mbmaxlen=%lu, " > "type->mbminlen=%lu, " > "type->mbmaxlen=%lu\n", > (ulong) mbminlen, > (ulong) mbmaxlen, > (ulong) type->mbminlen, > (ulong) type->mbmaxlen); > } > if (mbminlen == mbmaxlen) { > return(dtype_get_len(type)); > } > } > case 1: > case 4: > case 11: > case 12: > case 5: > return(0); > default: do { ut_dbg_assertion_failed(0, "./../include/data0type.ic", (ulint) 430); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } > return(0); >} >static inline >ulint >dtype_get_min_size( > const dtype_t* type) >{ > switch (type->mtype) { > case 8: > case 2: > case 3: > case 6: > case 9: > case 10: > return(type->len); > case 13: > if ((type->prtype & 1024) > || type->mbminlen == type->mbmaxlen) { > return(type->len); > } > do { if (__builtin_expect(!((ulint)(type->mbminlen > 0)), (0))) { ut_dbg_assertion_failed("type->mbminlen > 0", "./../include/data0type.ic", (ulint) 478); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/data0type.ic", (ulint) 478); } while (0); } while (0); > do { if (__builtin_expect(!((ulint)(type->mbmaxlen > type->mbminlen)), (0))) { ut_dbg_assertion_failed("type->mbmaxlen > type->mbminlen", "./../include/data0type.ic", (ulint) 479); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/data0type.ic", (ulint) 479); } while (0); } while (0); > do { if (__builtin_expect(!((ulint)(type->len % type->mbmaxlen == 0)), (0))) { ut_dbg_assertion_failed("type->len % type->mbmaxlen == 0", "./../include/data0type.ic", (ulint) 480); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/data0type.ic", (ulint) 480); } while (0); } while (0); > return(type->len * type->mbminlen / type->mbmaxlen); > case 1: > case 4: > case 11: > case 12: > case 5: > return(0); > default: do { ut_dbg_assertion_failed(0, "./../include/data0type.ic", (ulint) 488); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } > return(0); >} >static inline >ulint >dtype_get_sql_null_size( > dtype_t* type) >{ > return(dtype_get_fixed_size(type)); >} >static inline >ulint >dtype_is_fixed_size( > dtype_t* type) >{ > ulint size; > size = dtype_get_fixed_size(type); > if (size) { > return((1)); > } > return((0)); >} >typedef struct dfield_struct dfield_t; >typedef struct dtuple_struct dtuple_t; > > >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))); >extern void *memchr (__const void *__s, int __c, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > >extern void *rawmemchr (__const void *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); >extern void *memrchr (__const void *__s, int __c, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > >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))); > >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))); > >extern char *strchr (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); >extern char *strrchr (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > >extern char *strchrnul (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > >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))); >extern char *strpbrk (__const char *__s, __const char *__accept) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); >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))); >extern char *strcasestr (__const char *__haystack, __const char *__needle) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); >extern void *memmem (__const void *__haystack, size_t __haystacklen, > __const void *__needle, size_t __needlelen) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3))); >extern void *__mempcpy (void *__restrict __dest, > __const void *__restrict __src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); >extern void *mempcpy (void *__restrict __dest, > __const void *__restrict __src, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); > >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__)); > >extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); >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))); >extern char *index (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); >extern char *rindex (__const char *__s, int __c) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); >extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >extern int ffsl (long int __l) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >__extension__ extern int ffsll (long long int __ll) > __attribute__ ((__nothrow__)) __attribute__ ((__const__)); >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))); >extern int strcasecmp_l (__const char *__s1, __const char *__s2, > __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); >extern int strncasecmp_l (__const char *__s1, __const char *__s2, > size_t __n, __locale_t __loc) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 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))); >extern int strverscmp (__const char *__s1, __const char *__s2) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); >extern char *strfry (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern char *basename (__const char *__filename) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >typedef struct { unsigned char __arr[2]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR2; >typedef struct { unsigned char __arr[3]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR3; >typedef struct { unsigned char __arr[4]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR4; >typedef struct { unsigned char __arr[5]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR5; >typedef struct { unsigned char __arr[6]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR6; >typedef struct { unsigned char __arr[7]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR7; >typedef struct { unsigned char __arr[8]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR8; >extern void *__rawmemchr (const void *__s, int __c); >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; >} >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; >} >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; >} >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; >} >extern char *__strsep_g (char **__stringp, __const char *__delim); >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; >} >extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); >extern char *__strndup (__const char *__string, size_t __n) > __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); >extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters"))); >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 *__restrict __dest, __const void *__restrict __src, size_t __len) >{ > return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void * >__attribute__ ((__nothrow__)) mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) >{ > return __builtin___mempcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); >} >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 *__restrict __src, void *__restrict __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)); >} >extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char * >__attribute__ ((__nothrow__)) stpcpy (char *__restrict __dest, __const char *__restrict __src) >{ > return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1)); >} >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)); >} > >extern ulint ut_total_allocated_memory; >static inline >void* >ut_memcpy(void* dest, const void* sour, ulint n); >static inline >void* >ut_memmove(void* dest, const void* sour, ulint n); >static inline >int >ut_memcmp(const void* str1, const void* str2, ulint n); >void* >ut_malloc_low( > ulint n, > ulint set_to_zero, > ulint assert_on_error); >void* >ut_malloc( > ulint n); >ulint >ut_test_malloc( > ulint n); >void >ut_free( > void* ptr); >void* >ut_realloc( > void* ptr, > ulint size); >void >ut_free_all_mem(void); >static inline >char* >ut_strcpy(char* dest, const char* sour); >static inline >ulint >ut_strlen(const char* str); >static inline >int >ut_strcmp(const void* str1, const void* str2); >ulint >ut_strlcpy( > char* dst, > const char* src, > ulint size); >ulint >ut_strlcpy_rev( > char* dst, > const char* src, > ulint size); >static inline >ulint >ut_strlenq( > const char* str, > char q); >char* >ut_strcpyq( > char* dest, > char q, > const char* src); >char* >ut_memcpyq( > char* dest, > char q, > const char* src, > ulint len); >static inline >void* >ut_memcpy(void* dest, const void* sour, ulint n) >{ > return(memcpy(dest, sour, n)); >} >static inline >void* >ut_memmove(void* dest, const void* sour, ulint n) >{ > return(memmove(dest, sour, n)); >} >static inline >int >ut_memcmp(const void* str1, const void* str2, ulint n) >{ > return(memcmp(str1, str2, n)); >} >static inline >char* >ut_strcpy(char* dest, const char* sour) >{ > return(strcpy(dest, sour)); >} >static inline >ulint >ut_strlen(const char* str) >{ > return(strlen(str)); >} >static inline >int >ut_strcmp(const void* str1, const void* str2) >{ > return(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ((const char*)str1) && __builtin_constant_p ((const char*)str2) && (__s1_len = strlen ((const char*)str1), __s2_len = strlen ((const char*)str2), (!((size_t)(const void *)(((const char*)str1) + 1) - (size_t)(const void *)((const char*)str1) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(((const char*)str2) + 1) - (size_t)(const void *)((const char*)str2) == 1) || __s2_len >= 4)) ? __builtin_strcmp ((const char*)str1, (const char*)str2) : (__builtin_constant_p ((const char*)str1) && ((size_t)(const void *)(((const char*)str1) + 1) - (size_t)(const void *)((const char*)str1) == 1) && (__s1_len = strlen ((const char*)str1), __s1_len < 4) ? (__builtin_constant_p ((const char*)str2) && ((size_t)(const void *)(((const char*)str2) + 1) - (size_t)(const void *)((const char*)str2) == 1) ? __builtin_strcmp ((const char*)str1, (const char*)str2) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ((const char*)str2); register int __result = (((__const unsigned char *) (__const char *) ((const char*)str1))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((const char*)str1))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((const char*)str1))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ((const char*)str1))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ((const char*)str2) && ((size_t)(const void *)(((const char*)str2) + 1) - (size_t)(const void *)((const char*)str2) == 1) && (__s2_len = strlen ((const char*)str2), __s2_len < 4) ? (__builtin_constant_p ((const char*)str1) && ((size_t)(const void *)(((const char*)str1) + 1) - (size_t)(const void *)((const char*)str1) == 1) ? __builtin_strcmp ((const char*)str1, (const char*)str2) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ((const char*)str1); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ((const char*)str2))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ((const char*)str2))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ((const char*)str2))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ((const char*)str2))[3]); } } __result; }))) : __builtin_strcmp ((const char*)str1, (const char*)str2)))); })); >} >static inline >ulint >ut_strlenq( > const char* str, > char q) >{ > ulint len; > for (len = 0; *str; len++, str++) { > if (*str == q) { > len++; > } > } > return(len); >} >static inline >void >ut_rnd_set_seed( > ulint seed); >static inline >ulint >ut_rnd_gen_next_ulint( > ulint rnd); >static inline >ulint >ut_rnd_gen_ulint(void); >static inline >ulint >ut_rnd_interval( > ulint low, > ulint high); >static inline >ulint >ut_rnd_gen_ibool(void); >static inline >ulint >ut_hash_ulint( > ulint key, > ulint table_size); >static inline >ulint >ut_fold_ulint_pair( > ulint n1, > ulint n2); >static inline >ulint >ut_fold_dulint( > dulint d); >static inline >ulint >ut_fold_string( > const char* str); >static inline >ulint >ut_fold_binary( > const unsigned char* str, > ulint len); >ulint >ut_find_prime( > ulint n); >extern ulint ut_rnd_ulint_counter; >static inline >void >ut_rnd_set_seed( > ulint seed) >{ > ut_rnd_ulint_counter = seed; >} >static inline >ulint >ut_rnd_gen_next_ulint( > ulint rnd) >{ > ulint n_bits; > n_bits = 8 * sizeof(ulint); > rnd = 119785373 * rnd + 126792457; > rnd = 187678878 ^ rnd; > rnd = (rnd << 20) + (rnd >> (n_bits - 20)); > rnd = 85689495 * rnd + 63498502; > rnd = 143537923 ^ rnd; > rnd = (rnd << 20) + (rnd >> (n_bits - 20)); > rnd = 151117737 * rnd + 98781234; > return(rnd); >} >static inline >ulint >ut_rnd_gen_ulint(void) >{ > ulint rnd; > ulint n_bits; > n_bits = 8 * sizeof(ulint); > ut_rnd_ulint_counter = > 151117737 * ut_rnd_ulint_counter + 119785373; > rnd = ut_rnd_gen_next_ulint(ut_rnd_ulint_counter); > return(rnd); >} >static inline >ulint >ut_rnd_interval( > ulint low, > ulint high) >{ > ulint rnd; > ; > if (low == high) { > return(low); > } > rnd = ut_rnd_gen_ulint(); > return(low + (rnd % (high - low + 1))); >} >static inline >ulint >ut_rnd_gen_ibool(void) >{ > ulint x; > x = ut_rnd_gen_ulint(); > if (((x >> 20) + (x >> 15)) & 1) { > return((1)); > } > return((0)); >} >static inline >ulint >ut_hash_ulint( > ulint key, > ulint table_size) >{ > key = key ^ 1653893711; > return(key % table_size); >} >static inline >ulint >ut_fold_ulint_pair( > ulint n1, > ulint n2) >{ > return(((((n1 ^ n2 ^ 1653893711) << 8) + n1) > ^ 1463735687) + n2); >} >static inline >ulint >ut_fold_dulint( > dulint d) >{ > return(ut_fold_ulint_pair(ut_dulint_get_low(d), > ut_dulint_get_high(d))); >} >static inline >ulint >ut_fold_string( > const char* str) >{ > ulint fold = 0; > ; > while (*str != '\0') { > fold = ut_fold_ulint_pair(fold, (ulint)(*str)); > str++; > } > return(fold); >} >static inline >ulint >ut_fold_binary( > const unsigned char* str, > ulint len) >{ > const unsigned char* str_end = str + len; > ulint fold = 0; > ; > while (str < str_end) { > fold = ut_fold_ulint_pair(fold, (ulint)(*str)); > str++; > } > return(fold); >} >typedef struct mutex_struct ib_mutex_t; >typedef pthread_mutex_t os_fast_mutex_t; >typedef struct os_event_struct os_event_struct_t; >typedef os_event_struct_t* os_event_t; >struct os_event_struct { > os_fast_mutex_t os_mutex; > ulint is_set; > ib_longlong signal_count; > pthread_cond_t cond_var; > struct { os_event_struct_t * prev; os_event_struct_t * next; } os_event_list; >}; >typedef struct os_mutex_struct os_mutex_str_t; >typedef os_mutex_str_t* os_mutex_t; >extern os_mutex_t os_sync_mutex; >extern ulint os_thread_count; >extern ulint os_event_count; >extern ulint os_mutex_count; >extern ulint os_fast_mutex_count; >void >os_sync_init(void); >void >os_sync_free(void); >os_event_t >os_event_create( > const char* name); >void >os_event_set( > os_event_t event); >ib_longlong >os_event_reset( > os_event_t event); >void >os_event_free( > os_event_t event); >void >os_event_wait_low( > os_event_t event, > ib_longlong reset_sig_count); >ulint >os_event_wait_time( > os_event_t event, > ulint time); >os_mutex_t >os_mutex_create( > const char* name); >void >os_mutex_enter( > os_mutex_t mutex); >void >os_mutex_exit( > os_mutex_t mutex); >void >os_mutex_free( > os_mutex_t mutex); >static inline >ulint >os_fast_mutex_trylock( > os_fast_mutex_t* fast_mutex); >void >os_fast_mutex_unlock( > os_fast_mutex_t* fast_mutex); >void >os_fast_mutex_init( > os_fast_mutex_t* fast_mutex); >void >os_fast_mutex_lock( > os_fast_mutex_t* fast_mutex); >void >os_fast_mutex_free( > os_fast_mutex_t* fast_mutex); >static inline >ulint >os_fast_mutex_trylock( > os_fast_mutex_t* fast_mutex) >{ > return((ulint) pthread_mutex_trylock(fast_mutex)); >} >typedef struct sync_cell_struct sync_cell_t; >typedef struct sync_array_struct sync_array_t; >sync_array_t* >sync_array_create( > ulint n_cells, > ulint protection); >void >sync_array_free( > sync_array_t* arr); >void >sync_array_reserve_cell( > sync_array_t* arr, > void* object, > ulint type, > const char* file, > ulint line, > ulint* index); >void >sync_array_wait_event( > sync_array_t* arr, > ulint index); >void >sync_array_free_cell( > sync_array_t* arr, > ulint index); >void >sync_array_object_signalled( > sync_array_t* arr); >void >sync_arr_wake_threads_if_sema_free(void); >ulint >sync_array_print_long_waits(void); >void >sync_array_validate( > sync_array_t* arr); >void >sync_array_print_info( > FILE* file, > sync_array_t* arr); >extern my_bool timed_mutexes; >void >sync_init(void); >void >sync_close(void); >void >mutex_create_func( > ib_mutex_t* mutex, > const char* cfile_name, > ulint cline); >void >mutex_free( > ib_mutex_t* mutex); >void >mutex_enter_noninline( > ib_mutex_t* mutex); >static inline >void >mutex_enter_func( > ib_mutex_t* mutex, > const char* file_name, > ulint line); >ulint >mutex_enter_nowait( > ib_mutex_t* mutex, > const char* file_name, > ulint line); >static inline >void >mutex_exit( > ib_mutex_t* mutex); >void >mutex_exit_noninline( > ib_mutex_t* mutex); >ulint >sync_all_freed(void); >void >sync_print_wait_info( > FILE* file); >void >sync_print( > FILE* file); >ulint >mutex_validate( > ib_mutex_t* mutex); >void >mutex_set_level( > ib_mutex_t* mutex, > ulint level); >void >sync_thread_add_level( > void* latch, > ulint level); >ulint >sync_thread_reset_level( > void* latch); >ulint >sync_thread_levels_empty(void); >ulint >sync_thread_levels_empty_gen( > ulint dict_mutex_allowed); >static inline >ulint >mutex_get_lock_word( > ib_mutex_t* mutex); >struct mutex_struct { > os_event_t event; > ulint lock_word; > os_fast_mutex_t > os_fast_mutex; > ulint waiters; > struct { ib_mutex_t * prev; ib_mutex_t * next; } list; > ulint level; > const char* cfile_name; > ulint cline; > ulint magic_n; > ulong count_os_wait; >}; >extern sync_array_t* sync_primary_wait_array; >extern ulint mutex_system_call_count; >extern ulint mutex_exit_count; >extern ulint sync_order_checks_on; >extern ulint sync_initialized; >typedef struct { ulint count; ib_mutex_t * start; ib_mutex_t * end; } ut_list_base_node_t; >extern ut_list_base_node_t mutex_list; >extern ib_mutex_t mutex_list_mutex; >void >mutex_set_waiters( > ib_mutex_t* mutex, > ulint n); >void >mutex_spin_wait( > ib_mutex_t* mutex, > const char* file_name, > ulint line); >void >mutex_signal_object( > ib_mutex_t* mutex); >static inline >ulint >mutex_test_and_set( > ib_mutex_t* mutex) >{ > ulint ret; > ret = os_fast_mutex_trylock(&(mutex->os_fast_mutex)); > if (ret == 0) { > do { if (__builtin_expect(!((ulint)(mutex->lock_word == 0)), (0))) { ut_dbg_assertion_failed("mutex->lock_word == 0", "./../include/sync0sync.ic", (ulint) 111); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/sync0sync.ic", (ulint) 111); } while (0); } while (0); > mutex->lock_word = 1; > } > return(ret); >} >static inline >void >mutex_reset_lock_word( > ib_mutex_t* mutex) >{ > mutex->lock_word = 0; > os_fast_mutex_unlock(&(mutex->os_fast_mutex)); >} >static inline >ulint >mutex_get_lock_word( > ib_mutex_t* mutex) >{ >volatile ulint* ptr; > ; > ptr = &(mutex->lock_word); > return(*ptr); >} >static inline >ulint >mutex_get_waiters( > ib_mutex_t* mutex) >{ >volatile ulint* ptr; > ; > ptr = &(mutex->waiters); > return(*ptr); >} >static inline >void >mutex_exit( > ib_mutex_t* mutex) >{ > mutex_reset_lock_word(mutex); > if (mutex_get_waiters(mutex) != 0) { > mutex_signal_object(mutex); > } >} >static inline >void >mutex_enter_func( > ib_mutex_t* mutex, > const char* file_name, > ulint line) >{ > ; > if (!mutex_test_and_set(mutex)) > { > return; > } > mutex_spin_wait(mutex, file_name, line); >} >typedef struct mem_block_info_struct mem_block_info_t; >typedef mem_block_info_t mem_block_t; >typedef mem_block_t mem_heap_t; >void >mem_init( > ulint size); >static inline >mem_heap_t* >mem_heap_create_func( > ulint n, > void* init_block, > ulint type, > const char* file_name, > ulint line > ); >static inline >void >mem_heap_free_func( > mem_heap_t* heap, > const char* file_name, > ulint line); >static inline >void* >mem_heap_alloc( > mem_heap_t* heap, > ulint n); >static inline >unsigned char* >mem_heap_get_heap_top( > mem_heap_t* heap); >static inline >void >mem_heap_free_heap_top( > mem_heap_t* heap, > unsigned char* old_top); >static inline >void >mem_heap_empty( > mem_heap_t* heap); >static inline >void* >mem_heap_get_top( > mem_heap_t* heap, > ulint n); >static inline >void >mem_heap_free_top( > mem_heap_t* heap, > ulint n); >static inline >ulint >mem_heap_get_size( > mem_heap_t* heap); >static inline >void* >mem_alloc_func( > ulint n, > const char* file_name, > ulint line >); >void* >mem_alloc_func_noninline( > ulint n, > const char* file_name, > ulint line > ); >static inline >void >mem_free_func( > void* ptr, > const char* file_name, > ulint line >); >static inline >char* >mem_strdup( > const char* str); >static inline >char* >mem_strdupl( > const char* str, > ulint len); >static inline >char* >mem_strdupq( > const char* str, > char q); >char* >mem_heap_strdup( > mem_heap_t* heap, > const char* str); >static inline >char* >mem_heap_strdupl( > mem_heap_t* heap, > const char* str, > ulint len); >struct mem_block_info_struct { > ulint magic_n; > char file_name[8]; > ulint line; > struct { ulint count; mem_block_t * start; mem_block_t * end; } base; > struct { mem_block_t * prev; mem_block_t * next; } list; > ulint len; > ulint type; > ulint init_block; > ulint free; > ulint start; > unsigned char* free_block; >}; >void >mem_heap_validate_or_print( > mem_heap_t* heap, > unsigned char* top, > ulint print, > ulint* error, > ulint* us_size, > ulint* ph_size, > ulint* n_blocks); >ulint >mem_heap_check( > mem_heap_t* heap); >ulint >mem_heap_validate( > mem_heap_t* heap); >void >mem_analyze_corruption( > unsigned char* ptr); >void >mem_print_info(void); >void >mem_print_new_info(void); > >struct dirent > { > __ino64_t d_ino; > __off64_t d_off; > unsigned short int d_reclen; > unsigned char d_type; > char d_name[256]; > }; >struct dirent64 > { > __ino64_t d_ino; > __off64_t d_off; > unsigned short int d_reclen; > unsigned char d_type; > char d_name[256]; > }; >enum > { > DT_UNKNOWN = 0, > DT_FIFO = 1, > DT_CHR = 2, > DT_DIR = 4, > DT_BLK = 6, > DT_REG = 8, > DT_LNK = 10, > DT_SOCK = 12, > DT_WHT = 14 > }; >typedef struct __dirstream DIR; >extern DIR *opendir (__const char *__name) __attribute__ ((__nonnull__ (1))); >extern DIR *fdopendir (int __fd); >extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1))); >extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64") > __attribute__ ((__nonnull__ (1))); >extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1))); >extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r") __attribute__ ((__nonnull__ (1, 2, 3))); >extern int readdir64_r (DIR *__restrict __dirp, > struct dirent64 *__restrict __entry, > struct dirent64 **__restrict __result) > __attribute__ ((__nonnull__ (1, 2, 3))); >extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); >extern int scandir (__const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (__const struct dirent *), int (*__cmp) (__const struct dirent **, __const struct dirent **)) __asm__ ("" "scandir64") __attribute__ ((__nonnull__ (1, 2))); >extern int scandir64 (__const char *__restrict __dir, > struct dirent64 ***__restrict __namelist, > int (*__selector) (__const struct dirent64 *), > int (*__cmp) (__const struct dirent64 **, > __const struct dirent64 **)) > __attribute__ ((__nonnull__ (1, 2))); >extern int alphasort (__const struct dirent **__e1, __const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); >extern int alphasort64 (__const struct dirent64 **__e1, > __const struct dirent64 **__e2) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); >extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); >extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf, > size_t __nbytes, > __off64_t *__restrict __basep) > __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); >extern int versionsort (__const struct dirent **__e1, __const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__)) > __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); >extern int versionsort64 (__const struct dirent64 **__e1, > __const struct dirent64 **__e2) > __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > >typedef struct fil_node_struct fil_node_t; >extern ulint os_has_said_disk_full; >extern ulint os_aio_print_debug; >extern ulint os_file_n_pending_preads; >extern ulint os_file_n_pending_pwrites; >extern ulint os_n_pending_reads; >extern ulint os_n_pending_writes; >typedef int os_file_t; >extern ulint os_innodb_umask; >extern ulint os_aio_use_native_aio; >extern ulint os_n_file_reads; >extern ulint os_n_file_writes; >extern ulint os_n_fsyncs; >enum os_file_type_enum{ > OS_FILE_TYPE_UNKNOWN = 0, > OS_FILE_TYPE_FILE, > OS_FILE_TYPE_DIR, > OS_FILE_TYPE_LINK >}; >typedef enum os_file_type_enum os_file_type_t; >struct os_file_stat_struct{ > char name[4000]; > os_file_type_t type; > ib_longlong size; > time_t ctime; > time_t mtime; > time_t atime; >}; >typedef struct os_file_stat_struct os_file_stat_t; >typedef DIR* os_file_dir_t; >ulint >os_get_os_version(void); >void >os_io_init_simple(void); >FILE* >os_file_create_tmpfile(void); >os_file_dir_t >os_file_opendir( > const char* dirname, > ulint error_is_fatal); >int >os_file_closedir( > os_file_dir_t dir); >int >os_file_readdir_next_file( > const char* dirname, > os_file_dir_t dir, > os_file_stat_t* info); >ulint >os_file_create_directory( > const char* pathname, > ulint fail_if_exists); >os_file_t >os_file_create_simple( > const char* name, > ulint create_mode, > ulint access_type, > ulint* success); >os_file_t >os_file_create_simple_no_error_handling( > const char* name, > ulint create_mode, > ulint access_type, > ulint* success); >os_file_t >os_file_create( > const char* name, > ulint create_mode, > ulint purpose, > ulint type, > ulint* success); >ulint >os_file_delete( > const char* name); >ulint >os_file_delete_if_exists( > const char* name); >ulint >os_file_rename( > const char* oldpath, > const char* newpath); >ulint >os_file_close( > os_file_t file); >ulint >os_file_close_no_error_handling( > os_file_t file); >ulint >os_file_get_size( > os_file_t file, > ulint* size, > ulint* size_high); >ib_longlong >os_file_get_size_as_iblonglong( > os_file_t file); >ulint >os_file_set_size( > const char* name, > os_file_t file, > ulint size, > ulint size_high); >ulint >os_file_set_eof( > FILE* file); >ulint >os_file_flush( > os_file_t file); >ulint >os_file_get_last_error( > ulint report_all_errors); >ulint >os_file_read( > os_file_t file, > void* buf, > ulint offset, > ulint offset_high, > ulint n); >void >os_file_read_string( > FILE* file, > char* str, > ulint size); >ulint >os_file_read_no_error_handling( > os_file_t file, > void* buf, > ulint offset, > ulint offset_high, > ulint n); >ulint >os_file_write( > const char* name, > os_file_t file, > const void* buf, > ulint offset, > ulint offset_high, > ulint n); >ulint >os_file_status( > const char* path, > ulint* exists, > os_file_type_t* type); >char* >os_file_dirname( > const char* path); >ulint >os_file_create_subdirs_if_needed( > const char* path); >void >os_aio_init( > ulint n, > ulint n_segments, > ulint n_slots_sync); >ulint >os_aio( > ulint type, > ulint mode, > const char* name, > os_file_t file, > void* buf, > ulint offset, > ulint offset_high, > ulint n, > fil_node_t* message1, > void* message2); >void >os_aio_wake_all_threads_at_shutdown(void); >void >os_aio_wait_until_no_pending_writes(void); >void >os_aio_simulated_wake_handler_threads(void); >void >os_aio_simulated_put_read_threads_to_sleep(void); >ulint >os_aio_simulated_handle( > ulint segment, > fil_node_t**message1, > void** message2, > ulint* type); >ulint >os_aio_validate(void); >void >os_aio_print( > FILE* file); >void >os_aio_refresh_stats(void); >ulint >os_file_get_status( > const char* path, > os_file_stat_t* stat_info); >typedef struct mem_area_struct mem_area_t; >typedef struct mem_pool_struct mem_pool_t; >extern mem_pool_t* mem_comm_pool; >struct mem_area_struct{ > ulint size_and_free; > struct { mem_area_t * prev; mem_area_t * next; } > free_list; >}; >mem_pool_t* >mem_pool_create( > ulint size); >void* >mem_area_alloc( > ulint size, > mem_pool_t* pool); >void >mem_area_free( > void* ptr, > mem_pool_t* pool); >ulint >mem_pool_get_reserved( > mem_pool_t* pool); >void >mem_pool_mutex_enter(void); >void >mem_pool_mutex_exit(void); >ulint >mem_pool_validate( > mem_pool_t* pool); >void >mem_pool_print_info( > FILE* outfile, > mem_pool_t* pool); >mem_block_t* >mem_heap_create_block( > mem_heap_t* heap, > ulint n, > void* init_block, > ulint type, > const char* file_name, > ulint line); >void >mem_heap_block_free( > mem_heap_t* heap, > mem_block_t* block); >void >mem_heap_free_block_free( > mem_heap_t* heap); >mem_block_t* >mem_heap_add_block( > mem_heap_t* heap, > ulint n); >static inline >void >mem_block_set_len(mem_block_t* block, ulint len) >{ > ; > block->len = len; >} >static inline >ulint >mem_block_get_len(mem_block_t* block) >{ > return(block->len); >} >static inline >void >mem_block_set_type(mem_block_t* block, ulint type) >{ > ; > block->type = type; >} >static inline >ulint >mem_block_get_type(mem_block_t* block) >{ > return(block->type); >} >static inline >void >mem_block_set_free(mem_block_t* block, ulint free) >{ > ; > ; > block->free = free; >} >static inline >ulint >mem_block_get_free(mem_block_t* block) >{ > return(block->free); >} >static inline >void >mem_block_set_start(mem_block_t* block, ulint start) >{ > ; > block->start = start; >} >static inline >ulint >mem_block_get_start(mem_block_t* block) >{ > return(block->start); >} >static inline >void* >mem_heap_alloc( > mem_heap_t* heap, > ulint n) >{ > mem_block_t* block; > void* buf; > ulint free; > ; > block = (heap->base).end; > ; > if (mem_block_get_len(block) > < mem_block_get_free(block) + ut_calc_align((n), 8)) { > block = mem_heap_add_block(heap, n); > if (block == ((void *)0)) { > return(((void *)0)); > } > } > free = mem_block_get_free(block); > buf = (unsigned char*)block + free; > mem_block_set_free(block, free + ut_calc_align((n), 8)); > return(buf); >} >static inline >unsigned char* >mem_heap_get_heap_top( > mem_heap_t* heap) >{ > mem_block_t* block; > unsigned char* buf; > ; > block = (heap->base).end; > buf = (unsigned char*)block + mem_block_get_free(block); > return(buf); >} >static inline >void >mem_heap_free_heap_top( > mem_heap_t* heap, > unsigned char* old_top) >{ > mem_block_t* block; > mem_block_t* prev_block; > ; > block = (heap->base).end; > while (block != ((void *)0)) { > if (((unsigned char*)block + mem_block_get_free(block) >= old_top) > && ((unsigned char*)block <= old_top)) { > break; > } > prev_block = (((block)->list).prev); > mem_heap_block_free(heap, block); > block = prev_block; > } > ; > mem_block_set_free(block, old_top - (unsigned char*)block); > if ((heap != block) && (mem_block_get_free(block) == > mem_block_get_start(block))) { > mem_heap_block_free(heap, block); > } >} >static inline >void >mem_heap_empty( > mem_heap_t* heap) >{ > mem_heap_free_heap_top(heap, (unsigned char*)heap + mem_block_get_start(heap)); > if (heap->free_block) { > mem_heap_free_block_free(heap); > } >} >static inline >void* >mem_heap_get_top( > mem_heap_t* heap, > ulint n) >{ > mem_block_t* block; > void* buf; > ; > block = (heap->base).end; > buf = (unsigned char*)block + mem_block_get_free(block) - ut_calc_align((n), 8); > return(buf); >} >static inline >void >mem_heap_free_top( > mem_heap_t* heap, > ulint n) >{ > mem_block_t* block; > ; > block = (heap->base).end; > mem_block_set_free(block, mem_block_get_free(block) > - ut_calc_align((n), 8)); > if ((heap != block) && (mem_block_get_free(block) == > mem_block_get_start(block))) { > mem_heap_block_free(heap, block); > } >} >static inline >mem_heap_t* >mem_heap_create_func( > ulint n, > void* init_block, > ulint type, > const char* file_name, > ulint line > ) >{ > mem_block_t* block; > if (n > 0) { > block = mem_heap_create_block(((void *)0), n, init_block, type, > file_name, line); > } else { > block = mem_heap_create_block(((void *)0), 64, > init_block, type, file_name, line); > } > ; > { (block->base).count = 0; (block->base).start = ((void *)0); (block->base).end = ((void *)0);}; > { ; ((block->base).count)++; ((block)->list).next = (block->base).start; ((block)->list).prev = ((void *)0); if ((block->base).start != ((void *)0)) { (((block->base).start)->list).prev = (block); } (block->base).start = (block); if ((block->base).end == ((void *)0)) { (block->base).end = (block); }}; > return(block); >} >static inline >void >mem_heap_free_func( > mem_heap_t* heap, > const char* file_name __attribute__((unused)), > ulint line __attribute__((unused))) >{ > mem_block_t* block; > mem_block_t* prev_block; > ; > block = (heap->base).end; > if (heap->free_block) { > mem_heap_free_block_free(heap); > } > while (block != ((void *)0)) { > prev_block = (((block)->list).prev); > mem_heap_block_free(heap, block); > block = prev_block; > } >} >static inline >void* >mem_alloc_func( > ulint n, > const char* file_name, > ulint line > ) >{ > mem_heap_t* heap; > void* buf; > heap = mem_heap_create_func(n, ((void *)0), 0, file_name, > line); > if (heap == ((void *)0)) { > return(((void *)0)); > } > buf = mem_heap_alloc(heap, n); > do { if (__builtin_expect(!((ulint)((unsigned char*)heap == (unsigned char*)buf - ut_calc_align(sizeof(mem_block_info_t), 8) - 0)), (0))) { ut_dbg_assertion_failed("(byte*)heap == (byte*)buf - MEM_BLOCK_HEADER_SIZE - MEM_FIELD_HEADER_SIZE", "./../include/mem0mem.ic", (ulint) 512); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/mem0mem.ic", (ulint) 512); } while (0); } while (0); > return(buf); >} >static inline >void >mem_free_func( > void* ptr, > const char* file_name, > ulint line > ) >{ > mem_heap_t* heap; > heap = (mem_heap_t*)((unsigned char*)ptr - ut_calc_align(sizeof(mem_block_info_t), 8) > - 0); > mem_heap_free_func(heap, file_name, line); >} >static inline >ulint >mem_heap_get_size( > mem_heap_t* heap) >{ > mem_block_t* block; > ulint size = 0; > ; > block = heap; > while (block != ((void *)0)) { > size += mem_block_get_len(block); > block = (((block)->list).next); > } > if (heap->free_block) { > size += (2 * 8192); > } > return(size); >} >static inline >char* >mem_strdup( > const char* str) >{ > ulint len = strlen(str) + 1; > return(memcpy(mem_alloc_func((len), "./../include/mem0mem.ic", 575), str, len)); >} >static inline >char* >mem_strdupl( > const char* str, > ulint len) >{ > char* s = mem_alloc_func((len + 1), "./../include/mem0mem.ic", 589); > s[len] = 0; > return(memcpy(s, str, len)); >} >static inline >char* >mem_strdupq( > const char* str, > char q) >{ > char* dst; > char* d; > const char* s = str; > size_t len = strlen(str) + 3; > while((s = (__extension__ (__builtin_constant_p (q) && !__builtin_constant_p (s) && (q) == '\0' ? (char *) __rawmemchr (s, q) : __builtin_strchr (s, q)))) != ((void *)0)) { > s++; > len++; > } > d = dst = mem_alloc_func((len), "./../include/mem0mem.ic", 615); > *d++ = q; > s = str; > while(*s) { > if ((*d++ = *s++) == q) { > *d++ = q; > } > } > *d++ = q; > *d++ = '\0'; > ; > return(dst); >} >static inline >char* >mem_heap_strdupl( > mem_heap_t* heap, > const char* str, > ulint len) >{ > char* s = mem_heap_alloc(heap, len + 1); > s[len] = 0; > return(memcpy(s, str, len)); >} >typedef struct big_rec_struct big_rec_t; >void >dfield_set_data_noninline( > dfield_t* field, > void* data, > ulint len); >void* >dfield_get_data_noninline( > dfield_t* field); >ulint >dfield_get_len_noninline( > dfield_t* field); >ulint >dtuple_get_n_fields_noninline( > dtuple_t* tuple); >dfield_t* >dtuple_get_nth_field_noninline( > dtuple_t* tuple, > ulint n); >static inline >dtype_t* >dfield_get_type( > dfield_t* field); >static inline >void >dfield_set_type( > dfield_t* field, > dtype_t* type); >static inline >void* >dfield_get_data( > dfield_t* field); >static inline >ulint >dfield_get_len( > dfield_t* field); >static inline >void >dfield_set_len( > dfield_t* field, > ulint len); >static inline >void >dfield_set_data( > dfield_t* field, > const void* data, > ulint len); >static inline >void >data_write_sql_null( > unsigned char* data, > ulint len); >static inline >void >dfield_copy_data( > dfield_t* field1, > dfield_t* field2); >static inline >void >dfield_copy( > dfield_t* field1, > dfield_t* field2); >static inline >ulint >dfield_datas_are_binary_equal( > dfield_t* field1, > dfield_t* field2); >ulint >dfield_data_is_binary_equal( > dfield_t* field, > ulint len, > unsigned char* data); >static inline >ulint >dtuple_get_n_fields( > dtuple_t* tuple); >static inline >dfield_t* >dtuple_get_nth_field( > dtuple_t* tuple, > ulint n); >static inline >ulint >dtuple_get_info_bits( > dtuple_t* tuple); >static inline >void >dtuple_set_info_bits( > dtuple_t* tuple, > ulint info_bits); >static inline >ulint >dtuple_get_n_fields_cmp( > dtuple_t* tuple); >static inline >void >dtuple_set_n_fields_cmp( > dtuple_t* tuple, > ulint n_fields_cmp); >static inline >dtuple_t* >dtuple_create( > mem_heap_t* heap, > ulint n_fields); >dtuple_t* >dtuple_create_for_mysql( > void** heap, > ulint n_fields); >void >dtuple_free_for_mysql( > void* heap); >void >dtuple_set_n_fields( > dtuple_t* tuple, > ulint n_fields); >static inline >ulint >dtuple_get_data_size( > dtuple_t* tuple); >ulint >dtuple_datas_are_ordering_equal( > dtuple_t* tuple1, > dtuple_t* tuple2); >static inline >ulint >dtuple_fold( > dtuple_t* tuple, > ulint n_fields, > ulint n_bytes, > dulint tree_id); >static inline >void >dtuple_set_types_binary( > dtuple_t* tuple, > ulint n); >static inline >ulint >dtuple_contains_null( > dtuple_t* tuple); >ulint >dfield_check_typed( > dfield_t* field); >ulint >dtuple_check_typed( > dtuple_t* tuple); >ulint >dtuple_check_typed_no_assert( > dtuple_t* tuple); >void >dfield_print( > dfield_t* dfield); >void >dfield_print_also_hex( > dfield_t* dfield); >void >dtuple_print( > FILE* f, > dtuple_t* tuple); >big_rec_t* >dtuple_convert_big_rec( > dict_index_t* index, > dtuple_t* entry, > ulint* ext_vec, > ulint n_ext_vec); >void >dtuple_convert_back_big_rec( > dict_index_t* index, > dtuple_t* entry, > big_rec_t* vector); >void >dtuple_big_rec_free( > big_rec_t* vector); >struct dfield_struct{ > void* data; > ulint len; > dtype_t type; >}; >struct dtuple_struct { > ulint info_bits; > ulint n_fields; > ulint n_fields_cmp; > dfield_t* fields; > struct { dtuple_t * prev; dtuple_t * next; } tuple_list; > ulint magic_n; >}; >typedef struct big_rec_field_struct big_rec_field_t; >struct big_rec_field_struct { > ulint field_no; > ulint len; > unsigned char* data; >}; >struct big_rec_struct { > mem_heap_t* heap; > ulint n_fields; > big_rec_field_t* fields; >}; >extern unsigned char data_error; >static inline >dtype_t* >dfield_get_type( > dfield_t* field) >{ > ; > return(&(field->type)); >} >static inline >void >dfield_set_type( > dfield_t* field, > dtype_t* type) >{ > ; > field->type = *type; >} >static inline >void* >dfield_get_data( > dfield_t* field) >{ > ; > ; > return(field->data); >} >static inline >ulint >dfield_get_len( > dfield_t* field) >{ > ; > ; > return(field->len); >} >static inline >void >dfield_set_len( > dfield_t* field, > ulint len) >{ > ; > field->len = len; >} >static inline >void >dfield_set_data( > dfield_t* field, > const void* data, > ulint len) >{ > ; > field->data = (void*) data; > field->len = len; >} >static inline >void >dfield_copy_data( > dfield_t* field1, > dfield_t* field2) >{ > ; > field1->data = field2->data; > field1->len = field2->len; >} >static inline >void >dfield_copy( > dfield_t* field1, > dfield_t* field2) >{ > *field1 = *field2; >} >static inline >ulint >dfield_datas_are_binary_equal( > dfield_t* field1, > dfield_t* field2) >{ > ulint len; > len = field1->len; > if ((len != field2->len) > || ((len != 0xFFFFFFFF) > && (0 != ut_memcmp(field1->data, field2->data, len)))) { > return((0)); > } > return((1)); >} >static inline >ulint >dtuple_get_info_bits( > dtuple_t* tuple) >{ > ; > return(tuple->info_bits); >} >static inline >void >dtuple_set_info_bits( > dtuple_t* tuple, > ulint info_bits) >{ > ; > tuple->info_bits = info_bits; >} >static inline >ulint >dtuple_get_n_fields_cmp( > dtuple_t* tuple) >{ > ; > return(tuple->n_fields_cmp); >} >static inline >void >dtuple_set_n_fields_cmp( > dtuple_t* tuple, > ulint n_fields_cmp) >{ > ; > ; > tuple->n_fields_cmp = n_fields_cmp; >} >static inline >ulint >dtuple_get_n_fields( > dtuple_t* tuple) >{ > ; > return(tuple->n_fields); >} >static inline >dfield_t* >dtuple_get_nth_field( > dtuple_t* tuple, > ulint n) >{ > ; > ; > return(tuple->fields + n); >} >static inline >dtuple_t* >dtuple_create( > mem_heap_t* heap, > ulint n_fields) >{ > dtuple_t* tuple; > ; > tuple = (dtuple_t*) mem_heap_alloc(heap, sizeof(dtuple_t) > + n_fields * sizeof(dfield_t)); > tuple->info_bits = 0; > tuple->n_fields = n_fields; > tuple->n_fields_cmp = n_fields; > tuple->fields = (dfield_t*)(((unsigned char*)tuple) + sizeof(dtuple_t)); > return(tuple); >} >static inline >ulint >dtuple_get_data_size( > dtuple_t* tuple) >{ > dfield_t* field; > ulint n_fields; > ulint len; > ulint i; > ulint sum = 0; > ; > ; > ; > n_fields = tuple->n_fields; > for (i = 0; i < n_fields; i++) { > field = dtuple_get_nth_field(tuple, i); > len = dfield_get_len(field); > if (len == 0xFFFFFFFF) { > len = dtype_get_sql_null_size(dfield_get_type(field)); > } > sum += len; > } > return(sum); >} >static inline >void >dtuple_set_types_binary( > dtuple_t* tuple, > ulint n) >{ > dtype_t* dfield_type; > ulint i; > for (i = 0; i < n; i++) { > dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i)); > dtype_set(dfield_type, 4, 0, 0, 0); > } >} >static inline >ulint >dtuple_fold( > dtuple_t* tuple, > ulint n_fields, > ulint n_bytes, > dulint tree_id) >{ > dfield_t* field; > ulint i; > unsigned char* data; > ulint len; > ulint fold; > ; > ; > ; > fold = ut_fold_dulint(tree_id); > for (i = 0; i < n_fields; i++) { > field = dtuple_get_nth_field(tuple, i); > data = (unsigned char*) dfield_get_data(field); > len = dfield_get_len(field); > if (len != 0xFFFFFFFF) { > fold = ut_fold_ulint_pair(fold, > ut_fold_binary(data, len)); > } > } > if (n_bytes > 0) { > field = dtuple_get_nth_field(tuple, i); > data = (unsigned char*) dfield_get_data(field); > len = dfield_get_len(field); > if (len != 0xFFFFFFFF) { > if (len > n_bytes) { > len = n_bytes; > } > fold = ut_fold_ulint_pair(fold, > ut_fold_binary(data, len)); > } > } > return(fold); >} >static inline >void >data_write_sql_null( > unsigned char* data, > ulint len) >{ > ulint j; > for (j = 0; j < len; j++) { > data[j] = '\0'; > } >} >static inline >ulint >dtuple_contains_null( > dtuple_t* tuple) >{ > ulint n; > ulint i; > n = dtuple_get_n_fields(tuple); > for (i = 0; i < n; i++) { > if (dfield_get_len(dtuple_get_nth_field(tuple, i)) > == 0xFFFFFFFF) { > return((1)); > } > } > return((0)); >} >typedef unsigned char rec_t; >typedef unsigned char ib_page_t; >typedef struct page_search_struct page_search_t; >typedef struct page_cur_struct page_cur_t; >typedef struct btr_pcur_struct btr_pcur_t; >typedef struct btr_cur_struct btr_cur_t; >typedef struct btr_search_struct btr_search_t; >typedef struct rw_lock_struct rw_lock_t; >typedef struct { ulint count; rw_lock_t * start; rw_lock_t * end; } rw_lock_list_t; >extern rw_lock_list_t rw_lock_list; >extern ib_mutex_t rw_lock_list_mutex; >extern ulint rw_s_system_call_count; >extern ulint rw_s_spin_wait_count; >extern ulint rw_s_exit_count; >extern ulint rw_s_os_wait_count; >extern ulint rw_x_system_call_count; >extern ulint rw_x_spin_wait_count; >extern ulint rw_x_os_wait_count; >extern ulint rw_x_exit_count; >void >rw_lock_create_func( > rw_lock_t* lock, > const char* cfile_name, > ulint cline); >void >rw_lock_free( > rw_lock_t* lock); >ulint >rw_lock_validate( > rw_lock_t* lock); >static inline >void >rw_lock_s_lock_func( > rw_lock_t* lock, > ulint pass, > const char* file_name, > ulint line); >static inline >ulint >rw_lock_s_lock_func_nowait( > rw_lock_t* lock, > const char* file_name, > ulint line); >static inline >ulint >rw_lock_x_lock_func_nowait( > rw_lock_t* lock, > const char* file_name, > ulint line); >static inline >void >rw_lock_s_unlock_func( > rw_lock_t* lock > ); >void >rw_lock_x_lock_func( > rw_lock_t* lock, > ulint pass, > const char* file_name, > ulint line); >static inline >void >rw_lock_x_unlock_func( > rw_lock_t* lock > ); >static inline >void >rw_lock_s_lock_direct( > rw_lock_t* lock, > const char* file_name, > ulint line >); >static inline >void >rw_lock_x_lock_direct( > rw_lock_t* lock, > const char* file_name, > ulint line >); >void >rw_lock_x_lock_move_ownership( > rw_lock_t* lock); >static inline >void >rw_lock_s_unlock_direct( > rw_lock_t* lock); >static inline >void >rw_lock_x_unlock_direct( > rw_lock_t* lock); >void >rw_lock_set_level( > rw_lock_t* lock, > ulint level); >static inline >ulint >rw_lock_get_x_lock_count( > rw_lock_t* lock); >static inline >ulint >rw_lock_get_waiters( > rw_lock_t* lock); >static inline >ulint >rw_lock_get_writer( > rw_lock_t* lock); >static inline >ulint >rw_lock_get_reader_count( > rw_lock_t* lock); >ulint >rw_lock_is_locked( > rw_lock_t* lock, > ulint lock_type); >struct rw_lock_struct { > os_event_t event; > ulint reader_count; > ulint writer; > os_thread_id_t writer_thread; > ulint writer_count; > ib_mutex_t mutex; > ulint pass; > ulint waiters; > ulint writer_is_wait_ex; > struct { rw_lock_t * prev; rw_lock_t * next; } list; > ulint level; > const char* cfile_name; > ulint cline; > const char* last_s_file_name; > const char* last_x_file_name; > ulint last_s_line; > ulint last_x_line; > ulint magic_n; >}; >void >rw_lock_s_lock_spin( > rw_lock_t* lock, > ulint pass, > const char* file_name, > ulint line); >static inline >ulint >rw_lock_get_waiters( > rw_lock_t* lock) >{ > return(lock->waiters); >} >static inline >void >rw_lock_set_waiters( > rw_lock_t* lock, > ulint flag) >{ > lock->waiters = flag; >} >static inline >ulint >rw_lock_get_writer( > rw_lock_t* lock) >{ > return(lock->writer); >} >static inline >void >rw_lock_set_writer( > rw_lock_t* lock, > ulint flag) >{ > lock->writer = flag; >} >static inline >ulint >rw_lock_get_reader_count( > rw_lock_t* lock) >{ > return(lock->reader_count); >} >static inline >void >rw_lock_set_reader_count( > rw_lock_t* lock, > ulint count) >{ > lock->reader_count = count; >} >static inline >ib_mutex_t* >rw_lock_get_mutex( > rw_lock_t* lock) >{ > return(&(lock->mutex)); >} >static inline >ulint >rw_lock_get_x_lock_count( > rw_lock_t* lock) >{ > return(lock->writer_count); >} >static inline >ulint >rw_lock_s_lock_low( > rw_lock_t* lock, > ulint pass __attribute__((unused)), > const char* file_name, > ulint line) >{ > if (__builtin_expect(lock->writer == 350, (1))) { > lock->reader_count++; > lock->last_s_file_name = file_name; > lock->last_s_line = line; > return((1)); > } > return((0)); >} >static inline >void >rw_lock_s_lock_direct( > rw_lock_t* lock, > const char* file_name, > ulint line) >{ > ; > ; > lock->reader_count++; > lock->last_s_file_name = file_name; > lock->last_s_line = line; >} >static inline >void >rw_lock_x_lock_direct( > rw_lock_t* lock, > const char* file_name, > ulint line) >{ > ; > ; > ; > rw_lock_set_writer(lock, 351); > lock->writer_thread = os_thread_get_curr_id(); > lock->writer_count++; > lock->pass = 0; > lock->last_x_file_name = file_name; > lock->last_x_line = line; >} >static inline >void >rw_lock_s_lock_func( > rw_lock_t* lock, > ulint pass, > const char* file_name, > ulint line) >{ > mutex_enter_func((rw_lock_get_mutex(lock)), "./../include/sync0rw.ic", 244); > if (__builtin_expect(rw_lock_s_lock_low(lock, pass, file_name, line), (1))) { > mutex_exit(rw_lock_get_mutex(lock)); > return; > } else { > mutex_exit(rw_lock_get_mutex(lock)); > rw_lock_s_lock_spin(lock, pass, file_name, line); > return; > } >} >static inline >ulint >rw_lock_s_lock_func_nowait( > rw_lock_t* lock, > const char* file_name, > ulint line) >{ > ulint success = (0); > mutex_enter_func((rw_lock_get_mutex(lock)), "./../include/sync0rw.ic", 275); > if (lock->writer == 350) { > lock->reader_count++; > lock->last_s_file_name = file_name; > lock->last_s_line = line; > success = (1); > } > mutex_exit(rw_lock_get_mutex(lock)); > return(success); >} >static inline >ulint >rw_lock_x_lock_func_nowait( > rw_lock_t* lock, > const char* file_name, > ulint line) >{ > ulint success = (0); > os_thread_id_t curr_thread = os_thread_get_curr_id(); > mutex_enter_func((rw_lock_get_mutex(lock)), "./../include/sync0rw.ic", 312); > if (__builtin_expect(rw_lock_get_reader_count(lock) != 0, (0))) { > } else if (__builtin_expect(rw_lock_get_writer(lock) == 350, (1))) { > rw_lock_set_writer(lock, 351); > lock->writer_thread = curr_thread; > lock->pass = 0; > relock: > lock->writer_count++; > lock->last_x_file_name = file_name; > lock->last_x_line = line; > success = (1); > } else if (rw_lock_get_writer(lock) == 351 > && lock->pass == 0 > && os_thread_eq(lock->writer_thread, curr_thread)) { > goto relock; > } > mutex_exit(rw_lock_get_mutex(lock)); > ; > return(success); >} >static inline >void >rw_lock_s_unlock_func( > rw_lock_t* lock > ) >{ > ib_mutex_t* mutex = &(lock->mutex); > ulint sg = (0); > mutex_enter_func((mutex), "./../include/sync0rw.ic", 361); > do { if (__builtin_expect(!((ulint)(lock->reader_count > 0)), (0))) { ut_dbg_assertion_failed("lock->reader_count > 0", "./../include/sync0rw.ic", (ulint) 365); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/sync0rw.ic", (ulint) 365); } while (0); } while (0); > lock->reader_count--; > if (__builtin_expect(lock->waiters, (0)) > && lock->reader_count == 0) { > sg = (1); > rw_lock_set_waiters(lock, 0); > } > mutex_exit(mutex); > if (__builtin_expect(sg, (0))) { > os_event_set(lock->event); > sync_array_object_signalled(sync_primary_wait_array); > } > ; >} >static inline >void >rw_lock_s_unlock_direct( > rw_lock_t* lock) >{ > ; > lock->reader_count--; > ; > ; >} >static inline >void >rw_lock_x_unlock_func( > rw_lock_t* lock > ) >{ > ulint sg = (0); > mutex_enter_func((&(lock->mutex)), "./../include/sync0rw.ic", 441); > ; > lock->writer_count--; > if (lock->writer_count == 0) { > rw_lock_set_writer(lock, 350); > } > if (__builtin_expect(lock->waiters, (0)) > && lock->writer_count == 0) { > sg = (1); > rw_lock_set_waiters(lock, 0); > } > mutex_exit(&(lock->mutex)); > if (__builtin_expect(sg, (0))) { > os_event_set(lock->event); > sync_array_object_signalled(sync_primary_wait_array); > } > ; >} >static inline >void >rw_lock_x_unlock_direct( > rw_lock_t* lock) >{ > ; > lock->writer_count--; > if (lock->writer_count == 0) { > rw_lock_set_writer(lock, 350); > } > ; > ; >} >typedef struct lock_struct ib_lock_t; >typedef struct lock_sys_struct lock_sys_t; >typedef struct hash_table_struct hash_table_t; >typedef struct hash_cell_struct hash_cell_t; >typedef void* hash_node_t; >hash_table_t* >hash0_create( > ulint n); >void >hash_create_mutexes( > hash_table_t* table, > ulint n_mutexes, > ulint sync_level); >void >hash_table_free( > hash_table_t* table); >static inline >ulint >hash_calc_hash( > ulint fold, > hash_table_t* table); >static inline >hash_cell_t* >hash_get_nth_cell( > hash_table_t* table, > ulint n); >static inline >ulint >hash_get_n_cells( > hash_table_t* table); >static inline >ulint >hash_get_mutex_no( > hash_table_t* table, > ulint fold); >static inline >mem_heap_t* >hash_get_nth_heap( > hash_table_t* table, > ulint i); >static inline >mem_heap_t* >hash_get_heap( > hash_table_t* table, > ulint fold); >static inline >ib_mutex_t* >hash_get_nth_mutex( > hash_table_t* table, > ulint i); >static inline >ib_mutex_t* >hash_get_mutex( > hash_table_t* table, > ulint fold); >void >hash_mutex_enter( > hash_table_t* table, > ulint fold); >void >hash_mutex_exit( > hash_table_t* table, > ulint fold); >void >hash_mutex_enter_all( > hash_table_t* table); >void >hash_mutex_exit_all( > hash_table_t* table); >struct hash_cell_struct{ > void* node; >}; >struct hash_table_struct { > ulint adaptive; > ulint n_cells; > hash_cell_t* array; > ulint n_mutexes; > ib_mutex_t* mutexes; > mem_heap_t** heaps; > mem_heap_t* heap; > ulint magic_n; >}; >static inline >hash_cell_t* >hash_get_nth_cell( > hash_table_t* table, > ulint n) >{ > ; > return(table->array + n); >} >static inline >ulint >hash_get_n_cells( > hash_table_t* table) >{ > return(table->n_cells); >} >static inline >ulint >hash_calc_hash( > ulint fold, > hash_table_t* table) >{ > return(ut_hash_ulint(fold, table->n_cells)); >} >static inline >ulint >hash_get_mutex_no( > hash_table_t* table, > ulint fold) >{ > return(ut_2pow_remainder(fold, table->n_mutexes)); >} >static inline >mem_heap_t* >hash_get_nth_heap( > hash_table_t* table, > ulint i) >{ > ; > return(table->heaps[i]); >} >static inline >mem_heap_t* >hash_get_heap( > hash_table_t* table, > ulint fold) >{ > ulint i; > if (table->heap) { > return(table->heap); > } > i = hash_get_mutex_no(table, fold); > return(hash_get_nth_heap(table, i)); >} >static inline >ib_mutex_t* >hash_get_nth_mutex( > hash_table_t* table, > ulint i) >{ > ; > return(table->mutexes + i); >} >static inline >ib_mutex_t* >hash_get_mutex( > hash_table_t* table, > ulint fold) >{ > ulint i; > i = hash_get_mutex_no(table, fold); > return(hash_get_nth_mutex(table, i)); >} >typedef void que_node_t; >typedef struct que_fork_struct que_fork_t; >typedef que_fork_t que_t; >typedef struct que_thr_struct que_thr_t; >typedef struct que_common_struct que_common_t; >struct que_common_struct{ > ulint type; > que_node_t* parent; > que_node_t* brother; > dfield_t val; > ulint val_buf_size; >}; >dict_table_t* >dict_mem_table_create( > const char* name, > ulint space, > ulint n_cols, > ulint comp); >void >dict_mem_table_free( > dict_table_t* table); >dict_cluster_t* >dict_mem_cluster_create( > const char* name, > ulint space, > ulint n_cols, > ulint mix_len); >void >dict_mem_table_make_cluster_member( > dict_table_t* table, > const char* cluster_name); >void >dict_mem_table_add_col( > dict_table_t* table, > const char* name, > ulint mtype, > ulint prtype, > ulint len, > ulint prec); >dict_index_t* >dict_mem_index_create( > const char* table_name, > const char* index_name, > ulint space, > ulint type, > ulint n_fields); >void >dict_mem_index_add_field( > dict_index_t* index, > const char* name, > ulint order, > ulint prefix_len); >void >dict_mem_index_free( > dict_index_t* index); >dict_foreign_t* >dict_mem_foreign_create(void); >struct dict_col_struct{ > hash_node_t hash; > ulint ind; > ulint clust_pos; > ulint ord_part; > const char* name; > dtype_t type; > dict_table_t* table; > ulint aux; >}; >struct dict_field_struct{ > dict_col_t* col; > const char* name; > ulint order; > ulint prefix_len; > ulint fixed_len; > ulint fixed_offs; >}; >struct dict_tree_struct{ > ulint type; > dulint id; > ulint space; > ulint page; > unsigned char pad[64]; > rw_lock_t lock; > ulint mem_fix; > struct { ulint count; dict_index_t * start; dict_index_t * end; } > tree_indexes; > ulint magic_n; >}; >struct dict_index_struct{ > dulint id; > mem_heap_t* heap; > ulint type; > const char* name; > const char* table_name; > dict_table_t* table; > ulint space; > ulint trx_id_offset; > ulint n_user_defined_cols; > ulint n_uniq; > ulint n_def; > ulint n_fields; > dict_field_t* fields; > ulint n_nullable; > struct { dict_index_t * prev; dict_index_t * next; } > indexes; > dict_tree_t* tree; > struct { dict_index_t * prev; dict_index_t * next; } > tree_indexes; > ulint cached; > btr_search_t* search_info; > ib_longlong* stat_n_diff_key_vals; > ulint stat_index_size; > ulint stat_n_leaf_pages; > ulint magic_n; >}; >struct dict_foreign_struct{ > mem_heap_t* heap; > char* id; > ulint type; > char* foreign_table_name; > dict_table_t* foreign_table; > const char** foreign_col_names; > char* referenced_table_name; > dict_table_t* referenced_table; > const char** referenced_col_names; > ulint n_fields; > dict_index_t* foreign_index; > dict_index_t* referenced_index; > struct { dict_foreign_t * prev; dict_foreign_t * next; } > foreign_list; > struct { dict_foreign_t * prev; dict_foreign_t * next; } > referenced_list; >}; >struct dict_table_struct{ > dulint id; > ulint type; > mem_heap_t* heap; > const char* name; > const char* dir_path_of_temp_table; > ulint space; > ulint ibd_file_missing; > ulint tablespace_discarded; > ulint comp; > hash_node_t name_hash; > hash_node_t id_hash; > ulint n_def; > ulint n_cols; > dict_col_t* cols; > struct { ulint count; dict_index_t * start; dict_index_t * end; } > indexes; > struct { ulint count; dict_foreign_t * start; dict_foreign_t * end; } > foreign_list; > struct { ulint count; dict_foreign_t * start; dict_foreign_t * end; } > referenced_list; > struct { dict_table_t * prev; dict_table_t * next; } > table_LRU; > ulint mem_fix; > ulint n_mysql_handles_opened; > ulint n_foreign_key_checks_running; > ulint cached; > ib_lock_t* auto_inc_lock; > dulint query_cache_inv_trx_id; > struct { ulint count; ib_lock_t * start; ib_lock_t * end; } > locks; > dulint mix_id; > ulint mix_len; > ulint mix_id_len; > unsigned char mix_id_buf[12]; > const char* cluster_name; > ulint does_not_fit_in_memory; > ib_longlong stat_n_rows; > ulint stat_clustered_index_size; > ulint stat_sum_of_other_index_sizes; > ulint stat_initialized; > ulint stat_modified_counter; > ib_mutex_t autoinc_mutex; > ulint autoinc_inited; > ib_longlong autoinc; > ulint magic_n; >}; >typedef struct trx_struct trx_t; >typedef struct trx_sys_struct trx_sys_t; >typedef struct trx_doublewrite_struct trx_doublewrite_t; >typedef struct trx_sig_struct trx_sig_t; >typedef struct trx_rseg_struct trx_rseg_t; >typedef struct trx_undo_struct trx_undo_t; >typedef struct trx_undo_arr_struct trx_undo_arr_t; >typedef struct trx_undo_inf_struct trx_undo_inf_t; >typedef struct trx_purge_struct trx_purge_t; >typedef struct roll_node_struct roll_node_t; >typedef struct commit_node_struct commit_node_t; >typedef struct trx_named_savept_struct trx_named_savept_t; >typedef struct trx_savept_struct trx_savept_t; >struct trx_savept_struct{ > dulint least_undo_no; >}; >typedef unsigned char trx_sysf_t; >typedef unsigned char trx_rsegf_t; >typedef unsigned char trx_usegf_t; >typedef unsigned char trx_ulogf_t; >typedef unsigned char trx_upagef_t; >typedef unsigned char trx_undo_rec_t; >void >dict_casedn_str( > char* a); >ulint >dict_get_db_name_len( > const char* name); >const char* >dict_accept( > const char* ptr, > const char* string, > ulint* success); >void >dict_table_decrement_handle_count( > dict_table_t* table); >void >dict_init(void); >void >dict_load_space_id_list(void); >static inline >dtype_t* >dict_col_get_type( > dict_col_t* col); >static inline >ulint >dict_col_get_no( > dict_col_t* col); >static inline >ulint >dict_col_get_clust_pos( > dict_col_t* col); >ulint >dict_col_name_is_reserved( > const char* name); >void >dict_table_autoinc_initialize( > dict_table_t* table, > ib_longlong value); >ib_longlong >dict_table_autoinc_get( > dict_table_t* table); >void >dict_table_autoinc_decrement( > dict_table_t* table); >ib_longlong >dict_table_autoinc_read( > dict_table_t* table); >ib_longlong >dict_table_autoinc_peek( > dict_table_t* table); >void >dict_table_autoinc_update( > dict_table_t* table, > ib_longlong value); >void >dict_table_add_to_cache( > dict_table_t* table); >void >dict_table_remove_from_cache( > dict_table_t* table); >ulint >dict_table_rename_in_cache( > dict_table_t* table, > const char* new_name, > ulint rename_also_foreigns); >void >dict_table_change_id_in_cache( > dict_table_t* table, > dulint new_id); >ulint >dict_foreign_add_to_cache( > dict_foreign_t* foreign, > ulint check_charsets); >ulint >dict_table_referenced_by_foreign_key( > dict_table_t* table); >ulint >dict_create_foreign_constraints( > trx_t* trx, > const char* sql_string, > const char* name, > ulint reject_fks); >ulint >dict_foreign_parse_drop_constraints( > mem_heap_t* heap, > trx_t* trx, > dict_table_t* table, > ulint* n, > const char*** constraints_to_drop); >dict_table_t* >dict_table_get( > const char* table_name, > trx_t* trx); >dict_table_t* >dict_table_get_and_increment_handle_count( > const char* table_name, > trx_t* trx); >dict_table_t* >dict_table_get_on_id( > dulint table_id, > trx_t* trx); >static inline >dict_table_t* >dict_table_get_on_id_low( > dulint table_id, > trx_t* trx); >static inline >void >dict_table_release( > dict_table_t* table); >static inline >dict_table_t* >dict_table_check_if_in_cache_low( > const char* table_name); >static inline >dict_table_t* >dict_table_get_low( > const char* table_name); >static inline >dict_index_t* >dict_table_get_index( > dict_table_t* table, > const char* name); >dict_index_t* >dict_table_get_index_noninline( > dict_table_t* table, > const char* name); >void >dict_table_print( > dict_table_t* table); >void >dict_table_print_low( > dict_table_t* table); >void >dict_table_print_by_name( > const char* name); >void >dict_print_info_on_foreign_keys( > ulint create_table_format, > FILE* file, > trx_t* trx, > dict_table_t* table); >void >dict_print_info_on_foreign_key_in_create_format( > FILE* file, > trx_t* trx, > dict_foreign_t* foreign, > ulint add_newline); >void >dict_index_name_print( > FILE* file, > trx_t* trx, > const dict_index_t* index); >static inline >dict_index_t* >dict_table_get_first_index( > dict_table_t* table); >dict_index_t* >dict_table_get_first_index_noninline( > dict_table_t* table); >static inline >dict_index_t* >dict_table_get_next_index( > dict_index_t* index); >dict_index_t* >dict_table_get_next_index_noninline( > dict_index_t* index); >static inline >ulint >dict_table_get_n_user_cols( > dict_table_t* table); >static inline >ulint >dict_table_get_n_sys_cols( > dict_table_t* table); >static inline >ulint >dict_table_get_n_cols( > dict_table_t* table); >static inline >dict_col_t* >dict_table_get_nth_col( > dict_table_t* table, > ulint pos); >dict_col_t* >dict_table_get_nth_col_noninline( > dict_table_t* table, > ulint pos); >static inline >dict_col_t* >dict_table_get_sys_col( > dict_table_t* table, > ulint sys); >static inline >ulint >dict_table_get_sys_col_no( > dict_table_t* table, > ulint sys); >ulint >dict_table_col_in_clustered_key( > dict_table_t* table, > ulint n); >void >dict_table_copy_types( > dtuple_t* tuple, > dict_table_t* table); >dict_index_t* >dict_index_find_on_id_low( > dulint id); >ulint >dict_index_add_to_cache( > dict_table_t* table, > dict_index_t* index, > ulint page_no); >static inline >ulint >dict_index_get_n_fields( > dict_index_t* index); >static inline >ulint >dict_index_get_n_unique( > dict_index_t* index); >static inline >ulint >dict_index_get_n_unique_in_tree( > dict_index_t* index); >static inline >ulint >dict_index_get_n_ordering_defined_by_user( > dict_index_t* index); >static inline >dict_field_t* >dict_index_get_nth_field( > dict_index_t* index, > ulint pos); >static inline >dtype_t* >dict_index_get_nth_type( > dict_index_t* index, > ulint pos); >static inline >ulint >dict_index_get_nth_col_no( > dict_index_t* index, > ulint pos); >ulint >dict_index_get_nth_col_pos( > dict_index_t* index, > ulint n); >ulint >dict_index_contains_col_or_prefix( > dict_index_t* index, > ulint n); >ulint >dict_index_get_nth_field_pos( > dict_index_t* index, > dict_index_t* index2, > ulint n); >ulint >dict_table_get_nth_col_pos( > dict_table_t* table, > ulint n); >static inline >ulint >dict_index_get_sys_col_pos( > dict_index_t* index, > ulint type); >void >dict_index_add_col( > dict_index_t* index, > dict_col_t* col, > ulint order, > ulint prefix_len); >void >dict_index_copy_types( > dtuple_t* tuple, > dict_index_t* index, > ulint n_fields); >static inline >dict_tree_t* >dict_index_get_tree( > dict_index_t* index); >static inline >ulint >dict_field_get_order( > dict_field_t* field); >static inline >dict_col_t* >dict_field_get_col( > dict_field_t* field); >dict_tree_t* >dict_tree_create( > dict_index_t* index, > ulint page_no); >void >dict_tree_free( > dict_tree_t* tree); >dict_index_t* >dict_tree_find_index( > dict_tree_t* tree, > rec_t* rec); >dict_index_t* >dict_tree_find_index_for_tuple( > dict_tree_t* tree, > dtuple_t* tuple); >ulint >dict_is_mixed_table_rec( > dict_table_t* table, > rec_t* rec); >dict_index_t* >dict_index_get_if_in_cache( > dulint index_id); >ulint >dict_tree_check_search_tuple( > dict_tree_t* tree, > dtuple_t* tuple); >dtuple_t* >dict_tree_build_node_ptr( > dict_tree_t* tree, > rec_t* rec, > ulint page_no, > mem_heap_t* heap, > ulint level); >rec_t* >dict_tree_copy_rec_order_prefix( > dict_tree_t* tree, > rec_t* rec, > ulint* n_fields, > unsigned char** buf, > ulint* buf_size); >dtuple_t* >dict_tree_build_data_tuple( > dict_tree_t* tree, > rec_t* rec, > ulint n_fields, > mem_heap_t* heap); >static inline >ulint >dict_tree_get_space( > dict_tree_t* tree); >static inline >void >dict_tree_set_space( > dict_tree_t* tree, > ulint space); >static inline >ulint >dict_tree_get_page( > dict_tree_t* tree); >static inline >void >dict_tree_set_page( > dict_tree_t* tree, > ulint page); >static inline >ulint >dict_tree_get_type( > dict_tree_t* tree); >static inline >rw_lock_t* >dict_tree_get_lock( > dict_tree_t* tree); >static inline >ulint >dict_tree_get_space_reserve( > dict_tree_t* tree); >ulint >dict_index_calc_min_rec_len( > dict_index_t* index); >void >dict_update_statistics_low( > dict_table_t* table, > ulint has_dict_mutex); >void >dict_update_statistics( > dict_table_t* table); >void >dict_mutex_enter_for_mysql(void); >void >dict_mutex_exit_for_mysql(void); >ulint >dict_tables_have_same_db( > const char* name1, > const char* name2); >const char* >dict_scan_to( > const char* ptr, > const char* string); >extern FILE* dict_foreign_err_file; >extern ib_mutex_t dict_foreign_err_mutex; >extern dict_sys_t* dict_sys; >extern rw_lock_t dict_operation_lock; >struct dict_sys_struct{ > ib_mutex_t mutex; > dulint row_id; > hash_table_t* table_hash; > hash_table_t* table_id_hash; > hash_table_t* col_hash; > struct { ulint count; dict_table_t * start; dict_table_t * end; } > table_LRU; > ulint size; > dict_table_t* sys_tables; > dict_table_t* sys_columns; > dict_table_t* sys_indexes; > dict_table_t* sys_fields; >}; >void >dict_check_tablespaces_and_store_max_id( > ulint in_crash_recovery); >char* >dict_get_first_table_name_in_db( > const char* name); >dict_table_t* >dict_load_table( > const char* name); >dict_table_t* >dict_load_table_on_id( > dulint table_id); >void >dict_load_sys_table( > dict_table_t* table); >ulint >dict_load_foreigns( > const char* table_name, > ulint check_charsets); >void >dict_print(void); >typedef struct dyn_block_struct dyn_block_t; >typedef dyn_block_t dyn_array_t; >static inline >dyn_array_t* >dyn_array_create( > dyn_array_t* arr); >static inline >void >dyn_array_free( > dyn_array_t* arr); >static inline >unsigned char* >dyn_array_open( > dyn_array_t* arr, > ulint size); >static inline >void >dyn_array_close( > dyn_array_t* arr, > unsigned char* ptr); >static inline >void* >dyn_array_push( > dyn_array_t* arr, > ulint size); >static inline >void* >dyn_array_get_element( > dyn_array_t* arr, > ulint pos); >static inline >ulint >dyn_array_get_data_size( > dyn_array_t* arr); >static inline >dyn_block_t* >dyn_array_get_first_block( > dyn_array_t* arr); >static inline >dyn_block_t* >dyn_array_get_last_block( > dyn_array_t* arr); >static inline >dyn_block_t* >dyn_array_get_next_block( > dyn_array_t* arr, > dyn_block_t* block); >static inline >ulint >dyn_block_get_used( > dyn_block_t* block); >static inline >unsigned char* >dyn_block_get_data( > dyn_block_t* block); >static inline >void >dyn_push_string( > dyn_array_t* arr, > const unsigned char* str, > ulint len); >struct dyn_block_struct{ > mem_heap_t* heap; > ulint used; > unsigned char data[512]; > struct { ulint count; dyn_block_t * start; dyn_block_t * end; } base; > struct { dyn_block_t * prev; dyn_block_t * next; } list; >}; >dyn_block_t* >dyn_array_add_block( > dyn_array_t* arr); >static inline >dyn_block_t* >dyn_array_get_first_block( > dyn_array_t* arr) >{ > return(arr); >} >static inline >dyn_block_t* >dyn_array_get_last_block( > dyn_array_t* arr) >{ > if (arr->heap == ((void *)0)) { > return(arr); > } > return((arr->base).end); >} >static inline >dyn_block_t* >dyn_array_get_next_block( > dyn_array_t* arr, > dyn_block_t* block) >{ > ; > if (arr->heap == ((void *)0)) { > ; > return(((void *)0)); > } > return((((block)->list).next)); >} >static inline >ulint >dyn_block_get_used( > dyn_block_t* block) >{ > ; > return((block->used) & ~0x1000000UL); >} >static inline >unsigned char* >dyn_block_get_data( > dyn_block_t* block) >{ > ; > return(block->data); >} >static inline >dyn_array_t* >dyn_array_create( > dyn_array_t* arr) >{ > ; > ; > arr->heap = ((void *)0); > arr->used = 0; > return(arr); >} >static inline >void >dyn_array_free( > dyn_array_t* arr) >{ > if (arr->heap != ((void *)0)) { > mem_heap_free_func( (arr->heap), "./../include/dyn0dyn.ic", 130); > } >} >static inline >void* >dyn_array_push( > dyn_array_t* arr, > ulint size) >{ > dyn_block_t* block; > ulint used; > ; > ; > ; > ; > block = arr; > used = block->used; > if (used + size > 512) { > block = dyn_array_get_last_block(arr); > used = block->used; > if (used + size > 512) { > block = dyn_array_add_block(arr); > used = block->used; > } > } > block->used = used + size; > ; > return((block->data) + used); >} >static inline >unsigned char* >dyn_array_open( > dyn_array_t* arr, > ulint size) >{ > dyn_block_t* block; > ulint used; > ; > ; > ; > ; > block = arr; > used = block->used; > if (used + size > 512) { > block = dyn_array_get_last_block(arr); > used = block->used; > if (used + size > 512) { > block = dyn_array_add_block(arr); > used = block->used; > do { if (__builtin_expect(!((ulint)(size <= 512)), (0))) { ut_dbg_assertion_failed("size <= DYN_ARRAY_DATA_SIZE", "./../include/dyn0dyn.ic", (ulint) 211); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/dyn0dyn.ic", (ulint) 211); } while (0); } while (0); > } > } > ; > return((block->data) + used); >} >static inline >void >dyn_array_close( > dyn_array_t* arr, > unsigned char* ptr) >{ > dyn_block_t* block; > ; > ; > block = dyn_array_get_last_block(arr); > ; > block->used = ptr - block->data; > ; >} >static inline >void* >dyn_array_get_element( > dyn_array_t* arr, > ulint pos) >{ > dyn_block_t* block; > ulint used; > ; > ; > block = dyn_array_get_first_block(arr); > if (arr->heap != ((void *)0)) { > used = dyn_block_get_used(block); > while (pos >= used) { > pos -= used; > block = (((block)->list).next); > ; > used = dyn_block_get_used(block); > } > } > ; > ; > return(block->data + pos); >} >static inline >ulint >dyn_array_get_data_size( > dyn_array_t* arr) >{ > dyn_block_t* block; > ulint sum = 0; > ; > ; > if (arr->heap == ((void *)0)) { > return(arr->used); > } > block = dyn_array_get_first_block(arr); > while (block != ((void *)0)) { > sum += dyn_block_get_used(block); > block = dyn_array_get_next_block(arr, block); > } > return(sum); >} >static inline >void >dyn_push_string( > dyn_array_t* arr, > const unsigned char* str, > ulint len) >{ > ulint n_copied; > while (len > 0) { > if (len > 512) { > n_copied = 512; > } else { > n_copied = len; > } > memcpy(dyn_array_push(arr, n_copied), str, n_copied); > str += n_copied; > len -= n_copied; > } >} >typedef struct buf_block_struct buf_block_t; >typedef struct buf_pool_struct buf_pool_t; >typedef unsigned char buf_frame_t; >typedef struct mtr_struct mtr_t; >static inline >mtr_t* >mtr_start( > mtr_t* mtr); >mtr_t* >mtr_start_noninline( > mtr_t* mtr); >void >mtr_commit( > mtr_t* mtr); >static inline >ulint >mtr_set_savepoint( > mtr_t* mtr); >void >mtr_rollback_to_savepoint( > mtr_t* mtr, > ulint savepoint); >static inline >void >mtr_release_s_latch_at_savepoint( > mtr_t* mtr, > ulint savepoint, > rw_lock_t* lock); >static inline >ulint >mtr_get_log_mode( > mtr_t* mtr); >static inline >ulint >mtr_set_log_mode( > mtr_t* mtr, > ulint mode); >ulint >mtr_read_ulint( > unsigned char* ptr, > ulint type, > mtr_t* mtr); >dulint >mtr_read_dulint( > unsigned char* ptr, > mtr_t* mtr); >static inline >void >mtr_s_lock_func( > rw_lock_t* lock, > const char* file, > ulint line, > mtr_t* mtr); >static inline >void >mtr_x_lock_func( > rw_lock_t* lock, > const char* file, > ulint line, > mtr_t* mtr); >void >mtr_memo_release( > mtr_t* mtr, > void* object, > ulint type); >static inline >ulint >mtr_memo_contains( > mtr_t* mtr, > void* object, > ulint type); >void >mtr_print( > mtr_t* mtr); >static inline >dyn_array_t* >mtr_get_log( > mtr_t* mtr); >static inline >void >mtr_memo_push( > mtr_t* mtr, > void* object, > ulint type); >typedef struct mtr_memo_slot_struct mtr_memo_slot_t; >struct mtr_memo_slot_struct{ > ulint type; > void* object; >}; >struct mtr_struct{ > ulint state; > dyn_array_t memo; > dyn_array_t log; > ulint modifications; > ulint n_log_recs; > ulint log_mode; > dulint start_lsn; > dulint end_lsn; > ulint magic_n; >}; >static inline >mtr_t* >mtr_start( > mtr_t* mtr) >{ > dyn_array_create(&(mtr->memo)); > dyn_array_create(&(mtr->log)); > mtr->log_mode = 21; > mtr->modifications = (0); > mtr->n_log_recs = 0; > return(mtr); >} >static inline >void >mtr_memo_push( > mtr_t* mtr, > void* object, > ulint type) >{ > dyn_array_t* memo; > mtr_memo_slot_t* slot; > ; > ; > ; > ; > ; > memo = &(mtr->memo); > slot = dyn_array_push(memo, sizeof(mtr_memo_slot_t)); > slot->object = object; > slot->type = type; >} >static inline >ulint >mtr_set_savepoint( > mtr_t* mtr) >{ > dyn_array_t* memo; > ; > ; > memo = &(mtr->memo); > return(dyn_array_get_data_size(memo)); >} >static inline >void >mtr_release_s_latch_at_savepoint( > mtr_t* mtr, > ulint savepoint, > rw_lock_t* lock) >{ > mtr_memo_slot_t* slot; > dyn_array_t* memo; > ; > ; > ; > memo = &(mtr->memo); > ; > slot = dyn_array_get_element(memo, savepoint); > ; > ; > rw_lock_s_unlock_func(lock); > slot->object = ((void *)0); >} >static inline >ulint >mtr_memo_contains( > mtr_t* mtr, > void* object, > ulint type) >{ > mtr_memo_slot_t* slot; > dyn_array_t* memo; > ulint offset; > ; > ; > memo = &(mtr->memo); > offset = dyn_array_get_data_size(memo); > while (offset > 0) { > offset -= sizeof(mtr_memo_slot_t); > slot = dyn_array_get_element(memo, offset); > if ((object == slot->object) && (type == slot->type)) { > return((1)); > } > } > return((0)); >} >static inline >dyn_array_t* >mtr_get_log( > mtr_t* mtr) >{ > ; > ; > return(&(mtr->log)); >} >static inline >ulint >mtr_get_log_mode( > mtr_t* mtr) >{ > ; > ; > ; > return(mtr->log_mode); >} >static inline >ulint >mtr_set_log_mode( > mtr_t* mtr, > ulint mode) >{ > ulint old_mode; > ; > ; > ; > old_mode = mtr->log_mode; > if ((mode == 24) && (old_mode == 22)) { > } else { > mtr->log_mode = mode; > } > ; > ; > return(old_mode); >} >static inline >void >mtr_s_lock_func( > rw_lock_t* lock, > const char* file, > ulint line, > mtr_t* mtr) >{ > ; > ; > rw_lock_s_lock_func(lock, 0, file, line); > mtr_memo_push(mtr, lock, 55); >} >static inline >void >mtr_x_lock_func( > rw_lock_t* lock, > const char* file, > ulint line, > mtr_t* mtr) >{ > ; > ; > rw_lock_x_lock_func(lock, 0, file, line); > mtr_memo_push(mtr, lock, 56); >} >void >mlog_write_ulint( > unsigned char* ptr, > ulint val, > unsigned char type, > mtr_t* mtr); >void >mlog_write_dulint( > unsigned char* ptr, > dulint val, > mtr_t* mtr); >void >mlog_write_string( > unsigned char* ptr, > const unsigned char* str, > ulint len, > mtr_t* mtr); >void >mlog_write_initial_log_record( > unsigned char* ptr, > unsigned char type, > mtr_t* mtr); >static inline >unsigned char* >mlog_write_initial_log_record_for_file_op( > ulint type, > ulint space_id, > ulint page_no, > unsigned char* log_ptr, > mtr_t* mtr); >static inline >void >mlog_catenate_ulint( > mtr_t* mtr, > ulint val, > ulint type); >void >mlog_catenate_string( > mtr_t* mtr, > const unsigned char* str, > ulint len); >static inline >void >mlog_catenate_ulint_compressed( > mtr_t* mtr, > ulint val); >static inline >void >mlog_catenate_dulint_compressed( > mtr_t* mtr, > dulint val); >static inline >unsigned char* >mlog_open( > mtr_t* mtr, > ulint size); >static inline >void >mlog_close( > mtr_t* mtr, > unsigned char* ptr); >static inline >unsigned char* >mlog_write_initial_log_record_fast( > unsigned char* ptr, > unsigned char type, > unsigned char* log_ptr, > mtr_t* mtr); >unsigned char* >mlog_parse_initial_log_record( > unsigned char* ptr, > unsigned char* end_ptr, > unsigned char* type, > ulint* space, > ulint* page_no); >unsigned char* >mlog_parse_nbytes( > ulint type, > unsigned char* ptr, > unsigned char* end_ptr, > unsigned char* page); >unsigned char* >mlog_parse_string( > unsigned char* ptr, > unsigned char* end_ptr, > unsigned char* page); >unsigned char* >mlog_open_and_write_index( > mtr_t* mtr, > unsigned char* rec, > dict_index_t* index, > unsigned char type, > ulint size); >unsigned char* >mlog_parse_index( > unsigned char* ptr, > unsigned char* end_ptr, > ulint comp, > dict_index_t** index); >typedef struct ibuf_data_struct ibuf_data_t; >typedef struct ibuf_struct ibuf_t; >extern const char* fil_path_to_mysql_datadir; >typedef unsigned char fil_faddr_t; >typedef struct fil_addr_struct fil_addr_t; >struct fil_addr_struct{ > ulint page; > ulint boffset; >}; >extern fil_addr_t fil_addr_null; >extern ulint fil_n_log_flushes; >extern ulint fil_n_pending_log_flushes; >extern ulint fil_n_pending_tablespace_flushes; >ib_longlong >fil_space_get_version( > ulint id); >rw_lock_t* >fil_space_get_latch( > ulint id); >ulint >fil_space_get_type( > ulint id); >ibuf_data_t* >fil_space_get_ibuf_data( > ulint id); >void >fil_node_create( > const char* name, > ulint size, > ulint id, > ulint is_raw); >void >fil_space_truncate_start( > ulint id, > ulint trunc_len); >ulint >fil_space_create( > const char* name, > ulint id, > ulint purpose); >ulint >fil_space_free( > ulint id); >ulint >fil_space_get_size( > ulint id); >ulint >fil_check_adress_in_tablespace( > ulint id, > ulint page_no); >void >fil_init( > ulint max_n_open); >void >fil_open_log_and_system_tablespace_files(void); >void >fil_close_all_files(void); >void >fil_set_max_space_id_if_bigger( > ulint max_id); >void >fil_ibuf_init_at_db_start(void); >ulint >fil_write_flushed_lsn_to_data_files( > dulint lsn, > ulint arch_log_no); >void >fil_read_flushed_lsn_and_arch_log_no( > os_file_t data_file, > ulint one_read_already, > dulint* min_flushed_lsn, > dulint* max_flushed_lsn); >ulint >fil_inc_pending_ibuf_merges( > ulint id); >void >fil_decr_pending_ibuf_merges( > ulint id); >unsigned char* >fil_op_log_parse_or_replay( > unsigned char* ptr, > unsigned char* end_ptr, > ulint type, > ulint do_replay, > ulint space_id); >ulint >fil_delete_tablespace( > ulint id); >ulint >fil_discard_tablespace( > ulint id); >ulint >fil_rename_tablespace( > const char* old_name, > ulint id, > const char* new_name); >ulint >fil_create_new_single_table_tablespace( > ulint* space_id, > const char* tablename, > ulint is_temp, > ulint size); >ulint >fil_open_single_table_tablespace( > ulint check_space_id, > ulint id, > const char* name); >ulint >fil_reset_too_high_lsns( > const char* name, > dulint current_lsn); >ulint >fil_load_single_table_tablespaces(void); >void >fil_print_orphaned_tablespaces(void); >ulint >fil_tablespace_deleted_or_being_deleted_in_mem( > ulint id, > ib_longlong version); >ulint >fil_tablespace_exists_in_mem( > ulint id); >ulint >fil_space_for_table_exists_in_mem( > ulint id, > const char* name, > ulint is_temp, > ulint mark_space, > ulint print_error_if_does_not_exist); >ulint >fil_extend_space_to_desired_size( > ulint* actual_size, > ulint space_id, > ulint size_after_extend); >ulint >fil_space_reserve_free_extents( > ulint id, > ulint n_free_now, > ulint n_to_reserve); >void >fil_space_release_free_extents( > ulint id, > ulint n_reserved); >ulint >fil_space_get_n_reserved_extents( > ulint id); >ulint >fil_io( > ulint type, > ulint sync, > ulint space_id, > ulint block_offset, > ulint byte_offset, > ulint len, > void* buf, > void* message); >ulint >fil_read( > ulint sync, > ulint space_id, > ulint block_offset, > ulint byte_offset, > ulint len, > void* buf, > void* message); >ulint >fil_write( > ulint sync, > ulint space_id, > ulint block_offset, > ulint byte_offset, > ulint len, > void* buf, > void* message); >void >fil_aio_wait( > ulint segment); >void >fil_flush( > ulint space_id); >void >fil_flush_file_spaces( > ulint purpose); >ulint >fil_validate(void); >ulint >fil_addr_is_null( > fil_addr_t addr); >ulint >fil_page_get_prev(unsigned char* page); >ulint >fil_page_get_next(unsigned char* page); >void >fil_page_set_type( > unsigned char* page, > ulint type); >ulint >fil_page_get_type( > unsigned char* page); >typedef struct fil_space_struct fil_space_t; >typedef unsigned short int __ipc_pid_t; >struct ipc_perm > { > __key_t __key; > __uid_t uid; > __gid_t gid; > __uid_t cuid; > __gid_t cgid; > unsigned short int mode; > unsigned short int __pad1; > unsigned short int __seq; > unsigned short int __pad2; > unsigned long int __unused1; > unsigned long int __unused2; > }; > >extern key_t ftok (__const char *__pathname, int __proj_id) __attribute__ ((__nothrow__)); > > >typedef unsigned long int shmatt_t; >struct shmid_ds > { > struct ipc_perm shm_perm; > size_t shm_segsz; > __time_t shm_atime; > unsigned long int __unused1; > __time_t shm_dtime; > unsigned long int __unused2; > __time_t shm_ctime; > unsigned long int __unused3; > __pid_t shm_cpid; > __pid_t shm_lpid; > shmatt_t shm_nattch; > unsigned long int __unused4; > unsigned long int __unused5; > }; >struct shminfo > { > unsigned long int shmmax; > unsigned long int shmmin; > unsigned long int shmmni; > unsigned long int shmseg; > unsigned long int shmall; > unsigned long int __unused1; > unsigned long int __unused2; > unsigned long int __unused3; > unsigned long int __unused4; > }; >struct shm_info > { > int used_ids; > unsigned long int shm_tot; > unsigned long int shm_rss; > unsigned long int shm_swp; > unsigned long int swap_attempts; > unsigned long int swap_successes; > }; > > >extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __attribute__ ((__nothrow__)); >extern int shmget (key_t __key, size_t __size, int __shmflg) __attribute__ ((__nothrow__)); >extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg) > __attribute__ ((__nothrow__)); >extern int shmdt (__const void *__shmaddr) __attribute__ ((__nothrow__)); > >typedef void* os_process_t; >typedef unsigned long int os_process_id_t; >typedef ulint os_awe_t; >extern ulint os_use_large_pages; >extern ulint os_large_page_size; >ulint >os_awe_enable_lock_pages_in_mem(void); >ulint >os_awe_allocate_physical_mem( > os_awe_t** page_info, > ulint n_megabytes); >unsigned char* >os_awe_allocate_virtual_mem_window( > ulint size); >ulint >os_awe_map_physical_mem_to_window( > unsigned char* ptr, > ulint n_mem_pages, > os_awe_t* page_info); >ulint >os_proc_get_number(void); >void* >os_mem_alloc_nocache( > ulint n); >void* >os_mem_alloc_large( > ulint n, > ulint set_to_zero, > ulint assert_on_error); >void >os_mem_free_large( >void *ptr); >void >os_process_set_priority_boost( > ulint do_boost); >extern buf_pool_t* buf_pool; >extern ulint srv_buf_pool_write_requests; >buf_pool_t* >buf_pool_init( > ulint max_size, > ulint curr_size, > ulint n_frames); >static inline >ulint >buf_pool_get_curr_size(void); >static inline >ulint >buf_pool_get_max_size(void); >static inline >dulint >buf_pool_get_oldest_modification(void); >buf_frame_t* >buf_frame_alloc(void); >void >buf_frame_free( > buf_frame_t* frame); >static inline >unsigned char* >buf_frame_copy( > unsigned char* buf, > buf_frame_t* frame); >ulint >buf_page_optimistic_get_func( > ulint rw_latch, > buf_block_t* block, > buf_frame_t* guess, > dulint modify_clock, > const char* file, > ulint line, > mtr_t* mtr); >static inline >buf_frame_t* >buf_page_get_release_on_io( > ulint space, > ulint offset, > buf_frame_t* guess, > ulint rw_latch, > ulint savepoint, > mtr_t* mtr); >ulint >buf_page_get_known_nowait( > ulint rw_latch, > buf_frame_t* guess, > ulint mode, > const char* file, > ulint line, > mtr_t* mtr); >buf_frame_t* >buf_page_get_gen( > ulint space, > ulint offset, > ulint rw_latch, > buf_frame_t* guess, > ulint mode, > const char* file, > ulint line, > mtr_t* mtr); >buf_frame_t* >buf_page_create( > ulint space, > ulint offset, > mtr_t* mtr); >void >buf_page_init_for_backup_restore( > ulint space, > ulint offset, > buf_block_t* block); >static inline >void >buf_page_release( > buf_block_t* block, > ulint rw_latch, > mtr_t* mtr); >void >buf_page_make_young( > buf_frame_t* frame); >ulint >buf_page_peek( > ulint space, > ulint offset); >buf_block_t* >buf_page_peek_block( > ulint space, > ulint offset); >void >buf_reset_check_index_page_at_flush( > ulint space, > ulint offset); >buf_block_t* >buf_page_set_file_page_was_freed( > ulint space, > ulint offset); >buf_block_t* >buf_page_reset_file_page_was_freed( > ulint space, > ulint offset); >static inline >ulint >buf_block_peek_if_too_old( > buf_block_t* block); >ulint >buf_page_peek_if_search_hashed( > ulint space, > ulint offset); >static inline >dulint >buf_frame_get_newest_modification( > buf_frame_t* frame); >static inline >dulint >buf_frame_modify_clock_inc( > buf_frame_t* frame); >static inline >dulint >buf_block_modify_clock_inc( > buf_block_t* block); >static inline >dulint >buf_block_get_modify_clock( > buf_block_t* block); >ulint >buf_calc_page_new_checksum( > unsigned char* page); >ulint >buf_calc_page_old_checksum( > unsigned char* page); >ulint >buf_page_is_corrupted( > unsigned char* read_buf); >static inline >ulint >buf_frame_get_page_no( > unsigned char* ptr); >static inline >ulint >buf_frame_get_space_id( > unsigned char* ptr); >static inline >void >buf_ptr_get_fsp_addr( > unsigned char* ptr, > ulint* space, > fil_addr_t* addr); >static inline >ulint >buf_frame_get_lock_hash_val( > unsigned char* ptr); >static inline >ib_mutex_t* >buf_frame_get_mutex( > unsigned char* ptr); >static inline >buf_frame_t* >buf_frame_align( > unsigned char* ptr); >static inline >ulint >buf_pool_is_block( > void* ptr); >void >buf_page_print( > unsigned char* read_buf); >ulint >buf_get_n_pending_ios(void); >void >buf_print_io( > FILE* file); >ulint >buf_get_modified_ratio_pct(void); >void >buf_refresh_io_stats(void); >ulint >buf_all_freed(void); >ulint >buf_pool_check_no_pending_io(void); >void >buf_pool_invalidate(void); >void >buf_awe_map_page_to_frame( > buf_block_t* block, > ulint add_to_mapped_list); >static inline >buf_frame_t* >buf_block_get_frame( > buf_block_t* block); >static inline >ulint >buf_block_get_space( > buf_block_t* block); >static inline >ulint >buf_block_get_page_no( > buf_block_t* block); >static inline >buf_block_t* >buf_block_align( > unsigned char* ptr); >static inline >ulint >buf_page_io_query( > buf_block_t* block); >static inline >buf_block_t* >buf_pool_get_nth_block( > buf_pool_t* pool, > ulint i); >buf_block_t* >buf_page_init_for_read( > ulint* err, > ulint mode, > ulint space, > ib_longlong tablespace_version, > ulint offset); >void >buf_page_io_complete( > buf_block_t* block); >static inline >ulint >buf_page_address_fold( > ulint space, > ulint offset); >static inline >buf_block_t* >buf_page_hash_get( > ulint space, > ulint offset); >static inline >ulint >buf_pool_clock_tic(void); >ulint >buf_get_free_list_len(void); >struct buf_block_struct{ > ulint magic_n; > ulint state; > unsigned char* frame; > os_awe_t* awe_info; > ulint space; > ulint offset; > ulint lock_hash_val; > ib_mutex_t mutex; > rw_lock_t lock; > buf_block_t* hash; > ulint check_index_page_at_flush; > struct { buf_block_t * prev; buf_block_t * next; } flush_list; > dulint newest_modification; > dulint oldest_modification; > ulint flush_type; > struct { buf_block_t * prev; buf_block_t * next; } free; > ulint in_free_list; > struct { buf_block_t * prev; buf_block_t * next; } LRU; > struct { buf_block_t * prev; buf_block_t * next; } awe_LRU_free_mapped; > ulint in_LRU_list; > ulint LRU_position; > ulint freed_page_clock; > ulint old; > ulint accessed; > ulint buf_fix_count; > ulint io_fix; > dulint modify_clock; > ulint n_hash_helps; > ulint n_fields; > ulint n_bytes; > ulint side; > ulint is_hashed; > ulint n_pointers; > ulint curr_n_fields; > ulint curr_n_bytes; > ulint curr_side; > dict_index_t* index; > ulint file_page_was_freed; >}; >struct buf_pool_struct{ > ib_mutex_t mutex; > unsigned char* frame_mem; > unsigned char* frame_zero; > unsigned char* high_end; > ulint n_frames; > buf_block_t* blocks; > buf_block_t** blocks_of_frames; > os_awe_t* awe_info; > ulint max_size; > ulint curr_size; > hash_table_t* page_hash; > ulint n_pend_reads; > time_t last_printout_time; > ulint n_pages_read; > ulint n_pages_written; > ulint n_pages_created; > ulint n_page_gets; > ulint n_pages_awe_remapped; > ulint n_page_gets_old; > ulint n_pages_read_old; > ulint n_pages_written_old; > ulint n_pages_created_old; > ulint n_pages_awe_remapped_old; > struct { ulint count; buf_block_t * start; buf_block_t * end; } flush_list; > ulint init_flush[3 + 1]; > ulint n_flush[3 + 1]; > os_event_t no_flush[3 + 1]; > ulint ulint_clock; > ulint freed_page_clock; > ulint LRU_flush_ended; > struct { ulint count; buf_block_t * start; buf_block_t * end; } free; > struct { ulint count; buf_block_t * start; buf_block_t * end; } LRU; > buf_block_t* LRU_old; > ulint LRU_old_len; > struct { ulint count; buf_block_t * start; buf_block_t * end; } awe_LRU_free_mapped; >}; >void >buf_flush_write_complete( > buf_block_t* block); >void >buf_flush_free_margin(void); >void >buf_flush_init_for_writing( > unsigned char* page, > dulint newest_lsn, > ulint space, > ulint page_no); >ulint >buf_flush_batch( > ulint flush_type, > ulint min_n, > dulint lsn_limit); >void >buf_flush_wait_batch_end( > ulint type); >static inline >void >buf_flush_note_modification( > buf_block_t* block, > mtr_t* mtr); >static inline >void >buf_flush_recv_note_modification( > buf_block_t* block, > dulint start_lsn, > dulint end_lsn); >ulint >buf_flush_ready_for_replace( > buf_block_t* block); >ulint >buf_flush_validate(void); >void >buf_flush_insert_into_flush_list( > buf_block_t* block); >void >buf_flush_insert_sorted_into_flush_list( > buf_block_t* block); >static inline >void >buf_flush_note_modification( > buf_block_t* block, > mtr_t* mtr) >{ > ; > ; > ; > ; > ; > ; > block->newest_modification = mtr->end_lsn; > if (ut_dulint_is_zero(block->oldest_modification)) { > block->oldest_modification = mtr->start_lsn; > ; > buf_flush_insert_into_flush_list(block); > } else { > ; > } > ++srv_buf_pool_write_requests; >} >static inline >void >buf_flush_recv_note_modification( > buf_block_t* block, > dulint start_lsn, > dulint end_lsn) >{ > ; > ; > ; > mutex_enter_func((&(buf_pool->mutex)), "./../include/buf0flu.ic", 87); > ; > block->newest_modification = end_lsn; > if (ut_dulint_is_zero(block->oldest_modification)) { > block->oldest_modification = start_lsn; > ; > buf_flush_insert_sorted_into_flush_list(block); > } else { > ; > } > mutex_exit(&(buf_pool->mutex)); >} >void >buf_LRU_try_free_flushed_blocks(void); >ulint >buf_LRU_buf_pool_running_out(void); >void >buf_LRU_invalidate_tablespace( > ulint id); >ulint >buf_LRU_get_recent_limit(void); >ulint >buf_LRU_search_and_free_block( > ulint n_iterations); >buf_block_t* >buf_LRU_get_free_block(void); >void >buf_LRU_block_free_non_file_page( > buf_block_t* block); >void >buf_LRU_add_block( > buf_block_t* block, > ulint old); >void >buf_LRU_make_block_young( > buf_block_t* block); >void >buf_LRU_make_block_old( > buf_block_t* block); >ulint >buf_LRU_validate(void); >void >buf_LRU_print(void); >ulint >buf_read_page( > ulint space, > ulint offset); >ulint >buf_read_ahead_linear( > ulint space, > ulint offset); >void >buf_read_ibuf_merge_pages( > ulint sync, > ulint* space_ids, > ib_longlong* space_versions, > ulint* page_nos, > ulint n_stored); >void >buf_read_recv_pages( > ulint sync, > ulint space, > ulint* page_nos, > ulint n_stored); >void >buf_print_diagnostic( > mtr_t* mtr, > const buf_block_t* block); >static inline >ulint >buf_block_peek_if_too_old( > buf_block_t* block) >{ > return(buf_pool->freed_page_clock >= block->freed_page_clock > + 1 + (buf_pool->curr_size / 1024)); >} >static inline >ulint >buf_pool_get_curr_size(void) >{ > return((buf_pool->n_frames) * (2 * 8192)); >} >static inline >ulint >buf_pool_get_max_size(void) >{ > return((buf_pool->n_frames) * (2 * 8192)); >} >static inline >buf_block_t* >buf_pool_get_nth_block( > buf_pool_t* buf_pool, > ulint i) >{ > ; > ; > return(i + buf_pool->blocks); >} >static inline >ulint >buf_pool_is_block( > void* ptr) >{ > if ((buf_pool->blocks <= (buf_block_t*)ptr) > && ((buf_block_t*)ptr < buf_pool->blocks + buf_pool->max_size)) { > return((1)); > } > return((0)); >} >static inline >dulint >buf_pool_get_oldest_modification(void) >{ > buf_block_t* block; > dulint lsn; > mutex_enter_func((&(buf_pool->mutex)), "./../include/buf0buf.ic", 115); > block = (buf_pool->flush_list).end; > if (block == ((void *)0)) { > lsn = ut_dulint_zero; > } else { > lsn = block->oldest_modification; > } > mutex_exit(&(buf_pool->mutex)); > return(lsn); >} >static inline >ulint >buf_pool_clock_tic(void) >{ > buf_pool->ulint_clock++; > return(buf_pool->ulint_clock); >} >static inline >buf_frame_t* >buf_block_get_frame( > buf_block_t* block) >{ > ; > ; > ; > ; > ; > return(block->frame); >} >static inline >ulint >buf_block_get_space( > buf_block_t* block) >{ > ; > ; > ; > do { if (__builtin_expect(!((ulint)(block->state == 213)), (0))) { ut_dbg_assertion_failed("block->state == BUF_BLOCK_FILE_PAGE", "./../include/buf0buf.ic", (ulint) 179); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/buf0buf.ic", (ulint) 179); } while (0); } while (0); > ; > return(block->space); >} >static inline >ulint >buf_block_get_page_no( > buf_block_t* block) >{ > ; > ; > ; > do { if (__builtin_expect(!((ulint)(block->state == 213)), (0))) { ut_dbg_assertion_failed("block->state == BUF_BLOCK_FILE_PAGE", "./../include/buf0buf.ic", (ulint) 197); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/buf0buf.ic", (ulint) 197); } while (0); } while (0); > ; > return(block->offset); >} >static inline >buf_block_t* >buf_block_align( > unsigned char* ptr) >{ > buf_block_t* block; > buf_frame_t* frame_zero; > ; > frame_zero = buf_pool->frame_zero; > if (__builtin_expect((ulint)ptr < (ulint)frame_zero, (0)) > || __builtin_expect((ulint)ptr > (ulint)(buf_pool->high_end), (0))) { > ut_print_timestamp(stderr); > fprintf(stderr, >"InnoDB: Error: trying to access a stray pointer %p\n" >"InnoDB: buf pool start is at %p, end at %p\n" >"InnoDB: Probable reason is database corruption or memory\n" >"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" >"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" >"InnoDB: how to force recovery.\n", > ptr, frame_zero, > buf_pool->high_end); > do { ut_dbg_assertion_failed(0, "./../include/buf0buf.ic", (ulint) 232); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } > block = *(buf_pool->blocks_of_frames + (((ulint)(ptr - frame_zero)) > >> 14)); > return(block); >} >static inline >buf_frame_t* >buf_frame_align( > unsigned char* ptr) >{ > buf_frame_t* frame; > ; > frame = ut_align_down(ptr, (2 * 8192)); > if (__builtin_expect((ulint)frame < (ulint)(buf_pool->frame_zero), (0)) > || __builtin_expect((ulint)frame >= (ulint)(buf_pool->high_end), (0))) { > ut_print_timestamp(stderr); > fprintf(stderr, >"InnoDB: Error: trying to access a stray pointer %p\n" >"InnoDB: buf pool start is at %p, end at %p\n" >"InnoDB: Probable reason is database corruption or memory\n" >"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" >"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" >"InnoDB: how to force recovery.\n", > ptr, buf_pool->frame_zero, > buf_pool->high_end); > do { ut_dbg_assertion_failed(0, "./../include/buf0buf.ic", (ulint) 268); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } > return(frame); >} >static inline >ulint >buf_frame_get_page_no( > unsigned char* ptr) >{ > return(buf_block_get_page_no(buf_block_align(ptr))); >} >static inline >ulint >buf_frame_get_space_id( > unsigned char* ptr) >{ > return(buf_block_get_space(buf_block_align(ptr))); >} >static inline >void >buf_ptr_get_fsp_addr( > unsigned char* ptr, > ulint* space, > fil_addr_t* addr) >{ > buf_block_t* block; > block = buf_block_align(ptr); > *space = buf_block_get_space(block); > addr->page = buf_block_get_page_no(block); > addr->boffset = ptr - buf_frame_align(ptr); >} >static inline >ulint >buf_frame_get_lock_hash_val( > unsigned char* ptr) >{ > buf_block_t* block; > block = buf_block_align(ptr); > return(block->lock_hash_val); >} >static inline >ib_mutex_t* >buf_frame_get_mutex( > unsigned char* ptr) >{ > buf_block_t* block; > block = buf_block_align(ptr); > return(&block->mutex); >} >static inline >unsigned char* >buf_frame_copy( > unsigned char* buf, > buf_frame_t* frame) >{ > ; > ut_memcpy(buf, frame, (2 * 8192)); > return(buf); >} >static inline >ulint >buf_page_address_fold( > ulint space, > ulint offset) >{ > return((space << 20) + space + offset); >} >static inline >ulint >buf_page_io_query( > buf_block_t* block) >{ > mutex_enter_func((&(buf_pool->mutex)), "./../include/buf0buf.ic", 395); > ; > ; > if (block->io_fix != 0) { > mutex_exit(&(buf_pool->mutex)); > return((1)); > } > mutex_exit(&(buf_pool->mutex)); > return((0)); >} >static inline >dulint >buf_frame_get_newest_modification( > buf_frame_t* frame) >{ > buf_block_t* block; > dulint lsn; > ; > block = buf_block_align(frame); > mutex_enter_func((&(buf_pool->mutex)), "./../include/buf0buf.ic", 428); > if (block->state == 213) { > lsn = block->newest_modification; > } else { > lsn = ut_dulint_zero; > } > mutex_exit(&(buf_pool->mutex)); > return(lsn); >} >static inline >dulint >buf_frame_modify_clock_inc( > buf_frame_t* frame) >{ > buf_block_t* block; > ; > block = buf_block_align(frame); > { if ((block->modify_clock).low == 0xFFFFFFFFUL) { (block->modify_clock).high = (block->modify_clock).high + 1; (block->modify_clock).low = 0; } else { (block->modify_clock).low = (block->modify_clock).low + 1; }}; > return(block->modify_clock); >} >static inline >dulint >buf_block_modify_clock_inc( > buf_block_t* block) >{ > { if ((block->modify_clock).low == 0xFFFFFFFFUL) { (block->modify_clock).high = (block->modify_clock).high + 1; (block->modify_clock).low = 0; } else { (block->modify_clock).low = (block->modify_clock).low + 1; }}; > return(block->modify_clock); >} >static inline >dulint >buf_block_get_modify_clock( > buf_block_t* block) >{ > return(block->modify_clock); >} >static inline >void >buf_block_buf_fix_inc( > buf_block_t* block) >{ > block->buf_fix_count++; >} >static inline >buf_block_t* >buf_page_hash_get( > ulint space, > ulint offset) >{ > buf_block_t* block; > ulint fold; > ; > fold = buf_page_address_fold(space, offset); > { (block) = (hash_get_nth_cell(buf_pool->page_hash, hash_calc_hash(fold, buf_pool->page_hash))->node); while ((block) != ((void *)0)) { if ((block->space == space) && (block->offset == offset)) { break; } else { (block) = ((block)->hash); } }}; > do { if (__builtin_expect(!((ulint)(block == ((void *)0) || block->state == 213)), (0))) { ut_dbg_assertion_failed("block == NULL || block->state == BUF_BLOCK_FILE_PAGE", "./../include/buf0buf.ic", (ulint) 567); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/buf0buf.ic", (ulint) 567); } while (0); } while (0); > return(block); >} >static inline >buf_frame_t* >buf_page_get_release_on_io( > ulint space, > ulint offset, > buf_frame_t* guess, > ulint rw_latch, > ulint savepoint, > mtr_t* mtr) >{ > buf_frame_t* frame; > frame = buf_page_get_gen(space, offset, rw_latch, guess, > 11, > "./../include/buf0buf.ic", 596, > mtr); > if (frame != ((void *)0)) { > return(frame); > } > mtr_rollback_to_savepoint(mtr, savepoint); > buf_page_get_gen( space, offset, 1, ((void *)0), 10, "./../include/buf0buf.ic", 608, mtr); > mtr_rollback_to_savepoint(mtr, savepoint); > return(((void *)0)); >} >static inline >void >buf_page_release( > buf_block_t* block, > ulint rw_latch, > mtr_t* mtr) >{ > ; > do { if (__builtin_expect(!((ulint)(block->state == 213)), (0))) { ut_dbg_assertion_failed("block->state == BUF_BLOCK_FILE_PAGE", "./../include/buf0buf.ic", (ulint) 632); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/buf0buf.ic", (ulint) 632); } while (0); } while (0); > if (rw_latch == 2 && mtr->modifications) { > mutex_enter_func((&buf_pool->mutex), "./../include/buf0buf.ic", 635); > buf_flush_note_modification(block, mtr); > mutex_exit(&buf_pool->mutex); > } > mutex_enter_func((&block->mutex), "./../include/buf0buf.ic", 640); > if (__builtin_expect(block->buf_fix_count == 0, (0))) { > buf_print_diagnostic(mtr, block); > do { ut_dbg_assertion_failed(0, "./../include/buf0buf.ic", (ulint) 645); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } > --block->buf_fix_count; > mutex_exit(&block->mutex); > if (rw_latch == 1) { > rw_lock_s_unlock_func(&(block->lock)); > } else if (rw_latch == 2) { > rw_lock_x_unlock_func(&(block->lock)); > } >} >static inline >unsigned char* >mlog_open( > mtr_t* mtr, > ulint size) >{ > dyn_array_t* mlog; > mtr->modifications = (1); > if (mtr_get_log_mode(mtr) == 22) { > return(((void *)0)); > } > mlog = &(mtr->log); > return(dyn_array_open(mlog, size)); >} >static inline >void >mlog_close( > mtr_t* mtr, > unsigned char* ptr) >{ > dyn_array_t* mlog; > ; > mlog = &(mtr->log); > dyn_array_close(mlog, ptr); >} >static inline >void >mlog_catenate_ulint( > mtr_t* mtr, > ulint val, > ulint type) >{ > dyn_array_t* mlog; > unsigned char* ptr; > if (mtr_get_log_mode(mtr) == 22) { > return; > } > mlog = &(mtr->log); > ; > ; > ; > ptr = dyn_array_push(mlog, type); > if (type == ((unsigned char)4)) { > mach_write_to_4(ptr, val); > } else if (type == ((unsigned char)2)) { > mach_write_to_2(ptr, val); > } else { > ; > mach_write_to_1(ptr, val); > } >} >static inline >void >mlog_catenate_ulint_compressed( > mtr_t* mtr, > ulint val) >{ > unsigned char* log_ptr; > log_ptr = mlog_open(mtr, 10); > if (log_ptr == ((void *)0)) { > return; > } > log_ptr += mach_write_compressed(log_ptr, val); > mlog_close(mtr, log_ptr); >} >static inline >void >mlog_catenate_dulint_compressed( > mtr_t* mtr, > dulint val) >{ > unsigned char* log_ptr; > log_ptr = mlog_open(mtr, 15); > if (log_ptr == ((void *)0)) { > return; > } > log_ptr += mach_dulint_write_compressed(log_ptr, val); > mlog_close(mtr, log_ptr); >} >static inline >unsigned char* >mlog_write_initial_log_record_fast( > unsigned char* ptr, > unsigned char type, > unsigned char* log_ptr, > mtr_t* mtr) >{ > buf_block_t* block; > ulint space; > ulint offset; > ; > ; > ; > block = buf_block_align(ptr); > space = buf_block_get_space(block); > offset = buf_block_get_page_no(block); > mach_write_to_1(log_ptr, type); > log_ptr++; > log_ptr += mach_write_compressed(log_ptr, space); > log_ptr += mach_write_compressed(log_ptr, offset); > mtr->n_log_recs++; > return(log_ptr); >} >static inline >unsigned char* >mlog_write_initial_log_record_for_file_op( > ulint type, > ulint space_id, > ulint page_no, > unsigned char* log_ptr, > mtr_t* mtr) >{ > ; > mach_write_to_1(log_ptr, type); > log_ptr++; > log_ptr += mach_write_compressed(log_ptr, space_id); > log_ptr += mach_write_compressed(log_ptr, page_no); > mtr->n_log_recs++; > return(log_ptr); >} >typedef unsigned char flst_base_node_t; >typedef unsigned char flst_node_t; >static inline >void >flst_init( > flst_base_node_t* base, > mtr_t* mtr); >void >flst_add_last( > flst_base_node_t* base, > flst_node_t* node, > mtr_t* mtr); >void >flst_add_first( > flst_base_node_t* base, > flst_node_t* node, > mtr_t* mtr); >void >flst_insert_after( > flst_base_node_t* base, > flst_node_t* node1, > flst_node_t* node2, > mtr_t* mtr); >void >flst_insert_before( > flst_base_node_t* base, > flst_node_t* node2, > flst_node_t* node3, > mtr_t* mtr); >void >flst_remove( > flst_base_node_t* base, > flst_node_t* node2, > mtr_t* mtr); >void >flst_cut_end( > flst_base_node_t* base, > flst_node_t* node2, > ulint n_nodes, > mtr_t* mtr); >void >flst_truncate_end( > flst_base_node_t* base, > flst_node_t* node2, > ulint n_nodes, > mtr_t* mtr); >static inline >ulint >flst_get_len( > flst_base_node_t* base, > mtr_t* mtr); >static inline >fil_addr_t >flst_get_first( > flst_base_node_t* base, > mtr_t* mtr); >static inline >fil_addr_t >flst_get_last( > flst_base_node_t* base, > mtr_t* mtr); >static inline >fil_addr_t >flst_get_next_addr( > flst_node_t* node, > mtr_t* mtr); >static inline >fil_addr_t >flst_get_prev_addr( > flst_node_t* node, > mtr_t* mtr); >static inline >void >flst_write_addr( > fil_faddr_t* faddr, > fil_addr_t addr, > mtr_t* mtr); >static inline >fil_addr_t >flst_read_addr( > fil_faddr_t* faddr, > mtr_t* mtr); >ulint >flst_validate( > flst_base_node_t* base, > mtr_t* mtr1); >void >flst_print( > flst_base_node_t* base, > mtr_t* mtr); >static inline >unsigned char* >fut_get_ptr( > ulint space, > fil_addr_t addr, > ulint rw_latch, > mtr_t* mtr); >static inline >unsigned char* >fut_get_ptr( > ulint space, > fil_addr_t addr, > ulint rw_latch, > mtr_t* mtr) >{ > unsigned char* ptr; > ; > ; > ; > ptr = buf_page_get_gen( space, addr.page, rw_latch, ((void *)0), 10, "./../include/fut0fut.ic", 31, mtr) + addr.boffset; > return(ptr); >} >static inline >void >flst_write_addr( > fil_faddr_t* faddr, > fil_addr_t addr, > mtr_t* mtr) >{ > ; > ; > mlog_write_ulint(faddr + 0, addr.page, ((unsigned char)4), mtr); > mlog_write_ulint(faddr + 4, addr.boffset, > ((unsigned char)2), mtr); >} >static inline >fil_addr_t >flst_read_addr( > fil_faddr_t* faddr, > mtr_t* mtr) >{ > fil_addr_t addr; > ; > addr.page = mtr_read_ulint(faddr + 0, ((unsigned char)4), mtr); > addr.boffset = mtr_read_ulint(faddr + 4, ((unsigned char)2), > mtr); > return(addr); >} >static inline >void >flst_init( > flst_base_node_t* base, > mtr_t* mtr) >{ > ; > mlog_write_ulint(base + 0, 0, ((unsigned char)4), mtr); > flst_write_addr(base + 4, fil_addr_null, mtr); > flst_write_addr(base + (4 + 6), fil_addr_null, mtr); >} >static inline >ulint >flst_get_len( > flst_base_node_t* base, > mtr_t* mtr) >{ > return(mtr_read_ulint(base + 0, ((unsigned char)4), mtr)); >} >static inline >fil_addr_t >flst_get_first( > flst_base_node_t* base, > mtr_t* mtr) >{ > return(flst_read_addr(base + 4, mtr)); >} >static inline >fil_addr_t >flst_get_last( > flst_base_node_t* base, > mtr_t* mtr) >{ > return(flst_read_addr(base + (4 + 6), mtr)); >} >static inline >fil_addr_t >flst_get_next_addr( > flst_node_t* node, > mtr_t* mtr) >{ > return(flst_read_addr(node + 6, mtr)); >} >static inline >fil_addr_t >flst_get_prev_addr( > flst_node_t* node, > mtr_t* mtr) >{ > return(flst_read_addr(node + 0, mtr)); >} >typedef unsigned char fseg_header_t; >void >fsp_init(void); >ulint >fsp_header_get_free_limit( > ulint space); >ulint >fsp_header_get_tablespace_size( > ulint space); >ulint >fsp_get_size_low( > ib_page_t* page); >ulint >fsp_header_get_space_id( > ib_page_t* page); >void >fsp_header_write_space_id( > ib_page_t* page, > ulint space_id); >void >fsp_header_init( > ulint space, > ulint size, > mtr_t* mtr); >void >fsp_header_inc_size( > ulint space, > ulint size_inc, > mtr_t* mtr); >ib_page_t* >fseg_create( > ulint space, > ulint page, > ulint byte_offset, > mtr_t* mtr); >ib_page_t* >fseg_create_general( > ulint space, > ulint page, > ulint byte_offset, > ulint has_done_reservation, > mtr_t* mtr); >ulint >fseg_n_reserved_pages( > fseg_header_t* header, > ulint* used, > mtr_t* mtr); >ulint >fseg_alloc_free_page( > fseg_header_t* seg_header, > ulint hint, > unsigned char direction, > mtr_t* mtr); >ulint >fseg_alloc_free_page_general( > fseg_header_t* seg_header, > ulint hint, > unsigned char direction, > ulint has_done_reservation, > mtr_t* mtr); >ulint >fsp_reserve_free_extents( > ulint* n_reserved, > ulint space, > ulint n_ext, > ulint alloc_type, > mtr_t* mtr); >ullint >fsp_get_available_space_in_free_extents( > ulint space); >void >fseg_free_page( > fseg_header_t* seg_header, > ulint space, > ulint page, > mtr_t* mtr); >void >fseg_free( > ulint space, > ulint page_no, > ulint offset); >ulint >fseg_free_step( > fseg_header_t* header, > mtr_t* mtr); >ulint >fseg_free_step_not_header( > fseg_header_t* header, > mtr_t* mtr); >static inline >ulint >fsp_descr_page( > ulint page_no); >unsigned char* >fsp_parse_init_file_page( > unsigned char* ptr, > unsigned char* end_ptr, > ib_page_t* page); >ulint >fsp_validate( > ulint space); >void >fsp_print( > ulint space); >ulint >fseg_validate( > fseg_header_t* header, > mtr_t* mtr2); >void >fseg_print( > fseg_header_t* header, > mtr_t* mtr); >static inline >ulint >fsp_descr_page( > ulint page_no) >{ > if (page_no % (2 * 8192) == 0) { > return((1)); > } > return((0)); >} >typedef struct read_view_struct read_view_t; >typedef struct cursor_view_struct cursor_view_t; >extern char trx_sys_mysql_master_log_name[]; >extern ib_longlong trx_sys_mysql_master_log_pos; >extern char trx_sys_mysql_bin_log_name[]; >extern ib_longlong trx_sys_mysql_bin_log_pos; >extern trx_sys_t* trx_sys; >extern trx_doublewrite_t* trx_doublewrite; >extern ulint trx_doublewrite_must_reset_space_ids; >extern ulint trx_sys_multiple_tablespace_format; >void >trx_sys_create_doublewrite_buf(void); >void >trx_sys_doublewrite_init_or_restore_pages( > ulint restore_corrupt_pages); >void >trx_sys_mark_upgraded_to_multiple_tablespaces(void); >ulint >trx_doublewrite_page_inside( > ulint page_no); >static inline >ulint >trx_sys_hdr_page( > ulint space, > ulint page_no); >void >trx_sys_init_at_db_start(void); >void >trx_sys_create(void); >ulint >trx_sysf_rseg_find_free( > mtr_t* mtr); >static inline >trx_rseg_t* >trx_sys_get_nth_rseg( > trx_sys_t* sys, > ulint n); >static inline >void >trx_sys_set_nth_rseg( > trx_sys_t* sys, > ulint n, > trx_rseg_t* rseg); >static inline >trx_sysf_t* >trx_sysf_get( > mtr_t* mtr); >static inline >ulint >trx_sysf_rseg_get_space( > trx_sysf_t* sys_header, > ulint i, > mtr_t* mtr); >static inline >ulint >trx_sysf_rseg_get_page_no( > trx_sysf_t* sys_header, > ulint i, > mtr_t* mtr); >static inline >void >trx_sysf_rseg_set_space( > trx_sysf_t* sys_header, > ulint i, > ulint space, > mtr_t* mtr); >static inline >void >trx_sysf_rseg_set_page_no( > trx_sysf_t* sys_header, > ulint i, > ulint page_no, > mtr_t* mtr); >static inline >dulint >trx_sys_get_new_trx_id(void); >static inline >dulint >trx_sys_get_new_trx_no(void); >static inline >void >trx_write_trx_id( > unsigned char* ptr, > dulint id); >static inline >dulint >trx_read_trx_id( > unsigned char* ptr); >static inline >trx_t* >trx_get_on_id( > dulint trx_id); >static inline >dulint >trx_list_get_min_trx_id(void); >static inline >ulint >trx_is_active( > dulint trx_id); >ulint >trx_in_trx_list( > trx_t* in_trx); >void >trx_sys_update_mysql_binlog_offset( > const char* file_name, > ib_longlong offset, > ulint field, > mtr_t* mtr); >void >trx_sys_print_mysql_binlog_offset(void); >void >trx_sys_print_mysql_master_log_pos(void); >struct trx_doublewrite_struct{ > ib_mutex_t mutex; > ulint block1; > ulint block2; > ulint first_free; > unsigned char* write_buf; > unsigned char* write_buf_unaligned; > buf_block_t** > buf_block_arr; >}; >struct trx_sys_struct{ > dulint max_trx_id; > struct { ulint count; trx_t * start; trx_t * end; } trx_list; > struct { ulint count; trx_t * start; trx_t * end; } mysql_trx_list; > struct { ulint count; trx_rseg_t * start; trx_rseg_t * end; } rseg_list; > trx_rseg_t* latest_rseg; > trx_rseg_t* rseg_array[256]; > ulint rseg_history_len; > struct { ulint count; read_view_t * start; read_view_t * end; } view_list; >}; >extern const char* srv_main_thread_op_info; >extern os_event_t srv_lock_timeout_thread_event; >extern ulint srv_lower_case_table_names; >extern ib_mutex_t srv_monitor_file_mutex; >extern FILE* srv_monitor_file; >extern ib_mutex_t srv_dict_tmpfile_mutex; >extern FILE* srv_dict_tmpfile; >extern ib_mutex_t srv_misc_tmpfile_mutex; >extern FILE* srv_misc_tmpfile; >extern char* srv_data_home; >extern ulint srv_file_per_table; >extern ulint srv_locks_unsafe_for_binlog; >extern ulint srv_n_data_files; >extern char** srv_data_file_names; >extern ulint* srv_data_file_sizes; >extern ulint* srv_data_file_is_raw_partition; >extern ulint srv_auto_extend_last_data_file; >extern ulint srv_last_file_size_max; >extern ulong srv_auto_extend_increment; >extern ulint srv_created_new_raw; >extern char** srv_log_group_home_dirs; >extern ulint srv_n_log_groups; >extern ulint srv_n_log_files; >extern ulint srv_log_file_size; >extern ulint srv_log_buffer_size; >extern ulong srv_flush_log_at_trx_commit; >extern unsigned char srv_latin1_ordering[256]; >extern ulint srv_pool_size; >extern ulint srv_awe_window_size; >extern ulint srv_mem_pool_size; >extern ulint srv_lock_table_size; >extern ulint srv_n_file_io_threads; >extern ulint srv_lock_wait_timeout; >extern char* srv_file_flush_method_str; >extern ulint srv_unix_file_flush_method; >extern ulint srv_win_file_flush_method; >extern ulint srv_max_n_open_files; >extern ulint srv_max_dirty_pages_pct; >extern ulint srv_force_recovery; >extern ulong srv_thread_concurrency; >extern ulong srv_commit_concurrency; >extern ulint srv_max_n_threads; >extern lint srv_conc_n_threads; >extern ulint srv_fast_shutdown; >extern ulint srv_innodb_status; >extern ulint srv_use_doublewrite_buf; >extern ulint srv_use_checksums; >extern ulint srv_set_thread_priorities; >extern int srv_query_thread_priority; >extern ulong srv_max_buf_pool_modified_pct; >extern ulong srv_max_purge_lag; >extern ulint srv_use_awe; >extern ulint srv_use_adaptive_hash_indexes; >extern ulint srv_n_rows_inserted; >extern ulint srv_n_rows_updated; >extern ulint srv_n_rows_deleted; >extern ulint srv_n_rows_read; >extern ulint srv_print_innodb_monitor; >extern ulint srv_print_innodb_lock_monitor; >extern ulint srv_print_innodb_tablespace_monitor; >extern ulint srv_print_verbose_log; >extern ulint srv_print_innodb_table_monitor; >extern ulint srv_lock_timeout_and_monitor_active; >extern ulint srv_error_monitor_active; >extern ulong srv_n_spin_wait_rounds; >extern ulong srv_n_free_tickets_to_enter; >extern ulong srv_thread_sleep_delay; >extern ulint srv_spin_wait_delay; >extern ulint srv_priority_boost; >extern ulint srv_pool_size; >extern ulint srv_mem_pool_size; >extern ulint srv_lock_table_size; >extern ulint srv_sim_disk_wait_pct; >extern ulint srv_sim_disk_wait_len; >extern ulint srv_sim_disk_wait_by_yield; >extern ulint srv_sim_disk_wait_by_wait; >extern ulint srv_measure_contention; >extern ulint srv_measure_by_spin; >extern ulint srv_print_thread_releases; >extern ulint srv_print_lock_waits; >extern ulint srv_print_buf_io; >extern ulint srv_print_log_io; >extern ulint srv_print_parsed_sql; >extern ulint srv_print_latch_waits; >extern ulint srv_test_nocache; >extern ulint srv_test_cache_evict; >extern ulint srv_test_extra_mutexes; >extern ulint srv_test_sync; >extern ulint srv_test_n_threads; >extern ulint srv_test_n_loops; >extern ulint srv_test_n_free_rnds; >extern ulint srv_test_n_reserved_rnds; >extern ulint srv_test_n_mutexes; >extern ulint srv_test_array_size; >extern ulint srv_activity_count; >extern ulint srv_fatal_semaphore_wait_threshold; >extern ulint srv_dml_needed_delay; >extern ib_mutex_t* kernel_mutex_temp; >extern const char* srv_io_thread_op_info[]; >extern const char* srv_io_thread_function[]; >extern ulint srv_log_write_requests; >extern ulint srv_log_writes; >extern ulint srv_os_log_written; >extern ulint srv_os_log_pending_writes; >extern ulint srv_log_waits; >extern ulint srv_data_read; >extern ulint srv_data_written; >extern ulint srv_dblwr_writes; >extern ulint srv_dblwr_pages_written; >extern ulint srv_buf_pool_write_requests; >extern ulint srv_buf_pool_wait_free; >extern ulint srv_buf_pool_flushed; >extern ulint srv_buf_pool_reads; >extern ulint srv_read_ahead_seq; >extern ulint srv_read_ahead_rnd; >typedef struct export_var_struct export_struc; >extern export_struc export_vars; >typedef struct srv_sys_struct srv_sys_t; >extern srv_sys_t* srv_sys; >ulint >srv_boot(void); >void >srv_init(void); >void >srv_free(void); >void >srv_general_init(void); >ulint >srv_get_n_threads(void); >ulint >srv_get_thread_type(void); >void >srv_set_io_thread_op_info( > ulint i, > const char* str); >ulint >srv_release_threads( > ulint type, > ulint n); >void* >srv_master_thread( > void* arg); >void >srv_active_wake_master_thread(void); >void >srv_wake_master_thread(void); >void >srv_conc_enter_innodb( > trx_t* trx); >void >srv_conc_force_enter_innodb( > trx_t* trx); >void >srv_conc_force_exit_innodb( > trx_t* trx); >void >srv_conc_exit_innodb( > trx_t* trx); >void >srv_suspend_mysql_thread( > que_thr_t* thr); >void >srv_release_mysql_thread_if_suspended( > que_thr_t* thr); >void* >srv_lock_timeout_and_monitor_thread( > void* arg); >void* >srv_error_monitor_thread( > void* arg); >void >srv_printf_innodb_monitor( > FILE* file, > ulint* trx_start, > ulint* trx_end); >void >srv_export_innodb_status(void); >typedef struct srv_slot_struct srv_slot_t; >typedef srv_slot_t srv_table_t; >struct export_var_struct{ > ulint innodb_data_pending_reads; > ulint innodb_data_pending_writes; > ulint innodb_data_pending_fsyncs; > ulint innodb_data_fsyncs; > ulint innodb_data_read; > ulint innodb_data_writes; > ulint innodb_data_written; > ulint innodb_data_reads; > ulint innodb_buffer_pool_pages_total; > ulint innodb_buffer_pool_pages_data; > ulint innodb_buffer_pool_pages_dirty; > ulint innodb_buffer_pool_pages_misc; > ulint innodb_buffer_pool_pages_free; > ulint innodb_buffer_pool_read_requests; > ulint innodb_buffer_pool_reads; > ulint innodb_buffer_pool_wait_free; > ulint innodb_buffer_pool_pages_flushed; > ulint innodb_buffer_pool_write_requests; > ulint innodb_buffer_pool_read_ahead_seq; > ulint innodb_buffer_pool_read_ahead_rnd; > ulint innodb_dblwr_pages_written; > ulint innodb_dblwr_writes; > ulint innodb_log_waits; > ulint innodb_log_write_requests; > ulint innodb_log_writes; > ulint innodb_os_log_written; > ulint innodb_os_log_fsyncs; > ulint innodb_os_log_pending_writes; > ulint innodb_os_log_pending_fsyncs; > ulint innodb_page_size; > ulint innodb_pages_created; > ulint innodb_pages_read; > ulint innodb_pages_written; > ulint innodb_row_lock_waits; > ulint innodb_row_lock_current_waits; > ib_longlong innodb_row_lock_time; > ulint innodb_row_lock_time_avg; > ulint innodb_row_lock_time_max; > ulint innodb_rows_read; > ulint innodb_rows_inserted; > ulint innodb_rows_updated; > ulint innodb_rows_deleted; >}; >struct srv_sys_struct{ > os_event_t operational; > srv_table_t* threads; > struct { ulint count; que_thr_t * start; que_thr_t * end; } > tasks; > dict_index_t* dummy_ind1; > dict_index_t* dummy_ind2; >}; >extern ulint srv_n_threads_active[]; >typedef struct sess_struct sess_t; >struct xid_t { > long formatID; > long gtrid_length; > long bqual_length; > char data[128]; >}; >typedef struct xid_t XID; >extern ulint trx_n_mysql_transactions; >static inline >void >trx_reset_new_rec_lock_info( > trx_t* trx); >static inline >void >trx_register_new_rec_lock( > trx_t* trx, > dict_index_t* index); >static inline >ulint >trx_new_rec_locks_contain( > trx_t* trx, > dict_index_t* index); >void >trx_search_latch_release_if_reserved( > trx_t* trx); >void >trx_set_detailed_error( > trx_t* trx, > const char* msg); >void >trx_set_detailed_error_from_file( > trx_t* trx, > FILE* file); >void* >trx_get_error_info( > trx_t* trx); >trx_t* >trx_create( > sess_t* sess); >trx_t* >trx_allocate_for_mysql(void); >trx_t* >trx_allocate_for_background(void); >void >trx_free( > trx_t* trx); >void >trx_free_for_mysql( > trx_t* trx); >void >trx_free_for_background( > trx_t* trx); >void >trx_lists_init_at_db_start(void); >ulint >trx_start( > trx_t* trx, > ulint rseg_id); >ulint >trx_start_low( > trx_t* trx, > ulint rseg_id); >static inline >void >trx_start_if_not_started( > trx_t* trx); >static inline >void >trx_start_if_not_started_low( > trx_t* trx); >void >trx_start_if_not_started_noninline( > trx_t* trx); >void >trx_commit_off_kernel( > trx_t* trx); >void >trx_cleanup_at_db_startup( > trx_t* trx); >ulint >trx_commit_for_mysql( > trx_t* trx); >ulint >trx_prepare_for_mysql( > trx_t* trx); >int >trx_recover_for_mysql( > XID* xid_list, > ulint len); >trx_t * >trx_get_trx_by_xid( > XID* xid); >ulint >trx_commit_complete_for_mysql( > trx_t* trx); >void >trx_mark_sql_stat_end( > trx_t* trx); >read_view_t* >trx_assign_read_view( > trx_t* trx); >void >trx_end_lock_wait( > trx_t* trx); >ulint >trx_sig_send( > trx_t* trx, > ulint type, > ulint sender, > que_thr_t* receiver_thr, > trx_savept_t* savept, > que_thr_t** next_thr); >void >trx_sig_reply( > trx_sig_t* sig, > que_thr_t** next_thr); >void >trx_sig_remove( > trx_t* trx, > trx_sig_t* sig); >void >trx_sig_start_handle( > trx_t* trx, > que_thr_t** next_thr); >void >trx_end_signal_handling( > trx_t* trx); >commit_node_t* >commit_node_create( > mem_heap_t* heap); >que_thr_t* >trx_commit_step( > que_thr_t* thr); >void >trx_print( > FILE* f, > trx_t* trx, > uint max_query_len); >ulint >trx_is_interrupted( > trx_t* trx); >struct trx_sig_struct{ > ulint type; > ulint state; > ulint sender; > que_thr_t* receiver; > trx_savept_t savept; > struct { trx_sig_t * prev; trx_sig_t * next; } > signals; > struct { trx_sig_t * prev; trx_sig_t * next; } > reply_signals; >}; >struct trx_struct{ > ulint magic_n; > const char* op_info; > ulint type; > ulint conc_state; > time_t start_time; > ulint isolation_level; > ulint check_foreigns; > ulint check_unique_secondary; > dulint id; > XID xid; > ulint support_xa; > dulint no; > ulint flush_log_later; > ulint must_flush_log_later; > dulint commit_lsn; > ulint dict_operation; > dulint table_id; > int active_trans; > void* mysql_thd; > char** mysql_query_str; > const char* mysql_log_file_name; > ib_longlong mysql_log_offset; > const char* mysql_master_log_file_name; > ib_longlong mysql_master_log_pos; > char* repl_wait_binlog_name; > ib_longlong repl_wait_binlog_pos; > os_thread_id_t mysql_thread_id; > ulint mysql_process_no; > ulint n_mysql_tables_in_use; > ulint mysql_n_tables_locked; > ulint dict_operation_lock_mode; > ulint has_search_latch; > ulint search_latch_timeout; > ulint declared_to_be_inside_innodb; > ulint n_tickets_to_enter_innodb; > ib_lock_t* auto_inc_lock; > dict_index_t* new_rec_locks[2]; > struct { trx_t * prev; trx_t * next; } > trx_list; > struct { trx_t * prev; trx_t * next; } > mysql_trx_list; > ulint error_state; > void* error_info; > sess_t* sess; > ulint que_state; > que_t* graph; > ulint n_active_thrs; > ulint handling_signals; > que_t* graph_before_signal_handling; > trx_sig_t sig; > struct { ulint count; trx_sig_t * start; trx_sig_t * end; } > signals; > struct { ulint count; trx_sig_t * start; trx_sig_t * end; } > reply_signals; > ib_lock_t* wait_lock; > ulint was_chosen_as_deadlock_victim; > time_t wait_started; > struct { ulint count; que_thr_t * start; que_thr_t * end; } > wait_thrs; > ulint deadlock_mark; > mem_heap_t* lock_heap; > struct { ulint count; ib_lock_t * start; ib_lock_t * end; } > trx_locks; > mem_heap_t* global_read_view_heap; > read_view_t* global_read_view; > read_view_t* read_view; > struct { ulint count; trx_named_savept_t * start; trx_named_savept_t * end; } > trx_savepoints; > ib_mutex_t undo_mutex; > dulint undo_no; > trx_savept_t last_sql_stat_start; > trx_rseg_t* rseg; > trx_undo_t* insert_undo; > trx_undo_t* update_undo; > dulint roll_limit; > ulint pages_undone; > trx_undo_arr_t* undo_no_arr; > char detailed_error[256]; >}; >struct commit_node_struct{ > que_common_t common; > ulint state; >}; >static inline >void >trx_start_if_not_started( > trx_t* trx) >{ > ; > if (trx->conc_state == 1) { > trx_start(trx, ((ulint)(-1))); > } >} >static inline >void >trx_start_if_not_started_low( > trx_t* trx) >{ > ; > if (trx->conc_state == 1) { > trx_start_low(trx, ((ulint)(-1))); > } >} >static inline >void >trx_reset_new_rec_lock_info( > trx_t* trx) >{ > trx->new_rec_locks[0] = ((void *)0); > trx->new_rec_locks[1] = ((void *)0); >} >static inline >void >trx_register_new_rec_lock( > trx_t* trx, > dict_index_t* index) >{ > if (trx->new_rec_locks[0] == ((void *)0)) { > trx->new_rec_locks[0] = index; > return; > } > if (trx->new_rec_locks[0] == index) { > return; > } > if (trx->new_rec_locks[1] != ((void *)0)) { > return; > } > trx->new_rec_locks[1] = index; >} >static inline >ulint >trx_new_rec_locks_contain( > trx_t* trx, > dict_index_t* index) >{ > return(trx->new_rec_locks[0] == index > || trx->new_rec_locks[1] == index); >} >typedef unsigned char trx_sysf_rseg_t; >void >trx_sys_flush_max_trx_id(void); >static inline >ulint >trx_sys_hdr_page( > ulint space, > ulint page_no) >{ > if ((space == 0) && (page_no == 5)) { > return((1)); > } > return((0)); >} >static inline >trx_rseg_t* >trx_sys_get_nth_rseg( > trx_sys_t* sys, > ulint n) >{ > ; > return(sys->rseg_array[n]); >} >static inline >void >trx_sys_set_nth_rseg( > trx_sys_t* sys, > ulint n, > trx_rseg_t* rseg) >{ > ; > sys->rseg_array[n] = rseg; >} >static inline >trx_sysf_t* >trx_sysf_get( > mtr_t* mtr) >{ > trx_sysf_t* header; > ; > header = 38 + buf_page_get_gen( 0, 5, 2, ((void *)0), 10, "./../include/trx0sys.ic", 101, mtr); > return(header); >} >static inline >ulint >trx_sysf_rseg_get_space( > trx_sysf_t* sys_header, > ulint i, > mtr_t* mtr) >{ > ; > ; > return(mtr_read_ulint(sys_header + (8 + 10) > + i * 8 > + 0, ((unsigned char)4), mtr)); >} >static inline >ulint >trx_sysf_rseg_get_page_no( > trx_sysf_t* sys_header, > ulint i, > mtr_t* mtr) >{ > ; > ; > return(mtr_read_ulint(sys_header + (8 + 10) > + i * 8 > + 4, ((unsigned char)4), mtr)); >} >static inline >void >trx_sysf_rseg_set_space( > trx_sysf_t* sys_header, > ulint i, > ulint space, > mtr_t* mtr) >{ > ; > ; > mlog_write_ulint(sys_header + (8 + 10) > + i * 8 > + 0, > space, > ((unsigned char)4), mtr); >} >static inline >void >trx_sysf_rseg_set_page_no( > trx_sysf_t* sys_header, > ulint i, > ulint page_no, > mtr_t* mtr) >{ > ; > ; > mlog_write_ulint(sys_header + (8 + 10) > + i * 8 > + 4, > page_no, > ((unsigned char)4), mtr); >} >static inline >void >trx_write_trx_id( > unsigned char* ptr, > dulint id) >{ > ; > mach_write_to_6(ptr, id); >} >static inline >dulint >trx_read_trx_id( > unsigned char* ptr) >{ > ; > return(mach_read_from_6(ptr)); >} >static inline >trx_t* >trx_get_on_id( > dulint trx_id) >{ > trx_t* trx; > trx = (trx_sys->trx_list).start; > while (trx != ((void *)0)) { > if (0 == ut_dulint_cmp(trx_id, trx->id)) { > return(trx); > } > trx = (((trx)->trx_list).next); > } > return(((void *)0)); >} >static inline >dulint >trx_list_get_min_trx_id(void) >{ > trx_t* trx; > trx = (trx_sys->trx_list).end; > if (trx == ((void *)0)) { > return(trx_sys->max_trx_id); > } > return(trx->id); >} >static inline >ulint >trx_is_active( > dulint trx_id) >{ > trx_t* trx; > if (ut_dulint_cmp(trx_id, trx_list_get_min_trx_id()) < 0) { > return((0)); > } > if (ut_dulint_cmp(trx_id, trx_sys->max_trx_id) >= 0) { > return((1)); > } > trx = trx_get_on_id(trx_id); > if (trx && (trx->conc_state == 2 || > trx->conc_state == 4)) { > return((1)); > } > return((0)); >} >static inline >dulint >trx_sys_get_new_trx_id(void) >{ > dulint id; > if (ut_dulint_get_low(trx_sys->max_trx_id) > % 256 == 0) { > trx_sys_flush_max_trx_id(); > } > id = trx_sys->max_trx_id; > { if ((trx_sys->max_trx_id).low == 0xFFFFFFFFUL) { (trx_sys->max_trx_id).high = (trx_sys->max_trx_id).high + 1; (trx_sys->max_trx_id).low = 0; } else { (trx_sys->max_trx_id).low = (trx_sys->max_trx_id).low + 1; }}; > return(id); >} >static inline >dulint >trx_sys_get_new_trx_no(void) >{ > return(trx_sys_get_new_trx_id()); >} >static inline >dulint >trx_undo_build_roll_ptr( > ulint is_insert, > ulint rseg_id, > ulint page_no, > ulint offset); >static inline >void >trx_undo_decode_roll_ptr( > dulint roll_ptr, > ulint* is_insert, > ulint* rseg_id, > ulint* page_no, > ulint* offset); >static inline >ulint >trx_undo_roll_ptr_is_insert( > dulint roll_ptr); >static inline >void >trx_write_roll_ptr( > unsigned char* ptr, > dulint roll_ptr); >static inline >dulint >trx_read_roll_ptr( > unsigned char* ptr); >static inline >ib_page_t* >trx_undo_page_get( > ulint space, > ulint page_no, > mtr_t* mtr); >static inline >ib_page_t* >trx_undo_page_get_s_latched( > ulint space, > ulint page_no, > mtr_t* mtr); >static inline >trx_undo_rec_t* >trx_undo_page_get_prev_rec( > trx_undo_rec_t* rec, > ulint page_no, > ulint offset); >static inline >trx_undo_rec_t* >trx_undo_page_get_next_rec( > trx_undo_rec_t* rec, > ulint page_no, > ulint offset); >static inline >trx_undo_rec_t* >trx_undo_page_get_last_rec( > ib_page_t* undo_page, > ulint page_no, > ulint offset); >static inline >trx_undo_rec_t* >trx_undo_page_get_first_rec( > ib_page_t* undo_page, > ulint page_no, > ulint offset); >trx_undo_rec_t* >trx_undo_get_prev_rec( > trx_undo_rec_t* rec, > ulint page_no, > ulint offset, > mtr_t* mtr); >trx_undo_rec_t* >trx_undo_get_next_rec( > trx_undo_rec_t* rec, > ulint page_no, > ulint offset, > mtr_t* mtr); >trx_undo_rec_t* >trx_undo_get_first_rec( > ulint space, > ulint page_no, > ulint offset, > ulint mode, > mtr_t* mtr); >ulint >trx_undo_add_page( > trx_t* trx, > trx_undo_t* undo, > mtr_t* mtr); >void >trx_undo_truncate_end( > trx_t* trx, > trx_undo_t* undo, > dulint limit); >void >trx_undo_truncate_start( > trx_rseg_t* rseg, > ulint space, > ulint hdr_page_no, > ulint hdr_offset, > dulint limit); >ulint >trx_undo_lists_init( > trx_rseg_t* rseg); >trx_undo_t* >trx_undo_assign_undo( > trx_t* trx, > ulint type); >ib_page_t* >trx_undo_set_state_at_finish( > trx_rseg_t* rseg, > trx_t* trx, > trx_undo_t* undo, > mtr_t* mtr); >ib_page_t* >trx_undo_set_state_at_prepare( > trx_t* trx, > trx_undo_t* undo, > mtr_t* mtr); >void >trx_undo_update_cleanup( > trx_t* trx, > ib_page_t* undo_page, > mtr_t* mtr); >void >trx_undo_insert_cleanup( > trx_t* trx); >unsigned char* >trx_undo_parse_page_init( > unsigned char* ptr, > unsigned char* end_ptr, > ib_page_t* page, > mtr_t* mtr); >unsigned char* >trx_undo_parse_page_header( > ulint type, > unsigned char* ptr, > unsigned char* end_ptr, > ib_page_t* page, > mtr_t* mtr); >unsigned char* >trx_undo_parse_discard_latest( > unsigned char* ptr, > unsigned char* end_ptr, > ib_page_t* page, > mtr_t* mtr); >struct trx_undo_struct{ > ulint id; > ulint type; > ulint state; > ulint del_marks; > dulint trx_id; > XID xid; > ulint dict_operation; > dulint table_id; > trx_rseg_t* rseg; > ulint space; > ulint hdr_page_no; > ulint hdr_offset; > ulint last_page_no; > ulint size; > ulint empty; > ulint top_page_no; > ulint top_offset; > dulint top_undo_no; > ib_page_t* guess_page; > struct { trx_undo_t * prev; trx_undo_t * next; } undo_list; >}; >static inline >dulint >trx_undo_build_roll_ptr( > ulint is_insert, > ulint rseg_id, > ulint page_no, > ulint offset) >{ > ; > ; > return(ut_dulint_create(is_insert * 128 * 256 * 256 > + rseg_id * 256 * 256 > + (page_no / 256) / 256, > (page_no % (256 * 256)) * 256 * 256 > + offset)); >} >static inline >void >trx_undo_decode_roll_ptr( > dulint roll_ptr, > ulint* is_insert, > ulint* rseg_id, > ulint* page_no, > ulint* offset) >{ > ulint low; > ulint high; > ; > ; > high = ut_dulint_get_high(roll_ptr); > low = ut_dulint_get_low(roll_ptr); > *offset = low % (256 * 256); > *is_insert = high / (256 * 256 * 128); > *rseg_id = (high / (256 * 256)) % 128; > *page_no = (high % (256 * 256)) * 256 * 256 > + (low / 256) / 256; >} >static inline >ulint >trx_undo_roll_ptr_is_insert( > dulint roll_ptr) >{ > ulint high; > ; > ; > high = ut_dulint_get_high(roll_ptr); > return(high / (256 * 256 * 128)); >} >static inline >void >trx_write_roll_ptr( > unsigned char* ptr, > dulint roll_ptr) >{ > ; > mach_write_to_7(ptr, roll_ptr); >} >static inline >dulint >trx_read_roll_ptr( > unsigned char* ptr) >{ > ; > return(mach_read_from_7(ptr)); >} >static inline >ib_page_t* >trx_undo_page_get( > ulint space, > ulint page_no, > mtr_t* mtr) >{ > ib_page_t* page; > page = buf_page_get_gen( space, page_no, 2, ((void *)0), 10, "./../include/trx0undo.ic", 127, mtr); > return(page); >} >static inline >ib_page_t* >trx_undo_page_get_s_latched( > ulint space, > ulint page_no, > mtr_t* mtr) >{ > ib_page_t* page; > page = buf_page_get_gen( space, page_no, 1, ((void *)0), 10, "./../include/trx0undo.ic", 149, mtr); > return(page); >} >static inline >ulint >trx_undo_page_get_start( > ib_page_t* undo_page, > ulint page_no, > ulint offset) >{ > ulint start; > if (page_no == buf_frame_get_page_no(undo_page)) { > start = mach_read_from_2(offset + undo_page > + 18); > } else { > start = 38 + (6 + (2 * 6)); > } > return(start); >} >static inline >ulint >trx_undo_page_get_end( > ib_page_t* undo_page, > ulint page_no, > ulint offset) >{ > trx_ulogf_t* log_hdr; > ulint end; > if (page_no == buf_frame_get_page_no(undo_page)) { > log_hdr = undo_page + offset; > end = mach_read_from_2(log_hdr + 30); > if (end == 0) { > end = mach_read_from_2(undo_page + 38 > + 4); > } > } else { > end = mach_read_from_2(undo_page + 38 > + 4); > } > return(end); >} >static inline >trx_undo_rec_t* >trx_undo_page_get_prev_rec( > trx_undo_rec_t* rec, > ulint page_no, > ulint offset) >{ > ib_page_t* undo_page; > ulint start; > undo_page = buf_frame_align(rec); > start = trx_undo_page_get_start(undo_page, page_no, offset); > if (start + undo_page == rec) { > return(((void *)0)); > } > return(undo_page + mach_read_from_2(rec - 2)); >} >static inline >trx_undo_rec_t* >trx_undo_page_get_next_rec( > trx_undo_rec_t* rec, > ulint page_no, > ulint offset) >{ > ib_page_t* undo_page; > ulint end; > ulint next; > undo_page = buf_frame_align(rec); > end = trx_undo_page_get_end(undo_page, page_no, offset); > next = mach_read_from_2(rec); > if (next == end) { > return(((void *)0)); > } > return(undo_page + next); >} >static inline >trx_undo_rec_t* >trx_undo_page_get_last_rec( > ib_page_t* undo_page, > ulint page_no, > ulint offset) >{ > ulint start; > ulint end; > start = trx_undo_page_get_start(undo_page, page_no, offset); > end = trx_undo_page_get_end(undo_page, page_no, offset); > if (start == end) { > return(((void *)0)); > } > return(undo_page + mach_read_from_2(undo_page + end - 2)); >} >static inline >trx_undo_rec_t* >trx_undo_page_get_first_rec( > ib_page_t* undo_page, > ulint page_no, > ulint offset) >{ > ulint start; > ulint end; > start = trx_undo_page_get_start(undo_page, page_no, offset); > end = trx_undo_page_get_end(undo_page, page_no, offset); > if (start == end) { > return(((void *)0)); > } > return(undo_page + start); >} >static inline >dtype_t* >dict_col_get_type( > dict_col_t* col) >{ > ; > return(&col->type); >} >static inline >ulint >dict_col_get_no( > dict_col_t* col) >{ > ; > return(col->ind); >} >static inline >ulint >dict_col_get_clust_pos( > dict_col_t* col) >{ > ; > return(col->clust_pos); >} >static inline >dict_index_t* >dict_table_get_first_index( > dict_table_t* table) >{ > ; > ; > return((table->indexes).start); >} >static inline >dict_index_t* >dict_table_get_next_index( > dict_index_t* index) >{ > ; > ; > return((((index)->indexes).next)); >} >static inline >ulint >dict_table_get_n_user_cols( > dict_table_t* table) >{ > ; > ; > return(table->n_cols - 4); >} >static inline >ulint >dict_table_get_n_sys_cols( > dict_table_t* table __attribute__((unused))) >{ > ; > ; > ; > return(4); >} >static inline >ulint >dict_table_get_n_cols( > dict_table_t* table) >{ > ; > ; > return(table->n_cols); >} >static inline >dict_col_t* >dict_table_get_nth_col( > dict_table_t* table, > ulint pos) >{ > ; > ; > ; > return((table->cols) + pos); >} >static inline >dict_col_t* >dict_table_get_sys_col( > dict_table_t* table, > ulint sys) >{ > dict_col_t* col; > ; > ; > ; > col = dict_table_get_nth_col(table, table->n_cols > - 4 + sys); > ; > ; > return(col); >} >static inline >ulint >dict_table_get_sys_col_no( > dict_table_t* table, > ulint sys) >{ > ; > ; > ; > return(table->n_cols - 4 + sys); >} >static inline >ulint >dict_index_get_n_fields( > dict_index_t* index) >{ > ; > ; > return(index->n_fields); >} >static inline >ulint >dict_index_get_n_unique( > dict_index_t* index) >{ > ; > ; > ; > return(index->n_uniq); >} >static inline >ulint >dict_index_get_n_unique_in_tree( > dict_index_t* index) >{ > ; > ; > ; > if (index->type & 1) { > return(dict_index_get_n_unique(index)); > } > return(dict_index_get_n_fields(index)); >} >static inline >ulint >dict_index_get_n_ordering_defined_by_user( > dict_index_t* index) >{ > return(index->n_user_defined_cols); >} >static inline >dict_field_t* >dict_index_get_nth_field( > dict_index_t* index, > ulint pos) >{ > ; > ; > ; > return((index->fields) + pos); >} >static inline >ulint >dict_index_get_sys_col_pos( > dict_index_t* index, > ulint type) >{ > dict_col_t* col; > ; > ; > ; > col = dict_table_get_sys_col(index->table, type); > if (index->type & 1) { > return(col->clust_pos); > } > return(dict_index_get_nth_col_pos(index, > dict_table_get_sys_col_no(index->table, type))); >} >static inline >dict_tree_t* >dict_index_get_tree( > dict_index_t* index) >{ > ; > ; > return(index->tree); >} >static inline >ulint >dict_field_get_order( > dict_field_t* field) >{ > ; > return(field->order); >} >static inline >dict_col_t* >dict_field_get_col( > dict_field_t* field) >{ > ; > return(field->col); >} >static inline >dtype_t* >dict_index_get_nth_type( > dict_index_t* index, > ulint pos) >{ > return(dict_col_get_type(dict_field_get_col( > dict_index_get_nth_field(index, pos)))); >} >static inline >ulint >dict_index_get_nth_col_no( > dict_index_t* index, > ulint pos) >{ > return(dict_col_get_no(dict_field_get_col( > dict_index_get_nth_field(index, pos)))); >} >static inline >ulint >dict_tree_get_space( > dict_tree_t* tree) >{ > ; > ; > return(tree->space); >} >static inline >void >dict_tree_set_space( > dict_tree_t* tree, > ulint space) >{ > ; > ; > tree->space = space; >} >static inline >ulint >dict_tree_get_page( > dict_tree_t* tree) >{ > ; > ; > return(tree->page); >} >static inline >void >dict_tree_set_page( > dict_tree_t* tree, > ulint page) >{ > ; > ; > tree->page = page; >} >static inline >ulint >dict_tree_get_type( > dict_tree_t* tree) >{ > ; > ; > return(tree->type); >} >static inline >rw_lock_t* >dict_tree_get_lock( > dict_tree_t* tree) >{ > ; > ; > return(&(tree->lock)); >} >static inline >ulint >dict_tree_get_space_reserve( > dict_tree_t* tree) >{ > ; > tree = tree; > return((2 * 8192) / 16); >} >static inline >dict_table_t* >dict_table_check_if_in_cache_low( > const char* table_name) >{ > dict_table_t* table; > ulint table_fold; > ; > table_fold = ut_fold_string(table_name); > { (table) = (hash_get_nth_cell(dict_sys->table_hash, hash_calc_hash(table_fold, dict_sys->table_hash))->node); while ((table) != ((void *)0)) { if (ut_strcmp(table->name, table_name) == 0) { break; } else { (table) = ((table)->name_hash); } }}; > return(table); >} >static inline >dict_table_t* >dict_table_get_low( > const char* table_name) >{ > dict_table_t* table; > ; > table = dict_table_check_if_in_cache_low(table_name); > if (table == ((void *)0)) { > table = dict_load_table(table_name); > } > return(table); >} >static inline >dict_table_t* >dict_table_get_on_id_low( > dulint table_id, > trx_t* trx) >{ > dict_table_t* table; > ulint fold; > trx = trx; > fold = ut_fold_dulint(table_id); > { (table) = (hash_get_nth_cell(dict_sys->table_id_hash, hash_calc_hash(fold, dict_sys->table_id_hash))->node); while ((table) != ((void *)0)) { if (ut_dulint_cmp(table->id, table_id) == 0) { break; } else { (table) = ((table)->id_hash); } }}; > if (table == ((void *)0)) { > table = dict_load_table_on_id(table_id); > } > if (table != ((void *)0)) { > table->mem_fix++; > } > return(table); >} >static inline >void >dict_table_release( > dict_table_t* table) >{ > mutex_enter_func((&(dict_sys->mutex)), "./../include/dict0dict.ic", 611); > table->mem_fix--; > mutex_exit(&(dict_sys->mutex)); >} >static inline >dict_index_t* >dict_table_get_index( > dict_table_t* table, > const char* name) >{ > dict_index_t* index = ((void *)0); > index = dict_table_get_first_index(table); > while (index != ((void *)0)) { > if (ut_strcmp(name, index->name) == 0) { > break; > } > index = dict_table_get_next_index(index); > } > return(index); >} >typedef struct plan_struct plan_t; >typedef struct upd_struct upd_t; >typedef struct upd_field_struct upd_field_t; >typedef struct upd_node_struct upd_node_t; >typedef struct del_node_struct del_node_t; >typedef struct ins_node_struct ins_node_t; >typedef struct sel_node_struct sel_node_t; >typedef struct open_node_struct open_node_t; >typedef struct fetch_node_struct fetch_node_t; >typedef struct row_printf_node_struct row_printf_node_t; >typedef struct sel_buf_struct sel_buf_t; >typedef struct undo_node_struct undo_node_t; >typedef struct purge_node_struct purge_node_t; >tab_node_t* >tab_create_graph_create( > dict_table_t* table, > mem_heap_t* heap); >ind_node_t* >ind_create_graph_create( > dict_index_t* index, > mem_heap_t* heap); >que_thr_t* >dict_create_table_step( > que_thr_t* thr); >que_thr_t* >dict_create_index_step( > que_thr_t* thr); >ulint >dict_truncate_index_tree( > dict_table_t* table, > btr_pcur_t* pcur, > mtr_t* mtr); >void >dict_drop_index_tree( > rec_t* rec, > mtr_t* mtr); >ulint >dict_create_or_check_foreign_constraint_tables(void); >ulint >dict_create_add_foreigns_to_dictionary( > ulint start_id, > dict_table_t* table, > trx_t* trx); >struct tab_node_struct{ > que_common_t common; > dict_table_t* table; > ins_node_t* tab_def; > ins_node_t* col_def; > commit_node_t* commit_node; > ulint state; > ulint col_no; > mem_heap_t* heap; >}; >struct ind_node_struct{ > que_common_t common; > dict_index_t* index; > ins_node_t* ind_def; > ins_node_t* field_def; > commit_node_t* commit_node; > ulint state; > ulint page_no; > dict_table_t* table; > dtuple_t* ind_row; > ulint field_no; > mem_heap_t* heap; >}; >static inline >ulint >rec_get_next_offs( > rec_t* rec, > ulint comp); >static inline >void >rec_set_next_offs( > rec_t* rec, > ulint comp, > ulint next); >static inline >ulint >rec_get_n_fields_old( > rec_t* rec); >static inline >ulint >rec_get_n_fields( > rec_t* rec, > dict_index_t* index); >static inline >ulint >rec_get_n_owned( > rec_t* rec, > ulint comp); >static inline >void >rec_set_n_owned( > rec_t* rec, > ulint comp, > ulint n_owned); >static inline >ulint >rec_get_info_bits( > rec_t* rec, > ulint comp); >static inline >void >rec_set_info_bits( > rec_t* rec, > ulint comp, > ulint bits); >static inline >ulint >rec_get_status( > rec_t* rec); >static inline >void >rec_set_status( > rec_t* rec, > ulint bits); >static inline >ulint >rec_get_info_and_status_bits( > rec_t* rec, > ulint comp); >static inline >void >rec_set_info_and_status_bits( > rec_t* rec, > ulint comp, > ulint bits); >static inline >ulint >rec_get_deleted_flag( > rec_t* rec, > ulint comp); >static inline >void >rec_set_deleted_flag( > rec_t* rec, > ulint comp, > ulint flag); >static inline >ulint >rec_get_node_ptr_flag( > rec_t* rec); >static inline >ulint >rec_get_heap_no( > rec_t* rec, > ulint comp); >static inline >void >rec_set_heap_no( > rec_t* rec, > ulint comp, > ulint heap_no); >static inline >ulint >rec_get_1byte_offs_flag( > rec_t* rec); >ulint* >rec_get_offsets_func( > rec_t* rec, > dict_index_t* index, > ulint* offsets, > ulint n_fields, > mem_heap_t** heap, > const char* file, > ulint line); >static inline >ulint >rec_offs_validate( > rec_t* rec, > dict_index_t* index, > const ulint* offsets); >static inline >void >rec_offs_make_valid( > rec_t* rec, > dict_index_t* index, > ulint* offsets); >unsigned char* >rec_get_nth_field_old( > rec_t* rec, > ulint n, > ulint* len); >static inline >ulint >rec_get_nth_field_size( > rec_t* rec, > ulint n); >static inline >unsigned char* >rec_get_nth_field( > rec_t* rec, > const ulint* offsets, > ulint n, > ulint* len); >static inline >ulint >rec_offs_comp( > const ulint* offsets); >static inline >ulint >rec_offs_nth_extern( > const ulint* offsets, > ulint n); >static inline >ulint >rec_offs_nth_sql_null( > const ulint* offsets, > ulint n); >static inline >ulint >rec_offs_nth_size( > const ulint* offsets, > ulint n); >static inline >ulint >rec_offs_any_extern( > const ulint* offsets); >static inline >void >rec_set_nth_field_extern_bit( > rec_t* rec, > dict_index_t* index, > ulint i, > ulint val, > mtr_t* mtr); >void >rec_set_field_extern_bits( > rec_t* rec, > dict_index_t* index, > const ulint* vec, > ulint n_fields, > mtr_t* mtr); >static inline >void >rec_set_nth_field( > rec_t* rec, > const ulint* offsets, > ulint n, > const void* data, > ulint len); >static inline >ulint >rec_get_data_size_old( > rec_t* rec); >static inline >ulint >rec_offs_n_fields( > const ulint* offsets); >static inline >ulint >rec_offs_data_size( > const ulint* offsets); >static inline >ulint >rec_offs_extra_size( > const ulint* offsets); >static inline >ulint >rec_offs_size( > const ulint* offsets); >static inline >unsigned char* >rec_get_start( > rec_t* rec, > const ulint* offsets); >static inline >unsigned char* >rec_get_end( > rec_t* rec, > const ulint* offsets); >static inline >rec_t* >rec_copy( > void* buf, > const rec_t* rec, > const ulint* offsets); >rec_t* >rec_copy_prefix_to_buf( > rec_t* rec, > dict_index_t* index, > ulint n_fields, > unsigned char** buf, > ulint* buf_size); >static inline >ulint >rec_fold( > rec_t* rec, > const ulint* offsets, > ulint n_fields, > ulint n_bytes, > dulint tree_id); >rec_t* >rec_convert_dtuple_to_rec( > unsigned char* buf, > dict_index_t* index, > dtuple_t* dtuple); >static inline >ulint >rec_get_converted_extra_size( > ulint data_size, > ulint n_fields) > __attribute__((const)); >static inline >ulint >rec_get_converted_size( > dict_index_t* index, > dtuple_t* dtuple); >void >rec_copy_prefix_to_dtuple( > dtuple_t* tuple, > rec_t* rec, > dict_index_t* index, > ulint n_fields, > mem_heap_t* heap); >ulint >rec_validate( > rec_t* rec, > const ulint* offsets); >void >rec_print_old( > FILE* file, > rec_t* rec); >void >rec_print_new( > FILE* file, > rec_t* rec, > const ulint* offsets); >void >rec_print( > FILE* file, > rec_t* rec, > dict_index_t* index); >void >rec_set_nth_field_null_bit( > rec_t* rec, > ulint i, > ulint val); >void >rec_set_nth_field_sql_null( > rec_t* rec, > ulint n); >void >rec_set_nth_field_extern_bit_old( > rec_t* rec, > ulint i, > ulint val, > mtr_t* mtr); >void >rec_set_nth_field_extern_bit_new( > rec_t* rec, > dict_index_t* index, > ulint ith, > ulint val, > mtr_t* mtr); >static inline >ulint >rec_get_bit_field_1( > rec_t* rec, > ulint offs, > ulint mask, > ulint shift) >{ > ; > return((mach_read_from_1(rec - offs) & mask) >> shift); >} >static inline >void >rec_set_bit_field_1( > rec_t* rec, > ulint val, > ulint offs, > ulint mask, > ulint shift) >{ > ; > ; > ; > ; > ; > ; > mach_write_to_1(rec - offs, > (mach_read_from_1(rec - offs) & ~mask) > | (val << shift)); >} >static inline >ulint >rec_get_bit_field_2( > rec_t* rec, > ulint offs, > ulint mask, > ulint shift) >{ > ; > return((mach_read_from_2(rec - offs) & mask) >> shift); >} >static inline >void >rec_set_bit_field_2( > rec_t* rec, > ulint val, > ulint offs, > ulint mask, > ulint shift) >{ > ; > ; > ; > ; > ; > ; > ; > ; > mach_write_to_2(rec - offs, > (mach_read_from_2(rec - offs) & ~mask) > | (val << shift)); >} >static inline >ulint >rec_get_next_offs( > rec_t* rec, > ulint comp) >{ > ulint field_value; > ; > ; > field_value = mach_read_from_2(rec - 2); > if (comp) { > ; > if (field_value == 0) { > return(0); > } > return(ut_align_offset(rec + field_value, (2 * 8192))); > } else { > ; > return(field_value); > } >} >static inline >void >rec_set_next_offs( > rec_t* rec, > ulint comp, > ulint next) >{ > ; > ; > ; > ; > if (comp) { > ulint field_value; > if (next) { > field_value = (ulint)((lint)next > - (lint)ut_align_offset(rec, (2 * 8192))); > field_value &= 0xFFFFUL; > } else { > field_value = 0; > } > mach_write_to_2(rec - 2, field_value); > } else { > mach_write_to_2(rec - 2, next); > } >} >static inline >ulint >rec_get_n_fields_old( > rec_t* rec) >{ > ulint ret; > ; > ret = rec_get_bit_field_2(rec, 4, > 0x7FEUL, 1); > ; > ; > return(ret); >} >static inline >void >rec_set_n_fields_old( > rec_t* rec, > ulint n_fields) >{ > ; > ; > ; > rec_set_bit_field_2(rec, n_fields, 4, > 0x7FEUL, 1); >} >static inline >ulint >rec_get_status( > rec_t* rec) >{ > ulint ret; > ; > ret = rec_get_bit_field_1(rec, 3, > 0x7UL, 0); > ; > return(ret); >} >static inline >ulint >rec_get_n_fields( > rec_t* rec, > dict_index_t* index) >{ > ; > ; > if (__builtin_expect(!index->table->comp, (0))) { > return(rec_get_n_fields_old(rec)); > } > switch (rec_get_status(rec)) { > case 0: > return(dict_index_get_n_fields(index)); > case 1: > return(dict_index_get_n_unique_in_tree(index) + 1); > case 2: > case 3: > return(1); > default: > do { ut_dbg_assertion_failed(0, "./../include/rem0rec.ic", (ulint) 429); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > return(((ulint)(-1))); > } >} >static inline >ulint >rec_get_n_owned( > rec_t* rec, > ulint comp) >{ > ulint ret; > ; > ret = rec_get_bit_field_1(rec, > comp ? 5 : 6, > 0xFUL, 0); > ; > return(ret); >} >static inline >void >rec_set_n_owned( > rec_t* rec, > ulint comp, > ulint n_owned) >{ > ; > ; > rec_set_bit_field_1(rec, n_owned, > comp ? 5 : 6, > 0xFUL, 0); >} >static inline >ulint >rec_get_info_bits( > rec_t* rec, > ulint comp) >{ > ulint ret; > ; > ret = rec_get_bit_field_1(rec, > comp ? 5 : 6, > 0xF0UL, 0); > ; > return(ret); >} >static inline >void >rec_set_info_bits( > rec_t* rec, > ulint comp, > ulint bits) >{ > ; > ; > rec_set_bit_field_1(rec, bits, > comp ? 5 : 6, > 0xF0UL, 0); >} >static inline >void >rec_set_status( > rec_t* rec, > ulint bits) >{ > ; > ; > rec_set_bit_field_1(rec, bits, 3, > 0x7UL, 0); >} >static inline >ulint >rec_get_info_and_status_bits( > rec_t* rec, > ulint comp) >{ > ulint bits; > if (__builtin_expect(comp, ((ulint) 1 << 31))) { > bits = rec_get_info_bits(rec, (1)) | rec_get_status(rec); > } else { > bits = rec_get_info_bits(rec, (0)); > ; > } > return(bits); >} >static inline >void >rec_set_info_and_status_bits( > rec_t* rec, > ulint comp, > ulint bits) >{ > if (comp) { > rec_set_status(rec, bits & 0x7UL); > } else { > ; > } > rec_set_info_bits(rec, comp, bits & ~0x7UL); >} >static inline >ulint >rec_get_deleted_flag( > rec_t* rec, > ulint comp) >{ > if (__builtin_expect(comp, ((ulint) 1 << 31))) { > return(__builtin_expect(rec_get_bit_field_1(rec, 5, 0x20UL, 0), (0))); > } else { > return(__builtin_expect(rec_get_bit_field_1(rec, 6, 0x20UL, 0), (0))); > } >} >static inline >void >rec_set_deleted_flag( > rec_t* rec, > ulint comp, > ulint flag) >{ > ulint val; > val = rec_get_info_bits(rec, comp); > if (flag) { > val |= 0x20UL; > } else { > val &= ~0x20UL; > } > rec_set_info_bits(rec, comp, val); >} >static inline >ulint >rec_get_node_ptr_flag( > rec_t* rec) >{ > return(1 == rec_get_status(rec)); >} >static inline >ulint >rec_get_heap_no( > rec_t* rec, > ulint comp) >{ > ulint ret; > ; > ret = rec_get_bit_field_2(rec, > comp ? 4 : 5, > 0xFFF8UL, 3); > ; > return(ret); >} >static inline >void >rec_set_heap_no( > rec_t* rec, > ulint comp, > ulint heap_no) >{ > ; > rec_set_bit_field_2(rec, heap_no, > comp ? 4 : 5, > 0xFFF8UL, 3); >} >static inline >ulint >rec_get_1byte_offs_flag( > rec_t* rec) >{ > return(rec_get_bit_field_1(rec, 3, 0x1UL, > 0)); >} >static inline >void >rec_set_1byte_offs_flag( > rec_t* rec, > ulint flag) >{ > ; > rec_set_bit_field_1(rec, flag, 3, 0x1UL, > 0); >} >static inline >ulint >rec_1_get_field_end_info( > rec_t* rec, > ulint n) >{ > ; > ; > return(mach_read_from_1(rec - (6 + n + 1))); >} >static inline >ulint >rec_2_get_field_end_info( > rec_t* rec, > ulint n) >{ > ; > ; > return(mach_read_from_2(rec - (6 + 2 * n + 2))); >} >static inline >ulint >rec_offs_get_n_alloc( > const ulint* offsets) >{ > ulint n_alloc; > ; > n_alloc = offsets[0]; > ; > return(n_alloc); >} >static inline >void >rec_offs_set_n_alloc( > ulint* offsets, > ulint n_alloc) >{ > ; > ; > offsets[0] = n_alloc; >} >static inline >ulint >rec_offs_n_fields( > const ulint* offsets) >{ > ulint n_fields; > ; > n_fields = offsets[1]; > ; > ; > ; > return(n_fields); >} >static inline >ulint >rec_offs_validate( > rec_t* rec, > dict_index_t* index, > const ulint* offsets) >{ > ulint i = rec_offs_n_fields(offsets); > ulint last = ((ulint)(-2)); > ulint comp = *(offsets + 2) & ((ulint) 1 << 31); > if (rec) { > ; > if (!comp) { > do { if (__builtin_expect(!((ulint)(rec_get_n_fields_old(rec) >= i)), (0))) { ut_dbg_assertion_failed("rec_get_n_fields_old(rec) >= i", "./../include/rem0rec.ic", (ulint) 830); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/rem0rec.ic", (ulint) 830); } while (0); } while (0); > } > } > if (index) { > ulint max_n_fields; > ; > max_n_fields = ut_max( > dict_index_get_n_fields(index), > dict_index_get_n_unique_in_tree(index) + 1); > if (comp && rec) { > switch (rec_get_status(rec)) { > case 0: > break; > case 1: > max_n_fields = > dict_index_get_n_unique_in_tree(index) + 1; > break; > case 2: > case 3: > max_n_fields = 1; > break; > default: > do { ut_dbg_assertion_failed(0, "./../include/rem0rec.ic", (ulint) 852); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } > } > do { if (__builtin_expect(!((ulint)(!comp || index->n_def)), (0))) { ut_dbg_assertion_failed("!comp || index->n_def", "./../include/rem0rec.ic", (ulint) 856); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/rem0rec.ic", (ulint) 856); } while (0); } while (0); > do { if (__builtin_expect(!((ulint)(!index->n_def || i <= max_n_fields)), (0))) { ut_dbg_assertion_failed("!index->n_def || i <= max_n_fields", "./../include/rem0rec.ic", (ulint) 857); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/rem0rec.ic", (ulint) 857); } while (0); } while (0); > } > while (i--) { > ulint curr = (offsets + 2)[1 + i] & (((ulint) 1 << 30) - 1); > do { if (__builtin_expect(!((ulint)(curr <= last)), (0))) { ut_dbg_assertion_failed("curr <= last", "./../include/rem0rec.ic", (ulint) 861); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/rem0rec.ic", (ulint) 861); } while (0); } while (0); > last = curr; > } > return((1)); >} >static inline >void >rec_offs_make_valid( > rec_t* rec __attribute__((unused)), > dict_index_t* index __attribute__((unused)), > ulint* offsets __attribute__((unused))) >{ >} >static inline >unsigned char* >rec_get_nth_field( > rec_t* rec, > const ulint* offsets, > ulint n, > ulint* len) >{ > unsigned char* field; > ulint length; > ; > ; > ; > ; > if (__builtin_expect(n == 0, (0))) { > field = rec; > } else { > field = rec + ((offsets + 2)[n] & (((ulint) 1 << 30) - 1)); > } > length = (offsets + 2)[1 + n]; > if (length & ((ulint) 1 << 31)) { > length = 0xFFFFFFFF; > } else { > length &= (((ulint) 1 << 30) - 1); > length -= field - rec; > } > *len = length; > return(field); >} >static inline >ulint >rec_offs_comp( > const ulint* offsets) >{ > ; > return(*(offsets + 2) & ((ulint) 1 << 31)); >} >static inline >ulint >rec_offs_nth_extern( > const ulint* offsets, > ulint n) >{ > ; > ; > return(__builtin_expect((offsets + 2)[1 + n] & ((ulint) 1 << 30), (0))); >} >static inline >ulint >rec_offs_nth_sql_null( > const ulint* offsets, > ulint n) >{ > ; > ; > return(__builtin_expect((offsets + 2)[1 + n] & ((ulint) 1 << 31), (0))); >} >static inline >ulint >rec_offs_nth_size( > const ulint* offsets, > ulint n) >{ > ; > ; > if (!n) { > return((offsets + 2)[1 + n] & (((ulint) 1 << 30) - 1)); > } > return(((offsets + 2)[1 + n] - (offsets + 2)[n]) > & (((ulint) 1 << 30) - 1)); >} >static inline >ulint >rec_offs_any_extern( > const ulint* offsets) >{ > ulint i; > for (i = rec_offs_n_fields(offsets); i--; ) { > if (rec_offs_nth_extern(offsets, i)) { > return((1)); > } > } > return((0)); >} >static inline >void >rec_set_nth_field_extern_bit( > rec_t* rec, > dict_index_t* index, > ulint i, > ulint val, > mtr_t* mtr) >{ > if (__builtin_expect(index->table->comp, (1))) { > rec_set_nth_field_extern_bit_new(rec, index, i, val, mtr); > } else { > rec_set_nth_field_extern_bit_old(rec, i, val, mtr); > } >} >static inline >ulint >rec_1_get_prev_field_end_info( > rec_t* rec, > ulint n) >{ > ; > ; > return(mach_read_from_1(rec - (6 + n))); >} >static inline >ulint >rec_2_get_prev_field_end_info( > rec_t* rec, > ulint n) >{ > ; > ; > return(mach_read_from_2(rec - (6 + 2 * n))); >} >static inline >void >rec_1_set_field_end_info( > rec_t* rec, > ulint n, > ulint info) >{ > ; > ; > mach_write_to_1(rec - (6 + n + 1), info); >} >static inline >void >rec_2_set_field_end_info( > rec_t* rec, > ulint n, > ulint info) >{ > ; > ; > mach_write_to_2(rec - (6 + 2 * n + 2), info); >} >static inline >ulint >rec_1_get_field_start_offs( > rec_t* rec, > ulint n) >{ > ; > ; > if (n == 0) { > return(0); > } > return(rec_1_get_prev_field_end_info(rec, n) > & ~0x80UL); >} >static inline >ulint >rec_2_get_field_start_offs( > rec_t* rec, > ulint n) >{ > ; > ; > if (n == 0) { > return(0); > } > return(rec_2_get_prev_field_end_info(rec, n) > & ~(0x8000UL | 0x4000UL)); >} >static inline >ulint >rec_get_field_start_offs( > rec_t* rec, > ulint n) >{ > ; > ; > if (n == 0) { > return(0); > } > if (rec_get_1byte_offs_flag(rec)) { > return(rec_1_get_field_start_offs(rec, n)); > } > return(rec_2_get_field_start_offs(rec, n)); >} >static inline >ulint >rec_get_nth_field_size( > rec_t* rec, > ulint n) >{ > ulint os; > ulint next_os; > os = rec_get_field_start_offs(rec, n); > next_os = rec_get_field_start_offs(rec, n + 1); > ; > return(next_os - os); >} >static inline >void >rec_set_nth_field( > rec_t* rec, > const ulint* offsets, > ulint n, > const void* data, > ulint len) >{ > unsigned char* data2; > ulint len2; > ; > ; > if (len == 0xFFFFFFFF) { > ; > rec_set_nth_field_sql_null(rec, n); > return; > } > data2 = rec_get_nth_field(rec, offsets, n, &len2); > if (len2 == 0xFFFFFFFF) { > ; > rec_set_nth_field_null_bit(rec, n, (0)); > ; > } else { > ; > } > ut_memcpy(data2, data, len); >} >static inline >ulint >rec_get_data_size_old( > rec_t* rec) >{ > ; > return(rec_get_field_start_offs(rec, rec_get_n_fields_old(rec))); >} >static inline >void >rec_offs_set_n_fields( > ulint* offsets, > ulint n_fields) >{ > ; > ; > ; > ; > offsets[1] = n_fields; >} >static inline >ulint >rec_offs_data_size( > const ulint* offsets) >{ > ulint size; > ; > size = (offsets + 2)[rec_offs_n_fields(offsets)] > & (((ulint) 1 << 30) - 1); > ; > return(size); >} >static inline >ulint >rec_offs_extra_size( > const ulint* offsets) >{ > ulint size; > ; > size = *(offsets + 2) & ~((ulint) 1 << 31); > ; > return(size); >} >static inline >ulint >rec_offs_size( > const ulint* offsets) >{ > return(rec_offs_data_size(offsets) + rec_offs_extra_size(offsets)); >} >static inline >unsigned char* >rec_get_end( > rec_t* rec, > const ulint* offsets) >{ > return(rec + rec_offs_data_size(offsets)); >} >static inline >unsigned char* >rec_get_start( > rec_t* rec, > const ulint* offsets) >{ > return(rec - rec_offs_extra_size(offsets)); >} >static inline >rec_t* >rec_copy( > void* buf, > const rec_t* rec, > const ulint* offsets) >{ > ulint extra_len; > ulint data_len; > ; > ; > ; > extra_len = rec_offs_extra_size(offsets); > data_len = rec_offs_data_size(offsets); > ut_memcpy(buf, rec - extra_len, extra_len + data_len); > return((unsigned char*)buf + extra_len); >} >static inline >ulint >rec_get_converted_extra_size( > ulint data_size, > ulint n_fields) >{ > if (data_size <= 0x7FUL) { > return(6 + n_fields); > } > return(6 + 2 * n_fields); >} >ulint >rec_get_converted_size_new( > dict_index_t* index, > dtuple_t* dtuple); >static inline >ulint >rec_get_converted_size( > dict_index_t* index, > dtuple_t* dtuple) >{ > ulint data_size; > ulint extra_size; > ; > ; > ; > ; > if (__builtin_expect(index->table->comp, (1))) { > return(rec_get_converted_size_new(index, dtuple)); > } > data_size = dtuple_get_data_size(dtuple); > extra_size = rec_get_converted_extra_size( > data_size, dtuple_get_n_fields(dtuple)); > return(data_size + extra_size); >} >static inline >ulint >rec_fold( > rec_t* rec, > const ulint* offsets, > ulint n_fields, > ulint n_bytes, > dulint tree_id) >{ > ulint i; > unsigned char* data; > ulint len; > ulint fold; > ulint n_fields_rec; > ; > ; > ; > n_fields_rec = rec_offs_n_fields(offsets); > ; > ; > if (n_fields > n_fields_rec) { > n_fields = n_fields_rec; > } > if (n_fields == n_fields_rec) { > n_bytes = 0; > } > fold = ut_fold_dulint(tree_id); > for (i = 0; i < n_fields; i++) { > data = rec_get_nth_field(rec, offsets, i, &len); > if (len != 0xFFFFFFFF) { > fold = ut_fold_ulint_pair(fold, > ut_fold_binary(data, len)); > } > } > if (n_bytes > 0) { > data = rec_get_nth_field(rec, offsets, i, &len); > if (len != 0xFFFFFFFF) { > if (len > n_bytes) { > len = n_bytes; > } > fold = ut_fold_ulint_pair(fold, > ut_fold_binary(data, len)); > } > } > return(fold); >} >typedef unsigned char page_header_t; >typedef unsigned char page_dir_slot_t; >typedef page_dir_slot_t page_dir_t; >static inline >dulint >page_get_max_trx_id( > ib_page_t* page); >void >page_set_max_trx_id( > ib_page_t* page, > dulint trx_id); >static inline >void >page_update_max_trx_id( > ib_page_t* page, > dulint trx_id); >static inline >ulint >page_header_get_field( > ib_page_t* page, > ulint field); >static inline >void >page_header_set_field( > ib_page_t* page, > ulint field, > ulint val); >static inline >unsigned char* >page_header_get_ptr( > ib_page_t* page, > ulint field); >static inline >void >page_header_set_ptr( > ib_page_t* page, > ulint field, > unsigned char* ptr); >static inline >void >page_header_reset_last_insert( > ib_page_t* page, > mtr_t* mtr); >static inline >rec_t* >page_get_infimum_rec( > ib_page_t* page); >static inline >rec_t* >page_get_supremum_rec( > ib_page_t* page); >rec_t* >page_get_middle_rec( > ib_page_t* page); >static inline >int >page_cmp_dtuple_rec_with_match( > dtuple_t* dtuple, > rec_t* rec, > const ulint* offsets, > ulint* matched_fields, > ulint* matched_bytes); >static inline >ulint >page_get_n_recs( > ib_page_t* page); >ulint >page_rec_get_n_recs_before( > rec_t* rec); >static inline >ulint >page_dir_get_n_heap( > ib_page_t* page); >static inline >void >page_dir_set_n_heap( > ib_page_t* page, > ulint n_heap); >static inline >ulint >page_dir_get_n_slots( > ib_page_t* page); >static inline >void >page_dir_set_n_slots( > ib_page_t* page, > ulint n_slots); >static inline >page_dir_slot_t* >page_dir_get_nth_slot( > ib_page_t* page, > ulint n); >static inline >ulint >page_rec_check( > rec_t* rec); >static inline >rec_t* >page_dir_slot_get_rec( > page_dir_slot_t* slot); >static inline >void >page_dir_slot_set_rec( > page_dir_slot_t* slot, > rec_t* rec); >static inline >ulint >page_dir_slot_get_n_owned( > page_dir_slot_t* slot); >static inline >void >page_dir_slot_set_n_owned( > page_dir_slot_t* slot, > ulint n); >static inline >ulint >page_dir_calc_reserved_space( > ulint n_recs); >ulint >page_dir_find_owner_slot( > rec_t* rec); >static inline >ulint >page_is_comp( > ib_page_t* page); >static inline >ulint >page_rec_is_comp( > const rec_t* rec); >static inline >rec_t* >page_rec_get_next( > rec_t* rec); >static inline >void >page_rec_set_next( > rec_t* rec, > rec_t* next); >static inline >rec_t* >page_rec_get_prev( > rec_t* rec); >static inline >ulint >page_rec_is_user_rec_low( > ulint offset); >static inline >ulint >page_rec_is_supremum_low( > ulint offset); >static inline >ulint >page_rec_is_infimum_low( > ulint offset); >static inline >ulint >page_rec_is_user_rec( > const rec_t* rec); >static inline >ulint >page_rec_is_supremum( > const rec_t* rec); >static inline >ulint >page_rec_is_infimum( > const rec_t* rec); >static inline >rec_t* >page_rec_find_owner_rec( > rec_t* rec); >void >page_rec_write_index_page_no( > rec_t* rec, > ulint i, > ulint page_no, > mtr_t* mtr); >static inline >ulint >page_get_max_insert_size( > ib_page_t* page, > ulint n_recs); >static inline >ulint >page_get_max_insert_size_after_reorganize( > ib_page_t* page, > ulint n_recs); >static inline >ulint >page_get_free_space_of_empty( > ulint comp) > __attribute__((const)); >static inline >ulint >page_get_data_size( > ib_page_t* page); >unsigned char* >page_mem_alloc( > ib_page_t* page, > ulint need, > dict_index_t* index, > ulint* heap_no); >static inline >void >page_mem_free( > ib_page_t* page, > rec_t* rec, > const ulint* offsets); >ib_page_t* >page_create( > buf_frame_t* frame, > mtr_t* mtr, > ulint comp); >void >page_copy_rec_list_end_no_locks( > ib_page_t* new_page, > ib_page_t* page, > rec_t* rec, > dict_index_t* index, > mtr_t* mtr); >void >page_copy_rec_list_end( > ib_page_t* new_page, > ib_page_t* page, > rec_t* rec, > dict_index_t* index, > mtr_t* mtr); >void >page_copy_rec_list_start( > ib_page_t* new_page, > ib_page_t* page, > rec_t* rec, > dict_index_t* index, > mtr_t* mtr); >void >page_delete_rec_list_end( > ib_page_t* page, > rec_t* rec, > dict_index_t* index, > ulint n_recs, > ulint size, > mtr_t* mtr); >void >page_delete_rec_list_start( > ib_page_t* page, > rec_t* rec, > dict_index_t* index, > mtr_t* mtr); >void >page_move_rec_list_end( > ib_page_t* new_page, > ib_page_t* page, > rec_t* split_rec, > dict_index_t* index, > mtr_t* mtr); >void >page_move_rec_list_start( > ib_page_t* new_page, > ib_page_t* page, > rec_t* split_rec, > dict_index_t* index, > mtr_t* mtr); >void >page_dir_split_slot( > ib_page_t* page, > ulint slot_no); >void >page_dir_balance_slot( > ib_page_t* page, > ulint slot_no); >unsigned char* >page_parse_delete_rec_list( > unsigned char type, > unsigned char* ptr, > unsigned char* end_ptr, > dict_index_t* index, > ib_page_t* page, > mtr_t* mtr); >unsigned char* >page_parse_create( > unsigned char* ptr, > unsigned char* end_ptr, > ulint comp, > ib_page_t* page, > mtr_t* mtr); >void >page_rec_print( > rec_t* rec, > const ulint* offsets); >void >page_dir_print( > ib_page_t* page, > ulint pr_n); >void >page_print_list( > ib_page_t* page, > dict_index_t* index, > ulint pr_n); >void >page_header_print( > ib_page_t* page); >void >page_print( > ib_page_t* page, > dict_index_t* index, > ulint dn, > ulint rn); >ulint >page_rec_validate( > rec_t* rec, > const ulint* offsets); >void >page_check_dir( > ib_page_t* page); >ulint >page_simple_validate( > ib_page_t* page); >ulint >page_validate( > ib_page_t* page, > dict_index_t* index); >rec_t* >page_find_rec_with_heap_no( > ib_page_t* page, > ulint heap_no); >ulint >cmp_types_are_equal( > dtype_t* type1, > dtype_t* type2, > ulint check_charsets); >static inline >int >cmp_data_data( > dtype_t* cur_type, > unsigned char* data1, > ulint len1, > unsigned char* data2, > ulint len2); >int >cmp_data_data_slow( > dtype_t* cur_type, > unsigned char* data1, > ulint len1, > unsigned char* data2, > ulint len2); >static inline >int >cmp_dfield_dfield( > dfield_t* dfield1, > dfield_t* dfield2); >int >cmp_dtuple_rec_with_match( > dtuple_t* dtuple, > rec_t* rec, > const ulint* offsets, > ulint* matched_fields, > ulint* matched_bytes); >int >cmp_dtuple_rec( > dtuple_t* dtuple, > rec_t* rec, > const ulint* offsets); >ulint >cmp_dtuple_is_prefix_of_rec( > dtuple_t* dtuple, > rec_t* rec, > const ulint* offsets); >int >cmp_rec_rec_with_match( > rec_t* rec1, > rec_t* rec2, > const ulint* offsets1, > const ulint* offsets2, > dict_index_t* index, > ulint* matched_fields, > ulint* matched_bytes); >static inline >int >cmp_rec_rec( > rec_t* rec1, > rec_t* rec2, > const ulint* offsets1, > const ulint* offsets2, > dict_index_t* index); >static inline >int >cmp_data_data( > dtype_t* cur_type, > unsigned char* data1, > ulint len1, > unsigned char* data2, > ulint len2) >{ > return(cmp_data_data_slow(cur_type, data1, len1, data2, len2)); >} >static inline >int >cmp_dfield_dfield( > dfield_t* dfield1, > dfield_t* dfield2) >{ > ; > return(cmp_data_data(dfield_get_type(dfield1), > dfield_get_data(dfield1), dfield_get_len(dfield1), > dfield_get_data(dfield2), dfield_get_len(dfield2))); >} >static inline >int >cmp_rec_rec( > rec_t* rec1, > rec_t* rec2, > const ulint* offsets1, > const ulint* offsets2, > dict_index_t* index) >{ > ulint match_f = 0; > ulint match_b = 0; > return(cmp_rec_rec_with_match(rec1, rec2, offsets1, offsets2, index, > &match_f, &match_b)); >} >static inline >dulint >page_get_max_trx_id( > ib_page_t* page) >{ > ; > return(mach_read_from_8(page + 38 + 18)); >} >static inline >void >page_update_max_trx_id( > ib_page_t* page, > dulint trx_id) >{ > ; > if (ut_dulint_cmp(page_get_max_trx_id(page), trx_id) < 0) { > page_set_max_trx_id(page, trx_id); > } >} >static inline >ulint >page_header_get_field( > ib_page_t* page, > ulint field) >{ > ; > ; > return(mach_read_from_2(page + 38 + field)); >} >static inline >void >page_header_set_field( > ib_page_t* page, > ulint field, > ulint val) >{ > ; > ; > ; > ; > mach_write_to_2(page + 38 + field, val); >} >static inline >unsigned char* >page_header_get_ptr( > ib_page_t* page, > ulint field) >{ > ulint offs; > ; > ; > offs = page_header_get_field(page, field); > ; > if (offs == 0) { > return(((void *)0)); > } > return(page + offs); >} >static inline >void >page_header_set_ptr( > ib_page_t* page, > ulint field, > unsigned char* ptr) >{ > ulint offs; > ; > ; > if (ptr == ((void *)0)) { > offs = 0; > } else { > offs = ptr - page; > } > ; > page_header_set_field(page, field, offs); >} >static inline >void >page_header_reset_last_insert( > ib_page_t* page, > mtr_t* mtr) >{ > ; > mlog_write_ulint(page + 38 + 10, 0, > ((unsigned char)2), mtr); >} >static inline >ulint >page_is_comp( > ib_page_t* page) >{ > return(__builtin_expect(page_header_get_field(page, 4) & 0x8000, 0x8000)); >} >static inline >ulint >page_rec_is_comp( > const rec_t* rec) >{ > return(page_is_comp(ut_align_down((rec_t*) rec, (2 * 8192)))); >} >static inline >rec_t* >page_get_infimum_rec( > ib_page_t* page) >{ > ; > if (page_is_comp(page)) { > return(page + ((38 + 36 + 2 * 10) + 5)); > } else { > return(page + ((38 + 36 + 2 * 10) + 1 + 6)); > } >} >static inline >rec_t* >page_get_supremum_rec( > ib_page_t* page) >{ > ; > if (page_is_comp(page)) { > return(page + ((38 + 36 + 2 * 10) + 2 * 5 + 8)); > } else { > return(page + ((38 + 36 + 2 * 10) + 2 + 2 * 6 + 8)); > } >} >static inline >ulint >page_rec_is_user_rec_low( > ulint offset) >{ > ; > ; > return(__builtin_expect(offset != ((38 + 36 + 2 * 10) + 2 * 5 + 8), (1)) > && __builtin_expect(offset != ((38 + 36 + 2 * 10) + 5), (1)) > && __builtin_expect(offset != ((38 + 36 + 2 * 10) + 1 + 6), (1)) > && __builtin_expect(offset != ((38 + 36 + 2 * 10) + 2 + 2 * 6 + 8), (1))); >} >static inline >ulint >page_rec_is_supremum_low( > ulint offset) >{ > ; > ; > return(__builtin_expect(offset == ((38 + 36 + 2 * 10) + 2 * 5 + 8), (0)) > || __builtin_expect(offset == ((38 + 36 + 2 * 10) + 2 + 2 * 6 + 8), (0))); >} >static inline >ulint >page_rec_is_infimum_low( > ulint offset) >{ > ; > ; > return(__builtin_expect(offset == ((38 + 36 + 2 * 10) + 5), (0)) > || __builtin_expect(offset == ((38 + 36 + 2 * 10) + 1 + 6), (0))); >} >static inline >ulint >page_rec_is_user_rec( > const rec_t* rec) >{ > return(page_rec_is_user_rec_low( > ut_align_offset(rec, (2 * 8192)))); >} >static inline >ulint >page_rec_is_supremum( > const rec_t* rec) >{ > return(page_rec_is_supremum_low( > ut_align_offset(rec, (2 * 8192)))); >} >static inline >ulint >page_rec_is_infimum( > const rec_t* rec) >{ > return(page_rec_is_infimum_low( > ut_align_offset(rec, (2 * 8192)))); >} >static inline >int >page_cmp_dtuple_rec_with_match( > dtuple_t* dtuple, > rec_t* rec, > const ulint* offsets, > ulint* matched_fields, > ulint* matched_bytes) >{ > ulint rec_offset; > ; > ; > ; > rec_offset = ut_align_offset(rec, (2 * 8192)); > if (__builtin_expect(rec_offset == ((38 + 36 + 2 * 10) + 5), (0)) > || __builtin_expect(rec_offset == ((38 + 36 + 2 * 10) + 1 + 6), (0))) { > return(1); > } > if (__builtin_expect(rec_offset == ((38 + 36 + 2 * 10) + 2 * 5 + 8), (0)) > || __builtin_expect(rec_offset == ((38 + 36 + 2 * 10) + 2 + 2 * 6 + 8), (0))) { > return(-1); > } > return(cmp_dtuple_rec_with_match(dtuple, rec, offsets, > matched_fields, > matched_bytes)); >} >static inline >ulint >page_get_n_recs( > ib_page_t* page) >{ > return(page_header_get_field(page, 16)); >} >static inline >ulint >page_dir_get_n_slots( > ib_page_t* page) >{ > return(page_header_get_field(page, 0)); >} >static inline >void >page_dir_set_n_slots( > ib_page_t* page, > ulint n_slots) >{ > page_header_set_field(page, 0, n_slots); >} >static inline >ulint >page_dir_get_n_heap( > ib_page_t* page) >{ > return(page_header_get_field(page, 4) & 0x7fff); >} >static inline >void >page_dir_set_n_heap( > ib_page_t* page, > ulint n_heap) >{ > ; > page_header_set_field(page, 4, n_heap | (0x8000 & > page_header_get_field(page, 4))); >} >static inline >page_dir_slot_t* >page_dir_get_nth_slot( > ib_page_t* page, > ulint n) >{ > ; > return(page + (2 * 8192) - 8 > - (n + 1) * 2); >} >static inline >ulint >page_rec_check( > rec_t* rec) >{ > ib_page_t* page; > do { if (__builtin_expect(!((ulint)(rec)), (0))) { ut_dbg_assertion_failed("rec", "./../include/page0page.ic", (ulint) 464); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/page0page.ic", (ulint) 464); } while (0); } while (0); > page = buf_frame_align(rec); > do { if (__builtin_expect(!((ulint)(rec <= page_header_get_ptr(page, 2))), (0))) { ut_dbg_assertion_failed("rec <= page_header_get_ptr(page, PAGE_HEAP_TOP)", "./../include/page0page.ic", (ulint) 468); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/page0page.ic", (ulint) 468); } while (0); } while (0); > do { if (__builtin_expect(!((ulint)(rec >= page + (38 + 36 + 2 * 10))), (0))) { ut_dbg_assertion_failed("rec >= page + PAGE_DATA", "./../include/page0page.ic", (ulint) 469); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/page0page.ic", (ulint) 469); } while (0); } while (0); > return((1)); >} >static inline >rec_t* >page_dir_slot_get_rec( > page_dir_slot_t* slot) >{ > return(buf_frame_align(slot) + mach_read_from_2(slot)); >} >static inline >void >page_dir_slot_set_rec( > page_dir_slot_t* slot, > rec_t* rec) >{ > ; > mach_write_to_2(slot, ut_align_offset(rec, (2 * 8192))); >} >static inline >ulint >page_dir_slot_get_n_owned( > page_dir_slot_t* slot) >{ > rec_t* rec = page_dir_slot_get_rec(slot); > return(rec_get_n_owned(rec, page_rec_is_comp(rec))); >} >static inline >void >page_dir_slot_set_n_owned( > page_dir_slot_t* slot, > ulint n) >{ > rec_t* rec = page_dir_slot_get_rec(slot); > rec_set_n_owned(rec, page_rec_is_comp(rec), n); >} >static inline >ulint >page_dir_calc_reserved_space( > ulint n_recs) >{ > return((2 * n_recs + 4 - 1) > / 4); >} >static inline >rec_t* >page_rec_get_next( > rec_t* rec) >{ > ulint offs; > ib_page_t* page; > ; > page = ut_align_down(rec, (2 * 8192)); > offs = rec_get_next_offs(rec, page_is_comp(page)); > if (__builtin_expect(offs >= (2 * 8192), (0))) { > fprintf(stderr, >"InnoDB: Next record offset is nonsensical %lu in record at offset %lu\n" >"InnoDB: rec address %p, first buffer frame %p\n" >"InnoDB: buffer pool high end %p, buf fix count %lu\n", > (ulong)offs, (ulong)(rec - page), > rec, buf_pool->frame_zero, > buf_pool->high_end, > (ulong)buf_block_align(rec)->buf_fix_count); > buf_page_print(page); > do { ut_dbg_assertion_failed(0, "./../include/page0page.ic", (ulint) 570); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } > if (__builtin_expect(offs == 0, (0))) { > return(((void *)0)); > } > return(page + offs); >} >static inline >void >page_rec_set_next( > rec_t* rec, > rec_t* next) >{ > ib_page_t* page; > ulint offs; > ; > ; > page = ut_align_down(rec, (2 * 8192)); > if (next) { > ; > ; > offs = (ulint) (next - page); > } else { > offs = 0; > } > rec_set_next_offs(rec, page_is_comp(page), offs); >} >static inline >rec_t* >page_rec_get_prev( > rec_t* rec) >{ > page_dir_slot_t* slot; > ulint slot_no; > rec_t* rec2; > rec_t* prev_rec = ((void *)0); > ib_page_t* page; > ; > page = ut_align_down(rec, (2 * 8192)); > ; > slot_no = page_dir_find_owner_slot(rec); > do { if (__builtin_expect(!((ulint)(slot_no != 0)), (0))) { ut_dbg_assertion_failed("slot_no != 0", "./../include/page0page.ic", (ulint) 633); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/page0page.ic", (ulint) 633); } while (0); } while (0); > slot = page_dir_get_nth_slot(page, slot_no - 1); > rec2 = page_dir_slot_get_rec(slot); > while (rec != rec2) { > prev_rec = rec2; > rec2 = page_rec_get_next(rec2); > } > do { if (__builtin_expect(!((ulint)(prev_rec)), (0))) { ut_dbg_assertion_failed("prev_rec", "./../include/page0page.ic", (ulint) 644); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/page0page.ic", (ulint) 644); } while (0); } while (0); > return(prev_rec); >} >static inline >rec_t* >page_rec_find_owner_rec( > rec_t* rec) >{ > ; > if (page_rec_is_comp(rec)) { > while (rec_get_n_owned(rec, (1)) == 0) { > rec = page_rec_get_next(rec); > } > } else { > while (rec_get_n_owned(rec, (0)) == 0) { > rec = page_rec_get_next(rec); > } > } > return(rec); >} >static inline >ulint >page_get_data_size( > ib_page_t* page) >{ > ulint ret; > ret = (ulint)(page_header_get_field(page, 2) > - (page_is_comp(page) > ? (((38 + 36 + 2 * 10) + 2 * 5 + 8) + 8) > : (((38 + 36 + 2 * 10) + 2 + 2 * 6 + 8) + 9)) > - page_header_get_field(page, 8)); > ; > return(ret); >} >static inline >ulint >page_get_free_space_of_empty( > ulint comp) >{ > if (__builtin_expect(comp, (1))) { > return((ulint)((2 * 8192) > - (((38 + 36 + 2 * 10) + 2 * 5 + 8) + 8) > - 8 > - 2 * 2)); > } > return((ulint)((2 * 8192) > - (((38 + 36 + 2 * 10) + 2 + 2 * 6 + 8) + 9) > - 8 > - 2 * 2)); >} >static inline >ulint >page_get_max_insert_size( > ib_page_t* page, > ulint n_recs) >{ > ulint occupied; > ulint free_space; > if (page_is_comp(page)) { > occupied = page_header_get_field(page, 2) > - (((38 + 36 + 2 * 10) + 2 * 5 + 8) + 8) + page_dir_calc_reserved_space( > n_recs + page_dir_get_n_heap(page) - 2); > free_space = page_get_free_space_of_empty((1)); > } else { > occupied = page_header_get_field(page, 2) > - (((38 + 36 + 2 * 10) + 2 + 2 * 6 + 8) + 9) + page_dir_calc_reserved_space( > n_recs + page_dir_get_n_heap(page) - 2); > free_space = page_get_free_space_of_empty((0)); > } > if (occupied > free_space) { > return(0); > } > return(free_space - occupied); >} >static inline >ulint >page_get_max_insert_size_after_reorganize( > ib_page_t* page, > ulint n_recs) >{ > ulint occupied; > ulint free_space; > occupied = page_get_data_size(page) > + page_dir_calc_reserved_space(n_recs + page_get_n_recs(page)); > free_space = page_get_free_space_of_empty(page_is_comp(page)); > if (occupied > free_space) { > return(0); > } > return(free_space - occupied); >} >static inline >void >page_mem_free( > ib_page_t* page, > rec_t* rec, > const ulint* offsets) >{ > rec_t* free; > ulint garbage; > ; > ; > free = page_header_get_ptr(page, 6); > page_rec_set_next(rec, free); > page_header_set_ptr(page, 6, rec); > garbage = page_header_get_field(page, 8); > page_header_set_field(page, 8, > garbage + rec_offs_size(offsets)); >} >static inline >ib_page_t* >page_cur_get_page( > page_cur_t* cur); >static inline >rec_t* >page_cur_get_rec( > page_cur_t* cur); >static inline >void >page_cur_set_before_first( > ib_page_t* page, > page_cur_t* cur); >static inline >void >page_cur_set_after_last( > ib_page_t* page, > page_cur_t* cur); >static inline >ulint >page_cur_is_before_first( > const page_cur_t* cur); >static inline >ulint >page_cur_is_after_last( > const page_cur_t* cur); >static inline >void >page_cur_position( > rec_t* rec, > page_cur_t* cur); >static inline >void >page_cur_invalidate( > page_cur_t* cur); >static inline >void >page_cur_move_to_next( > page_cur_t* cur); >static inline >void >page_cur_move_to_prev( > page_cur_t* cur); >static inline >rec_t* >page_cur_tuple_insert( > page_cur_t* cursor, > dtuple_t* tuple, > dict_index_t* index, > mtr_t* mtr); >static inline >rec_t* >page_cur_rec_insert( > page_cur_t* cursor, > rec_t* rec, > dict_index_t* index, > ulint* offsets, > mtr_t* mtr); >rec_t* >page_cur_insert_rec_low( > page_cur_t* cursor, > dtuple_t* tuple, > dict_index_t* index, > rec_t* rec, > ulint* offsets, > mtr_t* mtr); >void >page_copy_rec_list_end_to_created_page( > ib_page_t* new_page, > ib_page_t* page, > rec_t* rec, > dict_index_t* index, > mtr_t* mtr); >void >page_cur_delete_rec( > page_cur_t* cursor, > dict_index_t* index, > const ulint* offsets, > mtr_t* mtr); >static inline >ulint >page_cur_search( > ib_page_t* page, > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > page_cur_t* cursor); >void >page_cur_search_with_match( > ib_page_t* page, > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > ulint* iup_matched_fields, > ulint* iup_matched_bytes, > ulint* ilow_matched_fields, > ulint* ilow_matched_bytes, > page_cur_t* cursor); >void >page_cur_open_on_rnd_user_rec( > ib_page_t* page, > page_cur_t* cursor); >unsigned char* >page_cur_parse_insert_rec( > ulint is_short, > unsigned char* ptr, > unsigned char* end_ptr, > dict_index_t* index, > ib_page_t* page, > mtr_t* mtr); >unsigned char* >page_parse_copy_rec_list_to_created_page( > unsigned char* ptr, > unsigned char* end_ptr, > dict_index_t* index, > ib_page_t* page, > mtr_t* mtr); >unsigned char* >page_cur_parse_delete_rec( > unsigned char* ptr, > unsigned char* end_ptr, > dict_index_t* index, > ib_page_t* page, > mtr_t* mtr); >struct page_cur_struct{ > unsigned char* rec; >}; >static inline >ib_page_t* >page_cur_get_page( > page_cur_t* cur) >{ > ; > return(buf_frame_align(cur->rec)); >} >static inline >rec_t* >page_cur_get_rec( > page_cur_t* cur) >{ > ; > return(cur->rec); >} >static inline >void >page_cur_set_before_first( > ib_page_t* page, > page_cur_t* cur) >{ > cur->rec = page_get_infimum_rec(page); >} >static inline >void >page_cur_set_after_last( > ib_page_t* page, > page_cur_t* cur) >{ > cur->rec = page_get_supremum_rec(page); >} >static inline >ulint >page_cur_is_before_first( > const page_cur_t* cur) >{ > return(page_rec_is_infimum(cur->rec)); >} >static inline >ulint >page_cur_is_after_last( > const page_cur_t* cur) >{ > return(page_rec_is_supremum(cur->rec)); >} >static inline >void >page_cur_position( > rec_t* rec, > page_cur_t* cur) >{ > ; > cur->rec = rec; >} >static inline >void >page_cur_invalidate( > page_cur_t* cur) >{ > ; > cur->rec = ((void *)0); >} >static inline >void >page_cur_move_to_next( > page_cur_t* cur) >{ > ; > cur->rec = page_rec_get_next(cur->rec); >} >static inline >void >page_cur_move_to_prev( > page_cur_t* cur) >{ > ; > cur->rec = page_rec_get_prev(cur->rec); >} >static inline >ulint >page_cur_search( > ib_page_t* page, > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > page_cur_t* cursor) >{ > ulint low_matched_fields = 0; > ulint low_matched_bytes = 0; > ulint up_matched_fields = 0; > ulint up_matched_bytes = 0; > ; > page_cur_search_with_match(page, index, tuple, mode, > &up_matched_fields, > &up_matched_bytes, > &low_matched_fields, > &low_matched_bytes, > cursor); > return(low_matched_fields); >} >static inline >rec_t* >page_cur_tuple_insert( > page_cur_t* cursor, > dtuple_t* tuple, > dict_index_t* index, > mtr_t* mtr) >{ > return(page_cur_insert_rec_low(cursor, tuple, index, ((void *)0), ((void *)0), mtr)); >} >static inline >rec_t* >page_cur_rec_insert( > page_cur_t* cursor, > rec_t* rec, > dict_index_t* index, > ulint* offsets, > mtr_t* mtr) >{ > return(page_cur_insert_rec_low(cursor, ((void *)0), index, rec, > offsets, mtr)); >} >static inline >void* >ha_search_and_get_data( > hash_table_t* table, > ulint fold); >void >ha_search_and_update_if_found( > hash_table_t* table, > ulint fold, > void* data, > void* new_data); >hash_table_t* >ha_create( > ulint in_btr_search, > ulint n, > ulint n_mutexes, > ulint mutex_level); >ulint >ha_insert_for_fold( > hash_table_t* table, > ulint fold, > void* data); >static inline >ulint >ha_insert_for_fold_mutex( > hash_table_t* table, > ulint fold, > void* data); >void >ha_delete( > hash_table_t* table, > ulint fold, > void* data); >static inline >ulint >ha_search_and_delete_if_found( > hash_table_t* table, > ulint fold, > void* data); >void >ha_remove_all_nodes_to_page( > hash_table_t* table, > ulint fold, > ib_page_t* page); >ulint >ha_validate( > hash_table_t* table, > ulint start_index, > ulint end_index); >void >ha_print_info( > FILE* file, > hash_table_t* table); >typedef struct ha_node_struct ha_node_t; >struct ha_node_struct { > ha_node_t* next; > void* data; > ulint fold; >}; >void >ha_delete_hash_node( > hash_table_t* table, > ha_node_t* del_node); >static inline >void* >ha_node_get_data( > ha_node_t* node) >{ > return(node->data); >} >static inline >void >ha_node_set_data( > ha_node_t* node, > void* data) >{ > node->data = data; >} >static inline >ha_node_t* >ha_chain_get_next( > ha_node_t* node) >{ > return(node->next); >} >static inline >ha_node_t* >ha_chain_get_first( > hash_table_t* table, > ulint fold) >{ > return(hash_get_nth_cell(table, hash_calc_hash(fold, table))->node); >} >static inline >ha_node_t* >ha_search( > hash_table_t* table, > ulint fold) >{ > ha_node_t* node; > node = ha_chain_get_first(table, fold); > while (node) { > if (node->fold == fold) { > return(node); > } > node = ha_chain_get_next(node); > } > return(((void *)0)); >} >static inline >void* >ha_search_and_get_data( > hash_table_t* table, > ulint fold) >{ > ha_node_t* node; > node = ha_chain_get_first(table, fold); > while (node) { > if (node->fold == fold) { > return(node->data); > } > node = ha_chain_get_next(node); > } > return(((void *)0)); >} >static inline >ha_node_t* >ha_search_with_data( > hash_table_t* table, > ulint fold, > void* data) >{ > ha_node_t* node; > node = ha_chain_get_first(table, fold); > while (node) { > if (node->data == data) { > return(node); > } > node = ha_chain_get_next(node); > } > return(((void *)0)); >} >static inline >ulint >ha_search_and_delete_if_found( > hash_table_t* table, > ulint fold, > void* data) >{ > ha_node_t* node; > node = ha_search_with_data(table, fold, data); > if (node) { > ha_delete_hash_node(table, node); > return((1)); > } > return((0)); >} >static inline >ulint >ha_insert_for_fold_mutex( > hash_table_t* table, > ulint fold, > void* data) >{ > ulint ret; > hash_mutex_enter(table, fold); > ret = ha_insert_for_fold(table, fold, data); > hash_mutex_exit(table, fold); > return(ret); >} >static inline >page_cur_t* >btr_cur_get_page_cur( > btr_cur_t* cursor); >static inline >rec_t* >btr_cur_get_rec( > btr_cur_t* cursor); >static inline >void >btr_cur_invalidate( > btr_cur_t* cursor); >static inline >ib_page_t* >btr_cur_get_page( > btr_cur_t* cursor); >static inline >dict_tree_t* >btr_cur_get_tree( > btr_cur_t* cursor); >static inline >void >btr_cur_position( > dict_index_t* index, > rec_t* rec, > btr_cur_t* cursor); >void >btr_cur_search_to_nth_level( > dict_index_t* index, > ulint level, > dtuple_t* tuple, > ulint mode, > ulint latch_mode, > btr_cur_t* cursor, > ulint has_search_latch, > mtr_t* mtr); >void >btr_cur_open_at_index_side( > ulint from_left, > dict_index_t* index, > ulint latch_mode, > btr_cur_t* cursor, > mtr_t* mtr); >void >btr_cur_open_at_rnd_pos( > dict_index_t* index, > ulint latch_mode, > btr_cur_t* cursor, > mtr_t* mtr); >ulint >btr_cur_optimistic_insert( > ulint flags, > btr_cur_t* cursor, > dtuple_t* entry, > rec_t** rec, > big_rec_t** big_rec, > que_thr_t* thr, > mtr_t* mtr); >ulint >btr_cur_pessimistic_insert( > ulint flags, > btr_cur_t* cursor, > dtuple_t* entry, > rec_t** rec, > big_rec_t** big_rec, > que_thr_t* thr, > mtr_t* mtr); >ulint >btr_cur_update_in_place( > ulint flags, > btr_cur_t* cursor, > upd_t* update, > ulint cmpl_info, > que_thr_t* thr, > mtr_t* mtr); >ulint >btr_cur_optimistic_update( > ulint flags, > btr_cur_t* cursor, > upd_t* update, > ulint cmpl_info, > que_thr_t* thr, > mtr_t* mtr); >ulint >btr_cur_pessimistic_update( > ulint flags, > btr_cur_t* cursor, > big_rec_t** big_rec, > upd_t* update, > ulint cmpl_info, > que_thr_t* thr, > mtr_t* mtr); >ulint >btr_cur_del_mark_set_clust_rec( > ulint flags, > btr_cur_t* cursor, > ulint val, > que_thr_t* thr, > mtr_t* mtr); >ulint >btr_cur_del_mark_set_sec_rec( > ulint flags, > btr_cur_t* cursor, > ulint val, > que_thr_t* thr, > mtr_t* mtr); >void >btr_cur_del_unmark_for_ibuf( > rec_t* rec, > mtr_t* mtr); >void >btr_cur_compress( > btr_cur_t* cursor, > mtr_t* mtr); >ulint >btr_cur_compress_if_useful( > btr_cur_t* cursor, > mtr_t* mtr); >ulint >btr_cur_optimistic_delete( > btr_cur_t* cursor, > mtr_t* mtr); >ulint >btr_cur_pessimistic_delete( > ulint* err, > ulint has_reserved_extents, > btr_cur_t* cursor, > ulint in_rollback, > mtr_t* mtr); >unsigned char* >btr_cur_parse_update_in_place( > unsigned char* ptr, > unsigned char* end_ptr, > ib_page_t* page, > dict_index_t* index); >unsigned char* >btr_cur_parse_del_mark_set_clust_rec( > unsigned char* ptr, > unsigned char* end_ptr, > dict_index_t* index, > ib_page_t* page); >unsigned char* >btr_cur_parse_del_mark_set_sec_rec( > unsigned char* ptr, > unsigned char* end_ptr, > ib_page_t* page); >ib_longlong >btr_estimate_n_rows_in_range( > dict_index_t* index, > dtuple_t* tuple1, > ulint mode1, > dtuple_t* tuple2, > ulint mode2); >void >btr_estimate_number_of_different_key_vals( > dict_index_t* index); >void >btr_cur_mark_extern_inherited_fields( > rec_t* rec, > const ulint* offsets, > upd_t* update, > mtr_t* mtr); >void >btr_cur_mark_dtuple_inherited_extern( > dtuple_t* entry, > ulint* ext_vec, > ulint n_ext_vec, > upd_t* update); >void >btr_cur_unmark_dtuple_extern_fields( > dtuple_t* entry, > ulint* ext_vec, > ulint n_ext_vec); >ulint >btr_store_big_rec_extern_fields( > dict_index_t* index, > rec_t* rec, > const ulint* offsets, > big_rec_t* big_rec_vec, > mtr_t* local_mtr); >void >btr_free_externally_stored_field( > dict_index_t* index, > unsigned char* data, > ulint local_len, > ulint do_not_free_inherited, > mtr_t* local_mtr); >void >btr_rec_free_externally_stored_fields( > dict_index_t* index, > rec_t* rec, > const ulint* offsets, > ulint do_not_free_inherited, > mtr_t* mtr); >unsigned char* >btr_rec_copy_externally_stored_field( > rec_t* rec, > const ulint* offsets, > ulint no, > ulint* len, > mem_heap_t* heap); >unsigned char* >btr_copy_externally_stored_field( > ulint* len, > unsigned char* data, > ulint local_len, > mem_heap_t* heap); >ulint >btr_push_update_extern_fields( > ulint* ext_vect, > const ulint* offsets, > upd_t* update); >typedef struct btr_path_struct btr_path_t; >struct btr_path_struct{ > ulint nth_rec; > ulint n_recs; >}; >struct btr_cur_struct { > dict_index_t* index; > page_cur_t page_cur; > ib_page_t* left_page; > que_thr_t* thr; > ulint flag; > ulint tree_height; > ulint up_match; > ulint up_bytes; > ulint low_match; > ulint low_bytes; > ulint n_fields; > ulint n_bytes; > ulint fold; > btr_path_t* path_arr; >}; >extern ulint btr_cur_n_non_sea; >extern ulint btr_cur_n_sea; >extern ulint btr_cur_n_non_sea_old; >extern ulint btr_cur_n_sea_old; >ib_page_t* >btr_root_get( > dict_tree_t* tree, > mtr_t* mtr); >static inline >ib_page_t* >btr_page_get( > ulint space, > ulint page_no, > ulint mode, > mtr_t* mtr); >static inline >dulint >btr_page_get_index_id( > ib_page_t* page); >static inline >ulint >btr_page_get_level_low( > ib_page_t* page); >static inline >ulint >btr_page_get_level( > ib_page_t* page, > mtr_t* mtr); >static inline >ulint >btr_page_get_next( > ib_page_t* page, > mtr_t* mtr); >static inline >ulint >btr_page_get_prev( > ib_page_t* page, > mtr_t* mtr); >rec_t* >btr_get_prev_user_rec( > rec_t* rec, > mtr_t* mtr); >rec_t* >btr_get_next_user_rec( > rec_t* rec, > mtr_t* mtr); >static inline >void >btr_leaf_page_release( > ib_page_t* page, > ulint latch_mode, > mtr_t* mtr); >static inline >ulint >btr_node_ptr_get_child_page_no( > rec_t* rec, > const ulint* offsets); >ulint >btr_create( > ulint type, > ulint space, > dulint index_id, > ulint comp, > mtr_t* mtr); >void >btr_free_but_not_root( > ulint space, > ulint root_page_no); >void >btr_free_root( > ulint space, > ulint root_page_no, > mtr_t* mtr); >rec_t* >btr_root_raise_and_insert( > btr_cur_t* cursor, > dtuple_t* tuple, > mtr_t* mtr); >void >btr_page_reorganize( > ib_page_t* page, > dict_index_t* index, > mtr_t* mtr); >ulint >btr_page_get_split_rec_to_left( > btr_cur_t* cursor, > rec_t** split_rec); >ulint >btr_page_get_split_rec_to_right( > btr_cur_t* cursor, > rec_t** split_rec); >rec_t* >btr_page_split_and_insert( > btr_cur_t* cursor, > dtuple_t* tuple, > mtr_t* mtr); >void >btr_insert_on_non_leaf_level( > dict_tree_t* tree, > ulint level, > dtuple_t* tuple, > mtr_t* mtr); >void >btr_set_min_rec_mark( > rec_t* rec, > ulint comp, > mtr_t* mtr); >void >btr_node_ptr_delete( > dict_tree_t* tree, > ib_page_t* page, > mtr_t* mtr); >ulint >btr_check_node_ptr( > dict_tree_t* tree, > ib_page_t* page, > mtr_t* mtr); >void >btr_compress( > btr_cur_t* cursor, > mtr_t* mtr); >void >btr_discard_page( > btr_cur_t* cursor, > mtr_t* mtr); >unsigned char* >btr_parse_set_min_rec_mark( > unsigned char* ptr, > unsigned char* end_ptr, > ulint comp, > ib_page_t* page, > mtr_t* mtr); >unsigned char* >btr_parse_page_reorganize( > unsigned char* ptr, > unsigned char* end_ptr, > dict_index_t* index, > ib_page_t* page, > mtr_t* mtr); >ulint >btr_get_size( > dict_index_t* index, > ulint flag); >ib_page_t* >btr_page_alloc( > dict_tree_t* tree, > ulint hint_page_no, > unsigned char file_direction, > ulint level, > mtr_t* mtr); >void >btr_page_free( > dict_tree_t* tree, > ib_page_t* page, > mtr_t* mtr); >void >btr_page_free_low( > dict_tree_t* tree, > ib_page_t* page, > ulint level, > mtr_t* mtr); >ulint >btr_index_rec_validate( > rec_t* rec, > dict_index_t* index, > ulint dump_on_error); >ulint >btr_validate_tree( > dict_tree_t* tree, > trx_t* trx); >static inline >ib_page_t* >btr_page_get( > ulint space, > ulint page_no, > ulint mode, > mtr_t* mtr) >{ > ib_page_t* page; > page = buf_page_get_gen( space, page_no, mode, ((void *)0), 10, "./../include/btr0btr.ic", 28, mtr); > return(page); >} >static inline >void >btr_page_set_index_id( > ib_page_t* page, > dulint id, > mtr_t* mtr) >{ > mlog_write_dulint(page + 38 + 28, id, mtr); >} >static inline >dulint >btr_page_get_index_id( > ib_page_t* page) >{ > return(mach_read_from_8(page + 38 + 28)); >} >static inline >ulint >btr_page_get_level_low( > ib_page_t* page) >{ > ulint level; > ; > level = mach_read_from_2(page + 38 + 26); > ; > return(level); >} >static inline >ulint >btr_page_get_level( > ib_page_t* page, > mtr_t* mtr __attribute__((unused))) >{ > ; > return(btr_page_get_level_low(page)); >} >static inline >void >btr_page_set_level( > ib_page_t* page, > ulint level, > mtr_t* mtr) >{ > ; > ; > mlog_write_ulint(page + 38 + 26, level, > ((unsigned char)2), mtr); >} >static inline >ulint >btr_page_get_next( > ib_page_t* page, > mtr_t* mtr __attribute__((unused))) >{ > ; > ; > return(mach_read_from_4(page + 12)); >} >static inline >void >btr_page_set_next( > ib_page_t* page, > ulint next, > mtr_t* mtr) >{ > ; > mlog_write_ulint(page + 12, next, ((unsigned char)4), mtr); >} >static inline >ulint >btr_page_get_prev( > ib_page_t* page, > mtr_t* mtr __attribute__((unused))) >{ > ; > return(mach_read_from_4(page + 8)); >} >static inline >void >btr_page_set_prev( > ib_page_t* page, > ulint prev, > mtr_t* mtr) >{ > ; > mlog_write_ulint(page + 8, prev, ((unsigned char)4), mtr); >} >static inline >ulint >btr_node_ptr_get_child_page_no( > rec_t* rec, > const ulint* offsets) >{ > unsigned char* field; > ulint len; > ulint page_no; > ; > field = rec_get_nth_field(rec, offsets, > rec_offs_n_fields(offsets) - 1, &len); > ; > page_no = mach_read_from_4(field); > if (__builtin_expect(page_no == 0, (0))) { > fprintf(stderr, >"InnoDB: a nonsensical page number 0 in a node ptr record at offset %lu\n", > (ulong) ut_align_offset(rec, (2 * 8192))); > buf_page_print(buf_frame_align(rec)); > } > return(page_no); >} >static inline >void >btr_leaf_page_release( > ib_page_t* page, > ulint latch_mode, > mtr_t* mtr) >{ > ; > if (latch_mode == 1) { > mtr_memo_release(mtr, buf_block_align(page), > 1); > } else { > ; > mtr_memo_release(mtr, buf_block_align(page), > 2); > } >} >static inline >page_cur_t* >btr_cur_get_page_cur( > btr_cur_t* cursor) >{ > return(&(cursor->page_cur)); >} >static inline >rec_t* >btr_cur_get_rec( > btr_cur_t* cursor) >{ > return(page_cur_get_rec(&(cursor->page_cur))); >} >static inline >void >btr_cur_invalidate( > btr_cur_t* cursor) >{ > page_cur_invalidate(&(cursor->page_cur)); >} >static inline >ib_page_t* >btr_cur_get_page( > btr_cur_t* cursor) >{ > return(buf_frame_align(page_cur_get_rec(&(cursor->page_cur)))); >} >static inline >dict_tree_t* >btr_cur_get_tree( > btr_cur_t* cursor) >{ > return((cursor->index)->tree); >} >static inline >void >btr_cur_position( > dict_index_t* index, > rec_t* rec, > btr_cur_t* cursor) >{ > page_cur_position(rec, btr_cur_get_page_cur(cursor)); > cursor->index = index; >} >static inline >ulint >btr_cur_compress_recommendation( > btr_cur_t* cursor, > mtr_t* mtr) >{ > ib_page_t* page; > ; > page = btr_cur_get_page(cursor); > if ((page_get_data_size(page) < ((2 * 8192) / 2)) > || ((btr_page_get_next(page, mtr) == 0xFFFFFFFF) > && (btr_page_get_prev(page, mtr) == 0xFFFFFFFF))) { > if (dict_tree_get_page((cursor->index)->tree) > == buf_frame_get_page_no(page)) { > return((0)); > } > return((1)); > } > return((0)); >} >static inline >ulint >btr_cur_can_delete_without_compress( > btr_cur_t* cursor, > ulint rec_size, > mtr_t* mtr) >{ > ib_page_t* page; > ; > page = btr_cur_get_page(cursor); > if ((page_get_data_size(page) - rec_size < ((2 * 8192) / 2)) > || ((btr_page_get_next(page, mtr) == 0xFFFFFFFF) > && (btr_page_get_prev(page, mtr) == 0xFFFFFFFF)) > || (page_get_n_recs(page) < 2)) { > if (dict_tree_get_page((cursor->index)->tree) > == buf_frame_get_page_no(page)) { > return((1)); > } > return((0)); > } > return((1)); >} >btr_pcur_t* >btr_pcur_create_for_mysql(void); >void >btr_pcur_free_for_mysql( > btr_pcur_t* cursor); >void >btr_pcur_copy_stored_position( > btr_pcur_t* pcur_receive, > btr_pcur_t* pcur_donate); >static inline >void >btr_pcur_init( > btr_pcur_t* pcur); >static inline >void >btr_pcur_open( > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > ulint latch_mode, > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >void >btr_pcur_open_with_no_init( > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > ulint latch_mode, > btr_pcur_t* cursor, > ulint has_search_latch, > mtr_t* mtr); >static inline >void >btr_pcur_open_at_index_side( > ulint from_left, > dict_index_t* index, > ulint latch_mode, > btr_pcur_t* pcur, > ulint do_init, > mtr_t* mtr); >static inline >ulint >btr_pcur_get_up_match( > btr_pcur_t* cursor); >static inline >ulint >btr_pcur_get_low_match( > btr_pcur_t* cursor); >void >btr_pcur_open_on_user_rec( > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > ulint latch_mode, > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >void >btr_pcur_open_at_rnd_pos( > dict_index_t* index, > ulint latch_mode, > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >void >btr_pcur_close( > btr_pcur_t* cursor); >void >btr_pcur_store_position( > btr_pcur_t* cursor, > mtr_t* mtr); >ulint >btr_pcur_restore_position( > ulint latch_mode, > btr_pcur_t* cursor, > mtr_t* mtr); >void >btr_pcur_release_leaf( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >ulint >btr_pcur_get_rel_pos( > btr_pcur_t* cursor); >static inline >void >btr_pcur_set_mtr( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >mtr_t* >btr_pcur_get_mtr( > btr_pcur_t* cursor); >static inline >void >btr_pcur_commit( > btr_pcur_t* pcur); >static inline >void >btr_pcur_commit_specify_mtr( > btr_pcur_t* pcur, > mtr_t* mtr); >static inline >ulint >btr_pcur_is_detached( > btr_pcur_t* pcur); >static inline >ulint >btr_pcur_move_to_next( > btr_pcur_t* cursor, > mtr_t* mtr); >ulint >btr_pcur_move_to_prev( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >void >btr_pcur_move_to_last_on_page( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >ulint >btr_pcur_move_to_next_user_rec( > btr_pcur_t* cursor, > mtr_t* mtr); >void >btr_pcur_move_to_next_page( > btr_pcur_t* cursor, > mtr_t* mtr); >void >btr_pcur_move_backward_from_page( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >btr_cur_t* >btr_pcur_get_btr_cur( > btr_pcur_t* cursor); >static inline >page_cur_t* >btr_pcur_get_page_cur( > btr_pcur_t* cursor); >static inline >ib_page_t* >btr_pcur_get_page( > btr_pcur_t* cursor); >static inline >rec_t* >btr_pcur_get_rec( > btr_pcur_t* cursor); >static inline >ulint >btr_pcur_is_on_user_rec( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >ulint >btr_pcur_is_after_last_on_page( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >ulint >btr_pcur_is_before_first_on_page( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >ulint >btr_pcur_is_before_first_in_tree( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >ulint >btr_pcur_is_after_last_in_tree( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >void >btr_pcur_move_to_next_on_page( > btr_pcur_t* cursor, > mtr_t* mtr); >static inline >void >btr_pcur_move_to_prev_on_page( > btr_pcur_t* cursor, > mtr_t* mtr); >struct btr_pcur_struct{ > btr_cur_t btr_cur; > ulint latch_mode; > ulint old_stored; > rec_t* old_rec; > ulint old_n_fields; > ulint rel_pos; > buf_block_t* block_when_stored; > dulint modify_clock; > ulint pos_state; > ulint search_mode; > trx_t* trx_if_known; > mtr_t* mtr; > unsigned char* old_rec_buf; > ulint buf_size; >}; >static inline >ulint >btr_pcur_get_rel_pos( > btr_pcur_t* cursor) >{ > ; > ; > ; > ; > return(cursor->rel_pos); >} >static inline >void >btr_pcur_set_mtr( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > ; > cursor->mtr = mtr; >} >static inline >mtr_t* >btr_pcur_get_mtr( > btr_pcur_t* cursor) >{ > ; > return(cursor->mtr); >} >static inline >btr_cur_t* >btr_pcur_get_btr_cur( > btr_pcur_t* cursor) >{ > return(&(cursor->btr_cur)); >} >static inline >page_cur_t* >btr_pcur_get_page_cur( > btr_pcur_t* cursor) >{ > return(btr_cur_get_page_cur(&(cursor->btr_cur))); >} >static inline >ib_page_t* >btr_pcur_get_page( > btr_pcur_t* cursor) >{ > ; > return(page_cur_get_page(btr_pcur_get_page_cur(cursor))); >} >static inline >rec_t* >btr_pcur_get_rec( > btr_pcur_t* cursor) >{ > ; > ; > return(page_cur_get_rec(btr_pcur_get_page_cur(cursor))); >} >static inline >ulint >btr_pcur_get_up_match( > btr_pcur_t* cursor) >{ > btr_cur_t* btr_cursor; > ; > btr_cursor = btr_pcur_get_btr_cur(cursor); > ; > return(btr_cursor->up_match); >} >static inline >ulint >btr_pcur_get_low_match( > btr_pcur_t* cursor) >{ > btr_cur_t* btr_cursor; > ; > btr_cursor = btr_pcur_get_btr_cur(cursor); > ; > return(btr_cursor->low_match); >} >static inline >ulint >btr_pcur_is_after_last_on_page( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > mtr = mtr; > ; > ; > return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor))); >} >static inline >ulint >btr_pcur_is_before_first_on_page( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > mtr = mtr; > ; > ; > return(page_cur_is_before_first(btr_pcur_get_page_cur(cursor))); >} >static inline >ulint >btr_pcur_is_on_user_rec( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > ; > ; > if ((btr_pcur_is_before_first_on_page(cursor, mtr)) > || (btr_pcur_is_after_last_on_page(cursor, mtr))) { > return((0)); > } > return((1)); >} >static inline >ulint >btr_pcur_is_before_first_in_tree( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > ; > ; > if (btr_page_get_prev(btr_pcur_get_page(cursor), mtr) != 0xFFFFFFFF) { > return((0)); > } > return(page_cur_is_before_first(btr_pcur_get_page_cur(cursor))); >} >static inline >ulint >btr_pcur_is_after_last_in_tree( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > ; > ; > if (btr_page_get_next(btr_pcur_get_page(cursor), mtr) != 0xFFFFFFFF) { > return((0)); > } > return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor))); >} >static inline >void >btr_pcur_move_to_next_on_page( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > mtr = mtr; > ; > ; > page_cur_move_to_next(btr_pcur_get_page_cur(cursor)); > cursor->old_stored = 122766467; >} >static inline >void >btr_pcur_move_to_prev_on_page( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > mtr = mtr; > ; > ; > page_cur_move_to_prev(btr_pcur_get_page_cur(cursor)); > cursor->old_stored = 122766467; >} >static inline >void >btr_pcur_move_to_last_on_page( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > mtr = mtr; > ; > page_cur_set_after_last(buf_frame_align(btr_pcur_get_rec(cursor)), > btr_pcur_get_page_cur(cursor)); > cursor->old_stored = 122766467; >} >static inline >ulint >btr_pcur_move_to_next_user_rec( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > ; > ; > cursor->old_stored = 122766467; >loop: > if (btr_pcur_is_after_last_on_page(cursor, mtr)) { > if (btr_pcur_is_after_last_in_tree(cursor, mtr)) { > return((0)); > } > btr_pcur_move_to_next_page(cursor, mtr); > } else { > btr_pcur_move_to_next_on_page(cursor, mtr); > } > if (btr_pcur_is_on_user_rec(cursor, mtr)) { > return((1)); > } > goto loop; >} >static inline >ulint >btr_pcur_move_to_next( > btr_pcur_t* cursor, > mtr_t* mtr) >{ > ; > ; > cursor->old_stored = 122766467; > if (btr_pcur_is_after_last_on_page(cursor, mtr)) { > if (btr_pcur_is_after_last_in_tree(cursor, mtr)) { > return((0)); > } > btr_pcur_move_to_next_page(cursor, mtr); > return((1)); > } > btr_pcur_move_to_next_on_page(cursor, mtr); > return((1)); >} >static inline >void >btr_pcur_commit( > btr_pcur_t* pcur) >{ > do { if (__builtin_expect(!((ulint)(pcur->pos_state == 1997660512)), (0))) { ut_dbg_assertion_failed("pcur->pos_state == BTR_PCUR_IS_POSITIONED", "./../include/btr0pcur.ic", (ulint) 389); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/btr0pcur.ic", (ulint) 389); } while (0); } while (0); > pcur->latch_mode = 3; > mtr_commit(pcur->mtr); > pcur->pos_state = 1187549791; >} >static inline >void >btr_pcur_commit_specify_mtr( > btr_pcur_t* pcur, > mtr_t* mtr) >{ > do { if (__builtin_expect(!((ulint)(pcur->pos_state == 1997660512)), (0))) { ut_dbg_assertion_failed("pcur->pos_state == BTR_PCUR_IS_POSITIONED", "./../include/btr0pcur.ic", (ulint) 407); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/btr0pcur.ic", (ulint) 407); } while (0); } while (0); > pcur->latch_mode = 3; > mtr_commit(mtr); > pcur->pos_state = 1187549791; >} >static inline >void >btr_pcur_detach( > btr_pcur_t* pcur) >{ > do { if (__builtin_expect(!((ulint)(pcur->pos_state == 1997660512)), (0))) { ut_dbg_assertion_failed("pcur->pos_state == BTR_PCUR_IS_POSITIONED", "./../include/btr0pcur.ic", (ulint) 424); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("./../include/btr0pcur.ic", (ulint) 424); } while (0); } while (0); > pcur->latch_mode = 3; > pcur->pos_state = 1187549791; >} >static inline >ulint >btr_pcur_is_detached( > btr_pcur_t* pcur) >{ > if (pcur->latch_mode == 3) { > return((1)); > } > return((0)); >} >static inline >void >btr_pcur_init( > btr_pcur_t* pcur) >{ > pcur->old_stored = 122766467; > pcur->old_rec_buf = ((void *)0); > pcur->old_rec = ((void *)0); >} >static inline >void >btr_pcur_open( > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > ulint latch_mode, > btr_pcur_t* cursor, > mtr_t* mtr) >{ > btr_cur_t* btr_cursor; > btr_pcur_init(cursor); > cursor->latch_mode = latch_mode; > cursor->search_mode = mode; > btr_cursor = btr_pcur_get_btr_cur(cursor); > btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode, > btr_cursor, 0, mtr); > cursor->pos_state = 1997660512; > cursor->trx_if_known = ((void *)0); >} >static inline >void >btr_pcur_open_with_no_init( > dict_index_t* index, > dtuple_t* tuple, > ulint mode, > ulint latch_mode, > btr_pcur_t* cursor, > ulint has_search_latch, > mtr_t* mtr) >{ > btr_cur_t* btr_cursor; > cursor->latch_mode = latch_mode; > cursor->search_mode = mode; > btr_cursor = btr_pcur_get_btr_cur(cursor); > btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode, > btr_cursor, has_search_latch, mtr); > cursor->pos_state = 1997660512; > cursor->old_stored = 122766467; > cursor->trx_if_known = ((void *)0); >} >static inline >void >btr_pcur_open_at_index_side( > ulint from_left, > dict_index_t* index, > ulint latch_mode, > btr_pcur_t* pcur, > ulint do_init, > mtr_t* mtr) >{ > pcur->latch_mode = latch_mode; > if (from_left) { > pcur->search_mode = 1; > } else { > pcur->search_mode = 3; > } > if (do_init) { > btr_pcur_init(pcur); > } > btr_cur_open_at_index_side(from_left, index, latch_mode, > btr_pcur_get_btr_cur(pcur), mtr); > pcur->pos_state = 1997660512; > pcur->old_stored = 122766467; > pcur->trx_if_known = ((void *)0); >} >static inline >void >btr_pcur_open_at_rnd_pos( > dict_index_t* index, > ulint latch_mode, > btr_pcur_t* cursor, > mtr_t* mtr) >{ > cursor->latch_mode = latch_mode; > cursor->search_mode = 1; > btr_pcur_init(cursor); > btr_cur_open_at_rnd_pos(index, latch_mode, > btr_pcur_get_btr_cur(cursor), mtr); > cursor->pos_state = 1997660512; > cursor->old_stored = 122766467; > cursor->trx_if_known = ((void *)0); >} >static inline >void >btr_pcur_close( > btr_pcur_t* cursor) >{ > if (cursor->old_rec_buf != ((void *)0)) { > mem_free_func((cursor->old_rec_buf), "./../include/btr0pcur.ic", 616); > cursor->old_rec = ((void *)0); > cursor->old_rec_buf = ((void *)0); > } > cursor->btr_cur.page_cur.rec = ((void *)0); > cursor->old_rec = ((void *)0); > cursor->old_stored = 122766467; > cursor->latch_mode = 3; > cursor->pos_state = 1328997689; > cursor->trx_if_known = ((void *)0); >} >typedef unsigned char dict_hdr_t; >dict_hdr_t* >dict_hdr_get( > mtr_t* mtr); >dulint >dict_hdr_get_new_id( > ulint type); >static inline >dulint >dict_sys_get_new_row_id(void); >static inline >dulint >dict_sys_read_row_id( > unsigned char* field); >static inline >void >dict_sys_write_row_id( > unsigned char* field, > dulint row_id); >void >dict_boot(void); >void >dict_create(void); >void >dict_hdr_flush_row_id(void); >static inline >dulint >dict_sys_get_new_row_id(void) >{ > dulint id; > mutex_enter_func((&(dict_sys->mutex)), "./../include/dict0boot.ic", 28); > id = dict_sys->row_id; > if (0 == (ut_dulint_get_low(id) % 256)) { > dict_hdr_flush_row_id(); > } > { if ((dict_sys->row_id).low == 0xFFFFFFFFUL) { (dict_sys->row_id).high = (dict_sys->row_id).high + 1; (dict_sys->row_id).low = 0; } else { (dict_sys->row_id).low = (dict_sys->row_id).low + 1; }}; > mutex_exit(&(dict_sys->mutex)); > return(id); >} >static inline >dulint >dict_sys_read_row_id( > unsigned char* field) >{ > ; > return(mach_read_from_6(field)); >} >static inline >void >dict_sys_write_row_id( > unsigned char* field, > dulint row_id) >{ > ; > mach_write_to_6(field, row_id); >} >typedef struct sym_node_struct sym_node_t; >typedef struct sym_tab_struct sym_tab_t; >typedef struct pars_res_word_struct pars_res_word_t; >typedef struct func_node_struct func_node_t; >typedef struct order_node_struct order_node_t; >typedef struct proc_node_struct proc_node_t; >typedef struct elsif_node_struct elsif_node_t; >typedef struct if_node_struct if_node_t; >typedef struct while_node_struct while_node_t; >typedef struct for_node_struct for_node_t; >typedef struct return_node_struct return_node_t; >typedef struct assign_node_struct assign_node_t; >typedef struct col_assign_node_struct col_assign_node_t; >typedef struct { ulint count; sym_node_t * start; sym_node_t * end; } sym_node_list_t; >extern ulint que_trace_on; >void >que_graph_publish( > que_t* graph, > sess_t* sess); >que_fork_t* >que_fork_create( > que_t* graph, > que_node_t* parent, > ulint fork_type, > mem_heap_t* heap); >static inline >que_thr_t* >que_fork_get_first_thr( > que_fork_t* fork); >static inline >que_node_t* >que_fork_get_child( > que_fork_t* fork); >static inline >void >que_node_set_parent( > que_node_t* node, > que_node_t* parent); >que_thr_t* >que_thr_create( > que_fork_t* parent, > mem_heap_t* heap); >ulint >que_graph_try_free( > que_t* graph); >void >que_graph_free_recursive( > que_node_t* node); >void >que_graph_free( > que_t* graph); >ulint >que_thr_stop( > que_thr_t* thr); >void >que_thr_move_to_run_state_for_mysql( > que_thr_t* thr, > trx_t* trx); >void >que_thr_stop_for_mysql_no_error( > que_thr_t* thr, > trx_t* trx); >void >que_thr_stop_for_mysql( > que_thr_t* thr); >void >que_run_threads( > que_thr_t* thr); >void >que_fork_error_handle( > trx_t* trx, > que_t* fork); >void >que_thr_handle_error( > que_thr_t* thr, > ulint err_no, > unsigned char* err_str, > ulint err_len); >void >que_thr_end_wait( > que_thr_t* thr, > que_thr_t** next_thr); >void >que_thr_end_wait_no_next_thr( > que_thr_t* thr); >que_thr_t* >que_fork_start_command( > que_fork_t* fork); >static inline >trx_t* >thr_get_trx( > que_thr_t* thr); >static inline >ulint >que_node_get_type( > que_node_t* node); >static inline >dtype_t* >que_node_get_data_type( > que_node_t* node); >static inline >dfield_t* >que_node_get_val( > que_node_t* node); >static inline >ulint >que_node_get_val_buf_size( > que_node_t* node); >static inline >void >que_node_set_val_buf_size( > que_node_t* node, > ulint size); >static inline >que_node_t* >que_node_get_next( > que_node_t* node); >static inline >que_node_t* >que_node_get_parent( > que_node_t* node); >static inline >que_node_t* >que_node_list_add_last( > que_node_t* node_list, > que_node_t* node); >static inline >ulint >que_node_list_get_len( > que_node_t* node_list); >static inline >ulint >que_thr_peek_stop( > que_thr_t* thr); >static inline >ulint >que_graph_is_select( > que_t* graph); >void >que_node_print_info( > que_node_t* node); >struct que_thr_struct{ > que_common_t common; > ulint magic_n; > que_node_t* child; > que_t* graph; > ulint is_active; > ulint state; > struct { que_thr_t * prev; que_thr_t * next; } > thrs; > struct { que_thr_t * prev; que_thr_t * next; } > trx_thrs; > struct { que_thr_t * prev; que_thr_t * next; } > queue; > que_node_t* run_node; > que_node_t* prev_node; > ulint resource; > ulint lock_state; >}; >struct que_fork_struct{ > que_common_t common; > que_t* graph; > ulint fork_type; > ulint n_active_thrs; > trx_t* trx; > ulint state; > que_thr_t* caller; > struct { ulint count; que_thr_t * start; que_thr_t * end; } > thrs; > sym_tab_t* sym_tab; > ulint cur_end; > ulint cur_pos; > ulint cur_on_row; > dulint n_inserts; > dulint n_updates; > dulint n_deletes; > sel_node_t* last_sel_node; > struct { que_fork_t * prev; que_fork_t * next; } > graphs; > mem_heap_t* heap; >}; >sess_t* >sess_open(void); >ulint >sess_try_close( > sess_t* sess); >struct sess_struct{ > ulint state; > trx_t* trx; > struct { ulint count; que_t * start; que_t * end; } > graphs; >}; >static inline >trx_t* >thr_get_trx( > que_thr_t* thr) >{ > ; > return(thr->graph->trx); >} >static inline >que_thr_t* >que_fork_get_first_thr( > que_fork_t* fork) >{ > return((fork->thrs).start); >} >static inline >que_node_t* >que_fork_get_child( > que_fork_t* fork) >{ > que_thr_t* thr; > thr = (fork->thrs).start; > return(thr->child); >} >static inline >ulint >que_node_get_type( > que_node_t* node) >{ > ; > return(((que_common_t*)node)->type); >} >static inline >dfield_t* >que_node_get_val( > que_node_t* node) >{ > ; > return(&(((que_common_t*)node)->val)); >} >static inline >ulint >que_node_get_val_buf_size( > que_node_t* node) >{ > ; > return(((que_common_t*)node)->val_buf_size); >} >static inline >void >que_node_set_val_buf_size( > que_node_t* node, > ulint size) >{ > ; > ((que_common_t*)node)->val_buf_size = size; >} >static inline >void >que_node_set_parent( > que_node_t* node, > que_node_t* parent) >{ > ; > ((que_common_t*)node)->parent = parent; >} >static inline >dtype_t* >que_node_get_data_type( > que_node_t* node) >{ > ; > return(&(((que_common_t*)node)->val.type)); >} >static inline >que_node_t* >que_node_list_add_last( > que_node_t* node_list, > que_node_t* node) >{ > que_common_t* cnode; > que_common_t* cnode2; > cnode = node; > cnode->brother = ((void *)0); > if (node_list == ((void *)0)) { > return(node); > } > cnode2 = node_list; > while (cnode2->brother != ((void *)0)) { > cnode2 = cnode2->brother; > } > cnode2->brother = node; > return(node_list); >} >static inline >que_node_t* >que_node_get_next( > que_node_t* node) >{ > return(((que_common_t*)node)->brother); >} >static inline >ulint >que_node_list_get_len( > que_node_t* node_list) >{ > que_common_t* cnode; > ulint len; > cnode = node_list; > len = 0; > while (cnode != ((void *)0)) { > len++; > cnode = cnode->brother; > } > return(len); >} >static inline >que_node_t* >que_node_get_parent( > que_node_t* node) >{ > return(((que_common_t*)node)->parent); >} >static inline >ulint >que_thr_peek_stop( > que_thr_t* thr) >{ > trx_t* trx; > que_t* graph; > graph = thr->graph; > trx = graph->trx; > if (graph->state != 1 > || trx->que_state == 2 > || ((trx->signals).count > 0 > && trx->que_state == 1)) { > return((1)); > } > return((0)); >} >static inline >ulint >que_graph_is_select( > que_t* graph) >{ > if (graph->fork_type == 2 > || graph->fork_type == 1) { > return((1)); > } > return((0)); >} >ulint >row_ins_check_foreign_constraint( > ulint check_ref, > dict_foreign_t* foreign, > dict_table_t* table, > dtuple_t* entry, > que_thr_t* thr); >ins_node_t* >ins_node_create( > ulint ins_type, > dict_table_t* table, > mem_heap_t* heap); >void >ins_node_set_new_row( > ins_node_t* node, > dtuple_t* row); >ulint >row_ins_index_entry_low( > ulint mode, > dict_index_t* index, > dtuple_t* entry, > ulint* ext_vec, > ulint n_ext_vec, > que_thr_t* thr); >ulint >row_ins_index_entry( > dict_index_t* index, > dtuple_t* entry, > ulint* ext_vec, > ulint n_ext_vec, > que_thr_t* thr); >ulint >row_ins( > ins_node_t* node, > que_thr_t* thr); >que_thr_t* >row_ins_step( > que_thr_t* thr); >struct ins_node_struct{ > que_common_t common; > ulint ins_type; > dtuple_t* row; > dict_table_t* table; > sel_node_t* select; > que_node_t* values_list; > ulint state; > dict_index_t* index; > dtuple_t* entry; > struct { ulint count; dtuple_t * start; dtuple_t * end; } > entry_list; > unsigned char* row_id_buf; > dulint trx_id; > unsigned char* trx_id_buf; > mem_heap_t* entry_sys_heap; > ulint magic_n; >}; >extern ulint row_rollback_on_timeout; >typedef struct row_prebuilt_struct row_prebuilt_t; >void >row_mysql_prebuilt_free_blob_heap( > row_prebuilt_t* prebuilt); >unsigned char* >row_mysql_store_true_var_len( > unsigned char* dest, > ulint len, > ulint lenlen); >unsigned char* >row_mysql_read_true_varchar( > ulint* len, > unsigned char* field, > ulint lenlen); >void >row_mysql_store_blob_ref( > unsigned char* dest, > ulint col_len, > unsigned char* data, > ulint len); >unsigned char* >row_mysql_read_blob_ref( > ulint* len, > unsigned char* ref, > ulint col_len); >unsigned char* >row_mysql_store_col_in_innobase_format( > dfield_t* dfield, > unsigned char* buf, > ulint row_format_col, > unsigned char* mysql_data, > ulint col_len, > ulint comp); >ulint >row_mysql_handle_errors( > ulint* new_err, > trx_t* trx, > que_thr_t* thr, > trx_savept_t* savept); >row_prebuilt_t* >row_create_prebuilt( > dict_table_t* table); >void >row_prebuilt_free( > row_prebuilt_t* prebuilt); >void >row_update_prebuilt_trx( > row_prebuilt_t* prebuilt, > trx_t* trx); >void >row_unlock_table_autoinc_for_mysql( > trx_t* trx); >int >row_lock_table_autoinc_for_mysql( > row_prebuilt_t* prebuilt); >int >row_lock_table_for_mysql( > row_prebuilt_t* prebuilt, > dict_table_t* table, > ulint mode); >int >row_insert_for_mysql( > unsigned char* mysql_rec, > row_prebuilt_t* prebuilt); >void >row_prebuild_sel_graph( > row_prebuilt_t* prebuilt); >upd_t* >row_get_prebuilt_update_vector( > row_prebuilt_t* prebuilt); >ulint >row_table_got_default_clust_index( > dict_table_t* table); >ulint >row_get_mysql_key_number_for_index( > dict_index_t* index); >int >row_update_for_mysql( > unsigned char* mysql_rec, > row_prebuilt_t* prebuilt); >int >row_unlock_for_mysql( > row_prebuilt_t* prebuilt, > ulint has_latches_on_recs); >upd_node_t* >row_create_update_node_for_mysql( > dict_table_t* table, > mem_heap_t* heap); >ulint >row_update_cascade_for_mysql( > que_thr_t* thr, > upd_node_t* node, > dict_table_t* table); >void >row_mysql_lock_data_dictionary( > trx_t* trx); >void >row_mysql_unlock_data_dictionary( > trx_t* trx); >void >row_mysql_freeze_data_dictionary( > trx_t* trx); >void >row_mysql_unfreeze_data_dictionary( > trx_t* trx); >int >row_create_table_for_mysql( > dict_table_t* table, > trx_t* trx); >int >row_create_index_for_mysql( > dict_index_t* index, > trx_t* trx, > const ulint* field_lengths); >int >row_table_add_foreign_constraints( > trx_t* trx, > const char* sql_string, > const char* name, > ulint reject_fks); >ulint >row_drop_tables_for_mysql_in_background(void); >ulint >row_get_background_drop_list_len_low(void); >int >row_truncate_table_for_mysql( > dict_table_t* table, > trx_t* trx); >int >row_drop_table_for_mysql( > const char* name, > trx_t* trx, > ulint drop_db); >int >row_discard_tablespace_for_mysql( > const char* name, > trx_t* trx); >int >row_import_tablespace_for_mysql( > const char* name, > trx_t* trx); >int >row_drop_database_for_mysql( > const char* name, > trx_t* trx); >int >row_rename_table_for_mysql( > const char* old_name, > const char* new_name, > trx_t* trx); >ulint >row_check_table_for_mysql( > row_prebuilt_t* prebuilt); >typedef struct mysql_row_templ_struct mysql_row_templ_t; >struct mysql_row_templ_struct { > ulint col_no; > ulint rec_field_no; > ulint mysql_col_offset; > ulint mysql_col_len; > ulint mysql_null_byte_offset; > ulint mysql_null_bit_mask; > ulint type; > ulint mysql_type; > ulint mysql_length_bytes; > ulint charset; > ulint mbminlen; > ulint mbmaxlen; > ulint is_unsigned; >}; >struct row_prebuilt_struct { > ulint magic_n; > dict_table_t* table; > trx_t* trx; > ulint sql_stat_start; > ulint mysql_has_locked; > ulint clust_index_was_generated; > dict_index_t* index; > ulint read_just_key; > ulint used_in_HANDLER; > ulint template_type; > ulint n_template; > ulint null_bitmap_len; > ulint need_to_access_clustered; > ulint templ_contains_blob; > mysql_row_templ_t* mysql_template; > mem_heap_t* heap; > ins_node_t* ins_node; > unsigned char* ins_upd_rec_buff; > ulint hint_need_to_fetch_extra_cols; > upd_node_t* upd_node; > que_fork_t* ins_graph; > que_fork_t* upd_graph; > btr_pcur_t* pcur; > btr_pcur_t* clust_pcur; > que_fork_t* sel_graph; > dtuple_t* search_tuple; > unsigned char row_id[6]; > dtuple_t* clust_ref; > ulint select_lock_type; > ulint stored_select_lock_type; > ulint mysql_prefix_len; > ulint mysql_row_len; > ulint n_rows_fetched; > ulint fetch_direction; > unsigned char* fetch_cache[8]; > ulint keep_other_fields_on_keyread; > ulint fetch_cache_first; > ulint n_fetch_cached; > mem_heap_t* blob_heap; > mem_heap_t* old_vers_heap; > ulint magic_n2; >}; >extern int yydebug; >extern sym_tab_t* pars_sym_tab_global; >extern pars_res_word_t pars_to_char_token; >extern pars_res_word_t pars_to_number_token; >extern pars_res_word_t pars_to_binary_token; >extern pars_res_word_t pars_binary_to_number_token; >extern pars_res_word_t pars_substr_token; >extern pars_res_word_t pars_replstr_token; >extern pars_res_word_t pars_concat_token; >extern pars_res_word_t pars_length_token; >extern pars_res_word_t pars_instr_token; >extern pars_res_word_t pars_sysdate_token; >extern pars_res_word_t pars_printf_token; >extern pars_res_word_t pars_assert_token; >extern pars_res_word_t pars_rnd_token; >extern pars_res_word_t pars_rnd_str_token; >extern pars_res_word_t pars_count_token; >extern pars_res_word_t pars_sum_token; >extern pars_res_word_t pars_distinct_token; >extern pars_res_word_t pars_int_token; >extern pars_res_word_t pars_char_token; >extern pars_res_word_t pars_float_token; >extern pars_res_word_t pars_update_token; >extern pars_res_word_t pars_asc_token; >extern pars_res_word_t pars_desc_token; >extern pars_res_word_t pars_open_token; >extern pars_res_word_t pars_close_token; >extern pars_res_word_t pars_consistent_token; >extern pars_res_word_t pars_unique_token; >extern pars_res_word_t pars_clustered_token; >extern ulint pars_star_denoter; >int >yyparse(void); >que_t* >pars_sql( > const char* str); >void >pars_get_lex_chars( > char* buf, > int* result, > int max_size); >void >yyerror( > const char* s); >sym_node_t* >pars_variable_declaration( > sym_node_t* node, > pars_res_word_t* type); >func_node_t* >pars_func( > que_node_t* res_word, > que_node_t* arg); >func_node_t* >pars_op( > int func, > que_node_t* arg1, > que_node_t* arg2); >order_node_t* >pars_order_by( > sym_node_t* column, > pars_res_word_t* asc); >sel_node_t* >pars_select_list( > que_node_t* select_list, > sym_node_t* into_list); >que_node_t* >pars_cursor_declaration( > sym_node_t* sym_node, > sel_node_t* select_node); >sel_node_t* >pars_select_statement( > sel_node_t* select_node, > sym_node_t* table_list, > que_node_t* search_cond, > pars_res_word_t* for_update, > pars_res_word_t* consistent_read, > order_node_t* order_by); >col_assign_node_t* >pars_column_assignment( > sym_node_t* column, > que_node_t* exp); >upd_node_t* >pars_update_statement_start( > ulint is_delete, > sym_node_t* table_sym, > col_assign_node_t* col_assign_list); >upd_node_t* >pars_update_statement( > upd_node_t* node, > sym_node_t* cursor_sym, > que_node_t* search_cond); >ins_node_t* >pars_insert_statement( > sym_node_t* table_sym, > que_node_t* values_list, > sel_node_t* select); >sym_node_t* >pars_parameter_declaration( > sym_node_t* node, > ulint param_type, > pars_res_word_t* type); >elsif_node_t* >pars_elsif_element( > que_node_t* cond, > que_node_t* stat_list); >if_node_t* >pars_if_statement( > que_node_t* cond, > que_node_t* stat_list, > que_node_t* else_part); >for_node_t* >pars_for_statement( > sym_node_t* loop_var, > que_node_t* loop_start_limit, > que_node_t* loop_end_limit, > que_node_t* stat_list); >while_node_t* >pars_while_statement( > que_node_t* cond, > que_node_t* stat_list); >return_node_t* >pars_return_statement(void); >func_node_t* >pars_procedure_call( > que_node_t* res_word, > que_node_t* args); >assign_node_t* >pars_assignment_statement( > sym_node_t* var, > que_node_t* val); >fetch_node_t* >pars_fetch_statement( > sym_node_t* cursor, > sym_node_t* into_list); >open_node_t* >pars_open_statement( > ulint type, > sym_node_t* cursor); >row_printf_node_t* >pars_row_printf_statement( > sel_node_t* sel_node); >commit_node_t* >pars_commit_statement(void); >roll_node_t* >pars_rollback_statement(void); >sym_node_t* >pars_column_def( > sym_node_t* sym_node, > pars_res_word_t* type); >tab_node_t* >pars_create_table( > sym_node_t* table_sym, > sym_node_t* column_defs, > void* not_fit_in_memory); >ind_node_t* >pars_create_index( > pars_res_word_t* unique_def, > pars_res_word_t* clustered_def, > sym_node_t* index_sym, > sym_node_t* table_sym, > sym_node_t* column_list); >que_fork_t* >pars_procedure_definition( > sym_node_t* sym_node, > sym_node_t* param_list, > que_node_t* stat_list); >que_fork_t* >pars_stored_procedure_call( > sym_node_t* sym_node); >que_thr_t* >pars_complete_graph_for_exec( > que_node_t* node, > trx_t* trx, > mem_heap_t* heap); >struct pars_res_word_struct{ > int code; >}; >struct func_node_struct{ > que_common_t common; > int func; > ulint class; > que_node_t* args; > struct { func_node_t * prev; func_node_t * next; } cond_list; > struct { func_node_t * prev; func_node_t * next; } func_node_list; >}; >struct order_node_struct{ > que_common_t common; > sym_node_t* column; > ulint asc; >}; >struct proc_node_struct{ > que_common_t common; > sym_node_t* proc_id; > sym_node_t* param_list; > que_node_t* stat_list; > sym_tab_t* sym_tab; >}; >struct elsif_node_struct{ > que_common_t common; > que_node_t* cond; > que_node_t* stat_list; >}; >struct if_node_struct{ > que_common_t common; > que_node_t* cond; > que_node_t* stat_list; > que_node_t* else_part; > elsif_node_t* elsif_list; >}; >struct while_node_struct{ > que_common_t common; > que_node_t* cond; > que_node_t* stat_list; >}; >struct for_node_struct{ > que_common_t common; > sym_node_t* loop_var; > que_node_t* loop_start_limit; > que_node_t* loop_end_limit; > int loop_end_value; > que_node_t* stat_list; >}; >struct return_node_struct{ > que_common_t common; >}; >struct assign_node_struct{ > que_common_t common; > sym_node_t* var; > que_node_t* val; >}; >struct col_assign_node_struct{ > que_common_t common; > sym_node_t* col; > que_node_t* val; >}; >trx_savept_t >trx_savept_take( > trx_t* trx); >trx_undo_arr_t* >trx_undo_arr_create(void); >void >trx_undo_arr_free( > trx_undo_arr_t* arr); >static inline >trx_undo_inf_t* >trx_undo_arr_get_nth_info( > trx_undo_arr_t* arr, > ulint n); >void >trx_roll_try_truncate( > trx_t* trx); >trx_undo_rec_t* >trx_roll_pop_top_rec_of_trx( > trx_t* trx, > dulint limit, > dulint* roll_ptr, > mem_heap_t* heap); >ulint >trx_undo_rec_reserve( > trx_t* trx, > dulint undo_no); >void >trx_undo_rec_release( > trx_t* trx, > dulint undo_no); >void >trx_rollback( > trx_t* trx, > trx_sig_t* sig, > que_thr_t** next_thr); >void* >trx_rollback_or_clean_all_without_sess( > void* arg __attribute__((unused))); >void >trx_finish_rollback_off_kernel( > que_t* graph, > trx_t* trx, > que_thr_t** next_thr); >que_t* >trx_roll_graph_build( > trx_t* trx); >roll_node_t* >roll_node_create( > mem_heap_t* heap); >que_thr_t* >trx_rollback_step( > que_thr_t* thr); >int >trx_rollback_for_mysql( > trx_t* trx); >int >trx_rollback_last_sql_stat_for_mysql( > trx_t* trx); >int >trx_general_rollback_for_mysql( > trx_t* trx, > ulint partial, > trx_savept_t* savept); >ulint >trx_rollback_to_savepoint_for_mysql( > trx_t* trx, > const char* savepoint_name, > ib_longlong* mysql_binlog_cache_pos); >ulint >trx_savepoint_for_mysql( > trx_t* trx, > const char* savepoint_name, > ib_longlong binlog_cache_pos); >ulint >trx_release_savepoint_for_mysql( > trx_t* trx, > const char* savepoint_name); >void >trx_roll_savepoints_free( > trx_t* trx, > trx_named_savept_t* savep); >extern sess_t* trx_dummy_sess; >struct trx_undo_inf_struct{ > dulint trx_no; > dulint undo_no; > ulint in_use; >}; >struct trx_undo_arr_struct{ > ulint n_cells; > ulint n_used; > trx_undo_inf_t* infos; > mem_heap_t* heap; >}; >struct roll_node_struct{ > que_common_t common; > ulint state; > ulint partial; > trx_savept_t savept; >}; >struct trx_named_savept_struct{ > char* name; > trx_savept_t savept; > ib_longlong mysql_binlog_cache_pos; > struct { trx_named_savept_t * prev; trx_named_savept_t * next; } > trx_savepoints; >}; >static inline >trx_undo_inf_t* >trx_undo_arr_get_nth_info( > trx_undo_arr_t* arr, > ulint n) >{ > ; > ; > return(arr->infos + n); >} >static >dtuple_t* >dict_create_sys_tables_tuple( > dict_table_t* table, > mem_heap_t* heap) >{ > dict_table_t* sys_tables; > dtuple_t* entry; > dfield_t* dfield; > unsigned char* ptr; > ; > sys_tables = dict_sys->sys_tables; > entry = dtuple_create(heap, 8 + 4); > dfield = dtuple_get_nth_field(entry, 0); > dfield_set_data(dfield, table->name, ut_strlen(table->name)); > dfield = dtuple_get_nth_field(entry, 1); > ptr = mem_heap_alloc(heap, 8); > mach_write_to_8(ptr, table->id); > dfield_set_data(dfield, ptr, 8); > dfield = dtuple_get_nth_field(entry, 2); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, table->n_def > | ((ulint) table->comp << 31)); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 3); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, table->type); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 4); > ptr = mem_heap_alloc(heap, 8); > mach_write_to_8(ptr, table->mix_id); > dfield_set_data(dfield, ptr, 8); > dfield = dtuple_get_nth_field(entry, 5); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, table->mix_len); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 6); > if (table->type == 2) { > dfield_set_data(dfield, table->cluster_name, > ut_strlen(table->cluster_name)); > do { ut_dbg_assertion_failed(0, "dict0crea.c", (ulint) 97); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } while (0); > } else { > dfield_set_data(dfield, ((void *)0), 0xFFFFFFFF); > } > dfield = dtuple_get_nth_field(entry, 7); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, table->space); > dfield_set_data(dfield, ptr, 4); > dict_table_copy_types(entry, sys_tables); > return(entry); >} >static >dtuple_t* >dict_create_sys_columns_tuple( > dict_table_t* table, > ulint i, > mem_heap_t* heap) >{ > dict_table_t* sys_columns; > dtuple_t* entry; > dict_col_t* column; > dfield_t* dfield; > unsigned char* ptr; > ; > column = dict_table_get_nth_col(table, i); > sys_columns = dict_sys->sys_columns; > entry = dtuple_create(heap, 7 + 4); > dfield = dtuple_get_nth_field(entry, 0); > ptr = mem_heap_alloc(heap, 8); > mach_write_to_8(ptr, table->id); > dfield_set_data(dfield, ptr, 8); > dfield = dtuple_get_nth_field(entry, 1); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, i); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 2); > dfield_set_data(dfield, column->name, ut_strlen(column->name)); > dfield = dtuple_get_nth_field(entry, 3); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, (column->type).mtype); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 4); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, (column->type).prtype); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 5); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, (column->type).len); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 6); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, (column->type).prec); > dfield_set_data(dfield, ptr, 4); > dict_table_copy_types(entry, sys_columns); > return(entry); >} >static >ulint >dict_build_table_def_step( > que_thr_t* thr, > tab_node_t* node) >{ > dict_table_t* table; > dict_table_t* cluster_table; > dtuple_t* row; > ulint error; > const char* path_or_name; > ulint is_path; > mtr_t mtr; > ulint i; > ulint row_len; > table = node->table; > table->id = dict_hdr_get_new_id(8); > thr_get_trx(thr)->table_id = table->id; > row_len = 0; > for (i = 0; i < table->n_def; i++) { > row_len += dtype_get_min_size(dict_col_get_type( > &table->cols[i])); > } > if (row_len > ((2 * 8192) / 2 - 200)) { > return(34); > } > if (table->type == 2) { > cluster_table = dict_table_get_low(table->cluster_name); > if (cluster_table == ((void *)0)) { > return(30); > } > table->space = cluster_table->space; > table->mix_len = cluster_table->mix_len; > table->mix_id = dict_hdr_get_new_id(24); > } > if (srv_file_per_table) { > table->space = 0; > if (table->dir_path_of_temp_table) { > path_or_name = table->dir_path_of_temp_table; > is_path = (1); > } else { > path_or_name = table->name; > is_path = (0); > } > error = fil_create_new_single_table_tablespace( > &(table->space), path_or_name, is_path, > 4); > if (error != 10) { > return(error); > } > mtr_start(&mtr); > fsp_header_init(table->space, 4, &mtr); > mtr_commit(&mtr); > } > row = dict_create_sys_tables_tuple(table, node->heap); > ins_node_set_new_row(node->tab_def, row); > return(10); >} >static >ulint >dict_build_col_def_step( > tab_node_t* node) >{ > dtuple_t* row; > row = dict_create_sys_columns_tuple(node->table, node->col_no, > node->heap); > ins_node_set_new_row(node->col_def, row); > return(10); >} >static >dtuple_t* >dict_create_sys_indexes_tuple( > dict_index_t* index, > mem_heap_t* heap) >{ > dict_table_t* sys_indexes; > dict_table_t* table; > dtuple_t* entry; > dfield_t* dfield; > unsigned char* ptr; > ; > sys_indexes = dict_sys->sys_indexes; > table = dict_table_get_low(index->table_name); > entry = dtuple_create(heap, 7 + 4); > dfield = dtuple_get_nth_field(entry, 0); > ptr = mem_heap_alloc(heap, 8); > mach_write_to_8(ptr, table->id); > dfield_set_data(dfield, ptr, 8); > dfield = dtuple_get_nth_field(entry, 1); > ptr = mem_heap_alloc(heap, 8); > mach_write_to_8(ptr, index->id); > dfield_set_data(dfield, ptr, 8); > dfield = dtuple_get_nth_field(entry, 2); > dfield_set_data(dfield, index->name, ut_strlen(index->name)); > dfield = dtuple_get_nth_field(entry, 3); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, index->n_fields); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 4); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, index->type); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 5); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, index->space); > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 6); > ptr = mem_heap_alloc(heap, 4); > mach_write_to_4(ptr, 0xFFFFFFFF); > dfield_set_data(dfield, ptr, 4); > dict_table_copy_types(entry, sys_indexes); > return(entry); >} >static >dtuple_t* >dict_create_sys_fields_tuple( > dict_index_t* index, > ulint i, > mem_heap_t* heap) >{ > dict_table_t* sys_fields; > dtuple_t* entry; > dict_field_t* field; > dfield_t* dfield; > unsigned char* ptr; > ulint index_contains_column_prefix_field = (0); > ulint j; > ; > for (j = 0; j < index->n_fields; j++) { > if (dict_index_get_nth_field(index, j)->prefix_len > 0) { > index_contains_column_prefix_field = (1); > } > } > field = dict_index_get_nth_field(index, i); > sys_fields = dict_sys->sys_fields; > entry = dtuple_create(heap, 3 + 4); > dfield = dtuple_get_nth_field(entry, 0); > ptr = mem_heap_alloc(heap, 8); > mach_write_to_8(ptr, index->id); > dfield_set_data(dfield, ptr, 8); > dfield = dtuple_get_nth_field(entry, 1); > ptr = mem_heap_alloc(heap, 4); > if (index_contains_column_prefix_field) { > mach_write_to_4(ptr, (i << 16) + field->prefix_len); > } else { > mach_write_to_4(ptr, i); > } > dfield_set_data(dfield, ptr, 4); > dfield = dtuple_get_nth_field(entry, 2); > dfield_set_data(dfield, field->name, > ut_strlen(field->name)); > dict_table_copy_types(entry, sys_fields); > return(entry); >} >static >dtuple_t* >dict_create_search_tuple( > dtuple_t* tuple, > mem_heap_t* heap) >{ > dtuple_t* search_tuple; > dfield_t* field1; > dfield_t* field2; > ; > search_tuple = dtuple_create(heap, 2); > field1 = dtuple_get_nth_field(tuple, 0); > field2 = dtuple_get_nth_field(search_tuple, 0); > dfield_copy(field2, field1); > field1 = dtuple_get_nth_field(tuple, 1); > field2 = dtuple_get_nth_field(search_tuple, 1); > dfield_copy(field2, field1); > ; > return(search_tuple); >} >static >ulint >dict_build_index_def_step( > que_thr_t* thr, > ind_node_t* node) >{ > dict_table_t* table; > dict_index_t* index; > dtuple_t* row; > trx_t* trx; > trx = thr_get_trx(thr); > index = node->index; > table = dict_table_get_low(index->table_name); > if (table == ((void *)0)) { > return(31); > } > trx->table_id = table->id; > node->table = table; > ; > index->id = dict_hdr_get_new_id(16); > index->space = table->space; > node->page_no = 0xFFFFFFFF; > row = dict_create_sys_indexes_tuple(index, node->heap); > node->ind_row = row; > ins_node_set_new_row(node->ind_def, row); > return(10); >} >static >ulint >dict_build_field_def_step( > ind_node_t* node) >{ > dict_index_t* index; > dtuple_t* row; > index = node->index; > row = dict_create_sys_fields_tuple(index, node->field_no, node->heap); > ins_node_set_new_row(node->field_def, row); > return(10); >} >static >ulint >dict_create_index_tree_step( > ind_node_t* node) >{ > dict_index_t* index; > dict_table_t* sys_indexes; > dict_table_t* table; > dtuple_t* search_tuple; > btr_pcur_t pcur; > mtr_t mtr; > index = node->index; > table = node->table; > sys_indexes = dict_sys->sys_indexes; > if (index->type & 1 > && table->type == 2) { > return(10); > } > mtr_start(&mtr); > search_tuple = dict_create_search_tuple(node->ind_row, node->heap); > btr_pcur_open((sys_indexes->indexes).start, > search_tuple, 3, 2, > &pcur, &mtr); > btr_pcur_move_to_next_user_rec(&pcur, &mtr); > node->page_no = btr_create(index->type, index->space, index->id, > table->comp, &mtr); > page_rec_write_index_page_no(btr_pcur_get_rec(&pcur), > 8, > node->page_no, &mtr); > btr_pcur_close(&pcur); > mtr_commit(&mtr); > if (node->page_no == 0xFFFFFFFF) { > return(13); > } > return(10); >} >void >dict_drop_index_tree( > rec_t* rec, > mtr_t* mtr) >{ > ulint root_page_no; > ulint space; > unsigned char* ptr; > ulint len; > do { if (__builtin_expect(!((ulint)(!dict_sys->sys_indexes->comp)), (0))) { ut_dbg_assertion_failed("!dict_sys->sys_indexes->comp", "dict0crea.c", (ulint) 674); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 674); } while (0); } while (0); > ptr = rec_get_nth_field_old(rec, 8, &len); > ; > root_page_no = mtr_read_ulint(ptr, ((unsigned char)4), mtr); > if (root_page_no == 0xFFFFFFFF) { > return; > } > ptr = rec_get_nth_field_old(rec, > 7, &len); > ; > space = mtr_read_ulint(ptr, ((unsigned char)4), mtr); > if (!fil_tablespace_exists_in_mem(space)) { > return; > } > btr_free_but_not_root(space, root_page_no); > btr_free_root(space, root_page_no, mtr); > page_rec_write_index_page_no(rec, > 8, 0xFFFFFFFF, mtr); >} >ulint >dict_truncate_index_tree( > dict_table_t* table, > btr_pcur_t* pcur, > mtr_t* mtr) >{ > ulint root_page_no; > ulint space; > ulint type; > dulint index_id; > rec_t* rec; > unsigned char* ptr; > ulint len; > ulint comp; > dict_index_t* index; > do { if (__builtin_expect(!((ulint)(!dict_sys->sys_indexes->comp)), (0))) { ut_dbg_assertion_failed("!dict_sys->sys_indexes->comp", "dict0crea.c", (ulint) 749); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 749); } while (0); } while (0); > rec = btr_pcur_get_rec(pcur); > ptr = rec_get_nth_field_old(rec, 8, &len); > ; > root_page_no = mtr_read_ulint(ptr, ((unsigned char)4), mtr); > if (root_page_no == 0xFFFFFFFF) { > ut_print_timestamp(stderr); > fprintf(stderr, " InnoDB: Trying to TRUNCATE" > " a missing index of table %s!\n", table->name); > return(0xFFFFFFFF); > } > ptr = rec_get_nth_field_old(rec, > 7, &len); > ; > space = mtr_read_ulint(ptr, ((unsigned char)4), mtr); > if (!fil_tablespace_exists_in_mem(space)) { > ut_print_timestamp(stderr); > fprintf(stderr, " InnoDB: Trying to TRUNCATE" > " a missing .ibd file of table %s!\n", table->name); > return(0xFFFFFFFF); > } > ptr = rec_get_nth_field_old(rec, > 6, &len); > ; > type = mach_read_from_4(ptr); > ptr = rec_get_nth_field_old(rec, 1, &len); > ; > index_id = mach_read_from_8(ptr); > btr_free_but_not_root(space, root_page_no); > comp = page_is_comp(btr_page_get( > space, root_page_no, 2, mtr)); > btr_free_root(space, root_page_no, mtr); > page_rec_write_index_page_no(rec, 8, > 0xFFFFFFFF, mtr); > btr_pcur_store_position(pcur, mtr); > mtr_commit(mtr); > mtr_start(mtr); > btr_pcur_restore_position(2, pcur, mtr); > for (index = (table->indexes).start; > index; > index = (((index)->indexes).next)) { > if (!ut_dulint_cmp(index->id, index_id)) { > break; > } > } > root_page_no = btr_create(type, space, index_id, comp, mtr); > if (index) { > index->tree->page = root_page_no; > } else { > ut_print_timestamp(stderr); > fprintf(stderr, > " InnoDB: Index %lu %lu of table %s is missing\n" > "InnoDB: from the data dictionary during TRUNCATE!\n", > ut_dulint_get_high(index_id), > ut_dulint_get_low(index_id), > table->name); > } > return(root_page_no); >} >tab_node_t* >tab_create_graph_create( > dict_table_t* table, > mem_heap_t* heap) >{ > tab_node_t* node; > node = mem_heap_alloc(heap, sizeof(tab_node_t)); > node->common.type = 14; > node->table = table; > node->state = 1; > node->heap = mem_heap_create_func( (256), ((void *)0), 0, "dict0crea.c", 867); > node->tab_def = ins_node_create(2, dict_sys->sys_tables, > heap); > node->tab_def->common.parent = node; > node->col_def = ins_node_create(2, dict_sys->sys_columns, > heap); > node->col_def->common.parent = node; > node->commit_node = commit_node_create(heap); > node->commit_node->common.parent = node; > return(node); >} >ind_node_t* >ind_create_graph_create( > dict_index_t* index, > mem_heap_t* heap) >{ > ind_node_t* node; > node = mem_heap_alloc(heap, sizeof(ind_node_t)); > node->common.type = 15; > node->index = index; > node->state = 1; > node->page_no = 0xFFFFFFFF; > node->heap = mem_heap_create_func( (256), ((void *)0), 0, "dict0crea.c", 904); > node->ind_def = ins_node_create(2, > dict_sys->sys_indexes, heap); > node->ind_def->common.parent = node; > node->field_def = ins_node_create(2, > dict_sys->sys_fields, heap); > node->field_def->common.parent = node; > node->commit_node = commit_node_create(heap); > node->commit_node->common.parent = node; > return(node); >} >que_thr_t* >dict_create_table_step( > que_thr_t* thr) >{ > tab_node_t* node; > ulint err = 11; > trx_t* trx; > ; > trx = thr_get_trx(thr); > node = thr->run_node; > ; > if (thr->prev_node == que_node_get_parent(node)) { > node->state = 1; > } > if (node->state == 1) { > err = dict_build_table_def_step(thr, node); > if (err != 10) { > goto function_exit; > } > node->state = 2; > node->col_no = 0; > thr->run_node = node->tab_def; > return(thr); > } > if (node->state == 2) { > if (node->col_no < (node->table)->n_def) { > err = dict_build_col_def_step(node); > if (err != 10) { > goto function_exit; > } > node->col_no++; > thr->run_node = node->col_def; > return(thr); > } else { > node->state = 3; > } > } > if (node->state == 3) { > node->state = 4; > } > if (node->state == 4) { > dict_table_add_to_cache(node->table); > err = 10; > } >function_exit: > trx->error_state = err; > if (err == 10) { > } else if (err == 14) { > return(((void *)0)); > } else { > return(((void *)0)); > } > thr->run_node = que_node_get_parent(node); > return(thr); >} >que_thr_t* >dict_create_index_step( > que_thr_t* thr) >{ > ind_node_t* node; > ulint success; > ulint err = 11; > trx_t* trx; > ; > trx = thr_get_trx(thr); > node = thr->run_node; > ; > if (thr->prev_node == que_node_get_parent(node)) { > node->state = 1; > } > if (node->state == 1) { > err = dict_build_index_def_step(thr, node); > if (err != 10) { > goto function_exit; > } > node->state = 2; > node->field_no = 0; > thr->run_node = node->ind_def; > return(thr); > } > if (node->state == 2) { > if (node->field_no < (node->index)->n_fields) { > err = dict_build_field_def_step(node); > if (err != 10) { > goto function_exit; > } > node->field_no++; > thr->run_node = node->field_def; > return(thr); > } else { > node->state = 3; > } > } > if (node->state == 3) { > err = dict_create_index_tree_step(node); > if (err != 10) { > goto function_exit; > } > node->state = 4; > } > if (node->state == 4) { > node->state = 5; > } > if (node->state == 5) { > success = dict_index_add_to_cache(node->table, node->index, > node->page_no); > do { if (__builtin_expect(!((ulint)(success)), (0))) { ut_dbg_assertion_failed("success", "dict0crea.c", (ulint) 1126); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 1126); } while (0); } while (0); > err = 10; > } >function_exit: > trx->error_state = err; > if (err == 10) { > } else if (err == 14) { > return(((void *)0)); > } else { > return(((void *)0)); > } > thr->run_node = que_node_get_parent(node); > return(thr); >} >ulint >dict_create_or_check_foreign_constraint_tables(void) >{ > dict_table_t* table1; > dict_table_t* table2; > que_thr_t* thr; > que_t* graph; > ulint error; > trx_t* trx; > const char* str; > mutex_enter_func((&(dict_sys->mutex)), "dict0crea.c", 1169); > table1 = dict_table_get_low("SYS_FOREIGN"); > table2 = dict_table_get_low("SYS_FOREIGN_COLS"); > if (table1 && table2 > && (table1->indexes).count == 3 > && (table2->indexes).count == 1) { > mutex_exit(&(dict_sys->mutex)); > return(10); > } > mutex_exit(&(dict_sys->mutex)); > trx = trx_allocate_for_mysql(); > trx->op_info = "creating foreign key sys tables"; > row_mysql_lock_data_dictionary(trx); > if (table1) { > fprintf(stderr, > "InnoDB: dropping incompletely created SYS_FOREIGN table\n"); > row_drop_table_for_mysql("SYS_FOREIGN", trx, (1)); > } > if (table2) { > fprintf(stderr, > "InnoDB: dropping incompletely created SYS_FOREIGN_COLS table\n"); > row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, (1)); > } > fprintf(stderr, > "InnoDB: Creating foreign key constraint system tables\n"); > str = > "PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n" > "BEGIN\n" > "CREATE TABLE\n" > "SYS_FOREIGN(ID CHAR, FOR_NAME CHAR, REF_NAME CHAR, N_COLS INT);\n" > "CREATE UNIQUE CLUSTERED INDEX ID_IND ON SYS_FOREIGN (ID);\n" > "CREATE INDEX FOR_IND ON SYS_FOREIGN (FOR_NAME);\n" > "CREATE INDEX REF_IND ON SYS_FOREIGN (REF_NAME);\n" > "CREATE TABLE\n" > "SYS_FOREIGN_COLS(ID CHAR, POS INT, FOR_COL_NAME CHAR, REF_COL_NAME CHAR);\n" > "CREATE UNIQUE CLUSTERED INDEX ID_IND ON SYS_FOREIGN_COLS (ID, POS);\n" > "COMMIT WORK;\n" > "END;\n"; > graph = pars_sql(str); > do { if (__builtin_expect(!((ulint)(graph)), (0))) { ut_dbg_assertion_failed("graph", "dict0crea.c", (ulint) 1235); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 1235); } while (0); } while (0); > graph->trx = trx; > trx->graph = ((void *)0); > graph->fork_type = 10; > do { if (__builtin_expect(!((ulint)(thr = que_fork_start_command(graph))), (0))) { ut_dbg_assertion_failed("thr = que_fork_start_command(graph)", "dict0crea.c", (ulint) 1242); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 1242); } while (0); } while (0); > que_run_threads(thr); > error = trx->error_state; > if (error != 10) { > fprintf(stderr, "InnoDB: error %lu in creation\n", > (ulong) error); > do { if (__builtin_expect(!((ulint)(error == 13)), (0))) { ut_dbg_assertion_failed("error == DB_OUT_OF_FILE_SPACE", "dict0crea.c", (ulint) 1252); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 1252); } while (0); } while (0); > fprintf(stderr, "InnoDB: creation failed\n"); > fprintf(stderr, "InnoDB: tablespace is full\n"); > fprintf(stderr, > "InnoDB: dropping incompletely created SYS_FOREIGN tables\n"); > row_drop_table_for_mysql("SYS_FOREIGN", trx, (1)); > row_drop_table_for_mysql("SYS_FOREIGN_COLS", trx, (1)); > error = 32; > } > que_graph_free(graph); > trx->op_info = ""; > row_mysql_unlock_data_dictionary(trx); > trx_free_for_mysql(trx); > if (error == 10) { > fprintf(stderr, > "InnoDB: Foreign key constraint system tables created\n"); > } > return(error); >} >ulint >dict_create_add_foreigns_to_dictionary( > ulint start_id, > dict_table_t* table, > trx_t* trx) >{ > dict_foreign_t* foreign; > que_thr_t* thr; > que_t* graph; > ulint number = start_id + 1; > ulint len; > ulint error; > FILE* ef = dict_foreign_err_file; > ulint i; > char* sql; > char* sqlend; > static const char str1[] = "PROCEDURE ADD_FOREIGN_DEFS_PROC () IS\n" > "BEGIN\n" > "INSERT INTO SYS_FOREIGN VALUES("; > static const char str2[] = ");\n"; > static const char str3[] = > "INSERT INTO SYS_FOREIGN_COLS VALUES("; > static const char str4[] = > "COMMIT WORK;\n" > "END;\n"; > if (((void *)0) == dict_table_get_low("SYS_FOREIGN")) { > fprintf(stderr, > "InnoDB: table SYS_FOREIGN not found from internal data dictionary\n"); > return(11); > } > foreign = (table->foreign_list).start; >loop: > if (foreign == ((void *)0)) { > return(10); > } > if (foreign->id == ((void *)0)) { > ulint namelen = strlen(table->name); > char* id = mem_heap_alloc(foreign->heap, namelen + 20); > sprintf(id, "%s_ibfk_%lu", table->name, (ulong) number++); > foreign->id = id; > } > len = (sizeof str1) + (sizeof str2) + (sizeof str4) - 3 > + 9 + 10 > + ut_strlenq(foreign->id, '\'') * (foreign->n_fields + 1) > + ut_strlenq(table->name, '\'') > + ut_strlenq(foreign->referenced_table_name, '\''); > for (i = 0; i < foreign->n_fields; i++) { > len += 9 + 10 > + (sizeof str3) + (sizeof str2) - 2 > + ut_strlenq(foreign->foreign_col_names[i], '\'') > + ut_strlenq(foreign->referenced_col_names[i], '\''); > } > sql = sqlend = mem_alloc_func((len + 1), "dict0crea.c", 1366); > memcpy(sqlend, str1, (sizeof str1) - 1); > sqlend += (sizeof str1) - 1; > *sqlend++ = '\''; > sqlend = ut_strcpyq(sqlend, '\'', foreign->id); > *sqlend++ = '\'', *sqlend++ = ',', *sqlend++ = '\''; > sqlend = ut_strcpyq(sqlend, '\'', table->name); > *sqlend++ = '\'', *sqlend++ = ',', *sqlend++ = '\''; > sqlend = ut_strcpyq(sqlend, '\'', foreign->referenced_table_name); > *sqlend++ = '\'', *sqlend++ = ','; > sqlend += sprintf(sqlend, "%010lu", > foreign->n_fields + (foreign->type << 24)); > memcpy(sqlend, str2, (sizeof str2) - 1); > sqlend += (sizeof str2) - 1; > for (i = 0; i < foreign->n_fields; i++) { > memcpy(sqlend, str3, (sizeof str3) - 1); > sqlend += (sizeof str3) - 1; > *sqlend++ = '\''; > sqlend = ut_strcpyq(sqlend, '\'', foreign->id); > *sqlend++ = '\''; *sqlend++ = ','; > sqlend += sprintf(sqlend, "%010lu", (ulong) i); > *sqlend++ = ','; *sqlend++ = '\''; > sqlend = ut_strcpyq(sqlend, '\'', > foreign->foreign_col_names[i]); > *sqlend++ = '\''; *sqlend++ = ','; *sqlend++ = '\''; > sqlend = ut_strcpyq(sqlend, '\'', > foreign->referenced_col_names[i]); > *sqlend++ = '\''; > memcpy(sqlend, str2, (sizeof str2) - 1); > sqlend += (sizeof str2) - 1; > } > memcpy(sqlend, str4, sizeof str4); > sqlend += sizeof str4; > do { if (__builtin_expect(!((ulint)(sqlend == sql + len + 1)), (0))) { ut_dbg_assertion_failed("sqlend == sql + len + 1", "dict0crea.c", (ulint) 1405); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 1405); } while (0); } while (0); > graph = pars_sql(sql); > do { if (__builtin_expect(!((ulint)(graph)), (0))) { ut_dbg_assertion_failed("graph", "dict0crea.c", (ulint) 1409); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 1409); } while (0); } while (0); > mem_free_func((sql), "dict0crea.c", 1411); > graph->trx = trx; > trx->graph = ((void *)0); > graph->fork_type = 10; > do { if (__builtin_expect(!((ulint)(thr = que_fork_start_command(graph))), (0))) { ut_dbg_assertion_failed("thr = que_fork_start_command(graph)", "dict0crea.c", (ulint) 1418); if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = ((void *)0); } do if (__builtin_expect(ut_dbg_stop_threads, (0))) { ut_dbg_stop_thread("dict0crea.c", (ulint) 1418); } while (0); } while (0); > que_run_threads(thr); > error = trx->error_state; > que_graph_free(graph); > if (error == 17) { > mutex_enter_func((&dict_foreign_err_mutex), "dict0crea.c", 1427); > rewind(ef); > ut_print_timestamp(ef); > fputs(" Error in foreign key constraint creation for table ", > ef); > ut_print_name(ef, trx, table->name); > fputs(".\nA foreign key constraint of name ", ef); > ut_print_name(ef, trx, foreign->id); > fputs("\nalready exists." > " (Note that internally InnoDB adds 'databasename/'\n" > "in front of the user-defined constraint name).\n", > ef); > fputs("Note that InnoDB's FOREIGN KEY system tables store\n" > "constraint names as case-insensitive, with the\n" > "MySQL standard latin1_swedish_ci collation. If you\n" > "create tables or databases whose names differ only in\n" > "the character case, then collisions in constraint\n" > "names can occur. Workaround: name your constraints\n" > "explicitly with unique names.\n", > ef); > mutex_exit(&dict_foreign_err_mutex); > return(error); > } > if (error != 10) { > fprintf(stderr, > "InnoDB: Foreign key constraint creation failed:\n" > "InnoDB: internal error number %lu\n", (ulong) error); > mutex_enter_func((&dict_foreign_err_mutex), "dict0crea.c", 1458); > ut_print_timestamp(ef); > fputs(" Internal error in foreign key constraint creation" > " for table ", ef); > ut_print_name(ef, trx, table->name); > fputs(".\n" > "See the MySQL .err log in the datadir for more information.\n", ef); > mutex_exit(&dict_foreign_err_mutex); > return(error); > } > foreign = (((foreign)->foreign_list).next); > goto loop; >}
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 337666
: 247614 |
247616