Skip to content

Instantly share code, notes, and snippets.

@danielmatz
Created April 9, 2014 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmatz/10211893 to your computer and use it in GitHub Desktop.
Save danielmatz/10211893 to your computer and use it in GitHub Desktop.
# 1 "mimedb.cpp"
# 1 "/Users/dmatz/Data/Projects/fish-shell//"
# 1 "<command-line>"
# 1 "mimedb.cpp"
# 22 "mimedb.cpp"
# 1 "config.h" 1
# 23 "mimedb.cpp" 2
# 1 "/usr/include/string.h" 1 3 4
# 61 "/usr/include/string.h" 3 4
# 1 "/usr/include/_types.h" 1 3 4
# 27 "/usr/include/_types.h" 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 32 "/usr/include/sys/_types.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 484 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/sys/_symbol_aliasing.h" 1 3 4
# 485 "/usr/include/sys/cdefs.h" 2 3 4
# 550 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/sys/_posix_availability.h" 1 3 4
# 551 "/usr/include/sys/cdefs.h" 2 3 4
# 33 "/usr/include/sys/_types.h" 2 3 4
# 1 "/usr/include/machine/_types.h" 1 3 4
# 32 "/usr/include/machine/_types.h" 3 4
# 1 "/usr/include/i386/_types.h" 1 3 4
# 37 "/usr/include/i386/_types.h" 3 4
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
# 70 "/usr/include/i386/_types.h" 3 4
typedef int __darwin_ct_rune_t;
typedef union {
char __mbstate8[128];
long long _mbstateL;
} __mbstate_t;
typedef __mbstate_t __darwin_mbstate_t;
typedef long int __darwin_ptrdiff_t;
typedef long unsigned int __darwin_size_t;
typedef __builtin_va_list __darwin_va_list;
typedef int __darwin_wchar_t;
typedef __darwin_wchar_t __darwin_rune_t;
typedef int __darwin_wint_t;
typedef unsigned long __darwin_clock_t;
typedef __uint32_t __darwin_socklen_t;
typedef long __darwin_ssize_t;
typedef long __darwin_time_t;
# 33 "/usr/include/machine/_types.h" 2 3 4
# 34 "/usr/include/sys/_types.h" 2 3 4
# 58 "/usr/include/sys/_types.h" 3 4
struct __darwin_pthread_handler_rec
{
void (*__routine)(void *);
void *__arg;
struct __darwin_pthread_handler_rec *__next;
};
struct _opaque_pthread_attr_t { long __sig; char __opaque[56]; };
struct _opaque_pthread_cond_t { long __sig; char __opaque[40]; };
struct _opaque_pthread_condattr_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_mutex_t { long __sig; char __opaque[56]; };
struct _opaque_pthread_mutexattr_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_once_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_rwlock_t { long __sig; char __opaque[192]; };
struct _opaque_pthread_rwlockattr_t { long __sig; char __opaque[16]; };
struct _opaque_pthread_t { long __sig; struct __darwin_pthread_handler_rec *__cleanup_stack; char __opaque[1168]; };
# 94 "/usr/include/sys/_types.h" 3 4
typedef __int64_t __darwin_blkcnt_t;
typedef __int32_t __darwin_blksize_t;
typedef __int32_t __darwin_dev_t;
typedef unsigned int __darwin_fsblkcnt_t;
typedef unsigned int __darwin_fsfilcnt_t;
typedef __uint32_t __darwin_gid_t;
typedef __uint32_t __darwin_id_t;
typedef __uint64_t __darwin_ino64_t;
typedef __darwin_ino64_t __darwin_ino_t;
typedef __darwin_natural_t __darwin_mach_port_name_t;
typedef __darwin_mach_port_name_t __darwin_mach_port_t;
typedef __uint16_t __darwin_mode_t;
typedef __int64_t __darwin_off_t;
typedef __int32_t __darwin_pid_t;
typedef struct _opaque_pthread_attr_t
__darwin_pthread_attr_t;
typedef struct _opaque_pthread_cond_t
__darwin_pthread_cond_t;
typedef struct _opaque_pthread_condattr_t
__darwin_pthread_condattr_t;
typedef unsigned long __darwin_pthread_key_t;
typedef struct _opaque_pthread_mutex_t
__darwin_pthread_mutex_t;
typedef struct _opaque_pthread_mutexattr_t
__darwin_pthread_mutexattr_t;
typedef struct _opaque_pthread_once_t
__darwin_pthread_once_t;
typedef struct _opaque_pthread_rwlock_t
__darwin_pthread_rwlock_t;
typedef struct _opaque_pthread_rwlockattr_t
__darwin_pthread_rwlockattr_t;
typedef struct _opaque_pthread_t
*__darwin_pthread_t;
typedef __uint32_t __darwin_sigset_t;
typedef __int32_t __darwin_suseconds_t;
typedef __uint32_t __darwin_uid_t;
typedef __uint32_t __darwin_useconds_t;
typedef unsigned char __darwin_uuid_t[16];
typedef char __darwin_uuid_string_t[37];
# 28 "/usr/include/_types.h" 2 3 4
# 39 "/usr/include/_types.h" 3 4
typedef int __darwin_nl_item;
typedef int __darwin_wctrans_t;
typedef __uint32_t __darwin_wctype_t;
# 62 "/usr/include/string.h" 2 3 4
# 1 "/usr/include/Availability.h" 1 3 4
# 148 "/usr/include/Availability.h" 3 4
# 1 "/usr/include/AvailabilityInternal.h" 1 3 4
# 149 "/usr/include/Availability.h" 2 3 4
# 64 "/usr/include/string.h" 2 3 4
# 1 "/usr/include/sys/_types/_size_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_size_t.h" 3 4
typedef __darwin_size_t size_t;
# 65 "/usr/include/string.h" 2 3 4
# 1 "/usr/include/sys/_types/_null.h" 1 3 4
# 66 "/usr/include/string.h" 2 3 4
extern "C" {
void *memchr(const void *, int, size_t);
int memcmp(const void *, const void *, size_t);
void *memcpy(void *, const void *, size_t);
void *memmove(void *, const void *, size_t);
void *memset(void *, int, size_t);
char *strcat(char *, const char *);
char *strchr(const char *, int);
int strcmp(const char *, const char *);
int strcoll(const char *, const char *);
char *strcpy(char *, const char *);
size_t strcspn(const char *, const char *);
char *strerror(int) __asm("_" "strerror" );
size_t strlen(const char *);
char *strncat(char *, const char *, size_t);
int strncmp(const char *, const char *, size_t);
char *strncpy(char *, const char *, size_t);
char *strpbrk(const char *, const char *);
char *strrchr(const char *, int);
size_t strspn(const char *, const char *);
char *strstr(const char *, const char *);
char *strtok(char *, const char *);
size_t strxfrm(char *, const char *, size_t);
}
# 103 "/usr/include/string.h" 3 4
extern "C" {
char *strtok_r(char *, const char *, char **);
}
# 115 "/usr/include/string.h" 3 4
extern "C" {
int strerror_r(int, char *, size_t);
char *strdup(const char *);
void *memccpy(void *, const void *, int, size_t);
}
# 129 "/usr/include/string.h" 3 4
extern "C" {
char *stpcpy(char *, const char *);
char *stpncpy(char *, const char *, size_t) ;
char *strndup(const char *, size_t) ;
size_t strnlen(const char *, size_t) ;
char *strsignal(int sig);
}
# 1 "/usr/include/sys/_types/_rsize_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_rsize_t.h" 3 4
typedef __darwin_size_t rsize_t;
# 142 "/usr/include/string.h" 2 3 4
# 1 "/usr/include/sys/_types/_errno_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_errno_t.h" 3 4
typedef int errno_t;
# 143 "/usr/include/string.h" 2 3 4
extern "C" {
errno_t memset_s(void *, rsize_t, int, rsize_t) ;
}
# 1 "/usr/include/sys/_types/_ssize_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_ssize_t.h" 3 4
typedef __darwin_ssize_t ssize_t;
# 153 "/usr/include/string.h" 2 3 4
extern "C" {
void *memmem(const void *, size_t, const void *, size_t) ;
void memset_pattern4(void *, const void *, size_t) ;
void memset_pattern8(void *, const void *, size_t) ;
void memset_pattern16(void *, const void *, size_t) ;
char *strcasestr(const char *, const char *);
char *strnstr(const char *, const char *, size_t);
size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
void strmode(int, char *);
char *strsep(char **, const char *);
void swab(const void * , void * , ssize_t);
}
# 1 "/usr/include/strings.h" 1 3 4
# 67 "/usr/include/strings.h" 3 4
extern "C" {
int bcmp(const void *, const void *, size_t) ;
void bcopy(const void *, void *, size_t) ;
void bzero(void *, size_t) ;
char *index(const char *, int) ;
char *rindex(const char *, int) ;
int ffs(int);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
}
extern "C" {
int ffsl(long) ;
int ffsll(long long) ;
int fls(int) ;
int flsl(long) ;
int flsll(long long) ;
}
# 1 "/usr/include/string.h" 1 3 4
# 93 "/usr/include/strings.h" 2 3 4
# 177 "/usr/include/string.h" 2 3 4
# 26 "mimedb.cpp" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 71 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/sys/_types/_va_list.h" 1 3 4
# 31 "/usr/include/sys/_types/_va_list.h" 3 4
typedef __darwin_va_list va_list;
# 72 "/usr/include/stdio.h" 2 3 4
typedef __darwin_off_t fpos_t;
# 86 "/usr/include/stdio.h" 3 4
struct __sbuf {
unsigned char *_base;
int _size;
};
struct __sFILEX;
# 120 "/usr/include/stdio.h" 3 4
typedef struct __sFILE {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
void *_cookie;
int (*_close)(void *);
int (*_read) (void *, char *, int);
fpos_t (*_seek) (void *, fpos_t, int);
int (*_write)(void *, const char *, int);
struct __sbuf _ub;
struct __sFILEX *_extra;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
fpos_t _offset;
} FILE;
extern "C" {
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
}
# 228 "/usr/include/stdio.h" 3 4
extern "C" {
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * , fpos_t *);
char *fgets(char * , int, FILE *);
FILE *fopen(const char * , const char * ) __asm("_" "fopen" );
int fprintf(FILE * , const char * , ...) __attribute__((__format__ (__printf__, 2, 3)));
int fputc(int, FILE *);
int fputs(const char * , FILE * ) __asm("_" "fputs" );
size_t fread(void * , size_t, size_t, FILE * );
FILE *freopen(const char * , const char * ,
FILE * ) __asm("_" "freopen" );
int fscanf(FILE * , const char * , ...) __attribute__((__format__ (__scanf__, 2, 3)));
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * , size_t, size_t, FILE * ) __asm("_" "fwrite" );
int getc(FILE *);
int getchar(void);
char *gets(char *);
void perror(const char *);
int printf(const char * , ...) __attribute__((__format__ (__printf__, 1, 2)));
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename (const char *, const char *);
void rewind(FILE *);
int scanf(const char * , ...) __attribute__((__format__ (__scanf__, 1, 2)));
void setbuf(FILE * , char * );
int setvbuf(FILE * , char * , int, size_t);
int sprintf(char * , const char * , ...) __attribute__((__format__ (__printf__, 2, 3)));
int sscanf(const char * , const char * , ...) __attribute__((__format__ (__scanf__, 2, 3)));
FILE *tmpfile(void);
__attribute__((deprecated("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")))
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE * , const char * , va_list) __attribute__((__format__ (__printf__, 2, 0)));
int vprintf(const char * , va_list) __attribute__((__format__ (__printf__, 1, 0)));
int vsprintf(char * , const char * , va_list) __attribute__((__format__ (__printf__, 2, 0)));
}
# 290 "/usr/include/stdio.h" 3 4
extern "C" {
char *ctermid(char *);
FILE *fdopen(int, const char *) __asm("_" "fdopen" );
int fileno(FILE *);
}
# 312 "/usr/include/stdio.h" 3 4
extern "C" {
int pclose(FILE *);
FILE *popen(const char *, const char *) __asm("_" "popen" );
}
# 334 "/usr/include/stdio.h" 3 4
extern "C" {
int __srget(FILE *);
int __svfscanf(FILE *, const char *, va_list) __attribute__((__format__ (__scanf__, 2, 0)));
int __swbuf(int, FILE *);
}
inline __attribute__ ((__always_inline__)) int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
# 371 "/usr/include/stdio.h" 3 4
extern "C" {
void flockfile(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
int getw(FILE *);
int putw(int, FILE *);
__attribute__((deprecated("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.")))
char *tempnam(const char *, const char *) __asm("_" "tempnam" );
}
# 409 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/sys/_types/_off_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_off_t.h" 3 4
typedef __darwin_off_t off_t;
# 410 "/usr/include/stdio.h" 2 3 4
extern "C" {
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
}
extern "C" {
int snprintf(char * , size_t, const char * , ...) __attribute__((__format__ (__printf__, 3, 4)));
int vfscanf(FILE * , const char * , va_list) __attribute__((__format__ (__scanf__, 2, 0)));
int vscanf(const char * , va_list) __attribute__((__format__ (__scanf__, 1, 0)));
int vsnprintf(char * , size_t, const char * , va_list) __attribute__((__format__ (__printf__, 3, 0)));
int vsscanf(const char * , const char * , va_list) __attribute__((__format__ (__scanf__, 2, 0)));
}
# 436 "/usr/include/stdio.h" 3 4
extern "C" {
int dprintf(int, const char * , ...) __attribute__((__format__ (__printf__, 2, 3))) ;
int vdprintf(int, const char * , va_list) __attribute__((__format__ (__printf__, 2, 0))) ;
ssize_t getdelim(char ** , size_t * , int, FILE * ) ;
ssize_t getline(char ** , size_t * , FILE * ) ;
}
extern "C" {
extern const int sys_nerr;
extern const char *const sys_errlist[];
int asprintf(char ** , const char * , ...) __attribute__((__format__ (__printf__, 2, 3)));
char *ctermid_r(char *);
char *fgetln(FILE *, size_t *);
const char *fmtcheck(const char *, const char *);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char ** , const char * , va_list) __attribute__((__format__ (__printf__, 2, 0)));
FILE *zopen(const char *, const char *, int);
FILE *funopen(const void *,
int (*)(void *, char *, int),
int (*)(void *, const char *, int),
fpos_t (*)(void *, fpos_t, int),
int (*)(void *));
}
# 27 "mimedb.cpp" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 65 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/sys/wait.h" 1 3 4
# 79 "/usr/include/sys/wait.h" 3 4
typedef enum {
P_ALL,
P_PID,
P_PGID
} idtype_t;
# 1 "/usr/include/sys/_types/_pid_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pid_t.h" 3 4
typedef __darwin_pid_t pid_t;
# 90 "/usr/include/sys/wait.h" 2 3 4
# 1 "/usr/include/sys/_types/_id_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_id_t.h" 3 4
typedef __darwin_id_t id_t;
# 91 "/usr/include/sys/wait.h" 2 3 4
# 109 "/usr/include/sys/wait.h" 3 4
# 1 "/usr/include/sys/signal.h" 1 3 4
# 73 "/usr/include/sys/signal.h" 3 4
# 1 "/usr/include/sys/appleapiopts.h" 1 3 4
# 74 "/usr/include/sys/signal.h" 2 3 4
# 1 "/usr/include/machine/signal.h" 1 3 4
# 32 "/usr/include/machine/signal.h" 3 4
# 1 "/usr/include/i386/signal.h" 1 3 4
# 39 "/usr/include/i386/signal.h" 3 4
typedef int sig_atomic_t;
# 33 "/usr/include/machine/signal.h" 2 3 4
# 82 "/usr/include/sys/signal.h" 2 3 4
# 145 "/usr/include/sys/signal.h" 3 4
# 1 "/usr/include/machine/_mcontext.h" 1 3 4
# 29 "/usr/include/machine/_mcontext.h" 3 4
# 1 "/usr/include/i386/_mcontext.h" 1 3 4
# 33 "/usr/include/i386/_mcontext.h" 3 4
# 1 "/usr/include/mach/i386/_structs.h" 1 3 4
# 43 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_i386_thread_state
{
unsigned int __eax;
unsigned int __ebx;
unsigned int __ecx;
unsigned int __edx;
unsigned int __edi;
unsigned int __esi;
unsigned int __ebp;
unsigned int __esp;
unsigned int __ss;
unsigned int __eflags;
unsigned int __eip;
unsigned int __cs;
unsigned int __ds;
unsigned int __es;
unsigned int __fs;
unsigned int __gs;
};
# 89 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_fp_control
{
unsigned short __invalid :1,
__denorm :1,
__zdiv :1,
__ovrfl :1,
__undfl :1,
__precis :1,
:2,
__pc :2,
__rc :2,
:1,
:3;
};
typedef struct __darwin_fp_control __darwin_fp_control_t;
# 147 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_fp_status
{
unsigned short __invalid :1,
__denorm :1,
__zdiv :1,
__ovrfl :1,
__undfl :1,
__precis :1,
__stkflt :1,
__errsumm :1,
__c0 :1,
__c1 :1,
__c2 :1,
__tos :3,
__c3 :1,
__busy :1;
};
typedef struct __darwin_fp_status __darwin_fp_status_t;
# 191 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_mmst_reg
{
char __mmst_reg[10];
char __mmst_rsrv[6];
};
# 210 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_xmm_reg
{
char __xmm_reg[16];
};
# 232 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_i386_float_state
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
char __fpu_rsrv4[14*16];
int __fpu_reserved1;
};
struct __darwin_i386_avx_state
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
char __fpu_rsrv4[14*16];
int __fpu_reserved1;
char __avx_reserved1[64];
struct __darwin_xmm_reg __fpu_ymmh0;
struct __darwin_xmm_reg __fpu_ymmh1;
struct __darwin_xmm_reg __fpu_ymmh2;
struct __darwin_xmm_reg __fpu_ymmh3;
struct __darwin_xmm_reg __fpu_ymmh4;
struct __darwin_xmm_reg __fpu_ymmh5;
struct __darwin_xmm_reg __fpu_ymmh6;
struct __darwin_xmm_reg __fpu_ymmh7;
};
# 402 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_i386_exception_state
{
__uint16_t __trapno;
__uint16_t __cpu;
__uint32_t __err;
__uint32_t __faultvaddr;
};
# 422 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_x86_debug_state32
{
unsigned int __dr0;
unsigned int __dr1;
unsigned int __dr2;
unsigned int __dr3;
unsigned int __dr4;
unsigned int __dr5;
unsigned int __dr6;
unsigned int __dr7;
};
# 454 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_x86_thread_state64
{
__uint64_t __rax;
__uint64_t __rbx;
__uint64_t __rcx;
__uint64_t __rdx;
__uint64_t __rdi;
__uint64_t __rsi;
__uint64_t __rbp;
__uint64_t __rsp;
__uint64_t __r8;
__uint64_t __r9;
__uint64_t __r10;
__uint64_t __r11;
__uint64_t __r12;
__uint64_t __r13;
__uint64_t __r14;
__uint64_t __r15;
__uint64_t __rip;
__uint64_t __rflags;
__uint64_t __cs;
__uint64_t __fs;
__uint64_t __gs;
};
# 509 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_x86_float_state64
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
struct __darwin_xmm_reg __fpu_xmm8;
struct __darwin_xmm_reg __fpu_xmm9;
struct __darwin_xmm_reg __fpu_xmm10;
struct __darwin_xmm_reg __fpu_xmm11;
struct __darwin_xmm_reg __fpu_xmm12;
struct __darwin_xmm_reg __fpu_xmm13;
struct __darwin_xmm_reg __fpu_xmm14;
struct __darwin_xmm_reg __fpu_xmm15;
char __fpu_rsrv4[6*16];
int __fpu_reserved1;
};
struct __darwin_x86_avx_state64
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
struct __darwin_xmm_reg __fpu_xmm8;
struct __darwin_xmm_reg __fpu_xmm9;
struct __darwin_xmm_reg __fpu_xmm10;
struct __darwin_xmm_reg __fpu_xmm11;
struct __darwin_xmm_reg __fpu_xmm12;
struct __darwin_xmm_reg __fpu_xmm13;
struct __darwin_xmm_reg __fpu_xmm14;
struct __darwin_xmm_reg __fpu_xmm15;
char __fpu_rsrv4[6*16];
int __fpu_reserved1;
char __avx_reserved1[64];
struct __darwin_xmm_reg __fpu_ymmh0;
struct __darwin_xmm_reg __fpu_ymmh1;
struct __darwin_xmm_reg __fpu_ymmh2;
struct __darwin_xmm_reg __fpu_ymmh3;
struct __darwin_xmm_reg __fpu_ymmh4;
struct __darwin_xmm_reg __fpu_ymmh5;
struct __darwin_xmm_reg __fpu_ymmh6;
struct __darwin_xmm_reg __fpu_ymmh7;
struct __darwin_xmm_reg __fpu_ymmh8;
struct __darwin_xmm_reg __fpu_ymmh9;
struct __darwin_xmm_reg __fpu_ymmh10;
struct __darwin_xmm_reg __fpu_ymmh11;
struct __darwin_xmm_reg __fpu_ymmh12;
struct __darwin_xmm_reg __fpu_ymmh13;
struct __darwin_xmm_reg __fpu_ymmh14;
struct __darwin_xmm_reg __fpu_ymmh15;
};
# 751 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_x86_exception_state64
{
__uint16_t __trapno;
__uint16_t __cpu;
__uint32_t __err;
__uint64_t __faultvaddr;
};
# 771 "/usr/include/mach/i386/_structs.h" 3 4
struct __darwin_x86_debug_state64
{
__uint64_t __dr0;
__uint64_t __dr1;
__uint64_t __dr2;
__uint64_t __dr3;
__uint64_t __dr4;
__uint64_t __dr5;
__uint64_t __dr6;
__uint64_t __dr7;
};
# 34 "/usr/include/i386/_mcontext.h" 2 3 4
struct __darwin_mcontext32
{
struct __darwin_i386_exception_state __es;
struct __darwin_i386_thread_state __ss;
struct __darwin_i386_float_state __fs;
};
struct __darwin_mcontext_avx32
{
struct __darwin_i386_exception_state __es;
struct __darwin_i386_thread_state __ss;
struct __darwin_i386_avx_state __fs;
};
# 76 "/usr/include/i386/_mcontext.h" 3 4
struct __darwin_mcontext64
{
struct __darwin_x86_exception_state64 __es;
struct __darwin_x86_thread_state64 __ss;
struct __darwin_x86_float_state64 __fs;
};
struct __darwin_mcontext_avx64
{
struct __darwin_x86_exception_state64 __es;
struct __darwin_x86_thread_state64 __ss;
struct __darwin_x86_avx_state64 __fs;
};
# 115 "/usr/include/i386/_mcontext.h" 3 4
typedef struct __darwin_mcontext64 *mcontext_t;
# 30 "/usr/include/machine/_mcontext.h" 2 3 4
# 146 "/usr/include/sys/signal.h" 2 3 4
# 1 "/usr/include/sys/_types/_sigaltstack.h" 1 3 4
# 36 "/usr/include/sys/_types/_sigaltstack.h" 3 4
struct __darwin_sigaltstack
{
void *ss_sp;
__darwin_size_t ss_size;
int ss_flags;
};
typedef struct __darwin_sigaltstack stack_t;
# 147 "/usr/include/sys/signal.h" 2 3 4
# 1 "/usr/include/sys/_types/_ucontext.h" 1 3 4
# 34 "/usr/include/sys/_types/_ucontext.h" 3 4
struct __darwin_ucontext
{
int uc_onstack;
__darwin_sigset_t uc_sigmask;
struct __darwin_sigaltstack uc_stack;
struct __darwin_ucontext *uc_link;
__darwin_size_t uc_mcsize;
struct __darwin_mcontext64 *uc_mcontext;
};
typedef struct __darwin_ucontext ucontext_t;
# 148 "/usr/include/sys/signal.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_attr_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_attr_t.h" 3 4
typedef __darwin_pthread_attr_t pthread_attr_t;
# 151 "/usr/include/sys/signal.h" 2 3 4
# 1 "/usr/include/sys/_types/_sigset_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_sigset_t.h" 3 4
typedef __darwin_sigset_t sigset_t;
# 152 "/usr/include/sys/signal.h" 2 3 4
# 1 "/usr/include/sys/_types/_uid_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_uid_t.h" 3 4
typedef __darwin_uid_t uid_t;
# 154 "/usr/include/sys/signal.h" 2 3 4
union sigval {
int sival_int;
void *sival_ptr;
};
struct sigevent {
int sigev_notify;
int sigev_signo;
union sigval sigev_value;
void (*sigev_notify_function)(union sigval);
pthread_attr_t *sigev_notify_attributes;
};
typedef struct __siginfo {
int si_signo;
int si_errno;
int si_code;
pid_t si_pid;
uid_t si_uid;
int si_status;
void *si_addr;
union sigval si_value;
long si_band;
unsigned long __pad[7];
} siginfo_t;
# 266 "/usr/include/sys/signal.h" 3 4
union __sigaction_u {
void (*__sa_handler)(int);
void (*__sa_sigaction)(int, struct __siginfo *,
void *);
};
struct __sigaction {
union __sigaction_u __sigaction_u;
void (*sa_tramp)(void *, int, int, siginfo_t *, void *);
sigset_t sa_mask;
int sa_flags;
};
struct sigaction {
union __sigaction_u __sigaction_u;
sigset_t sa_mask;
int sa_flags;
};
# 328 "/usr/include/sys/signal.h" 3 4
typedef void (*sig_t)(int);
# 345 "/usr/include/sys/signal.h" 3 4
struct sigvec {
void (*sv_handler)(int);
int sv_mask;
int sv_flags;
};
# 364 "/usr/include/sys/signal.h" 3 4
struct sigstack {
char *ss_sp;
int ss_onstack;
};
# 386 "/usr/include/sys/signal.h" 3 4
extern "C" {
void (*signal(int, void (*)(int)))(int);
}
# 110 "/usr/include/sys/wait.h" 2 3 4
# 1 "/usr/include/sys/resource.h" 1 3 4
# 72 "/usr/include/sys/resource.h" 3 4
# 1 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include/stdint.h" 1 3 4
# 9 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include/stdint.h" 3 4
# 1 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 1 3 4
# 27 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 3 4
# 1 "/usr/include/sys/_types/_int8_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_int8_t.h" 3 4
typedef signed char int8_t;
# 28 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/sys/_types/_int16_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_int16_t.h" 3 4
typedef short int16_t;
# 29 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/sys/_types/_int32_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_int32_t.h" 3 4
typedef int int32_t;
# 30 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/sys/_types/_int64_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_int64_t.h" 3 4
typedef long long int64_t;
# 31 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/_types/_uint8_t.h" 1 3 4
# 31 "/usr/include/_types/_uint8_t.h" 3 4
typedef unsigned char uint8_t;
# 33 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/_types/_uint16_t.h" 1 3 4
# 31 "/usr/include/_types/_uint16_t.h" 3 4
typedef unsigned short uint16_t;
# 34 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/_types/_uint32_t.h" 1 3 4
# 31 "/usr/include/_types/_uint32_t.h" 3 4
typedef unsigned int uint32_t;
# 35 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/_types/_uint64_t.h" 1 3 4
# 31 "/usr/include/_types/_uint64_t.h" 3 4
typedef unsigned long long uint64_t;
# 36 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
# 1 "/usr/include/sys/_types/_intptr_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_intptr_t.h" 3 4
typedef __darwin_intptr_t intptr_t;
# 63 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/sys/_types/_uintptr_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_uintptr_t.h" 3 4
typedef unsigned long uintptr_t;
# 64 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/_types/_intmax_t.h" 1 3 4
# 32 "/usr/include/_types/_intmax_t.h" 3 4
typedef long int intmax_t;
# 68 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 1 "/usr/include/_types/_uintmax_t.h" 1 3 4
# 32 "/usr/include/_types/_uintmax_t.h" 3 4
typedef long unsigned int uintmax_t;
# 69 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/stdint.h" 2 3 4
# 10 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include/stdint.h" 2 3 4
# 73 "/usr/include/sys/resource.h" 2 3 4
# 1 "/usr/include/sys/_types/_timeval.h" 1 3 4
# 30 "/usr/include/sys/_types/_timeval.h" 3 4
struct timeval
{
__darwin_time_t tv_sec;
__darwin_suseconds_t tv_usec;
};
# 81 "/usr/include/sys/resource.h" 2 3 4
# 89 "/usr/include/sys/resource.h" 3 4
typedef __uint64_t rlim_t;
# 151 "/usr/include/sys/resource.h" 3 4
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
# 162 "/usr/include/sys/resource.h" 3 4
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
# 190 "/usr/include/sys/resource.h" 3 4
typedef void *rusage_info_t;
struct rusage_info_v0 {
uint8_t ri_uuid[16];
uint64_t ri_user_time;
uint64_t ri_system_time;
uint64_t ri_pkg_idle_wkups;
uint64_t ri_interrupt_wkups;
uint64_t ri_pageins;
uint64_t ri_wired_size;
uint64_t ri_resident_size;
uint64_t ri_phys_footprint;
uint64_t ri_proc_start_abstime;
uint64_t ri_proc_exit_abstime;
};
struct rusage_info_v1 {
uint8_t ri_uuid[16];
uint64_t ri_user_time;
uint64_t ri_system_time;
uint64_t ri_pkg_idle_wkups;
uint64_t ri_interrupt_wkups;
uint64_t ri_pageins;
uint64_t ri_wired_size;
uint64_t ri_resident_size;
uint64_t ri_phys_footprint;
uint64_t ri_proc_start_abstime;
uint64_t ri_proc_exit_abstime;
uint64_t ri_child_user_time;
uint64_t ri_child_system_time;
uint64_t ri_child_pkg_idle_wkups;
uint64_t ri_child_interrupt_wkups;
uint64_t ri_child_pageins;
uint64_t ri_child_elapsed_abstime;
};
struct rusage_info_v2 {
uint8_t ri_uuid[16];
uint64_t ri_user_time;
uint64_t ri_system_time;
uint64_t ri_pkg_idle_wkups;
uint64_t ri_interrupt_wkups;
uint64_t ri_pageins;
uint64_t ri_wired_size;
uint64_t ri_resident_size;
uint64_t ri_phys_footprint;
uint64_t ri_proc_start_abstime;
uint64_t ri_proc_exit_abstime;
uint64_t ri_child_user_time;
uint64_t ri_child_system_time;
uint64_t ri_child_pkg_idle_wkups;
uint64_t ri_child_interrupt_wkups;
uint64_t ri_child_pageins;
uint64_t ri_child_elapsed_abstime;
uint64_t ri_diskio_bytesread;
uint64_t ri_diskio_byteswritten;
};
# 290 "/usr/include/sys/resource.h" 3 4
struct rlimit {
rlim_t rlim_cur;
rlim_t rlim_max;
};
# 317 "/usr/include/sys/resource.h" 3 4
struct proc_rlimit_control_wakeupmon {
uint32_t wm_flags;
int32_t wm_rate;
};
# 346 "/usr/include/sys/resource.h" 3 4
extern "C" {
int getpriority(int, id_t);
int getiopolicy_np(int, int) ;
int getrlimit(int, struct rlimit *) __asm("_" "getrlimit" );
int getrusage(int, struct rusage *);
int setpriority(int, id_t, int);
int setiopolicy_np(int, int, int) ;
int setrlimit(int, const struct rlimit *) __asm("_" "setrlimit" );
}
# 111 "/usr/include/sys/wait.h" 2 3 4
# 186 "/usr/include/sys/wait.h" 3 4
# 1 "/usr/include/machine/endian.h" 1 3 4
# 35 "/usr/include/machine/endian.h" 3 4
# 1 "/usr/include/i386/endian.h" 1 3 4
# 99 "/usr/include/i386/endian.h" 3 4
# 1 "/usr/include/sys/_endian.h" 1 3 4
# 124 "/usr/include/sys/_endian.h" 3 4
# 1 "/usr/include/libkern/_OSByteOrder.h" 1 3 4
# 66 "/usr/include/libkern/_OSByteOrder.h" 3 4
# 1 "/usr/include/libkern/i386/_OSByteOrder.h" 1 3 4
# 44 "/usr/include/libkern/i386/_OSByteOrder.h" 3 4
static inline
__uint16_t
_OSSwapInt16(
__uint16_t _data
)
{
return ((__uint16_t)((_data << 8) | (_data >> 8)));
}
static inline
__uint32_t
_OSSwapInt32(
__uint32_t _data
)
{
__asm__ ("bswap %0" : "+r" (_data));
return _data;
}
# 91 "/usr/include/libkern/i386/_OSByteOrder.h" 3 4
static inline
__uint64_t
_OSSwapInt64(
__uint64_t _data
)
{
__asm__ ("bswap %0" : "+r" (_data));
return _data;
}
# 67 "/usr/include/libkern/_OSByteOrder.h" 2 3 4
# 125 "/usr/include/sys/_endian.h" 2 3 4
# 100 "/usr/include/i386/endian.h" 2 3 4
# 36 "/usr/include/machine/endian.h" 2 3 4
# 187 "/usr/include/sys/wait.h" 2 3 4
union wait {
int w_status;
struct {
unsigned int w_Termsig:7,
w_Coredump:1,
w_Retcode:8,
w_Filler:16;
} w_T;
struct {
unsigned int w_Stopval:8,
w_Stopsig:8,
w_Filler:16;
} w_S;
};
# 247 "/usr/include/sys/wait.h" 3 4
extern "C" {
pid_t wait(int *) __asm("_" "wait" );
pid_t waitpid(pid_t, int *, int) __asm("_" "waitpid" );
int waitid(idtype_t, id_t, siginfo_t *, int) __asm("_" "waitid" );
pid_t wait3(int *, int, struct rusage *);
pid_t wait4(pid_t, int *, int, struct rusage *);
}
# 66 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/alloca.h" 1 3 4
# 31 "/usr/include/alloca.h" 3 4
extern "C" {
void *alloca(size_t);
}
# 68 "/usr/include/stdlib.h" 2 3 4
# 76 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/sys/_types/_ct_rune_t.h" 1 3 4
# 31 "/usr/include/sys/_types/_ct_rune_t.h" 3 4
typedef __darwin_ct_rune_t ct_rune_t;
# 77 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/sys/_types/_rune_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_rune_t.h" 3 4
typedef __darwin_rune_t rune_t;
# 78 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/sys/_types/_wchar_t.h" 1 3 4
# 81 "/usr/include/stdlib.h" 2 3 4
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef struct {
long long quot;
long long rem;
} lldiv_t;
# 117 "/usr/include/stdlib.h" 3 4
extern int __mb_cur_max;
# 127 "/usr/include/stdlib.h" 3 4
extern "C" {
void abort(void) __attribute__((noreturn));
int abs(int) __attribute__((const));
int atexit(void (*)(void));
double atof(const char *);
int atoi(const char *);
long atol(const char *);
long long
atoll(const char *);
void *bsearch(const void *, const void *, size_t,
size_t, int (*)(const void *, const void *));
void *calloc(size_t, size_t);
div_t div(int, int) __attribute__((const));
void exit(int) __attribute__((noreturn));
void free(void *);
char *getenv(const char *);
long labs(long) __attribute__((const));
ldiv_t ldiv(long, long) __attribute__((const));
long long
llabs(long long);
lldiv_t lldiv(long long, long long);
void *malloc(size_t);
int mblen(const char *, size_t);
size_t mbstowcs(wchar_t * , const char * , size_t);
int mbtowc(wchar_t * , const char * , size_t);
int posix_memalign(void **, size_t, size_t) ;
void qsort(void *, size_t, size_t,
int (*)(const void *, const void *));
int rand(void);
void *realloc(void *, size_t);
void srand(unsigned);
double strtod(const char *, char **) __asm("_" "strtod" );
float strtof(const char *, char **) __asm("_" "strtof" );
long strtol(const char *, char **, int);
long double
strtold(const char *, char **);
long long
strtoll(const char *, char **, int);
unsigned long
strtoul(const char *, char **, int);
unsigned long long
strtoull(const char *, char **, int);
int system(const char *) __asm("_" "system" );
size_t wcstombs(char * , const wchar_t * , size_t);
int wctomb(char *, wchar_t);
void _Exit(int) __attribute__((noreturn));
long a64l(const char *);
double drand48(void);
char *ecvt(double, int, int *, int *);
double erand48(unsigned short[3]);
char *fcvt(double, int, int *, int *);
char *gcvt(double, int, char *);
int getsubopt(char **, char * const *, char **);
int grantpt(int);
char *initstate(unsigned, char *, size_t);
long jrand48(unsigned short[3]);
char *l64a(long);
void lcong48(unsigned short[7]);
long lrand48(void);
char *mktemp(char *);
int mkstemp(char *);
long mrand48(void);
long nrand48(unsigned short[3]);
int posix_openpt(int);
char *ptsname(int);
int putenv(char *) __asm("_" "putenv" );
long random(void);
int rand_r(unsigned *);
char *realpath(const char * , char * ) __asm("_" "realpath" "$DARWIN_EXTSN");
unsigned short
*seed48(unsigned short[3]);
int setenv(const char *, const char *, int) __asm("_" "setenv" );
void setkey(const char *) __asm("_" "setkey" );
char *setstate(const char *);
void srand48(long);
void srandom(unsigned);
int unlockpt(int);
int unsetenv(const char *) __asm("_" "unsetenv" );
# 1 "/usr/include/machine/types.h" 1 3 4
# 35 "/usr/include/machine/types.h" 3 4
# 1 "/usr/include/i386/types.h" 1 3 4
# 81 "/usr/include/i386/types.h" 3 4
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef unsigned long long u_int64_t;
typedef int64_t register_t;
# 97 "/usr/include/i386/types.h" 3 4
typedef u_int64_t user_addr_t;
typedef u_int64_t user_size_t;
typedef int64_t user_ssize_t;
typedef int64_t user_long_t;
typedef u_int64_t user_ulong_t;
typedef int64_t user_time_t;
typedef int64_t user_off_t;
typedef u_int64_t syscall_arg_t;
# 1 "/usr/include/sys/_types/___offsetof.h" 1 3 4
# 114 "/usr/include/i386/types.h" 2 3 4
# 36 "/usr/include/machine/types.h" 2 3 4
# 239 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/sys/_types/_dev_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_dev_t.h" 3 4
typedef __darwin_dev_t dev_t;
# 241 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/sys/_types/_mode_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_mode_t.h" 3 4
typedef __darwin_mode_t mode_t;
# 242 "/usr/include/stdlib.h" 2 3 4
u_int32_t arc4random(void);
void arc4random_addrandom(unsigned char * , int );
void arc4random_buf(void * , size_t ) ;
void arc4random_stir(void);
u_int32_t
arc4random_uniform(u_int32_t ) ;
char *cgetcap(char *, const char *, int);
int cgetclose(void);
int cgetent(char **, char **, const char *);
int cgetfirst(char **, char **);
int cgetmatch(const char *, const char *);
int cgetnext(char **, char **);
int cgetnum(char *, const char *, long *);
int cgetset(const char *);
int cgetstr(char *, const char *, char **);
int cgetustr(char *, const char *, char **);
int daemon(int, int) __asm("_" "daemon" "$1050") __attribute__((deprecated));
char *devname(dev_t, mode_t);
char *devname_r(dev_t, mode_t, char *buf, int len);
char *getbsize(int *, long *);
int getloadavg(double [], int);
const char
*getprogname(void);
int heapsort(void *, size_t, size_t,
int (*)(const void *, const void *));
int mergesort(void *, size_t, size_t,
int (*)(const void *, const void *));
void psort(void *, size_t, size_t,
int (*)(const void *, const void *)) ;
void psort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *)) ;
void qsort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void setprogname(const char *);
int sradixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void sranddev(void);
void srandomdev(void);
void *reallocf(void *, size_t);
long long
strtoq(const char *, char **, int);
unsigned long long
strtouq(const char *, char **, int);
extern char *suboptarg;
void *valloc(size_t);
}
# 28 "mimedb.cpp" 2
# 1 "/usr/include/sys/types.h" 1 3 4
# 84 "/usr/include/sys/types.h" 3 4
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef u_int64_t u_quad_t;
typedef int64_t quad_t;
typedef quad_t * qaddr_t;
typedef char * caddr_t;
typedef int32_t daddr_t;
typedef u_int32_t fixpt_t;
# 1 "/usr/include/sys/_types/_blkcnt_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_blkcnt_t.h" 3 4
typedef __darwin_blkcnt_t blkcnt_t;
# 107 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_blksize_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_blksize_t.h" 3 4
typedef __darwin_blksize_t blksize_t;
# 108 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_gid_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_gid_t.h" 3 4
typedef __darwin_gid_t gid_t;
# 109 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_in_addr_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_in_addr_t.h" 3 4
typedef __uint32_t in_addr_t;
# 110 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_in_port_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_in_port_t.h" 3 4
typedef __uint16_t in_port_t;
# 111 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_ino_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_ino_t.h" 3 4
typedef __darwin_ino_t ino_t;
# 112 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_ino64_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_ino64_t.h" 3 4
typedef __darwin_ino64_t ino64_t;
# 115 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_key_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_key_t.h" 3 4
typedef __int32_t key_t;
# 118 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_nlink_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_nlink_t.h" 3 4
typedef __uint16_t nlink_t;
# 120 "/usr/include/sys/types.h" 2 3 4
typedef int32_t segsz_t;
typedef int32_t swblk_t;
# 137 "/usr/include/sys/types.h" 3 4
static inline __int32_t major(__uint32_t _x)
{
return (__int32_t)(((__uint32_t)_x >> 24) & 0xff);
}
static inline __int32_t minor(__uint32_t _x)
{
return (__int32_t)((_x) & 0xffffff);
}
static inline dev_t makedev(__uint32_t _major, __uint32_t _minor)
{
return (dev_t)(((_major) << 24) | (_minor));
}
# 161 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/_types/_clock_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_clock_t.h" 3 4
typedef __darwin_clock_t clock_t;
# 162 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_time_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_time_t.h" 3 4
typedef __darwin_time_t time_t;
# 165 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_useconds_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_useconds_t.h" 3 4
typedef __darwin_useconds_t useconds_t;
# 167 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_suseconds_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_suseconds_t.h" 3 4
typedef __darwin_suseconds_t suseconds_t;
# 168 "/usr/include/sys/types.h" 2 3 4
# 180 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/_types/_fd_def.h" 1 3 4
# 45 "/usr/include/sys/_types/_fd_def.h" 3 4
extern "C" {
typedef struct fd_set {
__int32_t fds_bits[((((1024) % ((sizeof(__int32_t) * 8))) == 0) ? ((1024) / ((sizeof(__int32_t) * 8))) : (((1024) / ((sizeof(__int32_t) * 8))) + 1))];
} fd_set;
}
static inline int
__darwin_fd_isset(int _n, const struct fd_set *_p)
{
return (_p->fds_bits[(unsigned long)_n/(sizeof(__int32_t) * 8)] & ((__int32_t)(1<<((unsigned long)_n % (sizeof(__int32_t) * 8)))));
}
# 181 "/usr/include/sys/types.h" 2 3 4
typedef __int32_t fd_mask;
# 1 "/usr/include/sys/_types/_fd_setsize.h" 1 3 4
# 194 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_fd_set.h" 1 3 4
# 195 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_fd_clr.h" 1 3 4
# 196 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_fd_zero.h" 1 3 4
# 197 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_fd_isset.h" 1 3 4
# 198 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_fd_copy.h" 1 3 4
# 201 "/usr/include/sys/types.h" 2 3 4
# 211 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/_types/_pthread_cond_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_cond_t.h" 3 4
typedef __darwin_pthread_cond_t pthread_cond_t;
# 212 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_condattr_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_condattr_t.h" 3 4
typedef __darwin_pthread_condattr_t pthread_condattr_t;
# 213 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_mutex_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_mutex_t.h" 3 4
typedef __darwin_pthread_mutex_t pthread_mutex_t;
# 214 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_mutexattr_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_mutexattr_t.h" 3 4
typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t;
# 215 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_once_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_once_t.h" 3 4
typedef __darwin_pthread_once_t pthread_once_t;
# 216 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_rwlock_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_rwlock_t.h" 3 4
typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
# 217 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_rwlockattr_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_rwlockattr_t.h" 3 4
typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t;
# 218 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_t.h" 3 4
typedef __darwin_pthread_t pthread_t;
# 219 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_pthread_key_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_pthread_key_t.h" 3 4
typedef __darwin_pthread_key_t pthread_key_t;
# 223 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_fsblkcnt_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_fsblkcnt_t.h" 3 4
typedef __darwin_fsblkcnt_t fsblkcnt_t;
# 227 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/_types/_fsfilcnt_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_fsfilcnt_t.h" 3 4
typedef __darwin_fsfilcnt_t fsfilcnt_t;
# 228 "/usr/include/sys/types.h" 2 3 4
# 29 "mimedb.cpp" 2
# 1 "/usr/include/sys/stat.h" 1 3 4
# 78 "/usr/include/sys/stat.h" 3 4
# 1 "/usr/include/sys/_types/_timespec.h" 1 3 4
# 30 "/usr/include/sys/_types/_timespec.h" 3 4
struct timespec
{
__darwin_time_t tv_sec;
long tv_nsec;
};
# 79 "/usr/include/sys/stat.h" 2 3 4
# 110 "/usr/include/sys/stat.h" 3 4
struct ostat {
__uint16_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
__uint16_t st_uid;
__uint16_t st_gid;
__uint16_t st_rdev;
__int32_t st_size;
struct timespec st_atimespec;
struct timespec st_mtimespec;
struct timespec st_ctimespec;
__int32_t st_blksize;
__int32_t st_blocks;
__uint32_t st_flags;
__uint32_t st_gen;
};
# 182 "/usr/include/sys/stat.h" 3 4
struct stat { dev_t st_dev; mode_t st_mode; nlink_t st_nlink; __darwin_ino64_t st_ino; uid_t st_uid; gid_t st_gid; dev_t st_rdev; struct timespec st_atimespec; struct timespec st_mtimespec; struct timespec st_ctimespec; struct timespec st_birthtimespec; off_t st_size; blkcnt_t st_blocks; blksize_t st_blksize; __uint32_t st_flags; __uint32_t st_gen; __int32_t st_lspare; __int64_t st_qspare[2]; };
# 221 "/usr/include/sys/stat.h" 3 4
struct stat64 { dev_t st_dev; mode_t st_mode; nlink_t st_nlink; __darwin_ino64_t st_ino; uid_t st_uid; gid_t st_gid; dev_t st_rdev; struct timespec st_atimespec; struct timespec st_mtimespec; struct timespec st_ctimespec; struct timespec st_birthtimespec; off_t st_size; blkcnt_t st_blocks; blksize_t st_blksize; __uint32_t st_flags; __uint32_t st_gen; __int32_t st_lspare; __int64_t st_qspare[2]; };
# 241 "/usr/include/sys/stat.h" 3 4
# 1 "/usr/include/sys/_types/_s_ifmt.h" 1 3 4
# 242 "/usr/include/sys/stat.h" 2 3 4
# 344 "/usr/include/sys/stat.h" 3 4
extern "C" {
int chmod(const char *, mode_t) __asm("_" "chmod" );
int fchmod(int, mode_t) __asm("_" "fchmod" );
int fstat(int, struct stat *) __asm("_" "fstat" "$INODE64");
int lstat(const char *, struct stat *) __asm("_" "lstat" "$INODE64");
int mkdir(const char *, mode_t);
int mkfifo(const char *, mode_t);
int stat(const char *, struct stat *) __asm("_" "stat" "$INODE64");
int mknod(const char *, mode_t, dev_t);
mode_t umask(mode_t);
# 1 "/usr/include/sys/_types/_filesec_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_filesec_t.h" 3 4
struct _filesec;
typedef struct _filesec *filesec_t;
# 359 "/usr/include/sys/stat.h" 2 3 4
int chflags(const char *, __uint32_t);
int chmodx_np(const char *, filesec_t);
int fchflags(int, __uint32_t);
int fchmodx_np(int, filesec_t);
int fstatx_np(int, struct stat *, filesec_t) __asm("_" "fstatx_np" "$INODE64");
int lchflags(const char *, __uint32_t) ;
int lchmod(const char *, mode_t) ;
int lstatx_np(const char *, struct stat *, filesec_t) __asm("_" "lstatx_np" "$INODE64");
int mkdirx_np(const char *, filesec_t);
int mkfifox_np(const char *, filesec_t);
int statx_np(const char *, struct stat *, filesec_t) __asm("_" "statx_np" "$INODE64");
int umaskx_np(filesec_t) __attribute__((deprecated));
int fstatx64_np(int, struct stat64 *, filesec_t) __attribute__((deprecated));
int lstatx64_np(const char *, struct stat64 *, filesec_t) __attribute__((deprecated));
int statx64_np(const char *, struct stat64 *, filesec_t) __attribute__((deprecated));
int fstat64(int, struct stat64 *) __attribute__((deprecated));
int lstat64(const char *, struct stat64 *) __attribute__((deprecated));
int stat64(const char *, struct stat64 *) __attribute__((deprecated));
}
# 30 "mimedb.cpp" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 72 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/sys/unistd.h" 1 3 4
# 84 "/usr/include/sys/unistd.h" 3 4
# 1 "/usr/include/sys/_types/_posix_vdisable.h" 1 3 4
# 85 "/usr/include/sys/unistd.h" 2 3 4
# 122 "/usr/include/sys/unistd.h" 3 4
# 1 "/usr/include/sys/_types/_seek_set.h" 1 3 4
# 123 "/usr/include/sys/unistd.h" 2 3 4
# 132 "/usr/include/sys/unistd.h" 3 4
struct accessx_descriptor {
unsigned int ad_name_offset;
int ad_flags;
int ad_pad[2];
};
# 73 "/usr/include/unistd.h" 2 3 4
# 423 "/usr/include/unistd.h" 3 4
extern "C" {
void _exit(int) __attribute__((noreturn));
int access(const char *, int);
unsigned int
alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
int close(int) __asm("_" "close" );
int dup(int);
int dup2(int, int);
int execl(const char *, const char *, ...);
int execle(const char *, const char *, ...);
int execlp(const char *, const char *, ...);
int execv(const char *, char * const *);
int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);
pid_t fork(void);
long fpathconf(int, int);
char *getcwd(char *, size_t);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t []);
char *getlogin(void);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
uid_t getuid(void);
int isatty(int);
int link(const char *, const char *);
off_t lseek(int, off_t, int);
long pathconf(const char *, int);
int pause(void) __asm("_" "pause" );
int pipe(int [2]);
ssize_t read(int, void *, size_t) __asm("_" "read" );
int rmdir(const char *);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
pid_t setsid(void);
int setuid(uid_t);
unsigned int
sleep(unsigned int) __asm("_" "sleep" );
long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
int ttyname_r(int, char *, size_t) __asm("_" "ttyname_r" );
int unlink(const char *);
ssize_t write(int, const void *, size_t) __asm("_" "write" );
}
# 500 "/usr/include/unistd.h" 3 4
extern "C" {
size_t confstr(int, char *, size_t) __asm("_" "confstr" );
int getopt(int, char * const [], const char *) __asm("_" "getopt" );
extern char *optarg;
extern int optind, opterr, optopt;
}
# 525 "/usr/include/unistd.h" 3 4
extern "C" {
__attribute__((deprecated))
void *brk(const void *);
int chroot(const char *) ;
char *crypt(const char *, const char *);
void encrypt(char *, int) __asm("_" "encrypt" );
int fchdir(int);
long gethostid(void);
pid_t getpgid(pid_t);
pid_t getsid(pid_t);
int getdtablesize(void) ;
int getpagesize(void) __attribute__((const)) ;
char *getpass(const char *) ;
char *getwd(char *) ;
int lchown(const char *, uid_t, gid_t) __asm("_" "lchown" );
int lockf(int, int, off_t) __asm("_" "lockf" );
int nice(int) __asm("_" "nice" );
ssize_t pread(int, void *, size_t, off_t) __asm("_" "pread" );
ssize_t pwrite(int, const void *, size_t, off_t) __asm("_" "pwrite" );
__attribute__((deprecated))
void *sbrk(int);
pid_t setpgrp(void) __asm("_" "setpgrp" );
int setregid(gid_t, gid_t) __asm("_" "setregid" );
int setreuid(uid_t, uid_t) __asm("_" "setreuid" );
void swab(const void * , void * , ssize_t);
void sync(void);
int truncate(const char *, off_t);
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t) __asm("_" "usleep" );
pid_t vfork(void);
int fsync(int) __asm("_" "fsync" );
int ftruncate(int, off_t);
int getlogin_r(char *, size_t);
}
# 618 "/usr/include/unistd.h" 3 4
extern "C" {
int fchown(int, uid_t, gid_t);
int gethostname(char *, size_t);
ssize_t readlink(const char * , char * , size_t);
int setegid(gid_t);
int seteuid(uid_t);
int symlink(const char *, const char *);
}
# 1 "/usr/include/sys/select.h" 1 3 4
# 111 "/usr/include/sys/select.h" 3 4
extern "C" {
int pselect(int, fd_set * , fd_set * ,
fd_set * , const struct timespec * ,
const sigset_t * )
__asm("_" "pselect" "$1050")
;
# 1 "/usr/include/sys/_select.h" 1 3 4
# 39 "/usr/include/sys/_select.h" 3 4
int select(int, fd_set * , fd_set * ,
fd_set * , struct timeval * )
__asm("_" "select" "$1050")
;
# 130 "/usr/include/sys/select.h" 2 3 4
}
# 634 "/usr/include/unistd.h" 2 3 4
# 1 "/usr/include/sys/_types/_uuid_t.h" 1 3 4
# 30 "/usr/include/sys/_types/_uuid_t.h" 3 4
typedef __darwin_uuid_t uuid_t;
# 638 "/usr/include/unistd.h" 2 3 4
extern "C" {
void _Exit(int) __attribute__((noreturn));
int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t);
int acct(const char *);
int add_profil(char *, size_t, unsigned long, unsigned int);
void endusershell(void);
int execvP(const char *, const char *, char * const *);
char *fflagstostr(unsigned long);
int getdomainname(char *, int);
int getgrouplist(const char *, int, int *, int *);
# 1 "/usr/include/gethostuuid.h" 1 3 4
# 39 "/usr/include/gethostuuid.h" 3 4
int gethostuuid(uuid_t, const struct timespec *) ;
# 657 "/usr/include/unistd.h" 2 3 4
mode_t getmode(const void *, mode_t);
int getpeereid(int, uid_t *, gid_t *);
int getsgroups_np(int *, uuid_t);
char *getusershell(void);
int getwgroups_np(int *, uuid_t);
int initgroups(const char *, int);
int iruserok(unsigned long, int, const char *, const char *);
int iruserok_sa(const void *, int, int, const char *, const char *);
int issetugid(void);
char *mkdtemp(char *);
int mknod(const char *, mode_t, dev_t);
int mkpath_np(const char *path, mode_t omode) ;
int mkstemp(char *);
int mkstemps(char *, int);
char *mktemp(char *);
int nfssvc(int, void *);
int profil(char *, size_t, unsigned long, unsigned int);
int pthread_setugid_np(uid_t, gid_t);
int pthread_getugid_np( uid_t *, gid_t *);
int rcmd(char **, int, const char *, const char *, const char *, int *);
int rcmd_af(char **, int, const char *, const char *, const char *, int *,
int);
int reboot(int);
int revoke(const char *);
int rresvport(int *);
int rresvport_af(int *, int);
int ruserok(const char *, int, const char *, const char *);
int setdomainname(const char *, int);
int setgroups(int, const gid_t *);
void sethostid(long);
int sethostname(const char *, int);
void setkey(const char *) __asm("_" "setkey" );
int setlogin(const char *);
void *setmode(const char *) __asm("_" "setmode" );
int setrgid(gid_t);
int setruid(uid_t);
int setsgroups_np(int, const uuid_t);
void setusershell(void);
int setwgroups_np(int, const uuid_t);
int strtofflags(char **, unsigned long *, unsigned long *);
int swapon(const char *);
int syscall(int, ...);
int ttyslot(void);
int undelete(const char *);
int unwhiteout(const char *);
void *valloc(size_t);
extern char *suboptarg;
int getsubopt(char **, char * const *, char **);
int fgetattrlist(int,void*,void*,size_t,unsigned int) ;
int fsetattrlist(int,void*,void*,size_t,unsigned int) ;
int getattrlist(const char*,void*,void*,size_t,unsigned int) __asm("_" "getattrlist" );
int setattrlist(const char*,void*,void*,size_t,unsigned int) __asm("_" "setattrlist" );
int exchangedata(const char*,const char*,unsigned int);
int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int);
# 731 "/usr/include/unistd.h" 3 4
struct fssearchblock;
struct searchstate;
int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *);
int fsctl(const char *,unsigned long,void*,unsigned int);
int ffsctl(int,unsigned long,void*,unsigned int) ;
int fsync_volume_np(int, int) ;
int sync_volume_np(const char *, int) ;
extern int optreset;
}
# 31 "mimedb.cpp" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 23 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/sys/fcntl.h" 1 3 4
# 116 "/usr/include/sys/fcntl.h" 3 4
# 1 "/usr/include/sys/_types/_o_sync.h" 1 3 4
# 117 "/usr/include/sys/fcntl.h" 2 3 4
# 141 "/usr/include/sys/fcntl.h" 3 4
# 1 "/usr/include/sys/_types/_o_dsync.h" 1 3 4
# 142 "/usr/include/sys/fcntl.h" 2 3 4
# 304 "/usr/include/sys/fcntl.h" 3 4
struct flock {
off_t l_start;
off_t l_len;
pid_t l_pid;
short l_type;
short l_whence;
};
# 319 "/usr/include/sys/fcntl.h" 3 4
struct flocktimeout {
struct flock fl;
struct timespec timeout;
};
# 332 "/usr/include/sys/fcntl.h" 3 4
struct radvisory {
off_t ra_offset;
int ra_count;
};
# 344 "/usr/include/sys/fcntl.h" 3 4
typedef struct fsignatures {
off_t fs_file_start;
void *fs_blob_start;
size_t fs_blob_size;
} fsignatures_t;
# 358 "/usr/include/sys/fcntl.h" 3 4
typedef struct fstore {
unsigned int fst_flags;
int fst_posmode;
off_t fst_offset;
off_t fst_length;
off_t fst_bytesalloc;
} fstore_t;
typedef struct fbootstraptransfer {
off_t fbt_offset;
size_t fbt_length;
void *fbt_buffer;
} fbootstraptransfer_t;
# 396 "/usr/include/sys/fcntl.h" 3 4
#pragma pack(4)
struct log2phys {
unsigned int l2p_flags;
off_t l2p_contigbytes;
off_t l2p_devoffset;
};
#pragma pack()
# 421 "/usr/include/sys/fcntl.h" 3 4
typedef enum {
FILESEC_OWNER = 1,
FILESEC_GROUP = 2,
FILESEC_UUID = 3,
FILESEC_MODE = 4,
FILESEC_ACL = 5,
FILESEC_GRPUUID = 6,
FILESEC_ACL_RAW = 100,
FILESEC_ACL_ALLOCSIZE = 101
} filesec_property_t;
extern "C" {
int open(const char *, int, ...) __asm("_" "open" );
int creat(const char *, mode_t) __asm("_" "creat" );
int fcntl(int, int, ...) __asm("_" "fcntl" );
int openx_np(const char *, int, filesec_t);
int open_dprotected_np ( const char *, int, int, int, ...);
int flock(int, int);
filesec_t filesec_init(void);
filesec_t filesec_dup(filesec_t);
void filesec_free(filesec_t);
int filesec_get_property(filesec_t, filesec_property_t, void *);
int filesec_query_property(filesec_t, filesec_property_t, int *);
int filesec_set_property(filesec_t, filesec_property_t, const void *);
int filesec_unset_property(filesec_t, filesec_property_t) ;
}
# 23 "/usr/include/fcntl.h" 2 3 4
# 32 "mimedb.cpp" 2
# 1 "/usr/include/libgen.h" 1 3 4
# 36 "/usr/include/libgen.h" 3 4
extern "C" {
char *basename(char *);
char *dirname(char *);
# 50 "/usr/include/libgen.h" 3 4
}
# 33 "mimedb.cpp" 2
# 1 "/usr/include/errno.h" 1 3 4
# 23 "/usr/include/errno.h" 3 4
# 1 "/usr/include/sys/errno.h" 1 3 4
# 79 "/usr/include/sys/errno.h" 3 4
extern "C" {
extern int * __error(void);
}
# 24 "/usr/include/errno.h" 2 3 4
# 34 "mimedb.cpp" 2
# 1 "/usr/include/regex.h" 1 3 4
# 103 "/usr/include/regex.h" 3 4
typedef __darwin_off_t regoff_t;
typedef struct {
int re_magic;
size_t re_nsub;
const char *re_endp;
struct re_guts *re_g;
} regex_t;
typedef struct {
regoff_t rm_so;
regoff_t rm_eo;
} regmatch_t;
# 199 "/usr/include/regex.h" 3 4
extern "C" {
int regcomp(regex_t * , const char * , int) __asm("_" "regcomp" );
size_t regerror(int, const regex_t * , char * , size_t);
int regexec(const regex_t * , const char * , size_t,
regmatch_t __pmatch[ ], int);
void regfree(regex_t *);
int regncomp(regex_t * , const char * , size_t, int)
;
int regnexec(const regex_t * , const char * , size_t,
size_t, regmatch_t __pmatch[ ], int)
;
int regwcomp(regex_t * , const wchar_t * , int)
;
int regwexec(const regex_t * , const wchar_t * , size_t,
regmatch_t __pmatch[ ], int)
;
int regwncomp(regex_t * , const wchar_t * , size_t, int)
;
int regwnexec(const regex_t * , const wchar_t * ,
size_t, size_t, regmatch_t __pmatch[ ], int)
;
}
# 35 "mimedb.cpp" 2
# 1 "/usr/include/locale.h" 1 3 4
# 40 "/usr/include/locale.h" 3 4
# 1 "/usr/include/_locale.h" 1 3 4
# 43 "/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_n_cs_precedes;
char int_p_sep_by_space;
char int_n_sep_by_space;
char int_p_sign_posn;
char int_n_sign_posn;
};
extern "C" {
struct lconv *localeconv(void);
}
# 41 "/usr/include/locale.h" 2 3 4
# 52 "/usr/include/locale.h" 3 4
extern "C" {
char *setlocale(int, const char *);
}
# 36 "mimedb.cpp" 2
# 1 "/opt/local/include/gcc48/c++/vector" 1 3
# 58 "/opt/local/include/gcc48/c++/vector" 3
# 59 "/opt/local/include/gcc48/c++/vector" 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 1 3
# 59 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++config.h" 1 3
# 184 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++config.h" 3
namespace std
{
typedef long unsigned int size_t;
typedef long int ptrdiff_t;
}
# 426 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++config.h" 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/os_defines.h" 1 3
# 427 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++config.h" 2 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/cpu_defines.h" 1 3
# 430 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++config.h" 2 3
# 60 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/functexcept.h" 1 3
# 40 "/opt/local/include/gcc48/c++/bits/functexcept.h" 3
# 1 "/opt/local/include/gcc48/c++/bits/exception_defines.h" 1 3
# 41 "/opt/local/include/gcc48/c++/bits/functexcept.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
void
__throw_bad_exception(void) __attribute__((__noreturn__));
void
__throw_bad_alloc(void) __attribute__((__noreturn__));
void
__throw_bad_cast(void) __attribute__((__noreturn__));
void
__throw_bad_typeid(void) __attribute__((__noreturn__));
void
__throw_logic_error(const char*) __attribute__((__noreturn__));
void
__throw_domain_error(const char*) __attribute__((__noreturn__));
void
__throw_invalid_argument(const char*) __attribute__((__noreturn__));
void
__throw_length_error(const char*) __attribute__((__noreturn__));
void
__throw_out_of_range(const char*) __attribute__((__noreturn__));
void
__throw_runtime_error(const char*) __attribute__((__noreturn__));
void
__throw_range_error(const char*) __attribute__((__noreturn__));
void
__throw_overflow_error(const char*) __attribute__((__noreturn__));
void
__throw_underflow_error(const char*) __attribute__((__noreturn__));
void
__throw_ios_failure(const char*) __attribute__((__noreturn__));
void
__throw_system_error(int) __attribute__((__noreturn__));
void
__throw_future_error(int) __attribute__((__noreturn__));
void
__throw_bad_function_call() __attribute__((__noreturn__));
}
# 61 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/cpp_type_traits.h" 1 3
# 35 "/opt/local/include/gcc48/c++/bits/cpp_type_traits.h" 3
# 36 "/opt/local/include/gcc48/c++/bits/cpp_type_traits.h" 3
# 68 "/opt/local/include/gcc48/c++/bits/cpp_type_traits.h" 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
template<typename _Iterator, typename _Container>
class __normal_iterator;
}
namespace std __attribute__ ((__visibility__ ("default")))
{
struct __true_type { };
struct __false_type { };
template<bool>
struct __truth_type
{ typedef __false_type __type; };
template<>
struct __truth_type<true>
{ typedef __true_type __type; };
template<class _Sp, class _Tp>
struct __traitor
{
enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
typedef typename __truth_type<__value>::__type __type;
};
template<typename, typename>
struct __are_same
{
enum { __value = 0 };
typedef __false_type __type;
};
template<typename _Tp>
struct __are_same<_Tp, _Tp>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_void
{
enum { __value = 0 };
typedef __false_type __type;
};
template<>
struct __is_void<void>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_integer
{
enum { __value = 0 };
typedef __false_type __type;
};
template<>
struct __is_integer<bool>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<char>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<signed char>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned char>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<wchar_t>
{
enum { __value = 1 };
typedef __true_type __type;
};
# 198 "/opt/local/include/gcc48/c++/bits/cpp_type_traits.h" 3
template<>
struct __is_integer<short>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned short>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<int>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned int>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<long>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned long>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<long long>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned long long>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_floating
{
enum { __value = 0 };
typedef __false_type __type;
};
template<>
struct __is_floating<float>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_floating<double>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_floating<long double>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_pointer
{
enum { __value = 0 };
typedef __false_type __type;
};
template<typename _Tp>
struct __is_pointer<_Tp*>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_normal_iterator
{
enum { __value = 0 };
typedef __false_type __type;
};
template<typename _Iterator, typename _Container>
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
_Container> >
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_arithmetic
: public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
{ };
template<typename _Tp>
struct __is_fundamental
: public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
{ };
template<typename _Tp>
struct __is_scalar
: public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
{ };
template<typename _Tp>
struct __is_char
{
enum { __value = 0 };
typedef __false_type __type;
};
template<>
struct __is_char<char>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_char<wchar_t>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_byte
{
enum { __value = 0 };
typedef __false_type __type;
};
template<>
struct __is_byte<char>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_byte<signed char>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_byte<unsigned char>
{
enum { __value = 1 };
typedef __true_type __type;
};
template<typename _Tp>
struct __is_move_iterator
{
enum { __value = 0 };
typedef __false_type __type;
};
# 421 "/opt/local/include/gcc48/c++/bits/cpp_type_traits.h" 3
}
# 62 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/ext/type_traits.h" 1 3
# 32 "/opt/local/include/gcc48/c++/ext/type_traits.h" 3
# 33 "/opt/local/include/gcc48/c++/ext/type_traits.h" 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
template<bool, typename>
struct __enable_if
{ };
template<typename _Tp>
struct __enable_if<true, _Tp>
{ typedef _Tp __type; };
template<bool _Cond, typename _Iftrue, typename _Iffalse>
struct __conditional_type
{ typedef _Iftrue __type; };
template<typename _Iftrue, typename _Iffalse>
struct __conditional_type<false, _Iftrue, _Iffalse>
{ typedef _Iffalse __type; };
template<typename _Tp>
struct __add_unsigned
{
private:
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
public:
typedef typename __if_type::__type __type;
};
template<>
struct __add_unsigned<char>
{ typedef unsigned char __type; };
template<>
struct __add_unsigned<signed char>
{ typedef unsigned char __type; };
template<>
struct __add_unsigned<short>
{ typedef unsigned short __type; };
template<>
struct __add_unsigned<int>
{ typedef unsigned int __type; };
template<>
struct __add_unsigned<long>
{ typedef unsigned long __type; };
template<>
struct __add_unsigned<long long>
{ typedef unsigned long long __type; };
template<>
struct __add_unsigned<bool>;
template<>
struct __add_unsigned<wchar_t>;
template<typename _Tp>
struct __remove_unsigned
{
private:
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
public:
typedef typename __if_type::__type __type;
};
template<>
struct __remove_unsigned<char>
{ typedef signed char __type; };
template<>
struct __remove_unsigned<unsigned char>
{ typedef signed char __type; };
template<>
struct __remove_unsigned<unsigned short>
{ typedef short __type; };
template<>
struct __remove_unsigned<unsigned int>
{ typedef int __type; };
template<>
struct __remove_unsigned<unsigned long>
{ typedef long __type; };
template<>
struct __remove_unsigned<unsigned long long>
{ typedef long long __type; };
template<>
struct __remove_unsigned<bool>;
template<>
struct __remove_unsigned<wchar_t>;
template<typename _Type>
inline bool
__is_null_pointer(_Type* __ptr)
{ return __ptr == 0; }
template<typename _Type>
inline bool
__is_null_pointer(_Type)
{ return false; }
template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
struct __promote
{ typedef double __type; };
template<typename _Tp>
struct __promote<_Tp, false>
{ };
template<>
struct __promote<long double>
{ typedef long double __type; };
template<>
struct __promote<double>
{ typedef double __type; };
template<>
struct __promote<float>
{ typedef float __type; };
template<typename _Tp, typename _Up,
typename _Tp2 = typename __promote<_Tp>::__type,
typename _Up2 = typename __promote<_Up>::__type>
struct __promote_2
{
typedef __typeof__(_Tp2() + _Up2()) __type;
};
template<typename _Tp, typename _Up, typename _Vp,
typename _Tp2 = typename __promote<_Tp>::__type,
typename _Up2 = typename __promote<_Up>::__type,
typename _Vp2 = typename __promote<_Vp>::__type>
struct __promote_3
{
typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type;
};
template<typename _Tp, typename _Up, typename _Vp, typename _Wp,
typename _Tp2 = typename __promote<_Tp>::__type,
typename _Up2 = typename __promote<_Up>::__type,
typename _Vp2 = typename __promote<_Vp>::__type,
typename _Wp2 = typename __promote<_Wp>::__type>
struct __promote_4
{
typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type;
};
}
# 63 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/ext/numeric_traits.h" 1 3
# 32 "/opt/local/include/gcc48/c++/ext/numeric_traits.h" 3
# 33 "/opt/local/include/gcc48/c++/ext/numeric_traits.h" 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
# 54 "/opt/local/include/gcc48/c++/ext/numeric_traits.h" 3
template<typename _Value>
struct __numeric_traits_integer
{
static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
static const bool __is_signed = ((_Value)(-1) < 0);
static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
};
template<typename _Value>
const _Value __numeric_traits_integer<_Value>::__min;
template<typename _Value>
const _Value __numeric_traits_integer<_Value>::__max;
template<typename _Value>
const bool __numeric_traits_integer<_Value>::__is_signed;
template<typename _Value>
const int __numeric_traits_integer<_Value>::__digits;
# 99 "/opt/local/include/gcc48/c++/ext/numeric_traits.h" 3
template<typename _Value>
struct __numeric_traits_floating
{
static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 64) * 643L / 2136);
static const bool __is_signed = true;
static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 18);
static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 4932);
};
template<typename _Value>
const int __numeric_traits_floating<_Value>::__max_digits10;
template<typename _Value>
const bool __numeric_traits_floating<_Value>::__is_signed;
template<typename _Value>
const int __numeric_traits_floating<_Value>::__digits10;
template<typename _Value>
const int __numeric_traits_floating<_Value>::__max_exponent10;
template<typename _Value>
struct __numeric_traits
: public __conditional_type<std::__is_integer<_Value>::__value,
__numeric_traits_integer<_Value>,
__numeric_traits_floating<_Value> >::__type
{ };
}
# 64 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_pair.h" 1 3
# 59 "/opt/local/include/gcc48/c++/bits/stl_pair.h" 3
# 1 "/opt/local/include/gcc48/c++/bits/move.h" 1 3
# 34 "/opt/local/include/gcc48/c++/bits/move.h" 3
# 1 "/opt/local/include/gcc48/c++/bits/concept_check.h" 1 3
# 33 "/opt/local/include/gcc48/c++/bits/concept_check.h" 3
# 34 "/opt/local/include/gcc48/c++/bits/concept_check.h" 3
# 35 "/opt/local/include/gcc48/c++/bits/move.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _Tp>
inline _Tp*
__addressof(_Tp& __r)
{
return reinterpret_cast<_Tp*>
(&const_cast<char&>(reinterpret_cast<const volatile char&>(__r)));
}
}
# 149 "/opt/local/include/gcc48/c++/bits/move.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 164 "/opt/local/include/gcc48/c++/bits/move.h" 3
template<typename _Tp>
inline void
swap(_Tp& __a, _Tp& __b)
{
_Tp __tmp = (__a);
__a = (__b);
__b = (__tmp);
}
template<typename _Tp, size_t _Nm>
inline void
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
{
for (size_t __n = 0; __n < _Nm; ++__n)
swap(__a[__n], __b[__n]);
}
}
# 60 "/opt/local/include/gcc48/c++/bits/stl_pair.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 95 "/opt/local/include/gcc48/c++/bits/stl_pair.h" 3
template<class _T1, class _T2>
struct pair
{
typedef _T1 first_type;
typedef _T2 second_type;
_T1 first;
_T2 second;
pair()
: first(), second() { }
pair(const _T1& __a, const _T2& __b)
: first(__a), second(__b) { }
template<class _U1, class _U2>
pair(const pair<_U1, _U2>& __p)
: first(__p.first), second(__p.second) { }
# 209 "/opt/local/include/gcc48/c++/bits/stl_pair.h" 3
};
template<class _T1, class _T2>
inline bool
operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return __x.first == __y.first && __x.second == __y.second; }
template<class _T1, class _T2>
inline bool
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return __x.first < __y.first
|| (!(__y.first < __x.first) && __x.second < __y.second); }
template<class _T1, class _T2>
inline bool
operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return !(__x == __y); }
template<class _T1, class _T2>
inline bool
operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return __y < __x; }
template<class _T1, class _T2>
inline bool
operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return !(__y < __x); }
template<class _T1, class _T2>
inline bool
operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return !(__x < __y); }
# 284 "/opt/local/include/gcc48/c++/bits/stl_pair.h" 3
template<class _T1, class _T2>
inline pair<_T1, _T2>
make_pair(_T1 __x, _T2 __y)
{ return pair<_T1, _T2>(__x, __y); }
}
# 65 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_types.h" 1 3
# 62 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_types.h" 3
# 63 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_types.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 89 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_types.h" 3
struct input_iterator_tag { };
struct output_iterator_tag { };
struct forward_iterator_tag : public input_iterator_tag { };
struct bidirectional_iterator_tag : public forward_iterator_tag { };
struct random_access_iterator_tag : public bidirectional_iterator_tag { };
# 116 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_types.h" 3
template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
typename _Pointer = _Tp*, typename _Reference = _Tp&>
struct iterator
{
typedef _Category iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Pointer pointer;
typedef _Reference reference;
};
# 162 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_types.h" 3
template<typename _Iterator>
struct iterator_traits
{
typedef typename _Iterator::iterator_category iterator_category;
typedef typename _Iterator::value_type value_type;
typedef typename _Iterator::difference_type difference_type;
typedef typename _Iterator::pointer pointer;
typedef typename _Iterator::reference reference;
};
template<typename _Tp>
struct iterator_traits<_Tp*>
{
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
template<typename _Tp>
struct iterator_traits<const _Tp*>
{
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef const _Tp* pointer;
typedef const _Tp& reference;
};
template<typename _Iter>
inline typename iterator_traits<_Iter>::iterator_category
__iterator_category(const _Iter&)
{ return typename iterator_traits<_Iter>::iterator_category(); }
template<typename _Iterator, bool _HasBase>
struct _Iter_base
{
typedef _Iterator iterator_type;
static iterator_type _S_base(_Iterator __it)
{ return __it; }
};
template<typename _Iterator>
struct _Iter_base<_Iterator, true>
{
typedef typename _Iterator::iterator_type iterator_type;
static iterator_type _S_base(_Iterator __it)
{ return __it.base(); }
};
# 232 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_types.h" 3
}
# 66 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_funcs.h" 1 3
# 62 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_funcs.h" 3
# 63 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_funcs.h" 3
# 1 "/opt/local/include/gcc48/c++/debug/debug.h" 1 3
# 46 "/opt/local/include/gcc48/c++/debug/debug.h" 3
namespace std
{
namespace __debug { }
}
namespace __gnu_debug
{
using namespace std::__debug;
}
# 66 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_funcs.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
__distance(_InputIterator __first, _InputIterator __last,
input_iterator_tag)
{
typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last)
{
++__first;
++__n;
}
return __n;
}
template<typename _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
random_access_iterator_tag)
{
return __last - __first;
}
# 112 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_funcs.h" 3
template<typename _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
distance(_InputIterator __first, _InputIterator __last)
{
return std::__distance(__first, __last,
std::__iterator_category(__first));
}
template<typename _InputIterator, typename _Distance>
inline void
__advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
{
;
while (__n--)
++__i;
}
template<typename _BidirectionalIterator, typename _Distance>
inline void
__advance(_BidirectionalIterator& __i, _Distance __n,
bidirectional_iterator_tag)
{
if (__n > 0)
while (__n--)
++__i;
else
while (__n++)
--__i;
}
template<typename _RandomAccessIterator, typename _Distance>
inline void
__advance(_RandomAccessIterator& __i, _Distance __n,
random_access_iterator_tag)
{
__i += __n;
}
# 171 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_funcs.h" 3
template<typename _InputIterator, typename _Distance>
inline void
advance(_InputIterator& __i, _Distance __n)
{
typename iterator_traits<_InputIterator>::difference_type __d = __n;
std::__advance(__i, __d, std::__iterator_category(__i));
}
# 202 "/opt/local/include/gcc48/c++/bits/stl_iterator_base_funcs.h" 3
}
# 67 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 1 3
# 67 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 95 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Iterator>
class reverse_iterator
: public iterator<typename iterator_traits<_Iterator>::iterator_category,
typename iterator_traits<_Iterator>::value_type,
typename iterator_traits<_Iterator>::difference_type,
typename iterator_traits<_Iterator>::pointer,
typename iterator_traits<_Iterator>::reference>
{
protected:
_Iterator current;
typedef iterator_traits<_Iterator> __traits_type;
public:
typedef _Iterator iterator_type;
typedef typename __traits_type::difference_type difference_type;
typedef typename __traits_type::pointer pointer;
typedef typename __traits_type::reference reference;
reverse_iterator() : current() { }
explicit
reverse_iterator(iterator_type __x) : current(__x) { }
reverse_iterator(const reverse_iterator& __x)
: current(__x.current) { }
template<typename _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x)
: current(__x.base()) { }
iterator_type
base() const
{ return current; }
# 159 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
reference
operator*() const
{
_Iterator __tmp = current;
return *--__tmp;
}
pointer
operator->() const
{ return &(operator*()); }
reverse_iterator&
operator++()
{
--current;
return *this;
}
reverse_iterator
operator++(int)
{
reverse_iterator __tmp = *this;
--current;
return __tmp;
}
reverse_iterator&
operator--()
{
++current;
return *this;
}
reverse_iterator
operator--(int)
{
reverse_iterator __tmp = *this;
++current;
return __tmp;
}
reverse_iterator
operator+(difference_type __n) const
{ return reverse_iterator(current - __n); }
reverse_iterator&
operator+=(difference_type __n)
{
current -= __n;
return *this;
}
reverse_iterator
operator-(difference_type __n) const
{ return reverse_iterator(current + __n); }
reverse_iterator&
operator-=(difference_type __n)
{
current += __n;
return *this;
}
reference
operator[](difference_type __n) const
{ return *(*this + __n); }
};
# 289 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Iterator>
inline bool
operator==(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __x.base() == __y.base(); }
template<typename _Iterator>
inline bool
operator<(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y.base() < __x.base(); }
template<typename _Iterator>
inline bool
operator!=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__x == __y); }
template<typename _Iterator>
inline bool
operator>(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y < __x; }
template<typename _Iterator>
inline bool
operator<=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__y < __x); }
template<typename _Iterator>
inline bool
operator>=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__x < __y); }
template<typename _Iterator>
inline typename reverse_iterator<_Iterator>::difference_type
operator-(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y.base() - __x.base(); }
template<typename _Iterator>
inline reverse_iterator<_Iterator>
operator+(typename reverse_iterator<_Iterator>::difference_type __n,
const reverse_iterator<_Iterator>& __x)
{ return reverse_iterator<_Iterator>(__x.base() - __n); }
template<typename _IteratorL, typename _IteratorR>
inline bool
operator==(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
{ return __x.base() == __y.base(); }
template<typename _IteratorL, typename _IteratorR>
inline bool
operator<(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
{ return __y.base() < __x.base(); }
template<typename _IteratorL, typename _IteratorR>
inline bool
operator!=(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
{ return !(__x == __y); }
template<typename _IteratorL, typename _IteratorR>
inline bool
operator>(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
{ return __y < __x; }
template<typename _IteratorL, typename _IteratorR>
inline bool
operator<=(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
{ return !(__y < __x); }
template<typename _IteratorL, typename _IteratorR>
inline bool
operator>=(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
{ return !(__x < __y); }
template<typename _IteratorL, typename _IteratorR>
inline typename reverse_iterator<_IteratorL>::difference_type
operator-(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
{ return __y.base() - __x.base(); }
# 401 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Container>
class back_insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
_Container* container;
public:
typedef _Container container_type;
explicit
back_insert_iterator(_Container& __x) : container(&__x) { }
# 428 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
back_insert_iterator&
operator=(typename _Container::const_reference __value)
{
container->push_back(__value);
return *this;
}
# 451 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
back_insert_iterator&
operator*()
{ return *this; }
back_insert_iterator&
operator++()
{ return *this; }
back_insert_iterator
operator++(int)
{ return *this; }
};
# 477 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Container>
inline back_insert_iterator<_Container>
back_inserter(_Container& __x)
{ return back_insert_iterator<_Container>(__x); }
# 492 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Container>
class front_insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
_Container* container;
public:
typedef _Container container_type;
explicit front_insert_iterator(_Container& __x) : container(&__x) { }
# 518 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
front_insert_iterator&
operator=(typename _Container::const_reference __value)
{
container->push_front(__value);
return *this;
}
# 541 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
front_insert_iterator&
operator*()
{ return *this; }
front_insert_iterator&
operator++()
{ return *this; }
front_insert_iterator
operator++(int)
{ return *this; }
};
# 567 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Container>
inline front_insert_iterator<_Container>
front_inserter(_Container& __x)
{ return front_insert_iterator<_Container>(__x); }
# 586 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Container>
class insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
insert_iterator(_Container& __x, typename _Container::iterator __i)
: container(&__x), iter(__i) {}
# 629 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
insert_iterator&
operator=(typename _Container::const_reference __value)
{
iter = container->insert(iter, __value);
++iter;
return *this;
}
# 655 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
insert_iterator&
operator*()
{ return *this; }
insert_iterator&
operator++()
{ return *this; }
insert_iterator&
operator++(int)
{ return *this; }
};
# 681 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _Container, typename _Iterator>
inline insert_iterator<_Container>
inserter(_Container& __x, _Iterator __i)
{
return insert_iterator<_Container>(__x,
typename _Container::iterator(__i));
}
}
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
# 705 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
using std::iterator_traits;
using std::iterator;
template<typename _Iterator, typename _Container>
class __normal_iterator
{
protected:
_Iterator _M_current;
typedef iterator_traits<_Iterator> __traits_type;
public:
typedef _Iterator iterator_type;
typedef typename __traits_type::iterator_category iterator_category;
typedef typename __traits_type::value_type value_type;
typedef typename __traits_type::difference_type difference_type;
typedef typename __traits_type::reference reference;
typedef typename __traits_type::pointer pointer;
__normal_iterator() : _M_current(_Iterator()) { }
explicit
__normal_iterator(const _Iterator& __i) : _M_current(__i) { }
template<typename _Iter>
__normal_iterator(const __normal_iterator<_Iter,
typename __enable_if<
(std::__are_same<_Iter, typename _Container::pointer>::__value),
_Container>::__type>& __i)
: _M_current(__i.base()) { }
reference
operator*() const
{ return *_M_current; }
pointer
operator->() const
{ return _M_current; }
__normal_iterator&
operator++()
{
++_M_current;
return *this;
}
__normal_iterator
operator++(int)
{ return __normal_iterator(_M_current++); }
__normal_iterator&
operator--()
{
--_M_current;
return *this;
}
__normal_iterator
operator--(int)
{ return __normal_iterator(_M_current--); }
reference
operator[](const difference_type& __n) const
{ return _M_current[__n]; }
__normal_iterator&
operator+=(const difference_type& __n)
{ _M_current += __n; return *this; }
__normal_iterator
operator+(const difference_type& __n) const
{ return __normal_iterator(_M_current + __n); }
__normal_iterator&
operator-=(const difference_type& __n)
{ _M_current -= __n; return *this; }
__normal_iterator
operator-(const difference_type& __n) const
{ return __normal_iterator(_M_current - __n); }
const _Iterator&
base() const
{ return _M_current; }
};
# 803 "/opt/local/include/gcc48/c++/bits/stl_iterator.h" 3
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() == __rhs.base(); }
template<typename _Iterator, typename _Container>
inline bool
operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() == __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() != __rhs.base(); }
template<typename _Iterator, typename _Container>
inline bool
operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() != __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() < __rhs.base(); }
template<typename _Iterator, typename _Container>
inline bool
operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() < __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() > __rhs.base(); }
template<typename _Iterator, typename _Container>
inline bool
operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() > __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() <= __rhs.base(); }
template<typename _Iterator, typename _Container>
inline bool
operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() <= __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() >= __rhs.base(); }
template<typename _Iterator, typename _Container>
inline bool
operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() >= __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline typename __normal_iterator<_IteratorL, _Container>::difference_type
operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() - __rhs.base(); }
template<typename _Iterator, typename _Container>
inline typename __normal_iterator<_Iterator, _Container>::difference_type
operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
const __normal_iterator<_Iterator, _Container>& __rhs)
{ return __lhs.base() - __rhs.base(); }
template<typename _Iterator, typename _Container>
inline __normal_iterator<_Iterator, _Container>
operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
__n, const __normal_iterator<_Iterator, _Container>& __i)
{ return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
}
# 68 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<bool _BoolType>
struct __iter_swap
{
template<typename _ForwardIterator1, typename _ForwardIterator2>
static void
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
{
typedef typename iterator_traits<_ForwardIterator1>::value_type
_ValueType1;
_ValueType1 __tmp = (*__a);
*__a = (*__b);
*__b = (__tmp);
}
};
template<>
struct __iter_swap<true>
{
template<typename _ForwardIterator1, typename _ForwardIterator2>
static void
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
{
swap(*__a, *__b);
}
};
# 117 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _ForwardIterator1, typename _ForwardIterator2>
inline void
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
{
typedef typename iterator_traits<_ForwardIterator1>::value_type
_ValueType1;
typedef typename iterator_traits<_ForwardIterator2>::value_type
_ValueType2;
typedef typename iterator_traits<_ForwardIterator1>::reference
_ReferenceType1;
typedef typename iterator_traits<_ForwardIterator2>::reference
_ReferenceType2;
std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
&& __are_same<_ValueType1&, _ReferenceType1>::__value
&& __are_same<_ValueType2&, _ReferenceType2>::__value>::
iter_swap(__a, __b);
}
# 163 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _ForwardIterator1, typename _ForwardIterator2>
_ForwardIterator2
swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2)
{
;
for (; __first1 != __last1; ++__first1, ++__first2)
std::iter_swap(__first1, __first2);
return __first2;
}
# 191 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _Tp>
inline const _Tp&
min(const _Tp& __a, const _Tp& __b)
{
if (__b < __a)
return __b;
return __a;
}
# 214 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _Tp>
inline const _Tp&
max(const _Tp& __a, const _Tp& __b)
{
if (__a < __b)
return __b;
return __a;
}
# 237 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _Tp, typename _Compare>
inline const _Tp&
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
{
if (__comp(__b, __a))
return __b;
return __a;
}
# 258 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _Tp, typename _Compare>
inline const _Tp&
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
{
if (__comp(__a, __b))
return __b;
return __a;
}
template<typename _Iterator>
struct _Niter_base
: _Iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value>
{ };
template<typename _Iterator>
inline typename _Niter_base<_Iterator>::iterator_type
__niter_base(_Iterator __it)
{ return std::_Niter_base<_Iterator>::_S_base(__it); }
template<typename _Iterator>
struct _Miter_base
: _Iter_base<_Iterator, __is_move_iterator<_Iterator>::__value>
{ };
template<typename _Iterator>
inline typename _Miter_base<_Iterator>::iterator_type
__miter_base(_Iterator __it)
{ return std::_Miter_base<_Iterator>::_S_base(__it); }
template<bool, bool, typename>
struct __copy_move
{
template<typename _II, typename _OI>
static _OI
__copy_m(_II __first, _II __last, _OI __result)
{
for (; __first != __last; ++__result, ++__first)
*__result = *__first;
return __result;
}
};
# 325 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<>
struct __copy_move<false, false, random_access_iterator_tag>
{
template<typename _II, typename _OI>
static _OI
__copy_m(_II __first, _II __last, _OI __result)
{
typedef typename iterator_traits<_II>::difference_type _Distance;
for(_Distance __n = __last - __first; __n > 0; --__n)
{
*__result = *__first;
++__first;
++__result;
}
return __result;
}
};
# 363 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<bool _IsMove>
struct __copy_move<_IsMove, true, random_access_iterator_tag>
{
template<typename _Tp>
static _Tp*
__copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
const ptrdiff_t _Num = __last - __first;
if (_Num)
__builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
return __result + _Num;
}
};
template<bool _IsMove, typename _II, typename _OI>
inline _OI
__copy_move_a(_II __first, _II __last, _OI __result)
{
typedef typename iterator_traits<_II>::value_type _ValueTypeI;
typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
typedef typename iterator_traits<_II>::iterator_category _Category;
const bool __simple = (__is_trivial(_ValueTypeI)
&& __is_pointer<_II>::__value
&& __is_pointer<_OI>::__value
&& __are_same<_ValueTypeI, _ValueTypeO>::__value);
return std::__copy_move<_IsMove, __simple,
_Category>::__copy_m(__first, __last, __result);
}
template<typename _CharT>
struct char_traits;
template<typename _CharT, typename _Traits>
class istreambuf_iterator;
template<typename _CharT, typename _Traits>
class ostreambuf_iterator;
template<bool _IsMove, typename _CharT>
typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
__copy_move_a2(_CharT*, _CharT*,
ostreambuf_iterator<_CharT, char_traits<_CharT> >);
template<bool _IsMove, typename _CharT>
typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
__copy_move_a2(const _CharT*, const _CharT*,
ostreambuf_iterator<_CharT, char_traits<_CharT> >);
template<bool _IsMove, typename _CharT>
typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
_CharT*>::__type
__copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
template<bool _IsMove, typename _II, typename _OI>
inline _OI
__copy_move_a2(_II __first, _II __last, _OI __result)
{
return _OI(std::__copy_move_a<_IsMove>(std::__niter_base(__first),
std::__niter_base(__last),
std::__niter_base(__result)));
}
# 448 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _II, typename _OI>
inline _OI
copy(_II __first, _II __last, _OI __result)
{
;
return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
(std::__miter_base(__first), std::__miter_base(__last),
__result));
}
# 500 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<bool, bool, typename>
struct __copy_move_backward
{
template<typename _BI1, typename _BI2>
static _BI2
__copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
{
while (__first != __last)
*--__result = *--__last;
return __result;
}
};
# 528 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<>
struct __copy_move_backward<false, false, random_access_iterator_tag>
{
template<typename _BI1, typename _BI2>
static _BI2
__copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
{
typename iterator_traits<_BI1>::difference_type __n;
for (__n = __last - __first; __n > 0; --__n)
*--__result = *--__last;
return __result;
}
};
# 558 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<bool _IsMove>
struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
{
template<typename _Tp>
static _Tp*
__copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
const ptrdiff_t _Num = __last - __first;
if (_Num)
__builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
return __result - _Num;
}
};
template<bool _IsMove, typename _BI1, typename _BI2>
inline _BI2
__copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
{
typedef typename iterator_traits<_BI1>::value_type _ValueType1;
typedef typename iterator_traits<_BI2>::value_type _ValueType2;
typedef typename iterator_traits<_BI1>::iterator_category _Category;
const bool __simple = (__is_trivial(_ValueType1)
&& __is_pointer<_BI1>::__value
&& __is_pointer<_BI2>::__value
&& __are_same<_ValueType1, _ValueType2>::__value);
return std::__copy_move_backward<_IsMove, __simple,
_Category>::__copy_move_b(__first,
__last,
__result);
}
template<bool _IsMove, typename _BI1, typename _BI2>
inline _BI2
__copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
{
return _BI2(std::__copy_move_backward_a<_IsMove>
(std::__niter_base(__first), std::__niter_base(__last),
std::__niter_base(__result)));
}
# 617 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _BI1, typename _BI2>
inline _BI2
copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
{
;
return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
(std::__miter_base(__first), std::__miter_base(__last),
__result));
}
# 675 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _ForwardIterator, typename _Tp>
inline typename
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
__fill_a(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __value)
{
for (; __first != __last; ++__first)
*__first = __value;
}
template<typename _ForwardIterator, typename _Tp>
inline typename
__gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
__fill_a(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __value)
{
const _Tp __tmp = __value;
for (; __first != __last; ++__first)
*__first = __tmp;
}
template<typename _Tp>
inline typename
__gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
__fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
{
const _Tp __tmp = __c;
__builtin_memset(__first, static_cast<unsigned char>(__tmp),
__last - __first);
}
# 719 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _ForwardIterator, typename _Tp>
inline void
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
;
std::__fill_a(std::__niter_base(__first), std::__niter_base(__last),
__value);
}
template<typename _OutputIterator, typename _Size, typename _Tp>
inline typename
__gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
__fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
{
for (__decltype(__n + 0) __niter = __n;
__niter > 0; --__niter, ++__first)
*__first = __value;
return __first;
}
template<typename _OutputIterator, typename _Size, typename _Tp>
inline typename
__gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
__fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
{
const _Tp __tmp = __value;
for (__decltype(__n + 0) __niter = __n;
__niter > 0; --__niter, ++__first)
*__first = __tmp;
return __first;
}
template<typename _Size, typename _Tp>
inline typename
__gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
__fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
{
std::__fill_a(__first, __first + __n, __c);
return __first + __n;
}
# 779 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _OI, typename _Size, typename _Tp>
inline _OI
fill_n(_OI __first, _Size __n, const _Tp& __value)
{
return _OI(std::__fill_n_a(std::__niter_base(__first), __n, __value));
}
template<bool _BoolType>
struct __equal
{
template<typename _II1, typename _II2>
static bool
equal(_II1 __first1, _II1 __last1, _II2 __first2)
{
for (; __first1 != __last1; ++__first1, ++__first2)
if (!(*__first1 == *__first2))
return false;
return true;
}
};
template<>
struct __equal<true>
{
template<typename _Tp>
static bool
equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
{
return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
* (__last1 - __first1));
}
};
template<typename _II1, typename _II2>
inline bool
__equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
{
typedef typename iterator_traits<_II1>::value_type _ValueType1;
typedef typename iterator_traits<_II2>::value_type _ValueType2;
const bool __simple = ((__is_integer<_ValueType1>::__value
|| __is_pointer<_ValueType1>::__value)
&& __is_pointer<_II1>::__value
&& __is_pointer<_II2>::__value
&& __are_same<_ValueType1, _ValueType2>::__value);
return std::__equal<__simple>::equal(__first1, __last1, __first2);
}
template<typename, typename>
struct __lc_rai
{
template<typename _II1, typename _II2>
static _II1
__newlast1(_II1, _II1 __last1, _II2, _II2)
{ return __last1; }
template<typename _II>
static bool
__cnd2(_II __first, _II __last)
{ return __first != __last; }
};
template<>
struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
{
template<typename _RAI1, typename _RAI2>
static _RAI1
__newlast1(_RAI1 __first1, _RAI1 __last1,
_RAI2 __first2, _RAI2 __last2)
{
const typename iterator_traits<_RAI1>::difference_type
__diff1 = __last1 - __first1;
const typename iterator_traits<_RAI2>::difference_type
__diff2 = __last2 - __first2;
return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
}
template<typename _RAI>
static bool
__cnd2(_RAI, _RAI)
{ return true; }
};
template<bool _BoolType>
struct __lexicographical_compare
{
template<typename _II1, typename _II2>
static bool __lc(_II1, _II1, _II2, _II2);
};
template<bool _BoolType>
template<typename _II1, typename _II2>
bool
__lexicographical_compare<_BoolType>::
__lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
{
typedef typename iterator_traits<_II1>::iterator_category _Category1;
typedef typename iterator_traits<_II2>::iterator_category _Category2;
typedef std::__lc_rai<_Category1, _Category2> __rai_type;
__last1 = __rai_type::__newlast1(__first1, __last1,
__first2, __last2);
for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
++__first1, ++__first2)
{
if (*__first1 < *__first2)
return true;
if (*__first2 < *__first1)
return false;
}
return __first1 == __last1 && __first2 != __last2;
}
template<>
struct __lexicographical_compare<true>
{
template<typename _Tp, typename _Up>
static bool
__lc(const _Tp* __first1, const _Tp* __last1,
const _Up* __first2, const _Up* __last2)
{
const size_t __len1 = __last1 - __first1;
const size_t __len2 = __last2 - __first2;
const int __result = __builtin_memcmp(__first1, __first2,
std::min(__len1, __len2));
return __result != 0 ? __result < 0 : __len1 < __len2;
}
};
template<typename _II1, typename _II2>
inline bool
__lexicographical_compare_aux(_II1 __first1, _II1 __last1,
_II2 __first2, _II2 __last2)
{
typedef typename iterator_traits<_II1>::value_type _ValueType1;
typedef typename iterator_traits<_II2>::value_type _ValueType2;
const bool __simple =
(__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
&& !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
&& !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
&& __is_pointer<_II1>::__value
&& __is_pointer<_II2>::__value);
return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
__first2, __last2);
}
# 941 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _ForwardIterator, typename _Tp>
_ForwardIterator
lower_bound(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __val)
{
typedef typename iterator_traits<_ForwardIterator>::difference_type
_DistanceType;
;
_DistanceType __len = std::distance(__first, __last);
while (__len > 0)
{
_DistanceType __half = __len >> 1;
_ForwardIterator __middle = __first;
std::advance(__middle, __half);
if (*__middle < __val)
{
__first = __middle;
++__first;
__len = __len - __half - 1;
}
else
__len = __half;
}
return __first;
}
inline int
__lg(int __n)
{ return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
inline unsigned
__lg(unsigned __n)
{ return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
inline long
__lg(long __n)
{ return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
inline unsigned long
__lg(unsigned long __n)
{ return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
inline long long
__lg(long long __n)
{ return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
inline unsigned long long
__lg(unsigned long long __n)
{ return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
# 1019 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _II1, typename _II2>
inline bool
equal(_II1 __first1, _II1 __last1, _II2 __first2)
{
;
return std::__equal_aux(std::__niter_base(__first1),
std::__niter_base(__last1),
std::__niter_base(__first2));
}
# 1051 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
inline bool
equal(_IIter1 __first1, _IIter1 __last1,
_IIter2 __first2, _BinaryPredicate __binary_pred)
{
;
for (; __first1 != __last1; ++__first1, ++__first2)
if (!bool(__binary_pred(*__first1, *__first2)))
return false;
return true;
}
# 1082 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _II1, typename _II2>
inline bool
lexicographical_compare(_II1 __first1, _II1 __last1,
_II2 __first2, _II2 __last2)
{
;
;
return std::__lexicographical_compare_aux(std::__niter_base(__first1),
std::__niter_base(__last1),
std::__niter_base(__first2),
std::__niter_base(__last2));
}
# 1118 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _II1, typename _II2, typename _Compare>
bool
lexicographical_compare(_II1 __first1, _II1 __last1,
_II2 __first2, _II2 __last2, _Compare __comp)
{
typedef typename iterator_traits<_II1>::iterator_category _Category1;
typedef typename iterator_traits<_II2>::iterator_category _Category2;
typedef std::__lc_rai<_Category1, _Category2> __rai_type;
;
;
__last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
++__first1, ++__first2)
{
if (__comp(*__first1, *__first2))
return true;
if (__comp(*__first2, *__first1))
return false;
}
return __first1 == __last1 && __first2 != __last2;
}
# 1158 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _InputIterator1, typename _InputIterator2>
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2)
{
;
while (__first1 != __last1 && *__first1 == *__first2)
{
++__first1;
++__first2;
}
return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
}
# 1195 "/opt/local/include/gcc48/c++/bits/stl_algobase.h" 3
template<typename _InputIterator1, typename _InputIterator2,
typename _BinaryPredicate>
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _BinaryPredicate __binary_pred)
{
;
while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
{
++__first1;
++__first2;
}
return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
}
}
# 61 "/opt/local/include/gcc48/c++/vector" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/allocator.h" 1 3
# 46 "/opt/local/include/gcc48/c++/bits/allocator.h" 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++allocator.h" 1 3
# 33 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++allocator.h" 3
# 1 "/opt/local/include/gcc48/c++/ext/new_allocator.h" 1 3
# 33 "/opt/local/include/gcc48/c++/ext/new_allocator.h" 3
# 1 "/opt/local/include/gcc48/c++/new" 1 3
# 37 "/opt/local/include/gcc48/c++/new" 3
# 38 "/opt/local/include/gcc48/c++/new" 3
# 1 "/opt/local/include/gcc48/c++/exception" 1 3
# 33 "/opt/local/include/gcc48/c++/exception" 3
# 34 "/opt/local/include/gcc48/c++/exception" 3
#pragma GCC visibility push(default)
# 1 "/opt/local/include/gcc48/c++/bits/atomic_lockfree_defines.h" 1 3
# 33 "/opt/local/include/gcc48/c++/bits/atomic_lockfree_defines.h" 3
# 34 "/opt/local/include/gcc48/c++/bits/atomic_lockfree_defines.h" 3
# 39 "/opt/local/include/gcc48/c++/exception" 2 3
extern "C++" {
namespace std
{
# 60 "/opt/local/include/gcc48/c++/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();
virtual const char* what() const throw();
};
typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
terminate_handler set_terminate(terminate_handler) throw();
void terminate() throw() __attribute__ ((__noreturn__));
unexpected_handler set_unexpected(unexpected_handler) throw();
void unexpected() __attribute__ ((__noreturn__));
# 117 "/opt/local/include/gcc48/c++/exception" 3
bool uncaught_exception() throw() __attribute__ ((__pure__));
}
namespace __gnu_cxx
{
# 142 "/opt/local/include/gcc48/c++/exception" 3
void __verbose_terminate_handler();
}
}
#pragma GCC visibility pop
# 41 "/opt/local/include/gcc48/c++/new" 2 3
#pragma GCC visibility push(default)
extern "C++" {
namespace std
{
class bad_alloc : public exception
{
public:
bad_alloc() throw() { }
virtual ~bad_alloc() throw();
virtual const char* what() const throw();
};
struct nothrow_t { };
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler(new_handler) throw();
}
# 91 "/opt/local/include/gcc48/c++/new" 3
void* operator new(std::size_t) throw(std::bad_alloc)
__attribute__((__externally_visible__));
void* operator new[](std::size_t) throw(std::bad_alloc)
__attribute__((__externally_visible__));
void operator delete(void*) throw()
__attribute__((__externally_visible__));
void operator delete[](void*) throw()
__attribute__((__externally_visible__));
void* operator new(std::size_t, const std::nothrow_t&) throw()
__attribute__((__externally_visible__));
void* operator new[](std::size_t, const std::nothrow_t&) throw()
__attribute__((__externally_visible__));
void operator delete(void*, const std::nothrow_t&) throw()
__attribute__((__externally_visible__));
void operator delete[](void*, const std::nothrow_t&) throw()
__attribute__((__externally_visible__));
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() { }
}
#pragma GCC visibility pop
# 34 "/opt/local/include/gcc48/c++/ext/new_allocator.h" 2 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
using std::size_t;
using std::ptrdiff_t;
# 57 "/opt/local/include/gcc48/c++/ext/new_allocator.h" 3
template<typename _Tp>
class new_allocator
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
template<typename _Tp1>
struct rebind
{ typedef new_allocator<_Tp1> other; };
new_allocator() throw() { }
new_allocator(const new_allocator&) throw() { }
template<typename _Tp1>
new_allocator(const new_allocator<_Tp1>&) throw() { }
~new_allocator() throw() { }
pointer
address(reference __x) const
{ return std::__addressof(__x); }
const_pointer
address(const_reference __x) const
{ return std::__addressof(__x); }
pointer
allocate(size_type __n, const void* = 0)
{
if (__n > this->max_size())
std::__throw_bad_alloc();
return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
}
void
deallocate(pointer __p, size_type)
{ ::operator delete(__p); }
size_type
max_size() const throw()
{ return size_t(-1) / sizeof(_Tp); }
# 128 "/opt/local/include/gcc48/c++/ext/new_allocator.h" 3
void
construct(pointer __p, const _Tp& __val)
{ ::new((void *)__p) _Tp(__val); }
void
destroy(pointer __p) { __p->~_Tp(); }
};
template<typename _Tp>
inline bool
operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
{ return true; }
template<typename _Tp>
inline bool
operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
{ return false; }
}
# 34 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++allocator.h" 2 3
# 47 "/opt/local/include/gcc48/c++/bits/allocator.h" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/memoryfwd.h" 1 3
# 46 "/opt/local/include/gcc48/c++/bits/memoryfwd.h" 3
# 47 "/opt/local/include/gcc48/c++/bits/memoryfwd.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 63 "/opt/local/include/gcc48/c++/bits/memoryfwd.h" 3
template<typename>
class allocator;
template<>
class allocator<void>;
template<typename, typename>
struct uses_allocator;
}
# 48 "/opt/local/include/gcc48/c++/bits/allocator.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<>
class allocator<void>
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template<typename _Tp1>
struct rebind
{ typedef allocator<_Tp1> other; };
};
# 91 "/opt/local/include/gcc48/c++/bits/allocator.h" 3
template<typename _Tp>
class allocator: public __gnu_cxx::new_allocator<_Tp>
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
template<typename _Tp1>
struct rebind
{ typedef allocator<_Tp1> other; };
allocator() throw() { }
allocator(const allocator& __a) throw()
: __gnu_cxx::new_allocator<_Tp>(__a) { }
template<typename _Tp1>
allocator(const allocator<_Tp1>&) throw() { }
~allocator() throw() { }
};
template<typename _T1, typename _T2>
inline bool
operator==(const allocator<_T1>&, const allocator<_T2>&)
{ return true; }
template<typename _Tp>
inline bool
operator==(const allocator<_Tp>&, const allocator<_Tp>&)
{ return true; }
template<typename _T1, typename _T2>
inline bool
operator!=(const allocator<_T1>&, const allocator<_T2>&)
{ return false; }
template<typename _Tp>
inline bool
operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
{ return false; }
extern template class allocator<char>;
extern template class allocator<wchar_t>;
template<typename _Alloc, bool = __is_empty(_Alloc)>
struct __alloc_swap
{ static void _S_do_it(_Alloc&, _Alloc&) { } };
template<typename _Alloc>
struct __alloc_swap<_Alloc, false>
{
static void
_S_do_it(_Alloc& __one, _Alloc& __two)
{
if (__one != __two)
swap(__one, __two);
}
};
template<typename _Alloc, bool = __is_empty(_Alloc)>
struct __alloc_neq
{
static bool
_S_do_it(const _Alloc&, const _Alloc&)
{ return false; }
};
template<typename _Alloc>
struct __alloc_neq<_Alloc, false>
{
static bool
_S_do_it(const _Alloc& __one, const _Alloc& __two)
{ return __one != __two; }
};
# 218 "/opt/local/include/gcc48/c++/bits/allocator.h" 3
}
# 62 "/opt/local/include/gcc48/c++/vector" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_construct.h" 1 3
# 61 "/opt/local/include/gcc48/c++/bits/stl_construct.h" 3
# 1 "/opt/local/include/gcc48/c++/ext/alloc_traits.h" 1 3
# 32 "/opt/local/include/gcc48/c++/ext/alloc_traits.h" 3
# 33 "/opt/local/include/gcc48/c++/ext/alloc_traits.h" 3
# 41 "/opt/local/include/gcc48/c++/ext/alloc_traits.h" 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
# 120 "/opt/local/include/gcc48/c++/ext/alloc_traits.h" 3
template<typename _Alloc>
struct __alloc_traits
{
typedef _Alloc allocator_type;
# 199 "/opt/local/include/gcc48/c++/ext/alloc_traits.h" 3
typedef typename _Alloc::pointer pointer;
typedef typename _Alloc::const_pointer const_pointer;
typedef typename _Alloc::value_type value_type;
typedef typename _Alloc::reference reference;
typedef typename _Alloc::const_reference const_reference;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
static pointer
allocate(_Alloc& __a, size_type __n)
{ return __a.allocate(__n); }
static void deallocate(_Alloc& __a, pointer __p, size_type __n)
{ __a.deallocate(__p, __n); }
template<typename _Tp>
static void construct(_Alloc& __a, pointer __p, const _Tp& __arg)
{ __a.construct(__p, __arg); }
static void destroy(_Alloc& __a, pointer __p)
{ __a.destroy(__p); }
static size_type max_size(const _Alloc& __a)
{ return __a.max_size(); }
static const _Alloc& _S_select_on_copy(const _Alloc& __a) { return __a; }
static void _S_on_swap(_Alloc& __a, _Alloc& __b)
{
std::__alloc_swap<_Alloc>::_S_do_it(__a, __b);
}
template<typename _Tp>
struct rebind
{ typedef typename _Alloc::template rebind<_Tp>::other other; };
};
}
# 62 "/opt/local/include/gcc48/c++/bits/stl_construct.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 77 "/opt/local/include/gcc48/c++/bits/stl_construct.h" 3
template<typename _T1, typename _T2>
inline void
_Construct(_T1* __p, const _T2& __value)
{
::new(static_cast<void*>(__p)) _T1(__value);
}
template<typename _Tp>
inline void
_Destroy(_Tp* __pointer)
{ __pointer->~_Tp(); }
template<bool>
struct _Destroy_aux
{
template<typename _ForwardIterator>
static void
__destroy(_ForwardIterator __first, _ForwardIterator __last)
{
for (; __first != __last; ++__first)
std::_Destroy(std::__addressof(*__first));
}
};
template<>
struct _Destroy_aux<true>
{
template<typename _ForwardIterator>
static void
__destroy(_ForwardIterator, _ForwardIterator) { }
};
template<typename _ForwardIterator>
inline void
_Destroy(_ForwardIterator __first, _ForwardIterator __last)
{
typedef typename iterator_traits<_ForwardIterator>::value_type
_Value_type;
std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
__destroy(__first, __last);
}
template<typename _ForwardIterator, typename _Allocator>
void
_Destroy(_ForwardIterator __first, _ForwardIterator __last,
_Allocator& __alloc)
{
typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
for (; __first != __last; ++__first)
__traits::destroy(__alloc, std::__addressof(*__first));
}
template<typename _ForwardIterator, typename _Tp>
inline void
_Destroy(_ForwardIterator __first, _ForwardIterator __last,
allocator<_Tp>&)
{
_Destroy(__first, __last);
}
}
# 63 "/opt/local/include/gcc48/c++/vector" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_uninitialized.h" 1 3
# 59 "/opt/local/include/gcc48/c++/bits/stl_uninitialized.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<bool _TrivialValueTypes>
struct __uninitialized_copy
{
template<typename _InputIterator, typename _ForwardIterator>
static _ForwardIterator
__uninit_copy(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result)
{
_ForwardIterator __cur = __result;
if (true)
{
for (; __first != __last; ++__first, ++__cur)
std::_Construct(std::__addressof(*__cur), *__first);
return __cur;
}
if (false)
{
std::_Destroy(__result, __cur);
;
}
}
};
template<>
struct __uninitialized_copy<true>
{
template<typename _InputIterator, typename _ForwardIterator>
static _ForwardIterator
__uninit_copy(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result)
{ return std::copy(__first, __last, __result); }
};
# 105 "/opt/local/include/gcc48/c++/bits/stl_uninitialized.h" 3
template<typename _InputIterator, typename _ForwardIterator>
inline _ForwardIterator
uninitialized_copy(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result)
{
typedef typename iterator_traits<_InputIterator>::value_type
_ValueType1;
typedef typename iterator_traits<_ForwardIterator>::value_type
_ValueType2;
return std::__uninitialized_copy<(__is_trivial(_ValueType1)
&& __is_trivial(_ValueType2))>::
__uninit_copy(__first, __last, __result);
}
template<bool _TrivialValueType>
struct __uninitialized_fill
{
template<typename _ForwardIterator, typename _Tp>
static void
__uninit_fill(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x)
{
_ForwardIterator __cur = __first;
if (true)
{
for (; __cur != __last; ++__cur)
std::_Construct(std::__addressof(*__cur), __x);
}
if (false)
{
std::_Destroy(__first, __cur);
;
}
}
};
template<>
struct __uninitialized_fill<true>
{
template<typename _ForwardIterator, typename _Tp>
static void
__uninit_fill(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x)
{ std::fill(__first, __last, __x); }
};
# 162 "/opt/local/include/gcc48/c++/bits/stl_uninitialized.h" 3
template<typename _ForwardIterator, typename _Tp>
inline void
uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x)
{
typedef typename iterator_traits<_ForwardIterator>::value_type
_ValueType;
std::__uninitialized_fill<__is_trivial(_ValueType)>::
__uninit_fill(__first, __last, __x);
}
template<bool _TrivialValueType>
struct __uninitialized_fill_n
{
template<typename _ForwardIterator, typename _Size, typename _Tp>
static void
__uninit_fill_n(_ForwardIterator __first, _Size __n,
const _Tp& __x)
{
_ForwardIterator __cur = __first;
if (true)
{
for (; __n > 0; --__n, ++__cur)
std::_Construct(std::__addressof(*__cur), __x);
}
if (false)
{
std::_Destroy(__first, __cur);
;
}
}
};
template<>
struct __uninitialized_fill_n<true>
{
template<typename _ForwardIterator, typename _Size, typename _Tp>
static void
__uninit_fill_n(_ForwardIterator __first, _Size __n,
const _Tp& __x)
{ std::fill_n(__first, __n, __x); }
};
# 216 "/opt/local/include/gcc48/c++/bits/stl_uninitialized.h" 3
template<typename _ForwardIterator, typename _Size, typename _Tp>
inline void
uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
{
typedef typename iterator_traits<_ForwardIterator>::value_type
_ValueType;
std::__uninitialized_fill_n<__is_trivial(_ValueType)>::
__uninit_fill_n(__first, __n, __x);
}
template<typename _InputIterator, typename _ForwardIterator,
typename _Allocator>
_ForwardIterator
__uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result, _Allocator& __alloc)
{
_ForwardIterator __cur = __result;
if (true)
{
typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
for (; __first != __last; ++__first, ++__cur)
__traits::construct(__alloc, std::__addressof(*__cur), *__first);
return __cur;
}
if (false)
{
std::_Destroy(__result, __cur, __alloc);
;
}
}
template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
inline _ForwardIterator
__uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result, allocator<_Tp>&)
{ return std::uninitialized_copy(__first, __last, __result); }
template<typename _InputIterator, typename _ForwardIterator,
typename _Allocator>
inline _ForwardIterator
__uninitialized_move_a(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result, _Allocator& __alloc)
{
return std::__uninitialized_copy_a((__first),
(__last),
__result, __alloc);
}
template<typename _InputIterator, typename _ForwardIterator,
typename _Allocator>
inline _ForwardIterator
__uninitialized_move_if_noexcept_a(_InputIterator __first,
_InputIterator __last,
_ForwardIterator __result,
_Allocator& __alloc)
{
return std::__uninitialized_copy_a
((__first),
(__last), __result, __alloc);
}
template<typename _ForwardIterator, typename _Tp, typename _Allocator>
void
__uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x, _Allocator& __alloc)
{
_ForwardIterator __cur = __first;
if (true)
{
typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
for (; __cur != __last; ++__cur)
__traits::construct(__alloc, std::__addressof(*__cur), __x);
}
if (false)
{
std::_Destroy(__first, __cur, __alloc);
;
}
}
template<typename _ForwardIterator, typename _Tp, typename _Tp2>
inline void
__uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x, allocator<_Tp2>&)
{ std::uninitialized_fill(__first, __last, __x); }
template<typename _ForwardIterator, typename _Size, typename _Tp,
typename _Allocator>
void
__uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
const _Tp& __x, _Allocator& __alloc)
{
_ForwardIterator __cur = __first;
if (true)
{
typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
for (; __n > 0; --__n, ++__cur)
__traits::construct(__alloc, std::__addressof(*__cur), __x);
}
if (false)
{
std::_Destroy(__first, __cur, __alloc);
;
}
}
template<typename _ForwardIterator, typename _Size, typename _Tp,
typename _Tp2>
inline void
__uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
const _Tp& __x, allocator<_Tp2>&)
{ std::uninitialized_fill_n(__first, __n, __x); }
# 346 "/opt/local/include/gcc48/c++/bits/stl_uninitialized.h" 3
template<typename _InputIterator1, typename _InputIterator2,
typename _ForwardIterator, typename _Allocator>
inline _ForwardIterator
__uninitialized_copy_move(_InputIterator1 __first1,
_InputIterator1 __last1,
_InputIterator2 __first2,
_InputIterator2 __last2,
_ForwardIterator __result,
_Allocator& __alloc)
{
_ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
__result,
__alloc);
if (true)
{
return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
}
if (false)
{
std::_Destroy(__result, __mid, __alloc);
;
}
}
template<typename _InputIterator1, typename _InputIterator2,
typename _ForwardIterator, typename _Allocator>
inline _ForwardIterator
__uninitialized_move_copy(_InputIterator1 __first1,
_InputIterator1 __last1,
_InputIterator2 __first2,
_InputIterator2 __last2,
_ForwardIterator __result,
_Allocator& __alloc)
{
_ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
__result,
__alloc);
if (true)
{
return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
}
if (false)
{
std::_Destroy(__result, __mid, __alloc);
;
}
}
template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
typename _Allocator>
inline _ForwardIterator
__uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
const _Tp& __x, _InputIterator __first,
_InputIterator __last, _Allocator& __alloc)
{
std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
if (true)
{
return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
}
if (false)
{
std::_Destroy(__result, __mid, __alloc);
;
}
}
template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
typename _Allocator>
inline void
__uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
_ForwardIterator __first2,
_ForwardIterator __last2, const _Tp& __x,
_Allocator& __alloc)
{
_ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
__first2,
__alloc);
if (true)
{
std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
}
if (false)
{
std::_Destroy(__first2, __mid2, __alloc);
;
}
}
# 653 "/opt/local/include/gcc48/c++/bits/stl_uninitialized.h" 3
}
# 64 "/opt/local/include/gcc48/c++/vector" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 1 3
# 66 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _Tp, typename _Alloc>
struct _Vector_base
{
typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
rebind<_Tp>::other _Tp_alloc_type;
typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
pointer;
struct _Vector_impl
: public _Tp_alloc_type
{
pointer _M_start;
pointer _M_finish;
pointer _M_end_of_storage;
_Vector_impl()
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
_Vector_impl(_Tp_alloc_type const& __a)
: _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
# 101 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void _M_swap_data(_Vector_impl& __x)
{
std::swap(_M_start, __x._M_start);
std::swap(_M_finish, __x._M_finish);
std::swap(_M_end_of_storage, __x._M_end_of_storage);
}
};
public:
typedef _Alloc allocator_type;
_Tp_alloc_type&
_M_get_Tp_allocator()
{ return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
const _Tp_alloc_type&
_M_get_Tp_allocator() const
{ return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
allocator_type
get_allocator() const
{ return allocator_type(_M_get_Tp_allocator()); }
_Vector_base()
: _M_impl() { }
_Vector_base(const allocator_type& __a)
: _M_impl(__a) { }
_Vector_base(size_t __n)
: _M_impl()
{ _M_create_storage(__n); }
_Vector_base(size_t __n, const allocator_type& __a)
: _M_impl(__a)
{ _M_create_storage(__n); }
# 159 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
~_Vector_base()
{ _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
- this->_M_impl._M_start); }
public:
_Vector_impl _M_impl;
pointer
_M_allocate(size_t __n)
{ return __n != 0 ? _M_impl.allocate(__n) : 0; }
void
_M_deallocate(pointer __p, size_t __n)
{
if (__p)
_M_impl.deallocate(__p, __n);
}
private:
void
_M_create_storage(size_t __n)
{
this->_M_impl._M_start = this->_M_allocate(__n);
this->_M_impl._M_finish = this->_M_impl._M_start;
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
}
};
# 209 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
class vector : protected _Vector_base<_Tp, _Alloc>
{
typedef typename _Alloc::value_type _Alloc_value_type;
typedef _Vector_base<_Tp, _Alloc> _Base;
typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
public:
typedef _Tp value_type;
typedef typename _Base::pointer pointer;
typedef typename _Alloc_traits::const_pointer const_pointer;
typedef typename _Alloc_traits::reference reference;
typedef typename _Alloc_traits::const_reference const_reference;
typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Alloc allocator_type;
protected:
using _Base::_M_allocate;
using _Base::_M_deallocate;
using _Base::_M_impl;
using _Base::_M_get_Tp_allocator;
public:
vector()
: _Base() { }
explicit
vector(const allocator_type& __a)
: _Base(__a) { }
# 294 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
explicit
vector(size_type __n, const value_type& __value = value_type(),
const allocator_type& __a = allocator_type())
: _Base(__n, __a)
{ _M_fill_initialize(__n, __value); }
# 310 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
vector(const vector& __x)
: _Base(__x.size(),
_Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
{ this->_M_impl._M_finish =
std::__uninitialized_copy_a(__x.begin(), __x.end(),
this->_M_impl._M_start,
_M_get_Tp_allocator());
}
# 397 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
: _Base(__a)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
# 414 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
~vector()
{ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator()); }
# 426 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
vector&
operator=(const vector& __x);
# 478 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
assign(size_type __n, const value_type& __val)
{ _M_fill_assign(__n, __val); }
# 501 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _InputIterator>
void
assign(_InputIterator __first, _InputIterator __last)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
# 529 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
using _Base::get_allocator;
iterator
begin()
{ return iterator(this->_M_impl._M_start); }
const_iterator
begin() const
{ return const_iterator(this->_M_impl._M_start); }
iterator
end()
{ return iterator(this->_M_impl._M_finish); }
const_iterator
end() const
{ return const_iterator(this->_M_impl._M_finish); }
reverse_iterator
rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(end()); }
reverse_iterator
rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator
rend() const
{ return const_reverse_iterator(begin()); }
# 644 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
size_type
size() const
{ return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
size_type
max_size() const
{ return _Alloc_traits::max_size(_M_get_Tp_allocator()); }
# 703 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
resize(size_type __new_size, value_type __x = value_type())
{
if (__new_size > size())
insert(end(), __new_size - size(), __x);
else if (__new_size < size())
_M_erase_at_end(this->_M_impl._M_start + __new_size);
}
# 724 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
size_type
capacity() const
{ return size_type(this->_M_impl._M_end_of_storage
- this->_M_impl._M_start); }
bool
empty() const
{ return begin() == end(); }
# 754 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
reserve(size_type __n);
# 769 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
reference
operator[](size_type __n)
{ return *(this->_M_impl._M_start + __n); }
# 784 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
const_reference
operator[](size_type __n) const
{ return *(this->_M_impl._M_start + __n); }
protected:
void
_M_range_check(size_type __n) const
{
if (__n >= this->size())
__throw_out_of_range(("vector::_M_range_check"));
}
public:
# 809 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
reference
at(size_type __n)
{
_M_range_check(__n);
return (*this)[__n];
}
# 827 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
const_reference
at(size_type __n) const
{
_M_range_check(__n);
return (*this)[__n];
}
reference
front()
{ return *begin(); }
const_reference
front() const
{ return *begin(); }
reference
back()
{ return *(end() - 1); }
const_reference
back() const
{ return *(end() - 1); }
# 876 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
pointer
data()
{ return std::__addressof(front()); }
const_pointer
data() const
{ return std::__addressof(front()); }
# 900 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
push_back(const value_type& __x)
{
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
{
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
__x);
++this->_M_impl._M_finish;
}
else
_M_insert_aux(end(), __x);
}
# 936 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
pop_back()
{
--this->_M_impl._M_finish;
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
}
# 972 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
iterator
insert(iterator __position, const value_type& __x);
# 1022 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
insert(iterator __position, size_type __n, const value_type& __x)
{ _M_fill_insert(__position, __n, __x); }
# 1048 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _InputIterator>
void
insert(iterator __position, _InputIterator __first,
_InputIterator __last)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
# 1074 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
iterator
erase(iterator __position);
# 1095 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
iterator
erase(iterator __first, iterator __last);
# 1107 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
swap(vector& __x)
{
this->_M_impl._M_swap_data(__x._M_impl);
_Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
__x._M_get_Tp_allocator());
}
void
clear()
{ _M_erase_at_end(this->_M_impl._M_start); }
protected:
template<typename _ForwardIterator>
pointer
_M_allocate_and_copy(size_type __n,
_ForwardIterator __first, _ForwardIterator __last)
{
pointer __result = this->_M_allocate(__n);
if (true)
{
std::__uninitialized_copy_a(__first, __last, __result,
_M_get_Tp_allocator());
return __result;
}
if (false)
{
_M_deallocate(__result, __n);
;
}
}
# 1159 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _Integer>
void
_M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
{
this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
this->_M_impl._M_end_of_storage =
this->_M_impl._M_start + static_cast<size_type>(__n);
_M_fill_initialize(static_cast<size_type>(__n), __value);
}
template<typename _InputIterator>
void
_M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{
typedef typename std::iterator_traits<_InputIterator>::
iterator_category _IterCategory;
_M_range_initialize(__first, __last, _IterCategory());
}
template<typename _InputIterator>
void
_M_range_initialize(_InputIterator __first,
_InputIterator __last, std::input_iterator_tag)
{
for (; __first != __last; ++__first)
push_back(*__first);
}
template<typename _ForwardIterator>
void
_M_range_initialize(_ForwardIterator __first,
_ForwardIterator __last, std::forward_iterator_tag)
{
const size_type __n = std::distance(__first, __last);
this->_M_impl._M_start = this->_M_allocate(__n);
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__first, __last,
this->_M_impl._M_start,
_M_get_Tp_allocator());
}
void
_M_fill_initialize(size_type __n, const value_type& __value)
{
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
_M_get_Tp_allocator());
this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
}
# 1237 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _Integer>
void
_M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign(__n, __val); }
template<typename _InputIterator>
void
_M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{
typedef typename std::iterator_traits<_InputIterator>::
iterator_category _IterCategory;
_M_assign_aux(__first, __last, _IterCategory());
}
template<typename _InputIterator>
void
_M_assign_aux(_InputIterator __first, _InputIterator __last,
std::input_iterator_tag);
template<typename _ForwardIterator>
void
_M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
std::forward_iterator_tag);
void
_M_fill_assign(size_type __n, const value_type& __val);
# 1277 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _Integer>
void
_M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
__true_type)
{ _M_fill_insert(__pos, __n, __val); }
template<typename _InputIterator>
void
_M_insert_dispatch(iterator __pos, _InputIterator __first,
_InputIterator __last, __false_type)
{
typedef typename std::iterator_traits<_InputIterator>::
iterator_category _IterCategory;
_M_range_insert(__pos, __first, __last, _IterCategory());
}
template<typename _InputIterator>
void
_M_range_insert(iterator __pos, _InputIterator __first,
_InputIterator __last, std::input_iterator_tag);
template<typename _ForwardIterator>
void
_M_range_insert(iterator __pos, _ForwardIterator __first,
_ForwardIterator __last, std::forward_iterator_tag);
void
_M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
# 1322 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
void
_M_insert_aux(iterator __position, const value_type& __x);
# 1335 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
size_type
_M_check_len(size_type __n, const char* __s) const
{
if (max_size() - size() < __n)
__throw_length_error((__s));
const size_type __len = size() + std::max(size(), __n);
return (__len < size() || __len > max_size()) ? max_size() : __len;
}
void
_M_erase_at_end(pointer __pos)
{
std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
this->_M_impl._M_finish = __pos;
}
# 1388 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
};
# 1401 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _Tp, typename _Alloc>
inline bool
operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{ return (__x.size() == __y.size()
&& std::equal(__x.begin(), __x.end(), __y.begin())); }
# 1418 "/opt/local/include/gcc48/c++/bits/stl_vector.h" 3
template<typename _Tp, typename _Alloc>
inline bool
operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{ return std::lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end()); }
template<typename _Tp, typename _Alloc>
inline bool
operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{ return !(__x == __y); }
template<typename _Tp, typename _Alloc>
inline bool
operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{ return __y < __x; }
template<typename _Tp, typename _Alloc>
inline bool
operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{ return !(__y < __x); }
template<typename _Tp, typename _Alloc>
inline bool
operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{ return !(__x < __y); }
template<typename _Tp, typename _Alloc>
inline void
swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
{ __x.swap(__y); }
}
# 65 "/opt/local/include/gcc48/c++/vector" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 1 3
# 63 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
typedef unsigned long _Bit_type;
enum { _S_word_bit = int(8 * sizeof(_Bit_type)) };
struct _Bit_reference
{
_Bit_type * _M_p;
_Bit_type _M_mask;
_Bit_reference(_Bit_type * __x, _Bit_type __y)
: _M_p(__x), _M_mask(__y) { }
_Bit_reference() : _M_p(0), _M_mask(0) { }
operator bool() const
{ return !!(*_M_p & _M_mask); }
_Bit_reference&
operator=(bool __x)
{
if (__x)
*_M_p |= _M_mask;
else
*_M_p &= ~_M_mask;
return *this;
}
_Bit_reference&
operator=(const _Bit_reference& __x)
{ return *this = bool(__x); }
bool
operator==(const _Bit_reference& __x) const
{ return bool(*this) == bool(__x); }
bool
operator<(const _Bit_reference& __x) const
{ return !bool(*this) && bool(__x); }
void
flip()
{ *_M_p ^= _M_mask; }
};
# 136 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
struct _Bit_iterator_base
: public std::iterator<std::random_access_iterator_tag, bool>
{
_Bit_type * _M_p;
unsigned int _M_offset;
_Bit_iterator_base(_Bit_type * __x, unsigned int __y)
: _M_p(__x), _M_offset(__y) { }
void
_M_bump_up()
{
if (_M_offset++ == int(_S_word_bit) - 1)
{
_M_offset = 0;
++_M_p;
}
}
void
_M_bump_down()
{
if (_M_offset-- == 0)
{
_M_offset = int(_S_word_bit) - 1;
--_M_p;
}
}
void
_M_incr(ptrdiff_t __i)
{
difference_type __n = __i + _M_offset;
_M_p += __n / int(_S_word_bit);
__n = __n % int(_S_word_bit);
if (__n < 0)
{
__n += int(_S_word_bit);
--_M_p;
}
_M_offset = static_cast<unsigned int>(__n);
}
bool
operator==(const _Bit_iterator_base& __i) const
{ return _M_p == __i._M_p && _M_offset == __i._M_offset; }
bool
operator<(const _Bit_iterator_base& __i) const
{
return _M_p < __i._M_p
|| (_M_p == __i._M_p && _M_offset < __i._M_offset);
}
bool
operator!=(const _Bit_iterator_base& __i) const
{ return !(*this == __i); }
bool
operator>(const _Bit_iterator_base& __i) const
{ return __i < *this; }
bool
operator<=(const _Bit_iterator_base& __i) const
{ return !(__i < *this); }
bool
operator>=(const _Bit_iterator_base& __i) const
{ return !(*this < __i); }
};
inline ptrdiff_t
operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
{
return (int(_S_word_bit) * (__x._M_p - __y._M_p)
+ __x._M_offset - __y._M_offset);
}
struct _Bit_iterator : public _Bit_iterator_base
{
typedef _Bit_reference reference;
typedef _Bit_reference* pointer;
typedef _Bit_iterator iterator;
_Bit_iterator() : _Bit_iterator_base(0, 0) { }
_Bit_iterator(_Bit_type * __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) { }
reference
operator*() const
{ return reference(_M_p, 1UL << _M_offset); }
iterator&
operator++()
{
_M_bump_up();
return *this;
}
iterator
operator++(int)
{
iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
iterator&
operator--()
{
_M_bump_down();
return *this;
}
iterator
operator--(int)
{
iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
iterator&
operator+=(difference_type __i)
{
_M_incr(__i);
return *this;
}
iterator&
operator-=(difference_type __i)
{
*this += -__i;
return *this;
}
iterator
operator+(difference_type __i) const
{
iterator __tmp = *this;
return __tmp += __i;
}
iterator
operator-(difference_type __i) const
{
iterator __tmp = *this;
return __tmp -= __i;
}
reference
operator[](difference_type __i) const
{ return *(*this + __i); }
};
inline _Bit_iterator
operator+(ptrdiff_t __n, const _Bit_iterator& __x)
{ return __x + __n; }
struct _Bit_const_iterator : public _Bit_iterator_base
{
typedef bool reference;
typedef bool const_reference;
typedef const bool* pointer;
typedef _Bit_const_iterator const_iterator;
_Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
_Bit_const_iterator(_Bit_type * __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) { }
_Bit_const_iterator(const _Bit_iterator& __x)
: _Bit_iterator_base(__x._M_p, __x._M_offset) { }
const_reference
operator*() const
{ return _Bit_reference(_M_p, 1UL << _M_offset); }
const_iterator&
operator++()
{
_M_bump_up();
return *this;
}
const_iterator
operator++(int)
{
const_iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
const_iterator&
operator--()
{
_M_bump_down();
return *this;
}
const_iterator
operator--(int)
{
const_iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
const_iterator&
operator+=(difference_type __i)
{
_M_incr(__i);
return *this;
}
const_iterator&
operator-=(difference_type __i)
{
*this += -__i;
return *this;
}
const_iterator
operator+(difference_type __i) const
{
const_iterator __tmp = *this;
return __tmp += __i;
}
const_iterator
operator-(difference_type __i) const
{
const_iterator __tmp = *this;
return __tmp -= __i;
}
const_reference
operator[](difference_type __i) const
{ return *(*this + __i); }
};
inline _Bit_const_iterator
operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
{ return __x + __n; }
inline void
__fill_bvector(_Bit_iterator __first, _Bit_iterator __last, bool __x)
{
for (; __first != __last; ++__first)
*__first = __x;
}
inline void
fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x)
{
if (__first._M_p != __last._M_p)
{
std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0);
__fill_bvector(__first, _Bit_iterator(__first._M_p + 1, 0), __x);
__fill_bvector(_Bit_iterator(__last._M_p, 0), __last, __x);
}
else
__fill_bvector(__first, __last, __x);
}
template<typename _Alloc>
struct _Bvector_base
{
typedef typename _Alloc::template rebind<_Bit_type>::other
_Bit_alloc_type;
struct _Bvector_impl
: public _Bit_alloc_type
{
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
_Bit_type* _M_end_of_storage;
_Bvector_impl()
: _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
{ }
_Bvector_impl(const _Bit_alloc_type& __a)
: _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
{ }
};
public:
typedef _Alloc allocator_type;
_Bit_alloc_type&
_M_get_Bit_allocator()
{ return *static_cast<_Bit_alloc_type*>(&this->_M_impl); }
const _Bit_alloc_type&
_M_get_Bit_allocator() const
{ return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); }
allocator_type
get_allocator() const
{ return allocator_type(_M_get_Bit_allocator()); }
_Bvector_base()
: _M_impl() { }
_Bvector_base(const allocator_type& __a)
: _M_impl(__a) { }
# 465 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
~_Bvector_base()
{ this->_M_deallocate(); }
protected:
_Bvector_impl _M_impl;
_Bit_type*
_M_allocate(size_t __n)
{ return _M_impl.allocate(_S_nword(__n)); }
void
_M_deallocate()
{
if (_M_impl._M_start._M_p)
_M_impl.deallocate(_M_impl._M_start._M_p,
_M_impl._M_end_of_storage - _M_impl._M_start._M_p);
}
static size_t
_S_nword(size_t __n)
{ return (__n + int(_S_word_bit) - 1) / int(_S_word_bit); }
};
}
namespace std __attribute__ ((__visibility__ ("default")))
{
# 517 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
template<typename _Alloc>
class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
{
typedef _Bvector_base<_Alloc> _Base;
public:
typedef bool value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Bit_reference reference;
typedef bool const_reference;
typedef _Bit_reference* pointer;
typedef const bool* const_pointer;
typedef _Bit_iterator iterator;
typedef _Bit_const_iterator const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef _Alloc allocator_type;
allocator_type get_allocator() const
{ return _Base::get_allocator(); }
protected:
using _Base::_M_allocate;
using _Base::_M_deallocate;
using _Base::_S_nword;
using _Base::_M_get_Bit_allocator;
public:
vector()
: _Base() { }
explicit
vector(const allocator_type& __a)
: _Base(__a) { }
# 572 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
explicit
vector(size_type __n, const bool& __value = bool(),
const allocator_type& __a = allocator_type())
: _Base(__a)
{
_M_initialize(__n);
std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
__value ? ~0 : 0);
}
vector(const vector& __x)
: _Base(__x._M_get_Bit_allocator())
{
_M_initialize(__x.size());
_M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
}
# 611 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
template<typename _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
: _Base(__a)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
~vector() { }
vector&
operator=(const vector& __x)
{
if (&__x == this)
return *this;
if (__x.size() > capacity())
{
this->_M_deallocate();
_M_initialize(__x.size());
}
this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
begin());
return *this;
}
# 661 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
void
assign(size_type __n, const bool& __x)
{ _M_fill_assign(__n, __x); }
# 672 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
template<typename _InputIterator>
void
assign(_InputIterator __first, _InputIterator __last)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
# 687 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
iterator
begin()
{ return this->_M_impl._M_start; }
const_iterator
begin() const
{ return this->_M_impl._M_start; }
iterator
end()
{ return this->_M_impl._M_finish; }
const_iterator
end() const
{ return this->_M_impl._M_finish; }
reverse_iterator
rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(end()); }
reverse_iterator
rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator
rend() const
{ return const_reverse_iterator(begin()); }
# 737 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
size_type
size() const
{ return size_type(end() - begin()); }
size_type
max_size() const
{
const size_type __isize =
__gnu_cxx::__numeric_traits<difference_type>::__max
- int(_S_word_bit) + 1;
const size_type __asize = _M_get_Bit_allocator().max_size();
return (__asize <= __isize / int(_S_word_bit)
? __asize * int(_S_word_bit) : __isize);
}
size_type
capacity() const
{ return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0)
- begin()); }
bool
empty() const
{ return begin() == end(); }
reference
operator[](size_type __n)
{
return *iterator(this->_M_impl._M_start._M_p
+ __n / int(_S_word_bit), __n % int(_S_word_bit));
}
const_reference
operator[](size_type __n) const
{
return *const_iterator(this->_M_impl._M_start._M_p
+ __n / int(_S_word_bit), __n % int(_S_word_bit));
}
protected:
void
_M_range_check(size_type __n) const
{
if (__n >= this->size())
__throw_out_of_range(("vector<bool>::_M_range_check"));
}
public:
reference
at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference
at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
void
reserve(size_type __n)
{
if (__n > max_size())
__throw_length_error(("vector::reserve"));
if (capacity() < __n)
_M_reallocate(__n);
}
reference
front()
{ return *begin(); }
const_reference
front() const
{ return *begin(); }
reference
back()
{ return *(end() - 1); }
const_reference
back() const
{ return *(end() - 1); }
void
data() { }
void
push_back(bool __x)
{
if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
*this->_M_impl._M_finish++ = __x;
else
_M_insert_aux(end(), __x);
}
void
swap(vector& __x)
{
std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
std::swap(this->_M_impl._M_end_of_storage,
__x._M_impl._M_end_of_storage);
std::__alloc_swap<typename _Base::_Bit_alloc_type>::
_S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
}
static void
swap(reference __x, reference __y)
{
bool __tmp = __x;
__x = __y;
__y = __tmp;
}
iterator
insert(iterator __position, const bool& __x = bool())
{
const difference_type __n = __position - begin();
if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
&& __position == end())
*this->_M_impl._M_finish++ = __x;
else
_M_insert_aux(__position, __x);
return begin() + __n;
}
# 877 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
template<typename _InputIterator>
void
insert(iterator __position,
_InputIterator __first, _InputIterator __last)
{
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
void
insert(iterator __position, size_type __n, const bool& __x)
{ _M_fill_insert(__position, __n, __x); }
void
pop_back()
{ --this->_M_impl._M_finish; }
iterator
erase(iterator __position)
{
if (__position + 1 != end())
std::copy(__position + 1, end(), __position);
--this->_M_impl._M_finish;
return __position;
}
iterator
erase(iterator __first, iterator __last)
{
if (__first != __last)
_M_erase_at_end(std::copy(__last, end(), __first));
return __first;
}
void
resize(size_type __new_size, bool __x = bool())
{
if (__new_size < size())
_M_erase_at_end(begin() + difference_type(__new_size));
else
insert(end(), __new_size - size(), __x);
}
void
flip()
{
for (_Bit_type * __p = this->_M_impl._M_start._M_p;
__p != this->_M_impl._M_end_of_storage; ++__p)
*__p = ~*__p;
}
void
clear()
{ _M_erase_at_end(begin()); }
protected:
iterator
_M_copy_aligned(const_iterator __first, const_iterator __last,
iterator __result)
{
_Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
return std::copy(const_iterator(__last._M_p, 0), __last,
iterator(__q, 0));
}
void
_M_initialize(size_type __n)
{
_Bit_type* __q = this->_M_allocate(__n);
this->_M_impl._M_end_of_storage = __q + _S_nword(__n);
this->_M_impl._M_start = iterator(__q, 0);
this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
}
void
_M_reallocate(size_type __n);
# 977 "/opt/local/include/gcc48/c++/bits/stl_bvector.h" 3
template<typename _Integer>
void
_M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
{
_M_initialize(static_cast<size_type>(__n));
std::fill(this->_M_impl._M_start._M_p,
this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
}
template<typename _InputIterator>
void
_M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{ _M_initialize_range(__first, __last,
std::__iterator_category(__first)); }
template<typename _InputIterator>
void
_M_initialize_range(_InputIterator __first, _InputIterator __last,
std::input_iterator_tag)
{
for (; __first != __last; ++__first)
push_back(*__first);
}
template<typename _ForwardIterator>
void
_M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
std::forward_iterator_tag)
{
const size_type __n = std::distance(__first, __last);
_M_initialize(__n);
std::copy(__first, __last, this->_M_impl._M_start);
}
template<typename _Integer>
void
_M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign(__n, __val); }
template<class _InputIterator>
void
_M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{ _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
void
_M_fill_assign(size_t __n, bool __x)
{
if (__n > size())
{
std::fill(this->_M_impl._M_start._M_p,
this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
insert(end(), __n - size(), __x);
}
else
{
_M_erase_at_end(begin() + __n);
std::fill(this->_M_impl._M_start._M_p,
this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
}
}
template<typename _InputIterator>
void
_M_assign_aux(_InputIterator __first, _InputIterator __last,
std::input_iterator_tag)
{
iterator __cur = begin();
for (; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
_M_erase_at_end(__cur);
else
insert(end(), __first, __last);
}
template<typename _ForwardIterator>
void
_M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
std::forward_iterator_tag)
{
const size_type __len = std::distance(__first, __last);
if (__len < size())
_M_erase_at_end(std::copy(__first, __last, begin()));
else
{
_ForwardIterator __mid = __first;
std::advance(__mid, size());
std::copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
}
template<typename _Integer>
void
_M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type)
{ _M_fill_insert(__pos, __n, __x); }
template<typename _InputIterator>
void
_M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type)
{ _M_insert_range(__pos, __first, __last,
std::__iterator_category(__first)); }
void
_M_fill_insert(iterator __position, size_type __n, bool __x);
template<typename _InputIterator>
void
_M_insert_range(iterator __pos, _InputIterator __first,
_InputIterator __last, std::input_iterator_tag)
{
for (; __first != __last; ++__first)
{
__pos = insert(__pos, *__first);
++__pos;
}
}
template<typename _ForwardIterator>
void
_M_insert_range(iterator __position, _ForwardIterator __first,
_ForwardIterator __last, std::forward_iterator_tag);
void
_M_insert_aux(iterator __position, bool __x);
size_type
_M_check_len(size_type __n, const char* __s) const
{
if (max_size() - size() < __n)
__throw_length_error((__s));
const size_type __len = size() + std::max(size(), __n);
return (__len < size() || __len > max_size()) ? max_size() : __len;
}
void
_M_erase_at_end(iterator __pos)
{ this->_M_impl._M_finish = __pos; }
};
}
# 66 "/opt/local/include/gcc48/c++/vector" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/range_access.h" 1 3
# 33 "/opt/local/include/gcc48/c++/bits/range_access.h" 3
# 34 "/opt/local/include/gcc48/c++/bits/range_access.h" 3
# 67 "/opt/local/include/gcc48/c++/vector" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/vector.tcc" 1 3
# 59 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
reserve(size_type __n)
{
if (__n > this->max_size())
__throw_length_error(("vector::reserve"));
if (this->capacity() < __n)
{
const size_type __old_size = size();
pointer __tmp = _M_allocate_and_copy(__n,
(this->_M_impl._M_start),
(this->_M_impl._M_finish));
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __tmp;
this->_M_impl._M_finish = __tmp + __old_size;
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
}
}
# 105 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
insert(iterator __position, const value_type& __x)
{
const size_type __n = __position - begin();
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
&& __position == end())
{
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, __x);
++this->_M_impl._M_finish;
}
else
{
# 127 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
_M_insert_aux(__position, __x);
}
return iterator(this->_M_impl._M_start + __n);
}
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
erase(iterator __position)
{
if (__position + 1 != end())
std::copy(__position + 1, end(), __position);
--this->_M_impl._M_finish;
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
return __position;
}
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
erase(iterator __first, iterator __last)
{
if (__first != __last)
{
if (__last != end())
std::copy(__last, end(), __first);
_M_erase_at_end(__first.base() + (end() - __last));
}
return __first;
}
template<typename _Tp, typename _Alloc>
vector<_Tp, _Alloc>&
vector<_Tp, _Alloc>::
operator=(const vector<_Tp, _Alloc>& __x)
{
if (&__x != this)
{
# 184 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
const size_type __xlen = __x.size();
if (__xlen > capacity())
{
pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
__x.end());
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __tmp;
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
}
else if (size() >= __xlen)
{
std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
end(), _M_get_Tp_allocator());
}
else
{
std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
this->_M_impl._M_start);
std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
__x._M_impl._M_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
}
this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
}
return *this;
}
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
_M_fill_assign(size_t __n, const value_type& __val)
{
if (__n > capacity())
{
vector __tmp(__n, __val, _M_get_Tp_allocator());
__tmp.swap(*this);
}
else if (__n > size())
{
std::fill(begin(), end(), __val);
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
__n - size(), __val,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n - size();
}
else
_M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
}
template<typename _Tp, typename _Alloc>
template<typename _InputIterator>
void
vector<_Tp, _Alloc>::
_M_assign_aux(_InputIterator __first, _InputIterator __last,
std::input_iterator_tag)
{
pointer __cur(this->_M_impl._M_start);
for (; __first != __last && __cur != this->_M_impl._M_finish;
++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
_M_erase_at_end(__cur);
else
insert(end(), __first, __last);
}
template<typename _Tp, typename _Alloc>
template<typename _ForwardIterator>
void
vector<_Tp, _Alloc>::
_M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
std::forward_iterator_tag)
{
const size_type __len = std::distance(__first, __last);
if (__len > capacity())
{
pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __tmp;
this->_M_impl._M_finish = this->_M_impl._M_start + __len;
this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
}
else if (size() >= __len)
_M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
else
{
_ForwardIterator __mid = __first;
std::advance(__mid, size());
std::copy(__first, __mid, this->_M_impl._M_start);
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
}
}
# 316 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
_M_insert_aux(iterator __position, const _Tp& __x)
{
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
{
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
(*(this->_M_impl._M_finish - 1))
);
++this->_M_impl._M_finish;
_Tp __x_copy = __x;
std::copy_backward(__position.base(), this->_M_impl._M_finish - 2, this->_M_impl._M_finish - 1)
;
*__position = __x_copy;
}
else
{
const size_type __len =
_M_check_len(size_type(1), "vector::_M_insert_aux");
const size_type __elems_before = __position - begin();
pointer __new_start(this->_M_allocate(__len));
pointer __new_finish(__new_start);
if (true)
{
_Alloc_traits::construct(this->_M_impl,
__new_start + __elems_before,
__x);
__new_finish = 0;
__new_finish
= std::__uninitialized_move_if_noexcept_a
(this->_M_impl._M_start, __position.base(),
__new_start, _M_get_Tp_allocator());
++__new_finish;
__new_finish
= std::__uninitialized_move_if_noexcept_a
(__position.base(), this->_M_impl._M_finish,
__new_finish, _M_get_Tp_allocator());
}
if (false)
{
if (!__new_finish)
_Alloc_traits::destroy(this->_M_impl,
__new_start + __elems_before);
else
std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
_M_deallocate(__new_start, __len);
;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
}
# 439 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
_M_fill_insert(iterator __position, size_type __n, const value_type& __x)
{
if (__n != 0)
{
if (size_type(this->_M_impl._M_end_of_storage
- this->_M_impl._M_finish) >= __n)
{
value_type __x_copy = __x;
const size_type __elems_after = end() - __position;
pointer __old_finish(this->_M_impl._M_finish);
if (__elems_after > __n)
{
std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n;
std::copy_backward(__position.base(), __old_finish - __n, __old_finish)
;
std::fill(__position.base(), __position.base() + __n,
__x_copy);
}
else
{
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
__n - __elems_after,
__x_copy,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_move_a(__position.base(), __old_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __elems_after;
std::fill(__position.base(), __old_finish, __x_copy);
}
}
else
{
const size_type __len =
_M_check_len(__n, "vector::_M_fill_insert");
const size_type __elems_before = __position - begin();
pointer __new_start(this->_M_allocate(__len));
pointer __new_finish(__new_start);
if (true)
{
std::__uninitialized_fill_n_a(__new_start + __elems_before,
__n, __x,
_M_get_Tp_allocator());
__new_finish = 0;
__new_finish
= std::__uninitialized_move_if_noexcept_a
(this->_M_impl._M_start, __position.base(),
__new_start, _M_get_Tp_allocator());
__new_finish += __n;
__new_finish
= std::__uninitialized_move_if_noexcept_a
(__position.base(), this->_M_impl._M_finish,
__new_finish, _M_get_Tp_allocator());
}
if (false)
{
if (!__new_finish)
std::_Destroy(__new_start + __elems_before,
__new_start + __elems_before + __n,
_M_get_Tp_allocator());
else
std::_Destroy(__new_start, __new_finish,
_M_get_Tp_allocator());
_M_deallocate(__new_start, __len);
;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
}
}
# 591 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
template<typename _Tp, typename _Alloc>
template<typename _InputIterator>
void
vector<_Tp, _Alloc>::
_M_range_insert(iterator __pos, _InputIterator __first,
_InputIterator __last, std::input_iterator_tag)
{
for (; __first != __last; ++__first)
{
__pos = insert(__pos, *__first);
++__pos;
}
}
template<typename _Tp, typename _Alloc>
template<typename _ForwardIterator>
void
vector<_Tp, _Alloc>::
_M_range_insert(iterator __position, _ForwardIterator __first,
_ForwardIterator __last, std::forward_iterator_tag)
{
if (__first != __last)
{
const size_type __n = std::distance(__first, __last);
if (size_type(this->_M_impl._M_end_of_storage
- this->_M_impl._M_finish) >= __n)
{
const size_type __elems_after = end() - __position;
pointer __old_finish(this->_M_impl._M_finish);
if (__elems_after > __n)
{
std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n;
std::copy_backward(__position.base(), __old_finish - __n, __old_finish)
;
std::copy(__first, __last, __position);
}
else
{
_ForwardIterator __mid = __first;
std::advance(__mid, __elems_after);
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_move_a(__position.base(),
__old_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __elems_after;
std::copy(__first, __mid, __position);
}
}
else
{
const size_type __len =
_M_check_len(__n, "vector::_M_range_insert");
pointer __new_start(this->_M_allocate(__len));
pointer __new_finish(__new_start);
if (true)
{
__new_finish
= std::__uninitialized_move_if_noexcept_a
(this->_M_impl._M_start, __position.base(),
__new_start, _M_get_Tp_allocator());
__new_finish
= std::__uninitialized_copy_a(__first, __last,
__new_finish,
_M_get_Tp_allocator());
__new_finish
= std::__uninitialized_move_if_noexcept_a
(__position.base(), this->_M_impl._M_finish,
__new_finish, _M_get_Tp_allocator());
}
if (false)
{
std::_Destroy(__new_start, __new_finish,
_M_get_Tp_allocator());
_M_deallocate(__new_start, __len);
;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
}
}
template<typename _Alloc>
void
vector<bool, _Alloc>::
_M_reallocate(size_type __n)
{
_Bit_type* __q = this->_M_allocate(__n);
this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
iterator(__q, 0));
this->_M_deallocate();
this->_M_impl._M_start = iterator(__q, 0);
this->_M_impl._M_end_of_storage = __q + _S_nword(__n);
}
template<typename _Alloc>
void
vector<bool, _Alloc>::
_M_fill_insert(iterator __position, size_type __n, bool __x)
{
if (__n == 0)
return;
if (capacity() - size() >= __n)
{
std::copy_backward(__position, end(),
this->_M_impl._M_finish + difference_type(__n));
std::fill(__position, __position + difference_type(__n), __x);
this->_M_impl._M_finish += difference_type(__n);
}
else
{
const size_type __len =
_M_check_len(__n, "vector<bool>::_M_fill_insert");
_Bit_type * __q = this->_M_allocate(__len);
iterator __i = _M_copy_aligned(begin(), __position,
iterator(__q, 0));
std::fill(__i, __i + difference_type(__n), __x);
this->_M_impl._M_finish = std::copy(__position, end(),
__i + difference_type(__n));
this->_M_deallocate();
this->_M_impl._M_end_of_storage = __q + _S_nword(__len);
this->_M_impl._M_start = iterator(__q, 0);
}
}
template<typename _Alloc>
template<typename _ForwardIterator>
void
vector<bool, _Alloc>::
_M_insert_range(iterator __position, _ForwardIterator __first,
_ForwardIterator __last, std::forward_iterator_tag)
{
if (__first != __last)
{
size_type __n = std::distance(__first, __last);
if (capacity() - size() >= __n)
{
std::copy_backward(__position, end(),
this->_M_impl._M_finish
+ difference_type(__n));
std::copy(__first, __last, __position);
this->_M_impl._M_finish += difference_type(__n);
}
else
{
const size_type __len =
_M_check_len(__n, "vector<bool>::_M_insert_range");
_Bit_type * __q = this->_M_allocate(__len);
iterator __i = _M_copy_aligned(begin(), __position,
iterator(__q, 0));
__i = std::copy(__first, __last, __i);
this->_M_impl._M_finish = std::copy(__position, end(), __i);
this->_M_deallocate();
this->_M_impl._M_end_of_storage = __q + _S_nword(__len);
this->_M_impl._M_start = iterator(__q, 0);
}
}
}
template<typename _Alloc>
void
vector<bool, _Alloc>::
_M_insert_aux(iterator __position, bool __x)
{
if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
{
std::copy_backward(__position, this->_M_impl._M_finish,
this->_M_impl._M_finish + 1);
*__position = __x;
++this->_M_impl._M_finish;
}
else
{
const size_type __len =
_M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
_Bit_type * __q = this->_M_allocate(__len);
iterator __i = _M_copy_aligned(begin(), __position,
iterator(__q, 0));
*__i++ = __x;
this->_M_impl._M_finish = std::copy(__position, end(), __i);
this->_M_deallocate();
this->_M_impl._M_end_of_storage = __q + _S_nword(__len);
this->_M_impl._M_start = iterator(__q, 0);
}
}
# 811 "/opt/local/include/gcc48/c++/bits/vector.tcc" 3
}
# 70 "/opt/local/include/gcc48/c++/vector" 2 3
# 37 "mimedb.cpp" 2
# 1 "/opt/local/include/gcc48/c++/string" 1 3
# 36 "/opt/local/include/gcc48/c++/string" 3
# 37 "/opt/local/include/gcc48/c++/string" 3
# 1 "/opt/local/include/gcc48/c++/bits/stringfwd.h" 1 3
# 37 "/opt/local/include/gcc48/c++/bits/stringfwd.h" 3
# 38 "/opt/local/include/gcc48/c++/bits/stringfwd.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<class _CharT>
struct char_traits;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_string;
template<> struct char_traits<char>;
typedef basic_string<char> string;
template<> struct char_traits<wchar_t>;
typedef basic_string<wchar_t> wstring;
# 86 "/opt/local/include/gcc48/c++/bits/stringfwd.h" 3
}
# 40 "/opt/local/include/gcc48/c++/string" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/char_traits.h" 1 3
# 37 "/opt/local/include/gcc48/c++/bits/char_traits.h" 3
# 38 "/opt/local/include/gcc48/c++/bits/char_traits.h" 3
# 1 "/opt/local/include/gcc48/c++/bits/postypes.h" 1 3
# 38 "/opt/local/include/gcc48/c++/bits/postypes.h" 3
# 39 "/opt/local/include/gcc48/c++/bits/postypes.h" 3
# 1 "/opt/local/include/gcc48/c++/cwchar" 1 3
# 39 "/opt/local/include/gcc48/c++/cwchar" 3
# 40 "/opt/local/include/gcc48/c++/cwchar" 3
# 1 "/usr/include/wchar.h" 1 3 4
# 76 "/usr/include/wchar.h" 3 4
# 1 "/usr/include/sys/_types/_mbstate_t.h" 1 3 4
# 31 "/usr/include/sys/_types/_mbstate_t.h" 3 4
typedef __darwin_mbstate_t mbstate_t;
# 77 "/usr/include/wchar.h" 2 3 4
# 89 "/usr/include/wchar.h" 3 4
# 1 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include/stdarg.h" 1 3 4
# 40 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 98 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 90 "/usr/include/wchar.h" 2 3 4
# 1 "/usr/include/time.h" 1 3 4
# 69 "/usr/include/time.h" 3 4
# 1 "/usr/include/_structs.h" 1 3 4
# 24 "/usr/include/_structs.h" 3 4
# 1 "/usr/include/sys/_structs.h" 1 3 4
# 25 "/usr/include/_structs.h" 2 3 4
# 70 "/usr/include/time.h" 2 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 tm_gmtoff;
char *tm_zone;
};
# 98 "/usr/include/time.h" 3 4
extern char *tzname[];
extern int getdate_err;
extern long timezone __asm("_" "timezone" );
extern int daylight;
extern "C" {
char *asctime(const struct tm *);
clock_t clock(void) __asm("_" "clock" );
char *ctime(const time_t *);
double difftime(time_t, time_t);
struct tm *getdate(const char *);
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *) __asm("_" "mktime" );
size_t strftime(char * , size_t, const char * , const struct tm * ) __asm("_" "strftime" );
char *strptime(const char * , const char * , struct tm * ) __asm("_" "strptime" );
time_t time(time_t *);
void tzset(void);
char *asctime_r(const struct tm * , char * );
char *ctime_r(const time_t *, char *);
struct tm *gmtime_r(const time_t * , struct tm * );
struct tm *localtime_r(const time_t * , struct tm * );
time_t posix2time(time_t);
void tzsetwall(void);
time_t time2posix(time_t);
time_t timelocal(struct tm * const);
time_t timegm(struct tm * const);
int nanosleep(const struct timespec *, struct timespec *) __asm("_" "nanosleep" );
}
# 92 "/usr/include/wchar.h" 2 3 4
# 1 "/usr/include/_wctype.h" 1 3 4
# 45 "/usr/include/_wctype.h" 3 4
# 1 "/usr/include/sys/_types/_wint_t.h" 1 3 4
# 31 "/usr/include/sys/_types/_wint_t.h" 3 4
typedef __darwin_wint_t wint_t;
# 46 "/usr/include/_wctype.h" 2 3 4
# 1 "/usr/include/_types/_wctype_t.h" 1 3 4
# 31 "/usr/include/_types/_wctype_t.h" 3 4
typedef __darwin_wctype_t wctype_t;
# 48 "/usr/include/_wctype.h" 2 3 4
# 57 "/usr/include/_wctype.h" 3 4
# 1 "/usr/include/ctype.h" 1 3 4
# 70 "/usr/include/ctype.h" 3 4
# 1 "/usr/include/runetype.h" 1 3 4
# 60 "/usr/include/runetype.h" 3 4
typedef struct {
__darwin_rune_t __min;
__darwin_rune_t __max;
__darwin_rune_t __map;
__uint32_t *__types;
} _RuneEntry;
typedef struct {
int __nranges;
_RuneEntry *__ranges;
} _RuneRange;
typedef struct {
char __name[14];
__uint32_t __mask;
} _RuneCharClass;
typedef struct {
char __magic[8];
char __encoding[32];
__darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **);
int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);
__darwin_rune_t __invalid_rune;
__uint32_t __runetype[(1 <<8 )];
__darwin_rune_t __maplower[(1 <<8 )];
__darwin_rune_t __mapupper[(1 <<8 )];
_RuneRange __runetype_ext;
_RuneRange __maplower_ext;
_RuneRange __mapupper_ext;
void *__variable;
int __variable_len;
int __ncharclasses;
_RuneCharClass *__charclasses;
} _RuneLocale;
extern "C" {
extern _RuneLocale _DefaultRuneLocale;
extern _RuneLocale *_CurrentRuneLocale;
}
# 71 "/usr/include/ctype.h" 2 3 4
# 128 "/usr/include/ctype.h" 3 4
extern "C" {
unsigned long ___runetype(__darwin_ct_rune_t);
__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t);
__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t);
}
inline int
isascii(int _c)
{
return ((_c & ~0x7F) == 0);
}
# 147 "/usr/include/ctype.h" 3 4
extern "C" {
int __maskrune(__darwin_ct_rune_t, unsigned long);
}
inline int
__istype(__darwin_ct_rune_t _c, unsigned long _f)
{
return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f)
: !!__maskrune(_c, _f));
}
inline __darwin_ct_rune_t
__isctype(__darwin_ct_rune_t _c, unsigned long _f)
{
return (_c < 0 || _c >= (1 <<8 )) ? 0 :
!!(_DefaultRuneLocale.__runetype[_c] & _f);
}
# 187 "/usr/include/ctype.h" 3 4
extern "C" {
__darwin_ct_rune_t __toupper(__darwin_ct_rune_t);
__darwin_ct_rune_t __tolower(__darwin_ct_rune_t);
}
inline int
__wcwidth(__darwin_ct_rune_t _c)
{
unsigned int _x;
if (_c == 0)
return (0);
_x = (unsigned int)__maskrune(_c, 0xe0000000L|0x00040000L);
if ((_x & 0xe0000000L) != 0)
return ((_x & 0xe0000000L) >> 30);
return ((_x & 0x00040000L) != 0 ? 1 : -1);
}
inline int
isalnum(int _c)
{
return (__istype(_c, 0x00000100L|0x00000400L));
}
inline int
isalpha(int _c)
{
return (__istype(_c, 0x00000100L));
}
inline int
isblank(int _c)
{
return (__istype(_c, 0x00020000L));
}
inline int
iscntrl(int _c)
{
return (__istype(_c, 0x00000200L));
}
inline int
isdigit(int _c)
{
return (__isctype(_c, 0x00000400L));
}
inline int
isgraph(int _c)
{
return (__istype(_c, 0x00000800L));
}
inline int
islower(int _c)
{
return (__istype(_c, 0x00001000L));
}
inline int
isprint(int _c)
{
return (__istype(_c, 0x00040000L));
}
inline int
ispunct(int _c)
{
return (__istype(_c, 0x00002000L));
}
inline int
isspace(int _c)
{
return (__istype(_c, 0x00004000L));
}
inline int
isupper(int _c)
{
return (__istype(_c, 0x00008000L));
}
inline int
isxdigit(int _c)
{
return (__isctype(_c, 0x00010000L));
}
inline int
toascii(int _c)
{
return (_c & 0x7F);
}
inline int
tolower(int _c)
{
return (__tolower(_c));
}
inline int
toupper(int _c)
{
return (__toupper(_c));
}
inline int
digittoint(int _c)
{
return (__maskrune(_c, 0x0F));
}
inline int
ishexnumber(int _c)
{
return (__istype(_c, 0x00010000L));
}
inline int
isideogram(int _c)
{
return (__istype(_c, 0x00080000L));
}
inline int
isnumber(int _c)
{
return (__istype(_c, 0x00000400L));
}
inline int
isphonogram(int _c)
{
return (__istype(_c, 0x00200000L));
}
inline int
isrune(int _c)
{
return (__istype(_c, 0xFFFFFFF0L));
}
inline int
isspecial(int _c)
{
return (__istype(_c, 0x00100000L));
}
# 58 "/usr/include/_wctype.h" 2 3 4
inline int
iswalnum(wint_t _wc)
{
return (__istype(_wc, 0x00000100L|0x00000400L));
}
inline int
iswalpha(wint_t _wc)
{
return (__istype(_wc, 0x00000100L));
}
inline int
iswcntrl(wint_t _wc)
{
return (__istype(_wc, 0x00000200L));
}
inline int
iswctype(wint_t _wc, wctype_t _charclass)
{
return (__istype(_wc, _charclass));
}
inline int
iswdigit(wint_t _wc)
{
return (__isctype(_wc, 0x00000400L));
}
inline int
iswgraph(wint_t _wc)
{
return (__istype(_wc, 0x00000800L));
}
inline int
iswlower(wint_t _wc)
{
return (__istype(_wc, 0x00001000L));
}
inline int
iswprint(wint_t _wc)
{
return (__istype(_wc, 0x00040000L));
}
inline int
iswpunct(wint_t _wc)
{
return (__istype(_wc, 0x00002000L));
}
inline int
iswspace(wint_t _wc)
{
return (__istype(_wc, 0x00004000L));
}
inline int
iswupper(wint_t _wc)
{
return (__istype(_wc, 0x00008000L));
}
inline int
iswxdigit(wint_t _wc)
{
return (__isctype(_wc, 0x00010000L));
}
inline wint_t
towlower(wint_t _wc)
{
return (__tolower(_wc));
}
inline wint_t
towupper(wint_t _wc)
{
return (__toupper(_wc));
}
# 170 "/usr/include/_wctype.h" 3 4
extern "C" {
wctype_t
wctype(const char *);
}
# 93 "/usr/include/wchar.h" 2 3 4
extern "C" {
wint_t btowc(int);
wint_t fgetwc(FILE *);
wchar_t *fgetws(wchar_t * , int, FILE * );
wint_t fputwc(wchar_t, FILE *);
int fputws(const wchar_t * , FILE * );
int fwide(FILE *, int);
int fwprintf(FILE * , const wchar_t * , ...);
int fwscanf(FILE * , const wchar_t * , ...);
wint_t getwc(FILE *);
wint_t getwchar(void);
size_t mbrlen(const char * , size_t, mbstate_t * );
size_t mbrtowc(wchar_t * , const char * , size_t,
mbstate_t * );
int mbsinit(const mbstate_t *);
size_t mbsrtowcs(wchar_t * , const char ** , size_t,
mbstate_t * );
wint_t putwc(wchar_t, FILE *);
wint_t putwchar(wchar_t);
int swprintf(wchar_t * , size_t, const wchar_t * , ...);
int swscanf(const wchar_t * , const wchar_t * , ...);
wint_t ungetwc(wint_t, FILE *);
int vfwprintf(FILE * , const wchar_t * ,
__darwin_va_list);
int vswprintf(wchar_t * , size_t, const wchar_t * ,
__darwin_va_list);
int vwprintf(const wchar_t * , __darwin_va_list);
size_t wcrtomb(char * , wchar_t, mbstate_t * );
wchar_t *wcscat(wchar_t * , const wchar_t * );
wchar_t *wcschr(const wchar_t *, wchar_t);
int wcscmp(const wchar_t *, const wchar_t *);
int wcscoll(const wchar_t *, const wchar_t *);
wchar_t *wcscpy(wchar_t * , const wchar_t * );
size_t wcscspn(const wchar_t *, const wchar_t *);
size_t wcsftime(wchar_t * , size_t, const wchar_t * ,
const struct tm * ) __asm("_" "wcsftime" );
size_t wcslen(const wchar_t *);
wchar_t *wcsncat(wchar_t * , const wchar_t * , size_t);
int wcsncmp(const wchar_t *, const wchar_t *, size_t);
wchar_t *wcsncpy(wchar_t * , const wchar_t * , size_t);
wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
wchar_t *wcsrchr(const wchar_t *, wchar_t);
size_t wcsrtombs(char * , const wchar_t ** , size_t,
mbstate_t * );
size_t wcsspn(const wchar_t *, const wchar_t *);
wchar_t *wcsstr(const wchar_t * , const wchar_t * );
size_t wcsxfrm(wchar_t * , const wchar_t * , size_t);
int wctob(wint_t);
double wcstod(const wchar_t * , wchar_t ** );
wchar_t *wcstok(wchar_t * , const wchar_t * ,
wchar_t ** );
long wcstol(const wchar_t * , wchar_t ** , int);
unsigned long
wcstoul(const wchar_t * , wchar_t ** , int);
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
int wmemcmp(const wchar_t *, const wchar_t *, size_t);
wchar_t *wmemcpy(wchar_t * , const wchar_t * , size_t);
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
wchar_t *wmemset(wchar_t *, wchar_t, size_t);
int wprintf(const wchar_t * , ...);
int wscanf(const wchar_t * , ...);
int wcswidth(const wchar_t *, size_t);
int wcwidth(wchar_t);
}
# 169 "/usr/include/wchar.h" 3 4
extern "C" {
int vfwscanf(FILE * , const wchar_t * ,
__darwin_va_list);
int vswscanf(const wchar_t * , const wchar_t * ,
__darwin_va_list);
int vwscanf(const wchar_t * , __darwin_va_list);
float wcstof(const wchar_t * , wchar_t ** );
long double
wcstold(const wchar_t * , wchar_t ** );
long long
wcstoll(const wchar_t * , wchar_t ** , int);
unsigned long long
wcstoull(const wchar_t * , wchar_t ** , int);
}
# 194 "/usr/include/wchar.h" 3 4
extern "C" {
size_t mbsnrtowcs(wchar_t * , const char ** , size_t,
size_t, mbstate_t * );
wchar_t *wcpcpy(wchar_t * , const wchar_t * ) ;
wchar_t *wcpncpy(wchar_t * , const wchar_t * , size_t) ;
wchar_t *wcsdup(const wchar_t *) ;
int wcscasecmp(const wchar_t *, const wchar_t *) ;
int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) ;
size_t wcsnlen(const wchar_t *, size_t) ;
size_t wcsnrtombs(char * , const wchar_t ** , size_t,
size_t, mbstate_t * );
}
extern "C" {
wchar_t *fgetwln(FILE * , size_t *) ;
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
}
# 45 "/opt/local/include/gcc48/c++/cwchar" 2 3
# 62 "/opt/local/include/gcc48/c++/cwchar" 3
namespace std
{
using ::mbstate_t;
}
# 135 "/opt/local/include/gcc48/c++/cwchar" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
using ::wint_t;
using ::btowc;
using ::fgetwc;
using ::fgetws;
using ::fputwc;
using ::fputws;
using ::fwide;
using ::fwprintf;
using ::fwscanf;
using ::getwc;
using ::getwchar;
using ::mbrlen;
using ::mbrtowc;
using ::mbsinit;
using ::mbsrtowcs;
using ::putwc;
using ::putwchar;
using ::swprintf;
using ::swscanf;
using ::ungetwc;
using ::vfwprintf;
using ::vfwscanf;
using ::vswprintf;
using ::vswscanf;
using ::vwprintf;
using ::vwscanf;
using ::wcrtomb;
using ::wcscat;
using ::wcscmp;
using ::wcscoll;
using ::wcscpy;
using ::wcscspn;
using ::wcsftime;
using ::wcslen;
using ::wcsncat;
using ::wcsncmp;
using ::wcsncpy;
using ::wcsrtombs;
using ::wcsspn;
using ::wcstod;
using ::wcstof;
using ::wcstok;
using ::wcstol;
using ::wcstoul;
using ::wcsxfrm;
using ::wctob;
using ::wmemcmp;
using ::wmemcpy;
using ::wmemmove;
using ::wmemset;
using ::wprintf;
using ::wscanf;
using ::wcschr;
using ::wcspbrk;
using ::wcsrchr;
using ::wcsstr;
using ::wmemchr;
inline wchar_t*
wcschr(wchar_t* __p, wchar_t __c)
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
inline wchar_t*
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
inline wchar_t*
wcsrchr(wchar_t* __p, wchar_t __c)
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
inline wchar_t*
wcsstr(wchar_t* __s1, const wchar_t* __s2)
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
inline wchar_t*
wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
{ return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
}
namespace __gnu_cxx
{
using ::wcstold;
# 257 "/opt/local/include/gcc48/c++/cwchar" 3
using ::wcstoll;
using ::wcstoull;
}
namespace std
{
using ::__gnu_cxx::wcstold;
using ::__gnu_cxx::wcstoll;
using ::__gnu_cxx::wcstoull;
}
# 41 "/opt/local/include/gcc48/c++/bits/postypes.h" 2 3
# 68 "/opt/local/include/gcc48/c++/bits/postypes.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 90 "/opt/local/include/gcc48/c++/bits/postypes.h" 3
typedef long long streamoff;
typedef ptrdiff_t streamsize;
# 111 "/opt/local/include/gcc48/c++/bits/postypes.h" 3
template<typename _StateT>
class fpos
{
private:
streamoff _M_off;
_StateT _M_state;
public:
fpos()
: _M_off(0), _M_state() { }
# 133 "/opt/local/include/gcc48/c++/bits/postypes.h" 3
fpos(streamoff __off)
: _M_off(__off), _M_state() { }
operator streamoff() const { return _M_off; }
void
state(_StateT __st)
{ _M_state = __st; }
_StateT
state() const
{ return _M_state; }
fpos&
operator+=(streamoff __off)
{
_M_off += __off;
return *this;
}
fpos&
operator-=(streamoff __off)
{
_M_off -= __off;
return *this;
}
fpos
operator+(streamoff __off) const
{
fpos __pos(*this);
__pos += __off;
return __pos;
}
fpos
operator-(streamoff __off) const
{
fpos __pos(*this);
__pos -= __off;
return __pos;
}
streamoff
operator-(const fpos& __other) const
{ return _M_off - __other._M_off; }
};
template<typename _StateT>
inline bool
operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
{ return streamoff(__lhs) == streamoff(__rhs); }
template<typename _StateT>
inline bool
operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
{ return streamoff(__lhs) != streamoff(__rhs); }
typedef fpos<mbstate_t> streampos;
typedef fpos<mbstate_t> wstreampos;
# 239 "/opt/local/include/gcc48/c++/bits/postypes.h" 3
}
# 41 "/opt/local/include/gcc48/c++/bits/char_traits.h" 2 3
# 1 "/opt/local/include/gcc48/c++/cwchar" 1 3
# 39 "/opt/local/include/gcc48/c++/cwchar" 3
# 40 "/opt/local/include/gcc48/c++/cwchar" 3
# 42 "/opt/local/include/gcc48/c++/bits/char_traits.h" 2 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
# 57 "/opt/local/include/gcc48/c++/bits/char_traits.h" 3
template<typename _CharT>
struct _Char_types
{
typedef unsigned long int_type;
typedef std::streampos pos_type;
typedef std::streamoff off_type;
typedef std::mbstate_t state_type;
};
# 82 "/opt/local/include/gcc48/c++/bits/char_traits.h" 3
template<typename _CharT>
struct char_traits
{
typedef _CharT char_type;
typedef typename _Char_types<_CharT>::int_type int_type;
typedef typename _Char_types<_CharT>::pos_type pos_type;
typedef typename _Char_types<_CharT>::off_type off_type;
typedef typename _Char_types<_CharT>::state_type state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
static int
compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
static std::size_t
length(const char_type* __s);
static const char_type*
find(const char_type* __s, std::size_t __n, const char_type& __a);
static char_type*
move(char_type* __s1, const char_type* __s2, std::size_t __n);
static char_type*
copy(char_type* __s1, const char_type* __s2, std::size_t __n);
static char_type*
assign(char_type* __s, std::size_t __n, char_type __a);
static char_type
to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); }
static int_type
to_int_type(const char_type& __c)
{ return static_cast<int_type>(__c); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
eof()
{ return static_cast<int_type>(-1); }
static int_type
not_eof(const int_type& __c)
{ return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
};
template<typename _CharT>
int
char_traits<_CharT>::
compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
{
for (std::size_t __i = 0; __i < __n; ++__i)
if (lt(__s1[__i], __s2[__i]))
return -1;
else if (lt(__s2[__i], __s1[__i]))
return 1;
return 0;
}
template<typename _CharT>
std::size_t
char_traits<_CharT>::
length(const char_type* __p)
{
std::size_t __i = 0;
while (!eq(__p[__i], char_type()))
++__i;
return __i;
}
template<typename _CharT>
const typename char_traits<_CharT>::char_type*
char_traits<_CharT>::
find(const char_type* __s, std::size_t __n, const char_type& __a)
{
for (std::size_t __i = 0; __i < __n; ++__i)
if (eq(__s[__i], __a))
return __s + __i;
return 0;
}
template<typename _CharT>
typename char_traits<_CharT>::char_type*
char_traits<_CharT>::
move(char_type* __s1, const char_type* __s2, std::size_t __n)
{
return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
__n * sizeof(char_type)));
}
template<typename _CharT>
typename char_traits<_CharT>::char_type*
char_traits<_CharT>::
copy(char_type* __s1, const char_type* __s2, std::size_t __n)
{
std::copy(__s2, __s2 + __n, __s1);
return __s1;
}
template<typename _CharT>
typename char_traits<_CharT>::char_type*
char_traits<_CharT>::
assign(char_type* __s, std::size_t __n, char_type __a)
{
std::fill_n(__s, __n, __a);
return __s;
}
}
namespace std __attribute__ ((__visibility__ ("default")))
{
# 226 "/opt/local/include/gcc48/c++/bits/char_traits.h" 3
template<class _CharT>
struct char_traits : public __gnu_cxx::char_traits<_CharT>
{ };
template<>
struct char_traits<char>
{
typedef char char_type;
typedef int int_type;
typedef streampos pos_type;
typedef streamoff off_type;
typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return __builtin_memcmp(__s1, __s2, __n); }
static size_t
length(const char_type* __s)
{ return __builtin_strlen(__s); }
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
static char_type
to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); }
static int_type
to_int_type(const char_type& __c)
{ return static_cast<int_type>(static_cast<unsigned char>(__c)); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
eof()
{ return static_cast<int_type>(-1); }
static int_type
not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; }
};
template<>
struct char_traits<wchar_t>
{
typedef wchar_t char_type;
typedef wint_t int_type;
typedef streamoff off_type;
typedef wstreampos pos_type;
typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcmp(__s1, __s2, __n); }
static size_t
length(const char_type* __s)
{ return wcslen(__s); }
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return wmemchr(__s, __a, __n); }
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemmove(__s1, __s2, __n); }
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcpy(__s1, __s2, __n); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return wmemset(__s, __a, __n); }
static char_type
to_char_type(const int_type& __c)
{ return char_type(__c); }
static int_type
to_int_type(const char_type& __c)
{ return int_type(__c); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
eof()
{ return static_cast<int_type>(((__darwin_wint_t)-1)); }
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? 0 : __c; }
};
}
# 41 "/opt/local/include/gcc48/c++/string" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/localefwd.h" 1 3
# 37 "/opt/local/include/gcc48/c++/bits/localefwd.h" 3
# 38 "/opt/local/include/gcc48/c++/bits/localefwd.h" 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++locale.h" 1 3
# 39 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++locale.h" 3
# 40 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++locale.h" 3
# 1 "/opt/local/include/gcc48/c++/clocale" 1 3
# 39 "/opt/local/include/gcc48/c++/clocale" 3
# 40 "/opt/local/include/gcc48/c++/clocale" 3
# 51 "/opt/local/include/gcc48/c++/clocale" 3
namespace std
{
using ::lconv;
using ::setlocale;
using ::localeconv;
}
# 42 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/c++locale.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
typedef int* __c_locale;
inline int
__convert_from_v(const __c_locale&, char* __out,
const int __size __attribute__((__unused__)),
const char* __fmt, ...)
{
char* __old = std::setlocale(4, 0);
char* __sav = 0;
if (__builtin_strcmp(__old, "C"))
{
const size_t __len = __builtin_strlen(__old) + 1;
__sav = new char[__len];
__builtin_memcpy(__sav, __old, __len);
std::setlocale(4, "C");
}
__builtin_va_list __args;
__builtin_va_start(__args, __fmt);
const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
__builtin_va_end(__args);
if (__sav)
{
std::setlocale(4, __sav);
delete [] __sav;
}
return __ret;
}
}
# 41 "/opt/local/include/gcc48/c++/bits/localefwd.h" 2 3
# 1 "/opt/local/include/gcc48/c++/iosfwd" 1 3
# 36 "/opt/local/include/gcc48/c++/iosfwd" 3
# 37 "/opt/local/include/gcc48/c++/iosfwd" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 74 "/opt/local/include/gcc48/c++/iosfwd" 3
class ios_base;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ios;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_streambuf;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_istream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ostream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_iostream;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringbuf;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_istringstream;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_ostringstream;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringstream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_filebuf;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ifstream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ofstream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_fstream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class istreambuf_iterator;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class ostreambuf_iterator;
typedef basic_ios<char> ios;
typedef basic_streambuf<char> streambuf;
typedef basic_istream<char> istream;
typedef basic_ostream<char> ostream;
typedef basic_iostream<char> iostream;
typedef basic_stringbuf<char> stringbuf;
typedef basic_istringstream<char> istringstream;
typedef basic_ostringstream<char> ostringstream;
typedef basic_stringstream<char> stringstream;
typedef basic_filebuf<char> filebuf;
typedef basic_ifstream<char> ifstream;
typedef basic_ofstream<char> ofstream;
typedef basic_fstream<char> fstream;
typedef basic_ios<wchar_t> wios;
typedef basic_streambuf<wchar_t> wstreambuf;
typedef basic_istream<wchar_t> wistream;
typedef basic_ostream<wchar_t> wostream;
typedef basic_iostream<wchar_t> wiostream;
typedef basic_stringbuf<wchar_t> wstringbuf;
typedef basic_istringstream<wchar_t> wistringstream;
typedef basic_ostringstream<wchar_t> wostringstream;
typedef basic_stringstream<wchar_t> wstringstream;
typedef basic_filebuf<wchar_t> wfilebuf;
typedef basic_ifstream<wchar_t> wifstream;
typedef basic_ofstream<wchar_t> wofstream;
typedef basic_fstream<wchar_t> wfstream;
}
# 42 "/opt/local/include/gcc48/c++/bits/localefwd.h" 2 3
# 1 "/opt/local/include/gcc48/c++/cctype" 1 3
# 39 "/opt/local/include/gcc48/c++/cctype" 3
# 40 "/opt/local/include/gcc48/c++/cctype" 3
# 62 "/opt/local/include/gcc48/c++/cctype" 3
namespace std
{
using ::isalnum;
using ::isalpha;
using ::iscntrl;
using ::isdigit;
using ::isgraph;
using ::islower;
using ::isprint;
using ::ispunct;
using ::isspace;
using ::isupper;
using ::isxdigit;
using ::tolower;
using ::toupper;
}
# 43 "/opt/local/include/gcc48/c++/bits/localefwd.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 55 "/opt/local/include/gcc48/c++/bits/localefwd.h" 3
class locale;
template<typename _Facet>
bool
has_facet(const locale&) throw();
template<typename _Facet>
const _Facet&
use_facet(const locale&);
template<typename _CharT>
bool
isspace(_CharT, const locale&);
template<typename _CharT>
bool
isprint(_CharT, const locale&);
template<typename _CharT>
bool
iscntrl(_CharT, const locale&);
template<typename _CharT>
bool
isupper(_CharT, const locale&);
template<typename _CharT>
bool
islower(_CharT, const locale&);
template<typename _CharT>
bool
isalpha(_CharT, const locale&);
template<typename _CharT>
bool
isdigit(_CharT, const locale&);
template<typename _CharT>
bool
ispunct(_CharT, const locale&);
template<typename _CharT>
bool
isxdigit(_CharT, const locale&);
template<typename _CharT>
bool
isalnum(_CharT, const locale&);
template<typename _CharT>
bool
isgraph(_CharT, const locale&);
template<typename _CharT>
_CharT
toupper(_CharT, const locale&);
template<typename _CharT>
_CharT
tolower(_CharT, const locale&);
class ctype_base;
template<typename _CharT>
class ctype;
template<> class ctype<char>;
template<> class ctype<wchar_t>;
template<typename _CharT>
class ctype_byname;
class codecvt_base;
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt;
template<> class codecvt<char, char, mbstate_t>;
template<> class codecvt<wchar_t, char, mbstate_t>;
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt_byname;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class num_get;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class num_put;
template<typename _CharT> class numpunct;
template<typename _CharT> class numpunct_byname;
template<typename _CharT>
class collate;
template<typename _CharT> class
collate_byname;
class time_base;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class time_get;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class time_get_byname;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class time_put;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class time_put_byname;
class money_base;
template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
class money_get;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class money_put;
template<typename _CharT, bool _Intl = false>
class moneypunct;
template<typename _CharT, bool _Intl = false>
class moneypunct_byname;
class messages_base;
template<typename _CharT>
class messages;
template<typename _CharT>
class messages_byname;
}
# 44 "/opt/local/include/gcc48/c++/string" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/ostream_insert.h" 1 3
# 33 "/opt/local/include/gcc48/c++/bits/ostream_insert.h" 3
# 34 "/opt/local/include/gcc48/c++/bits/ostream_insert.h" 3
# 1 "/opt/local/include/gcc48/c++/bits/cxxabi_forced.h" 1 3
# 34 "/opt/local/include/gcc48/c++/bits/cxxabi_forced.h" 3
# 35 "/opt/local/include/gcc48/c++/bits/cxxabi_forced.h" 3
#pragma GCC visibility push(default)
namespace __cxxabiv1
{
class __forced_unwind
{
virtual ~__forced_unwind() throw();
virtual void __pure_dummy() = 0;
};
}
#pragma GCC visibility pop
# 37 "/opt/local/include/gcc48/c++/bits/ostream_insert.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _CharT, typename _Traits>
inline void
__ostream_write(basic_ostream<_CharT, _Traits>& __out,
const _CharT* __s, streamsize __n)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const streamsize __put = __out.rdbuf()->sputn(__s, __n);
if (__put != __n)
__out.setstate(__ios_base::badbit);
}
template<typename _CharT, typename _Traits>
inline void
__ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const _CharT __c = __out.fill();
for (; __n > 0; --__n)
{
const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
if (_Traits::eq_int_type(__put, _Traits::eof()))
{
__out.setstate(__ios_base::badbit);
break;
}
}
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
__ostream_insert(basic_ostream<_CharT, _Traits>& __out,
const _CharT* __s, streamsize __n)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
if (true)
{
const streamsize __w = __out.width();
if (__w > __n)
{
const bool __left = ((__out.flags()
& __ios_base::adjustfield)
== __ios_base::left);
if (!__left)
__ostream_fill(__out, __w - __n);
if (__out.good())
__ostream_write(__out, __s, __n);
if (__left && __out.good())
__ostream_fill(__out, __w - __n);
}
else
__ostream_write(__out, __s, __n);
__out.width(0);
}
if (false)
{
__out._M_setstate(__ios_base::badbit);
;
}
if (false)
{ __out._M_setstate(__ios_base::badbit); }
}
return __out;
}
extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
extern template wostream& __ostream_insert(wostream&, const wchar_t*,
streamsize);
}
# 45 "/opt/local/include/gcc48/c++/string" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_function.h" 1 3
# 59 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 100 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
template<typename _Arg, typename _Result>
struct unary_function
{
typedef _Arg argument_type;
typedef _Result result_type;
};
template<typename _Arg1, typename _Arg2, typename _Result>
struct binary_function
{
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
};
# 139 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
template<typename _Tp>
struct plus : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x + __y; }
};
template<typename _Tp>
struct minus : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x - __y; }
};
template<typename _Tp>
struct multiplies : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x * __y; }
};
template<typename _Tp>
struct divides : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x / __y; }
};
template<typename _Tp>
struct modulus : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x % __y; }
};
template<typename _Tp>
struct negate : public unary_function<_Tp, _Tp>
{
_Tp
operator()(const _Tp& __x) const
{ return -__x; }
};
# 203 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
template<typename _Tp>
struct equal_to : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x == __y; }
};
template<typename _Tp>
struct not_equal_to : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x != __y; }
};
template<typename _Tp>
struct greater : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x > __y; }
};
template<typename _Tp>
struct less : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x < __y; }
};
template<typename _Tp>
struct greater_equal : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x >= __y; }
};
template<typename _Tp>
struct less_equal : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x <= __y; }
};
# 267 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
template<typename _Tp>
struct logical_and : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x && __y; }
};
template<typename _Tp>
struct logical_or : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x || __y; }
};
template<typename _Tp>
struct logical_not : public unary_function<_Tp, bool>
{
bool
operator()(const _Tp& __x) const
{ return !__x; }
};
template<typename _Tp>
struct bit_and : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x & __y; }
};
template<typename _Tp>
struct bit_or : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x | __y; }
};
template<typename _Tp>
struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x ^ __y; }
};
# 350 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
template<typename _Predicate>
class unary_negate
: public unary_function<typename _Predicate::argument_type, bool>
{
protected:
_Predicate _M_pred;
public:
explicit
unary_negate(const _Predicate& __x) : _M_pred(__x) { }
bool
operator()(const typename _Predicate::argument_type& __x) const
{ return !_M_pred(__x); }
};
template<typename _Predicate>
inline unary_negate<_Predicate>
not1(const _Predicate& __pred)
{ return unary_negate<_Predicate>(__pred); }
template<typename _Predicate>
class binary_negate
: public binary_function<typename _Predicate::first_argument_type,
typename _Predicate::second_argument_type, bool>
{
protected:
_Predicate _M_pred;
public:
explicit
binary_negate(const _Predicate& __x) : _M_pred(__x) { }
bool
operator()(const typename _Predicate::first_argument_type& __x,
const typename _Predicate::second_argument_type& __y) const
{ return !_M_pred(__x, __y); }
};
template<typename _Predicate>
inline binary_negate<_Predicate>
not2(const _Predicate& __pred)
{ return binary_negate<_Predicate>(__pred); }
# 421 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
template<typename _Arg, typename _Result>
class pointer_to_unary_function : public unary_function<_Arg, _Result>
{
protected:
_Result (*_M_ptr)(_Arg);
public:
pointer_to_unary_function() { }
explicit
pointer_to_unary_function(_Result (*__x)(_Arg))
: _M_ptr(__x) { }
_Result
operator()(_Arg __x) const
{ return _M_ptr(__x); }
};
template<typename _Arg, typename _Result>
inline pointer_to_unary_function<_Arg, _Result>
ptr_fun(_Result (*__x)(_Arg))
{ return pointer_to_unary_function<_Arg, _Result>(__x); }
template<typename _Arg1, typename _Arg2, typename _Result>
class pointer_to_binary_function
: public binary_function<_Arg1, _Arg2, _Result>
{
protected:
_Result (*_M_ptr)(_Arg1, _Arg2);
public:
pointer_to_binary_function() { }
explicit
pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
: _M_ptr(__x) { }
_Result
operator()(_Arg1 __x, _Arg2 __y) const
{ return _M_ptr(__x, __y); }
};
template<typename _Arg1, typename _Arg2, typename _Result>
inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
ptr_fun(_Result (*__x)(_Arg1, _Arg2))
{ return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
template<typename _Tp>
struct _Identity
: public unary_function<_Tp,_Tp>
{
_Tp&
operator()(_Tp& __x) const
{ return __x; }
const _Tp&
operator()(const _Tp& __x) const
{ return __x; }
};
template<typename _Pair>
struct _Select1st
: public unary_function<_Pair, typename _Pair::first_type>
{
typename _Pair::first_type&
operator()(_Pair& __x) const
{ return __x.first; }
const typename _Pair::first_type&
operator()(const _Pair& __x) const
{ return __x.first; }
# 508 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
};
template<typename _Pair>
struct _Select2nd
: public unary_function<_Pair, typename _Pair::second_type>
{
typename _Pair::second_type&
operator()(_Pair& __x) const
{ return __x.second; }
const typename _Pair::second_type&
operator()(const _Pair& __x) const
{ return __x.second; }
};
# 541 "/opt/local/include/gcc48/c++/bits/stl_function.h" 3
template<typename _Ret, typename _Tp>
class mem_fun_t : public unary_function<_Tp*, _Ret>
{
public:
explicit
mem_fun_t(_Ret (_Tp::*__pf)())
: _M_f(__pf) { }
_Ret
operator()(_Tp* __p) const
{ return (__p->*_M_f)(); }
private:
_Ret (_Tp::*_M_f)();
};
template<typename _Ret, typename _Tp>
class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
{
public:
explicit
const_mem_fun_t(_Ret (_Tp::*__pf)() const)
: _M_f(__pf) { }
_Ret
operator()(const _Tp* __p) const
{ return (__p->*_M_f)(); }
private:
_Ret (_Tp::*_M_f)() const;
};
template<typename _Ret, typename _Tp>
class mem_fun_ref_t : public unary_function<_Tp, _Ret>
{
public:
explicit
mem_fun_ref_t(_Ret (_Tp::*__pf)())
: _M_f(__pf) { }
_Ret
operator()(_Tp& __r) const
{ return (__r.*_M_f)(); }
private:
_Ret (_Tp::*_M_f)();
};
template<typename _Ret, typename _Tp>
class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
{
public:
explicit
const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
: _M_f(__pf) { }
_Ret
operator()(const _Tp& __r) const
{ return (__r.*_M_f)(); }
private:
_Ret (_Tp::*_M_f)() const;
};
template<typename _Ret, typename _Tp, typename _Arg>
class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
{
public:
explicit
mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
: _M_f(__pf) { }
_Ret
operator()(_Tp* __p, _Arg __x) const
{ return (__p->*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg);
};
template<typename _Ret, typename _Tp, typename _Arg>
class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
{
public:
explicit
const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
: _M_f(__pf) { }
_Ret
operator()(const _Tp* __p, _Arg __x) const
{ return (__p->*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
template<typename _Ret, typename _Tp, typename _Arg>
class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
{
public:
explicit
mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
: _M_f(__pf) { }
_Ret
operator()(_Tp& __r, _Arg __x) const
{ return (__r.*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg);
};
template<typename _Ret, typename _Tp, typename _Arg>
class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
{
public:
explicit
const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
: _M_f(__pf) { }
_Ret
operator()(const _Tp& __r, _Arg __x) const
{ return (__r.*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
template<typename _Ret, typename _Tp>
inline mem_fun_t<_Ret, _Tp>
mem_fun(_Ret (_Tp::*__f)())
{ return mem_fun_t<_Ret, _Tp>(__f); }
template<typename _Ret, typename _Tp>
inline const_mem_fun_t<_Ret, _Tp>
mem_fun(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_t<_Ret, _Tp>(__f); }
template<typename _Ret, typename _Tp>
inline mem_fun_ref_t<_Ret, _Tp>
mem_fun_ref(_Ret (_Tp::*__f)())
{ return mem_fun_ref_t<_Ret, _Tp>(__f); }
template<typename _Ret, typename _Tp>
inline const_mem_fun_ref_t<_Ret, _Tp>
mem_fun_ref(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
template<typename _Ret, typename _Tp, typename _Arg>
inline mem_fun1_t<_Ret, _Tp, _Arg>
mem_fun(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
template<typename _Ret, typename _Tp, typename _Arg>
inline const_mem_fun1_t<_Ret, _Tp, _Arg>
mem_fun(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
template<typename _Ret, typename _Tp, typename _Arg>
inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
template<typename _Ret, typename _Tp, typename _Arg>
inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
}
# 1 "/opt/local/include/gcc48/c++/backward/binders.h" 1 3
# 59 "/opt/local/include/gcc48/c++/backward/binders.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 103 "/opt/local/include/gcc48/c++/backward/binders.h" 3
template<typename _Operation>
class binder1st
: public unary_function<typename _Operation::second_argument_type,
typename _Operation::result_type>
{
protected:
_Operation op;
typename _Operation::first_argument_type value;
public:
binder1st(const _Operation& __x,
const typename _Operation::first_argument_type& __y)
: op(__x), value(__y) { }
typename _Operation::result_type
operator()(const typename _Operation::second_argument_type& __x) const
{ return op(value, __x); }
typename _Operation::result_type
operator()(typename _Operation::second_argument_type& __x) const
{ return op(value, __x); }
} ;
template<typename _Operation, typename _Tp>
inline binder1st<_Operation>
bind1st(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::first_argument_type _Arg1_type;
return binder1st<_Operation>(__fn, _Arg1_type(__x));
}
template<typename _Operation>
class binder2nd
: public unary_function<typename _Operation::first_argument_type,
typename _Operation::result_type>
{
protected:
_Operation op;
typename _Operation::second_argument_type value;
public:
binder2nd(const _Operation& __x,
const typename _Operation::second_argument_type& __y)
: op(__x), value(__y) { }
typename _Operation::result_type
operator()(const typename _Operation::first_argument_type& __x) const
{ return op(__x, value); }
typename _Operation::result_type
operator()(typename _Operation::first_argument_type& __x) const
{ return op(__x, value); }
} ;
template<typename _Operation, typename _Tp>
inline binder2nd<_Operation>
bind2nd(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::second_argument_type _Arg2_type;
return binder2nd<_Operation>(__fn, _Arg2_type(__x));
}
}
# 732 "/opt/local/include/gcc48/c++/bits/stl_function.h" 2 3
# 49 "/opt/local/include/gcc48/c++/string" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/basic_string.h" 1 3
# 37 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
# 38 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
# 1 "/opt/local/include/gcc48/c++/ext/atomicity.h" 1 3
# 32 "/opt/local/include/gcc48/c++/ext/atomicity.h" 3
# 33 "/opt/local/include/gcc48/c++/ext/atomicity.h" 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr.h" 1 3
# 30 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr.h" 3
#pragma GCC visibility push(default)
# 148 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr.h" 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 1 3
# 35 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
# 1 "/usr/include/pthread.h" 1 3 4
# 57 "/usr/include/pthread.h" 3 4
# 1 "/usr/include/pthread_impl.h" 1 3 4
# 58 "/usr/include/pthread.h" 2 3 4
# 1 "/usr/include/sched.h" 1 3 4
# 30 "/usr/include/sched.h" 3 4
extern "C" {
struct sched_param { int sched_priority; char __opaque[4]; };
extern int sched_yield(void);
extern int sched_get_priority_min(int);
extern int sched_get_priority_max(int);
}
# 60 "/usr/include/pthread.h" 2 3 4
# 74 "/usr/include/pthread.h" 3 4
# 1 "/usr/include/sys/_types/_mach_port_t.h" 1 3 4
# 49 "/usr/include/sys/_types/_mach_port_t.h" 3 4
typedef __darwin_mach_port_t mach_port_t;
# 75 "/usr/include/pthread.h" 2 3 4
# 102 "/usr/include/pthread.h" 3 4
extern "C" {
# 206 "/usr/include/pthread.h" 3 4
int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
int pthread_attr_destroy(pthread_attr_t *);
int pthread_attr_getdetachstate(const pthread_attr_t *, int *);
int pthread_attr_getguardsize(const pthread_attr_t * , size_t * );
int pthread_attr_getinheritsched(const pthread_attr_t * , int * );
int pthread_attr_getschedparam(const pthread_attr_t * ,
struct sched_param * );
int pthread_attr_getschedpolicy(const pthread_attr_t * , int * );
int pthread_attr_getscope(const pthread_attr_t * , int * );
int pthread_attr_getstack(const pthread_attr_t * , void ** ,
size_t * );
int pthread_attr_getstackaddr(const pthread_attr_t * , void ** );
int pthread_attr_getstacksize(const pthread_attr_t * , size_t * );
int pthread_attr_init(pthread_attr_t *);
int pthread_attr_setdetachstate(pthread_attr_t *, int);
int pthread_attr_setguardsize(pthread_attr_t *, size_t);
int pthread_attr_setinheritsched(pthread_attr_t *, int);
int pthread_attr_setschedparam(pthread_attr_t * ,
const struct sched_param * );
int pthread_attr_setschedpolicy(pthread_attr_t *, int);
int pthread_attr_setscope(pthread_attr_t *, int);
int pthread_attr_setstack(pthread_attr_t *, void *, size_t);
int pthread_attr_setstackaddr(pthread_attr_t *, void *);
int pthread_attr_setstacksize(pthread_attr_t *, size_t);
int pthread_cancel(pthread_t) __asm("_" "pthread_cancel" );
int pthread_cond_broadcast(pthread_cond_t *);
int pthread_cond_destroy(pthread_cond_t *);
int pthread_cond_init(pthread_cond_t * ,
const pthread_condattr_t * ) __asm("_" "pthread_cond_init" );
int pthread_cond_signal(pthread_cond_t *);
int pthread_cond_timedwait(pthread_cond_t * , pthread_mutex_t * ,
const struct timespec * ) __asm("_" "pthread_cond_timedwait" );
int pthread_cond_wait(pthread_cond_t * ,
pthread_mutex_t * ) __asm("_" "pthread_cond_wait" );
int pthread_condattr_destroy(pthread_condattr_t *);
int pthread_condattr_init(pthread_condattr_t *);
int pthread_condattr_getpshared(const pthread_condattr_t * ,
int * );
int pthread_condattr_setpshared(pthread_condattr_t *, int);
int pthread_create(pthread_t * , const pthread_attr_t * ,
void *(*)(void *), void * );
int pthread_detach(pthread_t);
int pthread_equal(pthread_t, pthread_t);
void pthread_exit(void *) __attribute__((noreturn));
int pthread_getconcurrency(void);
int pthread_getschedparam(pthread_t , int * ,
struct sched_param * );
void* pthread_getspecific(pthread_key_t);
int pthread_join(pthread_t , void **) __asm("_" "pthread_join" );
int pthread_key_create(pthread_key_t *, void (*)(void *));
int pthread_key_delete(pthread_key_t);
int pthread_mutex_destroy(pthread_mutex_t *);
int pthread_mutex_getprioceiling(const pthread_mutex_t * ,
int * );
int pthread_mutex_init(pthread_mutex_t * ,
const pthread_mutexattr_t * );
int pthread_mutex_lock(pthread_mutex_t *);
int pthread_mutex_setprioceiling(pthread_mutex_t * , int,
int * );
int pthread_mutex_trylock(pthread_mutex_t *);
int pthread_mutex_unlock(pthread_mutex_t *);
int pthread_mutexattr_destroy(pthread_mutexattr_t *) __asm("_" "pthread_mutexattr_destroy" );
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * ,
int * );
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * ,
int * );
int pthread_mutexattr_getpshared(const pthread_mutexattr_t * ,
int * );
int pthread_mutexattr_gettype(const pthread_mutexattr_t * ,
int * );
int pthread_mutexattr_init(pthread_mutexattr_t *);
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
int pthread_once(pthread_once_t *, void (*)(void));
int pthread_rwlock_destroy(pthread_rwlock_t * ) __asm("_" "pthread_rwlock_destroy" );
int pthread_rwlock_init(pthread_rwlock_t * ,
const pthread_rwlockattr_t * ) __asm("_" "pthread_rwlock_init" );
int pthread_rwlock_rdlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_rdlock" );
int pthread_rwlock_tryrdlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_tryrdlock" );
int pthread_rwlock_trywrlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_trywrlock" );
int pthread_rwlock_wrlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_wrlock" );
int pthread_rwlock_unlock(pthread_rwlock_t *) __asm("_" "pthread_rwlock_unlock" );
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * ,
int * );
int pthread_rwlockattr_init(pthread_rwlockattr_t *);
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
pthread_t pthread_self(void);
int pthread_setcancelstate(int , int *) __asm("_" "pthread_setcancelstate" );
int pthread_setcanceltype(int , int *) __asm("_" "pthread_setcanceltype" );
int pthread_setconcurrency(int);
int pthread_setschedparam(pthread_t, int, const struct sched_param *);
int pthread_setspecific(pthread_key_t , const void *);
void pthread_testcancel(void) __asm("_" "pthread_testcancel" );
int pthread_is_threaded_np(void);
int pthread_threadid_np(pthread_t,__uint64_t*);
int pthread_getname_np(pthread_t,char*,size_t);
int pthread_setname_np(const char*);
int pthread_main_np(void);
mach_port_t pthread_mach_thread_np(pthread_t);
size_t pthread_get_stacksize_np(pthread_t);
void* pthread_get_stackaddr_np(pthread_t);
int pthread_cond_signal_thread_np(pthread_cond_t *, pthread_t);
int pthread_cond_timedwait_relative_np(pthread_cond_t *, pthread_mutex_t *,
const struct timespec *);
int pthread_create_suspended_np(pthread_t *, const pthread_attr_t *,
void *(*)(void *), void *);
int pthread_kill(pthread_t, int);
pthread_t pthread_from_mach_thread_np(mach_port_t);
int pthread_sigmask(int, const sigset_t *, sigset_t *) __asm("_" "pthread_sigmask" );
void pthread_yield_np(void);
}
# 36 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 2 3
# 47 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
typedef pthread_t __gthread_t;
typedef pthread_key_t __gthread_key_t;
typedef pthread_once_t __gthread_once_t;
typedef pthread_mutex_t __gthread_mutex_t;
typedef pthread_mutex_t __gthread_recursive_mutex_t;
typedef pthread_cond_t __gthread_cond_t;
typedef struct timespec __gthread_time_t;
# 101 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
# 298 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
static inline int
__gthread_active_p (void)
{
return 1;
}
# 658 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
static inline int
__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
void *__args)
{
return pthread_create (__threadid, __null, __func, __args);
}
static inline int
__gthread_join (__gthread_t __threadid, void **__value_ptr)
{
return pthread_join (__threadid, __value_ptr);
}
static inline int
__gthread_detach (__gthread_t __threadid)
{
return pthread_detach (__threadid);
}
static inline int
__gthread_equal (__gthread_t __t1, __gthread_t __t2)
{
return pthread_equal (__t1, __t2);
}
static inline __gthread_t
__gthread_self (void)
{
return pthread_self ();
}
static inline int
__gthread_yield (void)
{
return sched_yield ();
}
static inline int
__gthread_once (__gthread_once_t *__once, void (*__func) (void))
{
if (__gthread_active_p ())
return pthread_once (__once, __func);
else
return -1;
}
static inline int
__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
{
return pthread_key_create (__key, __dtor);
}
static inline int
__gthread_key_delete (__gthread_key_t __key)
{
return pthread_key_delete (__key);
}
static inline void *
__gthread_getspecific (__gthread_key_t __key)
{
return pthread_getspecific (__key);
}
static inline int
__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
{
return pthread_setspecific (__key, __ptr);
}
static inline void
__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
pthread_mutex_init (__mutex, __null);
}
static inline int
__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
return pthread_mutex_destroy (__mutex);
else
return 0;
}
static inline int
__gthread_mutex_lock (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
return pthread_mutex_lock (__mutex);
else
return 0;
}
static inline int
__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
return pthread_mutex_trylock (__mutex);
else
return 0;
}
# 774 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
static inline int
__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
return pthread_mutex_unlock (__mutex);
else
return 0;
}
static inline int
__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
{
if (__gthread_active_p ())
{
pthread_mutexattr_t __attr;
int __r;
__r = pthread_mutexattr_init (&__attr);
if (!__r)
__r = pthread_mutexattr_settype (&__attr,
2);
if (!__r)
__r = pthread_mutex_init (__mutex, &__attr);
if (!__r)
__r = pthread_mutexattr_destroy (&__attr);
return __r;
}
return 0;
}
static inline int
__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_lock (__mutex);
}
static inline int
__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_trylock (__mutex);
}
# 828 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
static inline int
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_unlock (__mutex);
}
static inline int
__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_destroy (__mutex);
}
# 849 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr-default.h" 3
static inline int
__gthread_cond_broadcast (__gthread_cond_t *__cond)
{
return pthread_cond_broadcast (__cond);
}
static inline int
__gthread_cond_signal (__gthread_cond_t *__cond)
{
return pthread_cond_signal (__cond);
}
static inline int
__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
{
return pthread_cond_wait (__cond, __mutex);
}
static inline int
__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
const __gthread_time_t *__abs_timeout)
{
return pthread_cond_timedwait (__cond, __mutex, __abs_timeout);
}
static inline int
__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
__gthread_recursive_mutex_t *__mutex)
{
return __gthread_cond_wait (__cond, __mutex);
}
static inline int
__gthread_cond_destroy (__gthread_cond_t* __cond)
{
return pthread_cond_destroy (__cond);
}
# 149 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/gthr.h" 2 3
#pragma GCC visibility pop
# 36 "/opt/local/include/gcc48/c++/ext/atomicity.h" 2 3
# 1 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/atomic_word.h" 1 3
# 32 "/opt/local/include/gcc48/c++/x86_64-apple-darwin13/bits/atomic_word.h" 3
typedef int _Atomic_word;
# 37 "/opt/local/include/gcc48/c++/ext/atomicity.h" 2 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
static inline _Atomic_word
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{ return __atomic_fetch_add(__mem, __val, 4); }
static inline void
__atomic_add(volatile _Atomic_word* __mem, int __val)
{ __atomic_fetch_add(__mem, __val, 4); }
# 64 "/opt/local/include/gcc48/c++/ext/atomicity.h" 3
static inline _Atomic_word
__exchange_and_add_single(_Atomic_word* __mem, int __val)
{
_Atomic_word __result = *__mem;
*__mem += __val;
return __result;
}
static inline void
__atomic_add_single(_Atomic_word* __mem, int __val)
{ *__mem += __val; }
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
{
if (__gthread_active_p())
return __exchange_and_add(__mem, __val);
else
return __exchange_and_add_single(__mem, __val);
}
static inline void
__attribute__ ((__unused__))
__atomic_add_dispatch(_Atomic_word* __mem, int __val)
{
if (__gthread_active_p())
__atomic_add(__mem, __val);
else
__atomic_add_single(__mem, __val);
}
}
# 40 "/opt/local/include/gcc48/c++/bits/basic_string.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 111 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
class basic_string
{
typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
public:
typedef _Traits traits_type;
typedef typename _Traits::char_type value_type;
typedef _Alloc allocator_type;
typedef typename _CharT_alloc_type::size_type size_type;
typedef typename _CharT_alloc_type::difference_type difference_type;
typedef typename _CharT_alloc_type::reference reference;
typedef typename _CharT_alloc_type::const_reference const_reference;
typedef typename _CharT_alloc_type::pointer pointer;
typedef typename _CharT_alloc_type::const_pointer const_pointer;
typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
private:
# 148 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
struct _Rep_base
{
size_type _M_length;
size_type _M_capacity;
_Atomic_word _M_refcount;
};
struct _Rep : _Rep_base
{
typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
# 173 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
static const size_type _S_max_size;
static const _CharT _S_terminal;
static size_type _S_empty_rep_storage[];
static _Rep&
_S_empty_rep()
{
void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
return *reinterpret_cast<_Rep*>(__p);
}
bool
_M_is_leaked() const
{ return this->_M_refcount < 0; }
bool
_M_is_shared() const
{ return this->_M_refcount > 0; }
void
_M_set_leaked()
{ this->_M_refcount = -1; }
void
_M_set_sharable()
{ this->_M_refcount = 0; }
void
_M_set_length_and_sharable(size_type __n)
{
if (__builtin_expect(this != &_S_empty_rep(), false))
{
this->_M_set_sharable();
this->_M_length = __n;
traits_type::assign(this->_M_refdata()[__n], _S_terminal);
}
}
_CharT*
_M_refdata() throw()
{ return reinterpret_cast<_CharT*>(this + 1); }
_CharT*
_M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
{
return (!_M_is_leaked() && __alloc1 == __alloc2)
? _M_refcopy() : _M_clone(__alloc1);
}
static _Rep*
_S_create(size_type, size_type, const _Alloc&);
void
_M_dispose(const _Alloc& __a)
{
if (__builtin_expect(this != &_S_empty_rep(), false))
{
;
if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
-1) <= 0)
{
;
_M_destroy(__a);
}
}
}
void
_M_destroy(const _Alloc&) throw();
_CharT*
_M_refcopy() throw()
{
if (__builtin_expect(this != &_S_empty_rep(), false))
__gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
return _M_refdata();
}
_CharT*
_M_clone(const _Alloc&, size_type __res = 0);
};
struct _Alloc_hider : _Alloc
{
_Alloc_hider(_CharT* __dat, const _Alloc& __a)
: _Alloc(__a), _M_p(__dat) { }
_CharT* _M_p;
};
public:
static const size_type npos = static_cast<size_type>(-1);
private:
mutable _Alloc_hider _M_dataplus;
_CharT*
_M_data() const
{ return _M_dataplus._M_p; }
_CharT*
_M_data(_CharT* __p)
{ return (_M_dataplus._M_p = __p); }
_Rep*
_M_rep() const
{ return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
iterator
_M_ibegin() const
{ return iterator(_M_data()); }
iterator
_M_iend() const
{ return iterator(_M_data() + this->size()); }
void
_M_leak()
{
if (!_M_rep()->_M_is_leaked())
_M_leak_hard();
}
size_type
_M_check(size_type __pos, const char* __s) const
{
if (__pos > this->size())
__throw_out_of_range((__s));
return __pos;
}
void
_M_check_length(size_type __n1, size_type __n2, const char* __s) const
{
if (this->max_size() - (this->size() - __n1) < __n2)
__throw_length_error((__s));
}
size_type
_M_limit(size_type __pos, size_type __off) const
{
const bool __testoff = __off < this->size() - __pos;
return __testoff ? __off : this->size() - __pos;
}
bool
_M_disjunct(const _CharT* __s) const
{
return (less<const _CharT*>()(__s, _M_data())
|| less<const _CharT*>()(_M_data() + this->size(), __s));
}
static void
_M_copy(_CharT* __d, const _CharT* __s, size_type __n)
{
if (__n == 1)
traits_type::assign(*__d, *__s);
else
traits_type::copy(__d, __s, __n);
}
static void
_M_move(_CharT* __d, const _CharT* __s, size_type __n)
{
if (__n == 1)
traits_type::assign(*__d, *__s);
else
traits_type::move(__d, __s, __n);
}
static void
_M_assign(_CharT* __d, size_type __n, _CharT __c)
{
if (__n == 1)
traits_type::assign(*__d, __c);
else
traits_type::assign(__d, __n, __c);
}
template<class _Iterator>
static void
_S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
{
for (; __k1 != __k2; ++__k1, ++__p)
traits_type::assign(*__p, *__k1);
}
static void
_S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
{ _S_copy_chars(__p, __k1.base(), __k2.base()); }
static void
_S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
{ _S_copy_chars(__p, __k1.base(), __k2.base()); }
static void
_S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
{ _M_copy(__p, __k1, __k2 - __k1); }
static void
_S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
{ _M_copy(__p, __k1, __k2 - __k1); }
static int
_S_compare(size_type __n1, size_type __n2)
{
const difference_type __d = difference_type(__n1 - __n2);
if (__d > __gnu_cxx::__numeric_traits<int>::__max)
return __gnu_cxx::__numeric_traits<int>::__max;
else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
return __gnu_cxx::__numeric_traits<int>::__min;
else
return int(__d);
}
void
_M_mutate(size_type __pos, size_type __len1, size_type __len2);
void
_M_leak_hard();
static _Rep&
_S_empty_rep()
{ return _Rep::_S_empty_rep(); }
public:
basic_string()
: _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
explicit
basic_string(const _Alloc& __a);
basic_string(const basic_string& __str);
basic_string(const basic_string& __str, size_type __pos,
size_type __n = npos);
basic_string(const basic_string& __str, size_type __pos,
size_type __n, const _Alloc& __a);
# 483 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string(const _CharT* __s, size_type __n,
const _Alloc& __a = _Alloc());
basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
# 531 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<class _InputIterator>
basic_string(_InputIterator __beg, _InputIterator __end,
const _Alloc& __a = _Alloc());
~basic_string()
{ _M_rep()->_M_dispose(this->get_allocator()); }
basic_string&
operator=(const basic_string& __str)
{ return this->assign(__str); }
basic_string&
operator=(const _CharT* __s)
{ return this->assign(__s); }
# 564 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
operator=(_CharT __c)
{
this->assign(1, __c);
return *this;
}
# 604 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
iterator
begin()
{
_M_leak();
return iterator(_M_data());
}
const_iterator
begin() const
{ return const_iterator(_M_data()); }
iterator
end()
{
_M_leak();
return iterator(_M_data() + this->size());
}
const_iterator
end() const
{ return const_iterator(_M_data() + this->size()); }
reverse_iterator
rbegin()
{ return reverse_iterator(this->end()); }
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(this->end()); }
reverse_iterator
rend()
{ return reverse_iterator(this->begin()); }
const_reverse_iterator
rend() const
{ return const_reverse_iterator(this->begin()); }
# 710 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
public:
size_type
size() const
{ return _M_rep()->_M_length; }
size_type
length() const
{ return _M_rep()->_M_length; }
size_type
max_size() const
{ return _Rep::_S_max_size; }
# 739 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
void
resize(size_type __n, _CharT __c);
# 752 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
void
resize(size_type __n)
{ this->resize(__n, _CharT()); }
# 775 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
capacity() const
{ return _M_rep()->_M_capacity; }
# 796 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
void
reserve(size_type __res_arg = 0);
void
clear()
{ _M_mutate(0, this->size(), 0); }
bool
empty() const
{ return this->size() == 0; }
# 825 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
const_reference
operator[] (size_type __pos) const
{
;
return _M_data()[__pos];
}
# 842 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
reference
operator[](size_type __pos)
{
;
;
_M_leak();
return _M_data()[__pos];
}
# 863 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
const_reference
at(size_type __n) const
{
if (__n >= this->size())
__throw_out_of_range(("basic_string::at"));
return _M_data()[__n];
}
# 882 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
reference
at(size_type __n)
{
if (__n >= size())
__throw_out_of_range(("basic_string::at"));
_M_leak();
return _M_data()[__n];
}
# 931 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
operator+=(const basic_string& __str)
{ return this->append(__str); }
basic_string&
operator+=(const _CharT* __s)
{ return this->append(__s); }
basic_string&
operator+=(_CharT __c)
{
this->push_back(__c);
return *this;
}
# 972 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
append(const basic_string& __str);
# 988 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
append(const basic_string& __str, size_type __pos, size_type __n);
basic_string&
append(const _CharT* __s, size_type __n);
basic_string&
append(const _CharT* __s)
{
;
return this->append(__s, traits_type::length(__s));
}
# 1020 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
append(size_type __n, _CharT __c);
# 1042 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<class _InputIterator>
basic_string&
append(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_iend(), _M_iend(), __first, __last); }
void
push_back(_CharT __c)
{
const size_type __len = 1 + this->size();
if (__len > this->capacity() || _M_rep()->_M_is_shared())
this->reserve(__len);
traits_type::assign(_M_data()[this->size()], __c);
_M_rep()->_M_set_length_and_sharable(__len);
}
basic_string&
assign(const basic_string& __str);
# 1099 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
assign(const basic_string& __str, size_type __pos, size_type __n)
{ return this->assign(__str._M_data()
+ __str._M_check(__pos, "basic_string::assign"),
__str._M_limit(__pos, __n)); }
# 1115 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
assign(const _CharT* __s, size_type __n);
# 1127 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
assign(const _CharT* __s)
{
;
return this->assign(__s, traits_type::length(__s));
}
# 1143 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
assign(size_type __n, _CharT __c)
{ return _M_replace_aux(size_type(0), this->size(), __n, __c); }
# 1155 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<class _InputIterator>
basic_string&
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
# 1184 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
void
insert(iterator __p, size_type __n, _CharT __c)
{ this->replace(__p, __p, __n, __c); }
# 1200 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<class _InputIterator>
void
insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
# 1232 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
insert(size_type __pos1, const basic_string& __str)
{ return this->insert(__pos1, __str, size_type(0), __str.size()); }
# 1254 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
insert(size_type __pos1, const basic_string& __str,
size_type __pos2, size_type __n)
{ return this->insert(__pos1, __str._M_data()
+ __str._M_check(__pos2, "basic_string::insert"),
__str._M_limit(__pos2, __n)); }
# 1277 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
insert(size_type __pos, const _CharT* __s, size_type __n);
# 1295 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
insert(size_type __pos, const _CharT* __s)
{
;
return this->insert(__pos, __s, traits_type::length(__s));
}
# 1318 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
insert(size_type __pos, size_type __n, _CharT __c)
{ return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
size_type(0), __n, __c); }
# 1336 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
iterator
insert(iterator __p, _CharT __c)
{
;
const size_type __pos = __p - _M_ibegin();
_M_replace_aux(__pos, size_type(0), size_type(1), __c);
_M_rep()->_M_set_leaked();
return iterator(_M_data() + __pos);
}
# 1361 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
erase(size_type __pos = 0, size_type __n = npos)
{
_M_mutate(_M_check(__pos, "basic_string::erase"),
_M_limit(__pos, __n), size_type(0));
return *this;
}
# 1377 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
iterator
erase(iterator __position)
{
;
const size_type __pos = __position - _M_ibegin();
_M_mutate(__pos, size_type(1), size_type(0));
_M_rep()->_M_set_leaked();
return iterator(_M_data() + __pos);
}
# 1397 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
iterator
erase(iterator __first, iterator __last);
# 1428 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(size_type __pos, size_type __n, const basic_string& __str)
{ return this->replace(__pos, __n, __str._M_data(), __str.size()); }
# 1450 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2)
{ return this->replace(__pos1, __n1, __str._M_data()
+ __str._M_check(__pos2, "basic_string::replace"),
__str._M_limit(__pos2, __n2)); }
# 1475 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2);
# 1495 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s)
{
;
return this->replace(__pos, __n1, __s, traits_type::length(__s));
}
# 1519 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
{ return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
_M_limit(__pos, __n1), __n2, __c); }
# 1537 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(iterator __i1, iterator __i2, const basic_string& __str)
{ return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
# 1556 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
{
;
return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
}
# 1577 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(iterator __i1, iterator __i2, const _CharT* __s)
{
;
return this->replace(__i1, __i2, __s, traits_type::length(__s));
}
# 1598 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string&
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
{
;
return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
}
# 1621 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<class _InputIterator>
basic_string&
replace(iterator __i1, iterator __i2,
_InputIterator __k1, _InputIterator __k2)
{
;
;
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
}
basic_string&
replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
{
;
;
return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1, __k2 - __k1);
}
basic_string&
replace(iterator __i1, iterator __i2,
const _CharT* __k1, const _CharT* __k2)
{
;
;
return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1, __k2 - __k1);
}
basic_string&
replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
{
;
;
return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1.base(), __k2 - __k1);
}
basic_string&
replace(iterator __i1, iterator __i2,
const_iterator __k1, const_iterator __k2)
{
;
;
return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1.base(), __k2 - __k1);
}
# 1697 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
private:
template<class _Integer>
basic_string&
_M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
_Integer __val, __true_type)
{ return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
template<class _InputIterator>
basic_string&
_M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
_InputIterator __k2, __false_type);
basic_string&
_M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
_CharT __c);
basic_string&
_M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
size_type __n2);
template<class _InIterator>
static _CharT*
_S_construct_aux(_InIterator __beg, _InIterator __end,
const _Alloc& __a, __false_type)
{
typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
return _S_construct(__beg, __end, __a, _Tag());
}
template<class _Integer>
static _CharT*
_S_construct_aux(_Integer __beg, _Integer __end,
const _Alloc& __a, __true_type)
{ return _S_construct_aux_2(static_cast<size_type>(__beg),
__end, __a); }
static _CharT*
_S_construct_aux_2(size_type __req, _CharT __c, const _Alloc& __a)
{ return _S_construct(__req, __c, __a); }
template<class _InIterator>
static _CharT*
_S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
{
typedef typename std::__is_integer<_InIterator>::__type _Integral;
return _S_construct_aux(__beg, __end, __a, _Integral());
}
template<class _InIterator>
static _CharT*
_S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
input_iterator_tag);
template<class _FwdIterator>
static _CharT*
_S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
forward_iterator_tag);
static _CharT*
_S_construct(size_type __req, _CharT __c, const _Alloc& __a);
public:
# 1779 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
# 1789 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
void
swap(basic_string& __s);
# 1799 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
const _CharT*
c_str() const
{ return _M_data(); }
const _CharT*
data() const
{ return _M_data(); }
allocator_type
get_allocator() const
{ return _M_dataplus; }
# 1832 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find(const _CharT* __s, size_type __pos, size_type __n) const;
# 1845 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find(const basic_string& __str, size_type __pos = 0) const
{ return this->find(__str.data(), __pos, __str.size()); }
# 1860 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find(const _CharT* __s, size_type __pos = 0) const
{
;
return this->find(__s, __pos, traits_type::length(__s));
}
# 1877 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find(_CharT __c, size_type __pos = 0) const ;
# 1890 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
rfind(const basic_string& __str, size_type __pos = npos) const
{ return this->rfind(__str.data(), __pos, __str.size()); }
# 1907 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
rfind(const _CharT* __s, size_type __pos, size_type __n) const;
# 1920 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
rfind(const _CharT* __s, size_type __pos = npos) const
{
;
return this->rfind(__s, __pos, traits_type::length(__s));
}
# 1937 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
rfind(_CharT __c, size_type __pos = npos) const ;
# 1951 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_of(const basic_string& __str, size_type __pos = 0) const
{ return this->find_first_of(__str.data(), __pos, __str.size()); }
# 1968 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
# 1981 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_of(const _CharT* __s, size_type __pos = 0) const
{
;
return this->find_first_of(__s, __pos, traits_type::length(__s));
}
# 2000 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_of(_CharT __c, size_type __pos = 0) const
{ return this->find(__c, __pos); }
# 2015 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_of(const basic_string& __str, size_type __pos = npos) const
{ return this->find_last_of(__str.data(), __pos, __str.size()); }
# 2032 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
# 2045 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_of(const _CharT* __s, size_type __pos = npos) const
{
;
return this->find_last_of(__s, __pos, traits_type::length(__s));
}
# 2064 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_of(_CharT __c, size_type __pos = npos) const
{ return this->rfind(__c, __pos); }
# 2078 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_not_of(const basic_string& __str, size_type __pos = 0) const
{ return this->find_first_not_of(__str.data(), __pos, __str.size()); }
# 2095 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_not_of(const _CharT* __s, size_type __pos,
size_type __n) const;
# 2109 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_not_of(const _CharT* __s, size_type __pos = 0) const
{
;
return this->find_first_not_of(__s, __pos, traits_type::length(__s));
}
# 2126 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_first_not_of(_CharT __c, size_type __pos = 0) const
;
# 2141 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_not_of(const basic_string& __str, size_type __pos = npos) const
{ return this->find_last_not_of(__str.data(), __pos, __str.size()); }
# 2158 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_not_of(const _CharT* __s, size_type __pos,
size_type __n) const;
# 2172 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_not_of(const _CharT* __s, size_type __pos = npos) const
{
;
return this->find_last_not_of(__s, __pos, traits_type::length(__s));
}
# 2189 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
size_type
find_last_not_of(_CharT __c, size_type __pos = npos) const
;
# 2205 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
basic_string
substr(size_type __pos = 0, size_type __n = npos) const
{ return basic_string(*this,
_M_check(__pos, "basic_string::substr"), __n); }
# 2224 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
int
compare(const basic_string& __str) const
{
const size_type __size = this->size();
const size_type __osize = __str.size();
const size_type __len = std::min(__size, __osize);
int __r = traits_type::compare(_M_data(), __str.data(), __len);
if (!__r)
__r = _S_compare(__size, __osize);
return __r;
}
# 2256 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
int
compare(size_type __pos, size_type __n, const basic_string& __str) const;
# 2282 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
int
compare(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2) const;
# 2300 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
int
compare(const _CharT* __s) const;
# 2324 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
int
compare(size_type __pos, size_type __n1, const _CharT* __s) const;
# 2351 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
int
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const;
};
# 2363 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{
basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
__str.append(__rhs);
return __str;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(const _CharT* __lhs,
const basic_string<_CharT,_Traits,_Alloc>& __rhs);
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{
basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
__str.append(__rhs);
return __str;
}
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
{
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__string_type __str(__lhs);
__str.append(__size_type(1), __rhs);
return __str;
}
# 2484 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) == 0; }
template<typename _CharT>
inline
typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
operator==(const basic_string<_CharT>& __lhs,
const basic_string<_CharT>& __rhs)
{ return (__lhs.size() == __rhs.size()
&& !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
__lhs.size())); }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) == 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) == 0; }
# 2530 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return !(__lhs == __rhs); }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return !(__lhs == __rhs); }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return !(__lhs == __rhs); }
# 2567 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) < 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) < 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) > 0; }
# 2604 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) > 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) > 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) < 0; }
# 2641 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) <= 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) <= 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) >= 0; }
# 2678 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) >= 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const _CharT* __rhs)
{ return __lhs.compare(__rhs) >= 0; }
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) <= 0; }
# 2715 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline void
swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
# 2733 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str);
template<>
basic_istream<char>&
operator>>(basic_istream<char>& __is, basic_string<char>& __str);
# 2751 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os,
const basic_string<_CharT, _Traits, _Alloc>& __str)
{
return __ostream_insert(__os, __str.data(), __str.size());
}
# 2774 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
# 2791 "/opt/local/include/gcc48/c++/bits/basic_string.h" 3
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str)
{ return getline(__is, __str, __is.widen('\n')); }
template<>
basic_istream<char>&
getline(basic_istream<char>& __in, basic_string<char>& __str,
char __delim);
template<>
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>& __in, basic_string<wchar_t>& __str,
wchar_t __delim);
}
# 53 "/opt/local/include/gcc48/c++/string" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/basic_string.tcc" 1 3
# 40 "/opt/local/include/gcc48/c++/bits/basic_string.tcc" 3
# 41 "/opt/local/include/gcc48/c++/bits/basic_string.tcc" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _CharT, typename _Traits, typename _Alloc>
const typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
_Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
template<typename _CharT, typename _Traits, typename _Alloc>
const _CharT
basic_string<_CharT, _Traits, _Alloc>::
_Rep::_S_terminal = _CharT();
template<typename _CharT, typename _Traits, typename _Alloc>
const typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::npos;
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
(sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
sizeof(size_type)];
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InIterator>
_CharT*
basic_string<_CharT, _Traits, _Alloc>::
_S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
input_iterator_tag)
{
if (__beg == __end && __a == _Alloc())
return _S_empty_rep()._M_refdata();
_CharT __buf[128];
size_type __len = 0;
while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
{
__buf[__len++] = *__beg;
++__beg;
}
_Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
_M_copy(__r->_M_refdata(), __buf, __len);
if (true)
{
while (__beg != __end)
{
if (__len == __r->_M_capacity)
{
_Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
_M_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
__r->_M_destroy(__a);
__r = __another;
}
__r->_M_refdata()[__len++] = *__beg;
++__beg;
}
}
if (false)
{
__r->_M_destroy(__a);
;
}
__r->_M_set_length_and_sharable(__len);
return __r->_M_refdata();
}
template<typename _CharT, typename _Traits, typename _Alloc>
template <typename _InIterator>
_CharT*
basic_string<_CharT, _Traits, _Alloc>::
_S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
forward_iterator_tag)
{
if (__beg == __end && __a == _Alloc())
return _S_empty_rep()._M_refdata();
if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end)
__throw_logic_error(("basic_string::_S_construct null not valid"));
const size_type __dnew = static_cast<size_type>(std::distance(__beg,
__end));
_Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
if (true)
{ _S_copy_chars(__r->_M_refdata(), __beg, __end); }
if (false)
{
__r->_M_destroy(__a);
;
}
__r->_M_set_length_and_sharable(__dnew);
return __r->_M_refdata();
}
template<typename _CharT, typename _Traits, typename _Alloc>
_CharT*
basic_string<_CharT, _Traits, _Alloc>::
_S_construct(size_type __n, _CharT __c, const _Alloc& __a)
{
if (__n == 0 && __a == _Alloc())
return _S_empty_rep()._M_refdata();
_Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
if (__n)
_M_assign(__r->_M_refdata(), __n, __c);
__r->_M_set_length_and_sharable(__n);
return __r->_M_refdata();
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str)
: _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
__str.get_allocator()),
__str.get_allocator())
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _Alloc& __a)
: _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str, size_type __pos, size_type __n)
: _M_dataplus(_S_construct(__str._M_data()
+ __str._M_check(__pos,
"basic_string::basic_string"),
__str._M_data() + __str._M_limit(__pos, __n)
+ __pos, _Alloc()), _Alloc())
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str, size_type __pos,
size_type __n, const _Alloc& __a)
: _M_dataplus(_S_construct(__str._M_data()
+ __str._M_check(__pos,
"basic_string::basic_string"),
__str._M_data() + __str._M_limit(__pos, __n)
+ __pos, __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
: _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _CharT* __s, const _Alloc& __a)
: _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
__s + npos, __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(size_type __n, _CharT __c, const _Alloc& __a)
: _M_dataplus(_S_construct(__n, __c, __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InputIterator>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
: _M_dataplus(_S_construct(__beg, __end, __a), __a)
{ }
# 240 "/opt/local/include/gcc48/c++/bits/basic_string.tcc" 3
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
assign(const basic_string& __str)
{
if (_M_rep() != __str._M_rep())
{
const allocator_type __a = this->get_allocator();
_CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
_M_rep()->_M_dispose(__a);
_M_data(__tmp);
}
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
assign(const _CharT* __s, size_type __n)
{
;
_M_check_length(this->size(), __n, "basic_string::assign");
if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
return _M_replace_safe(size_type(0), this->size(), __s, __n);
else
{
const size_type __pos = __s - _M_data();
if (__pos >= __n)
_M_copy(_M_data(), __s, __n);
else if (__pos)
_M_move(_M_data(), __s, __n);
_M_rep()->_M_set_length_and_sharable(__n);
return *this;
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
append(size_type __n, _CharT __c)
{
if (__n)
{
_M_check_length(size_type(0), __n, "basic_string::append");
const size_type __len = __n + this->size();
if (__len > this->capacity() || _M_rep()->_M_is_shared())
this->reserve(__len);
_M_assign(_M_data() + this->size(), __n, __c);
_M_rep()->_M_set_length_and_sharable(__len);
}
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
append(const _CharT* __s, size_type __n)
{
;
if (__n)
{
_M_check_length(size_type(0), __n, "basic_string::append");
const size_type __len = __n + this->size();
if (__len > this->capacity() || _M_rep()->_M_is_shared())
{
if (_M_disjunct(__s))
this->reserve(__len);
else
{
const size_type __off = __s - _M_data();
this->reserve(__len);
__s = _M_data() + __off;
}
}
_M_copy(_M_data() + this->size(), __s, __n);
_M_rep()->_M_set_length_and_sharable(__len);
}
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
append(const basic_string& __str)
{
const size_type __size = __str.size();
if (__size)
{
const size_type __len = __size + this->size();
if (__len > this->capacity() || _M_rep()->_M_is_shared())
this->reserve(__len);
_M_copy(_M_data() + this->size(), __str._M_data(), __size);
_M_rep()->_M_set_length_and_sharable(__len);
}
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
append(const basic_string& __str, size_type __pos, size_type __n)
{
__str._M_check(__pos, "basic_string::append");
__n = __str._M_limit(__pos, __n);
if (__n)
{
const size_type __len = __n + this->size();
if (__len > this->capacity() || _M_rep()->_M_is_shared())
this->reserve(__len);
_M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n);
_M_rep()->_M_set_length_and_sharable(__len);
}
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
insert(size_type __pos, const _CharT* __s, size_type __n)
{
;
_M_check(__pos, "basic_string::insert");
_M_check_length(size_type(0), __n, "basic_string::insert");
if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
return _M_replace_safe(__pos, size_type(0), __s, __n);
else
{
const size_type __off = __s - _M_data();
_M_mutate(__pos, 0, __n);
__s = _M_data() + __off;
_CharT* __p = _M_data() + __pos;
if (__s + __n <= __p)
_M_copy(__p, __s, __n);
else if (__s >= __p)
_M_copy(__p, __s + __n, __n);
else
{
const size_type __nleft = __p - __s;
_M_copy(__p, __s, __nleft);
_M_copy(__p + __nleft, __p + __n, __n - __nleft);
}
return *this;
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::iterator
basic_string<_CharT, _Traits, _Alloc>::
erase(iterator __first, iterator __last)
{
;
const size_type __size = __last - __first;
if (__size)
{
const size_type __pos = __first - _M_ibegin();
_M_mutate(__pos, __size, size_type(0));
_M_rep()->_M_set_leaked();
return iterator(_M_data() + __pos);
}
else
return __first;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
replace(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2)
{
;
_M_check(__pos, "basic_string::replace");
__n1 = _M_limit(__pos, __n1);
_M_check_length(__n1, __n2, "basic_string::replace");
bool __left;
if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
return _M_replace_safe(__pos, __n1, __s, __n2);
else if ((__left = __s + __n2 <= _M_data() + __pos)
|| _M_data() + __pos + __n1 <= __s)
{
size_type __off = __s - _M_data();
__left ? __off : (__off += __n2 - __n1);
_M_mutate(__pos, __n1, __n2);
_M_copy(_M_data() + __pos, _M_data() + __off, __n2);
return *this;
}
else
{
const basic_string __tmp(__s, __n2);
return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_M_destroy(const _Alloc& __a) throw ()
{
const size_type __size = sizeof(_Rep_base) +
(this->_M_capacity + 1) * sizeof(_CharT);
_Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::
_M_leak_hard()
{
if (_M_rep() == &_S_empty_rep())
return;
if (_M_rep()->_M_is_shared())
_M_mutate(0, 0, 0);
_M_rep()->_M_set_leaked();
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::
_M_mutate(size_type __pos, size_type __len1, size_type __len2)
{
const size_type __old_size = this->size();
const size_type __new_size = __old_size + __len2 - __len1;
const size_type __how_much = __old_size - __pos - __len1;
if (__new_size > this->capacity() || _M_rep()->_M_is_shared())
{
const allocator_type __a = get_allocator();
_Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a);
if (__pos)
_M_copy(__r->_M_refdata(), _M_data(), __pos);
if (__how_much)
_M_copy(__r->_M_refdata() + __pos + __len2,
_M_data() + __pos + __len1, __how_much);
_M_rep()->_M_dispose(__a);
_M_data(__r->_M_refdata());
}
else if (__how_much && __len1 != __len2)
{
_M_move(_M_data() + __pos + __len2,
_M_data() + __pos + __len1, __how_much);
}
_M_rep()->_M_set_length_and_sharable(__new_size);
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::
reserve(size_type __res)
{
if (__res != this->capacity() || _M_rep()->_M_is_shared())
{
if (__res < this->size())
__res = this->size();
const allocator_type __a = get_allocator();
_CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
_M_rep()->_M_dispose(__a);
_M_data(__tmp);
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::
swap(basic_string& __s)
{
if (_M_rep()->_M_is_leaked())
_M_rep()->_M_set_sharable();
if (__s._M_rep()->_M_is_leaked())
__s._M_rep()->_M_set_sharable();
if (this->get_allocator() == __s.get_allocator())
{
_CharT* __tmp = _M_data();
_M_data(__s._M_data());
__s._M_data(__tmp);
}
else
{
const basic_string __tmp1(_M_ibegin(), _M_iend(),
__s.get_allocator());
const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
this->get_allocator());
*this = __tmp2;
__s = __tmp1;
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_S_create(size_type __capacity, size_type __old_capacity,
const _Alloc& __alloc)
{
if (__capacity > _S_max_size)
__throw_length_error(("basic_string::_S_create"));
# 577 "/opt/local/include/gcc48/c++/bits/basic_string.tcc" 3
const size_type __pagesize = 4096;
const size_type __malloc_header_size = 4 * sizeof(void*);
if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
__capacity = 2 * __old_capacity;
size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
const size_type __adj_size = __size + __malloc_header_size;
if (__adj_size > __pagesize && __capacity > __old_capacity)
{
const size_type __extra = __pagesize - __adj_size % __pagesize;
__capacity += __extra / sizeof(_CharT);
if (__capacity > _S_max_size)
__capacity = _S_max_size;
__size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
}
void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
_Rep *__p = new (__place) _Rep;
__p->_M_capacity = __capacity;
__p->_M_set_sharable();
return __p;
}
template<typename _CharT, typename _Traits, typename _Alloc>
_CharT*
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_M_clone(const _Alloc& __alloc, size_type __res)
{
const size_type __requested_cap = this->_M_length + __res;
_Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
__alloc);
if (this->_M_length)
_M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length);
__r->_M_set_length_and_sharable(this->_M_length);
return __r->_M_refdata();
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::
resize(size_type __n, _CharT __c)
{
const size_type __size = this->size();
_M_check_length(__size, __n, "basic_string::resize");
if (__size < __n)
this->append(__n - __size, __c);
else if (__n < __size)
this->erase(__n);
}
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InputIterator>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
_M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
_InputIterator __k2, __false_type)
{
const basic_string __s(__k1, __k2);
const size_type __n1 = __i2 - __i1;
_M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch");
return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
__s.size());
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
_M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
_CharT __c)
{
_M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
_M_mutate(__pos1, __n1, __n2);
if (__n2)
_M_assign(_M_data() + __pos1, __n2, __c);
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
_M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
size_type __n2)
{
_M_mutate(__pos1, __n1, __n2);
if (__n2)
_M_copy(_M_data() + __pos1, __s, __n2);
return *this;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>
operator+(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{
;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
const __size_type __len = _Traits::length(__lhs);
__string_type __str;
__str.reserve(__len + __rhs.size());
__str.append(__lhs, __len);
__str.append(__rhs);
return __str;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>
operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__string_type __str;
const __size_type __len = __rhs.size();
__str.reserve(__len + 1);
__str.append(__size_type(1), __lhs);
__str.append(__rhs);
return __str;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
copy(_CharT* __s, size_type __n, size_type __pos) const
{
_M_check(__pos, "basic_string::copy");
__n = _M_limit(__pos, __n);
;
if (__n)
_M_copy(__s, _M_data() + __pos, __n);
return __n;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find(const _CharT* __s, size_type __pos, size_type __n) const
{
;
const size_type __size = this->size();
const _CharT* __data = _M_data();
if (__n == 0)
return __pos <= __size ? __pos : npos;
if (__n <= __size)
{
for (; __pos <= __size - __n; ++__pos)
if (traits_type::eq(__data[__pos], __s[0])
&& traits_type::compare(__data + __pos + 1,
__s + 1, __n - 1) == 0)
return __pos;
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find(_CharT __c, size_type __pos) const
{
size_type __ret = npos;
const size_type __size = this->size();
if (__pos < __size)
{
const _CharT* __data = _M_data();
const size_type __n = __size - __pos;
const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
if (__p)
__ret = __p - __data;
}
return __ret;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(const _CharT* __s, size_type __pos, size_type __n) const
{
;
const size_type __size = this->size();
if (__n <= __size)
{
__pos = std::min(size_type(__size - __n), __pos);
const _CharT* __data = _M_data();
do
{
if (traits_type::compare(__data + __pos, __s, __n) == 0)
return __pos;
}
while (__pos-- > 0);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(_CharT __c, size_type __pos) const
{
size_type __size = this->size();
if (__size)
{
if (--__size > __pos)
__size = __pos;
for (++__size; __size-- > 0; )
if (traits_type::eq(_M_data()[__size], __c))
return __size;
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
{
;
for (; __n && __pos < this->size(); ++__pos)
{
const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
if (__p)
return __pos;
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
{
;
size_type __size = this->size();
if (__size && __n)
{
if (--__size > __pos)
__size = __pos;
do
{
if (traits_type::find(__s, __n, _M_data()[__size]))
return __size;
}
while (__size-- != 0);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
;
for (; __pos < this->size(); ++__pos)
if (!traits_type::find(__s, __n, _M_data()[__pos]))
return __pos;
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(_CharT __c, size_type __pos) const
{
for (; __pos < this->size(); ++__pos)
if (!traits_type::eq(_M_data()[__pos], __c))
return __pos;
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
;
size_type __size = this->size();
if (__size)
{
if (--__size > __pos)
__size = __pos;
do
{
if (!traits_type::find(__s, __n, _M_data()[__size]))
return __size;
}
while (__size--);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(_CharT __c, size_type __pos) const
{
size_type __size = this->size();
if (__size)
{
if (--__size > __pos)
__size = __pos;
do
{
if (!traits_type::eq(_M_data()[__size], __c))
return __size;
}
while (__size--);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
compare(size_type __pos, size_type __n, const basic_string& __str) const
{
_M_check(__pos, "basic_string::compare");
__n = _M_limit(__pos, __n);
const size_type __osize = __str.size();
const size_type __len = std::min(__n, __osize);
int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
if (!__r)
__r = _S_compare(__n, __osize);
return __r;
}
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
compare(size_type __pos1, size_type __n1, const basic_string& __str,
size_type __pos2, size_type __n2) const
{
_M_check(__pos1, "basic_string::compare");
__str._M_check(__pos2, "basic_string::compare");
__n1 = _M_limit(__pos1, __n1);
__n2 = __str._M_limit(__pos2, __n2);
const size_type __len = std::min(__n1, __n2);
int __r = traits_type::compare(_M_data() + __pos1,
__str.data() + __pos2, __len);
if (!__r)
__r = _S_compare(__n1, __n2);
return __r;
}
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
compare(const _CharT* __s) const
{
;
const size_type __size = this->size();
const size_type __osize = traits_type::length(__s);
const size_type __len = std::min(__size, __osize);
int __r = traits_type::compare(_M_data(), __s, __len);
if (!__r)
__r = _S_compare(__size, __osize);
return __r;
}
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string <_CharT, _Traits, _Alloc>::
compare(size_type __pos, size_type __n1, const _CharT* __s) const
{
;
_M_check(__pos, "basic_string::compare");
__n1 = _M_limit(__pos, __n1);
const size_type __osize = traits_type::length(__s);
const size_type __len = std::min(__n1, __osize);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
__r = _S_compare(__n1, __osize);
return __r;
}
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string <_CharT, _Traits, _Alloc>::
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const
{
;
_M_check(__pos, "basic_string::compare");
__n1 = _M_limit(__pos, __n1);
const size_type __len = std::min(__n1, __n2);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
__r = _S_compare(__n1, __n2);
return __r;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT, _Traits, _Alloc>& __str)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __istream_type::ios_base __ios_base;
typedef typename __istream_type::int_type __int_type;
typedef typename __string_type::size_type __size_type;
typedef ctype<_CharT> __ctype_type;
typedef typename __ctype_type::ctype_base __ctype_base;
__size_type __extracted = 0;
typename __ios_base::iostate __err = __ios_base::goodbit;
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
if (true)
{
__str.erase();
_CharT __buf[128];
__size_type __len = 0;
const streamsize __w = __in.width();
const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
: __str.max_size();
const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
const __int_type __eof = _Traits::eof();
__int_type __c = __in.rdbuf()->sgetc();
while (__extracted < __n
&& !_Traits::eq_int_type(__c, __eof)
&& !__ct.is(__ctype_base::space,
_Traits::to_char_type(__c)))
{
if (__len == sizeof(__buf) / sizeof(_CharT))
{
__str.append(__buf, sizeof(__buf) / sizeof(_CharT));
__len = 0;
}
__buf[__len++] = _Traits::to_char_type(__c);
++__extracted;
__c = __in.rdbuf()->snextc();
}
__str.append(__buf, __len);
if (_Traits::eq_int_type(__c, __eof))
__err |= __ios_base::eofbit;
__in.width(0);
}
if (false)
{
__in._M_setstate(__ios_base::badbit);
;
}
if (false)
{
__in._M_setstate(__ios_base::badbit);
}
}
if (!__extracted)
__err |= __ios_base::failbit;
if (__err)
__in.setstate(__err);
return __in;
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __istream_type::ios_base __ios_base;
typedef typename __istream_type::int_type __int_type;
typedef typename __string_type::size_type __size_type;
__size_type __extracted = 0;
const __size_type __n = __str.max_size();
typename __ios_base::iostate __err = __ios_base::goodbit;
typename __istream_type::sentry __cerb(__in, true);
if (__cerb)
{
if (true)
{
__str.erase();
const __int_type __idelim = _Traits::to_int_type(__delim);
const __int_type __eof = _Traits::eof();
__int_type __c = __in.rdbuf()->sgetc();
while (__extracted < __n
&& !_Traits::eq_int_type(__c, __eof)
&& !_Traits::eq_int_type(__c, __idelim))
{
__str += _Traits::to_char_type(__c);
++__extracted;
__c = __in.rdbuf()->snextc();
}
if (_Traits::eq_int_type(__c, __eof))
__err |= __ios_base::eofbit;
else if (_Traits::eq_int_type(__c, __idelim))
{
++__extracted;
__in.rdbuf()->sbumpc();
}
else
__err |= __ios_base::failbit;
}
if (false)
{
__in._M_setstate(__ios_base::badbit);
;
}
if (false)
{
__in._M_setstate(__ios_base::badbit);
}
}
if (!__extracted)
__err |= __ios_base::failbit;
if (__err)
__in.setstate(__err);
return __in;
}
extern template class basic_string<char>;
extern template
basic_istream<char>&
operator>>(basic_istream<char>&, string&);
extern template
basic_ostream<char>&
operator<<(basic_ostream<char>&, const string&);
extern template
basic_istream<char>&
getline(basic_istream<char>&, string&, char);
extern template
basic_istream<char>&
getline(basic_istream<char>&, string&);
extern template class basic_string<wchar_t>;
extern template
basic_istream<wchar_t>&
operator>>(basic_istream<wchar_t>&, wstring&);
extern template
basic_ostream<wchar_t>&
operator<<(basic_ostream<wchar_t>&, const wstring&);
extern template
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&, wchar_t);
extern template
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&);
}
# 54 "/opt/local/include/gcc48/c++/string" 2 3
# 38 "mimedb.cpp" 2
# 1 "/opt/local/include/gcc48/c++/map" 1 3
# 58 "/opt/local/include/gcc48/c++/map" 3
# 59 "/opt/local/include/gcc48/c++/map" 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 1 3
# 69 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 89 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
enum _Rb_tree_color { _S_red = false, _S_black = true };
struct _Rb_tree_node_base
{
typedef _Rb_tree_node_base* _Base_ptr;
typedef const _Rb_tree_node_base* _Const_Base_ptr;
_Rb_tree_color _M_color;
_Base_ptr _M_parent;
_Base_ptr _M_left;
_Base_ptr _M_right;
static _Base_ptr
_S_minimum(_Base_ptr __x)
{
while (__x->_M_left != 0) __x = __x->_M_left;
return __x;
}
static _Const_Base_ptr
_S_minimum(_Const_Base_ptr __x)
{
while (__x->_M_left != 0) __x = __x->_M_left;
return __x;
}
static _Base_ptr
_S_maximum(_Base_ptr __x)
{
while (__x->_M_right != 0) __x = __x->_M_right;
return __x;
}
static _Const_Base_ptr
_S_maximum(_Const_Base_ptr __x)
{
while (__x->_M_right != 0) __x = __x->_M_right;
return __x;
}
};
template<typename _Val>
struct _Rb_tree_node : public _Rb_tree_node_base
{
typedef _Rb_tree_node<_Val>* _Link_type;
_Val _M_value_field;
};
__attribute__ ((__pure__)) _Rb_tree_node_base*
_Rb_tree_increment(_Rb_tree_node_base* __x) throw ();
__attribute__ ((__pure__)) const _Rb_tree_node_base*
_Rb_tree_increment(const _Rb_tree_node_base* __x) throw ();
__attribute__ ((__pure__)) _Rb_tree_node_base*
_Rb_tree_decrement(_Rb_tree_node_base* __x) throw ();
__attribute__ ((__pure__)) const _Rb_tree_node_base*
_Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ();
template<typename _Tp>
struct _Rb_tree_iterator
{
typedef _Tp value_type;
typedef _Tp& reference;
typedef _Tp* pointer;
typedef bidirectional_iterator_tag iterator_category;
typedef ptrdiff_t difference_type;
typedef _Rb_tree_iterator<_Tp> _Self;
typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
typedef _Rb_tree_node<_Tp>* _Link_type;
_Rb_tree_iterator()
: _M_node() { }
explicit
_Rb_tree_iterator(_Link_type __x)
: _M_node(__x) { }
reference
operator*() const
{ return static_cast<_Link_type>(_M_node)->_M_value_field; }
pointer
operator->() const
{ return std::__addressof(static_cast<_Link_type>
(_M_node)->_M_value_field); }
_Self&
operator++()
{
_M_node = _Rb_tree_increment(_M_node);
return *this;
}
_Self
operator++(int)
{
_Self __tmp = *this;
_M_node = _Rb_tree_increment(_M_node);
return __tmp;
}
_Self&
operator--()
{
_M_node = _Rb_tree_decrement(_M_node);
return *this;
}
_Self
operator--(int)
{
_Self __tmp = *this;
_M_node = _Rb_tree_decrement(_M_node);
return __tmp;
}
bool
operator==(const _Self& __x) const
{ return _M_node == __x._M_node; }
bool
operator!=(const _Self& __x) const
{ return _M_node != __x._M_node; }
_Base_ptr _M_node;
};
template<typename _Tp>
struct _Rb_tree_const_iterator
{
typedef _Tp value_type;
typedef const _Tp& reference;
typedef const _Tp* pointer;
typedef _Rb_tree_iterator<_Tp> iterator;
typedef bidirectional_iterator_tag iterator_category;
typedef ptrdiff_t difference_type;
typedef _Rb_tree_const_iterator<_Tp> _Self;
typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
typedef const _Rb_tree_node<_Tp>* _Link_type;
_Rb_tree_const_iterator()
: _M_node() { }
explicit
_Rb_tree_const_iterator(_Link_type __x)
: _M_node(__x) { }
_Rb_tree_const_iterator(const iterator& __it)
: _M_node(__it._M_node) { }
iterator
_M_const_cast() const
{ return iterator(static_cast<typename iterator::_Link_type>
(const_cast<typename iterator::_Base_ptr>(_M_node))); }
reference
operator*() const
{ return static_cast<_Link_type>(_M_node)->_M_value_field; }
pointer
operator->() const
{ return std::__addressof(static_cast<_Link_type>
(_M_node)->_M_value_field); }
_Self&
operator++()
{
_M_node = _Rb_tree_increment(_M_node);
return *this;
}
_Self
operator++(int)
{
_Self __tmp = *this;
_M_node = _Rb_tree_increment(_M_node);
return __tmp;
}
_Self&
operator--()
{
_M_node = _Rb_tree_decrement(_M_node);
return *this;
}
_Self
operator--(int)
{
_Self __tmp = *this;
_M_node = _Rb_tree_decrement(_M_node);
return __tmp;
}
bool
operator==(const _Self& __x) const
{ return _M_node == __x._M_node; }
bool
operator!=(const _Self& __x) const
{ return _M_node != __x._M_node; }
_Base_ptr _M_node;
};
template<typename _Val>
inline bool
operator==(const _Rb_tree_iterator<_Val>& __x,
const _Rb_tree_const_iterator<_Val>& __y)
{ return __x._M_node == __y._M_node; }
template<typename _Val>
inline bool
operator!=(const _Rb_tree_iterator<_Val>& __x,
const _Rb_tree_const_iterator<_Val>& __y)
{ return __x._M_node != __y._M_node; }
void
_Rb_tree_insert_and_rebalance(const bool __insert_left,
_Rb_tree_node_base* __x,
_Rb_tree_node_base* __p,
_Rb_tree_node_base& __header) throw ();
_Rb_tree_node_base*
_Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
_Rb_tree_node_base& __header) throw ();
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc = allocator<_Val> >
class _Rb_tree
{
typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
_Node_allocator;
protected:
typedef _Rb_tree_node_base* _Base_ptr;
typedef const _Rb_tree_node_base* _Const_Base_ptr;
public:
typedef _Key key_type;
typedef _Val value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef _Rb_tree_node<_Val>* _Link_type;
typedef const _Rb_tree_node<_Val>* _Const_Link_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Alloc allocator_type;
_Node_allocator&
_M_get_Node_allocator()
{ return *static_cast<_Node_allocator*>(&this->_M_impl); }
const _Node_allocator&
_M_get_Node_allocator() const
{ return *static_cast<const _Node_allocator*>(&this->_M_impl); }
allocator_type
get_allocator() const
{ return allocator_type(_M_get_Node_allocator()); }
protected:
_Link_type
_M_get_node()
{ return _M_impl._Node_allocator::allocate(1); }
void
_M_put_node(_Link_type __p)
{ _M_impl._Node_allocator::deallocate(__p, 1); }
_Link_type
_M_create_node(const value_type& __x)
{
_Link_type __tmp = _M_get_node();
if (true)
{ get_allocator().construct
(std::__addressof(__tmp->_M_value_field), __x); }
if (false)
{
_M_put_node(__tmp);
;
}
return __tmp;
}
void
_M_destroy_node(_Link_type __p)
{
get_allocator().destroy(std::__addressof(__p->_M_value_field));
_M_put_node(__p);
}
# 426 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
_Link_type
_M_clone_node(_Const_Link_type __x)
{
_Link_type __tmp = _M_create_node(__x->_M_value_field);
__tmp->_M_color = __x->_M_color;
__tmp->_M_left = 0;
__tmp->_M_right = 0;
return __tmp;
}
protected:
template<typename _Key_compare,
bool _Is_pod_comparator = __is_pod(_Key_compare)>
struct _Rb_tree_impl : public _Node_allocator
{
_Key_compare _M_key_compare;
_Rb_tree_node_base _M_header;
size_type _M_node_count;
_Rb_tree_impl()
: _Node_allocator(), _M_key_compare(), _M_header(),
_M_node_count(0)
{ _M_initialize(); }
_Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
: _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
_M_node_count(0)
{ _M_initialize(); }
# 462 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
private:
void
_M_initialize()
{
this->_M_header._M_color = _S_red;
this->_M_header._M_parent = 0;
this->_M_header._M_left = &this->_M_header;
this->_M_header._M_right = &this->_M_header;
}
};
_Rb_tree_impl<_Compare> _M_impl;
protected:
_Base_ptr&
_M_root()
{ return this->_M_impl._M_header._M_parent; }
_Const_Base_ptr
_M_root() const
{ return this->_M_impl._M_header._M_parent; }
_Base_ptr&
_M_leftmost()
{ return this->_M_impl._M_header._M_left; }
_Const_Base_ptr
_M_leftmost() const
{ return this->_M_impl._M_header._M_left; }
_Base_ptr&
_M_rightmost()
{ return this->_M_impl._M_header._M_right; }
_Const_Base_ptr
_M_rightmost() const
{ return this->_M_impl._M_header._M_right; }
_Link_type
_M_begin()
{ return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
_Const_Link_type
_M_begin() const
{
return static_cast<_Const_Link_type>
(this->_M_impl._M_header._M_parent);
}
_Link_type
_M_end()
{ return static_cast<_Link_type>(&this->_M_impl._M_header); }
_Const_Link_type
_M_end() const
{ return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
static const_reference
_S_value(_Const_Link_type __x)
{ return __x->_M_value_field; }
static const _Key&
_S_key(_Const_Link_type __x)
{ return _KeyOfValue()(_S_value(__x)); }
static _Link_type
_S_left(_Base_ptr __x)
{ return static_cast<_Link_type>(__x->_M_left); }
static _Const_Link_type
_S_left(_Const_Base_ptr __x)
{ return static_cast<_Const_Link_type>(__x->_M_left); }
static _Link_type
_S_right(_Base_ptr __x)
{ return static_cast<_Link_type>(__x->_M_right); }
static _Const_Link_type
_S_right(_Const_Base_ptr __x)
{ return static_cast<_Const_Link_type>(__x->_M_right); }
static const_reference
_S_value(_Const_Base_ptr __x)
{ return static_cast<_Const_Link_type>(__x)->_M_value_field; }
static const _Key&
_S_key(_Const_Base_ptr __x)
{ return _KeyOfValue()(_S_value(__x)); }
static _Base_ptr
_S_minimum(_Base_ptr __x)
{ return _Rb_tree_node_base::_S_minimum(__x); }
static _Const_Base_ptr
_S_minimum(_Const_Base_ptr __x)
{ return _Rb_tree_node_base::_S_minimum(__x); }
static _Base_ptr
_S_maximum(_Base_ptr __x)
{ return _Rb_tree_node_base::_S_maximum(__x); }
static _Const_Base_ptr
_S_maximum(_Const_Base_ptr __x)
{ return _Rb_tree_node_base::_S_maximum(__x); }
public:
typedef _Rb_tree_iterator<value_type> iterator;
typedef _Rb_tree_const_iterator<value_type> const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
private:
pair<_Base_ptr, _Base_ptr>
_M_get_insert_unique_pos(const key_type& __k);
pair<_Base_ptr, _Base_ptr>
_M_get_insert_equal_pos(const key_type& __k);
pair<_Base_ptr, _Base_ptr>
_M_get_insert_hint_unique_pos(const_iterator __pos,
const key_type& __k);
pair<_Base_ptr, _Base_ptr>
_M_get_insert_hint_equal_pos(const_iterator __pos,
const key_type& __k);
# 611 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
iterator
_M_insert_(_Base_ptr __x, _Base_ptr __y,
const value_type& __v);
iterator
_M_insert_lower(_Base_ptr __y, const value_type& __v);
iterator
_M_insert_equal_lower(const value_type& __x);
_Link_type
_M_copy(_Const_Link_type __x, _Link_type __p);
void
_M_erase(_Link_type __x);
iterator
_M_lower_bound(_Link_type __x, _Link_type __y,
const _Key& __k);
const_iterator
_M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
const _Key& __k) const;
iterator
_M_upper_bound(_Link_type __x, _Link_type __y,
const _Key& __k);
const_iterator
_M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
const _Key& __k) const;
public:
_Rb_tree() { }
_Rb_tree(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_impl(__comp, _Node_allocator(__a)) { }
_Rb_tree(const _Rb_tree& __x)
: _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
{
if (__x._M_root() != 0)
{
_M_root() = _M_copy(__x._M_begin(), _M_end());
_M_leftmost() = _S_minimum(_M_root());
_M_rightmost() = _S_maximum(_M_root());
_M_impl._M_node_count = __x._M_impl._M_node_count;
}
}
~_Rb_tree()
{ _M_erase(_M_begin()); }
_Rb_tree&
operator=(const _Rb_tree& __x);
_Compare
key_comp() const
{ return _M_impl._M_key_compare; }
iterator
begin()
{
return iterator(static_cast<_Link_type>
(this->_M_impl._M_header._M_left));
}
const_iterator
begin() const
{
return const_iterator(static_cast<_Const_Link_type>
(this->_M_impl._M_header._M_left));
}
iterator
end()
{ return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); }
const_iterator
end() const
{
return const_iterator(static_cast<_Const_Link_type>
(&this->_M_impl._M_header));
}
reverse_iterator
rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(end()); }
reverse_iterator
rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator
rend() const
{ return const_reverse_iterator(begin()); }
bool
empty() const
{ return _M_impl._M_node_count == 0; }
size_type
size() const
{ return _M_impl._M_node_count; }
size_type
max_size() const
{ return _M_get_Node_allocator().max_size(); }
void
swap(_Rb_tree& __t);
# 771 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
pair<iterator, bool>
_M_insert_unique(const value_type& __x);
iterator
_M_insert_equal(const value_type& __x);
iterator
_M_insert_unique_(const_iterator __position, const value_type& __x);
iterator
_M_insert_equal_(const_iterator __position, const value_type& __x);
template<typename _InputIterator>
void
_M_insert_unique(_InputIterator __first, _InputIterator __last);
template<typename _InputIterator>
void
_M_insert_equal(_InputIterator __first, _InputIterator __last);
private:
void
_M_erase_aux(const_iterator __position);
void
_M_erase_aux(const_iterator __first, const_iterator __last);
public:
# 824 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
void
erase(iterator __position)
{ _M_erase_aux(__position); }
void
erase(const_iterator __position)
{ _M_erase_aux(__position); }
size_type
erase(const key_type& __x);
# 846 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
void
erase(iterator __first, iterator __last)
{ _M_erase_aux(__first, __last); }
void
erase(const_iterator __first, const_iterator __last)
{ _M_erase_aux(__first, __last); }
void
erase(const key_type* __first, const key_type* __last);
void
clear()
{
_M_erase(_M_begin());
_M_leftmost() = _M_end();
_M_root() = 0;
_M_rightmost() = _M_end();
_M_impl._M_node_count = 0;
}
iterator
find(const key_type& __k);
const_iterator
find(const key_type& __k) const;
size_type
count(const key_type& __k) const;
iterator
lower_bound(const key_type& __k)
{ return _M_lower_bound(_M_begin(), _M_end(), __k); }
const_iterator
lower_bound(const key_type& __k) const
{ return _M_lower_bound(_M_begin(), _M_end(), __k); }
iterator
upper_bound(const key_type& __k)
{ return _M_upper_bound(_M_begin(), _M_end(), __k); }
const_iterator
upper_bound(const key_type& __k) const
{ return _M_upper_bound(_M_begin(), _M_end(), __k); }
pair<iterator, iterator>
equal_range(const key_type& __k);
pair<const_iterator, const_iterator>
equal_range(const key_type& __k) const;
bool
__rb_verify() const;
};
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
inline bool
operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
{
return __x.size() == __y.size()
&& std::equal(__x.begin(), __x.end(), __y.begin());
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
inline bool
operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
{
return std::lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
inline bool
operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
{ return !(__x == __y); }
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
inline bool
operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
{ return __y < __x; }
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
inline bool
operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
{ return !(__y < __x); }
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
inline bool
operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
{ return !(__x < __y); }
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
inline void
swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
{ __x.swap(__y); }
# 984 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
{
if (this != &__x)
{
clear();
_M_impl._M_key_compare = __x._M_impl._M_key_compare;
if (__x._M_root() != 0)
{
_M_root() = _M_copy(__x._M_begin(), _M_end());
_M_leftmost() = _S_minimum(_M_root());
_M_rightmost() = _S_maximum(_M_root());
_M_impl._M_node_count = __x._M_impl._M_node_count;
}
}
return *this;
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_insert_(_Base_ptr __x, _Base_ptr __p, const _Val& __v)
{
bool __insert_left = (__x != 0 || __p == _M_end()
|| _M_impl._M_key_compare(_KeyOfValue()(__v),
_S_key(__p)));
_Link_type __z = _M_create_node((__v));
_Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
this->_M_impl._M_header);
++_M_impl._M_node_count;
return iterator(__z);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_insert_lower(_Base_ptr __p, const _Val& __v)
{
bool __insert_left = (__p == _M_end()
|| !_M_impl._M_key_compare(_S_key(__p),
_KeyOfValue()(__v)));
_Link_type __z = _M_create_node((__v));
_Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
this->_M_impl._M_header);
++_M_impl._M_node_count;
return iterator(__z);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_insert_equal_lower(const _Val& __v)
{
_Link_type __x = _M_begin();
_Link_type __y = _M_end();
while (__x != 0)
{
__y = __x;
__x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ?
_S_left(__x) : _S_right(__x);
}
return _M_insert_lower(__y, (__v));
}
template<typename _Key, typename _Val, typename _KoV,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
_Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
_M_copy(_Const_Link_type __x, _Link_type __p)
{
_Link_type __top = _M_clone_node(__x);
__top->_M_parent = __p;
if (true)
{
if (__x->_M_right)
__top->_M_right = _M_copy(_S_right(__x), __top);
__p = __top;
__x = _S_left(__x);
while (__x != 0)
{
_Link_type __y = _M_clone_node(__x);
__p->_M_left = __y;
__y->_M_parent = __p;
if (__x->_M_right)
__y->_M_right = _M_copy(_S_right(__x), __y);
__p = __y;
__x = _S_left(__x);
}
}
if (false)
{
_M_erase(__top);
;
}
return __top;
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
void
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_erase(_Link_type __x)
{
while (__x != 0)
{
_M_erase(_S_right(__x));
_Link_type __y = _S_left(__x);
_M_destroy_node(__x);
__x = __y;
}
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_lower_bound(_Link_type __x, _Link_type __y,
const _Key& __k)
{
while (__x != 0)
if (!_M_impl._M_key_compare(_S_key(__x), __k))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
return iterator(__y);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::const_iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
const _Key& __k) const
{
while (__x != 0)
if (!_M_impl._M_key_compare(_S_key(__x), __k))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
return const_iterator(__y);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_upper_bound(_Link_type __x, _Link_type __y,
const _Key& __k)
{
while (__x != 0)
if (_M_impl._M_key_compare(__k, _S_key(__x)))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
return iterator(__y);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::const_iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
const _Key& __k) const
{
while (__x != 0)
if (_M_impl._M_key_compare(__k, _S_key(__x)))
__y = __x, __x = _S_left(__x);
else
__x = _S_right(__x);
return const_iterator(__y);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator,
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
equal_range(const _Key& __k)
{
_Link_type __x = _M_begin();
_Link_type __y = _M_end();
while (__x != 0)
{
if (_M_impl._M_key_compare(_S_key(__x), __k))
__x = _S_right(__x);
else if (_M_impl._M_key_compare(__k, _S_key(__x)))
__y = __x, __x = _S_left(__x);
else
{
_Link_type __xu(__x), __yu(__y);
__y = __x, __x = _S_left(__x);
__xu = _S_right(__xu);
return pair<iterator,
iterator>(_M_lower_bound(__x, __y, __k),
_M_upper_bound(__xu, __yu, __k));
}
}
return pair<iterator, iterator>(iterator(__y),
iterator(__y));
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::const_iterator,
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::const_iterator>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
equal_range(const _Key& __k) const
{
_Const_Link_type __x = _M_begin();
_Const_Link_type __y = _M_end();
while (__x != 0)
{
if (_M_impl._M_key_compare(_S_key(__x), __k))
__x = _S_right(__x);
else if (_M_impl._M_key_compare(__k, _S_key(__x)))
__y = __x, __x = _S_left(__x);
else
{
_Const_Link_type __xu(__x), __yu(__y);
__y = __x, __x = _S_left(__x);
__xu = _S_right(__xu);
return pair<const_iterator,
const_iterator>(_M_lower_bound(__x, __y, __k),
_M_upper_bound(__xu, __yu, __k));
}
}
return pair<const_iterator, const_iterator>(const_iterator(__y),
const_iterator(__y));
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
void
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
{
if (_M_root() == 0)
{
if (__t._M_root() != 0)
{
_M_root() = __t._M_root();
_M_leftmost() = __t._M_leftmost();
_M_rightmost() = __t._M_rightmost();
_M_root()->_M_parent = _M_end();
__t._M_root() = 0;
__t._M_leftmost() = __t._M_end();
__t._M_rightmost() = __t._M_end();
}
}
else if (__t._M_root() == 0)
{
__t._M_root() = _M_root();
__t._M_leftmost() = _M_leftmost();
__t._M_rightmost() = _M_rightmost();
__t._M_root()->_M_parent = __t._M_end();
_M_root() = 0;
_M_leftmost() = _M_end();
_M_rightmost() = _M_end();
}
else
{
std::swap(_M_root(),__t._M_root());
std::swap(_M_leftmost(),__t._M_leftmost());
std::swap(_M_rightmost(),__t._M_rightmost());
_M_root()->_M_parent = _M_end();
__t._M_root()->_M_parent = __t._M_end();
}
std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
std::__alloc_swap<_Node_allocator>::
_S_do_it(_M_get_Node_allocator(), __t._M_get_Node_allocator());
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr,
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_get_insert_unique_pos(const key_type& __k)
{
typedef pair<_Base_ptr, _Base_ptr> _Res;
_Link_type __x = _M_begin();
_Link_type __y = _M_end();
bool __comp = true;
while (__x != 0)
{
__y = __x;
__comp = _M_impl._M_key_compare(__k, _S_key(__x));
__x = __comp ? _S_left(__x) : _S_right(__x);
}
iterator __j = iterator(__y);
if (__comp)
{
if (__j == begin())
return _Res(__x, __y);
else
--__j;
}
if (_M_impl._M_key_compare(_S_key(__j._M_node), __k))
return _Res(__x, __y);
return _Res(__j._M_node, 0);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr,
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_get_insert_equal_pos(const key_type& __k)
{
typedef pair<_Base_ptr, _Base_ptr> _Res;
_Link_type __x = _M_begin();
_Link_type __y = _M_end();
while (__x != 0)
{
__y = __x;
__x = _M_impl._M_key_compare(__k, _S_key(__x)) ?
_S_left(__x) : _S_right(__x);
}
return _Res(__x, __y);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator, bool>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_insert_unique(const _Val& __v)
{
typedef pair<iterator, bool> _Res;
pair<_Base_ptr, _Base_ptr> __res
= _M_get_insert_unique_pos(_KeyOfValue()(__v));
if (__res.second)
return _Res(_M_insert_(__res.first, __res.second,
(__v)),
true);
return _Res(iterator(static_cast<_Link_type>(__res.first)), false);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_insert_equal(const _Val& __v)
{
pair<_Base_ptr, _Base_ptr> __res
= _M_get_insert_equal_pos(_KeyOfValue()(__v));
return _M_insert_(__res.first, __res.second, (__v));
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr,
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_get_insert_hint_unique_pos(const_iterator __position,
const key_type& __k)
{
iterator __pos = __position._M_const_cast();
typedef pair<_Base_ptr, _Base_ptr> _Res;
if (__pos._M_node == _M_end())
{
if (size() > 0
&& _M_impl._M_key_compare(_S_key(_M_rightmost()), __k))
return _Res(0, _M_rightmost());
else
return _M_get_insert_unique_pos(__k);
}
else if (_M_impl._M_key_compare(__k, _S_key(__pos._M_node)))
{
iterator __before = __pos;
if (__pos._M_node == _M_leftmost())
return _Res(_M_leftmost(), _M_leftmost());
else if (_M_impl._M_key_compare(_S_key((--__before)._M_node), __k))
{
if (_S_right(__before._M_node) == 0)
return _Res(0, __before._M_node);
else
return _Res(__pos._M_node, __pos._M_node);
}
else
return _M_get_insert_unique_pos(__k);
}
else if (_M_impl._M_key_compare(_S_key(__pos._M_node), __k))
{
iterator __after = __pos;
if (__pos._M_node == _M_rightmost())
return _Res(0, _M_rightmost());
else if (_M_impl._M_key_compare(__k, _S_key((++__after)._M_node)))
{
if (_S_right(__pos._M_node) == 0)
return _Res(0, __pos._M_node);
else
return _Res(__after._M_node, __after._M_node);
}
else
return _M_get_insert_unique_pos(__k);
}
else
return _Res(__pos._M_node, 0);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_insert_unique_(const_iterator __position, const _Val& __v)
{
pair<_Base_ptr, _Base_ptr> __res
= _M_get_insert_hint_unique_pos(__position, _KeyOfValue()(__v));
if (__res.second)
return _M_insert_(__res.first, __res.second,
(__v));
return iterator(static_cast<_Link_type>(__res.first));
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr,
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Base_ptr>
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_get_insert_hint_equal_pos(const_iterator __position, const key_type& __k)
{
iterator __pos = __position._M_const_cast();
typedef pair<_Base_ptr, _Base_ptr> _Res;
if (__pos._M_node == _M_end())
{
if (size() > 0
&& !_M_impl._M_key_compare(__k, _S_key(_M_rightmost())))
return _Res(0, _M_rightmost());
else
return _M_get_insert_equal_pos(__k);
}
else if (!_M_impl._M_key_compare(_S_key(__pos._M_node), __k))
{
iterator __before = __pos;
if (__pos._M_node == _M_leftmost())
return _Res(_M_leftmost(), _M_leftmost());
else if (!_M_impl._M_key_compare(__k, _S_key((--__before)._M_node)))
{
if (_S_right(__before._M_node) == 0)
return _Res(0, __before._M_node);
else
return _Res(__pos._M_node, __pos._M_node);
}
else
return _M_get_insert_equal_pos(__k);
}
else
{
iterator __after = __pos;
if (__pos._M_node == _M_rightmost())
return _Res(0, _M_rightmost());
else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node), __k))
{
if (_S_right(__pos._M_node) == 0)
return _Res(0, __pos._M_node);
else
return _Res(__after._M_node, __after._M_node);
}
else
return _Res(0, 0);
}
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_insert_equal_(const_iterator __position, const _Val& __v)
{
pair<_Base_ptr, _Base_ptr> __res
= _M_get_insert_hint_equal_pos(__position, _KeyOfValue()(__v));
if (__res.second)
return _M_insert_(__res.first, __res.second,
(__v));
return _M_insert_equal_lower((__v));
}
# 1714 "/opt/local/include/gcc48/c++/bits/stl_tree.h" 3
template<typename _Key, typename _Val, typename _KoV,
typename _Cmp, typename _Alloc>
template<class _II>
void
_Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
_M_insert_unique(_II __first, _II __last)
{
for (; __first != __last; ++__first)
_M_insert_unique_(end(), *__first);
}
template<typename _Key, typename _Val, typename _KoV,
typename _Cmp, typename _Alloc>
template<class _II>
void
_Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
_M_insert_equal(_II __first, _II __last)
{
for (; __first != __last; ++__first)
_M_insert_equal_(end(), *__first);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
void
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_erase_aux(const_iterator __position)
{
_Link_type __y =
static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
(const_cast<_Base_ptr>(__position._M_node),
this->_M_impl._M_header));
_M_destroy_node(__y);
--_M_impl._M_node_count;
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
void
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
_M_erase_aux(const_iterator __first, const_iterator __last)
{
if (__first == begin() && __last == end())
clear();
else
while (__first != __last)
erase(__first++);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
erase(const _Key& __x)
{
pair<iterator, iterator> __p = equal_range(__x);
const size_type __old_size = size();
erase(__p.first, __p.second);
return __old_size - size();
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
void
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
erase(const _Key* __first, const _Key* __last)
{
while (__first != __last)
erase(*__first++);
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
find(const _Key& __k)
{
iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
return (__j == end()
|| _M_impl._M_key_compare(__k,
_S_key(__j._M_node))) ? end() : __j;
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::const_iterator
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
find(const _Key& __k) const
{
const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
return (__j == end()
|| _M_impl._M_key_compare(__k,
_S_key(__j._M_node))) ? end() : __j;
}
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
count(const _Key& __k) const
{
pair<const_iterator, const_iterator> __p = equal_range(__k);
const size_type __n = std::distance(__p.first, __p.second);
return __n;
}
__attribute__ ((__pure__)) unsigned int
_Rb_tree_black_count(const _Rb_tree_node_base* __node,
const _Rb_tree_node_base* __root) throw ();
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc>
bool
_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
{
if (_M_impl._M_node_count == 0 || begin() == end())
return _M_impl._M_node_count == 0 && begin() == end()
&& this->_M_impl._M_header._M_left == _M_end()
&& this->_M_impl._M_header._M_right == _M_end();
unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
for (const_iterator __it = begin(); __it != end(); ++__it)
{
_Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
_Const_Link_type __L = _S_left(__x);
_Const_Link_type __R = _S_right(__x);
if (__x->_M_color == _S_red)
if ((__L && __L->_M_color == _S_red)
|| (__R && __R->_M_color == _S_red))
return false;
if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
return false;
if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
return false;
if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
return false;
}
if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
return false;
if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
return false;
return true;
}
}
# 61 "/opt/local/include/gcc48/c++/map" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_map.h" 1 3
# 66 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 94 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class map
{
public:
typedef _Key key_type;
typedef _Tp mapped_type;
typedef std::pair<const _Key, _Tp> value_type;
typedef _Compare key_compare;
typedef _Alloc allocator_type;
private:
typedef typename _Alloc::value_type _Alloc_value_type;
public:
class value_compare
: public std::binary_function<value_type, value_type, bool>
{
friend class map<_Key, _Tp, _Compare, _Alloc>;
protected:
_Compare comp;
value_compare(_Compare __c)
: comp(__c) { }
public:
bool operator()(const value_type& __x, const value_type& __y) const
{ return comp(__x.first, __y.first); }
};
private:
typedef typename _Alloc::template rebind<value_type>::other
_Pair_alloc_type;
typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
key_compare, _Pair_alloc_type> _Rep_type;
_Rep_type _M_t;
public:
typedef typename _Pair_alloc_type::pointer pointer;
typedef typename _Pair_alloc_type::const_pointer const_pointer;
typedef typename _Pair_alloc_type::reference reference;
typedef typename _Pair_alloc_type::const_reference const_reference;
typedef typename _Rep_type::iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
map()
: _M_t() { }
explicit
map(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, _Pair_alloc_type(__a)) { }
# 180 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
map(const map& __x)
: _M_t(__x._M_t) { }
# 223 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
template<typename _InputIterator>
map(_InputIterator __first, _InputIterator __last)
: _M_t()
{ _M_t._M_insert_unique(__first, __last); }
# 240 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
template<typename _InputIterator>
map(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_unique(__first, __last); }
# 263 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
map&
operator=(const map& __x)
{
_M_t = __x._M_t;
return *this;
}
# 309 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
allocator_type
get_allocator() const
{ return allocator_type(_M_t.get_allocator()); }
iterator
begin()
{ return _M_t.begin(); }
const_iterator
begin() const
{ return _M_t.begin(); }
iterator
end()
{ return _M_t.end(); }
const_iterator
end() const
{ return _M_t.end(); }
reverse_iterator
rbegin()
{ return _M_t.rbegin(); }
const_reverse_iterator
rbegin() const
{ return _M_t.rbegin(); }
reverse_iterator
rend()
{ return _M_t.rend(); }
const_reverse_iterator
rend() const
{ return _M_t.rend(); }
# 428 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
bool
empty() const
{ return _M_t.empty(); }
size_type
size() const
{ return _M_t.size(); }
size_type
max_size() const
{ return _M_t.max_size(); }
# 455 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
mapped_type&
operator[](const key_type& __k)
{
iterator __i = lower_bound(__k);
if (__i == end() || key_comp()(__k, (*__i).first))
__i = insert(__i, value_type(__k, mapped_type()));
return (*__i).second;
}
# 500 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
mapped_type&
at(const key_type& __k)
{
iterator __i = lower_bound(__k);
if (__i == end() || key_comp()(__k, (*__i).first))
__throw_out_of_range(("map::at"));
return (*__i).second;
}
const mapped_type&
at(const key_type& __k) const
{
const_iterator __i = lower_bound(__k);
if (__i == end() || key_comp()(__k, (*__i).first))
__throw_out_of_range(("map::at"));
return (*__i).second;
}
# 593 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
std::pair<iterator, bool>
insert(const value_type& __x)
{ return _M_t._M_insert_unique(__x); }
# 642 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
iterator
insert(iterator __position, const value_type& __x)
{ return _M_t._M_insert_unique_(__position, __x); }
# 668 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
template<typename _InputIterator>
void
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_unique(__first, __last); }
# 709 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
void
erase(iterator __position)
{ _M_t.erase(__position); }
# 725 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
size_type
erase(const key_type& __x)
{ return _M_t.erase(__x); }
# 761 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
void
erase(iterator __first, iterator __last)
{ _M_t.erase(__first, __last); }
# 777 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
void
swap(map& __x)
{ _M_t.swap(__x._M_t); }
void
clear()
{ _M_t.clear(); }
key_compare
key_comp() const
{ return _M_t.key_comp(); }
value_compare
value_comp() const
{ return value_compare(_M_t.key_comp()); }
# 820 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
iterator
find(const key_type& __x)
{ return _M_t.find(__x); }
# 835 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
const_iterator
find(const key_type& __x) const
{ return _M_t.find(__x); }
# 847 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
size_type
count(const key_type& __x) const
{ return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
# 862 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
iterator
lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); }
# 877 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
const_iterator
lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); }
iterator
upper_bound(const key_type& __x)
{ return _M_t.upper_bound(__x); }
const_iterator
upper_bound(const key_type& __x) const
{ return _M_t.upper_bound(__x); }
# 916 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
std::pair<iterator, iterator>
equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); }
# 935 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
std::pair<const_iterator, const_iterator>
equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); }
template<typename _K1, typename _T1, typename _C1, typename _A1>
friend bool
operator==(const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
template<typename _K1, typename _T1, typename _C1, typename _A1>
friend bool
operator<(const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
};
# 960 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
const map<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __x._M_t == __y._M_t; }
# 977 "/opt/local/include/gcc48/c++/bits/stl_map.h" 3
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
const map<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __x._M_t < __y._M_t; }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
const map<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__x == __y); }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
const map<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __y < __x; }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
const map<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__y < __x); }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
const map<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__x < __y); }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline void
swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
map<_Key, _Tp, _Compare, _Alloc>& __y)
{ __x.swap(__y); }
}
# 62 "/opt/local/include/gcc48/c++/map" 2 3
# 1 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 1 3
# 64 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 92 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
template <typename _Key, typename _Tp,
typename _Compare = std::less<_Key>,
typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class multimap
{
public:
typedef _Key key_type;
typedef _Tp mapped_type;
typedef std::pair<const _Key, _Tp> value_type;
typedef _Compare key_compare;
typedef _Alloc allocator_type;
private:
typedef typename _Alloc::value_type _Alloc_value_type;
public:
class value_compare
: public std::binary_function<value_type, value_type, bool>
{
friend class multimap<_Key, _Tp, _Compare, _Alloc>;
protected:
_Compare comp;
value_compare(_Compare __c)
: comp(__c) { }
public:
bool operator()(const value_type& __x, const value_type& __y) const
{ return comp(__x.first, __y.first); }
};
private:
typedef typename _Alloc::template rebind<value_type>::other
_Pair_alloc_type;
typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
key_compare, _Pair_alloc_type> _Rep_type;
_Rep_type _M_t;
public:
typedef typename _Pair_alloc_type::pointer pointer;
typedef typename _Pair_alloc_type::const_pointer const_pointer;
typedef typename _Pair_alloc_type::reference reference;
typedef typename _Pair_alloc_type::const_reference const_reference;
typedef typename _Rep_type::iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
multimap()
: _M_t() { }
explicit
multimap(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, _Pair_alloc_type(__a)) { }
# 177 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
multimap(const multimap& __x)
: _M_t(__x._M_t) { }
# 218 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
template<typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last)
: _M_t()
{ _M_t._M_insert_equal(__first, __last); }
# 234 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
template<typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); }
# 257 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
multimap&
operator=(const multimap& __x)
{
_M_t = __x._M_t;
return *this;
}
# 303 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
allocator_type
get_allocator() const
{ return allocator_type(_M_t.get_allocator()); }
iterator
begin()
{ return _M_t.begin(); }
const_iterator
begin() const
{ return _M_t.begin(); }
iterator
end()
{ return _M_t.end(); }
const_iterator
end() const
{ return _M_t.end(); }
reverse_iterator
rbegin()
{ return _M_t.rbegin(); }
const_reverse_iterator
rbegin() const
{ return _M_t.rbegin(); }
reverse_iterator
rend()
{ return _M_t.rend(); }
const_reverse_iterator
rend() const
{ return _M_t.rend(); }
# 420 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
bool
empty() const
{ return _M_t.empty(); }
size_type
size() const
{ return _M_t.size(); }
size_type
max_size() const
{ return _M_t.max_size(); }
# 500 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
iterator
insert(const value_type& __x)
{ return _M_t._M_insert_equal(__x); }
# 533 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
iterator
insert(iterator __position, const value_type& __x)
{ return _M_t._M_insert_equal_(__position, __x); }
# 560 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
template<typename _InputIterator>
void
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_equal(__first, __last); }
# 614 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
void
erase(iterator __position)
{ _M_t.erase(__position); }
# 630 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
size_type
erase(const key_type& __x)
{ return _M_t.erase(__x); }
# 670 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
void
erase(iterator __first, iterator __last)
{ _M_t.erase(__first, __last); }
# 686 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
void
swap(multimap& __x)
{ _M_t.swap(__x._M_t); }
void
clear()
{ _M_t.clear(); }
key_compare
key_comp() const
{ return _M_t.key_comp(); }
value_compare
value_comp() const
{ return value_compare(_M_t.key_comp()); }
# 729 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
iterator
find(const key_type& __x)
{ return _M_t.find(__x); }
# 744 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
const_iterator
find(const key_type& __x) const
{ return _M_t.find(__x); }
size_type
count(const key_type& __x) const
{ return _M_t.count(__x); }
# 768 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
iterator
lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); }
# 783 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
const_iterator
lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); }
iterator
upper_bound(const key_type& __x)
{ return _M_t.upper_bound(__x); }
const_iterator
upper_bound(const key_type& __x) const
{ return _M_t.upper_bound(__x); }
# 820 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
std::pair<iterator, iterator>
equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); }
# 837 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
std::pair<const_iterator, const_iterator>
equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); }
template<typename _K1, typename _T1, typename _C1, typename _A1>
friend bool
operator==(const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&);
template<typename _K1, typename _T1, typename _C1, typename _A1>
friend bool
operator<(const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&);
};
# 862 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __x._M_t == __y._M_t; }
# 879 "/opt/local/include/gcc48/c++/bits/stl_multimap.h" 3
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __x._M_t < __y._M_t; }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__x == __y); }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return __y < __x; }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__y < __x); }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ return !(__x < __y); }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline void
swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
multimap<_Key, _Tp, _Compare, _Alloc>& __y)
{ __x.swap(__y); }
}
# 63 "/opt/local/include/gcc48/c++/map" 2 3
# 39 "mimedb.cpp" 2
# 1 "/usr/include/getopt.h" 1 3 4
# 54 "/usr/include/getopt.h" 3 4
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
extern "C" {
int getopt_long(int, char * const *, const char *,
const struct option *, int *);
int getopt_long_only(int, char * const *, const char *,
const struct option *, int *);
int getopt(int, char * const [], const char *) __asm("_" "getopt" );
extern char *optarg;
extern int optind, opterr, optopt;
extern int optreset;
}
# 44 "mimedb.cpp" 2
# 1 "/opt/local/include/libintl.h" 1 3
# 22 "/opt/local/include/libintl.h" 3
# 1 "/usr/include/xlocale.h" 1 3 4
# 33 "/usr/include/xlocale.h" 3 4
struct _xlocale;
typedef struct _xlocale * locale_t;
# 1 "/usr/include/_xlocale.h" 1 3 4
# 29 "/usr/include/_xlocale.h" 3 4
extern "C" {
int ___mb_cur_max(void);
int ___mb_cur_max_l(locale_t);
}
# 38 "/usr/include/xlocale.h" 2 3 4
# 65 "/usr/include/xlocale.h" 3 4
extern "C" {
extern const locale_t _c_locale;
locale_t duplocale(locale_t);
int freelocale(locale_t);
struct lconv * localeconv_l(locale_t);
locale_t newlocale(int, const char *, locale_t);
const char * querylocale(int, locale_t);
locale_t uselocale(locale_t);
}
# 1 "/usr/include/xlocale/_ctype.h" 1 3 4
# 34 "/usr/include/xlocale/_ctype.h" 3 4
extern "C" {
unsigned long ___runetype_l(__darwin_ct_rune_t, locale_t);
__darwin_ct_rune_t ___tolower_l(__darwin_ct_rune_t, locale_t);
__darwin_ct_rune_t ___toupper_l(__darwin_ct_rune_t, locale_t);
}
extern "C" {
int __maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t);
}
inline int
__istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l)
{
return !!(isascii(_c) ? (_DefaultRuneLocale.__runetype[_c] & _f)
: __maskrune_l(_c, _f, _l));
}
inline __darwin_ct_rune_t
__toupper_l(__darwin_ct_rune_t _c, locale_t _l)
{
return isascii(_c) ? _DefaultRuneLocale.__mapupper[_c]
: ___toupper_l(_c, _l);
}
inline __darwin_ct_rune_t
__tolower_l(__darwin_ct_rune_t _c, locale_t _l)
{
return isascii(_c) ? _DefaultRuneLocale.__maplower[_c]
: ___tolower_l(_c, _l);
}
inline int
__wcwidth_l(__darwin_ct_rune_t _c, locale_t _l)
{
unsigned int _x;
if (_c == 0)
return (0);
_x = (unsigned int)__maskrune_l(_c, 0xe0000000L|0x00040000L, _l);
if ((_x & 0xe0000000L) != 0)
return ((_x & 0xe0000000L) >> 30);
return ((_x & 0x00040000L) != 0 ? 1 : -1);
}
inline int
digittoint_l(int c, locale_t l)
{
return (__maskrune_l(c, 0x0F, l));
}
inline int
isalnum_l(int c, locale_t l)
{
return (__istype_l(c, 0x00000100L|0x00000400L, l));
}
inline int
isalpha_l(int c, locale_t l)
{
return (__istype_l(c, 0x00000100L, l));
}
inline int
isblank_l(int c, locale_t l)
{
return (__istype_l(c, 0x00020000L, l));
}
inline int
iscntrl_l(int c, locale_t l)
{
return (__istype_l(c, 0x00000200L, l));
}
inline int
isdigit_l(int c, locale_t l)
{
return (__istype_l(c, 0x00000400L, l));
}
inline int
isgraph_l(int c, locale_t l)
{
return (__istype_l(c, 0x00000800L, l));
}
inline int
ishexnumber_l(int c, locale_t l)
{
return (__istype_l(c, 0x00010000L, l));
}
inline int
isideogram_l(int c, locale_t l)
{
return (__istype_l(c, 0x00080000L, l));
}
inline int
islower_l(int c, locale_t l)
{
return (__istype_l(c, 0x00001000L, l));
}
inline int
isnumber_l(int c, locale_t l)
{
return (__istype_l(c, 0x00000400L, l));
}
inline int
isphonogram_l(int c, locale_t l)
{
return (__istype_l(c, 0x00200000L, l));
}
inline int
isprint_l(int c, locale_t l)
{
return (__istype_l(c, 0x00040000L, l));
}
inline int
ispunct_l(int c, locale_t l)
{
return (__istype_l(c, 0x00002000L, l));
}
inline int
isrune_l(int c, locale_t l)
{
return (__istype_l(c, 0xFFFFFFF0L, l));
}
inline int
isspace_l(int c, locale_t l)
{
return (__istype_l(c, 0x00004000L, l));
}
inline int
isspecial_l(int c, locale_t l)
{
return (__istype_l(c, 0x00100000L, l));
}
inline int
isupper_l(int c, locale_t l)
{
return (__istype_l(c, 0x00008000L, l));
}
inline int
isxdigit_l(int c, locale_t l)
{
return (__istype_l(c, 0x00010000L, l));
}
inline int
tolower_l(int c, locale_t l)
{
return (__tolower_l(c, l));
}
inline int
toupper_l(int c, locale_t l)
{
return (__toupper_l(c, l));
}
# 78 "/usr/include/xlocale.h" 2 3 4
# 1 "/usr/include/xlocale/__wctype.h" 1 3 4
# 30 "/usr/include/xlocale/__wctype.h" 3 4
inline int
iswalnum_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00000100L|0x00000400L, _l));
}
inline int
iswalpha_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00000100L, _l));
}
inline int
iswcntrl_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00000200L, _l));
}
inline int
iswctype_l(wint_t _wc, wctype_t _charclass, locale_t _l)
{
return (__istype_l(_wc, _charclass, _l));
}
inline int
iswdigit_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00000400L, _l));
}
inline int
iswgraph_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00000800L, _l));
}
inline int
iswlower_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00001000L, _l));
}
inline int
iswprint_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00040000L, _l));
}
inline int
iswpunct_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00002000L, _l));
}
inline int
iswspace_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00004000L, _l));
}
inline int
iswupper_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00008000L, _l));
}
inline int
iswxdigit_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00010000L, _l));
}
inline wint_t
towlower_l(wint_t _wc, locale_t _l)
{
return (__tolower_l(_wc, _l));
}
inline wint_t
towupper_l(wint_t _wc, locale_t _l)
{
return (__toupper_l(_wc, _l));
}
# 135 "/usr/include/xlocale/__wctype.h" 3 4
extern "C" {
wctype_t
wctype_l(const char *, locale_t);
}
# 81 "/usr/include/xlocale.h" 2 3 4
# 92 "/usr/include/xlocale.h" 3 4
# 1 "/usr/include/xlocale/_regex.h" 1 3 4
# 27 "/usr/include/xlocale/_regex.h" 3 4
extern "C" {
int regcomp_l(regex_t * , const char * , int,
locale_t )
;
int regncomp_l(regex_t * , const char * , size_t,
int, locale_t )
;
int regwcomp_l(regex_t * , const wchar_t * ,
int, locale_t )
;
int regwnexec_l(const regex_t * , const wchar_t * ,
size_t, size_t, regmatch_t __pmatch[ ], int,
locale_t )
;
}
# 93 "/usr/include/xlocale.h" 2 3 4
# 1 "/usr/include/xlocale/_stdio.h" 1 3 4
# 27 "/usr/include/xlocale/_stdio.h" 3 4
extern "C" {
int fprintf_l(FILE * , locale_t , const char * , ...)
__attribute__((__format__ (__printf__, 3, 4)));
int fscanf_l(FILE * , locale_t , const char * , ...)
__attribute__((__format__ (__scanf__, 3, 4)));
int printf_l(locale_t , const char * , ...)
__attribute__((__format__ (__printf__, 2, 3)));
int scanf_l(locale_t , const char * , ...)
__attribute__((__format__ (__scanf__, 2, 3)));
int sprintf_l(char * , locale_t , const char * , ...)
__attribute__((__format__ (__printf__, 3, 4)));
int sscanf_l(const char * , locale_t , const char * , ...)
__attribute__((__format__ (__scanf__, 3, 4)));
int vfprintf_l(FILE * , locale_t , const char * , va_list)
__attribute__((__format__ (__printf__, 3, 0)));
int vprintf_l(locale_t , const char * , va_list)
__attribute__((__format__ (__printf__, 2, 0)));
int vsprintf_l(char * , locale_t , const char * , va_list)
__attribute__((__format__ (__printf__, 3, 0)));
int snprintf_l(char * , size_t, locale_t , const char * , ...)
__attribute__((__format__ (__printf__, 4, 5)));
int vfscanf_l(FILE * , locale_t , const char * , va_list)
__attribute__((__format__ (__scanf__, 3, 0)));
int vscanf_l(locale_t , const char * , va_list)
__attribute__((__format__ (__scanf__, 2, 0)));
int vsnprintf_l(char * , size_t, locale_t , const char * , va_list)
__attribute__((__format__ (__printf__, 4, 0)));
int vsscanf_l(const char * , locale_t , const char * , va_list)
__attribute__((__format__ (__scanf__, 3, 0)));
int dprintf_l(int, locale_t , const char * , ...)
__attribute__((__format__ (__printf__, 3, 4))) ;
int vdprintf_l(int, locale_t , const char * , va_list)
__attribute__((__format__ (__printf__, 3, 0))) ;
int asprintf_l(char ** , locale_t , const char * , ...)
__attribute__((__format__ (__printf__, 3, 4)));
int vasprintf_l(char ** , locale_t , const char * , va_list)
__attribute__((__format__ (__printf__, 3, 0)));
}
# 96 "/usr/include/xlocale.h" 2 3 4
# 1 "/usr/include/xlocale/_stdlib.h" 1 3 4
# 27 "/usr/include/xlocale/_stdlib.h" 3 4
extern "C" {
double atof_l(const char *, locale_t);
int atoi_l(const char *, locale_t);
long atol_l(const char *, locale_t);
long long
atoll_l(const char *, locale_t);
int mblen_l(const char *, size_t, locale_t);
size_t mbstowcs_l(wchar_t * , const char * , size_t,
locale_t);
int mbtowc_l(wchar_t * , const char * , size_t,
locale_t);
double strtod_l(const char *, char **, locale_t) __asm("_" "strtod_l" );
float strtof_l(const char *, char **, locale_t) __asm("_" "strtof_l" );
long strtol_l(const char *, char **, int, locale_t);
long double
strtold_l(const char *, char **, locale_t);
long long
strtoll_l(const char *, char **, int, locale_t);
long long
strtoq_l(const char *, char **, int, locale_t);
unsigned long
strtoul_l(const char *, char **, int, locale_t);
unsigned long long
strtoull_l(const char *, char **, int, locale_t);
unsigned long long
strtouq_l(const char *, char **, int, locale_t);
size_t wcstombs_l(char * , const wchar_t * , size_t,
locale_t);
int wctomb_l(char *, wchar_t, locale_t);
}
# 99 "/usr/include/xlocale.h" 2 3 4
# 1 "/usr/include/xlocale/_string.h" 1 3 4
# 27 "/usr/include/xlocale/_string.h" 3 4
extern "C" {
int strcoll_l(const char *, const char *, locale_t);
size_t strxfrm_l(char *, const char *, size_t, locale_t);
int strcasecmp_l(const char *, const char *, locale_t);
char *strcasestr_l(const char *, const char *, locale_t);
int strncasecmp_l(const char *, const char *, size_t, locale_t);
}
# 102 "/usr/include/xlocale.h" 2 3 4
# 1 "/usr/include/xlocale/_time.h" 1 3 4
# 27 "/usr/include/xlocale/_time.h" 3 4
extern "C" {
size_t strftime_l(char * , size_t, const char * ,
const struct tm * , locale_t)
__asm("_" "strftime_l" ) __attribute__((__format__ (__strftime__, 3, 0)));
char *strptime_l(const char * , const char * ,
struct tm * , locale_t)
__asm("_" "strptime_l" ) __attribute__((__format__ (__strftime__, 2, 0)));
}
# 105 "/usr/include/xlocale.h" 2 3 4
# 1 "/usr/include/xlocale/_wchar.h" 1 3 4
# 28 "/usr/include/xlocale/_wchar.h" 3 4
extern "C" {
wint_t btowc_l(int, locale_t);
wint_t fgetwc_l(FILE *, locale_t);
wchar_t *fgetws_l(wchar_t * , int, FILE * , locale_t);
wint_t fputwc_l(wchar_t, FILE *, locale_t);
int fputws_l(const wchar_t * , FILE * , locale_t);
int fwprintf_l(FILE * , locale_t, const wchar_t * , ...);
int fwscanf_l(FILE * , locale_t, const wchar_t * , ...);
wint_t getwc_l(FILE *, locale_t);
wint_t getwchar_l(locale_t);
size_t mbrlen_l(const char * , size_t, mbstate_t * ,
locale_t);
size_t mbrtowc_l(wchar_t * , const char * , size_t,
mbstate_t * , locale_t);
int mbsinit_l(const mbstate_t *, locale_t);
size_t mbsrtowcs_l(wchar_t * , const char ** , size_t,
mbstate_t * , locale_t);
wint_t putwc_l(wchar_t, FILE *, locale_t);
wint_t putwchar_l(wchar_t, locale_t);
int swprintf_l(wchar_t * , size_t n, locale_t,
const wchar_t * , ...);
int swscanf_l(const wchar_t * , locale_t,
const wchar_t * , ...);
wint_t ungetwc_l(wint_t, FILE *, locale_t);
int vfwprintf_l(FILE * , locale_t, const wchar_t * ,
__darwin_va_list);
int vswprintf_l(wchar_t * , size_t n, locale_t,
const wchar_t * , __darwin_va_list);
int vwprintf_l(locale_t, const wchar_t * , __darwin_va_list);
size_t wcrtomb_l(char * , wchar_t, mbstate_t * ,
locale_t);
int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
size_t wcsftime_l(wchar_t * , size_t, const wchar_t * ,
const struct tm * , locale_t)
__asm("_" "wcsftime_l" );
size_t wcsrtombs_l(char * , const wchar_t ** , size_t,
mbstate_t * , locale_t);
double wcstod_l(const wchar_t * , wchar_t ** , locale_t);
long wcstol_l(const wchar_t * , wchar_t ** , int,
locale_t);
unsigned long
wcstoul_l(const wchar_t * , wchar_t ** , int,
locale_t);
int wcswidth_l(const wchar_t *, size_t, locale_t);
size_t wcsxfrm_l(wchar_t * , const wchar_t * , size_t,
locale_t);
int wctob_l(wint_t, locale_t);
int wcwidth_l(wchar_t, locale_t);
int wprintf_l(locale_t, const wchar_t * , ...);
int wscanf_l(locale_t, const wchar_t * , ...);
}
# 87 "/usr/include/xlocale/_wchar.h" 3 4
extern "C" {
int vfwscanf_l(FILE * , locale_t, const wchar_t * ,
__darwin_va_list);
int vswscanf_l(const wchar_t * , locale_t,
const wchar_t * , __darwin_va_list);
int vwscanf_l(locale_t, const wchar_t * , __darwin_va_list);
float wcstof_l(const wchar_t * , wchar_t ** , locale_t);
long double
wcstold_l(const wchar_t * , wchar_t ** , locale_t);
long long
wcstoll_l(const wchar_t * , wchar_t ** , int,
locale_t);
unsigned long long
wcstoull_l(const wchar_t * , wchar_t ** , int,
locale_t);
}
# 114 "/usr/include/xlocale/_wchar.h" 3 4
extern "C" {
size_t mbsnrtowcs_l(wchar_t * , const char ** , size_t,
size_t, mbstate_t * , locale_t);
int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) ;
int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) ;
size_t wcsnrtombs_l(char * , const wchar_t ** , size_t,
size_t, mbstate_t * , locale_t);
}
extern "C" {
wchar_t *fgetwln_l(FILE * , size_t *, locale_t) ;
}
# 108 "/usr/include/xlocale.h" 2 3 4
# 23 "/opt/local/include/libintl.h" 2 3
# 52 "/opt/local/include/libintl.h" 3
extern "C" {
extern int libintl_version;
# 134 "/opt/local/include/libintl.h" 3
extern char *gettext (const char *__msgid)
__asm__ ("_" "libintl_gettext")
__attribute__ ((__format_arg__ (1)));
# 152 "/opt/local/include/libintl.h" 3
extern char *dgettext (const char *__domainname, const char *__msgid)
__asm__ ("_" "libintl_dgettext")
__attribute__ ((__format_arg__ (2)));
# 172 "/opt/local/include/libintl.h" 3
extern char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
__asm__ ("_" "libintl_dcgettext")
__attribute__ ((__format_arg__ (2)));
# 194 "/opt/local/include/libintl.h" 3
extern char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
__asm__ ("_" "libintl_ngettext")
__attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));
# 215 "/opt/local/include/libintl.h" 3
extern char *dngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n)
__asm__ ("_" "libintl_dngettext")
__attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));
# 239 "/opt/local/include/libintl.h" 3
extern char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
__asm__ ("_" "libintl_dcngettext")
__attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));
# 261 "/opt/local/include/libintl.h" 3
extern char *textdomain (const char *__domainname)
__asm__ ("_" "libintl_textdomain");
# 279 "/opt/local/include/libintl.h" 3
extern char *bindtextdomain (const char *__domainname, const char *__dirname)
__asm__ ("_" "libintl_bindtextdomain");
# 297 "/opt/local/include/libintl.h" 3
extern char *bind_textdomain_codeset (const char *__domainname,
const char *__codeset)
__asm__ ("_" "libintl_bind_textdomain_codeset");
# 433 "/opt/local/include/libintl.h" 3
extern char *libintl_setlocale (int, const char *);
extern locale_t libintl_newlocale (int, const char *, locale_t);
# 455 "/opt/local/include/libintl.h" 3
extern void
libintl_set_relocation_prefix (const char *orig_prefix,
const char *curr_prefix);
}
# 48 "mimedb.cpp" 2
# 1 "xdgmime.h" 1
# 35 "xdgmime.h"
extern "C" {
# 44 "xdgmime.h"
typedef void (*XdgMimeCallback)(void *user_data);
typedef void (*XdgMimeDestroy)(void *user_data);
# 65 "xdgmime.h"
extern const char *xdg_mime_type_unknown;
const char *xdg_mime_get_mime_type_for_data(const void *data,
size_t len);
const char *xdg_mime_get_mime_type_for_file(const char *file_name);
const char *xdg_mime_get_mime_type_from_file_name(const char *file_name);
int xdg_mime_is_valid_mime_type(const char *mime_type);
int xdg_mime_mime_type_equal(const char *mime_a,
const char *mime_b);
int xdg_mime_media_type_equal(const char *mime_a,
const char *mime_b);
int xdg_mime_mime_type_subclass(const char *mime_a,
const char *mime_b);
const char **xdg_mime_get_mime_parents(const char *mime);
const char *xdg_mime_unalias_mime_type(const char *mime);
int xdg_mime_get_max_buffer_extents(void);
void xdg_mime_shutdown(void);
void xdg_mime_dump(void);
int xdg_mime_register_reload_callback(XdgMimeCallback callback,
void *data,
XdgMimeDestroy destroy);
void xdg_mime_remove_callback(int callback_id);
}
# 51 "mimedb.cpp" 2
# 1 "fallback.h" 1
# 1 "/usr/include/wctype.h" 1 3 4
# 36 "/usr/include/wctype.h" 3 4
# 1 "/usr/include/_types/_wctrans_t.h" 1 3 4
# 31 "/usr/include/_types/_wctrans_t.h" 3 4
typedef __darwin_wctrans_t wctrans_t;
# 37 "/usr/include/wctype.h" 2 3 4
# 49 "/usr/include/wctype.h" 3 4
inline int
iswblank(wint_t _wc)
{
return (__istype(_wc, 0x00020000L));
}
inline int
iswascii(wint_t _wc)
{
return ((_wc & ~0x7F) == 0);
}
inline int
iswhexnumber(wint_t _wc)
{
return (__istype(_wc, 0x00010000L));
}
inline int
iswideogram(wint_t _wc)
{
return (__istype(_wc, 0x00080000L));
}
inline int
iswnumber(wint_t _wc)
{
return (__istype(_wc, 0x00000400L));
}
inline int
iswphonogram(wint_t _wc)
{
return (__istype(_wc, 0x00200000L));
}
inline int
iswrune(wint_t _wc)
{
return (__istype(_wc, 0xFFFFFFF0L));
}
inline int
iswspecial(wint_t _wc)
{
return (__istype(_wc, 0x00100000L));
}
# 117 "/usr/include/wctype.h" 3 4
extern "C" {
wint_t nextwctype(wint_t, wctype_t);
wint_t towctrans(wint_t, wctrans_t);
wctrans_t
wctrans(const char *);
}
# 1 "/usr/include/xlocale/_wctype.h" 1 3 4
# 30 "/usr/include/xlocale/_wctype.h" 3 4
inline int
iswblank_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00020000L, _l));
}
inline int
iswhexnumber_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00010000L, _l));
}
inline int
iswideogram_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00080000L, _l));
}
inline int
iswnumber_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00000400L, _l));
}
inline int
iswphonogram_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00200000L, _l));
}
inline int
iswrune_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0xFFFFFFF0L, _l));
}
inline int
iswspecial_l(wint_t _wc, locale_t _l)
{
return (__istype_l(_wc, 0x00100000L, _l));
}
# 86 "/usr/include/xlocale/_wctype.h" 3 4
extern "C" {
wint_t nextwctype_l(wint_t, wctype_t, locale_t);
wint_t towctrans_l(wint_t, wctrans_t, locale_t);
wctrans_t
wctrans_l(const char *, locale_t);
}
# 128 "/usr/include/wctype.h" 2 3 4
# 9 "fallback.h" 2
# 1 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/limits.h" 1 3 4
# 34 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/limits.h" 3 4
# 1 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/syslimits.h" 1 3 4
# 1 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/limits.h" 1 3 4
# 168 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 64 "/usr/include/limits.h" 3 4
# 1 "/usr/include/machine/limits.h" 1 3 4
# 1 "/usr/include/i386/limits.h" 1 3 4
# 40 "/usr/include/i386/limits.h" 3 4
# 1 "/usr/include/i386/_limits.h" 1 3 4
# 41 "/usr/include/i386/limits.h" 2 3 4
# 7 "/usr/include/machine/limits.h" 2 3 4
# 65 "/usr/include/limits.h" 2 3 4
# 1 "/usr/include/sys/syslimits.h" 1 3 4
# 66 "/usr/include/limits.h" 2 3 4
# 169 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/limits.h" 2 3 4
# 8 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/syslimits.h" 2 3 4
# 35 "/opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/limits.h" 2 3 4
# 11 "fallback.h" 2
# 1 "/usr/include/sys/time.h" 1 3 4
# 86 "/usr/include/sys/time.h" 3 4
struct itimerval {
struct timeval it_interval;
struct timeval it_value;
};
# 124 "/usr/include/sys/time.h" 3 4
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
# 167 "/usr/include/sys/time.h" 3 4
struct clockinfo {
int hz;
int tick;
int tickadj;
int stathz;
int profhz;
};
extern "C" {
int adjtime(const struct timeval *, struct timeval *);
int futimes(int, const struct timeval *);
int lutimes(const char *, const struct timeval *) ;
int settimeofday(const struct timeval *, const struct timezone *);
int getitimer(int, struct itimerval *);
int gettimeofday(struct timeval * , void * );
int setitimer(int, const struct itimerval * ,
struct itimerval * );
int utimes(const char *, const struct timeval *);
}
# 12 "fallback.h" 2
# 1 "/usr/include/signal.h" 1 3 4
# 67 "/usr/include/signal.h" 3 4
extern const char *const sys_signame[32];
extern const char *const sys_siglist[32];
extern "C" {
int raise(int);
}
extern "C" {
void (*bsd_signal(int, void (*)(int)))(int);
int kill(pid_t, int) __asm("_" "kill" );
int killpg(pid_t, int) __asm("_" "killpg" );
int pthread_kill(pthread_t, int);
int pthread_sigmask(int, const sigset_t *, sigset_t *) __asm("_" "pthread_sigmask" );
int sigaction(int, const struct sigaction * ,
struct sigaction * );
int sigaddset(sigset_t *, int);
int sigaltstack(const stack_t * , stack_t * ) __asm("_" "sigaltstack" );
int sigdelset(sigset_t *, int);
int sigemptyset(sigset_t *);
int sigfillset(sigset_t *);
int sighold(int);
int sigignore(int);
int siginterrupt(int, int);
int sigismember(const sigset_t *, int);
int sigpause(int) __asm("_" "sigpause" );
int sigpending(sigset_t *);
int sigprocmask(int, const sigset_t * , sigset_t * );
int sigrelse(int);
void (*sigset(int, void (*)(int)))(int);
int sigsuspend(const sigset_t *) __asm("_" "sigsuspend" );
int sigwait(const sigset_t * , int * ) __asm("_" "sigwait" );
void psignal(unsigned int, const char *);
int sigblock(int);
int sigsetmask(int);
int sigvec(int, struct sigvec *, struct sigvec *);
}
inline __attribute__ ((__always_inline__)) int
__sigbits(int __signo)
{
return __signo > 32 ? 0 : (1 << (__signo - 1));
}
# 14 "fallback.h" 2
int fish_wcwidth(wchar_t wc);
int fish_wcswidth(const wchar_t *str, size_t n);
# 49 "fallback.h"
typedef char tputs_arg_t;
# 218 "fallback.h"
wchar_t *wcsdup_use_weak(const wchar_t *);
int wcscasecmp_use_weak(const wchar_t *, const wchar_t *);
int wcsncasecmp_use_weak(const wchar_t *s1, const wchar_t *s2, size_t n);
# 295 "fallback.h"
wchar_t *wcsndup(const wchar_t *in, size_t c);
# 304 "fallback.h"
long convert_digit(wchar_t d, int base);
# 365 "fallback.h"
struct drand48_data
{
unsigned int seed;
}
;
int lrand48_r(struct drand48_data *buffer, long int *result);
int srand48_r(long int seedval, struct drand48_data *buffer);
# 395 "fallback.h"
char * fish_gettext(const char * msgid);
char * fish_bindtextdomain(const char * domainname, const char * dirname);
char * fish_textdomain(const char * domainname);
char * fish_dcgettext(const char * domainname, const char * msgid, int category);
# 413 "fallback.h"
extern int _nl_msg_cat_cntr;
# 52 "mimedb.cpp" 2
# 1 "util.h" 1
# 15 "util.h"
template<typename T>
static inline T maxi(T a, T b)
{
return a>b?a:b;
}
template<typename T>
static inline T mini(T a, T b)
{
return a<b?a:b;
}
# 64 "util.h"
int wcsfilecmp(const wchar_t *a, const wchar_t *b);
long long get_time();
# 53 "mimedb.cpp" 2
# 1 "print_help.h" 1
# 13 "print_help.h"
void print_help(const char *cmd, int fd);
# 54 "mimedb.cpp" 2
typedef std::vector<std::string> string_list_t;
# 116 "mimedb.cpp"
enum
{
FILEDATA,
FILENAME,
MIMETYPE,
DESCRIPTION,
ACTION,
LAUNCH
}
;
static regex_t *start_re=0;
static regex_t *stop_re=0;
static int error = 0;
static char *launch_buff=0;
static int launch_len=0;
static int launch_pos=0;
# 167 "mimedb.cpp"
void *my_malloc(size_t s)
{
void *res = malloc(s);
if (!s)
{
error=1;
fprintf(__stderrp, fish_gettext("%s: Out of memory\n"), "mimedb");
}
return res;
}
char *my_strdup(const char *s)
{
char *res = strdup(s);
if (!s)
{
error=1;
fprintf(__stderrp, fish_gettext("%s: Out of memory\n"), "mimedb");
}
return res;
}
static const char * search_ini(const char *filename, const char *match)
{
FILE *f = fopen(filename, "r");
char buf[4096];
int len=strlen(match);
int done = 0;
if (!f)
{
perror("fopen");
error=1;
return 0;
}
while (!done)
{
if (!fgets(buf, 4096, f))
{
if (!feof(f))
{
perror("fgets");
error=1;
}
buf[0]=0;
done = 1;
}
else if (strncmp(buf, match, len) == 0 && buf[len] == '=')
{
done=1;
}
}
fclose(f);
if (buf[0])
{
char *res=strdup(buf);
if (res)
{
if (res[strlen(res)-1]=='\n')
res[strlen(res)-1]='\0';
}
return res;
}
else
return (char *)0;
}
static char *file_exists(const char *dir, const char *in)
{
int dir_len = strlen(dir);
int need_sep = dir[dir_len - 1] != '/';
char *filename = (char *)my_malloc(dir_len + need_sep + strlen(in) + 1);
char *replaceme;
struct stat buf;
if (!filename)
{
return 0;
}
strcpy(filename, dir);
if (need_sep)
filename[dir_len++] = '/';
strcpy(filename + dir_len, in);
if (!stat(filename, &buf))
return filename;
free(filename);
replaceme = const_cast<char*>(strchr(in, '-'));
if (replaceme)
{
char *res;
*replaceme = '/';
res = file_exists(dir, in);
*replaceme = '-';
return res;
}
return 0;
}
# 304 "mimedb.cpp"
static int append_filenames(string_list_t &list, const char *f, int all)
{
size_t prev_count = list.size();
char *result;
const char *xdg_data_home;
const char *xdg_data_dirs;
const char *ptr;
xdg_data_home = getenv("XDG_DATA_HOME");
if (xdg_data_home)
{
result = file_exists(xdg_data_home, f);
if (result)
{
list.push_back(result);
if (!all)
return 1;
}
}
else
{
const char *home;
home = getenv("HOME");
if (home != __null)
{
char *guessed_xdg_home;
guessed_xdg_home = (char *)my_malloc(strlen(home) + strlen("/.local/share") + 1);
if (!guessed_xdg_home)
return 0;
strcpy(guessed_xdg_home, home);
strcat(guessed_xdg_home, "/.local/share");
result = file_exists(guessed_xdg_home, f);
free(guessed_xdg_home);
if (result)
{
list.push_back(result);
if (!all)
return 1;
}
}
}
xdg_data_dirs = getenv("XDG_DATA_DIRS");
if (xdg_data_dirs == __null)
xdg_data_dirs = "/usr/local/share:/usr/share";
ptr = xdg_data_dirs;
while (*ptr != '\000')
{
const char *end_ptr;
char *dir;
int len;
end_ptr = ptr;
while (*end_ptr != ':' && *end_ptr != '\000')
end_ptr ++;
if (end_ptr == ptr)
{
ptr++;
continue;
}
len = end_ptr - ptr;
dir = (char *)my_malloc(len + 1);
if (!dir)
return 0;
strncpy(dir, ptr, len);
dir[len] = '\0';
result = file_exists(dir, f);
free(dir);
if (result)
{
list.push_back(result);
if (!all)
{
return 1;
}
}
ptr = end_ptr;
}
return list.size() - prev_count;
}
static std::string get_filename(char *f)
{
string_list_t list;
append_filenames(list, f, 0);
if (list.empty())
{
return "";
}
else
{
return list.back();
}
}
static char *munge(char *in)
{
char *out = (char *)my_malloc(strlen(in)+1);
char *p=out;
int had_whitespace = 0;
int printed = 0;
if (!out)
{
return 0;
}
while (1)
{
switch (*in)
{
case ' ':
case '\n':
case '\t':
case '\r':
{
had_whitespace = 1;
break;
}
case '\0':
*p = '\0';
return out;
default:
{
if (printed && had_whitespace)
{
*(p++)=' ';
}
printed=1;
had_whitespace=0;
*(p++)=*in;
break;
}
}
in++;
}
fprintf(__stderrp, fish_gettext("%s: Unknown error in munge()\n"), "mimedb");
error=1;
return 0;
}
static char *get_lang_re()
{
static char buff[1024];
const char *lang = libintl_setlocale(6, 0);
int close=0;
char *out=buff;
if ((1+strlen(lang)*4) >= 1024)
{
fprintf(__stderrp, fish_gettext("%s: Locale string too long\n"), "mimedb");
error = 1;
return 0;
}
for (; *lang; lang++)
{
switch (*lang)
{
case '@':
case '.':
case '_':
if (close)
{
*out++ = ')';
*out++ = '?';
}
close=1;
*out++ = '(';
*out++ = *lang;
break;
default:
*out++ = *lang;
}
}
if (close)
{
*out++ = ')';
*out++ = '?';
}
*out++=0;
return buff;
}
static char *get_description(const char *mimetype)
{
char *fn_part;
std::string fn;
int fd;
struct stat st;
char *contents;
char *start=0, *stop=0, *best_start=0;
if (!start_re)
{
char *lang;
char buff[1024];
lang = get_lang_re();
if (!lang)
return 0;
snprintf(buff, 1024, "<comment( +xml:lang *= *(\"%s\"|'%s'))? *>", lang, lang);
start_re = (regex_t *)my_malloc(sizeof(regex_t));
stop_re = (regex_t *)my_malloc(sizeof(regex_t));
int reg_status;
if ((reg_status = regcomp(start_re, buff, 0001)))
{
char regerrbuf[1024];
regerror(reg_status, start_re, regerrbuf, 1024);
fprintf(__stderrp, fish_gettext("%s: Could not compile regular expressions %s with error %s\n"), "mimedb", buff, regerrbuf);
error=1;
}
else if ((reg_status = regcomp(stop_re, "</comment *>", 0001)))
{
char regerrbuf[1024];
regerror(reg_status, stop_re, regerrbuf, 1024);
fprintf(__stderrp, fish_gettext("%s: Could not compile regular expressions %s with error %s\n"), "mimedb", buff, regerrbuf);
error=1;
}
if (error)
{
free(start_re);
free(stop_re);
start_re = stop_re = 0;
return 0;
}
}
fn_part = (char *)my_malloc(strlen("mime/") + strlen(mimetype) + strlen(".xml") + 1);
if (!fn_part)
{
return 0;
}
strcpy(fn_part, "mime/");
strcat(fn_part, mimetype);
strcat(fn_part, ".xml");
fn = get_filename(fn_part);
free(fn_part);
if (fn.empty())
{
return 0;
}
fd = open(fn.c_str(), 0x0000);
if (fd == -1)
{
perror("open");
error=1;
return 0;
}
if (stat(fn.c_str(), &st))
{
perror("stat");
error=1;
return 0;
}
contents = (char *)my_malloc(st.st_size + 1);
if (!contents)
{
return 0;
}
if (read(fd, contents, st.st_size) != st.st_size)
{
perror("read");
error=1;
free((void *)contents);
return 0;
}
close(fd);
contents[st.st_size]=0;
regmatch_t match[1];
int w = -1;
start=contents;
while (!regexec(start_re, start, 1, match, 0))
{
int new_w = match[0].rm_eo - match[0].rm_so;
start += match[0].rm_eo;
if (new_w > w)
{
w=new_w;
best_start = start;
}
}
if (w != -1)
{
start = best_start;
if (!regexec(stop_re, start, 1, match, 0))
{
char *res;
stop = start + match[0].rm_so;
*stop = '\0';
res = munge(start);
free(contents);
return res;
}
}
free(contents);
fprintf(__stderrp, fish_gettext("%s: No description for type %s\n"), "mimedb", mimetype);
error=1;
return 0;
}
static char *get_action(const char *mimetype)
{
char *res=0;
const char *launcher, *end;
string_list_t mime_filenames;
const char *launcher_str = __null;
const char *launcher_command_str, *launcher_command;
char *launcher_full;
if (!append_filenames(mime_filenames, "applications/defaults.list", 1))
{
return 0;
}
for (size_t i = 0; i < mime_filenames.size(); i++)
{
launcher_str = search_ini(mime_filenames.at(i).c_str(), mimetype);
if (launcher_str)
break;
}
if (!launcher_str)
{
const char ** parents = xdg_mime_get_mime_parents(mimetype);
const char **p;
if (parents)
{
for (p=parents; *p; p++)
{
char *a = get_action(*p);
if (a != 0)
return a;
}
}
if (strncmp(mimetype, "text/plain", 10) != 0 && strncmp(mimetype, "text/", 5) == 0)
return get_action("text/plain");
return 0;
}
launcher = const_cast<char*>(strchr(launcher_str, '='));
if (!launcher)
{
fprintf(__stderrp, fish_gettext("%s: Could not parse launcher string '%s'\n"), "mimedb", launcher_str);
error=1;
return 0;
}
launcher++;
std::string mut_launcher = launcher;
end = strchr(launcher, ';');
if (end)
mut_launcher.resize(end - launcher);
launcher_full = (char *)my_malloc(mut_launcher.size() + strlen("applications/")+1);
if (!launcher_full)
{
free((void *)launcher_str);
return 0;
}
strcpy(launcher_full, "applications/");
strcat(launcher_full, mut_launcher.c_str());
free((void *)launcher_str);
std::string launcher_filename = get_filename(launcher_full);
free(launcher_full);
launcher_command_str = search_ini(launcher_filename.c_str(), "Exec");
if (!launcher_command_str)
{
fprintf(__stderrp,
fish_gettext("%s: Default launcher '%s' does not specify how to start\n"), "mimedb",
launcher_filename.c_str());
return 0;
}
launcher_command = strchr(launcher_command_str, '=');
launcher_command++;
res = my_strdup(launcher_command);
free((void *)launcher_command_str);
return res;
}
static void writer(char c)
{
if (launch_len == -1)
return;
if (launch_len <= launch_pos)
{
int new_len = launch_len?2*launch_len:256;
char *new_buff = (char *)realloc(launch_buff, new_len);
if (!new_buff)
{
free(launch_buff);
launch_len = -1;
error=1;
return;
}
launch_buff = new_buff;
launch_len = new_len;
}
launch_buff[launch_pos++]=c;
}
static void writer_hex(int num)
{
int a, b;
a = num /16;
b = num %16;
writer(a>9?('A'+a-10):('0'+a));
writer(b>9?('A'+b-10):('0'+b));
}
static char *my_getcwd()
{
size_t size = 100;
while (1)
{
char *buffer = (char *) malloc(size);
if (getcwd(buffer, size) == buffer)
return buffer;
free(buffer);
if ((*__error()) != 34)
return 0;
size *= 2;
}
}
static const char *get_fullfile(const char *file)
{
const char *fullfile;
if (file[0] == '/')
{
fullfile = file;
}
else
{
char *cwd = my_getcwd();
if (!cwd)
{
error = 1;
perror("getcwd");
return 0;
}
int l = strlen(cwd);
char *tmp = (char *)my_malloc(l + strlen(file)+2);
if (!tmp)
{
free(cwd);
return 0;
}
strcpy(tmp, cwd);
if (cwd[l-1] != '/')
strcat(tmp, "/");
strcat(tmp, file);
free(cwd);
fullfile = tmp;
}
return fullfile;
}
static void write_url(const char *file)
{
const char *fullfile = get_fullfile(file);
const char *str = fullfile;
if (str == 0)
{
launch_len = -1;
return;
}
writer('f');
writer('i');
writer('l');
writer('e');
writer(':');
writer('/');
writer('/');
while (*str)
{
if (((*str >= 'a') && (*str <='z')) ||
((*str >= 'A') && (*str <='Z')) ||
((*str >= '0') && (*str <='9')) ||
(strchr("-_.~/",*str) != 0))
{
writer(*str);
}
else if (strchr("()?&=",*str) != 0)
{
writer('\\');
writer(*str);
}
else
{
writer('%');
writer_hex((unsigned char)*str);
}
str++;
}
if (fullfile != file)
free((void *)fullfile);
}
static void write_file(const char *file, int print_path)
{
const char *fullfile;
const char *str;
if (print_path)
{
fullfile = get_fullfile(file);
str = fullfile;
}
else
{
char *tmp = my_strdup(file);
if (!tmp)
{
return;
}
str = basename(tmp);
fullfile = tmp;
}
if (!str)
{
error = 1;
return;
}
while (*str)
{
switch (*str)
{
case ')':
case '(':
case '-':
case '#':
case '$':
case '}':
case '{':
case ']':
case '[':
case '*':
case '?':
case ' ':
case '|':
case '<':
case '>':
case '^':
case '&':
case '\\':
case '`':
case '\'':
case '\"':
writer('\\');
writer(*str);
break;
case '\n':
writer('\\');
writer('n');
break;
case '\r':
writer('\\');
writer('r');
break;
case '\t':
writer('\\');
writer('t');
break;
case '\b':
writer('\\');
writer('b');
break;
case '\v':
writer('\\');
writer('v');
break;
default:
writer(*str);
break;
}
str++;
}
if (fullfile != file)
free((void *)fullfile);
}
# 1040 "mimedb.cpp"
static void launch(char *filter, const string_list_t &files, size_t fileno)
{
char *filter_org=filter;
int count=0;
int launch_again=0;
if (files.size() <= fileno)
return;
launch_pos=0;
for (; *filter && !error; filter++)
{
if (*filter == '%')
{
filter++;
switch (*filter)
{
case 'u':
{
launch_again = 1;
write_url(files.at(fileno).c_str());
break;
}
case 'U':
{
for (size_t i=0; i<files.size(); i++)
{
if (i != 0)
writer(' ');
write_url(files.at(i).c_str());
if (error)
break;
}
break;
}
case 'f':
case 'n':
{
launch_again = 1;
write_file(files.at(fileno).c_str(), *filter == 'f');
break;
}
case 'F':
case 'N':
{
for (size_t i=0; i<files.size(); i++)
{
if (i != 0)
writer(' ');
write_file(files.at(i).c_str(), *filter == 'F');
if (error)
break;
}
break;
}
case 'd':
{
const char *cpy = get_fullfile(files.at(fileno).c_str());
char *dir;
launch_again=1;
if (cpy == files.at(fileno).c_str())
cpy = my_strdup(cpy);
if (cpy == 0)
{
break;
}
dir=dirname((char *)cpy);
write_file(dir, 1);
free((void *)cpy);
break;
}
case 'D':
{
for (size_t i=0; i<files.size(); i++)
{
const char *cpy = get_fullfile(files.at(i).c_str());
char *dir;
if (cpy == files.at(i).c_str())
cpy = my_strdup(cpy);
if (cpy == 0)
{
break;
}
dir=dirname((char *)cpy);
if (i != 0)
writer(' ');
write_file(dir, 1);
free((void *)cpy);
}
break;
}
default:
fprintf(__stderrp, fish_gettext("%s: Unsupported switch '%c' in launch string '%s'\n"), "mimedb", *filter, filter_org);
launch_len=0;
break;
}
}
else
{
writer(*filter);
count++;
}
}
if (error)
return;
switch (launch_len)
{
case -1:
{
launch_len = 0;
fprintf(__stderrp, fish_gettext("%s: Out of memory\n"), "mimedb");
return;
}
case 0:
{
return;
}
default:
{
writer(' ');
writer('&');
writer('\0');
if (system(launch_buff) == -1)
{
fprintf(__stderrp, fish_gettext("%s: Could not execute command \"%s\"\n"), "mimedb", launch_buff);
exit(1);
}
break;
}
}
if (launch_again)
{
launch(filter_org, files, fileno+1);
}
}
static void locale_init()
{
libintl_setlocale(0, "");
fish_bindtextdomain("fish", "/usr/local/share/locale");
fish_textdomain("fish");
}
int main(int argc, char *argv[])
{
int input_type=FILEDATA;
int output_type=MIMETYPE;
const char *mimetype;
char *output=0;
int i;
typedef std::map<std::string, string_list_t> launch_hash_t;
launch_hash_t launch_hash;
locale_init();
while (1)
{
static struct option
long_options[] =
{
{
"input-file-data", 0, 0, 't'
}
,
{
"input-filename", 0, 0, 'f'
}
,
{
"input-mime", 0, 0, 'i'
}
,
{
"output-mime", 0, 0, 'm'
}
,
{
"output-description", 0, 0, 'd'
}
,
{
"output-action", 0, 0, 'a'
}
,
{
"help", 0, 0, 'h'
}
,
{
"version", 0, 0, 'v'
}
,
{
"launch", 0, 0, 'l'
}
,
{
0, 0, 0, 0
}
}
;
int opt_index = 0;
int opt = getopt_long(argc,
argv,
"tfimdalhv",
long_options,
&opt_index);
if (opt == -1)
break;
switch (opt)
{
case 0:
break;
case 't':
input_type=FILEDATA;
break;
case 'f':
input_type=FILENAME;
break;
case 'i':
input_type=MIMETYPE;
break;
case 'm':
output_type=MIMETYPE;
break;
case 'd':
output_type=DESCRIPTION;
break;
case 'a':
output_type=ACTION;
break;
case 'l':
output_type=LAUNCH;
break;
case 'h':
print_help(argv[0], 1);
exit(0);
case 'v':
printf(fish_gettext("%s, version %s\n"), "mimedb", "2.0.GIT");
exit(0);
case '?':
return 1;
}
}
if ((output_type == LAUNCH)&&(input_type==MIMETYPE))
{
fprintf(__stderrp, fish_gettext("%s: Can not launch a mimetype\n"), "mimedb");
print_help(argv[0], 2);
exit(1);
}
for (i = optind; (i < argc)&&(!error); i++)
{
if (input_type == FILENAME)
{
mimetype = xdg_mime_get_mime_type_from_file_name(argv[i]);
}
else if (input_type == FILEDATA)
{
mimetype = xdg_mime_get_mime_type_for_file(argv[i]);
}
else
mimetype = xdg_mime_is_valid_mime_type(argv[i])?argv[i]:0;
mimetype = xdg_mime_unalias_mime_type(mimetype);
if (!mimetype)
{
fprintf(__stderrp, fish_gettext("%s: Could not parse mimetype from argument '%s'\n"), "mimedb", argv[i]);
error=1;
return 1;
}
switch (output_type)
{
case MIMETYPE:
{
output = (char *)mimetype;
break;
}
case DESCRIPTION:
{
output = get_description(mimetype);
if (!output)
output = strdup(fish_gettext("Unknown"));
break;
}
case ACTION:
{
output = get_action(mimetype);
break;
}
case LAUNCH:
{
output = 0;
string_list_t &l = launch_hash[mimetype];
l.push_back(argv[i]);
}
}
if (output)
{
printf("%s\n", output);
if (output != mimetype)
free(output);
}
output = 0;
}
if (output_type == LAUNCH && !error)
{
for (launch_hash_t::iterator iter = launch_hash.begin(); iter != launch_hash.end(); ++iter)
{
const char *mimetype = iter->first.c_str();
string_list_t &files = iter->second;
char *launcher = get_action(mimetype);
if (launcher)
{
launch(launcher, files, 0);
free(launcher);
}
}
}
if (launch_buff)
free(launch_buff);
if (start_re)
{
regfree(start_re);
regfree(stop_re);
free(start_re);
free(stop_re);
}
xdg_mime_shutdown();
return error;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment