Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 82942 Details for
Bug 127325
emerging djvu failed
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Preprocessed source
ccm6iBBJ.out (text/plain), 269.30 KB, created by
Vladimir Dolzhenko
on 2006-03-23 09:17:54 UTC
(
hide
)
Description:
Preprocessed source
Filename:
MIME Type:
Creator:
Vladimir Dolzhenko
Created:
2006-03-23 09:17:54 UTC
Size:
269.30 KB
patch
obsolete
>// /usr/libexec/gcc/i686-pc-linux-gnu/3.4.5/cc1plus -quiet -I.. -I.. -I../libdjvu -I. -D_GNU_SOURCE -D_REENTRANT -DHAVE_CONFIG_H -DNDEBUG -DTHREADMODEL=POSIXTHREADS djvuserve.cpp -fPIE -fstack-protector -fstack-protector-all -quiet -dumpbase djvuserve.cpp -march=pentium3 -mtune=i686 -auxbase djvuserve -O3 -Wall -Wno-non-virtual-dtor -fomit-frame-pointer -o - -frandom-seed=0 ># 1 "djvuserve.cpp" ># 1 "<built-in>" ># 1 "<command line>" ># 1 "djvuserve.cpp" ># 58 "djvuserve.cpp" ># 1 "../config.h" 1 ># 59 "djvuserve.cpp" 2 > > > > > ># 1 "../libdjvu/DjVuDocument.h" 1 ># 60 "../libdjvu/DjVuDocument.h" ># 1 "../config.h" 1 ># 61 "../libdjvu/DjVuDocument.h" 2 > > > > > > ># 1 "../libdjvu/DjVuPort.h" 1 ># 67 "../libdjvu/DjVuPort.h" ># 1 "../libdjvu/GThreads.h" 1 ># 134 "../libdjvu/GThreads.h" ># 1 "../libdjvu/DjVuGlobal.h" 1 ># 71 "../libdjvu/DjVuGlobal.h" ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/new" 1 3 ># 41 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/new" 3 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/cstddef" 1 3 ># 46 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/cstddef" 3 > ># 47 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/cstddef" 3 > ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 151 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 3 4 >typedef int ptrdiff_t; ># 213 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 3 4 >typedef unsigned int size_t; ># 49 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/cstddef" 2 3 > >namespace std >{ > using ::ptrdiff_t; > using ::size_t; >} ># 42 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/new" 2 3 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/exception" 1 3 ># 40 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/exception" 3 >extern "C++" { > >namespace std >{ ># 52 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/exception" 3 > class exception > { > public: > exception() throw() { } > virtual ~exception() throw(); > > > virtual const char* what() const throw(); > }; > > > > class bad_exception : public exception > { > public: > bad_exception() throw() { } > > > virtual ~bad_exception() throw(); > }; > > > typedef void (*terminate_handler) (); > > typedef void (*unexpected_handler) (); > > > terminate_handler set_terminate(terminate_handler) throw(); > > > void terminate() __attribute__ ((__noreturn__)); > > > unexpected_handler set_unexpected(unexpected_handler) throw(); > > > void unexpected() __attribute__ ((__noreturn__)); ># 100 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/exception" 3 > bool uncaught_exception() throw(); >} > >namespace __gnu_cxx >{ ># 115 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/exception" 3 > void __verbose_terminate_handler (); >} > >} ># 43 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/new" 2 3 > >extern "C++" { > >namespace std >{ > > > > > > class bad_alloc : public exception > { > public: > bad_alloc() throw() { } > > > virtual ~bad_alloc() throw(); > }; > > struct nothrow_t { }; > extern const nothrow_t nothrow; > > > typedef void (*new_handler)(); > > new_handler set_new_handler(new_handler) throw(); >} ># 82 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3/new" 3 >void* operator new(std::size_t) throw (std::bad_alloc); >void* operator new[](std::size_t) throw (std::bad_alloc); >void operator delete(void*) throw(); >void operator delete[](void*) throw(); >void* operator new(std::size_t, const std::nothrow_t&) throw(); >void* operator new[](std::size_t, const std::nothrow_t&) throw(); >void operator delete(void*, const std::nothrow_t&) throw(); >void operator delete[](void*, const std::nothrow_t&) throw(); > > >inline void* operator new(std::size_t, void* __p) throw() { return __p; } >inline void* operator new[](std::size_t, void* __p) throw() { return __p; } > > >inline void operator delete (void*, void*) throw() { } >inline void operator delete[](void*, void*) throw() { } > >} ># 72 "../libdjvu/DjVuGlobal.h" 2 ># 305 "../libdjvu/DjVuGlobal.h" >extern "C" void DjVuPrintErrorUTF8(const char *fmt, ...);; > > >extern "C" void DjVuPrintErrorNative(const char *fmt, ...);; > > >extern "C" void DjVuPrintMessageUTF8(const char *fmt, ...);; > > >extern "C" void DjVuPrintMessageNative(const char *fmt, ...);; > > > >extern "C" void DjVuFormatErrorUTF8(const char *fmt, ...);; > > > >extern "C" void DjVuFormatErrorNative(const char *fmt, ...);; > > >extern "C" void DjVuWriteError( const char *message );; > > >extern "C" void DjVuWriteMessage( const char *message );; > > > > > > > >extern "C" void DjVuMessageLookUpUTF8( char *msg_buffer, const unsigned int buffer_size, const char *message );; > > >extern "C" void DjVuMessageLookUpNative( char *msg_buffer, const unsigned int buffer_size, const char *message );; > > > > > > >extern "C" const char *djvu_programname(const char *programname);; ># 135 "../libdjvu/GThreads.h" 2 ># 1 "../libdjvu/GException.h" 1 ># 125 "../libdjvu/GException.h" >namespace DJVU { ># 138 "../libdjvu/GException.h" >class GException { >public: > enum source_type { GINTERNAL=0, GEXTERNAL, GAPPLICATION, GOTHER }; > > > > > > > > GException (const char *cause, const char *file=0, int line=0, > const char *func=0, const source_type source=GINTERNAL); > > > GException (const GException & exc); > > > GException (); > > > virtual ~GException(void); > > > GException & operator=(const GException & exc); > > > > > > void perror(void) const; ># 179 "../libdjvu/GException.h" > const char* get_cause(void) const; > > > > int cmp_cause(const char s2[]) const; > > > > static int cmp_cause(const char s1[],const char s2[]); > > > > const char* get_function(void) const { return func; } > > > > const char* get_file(void) const { return file; } > > > source_type get_source(void) const { return source; } > > > > int get_line(void) const { return line; }; > > > static const char * const outofmemory; > >private: > const char *cause; > const char *file; > const char *func; > int line; > source_type source; >}; ># 252 "../libdjvu/GException.h" >class GExceptionHandler { >public: > > static void exthrow(const GException &) __attribute__ ((noreturn)); > > > > static void rethrow(void) __attribute__ ((noreturn)); >}; ># 320 "../libdjvu/GException.h" >inline void >G_EXTHROW >(const GException &ex,const char *msg=0,const char *file=0,int line=0, > const char *func=0, const GException::source_type source=GException::GINTERNAL) >{ > GExceptionHandler::exthrow((msg||file||line||func)? GException(msg?msg:ex.get_cause(), file?file:ex.get_file(), line?line:ex.get_line(), func?func:ex.get_function(), source) :ex); > > > > > > >} > >inline void >G_EXTHROW >(const char msg[],const char *file=0,int line=0,const char *func=0, > const GException::source_type source=GException::GINTERNAL ) >{ > GExceptionHandler::exthrow(GException(msg,file,line,func,source)); >} ># 351 "../libdjvu/GException.h" >} > >using namespace DJVU; ># 136 "../libdjvu/GThreads.h" 2 ># 179 "../libdjvu/GThreads.h" ># 1 "/usr/include/sys/types.h" 1 3 4 ># 27 "/usr/include/sys/types.h" 3 4 ># 1 "/usr/include/features.h" 1 3 4 ># 309 "/usr/include/features.h" 3 4 ># 1 "/usr/include/sys/cdefs.h" 1 3 4 ># 310 "/usr/include/features.h" 2 3 4 ># 332 "/usr/include/features.h" 3 4 ># 1 "/usr/include/gnu/stubs.h" 1 3 4 ># 333 "/usr/include/features.h" 2 3 4 ># 28 "/usr/include/sys/types.h" 2 3 4 > >extern "C" { > ># 1 "/usr/include/bits/types.h" 1 3 4 ># 28 "/usr/include/bits/types.h" 3 4 ># 1 "/usr/include/bits/wordsize.h" 1 3 4 ># 29 "/usr/include/bits/types.h" 2 3 4 > > ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 32 "/usr/include/bits/types.h" 2 3 4 > > >typedef unsigned char __u_char; >typedef unsigned short int __u_short; >typedef unsigned int __u_int; >typedef unsigned long int __u_long; > > >typedef signed char __int8_t; >typedef unsigned char __uint8_t; >typedef signed short int __int16_t; >typedef unsigned short int __uint16_t; >typedef signed int __int32_t; >typedef unsigned int __uint32_t; > > > > >__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; ># 129 "/usr/include/bits/types.h" 3 4 ># 1 "/usr/include/bits/typesizes.h" 1 3 4 ># 130 "/usr/include/bits/types.h" 2 3 4 > > > > > > >__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 int __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; ># 32 "/usr/include/sys/types.h" 2 3 4 > > > >typedef __u_char u_char; >typedef __u_short u_short; >typedef __u_int u_int; >typedef __u_long u_long; >typedef __quad_t quad_t; >typedef __u_quad_t u_quad_t; >typedef __fsid_t fsid_t; > > > > >typedef __loff_t loff_t; > > > >typedef __ino_t ino_t; > > > > > > >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 __off_t off_t; > > > > > > >typedef __off64_t off64_t; > > > > >typedef __pid_t pid_t; > > > > >typedef __id_t id_t; > > > > >typedef __ssize_t ssize_t; > > > > > >typedef __daddr_t daddr_t; >typedef __caddr_t caddr_t; > > > > > >typedef __key_t key_t; ># 133 "/usr/include/sys/types.h" 3 4 ># 1 "/usr/include/time.h" 1 3 4 ># 58 "/usr/include/time.h" 3 4 > > >typedef __clock_t clock_t; > > > ># 74 "/usr/include/time.h" 3 4 > > >typedef __time_t time_t; > > > ># 92 "/usr/include/time.h" 3 4 >typedef __clockid_t clockid_t; ># 104 "/usr/include/time.h" 3 4 >typedef __timer_t timer_t; ># 134 "/usr/include/sys/types.h" 2 3 4 > > > >typedef __useconds_t useconds_t; > > > >typedef __suseconds_t suseconds_t; > > > > > ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 148 "/usr/include/sys/types.h" 2 3 4 > > > >typedef unsigned long int ulong; >typedef unsigned short int ushort; >typedef unsigned int uint; ># 191 "/usr/include/sys/types.h" 3 4 >typedef int int8_t __attribute__ ((__mode__ (__QI__))); >typedef int int16_t __attribute__ ((__mode__ (__HI__))); >typedef int int32_t __attribute__ ((__mode__ (__SI__))); >typedef int int64_t __attribute__ ((__mode__ (__DI__))); > > >typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); >typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); >typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); >typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); > >typedef int register_t __attribute__ ((__mode__ (__word__))); ># 213 "/usr/include/sys/types.h" 3 4 ># 1 "/usr/include/endian.h" 1 3 4 ># 37 "/usr/include/endian.h" 3 4 ># 1 "/usr/include/bits/endian.h" 1 3 4 ># 38 "/usr/include/endian.h" 2 3 4 ># 214 "/usr/include/sys/types.h" 2 3 4 > > ># 1 "/usr/include/sys/select.h" 1 3 4 ># 31 "/usr/include/sys/select.h" 3 4 ># 1 "/usr/include/bits/select.h" 1 3 4 ># 32 "/usr/include/sys/select.h" 2 3 4 > > ># 1 "/usr/include/bits/sigset.h" 1 3 4 ># 23 "/usr/include/bits/sigset.h" 3 4 >typedef int __sig_atomic_t; > > > > >typedef struct > { > unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; > } __sigset_t; ># 35 "/usr/include/sys/select.h" 2 3 4 > > > >typedef __sigset_t sigset_t; > > > > > ># 1 "/usr/include/time.h" 1 3 4 ># 118 "/usr/include/time.h" 3 4 >struct timespec > { > __time_t tv_sec; > long int tv_nsec; > }; ># 45 "/usr/include/sys/select.h" 2 3 4 > ># 1 "/usr/include/bits/time.h" 1 3 4 ># 69 "/usr/include/bits/time.h" 3 4 >struct timeval > { > __time_t tv_sec; > __suseconds_t tv_usec; > }; ># 47 "/usr/include/sys/select.h" 2 3 4 ># 55 "/usr/include/sys/select.h" 3 4 >typedef long int __fd_mask; ># 67 "/usr/include/sys/select.h" 3 4 >typedef struct > { > > > > __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))]; > > > > > > } fd_set; > > > > > > >typedef __fd_mask fd_mask; ># 99 "/usr/include/sys/select.h" 3 4 >extern "C" { ># 109 "/usr/include/sys/select.h" 3 4 >extern int select (int __nfds, fd_set *__restrict __readfds, > fd_set *__restrict __writefds, > fd_set *__restrict __exceptfds, > struct timeval *__restrict __timeout); ># 121 "/usr/include/sys/select.h" 3 4 >extern int pselect (int __nfds, fd_set *__restrict __readfds, > fd_set *__restrict __writefds, > fd_set *__restrict __exceptfds, > const struct timespec *__restrict __timeout, > const __sigset_t *__restrict __sigmask); > > >} ># 217 "/usr/include/sys/types.h" 2 3 4 > > ># 1 "/usr/include/sys/sysmacros.h" 1 3 4 ># 29 "/usr/include/sys/sysmacros.h" 3 4 >__extension__ >extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) > throw (); >__extension__ >extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev) > throw (); >__extension__ >extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major, > unsigned int __minor) > throw (); > > >__extension__ extern __inline unsigned int >gnu_dev_major (unsigned long long int __dev) throw () >{ > return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); >} > >__extension__ extern __inline unsigned int >gnu_dev_minor (unsigned long long int __dev) throw () >{ > return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); >} > >__extension__ extern __inline unsigned long long int >gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw () >{ > return ((__minor & 0xff) | ((__major & 0xfff) << 8) > | (((unsigned long long int) (__minor & ~0xff)) << 12) > | (((unsigned long long int) (__major & ~0xfff)) << 32)); >} ># 220 "/usr/include/sys/types.h" 2 3 4 > > > > >typedef __blksize_t blksize_t; > > > > > > >typedef __blkcnt_t blkcnt_t; > > > >typedef __fsblkcnt_t fsblkcnt_t; > > > >typedef __fsfilcnt_t fsfilcnt_t; ># 258 "/usr/include/sys/types.h" 3 4 >typedef __blkcnt64_t blkcnt64_t; >typedef __fsblkcnt64_t fsblkcnt64_t; >typedef __fsfilcnt64_t fsfilcnt64_t; > > > > > ># 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 ># 23 "/usr/include/bits/pthreadtypes.h" 3 4 ># 1 "/usr/include/bits/sched.h" 1 3 4 ># 83 "/usr/include/bits/sched.h" 3 4 >struct __sched_param > { > int __sched_priority; > }; ># 24 "/usr/include/bits/pthreadtypes.h" 2 3 4 > > >struct _pthread_fastlock >{ > long int __status; > int __spinlock; > >}; > > > >typedef struct _pthread_descr_struct *_pthread_descr; > > > > > >typedef struct __pthread_attr_s >{ > int __detachstate; > int __schedpolicy; > struct __sched_param __schedparam; > int __inheritsched; > int __scope; > size_t __guardsize; > int __stackaddr_set; > void *__stackaddr; > size_t __stacksize; >} pthread_attr_t; > > > > > >__extension__ typedef long long __pthread_cond_align_t; > > > > >typedef struct >{ > struct _pthread_fastlock __c_lock; > _pthread_descr __c_waiting; > > char __padding[48 - sizeof (struct _pthread_fastlock) > - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)]; > __pthread_cond_align_t __align; > >} pthread_cond_t; > > > >typedef struct >{ > int __dummy; >} pthread_condattr_t; > > >typedef unsigned int pthread_key_t; > > > > > >typedef struct >{ > int __m_reserved; > int __m_count; > _pthread_descr __m_owner; > int __m_kind; > struct _pthread_fastlock __m_lock; >} pthread_mutex_t; > > > >typedef struct >{ > int __mutexkind; >} pthread_mutexattr_t; > > > >typedef int pthread_once_t; > > > > >typedef struct _pthread_rwlock_t >{ > struct _pthread_fastlock __rw_lock; > int __rw_readers; > _pthread_descr __rw_writer; > _pthread_descr __rw_read_waiting; > _pthread_descr __rw_write_waiting; > int __rw_kind; > int __rw_pshared; >} pthread_rwlock_t; > > > >typedef struct >{ > int __lockkind; > int __pshared; >} pthread_rwlockattr_t; > > > > >typedef volatile int pthread_spinlock_t; > > >typedef struct { > struct _pthread_fastlock __ba_lock; > int __ba_required; > int __ba_present; > _pthread_descr __ba_waiting; >} pthread_barrier_t; > > >typedef struct { > int __pshared; >} pthread_barrierattr_t; > > > > > >typedef unsigned long int pthread_t; ># 267 "/usr/include/sys/types.h" 2 3 4 > > >} ># 180 "../libdjvu/GThreads.h" 2 ># 1 "/usr/include/sys/time.h" 1 3 4 ># 26 "/usr/include/sys/time.h" 3 4 ># 1 "/usr/include/time.h" 1 3 4 ># 27 "/usr/include/sys/time.h" 2 3 4 > ># 1 "/usr/include/bits/time.h" 1 3 4 ># 29 "/usr/include/sys/time.h" 2 3 4 ># 38 "/usr/include/sys/time.h" 3 4 >extern "C" { ># 56 "/usr/include/sys/time.h" 3 4 >struct timezone > { > int tz_minuteswest; > int tz_dsttime; > }; > >typedef struct timezone *__restrict __timezone_ptr_t; ># 72 "/usr/include/sys/time.h" 3 4 >extern int gettimeofday (struct timeval *__restrict __tv, > __timezone_ptr_t __tz) throw (); > > > > >extern int settimeofday (__const struct timeval *__tv, > __const struct timezone *__tz) throw (); > > > > > >extern int adjtime (__const struct timeval *__delta, > struct timeval *__olddelta) throw (); > > > > >enum __itimer_which > { > > ITIMER_REAL = 0, > > > ITIMER_VIRTUAL = 1, > > > > ITIMER_PROF = 2 > > }; > > > >struct itimerval > { > > struct timeval it_interval; > > struct timeval it_value; > }; > > > > > > >typedef int __itimer_which_t; > > > > >extern int getitimer (__itimer_which_t __which, > struct itimerval *__value) throw (); > > > > >extern int setitimer (__itimer_which_t __which, > __const struct itimerval *__restrict __new, > struct itimerval *__restrict __old) throw (); > > > > >extern int utimes (__const char *__file, __const struct timeval __tvp[2]) > throw (); > > > >extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) > throw (); > > >extern int futimes (int __fd, __const struct timeval __tvp[2]) throw (); ># 181 "/usr/include/sys/time.h" 3 4 >} ># 181 "../libdjvu/GThreads.h" 2 ># 1 "/usr/include/unistd.h" 1 3 4 ># 28 "/usr/include/unistd.h" 3 4 >extern "C" { ># 171 "/usr/include/unistd.h" 3 4 ># 1 "/usr/include/bits/posix_opt.h" 1 3 4 ># 172 "/usr/include/unistd.h" 2 3 4 > > > ># 1 "/usr/include/bits/environments.h" 1 3 4 ># 176 "/usr/include/unistd.h" 2 3 4 ># 195 "/usr/include/unistd.h" 3 4 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 196 "/usr/include/unistd.h" 2 3 4 ># 236 "/usr/include/unistd.h" 3 4 >typedef __intptr_t intptr_t; > > > > > > >typedef __socklen_t socklen_t; ># 256 "/usr/include/unistd.h" 3 4 >extern int access (__const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int euidaccess (__const char *__name, int __type) > throw () __attribute__ ((__nonnull__ (1))); ># 287 "/usr/include/unistd.h" 3 4 >extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw (); ># 298 "/usr/include/unistd.h" 3 4 >extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) throw (); > > > > > > >extern int close (int __fd); > > > > > > >extern ssize_t read (int __fd, void *__buf, size_t __nbytes); > > > > > >extern ssize_t write (int __fd, __const void *__buf, size_t __n); ># 328 "/usr/include/unistd.h" 3 4 >extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, > __off_t __offset); > > > > > > >extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n, > __off_t __offset); ># 356 "/usr/include/unistd.h" 3 4 >extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, > __off64_t __offset); > > >extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, > __off64_t __offset); > > > > > > > >extern int pipe (int __pipedes[2]) throw (); ># 378 "/usr/include/unistd.h" 3 4 >extern unsigned int alarm (unsigned int __seconds) throw (); ># 390 "/usr/include/unistd.h" 3 4 >extern unsigned int sleep (unsigned int __seconds); > > > > > > >extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) > throw (); > > > > > > >extern int usleep (__useconds_t __useconds); ># 414 "/usr/include/unistd.h" 3 4 >extern int pause (void); > > > >extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) > throw () __attribute__ ((__nonnull__ (1))); > > > >extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw (); > > > > >extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) > throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int chdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1))); > > > >extern int fchdir (int __fd) throw (); ># 448 "/usr/include/unistd.h" 3 4 >extern char *getcwd (char *__buf, size_t __size) throw (); > > > > > >extern char *get_current_dir_name (void) throw (); > > > > > > >extern char *getwd (char *__buf) throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int dup (int __fd) throw (); > > >extern int dup2 (int __fd, int __fd2) throw (); > > >extern char **__environ; > >extern char **environ; > > > > > >extern int execve (__const char *__path, char *__const __argv[], > char *__const __envp[]) throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[]) > throw (); > > > > >extern int execv (__const char *__path, char *__const __argv[]) > throw () __attribute__ ((__nonnull__ (1))); > > > >extern int execle (__const char *__path, __const char *__arg, ...) > throw () __attribute__ ((__nonnull__ (1))); > > > >extern int execl (__const char *__path, __const char *__arg, ...) > throw () __attribute__ ((__nonnull__ (1))); > > > >extern int execvp (__const char *__file, char *__const __argv[]) > throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int execlp (__const char *__file, __const char *__arg, ...) > throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int nice (int __inc) throw (); > > > > >extern void _exit (int __status) __attribute__ ((__noreturn__)); > > > > > ># 1 "/usr/include/bits/confname.h" 1 3 4 ># 26 "/usr/include/bits/confname.h" 3 4 >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 > > }; > > >enum > { > _CS_PATH, > > > _CS_V6_WIDTH_RESTRICTED_ENVS, > > > _CS_GNU_LIBC_VERSION, > > _CS_GNU_LIBPTHREAD_VERSION, > > > _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 > > }; ># 531 "/usr/include/unistd.h" 2 3 4 > > >extern long int pathconf (__const char *__path, int __name) > throw () __attribute__ ((__nonnull__ (1))); > > >extern long int fpathconf (int __fd, int __name) throw (); > > >extern long int sysconf (int __name) throw () __attribute__ ((__const__)); > > > >extern size_t confstr (int __name, char *__buf, size_t __len) throw (); > > > > >extern __pid_t getpid (void) throw (); > > >extern __pid_t getppid (void) throw (); > > > > >extern __pid_t getpgrp (void) throw (); ># 567 "/usr/include/unistd.h" 3 4 >extern __pid_t __getpgid (__pid_t __pid) throw (); > >extern __pid_t getpgid (__pid_t __pid) throw (); > > > > > > >extern int setpgid (__pid_t __pid, __pid_t __pgid) throw (); ># 593 "/usr/include/unistd.h" 3 4 >extern int setpgrp (void) throw (); ># 610 "/usr/include/unistd.h" 3 4 >extern __pid_t setsid (void) throw (); > > > >extern __pid_t getsid (__pid_t __pid) throw (); > > > >extern __uid_t getuid (void) throw (); > > >extern __uid_t geteuid (void) throw (); > > >extern __gid_t getgid (void) throw (); > > >extern __gid_t getegid (void) throw (); > > > > >extern int getgroups (int __size, __gid_t __list[]) throw (); > > > >extern int group_member (__gid_t __gid) throw (); > > > > > > >extern int setuid (__uid_t __uid) throw (); > > > > >extern int setreuid (__uid_t __ruid, __uid_t __euid) throw (); > > > > >extern int seteuid (__uid_t __uid) throw (); > > > > > > >extern int setgid (__gid_t __gid) throw (); > > > > >extern int setregid (__gid_t __rgid, __gid_t __egid) throw (); > > > > >extern int setegid (__gid_t __gid) throw (); > > > > > >extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid); > > > >extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid); > > > >extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid); > > > >extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid); > > > > > > >extern __pid_t fork (void) throw (); > > > > > > >extern __pid_t vfork (void) throw (); > > > > > >extern char *ttyname (int __fd) throw (); > > > >extern int ttyname_r (int __fd, char *__buf, size_t __buflen) > throw () __attribute__ ((__nonnull__ (2))); > > > >extern int isatty (int __fd) throw (); > > > > > >extern int ttyslot (void) throw (); > > > > >extern int link (__const char *__from, __const char *__to) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > >extern int symlink (__const char *__from, __const char *__to) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > >extern int readlink (__const char *__restrict __path, char *__restrict __buf, > size_t __len) throw () __attribute__ ((__nonnull__ (1, 2))); > > > >extern int unlink (__const char *__name) throw () __attribute__ ((__nonnull__ (1))); > > >extern int rmdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1))); > > > >extern __pid_t tcgetpgrp (int __fd) throw (); > > >extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw (); > > > > > > >extern char *getlogin (void); > > > > > > > >extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); > > > > >extern int setlogin (__const char *__name) throw () __attribute__ ((__nonnull__ (1))); ># 783 "/usr/include/unistd.h" 3 4 ># 1 "/usr/include/getopt.h" 1 3 4 ># 50 "/usr/include/getopt.h" 3 4 >extern "C" { ># 59 "/usr/include/getopt.h" 3 4 >extern char *optarg; ># 73 "/usr/include/getopt.h" 3 4 >extern int optind; > > > > >extern int opterr; > > > >extern int optopt; ># 152 "/usr/include/getopt.h" 3 4 >extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) > throw (); ># 171 "/usr/include/getopt.h" 3 4 >} ># 784 "/usr/include/unistd.h" 2 3 4 > > > > > > > >extern int gethostname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1))); > > > > > > >extern int sethostname (__const char *__name, size_t __len) > throw () __attribute__ ((__nonnull__ (1))); > > > >extern int sethostid (long int __id) throw (); > > > > > >extern int getdomainname (char *__name, size_t __len) > throw () __attribute__ ((__nonnull__ (1))); >extern int setdomainname (__const char *__name, size_t __len) > throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern int vhangup (void) throw (); > > >extern int revoke (__const char *__file) throw () __attribute__ ((__nonnull__ (1))); > > > > > > > >extern int profil (unsigned short int *__sample_buffer, size_t __size, > size_t __offset, unsigned int __scale) > throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern int acct (__const char *__name) throw (); > > > >extern char *getusershell (void) throw (); >extern void endusershell (void) throw (); >extern void setusershell (void) throw (); > > > > > >extern int daemon (int __nochdir, int __noclose) throw (); > > > > > > >extern int chroot (__const char *__path) throw () __attribute__ ((__nonnull__ (1))); > > > >extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1))); ># 869 "/usr/include/unistd.h" 3 4 >extern int fsync (int __fd); > > > > > > >extern long int gethostid (void); > > >extern void sync (void) throw (); > > > > >extern int getpagesize (void) throw () __attribute__ ((__const__)); > > > > >extern int getdtablesize (void) throw (); > > > > >extern int truncate (__const char *__file, __off_t __length) > throw () __attribute__ ((__nonnull__ (1))); ># 906 "/usr/include/unistd.h" 3 4 >extern int truncate64 (__const char *__file, __off64_t __length) > throw () __attribute__ ((__nonnull__ (1))); ># 916 "/usr/include/unistd.h" 3 4 >extern int ftruncate (int __fd, __off_t __length) throw (); ># 926 "/usr/include/unistd.h" 3 4 >extern int ftruncate64 (int __fd, __off64_t __length) throw (); ># 936 "/usr/include/unistd.h" 3 4 >extern int brk (void *__addr) throw (); > > > > > >extern void *sbrk (intptr_t __delta) throw (); ># 957 "/usr/include/unistd.h" 3 4 >extern long int syscall (long int __sysno, ...) throw (); ># 980 "/usr/include/unistd.h" 3 4 >extern int lockf (int __fd, int __cmd, __off_t __len); ># 990 "/usr/include/unistd.h" 3 4 >extern int lockf64 (int __fd, int __cmd, __off64_t __len); ># 1011 "/usr/include/unistd.h" 3 4 >extern int fdatasync (int __fildes) throw (); > > > > > > > >extern char *crypt (__const char *__key, __const char *__salt) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > >extern void encrypt (char *__block, int __edflag) throw () __attribute__ ((__nonnull__ (1))); > > > > > > >extern void swab (__const void *__restrict __from, void *__restrict __to, > ssize_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); > > > > > > > >extern char *ctermid (char *__s) throw () __attribute__ ((__nonnull__ (1))); > > >} ># 182 "../libdjvu/GThreads.h" 2 > > > ># 1 "/usr/include/pthread.h" 1 3 4 ># 20 "/usr/include/pthread.h" 3 4 ># 1 "/usr/include/sched.h" 1 3 4 ># 29 "/usr/include/sched.h" 3 4 ># 1 "/usr/include/time.h" 1 3 4 ># 30 "/usr/include/sched.h" 2 3 4 > > ># 1 "/usr/include/bits/sched.h" 1 3 4 ># 62 "/usr/include/bits/sched.h" 3 4 >struct sched_param > { > int __sched_priority; > }; > >extern "C" { > > > >extern int clone (int (*__fn) (void *__arg), void *__child_stack, > int __flags, void *__arg) throw (); > > >} ># 98 "/usr/include/bits/sched.h" 3 4 >typedef unsigned long int __cpu_mask; > > > > > > >typedef struct >{ > __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; >} cpu_set_t; ># 33 "/usr/include/sched.h" 2 3 4 > > > > >extern "C" { > > >extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param) > throw (); > > >extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw (); > > >extern int sched_setscheduler (__pid_t __pid, int __policy, > __const struct sched_param *__param) throw (); > > >extern int sched_getscheduler (__pid_t __pid) throw (); > > >extern int sched_yield (void) throw (); > > >extern int sched_get_priority_max (int __algorithm) throw (); > > >extern int sched_get_priority_min (int __algorithm) throw (); > > >extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw (); ># 76 "/usr/include/sched.h" 3 4 >extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, > __const cpu_set_t *__cpuset) throw (); > > >extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize, > cpu_set_t *__cpuset) throw (); > > >} ># 21 "/usr/include/pthread.h" 2 3 4 ># 1 "/usr/include/time.h" 1 3 4 ># 30 "/usr/include/time.h" 3 4 >extern "C" { > > > > > > > ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 39 "/usr/include/time.h" 2 3 4 > > > ># 1 "/usr/include/bits/time.h" 1 3 4 ># 43 "/usr/include/time.h" 2 3 4 ># 129 "/usr/include/time.h" 3 4 > > >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; ># 178 "/usr/include/time.h" 3 4 > > > >extern clock_t clock (void) throw (); > > >extern time_t time (time_t *__timer) throw (); > > >extern double difftime (time_t __time1, time_t __time0) > throw () __attribute__ ((__const__)); > > >extern time_t mktime (struct tm *__tp) throw (); > > > > > >extern size_t strftime (char *__restrict __s, size_t __maxsize, > __const char *__restrict __format, > __const struct tm *__restrict __tp) throw (); > > > > > >extern char *strptime (__const char *__restrict __s, > __const char *__restrict __fmt, struct tm *__tp) > throw (); > > > > > ># 1 "/usr/include/xlocale.h" 1 3 4 ># 28 "/usr/include/xlocale.h" 3 4 >typedef struct __locale_struct >{ > > struct locale_data *__locales[13]; > > > const unsigned short int *__ctype_b; > const int *__ctype_tolower; > const int *__ctype_toupper; > > > const char *__names[13]; >} *__locale_t; ># 214 "/usr/include/time.h" 2 3 4 > >extern size_t strftime_l (char *__restrict __s, size_t __maxsize, > __const char *__restrict __format, > __const struct tm *__restrict __tp, > __locale_t __loc) throw (); > >extern char *strptime_l (__const char *__restrict __s, > __const char *__restrict __fmt, struct tm *__tp, > __locale_t __loc) throw (); > > > > > > >extern struct tm *gmtime (__const time_t *__timer) throw (); > > > >extern struct tm *localtime (__const time_t *__timer) throw (); > > > > > >extern struct tm *gmtime_r (__const time_t *__restrict __timer, > struct tm *__restrict __tp) throw (); > > > >extern struct tm *localtime_r (__const time_t *__restrict __timer, > struct tm *__restrict __tp) throw (); > > > > > >extern char *asctime (__const struct tm *__tp) throw (); > > >extern char *ctime (__const time_t *__timer) throw (); > > > > > > > >extern char *asctime_r (__const struct tm *__restrict __tp, > char *__restrict __buf) throw (); > > >extern char *ctime_r (__const time_t *__restrict __timer, > char *__restrict __buf) throw (); > > > > >extern char *__tzname[2]; >extern int __daylight; >extern long int __timezone; > > > > >extern char *tzname[2]; > > > >extern void tzset (void) throw (); > > > >extern int daylight; >extern long int timezone; > > > > > >extern int stime (__const time_t *__when) throw (); ># 309 "/usr/include/time.h" 3 4 >extern time_t timegm (struct tm *__tp) throw (); > > >extern time_t timelocal (struct tm *__tp) throw (); > > >extern int dysize (int __year) throw () __attribute__ ((__const__)); ># 324 "/usr/include/time.h" 3 4 >extern int nanosleep (__const struct timespec *__requested_time, > struct timespec *__remaining); > > > >extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw (); > > >extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw (); > > >extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) > throw (); > > > > > > >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) throw (); > > > > >extern int timer_create (clockid_t __clock_id, > struct sigevent *__restrict __evp, > timer_t *__restrict __timerid) throw (); > > >extern int timer_delete (timer_t __timerid) throw (); > > >extern int timer_settime (timer_t __timerid, int __flags, > __const struct itimerspec *__restrict __value, > struct itimerspec *__restrict __ovalue) throw (); > > >extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) > throw (); > > >extern int timer_getoverrun (timer_t __timerid) throw (); ># 386 "/usr/include/time.h" 3 4 >extern int getdate_err; ># 395 "/usr/include/time.h" 3 4 >extern struct tm *getdate (__const char *__string); ># 409 "/usr/include/time.h" 3 4 >extern int getdate_r (__const char *__restrict __string, > struct tm *__restrict __resbufp); > > >} ># 22 "/usr/include/pthread.h" 2 3 4 > > ># 1 "/usr/include/signal.h" 1 3 4 ># 31 "/usr/include/signal.h" 3 4 >extern "C" { > ># 1 "/usr/include/bits/sigset.h" 1 3 4 ># 34 "/usr/include/signal.h" 2 3 4 ># 400 "/usr/include/signal.h" 3 4 >} ># 25 "/usr/include/pthread.h" 2 3 4 ># 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 ># 26 "/usr/include/pthread.h" 2 3 4 ># 1 "/usr/include/bits/initspin.h" 1 3 4 ># 27 "/usr/include/pthread.h" 2 3 4 > > >extern "C" { ># 59 "/usr/include/pthread.h" 3 4 >enum >{ > PTHREAD_CREATE_JOINABLE, > > PTHREAD_CREATE_DETACHED > >}; > >enum >{ > PTHREAD_INHERIT_SCHED, > > PTHREAD_EXPLICIT_SCHED > >}; > >enum >{ > PTHREAD_SCOPE_SYSTEM, > > PTHREAD_SCOPE_PROCESS > >}; > >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_ADAPTIVE_NP > >}; > >enum >{ > PTHREAD_PROCESS_PRIVATE, > > PTHREAD_PROCESS_SHARED > >}; > > >enum >{ > PTHREAD_RWLOCK_PREFER_READER_NP, > PTHREAD_RWLOCK_PREFER_WRITER_NP, > PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, > PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP >}; ># 131 "/usr/include/pthread.h" 3 4 >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 > >}; ># 163 "/usr/include/pthread.h" 3 4 >extern int pthread_create (pthread_t *__restrict __threadp, > __const pthread_attr_t *__restrict __attr, > void *(*__start_routine) (void *), > void *__restrict __arg) throw (); > > >extern pthread_t pthread_self (void) throw (); > > >extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw (); > > >extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); > > > > >extern int pthread_join (pthread_t __th, void **__thread_return); > > > > > >extern int pthread_detach (pthread_t __th) throw (); > > > > > > > >extern int pthread_attr_init (pthread_attr_t *__attr) throw (); > > >extern int pthread_attr_destroy (pthread_attr_t *__attr) throw (); > > >extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, > int __detachstate) throw (); > > >extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, > int *__detachstate) throw (); > > >extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, > __const struct sched_param *__restrict > __param) throw (); > > >extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict > __attr, > struct sched_param *__restrict __param) > throw (); > > >extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) > throw (); > > >extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict > __attr, int *__restrict __policy) > throw (); > > >extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, > int __inherit) throw (); > > >extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict > __attr, int *__restrict __inherit) > throw (); > > >extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) > throw (); > > >extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, > int *__restrict __scope) throw (); > > > >extern int pthread_attr_setguardsize (pthread_attr_t *__attr, > size_t __guardsize) throw (); > > >extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict > __attr, size_t *__restrict __guardsize) > throw (); > > > > > > >extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, > void *__stackaddr) throw (); > > >extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict > __attr, void **__restrict __stackaddr) > throw (); > > > > > >extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, > size_t __stacksize) throw (); > > >extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr, > void **__restrict __stackaddr, > size_t *__restrict __stacksize) throw (); > > > > > >extern int pthread_attr_setstacksize (pthread_attr_t *__attr, > size_t __stacksize) throw (); > > >extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict > __attr, size_t *__restrict __stacksize) > throw (); > > > > > >extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) throw (); > > > > > > >extern int pthread_setschedparam (pthread_t __target_thread, int __policy, > __const struct sched_param *__param) > throw (); > > >extern int pthread_getschedparam (pthread_t __target_thread, > int *__restrict __policy, > struct sched_param *__restrict __param) > throw (); > > > >extern int pthread_getconcurrency (void) throw (); > > >extern int pthread_setconcurrency (int __level) throw (); > > > > > > > >extern int pthread_yield (void) throw (); > > > > > > >extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex, > __const pthread_mutexattr_t *__restrict > __mutex_attr) throw (); > > >extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw (); > > >extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw (); > > >extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw (); > > > >extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, > __const struct timespec *__restrict > __abstime) throw (); > > > >extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw (); > > > > > > >extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw (); > > >extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw (); > > >extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * > __restrict __attr, > int *__restrict __pshared) throw (); > > >extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, > int __pshared) throw (); > > > > > >extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) > throw (); > > >extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict > __attr, int *__restrict __kind) throw (); > > > > > > > >extern int pthread_cond_init (pthread_cond_t *__restrict __cond, > __const pthread_condattr_t *__restrict > __cond_attr) throw (); > > >extern int pthread_cond_destroy (pthread_cond_t *__cond) throw (); > > >extern int pthread_cond_signal (pthread_cond_t *__cond) throw (); > > >extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw (); > > > >extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, > pthread_mutex_t *__restrict __mutex); > > > > > >extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, > pthread_mutex_t *__restrict __mutex, > __const struct timespec *__restrict > __abstime); > > > > >extern int pthread_condattr_init (pthread_condattr_t *__attr) throw (); > > >extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw (); > > >extern int pthread_condattr_getpshared (__const pthread_condattr_t * > __restrict __attr, > int *__restrict __pshared) throw (); > > >extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, > int __pshared) throw (); > > > > > > > >extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, > __const pthread_rwlockattr_t *__restrict > __attr) throw (); > > >extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) throw (); > > >extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) throw (); > > >extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) throw (); > > > >extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, > __const struct timespec *__restrict > __abstime) throw (); > > > >extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) throw (); > > >extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) throw (); > > > >extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, > __const struct timespec *__restrict > __abstime) throw (); > > > >extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) throw (); > > > > > >extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) throw (); > > >extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) throw (); > > >extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t * > __restrict __attr, > int *__restrict __pshared) throw (); > > >extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, > int __pshared) throw (); > > >extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr, > int *__pref) throw (); > > >extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, > int __pref) throw (); ># 510 "/usr/include/pthread.h" 3 4 >extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) > throw (); > > >extern int pthread_spin_destroy (pthread_spinlock_t *__lock) throw (); > > >extern int pthread_spin_lock (pthread_spinlock_t *__lock) throw (); > > >extern int pthread_spin_trylock (pthread_spinlock_t *__lock) throw (); > > >extern int pthread_spin_unlock (pthread_spinlock_t *__lock) throw (); > > > > >extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, > __const pthread_barrierattr_t *__restrict > __attr, unsigned int __count) throw (); > >extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) throw (); > >extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) throw (); > >extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) throw (); > >extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t * > __restrict __attr, > int *__restrict __pshared) throw (); > >extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, > int __pshared) throw (); > >extern int pthread_barrier_wait (pthread_barrier_t *__barrier) throw (); ># 557 "/usr/include/pthread.h" 3 4 >extern int pthread_key_create (pthread_key_t *__key, > void (*__destr_function) (void *)) throw (); > > >extern int pthread_key_delete (pthread_key_t __key) throw (); > > >extern int pthread_setspecific (pthread_key_t __key, > __const void *__pointer) throw (); > > >extern void *pthread_getspecific (pthread_key_t __key) throw (); ># 580 "/usr/include/pthread.h" 3 4 >extern int pthread_once (pthread_once_t *__once_control, > void (*__init_routine) (void)); > > > > > > >extern int pthread_setcancelstate (int __state, int *__oldstate); > > > >extern int pthread_setcanceltype (int __type, int *__oldtype); > > >extern int pthread_cancel (pthread_t __cancelthread); > > > > >extern void pthread_testcancel (void); ># 614 "/usr/include/pthread.h" 3 4 >extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, > void (*__routine) (void *), > void *__arg) throw (); > > > > > > > >extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, > int __execute) throw (); ># 635 "/usr/include/pthread.h" 3 4 >extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer, > void (*__routine) (void *), > void *__arg) throw (); ># 646 "/usr/include/pthread.h" 3 4 >extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer, > int __execute) throw (); > > > > > >extern int pthread_getcpuclockid (pthread_t __thread_id, > __clockid_t *__clock_id) throw (); > > > > ># 1 "/usr/include/bits/sigthread.h" 1 3 4 ># 31 "/usr/include/bits/sigthread.h" 3 4 >extern int pthread_sigmask (int __how, > __const __sigset_t *__restrict __newmask, > __sigset_t *__restrict __oldmask)throw (); > > >extern int pthread_kill (pthread_t __threadid, int __signo) throw (); ># 660 "/usr/include/pthread.h" 2 3 4 ># 675 "/usr/include/pthread.h" 3 4 >extern int pthread_atfork (void (*__prepare) (void), > void (*__parent) (void), > void (*__child) (void)) throw (); > > > > >extern void pthread_kill_other_threads_np (void) throw (); > >} ># 186 "../libdjvu/GThreads.h" 2 ># 204 "../libdjvu/GThreads.h" >namespace DJVU { ># 230 "../libdjvu/GThreads.h" >class GThread { >public: > > > > > > > GThread(int stacksize = -1); > > > > ~GThread(); > > > > > int create(void (*entry)(void*), void *arg); > > > > > > void terminate(); ># 262 "../libdjvu/GThreads.h" > static int yield(); > > static void *current(); ># 275 "../libdjvu/GThreads.h" >private: > pthread_t hthr; > static void *start(void *arg); ># 327 "../libdjvu/GThreads.h" >public: > > void (*xentry)(void*); > void *xarg; >private: > > GThread(const GThread&); > GThread& operator=(const GThread&); >}; ># 362 "../libdjvu/GThreads.h" >class GMonitor >{ >public: > GMonitor(); > ~GMonitor(); > > > > void enter(); > > > > > > void leave(); > > > > > > void wait(); > > > > > > > void wait(unsigned long timeout); > > > > void signal(); > > > > void broadcast(); >private: ># 413 "../libdjvu/GThreads.h" > int ok; > int count; > pthread_t locker; > pthread_mutex_t mutex; > pthread_cond_t cond; ># 427 "../libdjvu/GThreads.h" >private: > > GMonitor(const GMonitor&); > GMonitor& operator=(const GMonitor&); >}; ># 478 "../libdjvu/GThreads.h" >class GMonitorLock >{ >private: > GMonitor *gsec; >public: > > GMonitorLock(GMonitor *gsec) : gsec(gsec) > { if (gsec) gsec->enter(); }; > > ~GMonitorLock() > { if (gsec) gsec->leave(); }; >}; ># 505 "../libdjvu/GThreads.h" >class GSafeFlags : public GMonitor >{ >private: > volatile long flags; >public: > > GSafeFlags(long flags=0); > > > > GSafeFlags & operator=(long flags); > > > operator long(void) const; > > > GSafeFlags & operator|=(long mask); > > > GSafeFlags & operator&=(long mask); > > > > > > > bool test_and_modify(long set_mask, long clr_mask, > long set_mask1, long clr_mask1); > > > > > > void wait_and_modify(long set_mask, long clr_mask, > long set_mask1, long clr_mask1); > > > > void wait_for_flags(long set_mask, long clr_mask=0) const; > > > > > void modify(long set_mask, long clr_mask); >}; > >inline >GSafeFlags::GSafeFlags(long xflags) > : flags(xflags) >{ >} > >inline void >GSafeFlags::wait_for_flags(long set_mask, long clr_mask) const >{ > ((GSafeFlags *) this)->wait_and_modify(set_mask, clr_mask, 0, 0); >} > >inline void >GSafeFlags::modify(long set_mask, long clr_mask) >{ > test_and_modify(0, 0, set_mask, clr_mask); >} > >inline GSafeFlags & >GSafeFlags::operator|=(long mask) >{ > test_and_modify(0, 0, mask, 0); > return *this; >} > >inline GSafeFlags & >GSafeFlags::operator&=(long mask) >{ > test_and_modify(0, 0, 0, ~mask); > return *this; >} ># 594 "../libdjvu/GThreads.h" >class GCriticalSection : protected GMonitor >{ >public: > void lock() > { GMonitor::enter(); }; > void unlock() > { GMonitor::leave(); }; >}; > >class GEvent : protected GMonitor >{ >private: > int status; >public: > GEvent() > : status(0) { }; > void set() > { if (!status) { enter(); status=1; signal(); leave(); } }; > void wait() > { enter(); if (!status) GMonitor::wait(); status=0; leave(); }; > void wait(int timeout) > { enter(); if (!status) GMonitor::wait(timeout); status=0; leave(); }; >}; > >class GCriticalSectionLock >{ >private: > GCriticalSection *gsec; >public: > GCriticalSectionLock(GCriticalSection *gsec) : gsec(gsec) > { if (gsec) gsec->lock(); }; > ~GCriticalSectionLock() > { if (gsec) gsec->unlock(); }; >}; > > > > > >} > >using namespace DJVU; ># 68 "../libdjvu/DjVuPort.h" 2 ># 1 "../libdjvu/GURL.h" 1 ># 67 "../libdjvu/GURL.h" ># 1 "../libdjvu/GString.h" 1 ># 111 "../libdjvu/GString.h" ># 1 "../libdjvu/GContainer.h" 1 ># 68 "../libdjvu/GContainer.h" ># 1 "../libdjvu/GSmartPointer.h" 1 ># 103 "../libdjvu/GSmartPointer.h" >namespace DJVU { ># 114 "../libdjvu/GSmartPointer.h" >class GPBufferBase >{ >public: > GPBufferBase(void *&,const size_t n,const size_t t); > void swap(GPBufferBase &p); > void resize(const size_t n,const size_t t); > void replace(void *nptr,const size_t n); > void set(const size_t t,const char c); > ~GPBufferBase(); > operator int(void) const { return ptr ? num : 0; } >private: > void *&ptr; > size_t num; >}; > >template<class TYPE> >class GPBuffer : public GPBufferBase >{ >public: > GPBuffer(TYPE *&xptr,const size_t n=0) : GPBufferBase((void *&)xptr,n,sizeof(TYPE)) {} > inline void resize(const size_t n) {GPBufferBase::resize(n,sizeof(TYPE));} > inline void clear(void) {GPBufferBase::set(sizeof(TYPE),0);} > inline void set(const char c) {GPBufferBase::set(sizeof(TYPE),c);} > inline operator int(void) const {return GPBufferBase::operator int();} >}; > > > > > > >class GPEnabled >{ >public: > > GPEnabled(); > > GPEnabled(const GPEnabled & obj); > > virtual ~GPEnabled(); > > GPEnabled & operator=(const GPEnabled & obj); > > > int get_count(void) const; >protected: > > volatile int count; >private: > friend class GPBase; > void unref(); > void ref(); > void destroy(); >}; ># 178 "../libdjvu/GSmartPointer.h" >class GPBase >{ >public: > > GPBase(); > > > > GPBase(const GPBase &sptr); > > > > GPBase(GPEnabled *nptr); > > ~GPBase(); > > GPEnabled* get() const; > > > > GPBase& assign(const GPBase &sptr); > > > > > GPBase& assign(GPEnabled *nptr); > > GPBase & operator=(const GPBase & obj); > > int operator==(const GPBase & g2) const; >protected: > > GPEnabled *ptr; >}; ># 269 "../libdjvu/GSmartPointer.h" >template <class TYPE> >class GP : protected GPBase >{ >public: > > GP(); > > > GP(const GP<TYPE> &sptr); > > > > > > GP(TYPE *nptr); > > > > > operator TYPE* () const; > > > > > > GP<TYPE>& operator= (TYPE *nptr); > > > GP<TYPE>& operator= (const GP<TYPE> &sptr); > > > > > TYPE* operator->() const; > > > > TYPE& operator*() const; > > > > > > int operator== (TYPE *nptr) const; > > > > > > int operator!= (TYPE *nptr) const; ># 327 "../libdjvu/GSmartPointer.h" > int operator! () const; >}; > > > > > >inline >GPEnabled::GPEnabled() > : count(0) >{ >} > >inline >GPEnabled::GPEnabled(const GPEnabled & obj) > : count(0) >{ > >} > >inline int >GPEnabled::get_count(void) const >{ > return count; >} > >inline GPEnabled & >GPEnabled::operator=(const GPEnabled & obj) >{ > > > > return *this; >} > > > >inline >GPBase::GPBase() > : ptr(0) >{ >} > >inline >GPBase::GPBase(GPEnabled *nptr) > : ptr(0) >{ > assign(nptr); >} > >inline >GPBase::GPBase(const GPBase &sptr) >{ > if (sptr.ptr) > sptr.ptr->ref(); > ptr = sptr.ptr; >} > >inline >GPBase::~GPBase() >{ > GPEnabled *old = ptr; > ptr = 0; > if (old) > old->unref(); >} > >inline GPEnabled* >GPBase::get() const >{ > return ptr; >} > >inline GPBase & >GPBase::operator=(const GPBase & obj) >{ > return assign(obj); >} > >inline int >GPBase::operator==(const GPBase & g2) const >{ > return ptr == g2.ptr; >} > > > > > > >template <class TYPE> inline >GP<TYPE>::GP() >{ >} > >template <class TYPE> inline >GP<TYPE>::GP(TYPE *nptr) >: GPBase((GPEnabled*)nptr) >{ >} > >template <class TYPE> inline >GP<TYPE>::GP(const GP<TYPE> &sptr) >: GPBase((const GPBase&) sptr) >{ >} > >template <class TYPE> inline >GP<TYPE>::operator TYPE* () const >{ > return (TYPE*) ptr; >} > >template <class TYPE> inline TYPE* >GP<TYPE>::operator->() const >{ > return (TYPE*) ptr; >} > >template <class TYPE> inline TYPE& >GP<TYPE>::operator*() const >{ > return *(TYPE*) ptr; >} > >template <class TYPE> inline GP<TYPE>& >GP<TYPE>::operator= (TYPE *nptr) >{ > return (GP<TYPE>&)( assign(nptr) ); >} > >template <class TYPE> inline GP<TYPE>& >GP<TYPE>::operator= (const GP<TYPE> &sptr) >{ > return (GP<TYPE>&)( assign((const GPBase&)sptr) ); >} > >template <class TYPE> inline int >GP<TYPE>::operator== (TYPE *nptr) const >{ > return ( (TYPE*)ptr == nptr ); >} > >template <class TYPE> inline int >GP<TYPE>::operator!= (TYPE *nptr) const >{ > return ( (TYPE*)ptr != nptr ); >} > >template <class TYPE> inline int >GP<TYPE>::operator! () const >{ > return !ptr; >} > > > >} > >using namespace DJVU; ># 69 "../libdjvu/GContainer.h" 2 ># 1 "/usr/include/string.h" 1 3 4 ># 28 "/usr/include/string.h" 3 4 >extern "C" { > > > > ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 34 "/usr/include/string.h" 2 3 4 > > > > >extern void *memcpy (void *__restrict __dest, > __const void *__restrict __src, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern void *memmove (void *__dest, __const void *__src, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > > > >extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, > int __c, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > > >extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1))); > > >extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern void *memchr (__const void *__s, int __c, size_t __n) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern void *rawmemchr (__const void *__s, int __c) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > >extern void *memrchr (__const void *__s, int __c, size_t __n) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) > throw () __attribute__ ((__nonnull__ (1, 2))); > >extern char *strncpy (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern char *strcat (char *__restrict __dest, __const char *__restrict __src) > throw () __attribute__ ((__nonnull__ (1, 2))); > >extern char *strncat (char *__restrict __dest, __const char *__restrict __src, > size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern int strcmp (__const char *__s1, __const char *__s2) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > >extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int strcoll (__const char *__s1, __const char *__s2) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > >extern size_t strxfrm (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > throw () __attribute__ ((__nonnull__ (2))); > ># 121 "/usr/include/string.h" 3 4 >extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); > >extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, > __locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4))); > > > > >extern char *strdup (__const char *__s) > throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); > > > > > > >extern char *strndup (__const char *__string, size_t __n) > throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); ># 165 "/usr/include/string.h" 3 4 > > >extern char *strchr (__const char *__s, int __c) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > >extern char *strrchr (__const char *__s, int __c) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern char *strchrnul (__const char *__s, int __c) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern size_t strcspn (__const char *__s, __const char *__reject) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern size_t strspn (__const char *__s, __const char *__accept) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > >extern char *strpbrk (__const char *__s, __const char *__accept) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > >extern char *strstr (__const char *__haystack, __const char *__needle) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > > >extern char *strtok (char *__restrict __s, __const char *__restrict __delim) > throw () __attribute__ ((__nonnull__ (2))); > > > > >extern char *__strtok_r (char *__restrict __s, > __const char *__restrict __delim, > char **__restrict __save_ptr) > throw () __attribute__ ((__nonnull__ (2, 3))); > >extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, > char **__restrict __save_ptr) > throw () __attribute__ ((__nonnull__ (2, 3))); > > > > >extern char *strcasestr (__const char *__haystack, __const char *__needle) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > > > > > >extern void *memmem (__const void *__haystack, size_t __haystacklen, > __const void *__needle, size_t __needlelen) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3))); > > > >extern void *__mempcpy (void *__restrict __dest, > __const void *__restrict __src, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); >extern void *mempcpy (void *__restrict __dest, > __const void *__restrict __src, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > > >extern size_t strlen (__const char *__s) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern size_t strnlen (__const char *__string, size_t __maxlen) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern char *strerror (int __errnum) throw (); > ># 281 "/usr/include/string.h" 3 4 >extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) > throw () __attribute__ ((__nonnull__ (2))); > > > > > >extern void __bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1))); > > > >extern void bcopy (__const void *__src, void *__dest, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1))); > > >extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern char *index (__const char *__s, int __c) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > >extern char *rindex (__const char *__s, int __c) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > >extern int ffs (int __i) throw () __attribute__ ((__const__)); > > > > >extern int ffsl (long int __l) throw () __attribute__ ((__const__)); > >__extension__ extern int ffsll (long long int __ll) > throw () __attribute__ ((__const__)); > > > > >extern int strcasecmp (__const char *__s1, __const char *__s2) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > > > > >extern int strcasecmp_l (__const char *__s1, __const char *__s2, > __locale_t __loc) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); > >extern int strncasecmp_l (__const char *__s1, __const char *__s2, > size_t __n, __locale_t __loc) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); > > > > > >extern char *strsep (char **__restrict __stringp, > __const char *__restrict __delim) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > >extern int strverscmp (__const char *__s1, __const char *__s2) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); > > >extern char *strsignal (int __sig) throw (); > > >extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) > throw () __attribute__ ((__nonnull__ (1, 2))); >extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > >extern char *__stpncpy (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); >extern char *stpncpy (char *__restrict __dest, > __const char *__restrict __src, size_t __n) > throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1))); > > >extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1))); > > > > > > >extern char *basename (__const char *__filename) throw () __attribute__ ((__nonnull__ (1))); ># 426 "/usr/include/string.h" 3 4 >} ># 70 "../libdjvu/GContainer.h" 2 > > >namespace DJVU { ># 158 "../libdjvu/GContainer.h" >class GCont > > > > >{ >public: > > > struct Traits > { > int size; > void *(*lea) (void *base, int n); > void (*init) (void *dst, int n); > void (*copy) (void *dst, const void* src, int n, int zap); > void (*fini) (void *dst, int n); > }; > >protected: > > > template <int SZ> class TrivTraits > { > public: > > static const Traits & traits(); > > static void * lea(void* base, int n) > { return (void*)( ((char*)base) + SZ*n ); } > > static void init(void* dst, int n) {} > > static void copy(void* dst, const void* src, int n, int ) > { memcpy(dst, src, SZ*n); } > > static void fini(void* dst, int n) {} > }; > > template <class T> class NormTraits > { > public: > > static const Traits & traits(); > > static void * lea(void* base, int n) > { return (void*)( ((T*)base) + n ); } > > static void init(void* dst, int n) > { T* d = (T*)dst; while (--n>=0) { new ((void*)d) T; d++; } } > > static void copy(void* dst, const void* src, int n, int zap) > { T* d = (T*)dst; const T *s = (const T*)src; > while (--n>=0) { new ((void*)d) T(*s); if (zap) { s->T::~T(); }; d++; s++; } } > > static void fini(void* dst, int n) > { T* d = (T*)dst; while (--n>=0) { d->T::~T(); d++; } } > }; > > struct Node > { > Node *next; > Node *prev; > }; > > template <class T> struct ListNode : public Node > { > T val; > }; > > struct HNode : public Node > { > HNode *hprev; > unsigned int hashcode; > }; > > template <class K> struct SetNode : public HNode > { > K key; > }; > > template <class K, class T> struct MapNode : public SetNode<K> > { > T val; > }; > >}; ># 253 "../libdjvu/GContainer.h" >template <int SZ> const GCont:: Traits & >GCont:: TrivTraits<SZ>::traits() >{ > static const Traits theTraits = { > SZ, > TrivTraits<SZ>::lea, > TrivTraits<SZ>::init, > TrivTraits<SZ>::copy, > TrivTraits<SZ>::fini > }; > return theTraits; >} > >template <class T> const GCont:: Traits & >GCont:: NormTraits<T>::traits() >{ > static const Traits theTraits = { > sizeof(T), > NormTraits<T>::lea, > NormTraits<T>::init, > NormTraits<T>::copy, > NormTraits<T>::fini > }; > return theTraits; >} ># 313 "../libdjvu/GContainer.h" >class GArrayBase : public GCont >{ >public: > > GArrayBase(const GArrayBase &ref); > GArrayBase(const Traits &traits); > GArrayBase(const Traits &traits, int lobound, int hibound); > > ~GArrayBase(); > > GArrayBase& operator= (const GArrayBase &ga); > > void empty(); > void touch(int n); > void resize(int lobound, int hibound); > void shift(int disp); > void del(int n, int howmany=1); > void ins(int n, const void *src, int howmany=1); > void steal(GArrayBase &ga); >protected: > const Traits &traits; > void *data; > GPBufferBase gdata; > int minlo; > int maxhi; > int lobound; > int hibound; >}; ># 349 "../libdjvu/GContainer.h" >template<class TYPE> >class GArrayTemplate : protected GArrayBase >{ >public: > > GArrayTemplate(const Traits &traits) : GArrayBase(traits) {} > GArrayTemplate(const Traits &traits, int lobound, int hibound) > : GArrayBase(traits, lobound, hibound) {} > > > int size() const > { return hibound-lobound+1; } > > int lbound() const > { return lobound; } > > int hbound() const > { return hibound; } > > > > > > inline TYPE& operator[](int const n); > > > > > > > inline const TYPE& operator[](int n) const; > > > > > > > > operator TYPE* () > { return ((TYPE*)data)-minlo; } > > > > > > > operator const TYPE* () const > { return ((const TYPE*)data)-minlo; } > operator const TYPE* () > { return ((const TYPE*)data)-minlo; } > > > > void empty() > { GArrayBase::empty(); } ># 418 "../libdjvu/GContainer.h" > void touch(int n) > { if (n<lobound || n>hibound) GArrayBase::touch(n); } > > > > > void resize(int hibound) > { GArrayBase::resize(0, hibound); } > > > > > void resize(int lobound, int hibound) > { GArrayBase::resize(lobound, hibound); } > > > > void shift(int disp) > { GArrayBase::shift(disp); } > > > > > > void del(int n, int howmany=1) > { GArrayBase::del(n, howmany); } > > > > > > > > void ins(int n, int howmany=1) > { GArrayBase::ins(n, 0, howmany); } > > > > void ins(int n, const TYPE &val, int howmany=1) > { GArrayBase::ins(n, (const void*)&val, howmany); } > > > void steal(GArrayTemplate &ga) > { GArrayBase::steal(ga); } > > > > > void sort() > { sort(lbound(), hbound()); } > > > > > > void sort(int lo, int hi); >}; > > > > >template <class TYPE> void >GArrayTemplate<TYPE>::sort(int lo, int hi) >{ > if (hi <= lo) > return; > if (hi > hibound || lo<lobound) > GExceptionHandler::exthrow (GException("\003" "GContainer.illegal_subscript", "../libdjvu/GContainer.h", 485, __PRETTY_FUNCTION__, GException::GINTERNAL)); > TYPE *data = (TYPE*)(*this); > > if (hi <= lo + 50) > { > for (int i=lo+1; i<=hi; i++) > { > int j = i; > TYPE tmp = data[i]; > while ((--j>=lo) && !(data[j]<=tmp)) > data[j+1] = data[j]; > data[j+1] = tmp; > } > return; > } > > TYPE tmp = data[lo]; > TYPE pivot = data[(lo+hi)/2]; > if (pivot <= tmp) > { tmp = pivot; pivot=data[lo]; } > if (data[hi] <= tmp) > { pivot = tmp; } > else if (data[hi] <= pivot) > { pivot = data[hi]; } > > int h = hi; > int l = lo; > while (l < h) > { > while (! (pivot <= data[l])) l++; > while (! (data[h] <= pivot)) h--; > if (l < h) > { > tmp = data[l]; > data[l] = data[h]; > data[h] = tmp; > l = l+1; > h = h-1; > } > } > > sort(lo, h); > sort(l, hi); >} > >template<class TYPE> inline TYPE& >GArrayTemplate<TYPE>::operator[](int const n) >{ > > if (n<lobound || n>hibound) > { > GExceptionHandler::exthrow (GException("\003" "GContainer.illegal_subscript", "../libdjvu/GContainer.h", 536, __PRETTY_FUNCTION__, GException::GINTERNAL)); > } > > return ((TYPE*)data)[n-minlo]; >} > > >template<class TYPE> inline const TYPE & >GArrayTemplate<TYPE>::operator[](int const n) const >{ > > if (n<lobound || n>hibound) > { > GExceptionHandler::exthrow (GException("\003" "GContainer.illegal_subscript", "../libdjvu/GContainer.h", 549, __PRETTY_FUNCTION__, GException::GINTERNAL)); > } > > return ((const TYPE*)data)[n-minlo]; >} ># 569 "../libdjvu/GContainer.h" >template<class TYPE> >class GArray : public GArrayTemplate<TYPE> >{ >public: > > > > GArray() > : GArrayTemplate<TYPE>(GCont:: NormTraits<TYPE>::traits() ) {} > > > > GArray(int hi) > : GArrayTemplate<TYPE>(GCont:: NormTraits<TYPE>::traits(), 0, hi ) {} > > > > GArray(int lo, int hi) > : GArrayTemplate<TYPE>(GCont:: NormTraits<TYPE>::traits(), lo, hi ) {} > > GArray& operator=(const GArray &r) > { GArrayBase::operator=(r); return *this; } >}; ># 602 "../libdjvu/GContainer.h" >template<class TYPE> >class GPArray : public GArrayTemplate<GP<TYPE> > >{ >public: > GPArray() > : GArrayTemplate<GP<TYPE> >(GCont:: NormTraits<GPBase>::traits() ) {} > GPArray(int hi) > : GArrayTemplate<GP<TYPE> >(GCont:: NormTraits<GPBase>::traits(), 0, hi ) {} > GPArray(int lo, int hi) > : GArrayTemplate<GP<TYPE> >(GCont:: NormTraits<GPBase>::traits(), lo, hi ) {} > > GPArray& operator=(const GPArray &r) > { GArrayBase::operator=(r); return *this; } >}; ># 625 "../libdjvu/GContainer.h" >template<class TYPE> >class GTArray : public GArrayTemplate<TYPE> >{ >public: > GTArray() > : GArrayTemplate<TYPE>(GCont:: TrivTraits<sizeof(TYPE)>::traits() ) {} > GTArray(int hi) > : GArrayTemplate<TYPE>(GCont:: TrivTraits<sizeof(TYPE)>::traits(), 0, hi ) {} > GTArray(int lo, int hi) > : GArrayTemplate<TYPE>(GCont:: TrivTraits<sizeof(TYPE)>::traits(), lo, hi ) {} > > GTArray& operator=(const GTArray &r) > { GArrayBase::operator=(r); return *this; } >}; ># 691 "../libdjvu/GContainer.h" >class GPosition : protected GCont >{ >public: > > GPosition() : ptr(0), cont(0) {} > > GPosition(const GPosition &ref) : ptr(ref.ptr), cont(ref.cont) {} > > operator int() const > { return !!ptr; } > > int operator !() const > { return !ptr; } > > GPosition& operator ++() > { if (ptr) ptr = ptr->next; return *this; } > > GPosition& operator --() > { if (ptr) ptr = ptr->prev; return *this; } > > GPosition(Node *p, void *c) : ptr(p), cont(c) {} > > Node *check(void *c) > { if (!ptr || c!=cont) throw_invalid(c); return ptr; } > const Node *check(void *c) const > { if (!ptr || c!=cont) throw_invalid(c); return ptr; } > > > > > > >protected: > Node *ptr; > void *cont; > friend class GListBase; > friend class GSetBase; > void throw_invalid(void *c) const __attribute__ ((noreturn)); >}; > > >class GListBase : public GCont >{ >protected: > GListBase(const Traits& traits); > GListBase(const GListBase &ref); > void append(Node *n); > void prepend(Node *n); > void insert_after(GPosition pos, Node *n); > void insert_before(GPosition pos, Node *n); > void insert_before(GPosition pos, GListBase &fromlist, GPosition &frompos); > void del(GPosition &pos); >protected: > const Traits &traits; > int nelem; > Node head; >public: > ~GListBase(); > GListBase & operator= (const GListBase & gl); > GPosition firstpos() const { return GPosition(head.next, (void*)this); } > GPosition lastpos() const { return GPosition(head.prev, (void*)this); } > int isempty() const { return nelem==0; }; > GPosition nth(unsigned int n) const; > void empty(); >}; > > >template<class TI> >class GListImpl : public GListBase >{ >protected: > GListImpl(); > typedef GCont:: ListNode<TI> LNode; > static Node * newnode(const TI &elt); > int operator==(const GListImpl<TI> &l2) const; > int search(const TI &elt, GPosition &pos) const; >}; > >template<class TI> >GListImpl<TI>::GListImpl() > : GListBase( GCont:: NormTraits<LNode>::traits() ) >{ >} > >template<class TI> GCont:: Node * >GListImpl<TI>::newnode(const TI &elt) >{ > LNode *n = (LNode *) operator new (sizeof(LNode )); > > memset(n, 0, sizeof(LNode )); > > new ((void*)&(n->val)) TI(elt); > return (Node*) n; >} > >template<class TI> int >GListImpl<TI>::operator==(const GListImpl<TI> &l2) const >{ > Node *p, *q; > for (p=head.next, q=l2.head.next; p && q; p=p->next, q=q->next ) > if (((LNode*)p)->val != ((LNode*)q)->val) > return 0; > return p==0 && q==0; >} > >template<class TI> int >GListImpl<TI>::search(const TI &elt, GPosition &pos) const >{ > Node *n = (pos ? pos.check((void*)this) : head.next); > for (; n; n=n->next) > if ( ((LNode *)n)->val == elt ) > break; > if (n) pos = GPosition(n, (void*)this); > return (n != 0); >} > > > > > > > >template <class TYPE, class TI> >class GListTemplate : protected GListImpl<TI> >{ >public: > > > int size() const > { return this->nelem; } > > GPosition firstpos() const > { return GListImpl<TI>::firstpos(); } > > GPosition lastpos() const > { return GListImpl<TI>::lastpos(); } > > operator GPosition() const > { return firstpos(); } > > > > > > TYPE& operator[](GPosition pos) > { return (TYPE&) (((typename GListImpl<TI>::LNode *)pos.check((void*)this))->val); } > > > > > > > const TYPE& operator[](GPosition pos) const > { return (const TYPE&) (((const typename GListImpl<TI>::LNode *)pos.check((void*)this))->val); } > > > > int isempty() const > { return this->nelem==0; } > > > > int operator==(const GListTemplate<TYPE,TI> &l2) const > { return GListImpl<TI>::operator==(l2); } > > > > > > GPosition nth(unsigned int n) const > { return GListImpl<TI>::nth(n); } > > int nth(unsigned int n, GPosition &pos) const > { GPosition npos=nth(n); if (npos) pos=npos; return !!pos; } > > > > > GPosition contains(const TYPE &elt) const > { GPosition pos; GListImpl<TI>::search((const TI&)elt, pos); return pos; } ># 880 "../libdjvu/GContainer.h" > int search(const TYPE &elt, GPosition &pos) const > { return GListImpl<TI>::search((const TI&)elt, pos); } > > > > void empty() > { GListImpl<TI>::empty(); } > > > void append(const TYPE &elt) > { GListImpl<TI>::append(newnode((const TI&)elt)); } > > > void prepend(const TYPE &elt) > { GListImpl<TI>::prepend(newnode((const TI&)elt)); } > > > > void insert_after(GPosition pos, const TYPE &elt) > { GListImpl<TI>::insert_after(pos, newnode((const TI&)elt)); } > > > > void insert_before(GPosition pos, const TYPE &elt) > { GListImpl<TI>::insert_before(pos, newnode((const TI&)elt)); } > > > > > > void insert_before(GPosition pos, GListTemplate<TYPE,TI> &fromlist, GPosition &frompos) > { GListImpl<TI>::insert_before(pos, fromlist, frompos); } > > > void del(GPosition &pos) > { GListImpl<TI>::del(pos); } > > > void first(GPosition &pos) const { pos = firstpos(); } > void last(GPosition &pos) const { pos = lastpos(); } > const TYPE *next(GPosition &pos) const > { if (!pos) return 0; const TYPE *x=&((*this)[pos]); ++pos; return x; } > const TYPE *prev(GPosition &pos) const > { if (!pos) return 0; const TYPE *x=&((*this)[pos]); --pos; return x; } > TYPE *next(GPosition &pos) > { if (!pos) return 0; TYPE *x=&((*this)[pos]); ++pos; return x; } > TYPE *prev(GPosition &pos) > { if (!pos) return 0; TYPE *x=&((*this)[pos]); --pos; return x; } > >}; > > > > > > > >template <class TYPE> >class GList : public GListTemplate<TYPE,TYPE> >{ >public: > > GList() : GListTemplate<TYPE,TYPE>() {} > GList& operator=(const GList &r) > { GListBase::operator=(r); return *this; } >}; ># 956 "../libdjvu/GContainer.h" >template <class TYPE> >class GPList : public GListTemplate<GP<TYPE>,GPBase> >{ >public: > > GPList() : GListTemplate<GP<TYPE>,GPBase>() {} > GPList& operator=(const GPList &r) > { GListBase::operator=(r); return *this; } >}; ># 1001 "../libdjvu/GContainer.h" >class GSetBase : public GCont >{ >protected: > GSetBase(const Traits &traits); > GSetBase(const GSetBase &ref); > static GCont:: HNode *newnode(const void *key); > HNode *hashnode(unsigned int hashcode) const; > HNode *installnode(HNode *n); > void deletenode(HNode *n); >protected: > const Traits &traits; > int nelems; > int nbuckets; > HNode **table; > GPBuffer<HNode *> gtable; > HNode *first; >private: > void insertnode(HNode *n); > void rehash(int newbuckets); >public: > ~GSetBase(); > GSetBase& operator=(const GSetBase &ref); > GPosition firstpos() const; > void del(GPosition &pos); > void empty(); >}; > >template <class K> >class GSetImpl : public GSetBase >{ >protected: > GSetImpl(); > GSetImpl(const Traits &traits); > typedef GCont:: SetNode<K> SNode; > HNode *get(const K &key) const; > HNode *get_or_throw(const K &key) const; > HNode *get_or_create(const K &key); >public: > GPosition contains(const K &key) const > { return GPosition( get(key), (void*)this); } > void del(const K &key) > { deletenode(get(key)); } >}; > >template<class K> >GSetImpl<K>::GSetImpl() > : GSetBase( GCont:: NormTraits<GCont:: SetNode<K> >::traits() ) >{ >} > >template<class K> >GSetImpl<K>::GSetImpl(const Traits &traits) > : GSetBase(traits) >{ >} > >template<class K> GCont:: HNode * >GSetImpl<K>::get(const K &key) const >{ > unsigned int hashcode = hash(key); > for (SNode *s=(SNode*)hashnode(hashcode); s; s=(SNode*)(s->hprev)) > if (s->hashcode == hashcode && s->key == key) return s; > return 0; >} > > >template<class K> GCont:: HNode * >GSetImpl<K>::get_or_throw(const K &key) const >{ > HNode *m = get(key); > if (!m) > { > GExceptionHandler::exthrow (GException("\003" "GContainer.cannot_add", "../libdjvu/GContainer.h", 1073, __PRETTY_FUNCTION__, GException::GINTERNAL)); > } > return m; >} ># 1085 "../libdjvu/GContainer.h" >template<class K> GCont:: HNode * >GSetImpl<K>::get_or_create(const K &key) >{ > HNode *m = get(key); > if (m) return m; > SNode *n = (SNode*) operator new (sizeof(SNode)); > > memset(n, 0, sizeof(SNode)); > > new ((void*)&(n->key)) K ( key ); > n->hashcode = hash((const K&)(n->key)); > installnode(n); > return n; >} > >template <class K, class TI> >class GMapImpl : public GSetImpl<K> >{ >protected: > GMapImpl(); > GMapImpl(const GCont:: Traits &traits); > typedef GCont:: MapNode<K,TI> MNode; > GCont:: HNode* get_or_create(const K &key); >}; > >template<class K, class TI> >GMapImpl<K,TI>::GMapImpl() > : GSetImpl<K> ( GCont:: NormTraits<GCont:: MapNode<K,TI> >::traits() ) >{ >} > >template<class K, class TI> >GMapImpl<K,TI>::GMapImpl(const GCont:: Traits &traits) > : GSetImpl<K>(traits) >{ >} > >template<class K, class TI> GCont:: HNode * >GMapImpl<K,TI>::get_or_create(const K &key) >{ > GCont:: HNode *m = get(key); > if (m) return m; > MNode *n = (MNode*) operator new (sizeof(MNode)); > > memset(n, 0, sizeof(MNode)); > > new ((void*)&(n->key)) K (key); > new ((void*)&(n->val)) TI (); > n->hashcode = hash((const K&)(n->key)); > installnode(n); > return n; >} ># 1146 "../libdjvu/GContainer.h" >template <class KTYPE, class VTYPE, class TI> >class GMapTemplate : protected GMapImpl<KTYPE,TI> >{ >public: > > int size() const > { return this->nelems; } > > GPosition firstpos() const > { return GMapImpl<KTYPE,TI>::firstpos(); } > > operator GPosition() const > { return firstpos(); } > > > int isempty() const > { return this->nelems==0; } > > > > > GPosition contains(const KTYPE &key) const > { return GMapImpl<KTYPE,TI>::contains(key); } > > GPosition contains(const KTYPE &key, GPosition &pos) const > { return pos = GMapImpl<KTYPE,TI>::contains(key); } > > > > void empty() > { GMapImpl<KTYPE,TI>::empty(); } > > > > const KTYPE &key(const GPosition &pos) const > { return (const KTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(pos.check((void*)this)))->key); } > > > > > VTYPE& operator[](const GPosition &pos) > { return (VTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(pos.check((void*)this)))->val); } > > > > > const VTYPE& operator[](const GPosition &pos) const > { return (const VTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(pos.check((void*)this)))->val); } > > > > > > const VTYPE& operator[](const KTYPE &key) const > { return (const VTYPE&)(((const typename GMapImpl<KTYPE,TI>::MNode*)(get_or_throw(key)))->val); } > > > > > VTYPE& operator[](const KTYPE &key) > { return (VTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(get_or_create(key)))->val); } > > > void del(GPosition &pos) > { GSetBase::del(pos); } > > > void del(const KTYPE &key) > { GMapImpl<KTYPE,TI>::del(key); } > > > void first(GPosition &pos) const { pos = firstpos(); } > const VTYPE *next(GPosition &pos) const > { if (!pos) return 0; const VTYPE *x=&((*this)[pos]); ++pos; return x; } > VTYPE *next(GPosition &pos) > { if (!pos) return 0; VTYPE *x=&((*this)[pos]); ++pos; return x; } > >}; ># 1237 "../libdjvu/GContainer.h" >template <class KTYPE, class VTYPE> >class GMap : public GMapTemplate<KTYPE,VTYPE,VTYPE> >{ >public: > > GMap() : GMapTemplate<KTYPE,VTYPE,VTYPE>() {} > GMap& operator=(const GMap &r) > { GSetBase::operator=(r); return *this; } >}; ># 1259 "../libdjvu/GContainer.h" >template <class KTYPE, class VTYPE> >class GPMap : public GMapTemplate<KTYPE,GP<VTYPE>,GPBase> >{ >public: > GPMap() : GMapTemplate<KTYPE,GP<VTYPE>,GPBase>() {} > GPMap& operator=(const GPMap &r) > { GSetBase::operator=(r); return *this; } >}; ># 1283 "../libdjvu/GContainer.h" >static inline unsigned int >hash(const unsigned int & x) >{ > return x; >} > > >static inline unsigned int >hash(const int & x) >{ > return (unsigned int)x; >} > > >static inline unsigned int >hash(const long & x) >{ > return (unsigned int)x; >} > > >static inline unsigned int >hash(const unsigned long & x) >{ > return (unsigned int)x; >} > > >static inline unsigned int >hash(void * const & x) >{ > return (unsigned long) x; >} > > >static inline unsigned int >hash(const void * const & x) >{ > return (unsigned long) x; >} > > >static inline unsigned int >hash(const float & x) >{ > > unsigned int *addr = (unsigned int*)&x; > if (sizeof(float)<2*sizeof(unsigned int)) > return addr[0]; > else > return addr[0]^addr[1]; >} > > >static inline unsigned int >hash(const double & x) >{ > > unsigned int *addr = (unsigned int*)&x; > if (sizeof(double)<2*sizeof(unsigned int)) > return addr[0]; > else if (sizeof(double)<4*sizeof(unsigned int)) > return addr[0]^addr[1]; > else > return addr[0]^addr[1]^addr[2]^addr[3]; >} ># 1359 "../libdjvu/GContainer.h" >} > >using namespace DJVU; ># 112 "../libdjvu/GString.h" 2 > ># 1 "/usr/include/stdlib.h" 1 3 4 ># 33 "/usr/include/stdlib.h" 3 4 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 34 "/usr/include/stdlib.h" 2 3 4 > >extern "C" { > > > > > > ># 1 "/usr/include/bits/waitflags.h" 1 3 4 ># 43 "/usr/include/stdlib.h" 2 3 4 ># 1 "/usr/include/bits/waitstatus.h" 1 3 4 ># 67 "/usr/include/bits/waitstatus.h" 3 4 >union wait > { > int w_status; > struct > { > > unsigned int __w_termsig:7; > unsigned int __w_coredump:1; > unsigned int __w_retcode:8; > unsigned int:16; > > > > > > > > } __wait_terminated; > struct > { > > unsigned int __w_stopval:8; > unsigned int __w_stopsig:8; > unsigned int:16; > > > > > > > } __wait_stopped; > }; ># 44 "/usr/include/stdlib.h" 2 3 4 ># 96 "/usr/include/stdlib.h" 3 4 > > >typedef struct > { > int quot; > int rem; > } div_t; > > > >typedef struct > { > long int quot; > long int rem; > } ldiv_t; > > > > > > > >__extension__ typedef struct > { > long long int quot; > long long int rem; > } lldiv_t; > > ># 140 "/usr/include/stdlib.h" 3 4 >extern size_t __ctype_get_mb_cur_max (void) throw (); > > > > >extern double atof (__const char *__nptr) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > >extern int atoi (__const char *__nptr) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > >extern long int atol (__const char *__nptr) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >__extension__ extern long long int atoll (__const char *__nptr) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); > > > > > >extern double strtod (__const char *__restrict __nptr, > char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern float strtof (__const char *__restrict __nptr, > char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); > >extern long double strtold (__const char *__restrict __nptr, > char **__restrict __endptr) > throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern long int strtol (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > throw () __attribute__ ((__nonnull__ (1))); > >extern unsigned long int strtoul (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > throw () __attribute__ ((__nonnull__ (1))); > > > > >__extension__ >extern long long int strtoq (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > throw () __attribute__ ((__nonnull__ (1))); > >__extension__ >extern unsigned long long int strtouq (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > throw () __attribute__ ((__nonnull__ (1))); > > > > > >__extension__ >extern long long int strtoll (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > throw () __attribute__ ((__nonnull__ (1))); > >__extension__ >extern unsigned long long int strtoull (__const char *__restrict __nptr, > char **__restrict __endptr, int __base) > throw () __attribute__ ((__nonnull__ (1))); > ># 239 "/usr/include/stdlib.h" 3 4 >extern long int strtol_l (__const char *__restrict __nptr, > char **__restrict __endptr, int __base, > __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))); > >extern unsigned long int strtoul_l (__const char *__restrict __nptr, > char **__restrict __endptr, > int __base, __locale_t __loc) > throw () __attribute__ ((__nonnull__ (1, 4))); > >__extension__ >extern long long int strtoll_l (__const char *__restrict __nptr, > char **__restrict __endptr, int __base, > __locale_t __loc) > throw () __attribute__ ((__nonnull__ (1, 4))); > >__extension__ >extern unsigned long long int strtoull_l (__const char *__restrict __nptr, > char **__restrict __endptr, > int __base, __locale_t __loc) > throw () __attribute__ ((__nonnull__ (1, 4))); > >extern double strtod_l (__const char *__restrict __nptr, > char **__restrict __endptr, __locale_t __loc) > throw () __attribute__ ((__nonnull__ (1, 3))); > >extern float strtof_l (__const char *__restrict __nptr, > char **__restrict __endptr, __locale_t __loc) > throw () __attribute__ ((__nonnull__ (1, 3))); > >extern long double strtold_l (__const char *__restrict __nptr, > char **__restrict __endptr, > __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); > > > > > > >extern double __strtod_internal (__const char *__restrict __nptr, > char **__restrict __endptr, int __group) > throw () __attribute__ ((__nonnull__ (1))); >extern float __strtof_internal (__const char *__restrict __nptr, > char **__restrict __endptr, int __group) > throw () __attribute__ ((__nonnull__ (1))); >extern long double __strtold_internal (__const char *__restrict __nptr, > char **__restrict __endptr, > int __group) throw () __attribute__ ((__nonnull__ (1))); > >extern long int __strtol_internal (__const char *__restrict __nptr, > char **__restrict __endptr, > int __base, int __group) > throw () __attribute__ ((__nonnull__ (1))); > > > >extern unsigned long int __strtoul_internal (__const char *__restrict __nptr, > char **__restrict __endptr, > int __base, int __group) > throw () __attribute__ ((__nonnull__ (1))); > > > > >__extension__ >extern long long int __strtoll_internal (__const char *__restrict __nptr, > char **__restrict __endptr, > int __base, int __group) > throw () __attribute__ ((__nonnull__ (1))); > > > >__extension__ >extern unsigned long long int __strtoull_internal (__const char * > __restrict __nptr, > char **__restrict __endptr, > int __base, int __group) > throw () __attribute__ ((__nonnull__ (1))); > > > > > > > > >extern __inline double >strtod (__const char *__restrict __nptr, char **__restrict __endptr) throw () >{ > return __strtod_internal (__nptr, __endptr, 0); >} >extern __inline long int >strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () > >{ > return __strtol_internal (__nptr, __endptr, __base, 0); >} >extern __inline unsigned long int >strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () > >{ > return __strtoul_internal (__nptr, __endptr, __base, 0); >} > > > > >extern __inline float >strtof (__const char *__restrict __nptr, char **__restrict __endptr) throw () >{ > return __strtof_internal (__nptr, __endptr, 0); >} >extern __inline long double >strtold (__const char *__restrict __nptr, char **__restrict __endptr) throw () >{ > return __strtold_internal (__nptr, __endptr, 0); >} > > > > >__extension__ extern __inline long long int >strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () > >{ > return __strtoll_internal (__nptr, __endptr, __base, 0); >} >__extension__ extern __inline unsigned long long int >strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () > >{ > return __strtoull_internal (__nptr, __endptr, __base, 0); >} > > > > >__extension__ extern __inline long long int >strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () > >{ > return __strtoll_internal (__nptr, __endptr, __base, 0); >} >__extension__ extern __inline unsigned long long int >strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base) throw () > >{ > return __strtoull_internal (__nptr, __endptr, __base, 0); >} > > > > >extern __inline double >atof (__const char *__nptr) throw () >{ > return strtod (__nptr, (char **) __null); >} >extern __inline int >atoi (__const char *__nptr) throw () >{ > return (int) strtol (__nptr, (char **) __null, 10); >} >extern __inline long int >atol (__const char *__nptr) throw () >{ > return strtol (__nptr, (char **) __null, 10); >} > > > > >__extension__ extern __inline long long int >atoll (__const char *__nptr) throw () >{ > return strtoll (__nptr, (char **) __null, 10); >} > ># 424 "/usr/include/stdlib.h" 3 4 >extern char *l64a (long int __n) throw (); > > >extern long int a64l (__const char *__s) > throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); ># 440 "/usr/include/stdlib.h" 3 4 >extern long int random (void) throw (); > > >extern void srandom (unsigned int __seed) throw (); > > > > > >extern char *initstate (unsigned int __seed, char *__statebuf, > size_t __statelen) throw () __attribute__ ((__nonnull__ (2))); > > > >extern char *setstate (char *__statebuf) throw () __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) throw () __attribute__ ((__nonnull__ (1, 2))); > >extern int srandom_r (unsigned int __seed, struct random_data *__buf) > throw () __attribute__ ((__nonnull__ (2))); > >extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, > size_t __statelen, > struct random_data *__restrict __buf) > throw () __attribute__ ((__nonnull__ (2, 4))); > >extern int setstate_r (char *__restrict __statebuf, > struct random_data *__restrict __buf) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > > > >extern int rand (void) throw (); > >extern void srand (unsigned int __seed) throw (); > > > > >extern int rand_r (unsigned int *__seed) throw (); > > > > > > > >extern double drand48 (void) throw (); >extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1))); > > >extern long int lrand48 (void) throw (); >extern long int nrand48 (unsigned short int __xsubi[3]) > throw () __attribute__ ((__nonnull__ (1))); > > >extern long int mrand48 (void) throw (); >extern long int jrand48 (unsigned short int __xsubi[3]) > throw () __attribute__ ((__nonnull__ (1))); > > >extern void srand48 (long int __seedval) throw (); >extern unsigned short int *seed48 (unsigned short int __seed16v[3]) > throw () __attribute__ ((__nonnull__ (1))); >extern void lcong48 (unsigned short int __param[7]) throw () __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) throw () __attribute__ ((__nonnull__ (1, 2))); >extern int erand48_r (unsigned short int __xsubi[3], > struct drand48_data *__restrict __buffer, > double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern int lrand48_r (struct drand48_data *__restrict __buffer, > long int *__restrict __result) > throw () __attribute__ ((__nonnull__ (1, 2))); >extern int nrand48_r (unsigned short int __xsubi[3], > struct drand48_data *__restrict __buffer, > long int *__restrict __result) > throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern int mrand48_r (struct drand48_data *__restrict __buffer, > long int *__restrict __result) > throw () __attribute__ ((__nonnull__ (1, 2))); >extern int jrand48_r (unsigned short int __xsubi[3], > struct drand48_data *__restrict __buffer, > long int *__restrict __result) > throw () __attribute__ ((__nonnull__ (1, 2))); > > >extern int srand48_r (long int __seedval, struct drand48_data *__buffer) > throw () __attribute__ ((__nonnull__ (2))); > >extern int seed48_r (unsigned short int __seed16v[3], > struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2))); > >extern int lcong48_r (unsigned short int __param[7], > struct drand48_data *__buffer) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > > > > > > >extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)); > >extern void *calloc (size_t __nmemb, size_t __size) > throw () __attribute__ ((__malloc__)); > > > > > > > >extern void *realloc (void *__ptr, size_t __size) throw () __attribute__ ((__malloc__)); > >extern void free (void *__ptr) throw (); > > > > >extern void cfree (void *__ptr) throw (); > > > ># 1 "/usr/include/alloca.h" 1 3 4 ># 25 "/usr/include/alloca.h" 3 4 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 26 "/usr/include/alloca.h" 2 3 4 > >extern "C" { > > > > > >extern void *alloca (size_t __size) throw (); > > > > > >} ># 607 "/usr/include/stdlib.h" 2 3 4 > > > > >extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)); > > > > >extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) > throw () __attribute__ ((__nonnull__ (1))); > > > > >extern void abort (void) throw () __attribute__ ((__noreturn__)); > > > >extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) > throw () __attribute__ ((__nonnull__ (1))); > > > > > > >extern void exit (int __status) throw () __attribute__ ((__noreturn__)); > > > > > > >extern void _Exit (int __status) throw () __attribute__ ((__noreturn__)); > > > > > > >extern char *getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1))); > > > > >extern char *__secure_getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern int setenv (__const char *__name, __const char *__value, int __replace) > throw () __attribute__ ((__nonnull__ (2))); > > >extern int unsetenv (__const char *__name) throw (); > > > > > > >extern int clearenv (void) throw (); ># 691 "/usr/include/stdlib.h" 3 4 >extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1))); ># 702 "/usr/include/stdlib.h" 3 4 >extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))); ># 711 "/usr/include/stdlib.h" 3 4 >extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))); ># 721 "/usr/include/stdlib.h" 3 4 >extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))); > > > > > > > > >extern int system (__const char *__command); > > > > > > > >extern char *canonicalize_file_name (__const char *__name) > throw () __attribute__ ((__nonnull__ (1))); ># 749 "/usr/include/stdlib.h" 3 4 >extern char *realpath (__const char *__restrict __name, > char *__restrict __resolved) throw (); > > > > > > >typedef int (*__compar_fn_t) (__const void *, __const void *); > > >typedef __compar_fn_t comparison_fn_t; > > > > > > >extern void *bsearch (__const void *__key, __const void *__base, > size_t __nmemb, size_t __size, __compar_fn_t __compar) > __attribute__ ((__nonnull__ (1, 2, 5))); > > > >extern void qsort (void *__base, size_t __nmemb, size_t __size, > __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); > > > >extern int abs (int __x) throw () __attribute__ ((__const__)); >extern long int labs (long int __x) throw () __attribute__ ((__const__)); > > > >__extension__ extern long long int llabs (long long int __x) > throw () __attribute__ ((__const__)); > > > > > > > >extern div_t div (int __numer, int __denom) > throw () __attribute__ ((__const__)); >extern ldiv_t ldiv (long int __numer, long int __denom) > throw () __attribute__ ((__const__)); > > > > >__extension__ extern lldiv_t lldiv (long long int __numer, > long long int __denom) > throw () __attribute__ ((__const__)); > ># 814 "/usr/include/stdlib.h" 3 4 >extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, > int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))); > > > > >extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, > int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))); > > > > >extern char *gcvt (double __value, int __ndigit, char *__buf) > throw () __attribute__ ((__nonnull__ (3))); > > > > >extern char *qecvt (long double __value, int __ndigit, > int *__restrict __decpt, int *__restrict __sign) > throw () __attribute__ ((__nonnull__ (3, 4))); >extern char *qfcvt (long double __value, int __ndigit, > int *__restrict __decpt, int *__restrict __sign) > throw () __attribute__ ((__nonnull__ (3, 4))); >extern char *qgcvt (long double __value, int __ndigit, char *__buf) > throw () __attribute__ ((__nonnull__ (3))); > > > > >extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, > int *__restrict __sign, char *__restrict __buf, > size_t __len) throw () __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) throw () __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) > throw () __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) > throw () __attribute__ ((__nonnull__ (3, 4, 5))); > > > > > > > >extern int mblen (__const char *__s, size_t __n) throw (); > > >extern int mbtowc (wchar_t *__restrict __pwc, > __const char *__restrict __s, size_t __n) throw (); > > >extern int wctomb (char *__s, wchar_t __wchar) throw (); > > > >extern size_t mbstowcs (wchar_t *__restrict __pwcs, > __const char *__restrict __s, size_t __n) throw (); > >extern size_t wcstombs (char *__restrict __s, > __const wchar_t *__restrict __pwcs, size_t __n) > throw (); > > > > > > > > >extern int rpmatch (__const char *__response) throw () __attribute__ ((__nonnull__ (1))); ># 902 "/usr/include/stdlib.h" 3 4 >extern int getsubopt (char **__restrict __optionp, > char *__const *__restrict __tokens, > char **__restrict __valuep) > throw () __attribute__ ((__nonnull__ (1, 2, 3))); > > > > > >extern void setkey (__const char *__key) throw () __attribute__ ((__nonnull__ (1))); > > > > > > > >extern int posix_openpt (int __oflag); > > > > > > > >extern int grantpt (int __fd) throw (); > > > >extern int unlockpt (int __fd) throw (); > > > > >extern char *ptsname (int __fd) throw (); > > > > > > >extern int ptsname_r (int __fd, char *__buf, size_t __buflen) > throw () __attribute__ ((__nonnull__ (2))); > > >extern int getpt (void); > > > > > > >extern int getloadavg (double __loadavg[], int __nelem) > throw () __attribute__ ((__nonnull__ (1))); > > > > > >} ># 114 "../libdjvu/GString.h" 2 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stdarg.h" 1 3 4 ># 43 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stdarg.h" 3 4 >typedef __builtin_va_list __gnuc_va_list; ># 105 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stdarg.h" 3 4 >typedef __gnuc_va_list va_list; ># 115 "../libdjvu/GString.h" 2 ># 123 "../libdjvu/GString.h" ># 1 "/usr/include/wchar.h" 1 3 4 ># 37 "/usr/include/wchar.h" 3 4 ># 1 "/usr/include/stdio.h" 1 3 4 ># 44 "/usr/include/stdio.h" 3 4 > > >typedef struct _IO_FILE FILE; > > > > > ># 62 "/usr/include/stdio.h" 3 4 >typedef struct _IO_FILE __FILE; ># 38 "/usr/include/wchar.h" 2 3 4 ># 48 "/usr/include/wchar.h" 3 4 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 354 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 3 4 >typedef unsigned int wint_t; ># 49 "/usr/include/wchar.h" 2 3 4 > ># 1 "/usr/include/bits/wchar.h" 1 3 4 ># 51 "/usr/include/wchar.h" 2 3 4 ># 76 "/usr/include/wchar.h" 3 4 >typedef struct >{ > int __count; > union > { > wint_t __wch; > char __wchb[4]; > } __value; >} __mbstate_t; ># 93 "/usr/include/wchar.h" 3 4 > > >typedef __mbstate_t mbstate_t; > > > ># 118 "/usr/include/wchar.h" 3 4 >extern "C" { > > > > >struct tm; > > > > > > > > > >extern wchar_t *wcscpy (wchar_t *__restrict __dest, > __const wchar_t *__restrict __src) throw (); > >extern wchar_t *wcsncpy (wchar_t *__restrict __dest, > __const wchar_t *__restrict __src, size_t __n) > throw (); > > >extern wchar_t *wcscat (wchar_t *__restrict __dest, > __const wchar_t *__restrict __src) throw (); > >extern wchar_t *wcsncat (wchar_t *__restrict __dest, > __const wchar_t *__restrict __src, size_t __n) > throw (); > > >extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) > throw () __attribute__ ((__pure__)); > >extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n) > throw () __attribute__ ((__pure__)); > > > > >extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) throw (); > > >extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2, > size_t __n) throw (); > > > > > >extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, > __locale_t __loc) throw (); > >extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, > size_t __n, __locale_t __loc) throw (); > > > > > >extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) throw (); > > > >extern size_t wcsxfrm (wchar_t *__restrict __s1, > __const wchar_t *__restrict __s2, size_t __n) throw (); > > > > > > > > >extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2, > __locale_t __loc) throw (); > > > > >extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2, > size_t __n, __locale_t __loc) throw (); > > >extern wchar_t *wcsdup (__const wchar_t *__s) throw () __attribute__ ((__malloc__)); > > > > >extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc) > throw () __attribute__ ((__pure__)); > >extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc) > throw () __attribute__ ((__pure__)); > > > > > >extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc) > throw () __attribute__ ((__pure__)); > > > > > >extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject) > throw () __attribute__ ((__pure__)); > > >extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept) > throw () __attribute__ ((__pure__)); > >extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept) > throw () __attribute__ ((__pure__)); > >extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle) > throw () __attribute__ ((__pure__)); > > >extern wchar_t *wcstok (wchar_t *__restrict __s, > __const wchar_t *__restrict __delim, > wchar_t **__restrict __ptr) throw (); > > >extern size_t wcslen (__const wchar_t *__s) throw () __attribute__ ((__pure__)); > > > > >extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle) > throw () __attribute__ ((__pure__)); > > > > >extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen) > throw () __attribute__ ((__pure__)); > > > > > >extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n) > throw () __attribute__ ((__pure__)); > > >extern int wmemcmp (__const wchar_t *__restrict __s1, > __const wchar_t *__restrict __s2, size_t __n) > throw () __attribute__ ((__pure__)); > > >extern wchar_t *wmemcpy (wchar_t *__restrict __s1, > __const wchar_t *__restrict __s2, size_t __n) throw (); > > > >extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n) > throw (); > > >extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw (); > > > > > >extern wchar_t *wmempcpy (wchar_t *__restrict __s1, > __const wchar_t *__restrict __s2, size_t __n) > throw (); > > > > > > >extern wint_t btowc (int __c) throw (); > > > >extern int wctob (wint_t __c) throw (); > > > >extern int mbsinit (__const mbstate_t *__ps) throw () __attribute__ ((__pure__)); > > > >extern size_t mbrtowc (wchar_t *__restrict __pwc, > __const char *__restrict __s, size_t __n, > mbstate_t *__p) throw (); > > >extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, > mbstate_t *__restrict __ps) throw (); > > >extern size_t __mbrlen (__const char *__restrict __s, size_t __n, > mbstate_t *__restrict __ps) throw (); >extern size_t mbrlen (__const char *__restrict __s, size_t __n, > mbstate_t *__restrict __ps) throw (); > > > > >extern __inline size_t >mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw () > >{ return (__ps != __null > ? mbrtowc (__null, __s, __n, __ps) : __mbrlen (__s, __n, __null)); } > > > > > >extern size_t mbsrtowcs (wchar_t *__restrict __dst, > __const char **__restrict __src, size_t __len, > mbstate_t *__restrict __ps) throw (); > > > >extern size_t wcsrtombs (char *__restrict __dst, > __const wchar_t **__restrict __src, size_t __len, > mbstate_t *__restrict __ps) throw (); > > > > > > >extern size_t mbsnrtowcs (wchar_t *__restrict __dst, > __const char **__restrict __src, size_t __nmc, > size_t __len, mbstate_t *__restrict __ps) throw (); > > > >extern size_t wcsnrtombs (char *__restrict __dst, > __const wchar_t **__restrict __src, > size_t __nwc, size_t __len, > mbstate_t *__restrict __ps) throw (); > > > > > > >extern int wcwidth (wchar_t __c) throw (); > > > >extern int wcswidth (__const wchar_t *__s, size_t __n) throw (); > > > > > > >extern double wcstod (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr) throw (); > > > >extern float wcstof (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr) throw (); >extern long double wcstold (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr) throw (); > > > > > >extern long int wcstol (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, int __base) throw (); > > > >extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, int __base) > throw (); > > > > >__extension__ >extern long long int wcstoll (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, int __base) > throw (); > > > >__extension__ >extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __base) throw (); > > > > > > >__extension__ >extern long long int wcstoq (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, int __base) > throw (); > > > >__extension__ >extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __base) throw (); ># 449 "/usr/include/wchar.h" 3 4 >extern long int wcstol_l (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, int __base, > __locale_t __loc) throw (); > >extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __base, __locale_t __loc) throw (); > >__extension__ >extern long long int wcstoll_l (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __base, __locale_t __loc) throw (); > >__extension__ >extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __base, __locale_t __loc) > throw (); > >extern double wcstod_l (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, __locale_t __loc) > throw (); > >extern float wcstof_l (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, __locale_t __loc) > throw (); > >extern long double wcstold_l (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > __locale_t __loc) throw (); > > > > > >extern double __wcstod_internal (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, int __group) > throw (); >extern float __wcstof_internal (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, int __group) > throw (); >extern long double __wcstold_internal (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __group) throw (); > > >extern long int __wcstol_internal (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __base, int __group) throw (); > > > >extern unsigned long int __wcstoul_internal (__const wchar_t *__restrict __npt, > wchar_t **__restrict __endptr, > int __base, int __group) throw (); > > > >__extension__ >extern long long int __wcstoll_internal (__const wchar_t *__restrict __nptr, > wchar_t **__restrict __endptr, > int __base, int __group) throw (); > > > >__extension__ >extern unsigned long long int __wcstoull_internal (__const wchar_t * > __restrict __nptr, > wchar_t ** > __restrict __endptr, > int __base, > int __group) throw (); > > > > > > > > >extern __inline double >wcstod (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw () > >{ return __wcstod_internal (__nptr, __endptr, 0); } >extern __inline long int >wcstol (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw () > >{ return __wcstol_internal (__nptr, __endptr, __base, 0); } >extern __inline unsigned long int >wcstoul (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw () > >{ return __wcstoul_internal (__nptr, __endptr, __base, 0); } > > > >extern __inline float >wcstof (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw () > >{ return __wcstof_internal (__nptr, __endptr, 0); } >extern __inline long double >wcstold (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw () > >{ return __wcstold_internal (__nptr, __endptr, 0); } > > >__extension__ >extern __inline long long int >wcstoq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw () > >{ return __wcstoll_internal (__nptr, __endptr, __base, 0); } >__extension__ >extern __inline unsigned long long int >wcstouq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw () > >{ return __wcstoull_internal (__nptr, __endptr, __base, 0); } > > > > > > > >extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) throw (); > > > >extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n) > throw (); > > > > > > > > >extern int fwide (__FILE *__fp, int __mode) throw (); > > > > > > >extern int fwprintf (__FILE *__restrict __stream, > __const wchar_t *__restrict __format, ...) > ; > > > > >extern int wprintf (__const wchar_t *__restrict __format, ...) > ; > >extern int swprintf (wchar_t *__restrict __s, size_t __n, > __const wchar_t *__restrict __format, ...) > throw () ; > > > > > >extern int vfwprintf (__FILE *__restrict __s, > __const wchar_t *__restrict __format, > __gnuc_va_list __arg) > ; > > > > >extern int vwprintf (__const wchar_t *__restrict __format, > __gnuc_va_list __arg) > ; > > >extern int vswprintf (wchar_t *__restrict __s, size_t __n, > __const wchar_t *__restrict __format, > __gnuc_va_list __arg) > throw () ; > > > > > > >extern int fwscanf (__FILE *__restrict __stream, > __const wchar_t *__restrict __format, ...) > ; > > > > >extern int wscanf (__const wchar_t *__restrict __format, ...) > ; > >extern int swscanf (__const wchar_t *__restrict __s, > __const wchar_t *__restrict __format, ...) > throw () ; > > > > > > > > > > > >extern int vfwscanf (__FILE *__restrict __s, > __const wchar_t *__restrict __format, > __gnuc_va_list __arg) > ; > > > > >extern int vwscanf (__const wchar_t *__restrict __format, > __gnuc_va_list __arg) > ; > >extern int vswscanf (__const wchar_t *__restrict __s, > __const wchar_t *__restrict __format, > __gnuc_va_list __arg) > throw () ; > > > > > > > > > > >extern wint_t fgetwc (__FILE *__stream); >extern wint_t getwc (__FILE *__stream); > > > > > >extern wint_t getwchar (void); > > > > > > >extern wint_t fputwc (wchar_t __wc, __FILE *__stream); >extern wint_t putwc (wchar_t __wc, __FILE *__stream); > > > > > >extern wint_t putwchar (wchar_t __wc); > > > > > > > >extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, > __FILE *__restrict __stream); > > > > > >extern int fputws (__const wchar_t *__restrict __ws, > __FILE *__restrict __stream); > > > > > > >extern wint_t ungetwc (wint_t __wc, __FILE *__stream); > ># 739 "/usr/include/wchar.h" 3 4 >extern wint_t getwc_unlocked (__FILE *__stream); >extern wint_t getwchar_unlocked (void); > > > > > > > >extern wint_t fgetwc_unlocked (__FILE *__stream); > > > > > > > >extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); ># 765 "/usr/include/wchar.h" 3 4 >extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); >extern wint_t putwchar_unlocked (wchar_t __wc); ># 775 "/usr/include/wchar.h" 3 4 >extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, > __FILE *__restrict __stream); > > > > > > > >extern int fputws_unlocked (__const wchar_t *__restrict __ws, > __FILE *__restrict __stream); > > > > > > > >extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, > __const wchar_t *__restrict __format, > __const struct tm *__restrict __tp) throw (); > > > > > > > >extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, > __const wchar_t *__restrict __format, > __const struct tm *__restrict __tp, > __locale_t __loc) throw (); ># 820 "/usr/include/wchar.h" 3 4 >} ># 124 "../libdjvu/GString.h" 2 > > > > > >namespace DJVU { ># 141 "../libdjvu/GString.h" >class GBaseString; >class GUTF8String; >class GNativeString; > > >class GStringRep : public GPEnabled >{ >public: > enum EncodeType { XUCS4, XUCS4BE, XUCS4LE, XUCS4_2143, XUCS4_3412, > XUTF16, XUTF16BE, XUTF16LE, XUTF8, XEBCDIC, XOTHER } ; > > enum EscapeMode { UNKNOWN_ESCAPED=0, IS_ESCAPED=1, NOT_ESCAPED=2 }; > > class UTF8; > friend class UTF8; > class Unicode; > friend class Unicode; > > class ChangeLocale; > > class Native; > friend class Native; > > friend class GBaseString; > friend class GUTF8String; > friend class GNativeString; > friend unsigned int hash(const GBaseString &ref); > >public: > > GStringRep(void); > > virtual ~GStringRep(); > > > > virtual GP<GStringRep> blank(const unsigned int sz) const = 0; > > GP<GStringRep> getbuf(int n) const; > > GP<GStringRep> setat(int n, char ch) const; > > virtual GP<GStringRep> append(const GP<GStringRep> &s2) const = 0; > > virtual bool isUTF8(void) const { return false; } > > virtual bool isNative(void) const { return false; } > > virtual GP<GStringRep> toNative( > const EscapeMode escape=UNKNOWN_ESCAPED ) const = 0; > > virtual GP<GStringRep> toUTF8(const bool nothrow=false) const = 0; > > virtual GP<GStringRep> toThis( > const GP<GStringRep> &rep,const GP<GStringRep> &locale=0) const = 0; > > virtual int cmp(const GP<GStringRep> &s2,const int len=(-1)) const = 0; > > > virtual int toInt(void) const = 0; > virtual long int toLong( > const int pos, int &endpos, const int base=10) const = 0; > virtual unsigned long toULong( > const int pos, int &endpos, const int base=10) const = 0; > virtual double toDouble(const int pos, int &endpos) const = 0; > > > int nextChar( const int from=0 ) const; > > > int nextNonSpace( const int from=0, const int len=(-1) ) const; > > > int nextSpace( const int from=0, const int len=(-1) ) const; > > > int firstEndSpace( int from=0, const int len=(-1) ) const; > > > template <class TYPE> static GP<GStringRep> create( > const unsigned int sz,TYPE *); > > GP<GStringRep> strdup(const char *s) const; > > > GP<GStringRep> append(const char *s2) const; > > > GP<GStringRep> concat(const GP<GStringRep> &s1,const GP<GStringRep> &s2) const; > GP<GStringRep> concat(const char *s1,const GP<GStringRep> &s2) const; > GP<GStringRep> concat(const GP<GStringRep> &s1,const char *s2) const; > GP<GStringRep> concat(const char *s1,const char *s2) const; > > > > > GP<GStringRep> substr( > const char *s,const int start,const int length=(-1)) const; > > GP<GStringRep> substr( > const unsigned short *s,const int start,const int length=(-1)) const; > > GP<GStringRep> substr( > const unsigned long *s,const int start,const int length=(-1)) const; > > > > > > > > GP<GStringRep> vformat(va_list args) const; > > > static GP<GStringRep> UTF8ToNative( const char *s, > const EscapeMode escape=UNKNOWN_ESCAPED ); > static GP<GStringRep> NativeToUTF8( const char *s ); > > > GP<GStringRep> upcase(void) const; > > GP<GStringRep> downcase(void) const; > > > static unsigned long UTF8toUCS4( > unsigned char const *&s, void const * const endptr ); > > > > static int UTF8toUCS4( > unsigned long &w, unsigned char const s[], void const * const endptr ) > { unsigned char const *r=s;w=UTF8toUCS4(r,endptr);return (int)((size_t)r-(size_t)s); } > > > static int UTF16toUCS4( > unsigned long &w, unsigned short const * const s,void const * const eptr); > > static int UCS4toUTF16( > unsigned long w, unsigned short &w1, unsigned short &w2); > > int cmp(const char *s2, const int len=(-1)) const; > static int cmp( > const GP<GStringRep> &s1, const GP<GStringRep> &s2, const int len=(-1)) ; > static int cmp( > const GP<GStringRep> &s1, const char *s2, const int len=(-1)); > static int cmp( > const char *s1, const GP<GStringRep> &s2, const int len=(-1)); > static int cmp( > const char *s1, const char *s2, const int len=(-1)); > > > int getUCS4(unsigned long &w, const int from) const; > > virtual unsigned char *UCS4toString( > const unsigned long w, unsigned char *ptr, mbstate_t *ps=0) const = 0; > > static unsigned char *UCS4toUTF8( > const unsigned long w,unsigned char *ptr); > > static unsigned char *UCS4toNative( > const unsigned long w,unsigned char *ptr, mbstate_t *ps); > > int search(char c, int from=0) const; > > int search(char const *str, int from=0) const; > > int rsearch(char c, int from=0) const; > > int rsearch(char const *str, int from=0) const; > > int contains(char const accept[], int from=0) const; > > int rcontains(char const accept[], int from=0) const; > >protected: > > virtual unsigned long getValidUCS4(const char *&source) const = 0; > > GP<GStringRep> tocase( > bool (*xiswcase)(const unsigned long wc), > unsigned long (*xtowcase)(const unsigned long wc)) const; > > > > > const char * isCharType( bool (*xiswtest)(const unsigned long wc), const char *ptr, > const bool reverse=false) const; > > > int nextCharType( > bool (*xiswtest)(const unsigned long wc),const int from,const int len, > const bool reverse=false) const; > > static bool giswspace(const unsigned long w); > static bool giswupper(const unsigned long w); > static bool giswlower(const unsigned long w); > static unsigned long gtowupper(const unsigned long w); > static unsigned long gtowlower(const unsigned long w); > > virtual void set_remainder( void const * const buf, const unsigned int size, > const EncodeType encodetype); > virtual void set_remainder( void const * const buf, const unsigned int size, > const GP<GStringRep> &encoding ); > virtual void set_remainder ( const GP<Unicode> &remainder ); > > virtual GP<Unicode> get_remainder( void ) const; > >public: > > > > > GP<GStringRep> toEscaped( const bool tosevenbit ) const; > > > virtual bool is_valid(void) const = 0; > > virtual int ncopy(wchar_t * const buf, const int buflen) const = 0; > >protected: > > > int size; > char *data; >}; > >class GStringRep::UTF8 : public GStringRep >{ >public: > > UTF8(void); > > virtual ~UTF8(); > > > virtual GP<GStringRep> blank(const unsigned int sz = 0) const; > virtual GP<GStringRep> append(const GP<GStringRep> &s2) const; > > virtual bool isUTF8(void) const; > > virtual GP<GStringRep> toNative( > const EscapeMode escape=UNKNOWN_ESCAPED) const; > > virtual GP<GStringRep> toUTF8(const bool nothrow=false) const; > > virtual GP<GStringRep> toThis( > const GP<GStringRep> &rep,const GP<GStringRep> &) const; > > virtual int cmp(const GP<GStringRep> &s2,const int len=(-1)) const; > > static GP<GStringRep> create(const unsigned int sz = 0); > > > virtual int toInt(void) const; > virtual long int toLong( > const int pos, int &endpos, const int base=10) const; > virtual unsigned long toULong( > const int pos, int &endpos, const int base=10) const; > virtual double toDouble( > const int pos, int &endpos) const; > > > static GP<GStringRep> create(const char *s); > > > static GP<GStringRep> create( > const GP<GStringRep> &s1,const GP<GStringRep> &s2); > static GP<GStringRep> create( const GP<GStringRep> &s1,const char *s2); > static GP<GStringRep> create( const char *s1, const GP<GStringRep> &s2); > static GP<GStringRep> create( const char *s1,const char *s2); > > > static GP<GStringRep> create( > const char *s,const int start,const int length=(-1)); > > static GP<GStringRep> create( > const unsigned short *s,const int start,const int length=(-1)); > > static GP<GStringRep> create( > const unsigned long *s,const int start,const int length=(-1)); > > static GP<GStringRep> create_format(const char fmt[],...); > static GP<GStringRep> create(const char fmt[],va_list& args); > > virtual unsigned char *UCS4toString( > const unsigned long w,unsigned char *ptr, mbstate_t *ps=0) const; > > > virtual bool is_valid(void) const; > > virtual int ncopy(wchar_t * const buf, const int buflen) const; > > friend class GBaseString; > >protected: > > virtual unsigned long getValidUCS4(const char *&source) const; >}; ># 464 "../libdjvu/GString.h" >class GBaseString : protected GP<GStringRep> >{ >public: > enum EscapeMode { > UNKNOWN_ESCAPED=GStringRep::UNKNOWN_ESCAPED, > IS_ESCAPED=GStringRep::IS_ESCAPED, > NOT_ESCAPED=GStringRep::NOT_ESCAPED }; > > friend class GUTF8String; > friend class GNativeString; >protected: > > void init(void); > > ~GBaseString(); > GBaseString &init(const GP<GStringRep> &rep); > > > > GBaseString( void ); > >public: > > > > > > > operator const char* ( void ) const ; > > unsigned int length( void ) const; ># 505 "../libdjvu/GString.h" > bool operator! ( void ) const; > > > > > > > > char operator[] (int n) const; > > bool is_int(void) const; > > bool is_float(void) const; > > > GNativeString getUTF82Native( EscapeMode escape=UNKNOWN_ESCAPED ) const; > GUTF8String getNative2UTF8( void ) const; > > > > void empty( void ); > > > > > > int search(char c, int from=0) const; > > > > > > > int search(const char *str, int from=0) const; > > > > > > int rsearch(char c, const int from=0) const; > > > > > > int rsearch(const char *str, const int from=0) const; > > > > int contains(const char accept[], const int from=0) const; > > > > int rcontains(const char accept[], const int from=0) const; > > > > GUTF8String operator+(const GUTF8String &s2) const; > GNativeString operator+(const GNativeString &s2) const; > > > int toInt(void) const; > > > long toLong(const int pos, int &endpos, const int base=10) const; > > > unsigned long toULong( > const int pos, int &endpos, const int base=10) const; > > > double toDouble( > const int pos, int &endpos ) const; > > > static long toLong( > const GUTF8String& src, const int pos, int &endpos, const int base=10); > > static unsigned long toULong( > const GUTF8String& src, const int pos, int &endpos, const int base=10); > > static double toDouble( > const GUTF8String& src, const int pos, int &endpos); > > > static long toLong( > const GNativeString& src, const int pos, int &endpos, const int base=10); > > static unsigned long toULong( > const GNativeString& src, const int pos, int &endpos, const int base=10); > > static double toDouble( > const GNativeString& src, const int pos, int &endpos); > > > > > > > int cmp(const GBaseString &s2, const int len=(-1)) const; > > > int cmp(const char *s2, const int len=(-1)) const; > > > int cmp(const char s2) const; > > > static int cmp(const char *s1, const char *s2, const int len=(-1)); > > > > > > > > bool operator==(const GBaseString &s2) const; > bool operator==(const char *s2) const; > friend bool operator==(const char *s1, const GBaseString &s2); > > > > > bool operator!=(const GBaseString &s2) const; > bool operator!=(const char *s2) const; > friend bool operator!=(const char *s1, const GBaseString &s2); > > > > > bool operator>=(const GBaseString &s2) const; > bool operator>=(const char *s2) const; > bool operator>=(const char s2) const; > friend bool operator>=(const char *s1, const GBaseString &s2); > friend bool operator>=(const char s1, const GBaseString &s2); > > > > > > bool operator<(const GBaseString &s2) const; > bool operator<(const char *s2) const; > bool operator<(const char s2) const; > friend bool operator<(const char *s1, const GBaseString &s2); > friend bool operator<(const char s1, const GBaseString &s2); > > > > > > bool operator> (const GBaseString &s2) const; > bool operator> (const char *s2) const; > bool operator> (const char s2) const; > friend bool operator> (const char *s1, const GBaseString &s2); > friend bool operator> (const char s1, const GBaseString &s2); > > > > > > bool operator<=(const GBaseString &s2) const; > bool operator<=(const char *s2) const; > bool operator<=(const char s2) const; > friend bool operator<=(const char *s1, const GBaseString &s2); > friend bool operator<=(const char s1, const GBaseString &s2); ># 680 "../libdjvu/GString.h" > friend unsigned int hash(const GBaseString &ref); > > friend class GStringRep; > > > int nextNonSpace( const int from=0, const int len=(-1) ) const; > > > int nextChar( const int from=0 ) const; > > > int nextSpace( const int from=0, const int len=(-1) ) const; > > > int firstEndSpace( const int from=0,const int len=(-1) ) const; > > > bool is_valid(void) const; > > > int ncopy(wchar_t * const buf, const int buflen) const; > >protected: > const char *gstr; > static void throw_illegal_subscript() __attribute__ ((noreturn)); > static const char *nullstr; >public: > GNativeString UTF8ToNative( > const bool currentlocale=false, > const EscapeMode escape=UNKNOWN_ESCAPED) const; > GUTF8String NativeToUTF8(void) const; >protected: > int CheckSubscript(int n) const; >}; ># 736 "../libdjvu/GString.h" >class GUTF8String : public GBaseString >{ >public: > ~GUTF8String(); > void init(void); > > GUTF8String &init(const GP<GStringRep> &rep); > > > > GUTF8String(void); > > GUTF8String(const char dat); > > GUTF8String(const char *str); > > GUTF8String(const unsigned char *str); > GUTF8String(const unsigned short *dat); > GUTF8String(const unsigned long *dat); > > > > > GUTF8String(const char *dat, unsigned int len); > GUTF8String(const unsigned short *dat, unsigned int len); > GUTF8String(const unsigned long *dat, unsigned int len); > > > GUTF8String(const GP<GStringRep> &str); > GUTF8String(const GBaseString &str); > GUTF8String(const GUTF8String &str); > GUTF8String(const GNativeString &str); > > > > > GUTF8String(const GBaseString &gs, int from, int len); > > > > > GUTF8String& operator= (const char str); > GUTF8String& operator= (const char *str); > GUTF8String& operator= (const GP<GStringRep> &str); > GUTF8String& operator= (const GBaseString &str); > GUTF8String& operator= (const GUTF8String &str); > GUTF8String& operator= (const GNativeString &str); ># 791 "../libdjvu/GString.h" > GUTF8String(const GUTF8String &fmt, va_list &args); > > > > > > GUTF8String(const int number); > > > > > GUTF8String(const double number); ># 812 "../libdjvu/GString.h" > GUTF8String &format(const char *fmt, ... ); > > > > > > > > GUTF8String &vformat(const GUTF8String &fmt, va_list &args); > > > > > > GUTF8String toEscaped( const bool tosevenbit=false ) const; > > > > > > GUTF8String fromEscaped( void ) const; > > > > > > > > GUTF8String fromEscaped( > const GMap<GUTF8String,GUTF8String> ConvMap ) const; > > > > > GUTF8String& operator+= (char ch); > > > GUTF8String& operator+= (const char *str); > > GUTF8String& operator+= (const GBaseString &str); > > > > > > GUTF8String substr(int from, int len ) const; > > > > > GUTF8String upcase( void ) const; > > > > GUTF8String downcase( void ) const; > > > > > GUTF8String operator+(const GBaseString &s2) const; > GUTF8String operator+(const GUTF8String &s2) const; > GUTF8String operator+(const GNativeString &s2) const; > GUTF8String operator+(const char *s2) const; > friend GUTF8String operator+(const char *s1, const GUTF8String &s2); ># 885 "../libdjvu/GString.h" > char *getbuf(int n = -1); ># 894 "../libdjvu/GString.h" > void setat(const int n, const char ch); >public: > typedef enum GStringRep::EncodeType EncodeType; > static GUTF8String create(void const * const buf, > const unsigned int size, > const EncodeType encodetype, const GUTF8String &encoding); > static GUTF8String create( void const * const buf, > unsigned int size, const EncodeType encodetype ); > static GUTF8String create( void const * const buf, > const unsigned int size, const GUTF8String &encoding ); > static GUTF8String create( void const * const buf, > const unsigned int size, const GP<GStringRep::Unicode> &remainder); > GP<GStringRep::Unicode> get_remainder(void) const; > static GUTF8String create( const char *buf, const unsigned int bufsize ); > static GUTF8String create( const unsigned short *buf, const unsigned int bufsize ); > static GUTF8String create( const unsigned long *buf, const unsigned int bufsize ); >}; ># 938 "../libdjvu/GString.h" >class GNativeString : public GBaseString >{ >public: > ~GNativeString(); > > > GNativeString(void); > > GNativeString(const char dat); > > GNativeString(const char *str); > > GNativeString(const unsigned char *str); > GNativeString(const unsigned short *str); > GNativeString(const unsigned long *str); > > > > > GNativeString(const char *dat, unsigned int len); > GNativeString(const unsigned short *dat, unsigned int len); > GNativeString(const unsigned long *dat, unsigned int len); > > GNativeString(const GP<GStringRep> &str); > GNativeString(const GBaseString &str); > > GNativeString(const GUTF8String &str); > > GNativeString(const GNativeString &str); > > > > > GNativeString(const GBaseString &gs, int from, int len); ># 980 "../libdjvu/GString.h" > GNativeString(const GNativeString &fmt, va_list &args); > > > > > GNativeString(const int number); > > > > > GNativeString(const double number); > > > > > > void init(void); > > > GNativeString &init(const GP<GStringRep> &rep); > > > > > GNativeString& operator= (const char str); > GNativeString& operator= (const char *str); > GNativeString& operator= (const GP<GStringRep> &str); > GNativeString& operator= (const GBaseString &str); > GNativeString& operator= (const GUTF8String &str); > GNativeString& operator= (const GNativeString &str); > > > GNativeString& operator+= (char ch); > > GNativeString& operator+= (const char *str); > > GNativeString& operator+= (const GBaseString &str); > > > > > > GNativeString substr(int from, int len ) const; > > > > > GNativeString upcase( void ) const; > > > > GNativeString downcase( void ) const; > > > GNativeString operator+(const GBaseString &s2) const; > GNativeString operator+(const GNativeString &s2) const; > GUTF8String operator+(const GUTF8String &s2) const; > GNativeString operator+(const char *s2) const; > friend GNativeString operator+(const char *s1, const GNativeString &s2); ># 1047 "../libdjvu/GString.h" > GNativeString &format(const char *fmt, ... ); > > > > > > > > GNativeString &vformat(const GNativeString &fmt, va_list &args); > > > > > > GNativeString toEscaped( const bool tosevenbit=false ) const; ># 1073 "../libdjvu/GString.h" > char *getbuf(int n = -1); ># 1083 "../libdjvu/GString.h" > void setat(const int n, const char ch); > > static GNativeString create( const char *buf, const unsigned int bufsize ); > static GNativeString create( const unsigned short *buf, const unsigned int bufsize ); > static GNativeString create( const unsigned long *buf, const unsigned int bufsize ); > >}; > > > >inline >GBaseString::operator const char* ( void ) const >{ > return ptr?(*this)->data:nullstr; >} > >inline unsigned int >GBaseString::length( void ) const >{ > return ptr ? (*this)->size : 0; >} > >inline bool >GBaseString::operator! ( void ) const >{ > return !ptr; >} > >inline GUTF8String >GUTF8String::upcase( void ) const >{ > if (ptr) return (*this)->upcase(); > return *this; >} > >inline GUTF8String >GUTF8String::downcase( void ) const >{ > if (ptr) return (*this)->downcase(); > return *this; >} > >inline void >GUTF8String::init(void) >{ GBaseString::init(); } > >inline GUTF8String & >GUTF8String::init(const GP<GStringRep> &rep) >{ GP<GStringRep>::operator=(rep?rep->toUTF8(true):rep); init(); return *this; } > >inline GUTF8String & >GUTF8String::vformat(const GUTF8String &fmt, va_list &args) >{ return (*this = (fmt.ptr?GUTF8String(fmt,args):fmt)); } > >inline GUTF8String >GUTF8String::toEscaped( const bool tosevenbit ) const >{ return ptr?GUTF8String((*this)->toEscaped(tosevenbit)):(*this); } > >inline GP<GStringRep::Unicode> >GUTF8String::get_remainder(void) const >{ > GP<GStringRep::Unicode> retval; > if(ptr) > retval=((*this)->get_remainder()); > return retval; >} > >inline >GUTF8String::GUTF8String(const GNativeString &str) >{ init(str.length()?(str->toUTF8(true)):(GP<GStringRep>)str); } > >inline >GUTF8String::GUTF8String(const GP<GStringRep> &str) >{ init(str?(str->toUTF8(true)):str); } > >inline >GUTF8String::GUTF8String(const GBaseString &str) >{ init(str.length()?(str->toUTF8(true)):(GP<GStringRep>)str); } > >inline void >GBaseString::init(void) >{ > gstr=ptr?((*this)->data):nullstr; >} > >inline int >GBaseString::toInt(void) const >{ return ptr?(*this)->toInt():0; } > > >inline long >GBaseString::toLong(const int pos, int &endpos, const int base) const >{ > long int retval=0; > if(ptr) > { > retval=(*this)->toLong(pos, endpos, base); > }else > { > endpos=(-1); > } > return retval; >} > >inline long >GBaseString::toLong( > const GUTF8String& src, const int pos, int &endpos, const int base) >{ > return src.toLong(pos,endpos,base); >} > >inline long >GBaseString::toLong( > const GNativeString& src, const int pos, int &endpos, const int base) >{ > return src.toLong(pos,endpos,base); >} > > >inline unsigned long >GBaseString::toULong(const int pos, int &endpos, const int base) const >{ > unsigned long retval=0; > if(ptr) > { > retval=(*this)->toULong(pos, endpos, base); > }else > { > endpos=(-1); > } > return retval; >} > >inline unsigned long >GBaseString::toULong( > const GUTF8String& src, const int pos, int &endpos, const int base) >{ > return src.toULong(pos,endpos,base); >} > >inline unsigned long >GBaseString::toULong( > const GNativeString& src, const int pos, int &endpos, const int base) >{ > return src.toULong(pos,endpos,base); >} > > >inline double >GBaseString::toDouble( > const int pos, int &endpos ) const >{ > double retval=(double)0; > if(ptr) > { > retval=(*this)->toDouble(pos, endpos); > }else > { > endpos=(-1); > } > return retval; >} > >inline double >GBaseString::toDouble( > const GUTF8String& src, const int pos, int &endpos) >{ > return src.toDouble(pos,endpos); >} > >inline double >GBaseString::toDouble( > const GNativeString& src, const int pos, int &endpos) >{ > return src.toDouble(pos,endpos); >} > >inline GBaseString & >GBaseString::init(const GP<GStringRep> &rep) >{ GP<GStringRep>::operator=(rep); init(); return *this;} > >inline char >GBaseString::operator[] (int n) const >{ return ((n||ptr)?((*this)->data[CheckSubscript(n)]):0); } > >inline int >GBaseString::search(char c, int from) const >{ return ptr?((*this)->search(c,from)):(-1); } > >inline int >GBaseString::search(const char *str, int from) const >{ return ptr?((*this)->search(str,from)):(-1); } > >inline int >GBaseString::rsearch(char c, const int from) const >{ return ptr?((*this)->rsearch(c,from)):(-1); } > >inline int >GBaseString::rsearch(const char *str, const int from) const >{ return ptr?((*this)->rsearch(str,from)):(-1); } > >inline int >GBaseString::contains(const char accept[], const int from) const >{ return ptr?((*this)->contains(accept,from)):(-1); } > >inline int >GBaseString::rcontains(const char accept[], const int from) const >{ return ptr?((*this)->rcontains(accept,from)):(-1); } > >inline int >GBaseString::cmp(const GBaseString &s2, const int len) const >{ return GStringRep::cmp(*this,s2,len); } > >inline int >GBaseString::cmp(const char *s2, const int len) const >{ return GStringRep::cmp(*this,s2,len); } > >inline int >GBaseString::cmp(const char s2) const >{ return GStringRep::cmp(*this,&s2,1); } > >inline int >GBaseString::cmp(const char *s1, const char *s2, const int len) >{ return GStringRep::cmp(s1,s2,len); } > >inline bool >GBaseString::operator==(const GBaseString &s2) const >{ return !cmp(s2); } > >inline bool >GBaseString::operator==(const char *s2) const >{ return !cmp(s2); } > >inline bool >GBaseString::operator!=(const GBaseString &s2) const >{ return !!cmp(s2); } > >inline bool >GBaseString::operator!=(const char *s2) const >{ return !!cmp(s2); } > >inline bool >GBaseString::operator>=(const GBaseString &s2) const >{ return (cmp(s2)>=0); } > >inline bool >GBaseString::operator>=(const char *s2) const >{ return (cmp(s2)>=0); } > >inline bool >GBaseString::operator>=(const char s2) const >{ return (cmp(s2)>=0); } > >inline bool >GBaseString::operator<(const GBaseString &s2) const >{ return (cmp(s2)<0); } > >inline bool >GBaseString::operator<(const char *s2) const >{ return (cmp(s2)<0); } > >inline bool >GBaseString::operator<(const char s2) const >{ return (cmp(s2)<0); } > >inline bool >GBaseString::operator> (const GBaseString &s2) const >{ return (cmp(s2)>0); } > >inline bool >GBaseString::operator> (const char *s2) const >{ return (cmp(s2)>0); } > >inline bool >GBaseString::operator> (const char s2) const >{ return (cmp(s2)>0); } > >inline bool >GBaseString::operator<=(const GBaseString &s2) const >{ return (cmp(s2)<=0); } > >inline bool >GBaseString::operator<=(const char *s2) const >{ return (cmp(s2)<=0); } > >inline bool >GBaseString::operator<=(const char s2) const >{ return (cmp(s2)<=0); } > >inline int >GBaseString::nextNonSpace( const int from, const int len ) const >{ return ptr?(*this)->nextNonSpace(from,len):0; } > >inline int >GBaseString::nextChar( const int from ) const >{ return ptr?(*this)->nextChar(from):0; } > >inline int >GBaseString::nextSpace( const int from, const int len ) const >{ return ptr?(*this)->nextSpace(from,len):0; } > >inline int >GBaseString::firstEndSpace( const int from,const int len ) const >{ return ptr?(*this)->firstEndSpace(from,len):0; } > >inline bool >GBaseString::is_valid(void) const >{ return ptr?((*this)->is_valid()):true; } > >inline int >GBaseString::ncopy(wchar_t * const buf, const int buflen) const >{if(buf&&buflen)buf[0]=0;return ptr?((*this)->ncopy(buf,buflen)):0;} > >inline int >GBaseString::CheckSubscript(int n) const >{ > if(n) > { > if (n<0 && ptr) > n += (*this)->size; > if (n<0 || !ptr || n > (int)(*this)->size) > throw_illegal_subscript(); > } > return n; >} > >inline GBaseString::GBaseString(void) { init(); } > >inline GUTF8String::GUTF8String(void) { } > >inline GUTF8String::GUTF8String(const GUTF8String &str) >{ init(str); } > >inline GUTF8String& GUTF8String::operator= (const GP<GStringRep> &str) >{ return init(str); } > >inline GUTF8String& GUTF8String::operator= (const GBaseString &str) >{ return init(str); } > >inline GUTF8String& GUTF8String::operator= (const GUTF8String &str) >{ return init(str); } > >inline GUTF8String& GUTF8String::operator= (const GNativeString &str) >{ return init(str); } > >inline GUTF8String >GUTF8String::create( const char *buf, const unsigned int bufsize ) >{ > > return GNativeString(buf,bufsize); > > > >} > >inline GUTF8String >GUTF8String::create( const unsigned short *buf, const unsigned int bufsize ) >{ > return GUTF8String(buf,bufsize); >} > >inline GUTF8String >GUTF8String::create( const unsigned long *buf, const unsigned int bufsize ) >{ > return GUTF8String(buf,bufsize); >} > >inline GNativeString::GNativeString(void) {} ># 1514 "../libdjvu/GString.h" >inline void >GNativeString::init(void) >{ GBaseString::init(); } > > >inline GNativeString & >GNativeString::init(const GP<GStringRep> &rep) >{ > GP<GStringRep>::operator=(rep?rep->toNative(GStringRep::NOT_ESCAPED):rep); > init(); > return *this; >} > >inline GNativeString >GNativeString::substr(int from, int len) const >{ return GNativeString(*this, from, len); } > >inline GNativeString & >GNativeString::vformat(const GNativeString &fmt, va_list &args) >{ return (*this = (fmt.ptr?GNativeString(fmt,args):fmt)); } > >inline GNativeString >GNativeString::toEscaped( const bool tosevenbit ) const >{ return ptr?GNativeString((*this)->toEscaped(tosevenbit)):(*this); } > >inline >GNativeString::GNativeString(const GUTF8String &str) >{ > if (str.length()) > init(str->toNative(GStringRep::NOT_ESCAPED)); > else > init((GP<GStringRep>)str); >} > >inline >GNativeString::GNativeString(const GP<GStringRep> &str) >{ > if (str) > init(str->toNative(GStringRep::NOT_ESCAPED)); > else > init(str); >} > >inline >GNativeString::GNativeString(const GBaseString &str) >{ > if (str.length()) > init(str->toNative(GStringRep::NOT_ESCAPED)); > else > init((GP<GStringRep>)str); >} > > >inline >GNativeString::GNativeString(const GNativeString &fmt, va_list &args) >{ > if (fmt.ptr) > init(fmt->vformat(args)); > else > init(fmt); >} > >inline GNativeString >GNativeString::create( const char *buf, const unsigned int bufsize ) >{ > return GNativeString(buf,bufsize); >} > >inline GNativeString >GNativeString::create( const unsigned short *buf, const unsigned int bufsize ) >{ > return GNativeString(buf,bufsize); >} > >inline GNativeString >GNativeString::create( const unsigned long *buf, const unsigned int bufsize ) >{ > return GNativeString(buf,bufsize); >} > >inline GNativeString& >GNativeString::operator= (const GP<GStringRep> &str) >{ return init(str); } > >inline GNativeString& >GNativeString::operator= (const GBaseString &str) >{ return init(str); } > >inline GNativeString& >GNativeString::operator= (const GUTF8String &str) >{ return init(str); } > >inline GNativeString& >GNativeString::operator= (const GNativeString &str) >{ return init(str); } > >inline GNativeString >GNativeString::upcase( void ) const >{ > if (ptr) return (*this)->upcase(); > return *this; >} > >inline GNativeString >GNativeString::downcase( void ) const >{ > if (ptr) return (*this)->downcase(); > return *this; >} > > > >inline bool >operator==(const char *s1, const GBaseString &s2) >{ return !s2.cmp(s1); } > >inline bool >operator!=(const char *s1, const GBaseString &s2) >{ return !!s2.cmp(s1); } > >inline bool >operator>=(const char *s1, const GBaseString &s2) >{ return (s2.cmp(s1)<=0); } > >inline bool >operator>=(const char s1, const GBaseString &s2) >{ return (s2.cmp(s1)<=0); } > >inline bool >operator<(const char *s1, const GBaseString &s2) >{ return (s2.cmp(s1)>0); } > >inline bool >operator<(const char s1, const GBaseString &s2) >{ return (s2.cmp(s1)>0); } > >inline bool >operator> (const char *s1, const GBaseString &s2) >{ return (s2.cmp(s1)<0); } > >inline bool >operator> (const char s1, const GBaseString &s2) >{ return (s2.cmp(s1)<0); } > >inline bool >operator<=(const char *s1, const GBaseString &s2) >{ return !(s1>s2); } > >inline bool >operator<=(const char s1, const GBaseString &s2) >{ return !(s1>s2); } > > > > > >} > >using namespace DJVU; ># 68 "../libdjvu/GURL.h" 2 ># 1 "../libdjvu/Arrays.h" 1 ># 71 "../libdjvu/Arrays.h" >namespace DJVU { ># 130 "../libdjvu/Arrays.h" >class _ArrayRep >{ > friend class _ArrayBase; >public: > _ArrayRep(void) : count(0) {} > _ArrayRep(const _ArrayRep &) {} > virtual ~_ArrayRep(void) {} > > _ArrayRep & operator=(const _ArrayRep &) { return *this; } > > int get_count(void) const { return count; } >private: > int count; > > void ref(void) { count++; } > void unref(void) { if (--count==0) delete this; } >}; > >class _ArrayBase >{ >public: > _ArrayBase(void) : rep(0) {} > _ArrayBase(const _ArrayBase & ab) : rep(0) > { > if (ab.rep) ab.rep->ref(); > rep=ab.rep; > } > _ArrayBase(_ArrayRep * ar) : rep(0) > { > if (ar) ar->ref(); > rep=ar; > } > virtual ~_ArrayBase(void) > { > if (rep) { rep->unref(); rep=0; } > } > > _ArrayRep * get(void) const { return rep; } > _ArrayBase & assign(_ArrayRep * ar) > { > if (ar) ar->ref(); > if (rep) rep->unref(); > rep=ar; > return *this; > } > _ArrayBase & operator=(const _ArrayBase & ab) { return assign(ab.rep); } > bool operator==(const _ArrayBase & ab) { return rep==ab.rep; } >private: > _ArrayRep * rep; >}; > > > > > >class ArrayRep : public _ArrayRep >{ >public: > ArrayRep(int elsize, > void (* xdestroy)(void *, int, int), > void (* xinit1)(void *, int, int), > void (* xinit2)(void *, int, int, const void *, int, int), > void (* xcopy)(void *, int, int, const void *, int, int), > void (* xinsert)(void *, int, int, const void *, int)); > ArrayRep(int elsize, > void (* xdestroy)(void *, int, int), > void (* xinit1)(void *, int, int), > void (* xinit2)(void *, int, int, const void *, int, int), > void (* xcopy)(void *, int, int, const void *, int, int), > void (* xinsert)(void *, int, int, const void *, int), > int hibound); > ArrayRep(int elsize, > void (* xdestroy)(void *, int, int), > void (* xinit1)(void *, int, int), > void (* xinit2)(void *, int, int, const void *, int, int), > void (* xcopy)(void *, int, int, const void *, int, int), > void (* xinsert)(void *, int, int, const void *, int), > int lobound, int hibound); > ArrayRep(const ArrayRep & rep); > > virtual ~ArrayRep(); > > > > int size() const; > int lbound() const; > int hbound() const; > > void empty(); > void touch(int n); > void resize(int lobound, int hibound); > void shift(int disp); > void del(int n, unsigned int howmany=1); > > > > void ins(int n, const void * what, unsigned int howmany); > > ArrayRep & operator=(const ArrayRep & rep); > > > void *data; > int minlo; > int maxhi; > int lobound; > int hibound; > int elsize; >private: > > > > void (* destroy)(void * data, int lo, int hi); > > > void (* init1)(void * data, int lo, int hi); > > > void (* init2)(void * data, int lo, int hi, > const void * src, int src_lo, int src_hi); > > void (* copy)(void * dst, int dst_lo, int dst_hi, > const void * src, int src_lo, int src_hi); > > > void (* insert)(void * data, int els, int where, const void * what, > int howmany); >}; > >inline int >ArrayRep::size() const >{ > return hibound - lobound + 1; >} > >inline int >ArrayRep::lbound() const >{ > return lobound; >} > >inline int >ArrayRep::hbound() const >{ > return hibound; >} > >inline void >ArrayRep::empty() >{ > resize(0, -1); >} > >inline void >ArrayRep::touch(int n) >{ > if (hibound < lobound) > { > resize(n,n); > } else > { > int nlo = lobound; > int nhi = hibound; > if (n < nlo) nlo = n; > if (n > nhi) nhi = n; > resize(nlo, nhi); > } >} ># 305 "../libdjvu/Arrays.h" >class ArrayBase : protected _ArrayBase >{ >protected: > void check(void); > void detach(void); > > ArrayBase(void) {}; >public: > > int size() const; > > int lbound() const; > > int hbound() const; > > > void empty(); ># 337 "../libdjvu/Arrays.h" > void touch(int n); > > > > > > void resize(int hibound); > > > > > > > void resize(int lobound, int hibound); > > > > void shift(int disp); > > > > > > > > void del(int n, unsigned int howmany=1); > > virtual ~ArrayBase(void) {}; >}; > >inline void >ArrayBase::detach(void) >{ > ArrayRep * new_rep=new ArrayRep(*(ArrayRep *) get()); > assign(new_rep); >} > >inline void >ArrayBase::check(void) >{ > if (get()->get_count()>1) detach(); >} > >inline int >ArrayBase::size() const >{ > return ((const ArrayRep *) get())->size(); >} > >inline int >ArrayBase::lbound() const >{ > return ((const ArrayRep *) get())->lobound; >} > >inline int >ArrayBase::hbound() const >{ > return ((const ArrayRep *) get())->hibound; >} > >inline void >ArrayBase::empty() >{ > check(); > ((ArrayRep *) get())->empty(); >} > >inline void >ArrayBase::resize(int lo, int hi) >{ > check(); > ((ArrayRep *) get())->resize(lo, hi); >} > >inline void >ArrayBase::resize(int hi) >{ > resize(0, hi); >} > >inline void >ArrayBase::touch(int n) >{ > check(); > ((ArrayRep *) get())->touch(n); >} > >inline void >ArrayBase::shift(int disp) >{ > check(); > ((ArrayRep *) get())->shift(disp); >} > >inline void >ArrayBase::del(int n, unsigned int howmany) >{ > check(); > > ((ArrayRep *) get())->del(n, howmany); >} ># 448 "../libdjvu/Arrays.h" >template <class TYPE> >class ArrayBaseT : public ArrayBase >{ >public: > virtual ~ArrayBaseT(void) {}; > > > > > > > TYPE& operator[](int n); > > > > > > > const TYPE& operator[](int n) const; > > > > > > > > operator TYPE* (); > > > > > > > operator const TYPE* () const; > > > operator const TYPE* (); ># 494 "../libdjvu/Arrays.h" > void ins(int n, const TYPE &val, unsigned int howmany=1); > > > > > void sort(); ># 508 "../libdjvu/Arrays.h" > void sort(int lo, int hi); >protected: > ArrayBaseT(void) {}; >private: > > static void destroy(void * data, int lo, int hi); > static void init1(void * data, int lo, int hi); > static void init2(void * data, int lo, int hi, > const void * src, int src_lo, int src_hi); > static void copy(void * dst, int dst_lo, int dst_hi, > const void * src, int src_lo, int src_hi); > static void insert(void * data, int els, int where, > const void * what, int howmany); >}; > >template <class TYPE> inline >ArrayBaseT<TYPE>::operator TYPE* () >{ > check(); > > ArrayRep * rep=(ArrayRep *) get(); > return &((TYPE *) rep->data)[-rep->minlo]; >} > > >template <class TYPE> inline >ArrayBaseT<TYPE>::operator const TYPE* () >{ > const ArrayRep * rep=(const ArrayRep *) get(); > return &((const TYPE *) rep->data)[-rep->minlo]; >} > > >template <class TYPE> inline >ArrayBaseT<TYPE>::operator const TYPE* () const >{ > const ArrayRep * rep=(const ArrayRep *) get(); > return &((const TYPE *) rep->data)[-rep->minlo]; >} > >template <class TYPE> inline TYPE& >ArrayBaseT<TYPE>::operator[](int n) >{ > check(); > > ArrayRep * rep=(ArrayRep *) get(); > if (n<rep->lobound || n>rep->hibound) > GExceptionHandler::exthrow (GException("\003" "arrays.ill_sub", "../libdjvu/Arrays.h", 555, __PRETTY_FUNCTION__, GException::GINTERNAL)); > return ((TYPE *) rep->data)[n - rep->minlo]; >} > >template <class TYPE> inline const TYPE& >ArrayBaseT<TYPE>::operator[](int n) const >{ > const ArrayRep * rep=(const ArrayRep *) get(); > if (n<rep->lobound || n>rep->hibound) > GExceptionHandler::exthrow (GException("\003" "arrays.ill_sub", "../libdjvu/Arrays.h", 564, __PRETTY_FUNCTION__, GException::GINTERNAL)); > return ((const TYPE *) rep->data)[n - rep->minlo]; >} > >template <class TYPE> inline void >ArrayBaseT<TYPE>::ins(int n, const TYPE &val, unsigned int howmany) >{ > check(); > > ((ArrayRep *) get())->ins(n, &val, howmany); >} > >template <class TYPE> void >ArrayBaseT<TYPE>::sort() >{ > sort(lbound(), hbound()); >} > >template <class TYPE> void >ArrayBaseT<TYPE>::sort(int lo, int hi) >{ > if (hi <= lo) > return; > > if (hi <= lo + 20) > { > for (int i=lo+1; i<=hi; i++) > { > int j = i; > TYPE tmp = (*this)[i]; > while ((--j>=lo) && !((*this)[j]<=tmp)) > (*this)[j+1] = (*this)[j]; > (*this)[j+1] = tmp; > } > return; > } > > TYPE tmp = (*this)[lo]; > TYPE pivot = (*this)[(lo+hi)/2]; > if (pivot <= tmp) > { tmp = pivot; pivot=(*this)[lo]; } > if ((*this)[hi] <= tmp) > { pivot = tmp; } > else if ((*this)[hi] <= pivot) > { pivot = (*this)[hi]; } > > int h = hi; > int l = lo; > while (l < h) > { > while (! (pivot <= (*this)[l])) l++; > while (! ((*this)[h] <= pivot)) h--; > if (l < h) > { > tmp = (*this)[l]; > (*this)[l] = (*this)[h]; > (*this)[h] = tmp; > l = l+1; > h = h-1; > } > } > > sort(lo, h); > sort(l, hi); >} ># 643 "../libdjvu/Arrays.h" >template <class TYPE> >class TArray : public ArrayBaseT<TYPE> { >public: > > > > TArray(); > > > > > TArray(int hibound); > > > > > > TArray(int lobound, int hibound); > > virtual ~TArray() {}; >private: > > static void destroy(void * data, int lo, int hi); > static void init1(void * data, int lo, int hi); > static void init2(void * data, int lo, int hi, > const void * src, int src_lo, int src_hi); > static void insert(void * data, int els, int where, > const void * what, int howmany); >}; > >template <class TYPE> void >TArray<TYPE>::destroy(void * data, int lo, int hi) >{ >} > >template <class TYPE> void >TArray<TYPE>::init1(void * data, int lo, int hi) >{ >} > >template <class TYPE> void >TArray<TYPE>::init2(void * data, int lo, int hi, > const void * src, int src_lo, int src_hi) >{ > if (data && src) > { > int els=hi-lo+1; > if (els>src_hi-src_lo+1) els=src_hi-src_lo+1; > if (els>0) > memmove((void *) &((TYPE *) data)[lo], > (void *) &((TYPE *) src)[src_lo], els*sizeof(TYPE)); > }; >} > > >template <class TYPE> void >TArray<TYPE>::insert(void * data, int els, int where, > const void * what, int howmany) >{ > memmove(((TYPE *) data)+where+howmany, > ((TYPE *) data)+where, sizeof(TYPE)*(els-where)); > for(int i=0;i<howmany;i++) > ((TYPE *) data)[where+i]=*(TYPE *) what; >} > >template <class TYPE> >TArray<TYPE>::TArray () >{ > this->assign(new ArrayRep(sizeof(TYPE), destroy, init1, > init2, init2, insert)); >} > >template <class TYPE> >TArray<TYPE>::TArray(int hi) >{ > this->assign(new ArrayRep(sizeof(TYPE), destroy, init1, > init2, init2, insert, hi)); >} > >template <class TYPE> >TArray<TYPE>::TArray(int lo, int hi) >{ > this->assign(new ArrayRep(sizeof(TYPE), destroy, init1, > init2, init2, insert, lo, hi)); >} ># 757 "../libdjvu/Arrays.h" >template <class TYPE> >class DArray : public ArrayBaseT<TYPE> { >public: > > > > DArray(void); > > > > > DArray(const int hibound); > > > > > > DArray(const int lobound, const int hibound); > > virtual ~DArray() {}; >private: > > static void destroy(void * data, int lo, int hi); > static void init1(void * data, int lo, int hi); > static void init2(void * data, int lo, int hi, > const void * src, int src_lo, int src_hi); > static void copy(void * dst, int dst_lo, int dst_hi, > const void * src, int src_lo, int src_hi); > static void insert(void * data, int els, int where, > const void * what, int howmany); >}; > >template <class TYPE> void >DArray<TYPE>::destroy(void * data, int lo, int hi) >{ > if (data) > for(int i=lo;i<=hi;i++) > ((TYPE *) data)[i].TYPE::~TYPE(); >} > >template <class TYPE> void >DArray<TYPE>::init1(void * data, int lo, int hi) >{ > if (data) > for(int i=lo;i<=hi;i++) > new ((void *) &((TYPE *) data)[i]) TYPE; >} > >template <class TYPE> void >DArray<TYPE>::init2(void * data, int lo, int hi, > const void * src, int src_lo, int src_hi) >{ > if (data && src) > { > int i, j; > for(i=lo, j=src_lo;i<=hi && j<=src_hi;i++, j++) > new ((void *) &((TYPE *) data)[i]) TYPE(((TYPE *) src)[j]); > }; >} > >template <class TYPE> void >DArray<TYPE>::copy(void * dst, int dst_lo, int dst_hi, > const void * src, int src_lo, int src_hi) >{ > if (dst && src) > { > int i, j; > for(i=dst_lo, j=src_lo;i<=dst_hi && j<=src_hi;i++, j++) > ((TYPE *) dst)[i]=((TYPE *) src)[j]; > }; >} > >template <class TYPE> inline void >DArray<TYPE>::insert(void * data, int els, int where, > const void * what, int howmany) >{ > > TYPE * d=(TYPE *) data; > > int i; > for (i=els+howmany-1; i>=els; i--) > { > if (i-where >= (int)howmany) > new ((void*) &d[i]) TYPE (d[i-howmany]); > else > new ((void*) &d[i]) TYPE (*(TYPE *) what); > } > > for (i=els-1; i>=where; i--) > { > if (i-where >= (int)howmany) > d[i] = d[i-howmany]; > else > d[i] = *(TYPE *) what; > } >} > >template <class TYPE> inline >DArray<TYPE>::DArray () >{ > this->assign(new ArrayRep(sizeof(TYPE), destroy, init1, > init2, copy, insert)); >} > >template <class TYPE> inline >DArray<TYPE>::DArray(const int hi) >{ > this->assign(new ArrayRep(sizeof(TYPE), destroy, init1, > init2, copy, insert, hi)); >} > >template <class TYPE> inline >DArray<TYPE>::DArray(const int lo, const int hi) >{ > this->assign(new ArrayRep(sizeof(TYPE), destroy, init1, > init2, copy, insert, lo, hi)); >} ># 892 "../libdjvu/Arrays.h" >template <class TYPE> >class DPArray : public DArray<GPBase> { >public: > > DPArray(); > DPArray(int hibound); > DPArray(int lobound, int hibound); > DPArray(const DPArray<TYPE> &gc); > > virtual ~DPArray(); > > GP<TYPE>& operator[](int n); > const GP<TYPE>& operator[](int n) const; > > operator GP<TYPE>* (); > > > operator const GP<TYPE>* (); > > > operator const GP<TYPE>* () const; > > void ins(int n, const GP<TYPE> &val, unsigned int howmany=1); > DPArray<TYPE>& operator= (const DPArray &ga); >}; > >template<class TYPE> >DPArray<TYPE>::DPArray() {} > >template<class TYPE> >DPArray<TYPE>::DPArray(int hibound) : > DArray<GPBase>(hibound) {} > >template<class TYPE> >DPArray<TYPE>::DPArray(int lobound, int hibound) : > DArray<GPBase>(lobound, hibound) {} > >template<class TYPE> >DPArray<TYPE>::DPArray(const DPArray<TYPE> &gc) : > DArray<GPBase>(gc) {} > >template<class TYPE> >DPArray<TYPE>::~DPArray() {} > >template<class TYPE> >inline GP<TYPE> & >DPArray<TYPE>::operator[](int n) >{ > return (GP<TYPE> &) DArray<GPBase>::operator[](n); >} > >template<class TYPE> >inline const GP<TYPE> & >DPArray<TYPE>::operator[](int n) const >{ > return (const GP<TYPE> &) DArray<GPBase>::operator[](n); >} > >template<class TYPE> >inline DPArray<TYPE>::operator GP<TYPE>* () >{ > return (GP<TYPE> *) DArray<GPBase>::operator GPBase*(); >} > > >template<class TYPE> >inline DPArray<TYPE>::operator const GP<TYPE>* () >{ > return (const GP<TYPE> *) DArray<GPBase>::operator const GPBase*(); >} > > >template<class TYPE> >inline DPArray<TYPE>::operator const GP<TYPE>* () const >{ > return (const GP<TYPE> *) DArray<GPBase>::operator const GPBase*(); >} > >template<class TYPE> >inline void >DPArray<TYPE>::ins(int n, const GP<TYPE> & val, unsigned int howmany) >{ > DArray<GPBase>::ins(n, val, howmany); >} > >template<class TYPE> >inline DPArray<TYPE> & >DPArray<TYPE>::operator= (const DPArray &ga) >{ > DArray<GPBase>::operator=(ga); > return *this; >} > > > > > > > >} > >using namespace DJVU; ># 69 "../libdjvu/GURL.h" 2 > > > > >namespace DJVU { ># 117 "../libdjvu/GURL.h" >class GURL >{ >public: > class Filename; > class UTF8; > class Native; >protected: > > > > > > > > GURL(const char * url_string); > > >public: > GURL(void); > > GURL(const GUTF8String & url_string); > > GURL(const GNativeString & url_string); > > GURL(const GUTF8String &xurl, const GURL &codebase); > > GURL(const GNativeString &xurl, const GURL &codebase); > > > GURL(const GURL & gurl); > > > virtual ~GURL(void) {} > >private: > > > GCriticalSection class_lock; >protected: > GUTF8String url; > DArray<GUTF8String> cgi_name_arr, cgi_value_arr; > bool validurl; > > void init(const bool nothrow=false); > void convert_slashes(void); > void beautify_path(void); > static GUTF8String beautify_path(GUTF8String url); > > static GUTF8String protocol(const GUTF8String& url); > void parse_cgi_args(void); > void store_cgi_args(void); >public: > > bool is_valid(void) const; > > > GUTF8String protocol(void) const; > > > > GUTF8String hash_argument(void) const; > > > > > void set_hash_argument(const GUTF8String &arg); > > > > int cgi_arguments(void) const; > > > > int djvu_cgi_arguments(void) const; > > > > GUTF8String cgi_name(int num) const; > > > > GUTF8String djvu_cgi_name(int num) const; > > > > GUTF8String cgi_value(int num) const; > > > > GUTF8String djvu_cgi_value(int num) const; > > > > DArray<GUTF8String>cgi_names(void) const; > > > > DArray<GUTF8String>djvu_cgi_names(void) const; > > > > DArray<GUTF8String>cgi_values(void) const; > > > > DArray<GUTF8String>djvu_cgi_values(void) const; > > > void clear_all_arguments(void); > > > void clear_hash_argument(void); > > > void clear_djvu_cgi_arguments(void); > > > void clear_cgi_arguments(void); > > > > void add_djvu_cgi_argument(const GUTF8String &name, const char * value=0); > > > > > GURL base(void) const; > > > GUTF8String pathname(void) const; > > > > > > GUTF8String name(void) const; > > > > > > GUTF8String fname(void) const; > > > GUTF8String extension(void) const; > > > bool is_empty(void) const; > > > bool is_local_file_url(void) const; ># 281 "../libdjvu/GURL.h" > bool GURL::operator==(const GURL & gurl2) const; > > > bool GURL::operator!=(const GURL & gurl2) const; > > > GURL & operator=(const GURL & url); > > > operator const char*(void) const { return url; }; > > > > > > > > GUTF8String get_string(const GUTF8String &useragent) const; > > GUTF8String get_string(const bool nothrow=false) const; > > > static GUTF8String encode_reserved(const GUTF8String &gs); > > > > static GUTF8String decode_reserved(const GUTF8String &url); > > > bool is_local_path(void) const; > > > bool is_file(void) const; > > > bool is_dir(void) const; > > > GURL follow_symlinks(void) const; > > > int mkdir(void) const; > > > > > int deletefile(void) const; > > > > int cleardir(const int timeout=0) const; > > > int renameto(const GURL &newurl) const; > > > GList<GURL> listdir(void) const; ># 353 "../libdjvu/GURL.h" > GUTF8String UTF8Filename(void) const; > > GNativeString NativeFilename(void) const; > > > > friend unsigned int hash(const GURL & gurl); ># 368 "../libdjvu/GURL.h" > static GUTF8String expand_name(const GUTF8String &filename, const char *fromdirname=0); >}; > >class GURL::UTF8 : public GURL >{ >public: > UTF8(const GUTF8String &xurl); > UTF8(const GUTF8String &xurl, const GURL &codebase); >}; > >class GURL::Native : public GURL >{ >public: > Native(const GNativeString &xurl); > Native(const GNativeString &xurl, const GURL &codebase); >}; > >class GURL::Filename : public GURL >{ >public: > Filename(const GUTF8String &filename); > Filename(const GNativeString &filename); > class UTF8; > class Native; >}; > >class GURL::Filename::UTF8 : public GURL::Filename >{ >public: > UTF8(const GUTF8String &filename); >}; > >class GURL::Filename::Native : public GURL::Filename >{ >public: > Native(const GNativeString &filename); >}; > > >inline bool >GURL::operator!=(const GURL & gurl2) const >{ > return !(*this == gurl2); >} > >inline GUTF8String >GURL::protocol(void) const >{ > return protocol(get_string()); >} > >inline bool >GURL::is_empty(void) const >{ > return !url.length()||!get_string().length(); >} > > > >inline bool >GURL::is_valid(void) const >{ > if(!validurl) > const_cast<GURL *>(this)->init(true); > return validurl; >} > > > > > > > >} > >using namespace DJVU; ># 69 "../libdjvu/DjVuPort.h" 2 > > >namespace DJVU { > > > > > >class DataPool; ># 125 "../libdjvu/DjVuPort.h" >class DjVuPort; >class DjVuPortcaster; >class DjVuFile; ># 141 "../libdjvu/DjVuPort.h" >class DjVuPort : public GPEnabled >{ >public: > DjVuPort(); > virtual ~DjVuPort(); > static void *operator new (size_t sz); > static void operator delete(void *addr); > > > static DjVuPortcaster *get_portcaster(void); > > > > DjVuPort(const DjVuPort & port); > > > > DjVuPort & operator=(const DjVuPort & port); ># 168 "../libdjvu/DjVuPort.h" > virtual bool inherits(const GUTF8String &class_name) const; ># 182 "../libdjvu/DjVuPort.h" > virtual GURL id_to_url(const DjVuPort * source, const GUTF8String &id); > > > > > > virtual GP<DjVuFile> id_to_file(const DjVuPort * source, const GUTF8String &id); ># 198 "../libdjvu/DjVuPort.h" > virtual GP<DataPool> request_data(const DjVuPort * source, const GURL & url); > > > > > virtual bool notify_error(const DjVuPort * source, const GUTF8String &msg); > > > > > virtual bool notify_status(const DjVuPort * source, const GUTF8String &msg); > > > > > > virtual void notify_redisplay(const class DjVuImage * source); > > > > > virtual void notify_relayout(const class DjVuImage * source); > > > virtual void notify_chunk_done(const DjVuPort * source, const GUTF8String &name); ># 235 "../libdjvu/DjVuPort.h" > virtual void notify_file_flags_changed(const class DjVuFile * source, > long set_mask, long clr_mask); ># 245 "../libdjvu/DjVuPort.h" > virtual void notify_doc_flags_changed(const class DjVuDocument * source, > long set_mask, long clr_mask); > > > > > > virtual void notify_decode_progress(const DjVuPort * source, float done); > > > > > > > enum ErrorRecoveryAction {ABORT=0,SKIP_PAGES=1,SKIP_CHUNKS=2,KEEP_ALL=3 }; > >public: > class DjVuPortCorpse; >private: > static GCriticalSection * corpse_lock; > static DjVuPortCorpse * corpse_head, * corpse_tail; > static int corpse_num; >}; ># 276 "../libdjvu/DjVuPort.h" >class DjVuSimplePort : public DjVuPort >{ >public: > > virtual bool inherits(const GUTF8String &class_name) const; > > > > virtual GP<DataPool> request_data(const DjVuPort * source, const GURL & url); > > > virtual bool notify_error(const DjVuPort * source, const GUTF8String &msg); > > > virtual bool notify_status(const DjVuPort * source, const GUTF8String &msg); >}; ># 301 "../libdjvu/DjVuPort.h" >class DjVuMemoryPort : public DjVuPort >{ >public: > > virtual bool inherits(const GUTF8String &class_name) const; > > > > > virtual GP<DataPool> request_data(const DjVuPort * source, const GURL & url); > > > > > void add_data(const GURL & url, const GP<DataPool> & pool); >private: > GCriticalSection lock; > GPMap<GURL, DataPool>map; >}; ># 356 "../libdjvu/DjVuPort.h" >class DjVuPortcaster >{ >public: > > static DjVuPortcaster *get_portcaster(void) > { return DjVuPort::get_portcaster(); } ; > > > DjVuPortcaster(void); > > virtual ~DjVuPortcaster(void); > > > > > void del_port(const DjVuPort * port); > > > > > > void add_route(const DjVuPort *src, DjVuPort *dst); > > > > void del_route(const DjVuPort *src, DjVuPort *dst); > > > > > void copy_routes(DjVuPort *dst, const DjVuPort *src); > > > > GP<DjVuPort> is_port_alive(DjVuPort *port); ># 399 "../libdjvu/DjVuPort.h" > void add_alias(const DjVuPort * port, const GUTF8String &alias); > > > static void clear_all_aliases(void); > > > void clear_aliases(const DjVuPort * port); > > > > > GP<DjVuPort> alias_to_port(const GUTF8String &name); > > > > > GPList<DjVuPort> prefix_to_ports(const GUTF8String &prefix); > > > > > virtual GURL id_to_url(const DjVuPort * source, const GUTF8String &id); > > > > > > virtual GP<DjVuFile> id_to_file(const DjVuPort * source, const GUTF8String &id); > > > > > virtual GP<DataPool> request_data(const DjVuPort * source, const GURL & url); > > > > > virtual bool notify_error(const DjVuPort * source, const GUTF8String &msg); > > > > > virtual bool notify_status(const DjVuPort * source, const GUTF8String &msg); > > > > > virtual void notify_redisplay(const class DjVuImage * source); > > > > > virtual void notify_relayout(const class DjVuImage * source); > > > > > virtual void notify_chunk_done(const DjVuPort * source, const GUTF8String &name); > > > > > virtual void notify_file_flags_changed(const class DjVuFile * source, > long set_mask, long clr_mask); > > > > > virtual void notify_doc_flags_changed(const class DjVuDocument * source, > long set_mask, long clr_mask); > > > > > virtual void notify_decode_progress(const DjVuPort * source, float done); > >private: > > friend class DjVuPort; > GCriticalSection map_lock; > GMap<const void *, void *> route_map; > GMap<const void *, void *> cont_map; > GMap<GUTF8String, const void *> a2p_map; > void add_to_closure(GMap<const void*, void*> & set, > const DjVuPort *dst, int distance); > void compute_closure(const DjVuPort *src, GPList<DjVuPort> &list, > bool sorted=false); >}; > > >inline bool >DjVuPort::inherits(const GUTF8String &class_name) const >{ > return (class_name == "DjVuPort"); >} > >inline bool >DjVuSimplePort::inherits(const GUTF8String &class_name) const >{ > return > (class_name == "DjVuSimplePort") || DjVuPort::inherits(class_name); >} > >inline bool >DjVuMemoryPort::inherits(const GUTF8String &class_name) const >{ > return > (class_name == "DjVuMemoryPort") || DjVuPort::inherits(class_name); >} > > > > > >} > >using namespace DJVU; ># 68 "../libdjvu/DjVuDocument.h" 2 > > >namespace DJVU { > > > > > >class DjVmDoc; >class DjVmDir; >class DjVmDir0; >class DjVmNav; >class DjVuImage; >class DjVuFile; >class DjVuFileCache; >class DjVuNavDir; >class ByteStream; ># 214 "../libdjvu/DjVuDocument.h" >class DjVuDocument : public DjVuPort >{ >public: ># 229 "../libdjvu/DjVuDocument.h" > enum DOC_FLAGS { DOC_TYPE_KNOWN=1, DOC_DIR_KNOWN=2, > DOC_NDIR_KNOWN=4, DOC_INIT_OK=8, > DOC_INIT_FAILED=16 }; ># 250 "../libdjvu/DjVuDocument.h" > enum DOC_TYPE { OLD_BUNDLED=1, OLD_INDEXED, BUNDLED, INDIRECT, > SINGLE_PAGE, UNKNOWN_TYPE }; > enum THREAD_FLAGS { STARTED=1, FINISHED=2 }; > >protected: > > > > DjVuDocument(void); >public: > > > virtual ~DjVuDocument(void); ># 339 "../libdjvu/DjVuDocument.h" > void start_init(const GURL & url, GP<DjVuPort> port=0, > DjVuFileCache * cache=0); > > > static GP<DjVuDocument> create_noinit(void) {return new DjVuDocument;} > > > static GP<DjVuDocument> create_wait( > const GURL &url, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0); > > > static GP<DjVuDocument> create( > const GURL &url, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0); > > > static GP<DjVuDocument> create( > GP<DataPool> pool, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0); > > > static GP<DjVuDocument> create( > const GP<ByteStream> &bs, GP<DjVuPort> xport=0, > DjVuFileCache * const xcache=0); > > > > > > > void stop_init(void); ># 377 "../libdjvu/DjVuDocument.h" > void init(const GURL & url, GP<DjVuPort> port=0, > DjVuFileCache * cache=0); ># 397 "../libdjvu/DjVuDocument.h" > bool is_init_complete(void) const; > > > > > > bool is_init_ok(void) const; > > void set_needs_compression(void); > > bool needs_compression(void) const; > > bool needs_rename(void) const; > > bool can_compress(void) const; > > > > > > bool is_init_failed(void) const; ># 431 "../libdjvu/DjVuDocument.h" > int get_doc_type(void) const; ># 443 "../libdjvu/DjVuDocument.h" > long get_doc_flags(void) const; > > > > bool is_bundled(void) const; > > > GURL get_init_url(void) const; > > > GList<GUTF8String> get_id_list(void); > > > void map_ids( GMap<GUTF8String,void *> &map); ># 465 "../libdjvu/DjVuDocument.h" > GP<DataPool> get_init_data_pool(void) const; > > > > > > > > int get_pages_num(void) const; ># 498 "../libdjvu/DjVuDocument.h" > GURL page_to_url(int page_num) const; > > GUTF8String page_to_id(int page_num) const > { return url_to_id(page_to_url(page_num)); } ># 513 "../libdjvu/DjVuDocument.h" > int url_to_page(const GURL & url) const; > > GUTF8String url_to_id(const GURL &url) const > { return url.fname(); } ># 555 "../libdjvu/DjVuDocument.h" > GURL id_to_url(const GUTF8String &id) const; > > int id_to_page(const GUTF8String &id) const > { return url_to_page(id_to_url(id)); } ># 605 "../libdjvu/DjVuDocument.h" > GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=0) const; > GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=0) > { return const_cast<const DjVuDocument *>(this)->get_page(page_num,sync,port); } ># 618 "../libdjvu/DjVuDocument.h" > GP<DjVuImage> get_page(const GUTF8String &id, bool sync=true, DjVuPort * port=0); ># 646 "../libdjvu/DjVuDocument.h" > GP<DjVuFile> get_djvu_file(int page_num, bool dont_create=false) const; > GP<DjVuFile> get_djvu_file(int page_num, bool dont_create=false) > { return const_cast<const DjVuDocument *>(this)->get_djvu_file(page_num,dont_create); } ># 663 "../libdjvu/DjVuDocument.h" > GP<DjVuFile> get_djvu_file(const GUTF8String &id, bool dont_create=false); > GP<DjVuFile> get_djvu_file(const GURL &url, bool dont_create=false); ># 675 "../libdjvu/DjVuDocument.h" > virtual GP<DataPool> get_thumbnail(int page_num, bool dont_decode); > > > > float get_thumbnails_gamma(void) const; ># 694 "../libdjvu/DjVuDocument.h" > bool wait_for_complete_init(void); > > > int wait_get_pages_num(void) const; > > > DjVuFileCache * get_cache(void) const; ># 713 "../libdjvu/DjVuDocument.h" > GP<DjVmDoc> get_djvm_doc(void); ># 724 "../libdjvu/DjVuDocument.h" > virtual void write(const GP<ByteStream> &str, bool force_djvm=false); > > > virtual void write(const GP<ByteStream> &str, > const GMap<GUTF8String,void *> &reserved); ># 746 "../libdjvu/DjVuDocument.h" > void expand(const GURL &codebase, const GUTF8String &idx_name); ># 758 "../libdjvu/DjVuDocument.h" > virtual void save_as(const GURL &where, const bool bundled=0); ># 769 "../libdjvu/DjVuDocument.h" > GP<DjVmDir> get_djvm_dir(void) const; > > > > > > > > GP<DjVmNav> get_djvm_nav(void) const; > > > > > > > > GP<DjVmDir0> get_djvm_dir0(void) const; > > > > > GP<DjVuNavDir> get_nav_dir(void) const; > > > void writeDjVuXML(const GP<ByteStream> &gstr_out,int flags) const; > > > virtual bool inherits(const GUTF8String &class_name) const; > > > virtual GURL id_to_url(const DjVuPort * source, const GUTF8String &id); > virtual GP<DjVuFile> id_to_file(const DjVuPort * source, const GUTF8String &id); > virtual GP<DataPool> request_data(const DjVuPort * source, const GURL & url); > virtual void notify_file_flags_changed(const DjVuFile * source, > long set_mask, long clr_mask); > > virtual GList<GURL> get_url_names(void); > virtual void set_recover_errors(ErrorRecoveryAction=ABORT); > virtual void set_verbose_eof(bool=true); > > static void set_compress_codec( > void (*codec)(GP<ByteStream> &, const GURL &where, bool bundled)); > > static void set_import_codec( > void (*codec)(GP<DataPool> &,const GURL &url,bool &, bool &)); > >protected: > static void (*djvu_import_codec) ( > GP<DataPool> &pool, const GURL &url,bool &needs_compression, bool &needs_rename ); > static void (*djvu_compress_codec) ( > GP<ByteStream> &bs, const GURL &where, bool bundled); > virtual GP<DjVuFile> url_to_file(const GURL & url, bool dont_create=false) const; > GURL init_url; > GP<DataPool> init_data_pool; > GP<DjVmDir> djvm_dir; > GP<DjVmNav> djvm_nav; > int doc_type; > bool needs_compression_flag; > bool can_compress_flag; > bool needs_rename_flag; > > > > bool has_url_names; > GCriticalSection url_names_lock; > GList<GURL> url_names; > ErrorRecoveryAction recover_errors; > bool verbose_eof; >public: > class UnnamedFile; > class ThumbReq; >protected: > bool init_started; > GSafeFlags flags; > GSafeFlags init_thread_flags; > DjVuFileCache * cache; > GP<DjVuSimplePort> simple_port; > > GP<DjVmDir0> djvm_dir0; > GP<DjVuNavDir> ndir; > GUTF8String first_page_name; > > > > > > GP<DjVuFile> ndir_file; > > GPList<UnnamedFile> ufiles_list; > GCriticalSection ufiles_lock; > > GPList<ThumbReq> threqs_list; > GCriticalSection threqs_lock; > > GP<DjVuDocument> init_life_saver; > > static const float thumb_gamma; > > > > GThread init_thr; > static void static_init_thread(void *); > void init_thread(void); > > void check() const; > > void process_threqs(void); > GP<ThumbReq> add_thumb_req(const GP<ThumbReq> & thumb_req); > > void add_to_cache(const GP<DjVuFile> & f); > void check_unnamed_files(void); > GUTF8String get_int_prefix(void) const; > void set_file_aliases(const DjVuFile * file); > GURL invent_url(const GUTF8String &name) const; >}; > >class DjVuDocument::UnnamedFile : public GPEnabled >{ >public: > enum { ID, PAGE_NUM }; > int id_type; > GUTF8String id; > int page_num; > GURL url; > GP<DjVuFile> file; > GP<DataPool> data_pool; >protected: > UnnamedFile(int xid_type, const GUTF8String &xid, int xpage_num, const GURL & xurl, > const GP<DjVuFile> & xfile) : > id_type(xid_type), id(xid), page_num(xpage_num), url(xurl), file(xfile) {} > friend class DjVuDocument; >}; > >class DjVuDocument::ThumbReq : public GPEnabled >{ >public: > int page_num; > GP<DataPool> data_pool; > > > GP<DjVuFile> image_file; > > int thumb_chunk; > GP<DjVuFile> thumb_file; >protected: > ThumbReq(int xpage_num, const GP<DataPool> & xdata_pool) : > page_num(xpage_num), data_pool(xdata_pool) {} > friend class DjVuDocument; >}; > >inline void >DjVuDocument::init(const GURL &url, GP<DjVuPort> port, DjVuFileCache *cache) >{ > start_init(url,port,cache); > wait_for_complete_init(); >} > >inline GP<DjVuDocument> >DjVuDocument::create( > const GURL &url, GP<DjVuPort> xport, DjVuFileCache * const xcache) >{ > DjVuDocument *doc=new DjVuDocument; > GP<DjVuDocument> retval=doc; > doc->start_init(url,xport,xcache); > return retval; >} > >inline bool >DjVuDocument::is_init_complete(void) const >{ > return (flags & (DOC_INIT_OK | DOC_INIT_FAILED))!=0; >} > >inline bool >DjVuDocument::is_init_ok(void) const >{ > return (flags & DOC_INIT_OK)!=0; >} > >inline void >DjVuDocument::set_needs_compression(void) >{ > needs_compression_flag=true; >} > >inline bool >DjVuDocument::needs_compression(void) const >{ > return needs_compression_flag; >} > >inline bool >DjVuDocument::needs_rename(void) const >{ > return needs_rename_flag; >} > >inline bool >DjVuDocument::can_compress(void) const >{ > return can_compress_flag; >} > >inline bool >DjVuDocument::is_init_failed(void) const >{ > return (flags & DOC_INIT_FAILED)!=0; >} > >inline int >DjVuDocument::get_doc_type(void) const { return doc_type; } > >inline long >DjVuDocument::get_doc_flags(void) const { return flags; } > >inline bool >DjVuDocument::is_bundled(void) const >{ > return doc_type==BUNDLED || doc_type==OLD_BUNDLED; >} > >inline GURL >DjVuDocument::get_init_url(void) const { return init_url; } > >inline GP<DataPool> >DjVuDocument::get_init_data_pool(void) const { return init_data_pool; } > >inline bool >DjVuDocument::inherits(const GUTF8String &class_name) const >{ > return > (GUTF8String("DjVuDocument") == class_name) || > DjVuPort::inherits(class_name); > > >} > >inline float >DjVuDocument::get_thumbnails_gamma(void) const >{ > return thumb_gamma; >} > >inline DjVuFileCache * >DjVuDocument::get_cache(void) const >{ > return cache; >} > >inline GP<DjVmDir> >DjVuDocument::get_djvm_dir(void) const >{ > if (doc_type==SINGLE_PAGE) > GExceptionHandler::exthrow (GException("\003" "DjVuDocument.no_dir", "../libdjvu/DjVuDocument.h", 1022, __PRETTY_FUNCTION__, GException::GINTERNAL)); > if (doc_type!=BUNDLED && doc_type!=INDIRECT) > GExceptionHandler::exthrow (GException("\003" "DjVuDocument.obsolete", "../libdjvu/DjVuDocument.h", 1024, __PRETTY_FUNCTION__, GException::GINTERNAL)); > return djvm_dir; >} > >inline GP<DjVmNav> >DjVuDocument::get_djvm_nav(void) const >{ > if (doc_type==BUNDLED || doc_type==INDIRECT) > return djvm_nav; > return 0; >} > >inline GP<DjVmDir0> >DjVuDocument::get_djvm_dir0(void) const >{ > if (doc_type!=OLD_BUNDLED) > GExceptionHandler::exthrow (GException("\003" "DjVuDocument.old_bundle", "../libdjvu/DjVuDocument.h", 1040, __PRETTY_FUNCTION__, GException::GINTERNAL)); > return djvm_dir0; >} > >inline GP<DjVuNavDir> >DjVuDocument::get_nav_dir(void) const >{ > return ndir; >} > >inline void >DjVuDocument::set_recover_errors(ErrorRecoveryAction recover) >{ > recover_errors=recover; >} > >inline void >DjVuDocument::set_verbose_eof(bool verbose) >{ > verbose_eof=verbose; >} > > > > > >} > >using namespace DJVU; ># 65 "djvuserve.cpp" 2 ># 1 "../libdjvu/DjVmDir.h" 1 ># 123 "../libdjvu/DjVmDir.h" >namespace DJVU { > > > > > >class ByteStream; ># 152 "../libdjvu/DjVmDir.h" >class DjVmDir : public GPEnabled >{ >protected: > > > DjVmDir(void) { } ; >public: > class File; > > static const int version; > > > > static GP<DjVmDir> create(void) {return new DjVmDir; } ; > > > void decode(const GP<ByteStream> &stream); > > void encode(const GP<ByteStream> &stream, const bool do_rename=false) const; > > void encode(const GP<ByteStream> &stream, const bool bundled, const bool do_rename) const; > > bool is_indirect(void) const; > > bool is_bundled(void) const; > > GP<File> page_to_file(int page_num) const; > > GP<File> name_to_file(const GUTF8String & name) const; > > GP<File> id_to_file(const GUTF8String &id) const; > > GP<File> title_to_file(const GUTF8String &title) const; > > int get_file_pos(const File * f) const; > > int get_page_pos(int page_num) const; > > GPList<File> resolve_duplicates(const bool save_as_bundled); > > GPList<File> get_files_list(void) const; > > int get_files_num(void) const; > > int get_pages_num(void) const; > > > > GP<File> get_shared_anno_file(void) const; > > void set_file_title(const GUTF8String &id, const GUTF8String &title); > > void set_file_name(const GUTF8String &id, const GUTF8String &name); > > > > int insert_file(const GP<File> & file, int pos=-1); > > void delete_file(const GUTF8String &id); >private: > GCriticalSection class_lock; > GPList<File> files_list; > GPArray<File> page2file; > GPMap<GUTF8String, File> name2file; > GPMap<GUTF8String, File> id2file; > GPMap<GUTF8String, File> title2file; >private: > static void decode(ByteStream *); > static void encode(ByteStream *); >}; > >class DjVmDir::File : public GPEnabled >{ >public: ># 244 "../libdjvu/DjVmDir.h" > enum FILE_TYPE { INCLUDE=0, PAGE=1, THUMBNAILS=2, SHARED_ANNO=3 }; >protected: > > File(void); > >public: > static GP<File> create(void) { return new File(); } > static GP<File> create(const GUTF8String &load_name, > const GUTF8String &save_name, const GUTF8String &title, > const FILE_TYPE file_type); > > > > const GUTF8String &check_save_name(const bool as_bundled); ># 266 "../libdjvu/DjVmDir.h" > const GUTF8String &get_save_name(void) const; > > > > > > const GUTF8String &get_load_name(void) const; > void set_load_name(const GUTF8String &id); > > > > > const GUTF8String &get_title() const; > void set_title(const GUTF8String &id); > > > GUTF8String get_str_type(void) const; > > > > > int offset; > > > > > int size; > > > > bool valid_name; > > > bool is_page(void) const > { > return (flags & TYPE_MASK)==PAGE; > } > > > > bool is_include(void) const > { > return (flags & TYPE_MASK)==INCLUDE; > } > > > bool is_thumbnails(void) const > { > return (flags & TYPE_MASK)==THUMBNAILS; > } > > > > bool is_shared_anno(void) const > { return (flags & TYPE_MASK)==SHARED_ANNO; } > > int get_page_num(void) const > { return page_num; } >protected: > GUTF8String name; > GUTF8String oldname; > GUTF8String id; > GUTF8String title; > void set_save_name(const GUTF8String &name); >private: > friend class DjVmDir; > enum FLAGS_0 { IS_PAGE_0=1, HAS_NAME_0=2, HAS_TITLE_0=4 }; > enum FLAGS_1 { HAS_NAME=0x80, HAS_TITLE=0x40, TYPE_MASK=0x3f }; > unsigned char flags; > int page_num; >}; > >inline const GUTF8String & >DjVmDir::File::get_load_name(void) const >{ return id; } > >inline const GUTF8String & >DjVmDir::File::get_title() const >{ return *(title.length()?&title:&id); } > >inline void >DjVmDir::File::set_title(const GUTF8String &xtitle) { title=xtitle; } ># 427 "../libdjvu/DjVmDir.h" >inline bool >DjVmDir::is_bundled(void) const >{ > return ! is_indirect(); >} > >inline bool >DjVmDir::is_indirect(void) const >{ > GCriticalSectionLock lock((GCriticalSection *) &class_lock); > return ( files_list.size() && files_list[files_list] != 0 && > files_list[files_list]->offset==0 ); >} > > > > > > >} > >using namespace DJVU; ># 66 "djvuserve.cpp" 2 ># 1 "../libdjvu/ByteStream.h" 1 ># 105 "../libdjvu/ByteStream.h" ># 1 "/usr/include/stdio.h" 1 3 4 ># 30 "/usr/include/stdio.h" 3 4 >extern "C" { > > > ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 35 "/usr/include/stdio.h" 2 3 4 ># 72 "/usr/include/stdio.h" 3 4 ># 1 "/usr/include/libio.h" 1 3 4 ># 32 "/usr/include/libio.h" 3 4 ># 1 "/usr/include/_G_config.h" 1 3 4 ># 14 "/usr/include/_G_config.h" 3 4 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 15 "/usr/include/_G_config.h" 2 3 4 ># 26 "/usr/include/_G_config.h" 3 4 >typedef struct >{ > __off_t __pos; > __mbstate_t __state; >} _G_fpos_t; >typedef struct >{ > __off64_t __pos; > __mbstate_t __state; >} _G_fpos64_t; ># 44 "/usr/include/_G_config.h" 3 4 ># 1 "/usr/include/gconv.h" 1 3 4 ># 31 "/usr/include/gconv.h" 3 4 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 32 "/usr/include/gconv.h" 2 3 4 > > > > > >enum >{ > __GCONV_OK = 0, > __GCONV_NOCONV, > __GCONV_NODB, > __GCONV_NOMEM, > > __GCONV_EMPTY_INPUT, > __GCONV_FULL_OUTPUT, > __GCONV_ILLEGAL_INPUT, > __GCONV_INCOMPLETE_INPUT, > > __GCONV_ILLEGAL_DESCRIPTOR, > __GCONV_INTERNAL_ERROR >}; > > > >enum >{ > __GCONV_IS_LAST = 0x0001, > __GCONV_IGNORE_ERRORS = 0x0002 >}; > > > >struct __gconv_step; >struct __gconv_step_data; >struct __gconv_loaded_object; >struct __gconv_trans_data; > > > >typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, > __const unsigned char **, __const unsigned char *, > unsigned char **, size_t *, int, int); > > >typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); > > >typedef int (*__gconv_init_fct) (struct __gconv_step *); >typedef void (*__gconv_end_fct) (struct __gconv_step *); > > > >typedef int (*__gconv_trans_fct) (struct __gconv_step *, > struct __gconv_step_data *, void *, > __const unsigned char *, > __const unsigned char **, > __const unsigned char *, unsigned char **, > size_t *); > > >typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, > __const unsigned char *, > unsigned char *, unsigned char *); > > >typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, > size_t *); > > >typedef int (*__gconv_trans_init_fct) (void **, const char *); >typedef void (*__gconv_trans_end_fct) (void *); > >struct __gconv_trans_data >{ > > __gconv_trans_fct __trans_fct; > __gconv_trans_context_fct __trans_context_fct; > __gconv_trans_end_fct __trans_end_fct; > void *__data; > struct __gconv_trans_data *__next; >}; > > > >struct __gconv_step >{ > struct __gconv_loaded_object *__shlib_handle; > __const char *__modname; > > int __counter; > > char *__from_name; > char *__to_name; > > __gconv_fct __fct; > __gconv_btowc_fct __btowc_fct; > __gconv_init_fct __init_fct; > __gconv_end_fct __end_fct; > > > > int __min_needed_from; > int __max_needed_from; > int __min_needed_to; > int __max_needed_to; > > > int __stateful; > > void *__data; >}; > > > >struct __gconv_step_data >{ > unsigned char *__outbuf; > unsigned char *__outbufend; > > > > int __flags; > > > > int __invocation_counter; > > > > int __internal_use; > > __mbstate_t *__statep; > __mbstate_t __state; > > > > struct __gconv_trans_data *__trans; >}; > > > >typedef struct __gconv_info >{ > size_t __nsteps; > struct __gconv_step *__steps; > __extension__ struct __gconv_step_data __data []; >} *__gconv_t; ># 45 "/usr/include/_G_config.h" 2 3 4 >typedef union >{ > struct __gconv_info __cd; > struct > { > struct __gconv_info __cd; > struct __gconv_step_data __data; > } __combined; >} _G_iconv_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__))); ># 33 "/usr/include/libio.h" 2 3 4 ># 166 "/usr/include/libio.h" 3 4 >struct _IO_jump_t; struct _IO_FILE; ># 176 "/usr/include/libio.h" 3 4 >typedef void _IO_lock_t; > > > > > >struct _IO_marker { > struct _IO_marker *_next; > struct _IO_FILE *_sbuf; > > > > int _pos; ># 199 "/usr/include/libio.h" 3 4 >}; > > >enum __codecvt_result >{ > __codecvt_ok, > __codecvt_partial, > __codecvt_error, > __codecvt_noconv >}; ># 267 "/usr/include/libio.h" 3 4 >struct _IO_FILE { > int _flags; > > > > > char* _IO_read_ptr; > char* _IO_read_end; > char* _IO_read_base; > char* _IO_write_base; > char* _IO_write_ptr; > char* _IO_write_end; > char* _IO_buf_base; > char* _IO_buf_end; > > char *_IO_save_base; > char *_IO_backup_base; > char *_IO_save_end; > > struct _IO_marker *_markers; > > struct _IO_FILE *_chain; > > int _fileno; > > > > int _flags2; > > __off_t _old_offset; > > > > unsigned short _cur_column; > signed char _vtable_offset; > char _shortbuf[1]; > > > > _IO_lock_t *_lock; ># 315 "/usr/include/libio.h" 3 4 > __off64_t _offset; > > > > > > void *__pad1; > void *__pad2; > > int _mode; > > char _unused2[15 * sizeof (int) - 2 * sizeof (void *)]; > >}; > > > > > >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_; ># 354 "/usr/include/libio.h" 3 4 >typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); > > > > > > > >typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, > size_t __n); > > > > > > > >typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); > > >typedef int __io_close_fn (void *__cookie); > > > > >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 "C" { > > >extern int __underflow (_IO_FILE *) throw (); >extern int __uflow (_IO_FILE *) throw (); >extern int __overflow (_IO_FILE *, int) throw (); >extern wint_t __wunderflow (_IO_FILE *) throw (); >extern wint_t __wuflow (_IO_FILE *) throw (); >extern wint_t __woverflow (_IO_FILE *, wint_t) throw (); ># 444 "/usr/include/libio.h" 3 4 >extern int _IO_getc (_IO_FILE *__fp) throw (); >extern int _IO_putc (int __c, _IO_FILE *__fp) throw (); >extern int _IO_feof (_IO_FILE *__fp) throw (); >extern int _IO_ferror (_IO_FILE *__fp) throw (); > >extern int _IO_peekc_locked (_IO_FILE *__fp) throw (); > > > > > >extern void _IO_flockfile (_IO_FILE *) throw (); >extern void _IO_funlockfile (_IO_FILE *) throw (); >extern int _IO_ftrylockfile (_IO_FILE *) throw (); ># 474 "/usr/include/libio.h" 3 4 >extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, > __gnuc_va_list, int *__restrict) throw (); >extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, > __gnuc_va_list) throw (); >extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) throw (); >extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) throw (); > >extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) throw (); >extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) throw (); > >extern void _IO_free_backup_area (_IO_FILE *) throw (); ># 532 "/usr/include/libio.h" 3 4 >} ># 73 "/usr/include/stdio.h" 2 3 4 ># 86 "/usr/include/stdio.h" 3 4 > > >typedef _G_fpos_t fpos_t; > > > > > >typedef _G_fpos64_t fpos64_t; ># 138 "/usr/include/stdio.h" 3 4 ># 1 "/usr/include/bits/stdio_lim.h" 1 3 4 ># 139 "/usr/include/stdio.h" 2 3 4 > > > >extern struct _IO_FILE *stdin; >extern struct _IO_FILE *stdout; >extern struct _IO_FILE *stderr; > > > > > > > >extern int remove (__const char *__filename) throw (); > >extern int rename (__const char *__old, __const char *__new) throw (); > > > > > > > > > >extern FILE *tmpfile (void); ># 174 "/usr/include/stdio.h" 3 4 >extern FILE *tmpfile64 (void); > > > >extern char *tmpnam (char *__s) throw (); > > > > > >extern char *tmpnam_r (char *__s) throw (); ># 196 "/usr/include/stdio.h" 3 4 >extern char *tempnam (__const char *__dir, __const char *__pfx) > throw () __attribute__ ((__malloc__)); > > > > > > > > >extern int fclose (FILE *__stream); > > > > >extern int fflush (FILE *__stream); > ># 221 "/usr/include/stdio.h" 3 4 >extern int fflush_unlocked (FILE *__stream); ># 231 "/usr/include/stdio.h" 3 4 >extern int fcloseall (void); > > > > > > > > > >extern FILE *fopen (__const char *__restrict __filename, > __const char *__restrict __modes); > > > > >extern FILE *freopen (__const char *__restrict __filename, > __const char *__restrict __modes, > FILE *__restrict __stream); ># 262 "/usr/include/stdio.h" 3 4 > > >extern FILE *fopen64 (__const char *__restrict __filename, > __const char *__restrict __modes); >extern FILE *freopen64 (__const char *__restrict __filename, > __const char *__restrict __modes, > FILE *__restrict __stream); > > > > >extern FILE *fdopen (int __fd, __const char *__modes) throw (); > > > > > >extern FILE *fopencookie (void *__restrict __magic_cookie, > __const char *__restrict __modes, > _IO_cookie_io_functions_t __io_funcs) throw (); > > >extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) throw (); > > > > >extern FILE *open_memstream (char **__restrict __bufloc, > size_t *__restrict __sizeloc) throw (); > > > > > > >extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw (); > > > >extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, > int __modes, size_t __n) throw (); > > > > > >extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, > size_t __size) throw (); > > >extern void setlinebuf (FILE *__stream) throw (); > > > > > > > > >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, ...) throw (); > > > > > >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) throw (); > > > > > >extern int snprintf (char *__restrict __s, size_t __maxlen, > __const char *__restrict __format, ...) > throw () __attribute__ ((__format__ (__printf__, 3, 4))); > >extern int vsnprintf (char *__restrict __s, size_t __maxlen, > __const char *__restrict __format, __gnuc_va_list __arg) > throw () __attribute__ ((__format__ (__printf__, 3, 0))); > > > > > > >extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f, > __gnuc_va_list __arg) > throw () __attribute__ ((__format__ (__printf__, 2, 0))); >extern int __asprintf (char **__restrict __ptr, > __const char *__restrict __fmt, ...) > throw () __attribute__ ((__format__ (__printf__, 2, 3))); >extern int asprintf (char **__restrict __ptr, > __const char *__restrict __fmt, ...) > throw () __attribute__ ((__format__ (__printf__, 2, 3))); > > > > > > > >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, ...); > > > > >extern int scanf (__const char *__restrict __format, ...); > >extern int sscanf (__const char *__restrict __s, > __const char *__restrict __format, ...) throw (); > > > > > > > > >extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, > __gnuc_va_list __arg) > __attribute__ ((__format__ (__scanf__, 2, 0))); > > > > > >extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) > __attribute__ ((__format__ (__scanf__, 1, 0))); > > >extern int vsscanf (__const char *__restrict __s, > __const char *__restrict __format, __gnuc_va_list __arg) > throw () __attribute__ ((__format__ (__scanf__, 2, 0))); > > > > > > > > > >extern int fgetc (FILE *__stream); >extern int getc (FILE *__stream); > > > > > >extern int getchar (void); > ># 454 "/usr/include/stdio.h" 3 4 >extern int getc_unlocked (FILE *__stream); >extern int getchar_unlocked (void); ># 465 "/usr/include/stdio.h" 3 4 >extern int fgetc_unlocked (FILE *__stream); > > > > > > > > > > > >extern int fputc (int __c, FILE *__stream); >extern int putc (int __c, FILE *__stream); > > > > > >extern int putchar (int __c); > ># 498 "/usr/include/stdio.h" 3 4 >extern int fputc_unlocked (int __c, FILE *__stream); > > > > > > > >extern int putc_unlocked (int __c, FILE *__stream); >extern int putchar_unlocked (int __c); > > > > > > >extern int getw (FILE *__stream); > > >extern int putw (int __w, FILE *__stream); > > > > > > > > >extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream); > > > > > > >extern char *gets (char *__s); > ># 543 "/usr/include/stdio.h" 3 4 >extern char *fgets_unlocked (char *__restrict __s, int __n, > FILE *__restrict __stream); ># 559 "/usr/include/stdio.h" 3 4 >extern __ssize_t __getdelim (char **__restrict __lineptr, > size_t *__restrict __n, int __delimiter, > FILE *__restrict __stream); >extern __ssize_t getdelim (char **__restrict __lineptr, > size_t *__restrict __n, int __delimiter, > FILE *__restrict __stream); > > > > > > > >extern __ssize_t getline (char **__restrict __lineptr, > size_t *__restrict __n, > FILE *__restrict __stream); > > > > > > > > >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); > > > > >extern size_t fwrite (__const void *__restrict __ptr, size_t __size, > size_t __n, FILE *__restrict __s); > ># 620 "/usr/include/stdio.h" 3 4 >extern int fputs_unlocked (__const char *__restrict __s, > FILE *__restrict __stream); ># 631 "/usr/include/stdio.h" 3 4 >extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, > size_t __n, FILE *__restrict __stream); >extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, > size_t __n, FILE *__restrict __stream); > > > > > > > > >extern int fseek (FILE *__stream, long int __off, int __whence); > > > > >extern long int ftell (FILE *__stream); > > > > >extern void rewind (FILE *__stream); > ># 667 "/usr/include/stdio.h" 3 4 >extern int fseeko (FILE *__stream, __off_t __off, int __whence); > > > > >extern __off_t ftello (FILE *__stream); ># 686 "/usr/include/stdio.h" 3 4 > > > > > > >extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); > > > > >extern int fsetpos (FILE *__stream, __const fpos_t *__pos); ># 709 "/usr/include/stdio.h" 3 4 > > > >extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); >extern __off64_t ftello64 (FILE *__stream); >extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); >extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos); > > > > >extern void clearerr (FILE *__stream) throw (); > >extern int feof (FILE *__stream) throw (); > >extern int ferror (FILE *__stream) throw (); > > > > >extern void clearerr_unlocked (FILE *__stream) throw (); >extern int feof_unlocked (FILE *__stream) throw (); >extern int ferror_unlocked (FILE *__stream) throw (); > > > > > > > > >extern void perror (__const char *__s); > > > > > > ># 1 "/usr/include/bits/sys_errlist.h" 1 3 4 ># 27 "/usr/include/bits/sys_errlist.h" 3 4 >extern int sys_nerr; >extern __const char *__const sys_errlist[]; > > >extern int _sys_nerr; >extern __const char *__const _sys_errlist[]; ># 748 "/usr/include/stdio.h" 2 3 4 > > > > >extern int fileno (FILE *__stream) throw (); > > > > >extern int fileno_unlocked (FILE *__stream) throw (); ># 767 "/usr/include/stdio.h" 3 4 >extern FILE *popen (__const char *__command, __const char *__modes); > > > > > >extern int pclose (FILE *__stream); > > > > > >extern char *ctermid (char *__s) throw (); > > > > > >extern char *cuserid (char *__s); > > > > >struct obstack; > > >extern int obstack_printf (struct obstack *__restrict __obstack, > __const char *__restrict __format, ...) > throw () __attribute__ ((__format__ (__printf__, 2, 3))); >extern int obstack_vprintf (struct obstack *__restrict __obstack, > __const char *__restrict __format, > __gnuc_va_list __args) > throw () __attribute__ ((__format__ (__printf__, 2, 0))); > > > > > > > >extern void flockfile (FILE *__stream) throw (); > > > >extern int ftrylockfile (FILE *__stream) throw (); > > >extern void funlockfile (FILE *__stream) throw (); ># 828 "/usr/include/stdio.h" 3 4 ># 1 "/usr/include/bits/stdio.h" 1 3 4 ># 33 "/usr/include/bits/stdio.h" 3 4 >inline int >vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) >{ > return vfprintf (stdout, __fmt, __arg); >} > > >inline int >getchar (void) >{ > return _IO_getc (stdin); >} > > > > >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++); >} > > >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++); >} > > > > >inline int >putchar (int __c) >{ > return _IO_putc (__c, stdout); >} > > > > >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))); >} > > > > > >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))); >} > > >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))); >} > > > > > >inline __ssize_t >getline (char **__lineptr, size_t *__n, FILE *__stream) >{ > return __getdelim (__lineptr, __n, '\n', __stream); >} > > > > > >inline int >feof_unlocked (FILE *__stream) throw () >{ > return (((__stream)->_flags & 0x10) != 0); >} > > >inline int >ferror_unlocked (FILE *__stream) throw () >{ > return (((__stream)->_flags & 0x20) != 0); >} ># 829 "/usr/include/stdio.h" 2 3 4 > > > > > >} ># 106 "../libdjvu/ByteStream.h" 2 > > >namespace DJVU { > > > > > >class GURL; >class GUTF8String; >class GNativeString; ># 129 "../libdjvu/ByteStream.h" >class ByteStream : public GPEnabled >{ >public: > class Stdio; > class Static; > class Memory; > class Wrapper; > enum codepage_type {RAW,AUTO,NATIVE,UTF8} cp; > > > > > >public: > > virtual ~ByteStream(); ># 156 "../libdjvu/ByteStream.h" > virtual size_t read(void *buffer, size_t size); ># 166 "../libdjvu/ByteStream.h" > virtual size_t write(const void *buffer, size_t size); > > > virtual long tell(void) const = 0; ># 192 "../libdjvu/ByteStream.h" > virtual int seek(long offset, int whence = 0, bool nothrow=false); > > > > > virtual void flush(void); > > > > > > >public: > > > > > > > > size_t readall(void *buffer, size_t size); > > > > > > > size_t writall(const void *buffer, size_t size); ># 228 "../libdjvu/ByteStream.h" > size_t copy(ByteStream &bsfrom, size_t size=0); > > > > GP<ByteStream> duplicate(const size_t size=0) const; > > size_t format(const char *fmt, ... ); > > int scanf(const char *fmt, ... ); > > size_t writestring(const GUTF8String &s); > > size_t writestring(const GNativeString &s); > > > void formatmessage( const char *fmt, ... ); > > void ByteStream::writemessage( const char *message ); > > void write8 (unsigned int card8); > > > > void write16(unsigned int card16); > > > > void write24(unsigned int card24); > > > > void write32(unsigned int card32); > > unsigned int read8 (); > > > > unsigned int read16(); > > > > unsigned int read24(); > > > > unsigned int read32(); > > > > virtual int size(void) const; > > TArray<char> get_data(void); > > > > virtual size_t readat(void *buffer, size_t sz, int pos); > > virtual bool is_static(void) const { return false; } > >protected: > ByteStream(void) : cp(AUTO) {}; >private: > > ByteStream(const ByteStream &); > ByteStream & operator=(const ByteStream &); >public: > > > > > > static GP<ByteStream> create(void); > > > > static GP<ByteStream> create(void const * const buffer, const size_t size); ># 313 "../libdjvu/ByteStream.h" > static GP<ByteStream> create( > const GURL &url, char const * const mode); > > static GP<ByteStream> create( char const * const mode); > > > > > > static GP<ByteStream> create( > const int fd, char const * const mode, const bool closeme); > > > > > > static GP<ByteStream> create( > FILE * const f, char const * const mode, const bool closeme); > > > > > > > static GP<ByteStream> create_static( > void const * const buffer, const size_t size); > > > static GP<ByteStream> get_stdin(char const * const mode=0); > static GP<ByteStream> get_stdout(char const * const mode=0); > static GP<ByteStream> get_stderr(char const * const mode=0); > > > static const char *EndOfFile; > > GNativeString getAsNative(void); > > GUTF8String getAsUTF8(void); >}; > >inline size_t >ByteStream::readat(void *buffer, size_t sz, int pos) >{ > size_t retval; > long tpos=tell(); > seek(pos, 0, true); > retval=readall(buffer,sz); > seek(tpos, 0, true); > return retval; >} > >inline int >ByteStream::size(void) const >{ > ByteStream *bs=const_cast<ByteStream *>(this); > int bsize=(-1); > long pos=tell(); > if(bs->seek(0,2,true)) > { > bsize=(int)tell(); > (void)(bs->seek(pos,0,false)); > } > return bsize; >} > > > > >class ByteStream::Wrapper : public ByteStream >{ >protected: > GP<ByteStream> gbs; > ByteStream *bs; > Wrapper(void) : bs(0) {} > Wrapper(const GP<ByteStream> &xbs) : gbs(xbs), bs(xbs) {} >public: > ~Wrapper(); > ByteStream * operator & () const {return bs;} > ByteStream * operator & () {return bs;} > virtual size_t read(void *buffer, size_t size) > { return bs->read(buffer,size); } > virtual size_t write(const void *buffer, size_t size) > { return bs->write(buffer,size); } > virtual long tell(void) const > { return bs->tell(); } > virtual int seek(long offset, int whence = 0, bool nothrow=false) > { return bs->seek(offset,whence,nothrow); } > virtual void flush(void) > { bs->flush(); } >}; > > > > > > > >} > >using namespace DJVU; ># 67 "djvuserve.cpp" 2 ># 1 "../libdjvu/IFFByteStream.h" 1 ># 134 "../libdjvu/IFFByteStream.h" ># 1 "../libdjvu/ByteStream.h" 1 ># 135 "../libdjvu/IFFByteStream.h" 2 > > > >namespace DJVU { ># 181 "../libdjvu/IFFByteStream.h" >class IFFByteStream : protected ByteStream::Wrapper >{ >protected: > IFFByteStream(const GP<ByteStream> &bs, const int pos); >public: > > > > static GP<IFFByteStream> create(const GP<ByteStream> &bs); > > ~IFFByteStream(); > virtual size_t read(void *buffer, size_t size); > virtual size_t write(const void *buffer, size_t size); > virtual long tell(void) const; ># 207 "../libdjvu/IFFByteStream.h" > int get_chunk(GUTF8String &chkid, int *rawoffsetptr=0, int *rawsizeptr=0); ># 216 "../libdjvu/IFFByteStream.h" > void put_chunk(const char *chkid, int insertmagic=0); > > > > > void close_chunk(); > > > void seek_close_chunk(); > > int ready(); > > int composite(); > > > > > > > > void short_id(GUTF8String &chkid); ># 247 "../libdjvu/IFFByteStream.h" > void full_id(GUTF8String &chkid); > > > > > > > static int check_id(const char *id); > GP<ByteStream> get_bytestream(void) {return this;} ># 264 "../libdjvu/IFFByteStream.h" > size_t copy(ByteStream &bsfrom, size_t size=0) > { return get_bytestream()->copy(bsfrom,size); } > > > > > virtual void flush(void) > { ByteStream::Wrapper::flush(); } > > > > > bool compare(IFFByteStream &iff); > > > bool has_magic; >private: > > struct IFFContext > { > IFFContext *next; > long offStart; > long offEnd; > char idOne[4]; > char idTwo[4]; > char bComposite; > }; > > IFFContext *ctx; > long offset; > long seekto; > int dir; > > IFFByteStream(const IFFByteStream &); > IFFByteStream & operator=(const IFFByteStream &); > static GP<IFFByteStream> create(ByteStream *bs); >}; > > > > > > >} > >using namespace DJVU; ># 68 "djvuserve.cpp" 2 ># 1 "../libdjvu/DjVuText.h" 1 ># 89 "../libdjvu/DjVuText.h" ># 1 "../libdjvu/GMapAreas.h" 1 ># 70 "../libdjvu/GMapAreas.h" ># 1 "../libdjvu/GRect.h" 1 ># 84 "../libdjvu/GRect.h" >namespace DJVU { ># 132 "../libdjvu/GRect.h" >class GRect >{ >public: ># 145 "../libdjvu/GRect.h" > enum OrientationBits > { > BOTTOM_UP=0x1, > MIRROR=0x2, > ROTATE90_CW=0x4 > }; ># 165 "../libdjvu/GRect.h" > enum Orientations > { > TDLRNR=0, > BULRNR=BOTTOM_UP, > TDRLNR=MIRROR, > BURLNR=MIRROR|BOTTOM_UP, > TDLRCW=ROTATE90_CW, > BULRCW=ROTATE90_CW|BOTTOM_UP, > TDRLCW=ROTATE90_CW|MIRROR, > BURLCW=ROTATE90_CW|MIRROR|BOTTOM_UP > }; > > static Orientations > rotate(const int angle,Orientations orientation) > { > for(int a=(((angle)%360)+405)%360;a>90;a-=90) > orientation=(Orientations)((int)orientation^(int)(orientation&ROTATE90_CW)?BURLCW:TDLRCW); > return orientation; > } > > static int > findangle(const Orientations orientation) > { > int a=270; > while(a&&(rotate(a,BURLNR)!=orientation)&&(rotate(a,TDRLNR)!=orientation)) > a-=90; > return a; > } > > > GRect(); > > > > GRect(int xmin, int ymin, unsigned int width=0, unsigned int height=0); > > int width() const; > > int height() const; > > int area() const; > > int isempty() const; > > > > > int contains(int x, int y) const; > > > > int contains(const GRect & rect) const; > > friend int operator==(const GRect & r1, const GRect & r2); > > friend int operator!=(const GRect & r1, const GRect & r2); > > void clear(); > > > > > int inflate(int dx, int dy); > > > > int translate(int dx, int dy); > > > int intersect(const GRect &rect1, const GRect &rect2); > > > > int recthull(const GRect &rect1, const GRect &rect2); > > void scale(float factor); > > void scale(float xfactor, float yfactor); > > int xmin; > > int ymin; > > int xmax; > > int ymax; >}; ># 263 "../libdjvu/GRect.h" >class GRectMapper >{ >public: > > GRectMapper(); > > > void clear(); > > void set_input(const GRect &rect); > > GRect get_input(); > > void set_output(const GRect &rect); > > GRect get_output(); > > > > > void rotate(int count=1); > > > > > void mirrorx(); > > > > > void mirrory(); > > > > > > > void map(int &x, int &y); > > > > > void map(GRect &rect); > > > > > > > void unmap(int &x, int &y); > > > > > void unmap(GRect &rect); >private: > > struct GRatio { > GRatio (); > GRatio (int p, int q); > int p; > int q; > }; > > GRect rectFrom; > GRect rectTo; > int code; > > void precalc(); > friend int operator*(int n, GRatio r ); > friend int operator/(int n, GRatio r ); > GRatio rw; > GRatio rh; >}; ># 345 "../libdjvu/GRect.h" >inline >GRect::GRect() >: xmin(0), ymin(0), xmax(0), ymax(0) >{ >} > >inline >GRect::GRect(int xmin, int ymin, unsigned int width, unsigned int height) >: xmin(xmin), ymin(ymin), xmax(xmin+width), ymax(ymin+height) >{ >} > >inline int >GRect::width() const >{ > return xmax - xmin; >} > >inline int >GRect::height() const >{ > return ymax - ymin; >} > >inline int >GRect::isempty() const >{ > return (xmin>=xmax || ymin>=ymax); >} > >inline int >GRect::area() const >{ > return isempty() ? 0 : (xmax-xmin)*(ymax-ymin); >} > >inline int >GRect::contains(int x, int y) const >{ > return (x>=xmin && x<xmax && y>=ymin && y<ymax); >} > >inline void >GRect::clear() >{ > xmin = xmax = ymin = ymax = 0; >} > >inline int >operator!=(const GRect & r1, const GRect & r2) >{ > return !(r1==r2); >} > > > > >} > >using namespace DJVU; ># 71 "../libdjvu/GMapAreas.h" 2 > > > >namespace DJVU { ># 135 "../libdjvu/GMapAreas.h" >class GMapArea : public GPEnabled >{ >protected: > GMapArea(void); >public: > > > > > virtual ~GMapArea(); > > static const char MAPAREA_TAG []; > static const char RECT_TAG []; > static const char POLY_TAG []; > static const char OVAL_TAG []; > static const char NO_BORDER_TAG []; > static const char XOR_BORDER_TAG []; > static const char SOLID_BORDER_TAG []; > static const char SHADOW_IN_BORDER_TAG []; > static const char SHADOW_OUT_BORDER_TAG []; > static const char SHADOW_EIN_BORDER_TAG []; > static const char SHADOW_EOUT_BORDER_TAG []; > static const char BORDER_AVIS_TAG []; > static const char HILITE_TAG []; > static const char URL_TAG []; > static const char TARGET_SELF []; > > enum BorderType { NO_BORDER=0, XOR_BORDER=1, SOLID_BORDER=2, > SHADOW_IN_BORDER=3, SHADOW_OUT_BORDER=4, > SHADOW_EIN_BORDER=5, SHADOW_EOUT_BORDER=6 }; > > enum Special_Hilite_Color{ NO_HILITE=0xFFFFFFFF, XOR_HILITE=0xFF000000}; > > > > enum MapAreaType { UNKNOWN, RECT, OVAL, POLY }; > > > > > > > GUTF8String url; > > > > > > > GUTF8String target; > > > GUTF8String comment; ># 201 "../libdjvu/GMapAreas.h" > BorderType border_type; > > > bool border_always_visible; > > unsigned long int border_color; > > int border_width; > > > > > unsigned long int hilite_color; > > > bool is_point_inside(int x, int y) const; > > > int get_xmin(void) const; > > int get_ymin(void) const; > > > > int get_xmax(void) const; > > > > int get_ymax(void) const; > > GRect get_bound_rect(void) const; > > > void move(int dx, int dy); > > > void resize(int new_width, int new_height); > > void transform(const GRect & grect); > > > > char const * const check_object(void); > > > GUTF8String print(void); > > virtual GUTF8String get_xmltag(const int height) const=0; > > > virtual MapAreaType const get_shape_type( void ) const { return UNKNOWN; }; > > virtual char const * const get_shape_name(void) const=0; > > virtual GP<GMapArea> get_copy(void) const=0; > > > virtual void get_coords( GList<int> & CoordList ) const; > > virtual void map(GRectMapper &mapper)=0; > > virtual void unmap(GRectMapper &mapper)=0; > >protected: > virtual int gma_get_xmin(void) const=0; > virtual int gma_get_ymin(void) const=0; > virtual int gma_get_xmax(void) const=0; > virtual int gma_get_ymax(void) const=0; > virtual void gma_move(int dx, int dy)=0; > virtual void gma_resize(int new_width, int new_height)=0; > virtual void gma_transform(const GRect & grect)=0; > virtual bool gma_is_point_inside(const int x, const int y) const=0; > virtual char const * const gma_check_object(void) const=0; > virtual GUTF8String gma_print(void)=0; > > void clear_bounds(void) { bounds_initialized=0; } >private: > int xmin, xmax, ymin, ymax; > bool bounds_initialized; > > void initialize_bounds(void); >}; > > > > > > > >class GMapRect: public GMapArea >{ >protected: > GMapRect(void); > GMapRect(const GRect & rect); >public: > > static GP<GMapRect> create(void) {return new GMapRect();} > > static GP<GMapRect> create(const GRect &rect) {return new GMapRect(rect);} > > virtual ~GMapRect(); > > > int get_width(void) const { return xmax-xmin; } > > int get_height(void) const { return ymax-ymin; } > > > GMapRect & operator=(const GRect & rect); > > > operator GRect(void); > > virtual GUTF8String get_xmltag(const int height) const; > > virtual MapAreaType const get_shape_type( void ) const { return RECT; }; > > virtual char const * const get_shape_name(void) const; > > virtual GP<GMapArea> get_copy(void) const; > > virtual void map(GRectMapper &mapper); > > virtual void unmap(GRectMapper &mapper); >protected: > int xmin, ymin, xmax, ymax; > virtual int gma_get_xmin(void) const; > virtual int gma_get_ymin(void) const; > virtual int gma_get_xmax(void) const; > virtual int gma_get_ymax(void) const; > virtual void gma_move(int dx, int dy); > virtual void gma_resize(int new_width, int new_height); > virtual void gma_transform(const GRect & grect); > virtual bool gma_is_point_inside(const int x, const int y) const; > virtual char const * const gma_check_object(void) const; > virtual GUTF8String gma_print(void); >}; ># 348 "../libdjvu/GMapAreas.h" >class GMapPoly : public GMapArea >{ >protected: > GMapPoly(void); > GMapPoly(const int * xx, const int * yy, int points, bool open=false); >public: > > static GP<GMapPoly> create(void) {return new GMapPoly();} > > > static GP<GMapPoly> create( > const int xx[], const int yy[], const int points, const bool open=false) > {return new GMapPoly(xx,yy,points,open);} > > > virtual ~GMapPoly(); > > > bool does_side_cross_rect(const GRect & grect, int side); > > > int get_points_num(void) const; > > > int get_sides_num(void) const; > > > int get_x(int i) const; > > > int get_y(int i) const; > > > void move_vertex(int i, int x, int y); > > > int add_vertex(int x, int y); > > > void close_poly(); > > void optimize_data(void); > > char const * const check_data(void); > > virtual GUTF8String get_xmltag(const int height) const; > > virtual MapAreaType const get_shape_type( void ) const { return POLY; }; > > virtual char const * const get_shape_name(void) const; > > virtual GP<GMapArea> get_copy(void) const; > > void get_coords( GList<int> & CoordList ) const; > > virtual void map(GRectMapper &mapper); > > virtual void unmap(GRectMapper &mapper); >protected: > virtual int gma_get_xmin(void) const; > virtual int gma_get_ymin(void) const; > virtual int gma_get_xmax(void) const; > virtual int gma_get_ymax(void) const; > virtual void gma_move(int dx, int dy); > virtual void gma_resize(int new_width, int new_height); > virtual void gma_transform(const GRect & grect); > virtual bool gma_is_point_inside(const int x, const int y) const; > virtual char const * const gma_check_object(void) const; > virtual GUTF8String gma_print(void); >private: > bool open; > int points, sides; > GTArray<int> xx, yy; > static int sign(int x); > static bool is_projection_on_segment(int x, int y, int x1, int y1, int x2, int y2); > static bool do_segments_intersect(int x11, int y11, int x12, int y12, > int x21, int y21, int x22, int y22); > static bool are_segments_parallel(int x11, int y11, int x12, int y12, > int x21, int y21, int x22, int y22); >}; > > > > > > > >class GMapOval: public GMapArea >{ >protected: > GMapOval(void); > GMapOval(const GRect & rect); >public: > > static GP<GMapOval> create(void) {return new GMapOval();} > > > static GP<GMapOval> create(const GRect &rect) {return new GMapOval(rect);} > > > virtual ~GMapOval(); > > > int get_a(void) const; > > int get_b(void) const; > > int get_rmin(void) const; > > int get_rmax(void) const; > > virtual GUTF8String get_xmltag(const int height) const; > > virtual MapAreaType const get_shape_type( void ) const { return OVAL; }; > > virtual char const * const get_shape_name(void) const; > > virtual GP<GMapArea> get_copy(void) const; > > virtual void map(GRectMapper &mapper); > > virtual void unmap(GRectMapper &mapper); >protected: > virtual int gma_get_xmin(void) const; > virtual int gma_get_ymin(void) const; > virtual int gma_get_xmax(void) const; > virtual int gma_get_ymax(void) const; > virtual void gma_move(int dx, int dy); > virtual void gma_resize(int new_width, int new_height); > virtual void gma_transform(const GRect & grect); > virtual bool gma_is_point_inside(const int x, const int y) const; > virtual char const * const gma_check_object(void) const; > virtual GUTF8String gma_print(void); >private: > int rmax, rmin; > int a, b; > int xf1, yf1, xf2, yf2; > int xmin, ymin, xmax, ymax; > > void initialize(void); >}; > >inline >GMapRect::operator GRect(void) >{ > return GRect(xmin, ymin, xmax-xmin, ymax-ymin); >} > >inline int >GMapRect::gma_get_xmin(void) const { return xmin; } > >inline int >GMapRect::gma_get_ymin(void) const { return ymin; } > >inline int >GMapRect::gma_get_xmax(void) const { return xmax; } > >inline int >GMapRect::gma_get_ymax(void) const { return ymax; } > >inline char const * const >GMapRect::gma_check_object(void) const{ return ""; } > >inline char const * const >GMapRect::get_shape_name(void) const { return RECT_TAG; } > >inline int >GMapPoly::get_points_num(void) const { return points; } > >inline int >GMapPoly::get_sides_num(void) const { return sides; } > >inline int >GMapPoly::get_x(int i) const { return xx[i]; } > >inline int >GMapPoly::get_y(int i) const { return yy[i]; } > >inline char const * const >GMapPoly::get_shape_name(void) const { return POLY_TAG; } > >inline int >GMapOval::get_a(void) const { return a; } > >inline int >GMapOval::get_b(void) const { return b; } > >inline int >GMapOval::get_rmin(void) const { return rmin; } > >inline int >GMapOval::get_rmax(void) const { return rmax; } > >inline int >GMapOval::gma_get_xmin(void) const { return xmin; } > >inline int >GMapOval::gma_get_ymin(void) const { return ymin; } > >inline int >GMapOval::gma_get_xmax(void) const { return xmax; } > >inline int >GMapOval::gma_get_ymax(void) const { return ymax; } > >inline char const * const >GMapOval::get_shape_name(void) const { return OVAL_TAG; } > > > > > >} > >using namespace DJVU; ># 90 "../libdjvu/DjVuText.h" 2 > > >namespace DJVU { > > > > > > >class ByteStream; ># 109 "../libdjvu/DjVuText.h" >class DjVuTXT : public GPEnabled >{ >protected: > DjVuTXT(void) {} >public: > > static GP<DjVuTXT> create(void) {return new DjVuTXT();} > > > > > enum ZoneType { PAGE=1, COLUMN=2, REGION=3, PARAGRAPH=4, > LINE=5, WORD=6, CHARACTER=7 }; > > > class Zone > { > public: > Zone(); > > enum ZoneType ztype; > > GRect rect; > > int text_start; > > int text_length; > > GList<Zone> children; > > > > Zone *append_child(); > > void get_text_with_rect(const GRect &box, > int &string_start,int &string_end ) const; > > void find_zones(GList<Zone *> &list, > const int string_start, const int string_end) const; > > void get_smallest(GList<GRect> &list) const; > > > > void get_smallest(GList<GRect> &list,const int padding) const; > > const Zone *get_parent(void) const; > private: > friend class DjVuTXT; > const Zone *zone_parent; > void cleartext(); > void normtext(const char *instr, GUTF8String &outstr); > unsigned int memuse() const; > static const int version; > void encode(const GP<ByteStream> &bs, > const Zone * parent=0, const Zone * prev=0) const; > void decode(const GP<ByteStream> &bs, int maxtext, > const Zone * parent=0, const Zone * prev=0); > }; ># 180 "../libdjvu/DjVuText.h" > GUTF8String textUTF8; > static const char end_of_column ; > static const char end_of_region ; > static const char end_of_paragraph ; > static const char end_of_line ; > > > Zone page_zone; > > int has_valid_zones() const; > > > > > > void normalize_text(); > > void encode(const GP<ByteStream> &bs) const; > > void decode(const GP<ByteStream> &bs); > > GP<DjVuTXT> copy(void) const; > > void writeText(ByteStream &bs,const int height) const; > > GUTF8String get_xmlText(const int height) const; > > GList<Zone*> find_text_in_rect(GRect target_rect, GUTF8String &text) const; > > GList<GRect> find_text_with_rect(const GRect &box, GUTF8String &text, const int padding=0) const; > > > void get_zones(int zone_type, const Zone *parent, GList<Zone *> & zone_list) const; > > > unsigned int get_memory_usage() const; >}; > >inline const DjVuTXT::Zone * >DjVuTXT::Zone::get_parent(void) const >{ > return zone_parent; >} > > >class DjVuText : public GPEnabled >{ >protected: > DjVuText(void) {} >public: > > static GP<DjVuText> create(void) {return new DjVuText();} > > > > > > void decode(const GP<ByteStream> &bs); > > > > void encode(const GP<ByteStream> &bs); > > > GP<DjVuText> copy(void) const; > > > > inline unsigned int get_memory_usage() const; > > > void writeText(ByteStream &bs,const int height) const; > > > GUTF8String get_xmlText(const int height) const; > > GP<DjVuTXT> txt; >private: > static void decode(ByteStream *); > static void encode(ByteStream *); >}; > > > >inline unsigned int >DjVuText::get_memory_usage() const >{ > return (txt)?(txt->get_memory_usage()):0; >} > > > > > >} > >using namespace DJVU; ># 69 "djvuserve.cpp" 2 ># 1 "../libdjvu/DjVuImage.h" 1 ># 108 "../libdjvu/DjVuImage.h" ># 1 "../libdjvu/DjVuFile.h" 1 ># 67 "../libdjvu/DjVuFile.h" ># 1 "../libdjvu/DjVuInfo.h" 1 ># 85 "../libdjvu/DjVuInfo.h" >namespace DJVU { > > > > > >class ByteStream; ># 119 "../libdjvu/DjVuInfo.h" >class GUTF8String; > > > > > > > >class DjVuInfo : public GPEnabled >{ >protected: > DjVuInfo(void); >public: > > > > static GP<DjVuInfo> create(void) {return new DjVuInfo();} > > > > > > void decode(ByteStream &bs); > > > > > void encode(ByteStream &bs); > > unsigned int get_memory_usage() const; > > int width; > > int height; > > > > > int version; > > > > > int dpi; > > > > double gamma; > > > > bool compressable; > enum {COMPRESSABLE_FLAG=0x80,RESERVED_FLAGS1=0x7f}; > > > GRect::Orientations orientation; > > > GUTF8String get_paramtags(void) const; > > void writeParam(ByteStream &out_str) const; >}; > > > > > > > >} > >using namespace DJVU; ># 68 "../libdjvu/DjVuFile.h" 2 ># 1 "../libdjvu/DjVuPalette.h" 1 ># 68 "../libdjvu/DjVuPalette.h" ># 1 "../libdjvu/GPixmap.h" 1 ># 89 "../libdjvu/GPixmap.h" >namespace DJVU { > > > > > > >class GBitmap; >class GRect; >class ByteStream; ># 109 "../libdjvu/GPixmap.h" >struct GPixel >{ > > unsigned char b; > > unsigned char g; > > unsigned char r; > > friend int operator==(const GPixel & p1, const GPixel & p2); > > friend int operator!=(const GPixel & p1, const GPixel & p2); > > friend unsigned int hash(const GPixel &p); > > > > static const GPixel WHITE; > > static const GPixel BLACK; > > static const GPixel BLUE; > > static const GPixel GREEN; > > static const GPixel RED; > >}; ># 148 "../libdjvu/GPixmap.h" >class GPixmap : public GPEnabled >{ >protected: > GPixmap(void); > GPixmap(int nrows, int ncolumns, const GPixel *filler=0); > GPixmap(const GBitmap &ref); > GPixmap(const GBitmap &ref, const GRect &rect); > GPixmap(const GPixmap &ref); > GPixmap(const GPixmap &ref, const GRect &rect); > GPixmap(ByteStream &ref); > >public: > > virtual ~GPixmap(); > > void destroy(void); > > > > > > static GP<GPixmap> create(void) {return new GPixmap();} > > > > > static GP<GPixmap> create( > const int nrows, const int ncolumns, const GPixel *filler=0) > { return new GPixmap(nrows,ncolumns,filler); } > > > > > static GP<GPixmap> create(const GBitmap &ref) > { return new GPixmap(ref); } > > > > > > > static GP<GPixmap> create(const GBitmap &ref, const GRect &rect) > { return new GPixmap(ref,rect); } > > > > static GP<GPixmap> create(const GPixmap &ref) > { return new GPixmap(ref); } > > > > > static GP<GPixmap> create(const GPixmap &ref, const GRect &rect) > { return new GPixmap(ref,rect); } > > > > static GP<GPixmap> create(ByteStream &ref) > { return new GPixmap(ref); } ># 215 "../libdjvu/GPixmap.h" > void init(int nrows, int ncolumns, const GPixel *filler=0); > > > void init(const GPixmap &ref); > > > void init(const GPixmap &ref, const GRect &rect); > > > > > void init(const GBitmap &ref, const GPixel *ramp=0); > > > > > > void init(const GBitmap &ref, const GRect &rect, const GPixel *ramp=0); > > > void init(ByteStream &ref); > > > GPixmap& operator=(const GBitmap &ref); > > > > GPixmap& operator=(const GPixmap &ref); > > > > > > unsigned int rows() const; > > unsigned int columns() const; > > > const GPixel * operator[] (int row) const; > > > GPixel * operator[] (int row); > > > > > unsigned int rowsize() const; ># 273 "../libdjvu/GPixmap.h" > void downsample(const GPixmap *src, int factor, const GRect *rect=0); > > > > > > > > void upsample(const GPixmap *src, int factor, const GRect *rect=0); > > > > > > > void downsample43(const GPixmap *src, const GRect *rect=0); > > > > > > > void upsample23(const GPixmap *src, const GRect *rect=0); ># 308 "../libdjvu/GPixmap.h" > void attenuate(const GBitmap *bm, int x, int y); > > > > > > void blit(const GBitmap *bm, int x, int y, const GPixel *color); > > > > > > > void blit(const GBitmap *bm, int x, int y, const GPixmap *color); > > > > > void blend(const GBitmap *bm, int x, int y, const GPixmap *color); > > > > > > > > void stencil(const GBitmap *bm, > const GPixmap *pm, int pms, > const GRect *pmr, double corr=1.0); ># 352 "../libdjvu/GPixmap.h" > void ordered_666_dither(int xmin=0, int ymin=0); ># 364 "../libdjvu/GPixmap.h" > void ordered_32k_dither(int xmin=0, int ymin=0); > > > > > void color_correct(double corr); > > > static void color_correct(double corr, GPixel *pixels, int npixels); > > > > > > > inline unsigned int get_memory_usage() const; > > > > void save_ppm(ByteStream &bs, int raw=1) const; ># 398 "../libdjvu/GPixmap.h" > GPixel *take_data(size_t &offset); > > > > > > > inline void borrow_data(GPixel &data, int w, int h); > > void donate_data(GPixel *data, int w, int h); > > > > > > GP<GPixmap> rotate(int count=0); > > > > > > > int get_grays(void) const { return 256; }; > void set_grays(int) {}; > >protected: > > unsigned short nrows; > unsigned short ncolumns; > unsigned short nrowsize; > GPixel *pixels; > GPixel *pixels_data; > friend class DjVu_PixImage; >}; > > > > > > >inline int >operator==(const GPixel & p1, const GPixel & p2) >{ > return p1.r==p2.r && p1.g==p2.g && p1.b==p2.b; >} > >inline int >operator!=(const GPixel & p1, const GPixel & p2) >{ > return p1.r!=p2.r || p1.g!=p2.g || p1.b!=p2.b; >} > >inline unsigned int >hash(const GPixel &p) >{ > unsigned int x = (p.b<<16)|(p.g<<8)|(p.r); > return x ^ (p.b<<4) ^ (p.r<<12); >} > >inline unsigned int >GPixmap::rows() const >{ > return nrows; >} > >inline unsigned int >GPixmap::columns() const >{ > return ncolumns; >} > >inline unsigned int >GPixmap::rowsize() const >{ > return nrowsize; >} > >inline GPixel * >GPixmap::operator[](int row) >{ > if (row<0 || row>=nrows || !pixels) return 0; > return &pixels[row * nrowsize]; >} > >inline const GPixel * >GPixmap::operator[](int row) const >{ > if (row<0 || row>=nrows) return 0; > return &pixels[row * nrowsize]; >} > >inline GPixmap & >GPixmap::operator=(const GBitmap &ref) >{ > init(ref); > return *this; >} > >inline GPixmap & >GPixmap::operator=(const GPixmap &ref) >{ > init(ref); > return *this; >} > >inline void >GPixmap::borrow_data(GPixel &data, int w, int h) >{ > donate_data(&data,w,h); > pixels_data=0; >} > > > > > > >inline unsigned int >GPixmap::get_memory_usage() const >{ > return sizeof(GPixmap)+(nrows * ncolumns * sizeof(GPixel)); >} > > > > >} > >using namespace DJVU; ># 69 "../libdjvu/DjVuPalette.h" 2 > > > > >namespace DJVU { ># 122 "../libdjvu/DjVuPalette.h" >class DjVuPalette : public GPEnabled >{ >protected: > DjVuPalette(void); >public: > > static GP<DjVuPalette> create(void) {return new DjVuPalette();} > > > ~DjVuPalette(); > > DjVuPalette(const DjVuPalette &ref); > DjVuPalette& operator=(const DjVuPalette &ref); > > > void histogram_clear(); > > > void histogram_add(const GPixel &p, int weight); > > > void histogram_add(const unsigned char *bgr, int weight); > > > > > > > void histogram_norm_and_add(const int *bgr, int weight); > > > > > > int compute_palette(int maxcolors, int minboxsize=0); > > > > int compute_pixmap_palette(const GPixmap &pm, int ncolors, int minboxsize=0); > > > int size() const; > > int color_to_index(const GPixel &p); > > int color_to_index(const unsigned char *bgr); > > void index_to_color(int index, GPixel &p) const; > > > void index_to_color(int index, unsigned char *bgr) const; > > > void quantize(GPixmap &pm); > > int compute_palette_and_quantize(GPixmap &pm, int maxcolors, int minboxsize=0); > > > > > > void color_correct(double corr); > > > > > GTArray<short> colordata; > > > > void get_color(int nth, GPixel &out) const; > > > > void encode_rgb_entries(ByteStream &bs) const; > > > void decode_rgb_entries(ByteStream &bs, const int palettesize); > > > > > void encode(GP<ByteStream> bs) const; > > > > > void decode(GP<ByteStream> bs); > >private: > > int mask; > GMap<int,int> *hist; > > struct PColor { unsigned char p[4]; }; > GTArray<PColor> palette; > GMap<int,int> *pmap; > > void allocate_hist(); > void allocate_pmap(); > static int bcomp (const void*, const void*); > static int gcomp (const void*, const void*); > static int rcomp (const void*, const void*); > static int lcomp (const void*, const void*); > int color_to_index_slow(const unsigned char *bgr); >private: > static void encode(ByteStream *); > static void decode(ByteStream *); >}; > > > > > > > >inline void >DjVuPalette::histogram_clear() >{ > delete hist; > hist = 0; > mask = 0; >} > >inline void >DjVuPalette::histogram_add(const unsigned char *bgr, int weight) >{ > if (weight > 0) > { > if (!hist || hist->size()>=0x4000) > allocate_hist(); > int key = (bgr[0]<<16)|(bgr[1]<<8)|(bgr[2])|(mask); > (*hist)[key] += weight; > } >} > >inline void >DjVuPalette::histogram_add(const GPixel &p, int weight) >{ > histogram_add(&p.b, weight); >} > >inline void >DjVuPalette::histogram_norm_and_add(const int *bgr, int weight) >{ > if (weight > 0) > { > int p0 = bgr[0]/weight; if (p0>255) p0=255; > int p1 = bgr[1]/weight; if (p1>255) p1=255; > int p2 = bgr[2]/weight; if (p2>255) p2=255; > if (!hist || hist->size()>=0x4000) > allocate_hist(); > int key = (p0<<16)|(p1<<8)|(p2)|(mask); > (*hist)[key] += weight; > } >} > >inline int >DjVuPalette::size() const >{ > return palette.size(); >} > >inline int >DjVuPalette::color_to_index(const unsigned char *bgr) >{ > if (! pmap) > allocate_pmap(); > int key = (bgr[0]<<16)|(bgr[1]<<8)|(bgr[2]); > GPosition p = pmap->contains(key); > if ( p) > return (*pmap)[p]; > return color_to_index_slow(bgr); >} > >inline int >DjVuPalette::color_to_index(const GPixel &p) >{ > return color_to_index(&p.b); >} > >inline void >DjVuPalette::index_to_color(int index, unsigned char *bgr) const >{ > const PColor &color = palette[index]; > bgr[0] = color.p[0]; > bgr[1] = color.p[1]; > bgr[2] = color.p[2]; >} > >inline void >DjVuPalette::index_to_color(int index, GPixel &p) const >{ > index_to_color(index, &p.b); >} > >inline void >DjVuPalette::get_color(int nth, GPixel &p) const >{ > index_to_color(colordata[nth], p); >} > > > > > > >} > >using namespace DJVU; ># 69 "../libdjvu/DjVuFile.h" 2 > > > >namespace DJVU { > > > > > >class DjVuTXT; >class ByteStream; >class DataPool; >class JB2Image; >class JB2Dict; >class IW44Image; >class IFFByteStream; >class GPixmap; >class DjVuNavDir; ># 201 "../libdjvu/DjVuFile.h" >class DjVuFile : public DjVuPort >{ >public: > enum { DECODING=1, DECODE_OK=2, DECODE_FAILED=4, DECODE_STOPPED=8, > DATA_PRESENT=16, ALL_DATA_PRESENT=32, INCL_FILES_CREATED=64, > MODIFIED=128, DONT_START_DECODE=256, STOPPED=512, > BLOCKED_STOPPED=1024, CAN_COMPRESS=2048, NEEDS_COMPRESSION=4096 }; > enum { STARTED=1, FINISHED=2 }; > > > > > GP<DjVuInfo> info; > > GP<IW44Image> bg44; > > GP<GPixmap> bgpm; > > GP<JB2Image> fgjb; > > GP<JB2Dict> fgjd; > > GP<GPixmap> fgpm; > > GP<DjVuPalette> fgbc; > > GP<ByteStream> anno; > > GP<ByteStream> text; > > GP<ByteStream> meta; > > GP<DjVuNavDir> dir; > > GUTF8String description; > > GUTF8String mimetype; > > int file_size; > > >protected: > > DjVuFile(void); >public: > virtual ~DjVuFile(void); ># 261 "../libdjvu/DjVuFile.h" > void init(const GP<ByteStream> & str); > > > static GP<DjVuFile> create( const GP<ByteStream> & str, > const ErrorRecoveryAction recover_action=ABORT, > const bool verbose_eof=true); ># 297 "../libdjvu/DjVuFile.h" > void init(const GURL & url, GP<DjVuPort> port=0); > > > static GP<DjVuFile> create( > const GURL & url, GP<DjVuPort> port=0, > const ErrorRecoveryAction recover_action=ABORT, > const bool verbose_eof=true); > > > > > void disable_standard_port(void); ># 319 "../libdjvu/DjVuFile.h" > GP<DjVuNavDir> find_ndir(void); ># 342 "../libdjvu/DjVuFile.h" > long get_flags(void) const; > > bool is_decoding(void) const; > > bool is_decode_ok(void) const; > > bool is_decode_failed(void) const; > > > bool is_decode_stopped(void) const; > > bool is_data_present(void) const; > > > bool is_all_data_present(void) const; > > > > bool are_incl_files_created(void) const; > bool is_modified(void) const; > bool needs_compression(void) const; > bool can_compress(void) const; > void set_modified(bool m); > void set_needs_compression(bool m); > void set_can_compress(bool m); > > > > GURL get_url(void) const; > > > > > > > > void start_decode(void); > > > > bool resume_decode(const bool sync=false); > > > > > void stop_decode(bool sync); ># 407 "../libdjvu/DjVuFile.h" > void stop(bool only_blocked); > > > void wait_for_finish(void); ># 422 "../libdjvu/DjVuFile.h" > GP<DjVuNavDir> decode_ndir(void); > > void reset(void); ># 434 "../libdjvu/DjVuFile.h" > void process_incl_chunks(void); > > > > unsigned int get_memory_usage(void) const; ># 452 "../libdjvu/DjVuFile.h" > GPList<DjVuFile> get_included_files(bool only_created=true); > > > > > > void insert_file(const GUTF8String &id, int chunk_num=1); > > void unlink_file(const GUTF8String &id); > > > static GP<DataPool> unlink_file(const GP<DataPool> & data, const GUTF8String &name); > > > int get_chunks_number(void); > > GUTF8String get_chunk_name(int chunk_num); > > bool contains_chunk(const GUTF8String &chunk_name); ># 490 "../libdjvu/DjVuFile.h" > GP<ByteStream> get_merged_anno(int * max_level_ptr=0); ># 500 "../libdjvu/DjVuFile.h" > GP<ByteStream> get_anno(void); ># 510 "../libdjvu/DjVuFile.h" > GP<ByteStream> get_text(void); ># 520 "../libdjvu/DjVuFile.h" > GP<ByteStream> get_meta(void); ># 529 "../libdjvu/DjVuFile.h" > GP<ByteStream> get_merged_anno(const GList<GURL> & ignore_list, > int * max_level_ptr); > > > void remove_anno(void); > > > void remove_text(void); > > > void remove_meta(void); > > > > > bool contains_anno(void); > > > > > bool contains_text(void); > > > > > bool contains_meta(void); > > > void change_info(GP<DjVuInfo> info, const bool do_reset=false); > > > void change_text(GP<DjVuTXT> txt, const bool do_reset=false); > > > void change_meta(const GUTF8String &meta, const bool do_reset=false); ># 577 "../libdjvu/DjVuFile.h" > GP<ByteStream> get_djvu_bytestream(const bool included_too, const bool no_ndir=true); > > > > GP<DataPool> get_djvu_data(const bool included_too, const bool no_ndir=true ); > > > > GP<DataPool> get_init_data_pool(void) const { return data_pool; }; > > > void move(const GURL & dir_url); > > > > void set_name(const GUTF8String &name); > > > GSafeFlags & get_safe_flags(void); > > > void merge_anno(ByteStream &out); > > > void get_text(ByteStream &out); > > > void get_meta(ByteStream &out); > > > void rebuild_data_pool(void); > > > virtual bool inherits(const GUTF8String &class_name) const; > virtual void notify_chunk_done(const DjVuPort * source, const GUTF8String &name); > virtual void notify_file_flags_changed(const DjVuFile * source, > long set_mask, long clr_mask); > virtual void set_recover_errors(const ErrorRecoveryAction=ABORT); > virtual void set_verbose_eof(const bool verbose_eof=true); > virtual void report_error(const GException &ex,const bool=true); > static void set_decode_codec(GP<GPixmap> (*codec)(ByteStream &bs)); > >protected: > GURL url; > GP<DataPool> data_pool; > > GPList<DjVuFile> inc_files_list; > GCriticalSection inc_files_lock; > GCriticalSection anno_lock; > GCriticalSection text_lock; > GCriticalSection meta_lock; > ErrorRecoveryAction recover_errors; > bool verbose_eof; > int chunks_number; >private: > bool initialized; > GSafeFlags flags; > > GThread * decode_thread; > GP<DataPool> decode_data_pool; > GP<DjVuFile> decode_life_saver; > > GP<DjVuPort> simple_port; > > GMonitor chunk_mon, finish_mon; > > > static void static_decode_func(void *); > void decode_func(void); > void decode(const GP<ByteStream> &str); > GUTF8String decode_chunk(const GUTF8String &chkid, > const GP<ByteStream> &str, bool djvi, bool djvu, bool iw44); > int get_dpi(int w, int h); > > > static GP<JB2Dict> static_get_fgjd(void *); > GP<JB2Dict> get_fgjd(int block=0); > > > void wait_for_chunk(void); > bool wait_for_finish(bool self); > > > GP<DjVuFile> process_incl_chunk(ByteStream & str, int file_num=-1); > > > static void static_trigger_cb(void *); > void trigger_cb(void); > > > static void progress_cb(int pos, void *); > static void get_merged_anno(const GP<DjVuFile> & file, > const GP<ByteStream> &str_out, const GList<GURL> & ignore_list, > int level, int & max_level, GMap<GURL, void *> & map); > static void get_anno(const GP<DjVuFile> & file, > const GP<ByteStream> &str_out); > static void get_text(const GP<DjVuFile> & file, > const GP<ByteStream> &str_out); > static void get_meta(const GP<DjVuFile> & file, > const GP<ByteStream> &str_out); > > void check() const; > GP<DjVuNavDir>find_ndir(GMap<GURL, void *> & map); > GP<DjVuNavDir>decode_ndir(GMap<GURL, void *> & map); > void add_djvu_data(IFFByteStream & str, > GMap<GURL, void *> & map, > const bool included_too, const bool no_ndir=true); > void move(GMap<GURL, void *> & map, const GURL & dir_url); >private: > static void decode(ByteStream *); > static GUTF8String decode_chunk(const GUTF8String &, ByteStream *,bool,bool,bool); > static void get_merged_anno(const GP<DjVuFile> &,ByteStream *, > const GList<GURL> &, int, int &, GMap<GURL, void *> &); > static void get_text(const GP<DjVuFile> &,ByteStream *); > static void get_meta(const GP<DjVuFile> &,ByteStream *); > >}; > >inline long >DjVuFile::get_flags(void) const >{ > return flags; >} > >inline GSafeFlags & >DjVuFile::get_safe_flags(void) >{ > return flags; >} > >inline bool >DjVuFile::is_decoding(void) const >{ > return (flags & DECODING)!=0; >} > >inline bool >DjVuFile::is_decode_ok(void) const >{ > return (flags & DECODE_OK)!=0; >} > >inline bool >DjVuFile::is_decode_failed(void) const >{ > return (flags & DECODE_FAILED)!=0; >} > >inline bool >DjVuFile::is_decode_stopped(void) const >{ > return (flags & DECODE_STOPPED)!=0; >} > >inline bool >DjVuFile::is_data_present(void) const >{ > return (flags & DATA_PRESENT)!=0; >} > >inline bool >DjVuFile::is_all_data_present(void) const >{ > return (flags & ALL_DATA_PRESENT)!=0; >} > >inline bool >DjVuFile::are_incl_files_created(void) const >{ > return (flags & INCL_FILES_CREATED)!=0; >} > >inline bool >DjVuFile::is_modified(void) const >{ > return (flags & MODIFIED)!=0; >} > >inline void >DjVuFile::set_modified(bool m) >{ > flags=m ? (flags | MODIFIED) : (flags & ~MODIFIED); >} > >inline bool >DjVuFile::needs_compression(void) const >{ > return (flags & NEEDS_COMPRESSION)!=0; >} > >inline void >DjVuFile::set_needs_compression(bool m) >{ > if (m) flags=flags | NEEDS_COMPRESSION; > else flags=flags & ~NEEDS_COMPRESSION; >} > >inline bool >DjVuFile::can_compress(void) const >{ > return (flags & CAN_COMPRESS)!=0; >} > >inline void >DjVuFile::set_can_compress(bool m) >{ > if(info) > { > info->compressable=m; > } > if (m) > { > flags=flags | CAN_COMPRESS; > } else > { > flags=flags & ~CAN_COMPRESS; > } >} > >inline void >DjVuFile::disable_standard_port(void) >{ > simple_port=0; >} > >inline bool >DjVuFile::inherits(const GUTF8String &class_name) const >{ > return > (GUTF8String("DjVuFile") == class_name) || > DjVuPort::inherits(class_name); > > >} > >inline void >DjVuFile::wait_for_finish(void) >{ > while(wait_for_finish(1)) > ; >} > >inline GURL >DjVuFile::get_url(void) const >{ > return url; >} > >inline void >DjVuFile::set_verbose_eof >(const bool verbose) >{ > verbose_eof=verbose; >} > >inline void >DjVuFile::set_recover_errors >(const ErrorRecoveryAction action) >{ > recover_errors=action; >} > > > > > >} > >using namespace DJVU; ># 109 "../libdjvu/DjVuImage.h" 2 ># 1 "../libdjvu/DjVuAnno.h" 1 ># 95 "../libdjvu/DjVuAnno.h" >namespace DJVU { > > > > > >class GMapArea; >class ByteStream; ># 113 "../libdjvu/DjVuAnno.h" >class DjVuANT : public GPEnabled >{ >protected: > > DjVuANT(void); > >public: > enum { MODE_UNSPEC=0, MODE_COLOR, MODE_FORE, MODE_BACK, MODE_BW }; > enum { ZOOM_STRETCH=-4, ZOOM_ONE2ONE=-3, ZOOM_WIDTH=-2, > ZOOM_PAGE=-1, ZOOM_UNSPEC=0 }; > enum alignment { ALIGN_UNSPEC=0, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, > ALIGN_TOP, ALIGN_BOTTOM }; > > > static GP<DjVuANT> create(void) { return new DjVuANT; } > virtual ~DjVuANT(); > > > > unsigned long int bg_color; ># 141 "../libdjvu/DjVuAnno.h" > int zoom; ># 154 "../libdjvu/DjVuAnno.h" > int mode; > > > alignment hor_align; > > > alignment ver_align; > > > > GPList<GMapArea> map_areas; > > > GMap<GUTF8String,GUTF8String> metadata; > > > > bool is_empty(void) const; > > > > > > void decode(ByteStream &bs); > > > > void merge(ByteStream & bs); > > > > > void encode(ByteStream &bs); > > > GUTF8String encode_raw(void) const; > > > GP<DjVuANT> copy(void) const; > > > > unsigned int get_memory_usage() const; > > > static unsigned long int cvt_color(const char * color, unsigned long int def); > > GUTF8String get_xmlmap(const GUTF8String &name, const int height) const; > > void writeMap( > ByteStream &bs,const GUTF8String &name, const int height) const; > > GUTF8String get_paramtags(void) const; > > void writeParam(ByteStream &out_str) const; >private: > void decode(class GLParser & parser); > static GUTF8String read_raw(ByteStream & str); > static unsigned char decode_comp(char ch1, char ch2); > static unsigned long int get_bg_color(class GLParser & parser); > static int get_zoom(class GLParser & parser); > static int get_mode(class GLParser & parser); > static alignment get_hor_align(class GLParser & parser); > static alignment get_ver_align(class GLParser & parser); > static GPList<GMapArea> get_map_areas(class GLParser & parser); > > static GMap<GUTF8String, GUTF8String>get_metadata(GLParser & parser); > > static void del_all_items(const char * name, class GLParser & parser); >}; ># 235 "../libdjvu/DjVuAnno.h" >class DjVuAnno : public GPEnabled >{ >protected: > DjVuAnno(void) {} >public: > > static GP<DjVuAnno> create(void) { return new DjVuAnno; } > > GP<DjVuANT> ant; > > > > > > void decode(const GP<ByteStream> &bs); > > > > void encode(const GP<ByteStream> &bs); > > > GP<DjVuAnno> copy(void) const; > > > > void merge(const GP<DjVuAnno> & anno); > > > > inline unsigned int get_memory_usage() const; > > GUTF8String get_xmlmap(const GUTF8String &name, const int height) const; > > void writeMap( > ByteStream &bs,const GUTF8String &name, const int height) const; > > GUTF8String get_paramtags(void) const; > > void writeParam(ByteStream &out_str) const; >private: > static void decode(ByteStream *); > static void encode(ByteStream *); >}; > > > >inline unsigned int >DjVuAnno::get_memory_usage() const >{ > return (ant)?(ant->get_memory_usage()):0; >} > > > > >} > >using namespace DJVU; ># 110 "../libdjvu/DjVuImage.h" 2 > > > >namespace DJVU { > > > > > > > >class DjVuInterface >{ >public: > virtual ~DjVuInterface(); > virtual void notify_chunk(const char *chkid, const char *msg) = 0; > virtual void notify_relayout(void) = 0; > virtual void notify_redisplay(void) = 0; >}; ># 138 "../libdjvu/DjVuImage.h" >class DjVuImage : public DjVuPort >{ >protected: > DjVuImage(void); >public: > enum { NOINFO, NOTEXT=1, NOMAP=4, NOMETA=8 }; ># 156 "../libdjvu/DjVuImage.h" > static GP<DjVuImage> create(void) {return new DjVuImage();} > > > > > > > > void connect(const GP<DjVuFile> & file); > > > static GP<DjVuImage> create(const GP<DjVuFile> &file) > { const GP<DjVuImage> retval=create(); retval->connect(file); return retval; } ># 178 "../libdjvu/DjVuImage.h" > GP<DjVuInfo> get_info() const; > > > > GP<IW44Image> get_bg44() const; > > > > > GP<GPixmap> get_bgpm() const; > > > > > GP<JB2Image> get_fgjb() const; > > > > > GP<GPixmap> get_fgpm() const; > > > > GP<DjVuPalette> get_fgbc() const; > > > > > GP<ByteStream> get_anno() const; > > > GP<ByteStream> get_text() const; > > > GP<ByteStream> get_meta() const; ># 222 "../libdjvu/DjVuImage.h" > bool wait_for_complete_decode(void); ># 232 "../libdjvu/DjVuImage.h" > void decode(ByteStream & str, DjVuInterface *notifier=0); ># 242 "../libdjvu/DjVuImage.h" > int get_width() const; > > > > > int get_height() const; > > > > int get_real_width() const; > > > > int get_real_height() const; > > > > > int get_version() const; > > > > > int get_dpi() const; > > > > int get_rounded_dpi() const; > > > > double get_gamma() const; > > > > GUTF8String get_mimetype() const; > > > GUTF8String get_short_description() const; ># 295 "../libdjvu/DjVuImage.h" > GUTF8String get_long_description() const; > > > GP<DjVuFile> get_djvu_file(void) const; > > void writeXML(ByteStream &str_out,const GURL &doc_url, const int flags=0) const; > > void writeXML(ByteStream &str_out) const; > > GUTF8String get_XML(const GURL &doc_url, const int flags=0) const; > > GUTF8String get_XML(void) const; ># 317 "../libdjvu/DjVuImage.h" > int is_legal_photo() const; > > > > > > int is_legal_bilevel() const; > > > > > > > int is_legal_compound() const; ># 353 "../libdjvu/DjVuImage.h" > GP<GPixmap> get_pixmap(const GRect &rect, const GRect &all, double gamma=0) const; ># 362 "../libdjvu/DjVuImage.h" > GP<GBitmap> get_bitmap(const GRect &rect, const GRect &all, int align = 1) const; > > > > > > > > GP<GPixmap> get_bg_pixmap(const GRect &rect, const GRect &all, double gamma=0) const; > > > > > > > > GP<GPixmap> get_fg_pixmap(const GRect &rect, const GRect &all, double gamma=0) const; > > > > > void set_rotate(int count=0); > > int get_rotate() const; > > > GP<DjVuAnno> get_decoded_anno(); > > > void map(GRect &rect) const; > > > void unmap(GRect &rect) const; > > > void map(int &x, int &y) const; > > > void unmap(int &x, int &y) const; > > > > > > > virtual void notify_chunk_done(const DjVuPort *, const GUTF8String &name); > > > GP<GPixmap> get_pixmap(const GRect &rect, int subs=1, double gamma=0) const; > GP<GBitmap> get_bitmap(const GRect &rect, int subs=1, int align = 1) const; > GP<GPixmap> get_bg_pixmap(const GRect &rect, int subs=1, double gamma=0) const; > GP<GPixmap> get_fg_pixmap(const GRect &rect, int subs=1, double gamma=0) const; >private: > GP<DjVuFile> file; > int rotate_count; > bool relayout_sent; > > > int stencil(GPixmap *pm, const GRect &rect, int subs, double gcorr) const; > GP<DjVuInfo> get_info(const GP<DjVuFile> & file) const; > GP<IW44Image> get_bg44(const GP<DjVuFile> & file) const; > GP<GPixmap> get_bgpm(const GP<DjVuFile> & file) const; > GP<JB2Image> get_fgjb(const GP<DjVuFile> & file) const; > GP<GPixmap> get_fgpm(const GP<DjVuFile> & file) const; > GP<DjVuPalette> get_fgbc(const GP<DjVuFile> & file) const; > void init_rotate(const DjVuInfo &info); >}; > > >inline GP<DjVuFile> >DjVuImage::get_djvu_file(void) const >{ > return file; >} ># 444 "../libdjvu/DjVuImage.h" >} > >using namespace DJVU; ># 70 "djvuserve.cpp" 2 ># 1 "../libdjvu/GString.h" 1 ># 71 "djvuserve.cpp" 2 ># 1 "../libdjvu/GOS.h" 1 ># 91 "../libdjvu/GOS.h" >namespace DJVU { > > > > > > >class GURL; > > >class GOS >{ > public: ># 112 "../libdjvu/GOS.h" > static GUTF8String basename(const GUTF8String &filename, const char *suffix=0); > > > > > > static GUTF8String cwd(const GUTF8String &dirname=GUTF8String()); ># 127 "../libdjvu/GOS.h" > static unsigned long ticks(); > > > > static void sleep(int milliseconds); > > > static GUTF8String getenv(const GUTF8String &name); ># 149 "../libdjvu/GOS.h" >}; > > > > > > >} > >using namespace DJVU; ># 72 "djvuserve.cpp" 2 ># 1 "../libdjvu/GURL.h" 1 ># 73 "djvuserve.cpp" 2 ># 1 "../libdjvu/DjVuMessage.h" 1 ># 73 "../libdjvu/DjVuMessage.h" ># 1 "../libdjvu/DjVuMessageLite.h" 1 ># 75 "../libdjvu/DjVuMessageLite.h" >namespace DJVU { > > > > > >class lt_XMLTags; >class ByteStream; ># 150 "../libdjvu/DjVuMessageLite.h" >class DjVuMessageLite : public GPEnabled >{ >protected: > > DjVuMessageLite( void ); > GMap<GUTF8String,GP<lt_XMLTags> > Map; > GUTF8String errors; > > static const DjVuMessageLite &real_create(void); > >public: > > static const DjVuMessageLite& (*create)(void); > > > static const DjVuMessageLite &create_lite(void); > > > > static void AddByteStreamLater(const GP<ByteStream> &bs); > > > > ~DjVuMessageLite(); > > > GUTF8String LookUp( const GUTF8String & MessageList ) const; > > > static GUTF8String LookUpUTF8( const GUTF8String & MessageList ) > { return create().LookUp(MessageList); } > > > > static GNativeString LookUpNative( const GUTF8String & MessageList ) > { return create().LookUp(MessageList).getUTF82Native(); } > > > static void perror( const GUTF8String & MessageList ); > >protected: > > > > > void LookUpID( const GUTF8String & msgID, > GUTF8String &message_text, GUTF8String &message_number ) const; > > > > > GUTF8String LookUpSingle( const GUTF8String & Single_Message ) const; > > > > > > void InsertArg( > GUTF8String &message, const int ArgId, const GUTF8String &arg ) const; > > void AddByteStream(const GP<ByteStream> &bs); > >protected: > > static GP<DjVuMessageLite> &getDjVuMessageLite(void); > > static GPList<ByteStream> &getByteStream(void); >}; > > > >} > >using namespace DJVU; ># 74 "../libdjvu/DjVuMessage.h" 2 > > >namespace DJVU { > > > > > >class GURL; > >class DjVuMessage : public DjVuMessageLite >{ >protected: > void init(void); > DjVuMessage(void); > >public: > > static void use_language(void); > > > static void set_programname(const GUTF8String &programname); > static GUTF8String &programname(void); > > > static const DjVuMessageLite &create_full(void); > > > > static void AddByteStreamLater(const GP<ByteStream> &bs) > { use_language(); DjVuMessageLite::AddByteStreamLater(bs); } > > > > ~DjVuMessage(); > > > static GUTF8String LookUpUTF8( const GUTF8String & MessageList ) > { use_language();return DjVuMessageLite::LookUpUTF8(MessageList); } > > > > static GNativeString LookUpNative( const GUTF8String & MessageList ) > { use_language();return DjVuMessageLite::LookUpNative(MessageList); } > > > static void perror( const GUTF8String & MessageList ) > { use_language();DjVuMessageLite::perror(MessageList); } > > static GList<GURL> GetProfilePaths(void); >}; > > > > >} > >using namespace DJVU; ># 74 "djvuserve.cpp" 2 > ># 1 "/usr/include/locale.h" 1 3 4 ># 29 "/usr/include/locale.h" 3 4 ># 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/stddef.h" 1 3 4 ># 30 "/usr/include/locale.h" 2 3 4 ># 1 "/usr/include/bits/locale.h" 1 3 4 ># 27 "/usr/include/bits/locale.h" 3 4 >enum >{ > __LC_CTYPE = 0, > __LC_NUMERIC = 1, > __LC_TIME = 2, > __LC_COLLATE = 3, > __LC_MONETARY = 4, > __LC_MESSAGES = 5, > __LC_ALL = 6, > __LC_PAPER = 7, > __LC_NAME = 8, > __LC_ADDRESS = 9, > __LC_TELEPHONE = 10, > __LC_MEASUREMENT = 11, > __LC_IDENTIFICATION = 12 >}; ># 31 "/usr/include/locale.h" 2 3 4 > >extern "C" { ># 52 "/usr/include/locale.h" 3 4 >struct lconv >{ > > > char *decimal_point; > char *thousands_sep; > > > > > > char *grouping; > > > > > > char *int_curr_symbol; > char *currency_symbol; > char *mon_decimal_point; > char *mon_thousands_sep; > char *mon_grouping; > char *positive_sign; > char *negative_sign; > char int_frac_digits; > char frac_digits; > > char p_cs_precedes; > > char p_sep_by_space; > > char n_cs_precedes; > > char n_sep_by_space; > > > > > > > char p_sign_posn; > char n_sign_posn; > > > char int_p_cs_precedes; > > char int_p_sep_by_space; > > char int_n_cs_precedes; > > char int_n_sep_by_space; > > > > > > > char int_p_sign_posn; > char int_n_sign_posn; ># 119 "/usr/include/locale.h" 3 4 >}; > > > > > >extern char *setlocale (int __category, __const char *__locale) throw (); > > >extern struct lconv *localeconv (void) throw (); > > ># 148 "/usr/include/locale.h" 3 4 >typedef __locale_t locale_t; > > > > > >extern __locale_t newlocale (int __category_mask, __const char *__locale, > __locale_t __base) throw (); ># 189 "/usr/include/locale.h" 3 4 >extern __locale_t duplocale (__locale_t __dataset) throw (); > > > >extern void freelocale (__locale_t __dataset) throw (); > > > > > > >extern __locale_t uselocale (__locale_t __dataset) throw (); > > > > > > > >} ># 76 "djvuserve.cpp" 2 > > ># 1 "/usr/include/sys/stat.h" 1 3 4 ># 103 "/usr/include/sys/stat.h" 3 4 >extern "C" { > ># 1 "/usr/include/bits/stat.h" 1 3 4 ># 36 "/usr/include/bits/stat.h" 3 4 >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; > > __off_t st_size; > > > > __blksize_t st_blksize; > > > __blkcnt_t st_blocks; ># 70 "/usr/include/bits/stat.h" 3 4 > struct timespec st_atim; > struct timespec st_mtim; > struct timespec st_ctim; ># 85 "/usr/include/bits/stat.h" 3 4 > unsigned long int __unused4; > unsigned long int __unused5; > > > > }; > > >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; ># 127 "/usr/include/bits/stat.h" 3 4 > __ino64_t st_ino; > }; ># 106 "/usr/include/sys/stat.h" 2 3 4 ># 207 "/usr/include/sys/stat.h" 3 4 >extern int stat (__const char *__restrict __file, > struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); > > > >extern int fstat (int __fd, struct stat *__buf) throw () __attribute__ ((__nonnull__ (2))); ># 226 "/usr/include/sys/stat.h" 3 4 >extern int stat64 (__const char *__restrict __file, > struct stat64 *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); >extern int fstat64 (int __fd, struct stat64 *__buf) throw () __attribute__ ((__nonnull__ (2))); > > > > > > >extern int lstat (__const char *__restrict __file, > struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); ># 248 "/usr/include/sys/stat.h" 3 4 >extern int lstat64 (__const char *__restrict __file, > struct stat64 *__restrict __buf) > throw () __attribute__ ((__nonnull__ (1, 2))); > > > > > >extern int chmod (__const char *__file, __mode_t __mode) > throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern int lchmod (__const char *__file, __mode_t __mode) > throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int fchmod (int __fd, __mode_t __mode) throw (); > > > > > >extern __mode_t umask (__mode_t __mask) throw (); > > > > >extern __mode_t getumask (void) throw (); > > > >extern int mkdir (__const char *__path, __mode_t __mode) > throw () __attribute__ ((__nonnull__ (1))); > > > > > >extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) > throw () __attribute__ ((__nonnull__ (1))); > > > > >extern int mkfifo (__const char *__path, __mode_t __mode) > throw () __attribute__ ((__nonnull__ (1))); ># 324 "/usr/include/sys/stat.h" 3 4 >extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) > throw () __attribute__ ((__nonnull__ (3))); >extern int __xstat (int __ver, __const char *__filename, > struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); >extern int __lxstat (int __ver, __const char *__filename, > struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); ># 350 "/usr/include/sys/stat.h" 3 4 >extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) > throw () __attribute__ ((__nonnull__ (3))); >extern int __xstat64 (int __ver, __const char *__filename, > struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); >extern int __lxstat64 (int __ver, __const char *__filename, > struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); > >extern int __xmknod (int __ver, __const char *__path, __mode_t __mode, > __dev_t *__dev) throw () __attribute__ ((__nonnull__ (2, 4))); > > > > >extern __inline__ int >stat (__const char *__path, struct stat *__statbuf) throw () >{ > return __xstat (3, __path, __statbuf); >} > > >extern __inline__ int >lstat (__const char *__path, struct stat *__statbuf) throw () >{ > return __lxstat (3, __path, __statbuf); >} > > >extern __inline__ int >fstat (int __fd, struct stat *__statbuf) throw () >{ > return __fxstat (3, __fd, __statbuf); >} > > >extern __inline__ int >mknod (__const char *__path, __mode_t __mode, __dev_t __dev) throw () >{ > return __xmknod (1, __path, __mode, &__dev); >} > > > > > >extern __inline__ int >stat64 (__const char *__path, struct stat64 *__statbuf) throw () >{ > return __xstat64 (3, __path, __statbuf); >} > > >extern __inline__ int >lstat64 (__const char *__path, struct stat64 *__statbuf) throw () >{ > return __lxstat64 (3, __path, __statbuf); >} > > >extern __inline__ int >fstat64 (int __fd, struct stat64 *__statbuf) throw () >{ > return __fxstat64 (3, __fd, __statbuf); >} > > > > >} ># 79 "djvuserve.cpp" 2 > ># 1 "/usr/include/errno.h" 1 3 4 ># 32 "/usr/include/errno.h" 3 4 >extern "C" { > > > ># 1 "/usr/include/bits/errno.h" 1 3 4 ># 25 "/usr/include/bits/errno.h" 3 4 ># 1 "/usr/include/linux/errno.h" 1 3 4 > > > ># 1 "/usr/include/asm/errno.h" 1 3 4 > > > ># 1 "/usr/include/asm-generic/errno.h" 1 3 4 > > > ># 1 "/usr/include/asm-generic/errno-base.h" 1 3 4 ># 5 "/usr/include/asm-generic/errno.h" 2 3 4 ># 5 "/usr/include/asm/errno.h" 2 3 4 ># 5 "/usr/include/linux/errno.h" 2 3 4 ># 26 "/usr/include/bits/errno.h" 2 3 4 ># 38 "/usr/include/bits/errno.h" 3 4 >extern int *__errno_location (void) throw () __attribute__ ((__const__)); ># 37 "/usr/include/errno.h" 2 3 4 ># 55 "/usr/include/errno.h" 3 4 >extern char *program_invocation_name, *program_invocation_short_name; > > > >} ># 69 "/usr/include/errno.h" 3 4 >typedef int error_t; ># 81 "djvuserve.cpp" 2 > > >static bool cgi = false; >static bool head = false; > > >struct DJVUSERVEGlobal >{ > > > GUTF8String pathinfo; > GUTF8String pathtranslated; > GUTF8String requestmethod; > GUTF8String querystring; >}; > >static DJVUSERVEGlobal& g(void) >{ > static DJVUSERVEGlobal g; > return g; >} > > >static void >usage(void) >{ > DjVuPrintErrorUTF8( > > "DJVUSERVE --- DjVuLibre-" "3.5.16" "\n" > > "Extracts hidden text from Djvu files\n" > "\n" > "Usage: djvuserve [<djvufile>[/<djvmid>]\n" > "Outputs the specified <djvufile> with valid Content-Type,\n" > "Content-Length, and Expire HTTP headers. Bundled multipage DjVu\n" > "documents are accessed as indirect document using the <djvmid>\n" > "syntax. Specifying a <djvmid> of <index> generates an indirect page\n" > "directory pointing to the other component files.\n" > "This program is designed to be used as a CGI executable.\n" > "It uses environment variable PATH_TRANSLATED when executed\n" > "without arguments.\n\n" ); > exit(10); >} > >static const char * >day_name(int d) >{ > static const char *n[] = { > "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" > }; > if (d>=0 && d<7) > return n[d]; > return "???"; >} > >static const char* >month_name(int d) >{ > static const char *n[] = { > "Jan", "Feb", "Mar", "Apr", "May", "Jun", > "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" > }; > if (d>=0 && d<12) > return n[d]; > return "???"; >} > >void >fprintdate(FILE *f, const char *fmt, const time_t *tim) >{ > char ctim[128]; > struct tm *ttim = gmtime(tim); > > sprintf(ctim,"%3s, %02d %3s %04d %02d:%02d:%02d GMT", > day_name(ttim->tm_wday), ttim->tm_mday, > month_name(ttim->tm_mon), 1900+ttim->tm_year, > ttim->tm_hour, ttim->tm_min, ttim->tm_sec); > fprintf(stdout, fmt, ctim); >} > >void >headers(const struct stat *statbuf) >{ > fprintf(stdout,"Content-Type: image/x.djvu\n"); > fprintf(stdout,"Content-Length: %ld\n", (long)statbuf->st_size); > time_t tim = time(0) + 360 * 24 * 3600; > fprintdate(stdout, "Last-Modified: %s\n", &statbuf->st_mtim.tv_sec); > fprintdate(stdout, "Expires: %s\n", &tim); >} > >bool >is_djvu_file_bundled(GURL &pathurl) >{ > GP<ByteStream> in = ByteStream::create(pathurl,"rb"); > GP<IFFByteStream> iff = IFFByteStream::create(in); > GUTF8String chkid; > iff->get_chunk(chkid); > > if (chkid != "FORM:DJVU" && > chkid != "FORM:DJVM" && > chkid != "FORM:PM44" && > chkid != "FORM:BM44" ) > GExceptionHandler::exthrow (GException("Corrupted DjVu file", "djvuserve.cpp", 183, __PRETTY_FUNCTION__, GException::GINTERNAL)); > > if (chkid == "FORM:DJVM") > { > while (iff->get_chunk(chkid) && chkid!="DIRM") > iff->close_chunk(); > if (chkid == "DIRM") > { > GP<ByteStream> dirm = iff->get_bytestream(); > if (dirm->read8() & 0x80) > return true; > } > } > return false; >} > >void >djvuserver_file(GURL pathurl) >{ > GNativeString fname = pathurl.NativeFilename(); > struct stat statbuf; > if (stat((const char *)fname, &statbuf) < 0) > GExceptionHandler::exthrow (GException(strerror((*__errno_location ())), "djvuserve.cpp", 205, __PRETTY_FUNCTION__, GException::GINTERNAL)); > > > if (is_djvu_file_bundled(pathurl)) > { > > GUTF8String id = pathurl.name(); > fprintf(stdout,"Location: %s/index.djvu", (const char*)id); > if (g().querystring.length()) > fprintf(stdout,"?%s", (const char*)g().querystring); > fprintf(stdout,"\n\n"); > return; > } > > headers(&statbuf); > if (head) > return; > fprintf(stdout,"\n"); > fflush(stdout); > GP<ByteStream> in = ByteStream::create(pathurl,"rb"); > GP<ByteStream> out = ByteStream::get_stdout("ab"); > out->copy(*in); >} > >void >djvuserver_directory(GURL pathurl) >{ > GNativeString fname = pathurl.NativeFilename(); > struct stat statbuf; > if (stat((const char *)fname, &statbuf) < 0) > GExceptionHandler::exthrow (GException(strerror((*__errno_location ())), "djvuserve.cpp", 235, __PRETTY_FUNCTION__, GException::GINTERNAL)); > > GP<ByteStream> temp; > GP<ByteStream> bsin = ByteStream::create(pathurl,"rb"); > GP<DjVmDir> dir = DjVmDir::create(); > { > GP<IFFByteStream> iffin = IFFByteStream::create(bsin); > GUTF8String chkid; > iffin->get_chunk(chkid); > if (chkid != "FORM:DJVM") > GExceptionHandler::exthrow (GException("This is not a multipage DjVu document", "djvuserve.cpp", 245, __PRETTY_FUNCTION__, GException::GINTERNAL)); > while (iffin->get_chunk(chkid) && chkid!="DIRM") > iffin->close_chunk(); > if (chkid != "DIRM") > GExceptionHandler::exthrow (GException("This is not a new style bundled DjVu document", "djvuserve.cpp", 249, __PRETTY_FUNCTION__, GException::GINTERNAL)); > temp = iffin->get_bytestream(); > dir->decode(temp); > if (! dir->is_bundled()) > GExceptionHandler::exthrow (GException("This is not a bundled DjVu document", "djvuserve.cpp", 253, __PRETTY_FUNCTION__, GException::GINTERNAL)); > } > > GP<ByteStream> bsdir = ByteStream::create(); > { > GP<IFFByteStream> iff = IFFByteStream::create(bsdir); > iff->put_chunk("FORM:DJVM",1); > iff->put_chunk("DIRM"); > temp = iff->get_bytestream(); > dir->encode(temp, false, false); > iff->close_chunk(); > iff->close_chunk(); > } > > statbuf.st_size = bsdir->tell(); > headers(&statbuf); > if (head) > return; > bsdir->seek(0); > fprintf(stdout,"\n"); > fflush(stdout); > GP<ByteStream> out = ByteStream::get_stdout("ab"); > out->copy(*bsdir); >} > >void >djvuserver_component(GURL pathurl, GUTF8String id) >{ > GNativeString fname = pathurl.NativeFilename(); > struct stat statbuf; > if (stat((const char *)fname, &statbuf) < 0) > GExceptionHandler::exthrow (GException(strerror((*__errno_location ())), "djvuserve.cpp", 284, __PRETTY_FUNCTION__, GException::GINTERNAL)); > > GP<ByteStream> temp; > GP<ByteStream> bsin = ByteStream::create(pathurl,"rb"); > GP<DjVmDir> dir = DjVmDir::create(); > { > GP<IFFByteStream> iffin = IFFByteStream::create(bsin); > GUTF8String chkid; > iffin->get_chunk(chkid); > if (chkid != "FORM:DJVM") > GExceptionHandler::exthrow (GException("This is not a multipage DjVu document", "djvuserve.cpp", 294, __PRETTY_FUNCTION__, GException::GINTERNAL)); > while (iffin->get_chunk(chkid) && chkid!="DIRM") > iffin->close_chunk(); > if (chkid != "DIRM") > GExceptionHandler::exthrow (GException("This is not a new style bundled DjVu document", "djvuserve.cpp", 298, __PRETTY_FUNCTION__, GException::GINTERNAL)); > temp = iffin->get_bytestream(); > dir->decode(temp); > if (! dir->is_bundled()) > GExceptionHandler::exthrow (GException("This is not a bundled DjVu document", "djvuserve.cpp", 302, __PRETTY_FUNCTION__, GException::GINTERNAL)); > } > > GP<DjVmDir::File> frec = dir->id_to_file(id); > if (!frec) > GExceptionHandler::exthrow (GException("Cannot locate requested component file", "djvuserve.cpp", 307, __PRETTY_FUNCTION__, GException::GINTERNAL)); > if (!frec->size || !frec->offset) > GExceptionHandler::exthrow (GException("Corrupted DjVu directory", "djvuserve.cpp", 309, __PRETTY_FUNCTION__, GException::GINTERNAL)); > > > statbuf.st_size = frec->size + 4; > headers(&statbuf); > if (head) > return; > fprintf(stdout,"\n"); > fflush(stdout); > GP<ByteStream> out = ByteStream::get_stdout("ab"); > out->writall("AT&T", 4); > bsin->seek(frec->offset); > out->copy(*bsin, frec->size); >} > >int >main(int argc, char ** argv) >{ > setlocale(__LC_ALL,""); > djvu_programname(argv[0]); > > try > { > > if (argc == 1) > { > cgi = true; > g().pathinfo = GNativeString(getenv("PATH_INFO")); > g().pathtranslated = GNativeString(getenv("PATH_TRANSLATED")); > if (! g().pathinfo) > usage(); > if (! g().pathtranslated) > GExceptionHandler::exthrow (GException("No path information", "djvuserve.cpp", 341, __PRETTY_FUNCTION__, GException::GINTERNAL)); > g().requestmethod = GNativeString(getenv("REQUEST_METHOD")); > g().querystring = GUTF8String(getenv("QUERY_STRING")); > } > else if (argc == 2) > { > cgi = false; > g().pathtranslated = GNativeString(argv[1]); > g().requestmethod = "GET"; > } > if (! g().pathtranslated) > usage(); > head = false; > if (g().requestmethod == "HEAD") > head = true; > else if (g().requestmethod != "GET") > GExceptionHandler::exthrow (GException("Only serve HEAD and GET requests", "djvuserve.cpp", 357, __PRETTY_FUNCTION__, GException::GINTERNAL)); > > GURL pathurl = GURL::Filename::UTF8(g().pathtranslated); > if (pathurl.is_file()) > { > djvuserver_file(pathurl); > } > else > { > GUTF8String id = pathurl.name(); > pathurl = pathurl.base(); > if (! pathurl.is_file()) > GExceptionHandler::exthrow (GException("File not found", "djvuserve.cpp", 369, __PRETTY_FUNCTION__, GException::GINTERNAL)); > if (id == "index" || id == "index.djvu") > djvuserver_directory(pathurl); > else > djvuserver_component(pathurl, id); > } > } > catch(const GException &ex) { > { > if (cgi) > { > GUTF8String cause = DjVuMessageLite::LookUpUTF8(ex.get_cause()); > fprintf(stdout,"Status: 400 %s\n", (const char*)cause); > fprintf(stdout,"Content-Type: text/html\n\n"); > fprintf(stdout, > "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" > "<HTML><HEAD><TITLE>400 Error</TITLE></HEAD><BODY>\n" > "<H1>%s</H1>The requested URL '%s' cannot be processed.<P>\n" > "<HR><ADDRESS>djvuserve/DjVuLibre-" "3.5.16" "</ADDRESS>\n" > "</BODY></HTML>\n", > (const char *) cause, > (const char *) g().pathinfo ); > } > else > { > ex.perror(); > } > exit(10); > } > }; > exit(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 127325
: 82942