# 1 "Objects/unicodeobject.c" # 1 "/packages/python-2.5//" # 1 "" # 1 "" # 1 "Objects/unicodeobject.c" # 43 "Objects/unicodeobject.c" # 1 "Include/Python.h" 1 # 1 "Include/patchlevel.h" 1 # 8 "Include/Python.h" 2 # 1 "./pyconfig.h" 1 # 9 "Include/Python.h" 2 # 18 "Include/Python.h" # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/limits.h" 1 3 4 # 11 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/limits.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/syslimits.h" 1 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/limits.h" 1 3 4 # 122 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/limits.h" 3 4 # 1 "/usr/include/limits.h" 1 3 4 # 27 "/usr/include/limits.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 330 "/usr/include/features.h" 3 4 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 348 "/usr/include/sys/cdefs.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 349 "/usr/include/sys/cdefs.h" 2 3 4 # 331 "/usr/include/features.h" 2 3 4 # 354 "/usr/include/features.h" 3 4 # 1 "/usr/include/gnu/stubs.h" 1 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 5 "/usr/include/gnu/stubs.h" 2 3 4 # 1 "/usr/include/gnu/stubs-32.h" 1 3 4 # 8 "/usr/include/gnu/stubs.h" 2 3 4 # 355 "/usr/include/features.h" 2 3 4 # 28 "/usr/include/limits.h" 2 3 4 # 145 "/usr/include/limits.h" 3 4 # 1 "/usr/include/bits/posix1_lim.h" 1 3 4 # 153 "/usr/include/bits/posix1_lim.h" 3 4 # 1 "/usr/include/bits/local_lim.h" 1 3 4 # 36 "/usr/include/bits/local_lim.h" 3 4 # 1 "/usr/include/linux/limits.h" 1 3 4 # 37 "/usr/include/bits/local_lim.h" 2 3 4 # 154 "/usr/include/bits/posix1_lim.h" 2 3 4 # 146 "/usr/include/limits.h" 2 3 4 # 1 "/usr/include/bits/posix2_lim.h" 1 3 4 # 150 "/usr/include/limits.h" 2 3 4 # 1 "/usr/include/bits/xopen_lim.h" 1 3 4 # 34 "/usr/include/bits/xopen_lim.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 35 "/usr/include/bits/xopen_lim.h" 2 3 4 # 154 "/usr/include/limits.h" 2 3 4 # 123 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/limits.h" 2 3 4 # 8 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/syslimits.h" 2 3 4 # 12 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/limits.h" 2 3 4 # 19 "Include/Python.h" 2 # 32 "Include/Python.h" # 1 "/usr/include/stdio.h" 1 3 4 # 30 "/usr/include/stdio.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 214 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 3 4 typedef unsigned int size_t; # 35 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types.h" 1 3 4 # 28 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; # 131 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/typesizes.h" 1 3 4 # 132 "/usr/include/bits/types.h" 2 3 4 __extension__ typedef __u_quad_t __dev_t; __extension__ typedef unsigned int __uid_t; __extension__ typedef unsigned int __gid_t; __extension__ typedef unsigned long int __ino_t; __extension__ typedef __u_quad_t __ino64_t; __extension__ typedef unsigned int __mode_t; __extension__ typedef unsigned int __nlink_t; __extension__ typedef long int __off_t; __extension__ typedef __quad_t __off64_t; __extension__ typedef int __pid_t; __extension__ typedef struct { int __val[2]; } __fsid_t; __extension__ typedef long int __clock_t; __extension__ typedef unsigned long int __rlim_t; __extension__ typedef __u_quad_t __rlim64_t; __extension__ typedef unsigned int __id_t; __extension__ typedef long int __time_t; __extension__ typedef unsigned int __useconds_t; __extension__ typedef long int __suseconds_t; __extension__ typedef int __daddr_t; __extension__ typedef long int __swblk_t; __extension__ typedef int __key_t; __extension__ typedef int __clockid_t; __extension__ typedef void * __timer_t; __extension__ typedef long int __blksize_t; __extension__ typedef long int __blkcnt_t; __extension__ typedef __quad_t __blkcnt64_t; __extension__ typedef unsigned long int __fsblkcnt_t; __extension__ typedef __u_quad_t __fsblkcnt64_t; __extension__ typedef unsigned long int __fsfilcnt_t; __extension__ typedef __u_quad_t __fsfilcnt64_t; __extension__ typedef int __ssize_t; typedef __off64_t __loff_t; typedef __quad_t *__qaddr_t; typedef char *__caddr_t; __extension__ typedef int __intptr_t; __extension__ typedef unsigned int __socklen_t; # 37 "/usr/include/stdio.h" 2 3 4 # 45 "/usr/include/stdio.h" 3 4 struct _IO_FILE; typedef struct _IO_FILE FILE; # 65 "/usr/include/stdio.h" 3 4 typedef struct _IO_FILE __FILE; # 75 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/libio.h" 1 3 4 # 32 "/usr/include/libio.h" 3 4 # 1 "/usr/include/_G_config.h" 1 3 4 # 15 "/usr/include/_G_config.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 16 "/usr/include/_G_config.h" 2 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 78 "/usr/include/wchar.h" 3 4 typedef struct { int __count; union { unsigned int __wch; char __wchb[4]; } __value; } __mbstate_t; # 21 "/usr/include/_G_config.h" 2 3 4 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; # 53 "/usr/include/_G_config.h" 3 4 typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); # 33 "/usr/include/libio.h" 2 3 4 # 53 "/usr/include/libio.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stdarg.h" 1 3 4 # 43 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 54 "/usr/include/libio.h" 2 3 4 # 170 "/usr/include/libio.h" 3 4 struct _IO_jump_t; struct _IO_FILE; # 180 "/usr/include/libio.h" 3 4 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 203 "/usr/include/libio.h" 3 4 }; enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; # 271 "/usr/include/libio.h" 3 4 struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; # 319 "/usr/include/libio.h" 3 4 __off64_t _offset; # 328 "/usr/include/libio.h" 3 4 void *__pad1; void *__pad2; void *__pad3; void *__pad4; size_t __pad5; int _mode; char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; typedef struct _IO_FILE _IO_FILE; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 364 "/usr/include/libio.h" 3 4 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; typedef struct { __io_read_fn *read; __io_write_fn *write; __io_seek_fn *seek; __io_close_fn *close; } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); extern int __underflow (_IO_FILE *); extern int __uflow (_IO_FILE *); extern int __overflow (_IO_FILE *, int); # 458 "/usr/include/libio.h" 3 4 extern int _IO_getc (_IO_FILE *__fp); extern int _IO_putc (int __c, _IO_FILE *__fp); extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_peekc_locked (_IO_FILE *__fp); extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); # 488 "/usr/include/libio.h" 3 4 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, __gnuc_va_list, int *__restrict); extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, __gnuc_va_list); extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t); extern size_t _IO_sgetn (_IO_FILE *, void *, size_t); extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int); extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int); extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); # 76 "/usr/include/stdio.h" 2 3 4 typedef __gnuc_va_list va_list; # 89 "/usr/include/stdio.h" 3 4 typedef _G_fpos64_t fpos_t; typedef _G_fpos64_t fpos64_t; # 141 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 142 "/usr/include/stdio.h" 2 3 4 extern struct _IO_FILE *stdin; extern struct _IO_FILE *stdout; extern struct _IO_FILE *stderr; extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); extern int renameat (int __oldfd, __const char *__old, int __newfd, __const char *__new) __attribute__ ((__nothrow__)); # 175 "/usr/include/stdio.h" 3 4 extern FILE *tmpfile (void) __asm__ ("" "tmpfile64") ; extern FILE *tmpfile64 (void) ; extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ; extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ; # 204 "/usr/include/stdio.h" 3 4 extern char *tempnam (__const char *__dir, __const char *__pfx) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 229 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 239 "/usr/include/stdio.h" 3 4 extern int fcloseall (void); # 260 "/usr/include/stdio.h" 3 4 extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) __asm__ ("" "fopen64") ; extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64") ; extern FILE *fopen64 (__const char *__restrict __filename, __const char *__restrict __modes) ; extern FILE *freopen64 (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) ; extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ; extern FILE *fopencookie (void *__restrict __magic_cookie, __const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__)) ; extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) __attribute__ ((__nothrow__)) ; extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ; extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int printf (__const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ; extern int __asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ; extern int asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ; extern int vdprintf (int __fd, __const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, __const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) ; extern int scanf (__const char *__restrict __format, ...) ; extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); # 441 "/usr/include/stdio.h" 3 4 extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0))); # 500 "/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); # 528 "/usr/include/stdio.h" 3 4 extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 539 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 572 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ; extern char *gets (char *__s) ; # 618 "/usr/include/stdio.h" 3 4 extern char *fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) ; # 634 "/usr/include/stdio.h" 3 4 extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) ; extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); extern int puts (__const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s) ; # 695 "/usr/include/stdio.h" 3 4 extern int fputs_unlocked (__const char *__restrict __s, FILE *__restrict __stream); # 706 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream) ; extern void rewind (FILE *__stream); # 750 "/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64"); extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64"); # 775 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64"); extern int fsetpos (FILE *__stream, __const fpos_t *__pos) __asm__ ("" "fsetpos64"); extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); extern __off64_t ftello64 (FILE *__stream) ; extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos); extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void perror (__const char *__s); # 1 "/usr/include/bits/sys_errlist.h" 1 3 4 # 27 "/usr/include/bits/sys_errlist.h" 3 4 extern int sys_nerr; extern __const char *__const sys_errlist[]; extern int _sys_nerr; extern __const char *__const _sys_errlist[]; # 823 "/usr/include/stdio.h" 2 3 4 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; # 842 "/usr/include/stdio.h" 3 4 extern FILE *popen (__const char *__command, __const char *__modes) ; extern int pclose (FILE *__stream); extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); extern char *cuserid (char *__s); struct obstack; extern int obstack_printf (struct obstack *__restrict __obstack, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))); extern int obstack_vprintf (struct obstack *__restrict __obstack, __const char *__restrict __format, __gnuc_va_list __args) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))); extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); # 903 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio.h" 1 3 4 # 36 "/usr/include/bits/stdio.h" 3 4 extern __inline int vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } extern __inline int getchar (void) { return _IO_getc (stdin); } extern __inline int fgetc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline int getc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline int getchar_unlocked (void) { return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline int putchar (int __c) { return _IO_putc (__c, stdout); } extern __inline int fputc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putchar_unlocked (int __c) { return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } extern __inline __ssize_t getline (char **__lineptr, size_t *__n, FILE *__stream) { return __getdelim (__lineptr, __n, '\n', __stream); } extern __inline int __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x10) != 0); } extern __inline int __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x20) != 0); } # 904 "/usr/include/stdio.h" 2 3 4 # 912 "/usr/include/stdio.h" 3 4 # 33 "Include/Python.h" 2 # 1 "/usr/include/string.h" 1 3 4 # 28 "/usr/include/string.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 34 "/usr/include/string.h" 2 3 4 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, __const void *__src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memchr (__const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern void *rawmemchr (__const void *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern void *memrchr (__const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); # 1 "/usr/include/xlocale.h" 1 3 4 # 28 "/usr/include/xlocale.h" 3 4 typedef struct __locale_struct { struct locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; } *__locale_t; # 119 "/usr/include/string.h" 2 3 4 extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); extern char *strdup (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strndup (__const char *__string, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 165 "/usr/include/string.h" 3 4 extern char *strchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strrchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strchrnul (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strcspn (__const char *__s, __const char *__reject) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strpbrk (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strstr (__const char *__haystack, __const char *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strcasestr (__const char *__haystack, __const char *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmem (__const void *__haystack, size_t __haystacklen, __const void *__needle, size_t __needlelen) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3))); extern void *__mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strnlen (__const char *__string, size_t __maxlen) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); # 281 "/usr/include/string.h" 3 4 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__)); extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void bcopy (__const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *index (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *rindex (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int ffsl (long int __l) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int strverscmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strsignal (int __sig) __attribute__ ((__nothrow__)); extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *__stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strfry (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern char *basename (__const char *__filename) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); # 420 "/usr/include/string.h" 3 4 # 1 "/usr/include/bits/string.h" 1 3 4 # 421 "/usr/include/string.h" 2 3 4 # 1 "/usr/include/bits/string2.h" 1 3 4 # 52 "/usr/include/bits/string2.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 37 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/endian.h" 1 3 4 # 38 "/usr/include/endian.h" 2 3 4 # 53 "/usr/include/bits/string2.h" 2 3 4 # 394 "/usr/include/bits/string2.h" 3 4 extern void *__rawmemchr (const void *__s, int __c); # 969 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); extern __inline size_t __strcspn_c1 (__const char *__s, int __reject) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject) ++__result; return __result; } extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2); extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2) ++__result; return __result; } extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3); extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3) ++__result; return __result; } # 1045 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strspn_c1 (__const char *__s, int __accept); extern __inline size_t __strspn_c1 (__const char *__s, int __accept) { register size_t __result = 0; while (__s[__result] == __accept) ++__result; return __result; } extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2); extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2) ++__result; return __result; } extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3) ++__result; return __result; } # 1121 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, int __accept2); extern __inline char * __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline char * __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } # 1173 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); extern __inline char * __strtok_r_1c (char *__s, char __sep, char **__nextp) { char *__result; if (__s == ((void *)0)) __s = *__nextp; while (*__s == __sep) ++__s; __result = ((void *)0); if (*__s != '\0') { __result = __s++; while (*__s != '\0') if (*__s++ == __sep) { __s[-1] = '\0'; break; } *__nextp = __s; } return __result; } # 1205 "/usr/include/bits/string2.h" 3 4 extern char *__strsep_g (char **__stringp, __const char *__delim); # 1223 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strsep_1c (char **__s, char __reject); extern __inline char * __strsep_1c (char **__s, char __reject) { register char *__retval = *__s; if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) *(*__s)++ = '\0'; return __retval; } extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); extern __inline char * __strsep_2c (char **__s, char __reject1, char __reject2) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3); extern __inline char * __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } # 1299 "/usr/include/bits/string2.h" 3 4 # 1 "/usr/include/stdlib.h" 1 3 4 # 33 "/usr/include/stdlib.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 34 "/usr/include/stdlib.h" 2 3 4 # 469 "/usr/include/stdlib.h" 3 4 extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; # 891 "/usr/include/stdlib.h" 3 4 # 1300 "/usr/include/bits/string2.h" 2 3 4 extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 1323 "/usr/include/bits/string2.h" 3 4 extern char *__strndup (__const char *__string, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 424 "/usr/include/string.h" 2 3 4 # 432 "/usr/include/string.h" 3 4 # 38 "Include/Python.h" 2 # 1 "/usr/include/errno.h" 1 3 4 # 32 "/usr/include/errno.h" 3 4 # 1 "/usr/include/bits/errno.h" 1 3 4 # 25 "/usr/include/bits/errno.h" 3 4 # 1 "/usr/include/linux/errno.h" 1 3 4 # 1 "/usr/include/asm/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno-base.h" 1 3 4 # 5 "/usr/include/asm-generic/errno.h" 2 3 4 # 5 "/usr/include/asm/errno.h" 2 3 4 # 5 "/usr/include/linux/errno.h" 2 3 4 # 26 "/usr/include/bits/errno.h" 2 3 4 # 43 "/usr/include/bits/errno.h" 3 4 extern int *__errno_location (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); # 37 "/usr/include/errno.h" 2 3 4 # 55 "/usr/include/errno.h" 3 4 extern char *program_invocation_name, *program_invocation_short_name; # 69 "/usr/include/errno.h" 3 4 typedef int error_t; # 40 "Include/Python.h" 2 # 1 "/usr/include/stdlib.h" 1 3 4 # 33 "/usr/include/stdlib.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 326 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 3 4 typedef long int wchar_t; # 34 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitflags.h" 1 3 4 # 43 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitstatus.h" 1 3 4 # 67 "/usr/include/bits/waitstatus.h" 3 4 union wait { int w_status; struct { unsigned int __w_termsig:7; unsigned int __w_coredump:1; unsigned int __w_retcode:8; unsigned int:16; } __wait_terminated; struct { unsigned int __w_stopval:8; unsigned int __w_stopsig:8; unsigned int:16; } __wait_stopped; }; # 44 "/usr/include/stdlib.h" 2 3 4 # 68 "/usr/include/stdlib.h" 3 4 typedef union { union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); # 96 "/usr/include/stdlib.h" 3 4 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; __extension__ typedef struct { long long int quot; long long int rem; } lldiv_t; # 140 "/usr/include/stdlib.h" 3 4 extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ; extern double atof (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern int atoi (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern long int atol (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int atoll (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern double strtod (__const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern float strtof (__const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern long double strtold (__const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern long int strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern unsigned long long int strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern unsigned long long int strtoull (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 240 "/usr/include/stdlib.h" 3 4 extern long int strtol_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; extern unsigned long int strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; __extension__ extern long long int strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; __extension__ extern unsigned long long int strtoull_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; extern double strtod_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; extern float strtof_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; extern long double strtold_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; extern __inline double __attribute__ ((__nothrow__)) atof (__const char *__nptr) { return strtod (__nptr, (char **) ((void *)0)); } extern __inline int __attribute__ ((__nothrow__)) atoi (__const char *__nptr) { return (int) strtol (__nptr, (char **) ((void *)0), 10); } extern __inline long int __attribute__ ((__nothrow__)) atol (__const char *__nptr) { return strtol (__nptr, (char **) ((void *)0), 10); } __extension__ extern __inline long long int __attribute__ ((__nothrow__)) atoll (__const char *__nptr) { return strtoll (__nptr, (char **) ((void *)0), 10); } # 311 "/usr/include/stdlib.h" 3 4 extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ; extern long int a64l (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; # 1 "/usr/include/sys/types.h" 1 3 4 # 29 "/usr/include/sys/types.h" 3 4 typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino64_t ino_t; typedef __ino64_t ino64_t; typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; typedef __off64_t off_t; typedef __off64_t off64_t; typedef __pid_t pid_t; typedef __id_t id_t; typedef __ssize_t ssize_t; typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 133 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 # 59 "/usr/include/time.h" 3 4 typedef __clock_t clock_t; # 75 "/usr/include/time.h" 3 4 typedef __time_t time_t; # 93 "/usr/include/time.h" 3 4 typedef __clockid_t clockid_t; # 105 "/usr/include/time.h" 3 4 typedef __timer_t timer_t; # 134 "/usr/include/sys/types.h" 2 3 4 typedef __useconds_t useconds_t; typedef __suseconds_t suseconds_t; # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 148 "/usr/include/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 195 "/usr/include/sys/types.h" 3 4 typedef int int8_t __attribute__ ((__mode__ (__QI__))); typedef int int16_t __attribute__ ((__mode__ (__HI__))); typedef int int32_t __attribute__ ((__mode__ (__SI__))); typedef int int64_t __attribute__ ((__mode__ (__DI__))); typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); typedef int register_t __attribute__ ((__mode__ (__word__))); # 220 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/sys/select.h" 1 3 4 # 31 "/usr/include/sys/select.h" 3 4 # 1 "/usr/include/bits/select.h" 1 3 4 # 32 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/sigset.h" 1 3 4 # 24 "/usr/include/bits/sigset.h" 3 4 typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 35 "/usr/include/sys/select.h" 2 3 4 typedef __sigset_t sigset_t; # 1 "/usr/include/time.h" 1 3 4 # 121 "/usr/include/time.h" 3 4 struct timespec { __time_t tv_sec; long int tv_nsec; }; # 45 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 69 "/usr/include/bits/time.h" 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 47 "/usr/include/sys/select.h" 2 3 4 # 55 "/usr/include/sys/select.h" 3 4 typedef long int __fd_mask; # 67 "/usr/include/sys/select.h" 3 4 typedef struct { __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 99 "/usr/include/sys/select.h" 3 4 # 109 "/usr/include/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); # 121 "/usr/include/sys/select.h" 3 4 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); # 221 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/sys/sysmacros.h" 1 3 4 # 30 "/usr/include/sys/sysmacros.h" 3 4 __extension__ extern unsigned int gnu_dev_major (unsigned long long int __dev) __attribute__ ((__nothrow__)); __extension__ extern unsigned int gnu_dev_minor (unsigned long long int __dev) __attribute__ ((__nothrow__)); __extension__ extern unsigned long long int gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__)); __extension__ extern __inline unsigned int __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev) { return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); } __extension__ extern __inline unsigned int __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev) { return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); } __extension__ extern __inline unsigned long long int __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32)); } # 224 "/usr/include/sys/types.h" 2 3 4 typedef __blksize_t blksize_t; # 248 "/usr/include/sys/types.h" 3 4 typedef __blkcnt64_t blkcnt_t; typedef __fsblkcnt64_t fsblkcnt_t; typedef __fsfilcnt64_t fsfilcnt_t; typedef __blkcnt64_t blkcnt64_t; typedef __fsblkcnt64_t fsblkcnt64_t; typedef __fsfilcnt64_t fsfilcnt64_t; # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 # 36 "/usr/include/bits/pthreadtypes.h" 3 4 typedef unsigned long int pthread_t; typedef union { char __size[36]; long int __align; } pthread_attr_t; typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; int __kind; unsigned int __nusers; __extension__ union { int __spins; __pthread_slist_t __list; }; } __data; char __size[24]; long int __align; } pthread_mutex_t; typedef union { char __size[4]; long int __align; } pthread_mutexattr_t; typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[48]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[4]; long int __align; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef int pthread_once_t; typedef union { struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; unsigned char __flags; unsigned char __shared; unsigned char __pad1; unsigned char __pad2; int __writer; } __data; char __size[32]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef union { char __size[20]; long int __align; } pthread_barrier_t; typedef union { char __size[4]; int __align; } pthread_barrierattr_t; # 271 "/usr/include/sys/types.h" 2 3 4 # 321 "/usr/include/stdlib.h" 2 3 4 extern long int random (void) __attribute__ ((__nothrow__)); extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__)); extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int srandom_r (unsigned int __seed, struct random_data *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int rand (void) __attribute__ ((__nothrow__)); extern void srand (unsigned int __seed) __attribute__ ((__nothrow__)); extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__)); extern double drand48 (void) __attribute__ ((__nothrow__)); extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern long int lrand48 (void) __attribute__ ((__nothrow__)); extern long int nrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern long int mrand48 (void) __attribute__ ((__nothrow__)); extern long int jrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void srand48 (long int __seedval) __attribute__ ((__nothrow__)); extern unsigned short int *seed48 (unsigned short int __seed16v[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int srand48_r (long int __seedval, struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); # 479 "/usr/include/stdlib.h" 3 4 extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__)); extern void free (void *__ptr) __attribute__ ((__nothrow__)); extern void cfree (void *__ptr) __attribute__ ((__nothrow__)); # 1 "/usr/include/alloca.h" 1 3 4 # 25 "/usr/include/alloca.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 26 "/usr/include/alloca.h" 2 3 4 extern void *alloca (size_t __size) __attribute__ ((__nothrow__)); # 498 "/usr/include/stdlib.h" 2 3 4 extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern char *__secure_getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int setenv (__const char *__name, __const char *__value, int __replace) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)); extern int clearenv (void) __attribute__ ((__nothrow__)); # 583 "/usr/include/stdlib.h" 3 4 extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 597 "/usr/include/stdlib.h" 3 4 extern int mkstemp (char *__template) __asm__ ("" "mkstemp64") __attribute__ ((__nonnull__ (1))) ; extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ; # 614 "/usr/include/stdlib.h" 3 4 extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 628 "/usr/include/stdlib.h" 3 4 extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64") __attribute__ ((__nonnull__ (1))) ; extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ; extern int system (__const char *__command) ; extern char *canonicalize_file_name (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 662 "/usr/include/stdlib.h" 3 4 extern char *realpath (__const char *__restrict __name, char *__restrict __resolved) __attribute__ ((__nothrow__)) ; typedef int (*__compar_fn_t) (__const void *, __const void *); typedef __compar_fn_t comparison_fn_t; typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *); extern void *bsearch (__const void *__key, __const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 2, 5))) ; extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); extern void qsort_r (void *__base, size_t __nmemb, size_t __size, __compar_d_fn_t __compar, void *__arg) __attribute__ ((__nonnull__ (1, 4))); extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; __extension__ extern long long int llabs (long long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; extern div_t div (int __numer, int __denom) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; extern ldiv_t ldiv (long int __numer, long int __denom) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; __extension__ extern lldiv_t lldiv (long long int __numer, long long int __denom) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; # 735 "/usr/include/stdlib.h" 3 4 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *gcvt (double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *qgcvt (long double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ; extern int mbtowc (wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ; extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ; extern size_t mbstowcs (wchar_t *__restrict __pwcs, __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)); extern size_t wcstombs (char *__restrict __s, __const wchar_t *__restrict __pwcs, size_t __n) __attribute__ ((__nothrow__)); extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 823 "/usr/include/stdlib.h" 3 4 extern int getsubopt (char **__restrict __optionp, char *__const *__restrict __tokens, char **__restrict __valuep) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) ; extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int posix_openpt (int __oflag) ; extern int grantpt (int __fd) __attribute__ ((__nothrow__)); extern int unlockpt (int __fd) __attribute__ ((__nothrow__)); extern char *ptsname (int __fd) __attribute__ ((__nothrow__)) ; extern int ptsname_r (int __fd, char *__buf, size_t __buflen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int getpt (void); extern int getloadavg (double __loadavg[], int __nelem) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); # 891 "/usr/include/stdlib.h" 3 4 # 42 "Include/Python.h" 2 # 1 "/usr/include/unistd.h" 1 3 4 # 28 "/usr/include/unistd.h" 3 4 # 173 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/bits/posix_opt.h" 1 3 4 # 174 "/usr/include/unistd.h" 2 3 4 # 1 "/usr/include/bits/environments.h" 1 3 4 # 178 "/usr/include/unistd.h" 2 3 4 # 197 "/usr/include/unistd.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 198 "/usr/include/unistd.h" 2 3 4 # 238 "/usr/include/unistd.h" 3 4 typedef __intptr_t intptr_t; typedef __socklen_t socklen_t; # 258 "/usr/include/unistd.h" 3 4 extern int access (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int euidaccess (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int eaccess (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int faccessat (int __fd, __const char *__file, int __type, int __flag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ; # 304 "/usr/include/unistd.h" 3 4 extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__)); extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) __attribute__ ((__nothrow__)); extern int close (int __fd); extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ; extern ssize_t write (int __fd, __const void *__buf, size_t __n) ; # 355 "/usr/include/unistd.h" 3 4 extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64") ; extern ssize_t pwrite (int __fd, __const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64") ; # 371 "/usr/include/unistd.h" 3 4 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) ; extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, __off64_t __offset) ; extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__)) ; # 393 "/usr/include/unistd.h" 3 4 extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__)); # 405 "/usr/include/unistd.h" 3 4 extern unsigned int sleep (unsigned int __seconds); extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) __attribute__ ((__nothrow__)); extern int usleep (__useconds_t __useconds); # 429 "/usr/include/unistd.h" 3 4 extern int pause (void); extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) ; extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int fchownat (int __fd, __const char *__file, __uid_t __owner, __gid_t __group, int __flag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ; extern int chdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int fchdir (int __fd) __attribute__ ((__nothrow__)) ; # 471 "/usr/include/unistd.h" 3 4 extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__)) ; extern char *get_current_dir_name (void) __attribute__ ((__nothrow__)); extern char *getwd (char *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ; extern int dup (int __fd) __attribute__ ((__nothrow__)) ; extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__)); extern char **__environ; extern char **environ; extern int execve (__const char *__path, char *__const __argv[], char *__const __envp[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[]) __attribute__ ((__nothrow__)); extern int execv (__const char *__path, char *__const __argv[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int execle (__const char *__path, __const char *__arg, ...) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int execl (__const char *__path, __const char *__arg, ...) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int execvp (__const char *__file, char *__const __argv[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int execlp (__const char *__file, __const char *__arg, ...) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int nice (int __inc) __attribute__ ((__nothrow__)) ; extern void _exit (int __status) __attribute__ ((__noreturn__)); # 1 "/usr/include/bits/confname.h" 1 3 4 # 26 "/usr/include/bits/confname.h" 3 4 enum { _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, _PC_SYNC_IO, _PC_ASYNC_IO, _PC_PRIO_IO, _PC_SOCK_MAXBUF, _PC_FILESIZEBITS, _PC_REC_INCR_XFER_SIZE, _PC_REC_MAX_XFER_SIZE, _PC_REC_MIN_XFER_SIZE, _PC_REC_XFER_ALIGN, _PC_ALLOC_SIZE_MIN, _PC_SYMLINK_MAX, _PC_2_SYMLINKS }; enum { _SC_ARG_MAX, _SC_CHILD_MAX, _SC_CLK_TCK, _SC_NGROUPS_MAX, _SC_OPEN_MAX, _SC_STREAM_MAX, _SC_TZNAME_MAX, _SC_JOB_CONTROL, _SC_SAVED_IDS, _SC_REALTIME_SIGNALS, _SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO, _SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE, _SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS, _SC_AIO_LISTIO_MAX, _SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX, _SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_VERSION, _SC_PAGESIZE, _SC_RTSIG_MAX, _SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, _SC_TIMER_MAX, _SC_BC_BASE_MAX, _SC_BC_DIM_MAX, _SC_BC_SCALE_MAX, _SC_BC_STRING_MAX, _SC_COLL_WEIGHTS_MAX, _SC_EQUIV_CLASS_MAX, _SC_EXPR_NEST_MAX, _SC_LINE_MAX, _SC_RE_DUP_MAX, _SC_CHARCLASS_NAME_MAX, _SC_2_VERSION, _SC_2_C_BIND, _SC_2_C_DEV, _SC_2_FORT_DEV, _SC_2_FORT_RUN, _SC_2_SW_DEV, _SC_2_LOCALEDEF, _SC_PII, _SC_PII_XTI, _SC_PII_SOCKET, _SC_PII_INTERNET, _SC_PII_OSI, _SC_POLL, _SC_SELECT, _SC_UIO_MAXIOV, _SC_IOV_MAX = _SC_UIO_MAXIOV, _SC_PII_INTERNET_STREAM, _SC_PII_INTERNET_DGRAM, _SC_PII_OSI_COTS, _SC_PII_OSI_CLTS, _SC_PII_OSI_M, _SC_T_IOV_MAX, _SC_THREADS, _SC_THREAD_SAFE_FUNCTIONS, _SC_GETGR_R_SIZE_MAX, _SC_GETPW_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_TTY_NAME_MAX, _SC_THREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_KEYS_MAX, _SC_THREAD_STACK_MIN, _SC_THREAD_THREADS_MAX, _SC_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKSIZE, _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_PROTECT, _SC_THREAD_PROCESS_SHARED, _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN, _SC_PHYS_PAGES, _SC_AVPHYS_PAGES, _SC_ATEXIT_MAX, _SC_PASS_MAX, _SC_XOPEN_VERSION, _SC_XOPEN_XCU_VERSION, _SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N, _SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, _SC_2_UPE, _SC_XOPEN_XPG2, _SC_XOPEN_XPG3, _SC_XOPEN_XPG4, _SC_CHAR_BIT, _SC_CHAR_MAX, _SC_CHAR_MIN, _SC_INT_MAX, _SC_INT_MIN, _SC_LONG_BIT, _SC_WORD_BIT, _SC_MB_LEN_MAX, _SC_NZERO, _SC_SSIZE_MAX, _SC_SCHAR_MAX, _SC_SCHAR_MIN, _SC_SHRT_MAX, _SC_SHRT_MIN, _SC_UCHAR_MAX, _SC_UINT_MAX, _SC_ULONG_MAX, _SC_USHRT_MAX, _SC_NL_ARGMAX, _SC_NL_LANGMAX, _SC_NL_MSGMAX, _SC_NL_NMAX, _SC_NL_SETMAX, _SC_NL_TEXTMAX, _SC_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFFBIG, _SC_XBS5_LP64_OFF64, _SC_XBS5_LPBIG_OFFBIG, _SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME, _SC_XOPEN_REALTIME_THREADS, _SC_ADVISORY_INFO, _SC_BARRIERS, _SC_BASE, _SC_C_LANG_SUPPORT, _SC_C_LANG_SUPPORT_R, _SC_CLOCK_SELECTION, _SC_CPUTIME, _SC_THREAD_CPUTIME, _SC_DEVICE_IO, _SC_DEVICE_SPECIFIC, _SC_DEVICE_SPECIFIC_R, _SC_FD_MGMT, _SC_FIFO, _SC_PIPE, _SC_FILE_ATTRIBUTES, _SC_FILE_LOCKING, _SC_FILE_SYSTEM, _SC_MONOTONIC_CLOCK, _SC_MULTI_PROCESS, _SC_SINGLE_PROCESS, _SC_NETWORKING, _SC_READER_WRITER_LOCKS, _SC_SPIN_LOCKS, _SC_REGEXP, _SC_REGEX_VERSION, _SC_SHELL, _SC_SIGNALS, _SC_SPAWN, _SC_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER, _SC_SYSTEM_DATABASE, _SC_SYSTEM_DATABASE_R, _SC_TIMEOUTS, _SC_TYPED_MEMORY_OBJECTS, _SC_USER_GROUPS, _SC_USER_GROUPS_R, _SC_2_PBS, _SC_2_PBS_ACCOUNTING, _SC_2_PBS_LOCATE, _SC_2_PBS_MESSAGE, _SC_2_PBS_TRACK, _SC_SYMLOOP_MAX, _SC_STREAMS, _SC_2_PBS_CHECKPOINT, _SC_V6_ILP32_OFF32, _SC_V6_ILP32_OFFBIG, _SC_V6_LP64_OFF64, _SC_V6_LPBIG_OFFBIG, _SC_HOST_NAME_MAX, _SC_TRACE, _SC_TRACE_EVENT_FILTER, _SC_TRACE_INHERIT, _SC_TRACE_LOG, _SC_LEVEL1_ICACHE_SIZE, _SC_LEVEL1_ICACHE_ASSOC, _SC_LEVEL1_ICACHE_LINESIZE, _SC_LEVEL1_DCACHE_SIZE, _SC_LEVEL1_DCACHE_ASSOC, _SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL2_CACHE_SIZE, _SC_LEVEL2_CACHE_ASSOC, _SC_LEVEL2_CACHE_LINESIZE, _SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC, _SC_LEVEL3_CACHE_LINESIZE, _SC_LEVEL4_CACHE_SIZE, _SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE, _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, _SC_RAW_SOCKETS }; enum { _CS_PATH, _CS_V6_WIDTH_RESTRICTED_ENVS, _CS_GNU_LIBC_VERSION, _CS_GNU_LIBPTHREAD_VERSION, _CS_LFS_CFLAGS = 1000, _CS_LFS_LDFLAGS, _CS_LFS_LIBS, _CS_LFS_LINTFLAGS, _CS_LFS64_CFLAGS, _CS_LFS64_LDFLAGS, _CS_LFS64_LIBS, _CS_LFS64_LINTFLAGS, _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, _CS_XBS5_ILP32_OFF32_LDFLAGS, _CS_XBS5_ILP32_OFF32_LIBS, _CS_XBS5_ILP32_OFF32_LINTFLAGS, _CS_XBS5_ILP32_OFFBIG_CFLAGS, _CS_XBS5_ILP32_OFFBIG_LDFLAGS, _CS_XBS5_ILP32_OFFBIG_LIBS, _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, _CS_XBS5_LP64_OFF64_CFLAGS, _CS_XBS5_LP64_OFF64_LDFLAGS, _CS_XBS5_LP64_OFF64_LIBS, _CS_XBS5_LP64_OFF64_LINTFLAGS, _CS_XBS5_LPBIG_OFFBIG_CFLAGS, _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, _CS_XBS5_LPBIG_OFFBIG_LIBS, _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, _CS_POSIX_V6_ILP32_OFF32_CFLAGS, _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, _CS_POSIX_V6_ILP32_OFF32_LIBS, _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LIBS, _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, _CS_POSIX_V6_LP64_OFF64_CFLAGS, _CS_POSIX_V6_LP64_OFF64_LDFLAGS, _CS_POSIX_V6_LP64_OFF64_LIBS, _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS }; # 555 "/usr/include/unistd.h" 2 3 4 extern long int pathconf (__const char *__path, int __name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__)); extern long int sysconf (int __name) __attribute__ ((__nothrow__)); extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__)); extern __pid_t getpid (void) __attribute__ ((__nothrow__)); extern __pid_t getppid (void) __attribute__ ((__nothrow__)); extern __pid_t getpgrp (void) __attribute__ ((__nothrow__)); # 591 "/usr/include/unistd.h" 3 4 extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__)); extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__)); extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__)); # 617 "/usr/include/unistd.h" 3 4 extern int setpgrp (void) __attribute__ ((__nothrow__)); # 634 "/usr/include/unistd.h" 3 4 extern __pid_t setsid (void) __attribute__ ((__nothrow__)); extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__)); extern __uid_t getuid (void) __attribute__ ((__nothrow__)); extern __uid_t geteuid (void) __attribute__ ((__nothrow__)); extern __gid_t getgid (void) __attribute__ ((__nothrow__)); extern __gid_t getegid (void) __attribute__ ((__nothrow__)); extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__)) ; extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__)); extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__)); extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__)); extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__)); extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__)); extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__)); extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__)); extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid) __attribute__ ((__nothrow__)); extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid) __attribute__ ((__nothrow__)); extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid) __attribute__ ((__nothrow__)); extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) __attribute__ ((__nothrow__)); extern __pid_t fork (void) __attribute__ ((__nothrow__)); extern __pid_t vfork (void) __attribute__ ((__nothrow__)); extern char *ttyname (int __fd) __attribute__ ((__nothrow__)); extern int ttyname_r (int __fd, char *__buf, size_t __buflen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ; extern int isatty (int __fd) __attribute__ ((__nothrow__)); extern int ttyslot (void) __attribute__ ((__nothrow__)); extern int link (__const char *__from, __const char *__to) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; extern int linkat (int __fromfd, __const char *__from, int __tofd, __const char *__to, int __flags) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))) ; extern int symlink (__const char *__from, __const char *__to) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; extern ssize_t readlink (__const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; extern int symlinkat (__const char *__from, int __tofd, __const char *__to) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; extern ssize_t readlinkat (int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))) ; extern int unlink (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int unlinkat (int __fd, __const char *__name, int __flag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int rmdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__)); extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__)); extern char *getlogin (void); extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); extern int setlogin (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); # 837 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/getopt.h" 1 3 4 # 59 "/usr/include/getopt.h" 3 4 extern char *optarg; # 73 "/usr/include/getopt.h" 3 4 extern int optind; extern int opterr; extern int optopt; # 152 "/usr/include/getopt.h" 3 4 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __attribute__ ((__nothrow__)); # 838 "/usr/include/unistd.h" 2 3 4 extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sethostname (__const char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int sethostid (long int __id) __attribute__ ((__nothrow__)) ; extern int getdomainname (char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int setdomainname (__const char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int vhangup (void) __attribute__ ((__nothrow__)); extern int revoke (__const char *__file) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int acct (__const char *__name) __attribute__ ((__nothrow__)); extern char *getusershell (void) __attribute__ ((__nothrow__)); extern void endusershell (void) __attribute__ ((__nothrow__)); extern void setusershell (void) __attribute__ ((__nothrow__)); extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__)) ; extern int chroot (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1))); # 923 "/usr/include/unistd.h" 3 4 extern int fsync (int __fd); extern long int gethostid (void); extern void sync (void) __attribute__ ((__nothrow__)); extern int getpagesize (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int getdtablesize (void) __attribute__ ((__nothrow__)); # 952 "/usr/include/unistd.h" 3 4 extern int truncate (__const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int truncate64 (__const char *__file, __off64_t __length) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 973 "/usr/include/unistd.h" 3 4 extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__)) ; extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__)) ; # 990 "/usr/include/unistd.h" 3 4 extern int brk (void *__addr) __attribute__ ((__nothrow__)) ; extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__)); # 1011 "/usr/include/unistd.h" 3 4 extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__)); # 1037 "/usr/include/unistd.h" 3 4 extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64") ; extern int lockf64 (int __fd, int __cmd, __off64_t __len) ; # 1065 "/usr/include/unistd.h" 3 4 extern int fdatasync (int __fildes); extern char *crypt (__const char *__key, __const char *__salt) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void encrypt (char *__block, int __edflag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void swab (__const void *__restrict __from, void *__restrict __to, ssize_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); # 1103 "/usr/include/unistd.h" 3 4 # 44 "Include/Python.h" 2 # 55 "Include/Python.h" # 1 "/usr/include/assert.h" 1 3 4 # 56 "Include/Python.h" 2 # 1 "Include/pyport.h" 1 # 1 "/usr/include/stdint.h" 1 3 4 # 27 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/bits/wchar.h" 1 3 4 # 28 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/stdint.h" 2 3 4 # 49 "/usr/include/stdint.h" 3 4 typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; __extension__ typedef unsigned long long int uint64_t; typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; __extension__ typedef long long int int_least64_t; typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; __extension__ typedef unsigned long long int uint_least64_t; typedef signed char int_fast8_t; typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; typedef unsigned char uint_fast8_t; typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; # 129 "/usr/include/stdint.h" 3 4 typedef unsigned int uintptr_t; # 138 "/usr/include/stdint.h" 3 4 __extension__ typedef long long int intmax_t; __extension__ typedef unsigned long long int uintmax_t; # 8 "Include/pyport.h" 2 # 89 "Include/pyport.h" typedef uintptr_t Py_uintptr_t; typedef intptr_t Py_intptr_t; # 113 "Include/pyport.h" typedef ssize_t Py_ssize_t; # 220 "Include/pyport.h" # 1 "/usr/include/math.h" 1 3 4 # 30 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/huge_val.h" 1 3 4 # 35 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/huge_valf.h" 1 3 4 # 37 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/huge_vall.h" 1 3 4 # 38 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/inf.h" 1 3 4 # 41 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/nan.h" 1 3 4 # 44 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/mathdef.h" 1 3 4 # 36 "/usr/include/bits/mathdef.h" 3 4 typedef long double float_t; typedef long double double_t; # 48 "/usr/include/math.h" 2 3 4 # 71 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern double acos (double __x) __attribute__ ((__nothrow__)); extern double __acos (double __x) __attribute__ ((__nothrow__)); extern double asin (double __x) __attribute__ ((__nothrow__)); extern double __asin (double __x) __attribute__ ((__nothrow__)); extern double atan (double __x) __attribute__ ((__nothrow__)); extern double __atan (double __x) __attribute__ ((__nothrow__)); extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double cos (double __x) __attribute__ ((__nothrow__)); extern double __cos (double __x) __attribute__ ((__nothrow__)); extern double sin (double __x) __attribute__ ((__nothrow__)); extern double __sin (double __x) __attribute__ ((__nothrow__)); extern double tan (double __x) __attribute__ ((__nothrow__)); extern double __tan (double __x) __attribute__ ((__nothrow__)); extern double cosh (double __x) __attribute__ ((__nothrow__)); extern double __cosh (double __x) __attribute__ ((__nothrow__)); extern double sinh (double __x) __attribute__ ((__nothrow__)); extern double __sinh (double __x) __attribute__ ((__nothrow__)); extern double tanh (double __x) __attribute__ ((__nothrow__)); extern double __tanh (double __x) __attribute__ ((__nothrow__)); extern void sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__)); extern void __sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__)); extern double acosh (double __x) __attribute__ ((__nothrow__)); extern double __acosh (double __x) __attribute__ ((__nothrow__)); extern double asinh (double __x) __attribute__ ((__nothrow__)); extern double __asinh (double __x) __attribute__ ((__nothrow__)); extern double atanh (double __x) __attribute__ ((__nothrow__)); extern double __atanh (double __x) __attribute__ ((__nothrow__)); extern double exp (double __x) __attribute__ ((__nothrow__)); extern double __exp (double __x) __attribute__ ((__nothrow__)); extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double log (double __x) __attribute__ ((__nothrow__)); extern double __log (double __x) __attribute__ ((__nothrow__)); extern double log10 (double __x) __attribute__ ((__nothrow__)); extern double __log10 (double __x) __attribute__ ((__nothrow__)); extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); extern double exp10 (double __x) __attribute__ ((__nothrow__)); extern double __exp10 (double __x) __attribute__ ((__nothrow__)); extern double pow10 (double __x) __attribute__ ((__nothrow__)); extern double __pow10 (double __x) __attribute__ ((__nothrow__)); extern double expm1 (double __x) __attribute__ ((__nothrow__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__)); extern double log1p (double __x) __attribute__ ((__nothrow__)); extern double __log1p (double __x) __attribute__ ((__nothrow__)); extern double logb (double __x) __attribute__ ((__nothrow__)); extern double __logb (double __x) __attribute__ ((__nothrow__)); extern double exp2 (double __x) __attribute__ ((__nothrow__)); extern double __exp2 (double __x) __attribute__ ((__nothrow__)); extern double log2 (double __x) __attribute__ ((__nothrow__)); extern double __log2 (double __x) __attribute__ ((__nothrow__)); extern double pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double sqrt (double __x) __attribute__ ((__nothrow__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__)); extern double hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double cbrt (double __x) __attribute__ ((__nothrow__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__)); extern double ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern int __isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double significand (double __x) __attribute__ ((__nothrow__)); extern double __significand (double __x) __attribute__ ((__nothrow__)); extern double copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double j0 (double) __attribute__ ((__nothrow__)); extern double __j0 (double) __attribute__ ((__nothrow__)); extern double j1 (double) __attribute__ ((__nothrow__)); extern double __j1 (double) __attribute__ ((__nothrow__)); extern double jn (int, double) __attribute__ ((__nothrow__)); extern double __jn (int, double) __attribute__ ((__nothrow__)); extern double y0 (double) __attribute__ ((__nothrow__)); extern double __y0 (double) __attribute__ ((__nothrow__)); extern double y1 (double) __attribute__ ((__nothrow__)); extern double __y1 (double) __attribute__ ((__nothrow__)); extern double yn (int, double) __attribute__ ((__nothrow__)); extern double __yn (int, double) __attribute__ ((__nothrow__)); extern double erf (double) __attribute__ ((__nothrow__)); extern double __erf (double) __attribute__ ((__nothrow__)); extern double erfc (double) __attribute__ ((__nothrow__)); extern double __erfc (double) __attribute__ ((__nothrow__)); extern double lgamma (double) __attribute__ ((__nothrow__)); extern double __lgamma (double) __attribute__ ((__nothrow__)); extern double tgamma (double) __attribute__ ((__nothrow__)); extern double __tgamma (double) __attribute__ ((__nothrow__)); extern double gamma (double) __attribute__ ((__nothrow__)); extern double __gamma (double) __attribute__ ((__nothrow__)); extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double rint (double __x) __attribute__ ((__nothrow__)); extern double __rint (double __x) __attribute__ ((__nothrow__)); extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double nexttoward (double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern int ilogb (double __x) __attribute__ ((__nothrow__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__)); extern double scalbln (double __x, long int __n) __attribute__ ((__nothrow__)); extern double __scalbln (double __x, long int __n) __attribute__ ((__nothrow__)); extern double nearbyint (double __x) __attribute__ ((__nothrow__)); extern double __nearbyint (double __x) __attribute__ ((__nothrow__)); extern double round (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __round (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double trunc (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __trunc (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__)); extern double __remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__)); extern long int lrint (double __x) __attribute__ ((__nothrow__)); extern long int __lrint (double __x) __attribute__ ((__nothrow__)); extern long long int llrint (double __x) __attribute__ ((__nothrow__)); extern long long int __llrint (double __x) __attribute__ ((__nothrow__)); extern long int lround (double __x) __attribute__ ((__nothrow__)); extern long int __lround (double __x) __attribute__ ((__nothrow__)); extern long long int llround (double __x) __attribute__ ((__nothrow__)); extern long long int __llround (double __x) __attribute__ ((__nothrow__)); extern double fdim (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fdim (double __x, double __y) __attribute__ ((__nothrow__)); extern double fmax (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmax (double __x, double __y) __attribute__ ((__nothrow__)); extern double fmin (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmin (double __x, double __y) __attribute__ ((__nothrow__)); extern int __fpclassify (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __signbit (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fma (double __x, double __y, double __z) __attribute__ ((__nothrow__)); extern double __fma (double __x, double __y, double __z) __attribute__ ((__nothrow__)); extern double scalb (double __x, double __n) __attribute__ ((__nothrow__)); extern double __scalb (double __x, double __n) __attribute__ ((__nothrow__)); # 72 "/usr/include/math.h" 2 3 4 # 94 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern float acosf (float __x) __attribute__ ((__nothrow__)); extern float __acosf (float __x) __attribute__ ((__nothrow__)); extern float asinf (float __x) __attribute__ ((__nothrow__)); extern float __asinf (float __x) __attribute__ ((__nothrow__)); extern float atanf (float __x) __attribute__ ((__nothrow__)); extern float __atanf (float __x) __attribute__ ((__nothrow__)); extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float cosf (float __x) __attribute__ ((__nothrow__)); extern float __cosf (float __x) __attribute__ ((__nothrow__)); extern float sinf (float __x) __attribute__ ((__nothrow__)); extern float __sinf (float __x) __attribute__ ((__nothrow__)); extern float tanf (float __x) __attribute__ ((__nothrow__)); extern float __tanf (float __x) __attribute__ ((__nothrow__)); extern float coshf (float __x) __attribute__ ((__nothrow__)); extern float __coshf (float __x) __attribute__ ((__nothrow__)); extern float sinhf (float __x) __attribute__ ((__nothrow__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__)); extern float tanhf (float __x) __attribute__ ((__nothrow__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__)); extern void sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__)); extern void __sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__)); extern float acoshf (float __x) __attribute__ ((__nothrow__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__)); extern float asinhf (float __x) __attribute__ ((__nothrow__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__)); extern float atanhf (float __x) __attribute__ ((__nothrow__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__)); extern float expf (float __x) __attribute__ ((__nothrow__)); extern float __expf (float __x) __attribute__ ((__nothrow__)); extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float logf (float __x) __attribute__ ((__nothrow__)); extern float __logf (float __x) __attribute__ ((__nothrow__)); extern float log10f (float __x) __attribute__ ((__nothrow__)); extern float __log10f (float __x) __attribute__ ((__nothrow__)); extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); extern float exp10f (float __x) __attribute__ ((__nothrow__)); extern float __exp10f (float __x) __attribute__ ((__nothrow__)); extern float pow10f (float __x) __attribute__ ((__nothrow__)); extern float __pow10f (float __x) __attribute__ ((__nothrow__)); extern float expm1f (float __x) __attribute__ ((__nothrow__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__)); extern float log1pf (float __x) __attribute__ ((__nothrow__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__)); extern float logbf (float __x) __attribute__ ((__nothrow__)); extern float __logbf (float __x) __attribute__ ((__nothrow__)); extern float exp2f (float __x) __attribute__ ((__nothrow__)); extern float __exp2f (float __x) __attribute__ ((__nothrow__)); extern float log2f (float __x) __attribute__ ((__nothrow__)); extern float __log2f (float __x) __attribute__ ((__nothrow__)); extern float powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float sqrtf (float __x) __attribute__ ((__nothrow__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__)); extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float cbrtf (float __x) __attribute__ ((__nothrow__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__)); extern float ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern int __isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float significandf (float __x) __attribute__ ((__nothrow__)); extern float __significandf (float __x) __attribute__ ((__nothrow__)); extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float nanf (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float j0f (float) __attribute__ ((__nothrow__)); extern float __j0f (float) __attribute__ ((__nothrow__)); extern float j1f (float) __attribute__ ((__nothrow__)); extern float __j1f (float) __attribute__ ((__nothrow__)); extern float jnf (int, float) __attribute__ ((__nothrow__)); extern float __jnf (int, float) __attribute__ ((__nothrow__)); extern float y0f (float) __attribute__ ((__nothrow__)); extern float __y0f (float) __attribute__ ((__nothrow__)); extern float y1f (float) __attribute__ ((__nothrow__)); extern float __y1f (float) __attribute__ ((__nothrow__)); extern float ynf (int, float) __attribute__ ((__nothrow__)); extern float __ynf (int, float) __attribute__ ((__nothrow__)); extern float erff (float) __attribute__ ((__nothrow__)); extern float __erff (float) __attribute__ ((__nothrow__)); extern float erfcf (float) __attribute__ ((__nothrow__)); extern float __erfcf (float) __attribute__ ((__nothrow__)); extern float lgammaf (float) __attribute__ ((__nothrow__)); extern float __lgammaf (float) __attribute__ ((__nothrow__)); extern float tgammaf (float) __attribute__ ((__nothrow__)); extern float __tgammaf (float) __attribute__ ((__nothrow__)); extern float gammaf (float) __attribute__ ((__nothrow__)); extern float __gammaf (float) __attribute__ ((__nothrow__)); extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float rintf (float __x) __attribute__ ((__nothrow__)); extern float __rintf (float __x) __attribute__ ((__nothrow__)); extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern int ilogbf (float __x) __attribute__ ((__nothrow__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__)); extern float scalblnf (float __x, long int __n) __attribute__ ((__nothrow__)); extern float __scalblnf (float __x, long int __n) __attribute__ ((__nothrow__)); extern float nearbyintf (float __x) __attribute__ ((__nothrow__)); extern float __nearbyintf (float __x) __attribute__ ((__nothrow__)); extern float roundf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __roundf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float truncf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __truncf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__)); extern float __remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__)); extern long int lrintf (float __x) __attribute__ ((__nothrow__)); extern long int __lrintf (float __x) __attribute__ ((__nothrow__)); extern long long int llrintf (float __x) __attribute__ ((__nothrow__)); extern long long int __llrintf (float __x) __attribute__ ((__nothrow__)); extern long int lroundf (float __x) __attribute__ ((__nothrow__)); extern long int __lroundf (float __x) __attribute__ ((__nothrow__)); extern long long int llroundf (float __x) __attribute__ ((__nothrow__)); extern long long int __llroundf (float __x) __attribute__ ((__nothrow__)); extern float fdimf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fdimf (float __x, float __y) __attribute__ ((__nothrow__)); extern float fmaxf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmaxf (float __x, float __y) __attribute__ ((__nothrow__)); extern float fminf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fminf (float __x, float __y) __attribute__ ((__nothrow__)); extern int __fpclassifyf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __signbitf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__)); extern float __fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__)); extern float scalbf (float __x, float __n) __attribute__ ((__nothrow__)); extern float __scalbf (float __x, float __n) __attribute__ ((__nothrow__)); # 95 "/usr/include/math.h" 2 3 4 # 141 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern long double acosl (long double __x) __attribute__ ((__nothrow__)); extern long double __acosl (long double __x) __attribute__ ((__nothrow__)); extern long double asinl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinl (long double __x) __attribute__ ((__nothrow__)); extern long double atanl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanl (long double __x) __attribute__ ((__nothrow__)); extern long double atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); extern long double __atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); extern long double cosl (long double __x) __attribute__ ((__nothrow__)); extern long double __cosl (long double __x) __attribute__ ((__nothrow__)); extern long double sinl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__)); extern long double tanl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanl (long double __x) __attribute__ ((__nothrow__)); extern long double coshl (long double __x) __attribute__ ((__nothrow__)); extern long double __coshl (long double __x) __attribute__ ((__nothrow__)); extern long double sinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinhl (long double __x) __attribute__ ((__nothrow__)); extern long double tanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanhl (long double __x) __attribute__ ((__nothrow__)); extern void sincosl (long double __x, long double *__sinx, long double *__cosx) __attribute__ ((__nothrow__)); extern void __sincosl (long double __x, long double *__sinx, long double *__cosx) __attribute__ ((__nothrow__)); extern long double acoshl (long double __x) __attribute__ ((__nothrow__)); extern long double __acoshl (long double __x) __attribute__ ((__nothrow__)); extern long double asinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinhl (long double __x) __attribute__ ((__nothrow__)); extern long double atanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanhl (long double __x) __attribute__ ((__nothrow__)); extern long double expl (long double __x) __attribute__ ((__nothrow__)); extern long double __expl (long double __x) __attribute__ ((__nothrow__)); extern long double frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); extern long double __frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); extern long double ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); extern long double __ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); extern long double logl (long double __x) __attribute__ ((__nothrow__)); extern long double __logl (long double __x) __attribute__ ((__nothrow__)); extern long double log10l (long double __x) __attribute__ ((__nothrow__)); extern long double __log10l (long double __x) __attribute__ ((__nothrow__)); extern long double modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); extern long double __modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); extern long double exp10l (long double __x) __attribute__ ((__nothrow__)); extern long double __exp10l (long double __x) __attribute__ ((__nothrow__)); extern long double pow10l (long double __x) __attribute__ ((__nothrow__)); extern long double __pow10l (long double __x) __attribute__ ((__nothrow__)); extern long double expm1l (long double __x) __attribute__ ((__nothrow__)); extern long double __expm1l (long double __x) __attribute__ ((__nothrow__)); extern long double log1pl (long double __x) __attribute__ ((__nothrow__)); extern long double __log1pl (long double __x) __attribute__ ((__nothrow__)); extern long double logbl (long double __x) __attribute__ ((__nothrow__)); extern long double __logbl (long double __x) __attribute__ ((__nothrow__)); extern long double exp2l (long double __x) __attribute__ ((__nothrow__)); extern long double __exp2l (long double __x) __attribute__ ((__nothrow__)); extern long double log2l (long double __x) __attribute__ ((__nothrow__)); extern long double __log2l (long double __x) __attribute__ ((__nothrow__)); extern long double powl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __powl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double sqrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __sqrtl (long double __x) __attribute__ ((__nothrow__)); extern long double hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double cbrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __cbrtl (long double __x) __attribute__ ((__nothrow__)); extern long double ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern int __isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double significandl (long double __x) __attribute__ ((__nothrow__)); extern long double __significandl (long double __x) __attribute__ ((__nothrow__)); extern long double copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double nanl (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nanl (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double j0l (long double) __attribute__ ((__nothrow__)); extern long double __j0l (long double) __attribute__ ((__nothrow__)); extern long double j1l (long double) __attribute__ ((__nothrow__)); extern long double __j1l (long double) __attribute__ ((__nothrow__)); extern long double jnl (int, long double) __attribute__ ((__nothrow__)); extern long double __jnl (int, long double) __attribute__ ((__nothrow__)); extern long double y0l (long double) __attribute__ ((__nothrow__)); extern long double __y0l (long double) __attribute__ ((__nothrow__)); extern long double y1l (long double) __attribute__ ((__nothrow__)); extern long double __y1l (long double) __attribute__ ((__nothrow__)); extern long double ynl (int, long double) __attribute__ ((__nothrow__)); extern long double __ynl (int, long double) __attribute__ ((__nothrow__)); extern long double erfl (long double) __attribute__ ((__nothrow__)); extern long double __erfl (long double) __attribute__ ((__nothrow__)); extern long double erfcl (long double) __attribute__ ((__nothrow__)); extern long double __erfcl (long double) __attribute__ ((__nothrow__)); extern long double lgammal (long double) __attribute__ ((__nothrow__)); extern long double __lgammal (long double) __attribute__ ((__nothrow__)); extern long double tgammal (long double) __attribute__ ((__nothrow__)); extern long double __tgammal (long double) __attribute__ ((__nothrow__)); extern long double gammal (long double) __attribute__ ((__nothrow__)); extern long double __gammal (long double) __attribute__ ((__nothrow__)); extern long double lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); extern long double __lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); extern long double rintl (long double __x) __attribute__ ((__nothrow__)); extern long double __rintl (long double __x) __attribute__ ((__nothrow__)); extern long double nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); extern long double __scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); extern int ilogbl (long double __x) __attribute__ ((__nothrow__)); extern int __ilogbl (long double __x) __attribute__ ((__nothrow__)); extern long double scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__)); extern long double __scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__)); extern long double nearbyintl (long double __x) __attribute__ ((__nothrow__)); extern long double __nearbyintl (long double __x) __attribute__ ((__nothrow__)); extern long double roundl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __roundl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double truncl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __truncl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__)); extern long double __remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__)); extern long int lrintl (long double __x) __attribute__ ((__nothrow__)); extern long int __lrintl (long double __x) __attribute__ ((__nothrow__)); extern long long int llrintl (long double __x) __attribute__ ((__nothrow__)); extern long long int __llrintl (long double __x) __attribute__ ((__nothrow__)); extern long int lroundl (long double __x) __attribute__ ((__nothrow__)); extern long int __lroundl (long double __x) __attribute__ ((__nothrow__)); extern long long int llroundl (long double __x) __attribute__ ((__nothrow__)); extern long long int __llroundl (long double __x) __attribute__ ((__nothrow__)); extern long double fdiml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fdiml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double fminl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fminl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern int __fpclassifyl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __signbitl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__)); extern long double __fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__)); extern long double scalbl (long double __x, long double __n) __attribute__ ((__nothrow__)); extern long double __scalbl (long double __x, long double __n) __attribute__ ((__nothrow__)); # 142 "/usr/include/math.h" 2 3 4 # 157 "/usr/include/math.h" 3 4 extern int signgam; # 198 "/usr/include/math.h" 3 4 enum { FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL }; # 284 "/usr/include/math.h" 3 4 typedef enum { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_, _ISOC_ } _LIB_VERSION_TYPE; extern _LIB_VERSION_TYPE _LIB_VERSION; # 309 "/usr/include/math.h" 3 4 struct exception { int type; char *name; double arg1; double arg2; double retval; }; extern int matherr (struct exception *__exc); # 409 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathinline.h" 1 3 4 # 127 "/usr/include/bits/mathinline.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) __signbitf (float __x) { __extension__ union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0; } extern __inline int __attribute__ ((__nothrow__)) __signbit (double __x) { __extension__ union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[1] < 0; } extern __inline int __attribute__ ((__nothrow__)) __signbitl (long double __x) { __extension__ union { long double __l; int __i[3]; } __u = { __l: __x }; return (__u.__i[2] & 0x8000) != 0; } # 291 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __sgn (double) __attribute__ ((__nothrow__)); extern __inline double __attribute__ ((__nothrow__)) __sgn (double __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } extern __inline float __sgnf (float) __attribute__ ((__nothrow__)); extern __inline float __attribute__ ((__nothrow__)) __sgnf (float __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } extern __inline long double __sgnl (long double) __attribute__ ((__nothrow__)); extern __inline long double __attribute__ ((__nothrow__)) __sgnl (long double __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } # 433 "/usr/include/bits/mathinline.h" 3 4 extern __inline long double __attribute__ ((__nothrow__)) __atan2l (long double __y, long double __x) { return __builtin_atan2l (__y, __x); } # 473 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __attribute__ ((__nothrow__)) fabs (double __x) { return __builtin_fabs (__x); } extern __inline float __attribute__ ((__nothrow__)) fabsf (float __x) { return __builtin_fabsf (__x); } extern __inline long double __attribute__ ((__nothrow__)) fabsl (long double __x) { return __builtin_fabsl (__x); } extern __inline long double __attribute__ ((__nothrow__)) __fabsl (long double __x) { return __builtin_fabsl (__x); } # 506 "/usr/include/bits/mathinline.h" 3 4 extern __inline long double __sgn1l (long double) __attribute__ ((__nothrow__)); extern __inline long double __attribute__ ((__nothrow__)) __sgn1l (long double __x) { __extension__ union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x }; __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; __n.__xi[1] = 0x80000000; __n.__xi[0] = 0; return __n.__xld; } # 530 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __attribute__ ((__nothrow__)) floor (double __x) { register long double __value; register int __ignore; unsigned short int __cw; unsigned short int __cwtmp; __asm __volatile ("fnstcw %3\n\t" "movzwl %3, %1\n\t" "andl $0xf3ff, %1\n\t" "orl $0x0400, %1\n\t" "movw %w1, %2\n\t" "fldcw %2\n\t" "frndint\n\t" "fldcw %3" : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), "=m" (__cw) : "0" (__x)); return __value; } extern __inline float __attribute__ ((__nothrow__)) floorf (float __x) { register long double __value; register int __ignore; unsigned short int __cw; unsigned short int __cwtmp; __asm __volatile ("fnstcw %3\n\t" "movzwl %3, %1\n\t" "andl $0xf3ff, %1\n\t" "orl $0x0400, %1\n\t" "movw %w1, %2\n\t" "fldcw %2\n\t" "frndint\n\t" "fldcw %3" : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), "=m" (__cw) : "0" (__x)); return __value; } extern __inline long double __attribute__ ((__nothrow__)) floorl (long double __x) { register long double __value; register int __ignore; unsigned short int __cw; unsigned short int __cwtmp; __asm __volatile ("fnstcw %3\n\t" "movzwl %3, %1\n\t" "andl $0xf3ff, %1\n\t" "orl $0x0400, %1\n\t" "movw %w1, %2\n\t" "fldcw %2\n\t" "frndint\n\t" "fldcw %3" : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), "=m" (__cw) : "0" (__x)); return __value; } # 548 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __attribute__ ((__nothrow__)) ceil (double __x) { register long double __value; register int __ignore; unsigned short int __cw; unsigned short int __cwtmp; __asm __volatile ("fnstcw %3\n\t" "movzwl %3, %1\n\t" "andl $0xf3ff, %1\n\t" "orl $0x0800, %1\n\t" "movw %w1, %2\n\t" "fldcw %2\n\t" "frndint\n\t" "fldcw %3" : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), "=m" (__cw) : "0" (__x)); return __value; } extern __inline float __attribute__ ((__nothrow__)) ceilf (float __x) { register long double __value; register int __ignore; unsigned short int __cw; unsigned short int __cwtmp; __asm __volatile ("fnstcw %3\n\t" "movzwl %3, %1\n\t" "andl $0xf3ff, %1\n\t" "orl $0x0800, %1\n\t" "movw %w1, %2\n\t" "fldcw %2\n\t" "frndint\n\t" "fldcw %3" : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), "=m" (__cw) : "0" (__x)); return __value; } extern __inline long double __attribute__ ((__nothrow__)) ceill (long double __x) { register long double __value; register int __ignore; unsigned short int __cw; unsigned short int __cwtmp; __asm __volatile ("fnstcw %3\n\t" "movzwl %3, %1\n\t" "andl $0xf3ff, %1\n\t" "orl $0x0800, %1\n\t" "movw %w1, %2\n\t" "fldcw %2\n\t" "frndint\n\t" "fldcw %3" : "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), "=m" (__cw) : "0" (__x)); return __value; } # 667 "/usr/include/bits/mathinline.h" 3 4 extern __inline long int __attribute__ ((__nothrow__)) lrintf (float __x) { long int __lrintres; __asm__ __volatile__ ("fistpl %0" : "=m" (__lrintres) : "t" (__x) : "st"); return __lrintres; } extern __inline long int __attribute__ ((__nothrow__)) lrint (double __x) { long int __lrintres; __asm__ __volatile__ ("fistpl %0" : "=m" (__lrintres) : "t" (__x) : "st"); return __lrintres; } extern __inline long int __attribute__ ((__nothrow__)) lrintl (long double __x) { long int __lrintres; __asm__ __volatile__ ("fistpl %0" : "=m" (__lrintres) : "t" (__x) : "st"); return __lrintres; } # 690 "/usr/include/bits/mathinline.h" 3 4 extern __inline long long int __attribute__ ((__nothrow__)) llrintf (float __x) { long long int __llrintres; __asm__ __volatile__ ("fistpll %0" : "=m" (__llrintres) : "t" (__x) : "st"); return __llrintres; } extern __inline long long int __attribute__ ((__nothrow__)) llrint (double __x) { long long int __llrintres; __asm__ __volatile__ ("fistpll %0" : "=m" (__llrintres) : "t" (__x) : "st"); return __llrintres; } extern __inline long long int __attribute__ ((__nothrow__)) llrintl (long double __x) { long long int __llrintres; __asm__ __volatile__ ("fistpll %0" : "=m" (__llrintres) : "t" (__x) : "st"); return __llrintres; } # 727 "/usr/include/bits/mathinline.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) __finite (double __x) { return (__extension__ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] | 0x800fffffu) + 1) >> 31)); } # 410 "/usr/include/math.h" 2 3 4 # 465 "/usr/include/math.h" 3 4 # 221 "Include/pyport.h" 2 # 1 "/usr/include/sys/time.h" 1 3 4 # 27 "/usr/include/sys/time.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 # 28 "/usr/include/sys/time.h" 2 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 30 "/usr/include/sys/time.h" 2 3 4 # 39 "/usr/include/sys/time.h" 3 4 # 57 "/usr/include/sys/time.h" 3 4 struct timezone { int tz_minuteswest; int tz_dsttime; }; typedef struct timezone *__restrict __timezone_ptr_t; # 73 "/usr/include/sys/time.h" 3 4 extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int settimeofday (__const struct timeval *__tv, __const struct timezone *__tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int adjtime (__const struct timeval *__delta, struct timeval *__olddelta) __attribute__ ((__nothrow__)); enum __itimer_which { ITIMER_REAL = 0, ITIMER_VIRTUAL = 1, ITIMER_PROF = 2 }; struct itimerval { struct timeval it_interval; struct timeval it_value; }; typedef enum __itimer_which __itimer_which_t; extern int getitimer (__itimer_which_t __which, struct itimerval *__value) __attribute__ ((__nothrow__)); extern int setitimer (__itimer_which_t __which, __const struct itimerval *__restrict __new, struct itimerval *__restrict __old) __attribute__ ((__nothrow__)); extern int utimes (__const char *__file, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int futimes (int __fd, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)); extern int futimesat (int __fd, __const char *__file, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)); # 191 "/usr/include/sys/time.h" 3 4 # 228 "Include/pyport.h" 2 # 1 "/usr/include/time.h" 1 3 4 # 31 "/usr/include/time.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 40 "/usr/include/time.h" 2 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 44 "/usr/include/time.h" 2 3 4 # 132 "/usr/include/time.h" 3 4 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; __const char *tm_zone; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; struct sigevent; # 181 "/usr/include/time.h" 3 4 extern clock_t clock (void) __attribute__ ((__nothrow__)); extern time_t time (time_t *__timer) __attribute__ ((__nothrow__)); extern double difftime (time_t __time1, time_t __time0) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__)); extern size_t strftime (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); extern char *strptime (__const char *__restrict __s, __const char *__restrict __fmt, struct tm *__tp) __attribute__ ((__nothrow__)); extern size_t strftime_l (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp, __locale_t __loc) __attribute__ ((__nothrow__)); extern char *strptime_l (__const char *__restrict __s, __const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __attribute__ ((__nothrow__)); extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__)); extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__)); extern struct tm *gmtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__ ((__nothrow__)); extern struct tm *localtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__ ((__nothrow__)); extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__)); extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__)); extern char *asctime_r (__const struct tm *__restrict __tp, char *__restrict __buf) __attribute__ ((__nothrow__)); extern char *ctime_r (__const time_t *__restrict __timer, char *__restrict __buf) __attribute__ ((__nothrow__)); extern char *__tzname[2]; extern int __daylight; extern long int __timezone; extern char *tzname[2]; extern void tzset (void) __attribute__ ((__nothrow__)); extern int daylight; extern long int timezone; extern int stime (__const time_t *__when) __attribute__ ((__nothrow__)); # 312 "/usr/include/time.h" 3 4 extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__)); extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__)); extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); # 327 "/usr/include/time.h" 3 4 extern int nanosleep (__const struct timespec *__requested_time, struct timespec *__remaining); extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__)); extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__)); extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) __attribute__ ((__nothrow__)); extern int clock_nanosleep (clockid_t __clock_id, int __flags, __const struct timespec *__req, struct timespec *__rem); extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__)); extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __attribute__ ((__nothrow__)); extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__)); extern int timer_settime (timer_t __timerid, int __flags, __const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__)); extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __attribute__ ((__nothrow__)); extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__)); # 389 "/usr/include/time.h" 3 4 extern int getdate_err; # 398 "/usr/include/time.h" 3 4 extern struct tm *getdate (__const char *__string); # 412 "/usr/include/time.h" 3 4 extern int getdate_r (__const char *__restrict __string, struct tm *__restrict __resbufp); # 229 "Include/pyport.h" 2 # 285 "Include/pyport.h" # 1 "/usr/include/sys/stat.h" 1 3 4 # 105 "/usr/include/sys/stat.h" 3 4 # 1 "/usr/include/bits/stat.h" 1 3 4 # 36 "/usr/include/bits/stat.h" 3 4 struct stat { __dev_t st_dev; unsigned short int __pad1; __ino_t __st_ino; __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; unsigned short int __pad2; __off64_t st_size; __blksize_t st_blksize; __blkcnt64_t st_blocks; # 70 "/usr/include/bits/stat.h" 3 4 struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; # 88 "/usr/include/bits/stat.h" 3 4 __ino64_t st_ino; }; struct stat64 { __dev_t st_dev; unsigned int __pad1; __ino_t __st_ino; __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; unsigned int __pad2; __off64_t st_size; __blksize_t st_blksize; __blkcnt64_t st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; # 127 "/usr/include/bits/stat.h" 3 4 __ino64_t st_ino; }; # 108 "/usr/include/sys/stat.h" 2 3 4 # 217 "/usr/include/sys/stat.h" 3 4 extern int stat (__const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int stat64 (__const char *__restrict __file, struct stat64 *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); # 243 "/usr/include/sys/stat.h" 3 4 extern int fstatat (int __fd, __const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); # 252 "/usr/include/sys/stat.h" 3 4 extern int fstatat64 (int __fd, __const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); # 265 "/usr/include/sys/stat.h" 3 4 extern int lstat (__const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int lstat64 (__const char *__restrict __file, struct stat64 *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int chmod (__const char *__file, __mode_t __mode) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int lchmod (__const char *__file, __mode_t __mode) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__)); extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ; extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__)); extern __mode_t getumask (void) __attribute__ ((__nothrow__)); extern int mkdir (__const char *__path, __mode_t __mode) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int mkdirat (int __fd, __const char *__path, __mode_t __mode) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int mknodat (int __fd, __const char *__path, __mode_t __mode, __dev_t __dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int mkfifo (__const char *__path, __mode_t __mode) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int utimensat (int __fd, __const char *__path, __const struct timespec __times[2], int __flags) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int futimens (int __fd, __const struct timespec __times[2]) __attribute__ ((__nothrow__)); # 408 "/usr/include/sys/stat.h" 3 4 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) __asm__ ("" "__fxstat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); extern int __xstat (int __ver, __const char *__filename, struct stat *__stat_buf) __asm__ ("" "__xstat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern int __lxstat (int __ver, __const char *__filename, struct stat *__stat_buf) __asm__ ("" "__lxstat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern int __fxstatat (int __ver, int __fildes, __const char *__filename, struct stat *__stat_buf, int __flag) __asm__ ("" "__fxstatat64") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))); # 430 "/usr/include/sys/stat.h" 3 4 extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); extern int __xstat64 (int __ver, __const char *__filename, struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern int __lxstat64 (int __ver, __const char *__filename, struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern int __fxstatat64 (int __ver, int __fildes, __const char *__filename, struct stat64 *__stat_buf, int __flag) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))); extern int __xmknod (int __ver, __const char *__path, __mode_t __mode, __dev_t *__dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); extern int __xmknodat (int __ver, int __fd, __const char *__path, __mode_t __mode, __dev_t *__dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 5))); extern __inline int __attribute__ ((__nothrow__)) stat (__const char *__path, struct stat *__statbuf) { return __xstat (3, __path, __statbuf); } extern __inline int __attribute__ ((__nothrow__)) lstat (__const char *__path, struct stat *__statbuf) { return __lxstat (3, __path, __statbuf); } extern __inline int __attribute__ ((__nothrow__)) fstat (int __fd, struct stat *__statbuf) { return __fxstat (3, __fd, __statbuf); } extern __inline int __attribute__ ((__nothrow__)) fstatat (int __fd, __const char *__filename, struct stat *__statbuf, int __flag) { return __fxstatat (3, __fd, __filename, __statbuf, __flag); } extern __inline int __attribute__ ((__nothrow__)) mknod (__const char *__path, __mode_t __mode, __dev_t __dev) { return __xmknod (1, __path, __mode, &__dev); } extern __inline int __attribute__ ((__nothrow__)) mknodat (int __fd, __const char *__path, __mode_t __mode, __dev_t __dev) { return __xmknodat (1, __fd, __path, __mode, &__dev); } extern __inline int __attribute__ ((__nothrow__)) stat64 (__const char *__path, struct stat64 *__statbuf) { return __xstat64 (3, __path, __statbuf); } extern __inline int __attribute__ ((__nothrow__)) lstat64 (__const char *__path, struct stat64 *__statbuf) { return __lxstat64 (3, __path, __statbuf); } extern __inline int __attribute__ ((__nothrow__)) fstat64 (int __fd, struct stat64 *__statbuf) { return __fxstat64 (3, __fd, __statbuf); } extern __inline int __attribute__ ((__nothrow__)) fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf, int __flag) { return __fxstatat64 (3, __fd, __filename, __statbuf, __flag); } # 286 "Include/pyport.h" 2 # 58 "Include/Python.h" 2 # 76 "Include/Python.h" # 1 "Include/pymem.h" 1 # 50 "Include/pymem.h" void * PyMem_Malloc(size_t); void * PyMem_Realloc(void *, size_t); void PyMem_Free(void *); # 77 "Include/Python.h" 2 # 1 "Include/object.h" 1 # 103 "Include/object.h" typedef struct _object { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; } PyObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size; } PyVarObject; # 127 "Include/object.h" typedef PyObject * (*unaryfunc)(PyObject *); typedef PyObject * (*binaryfunc)(PyObject *, PyObject *); typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *); typedef int (*inquiry)(PyObject *); typedef Py_ssize_t (*lenfunc)(PyObject *); typedef int (*coercion)(PyObject **, PyObject **); typedef PyObject *(*intargfunc)(PyObject *, int) __attribute__((__deprecated__)); typedef PyObject *(*intintargfunc)(PyObject *, int, int) __attribute__((__deprecated__)); typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t); typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t); typedef int(*intobjargproc)(PyObject *, int, PyObject *); typedef int(*intintobjargproc)(PyObject *, int, int, PyObject *); typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); typedef int (*getreadbufferproc)(PyObject *, int, void **); typedef int (*getwritebufferproc)(PyObject *, int, void **); typedef int (*getsegcountproc)(PyObject *, int *); typedef int (*getcharbufferproc)(PyObject *, int, char **); typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **); typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **); typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *); typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **); typedef int (*objobjproc)(PyObject *, PyObject *); typedef int (*visitproc)(PyObject *, void *); typedef int (*traverseproc)(PyObject *, visitproc, void *); typedef struct { # 167 "Include/object.h" binaryfunc nb_add; binaryfunc nb_subtract; binaryfunc nb_multiply; binaryfunc nb_divide; binaryfunc nb_remainder; binaryfunc nb_divmod; ternaryfunc nb_power; unaryfunc nb_negative; unaryfunc nb_positive; unaryfunc nb_absolute; inquiry nb_nonzero; unaryfunc nb_invert; binaryfunc nb_lshift; binaryfunc nb_rshift; binaryfunc nb_and; binaryfunc nb_xor; binaryfunc nb_or; coercion nb_coerce; unaryfunc nb_int; unaryfunc nb_long; unaryfunc nb_float; unaryfunc nb_oct; unaryfunc nb_hex; binaryfunc nb_inplace_add; binaryfunc nb_inplace_subtract; binaryfunc nb_inplace_multiply; binaryfunc nb_inplace_divide; binaryfunc nb_inplace_remainder; ternaryfunc nb_inplace_power; binaryfunc nb_inplace_lshift; binaryfunc nb_inplace_rshift; binaryfunc nb_inplace_and; binaryfunc nb_inplace_xor; binaryfunc nb_inplace_or; binaryfunc nb_floor_divide; binaryfunc nb_true_divide; binaryfunc nb_inplace_floor_divide; binaryfunc nb_inplace_true_divide; unaryfunc nb_index; } PyNumberMethods; typedef struct { lenfunc sq_length; binaryfunc sq_concat; ssizeargfunc sq_repeat; ssizeargfunc sq_item; ssizessizeargfunc sq_slice; ssizeobjargproc sq_ass_item; ssizessizeobjargproc sq_ass_slice; objobjproc sq_contains; binaryfunc sq_inplace_concat; ssizeargfunc sq_inplace_repeat; } PySequenceMethods; typedef struct { lenfunc mp_length; binaryfunc mp_subscript; objobjargproc mp_ass_subscript; } PyMappingMethods; typedef struct { readbufferproc bf_getreadbuffer; writebufferproc bf_getwritebuffer; segcountproc bf_getsegcount; charbufferproc bf_getcharbuffer; } PyBufferProcs; typedef void (*freefunc)(void *); typedef void (*destructor)(PyObject *); typedef int (*printfunc)(PyObject *, FILE *, int); typedef PyObject *(*getattrfunc)(PyObject *, char *); typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); typedef int (*setattrfunc)(PyObject *, char *, PyObject *); typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *); typedef int (*cmpfunc)(PyObject *, PyObject *); typedef PyObject *(*reprfunc)(PyObject *); typedef long (*hashfunc)(PyObject *); typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int); typedef PyObject *(*getiterfunc) (PyObject *); typedef PyObject *(*iternextfunc) (PyObject *); typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *); typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *); typedef int (*initproc)(PyObject *, PyObject *, PyObject *); typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *); typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t); typedef struct _typeobject { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size; const char *tp_name; Py_ssize_t tp_basicsize, tp_itemsize; destructor tp_dealloc; printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; cmpfunc tp_compare; reprfunc tp_repr; PyNumberMethods *tp_as_number; PySequenceMethods *tp_as_sequence; PyMappingMethods *tp_as_mapping; hashfunc tp_hash; ternaryfunc tp_call; reprfunc tp_str; getattrofunc tp_getattro; setattrofunc tp_setattro; PyBufferProcs *tp_as_buffer; long tp_flags; const char *tp_doc; traverseproc tp_traverse; inquiry tp_clear; richcmpfunc tp_richcompare; Py_ssize_t tp_weaklistoffset; getiterfunc tp_iter; iternextfunc tp_iternext; struct PyMethodDef *tp_methods; struct PyMemberDef *tp_members; struct PyGetSetDef *tp_getset; struct _typeobject *tp_base; PyObject *tp_dict; descrgetfunc tp_descr_get; descrsetfunc tp_descr_set; Py_ssize_t tp_dictoffset; initproc tp_init; allocfunc tp_alloc; newfunc tp_new; freefunc tp_free; inquiry tp_is_gc; PyObject *tp_bases; PyObject *tp_mro; PyObject *tp_cache; PyObject *tp_subclasses; PyObject *tp_weaklist; destructor tp_del; # 345 "Include/object.h" } PyTypeObject; typedef struct _heaptypeobject { PyTypeObject ht_type; PyNumberMethods as_number; PyMappingMethods as_mapping; PySequenceMethods as_sequence; PyBufferProcs as_buffer; PyObject *ht_name, *ht_slots; } PyHeapTypeObject; int PyType_IsSubtype(PyTypeObject *, PyTypeObject *); extern PyTypeObject PyType_Type; extern PyTypeObject PyBaseObject_Type; extern PyTypeObject PySuper_Type; int PyType_Ready(PyTypeObject *); PyObject * PyType_GenericAlloc(PyTypeObject *, Py_ssize_t); PyObject * PyType_GenericNew(PyTypeObject *, PyObject *, PyObject *); PyObject * _PyType_Lookup(PyTypeObject *, PyObject *); int PyObject_Print(PyObject *, FILE *, int); void _PyObject_Dump(PyObject *); PyObject * PyObject_Repr(PyObject *); PyObject * _PyObject_Str(PyObject *); PyObject * PyObject_Str(PyObject *); PyObject * PyObject_Unicode(PyObject *); int PyObject_Compare(PyObject *, PyObject *); PyObject * PyObject_RichCompare(PyObject *, PyObject *, int); int PyObject_RichCompareBool(PyObject *, PyObject *, int); PyObject * PyObject_GetAttrString(PyObject *, const char *); int PyObject_SetAttrString(PyObject *, const char *, PyObject *); int PyObject_HasAttrString(PyObject *, const char *); PyObject * PyObject_GetAttr(PyObject *, PyObject *); int PyObject_SetAttr(PyObject *, PyObject *, PyObject *); int PyObject_HasAttr(PyObject *, PyObject *); PyObject ** _PyObject_GetDictPtr(PyObject *); PyObject * PyObject_SelfIter(PyObject *); PyObject * PyObject_GenericGetAttr(PyObject *, PyObject *); int PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *); long PyObject_Hash(PyObject *); int PyObject_IsTrue(PyObject *); int PyObject_Not(PyObject *); int PyCallable_Check(PyObject *); int PyNumber_Coerce(PyObject **, PyObject **); int PyNumber_CoerceEx(PyObject **, PyObject **); void PyObject_ClearWeakRefs(PyObject *); extern int _PyObject_SlotCompare(PyObject *, PyObject *); PyObject * PyObject_Dir(PyObject *); int Py_ReprEnter(PyObject *); void Py_ReprLeave(PyObject *); long _Py_HashDouble(double); long _Py_HashPointer(void*); # 701 "Include/object.h" void Py_IncRef(PyObject *); void Py_DecRef(PyObject *); extern PyObject _Py_NoneStruct; # 720 "Include/object.h" extern PyObject _Py_NotImplementedStruct; # 734 "Include/object.h" extern int _Py_SwappedOp[]; # 846 "Include/object.h" void _PyTrash_deposit_object(PyObject*); void _PyTrash_destroy_chain(void); extern int _PyTrash_delete_nesting; extern PyObject * _PyTrash_delete_later; # 79 "Include/Python.h" 2 # 1 "Include/objimpl.h" 1 # 97 "Include/objimpl.h" void * PyObject_Malloc(size_t); void * PyObject_Realloc(void *, size_t); void PyObject_Free(void *); # 143 "Include/objimpl.h" PyObject * PyObject_Init(PyObject *, PyTypeObject *); PyVarObject * PyObject_InitVar(PyVarObject *, PyTypeObject *, Py_ssize_t); PyObject * _PyObject_New(PyTypeObject *); PyVarObject * _PyObject_NewVar(PyTypeObject *, Py_ssize_t); # 228 "Include/objimpl.h" Py_ssize_t PyGC_Collect(void); # 237 "Include/objimpl.h" PyVarObject * _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); typedef union _gc_head { struct { union _gc_head *gc_next; union _gc_head *gc_prev; Py_ssize_t gc_refs; } gc; long double dummy; } PyGC_Head; extern PyGC_Head *_PyGC_generation0; # 288 "Include/objimpl.h" PyObject * _PyObject_GC_Malloc(size_t); PyObject * _PyObject_GC_New(PyTypeObject *); PyVarObject * _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t); void PyObject_GC_Track(void *); void PyObject_GC_UnTrack(void *); void PyObject_GC_Del(void *); # 80 "Include/Python.h" 2 # 1 "Include/pydebug.h" 1 extern int Py_DebugFlag; extern int Py_VerboseFlag; extern int Py_InteractiveFlag; extern int Py_OptimizeFlag; extern int Py_NoSiteFlag; extern int Py_UseClassExceptionsFlag; extern int Py_FrozenFlag; extern int Py_TabcheckFlag; extern int Py_UnicodeFlag; extern int Py_IgnoreEnvironmentFlag; extern int Py_DivisionWarningFlag; extern int _Py_QnewFlag; void Py_FatalError(const char *message); # 82 "Include/Python.h" 2 # 1 "Include/unicodeobject.h" 1 # 55 "Include/unicodeobject.h" # 1 "/usr/include/ctype.h" 1 3 4 # 30 "/usr/include/ctype.h" 3 4 # 48 "/usr/include/ctype.h" 3 4 enum { _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)), _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)), _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)), _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)), _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)), _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)), _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)), _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)), _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)), _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)), _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)), _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8)) }; # 81 "/usr/include/ctype.h" 3 4 extern __const unsigned short int **__ctype_b_loc (void) __attribute__ ((__nothrow__)) __attribute__ ((__const)); extern __const __int32_t **__ctype_tolower_loc (void) __attribute__ ((__nothrow__)) __attribute__ ((__const)); extern __const __int32_t **__ctype_toupper_loc (void) __attribute__ ((__nothrow__)) __attribute__ ((__const)); # 96 "/usr/include/ctype.h" 3 4 extern int isalnum (int) __attribute__ ((__nothrow__)); extern int isalpha (int) __attribute__ ((__nothrow__)); extern int iscntrl (int) __attribute__ ((__nothrow__)); extern int isdigit (int) __attribute__ ((__nothrow__)); extern int islower (int) __attribute__ ((__nothrow__)); extern int isgraph (int) __attribute__ ((__nothrow__)); extern int isprint (int) __attribute__ ((__nothrow__)); extern int ispunct (int) __attribute__ ((__nothrow__)); extern int isspace (int) __attribute__ ((__nothrow__)); extern int isupper (int) __attribute__ ((__nothrow__)); extern int isxdigit (int) __attribute__ ((__nothrow__)); extern int tolower (int __c) __attribute__ ((__nothrow__)); extern int toupper (int __c) __attribute__ ((__nothrow__)); extern int isblank (int) __attribute__ ((__nothrow__)); extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__)); extern int isascii (int __c) __attribute__ ((__nothrow__)); extern int toascii (int __c) __attribute__ ((__nothrow__)); extern int _toupper (int) __attribute__ ((__nothrow__)); extern int _tolower (int) __attribute__ ((__nothrow__)); # 190 "/usr/include/ctype.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) tolower (int __c) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; } extern __inline int __attribute__ ((__nothrow__)) toupper (int __c) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; } # 247 "/usr/include/ctype.h" 3 4 extern int isalnum_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isalpha_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int iscntrl_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int islower_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isgraph_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isprint_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int ispunct_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isspace_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isupper_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isxdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isblank_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int __tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); extern int tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); extern int __toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); extern int toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); # 323 "/usr/include/ctype.h" 3 4 # 56 "Include/unicodeobject.h" 2 # 118 "Include/unicodeobject.h" # 1 "/usr/include/wchar.h" 1 3 4 # 40 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stdarg.h" 1 3 4 # 41 "/usr/include/wchar.h" 2 3 4 # 52 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 355 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 3 4 typedef unsigned int wint_t; # 53 "/usr/include/wchar.h" 2 3 4 # 99 "/usr/include/wchar.h" 3 4 typedef __mbstate_t mbstate_t; # 124 "/usr/include/wchar.h" 3 4 struct tm; extern wchar_t *wcscpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) __attribute__ ((__nothrow__)); extern wchar_t *wcsncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n) __attribute__ ((__nothrow__)); extern wchar_t *wcscat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) __attribute__ ((__nothrow__)); extern wchar_t *wcsncat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n) __attribute__ ((__nothrow__)); extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) __attribute__ ((__nothrow__)); extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n) __attribute__ ((__nothrow__)); extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, __locale_t __loc) __attribute__ ((__nothrow__)); extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n, __locale_t __loc) __attribute__ ((__nothrow__)); extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __attribute__ ((__nothrow__)); extern size_t wcsxfrm (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) __attribute__ ((__nothrow__)); extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2, __locale_t __loc) __attribute__ ((__nothrow__)); extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2, size_t __n, __locale_t __loc) __attribute__ ((__nothrow__)); extern wchar_t *wcsdup (__const wchar_t *__s) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wcstok (wchar_t *__restrict __s, __const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __attribute__ ((__nothrow__)); extern size_t wcslen (__const wchar_t *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern int wmemcmp (__const wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern wchar_t *wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) __attribute__ ((__nothrow__)); extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n) __attribute__ ((__nothrow__)); extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __attribute__ ((__nothrow__)); extern wchar_t *wmempcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) __attribute__ ((__nothrow__)); extern wint_t btowc (int __c) __attribute__ ((__nothrow__)); extern int wctob (wint_t __c) __attribute__ ((__nothrow__)); extern int mbsinit (__const mbstate_t *__ps) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); extern size_t mbrtowc (wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n, mbstate_t *__p) __attribute__ ((__nothrow__)); extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); extern size_t __mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); extern size_t mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); extern wint_t __btowc_alias (int __c) __asm ("btowc"); extern __inline wint_t __attribute__ ((__nothrow__)) btowc (int __c) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias (__c)); } extern int __wctob_alias (wint_t __c) __asm ("wctob"); extern __inline int __attribute__ ((__nothrow__)) wctob (wint_t __wc) { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int) __wc : __wctob_alias (__wc)); } extern __inline size_t __attribute__ ((__nothrow__)) mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) { return (__ps != ((void *)0) ? mbrtowc (((void *)0), __s, __n, __ps) : __mbrlen (__s, __n, ((void *)0))); } extern size_t mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); extern size_t wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); extern size_t mbsnrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); extern size_t wcsnrtombs (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); extern int wcwidth (wchar_t __c) __attribute__ ((__nothrow__)); extern int wcswidth (__const wchar_t *__s, size_t __n) __attribute__ ((__nothrow__)); extern double wcstod (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __attribute__ ((__nothrow__)); extern float wcstof (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __attribute__ ((__nothrow__)); extern long double wcstold (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __attribute__ ((__nothrow__)); extern long int wcstol (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); __extension__ extern long long int wcstoll (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); __extension__ extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); __extension__ extern long long int wcstoq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); __extension__ extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); # 477 "/usr/include/wchar.h" 3 4 extern long int wcstol_l (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)); extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)); __extension__ extern long long int wcstoll_l (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)); __extension__ extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)); extern double wcstod_l (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)); extern float wcstof_l (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)); extern long double wcstold_l (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)); extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __attribute__ ((__nothrow__)); extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n) __attribute__ ((__nothrow__)); # 527 "/usr/include/wchar.h" 3 4 extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)); extern int fwide (__FILE *__fp, int __mode) __attribute__ ((__nothrow__)); extern int fwprintf (__FILE *__restrict __stream, __const wchar_t *__restrict __format, ...) ; extern int wprintf (__const wchar_t *__restrict __format, ...) ; extern int swprintf (wchar_t *__restrict __s, size_t __n, __const wchar_t *__restrict __format, ...) __attribute__ ((__nothrow__)) ; extern int vfwprintf (__FILE *__restrict __s, __const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vwprintf (__const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vswprintf (wchar_t *__restrict __s, size_t __n, __const wchar_t *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) ; extern int fwscanf (__FILE *__restrict __stream, __const wchar_t *__restrict __format, ...) ; extern int wscanf (__const wchar_t *__restrict __format, ...) ; extern int swscanf (__const wchar_t *__restrict __s, __const wchar_t *__restrict __format, ...) __attribute__ ((__nothrow__)) ; # 627 "/usr/include/wchar.h" 3 4 extern int vfwscanf (__FILE *__restrict __s, __const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vwscanf (__const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vswscanf (__const wchar_t *__restrict __s, __const wchar_t *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) ; # 683 "/usr/include/wchar.h" 3 4 extern wint_t fgetwc (__FILE *__stream); extern wint_t getwc (__FILE *__stream); extern wint_t getwchar (void); extern wint_t fputwc (wchar_t __wc, __FILE *__stream); extern wint_t putwc (wchar_t __wc, __FILE *__stream); extern wint_t putwchar (wchar_t __wc); extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); extern int fputws (__const wchar_t *__restrict __ws, __FILE *__restrict __stream); extern wint_t ungetwc (wint_t __wc, __FILE *__stream); # 748 "/usr/include/wchar.h" 3 4 extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); extern wint_t fgetwc_unlocked (__FILE *__stream); extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); # 774 "/usr/include/wchar.h" 3 4 extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); # 784 "/usr/include/wchar.h" 3 4 extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); extern int fputws_unlocked (__const wchar_t *__restrict __ws, __FILE *__restrict __stream); extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, __const wchar_t *__restrict __format, __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, __const wchar_t *__restrict __format, __const struct tm *__restrict __tp, __locale_t __loc) __attribute__ ((__nothrow__)); # 838 "/usr/include/wchar.h" 3 4 # 119 "Include/unicodeobject.h" 2 typedef unsigned int Py_UCS4; typedef unsigned long Py_UNICODE; # 383 "Include/unicodeobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t length; Py_UNICODE *str; long hash; PyObject *defenc; } PyUnicodeObject; extern PyTypeObject PyUnicode_Type; # 431 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_FromUnicode( const Py_UNICODE *u, Py_ssize_t size ); Py_UNICODE * PyUnicodeUCS4_AsUnicode( PyObject *unicode ); Py_ssize_t PyUnicodeUCS4_GetSize( PyObject *unicode ); Py_UNICODE PyUnicodeUCS4_GetMax(void); # 466 "Include/unicodeobject.h" int PyUnicodeUCS4_Resize( PyObject **unicode, Py_ssize_t length ); # 488 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_FromEncodedObject( register PyObject *obj, const char *encoding, const char *errors ); # 507 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_FromObject( register PyObject *obj ); # 520 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_FromWideChar( register const wchar_t *w, Py_ssize_t size ); # 537 "Include/unicodeobject.h" Py_ssize_t PyUnicodeUCS4_AsWideChar( PyUnicodeObject *unicode, register wchar_t *w, Py_ssize_t size ); # 555 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_FromOrdinal(int ordinal); # 591 "Include/unicodeobject.h" PyObject * _PyUnicodeUCS4_AsDefaultEncodedString( PyObject *, const char *); # 603 "Include/unicodeobject.h" const char* PyUnicodeUCS4_GetDefaultEncoding(void); int PyUnicodeUCS4_SetDefaultEncoding( const char *encoding ); PyObject* PyUnicodeUCS4_Decode( const char *s, Py_ssize_t size, const char *encoding, const char *errors ); PyObject* PyUnicodeUCS4_Encode( const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors ); PyObject* PyUnicodeUCS4_AsEncodedObject( PyObject *unicode, const char *encoding, const char *errors ); PyObject* PyUnicodeUCS4_AsEncodedString( PyObject *unicode, const char *encoding, const char *errors ); PyObject* PyUnicode_BuildEncodingMap( PyObject* string ); PyObject* PyUnicode_DecodeUTF7( const char *string, Py_ssize_t length, const char *errors ); PyObject* PyUnicode_EncodeUTF7( const Py_UNICODE *data, Py_ssize_t length, int encodeSetO, int encodeWhiteSpace, const char *errors ); PyObject* PyUnicodeUCS4_DecodeUTF8( const char *string, Py_ssize_t length, const char *errors ); PyObject* PyUnicodeUCS4_DecodeUTF8Stateful( const char *string, Py_ssize_t length, const char *errors, Py_ssize_t *consumed ); PyObject* PyUnicodeUCS4_AsUTF8String( PyObject *unicode ); PyObject* PyUnicodeUCS4_EncodeUTF8( const Py_UNICODE *data, Py_ssize_t length, const char *errors ); # 728 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_DecodeUTF16( const char *string, Py_ssize_t length, const char *errors, int *byteorder ); PyObject* PyUnicodeUCS4_DecodeUTF16Stateful( const char *string, Py_ssize_t length, const char *errors, int *byteorder, Py_ssize_t *consumed ); PyObject* PyUnicodeUCS4_AsUTF16String( PyObject *unicode ); # 774 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_EncodeUTF16( const Py_UNICODE *data, Py_ssize_t length, const char *errors, int byteorder ); PyObject* PyUnicodeUCS4_DecodeUnicodeEscape( const char *string, Py_ssize_t length, const char *errors ); PyObject* PyUnicodeUCS4_AsUnicodeEscapeString( PyObject *unicode ); PyObject* PyUnicodeUCS4_EncodeUnicodeEscape( const Py_UNICODE *data, Py_ssize_t length ); PyObject* PyUnicodeUCS4_DecodeRawUnicodeEscape( const char *string, Py_ssize_t length, const char *errors ); PyObject* PyUnicodeUCS4_AsRawUnicodeEscapeString( PyObject *unicode ); PyObject* PyUnicodeUCS4_EncodeRawUnicodeEscape( const Py_UNICODE *data, Py_ssize_t length ); PyObject *_PyUnicode_DecodeUnicodeInternal( const char *string, Py_ssize_t length, const char *errors ); PyObject* PyUnicodeUCS4_DecodeLatin1( const char *string, Py_ssize_t length, const char *errors ); PyObject* PyUnicodeUCS4_AsLatin1String( PyObject *unicode ); PyObject* PyUnicodeUCS4_EncodeLatin1( const Py_UNICODE *data, Py_ssize_t length, const char *errors ); PyObject* PyUnicodeUCS4_DecodeASCII( const char *string, Py_ssize_t length, const char *errors ); PyObject* PyUnicodeUCS4_AsASCIIString( PyObject *unicode ); PyObject* PyUnicodeUCS4_EncodeASCII( const Py_UNICODE *data, Py_ssize_t length, const char *errors ); # 891 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_DecodeCharmap( const char *string, Py_ssize_t length, PyObject *mapping, const char *errors ); PyObject* PyUnicodeUCS4_AsCharmapString( PyObject *unicode, PyObject *mapping ); PyObject* PyUnicodeUCS4_EncodeCharmap( const Py_UNICODE *data, Py_ssize_t length, PyObject *mapping, const char *errors ); # 926 "Include/unicodeobject.h" PyObject * PyUnicodeUCS4_TranslateCharmap( const Py_UNICODE *data, Py_ssize_t length, PyObject *table, const char *errors ); # 986 "Include/unicodeobject.h" int PyUnicodeUCS4_EncodeDecimal( Py_UNICODE *s, Py_ssize_t length, char *output, const char *errors ); # 1001 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_Concat( PyObject *left, PyObject *right ); # 1017 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_Split( PyObject *s, PyObject *sep, Py_ssize_t maxsplit ); PyObject* PyUnicodeUCS4_Splitlines( PyObject *s, int keepends ); PyObject* PyUnicodeUCS4_Partition( PyObject *s, PyObject *sep ); PyObject* PyUnicodeUCS4_RPartition( PyObject *s, PyObject *sep ); # 1061 "Include/unicodeobject.h" PyObject* PyUnicodeUCS4_RSplit( PyObject *s, PyObject *sep, Py_ssize_t maxsplit ); # 1079 "Include/unicodeobject.h" PyObject * PyUnicodeUCS4_Translate( PyObject *str, PyObject *table, const char *errors ); PyObject* PyUnicodeUCS4_Join( PyObject *separator, PyObject *seq ); Py_ssize_t PyUnicodeUCS4_Tailmatch( PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction ); Py_ssize_t PyUnicodeUCS4_Find( PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction ); Py_ssize_t PyUnicodeUCS4_Count( PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end ); PyObject * PyUnicodeUCS4_Replace( PyObject *str, PyObject *substr, PyObject *replstr, Py_ssize_t maxcount ); int PyUnicodeUCS4_Compare( PyObject *left, PyObject *right ); # 1160 "Include/unicodeobject.h" PyObject * PyUnicodeUCS4_RichCompare( PyObject *left, PyObject *right, int op ); PyObject * PyUnicodeUCS4_Format( PyObject *format, PyObject *args ); int PyUnicodeUCS4_Contains( PyObject *container, PyObject *element ); PyObject * _PyUnicode_XStrip( PyUnicodeObject *self, int striptype, PyObject *sepobj ); # 1201 "Include/unicodeobject.h" int _PyUnicodeUCS4_IsLowercase( Py_UNICODE ch ); int _PyUnicodeUCS4_IsUppercase( Py_UNICODE ch ); int _PyUnicodeUCS4_IsTitlecase( Py_UNICODE ch ); int _PyUnicodeUCS4_IsWhitespace( const Py_UNICODE ch ); int _PyUnicodeUCS4_IsLinebreak( const Py_UNICODE ch ); Py_UNICODE _PyUnicodeUCS4_ToLowercase( Py_UNICODE ch ); Py_UNICODE _PyUnicodeUCS4_ToUppercase( Py_UNICODE ch ); Py_UNICODE _PyUnicodeUCS4_ToTitlecase( Py_UNICODE ch ); int _PyUnicodeUCS4_ToDecimalDigit( Py_UNICODE ch ); int _PyUnicodeUCS4_ToDigit( Py_UNICODE ch ); double _PyUnicodeUCS4_ToNumeric( Py_UNICODE ch ); int _PyUnicodeUCS4_IsDecimalDigit( Py_UNICODE ch ); int _PyUnicodeUCS4_IsDigit( Py_UNICODE ch ); int _PyUnicodeUCS4_IsNumeric( Py_UNICODE ch ); int _PyUnicodeUCS4_IsAlpha( Py_UNICODE ch ); # 84 "Include/Python.h" 2 # 1 "Include/intobject.h" 1 # 23 "Include/intobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; long ob_ival; } PyIntObject; extern PyTypeObject PyInt_Type; PyObject * PyInt_FromString(char*, char**, int); PyObject * PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int); PyObject * PyInt_FromLong(long); PyObject * PyInt_FromSize_t(size_t); PyObject * PyInt_FromSsize_t(Py_ssize_t); long PyInt_AsLong(PyObject *); Py_ssize_t PyInt_AsSsize_t(PyObject *); unsigned long PyInt_AsUnsignedLongMask(PyObject *); unsigned long long PyInt_AsUnsignedLongLongMask(PyObject *); long PyInt_GetMax(void); # 58 "Include/intobject.h" unsigned long PyOS_strtoul(char *, char **, int); long PyOS_strtol(char *, char **, int); # 85 "Include/Python.h" 2 # 1 "Include/boolobject.h" 1 # 10 "Include/boolobject.h" typedef PyIntObject PyBoolObject; extern PyTypeObject PyBool_Type; extern PyIntObject _Py_ZeroStruct, _Py_TrueStruct; # 31 "Include/boolobject.h" PyObject * PyBool_FromLong(long); # 86 "Include/Python.h" 2 # 1 "Include/longobject.h" 1 # 10 "Include/longobject.h" typedef struct _longobject PyLongObject; extern PyTypeObject PyLong_Type; PyObject * PyLong_FromLong(long); PyObject * PyLong_FromUnsignedLong(unsigned long); PyObject * PyLong_FromDouble(double); long PyLong_AsLong(PyObject *); unsigned long PyLong_AsUnsignedLong(PyObject *); unsigned long PyLong_AsUnsignedLongMask(PyObject *); Py_ssize_t _PyLong_AsSsize_t(PyObject *); PyObject * _PyLong_FromSize_t(size_t); PyObject * _PyLong_FromSsize_t(Py_ssize_t); extern int _PyLong_DigitValue[256]; double _PyLong_AsScaledDouble(PyObject *vv, int *e); double PyLong_AsDouble(PyObject *); PyObject * PyLong_FromVoidPtr(void *); void * PyLong_AsVoidPtr(PyObject *); PyObject * PyLong_FromLongLong(long long); PyObject * PyLong_FromUnsignedLongLong(unsigned long long); long long PyLong_AsLongLong(PyObject *); unsigned long long PyLong_AsUnsignedLongLong(PyObject *); unsigned long long PyLong_AsUnsignedLongLongMask(PyObject *); PyObject * PyLong_FromString(char *, char **, int); PyObject * PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int); int _PyLong_Sign(PyObject *v); # 69 "Include/longobject.h" size_t _PyLong_NumBits(PyObject *v); # 84 "Include/longobject.h" PyObject * _PyLong_FromByteArray( const unsigned char* bytes, size_t n, int little_endian, int is_signed); # 107 "Include/longobject.h" int _PyLong_AsByteArray(PyLongObject* v, unsigned char* bytes, size_t n, int little_endian, int is_signed); # 87 "Include/Python.h" 2 # 1 "Include/floatobject.h" 1 # 14 "Include/floatobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; double ob_fval; } PyFloatObject; extern PyTypeObject PyFloat_Type; PyObject * PyFloat_FromString(PyObject*, char** junk); PyObject * PyFloat_FromDouble(double); double PyFloat_AsDouble(PyObject *); void PyFloat_AsReprString(char*, PyFloatObject *v); void PyFloat_AsString(char*, PyFloatObject *v); # 82 "Include/floatobject.h" int _PyFloat_Pack4(double x, unsigned char *p, int le); int _PyFloat_Pack8(double x, unsigned char *p, int le); # 93 "Include/floatobject.h" double _PyFloat_Unpack4(const unsigned char *p, int le); double _PyFloat_Unpack8(const unsigned char *p, int le); # 88 "Include/Python.h" 2 # 1 "Include/complexobject.h" 1 # 9 "Include/complexobject.h" typedef struct { double real; double imag; } Py_complex; # 23 "Include/complexobject.h" Py_complex _Py_c_sum(Py_complex, Py_complex); Py_complex _Py_c_diff(Py_complex, Py_complex); Py_complex _Py_c_neg(Py_complex); Py_complex _Py_c_prod(Py_complex, Py_complex); Py_complex _Py_c_quot(Py_complex, Py_complex); Py_complex _Py_c_pow(Py_complex, Py_complex); # 38 "Include/complexobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_complex cval; } PyComplexObject; extern PyTypeObject PyComplex_Type; PyObject * PyComplex_FromCComplex(Py_complex); PyObject * PyComplex_FromDoubles(double real, double imag); double PyComplex_RealAsDouble(PyObject *op); double PyComplex_ImagAsDouble(PyObject *op); Py_complex PyComplex_AsCComplex(PyObject *op); # 90 "Include/Python.h" 2 # 1 "Include/rangeobject.h" 1 # 21 "Include/rangeobject.h" extern PyTypeObject PyRange_Type; # 92 "Include/Python.h" 2 # 1 "Include/stringobject.h" 1 # 10 "Include/stringobject.h" # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stdarg.h" 1 3 4 # 11 "Include/stringobject.h" 2 # 35 "Include/stringobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size; long ob_shash; int ob_sstate; char ob_sval[1]; # 49 "Include/stringobject.h" } PyStringObject; extern PyTypeObject PyBaseString_Type; extern PyTypeObject PyString_Type; PyObject * PyString_FromStringAndSize(const char *, Py_ssize_t); PyObject * PyString_FromString(const char *); PyObject * PyString_FromFormatV(const char*, va_list) __attribute__((format(printf, 1, 0))); PyObject * PyString_FromFormat(const char*, ...) __attribute__((format(printf, 1, 2))); Py_ssize_t PyString_Size(PyObject *); char * PyString_AsString(PyObject *); PyObject * PyString_Repr(PyObject *, int); void PyString_Concat(PyObject **, PyObject *); void PyString_ConcatAndDel(PyObject **, PyObject *); int _PyString_Resize(PyObject **, Py_ssize_t); int _PyString_Eq(PyObject *, PyObject*); PyObject * PyString_Format(PyObject *, PyObject *); PyObject * _PyString_FormatLong(PyObject*, int, int, int, char**, int*); PyObject * PyString_DecodeEscape(const char *, Py_ssize_t, const char *, Py_ssize_t, const char *); void PyString_InternInPlace(PyObject **); void PyString_InternImmortal(PyObject **); PyObject * PyString_InternFromString(const char *); void _Py_ReleaseInternedStrings(void); # 95 "Include/stringobject.h" PyObject * _PyString_Join(PyObject *sep, PyObject *x); PyObject* PyString_Decode( const char *s, Py_ssize_t size, const char *encoding, const char *errors ); PyObject* PyString_Encode( const char *s, Py_ssize_t size, const char *encoding, const char *errors ); PyObject* PyString_AsEncodedObject( PyObject *str, const char *encoding, const char *errors ); # 136 "Include/stringobject.h" PyObject* PyString_AsEncodedString( PyObject *str, const char *encoding, const char *errors ); PyObject* PyString_AsDecodedObject( PyObject *str, const char *encoding, const char *errors ); # 159 "Include/stringobject.h" PyObject* PyString_AsDecodedString( PyObject *str, const char *encoding, const char *errors ); int PyString_AsStringAndSize( register PyObject *obj, register char **s, register Py_ssize_t *len ); # 93 "Include/Python.h" 2 # 1 "Include/bufferobject.h" 1 # 13 "Include/bufferobject.h" extern PyTypeObject PyBuffer_Type; PyObject * PyBuffer_FromObject(PyObject *base, Py_ssize_t offset, Py_ssize_t size); PyObject * PyBuffer_FromReadWriteObject(PyObject *base, Py_ssize_t offset, Py_ssize_t size); PyObject * PyBuffer_FromMemory(void *ptr, Py_ssize_t size); PyObject * PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size); PyObject * PyBuffer_New(Py_ssize_t size); # 94 "Include/Python.h" 2 # 1 "Include/tupleobject.h" 1 # 24 "Include/tupleobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size; PyObject *ob_item[1]; } PyTupleObject; extern PyTypeObject PyTuple_Type; PyObject * PyTuple_New(Py_ssize_t size); Py_ssize_t PyTuple_Size(PyObject *); PyObject * PyTuple_GetItem(PyObject *, Py_ssize_t); int PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *); PyObject * PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); int _PyTuple_Resize(PyObject **, Py_ssize_t); PyObject * PyTuple_Pack(Py_ssize_t, ...); # 95 "Include/Python.h" 2 # 1 "Include/listobject.h" 1 # 22 "Include/listobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size; PyObject **ob_item; # 38 "Include/listobject.h" Py_ssize_t allocated; } PyListObject; extern PyTypeObject PyList_Type; PyObject * PyList_New(Py_ssize_t size); Py_ssize_t PyList_Size(PyObject *); PyObject * PyList_GetItem(PyObject *, Py_ssize_t); int PyList_SetItem(PyObject *, Py_ssize_t, PyObject *); int PyList_Insert(PyObject *, Py_ssize_t, PyObject *); int PyList_Append(PyObject *, PyObject *); PyObject * PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); int PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); int PyList_Sort(PyObject *); int PyList_Reverse(PyObject *); PyObject * PyList_AsTuple(PyObject *); PyObject * _PyList_Extend(PyListObject *, PyObject *); # 96 "Include/Python.h" 2 # 1 "Include/dictobject.h" 1 # 50 "Include/dictobject.h" typedef struct { Py_ssize_t me_hash; PyObject *me_key; PyObject *me_value; } PyDictEntry; # 69 "Include/dictobject.h" typedef struct _dictobject PyDictObject; struct _dictobject { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ma_fill; Py_ssize_t ma_used; Py_ssize_t ma_mask; PyDictEntry *ma_table; PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash); PyDictEntry ma_smalltable[8]; }; extern PyTypeObject PyDict_Type; PyObject * PyDict_New(void); PyObject * PyDict_GetItem(PyObject *mp, PyObject *key); int PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); int PyDict_DelItem(PyObject *mp, PyObject *key); void PyDict_Clear(PyObject *mp); int PyDict_Next( PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value); int _PyDict_Next( PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, long *hash); PyObject * PyDict_Keys(PyObject *mp); PyObject * PyDict_Values(PyObject *mp); PyObject * PyDict_Items(PyObject *mp); Py_ssize_t PyDict_Size(PyObject *mp); PyObject * PyDict_Copy(PyObject *mp); int PyDict_Contains(PyObject *mp, PyObject *key); int _PyDict_Contains(PyObject *mp, PyObject *key, long hash); int PyDict_Update(PyObject *mp, PyObject *other); int PyDict_Merge(PyObject *mp, PyObject *other, int override); int PyDict_MergeFromSeq2(PyObject *d, PyObject *seq2, int override); PyObject * PyDict_GetItemString(PyObject *dp, const char *key); int PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item); int PyDict_DelItemString(PyObject *dp, const char *key); # 97 "Include/Python.h" 2 # 1 "Include/enumobject.h" 1 # 10 "Include/enumobject.h" extern PyTypeObject PyEnum_Type; extern PyTypeObject PyReversed_Type; # 98 "Include/Python.h" 2 # 1 "Include/setobject.h" 1 # 24 "Include/setobject.h" typedef struct { long hash; PyObject *key; } setentry; typedef struct _setobject PySetObject; struct _setobject { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t fill; Py_ssize_t used; Py_ssize_t mask; setentry *table; setentry *(*lookup)(PySetObject *so, PyObject *key, long hash); setentry smalltable[8]; long hash; PyObject *weakreflist; }; extern PyTypeObject PySet_Type; extern PyTypeObject PyFrozenSet_Type; # 77 "Include/setobject.h" PyObject * PySet_New(PyObject *); PyObject * PyFrozenSet_New(PyObject *); Py_ssize_t PySet_Size(PyObject *anyset); int PySet_Clear(PyObject *set); int PySet_Contains(PyObject *anyset, PyObject *key); int PySet_Discard(PyObject *set, PyObject *key); int PySet_Add(PyObject *set, PyObject *key); int _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key); int _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash); PyObject * PySet_Pop(PyObject *set); int _PySet_Update(PyObject *set, PyObject *iterable); # 99 "Include/Python.h" 2 # 1 "Include/methodobject.h" 1 # 14 "Include/methodobject.h" extern PyTypeObject PyCFunction_Type; typedef PyObject *(*PyCFunction)(PyObject *, PyObject *); typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *, PyObject *); typedef PyObject *(*PyNoArgsFunction)(PyObject *); PyCFunction PyCFunction_GetFunction(PyObject *); PyObject * PyCFunction_GetSelf(PyObject *); int PyCFunction_GetFlags(PyObject *); # 35 "Include/methodobject.h" PyObject * PyCFunction_Call(PyObject *, PyObject *, PyObject *); struct PyMethodDef { const char *ml_name; PyCFunction ml_meth; int ml_flags; const char *ml_doc; }; typedef struct PyMethodDef PyMethodDef; PyObject * Py_FindMethod(PyMethodDef[], PyObject *, const char *); PyObject * PyCFunction_NewEx(PyMethodDef *, PyObject *, PyObject *); # 73 "Include/methodobject.h" typedef struct PyMethodChain { PyMethodDef *methods; struct PyMethodChain *link; } PyMethodChain; PyObject * Py_FindMethodInChain(PyMethodChain *, PyObject *, const char *); typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyMethodDef *m_ml; PyObject *m_self; PyObject *m_module; } PyCFunctionObject; # 100 "Include/Python.h" 2 # 1 "Include/moduleobject.h" 1 # 10 "Include/moduleobject.h" extern PyTypeObject PyModule_Type; PyObject * PyModule_New(const char *); PyObject * PyModule_GetDict(PyObject *); char * PyModule_GetName(PyObject *); char * PyModule_GetFilename(PyObject *); void _PyModule_Clear(PyObject *); # 101 "Include/Python.h" 2 # 1 "Include/funcobject.h" 1 # 21 "Include/funcobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *func_code; PyObject *func_globals; PyObject *func_defaults; PyObject *func_closure; PyObject *func_doc; PyObject *func_name; PyObject *func_dict; PyObject *func_weakreflist; PyObject *func_module; } PyFunctionObject; extern PyTypeObject PyFunction_Type; PyObject * PyFunction_New(PyObject *, PyObject *); PyObject * PyFunction_GetCode(PyObject *); PyObject * PyFunction_GetGlobals(PyObject *); PyObject * PyFunction_GetModule(PyObject *); PyObject * PyFunction_GetDefaults(PyObject *); int PyFunction_SetDefaults(PyObject *, PyObject *); PyObject * PyFunction_GetClosure(PyObject *); int PyFunction_SetClosure(PyObject *, PyObject *); # 67 "Include/funcobject.h" extern PyTypeObject PyClassMethod_Type; extern PyTypeObject PyStaticMethod_Type; PyObject * PyClassMethod_New(PyObject *); PyObject * PyStaticMethod_New(PyObject *); # 102 "Include/Python.h" 2 # 1 "Include/classobject.h" 1 # 12 "Include/classobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *cl_bases; PyObject *cl_dict; PyObject *cl_name; PyObject *cl_getattr; PyObject *cl_setattr; PyObject *cl_delattr; } PyClassObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyClassObject *in_class; PyObject *in_dict; PyObject *in_weakreflist; } PyInstanceObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *im_func; PyObject *im_self; PyObject *im_class; PyObject *im_weakreflist; } PyMethodObject; extern PyTypeObject PyClass_Type, PyInstance_Type, PyMethod_Type; PyObject * PyClass_New(PyObject *, PyObject *, PyObject *); PyObject * PyInstance_New(PyObject *, PyObject *, PyObject *); PyObject * PyInstance_NewRaw(PyObject *, PyObject *); PyObject * PyMethod_New(PyObject *, PyObject *, PyObject *); PyObject * PyMethod_Function(PyObject *); PyObject * PyMethod_Self(PyObject *); PyObject * PyMethod_Class(PyObject *); # 64 "Include/classobject.h" PyObject * _PyInstance_Lookup(PyObject *pinst, PyObject *name); # 75 "Include/classobject.h" int PyClass_IsSubclass(PyObject *, PyObject *); # 103 "Include/Python.h" 2 # 1 "Include/fileobject.h" 1 # 10 "Include/fileobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; FILE *f_fp; PyObject *f_name; PyObject *f_mode; int (*f_close)(FILE *); int f_softspace; int f_binary; char* f_buf; char* f_bufend; char* f_bufptr; char *f_setbuf; int f_univ_newline; int f_newlinetypes; int f_skipnextlf; PyObject *f_encoding; PyObject *weakreflist; } PyFileObject; extern PyTypeObject PyFile_Type; PyObject * PyFile_FromString(char *, char *); void PyFile_SetBufSize(PyObject *, int); int PyFile_SetEncoding(PyObject *, const char *); PyObject * PyFile_FromFile(FILE *, char *, char *, int (*)(FILE *)); FILE * PyFile_AsFile(PyObject *); PyObject * PyFile_Name(PyObject *); PyObject * PyFile_GetLine(PyObject *, int); int PyFile_WriteObject(PyObject *, PyObject *, int); int PyFile_SoftSpace(PyObject *, int); int PyFile_WriteString(const char *, PyObject *); int PyObject_AsFileDescriptor(PyObject *); extern const char * Py_FileSystemDefaultEncoding; char *Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); size_t Py_UniversalNewlineFread(char *, size_t, FILE *, PyObject *); int _PyFile_SanitizeMode(char *mode); # 104 "Include/Python.h" 2 # 1 "Include/cobject.h" 1 # 17 "Include/cobject.h" extern PyTypeObject PyCObject_Type; # 27 "Include/cobject.h" PyObject * PyCObject_FromVoidPtr( void *cobj, void (*destruct)(void*)); PyObject * PyCObject_FromVoidPtrAndDesc( void *cobj, void *desc, void (*destruct)(void*,void*)); void * PyCObject_AsVoidPtr(PyObject *); void * PyCObject_GetDesc(PyObject *); void * PyCObject_Import(char *module_name, char *cobject_name); int PyCObject_SetVoidPtr(PyObject *self, void *cobj); # 105 "Include/Python.h" 2 # 1 "Include/traceback.h" 1 struct _frame; typedef struct _traceback { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; struct _traceback *tb_next; struct _frame *tb_frame; int tb_lasti; int tb_lineno; } PyTracebackObject; int PyTraceBack_Here(struct _frame *); int PyTraceBack_Print(PyObject *, PyObject *); extern PyTypeObject PyTraceBack_Type; # 106 "Include/Python.h" 2 # 1 "Include/sliceobject.h" 1 # 9 "Include/sliceobject.h" extern PyObject _Py_EllipsisObject; # 22 "Include/sliceobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *start, *stop, *step; } PySliceObject; extern PyTypeObject PySlice_Type; PyObject * PySlice_New(PyObject* start, PyObject* stop, PyObject* step); PyObject * _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop); int PySlice_GetIndices(PySliceObject *r, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); int PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength); # 107 "Include/Python.h" 2 # 1 "Include/cellobject.h" 1 # 9 "Include/cellobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *ob_ref; } PyCellObject; extern PyTypeObject PyCell_Type; PyObject * PyCell_New(PyObject *); PyObject * PyCell_Get(PyObject *); int PyCell_Set(PyObject *, PyObject *); # 108 "Include/Python.h" 2 # 1 "Include/iterobject.h" 1 extern PyTypeObject PySeqIter_Type; PyObject * PySeqIter_New(PyObject *); extern PyTypeObject PyCallIter_Type; PyObject * PyCallIter_New(PyObject *, PyObject *); # 109 "Include/Python.h" 2 # 1 "Include/genobject.h" 1 # 10 "Include/genobject.h" struct _frame; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; struct _frame *gi_frame; int gi_running; PyObject *gi_weakreflist; } PyGenObject; extern PyTypeObject PyGen_Type; PyObject * PyGen_New(struct _frame *); int PyGen_NeedsFinalizing(PyGenObject *); # 110 "Include/Python.h" 2 # 1 "Include/descrobject.h" 1 typedef PyObject *(*getter)(PyObject *, void *); typedef int (*setter)(PyObject *, PyObject *, void *); typedef struct PyGetSetDef { char *name; getter get; setter set; char *doc; void *closure; } PyGetSetDef; typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, void *wrapped); typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, void *wrapped, PyObject *kwds); struct wrapperbase { char *name; int offset; void *function; wrapperfunc wrapper; char *doc; int flags; PyObject *name_strobj; }; # 45 "Include/descrobject.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name; } PyDescrObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name; PyMethodDef *d_method; } PyMethodDescrObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name; struct PyMemberDef *d_member; } PyMemberDescrObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name; PyGetSetDef *d_getset; } PyGetSetDescrObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name; struct wrapperbase *d_base; void *d_wrapped; } PyWrapperDescrObject; extern PyTypeObject PyWrapperDescr_Type; PyObject * PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); PyObject * PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); PyObject * PyDescr_NewMember(PyTypeObject *, struct PyMemberDef *); PyObject * PyDescr_NewGetSet(PyTypeObject *, struct PyGetSetDef *); PyObject * PyDescr_NewWrapper(PyTypeObject *, struct wrapperbase *, void *); PyObject * PyDictProxy_New(PyObject *); PyObject * PyWrapper_New(PyObject *, PyObject *); extern PyTypeObject PyProperty_Type; # 111 "Include/Python.h" 2 # 1 "Include/weakrefobject.h" 1 # 10 "Include/weakrefobject.h" typedef struct _PyWeakReference PyWeakReference; struct _PyWeakReference { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *wr_object; PyObject *wr_callback; long hash; PyWeakReference *wr_prev; PyWeakReference *wr_next; }; extern PyTypeObject _PyWeakref_RefType; extern PyTypeObject _PyWeakref_ProxyType; extern PyTypeObject _PyWeakref_CallableProxyType; # 59 "Include/weakrefobject.h" PyObject * PyWeakref_NewRef(PyObject *ob, PyObject *callback); PyObject * PyWeakref_NewProxy(PyObject *ob, PyObject *callback); PyObject * PyWeakref_GetObject(PyObject *ref); Py_ssize_t _PyWeakref_GetWeakrefCount(PyWeakReference *head); void _PyWeakref_ClearRef(PyWeakReference *self); # 112 "Include/Python.h" 2 # 1 "Include/codecs.h" 1 # 26 "Include/codecs.h" int PyCodec_Register( PyObject *search_function ); # 48 "Include/codecs.h" PyObject * _PyCodec_Lookup( const char *encoding ); # 62 "Include/codecs.h" PyObject * PyCodec_Encode( PyObject *object, const char *encoding, const char *errors ); # 78 "Include/codecs.h" PyObject * PyCodec_Decode( PyObject *object, const char *encoding, const char *errors ); # 94 "Include/codecs.h" PyObject * PyCodec_Encoder( const char *encoding ); PyObject * PyCodec_Decoder( const char *encoding ); PyObject * PyCodec_IncrementalEncoder( const char *encoding, const char *errors ); PyObject * PyCodec_IncrementalDecoder( const char *encoding, const char *errors ); PyObject * PyCodec_StreamReader( const char *encoding, PyObject *stream, const char *errors ); PyObject * PyCodec_StreamWriter( const char *encoding, PyObject *stream, const char *errors ); # 142 "Include/codecs.h" int PyCodec_RegisterError(const char *name, PyObject *error); PyObject * PyCodec_LookupError(const char *name); PyObject * PyCodec_StrictErrors(PyObject *exc); PyObject * PyCodec_IgnoreErrors(PyObject *exc); PyObject * PyCodec_ReplaceErrors(PyObject *exc); PyObject * PyCodec_XMLCharRefReplaceErrors(PyObject *exc); PyObject * PyCodec_BackslashReplaceErrors(PyObject *exc); # 114 "Include/Python.h" 2 # 1 "Include/pyerrors.h" 1 # 9 "Include/pyerrors.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *dict; PyObject *args; PyObject *message; } PyBaseExceptionObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *dict; PyObject *args; PyObject *message; PyObject *msg; PyObject *filename; PyObject *lineno; PyObject *offset; PyObject *text; PyObject *print_file_and_line; } PySyntaxErrorObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *dict; PyObject *args; PyObject *message; PyObject *encoding; PyObject *object; PyObject *start; PyObject *end; PyObject *reason; } PyUnicodeErrorObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *dict; PyObject *args; PyObject *message; PyObject *code; } PySystemExitObject; typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyObject *dict; PyObject *args; PyObject *message; PyObject *myerrno; PyObject *strerror; PyObject *filename; } PyEnvironmentErrorObject; # 76 "Include/pyerrors.h" void PyErr_SetNone(PyObject *); void PyErr_SetObject(PyObject *, PyObject *); void PyErr_SetString(PyObject *, const char *); PyObject * PyErr_Occurred(void); void PyErr_Clear(void); void PyErr_Fetch(PyObject **, PyObject **, PyObject **); void PyErr_Restore(PyObject *, PyObject *, PyObject *); # 91 "Include/pyerrors.h" int PyErr_GivenExceptionMatches(PyObject *, PyObject *); int PyErr_ExceptionMatches(PyObject *); void PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); # 120 "Include/pyerrors.h" extern PyObject * PyExc_BaseException; extern PyObject * PyExc_Exception; extern PyObject * PyExc_StopIteration; extern PyObject * PyExc_GeneratorExit; extern PyObject * PyExc_StandardError; extern PyObject * PyExc_ArithmeticError; extern PyObject * PyExc_LookupError; extern PyObject * PyExc_AssertionError; extern PyObject * PyExc_AttributeError; extern PyObject * PyExc_EOFError; extern PyObject * PyExc_FloatingPointError; extern PyObject * PyExc_EnvironmentError; extern PyObject * PyExc_IOError; extern PyObject * PyExc_OSError; extern PyObject * PyExc_ImportError; extern PyObject * PyExc_IndexError; extern PyObject * PyExc_KeyError; extern PyObject * PyExc_KeyboardInterrupt; extern PyObject * PyExc_MemoryError; extern PyObject * PyExc_NameError; extern PyObject * PyExc_OverflowError; extern PyObject * PyExc_RuntimeError; extern PyObject * PyExc_NotImplementedError; extern PyObject * PyExc_SyntaxError; extern PyObject * PyExc_IndentationError; extern PyObject * PyExc_TabError; extern PyObject * PyExc_ReferenceError; extern PyObject * PyExc_SystemError; extern PyObject * PyExc_SystemExit; extern PyObject * PyExc_TypeError; extern PyObject * PyExc_UnboundLocalError; extern PyObject * PyExc_UnicodeError; extern PyObject * PyExc_UnicodeEncodeError; extern PyObject * PyExc_UnicodeDecodeError; extern PyObject * PyExc_UnicodeTranslateError; extern PyObject * PyExc_ValueError; extern PyObject * PyExc_ZeroDivisionError; extern PyObject * PyExc_MemoryErrorInst; extern PyObject * PyExc_Warning; extern PyObject * PyExc_UserWarning; extern PyObject * PyExc_DeprecationWarning; extern PyObject * PyExc_PendingDeprecationWarning; extern PyObject * PyExc_SyntaxWarning; extern PyObject * PyExc_RuntimeWarning; extern PyObject * PyExc_FutureWarning; extern PyObject * PyExc_ImportWarning; extern PyObject * PyExc_UnicodeWarning; int PyErr_BadArgument(void); PyObject * PyErr_NoMemory(void); PyObject * PyErr_SetFromErrno(PyObject *); PyObject * PyErr_SetFromErrnoWithFilenameObject( PyObject *, PyObject *); PyObject * PyErr_SetFromErrnoWithFilename(PyObject *, char *); PyObject * PyErr_Format(PyObject *, const char *, ...) __attribute__((format(printf, 2, 3))); # 217 "Include/pyerrors.h" void PyErr_BadInternalCall(void); void _PyErr_BadInternalCall(char *filename, int lineno); PyObject * PyErr_NewException(char *name, PyObject *base, PyObject *dict); void PyErr_WriteUnraisable(PyObject *); int PyErr_WarnEx(PyObject *category, const char *msg, Py_ssize_t stack_level); int PyErr_WarnExplicit(PyObject *, const char *, const char *, int, const char *, PyObject *); int PyErr_CheckSignals(void); void PyErr_SetInterrupt(void); void PyErr_SyntaxLocation(const char *, int); PyObject * PyErr_ProgramText(const char *, int); PyObject * PyUnicodeDecodeError_Create( const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); PyObject * PyUnicodeEncodeError_Create( const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); PyObject * PyUnicodeTranslateError_Create( const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); PyObject * PyUnicodeEncodeError_GetEncoding(PyObject *); PyObject * PyUnicodeDecodeError_GetEncoding(PyObject *); PyObject * PyUnicodeEncodeError_GetObject(PyObject *); PyObject * PyUnicodeDecodeError_GetObject(PyObject *); PyObject * PyUnicodeTranslateError_GetObject(PyObject *); int PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *); int PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *); int PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *); int PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t); int PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t); int PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t); int PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *); int PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *); int PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *); int PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t); int PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t); int PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t); PyObject * PyUnicodeEncodeError_GetReason(PyObject *); PyObject * PyUnicodeDecodeError_GetReason(PyObject *); PyObject * PyUnicodeTranslateError_GetReason(PyObject *); int PyUnicodeEncodeError_SetReason( PyObject *, const char *); int PyUnicodeDecodeError_SetReason( PyObject *, const char *); int PyUnicodeTranslateError_SetReason( PyObject *, const char *); # 326 "Include/pyerrors.h" int PyOS_snprintf(char *str, size_t size, const char *format, ...) __attribute__((format(printf, 3, 4))); int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) __attribute__((format(printf, 3, 0))); # 115 "Include/Python.h" 2 # 1 "Include/pystate.h" 1 # 13 "Include/pystate.h" struct _ts; struct _is; typedef struct _is { struct _is *next; struct _ts *tstate_head; PyObject *modules; PyObject *sysdict; PyObject *builtins; PyObject *modules_reloading; PyObject *codec_search_path; PyObject *codec_search_cache; PyObject *codec_error_registry; int dlopenflags; } PyInterpreterState; struct _frame; typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); # 56 "Include/pystate.h" typedef struct _ts { struct _ts *next; PyInterpreterState *interp; struct _frame *frame; int recursion_depth; int tracing; int use_tracing; Py_tracefunc c_profilefunc; Py_tracefunc c_tracefunc; PyObject *c_profileobj; PyObject *c_traceobj; PyObject *curexc_type; PyObject *curexc_value; PyObject *curexc_traceback; PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; PyObject *dict; int tick_counter; int gilstate_counter; PyObject *async_exc; long thread_id; } PyThreadState; PyInterpreterState * PyInterpreterState_New(void); void PyInterpreterState_Clear(PyInterpreterState *); void PyInterpreterState_Delete(PyInterpreterState *); PyThreadState * PyThreadState_New(PyInterpreterState *); void PyThreadState_Clear(PyThreadState *); void PyThreadState_Delete(PyThreadState *); void PyThreadState_DeleteCurrent(void); PyThreadState * PyThreadState_Get(void); PyThreadState * PyThreadState_Swap(PyThreadState *); PyObject * PyThreadState_GetDict(void); int PyThreadState_SetAsyncExc(long, PyObject *); extern PyThreadState * _PyThreadState_Current; typedef enum {PyGILState_LOCKED, PyGILState_UNLOCKED} PyGILState_STATE; # 155 "Include/pystate.h" PyGILState_STATE PyGILState_Ensure(void); # 165 "Include/pystate.h" void PyGILState_Release(PyGILState_STATE); PyThreadState * PyGILState_GetThisThreadState(void); PyObject * _PyThread_CurrentFrames(void); PyInterpreterState * PyInterpreterState_Head(void); PyInterpreterState * PyInterpreterState_Next(PyInterpreterState *); PyThreadState * PyInterpreterState_ThreadHead(PyInterpreterState *); PyThreadState * PyThreadState_Next(PyThreadState *); typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_); extern PyThreadFrameGetter _PyThreadState_GetFrame; # 117 "Include/Python.h" 2 # 1 "Include/pyarena.h" 1 # 11 "Include/pyarena.h" typedef struct _arena PyArena; # 35 "Include/pyarena.h" PyArena * PyArena_New(void); void PyArena_Free(PyArena *); # 50 "Include/pyarena.h" void * PyArena_Malloc(PyArena *, size_t size); int PyArena_AddPyObject(PyArena *, PyObject *); # 119 "Include/Python.h" 2 # 1 "Include/modsupport.h" 1 # 26 "Include/modsupport.h" int _PyArg_Parse_SizeT(PyObject *, const char *, ...); int _PyArg_ParseTuple_SizeT(PyObject *, const char *, ...); int _PyArg_ParseTupleAndKeywords_SizeT(PyObject *, PyObject *, const char *, char **, ...); int PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...); PyObject * _Py_BuildValue_SizeT(const char *, ...); PyObject * _Py_BuildValue_SizeT(const char *, ...); int _PyArg_NoKeywords(const char *funcname, PyObject *kw); int _PyArg_VaParse_SizeT(PyObject *, const char *, va_list); int _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *, PyObject *, const char *, char **, va_list); PyObject * _Py_VaBuildValue_SizeT(const char *, va_list); int PyModule_AddObject(PyObject *, const char *, PyObject *); int PyModule_AddIntConstant(PyObject *, const char *, long); int PyModule_AddStringConstant(PyObject *, const char *, const char *); # 116 "Include/modsupport.h" PyObject * Py_InitModule4(const char *name, PyMethodDef *methods, const char *doc, PyObject *self, int apiver); # 128 "Include/modsupport.h" extern char * _Py_PackageContext; # 120 "Include/Python.h" 2 # 1 "Include/pythonrun.h" 1 # 17 "Include/pythonrun.h" typedef struct { int cf_flags; } PyCompilerFlags; void Py_SetProgramName(char *); char * Py_GetProgramName(void); void Py_SetPythonHome(char *); char * Py_GetPythonHome(void); void Py_Initialize(void); void Py_InitializeEx(int); void Py_Finalize(void); int Py_IsInitialized(void); PyThreadState * Py_NewInterpreter(void); void Py_EndInterpreter(PyThreadState *); int PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); int PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *); int PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); int PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *); int PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *); int PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *); struct _mod * PyParser_ASTFromString(const char *, const char *, int, PyCompilerFlags *flags, PyArena *); struct _mod * PyParser_ASTFromFile(FILE *, const char *, int, char *, char *, PyCompilerFlags *, int *, PyArena *); struct _node * PyParser_SimpleParseStringFlags(const char *, int, int); struct _node * PyParser_SimpleParseFileFlags(FILE *, const char *, int, int); PyObject * PyRun_StringFlags(const char *, int, PyObject *, PyObject *, PyCompilerFlags *); PyObject * PyRun_FileExFlags(FILE *, const char *, int, PyObject *, PyObject *, int, PyCompilerFlags *); PyObject * Py_CompileStringFlags(const char *, const char *, int, PyCompilerFlags *); struct symtable * Py_SymtableString(const char *, const char *, int); void PyErr_Print(void); void PyErr_PrintEx(int); void PyErr_Display(PyObject *, PyObject *, PyObject *); int Py_AtExit(void (*func)(void)); void Py_Exit(int); int Py_FdIsInteractive(FILE *, const char *); int Py_Main(int argc, char **argv); # 102 "Include/pythonrun.h" char * Py_GetProgramFullPath(void); char * Py_GetPrefix(void); char * Py_GetExecPrefix(void); char * Py_GetPath(void); const char * Py_GetVersion(void); const char * Py_GetPlatform(void); const char * Py_GetCopyright(void); const char * Py_GetCompiler(void); const char * Py_GetBuildInfo(void); const char * _Py_svnversion(void); const char * Py_SubversionRevision(void); const char * Py_SubversionShortBranch(void); PyObject * _PyBuiltin_Init(void); PyObject * _PySys_Init(void); void _PyImport_Init(void); void _PyExc_Init(void); void _PyImportHooks_Init(void); int _PyFrame_Init(void); int _PyInt_Init(void); void _PyFloat_Init(void); void _PyExc_Fini(void); void _PyImport_Fini(void); void PyMethod_Fini(void); void PyFrame_Fini(void); void PyCFunction_Fini(void); void PyTuple_Fini(void); void PyList_Fini(void); void PySet_Fini(void); void PyString_Fini(void); void PyInt_Fini(void); void PyFloat_Fini(void); void PyOS_FiniInterrupts(void); char * PyOS_Readline(FILE *, FILE *, char *); extern int (*PyOS_InputHook)(void); extern char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); extern PyThreadState* _PyOS_ReadlineTState; # 163 "Include/pythonrun.h" typedef void (*PyOS_sighandler_t)(int); PyOS_sighandler_t PyOS_getsig(int); PyOS_sighandler_t PyOS_setsig(int, PyOS_sighandler_t); # 121 "Include/Python.h" 2 # 1 "Include/ceval.h" 1 # 10 "Include/ceval.h" PyObject * PyEval_CallObjectWithKeywords( PyObject *, PyObject *, PyObject *); PyObject * PyEval_CallObject(PyObject *, PyObject *); PyObject * PyEval_CallFunction(PyObject *obj, const char *format, ...); PyObject * PyEval_CallMethod(PyObject *obj, const char *methodname, const char *format, ...); void PyEval_SetProfile(Py_tracefunc, PyObject *); void PyEval_SetTrace(Py_tracefunc, PyObject *); struct _frame; PyObject * PyEval_GetBuiltins(void); PyObject * PyEval_GetGlobals(void); PyObject * PyEval_GetLocals(void); struct _frame * PyEval_GetFrame(void); int PyEval_GetRestricted(void); int PyEval_MergeCompilerFlags(PyCompilerFlags *cf); int Py_FlushLine(void); int Py_AddPendingCall(int (*func)(void *), void *arg); int Py_MakePendingCalls(void); void Py_SetRecursionLimit(int); int Py_GetRecursionLimit(void); int _Py_CheckRecursiveCall(char *where); extern int _Py_CheckRecursionLimit; const char * PyEval_GetFuncName(PyObject *); const char * PyEval_GetFuncDesc(PyObject *); PyObject * PyEval_GetCallStats(PyObject *); PyObject * PyEval_EvalFrame(struct _frame *); PyObject * PyEval_EvalFrameEx(struct _frame *f, int exc); extern volatile int _Py_Ticker; extern int _Py_CheckInterval; # 121 "Include/ceval.h" PyThreadState * PyEval_SaveThread(void); void PyEval_RestoreThread(PyThreadState *); int PyEval_ThreadsInitialized(void); void PyEval_InitThreads(void); void PyEval_AcquireLock(void); void PyEval_ReleaseLock(void); void PyEval_AcquireThread(PyThreadState *tstate); void PyEval_ReleaseThread(PyThreadState *tstate); void PyEval_ReInitThreads(void); # 151 "Include/ceval.h" int _PyEval_SliceIndex(PyObject *, Py_ssize_t *); # 122 "Include/Python.h" 2 # 1 "Include/sysmodule.h" 1 # 10 "Include/sysmodule.h" PyObject * PySys_GetObject(char *); int PySys_SetObject(char *, PyObject *); FILE * PySys_GetFile(char *, FILE *); void PySys_SetArgv(int, char **); void PySys_SetPath(char *); void PySys_WriteStdout(const char *format, ...) __attribute__((format(printf, 1, 2))); void PySys_WriteStderr(const char *format, ...) __attribute__((format(printf, 1, 2))); extern PyObject * _PySys_TraceFunc, *_PySys_ProfileFunc; extern int _PySys_CheckInterval; void PySys_ResetWarnOptions(void); void PySys_AddWarnOption(char *); # 123 "Include/Python.h" 2 # 1 "Include/intrcheck.h" 1 int PyOS_InterruptOccurred(void); void PyOS_InitInterrupts(void); void PyOS_AfterFork(void); # 124 "Include/Python.h" 2 # 1 "Include/import.h" 1 # 10 "Include/import.h" long PyImport_GetMagicNumber(void); PyObject * PyImport_ExecCodeModule(char *name, PyObject *co); PyObject * PyImport_ExecCodeModuleEx( char *name, PyObject *co, char *pathname); PyObject * PyImport_GetModuleDict(void); PyObject * PyImport_AddModule(const char *name); PyObject * PyImport_ImportModule(const char *name); PyObject * PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level); PyObject * PyImport_ImportModuleEx( char *name, PyObject *globals, PyObject *locals, PyObject *fromlist); PyObject * PyImport_Import(PyObject *name); PyObject * PyImport_ReloadModule(PyObject *m); void PyImport_Cleanup(void); int PyImport_ImportFrozenModule(char *); struct filedescr * _PyImport_FindModule( const char *, PyObject *, char *, size_t, FILE **, PyObject **); int _PyImport_IsScript(struct filedescr *); void _PyImport_ReInitLock(void); PyObject *_PyImport_FindExtension(char *, char *); PyObject *_PyImport_FixupExtension(char *, char *); struct _inittab { char *name; void (*initfunc)(void); }; extern struct _inittab * PyImport_Inittab; int PyImport_AppendInittab(char *name, void (*initfunc)(void)); int PyImport_ExtendInittab(struct _inittab *newtab); struct _frozen { char *name; unsigned char *code; int size; }; extern struct _frozen * PyImport_FrozenModules; # 125 "Include/Python.h" 2 # 1 "Include/abstract.h" 1 # 231 "Include/abstract.h" int PyObject_Cmp(PyObject *o1, PyObject *o2, int *result); # 304 "Include/abstract.h" PyObject * PyObject_Call(PyObject *callable_object, PyObject *args, PyObject *kw); # 314 "Include/abstract.h" PyObject * PyObject_CallObject(PyObject *callable_object, PyObject *args); # 326 "Include/abstract.h" PyObject * _PyObject_CallFunction_SizeT(PyObject *callable_object, char *format, ...); # 340 "Include/abstract.h" PyObject * _PyObject_CallMethod_SizeT(PyObject *o, char *m, char *format, ...); # 352 "Include/abstract.h" PyObject * _PyObject_CallFunction_SizeT(PyObject *callable, char *format, ...); PyObject * _PyObject_CallMethod_SizeT(PyObject *o, char *name, char *format, ...); PyObject * PyObject_CallFunctionObjArgs(PyObject *callable, ...); # 370 "Include/abstract.h" PyObject * PyObject_CallMethodObjArgs(PyObject *o, PyObject *m, ...); # 413 "Include/abstract.h" PyObject * PyObject_Type(PyObject *o); Py_ssize_t PyObject_Size(PyObject *o); # 433 "Include/abstract.h" Py_ssize_t PyObject_Length(PyObject *o); Py_ssize_t _PyObject_LengthHint(PyObject *o); # 457 "Include/abstract.h" PyObject * PyObject_GetItem(PyObject *o, PyObject *key); # 466 "Include/abstract.h" int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v); int PyObject_DelItemString(PyObject *o, char *key); int PyObject_DelItem(PyObject *o, PyObject *key); int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len); # 505 "Include/abstract.h" int PyObject_CheckReadBuffer(PyObject *obj); # 514 "Include/abstract.h" int PyObject_AsReadBuffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len); # 530 "Include/abstract.h" int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len); # 547 "Include/abstract.h" PyObject * PyObject_GetIter(PyObject *); # 556 "Include/abstract.h" PyObject * PyIter_Next(PyObject *); int PyNumber_Check(PyObject *o); # 574 "Include/abstract.h" PyObject * PyNumber_Add(PyObject *o1, PyObject *o2); # 583 "Include/abstract.h" PyObject * PyNumber_Subtract(PyObject *o1, PyObject *o2); # 592 "Include/abstract.h" PyObject * PyNumber_Multiply(PyObject *o1, PyObject *o2); # 602 "Include/abstract.h" PyObject * PyNumber_Divide(PyObject *o1, PyObject *o2); # 611 "Include/abstract.h" PyObject * PyNumber_FloorDivide(PyObject *o1, PyObject *o2); # 621 "Include/abstract.h" PyObject * PyNumber_TrueDivide(PyObject *o1, PyObject *o2); # 631 "Include/abstract.h" PyObject * PyNumber_Remainder(PyObject *o1, PyObject *o2); # 641 "Include/abstract.h" PyObject * PyNumber_Divmod(PyObject *o1, PyObject *o2); # 651 "Include/abstract.h" PyObject * PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3); # 661 "Include/abstract.h" PyObject * PyNumber_Negative(PyObject *o); PyObject * PyNumber_Positive(PyObject *o); PyObject * PyNumber_Absolute(PyObject *o); PyObject * PyNumber_Invert(PyObject *o); # 695 "Include/abstract.h" PyObject * PyNumber_Lshift(PyObject *o1, PyObject *o2); # 705 "Include/abstract.h" PyObject * PyNumber_Rshift(PyObject *o1, PyObject *o2); # 714 "Include/abstract.h" PyObject * PyNumber_And(PyObject *o1, PyObject *o2); # 724 "Include/abstract.h" PyObject * PyNumber_Xor(PyObject *o1, PyObject *o2); # 734 "Include/abstract.h" PyObject * PyNumber_Or(PyObject *o1, PyObject *o2); # 767 "Include/abstract.h" PyObject * PyNumber_Index(PyObject *o); Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc); # 784 "Include/abstract.h" PyObject * PyNumber_Int(PyObject *o); # 793 "Include/abstract.h" PyObject * PyNumber_Long(PyObject *o); # 802 "Include/abstract.h" PyObject * PyNumber_Float(PyObject *o); # 812 "Include/abstract.h" PyObject * PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2); # 821 "Include/abstract.h" PyObject * PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2); # 830 "Include/abstract.h" PyObject * PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2); # 839 "Include/abstract.h" PyObject * PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2); # 848 "Include/abstract.h" PyObject * PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2); # 859 "Include/abstract.h" PyObject * PyNumber_InPlaceTrueDivide(PyObject *o1, PyObject *o2); # 870 "Include/abstract.h" PyObject * PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2); # 879 "Include/abstract.h" PyObject * PyNumber_InPlacePower(PyObject *o1, PyObject *o2, PyObject *o3); # 889 "Include/abstract.h" PyObject * PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2); # 898 "Include/abstract.h" PyObject * PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2); # 907 "Include/abstract.h" PyObject * PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2); # 916 "Include/abstract.h" PyObject * PyNumber_InPlaceXor(PyObject *o1, PyObject *o2); # 925 "Include/abstract.h" PyObject * PyNumber_InPlaceOr(PyObject *o1, PyObject *o2); # 937 "Include/abstract.h" int PySequence_Check(PyObject *o); # 947 "Include/abstract.h" Py_ssize_t PySequence_Size(PyObject *o); # 956 "Include/abstract.h" Py_ssize_t PySequence_Length(PyObject *o); PyObject * PySequence_Concat(PyObject *o1, PyObject *o2); # 969 "Include/abstract.h" PyObject * PySequence_Repeat(PyObject *o, Py_ssize_t count); # 978 "Include/abstract.h" PyObject * PySequence_GetItem(PyObject *o, Py_ssize_t i); PyObject * PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2); # 994 "Include/abstract.h" int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v); # 1003 "Include/abstract.h" int PySequence_DelItem(PyObject *o, Py_ssize_t i); int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v); int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2); PyObject * PySequence_Tuple(PyObject *o); PyObject * PySequence_List(PyObject *o); PyObject * PySequence_Fast(PyObject *o, const char* m); # 1078 "Include/abstract.h" Py_ssize_t PySequence_Count(PyObject *o, PyObject *value); # 1087 "Include/abstract.h" int PySequence_Contains(PyObject *seq, PyObject *ob); # 1096 "Include/abstract.h" Py_ssize_t _PySequence_IterSearch(PyObject *seq, PyObject *obj, int operation); # 1111 "Include/abstract.h" int PySequence_In(PyObject *o, PyObject *value); # 1122 "Include/abstract.h" Py_ssize_t PySequence_Index(PyObject *o, PyObject *value); # 1132 "Include/abstract.h" PyObject * PySequence_InPlaceConcat(PyObject *o1, PyObject *o2); # 1141 "Include/abstract.h" PyObject * PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count); # 1152 "Include/abstract.h" int PyMapping_Check(PyObject *o); # 1161 "Include/abstract.h" Py_ssize_t PyMapping_Size(PyObject *o); # 1171 "Include/abstract.h" Py_ssize_t PyMapping_Length(PyObject *o); # 1195 "Include/abstract.h" int PyMapping_HasKeyString(PyObject *o, char *key); # 1205 "Include/abstract.h" int PyMapping_HasKey(PyObject *o, PyObject *key); # 1248 "Include/abstract.h" PyObject * PyMapping_GetItemString(PyObject *o, char *key); int PyMapping_SetItemString(PyObject *o, char *key, PyObject *value); # 1266 "Include/abstract.h" int PyObject_IsInstance(PyObject *object, PyObject *typeorclass); int PyObject_IsSubclass(PyObject *object, PyObject *typeorclass); # 127 "Include/Python.h" 2 # 1 "Include/compile.h" 1 # 1 "Include/code.h" 1 # 10 "Include/code.h" typedef struct { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; int co_argcount; int co_nlocals; int co_stacksize; int co_flags; PyObject *co_code; PyObject *co_consts; PyObject *co_names; PyObject *co_varnames; PyObject *co_freevars; PyObject *co_cellvars; PyObject *co_filename; PyObject *co_name; int co_firstlineno; PyObject *co_lnotab; void *co_zombieframe; } PyCodeObject; # 59 "Include/code.h" extern PyTypeObject PyCode_Type; PyCodeObject * PyCode_New( int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); int PyCode_Addr2Line(PyCodeObject *, int); typedef struct _addr_pair { int ap_lower; int ap_upper; } PyAddrPair; # 88 "Include/code.h" int PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds); # 6 "Include/compile.h" 2 struct _node; PyCodeObject * PyNode_Compile(struct _node *, const char *); typedef struct { int ff_features; int ff_lineno; } PyFutureFeatures; struct _mod; PyCodeObject * PyAST_Compile(struct _mod *, const char *, PyCompilerFlags *, PyArena *); PyFutureFeatures * PyFuture_FromAST(struct _mod *, const char *); # 129 "Include/Python.h" 2 # 1 "Include/eval.h" 1 # 10 "Include/eval.h" PyObject * PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *); PyObject * PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argc, PyObject **kwds, int kwdc, PyObject **defs, int defc, PyObject *closure); PyObject * _PyEval_CallTracing(PyObject *func, PyObject *args); # 130 "Include/Python.h" 2 # 1 "Include/pystrtod.h" 1 # 9 "Include/pystrtod.h" double PyOS_ascii_strtod(const char *str, char **ptr); double PyOS_ascii_atof(const char *str); char * PyOS_ascii_formatd(char *buffer, size_t buf_len, const char *format, double d); # 132 "Include/Python.h" 2 PyObject* _Py_Mangle(PyObject *p, PyObject *name); # 151 "Include/Python.h" # 1 "Include/pyfpe.h" 1 # 129 "Include/pyfpe.h" # 1 "/usr/include/signal.h" 1 3 4 # 31 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/sigset.h" 1 3 4 # 104 "/usr/include/bits/sigset.h" 3 4 extern int __sigismember (__const __sigset_t *, int); extern int __sigaddset (__sigset_t *, int); extern int __sigdelset (__sigset_t *, int); # 118 "/usr/include/bits/sigset.h" 3 4 extern __inline int __sigismember (__const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; } extern __inline int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); } extern __inline int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); } # 34 "/usr/include/signal.h" 2 3 4 typedef __sig_atomic_t sig_atomic_t; # 58 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/signum.h" 1 3 4 # 59 "/usr/include/signal.h" 2 3 4 # 75 "/usr/include/signal.h" 3 4 typedef void (*__sighandler_t) (int); extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__)); extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__)); extern __sighandler_t signal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__)); # 104 "/usr/include/signal.h" 3 4 extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__)); extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__)); extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__)); extern int raise (int __sig) __attribute__ ((__nothrow__)); extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__)); extern int gsignal (int __sig) __attribute__ ((__nothrow__)); extern void psignal (int __sig, __const char *__s); # 153 "/usr/include/signal.h" 3 4 extern int __sigpause (int __sig_or_mask, int __is_sig); # 162 "/usr/include/signal.h" 3 4 extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); # 181 "/usr/include/signal.h" 3 4 extern int sigblock (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); extern int sigsetmask (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); extern int siggetmask (void) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); # 196 "/usr/include/signal.h" 3 4 typedef __sighandler_t sighandler_t; typedef __sighandler_t sig_t; # 212 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/siginfo.h" 1 3 4 # 25 "/usr/include/bits/siginfo.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 26 "/usr/include/bits/siginfo.h" 2 3 4 typedef union sigval { int sival_int; void *sival_ptr; } sigval_t; # 51 "/usr/include/bits/siginfo.h" 3 4 typedef struct siginfo { int si_signo; int si_errno; int si_code; union { int _pad[((128 / sizeof (int)) - 3)]; struct { __pid_t si_pid; __uid_t si_uid; } _kill; struct { int si_tid; int si_overrun; sigval_t si_sigval; } _timer; struct { __pid_t si_pid; __uid_t si_uid; sigval_t si_sigval; } _rt; struct { __pid_t si_pid; __uid_t si_uid; int si_status; __clock_t si_utime; __clock_t si_stime; } _sigchld; struct { void *si_addr; } _sigfault; struct { long int si_band; int si_fd; } _sigpoll; } _sifields; } siginfo_t; # 129 "/usr/include/bits/siginfo.h" 3 4 enum { SI_ASYNCNL = -60, SI_TKILL = -6, SI_SIGIO, SI_ASYNCIO, SI_MESGQ, SI_TIMER, SI_QUEUE, SI_USER, SI_KERNEL = 0x80 }; enum { ILL_ILLOPC = 1, ILL_ILLOPN, ILL_ILLADR, ILL_ILLTRP, ILL_PRVOPC, ILL_PRVREG, ILL_COPROC, ILL_BADSTK }; enum { FPE_INTDIV = 1, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB }; enum { SEGV_MAPERR = 1, SEGV_ACCERR }; enum { BUS_ADRALN = 1, BUS_ADRERR, BUS_OBJERR }; enum { TRAP_BRKPT = 1, TRAP_TRACE }; enum { CLD_EXITED = 1, CLD_KILLED, CLD_DUMPED, CLD_TRAPPED, CLD_STOPPED, CLD_CONTINUED }; enum { POLL_IN = 1, POLL_OUT, POLL_MSG, POLL_ERR, POLL_PRI, POLL_HUP }; # 273 "/usr/include/bits/siginfo.h" 3 4 typedef struct sigevent { sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[((64 / sizeof (int)) - 3)]; __pid_t _tid; struct { void (*_function) (sigval_t); void *_attribute; } _sigev_thread; } _sigev_un; } sigevent_t; enum { SIGEV_SIGNAL = 0, SIGEV_NONE, SIGEV_THREAD, SIGEV_THREAD_ID = 4 }; # 213 "/usr/include/signal.h" 2 3 4 extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sigismember (__const sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sigisemptyset (__const sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sigandset (sigset_t *__set, __const sigset_t *__left, __const sigset_t *__right) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int sigorset (sigset_t *__set, __const sigset_t *__left, __const sigset_t *__right) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))); # 1 "/usr/include/bits/sigaction.h" 1 3 4 # 25 "/usr/include/bits/sigaction.h" 3 4 struct sigaction { union { __sighandler_t sa_handler; void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; __sigset_t sa_mask; int sa_flags; void (*sa_restorer) (void); }; # 247 "/usr/include/signal.h" 2 3 4 extern int sigprocmask (int __how, __const sigset_t *__restrict __set, sigset_t *__restrict __oset) __attribute__ ((__nothrow__)); extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1))); extern int sigaction (int __sig, __const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) __attribute__ ((__nothrow__)); extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig) __attribute__ ((__nonnull__ (1, 2))); extern int sigwaitinfo (__const sigset_t *__restrict __set, siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1))); extern int sigtimedwait (__const sigset_t *__restrict __set, siginfo_t *__restrict __info, __const struct timespec *__restrict __timeout) __attribute__ ((__nonnull__ (1))); extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val) __attribute__ ((__nothrow__)); # 304 "/usr/include/signal.h" 3 4 extern __const char *__const _sys_siglist[65]; extern __const char *__const sys_siglist[65]; struct sigvec { __sighandler_t sv_handler; int sv_mask; int sv_flags; }; # 328 "/usr/include/signal.h" 3 4 extern int sigvec (int __sig, __const struct sigvec *__vec, struct sigvec *__ovec) __attribute__ ((__nothrow__)); # 1 "/usr/include/bits/sigcontext.h" 1 3 4 # 28 "/usr/include/bits/sigcontext.h" 3 4 # 1 "/usr/include/asm/sigcontext.h" 1 3 4 # 19 "/usr/include/asm/sigcontext.h" 3 4 struct _fpreg { unsigned short significand[4]; unsigned short exponent; }; struct _fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short padding[3]; }; struct _xmmreg { unsigned long element[4]; }; struct _fpstate { unsigned long cw; unsigned long sw; unsigned long tag; unsigned long ipoff; unsigned long cssel; unsigned long dataoff; unsigned long datasel; struct _fpreg _st[8]; unsigned short status; unsigned short magic; unsigned long _fxsr_env[6]; unsigned long mxcsr; unsigned long reserved; struct _fpxreg _fxsr_st[8]; struct _xmmreg _xmm[8]; unsigned long padding[56]; }; struct sigcontext { unsigned short gs, __gsh; unsigned short fs, __fsh; unsigned short es, __esh; unsigned short ds, __dsh; unsigned long edi; unsigned long esi; unsigned long ebp; unsigned long esp; unsigned long ebx; unsigned long edx; unsigned long ecx; unsigned long eax; unsigned long trapno; unsigned long err; unsigned long eip; unsigned short cs, __csh; unsigned long eflags; unsigned long esp_at_signal; unsigned short ss, __ssh; struct _fpstate * fpstate; unsigned long oldmask; unsigned long cr2; }; # 29 "/usr/include/bits/sigcontext.h" 2 3 4 # 334 "/usr/include/signal.h" 2 3 4 extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__)); # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/stddef.h" 1 3 4 # 344 "/usr/include/signal.h" 2 3 4 extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__)); # 1 "/usr/include/bits/sigstack.h" 1 3 4 # 26 "/usr/include/bits/sigstack.h" 3 4 struct sigstack { void *ss_sp; int ss_onstack; }; enum { SS_ONSTACK = 1, SS_DISABLE }; # 50 "/usr/include/bits/sigstack.h" 3 4 typedef struct sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; # 351 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/sys/ucontext.h" 1 3 4 # 23 "/usr/include/sys/ucontext.h" 3 4 # 1 "/usr/include/signal.h" 1 3 4 # 24 "/usr/include/sys/ucontext.h" 2 3 4 # 1 "/usr/include/bits/sigcontext.h" 1 3 4 # 28 "/usr/include/sys/ucontext.h" 2 3 4 typedef int greg_t; typedef greg_t gregset_t[19]; enum { REG_GS = 0, REG_FS, REG_ES, REG_DS, REG_EDI, REG_ESI, REG_EBP, REG_ESP, REG_EBX, REG_EDX, REG_ECX, REG_EAX, REG_TRAPNO, REG_ERR, REG_EIP, REG_CS, REG_EFL, REG_UESP, REG_SS }; struct _libc_fpreg { unsigned short int significand[4]; unsigned short int exponent; }; struct _libc_fpstate { unsigned long int cw; unsigned long int sw; unsigned long int tag; unsigned long int ipoff; unsigned long int cssel; unsigned long int dataoff; unsigned long int datasel; struct _libc_fpreg _st[8]; unsigned long int status; }; typedef struct _libc_fpstate *fpregset_t; typedef struct { gregset_t gregs; fpregset_t fpregs; unsigned long int oldmask; unsigned long int cr2; } mcontext_t; typedef struct ucontext { unsigned long int uc_flags; struct ucontext *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; __sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; # 354 "/usr/include/signal.h" 2 3 4 extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); extern int sigaltstack (__const struct sigaltstack *__restrict __ss, struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__)); extern int sighold (int __sig) __attribute__ ((__nothrow__)); extern int sigrelse (int __sig) __attribute__ ((__nothrow__)); extern int sigignore (int __sig) __attribute__ ((__nothrow__)); extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__)); # 1 "/usr/include/bits/sigthread.h" 1 3 4 # 31 "/usr/include/bits/sigthread.h" 3 4 extern int pthread_sigmask (int __how, __const __sigset_t *__restrict __newmask, __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__)); extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__)); # 390 "/usr/include/signal.h" 2 3 4 extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__)); extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__)); # 130 "Include/pyfpe.h" 2 # 1 "/usr/include/setjmp.h" 1 3 4 # 28 "/usr/include/setjmp.h" 3 4 # 1 "/usr/include/bits/setjmp.h" 1 3 4 # 29 "/usr/include/bits/setjmp.h" 3 4 typedef int __jmp_buf[6]; # 31 "/usr/include/setjmp.h" 2 3 4 # 1 "/usr/include/bits/sigset.h" 1 3 4 # 32 "/usr/include/setjmp.h" 2 3 4 struct __jmp_buf_tag { __jmp_buf __jmpbuf; int __mask_was_saved; __sigset_t __saved_mask; }; typedef struct __jmp_buf_tag jmp_buf[1]; extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__)); extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__)); extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__)); # 78 "/usr/include/setjmp.h" 3 4 extern void longjmp (struct __jmp_buf_tag __env[1], int __val) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); typedef struct __jmp_buf_tag sigjmp_buf[1]; # 110 "/usr/include/setjmp.h" 3 4 extern void siglongjmp (sigjmp_buf __env, int __val) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); # 131 "Include/pyfpe.h" 2 extern jmp_buf PyFPE_jbuf; extern int PyFPE_counter; extern double PyFPE_dummy(void *); # 152 "Include/Python.h" 2 # 44 "Objects/unicodeobject.c" 2 # 1 "Include/unicodeobject.h" 1 # 46 "Objects/unicodeobject.c" 2 # 1 "Include/ucnhash.h" 1 # 11 "Include/ucnhash.h" typedef struct { int size; int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen); int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code); } _PyUnicode_Name_CAPI; # 47 "Objects/unicodeobject.c" 2 # 96 "Objects/unicodeobject.c" static PyUnicodeObject *unicode_freelist; static int unicode_freelist_size; static PyUnicodeObject *unicode_empty; static PyUnicodeObject *unicode_latin1[256]; # 113 "Objects/unicodeobject.c" static char unicode_default_encoding[100]; Py_UNICODE PyUnicodeUCS4_GetMax(void) { return 0x10FFFF; } # 137 "Objects/unicodeobject.c" static unsigned long bloom_linebreak; static unsigned long make_bloom_mask(Py_UNICODE* ptr, Py_ssize_t len) { long mask; Py_ssize_t i; mask = 0; for (i = 0; i < len; i++) mask |= (1 << (ptr[i] & 0x1F)); return mask; } static int unicode_member(Py_UNICODE chr, Py_UNICODE* set, Py_ssize_t setlen) { Py_ssize_t i; for (i = 0; i < setlen; i++) if (set[i] == chr) return 1; return 0; } static int unicode_resize(register PyUnicodeObject *unicode, Py_ssize_t length) { void *oldstr; if (unicode->length == length) goto reset; if (unicode == unicode_empty || (unicode->length == 1 && unicode->str[0] < 256U && unicode_latin1[unicode->str[0]] == unicode)) { PyErr_SetString(PyExc_SystemError, "can't resize shared unicode objects"); return -1; } oldstr = unicode->str; ( (unicode->str) = (Py_UNICODE *) realloc(((unicode->str)), ((length + 1) * sizeof(Py_UNICODE)) ? ((length + 1) * sizeof(Py_UNICODE)) : 1) ); if (!unicode->str) { unicode->str = (Py_UNICODE *)oldstr; PyErr_NoMemory(); return -1; } unicode->str[length] = 0; unicode->length = length; reset: if (unicode->defenc) { if ( --(unicode->defenc)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode->defenc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode->defenc)))); unicode->defenc = ((void *)0); } unicode->hash = -1; return 0; } # 231 "Objects/unicodeobject.c" static PyUnicodeObject *_PyUnicode_New(Py_ssize_t length) { register PyUnicodeObject *unicode; if (length == 0 && unicode_empty != ((void *)0)) { ( (unicode_empty)->ob_refcnt++); return unicode_empty; } if (unicode_freelist) { unicode = unicode_freelist; unicode_freelist = *(PyUnicodeObject **)unicode; unicode_freelist_size--; if (unicode->str) { if ((unicode->length < length) && unicode_resize(unicode, length) < 0) { free(unicode->str); goto onError; } } else { unicode->str = ( (Py_UNICODE *) malloc(((length + 1) * sizeof(Py_UNICODE)) ? ((length + 1) * sizeof(Py_UNICODE)) : 1) ); } ( (unicode)->ob_type = (&PyUnicode_Type), ( ((PyObject *)(unicode))->ob_refcnt = 1), (unicode) ); } else { unicode = ( (PyUnicodeObject *) _PyObject_New(&PyUnicode_Type) ); if (unicode == ((void *)0)) return ((void *)0); unicode->str = ( (Py_UNICODE *) malloc(((length + 1) * sizeof(Py_UNICODE)) ? ((length + 1) * sizeof(Py_UNICODE)) : 1) ); } if (!unicode->str) { PyErr_NoMemory(); goto onError; } unicode->str[0] = 0; unicode->str[length] = 0; unicode->length = length; unicode->hash = -1; unicode->defenc = ((void *)0); return unicode; onError: ; PyObject_Free(unicode); return ((void *)0); } static void unicode_dealloc(register PyUnicodeObject *unicode) { if (((unicode)->ob_type == &PyUnicode_Type) && unicode_freelist_size < 1024) { if (unicode->length >= 9) { free(unicode->str); unicode->str = ((void *)0); unicode->length = 0; } if (unicode->defenc) { if ( --(unicode->defenc)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode->defenc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode->defenc)))); unicode->defenc = ((void *)0); } *(PyUnicodeObject **)unicode = unicode_freelist; unicode_freelist = unicode; unicode_freelist_size++; } else { free(unicode->str); if ((unicode->defenc) == ((void *)0)) ; else if ( --(unicode->defenc)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode->defenc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode->defenc)))); unicode->ob_type->tp_free((PyObject *)unicode); } } int PyUnicodeUCS4_Resize(PyObject **unicode, Py_ssize_t length) { register PyUnicodeObject *v; if (unicode == ((void *)0)) { _PyErr_BadInternalCall("Objects/unicodeobject.c", 325); return -1; } v = (PyUnicodeObject *)*unicode; if (v == ((void *)0) || !((v)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((v)->ob_type, (&PyUnicode_Type))) || v->ob_refcnt != 1 || length < 0) { _PyErr_BadInternalCall("Objects/unicodeobject.c", 330); return -1; } if (v->length != length && (v == unicode_empty || v->length == 1)) { PyUnicodeObject *w = _PyUnicode_New(length); if (w == ((void *)0)) return -1; memcpy((w->str), (v->str), (length < v->length ? length : v->length)*sizeof(Py_UNICODE)); if ( --(*unicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(*unicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(*unicode)))); *unicode = (PyObject *)w; return 0; } return unicode_resize(v, length); } PyObject *PyUnicodeUCS4_FromUnicode(const Py_UNICODE *u, Py_ssize_t size) { PyUnicodeObject *unicode; if (u != ((void *)0)) { if (size == 0 && unicode_empty != ((void *)0)) { ( (unicode_empty)->ob_refcnt++); return (PyObject *)unicode_empty; } if (size == 1 && *u < 256) { unicode = unicode_latin1[*u]; if (!unicode) { unicode = _PyUnicode_New(1); if (!unicode) return ((void *)0); unicode->str[0] = *u; unicode_latin1[*u] = unicode; } ( (unicode)->ob_refcnt++); return (PyObject *)unicode; } } unicode = _PyUnicode_New(size); if (!unicode) return ((void *)0); if (u != ((void *)0)) memcpy((unicode->str), (u), (size)*sizeof(Py_UNICODE)); return (PyObject *)unicode; } PyObject *PyUnicodeUCS4_FromWideChar(register const wchar_t *w, Py_ssize_t size) { PyUnicodeObject *unicode; if (w == ((void *)0)) { _PyErr_BadInternalCall("Objects/unicodeobject.c", 408); return ((void *)0); } unicode = _PyUnicode_New(size); if (!unicode) return ((void *)0); { register Py_UNICODE *u; register Py_ssize_t i; u = (((PyUnicodeObject *)(unicode))->str); for (i = size; i > 0; i--) *u++ = *w++; } return (PyObject *)unicode; } Py_ssize_t PyUnicodeUCS4_AsWideChar(PyUnicodeObject *unicode, wchar_t *w, Py_ssize_t size) { if (unicode == ((void *)0)) { _PyErr_BadInternalCall("Objects/unicodeobject.c", 437); return -1; } if (size > (((PyUnicodeObject *)(unicode))->length)) size = (((PyUnicodeObject *)(unicode))->length) + 1; { register Py_UNICODE *u; register Py_ssize_t i; u = (((PyUnicodeObject *)(unicode))->str); for (i = size; i > 0; i--) *w++ = *u++; } if (size > (((PyUnicodeObject *)(unicode))->length)) return (((PyUnicodeObject *)(unicode))->length); else return size; } PyObject *PyUnicodeUCS4_FromOrdinal(int ordinal) { Py_UNICODE s[1]; if (ordinal < 0 || ordinal > 0x10ffff) { PyErr_SetString(PyExc_ValueError, "unichr() arg not in range(0x110000) " "(wide Python build)"); return ((void *)0); } # 485 "Objects/unicodeobject.c" s[0] = (Py_UNICODE)ordinal; return PyUnicodeUCS4_FromUnicode(s, 1); } PyObject *PyUnicodeUCS4_FromObject(register PyObject *obj) { if (((obj)->ob_type == &PyUnicode_Type)) { ( (obj)->ob_refcnt++); return obj; } if (((obj)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((obj)->ob_type, (&PyUnicode_Type)))) { return PyUnicodeUCS4_FromUnicode((((PyUnicodeObject *)(obj))->str), (((PyUnicodeObject *)(obj))->length)); } return PyUnicodeUCS4_FromEncodedObject(obj, ((void *)0), "strict"); } PyObject *PyUnicodeUCS4_FromEncodedObject(register PyObject *obj, const char *encoding, const char *errors) { const char *s = ((void *)0); Py_ssize_t len; PyObject *v; if (obj == ((void *)0)) { _PyErr_BadInternalCall("Objects/unicodeobject.c", 515); return ((void *)0); } # 538 "Objects/unicodeobject.c" if (((obj)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((obj)->ob_type, (&PyUnicode_Type)))) { PyErr_SetString(PyExc_TypeError, "decoding Unicode is not supported"); return ((void *)0); } if (((obj)->ob_type == (&PyString_Type) || PyType_IsSubtype((obj)->ob_type, (&PyString_Type)))) { s = (((PyStringObject *)(obj))->ob_sval); len = (((PyStringObject *)(obj))->ob_size); } else if (PyObject_AsCharBuffer(obj, &s, &len)) { if (PyErr_ExceptionMatches(PyExc_TypeError)) PyErr_Format(PyExc_TypeError, "coercing to Unicode: need string or buffer, " "%.80s found", obj->ob_type->tp_name); goto onError; } if (len == 0) { ( (unicode_empty)->ob_refcnt++); v = (PyObject *)unicode_empty; } else v = PyUnicodeUCS4_Decode(s, len, encoding, errors); return v; onError: return ((void *)0); } PyObject *PyUnicodeUCS4_Decode(const char *s, Py_ssize_t size, const char *encoding, const char *errors) { PyObject *buffer = ((void *)0), *unicode; if (encoding == ((void *)0)) encoding = PyUnicodeUCS4_GetDefaultEncoding(); if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (encoding) && __builtin_constant_p ("utf-8") && (__s1_len = strlen (encoding), __s2_len = strlen ("utf-8"), (!((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("utf-8") + 1) - (size_t)(const void *)("utf-8") == 1) || __s2_len >= 4)) ? __builtin_strcmp (encoding, "utf-8") : (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) && (__s1_len = strlen (encoding), __s1_len < 4) ? (__builtin_constant_p ("utf-8") && ((size_t)(const void *)(("utf-8") + 1) - (size_t)(const void *)("utf-8") == 1) ? __builtin_strcmp (encoding, "utf-8") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("utf-8"); register int __result = (((__const unsigned char *) (__const char *) (encoding))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (encoding))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("utf-8") && ((size_t)(const void *)(("utf-8") + 1) - (size_t)(const void *)("utf-8") == 1) && (__s2_len = strlen ("utf-8"), __s2_len < 4) ? (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) ? __builtin_strcmp (encoding, "utf-8") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (encoding); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("utf-8"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("utf-8"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("utf-8"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("utf-8"))[3]); } } __result; }))) : __builtin_strcmp (encoding, "utf-8")))); }) == 0) return PyUnicodeUCS4_DecodeUTF8(s, size, errors); else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (encoding) && __builtin_constant_p ("latin-1") && (__s1_len = strlen (encoding), __s2_len = strlen ("latin-1"), (!((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("latin-1") + 1) - (size_t)(const void *)("latin-1") == 1) || __s2_len >= 4)) ? __builtin_strcmp (encoding, "latin-1") : (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) && (__s1_len = strlen (encoding), __s1_len < 4) ? (__builtin_constant_p ("latin-1") && ((size_t)(const void *)(("latin-1") + 1) - (size_t)(const void *)("latin-1") == 1) ? __builtin_strcmp (encoding, "latin-1") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("latin-1"); register int __result = (((__const unsigned char *) (__const char *) (encoding))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (encoding))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("latin-1") && ((size_t)(const void *)(("latin-1") + 1) - (size_t)(const void *)("latin-1") == 1) && (__s2_len = strlen ("latin-1"), __s2_len < 4) ? (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) ? __builtin_strcmp (encoding, "latin-1") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (encoding); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("latin-1"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("latin-1"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("latin-1"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("latin-1"))[3]); } } __result; }))) : __builtin_strcmp (encoding, "latin-1")))); }) == 0) return PyUnicodeUCS4_DecodeLatin1(s, size, errors); else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (encoding) && __builtin_constant_p ("ascii") && (__s1_len = strlen (encoding), __s2_len = strlen ("ascii"), (!((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("ascii") + 1) - (size_t)(const void *)("ascii") == 1) || __s2_len >= 4)) ? __builtin_strcmp (encoding, "ascii") : (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) && (__s1_len = strlen (encoding), __s1_len < 4) ? (__builtin_constant_p ("ascii") && ((size_t)(const void *)(("ascii") + 1) - (size_t)(const void *)("ascii") == 1) ? __builtin_strcmp (encoding, "ascii") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("ascii"); register int __result = (((__const unsigned char *) (__const char *) (encoding))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (encoding))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("ascii") && ((size_t)(const void *)(("ascii") + 1) - (size_t)(const void *)("ascii") == 1) && (__s2_len = strlen ("ascii"), __s2_len < 4) ? (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) ? __builtin_strcmp (encoding, "ascii") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (encoding); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("ascii"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("ascii"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("ascii"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("ascii"))[3]); } } __result; }))) : __builtin_strcmp (encoding, "ascii")))); }) == 0) return PyUnicodeUCS4_DecodeASCII(s, size, errors); buffer = PyBuffer_FromMemory((void *)s, size); if (buffer == ((void *)0)) goto onError; unicode = PyCodec_Decode(buffer, encoding, errors); if (unicode == ((void *)0)) goto onError; if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_Format(PyExc_TypeError, "decoder did not return an unicode object (type=%.400s)", unicode->ob_type->tp_name); if ( --(unicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode)))); goto onError; } if ( --(buffer)->ob_refcnt != 0) ; else ( (*((PyObject *)(buffer))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(buffer)))); return unicode; onError: if ((buffer) == ((void *)0)) ; else if ( --(buffer)->ob_refcnt != 0) ; else ( (*((PyObject *)(buffer))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(buffer)))); return ((void *)0); } PyObject *PyUnicode_AsDecodedObject(PyObject *unicode, const char *encoding, const char *errors) { PyObject *v; if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); goto onError; } if (encoding == ((void *)0)) encoding = PyUnicodeUCS4_GetDefaultEncoding(); v = PyCodec_Decode(unicode, encoding, errors); if (v == ((void *)0)) goto onError; return v; onError: return ((void *)0); } PyObject *PyUnicodeUCS4_Encode(const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors) { PyObject *v, *unicode; unicode = PyUnicodeUCS4_FromUnicode(s, size); if (unicode == ((void *)0)) return ((void *)0); v = PyUnicodeUCS4_AsEncodedString(unicode, encoding, errors); if ( --(unicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode)))); return v; } PyObject *PyUnicodeUCS4_AsEncodedObject(PyObject *unicode, const char *encoding, const char *errors) { PyObject *v; if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); goto onError; } if (encoding == ((void *)0)) encoding = PyUnicodeUCS4_GetDefaultEncoding(); v = PyCodec_Encode(unicode, encoding, errors); if (v == ((void *)0)) goto onError; return v; onError: return ((void *)0); } PyObject *PyUnicodeUCS4_AsEncodedString(PyObject *unicode, const char *encoding, const char *errors) { PyObject *v; if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); goto onError; } if (encoding == ((void *)0)) encoding = PyUnicodeUCS4_GetDefaultEncoding(); if (errors == ((void *)0)) { if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (encoding) && __builtin_constant_p ("utf-8") && (__s1_len = strlen (encoding), __s2_len = strlen ("utf-8"), (!((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("utf-8") + 1) - (size_t)(const void *)("utf-8") == 1) || __s2_len >= 4)) ? __builtin_strcmp (encoding, "utf-8") : (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) && (__s1_len = strlen (encoding), __s1_len < 4) ? (__builtin_constant_p ("utf-8") && ((size_t)(const void *)(("utf-8") + 1) - (size_t)(const void *)("utf-8") == 1) ? __builtin_strcmp (encoding, "utf-8") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("utf-8"); register int __result = (((__const unsigned char *) (__const char *) (encoding))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (encoding))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("utf-8") && ((size_t)(const void *)(("utf-8") + 1) - (size_t)(const void *)("utf-8") == 1) && (__s2_len = strlen ("utf-8"), __s2_len < 4) ? (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) ? __builtin_strcmp (encoding, "utf-8") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (encoding); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("utf-8"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("utf-8"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("utf-8"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("utf-8"))[3]); } } __result; }))) : __builtin_strcmp (encoding, "utf-8")))); }) == 0) return PyUnicodeUCS4_AsUTF8String(unicode); else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (encoding) && __builtin_constant_p ("latin-1") && (__s1_len = strlen (encoding), __s2_len = strlen ("latin-1"), (!((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("latin-1") + 1) - (size_t)(const void *)("latin-1") == 1) || __s2_len >= 4)) ? __builtin_strcmp (encoding, "latin-1") : (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) && (__s1_len = strlen (encoding), __s1_len < 4) ? (__builtin_constant_p ("latin-1") && ((size_t)(const void *)(("latin-1") + 1) - (size_t)(const void *)("latin-1") == 1) ? __builtin_strcmp (encoding, "latin-1") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("latin-1"); register int __result = (((__const unsigned char *) (__const char *) (encoding))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (encoding))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("latin-1") && ((size_t)(const void *)(("latin-1") + 1) - (size_t)(const void *)("latin-1") == 1) && (__s2_len = strlen ("latin-1"), __s2_len < 4) ? (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) ? __builtin_strcmp (encoding, "latin-1") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (encoding); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("latin-1"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("latin-1"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("latin-1"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("latin-1"))[3]); } } __result; }))) : __builtin_strcmp (encoding, "latin-1")))); }) == 0) return PyUnicodeUCS4_AsLatin1String(unicode); else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (encoding) && __builtin_constant_p ("ascii") && (__s1_len = strlen (encoding), __s2_len = strlen ("ascii"), (!((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("ascii") + 1) - (size_t)(const void *)("ascii") == 1) || __s2_len >= 4)) ? __builtin_strcmp (encoding, "ascii") : (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) && (__s1_len = strlen (encoding), __s1_len < 4) ? (__builtin_constant_p ("ascii") && ((size_t)(const void *)(("ascii") + 1) - (size_t)(const void *)("ascii") == 1) ? __builtin_strcmp (encoding, "ascii") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("ascii"); register int __result = (((__const unsigned char *) (__const char *) (encoding))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (encoding))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (encoding))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("ascii") && ((size_t)(const void *)(("ascii") + 1) - (size_t)(const void *)("ascii") == 1) && (__s2_len = strlen ("ascii"), __s2_len < 4) ? (__builtin_constant_p (encoding) && ((size_t)(const void *)((encoding) + 1) - (size_t)(const void *)(encoding) == 1) ? __builtin_strcmp (encoding, "ascii") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (encoding); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("ascii"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("ascii"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("ascii"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("ascii"))[3]); } } __result; }))) : __builtin_strcmp (encoding, "ascii")))); }) == 0) return PyUnicodeUCS4_AsASCIIString(unicode); } v = PyCodec_Encode(unicode, encoding, errors); if (v == ((void *)0)) goto onError; if (!((v)->ob_type == (&PyString_Type) || PyType_IsSubtype((v)->ob_type, (&PyString_Type)))) { PyErr_Format(PyExc_TypeError, "encoder did not return a string object (type=%.400s)", v->ob_type->tp_name); if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); goto onError; } return v; onError: return ((void *)0); } PyObject *_PyUnicodeUCS4_AsDefaultEncodedString(PyObject *unicode, const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; if (v) return v; v = PyUnicodeUCS4_AsEncodedString(unicode, ((void *)0), errors); if (v && errors == ((void *)0)) ((PyUnicodeObject *)unicode)->defenc = v; return v; } Py_UNICODE *PyUnicodeUCS4_AsUnicode(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); goto onError; } return (((PyUnicodeObject *)(unicode))->str); onError: return ((void *)0); } Py_ssize_t PyUnicodeUCS4_GetSize(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); goto onError; } return (((PyUnicodeObject *)(unicode))->length); onError: return -1; } const char *PyUnicodeUCS4_GetDefaultEncoding(void) { return unicode_default_encoding; } int PyUnicodeUCS4_SetDefaultEncoding(const char *encoding) { PyObject *v; v = _PyCodec_Lookup(encoding); if (v == ((void *)0)) goto onError; if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); __builtin_strncpy (unicode_default_encoding, encoding, sizeof(unicode_default_encoding)); return 0; onError: return -1; } # 795 "Objects/unicodeobject.c" static int unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler, const char *encoding, const char *reason, const char *input, Py_ssize_t insize, Py_ssize_t *startinpos, Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr, PyObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) { static char *argparse = "O!n;decoding error handler must return (unicode, int) tuple"; PyObject *restuple = ((void *)0); PyObject *repunicode = ((void *)0); Py_ssize_t outsize = (((PyUnicodeObject *)(*output))->length); Py_ssize_t requiredsize; Py_ssize_t newpos; Py_UNICODE *repptr; Py_ssize_t repsize; int res = -1; if (*errorHandler == ((void *)0)) { *errorHandler = PyCodec_LookupError(errors); if (*errorHandler == ((void *)0)) goto onError; } if (*exceptionObject == ((void *)0)) { *exceptionObject = PyUnicodeDecodeError_Create( encoding, input, insize, *startinpos, *endinpos, reason); if (*exceptionObject == ((void *)0)) goto onError; } else { if (PyUnicodeDecodeError_SetStart(*exceptionObject, *startinpos)) goto onError; if (PyUnicodeDecodeError_SetEnd(*exceptionObject, *endinpos)) goto onError; if (PyUnicodeDecodeError_SetReason(*exceptionObject, reason)) goto onError; } restuple = PyObject_CallFunctionObjArgs(*errorHandler, *exceptionObject, ((void *)0)); if (restuple == ((void *)0)) goto onError; if (!((restuple)->ob_type == (&PyTuple_Type) || PyType_IsSubtype((restuple)->ob_type, (&PyTuple_Type)))) { PyErr_Format(PyExc_TypeError, &argparse[4]); goto onError; } if (!_PyArg_ParseTuple_SizeT(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos)) goto onError; if (newpos<0) newpos = insize+newpos; if (newpos<0 || newpos>insize) { PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos); goto onError; } repptr = (((PyUnicodeObject *)(repunicode))->str); repsize = (((PyUnicodeObject *)(repunicode))->length); requiredsize = *outpos + repsize + insize-newpos; if (requiredsize > outsize) { if (requiredsize<2*outsize) requiredsize = 2*outsize; if (PyUnicodeUCS4_Resize(output, requiredsize) < 0) goto onError; *outptr = (((PyUnicodeObject *)(*output))->str) + *outpos; } *endinpos = newpos; *inptr = input + newpos; memcpy((*outptr), (repptr), (repsize)*sizeof(Py_UNICODE)); *outptr += repsize; *outpos += repsize; res = 0; onError: if ((restuple) == ((void *)0)) ; else if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return res; } static char utf7_special[128] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 0, 0, 0, 3, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, }; # 942 "Objects/unicodeobject.c" PyObject *PyUnicode_DecodeUTF7(const char *s, Py_ssize_t size, const char *errors) { const char *starts = s; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; const char *e; PyUnicodeObject *unicode; Py_UNICODE *p; const char *errmsg = ""; int inShift = 0; unsigned int bitsleft = 0; unsigned long charsleft = 0; int surrogate = 0; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); unicode = _PyUnicode_New(size); if (!unicode) return ((void *)0); if (size == 0) return (PyObject *)unicode; p = unicode->str; e = s + size; while (s < e) { Py_UNICODE ch; restart: ch = *s; if (inShift) { if ((ch == '-') || !(((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISalnum) || (ch) == '+' || (ch) == '/')) { inShift = 0; s++; while (bitsleft >= 16) { Py_UNICODE outCh = (Py_UNICODE) ((charsleft >> (bitsleft-16)) & 0xffff); bitsleft -= 16; if (surrogate) { surrogate = 0; } else if (0xDC00 <= outCh && outCh <= 0xDFFF) { surrogate = 1; errmsg = "code pairs are not supported"; goto utf7Error; } else { *p++ = outCh; } }; if (bitsleft >= 6) { errmsg = "partial character in shift sequence"; goto utf7Error; } if (bitsleft && charsleft << (sizeof(charsleft) * 8 - bitsleft)) { errmsg = "non-zero padding bits in shift sequence"; goto utf7Error; } if (ch == '-') { if ((s < e) && (*(s) == '-')) { *p++ = '-'; inShift = 1; } } else if (((ch) > 127 || (ch) <= 0 || utf7_special[(ch)] == 1 || (0 && (utf7_special[(ch)] == 2)) || (0 && (utf7_special[(ch)] == 3)))) { errmsg = "unexpected special character"; goto utf7Error; } else { *p++ = ch; } } else { charsleft = (charsleft << 6) | ((ch) == '+' ? 62 : (ch) == '/' ? 63 : (ch) >= 'a' ? (ch) - 71 : (ch) >= 'A' ? (ch) - 65 : (ch) + 4 ); bitsleft += 6; s++; while (bitsleft >= 16) { Py_UNICODE outCh = (Py_UNICODE) ((charsleft >> (bitsleft-16)) & 0xffff); bitsleft -= 16; if (surrogate) { surrogate = 0; } else if (0xDC00 <= outCh && outCh <= 0xDFFF) { surrogate = 1; errmsg = "code pairs are not supported"; goto utf7Error; } else { *p++ = outCh; } }; } } else if ( ch == '+' ) { startinpos = s-starts; s++; if (s < e && *s == '-') { s++; *p++ = '+'; } else { inShift = 1; bitsleft = 0; } } else if (((ch) > 127 || (ch) <= 0 || utf7_special[(ch)] == 1 || (0 && (utf7_special[(ch)] == 2)) || (0 && (utf7_special[(ch)] == 3)))) { errmsg = "unexpected special character"; s++; goto utf7Error; } else { *p++ = ch; s++; } continue; utf7Error: outpos = p-(((PyUnicodeObject *)(unicode))->str); endinpos = s-starts; if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf7", errmsg, starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&unicode, &outpos, &p)) goto onError; } if (inShift) { outpos = p-(((PyUnicodeObject *)(unicode))->str); endinpos = size; if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf7", "unterminated shift sequence", starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&unicode, &outpos, &p)) goto onError; if (s < e) goto restart; } if (PyUnicodeUCS4_Resize(((PyObject **)(&unicode)), p - (((PyUnicodeObject *)(unicode))->str)) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)unicode; onError: if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ( --(unicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode)))); return ((void *)0); } PyObject *PyUnicode_EncodeUTF7(const Py_UNICODE *s, Py_ssize_t size, int encodeSetO, int encodeWhiteSpace, const char *errors) { PyObject *v; Py_ssize_t cbAllocated = 5 * size; int inShift = 0; Py_ssize_t i = 0; unsigned int bitsleft = 0; unsigned long charsleft = 0; char * out; char * start; if (size == 0) return PyString_FromStringAndSize(((void *)0), 0); v = PyString_FromStringAndSize(((void *)0), cbAllocated); if (v == ((void *)0)) return ((void *)0); start = out = (((PyStringObject *)(v))->ob_sval); for (;i < size; ++i) { Py_UNICODE ch = s[i]; if (!inShift) { if (ch == '+') { *out++ = '+'; *out++ = '-'; } else if (((ch) > 127 || (ch) <= 0 || utf7_special[(ch)] == 1 || (encodeWhiteSpace && (utf7_special[(ch)] == 2)) || (encodeSetO && (utf7_special[(ch)] == 3)))) { charsleft = ch; bitsleft = 16; *out++ = '+'; while (bitsleft >= 6) { *out++ = ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(charsleft >> (bitsleft-6)) & 0x3f]); bitsleft -= 6; }; inShift = bitsleft > 0; } else { *out++ = (char) ch; } } else { if (!((ch) > 127 || (ch) <= 0 || utf7_special[(ch)] == 1 || (encodeWhiteSpace && (utf7_special[(ch)] == 2)) || (encodeSetO && (utf7_special[(ch)] == 3)))) { *out++ = ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(charsleft << (6-bitsleft)) & 0x3f]); charsleft = 0; bitsleft = 0; if ((((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISalnum) || (ch) == '+' || (ch) == '/') || ch == '-') { *out++ = '-'; } inShift = 0; *out++ = (char) ch; } else { bitsleft += 16; charsleft = (charsleft << 16) | ch; while (bitsleft >= 6) { *out++ = ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(charsleft >> (bitsleft-6)) & 0x3f]); bitsleft -= 6; }; if (bitsleft == 0) { if (i + 1 < size) { Py_UNICODE ch2 = s[i+1]; if (((ch2) > 127 || (ch2) <= 0 || utf7_special[(ch2)] == 1 || (encodeWhiteSpace && (utf7_special[(ch2)] == 2)) || (encodeSetO && (utf7_special[(ch2)] == 3)))) { } else if ((((*__ctype_b_loc ())[(int) ((ch2))] & (unsigned short int) _ISalnum) || (ch2) == '+' || (ch2) == '/') || ch2 == '-') { *out++ = '-'; inShift = 0; } else { inShift = 0; } } else { *out++ = '-'; inShift = 0; } } } } } if (bitsleft) { *out++= ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(charsleft << (6-bitsleft)) & 0x3f]); *out++ = '-'; } _PyString_Resize(&v, out - start); return v; } # 1180 "Objects/unicodeobject.c" static char utf8_code_length[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0 }; PyObject *PyUnicodeUCS4_DecodeUTF8(const char *s, Py_ssize_t size, const char *errors) { return PyUnicodeUCS4_DecodeUTF8Stateful(s, size, errors, ((void *)0)); } PyObject *PyUnicodeUCS4_DecodeUTF8Stateful(const char *s, Py_ssize_t size, const char *errors, Py_ssize_t *consumed) { const char *starts = s; int n; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; const char *e; PyUnicodeObject *unicode; Py_UNICODE *p; const char *errmsg = ""; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); unicode = _PyUnicode_New(size); if (!unicode) return ((void *)0); if (size == 0) { if (consumed) *consumed = 0; return (PyObject *)unicode; } p = unicode->str; e = s + size; while (s < e) { Py_UCS4 ch = (unsigned char)*s; if (ch < 0x80) { *p++ = (Py_UNICODE)ch; s++; continue; } n = utf8_code_length[ch]; if (s + n > e) { if (consumed) break; else { errmsg = "unexpected end of data"; startinpos = s-starts; endinpos = size; goto utf8Error; } } switch (n) { case 0: errmsg = "unexpected code byte"; startinpos = s-starts; endinpos = startinpos+1; goto utf8Error; case 1: errmsg = "internal error"; startinpos = s-starts; endinpos = startinpos+1; goto utf8Error; case 2: if ((s[1] & 0xc0) != 0x80) { errmsg = "invalid data"; startinpos = s-starts; endinpos = startinpos+2; goto utf8Error; } ch = ((s[0] & 0x1f) << 6) + (s[1] & 0x3f); if (ch < 0x80) { startinpos = s-starts; endinpos = startinpos+2; errmsg = "illegal encoding"; goto utf8Error; } else *p++ = (Py_UNICODE)ch; break; case 3: if ((s[1] & 0xc0) != 0x80 || (s[2] & 0xc0) != 0x80) { errmsg = "invalid data"; startinpos = s-starts; endinpos = startinpos+3; goto utf8Error; } ch = ((s[0] & 0x0f) << 12) + ((s[1] & 0x3f) << 6) + (s[2] & 0x3f); if (ch < 0x0800) { errmsg = "illegal encoding"; startinpos = s-starts; endinpos = startinpos+3; goto utf8Error; } else *p++ = (Py_UNICODE)ch; break; case 4: if ((s[1] & 0xc0) != 0x80 || (s[2] & 0xc0) != 0x80 || (s[3] & 0xc0) != 0x80) { errmsg = "invalid data"; startinpos = s-starts; endinpos = startinpos+4; goto utf8Error; } ch = ((s[0] & 0x7) << 18) + ((s[1] & 0x3f) << 12) + ((s[2] & 0x3f) << 6) + (s[3] & 0x3f); if ((ch < 0x10000) || (ch > 0x10ffff)) { errmsg = "illegal encoding"; startinpos = s-starts; endinpos = startinpos+4; goto utf8Error; } *p++ = (Py_UNICODE)ch; # 1357 "Objects/unicodeobject.c" break; default: errmsg = "unsupported Unicode code range"; startinpos = s-starts; endinpos = startinpos+n; goto utf8Error; } s += n; continue; utf8Error: outpos = p-(((PyUnicodeObject *)(unicode))->str); if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf8", errmsg, starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&unicode, &outpos, &p)) goto onError; } if (consumed) *consumed = s-starts; if (PyUnicodeUCS4_Resize(((PyObject **)(&unicode)), p - unicode->str) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)unicode; onError: if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ( --(unicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode)))); return ((void *)0); } PyObject * PyUnicodeUCS4_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors) { Py_ssize_t i; PyObject *v; char *p; Py_ssize_t nallocated; Py_ssize_t nneeded; char stackbuf[300 * 4]; ((void) (0)); ((void) (0)); if (size <= 300) { nallocated = (int)(sizeof(stackbuf)); v = ((void *)0); p = stackbuf; } else { nallocated = size * 4; if (nallocated / 4 != size) return PyErr_NoMemory(); v = PyString_FromStringAndSize(((void *)0), nallocated); if (v == ((void *)0)) return ((void *)0); p = (((PyStringObject *)(v))->ob_sval); } for (i = 0; i < size;) { Py_UCS4 ch = s[i++]; if (ch < 0x80) *p++ = (char) ch; else if (ch < 0x0800) { *p++ = (char)(0xc0 | (ch >> 6)); *p++ = (char)(0x80 | (ch & 0x3f)); } else { if (ch < 0x10000) { if (0xD800 <= ch && ch <= 0xDBFF && i != size) { Py_UCS4 ch2 = s[i]; if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { ch = ((ch - 0xD800) << 10 | (ch2 - 0xDC00)) + 0x10000; i++; goto encodeUCS4; } } *p++ = (char)(0xe0 | (ch >> 12)); *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); continue; } encodeUCS4: *p++ = (char)(0xf0 | (ch >> 18)); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); } } if (v == ((void *)0)) { nneeded = p - stackbuf; ((void) (0)); v = PyString_FromStringAndSize(stackbuf, nneeded); } else { nneeded = p - (((PyStringObject *)(v))->ob_sval); ((void) (0)); _PyString_Resize(&v, nneeded); } return v; } PyObject *PyUnicodeUCS4_AsUTF8String(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); return ((void *)0); } return PyUnicodeUCS4_EncodeUTF8((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length), ((void *)0)); } PyObject * PyUnicodeUCS4_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors, int *byteorder) { return PyUnicodeUCS4_DecodeUTF16Stateful(s, size, errors, byteorder, ((void *)0)); } PyObject * PyUnicodeUCS4_DecodeUTF16Stateful(const char *s, Py_ssize_t size, const char *errors, int *byteorder, Py_ssize_t *consumed) { const char *starts = s; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; PyUnicodeObject *unicode; Py_UNICODE *p; const unsigned char *q, *e; int bo = 0; const char *errmsg = ""; int ihi = 1, ilo = 0; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); unicode = _PyUnicode_New(size); if (!unicode) return ((void *)0); if (size == 0) return (PyObject *)unicode; p = unicode->str; q = (unsigned char *)s; e = q + size; if (byteorder) bo = *byteorder; if (bo == 0) { if (size >= 2) { const Py_UNICODE bom = (q[ihi] << 8) | q[ilo]; if (bom == 0xFEFF) { q += 2; bo = -1; } else if (bom == 0xFFFE) { q += 2; bo = 1; } # 1585 "Objects/unicodeobject.c" } } if (bo == -1) { ihi = 1; ilo = 0; } else if (bo == 1) { ihi = 0; ilo = 1; } while (q < e) { Py_UNICODE ch; if (e-q<2) { if (consumed) break; errmsg = "truncated data"; startinpos = ((const char *)q)-starts; endinpos = ((const char *)e)-starts; goto utf16Error; } ch = (q[ihi] << 8) | q[ilo]; q += 2; if (ch < 0xD800 || ch > 0xDFFF) { *p++ = ch; continue; } if (q >= e) { errmsg = "unexpected end of data"; startinpos = (((const char *)q)-2)-starts; endinpos = ((const char *)e)-starts; goto utf16Error; } if (0xD800 <= ch && ch <= 0xDBFF) { Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; q += 2; if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { *p++ = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; continue; } else { errmsg = "illegal UTF-16 surrogate"; startinpos = (((const char *)q)-4)-starts; endinpos = startinpos+2; goto utf16Error; } } errmsg = "illegal encoding"; startinpos = (((const char *)q)-2)-starts; endinpos = startinpos+2; utf16Error: outpos = p-(((PyUnicodeObject *)(unicode))->str); if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf16", errmsg, starts, size, &startinpos, &endinpos, &exc, (const char **)&q, (PyObject **)&unicode, &outpos, &p)) goto onError; } if (byteorder) *byteorder = bo; if (consumed) *consumed = (const char *)q-starts; if (PyUnicodeUCS4_Resize(((PyObject **)(&unicode)), p - unicode->str) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)unicode; onError: if ( --(unicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return ((void *)0); } PyObject * PyUnicodeUCS4_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder) { PyObject *v; unsigned char *p; int i, pairs; int ihi = 1, ilo = 0; # 1712 "Objects/unicodeobject.c" for (i = pairs = 0; i < size; i++) if (s[i] >= 0x10000) pairs++; v = PyString_FromStringAndSize(((void *)0), 2 * (size + pairs + (byteorder == 0))); if (v == ((void *)0)) return ((void *)0); p = (unsigned char *)(((PyStringObject *)(v))->ob_sval); if (byteorder == 0) do { p[ihi] = ((0xFEFF) >> 8) & 0xff; p[ilo] = (0xFEFF) & 0xff; p += 2; } while(0); if (size == 0) return v; if (byteorder == -1) { ihi = 1; ilo = 0; } else if (byteorder == 1) { ihi = 0; ilo = 1; } while (size-- > 0) { Py_UNICODE ch = *s++; Py_UNICODE ch2 = 0; if (ch >= 0x10000) { ch2 = 0xDC00 | ((ch-0x10000) & 0x3FF); ch = 0xD800 | ((ch-0x10000) >> 10); } do { p[ihi] = ((ch) >> 8) & 0xff; p[ilo] = (ch) & 0xff; p += 2; } while(0); if (ch2) do { p[ihi] = ((ch2) >> 8) & 0xff; p[ilo] = (ch2) & 0xff; p += 2; } while(0); } return v; } PyObject *PyUnicodeUCS4_AsUTF16String(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); return ((void *)0); } return PyUnicodeUCS4_EncodeUTF16((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length), ((void *)0), 0); } static _PyUnicode_Name_CAPI *ucnhash_CAPI = ((void *)0); PyObject *PyUnicodeUCS4_DecodeUnicodeEscape(const char *s, Py_ssize_t size, const char *errors) { const char *starts = s; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; int i; PyUnicodeObject *v; Py_UNICODE *p; const char *end; char* message; Py_UCS4 chr = 0xffffffff; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); v = _PyUnicode_New(size); if (v == ((void *)0)) goto onError; if (size == 0) return (PyObject *)v; p = (((PyUnicodeObject *)(v))->str); end = s + size; while (s < end) { unsigned char c; Py_UNICODE x; int digits; if (*s != '\\') { *p++ = (unsigned char) *s++; continue; } startinpos = s-starts; s++; c = *s++; if (s > end) c = '\0'; switch (c) { case '\n': break; case '\\': *p++ = '\\'; break; case '\'': *p++ = '\''; break; case '\"': *p++ = '\"'; break; case 'b': *p++ = '\b'; break; case 'f': *p++ = '\014'; break; case 't': *p++ = '\t'; break; case 'n': *p++ = '\n'; break; case 'r': *p++ = '\r'; break; case 'v': *p++ = '\013'; break; case 'a': *p++ = '\007'; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': x = s[-1] - '0'; if (s < end && '0' <= *s && *s <= '7') { x = (x<<3) + *s++ - '0'; if (s < end && '0' <= *s && *s <= '7') x = (x<<3) + *s++ - '0'; } *p++ = x; break; case 'x': digits = 2; message = "truncated \\xXX escape"; goto hexescape; case 'u': digits = 4; message = "truncated \\uXXXX escape"; goto hexescape; case 'U': digits = 8; message = "truncated \\UXXXXXXXX escape"; hexescape: chr = 0; outpos = p-(((PyUnicodeObject *)(v))->str); if (s+digits>end) { endinpos = size; if (unicode_decode_call_errorhandler( errors, &errorHandler, "unicodeescape", "end of string in escape sequence", starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) goto onError; goto nextByte; } for (i = 0; i < digits; ++i) { c = (unsigned char) s[i]; if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISxdigit)) { endinpos = (s+i+1)-starts; if (unicode_decode_call_errorhandler( errors, &errorHandler, "unicodeescape", message, starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) goto onError; goto nextByte; } chr = (chr<<4) & ~0xF; if (c >= '0' && c <= '9') chr += c - '0'; else if (c >= 'a' && c <= 'f') chr += 10 + c - 'a'; else chr += 10 + c - 'A'; } s += i; if (chr == 0xffffffff && PyErr_Occurred()) break; store: if (chr <= 0xffff) *p++ = (Py_UNICODE) chr; else if (chr <= 0x10ffff) { *p++ = chr; } else { endinpos = s-starts; outpos = p-(((PyUnicodeObject *)(v))->str); if (unicode_decode_call_errorhandler( errors, &errorHandler, "unicodeescape", "illegal Unicode character", starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) goto onError; } break; case 'N': message = "malformed \\N character escape"; if (ucnhash_CAPI == ((void *)0)) { PyObject *m, *api; m = PyImport_ImportModule("unicodedata"); if (m == ((void *)0)) goto ucnhashError; api = PyObject_GetAttrString(m, "ucnhash_CAPI"); if ( --(m)->ob_refcnt != 0) ; else ( (*((PyObject *)(m))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(m)))); if (api == ((void *)0)) goto ucnhashError; ucnhash_CAPI = (_PyUnicode_Name_CAPI *)PyCObject_AsVoidPtr(api); if ( --(api)->ob_refcnt != 0) ; else ( (*((PyObject *)(api))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(api)))); if (ucnhash_CAPI == ((void *)0)) goto ucnhashError; } if (*s == '{') { const char *start = s+1; while (*s != '}' && s < end) s++; if (s > start && s < end && *s == '}') { message = "unknown Unicode character name"; s++; if (ucnhash_CAPI->getcode(((void *)0), start, (int)(s-start-1), &chr)) goto store; } } endinpos = s-starts; outpos = p-(((PyUnicodeObject *)(v))->str); if (unicode_decode_call_errorhandler( errors, &errorHandler, "unicodeescape", message, starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) goto onError; break; default: if (s > end) { message = "\\ at end of string"; s--; endinpos = s-starts; outpos = p-(((PyUnicodeObject *)(v))->str); if (unicode_decode_call_errorhandler( errors, &errorHandler, "unicodeescape", message, starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) goto onError; } else { *p++ = '\\'; *p++ = (unsigned char)s[-1]; } break; } nextByte: ; } if (PyUnicodeUCS4_Resize(((PyObject **)(&v)), p - (((PyUnicodeObject *)(v))->str)) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)v; ucnhashError: PyErr_SetString( PyExc_UnicodeError, "\\N escapes not supported (can't load unicodedata module)" ); if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return ((void *)0); onError: if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return ((void *)0); } # 2021 "Objects/unicodeobject.c" static const Py_UNICODE * findchar(const Py_UNICODE *s, Py_ssize_t size, Py_UNICODE ch) { while (size-- > 0) { if (*s == ch) return s; s++; } return ((void *)0); } static PyObject *unicodeescape_string(const Py_UNICODE *s, Py_ssize_t size, int quotes) { PyObject *repr; char *p; static const char *hexdigit = "0123456789abcdef"; # 2060 "Objects/unicodeobject.c" repr = PyString_FromStringAndSize(((void *)0), 2 + 10*size + 1); if (repr == ((void *)0)) return ((void *)0); p = (((PyStringObject *)(repr))->ob_sval); if (quotes) { *p++ = 'u'; *p++ = (findchar(s, size, '\'') && !findchar(s, size, '"')) ? '"' : '\''; } while (size-- > 0) { Py_UNICODE ch = *s++; if ((quotes && ch == (Py_UNICODE) (((PyStringObject *)(repr))->ob_sval)[1]) || ch == '\\') { *p++ = '\\'; *p++ = (char) ch; continue; } else if (ch >= 0x10000) { *p++ = '\\'; *p++ = 'U'; *p++ = hexdigit[(ch >> 28) & 0x0000000F]; *p++ = hexdigit[(ch >> 24) & 0x0000000F]; *p++ = hexdigit[(ch >> 20) & 0x0000000F]; *p++ = hexdigit[(ch >> 16) & 0x0000000F]; *p++ = hexdigit[(ch >> 12) & 0x0000000F]; *p++ = hexdigit[(ch >> 8) & 0x0000000F]; *p++ = hexdigit[(ch >> 4) & 0x0000000F]; *p++ = hexdigit[ch & 0x0000000F]; continue; } # 2133 "Objects/unicodeobject.c" if (ch >= 256) { *p++ = '\\'; *p++ = 'u'; *p++ = hexdigit[(ch >> 12) & 0x000F]; *p++ = hexdigit[(ch >> 8) & 0x000F]; *p++ = hexdigit[(ch >> 4) & 0x000F]; *p++ = hexdigit[ch & 0x000F]; } else if (ch == '\t') { *p++ = '\\'; *p++ = 't'; } else if (ch == '\n') { *p++ = '\\'; *p++ = 'n'; } else if (ch == '\r') { *p++ = '\\'; *p++ = 'r'; } else if (ch < ' ' || ch >= 0x7F) { *p++ = '\\'; *p++ = 'x'; *p++ = hexdigit[(ch >> 4) & 0x000F]; *p++ = hexdigit[ch & 0x000F]; } else *p++ = (char) ch; } if (quotes) *p++ = (((PyStringObject *)(repr))->ob_sval)[1]; *p = '\0'; _PyString_Resize(&repr, p - (((PyStringObject *)(repr))->ob_sval)); return repr; } PyObject *PyUnicodeUCS4_EncodeUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size) { return unicodeescape_string(s, size, 0); } PyObject *PyUnicodeUCS4_AsUnicodeEscapeString(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); return ((void *)0); } return PyUnicodeUCS4_EncodeUnicodeEscape((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length)); } PyObject *PyUnicodeUCS4_DecodeRawUnicodeEscape(const char *s, Py_ssize_t size, const char *errors) { const char *starts = s; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; PyUnicodeObject *v; Py_UNICODE *p; const char *end; const char *bs; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); v = _PyUnicode_New(size); if (v == ((void *)0)) goto onError; if (size == 0) return (PyObject *)v; p = (((PyUnicodeObject *)(v))->str); end = s + size; while (s < end) { unsigned char c; Py_UCS4 x; int i; int count; if (*s != '\\') { *p++ = (unsigned char)*s++; continue; } startinpos = s-starts; bs = s; for (;s < end;) { if (*s != '\\') break; *p++ = (unsigned char)*s++; } if (((s - bs) & 1) == 0 || s >= end || (*s != 'u' && *s != 'U')) { continue; } p--; count = *s=='u' ? 4 : 8; s++; outpos = p-(((PyUnicodeObject *)(v))->str); for (x = 0, i = 0; i < count; ++i, ++s) { c = (unsigned char)*s; if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISxdigit)) { endinpos = s-starts; if (unicode_decode_call_errorhandler( errors, &errorHandler, "rawunicodeescape", "truncated \\uXXXX", starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) goto onError; goto nextByte; } x = (x<<4) & ~0xF; if (c >= '0' && c <= '9') x += c - '0'; else if (c >= 'a' && c <= 'f') x += 10 + c - 'a'; else x += 10 + c - 'A'; } # 2282 "Objects/unicodeobject.c" *p++ = x; nextByte: ; } if (PyUnicodeUCS4_Resize(((PyObject **)(&v)), p - (((PyUnicodeObject *)(v))->str)) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)v; onError: if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return ((void *)0); } PyObject *PyUnicodeUCS4_EncodeRawUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size) { PyObject *repr; char *p; char *q; static const char *hexdigit = "0123456789abcdef"; repr = PyString_FromStringAndSize(((void *)0), 10 * size); if (repr == ((void *)0)) return ((void *)0); if (size == 0) return repr; p = q = (((PyStringObject *)(repr))->ob_sval); while (size-- > 0) { Py_UNICODE ch = *s++; if (ch >= 0x10000) { *p++ = '\\'; *p++ = 'U'; *p++ = hexdigit[(ch >> 28) & 0xf]; *p++ = hexdigit[(ch >> 24) & 0xf]; *p++ = hexdigit[(ch >> 20) & 0xf]; *p++ = hexdigit[(ch >> 16) & 0xf]; *p++ = hexdigit[(ch >> 12) & 0xf]; *p++ = hexdigit[(ch >> 8) & 0xf]; *p++ = hexdigit[(ch >> 4) & 0xf]; *p++ = hexdigit[ch & 15]; } else if (ch >= 256) { *p++ = '\\'; *p++ = 'u'; *p++ = hexdigit[(ch >> 12) & 0xf]; *p++ = hexdigit[(ch >> 8) & 0xf]; *p++ = hexdigit[(ch >> 4) & 0xf]; *p++ = hexdigit[ch & 15]; } else *p++ = (char) ch; } *p = '\0'; _PyString_Resize(&repr, p - q); return repr; } PyObject *PyUnicodeUCS4_AsRawUnicodeEscapeString(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); return ((void *)0); } return PyUnicodeUCS4_EncodeRawUnicodeEscape((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length)); } PyObject *_PyUnicode_DecodeUnicodeInternal(const char *s, Py_ssize_t size, const char *errors) { const char *starts = s; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; PyUnicodeObject *v; Py_UNICODE *p; const char *end; const char *reason; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); Py_UNICODE unimax = PyUnicodeUCS4_GetMax(); v = _PyUnicode_New((size+4 -1)/ 4); if (v == ((void *)0)) goto onError; if (PyUnicodeUCS4_GetSize((PyObject *)v) == 0) return (PyObject *)v; p = (((PyUnicodeObject *)(v))->str); end = s + size; while (s < end) { memcpy(p, s, sizeof(Py_UNICODE)); if ( *p > unimax || *p < 0 || end-s < 4 ) { startinpos = s - starts; if (end-s < 4) { endinpos = end-starts; reason = "truncated input"; } else { endinpos = s - starts + 4; reason = "illegal code point (> 0x10FFFF)"; } outpos = p - (((PyUnicodeObject *)(v))->str); if (unicode_decode_call_errorhandler( errors, &errorHandler, "unicode_internal", reason, starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) { goto onError; } } else { p++; s += 4; } } if (PyUnicodeUCS4_Resize(((PyObject **)(&v)), p - (((PyUnicodeObject *)(v))->str)) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)v; onError: if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return ((void *)0); } PyObject *PyUnicodeUCS4_DecodeLatin1(const char *s, Py_ssize_t size, const char *errors) { PyUnicodeObject *v; Py_UNICODE *p; if (size == 1) { Py_UNICODE r = *(unsigned char*)s; return PyUnicodeUCS4_FromUnicode(&r, 1); } v = _PyUnicode_New(size); if (v == ((void *)0)) goto onError; if (size == 0) return (PyObject *)v; p = (((PyUnicodeObject *)(v))->str); while (size-- > 0) *p++ = (unsigned char)*s++; return (PyObject *)v; onError: if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return ((void *)0); } static void make_encode_exception(PyObject **exceptionObject, const char *encoding, const Py_UNICODE *unicode, Py_ssize_t size, Py_ssize_t startpos, Py_ssize_t endpos, const char *reason) { if (*exceptionObject == ((void *)0)) { *exceptionObject = PyUnicodeEncodeError_Create( encoding, unicode, size, startpos, endpos, reason); } else { if (PyUnicodeEncodeError_SetStart(*exceptionObject, startpos)) goto onError; if (PyUnicodeEncodeError_SetEnd(*exceptionObject, endpos)) goto onError; if (PyUnicodeEncodeError_SetReason(*exceptionObject, reason)) goto onError; return; onError: if ( --(*exceptionObject)->ob_refcnt != 0) ; else ( (*((PyObject *)(*exceptionObject))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(*exceptionObject)))); *exceptionObject = ((void *)0); } } static void raise_encode_exception(PyObject **exceptionObject, const char *encoding, const Py_UNICODE *unicode, Py_ssize_t size, Py_ssize_t startpos, Py_ssize_t endpos, const char *reason) { make_encode_exception(exceptionObject, encoding, unicode, size, startpos, endpos, reason); if (*exceptionObject != ((void *)0)) PyCodec_StrictErrors(*exceptionObject); } static PyObject *unicode_encode_call_errorhandler(const char *errors, PyObject **errorHandler, const char *encoding, const char *reason, const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, Py_ssize_t startpos, Py_ssize_t endpos, Py_ssize_t *newpos) { static char *argparse = "O!n;encoding error handler must return (unicode, int) tuple"; PyObject *restuple; PyObject *resunicode; if (*errorHandler == ((void *)0)) { *errorHandler = PyCodec_LookupError(errors); if (*errorHandler == ((void *)0)) return ((void *)0); } make_encode_exception(exceptionObject, encoding, unicode, size, startpos, endpos, reason); if (*exceptionObject == ((void *)0)) return ((void *)0); restuple = PyObject_CallFunctionObjArgs( *errorHandler, *exceptionObject, ((void *)0)); if (restuple == ((void *)0)) return ((void *)0); if (!((restuple)->ob_type == (&PyTuple_Type) || PyType_IsSubtype((restuple)->ob_type, (&PyTuple_Type)))) { PyErr_Format(PyExc_TypeError, &argparse[4]); if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return ((void *)0); } if (!_PyArg_ParseTuple_SizeT(restuple, argparse, &PyUnicode_Type, &resunicode, newpos)) { if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return ((void *)0); } if (*newpos<0) *newpos = size+*newpos; if (*newpos<0 || *newpos>size) { PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return ((void *)0); } ( (resunicode)->ob_refcnt++); if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return resunicode; } static PyObject *unicode_encode_ucs1(const Py_UNICODE *p, Py_ssize_t size, const char *errors, int limit) { PyObject *res; const Py_UNICODE *startp = p; const Py_UNICODE *endp = p + size; char *str; Py_ssize_t respos = 0; Py_ssize_t ressize; const char *encoding = (limit == 256) ? "latin-1" : "ascii"; const char *reason = (limit == 256) ? "ordinal not in range(256)" : "ordinal not in range(128)"; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); int known_errorHandler = -1; res = PyString_FromStringAndSize(((void *)0), size); if (res == ((void *)0)) goto onError; if (size == 0) return res; str = (((PyStringObject *)(res))->ob_sval); ressize = size; while (p=limit)) ++collend; if (known_errorHandler==-1) { if ((errors==((void *)0)) || (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("strict") && (__s1_len = strlen (errors), __s2_len = strlen ("strict"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "strict") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("strict"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) && (__s2_len = strlen ("strict"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("strict"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("strict"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("strict"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("strict"))[3]); } } __result; }))) : __builtin_strcmp (errors, "strict")))); }))) known_errorHandler = 1; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("replace") && (__s1_len = strlen (errors), __s2_len = strlen ("replace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "replace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("replace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) && (__s2_len = strlen ("replace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("replace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("replace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("replace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("replace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "replace")))); })) known_errorHandler = 2; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("ignore") && (__s1_len = strlen (errors), __s2_len = strlen ("ignore"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "ignore") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("ignore"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) && (__s2_len = strlen ("ignore"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("ignore"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("ignore"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("ignore"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("ignore"))[3]); } } __result; }))) : __builtin_strcmp (errors, "ignore")))); })) known_errorHandler = 3; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("xmlcharrefreplace") && (__s1_len = strlen (errors), __s2_len = strlen ("xmlcharrefreplace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("xmlcharrefreplace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) && (__s2_len = strlen ("xmlcharrefreplace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "xmlcharrefreplace")))); })) known_errorHandler = 4; else known_errorHandler = 0; } switch (known_errorHandler) { case 1: raise_encode_exception(&exc, encoding, startp, size, collstart-startp, collend-startp, reason); goto onError; case 2: while (collstart++ob_sval); for (p = collstart, repsize = 0; p < collend; ++p) { if (*p<10) repsize += 2+1+1; else if (*p<100) repsize += 2+2+1; else if (*p<1000) repsize += 2+3+1; else if (*p<10000) repsize += 2+4+1; else if (*p<100000) repsize += 2+5+1; else if (*p<1000000) repsize += 2+6+1; else repsize += 2+7+1; } requiredsize = respos+repsize+(endp-collend); if (requiredsize > ressize) { if (requiredsize<2*ressize) requiredsize = 2*ressize; if (_PyString_Resize(&res, requiredsize)) goto onError; str = (((PyStringObject *)(res))->ob_sval) + respos; ressize = requiredsize; } for (p = collstart; p < collend; ++p) { str += sprintf(str, "&#%d;", (int)*p); } p = collend; break; default: repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, encoding, reason, startp, size, &exc, collstart-startp, collend-startp, &newpos); if (repunicode == ((void *)0)) goto onError; respos = str-(((PyStringObject *)(res))->ob_sval); repsize = (((PyUnicodeObject *)(repunicode))->length); requiredsize = respos+repsize+(endp-collend); if (requiredsize > ressize) { if (requiredsize<2*ressize) requiredsize = 2*ressize; if (_PyString_Resize(&res, requiredsize)) { if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); goto onError; } str = (((PyStringObject *)(res))->ob_sval) + respos; ressize = requiredsize; } for (uni2 = (((PyUnicodeObject *)(repunicode))->str);repsize-->0; ++uni2, ++str) { c = *uni2; if (c >= limit) { raise_encode_exception(&exc, encoding, startp, size, unicodepos, unicodepos+1, reason); if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); goto onError; } *str = (char)c; } p = startp + newpos; if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); } } } respos = str-(((PyStringObject *)(res))->ob_sval); if (resposob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return res; onError: if ((res) == ((void *)0)) ; else if ( --(res)->ob_refcnt != 0) ; else ( (*((PyObject *)(res))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(res)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return ((void *)0); } PyObject *PyUnicodeUCS4_EncodeLatin1(const Py_UNICODE *p, Py_ssize_t size, const char *errors) { return unicode_encode_ucs1(p, size, errors, 256); } PyObject *PyUnicodeUCS4_AsLatin1String(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); return ((void *)0); } return PyUnicodeUCS4_EncodeLatin1((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length), ((void *)0)); } PyObject *PyUnicodeUCS4_DecodeASCII(const char *s, Py_ssize_t size, const char *errors) { const char *starts = s; PyUnicodeObject *v; Py_UNICODE *p; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; const char *e; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); if (size == 1 && *(unsigned char*)s < 128) { Py_UNICODE r = *(unsigned char*)s; return PyUnicodeUCS4_FromUnicode(&r, 1); } v = _PyUnicode_New(size); if (v == ((void *)0)) goto onError; if (size == 0) return (PyObject *)v; p = (((PyUnicodeObject *)(v))->str); e = s + size; while (s < e) { register unsigned char c = (unsigned char)*s; if (c < 128) { *p++ = c; ++s; } else { startinpos = s-starts; endinpos = startinpos + 1; outpos = p - (Py_UNICODE *)(((PyUnicodeObject *)(v))->str); if (unicode_decode_call_errorhandler( errors, &errorHandler, "ascii", "ordinal not in range(128)", starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) goto onError; } } if (p - (((PyUnicodeObject *)(v))->str) < (((PyStringObject *)(v))->ob_size)) if (PyUnicodeUCS4_Resize(((PyObject **)(&v)), p - (((PyUnicodeObject *)(v))->str)) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)v; onError: if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return ((void *)0); } PyObject *PyUnicodeUCS4_EncodeASCII(const Py_UNICODE *p, Py_ssize_t size, const char *errors) { return unicode_encode_ucs1(p, size, errors, 128); } PyObject *PyUnicodeUCS4_AsASCIIString(PyObject *unicode) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type)))) { PyErr_BadArgument(); return ((void *)0); } return PyUnicodeUCS4_EncodeASCII((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length), ((void *)0)); } # 3053 "Objects/unicodeobject.c" PyObject *PyUnicodeUCS4_DecodeCharmap(const char *s, Py_ssize_t size, PyObject *mapping, const char *errors) { const char *starts = s; Py_ssize_t startinpos; Py_ssize_t endinpos; Py_ssize_t outpos; const char *e; PyUnicodeObject *v; Py_UNICODE *p; Py_ssize_t extrachars = 0; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); Py_UNICODE *mapstring = ((void *)0); Py_ssize_t maplen = 0; if (mapping == ((void *)0)) return PyUnicodeUCS4_DecodeLatin1(s, size, errors); v = _PyUnicode_New(size); if (v == ((void *)0)) goto onError; if (size == 0) return (PyObject *)v; p = (((PyUnicodeObject *)(v))->str); e = s + size; if (((mapping)->ob_type == &PyUnicode_Type)) { mapstring = (((PyUnicodeObject *)(mapping))->str); maplen = (((PyUnicodeObject *)(mapping))->length); while (s < e) { unsigned char ch = *s; Py_UNICODE x = 0xfffe; if (ch < maplen) x = mapstring[ch]; if (x == 0xfffe) { outpos = p-(((PyUnicodeObject *)(v))->str); startinpos = s-starts; endinpos = startinpos+1; if (unicode_decode_call_errorhandler( errors, &errorHandler, "charmap", "character maps to ", starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) { goto onError; } continue; } *p++ = x; ++s; } } else { while (s < e) { unsigned char ch = *s; PyObject *w, *x; w = PyInt_FromLong((long)ch); if (w == ((void *)0)) goto onError; x = PyObject_GetItem(mapping, w); if ( --(w)->ob_refcnt != 0) ; else ( (*((PyObject *)(w))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(w)))); if (x == ((void *)0)) { if (PyErr_ExceptionMatches(PyExc_LookupError)) { PyErr_Clear(); x = (&_Py_NoneStruct); ( (x)->ob_refcnt++); } else goto onError; } if (((x)->ob_type == (&PyInt_Type) || PyType_IsSubtype((x)->ob_type, (&PyInt_Type)))) { long value = (((PyIntObject *)(x))->ob_ival); if (value < 0 || value > 65535) { PyErr_SetString(PyExc_TypeError, "character mapping must be in range(65536)"); if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); goto onError; } *p++ = (Py_UNICODE)value; } else if (x == (&_Py_NoneStruct)) { outpos = p-(((PyUnicodeObject *)(v))->str); startinpos = s-starts; endinpos = startinpos+1; if (unicode_decode_call_errorhandler( errors, &errorHandler, "charmap", "character maps to ", starts, size, &startinpos, &endinpos, &exc, &s, (PyObject **)&v, &outpos, &p)) { if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); goto onError; } if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); continue; } else if (((x)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((x)->ob_type, (&PyUnicode_Type)))) { Py_ssize_t targetsize = (((PyUnicodeObject *)(x))->length); if (targetsize == 1) *p++ = *(((PyUnicodeObject *)(x))->str); else if (targetsize > 1) { if (targetsize > extrachars) { Py_ssize_t oldpos = p - (((PyUnicodeObject *)(v))->str); Py_ssize_t needed = (targetsize - extrachars) + (targetsize << 2); extrachars += needed; if (PyUnicodeUCS4_Resize(((PyObject **)(&v)), (((PyUnicodeObject *)(v))->length) + needed) < 0) { if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); goto onError; } p = (((PyUnicodeObject *)(v))->str) + oldpos; } memcpy((p), ((((PyUnicodeObject *)(x))->str)), (targetsize)*sizeof(Py_UNICODE)); p += targetsize; extrachars -= targetsize; } } else { PyErr_SetString(PyExc_TypeError, "character mapping must return integer, None or unicode"); if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); goto onError; } if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); ++s; } } if (p - (((PyUnicodeObject *)(v))->str) < (((PyUnicodeObject *)(v))->length)) if (PyUnicodeUCS4_Resize(((PyObject **)(&v)), p - (((PyUnicodeObject *)(v))->str)) < 0) goto onError; if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); return (PyObject *)v; onError: if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return ((void *)0); } struct encoding_map{ Py_ssize_t ob_refcnt; struct _typeobject *ob_type; unsigned char level1[32]; int count2, count3; unsigned char level23[1]; }; static PyObject* encoding_map_size(PyObject *obj, PyObject* args) { struct encoding_map *map = (struct encoding_map*)obj; return PyInt_FromLong(sizeof(*map) - 1 + 16*map->count2 + 128*map->count3); } static PyMethodDef encoding_map_methods[] = { {"size", encoding_map_size, 0x0004, "Return the size (in bytes) of this object" }, { 0 } }; static void encoding_map_dealloc(PyObject* o) { PyObject_Free(o); } static PyTypeObject EncodingMapType = { 1, ((void *)0), 0, "EncodingMap", sizeof(struct encoding_map), 0, encoding_map_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ( (1L<<0) | (1L<<1) | (1L<<3) | (1L<<5) | (1L<<6) | (1L<<7) | (1L<<8) | 0 | (1L<<17) | 0), 0, 0, 0, 0, 0, 0, 0, encoding_map_methods, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; PyObject* PyUnicode_BuildEncodingMap(PyObject* string) { Py_UNICODE *decode; PyObject *result; struct encoding_map *mresult; int i; int need_dict = 0; unsigned char level1[32]; unsigned char level2[512]; unsigned char *mlevel1, *mlevel2, *mlevel3; int count2 = 0, count3 = 0; if (!((string)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((string)->ob_type, (&PyUnicode_Type))) || PyUnicodeUCS4_GetSize(string) != 256) { PyErr_BadArgument(); return ((void *)0); } decode = (((PyUnicodeObject *)(string))->str); memset(level1, 0xFF, sizeof level1); memset(level2, 0xFF, sizeof level2); if (decode[0] != 0) need_dict = 1; for (i = 1; i < 256; i++) { int l1, l2; if (decode[i] == 0 || decode[i] > 0xFFFF ) { need_dict = 1; break; } if (decode[i] == 0xFFFE) continue; l1 = decode[i] >> 11; l2 = decode[i] >> 7; if (level1[l1] == 0xFF) level1[l1] = count2++; if (level2[l2] == 0xFF) level2[l2] = count3++; } if (count2 >= 0xFF || count3 >= 0xFF) need_dict = 1; if (need_dict) { PyObject *result = PyDict_New(); PyObject *key, *value; if (!result) return ((void *)0); for (i = 0; i < 256; i++) { key = value = ((void *)0); key = PyInt_FromLong(decode[i]); value = PyInt_FromLong(i); if (!key || !value) goto failed1; if (PyDict_SetItem(result, key, value) == -1) goto failed1; if ( --(key)->ob_refcnt != 0) ; else ( (*((PyObject *)(key))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(key)))); if ( --(value)->ob_refcnt != 0) ; else ( (*((PyObject *)(value))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(value)))); } return result; failed1: if ((key) == ((void *)0)) ; else if ( --(key)->ob_refcnt != 0) ; else ( (*((PyObject *)(key))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(key)))); if ((value) == ((void *)0)) ; else if ( --(value)->ob_refcnt != 0) ; else ( (*((PyObject *)(value))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(value)))); if ( --(result)->ob_refcnt != 0) ; else ( (*((PyObject *)(result))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(result)))); return ((void *)0); } result = PyObject_Malloc(sizeof(struct encoding_map) + 16*count2 + 128*count3 - 1); if (!result) return PyErr_NoMemory(); PyObject_Init(result, &EncodingMapType); mresult = (struct encoding_map*)result; mresult->count2 = count2; mresult->count3 = count3; mlevel1 = mresult->level1; mlevel2 = mresult->level23; mlevel3 = mresult->level23 + 16*count2; memcpy(mlevel1, level1, 32); memset(mlevel2, 0xFF, 16*count2); memset(mlevel3, 0, 128*count3); count3 = 0; for (i = 1; i < 256; i++) { int o1, o2, o3, i2, i3; if (decode[i] == 0xFFFE) continue; o1 = decode[i]>>11; o2 = (decode[i]>>7) & 0xF; i2 = 16*mlevel1[o1] + o2; if (mlevel2[i2] == 0xFF) mlevel2[i2] = count3++; o3 = decode[i] & 0x7F; i3 = 128*mlevel2[i2] + o3; mlevel3[i3] = i; } return result; } static int encoding_map_lookup(Py_UNICODE c, PyObject *mapping) { struct encoding_map *map = (struct encoding_map*)mapping; int l1 = c>>11; int l2 = (c>>7) & 0xF; int l3 = c & 0x7F; int i; if (c > 0xFFFF) { return -1; } if (c == 0) return 0; i = map->level1[l1]; if (i == 0xFF) { return -1; } i = map->level23[16*i+l2]; if (i == 0xFF) { return -1; } i = map->level23[16*map->count2 + 128*i + l3]; if (i == 0) { return -1; } return i; } static PyObject *charmapencode_lookup(Py_UNICODE c, PyObject *mapping) { PyObject *w = PyInt_FromLong((long)c); PyObject *x; if (w == ((void *)0)) return ((void *)0); x = PyObject_GetItem(mapping, w); if ( --(w)->ob_refcnt != 0) ; else ( (*((PyObject *)(w))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(w)))); if (x == ((void *)0)) { if (PyErr_ExceptionMatches(PyExc_LookupError)) { PyErr_Clear(); x = (&_Py_NoneStruct); ( (x)->ob_refcnt++); return x; } else return ((void *)0); } else if (x == (&_Py_NoneStruct)) return x; else if (((x)->ob_type == (&PyInt_Type) || PyType_IsSubtype((x)->ob_type, (&PyInt_Type)))) { long value = (((PyIntObject *)(x))->ob_ival); if (value < 0 || value > 255) { PyErr_SetString(PyExc_TypeError, "character mapping must be in range(256)"); if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); return ((void *)0); } return x; } else if (((x)->ob_type == (&PyString_Type) || PyType_IsSubtype((x)->ob_type, (&PyString_Type)))) return x; else { PyErr_SetString(PyExc_TypeError, "character mapping must return integer, None or str"); if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); return ((void *)0); } } static int charmapencode_resize(PyObject **outobj, Py_ssize_t *outpos, Py_ssize_t requiredsize) { Py_ssize_t outsize = (((PyStringObject *)(*outobj))->ob_size); if (requiredsize < 2*outsize) requiredsize = 2*outsize; if (_PyString_Resize(outobj, requiredsize)) { return 0; } return 1; } typedef enum charmapencode_result { enc_SUCCESS, enc_FAILED, enc_EXCEPTION }charmapencode_result; static charmapencode_result charmapencode_output(Py_UNICODE c, PyObject *mapping, PyObject **outobj, Py_ssize_t *outpos) { PyObject *rep; char *outstart; Py_ssize_t outsize = (((PyStringObject *)(*outobj))->ob_size); if (mapping->ob_type == &EncodingMapType) { int res = encoding_map_lookup(c, mapping); Py_ssize_t requiredsize = *outpos+1; if (res == -1) return enc_FAILED; if (outsizeob_sval); outstart[(*outpos)++] = (char)res; return enc_SUCCESS; } rep = charmapencode_lookup(c, mapping); if (rep==((void *)0)) return enc_EXCEPTION; else if (rep==(&_Py_NoneStruct)) { if ( --(rep)->ob_refcnt != 0) ; else ( (*((PyObject *)(rep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(rep)))); return enc_FAILED; } else { if (((rep)->ob_type == (&PyInt_Type) || PyType_IsSubtype((rep)->ob_type, (&PyInt_Type)))) { Py_ssize_t requiredsize = *outpos+1; if (outsizeob_refcnt != 0) ; else ( (*((PyObject *)(rep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(rep)))); return enc_EXCEPTION; } outstart = (((PyStringObject *)(*outobj))->ob_sval); outstart[(*outpos)++] = (char)(((PyIntObject *)(rep))->ob_ival); } else { const char *repchars = (((PyStringObject *)(rep))->ob_sval); Py_ssize_t repsize = (((PyStringObject *)(rep))->ob_size); Py_ssize_t requiredsize = *outpos+repsize; if (outsizeob_refcnt != 0) ; else ( (*((PyObject *)(rep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(rep)))); return enc_EXCEPTION; } outstart = (((PyStringObject *)(*outobj))->ob_sval); memcpy(outstart + *outpos, repchars, repsize); *outpos += repsize; } } if ( --(rep)->ob_refcnt != 0) ; else ( (*((PyObject *)(rep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(rep)))); return enc_SUCCESS; } static int charmap_encoding_error( const Py_UNICODE *p, Py_ssize_t size, Py_ssize_t *inpos, PyObject *mapping, PyObject **exceptionObject, int *known_errorHandler, PyObject **errorHandler, const char *errors, PyObject **res, Py_ssize_t *respos) { PyObject *repunicode = ((void *)0); Py_ssize_t repsize; Py_ssize_t newpos; Py_UNICODE *uni2; Py_ssize_t collstartpos = *inpos; Py_ssize_t collendpos = *inpos+1; Py_ssize_t collpos; char *encoding = "charmap"; char *reason = "character maps to "; charmapencode_result x; while (collendpos < size) { PyObject *rep; if (mapping->ob_type == &EncodingMapType) { int res = encoding_map_lookup(p[collendpos], mapping); if (res != -1) break; ++collendpos; continue; } rep = charmapencode_lookup(p[collendpos], mapping); if (rep==((void *)0)) return -1; else if (rep!=(&_Py_NoneStruct)) { if ( --(rep)->ob_refcnt != 0) ; else ( (*((PyObject *)(rep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(rep)))); break; } if ( --(rep)->ob_refcnt != 0) ; else ( (*((PyObject *)(rep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(rep)))); ++collendpos; } if (*known_errorHandler==-1) { if ((errors==((void *)0)) || (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("strict") && (__s1_len = strlen (errors), __s2_len = strlen ("strict"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "strict") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("strict"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) && (__s2_len = strlen ("strict"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("strict"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("strict"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("strict"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("strict"))[3]); } } __result; }))) : __builtin_strcmp (errors, "strict")))); }))) *known_errorHandler = 1; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("replace") && (__s1_len = strlen (errors), __s2_len = strlen ("replace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "replace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("replace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) && (__s2_len = strlen ("replace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("replace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("replace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("replace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("replace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "replace")))); })) *known_errorHandler = 2; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("ignore") && (__s1_len = strlen (errors), __s2_len = strlen ("ignore"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "ignore") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("ignore"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) && (__s2_len = strlen ("ignore"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("ignore"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("ignore"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("ignore"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("ignore"))[3]); } } __result; }))) : __builtin_strcmp (errors, "ignore")))); })) *known_errorHandler = 3; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("xmlcharrefreplace") && (__s1_len = strlen (errors), __s2_len = strlen ("xmlcharrefreplace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("xmlcharrefreplace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) && (__s2_len = strlen ("xmlcharrefreplace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "xmlcharrefreplace")))); })) *known_errorHandler = 4; else *known_errorHandler = 0; } switch (*known_errorHandler) { case 1: raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); return -1; case 2: for (collpos = collstartpos; collposlength); for (uni2 = (((PyUnicodeObject *)(repunicode))->str); repsize-->0; ++uni2) { x = charmapencode_output(*uni2, mapping, res, respos); if (x==enc_EXCEPTION) { return -1; } else if (x==enc_FAILED) { if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); return -1; } } *inpos = newpos; if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); } return 0; } PyObject *PyUnicodeUCS4_EncodeCharmap(const Py_UNICODE *p, Py_ssize_t size, PyObject *mapping, const char *errors) { PyObject *res = ((void *)0); Py_ssize_t inpos = 0; Py_ssize_t respos = 0; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); int known_errorHandler = -1; if (mapping == ((void *)0)) return PyUnicodeUCS4_EncodeLatin1(p, size, errors); res = PyString_FromStringAndSize(((void *)0), size); if (res == ((void *)0)) goto onError; if (size == 0) return res; while (inposob_size)) { if (_PyString_Resize(&res, respos)) goto onError; } if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); return res; onError: if ((res) == ((void *)0)) ; else if ( --(res)->ob_refcnt != 0) ; else ( (*((PyObject *)(res))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(res)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); return ((void *)0); } PyObject *PyUnicodeUCS4_AsCharmapString(PyObject *unicode, PyObject *mapping) { if (!((unicode)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((unicode)->ob_type, (&PyUnicode_Type))) || mapping == ((void *)0)) { PyErr_BadArgument(); return ((void *)0); } return PyUnicodeUCS4_EncodeCharmap((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length), mapping, ((void *)0)); } static void make_translate_exception(PyObject **exceptionObject, const Py_UNICODE *unicode, Py_ssize_t size, Py_ssize_t startpos, Py_ssize_t endpos, const char *reason) { if (*exceptionObject == ((void *)0)) { *exceptionObject = PyUnicodeTranslateError_Create( unicode, size, startpos, endpos, reason); } else { if (PyUnicodeTranslateError_SetStart(*exceptionObject, startpos)) goto onError; if (PyUnicodeTranslateError_SetEnd(*exceptionObject, endpos)) goto onError; if (PyUnicodeTranslateError_SetReason(*exceptionObject, reason)) goto onError; return; onError: if ( --(*exceptionObject)->ob_refcnt != 0) ; else ( (*((PyObject *)(*exceptionObject))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(*exceptionObject)))); *exceptionObject = ((void *)0); } } static void raise_translate_exception(PyObject **exceptionObject, const Py_UNICODE *unicode, Py_ssize_t size, Py_ssize_t startpos, Py_ssize_t endpos, const char *reason) { make_translate_exception(exceptionObject, unicode, size, startpos, endpos, reason); if (*exceptionObject != ((void *)0)) PyCodec_StrictErrors(*exceptionObject); } static PyObject *unicode_translate_call_errorhandler(const char *errors, PyObject **errorHandler, const char *reason, const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, Py_ssize_t startpos, Py_ssize_t endpos, Py_ssize_t *newpos) { static char *argparse = "O!n;translating error handler must return (unicode, int) tuple"; Py_ssize_t i_newpos; PyObject *restuple; PyObject *resunicode; if (*errorHandler == ((void *)0)) { *errorHandler = PyCodec_LookupError(errors); if (*errorHandler == ((void *)0)) return ((void *)0); } make_translate_exception(exceptionObject, unicode, size, startpos, endpos, reason); if (*exceptionObject == ((void *)0)) return ((void *)0); restuple = PyObject_CallFunctionObjArgs( *errorHandler, *exceptionObject, ((void *)0)); if (restuple == ((void *)0)) return ((void *)0); if (!((restuple)->ob_type == (&PyTuple_Type) || PyType_IsSubtype((restuple)->ob_type, (&PyTuple_Type)))) { PyErr_Format(PyExc_TypeError, &argparse[4]); if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return ((void *)0); } if (!_PyArg_ParseTuple_SizeT(restuple, argparse, &PyUnicode_Type, &resunicode, &i_newpos)) { if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return ((void *)0); } if (i_newpos<0) *newpos = size+i_newpos; else *newpos = i_newpos; if (*newpos<0 || *newpos>size) { PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return ((void *)0); } ( (resunicode)->ob_refcnt++); if ( --(restuple)->ob_refcnt != 0) ; else ( (*((PyObject *)(restuple))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(restuple)))); return resunicode; } static int charmaptranslate_lookup(Py_UNICODE c, PyObject *mapping, PyObject **result) { PyObject *w = PyInt_FromLong((long)c); PyObject *x; if (w == ((void *)0)) return -1; x = PyObject_GetItem(mapping, w); if ( --(w)->ob_refcnt != 0) ; else ( (*((PyObject *)(w))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(w)))); if (x == ((void *)0)) { if (PyErr_ExceptionMatches(PyExc_LookupError)) { PyErr_Clear(); *result = ((void *)0); return 0; } else return -1; } else if (x == (&_Py_NoneStruct)) { *result = x; return 0; } else if (((x)->ob_type == (&PyInt_Type) || PyType_IsSubtype((x)->ob_type, (&PyInt_Type)))) { long value = (((PyIntObject *)(x))->ob_ival); long max = PyUnicodeUCS4_GetMax(); if (value < 0 || value > max) { PyErr_Format(PyExc_TypeError, "character mapping must be in range(0x%lx)", max+1); if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); return -1; } *result = x; return 0; } else if (((x)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((x)->ob_type, (&PyUnicode_Type)))) { *result = x; return 0; } else { PyErr_SetString(PyExc_TypeError, "character mapping must return integer, None or unicode"); if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); return -1; } } static int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp, Py_ssize_t requiredsize) { Py_ssize_t oldsize = (((PyUnicodeObject *)(*outobj))->length); if (requiredsize > oldsize) { Py_ssize_t outpos = *outp-(((PyUnicodeObject *)(*outobj))->str); if (requiredsize < 2 * oldsize) requiredsize = 2 * oldsize; if (PyUnicodeUCS4_Resize(((PyObject **)(outobj)), requiredsize) < 0) return -1; *outp = (((PyUnicodeObject *)(*outobj))->str) + outpos; } return 0; } static int charmaptranslate_output(const Py_UNICODE *startinp, const Py_UNICODE *curinp, Py_ssize_t insize, PyObject *mapping, PyObject **outobj, Py_UNICODE **outp, PyObject **res) { if (charmaptranslate_lookup(*curinp, mapping, res)) return -1; if (*res==((void *)0)) { *(*outp)++ = *curinp; } else if (*res==(&_Py_NoneStruct)) ; else if (((*res)->ob_type == (&PyInt_Type) || PyType_IsSubtype((*res)->ob_type, (&PyInt_Type)))) { *(*outp)++ = (Py_UNICODE)(((PyIntObject *)(*res))->ob_ival); } else if (((*res)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((*res)->ob_type, (&PyUnicode_Type)))) { Py_ssize_t repsize = (((PyUnicodeObject *)(*res))->length); if (repsize==1) { *(*outp)++ = *(((PyUnicodeObject *)(*res))->str); } else if (repsize!=0) { Py_ssize_t requiredsize = (*outp-(((PyUnicodeObject *)(*outobj))->str)) + (insize - (curinp-startinp)) + repsize - 1; if (charmaptranslate_makespace(outobj, outp, requiredsize)) return -1; memcpy(*outp, (((PyUnicodeObject *)(*res))->str), sizeof(Py_UNICODE)*repsize); *outp += repsize; } } else return -1; return 0; } PyObject *PyUnicodeUCS4_TranslateCharmap(const Py_UNICODE *p, Py_ssize_t size, PyObject *mapping, const char *errors) { PyObject *res = ((void *)0); const Py_UNICODE *startp = p; const Py_UNICODE *endp = p + size; Py_UNICODE *str; Py_ssize_t respos = 0; char *reason = "character maps to "; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); int known_errorHandler = -1; if (mapping == ((void *)0)) { PyErr_BadArgument(); return ((void *)0); } res = PyUnicodeUCS4_FromUnicode(((void *)0), size); if (res == ((void *)0)) goto onError; if (size == 0) return res; str = (((PyUnicodeObject *)(res))->str); while (pob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); goto onError; } if ((x) == ((void *)0)) ; else if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); if (x!=(&_Py_NoneStruct)) ++p; else { PyObject *repunicode = ((void *)0); Py_ssize_t repsize; Py_ssize_t newpos; Py_UNICODE *uni2; const Py_UNICODE *collstart = p; const Py_UNICODE *collend = p+1; const Py_UNICODE *coll; while (collend < endp) { if (charmaptranslate_lookup(*collend, mapping, &x)) goto onError; if ((x) == ((void *)0)) ; else if ( --(x)->ob_refcnt != 0) ; else ( (*((PyObject *)(x))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(x)))); if (x!=(&_Py_NoneStruct)) break; ++collend; } if (known_errorHandler==-1) { if ((errors==((void *)0)) || (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("strict") && (__s1_len = strlen (errors), __s2_len = strlen ("strict"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "strict") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("strict"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) && (__s2_len = strlen ("strict"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("strict"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("strict"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("strict"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("strict"))[3]); } } __result; }))) : __builtin_strcmp (errors, "strict")))); }))) known_errorHandler = 1; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("replace") && (__s1_len = strlen (errors), __s2_len = strlen ("replace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "replace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("replace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) && (__s2_len = strlen ("replace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("replace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("replace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("replace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("replace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "replace")))); })) known_errorHandler = 2; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("ignore") && (__s1_len = strlen (errors), __s2_len = strlen ("ignore"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "ignore") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("ignore"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) && (__s2_len = strlen ("ignore"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("ignore"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("ignore"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("ignore"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("ignore"))[3]); } } __result; }))) : __builtin_strcmp (errors, "ignore")))); })) known_errorHandler = 3; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("xmlcharrefreplace") && (__s1_len = strlen (errors), __s2_len = strlen ("xmlcharrefreplace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("xmlcharrefreplace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) && (__s2_len = strlen ("xmlcharrefreplace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "xmlcharrefreplace")))); })) known_errorHandler = 4; else known_errorHandler = 0; } switch (known_errorHandler) { case 1: raise_translate_exception(&exc, startp, size, collstart-startp, collend-startp, reason); goto onError; case 2: for (coll = collstart; collstr))+strlen(buffer)+(endp-collend))) goto onError; for (cp = buffer; *cp; ++cp) *str++ = *cp; } p = collend; break; default: repunicode = unicode_translate_call_errorhandler(errors, &errorHandler, reason, startp, size, &exc, collstart-startp, collend-startp, &newpos); if (repunicode == ((void *)0)) goto onError; repsize = (((PyUnicodeObject *)(repunicode))->length); if (charmaptranslate_makespace(&res, &str, (str-(((PyUnicodeObject *)(res))->str))+repsize+(endp-collend))) { if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); goto onError; } for (uni2 = (((PyUnicodeObject *)(repunicode))->str); repsize-->0; ++uni2) *str++ = *uni2; p = startp + newpos; if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); } } } respos = str-(((PyUnicodeObject *)(res))->str); if (respos<(((PyUnicodeObject *)(res))->length)) { if (PyUnicodeUCS4_Resize(((PyObject **)(&res)), respos) < 0) goto onError; } if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); return res; onError: if ((res) == ((void *)0)) ; else if ( --(res)->ob_refcnt != 0) ; else ( (*((PyObject *)(res))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(res)))); if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); return ((void *)0); } PyObject *PyUnicodeUCS4_Translate(PyObject *str, PyObject *mapping, const char *errors) { PyObject *result; str = PyUnicodeUCS4_FromObject(str); if (str == ((void *)0)) goto onError; result = PyUnicodeUCS4_TranslateCharmap((((PyUnicodeObject *)(str))->str), (((PyUnicodeObject *)(str))->length), mapping, errors); if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); return result; onError: if ((str) == ((void *)0)) ; else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); return ((void *)0); } int PyUnicodeUCS4_EncodeDecimal(Py_UNICODE *s, Py_ssize_t length, char *output, const char *errors) { Py_UNICODE *p, *end; PyObject *errorHandler = ((void *)0); PyObject *exc = ((void *)0); const char *encoding = "decimal"; const char *reason = "invalid decimal Unicode string"; int known_errorHandler = -1; if (output == ((void *)0)) { PyErr_BadArgument(); return -1; } p = s; end = s + length; while (p < end) { register Py_UNICODE ch = *p; int decimal; PyObject *repunicode; Py_ssize_t repsize; Py_ssize_t newpos; Py_UNICODE *uni2; Py_UNICODE *collstart; Py_UNICODE *collend; if (_PyUnicodeUCS4_IsWhitespace(ch)) { *output++ = ' '; ++p; continue; } decimal = _PyUnicodeUCS4_ToDecimalDigit(ch); if (decimal >= 0) { *output++ = '0' + decimal; ++p; continue; } if (0 < ch && ch < 256) { *output++ = (char)ch; ++p; continue; } collstart = p; collend = p+1; while (collend < end) { if ((0 < *collend && *collend < 256) || !_PyUnicodeUCS4_IsWhitespace(*collend) || _PyUnicodeUCS4_ToDecimalDigit(*collend)) break; } if (known_errorHandler==-1) { if ((errors==((void *)0)) || (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("strict") && (__s1_len = strlen (errors), __s2_len = strlen ("strict"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "strict") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("strict"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("strict") && ((size_t)(const void *)(("strict") + 1) - (size_t)(const void *)("strict") == 1) && (__s2_len = strlen ("strict"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "strict") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("strict"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("strict"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("strict"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("strict"))[3]); } } __result; }))) : __builtin_strcmp (errors, "strict")))); }))) known_errorHandler = 1; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("replace") && (__s1_len = strlen (errors), __s2_len = strlen ("replace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "replace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("replace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("replace") && ((size_t)(const void *)(("replace") + 1) - (size_t)(const void *)("replace") == 1) && (__s2_len = strlen ("replace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "replace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("replace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("replace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("replace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("replace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "replace")))); })) known_errorHandler = 2; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("ignore") && (__s1_len = strlen (errors), __s2_len = strlen ("ignore"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "ignore") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("ignore"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("ignore") && ((size_t)(const void *)(("ignore") + 1) - (size_t)(const void *)("ignore") == 1) && (__s2_len = strlen ("ignore"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "ignore") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("ignore"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("ignore"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("ignore"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("ignore"))[3]); } } __result; }))) : __builtin_strcmp (errors, "ignore")))); })) known_errorHandler = 3; else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (errors) && __builtin_constant_p ("xmlcharrefreplace") && (__s1_len = strlen (errors), __s2_len = strlen ("xmlcharrefreplace"), (!((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) || __s2_len >= 4)) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) && (__s1_len = strlen (errors), __s1_len < 4) ? (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("xmlcharrefreplace"); register int __result = (((__const unsigned char *) (__const char *) (errors))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (errors))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (errors))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("xmlcharrefreplace") && ((size_t)(const void *)(("xmlcharrefreplace") + 1) - (size_t)(const void *)("xmlcharrefreplace") == 1) && (__s2_len = strlen ("xmlcharrefreplace"), __s2_len < 4) ? (__builtin_constant_p (errors) && ((size_t)(const void *)((errors) + 1) - (size_t)(const void *)(errors) == 1) ? __builtin_strcmp (errors, "xmlcharrefreplace") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (errors); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("xmlcharrefreplace"))[3]); } } __result; }))) : __builtin_strcmp (errors, "xmlcharrefreplace")))); })) known_errorHandler = 4; else known_errorHandler = 0; } switch (known_errorHandler) { case 1: raise_encode_exception(&exc, encoding, s, length, collstart-s, collend-s, reason); goto onError; case 2: for (p = collstart; p < collend; ++p) *output++ = '?'; case 3: p = collend; break; case 4: for (p = collstart; p < collend; ++p) output += sprintf(output, "&#%d;", (int)*p); p = collend; break; default: repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, encoding, reason, s, length, &exc, collstart-s, collend-s, &newpos); if (repunicode == ((void *)0)) goto onError; repsize = (((PyUnicodeObject *)(repunicode))->length); for (uni2 = (((PyUnicodeObject *)(repunicode))->str); repsize-->0; ++uni2) { Py_UNICODE ch = *uni2; if (_PyUnicodeUCS4_IsWhitespace(ch)) *output++ = ' '; else { decimal = _PyUnicodeUCS4_ToDecimalDigit(ch); if (decimal >= 0) *output++ = '0' + decimal; else if (0 < ch && ch < 256) *output++ = (char)ch; else { if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); raise_encode_exception(&exc, encoding, s, length, collstart-s, collend-s, reason); goto onError; } } } p = s + newpos; if ( --(repunicode)->ob_refcnt != 0) ; else ( (*((PyObject *)(repunicode))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(repunicode)))); } } *output++ = '\0'; if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); return 0; onError: if ((exc) == ((void *)0)) ; else if ( --(exc)->ob_refcnt != 0) ; else ( (*((PyObject *)(exc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(exc)))); if ((errorHandler) == ((void *)0)) ; else if ( --(errorHandler)->ob_refcnt != 0) ; else ( (*((PyObject *)(errorHandler))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(errorHandler)))); return -1; } # 4256 "Objects/unicodeobject.c" static int STRINGLIB_CMP(const Py_UNICODE* str, const Py_UNICODE* other, Py_ssize_t len) { if (str[0] != other[0]) return 1; return memcmp((void*) str, (void*) other, len * sizeof(Py_UNICODE)); } # 1 "Objects/stringlib/fastsearch.h" 1 # 20 "Objects/stringlib/fastsearch.h" static Py_ssize_t fastsearch(const Py_UNICODE* s, Py_ssize_t n, const Py_UNICODE* p, Py_ssize_t m, int mode) { long mask; Py_ssize_t skip, count = 0; Py_ssize_t i, j, mlast, w; w = n - m; if (w < 0) return -1; if (m <= 1) { if (m <= 0) return -1; if (mode == 0) { for (i = 0; i < n; i++) if (s[i] == p[0]) count++; return count; } else { for (i = 0; i < n; i++) if (s[i] == p[0]) return i; } return -1; } mlast = m - 1; skip = mlast - 1; for (mask = i = 0; i < mlast; i++) { mask |= (1 << (p[i] & 0x1F)); if (p[i] == p[mlast]) skip = mlast - i - 1; } mask |= (1 << (p[mlast] & 0x1F)); for (i = 0; i <= w; i++) { if (s[i+m-1] == p[m-1]) { for (j = 0; j < mlast; j++) if (s[i+j] != p[j]) break; if (j == mlast) { if (mode != 0) return i; count++; i = i + mlast; continue; } if (!(mask & (1 << (s[i+m] & 0x1F)))) i = i + m; else i = i + skip; } else { if (!(mask & (1 << (s[i+m] & 0x1F)))) i = i + m; } } if (mode != 0) return -1; return count; } # 4267 "Objects/unicodeobject.c" 2 # 1 "Objects/stringlib/count.h" 1 # 10 "Objects/stringlib/count.h" static Py_ssize_t stringlib_count(const Py_UNICODE* str, Py_ssize_t str_len, const Py_UNICODE* sub, Py_ssize_t sub_len) { Py_ssize_t count; if (sub_len == 0) { if (str_len < 0) return 0; return str_len + 1; } count = fastsearch(str, str_len, sub, sub_len, 0); if (count < 0) count = 0; return count; } # 4269 "Objects/unicodeobject.c" 2 # 1 "Objects/stringlib/find.h" 1 # 10 "Objects/stringlib/find.h" static Py_ssize_t stringlib_find(const Py_UNICODE* str, Py_ssize_t str_len, const Py_UNICODE* sub, Py_ssize_t sub_len, Py_ssize_t offset) { Py_ssize_t pos; if (sub_len == 0) { if (str_len < 0) return -1; return offset; } pos = fastsearch(str, str_len, sub, sub_len, 1); if (pos >= 0) pos += offset; return pos; } static Py_ssize_t stringlib_rfind(const Py_UNICODE* str, Py_ssize_t str_len, const Py_UNICODE* sub, Py_ssize_t sub_len, Py_ssize_t offset) { if (sub_len == 0) { if (str_len < 0) return -1; return str_len + offset; } else { Py_ssize_t j, pos = -1; for (j = str_len - sub_len; j >= 0; --j) if (STRINGLIB_CMP(str+j, sub, sub_len) == 0) { pos = j + offset; break; } return pos; } } static Py_ssize_t stringlib_find_slice(const Py_UNICODE* str, Py_ssize_t str_len, const Py_UNICODE* sub, Py_ssize_t sub_len, Py_ssize_t start, Py_ssize_t end) { if (start < 0) start += str_len; if (start < 0) start = 0; if (end > str_len) end = str_len; if (end < 0) end += str_len; if (end < 0) end = 0; return stringlib_find( str + start, end - start, sub, sub_len, start ); } static Py_ssize_t stringlib_rfind_slice(const Py_UNICODE* str, Py_ssize_t str_len, const Py_UNICODE* sub, Py_ssize_t sub_len, Py_ssize_t start, Py_ssize_t end) { if (start < 0) start += str_len; if (start < 0) start = 0; if (end > str_len) end = str_len; if (end < 0) end += str_len; if (end < 0) end = 0; return stringlib_rfind(str + start, end - start, sub, sub_len, start); } static int stringlib_contains_obj(PyObject* str, PyObject* sub) { return stringlib_find( (((PyUnicodeObject *)(str))->str), (((PyUnicodeObject *)(str))->length), (((PyUnicodeObject *)(sub))->str), (((PyUnicodeObject *)(sub))->length), 0 ) != -1; } # 4270 "Objects/unicodeobject.c" 2 # 1 "Objects/stringlib/partition.h" 1 # 10 "Objects/stringlib/partition.h" static PyObject* stringlib_partition( PyObject* str_obj, const Py_UNICODE* str, Py_ssize_t str_len, PyObject* sep_obj, const Py_UNICODE* sep, Py_ssize_t sep_len ) { PyObject* out; Py_ssize_t pos; if (sep_len == 0) { PyErr_SetString(PyExc_ValueError, "empty separator"); return ((void *)0); } out = PyTuple_New(3); if (!out) return ((void *)0); pos = fastsearch(str, str_len, sep, sep_len, 1); if (pos < 0) { ( (str_obj)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[0] = (PyObject*) str_obj); ( (unicode_empty)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[1] = (PyObject*) unicode_empty); ( (unicode_empty)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[2] = (PyObject*) unicode_empty); return out; } (((PyTupleObject *)(out))->ob_item[0] = PyUnicodeUCS4_FromUnicode(str, pos)); ( (sep_obj)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[1] = sep_obj); pos += sep_len; (((PyTupleObject *)(out))->ob_item[2] = PyUnicodeUCS4_FromUnicode(str + pos, str_len - pos)); if (PyErr_Occurred()) { if ( --(out)->ob_refcnt != 0) ; else ( (*((PyObject *)(out))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(out)))); return ((void *)0); } return out; } static PyObject* stringlib_rpartition( PyObject* str_obj, const Py_UNICODE* str, Py_ssize_t str_len, PyObject* sep_obj, const Py_UNICODE* sep, Py_ssize_t sep_len ) { PyObject* out; Py_ssize_t pos, j; if (sep_len == 0) { PyErr_SetString(PyExc_ValueError, "empty separator"); return ((void *)0); } out = PyTuple_New(3); if (!out) return ((void *)0); pos = -1; for (j = str_len - sep_len; j >= 0; --j) if (STRINGLIB_CMP(str+j, sep, sep_len) == 0) { pos = j; break; } if (pos < 0) { ( (unicode_empty)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[0] = (PyObject*) unicode_empty); ( (unicode_empty)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[1] = (PyObject*) unicode_empty); ( (str_obj)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[2] = (PyObject*) str_obj); return out; } (((PyTupleObject *)(out))->ob_item[0] = PyUnicodeUCS4_FromUnicode(str, pos)); ( (sep_obj)->ob_refcnt++); (((PyTupleObject *)(out))->ob_item[1] = sep_obj); pos += sep_len; (((PyTupleObject *)(out))->ob_item[2] = PyUnicodeUCS4_FromUnicode(str + pos, str_len - pos)); if (PyErr_Occurred()) { if ( --(out)->ob_refcnt != 0) ; else ( (*((PyObject *)(out))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(out)))); return ((void *)0); } return out; } # 4271 "Objects/unicodeobject.c" 2 # 4285 "Objects/unicodeobject.c" Py_ssize_t PyUnicodeUCS4_Count(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end) { Py_ssize_t result; PyUnicodeObject* str_obj; PyUnicodeObject* sub_obj; str_obj = (PyUnicodeObject*) PyUnicodeUCS4_FromObject(str); if (!str_obj) return -1; sub_obj = (PyUnicodeObject*) PyUnicodeUCS4_FromObject(substr); if (!sub_obj) { if ( --(str_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(str_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str_obj)))); return -1; } if (start < 0) start += (str_obj)->length; if (start < 0) start = 0; if (end > (str_obj)->length) end = (str_obj)->length; if (end < 0) end += (str_obj)->length; if (end < 0) end = 0;; result = stringlib_count( str_obj->str + start, end - start, sub_obj->str, sub_obj->length ); if ( --(sub_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(sub_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sub_obj)))); if ( --(str_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(str_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str_obj)))); return result; } Py_ssize_t PyUnicodeUCS4_Find(PyObject *str, PyObject *sub, Py_ssize_t start, Py_ssize_t end, int direction) { Py_ssize_t result; str = PyUnicodeUCS4_FromObject(str); if (!str) return -2; sub = PyUnicodeUCS4_FromObject(sub); if (!sub) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); return -2; } if (direction > 0) result = stringlib_find_slice( (((PyUnicodeObject *)(str))->str), (((PyUnicodeObject *)(str))->length), (((PyUnicodeObject *)(sub))->str), (((PyUnicodeObject *)(sub))->length), start, end ); else result = stringlib_rfind_slice( (((PyUnicodeObject *)(str))->str), (((PyUnicodeObject *)(str))->length), (((PyUnicodeObject *)(sub))->str), (((PyUnicodeObject *)(sub))->length), start, end ); if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); if ( --(sub)->ob_refcnt != 0) ; else ( (*((PyObject *)(sub))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sub)))); return result; } static int tailmatch(PyUnicodeObject *self, PyUnicodeObject *substring, Py_ssize_t start, Py_ssize_t end, int direction) { if (substring->length == 0) return 1; if (start < 0) start += (self)->length; if (start < 0) start = 0; if (end > (self)->length) end = (self)->length; if (end < 0) end += (self)->length; if (end < 0) end = 0;; end -= substring->length; if (end < start) return 0; if (direction > 0) { if (((*((self)->str + (end)) == *((substring)->str)) && ((*((self)->str + (end) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && !memcmp((self)->str + (end), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))) return 1; } else { if (((*((self)->str + (start)) == *((substring)->str)) && ((*((self)->str + (start) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && !memcmp((self)->str + (start), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))) return 1; } return 0; } Py_ssize_t PyUnicodeUCS4_Tailmatch(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end, int direction) { Py_ssize_t result; str = PyUnicodeUCS4_FromObject(str); if (str == ((void *)0)) return -1; substr = PyUnicodeUCS4_FromObject(substr); if (substr == ((void *)0)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); return -1; } result = tailmatch((PyUnicodeObject *)str, (PyUnicodeObject *)substr, start, end, direction); if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); if ( --(substr)->ob_refcnt != 0) ; else ( (*((PyObject *)(substr))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substr)))); return result; } static PyObject *fixup(PyUnicodeObject *self, int (*fixfct)(PyUnicodeObject *s)) { PyUnicodeObject *u; u = (PyUnicodeObject*) PyUnicodeUCS4_FromUnicode(((void *)0), self->length); if (u == ((void *)0)) return ((void *)0); memcpy((u->str), (self->str), (self->length)*sizeof(Py_UNICODE)); if (!fixfct(u) && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); if ( --(u)->ob_refcnt != 0) ; else ( (*((PyObject *)(u))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(u)))); return (PyObject*) self; } return (PyObject*) u; } static int fixupper(PyUnicodeObject *self) { Py_ssize_t len = self->length; Py_UNICODE *s = self->str; int status = 0; while (len-- > 0) { register Py_UNICODE ch; ch = _PyUnicodeUCS4_ToUppercase(*s); if (ch != *s) { status = 1; *s = ch; } s++; } return status; } static int fixlower(PyUnicodeObject *self) { Py_ssize_t len = self->length; Py_UNICODE *s = self->str; int status = 0; while (len-- > 0) { register Py_UNICODE ch; ch = _PyUnicodeUCS4_ToLowercase(*s); if (ch != *s) { status = 1; *s = ch; } s++; } return status; } static int fixswapcase(PyUnicodeObject *self) { Py_ssize_t len = self->length; Py_UNICODE *s = self->str; int status = 0; while (len-- > 0) { if (_PyUnicodeUCS4_IsUppercase(*s)) { *s = _PyUnicodeUCS4_ToLowercase(*s); status = 1; } else if (_PyUnicodeUCS4_IsLowercase(*s)) { *s = _PyUnicodeUCS4_ToUppercase(*s); status = 1; } s++; } return status; } static int fixcapitalize(PyUnicodeObject *self) { Py_ssize_t len = self->length; Py_UNICODE *s = self->str; int status = 0; if (len == 0) return 0; if (_PyUnicodeUCS4_IsLowercase(*s)) { *s = _PyUnicodeUCS4_ToUppercase(*s); status = 1; } s++; while (--len > 0) { if (_PyUnicodeUCS4_IsUppercase(*s)) { *s = _PyUnicodeUCS4_ToLowercase(*s); status = 1; } s++; } return status; } static int fixtitle(PyUnicodeObject *self) { register Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register Py_UNICODE *e; int previous_is_cased; if ((((PyUnicodeObject *)(self))->length) == 1) { Py_UNICODE ch = _PyUnicodeUCS4_ToTitlecase(*p); if (*p != ch) { *p = ch; return 1; } else return 0; } e = p + (((PyUnicodeObject *)(self))->length); previous_is_cased = 0; for (; p < e; p++) { register const Py_UNICODE ch = *p; if (previous_is_cased) *p = _PyUnicodeUCS4_ToLowercase(ch); else *p = _PyUnicodeUCS4_ToTitlecase(ch); if (_PyUnicodeUCS4_IsLowercase(ch) || _PyUnicodeUCS4_IsUppercase(ch) || _PyUnicodeUCS4_IsTitlecase(ch)) previous_is_cased = 1; else previous_is_cased = 0; } return 1; } PyObject * PyUnicodeUCS4_Join(PyObject *separator, PyObject *seq) { PyObject *internal_separator = ((void *)0); const Py_UNICODE blank = ' '; const Py_UNICODE *sep = ␣ Py_ssize_t seplen = 1; PyUnicodeObject *res = ((void *)0); Py_ssize_t res_alloc = 100; Py_ssize_t res_used; Py_UNICODE *res_p; PyObject *fseq; Py_ssize_t seqlen; PyObject *item; Py_ssize_t i; fseq = PySequence_Fast(seq, ""); if (fseq == ((void *)0)) { return ((void *)0); } # 4583 "Objects/unicodeobject.c" seqlen = (((fseq)->ob_type == (&PyList_Type) || PyType_IsSubtype((fseq)->ob_type, (&PyList_Type))) ? (((PyListObject *)(fseq))->ob_size) : (((PyTupleObject *)(fseq))->ob_size)); if (seqlen == 0) { res = _PyUnicode_New(0); goto Done; } if (seqlen == 1) { item = (((fseq)->ob_type == (&PyList_Type) || PyType_IsSubtype((fseq)->ob_type, (&PyList_Type))) ? (((PyListObject *)(fseq))->ob_item[0]) : (((PyTupleObject *)(fseq))->ob_item[0])); if (((item)->ob_type == &PyUnicode_Type)) { ( (item)->ob_refcnt++); res = (PyUnicodeObject *)item; goto Done; } } if (seqlen > 1) { if (separator == ((void *)0)) { sep = ␣ seplen = 1; } else { internal_separator = PyUnicodeUCS4_FromObject(separator); if (internal_separator == ((void *)0)) goto onError; sep = (((PyUnicodeObject *)(internal_separator))->str); seplen = (((PyUnicodeObject *)(internal_separator))->length); seqlen = (((fseq)->ob_type == (&PyList_Type) || PyType_IsSubtype((fseq)->ob_type, (&PyList_Type))) ? (((PyListObject *)(fseq))->ob_size) : (((PyTupleObject *)(fseq))->ob_size)); } } res = _PyUnicode_New(res_alloc); if (res == ((void *)0)) goto onError; res_p = (((PyUnicodeObject *)(res))->str); res_used = 0; for (i = 0; i < seqlen; ++i) { Py_ssize_t itemlen; Py_ssize_t new_res_used; item = (((fseq)->ob_type == (&PyList_Type) || PyType_IsSubtype((fseq)->ob_type, (&PyList_Type))) ? (((PyListObject *)(fseq))->ob_item[i]) : (((PyTupleObject *)(fseq))->ob_item[i])); if (! ((item)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((item)->ob_type, (&PyUnicode_Type))) && ! ((item)->ob_type == (&PyString_Type) || PyType_IsSubtype((item)->ob_type, (&PyString_Type)))) { PyErr_Format(PyExc_TypeError, "sequence item %zd: expected string or Unicode," " %.80s found", i, item->ob_type->tp_name); goto onError; } item = PyUnicodeUCS4_FromObject(item); if (item == ((void *)0)) goto onError; seqlen = (((fseq)->ob_type == (&PyList_Type) || PyType_IsSubtype((fseq)->ob_type, (&PyList_Type))) ? (((PyListObject *)(fseq))->ob_size) : (((PyTupleObject *)(fseq))->ob_size)); itemlen = (((PyUnicodeObject *)(item))->length); new_res_used = res_used + itemlen; if (new_res_used < 0) goto Overflow; if (i < seqlen - 1) { new_res_used += seplen; if (new_res_used < 0) goto Overflow; } if (new_res_used > res_alloc) { do { res_alloc += res_alloc; if (res_alloc <= 0) goto Overflow; } while (new_res_used > res_alloc); if (PyUnicodeUCS4_Resize(((PyObject **)(&res)), res_alloc) < 0) { if ( --(item)->ob_refcnt != 0) ; else ( (*((PyObject *)(item))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(item)))); goto onError; } res_p = (((PyUnicodeObject *)(res))->str) + res_used; } memcpy((res_p), ((((PyUnicodeObject *)(item))->str)), (itemlen)*sizeof(Py_UNICODE)); res_p += itemlen; if (i < seqlen - 1) { memcpy((res_p), (sep), (seplen)*sizeof(Py_UNICODE)); res_p += seplen; } if ( --(item)->ob_refcnt != 0) ; else ( (*((PyObject *)(item))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(item)))); res_used = new_res_used; } if (PyUnicodeUCS4_Resize(((PyObject **)(&res)), res_used) < 0) goto onError; Done: if ((internal_separator) == ((void *)0)) ; else if ( --(internal_separator)->ob_refcnt != 0) ; else ( (*((PyObject *)(internal_separator))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(internal_separator)))); if ( --(fseq)->ob_refcnt != 0) ; else ( (*((PyObject *)(fseq))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(fseq)))); return (PyObject *)res; Overflow: PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); if ( --(item)->ob_refcnt != 0) ; else ( (*((PyObject *)(item))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(item)))); onError: if ((internal_separator) == ((void *)0)) ; else if ( --(internal_separator)->ob_refcnt != 0) ; else ( (*((PyObject *)(internal_separator))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(internal_separator)))); if ( --(fseq)->ob_refcnt != 0) ; else ( (*((PyObject *)(fseq))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(fseq)))); if ((res) == ((void *)0)) ; else if ( --(res)->ob_refcnt != 0) ; else ( (*((PyObject *)(res))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(res)))); return ((void *)0); } static PyUnicodeObject *pad(PyUnicodeObject *self, Py_ssize_t left, Py_ssize_t right, Py_UNICODE fill) { PyUnicodeObject *u; if (left < 0) left = 0; if (right < 0) right = 0; if (left == 0 && right == 0 && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return self; } u = _PyUnicode_New(left + self->length + right); if (u) { if (left) do {Py_ssize_t i_; Py_UNICODE *t_ = (u->str); Py_UNICODE v_ = (fill); for (i_ = 0; i_ < (left); i_++) t_[i_] = v_; } while (0); memcpy((u->str + left), (self->str), (self->length)*sizeof(Py_UNICODE)); if (right) do {Py_ssize_t i_; Py_UNICODE *t_ = (u->str + left + self->length); Py_UNICODE v_ = (fill); for (i_ = 0; i_ < (right); i_++) t_[i_] = v_; } while (0); } return u; } # 4745 "Objects/unicodeobject.c" static PyObject *split_whitespace(PyUnicodeObject *self, PyObject *list, Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; Py_ssize_t len = self->length; PyObject *str; for (i = j = 0; i < len; ) { while (i < len && _PyUnicodeUCS4_IsWhitespace(self->str[i])) i++; j = i; while (i < len && !_PyUnicodeUCS4_IsWhitespace(self->str[i])) i++; if (j < i) { if (maxcount-- <= 0) break; str = PyUnicodeUCS4_FromUnicode((self->str) + (j), (i) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; while (i < len && _PyUnicodeUCS4_IsWhitespace(self->str[i])) i++; j = i; } } if (j < len) { str = PyUnicodeUCS4_FromUnicode((self->str) + (j), (len) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; } return list; onError: if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); return ((void *)0); } PyObject *PyUnicodeUCS4_Splitlines(PyObject *string, int keepends) { register Py_ssize_t i; register Py_ssize_t j; Py_ssize_t len; PyObject *list; PyObject *str; Py_UNICODE *data; string = PyUnicodeUCS4_FromObject(string); if (string == ((void *)0)) return ((void *)0); data = (((PyUnicodeObject *)(string))->str); len = (((PyUnicodeObject *)(string))->length); list = PyList_New(0); if (!list) goto onError; for (i = j = 0; i < len; ) { Py_ssize_t eol; while (i < len && !(((bloom_linebreak & (1 << (((data[i])) & 0x1F)))) && _PyUnicodeUCS4_IsLinebreak((data[i])))) i++; eol = i; if (i < len) { if (data[i] == '\r' && i + 1 < len && data[i+1] == '\n') i += 2; else i++; if (keepends) eol = i; } str = PyUnicodeUCS4_FromUnicode((data) + (j), (eol) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; j = i; } if (j < len) { str = PyUnicodeUCS4_FromUnicode((data) + (j), (len) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; } if ( --(string)->ob_refcnt != 0) ; else ( (*((PyObject *)(string))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(string)))); return list; onError: if ((list) == ((void *)0)) ; else if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); if ( --(string)->ob_refcnt != 0) ; else ( (*((PyObject *)(string))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(string)))); return ((void *)0); } static PyObject *split_char(PyUnicodeObject *self, PyObject *list, Py_UNICODE ch, Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; Py_ssize_t len = self->length; PyObject *str; for (i = j = 0; i < len; ) { if (self->str[i] == ch) { if (maxcount-- <= 0) break; str = PyUnicodeUCS4_FromUnicode((self->str) + (j), (i) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; i = j = i + 1; } else i++; } if (j <= len) { str = PyUnicodeUCS4_FromUnicode((self->str) + (j), (len) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; } return list; onError: if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); return ((void *)0); } static PyObject *split_substring(PyUnicodeObject *self, PyObject *list, PyUnicodeObject *substring, Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; Py_ssize_t len = self->length; Py_ssize_t sublen = substring->length; PyObject *str; for (i = j = 0; i <= len - sublen; ) { if (((*((self)->str + (i)) == *((substring)->str)) && ((*((self)->str + (i) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && !memcmp((self)->str + (i), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))) { if (maxcount-- <= 0) break; str = PyUnicodeUCS4_FromUnicode((self->str) + (j), (i) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; i = j = i + sublen; } else i++; } if (j <= len) { str = PyUnicodeUCS4_FromUnicode((self->str) + (j), (len) - (j)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; } return list; onError: if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); return ((void *)0); } static PyObject *rsplit_whitespace(PyUnicodeObject *self, PyObject *list, Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; Py_ssize_t len = self->length; PyObject *str; for (i = j = len - 1; i >= 0; ) { while (i >= 0 && _PyUnicodeUCS4_IsWhitespace(self->str[i])) i--; j = i; while (i >= 0 && !_PyUnicodeUCS4_IsWhitespace(self->str[i])) i--; if (j > i) { if (maxcount-- <= 0) break; str = PyUnicodeUCS4_FromUnicode((self->str) + (i + 1), (j + 1) - (i + 1)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; while (i >= 0 && _PyUnicodeUCS4_IsWhitespace(self->str[i])) i--; j = i; } } if (j >= 0) { str = PyUnicodeUCS4_FromUnicode((self->str) + (0), (j + 1) - (0)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; } if (PyList_Reverse(list) < 0) goto onError; return list; onError: if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); return ((void *)0); } static PyObject *rsplit_char(PyUnicodeObject *self, PyObject *list, Py_UNICODE ch, Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; Py_ssize_t len = self->length; PyObject *str; for (i = j = len - 1; i >= 0; ) { if (self->str[i] == ch) { if (maxcount-- <= 0) break; str = PyUnicodeUCS4_FromUnicode((self->str) + (i + 1), (j + 1) - (i + 1)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; j = i = i - 1; } else i--; } if (j >= -1) { str = PyUnicodeUCS4_FromUnicode((self->str) + (0), (j + 1) - (0)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; } if (PyList_Reverse(list) < 0) goto onError; return list; onError: if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); return ((void *)0); } static PyObject *rsplit_substring(PyUnicodeObject *self, PyObject *list, PyUnicodeObject *substring, Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; Py_ssize_t len = self->length; Py_ssize_t sublen = substring->length; PyObject *str; for (i = len - sublen, j = len; i >= 0; ) { if (((*((self)->str + (i)) == *((substring)->str)) && ((*((self)->str + (i) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && !memcmp((self)->str + (i), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))) { if (maxcount-- <= 0) break; str = PyUnicodeUCS4_FromUnicode((self->str) + (i + sublen), (j) - (i + sublen)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; j = i; i -= sublen; } else i--; } if (j >= 0) { str = PyUnicodeUCS4_FromUnicode((self->str) + (0), (j) - (0)); if (!str) goto onError; if (PyList_Append(list, str)) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); goto onError; } else if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str))));; } if (PyList_Reverse(list) < 0) goto onError; return list; onError: if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); return ((void *)0); } static PyObject *split(PyUnicodeObject *self, PyUnicodeObject *substring, Py_ssize_t maxcount) { PyObject *list; if (maxcount < 0) maxcount = ((Py_ssize_t)(((size_t)-1)>>1)); list = PyList_New(0); if (!list) return ((void *)0); if (substring == ((void *)0)) return split_whitespace(self,list,maxcount); else if (substring->length == 1) return split_char(self,list,substring->str[0],maxcount); else if (substring->length == 0) { if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); PyErr_SetString(PyExc_ValueError, "empty separator"); return ((void *)0); } else return split_substring(self,list,substring,maxcount); } static PyObject *rsplit(PyUnicodeObject *self, PyUnicodeObject *substring, Py_ssize_t maxcount) { PyObject *list; if (maxcount < 0) maxcount = ((Py_ssize_t)(((size_t)-1)>>1)); list = PyList_New(0); if (!list) return ((void *)0); if (substring == ((void *)0)) return rsplit_whitespace(self,list,maxcount); else if (substring->length == 1) return rsplit_char(self,list,substring->str[0],maxcount); else if (substring->length == 0) { if ( --(list)->ob_refcnt != 0) ; else ( (*((PyObject *)(list))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(list)))); PyErr_SetString(PyExc_ValueError, "empty separator"); return ((void *)0); } else return rsplit_substring(self,list,substring,maxcount); } static PyObject *replace(PyUnicodeObject *self, PyUnicodeObject *str1, PyUnicodeObject *str2, Py_ssize_t maxcount) { PyUnicodeObject *u; if (maxcount < 0) maxcount = ((Py_ssize_t)(((size_t)-1)>>1)); if (str1->length == str2->length) { Py_ssize_t i; if (str1->length == 1) { Py_UNICODE u1, u2; if (!findchar(self->str, self->length, str1->str[0])) goto nothing; u = (PyUnicodeObject*) PyUnicodeUCS4_FromUnicode(((void *)0), self->length); if (!u) return ((void *)0); memcpy((u->str), (self->str), (self->length)*sizeof(Py_UNICODE)); u1 = str1->str[0]; u2 = str2->str[0]; for (i = 0; i < u->length; i++) if (u->str[i] == u1) { if (--maxcount < 0) break; u->str[i] = u2; } } else { i = fastsearch( self->str, self->length, str1->str, str1->length, 1 ); if (i < 0) goto nothing; u = (PyUnicodeObject*) PyUnicodeUCS4_FromUnicode(((void *)0), self->length); if (!u) return ((void *)0); memcpy((u->str), (self->str), (self->length)*sizeof(Py_UNICODE)); while (i <= self->length - str1->length) if (((*((self)->str + (i)) == *((str1)->str)) && ((*((self)->str + (i) + (str1)->length-1) == *((str1)->str + (str1)->length-1))) && !memcmp((self)->str + (i), (str1)->str, (str1)->length*sizeof(Py_UNICODE)))) { if (--maxcount < 0) break; memcpy((u->str+i), (str2->str), (str2->length)*sizeof(Py_UNICODE)); i += str1->length; } else i++; } } else { Py_ssize_t n, i, j, e; Py_ssize_t product, new_size, delta; Py_UNICODE *p; n = stringlib_count(self->str, self->length, str1->str, str1->length); if (n > maxcount) n = maxcount; if (n == 0) goto nothing; delta = (str2->length - str1->length); if (delta == 0) { new_size = self->length; } else { product = n * (str2->length - str1->length); if ((product / (str2->length - str1->length)) != n) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return ((void *)0); } new_size = self->length + product; if (new_size < 0) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return ((void *)0); } } u = _PyUnicode_New(new_size); if (!u) return ((void *)0); i = 0; p = u->str; e = self->length - str1->length; if (str1->length > 0) { while (n-- > 0) { j = i; while (j <= e) { if (((*((self)->str + (j)) == *((str1)->str)) && ((*((self)->str + (j) + (str1)->length-1) == *((str1)->str + (str1)->length-1))) && !memcmp((self)->str + (j), (str1)->str, (str1)->length*sizeof(Py_UNICODE)))) break; j++; } if (j > i) { if (j > e) break; memcpy((p), (self->str+i), (j-i)*sizeof(Py_UNICODE)); p += j - i; } if (str2->length > 0) { memcpy((p), (str2->str), (str2->length)*sizeof(Py_UNICODE)); p += str2->length; } i = j + str1->length; } if (i < self->length) memcpy((p), (self->str+i), (self->length-i)*sizeof(Py_UNICODE)); } else { while (n > 0) { memcpy((p), (str2->str), (str2->length)*sizeof(Py_UNICODE)); p += str2->length; if (--n <= 0) break; *p++ = self->str[i++]; } memcpy((p), (self->str+i), (self->length-i)*sizeof(Py_UNICODE)); } } return (PyObject *) u; nothing: if (((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject *) self; } return PyUnicodeUCS4_FromUnicode(self->str, self->length); } static char title__doc__[] = "S.title() -> unicode\n\nReturn a titlecased version of S, i.e. words start with title case\ncharacters, all remaining cased characters have lower case."; static PyObject* unicode_title(PyUnicodeObject *self) { return fixup(self, fixtitle); } static char capitalize__doc__[] = "S.capitalize() -> unicode\n\nReturn a capitalized version of S, i.e. make the first character\nhave upper case."; static PyObject* unicode_capitalize(PyUnicodeObject *self) { return fixup(self, fixcapitalize); } # 5261 "Objects/unicodeobject.c" static int convert_uc(PyObject *obj, void *addr) { Py_UNICODE *fillcharloc = (Py_UNICODE *)addr; PyObject *uniobj; Py_UNICODE *unistr; uniobj = PyUnicodeUCS4_FromObject(obj); if (uniobj == ((void *)0)) { PyErr_SetString(PyExc_TypeError, "The fill character cannot be converted to Unicode"); return 0; } if ((((PyUnicodeObject *)(uniobj))->length) != 1) { PyErr_SetString(PyExc_TypeError, "The fill character must be exactly one character long"); if ( --(uniobj)->ob_refcnt != 0) ; else ( (*((PyObject *)(uniobj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(uniobj)))); return 0; } unistr = (((PyUnicodeObject *)(uniobj))->str); *fillcharloc = unistr[0]; if ( --(uniobj)->ob_refcnt != 0) ; else ( (*((PyObject *)(uniobj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(uniobj)))); return 1; } static char center__doc__[] = "S.center(width[, fillchar]) -> unicode\n\nReturn S centered in a Unicode string of length width. Padding is\ndone using the specified fill character (default is a space)"; static PyObject * unicode_center(PyUnicodeObject *self, PyObject *args) { Py_ssize_t marg, left; Py_ssize_t width; Py_UNICODE fillchar = ' '; if (!_PyArg_ParseTuple_SizeT(args, "n|O&:center", &width, convert_uc, &fillchar)) return ((void *)0); if (self->length >= width && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject*) self; } marg = width - self->length; left = marg / 2 + (marg & width & 1); return (PyObject*) pad(self, left, marg - left, fillchar); } # 5365 "Objects/unicodeobject.c" static int unicode_compare(PyUnicodeObject *str1, PyUnicodeObject *str2) { register Py_ssize_t len1, len2; Py_UNICODE *s1 = str1->str; Py_UNICODE *s2 = str2->str; len1 = str1->length; len2 = str2->length; while (len1 > 0 && len2 > 0) { Py_UNICODE c1, c2; c1 = *s1++; c2 = *s2++; if (c1 != c2) return (c1 < c2) ? -1 : 1; len1--; len2--; } return (len1 < len2) ? -1 : (len1 != len2); } int PyUnicodeUCS4_Compare(PyObject *left, PyObject *right) { PyUnicodeObject *u = ((void *)0), *v = ((void *)0); int result; u = (PyUnicodeObject *)PyUnicodeUCS4_FromObject(left); if (u == ((void *)0)) goto onError; v = (PyUnicodeObject *)PyUnicodeUCS4_FromObject(right); if (v == ((void *)0)) goto onError; if (v == u) { if ( --(u)->ob_refcnt != 0) ; else ( (*((PyObject *)(u))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(u)))); if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return 0; } result = unicode_compare(u, v); if ( --(u)->ob_refcnt != 0) ; else ( (*((PyObject *)(u))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(u)))); if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return result; onError: if ((u) == ((void *)0)) ; else if ( --(u)->ob_refcnt != 0) ; else ( (*((PyObject *)(u))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(u)))); if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return -1; } PyObject *PyUnicodeUCS4_RichCompare(PyObject *left, PyObject *right, int op) { int result; result = PyUnicodeUCS4_Compare(left, right); if (result == -1 && PyErr_Occurred()) goto onError; switch (op) { case 2: result = (result == 0); break; case 3: result = (result != 0); break; case 1: result = (result <= 0); break; case 5: result = (result >= 0); break; case 0: result = (result == -1); break; case 4: result = (result == 1); break; } return PyBool_FromLong(result); onError: # 5471 "Objects/unicodeobject.c" if (PyErr_ExceptionMatches(PyExc_TypeError)) { PyErr_Clear(); ( ((&_Py_NotImplementedStruct))->ob_refcnt++); return (&_Py_NotImplementedStruct); } if (op != 2 && op != 3) return ((void *)0); if (!PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) return ((void *)0); PyErr_Clear(); if (PyErr_WarnEx(PyExc_UnicodeWarning, (op == 2) ? "Unicode equal comparison " "failed to convert both arguments to Unicode - " "interpreting them as being unequal" : "Unicode unequal comparison " "failed to convert both arguments to Unicode - " "interpreting them as being unequal", 1) < 0) # 5497 "Objects/unicodeobject.c" return ((void *)0); result = (op == 3); return PyBool_FromLong(result); } int PyUnicodeUCS4_Contains(PyObject *container, PyObject *element) { PyObject *str, *sub; int result; sub = PyUnicodeUCS4_FromObject(element); if (!sub) { PyErr_SetString(PyExc_TypeError, "'in ' requires string as left operand"); return -1; } str = PyUnicodeUCS4_FromObject(container); if (!str) { if ( --(sub)->ob_refcnt != 0) ; else ( (*((PyObject *)(sub))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sub)))); return -1; } result = stringlib_contains_obj(str, sub); if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); if ( --(sub)->ob_refcnt != 0) ; else ( (*((PyObject *)(sub))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sub)))); return result; } PyObject *PyUnicodeUCS4_Concat(PyObject *left, PyObject *right) { PyUnicodeObject *u = ((void *)0), *v = ((void *)0), *w; u = (PyUnicodeObject *)PyUnicodeUCS4_FromObject(left); if (u == ((void *)0)) goto onError; v = (PyUnicodeObject *)PyUnicodeUCS4_FromObject(right); if (v == ((void *)0)) goto onError; if (v == unicode_empty) { if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return (PyObject *)u; } if (u == unicode_empty) { if ( --(u)->ob_refcnt != 0) ; else ( (*((PyObject *)(u))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(u)))); return (PyObject *)v; } w = _PyUnicode_New(u->length + v->length); if (w == ((void *)0)) goto onError; memcpy((w->str), (u->str), (u->length)*sizeof(Py_UNICODE)); memcpy((w->str + u->length), (v->str), (v->length)*sizeof(Py_UNICODE)); if ( --(u)->ob_refcnt != 0) ; else ( (*((PyObject *)(u))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(u)))); if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return (PyObject *)w; onError: if ((u) == ((void *)0)) ; else if ( --(u)->ob_refcnt != 0) ; else ( (*((PyObject *)(u))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(u)))); if ((v) == ((void *)0)) ; else if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return ((void *)0); } static char count__doc__[] = "S.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of substring sub in\nUnicode string S[start:end]. Optional arguments start and end are\ninterpreted as in slice notation."; static PyObject * unicode_count(PyUnicodeObject *self, PyObject *args) { PyUnicodeObject *substring; Py_ssize_t start = 0; Py_ssize_t end = ((Py_ssize_t)(((size_t)-1)>>1)); PyObject *result; if (!_PyArg_ParseTuple_SizeT(args, "O|O&O&:count", &substring, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return ((void *)0); substring = (PyUnicodeObject *)PyUnicodeUCS4_FromObject( (PyObject *)substring); if (substring == ((void *)0)) return ((void *)0); if (start < 0) start += (self)->length; if (start < 0) start = 0; if (end > (self)->length) end = (self)->length; if (end < 0) end += (self)->length; if (end < 0) end = 0;; result = PyInt_FromSsize_t( stringlib_count(self->str + start, end - start, substring->str, substring->length) ); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); return result; } static char encode__doc__[] = "S.encode([encoding[,errors]]) -> string or unicode\n\nEncodes S using the codec registered for encoding. encoding defaults\nto the default encoding. errors may be given to set a different error\nhandling scheme. Default is 'strict' meaning that encoding errors raise\na UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n'xmlcharrefreplace' as well as any other name registered with\ncodecs.register_error that can handle UnicodeEncodeErrors."; # 5618 "Objects/unicodeobject.c" static PyObject * unicode_encode(PyUnicodeObject *self, PyObject *args) { char *encoding = ((void *)0); char *errors = ((void *)0); PyObject *v; if (!_PyArg_ParseTuple_SizeT(args, "|ss:encode", &encoding, &errors)) return ((void *)0); v = PyUnicodeUCS4_AsEncodedObject((PyObject *)self, encoding, errors); if (v == ((void *)0)) goto onError; if (!((v)->ob_type == (&PyString_Type) || PyType_IsSubtype((v)->ob_type, (&PyString_Type))) && !((v)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((v)->ob_type, (&PyUnicode_Type)))) { PyErr_Format(PyExc_TypeError, "encoder did not return a string/unicode object " "(type=%.400s)", v->ob_type->tp_name); if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return ((void *)0); } return v; onError: return ((void *)0); } static char decode__doc__[] = "S.decode([encoding[,errors]]) -> string or unicode\n\nDecodes S using the codec registered for encoding. encoding defaults\nto the default encoding. errors may be given to set a different error\nhandling scheme. Default is 'strict' meaning that encoding errors raise\na UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\nas well as any other name registerd with codecs.register_error that is\nable to handle UnicodeDecodeErrors."; # 5654 "Objects/unicodeobject.c" static PyObject * unicode_decode(PyUnicodeObject *self, PyObject *args) { char *encoding = ((void *)0); char *errors = ((void *)0); PyObject *v; if (!_PyArg_ParseTuple_SizeT(args, "|ss:decode", &encoding, &errors)) return ((void *)0); v = PyUnicode_AsDecodedObject((PyObject *)self, encoding, errors); if (v == ((void *)0)) goto onError; if (!((v)->ob_type == (&PyString_Type) || PyType_IsSubtype((v)->ob_type, (&PyString_Type))) && !((v)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((v)->ob_type, (&PyUnicode_Type)))) { PyErr_Format(PyExc_TypeError, "decoder did not return a string/unicode object " "(type=%.400s)", v->ob_type->tp_name); if ( --(v)->ob_refcnt != 0) ; else ( (*((PyObject *)(v))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v)))); return ((void *)0); } return v; onError: return ((void *)0); } static char expandtabs__doc__[] = "S.expandtabs([tabsize]) -> unicode\n\nReturn a copy of S where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed."; static PyObject* unicode_expandtabs(PyUnicodeObject *self, PyObject *args) { Py_UNICODE *e; Py_UNICODE *p; Py_UNICODE *q; Py_ssize_t i, j, old_j; PyUnicodeObject *u; int tabsize = 8; if (!_PyArg_ParseTuple_SizeT(args, "|i:expandtabs", &tabsize)) return ((void *)0); i = j = old_j = 0; e = self->str + self->length; for (p = self->str; p < e; p++) if (*p == '\t') { if (tabsize > 0) { j += tabsize - (j % tabsize); if (old_j > j) { PyErr_SetString(PyExc_OverflowError, "new string is too long"); return ((void *)0); } old_j = j; } } else { j++; if (*p == '\n' || *p == '\r') { i += j; old_j = j = 0; if (i < 0) { PyErr_SetString(PyExc_OverflowError, "new string is too long"); return ((void *)0); } } } if ((i + j) < 0) { PyErr_SetString(PyExc_OverflowError, "new string is too long"); return ((void *)0); } u = _PyUnicode_New(i + j); if (!u) return ((void *)0); j = 0; q = u->str; for (p = self->str; p < e; p++) if (*p == '\t') { if (tabsize > 0) { i = tabsize - (j % tabsize); j += i; while (i--) *q++ = ' '; } } else { j++; *q++ = *p; if (*p == '\n' || *p == '\r') j = 0; } return (PyObject*) u; } static char find__doc__[] = "S.find(sub [,start [,end]]) -> int\n\nReturn the lowest index in S where substring sub is found,\nsuch that sub is contained within s[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."; # 5768 "Objects/unicodeobject.c" static PyObject * unicode_find(PyUnicodeObject *self, PyObject *args) { PyObject *substring; Py_ssize_t start = 0; Py_ssize_t end = ((Py_ssize_t)(((size_t)-1)>>1)); Py_ssize_t result; if (!_PyArg_ParseTuple_SizeT(args, "O|O&O&:find", &substring, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return ((void *)0); substring = PyUnicodeUCS4_FromObject(substring); if (!substring) return ((void *)0); result = stringlib_find_slice( (((PyUnicodeObject *)(self))->str), (((PyUnicodeObject *)(self))->length), (((PyUnicodeObject *)(substring))->str), (((PyUnicodeObject *)(substring))->length), start, end ); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); return PyInt_FromSsize_t(result); } static PyObject * unicode_getitem(PyUnicodeObject *self, Py_ssize_t index) { if (index < 0 || index >= self->length) { PyErr_SetString(PyExc_IndexError, "string index out of range"); return ((void *)0); } return (PyObject*) PyUnicodeUCS4_FromUnicode(&self->str[index], 1); } static long unicode_hash(PyUnicodeObject *self) { register Py_ssize_t len; register Py_UNICODE *p; register long x; if (self->hash != -1) return self->hash; len = (((PyUnicodeObject *)(self))->length); p = (((PyUnicodeObject *)(self))->str); x = *p << 7; while (--len >= 0) x = (1000003*x) ^ *p++; x ^= (((PyUnicodeObject *)(self))->length); if (x == -1) x = -2; self->hash = x; return x; } static char index__doc__[] = "S.index(sub [,start [,end]]) -> int\n\nLike S.find() but raise ValueError when the substring is not found."; static PyObject * unicode_index(PyUnicodeObject *self, PyObject *args) { Py_ssize_t result; PyObject *substring; Py_ssize_t start = 0; Py_ssize_t end = ((Py_ssize_t)(((size_t)-1)>>1)); if (!_PyArg_ParseTuple_SizeT(args, "O|O&O&:index", &substring, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return ((void *)0); substring = PyUnicodeUCS4_FromObject(substring); if (!substring) return ((void *)0); result = stringlib_find_slice( (((PyUnicodeObject *)(self))->str), (((PyUnicodeObject *)(self))->length), (((PyUnicodeObject *)(substring))->str), (((PyUnicodeObject *)(substring))->length), start, end ); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); if (result < 0) { PyErr_SetString(PyExc_ValueError, "substring not found"); return ((void *)0); } return PyInt_FromSsize_t(result); } static char islower__doc__[] = "S.islower() -> bool\n\nReturn True if all cased characters in S are lowercase and there is\nat least one cased character in S, False otherwise."; static PyObject* unicode_islower(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; int cased; if ((((PyUnicodeObject *)(self))->length) == 1) return PyBool_FromLong(_PyUnicodeUCS4_IsLowercase(*p)); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); cased = 0; for (; p < e; p++) { register const Py_UNICODE ch = *p; if (_PyUnicodeUCS4_IsUppercase(ch) || _PyUnicodeUCS4_IsTitlecase(ch)) return PyBool_FromLong(0); else if (!cased && _PyUnicodeUCS4_IsLowercase(ch)) cased = 1; } return PyBool_FromLong(cased); } static char isupper__doc__[] = "S.isupper() -> bool\n\nReturn True if all cased characters in S are uppercase and there is\nat least one cased character in S, False otherwise."; static PyObject* unicode_isupper(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; int cased; if ((((PyUnicodeObject *)(self))->length) == 1) return PyBool_FromLong(_PyUnicodeUCS4_IsUppercase(*p) != 0); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); cased = 0; for (; p < e; p++) { register const Py_UNICODE ch = *p; if (_PyUnicodeUCS4_IsLowercase(ch) || _PyUnicodeUCS4_IsTitlecase(ch)) return PyBool_FromLong(0); else if (!cased && _PyUnicodeUCS4_IsUppercase(ch)) cased = 1; } return PyBool_FromLong(cased); } static char istitle__doc__[] = "S.istitle() -> bool\n\nReturn True if S is a titlecased string and there is at least one\ncharacter in S, i.e. upper- and titlecase characters may only\nfollow uncased characters and lowercase characters only cased ones.\nReturn False otherwise."; static PyObject* unicode_istitle(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; int cased, previous_is_cased; if ((((PyUnicodeObject *)(self))->length) == 1) return PyBool_FromLong((_PyUnicodeUCS4_IsTitlecase(*p) != 0) || (_PyUnicodeUCS4_IsUppercase(*p) != 0)); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); cased = 0; previous_is_cased = 0; for (; p < e; p++) { register const Py_UNICODE ch = *p; if (_PyUnicodeUCS4_IsUppercase(ch) || _PyUnicodeUCS4_IsTitlecase(ch)) { if (previous_is_cased) return PyBool_FromLong(0); previous_is_cased = 1; cased = 1; } else if (_PyUnicodeUCS4_IsLowercase(ch)) { if (!previous_is_cased) return PyBool_FromLong(0); previous_is_cased = 1; cased = 1; } else previous_is_cased = 0; } return PyBool_FromLong(cased); } static char isspace__doc__[] = "S.isspace() -> bool\n\nReturn True if all characters in S are whitespace\nand there is at least one character in S, False otherwise."; static PyObject* unicode_isspace(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; if ((((PyUnicodeObject *)(self))->length) == 1 && _PyUnicodeUCS4_IsWhitespace(*p)) return PyBool_FromLong(1); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); for (; p < e; p++) { if (!_PyUnicodeUCS4_IsWhitespace(*p)) return PyBool_FromLong(0); } return PyBool_FromLong(1); } static char isalpha__doc__[] = "S.isalpha() -> bool\n\nReturn True if all characters in S are alphabetic\nand there is at least one character in S, False otherwise."; static PyObject* unicode_isalpha(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; if ((((PyUnicodeObject *)(self))->length) == 1 && _PyUnicodeUCS4_IsAlpha(*p)) return PyBool_FromLong(1); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); for (; p < e; p++) { if (!_PyUnicodeUCS4_IsAlpha(*p)) return PyBool_FromLong(0); } return PyBool_FromLong(1); } static char isalnum__doc__[] = "S.isalnum() -> bool\n\nReturn True if all characters in S are alphanumeric\nand there is at least one character in S, False otherwise."; static PyObject* unicode_isalnum(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; if ((((PyUnicodeObject *)(self))->length) == 1 && (_PyUnicodeUCS4_IsAlpha(*p) || _PyUnicodeUCS4_IsDecimalDigit(*p) || _PyUnicodeUCS4_IsDigit(*p) || _PyUnicodeUCS4_IsNumeric(*p))) return PyBool_FromLong(1); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); for (; p < e; p++) { if (!(_PyUnicodeUCS4_IsAlpha(*p) || _PyUnicodeUCS4_IsDecimalDigit(*p) || _PyUnicodeUCS4_IsDigit(*p) || _PyUnicodeUCS4_IsNumeric(*p))) return PyBool_FromLong(0); } return PyBool_FromLong(1); } static char isdecimal__doc__[] = "S.isdecimal() -> bool\n\nReturn True if there are only decimal characters in S,\nFalse otherwise."; static PyObject* unicode_isdecimal(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; if ((((PyUnicodeObject *)(self))->length) == 1 && _PyUnicodeUCS4_IsDecimalDigit(*p)) return PyBool_FromLong(1); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); for (; p < e; p++) { if (!_PyUnicodeUCS4_IsDecimalDigit(*p)) return PyBool_FromLong(0); } return PyBool_FromLong(1); } static char isdigit__doc__[] = "S.isdigit() -> bool\n\nReturn True if all characters in S are digits\nand there is at least one character in S, False otherwise."; static PyObject* unicode_isdigit(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; if ((((PyUnicodeObject *)(self))->length) == 1 && _PyUnicodeUCS4_IsDigit(*p)) return PyBool_FromLong(1); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); for (; p < e; p++) { if (!_PyUnicodeUCS4_IsDigit(*p)) return PyBool_FromLong(0); } return PyBool_FromLong(1); } static char isnumeric__doc__[] = "S.isnumeric() -> bool\n\nReturn True if there are only numeric characters in S,\nFalse otherwise."; static PyObject* unicode_isnumeric(PyUnicodeObject *self) { register const Py_UNICODE *p = (((PyUnicodeObject *)(self))->str); register const Py_UNICODE *e; if ((((PyUnicodeObject *)(self))->length) == 1 && _PyUnicodeUCS4_IsNumeric(*p)) return PyBool_FromLong(1); if ((((PyUnicodeObject *)(self))->length) == 0) return PyBool_FromLong(0); e = p + (((PyUnicodeObject *)(self))->length); for (; p < e; p++) { if (!_PyUnicodeUCS4_IsNumeric(*p)) return PyBool_FromLong(0); } return PyBool_FromLong(1); } static char join__doc__[] = "S.join(sequence) -> unicode\n\nReturn a string which is the concatenation of the strings in the\nsequence. The separator between elements is S."; static PyObject* unicode_join(PyObject *self, PyObject *data) { return PyUnicodeUCS4_Join(self, data); } static Py_ssize_t unicode_length(PyUnicodeObject *self) { return self->length; } static char ljust__doc__[] = "S.ljust(width[, fillchar]) -> int\n\nReturn S left justified in a Unicode string of length width. Padding is\ndone using the specified fill character (default is a space)."; static PyObject * unicode_ljust(PyUnicodeObject *self, PyObject *args) { Py_ssize_t width; Py_UNICODE fillchar = ' '; if (!_PyArg_ParseTuple_SizeT(args, "n|O&:ljust", &width, convert_uc, &fillchar)) return ((void *)0); if (self->length >= width && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject*) self; } return (PyObject*) pad(self, 0, width - self->length, fillchar); } static char lower__doc__[] = "S.lower() -> unicode\n\nReturn a copy of the string S converted to lowercase."; static PyObject* unicode_lower(PyUnicodeObject *self) { return fixup(self, fixlower); } static const char *stripformat[] = {"|O:lstrip", "|O:rstrip", "|O:strip"}; PyObject * _PyUnicode_XStrip(PyUnicodeObject *self, int striptype, PyObject *sepobj) { Py_UNICODE *s = (((PyUnicodeObject *)(self))->str); Py_ssize_t len = (((PyUnicodeObject *)(self))->length); Py_UNICODE *sep = (((PyUnicodeObject *)(sepobj))->str); Py_ssize_t seplen = (((PyUnicodeObject *)(sepobj))->length); Py_ssize_t i, j; unsigned long sepmask = make_bloom_mask(sep, seplen); i = 0; if (striptype != 1) { while (i < len && ((sepmask & (1 << ((s[i]) & 0x1F)))) && unicode_member(s[i], sep, seplen)) { i++; } } j = len; if (striptype != 0) { do { j--; } while (j >= i && ((sepmask & (1 << ((s[j]) & 0x1F)))) && unicode_member(s[j], sep, seplen)); j++; } if (i == 0 && j == len && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject*)self; } else return PyUnicodeUCS4_FromUnicode(s+i, j-i); } static PyObject * do_strip(PyUnicodeObject *self, int striptype) { Py_UNICODE *s = (((PyUnicodeObject *)(self))->str); Py_ssize_t len = (((PyUnicodeObject *)(self))->length), i, j; i = 0; if (striptype != 1) { while (i < len && _PyUnicodeUCS4_IsWhitespace(s[i])) { i++; } } j = len; if (striptype != 0) { do { j--; } while (j >= i && _PyUnicodeUCS4_IsWhitespace(s[j])); j++; } if (i == 0 && j == len && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject*)self; } else return PyUnicodeUCS4_FromUnicode(s+i, j-i); } static PyObject * do_argstrip(PyUnicodeObject *self, int striptype, PyObject *args) { PyObject *sep = ((void *)0); if (!_PyArg_ParseTuple_SizeT(args, (char *)stripformat[striptype], &sep)) return ((void *)0); if (sep != ((void *)0) && sep != (&_Py_NoneStruct)) { if (((sep)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((sep)->ob_type, (&PyUnicode_Type)))) return _PyUnicode_XStrip(self, striptype, sep); else if (((sep)->ob_type == (&PyString_Type) || PyType_IsSubtype((sep)->ob_type, (&PyString_Type)))) { PyObject *res; sep = PyUnicodeUCS4_FromObject(sep); if (sep==((void *)0)) return ((void *)0); res = _PyUnicode_XStrip(self, striptype, sep); if ( --(sep)->ob_refcnt != 0) ; else ( (*((PyObject *)(sep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sep)))); return res; } else { PyErr_Format(PyExc_TypeError, "%s arg must be None, unicode or str", (stripformat[striptype]+3)); return ((void *)0); } } return do_strip(self, striptype); } static char strip__doc__[] = "S.strip([chars]) -> unicode\n\nReturn a copy of the string S with leading and trailing\nwhitespace removed.\nIf chars is given and not None, remove characters in chars instead.\nIf chars is a str, it will be converted to unicode before stripping"; static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) { if ((((PyTupleObject *)(args))->ob_size) == 0) return do_strip(self, 2); else return do_argstrip(self, 2, args); } static char lstrip__doc__[] = "S.lstrip([chars]) -> unicode\n\nReturn a copy of the string S with leading whitespace removed.\nIf chars is given and not None, remove characters in chars instead.\nIf chars is a str, it will be converted to unicode before stripping"; static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) { if ((((PyTupleObject *)(args))->ob_size) == 0) return do_strip(self, 0); else return do_argstrip(self, 0, args); } static char rstrip__doc__[] = "S.rstrip([chars]) -> unicode\n\nReturn a copy of the string S with trailing whitespace removed.\nIf chars is given and not None, remove characters in chars instead.\nIf chars is a str, it will be converted to unicode before stripping"; static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args) { if ((((PyTupleObject *)(args))->ob_size) == 0) return do_strip(self, 1); else return do_argstrip(self, 1, args); } static PyObject* unicode_repeat(PyUnicodeObject *str, Py_ssize_t len) { PyUnicodeObject *u; Py_UNICODE *p; Py_ssize_t nchars; size_t nbytes; if (len < 0) len = 0; if (len == 1 && ((str)->ob_type == &PyUnicode_Type)) { ( (str)->ob_refcnt++); return (PyObject*) str; } nchars = len * str->length; if (len && nchars / len != str->length) { PyErr_SetString(PyExc_OverflowError, "repeated string is too long"); return ((void *)0); } nbytes = (nchars + 1) * sizeof(Py_UNICODE); if (nbytes / sizeof(Py_UNICODE) != (size_t)(nchars + 1)) { PyErr_SetString(PyExc_OverflowError, "repeated string is too long"); return ((void *)0); } u = _PyUnicode_New(nchars); if (!u) return ((void *)0); p = u->str; if (str->length == 1 && len > 0) { do {Py_ssize_t i_; Py_UNICODE *t_ = (p); Py_UNICODE v_ = (str->str[0]); for (i_ = 0; i_ < (len); i_++) t_[i_] = v_; } while (0); } else { Py_ssize_t done = 0; if (done < nchars) { memcpy((p), (str->str), (str->length)*sizeof(Py_UNICODE)); done = str->length; } while (done < nchars) { int n = (done <= nchars-done) ? done : nchars-done; memcpy((p+done), (p), (n)*sizeof(Py_UNICODE)); done += n; } } return (PyObject*) u; } PyObject *PyUnicodeUCS4_Replace(PyObject *obj, PyObject *subobj, PyObject *replobj, Py_ssize_t maxcount) { PyObject *self; PyObject *str1; PyObject *str2; PyObject *result; self = PyUnicodeUCS4_FromObject(obj); if (self == ((void *)0)) return ((void *)0); str1 = PyUnicodeUCS4_FromObject(subobj); if (str1 == ((void *)0)) { if ( --(self)->ob_refcnt != 0) ; else ( (*((PyObject *)(self))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(self)))); return ((void *)0); } str2 = PyUnicodeUCS4_FromObject(replobj); if (str2 == ((void *)0)) { if ( --(self)->ob_refcnt != 0) ; else ( (*((PyObject *)(self))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(self)))); if ( --(str1)->ob_refcnt != 0) ; else ( (*((PyObject *)(str1))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str1)))); return ((void *)0); } result = replace((PyUnicodeObject *)self, (PyUnicodeObject *)str1, (PyUnicodeObject *)str2, maxcount); if ( --(self)->ob_refcnt != 0) ; else ( (*((PyObject *)(self))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(self)))); if ( --(str1)->ob_refcnt != 0) ; else ( (*((PyObject *)(str1))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str1)))); if ( --(str2)->ob_refcnt != 0) ; else ( (*((PyObject *)(str2))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str2)))); return result; } static char replace__doc__[] = "S.replace (old, new[, maxsplit]) -> unicode\n\nReturn a copy of S with all occurrences of substring\nold replaced by new. If the optional argument maxsplit is\ngiven, only the first maxsplit occurrences are replaced."; static PyObject* unicode_replace(PyUnicodeObject *self, PyObject *args) { PyUnicodeObject *str1; PyUnicodeObject *str2; Py_ssize_t maxcount = -1; PyObject *result; if (!_PyArg_ParseTuple_SizeT(args, "OO|n:replace", &str1, &str2, &maxcount)) return ((void *)0); str1 = (PyUnicodeObject *)PyUnicodeUCS4_FromObject((PyObject *)str1); if (str1 == ((void *)0)) return ((void *)0); str2 = (PyUnicodeObject *)PyUnicodeUCS4_FromObject((PyObject *)str2); if (str2 == ((void *)0)) { if ( --(str1)->ob_refcnt != 0) ; else ( (*((PyObject *)(str1))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str1)))); return ((void *)0); } result = replace(self, str1, str2, maxcount); if ( --(str1)->ob_refcnt != 0) ; else ( (*((PyObject *)(str1))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str1)))); if ( --(str2)->ob_refcnt != 0) ; else ( (*((PyObject *)(str2))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str2)))); return result; } static PyObject *unicode_repr(PyObject *unicode) { return unicodeescape_string((((PyUnicodeObject *)(unicode))->str), (((PyUnicodeObject *)(unicode))->length), 1); } static char rfind__doc__[] = "S.rfind(sub [,start [,end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within s[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."; # 6509 "Objects/unicodeobject.c" static PyObject * unicode_rfind(PyUnicodeObject *self, PyObject *args) { PyObject *substring; Py_ssize_t start = 0; Py_ssize_t end = ((Py_ssize_t)(((size_t)-1)>>1)); Py_ssize_t result; if (!_PyArg_ParseTuple_SizeT(args, "O|O&O&:rfind", &substring, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return ((void *)0); substring = PyUnicodeUCS4_FromObject(substring); if (!substring) return ((void *)0); result = stringlib_rfind_slice( (((PyUnicodeObject *)(self))->str), (((PyUnicodeObject *)(self))->length), (((PyUnicodeObject *)(substring))->str), (((PyUnicodeObject *)(substring))->length), start, end ); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); return PyInt_FromSsize_t(result); } static char rindex__doc__[] = "S.rindex(sub [,start [,end]]) -> int\n\nLike S.rfind() but raise ValueError when the substring is not found."; static PyObject * unicode_rindex(PyUnicodeObject *self, PyObject *args) { PyObject *substring; Py_ssize_t start = 0; Py_ssize_t end = ((Py_ssize_t)(((size_t)-1)>>1)); Py_ssize_t result; if (!_PyArg_ParseTuple_SizeT(args, "O|O&O&:rindex", &substring, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return ((void *)0); substring = PyUnicodeUCS4_FromObject(substring); if (!substring) return ((void *)0); result = stringlib_rfind_slice( (((PyUnicodeObject *)(self))->str), (((PyUnicodeObject *)(self))->length), (((PyUnicodeObject *)(substring))->str), (((PyUnicodeObject *)(substring))->length), start, end ); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); if (result < 0) { PyErr_SetString(PyExc_ValueError, "substring not found"); return ((void *)0); } return PyInt_FromSsize_t(result); } static char rjust__doc__[] = "S.rjust(width[, fillchar]) -> unicode\n\nReturn S right justified in a Unicode string of length width. Padding is\ndone using the specified fill character (default is a space)."; static PyObject * unicode_rjust(PyUnicodeObject *self, PyObject *args) { Py_ssize_t width; Py_UNICODE fillchar = ' '; if (!_PyArg_ParseTuple_SizeT(args, "n|O&:rjust", &width, convert_uc, &fillchar)) return ((void *)0); if (self->length >= width && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject*) self; } return (PyObject*) pad(self, width - self->length, 0, fillchar); } static PyObject* unicode_slice(PyUnicodeObject *self, Py_ssize_t start, Py_ssize_t end) { if (start < 0) start = 0; if (end < 0) end = 0; if (end > self->length) end = self->length; if (start == 0 && end == self->length && ((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject*) self; } if (start > end) start = end; return (PyObject*) PyUnicodeUCS4_FromUnicode(self->str + start, end - start); } PyObject *PyUnicodeUCS4_Split(PyObject *s, PyObject *sep, Py_ssize_t maxsplit) { PyObject *result; s = PyUnicodeUCS4_FromObject(s); if (s == ((void *)0)) return ((void *)0); if (sep != ((void *)0)) { sep = PyUnicodeUCS4_FromObject(sep); if (sep == ((void *)0)) { if ( --(s)->ob_refcnt != 0) ; else ( (*((PyObject *)(s))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(s)))); return ((void *)0); } } result = split((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); if ( --(s)->ob_refcnt != 0) ; else ( (*((PyObject *)(s))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(s)))); if ((sep) == ((void *)0)) ; else if ( --(sep)->ob_refcnt != 0) ; else ( (*((PyObject *)(sep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sep)))); return result; } static char split__doc__[] = "S.split([sep [,maxsplit]]) -> list of strings\n\nReturn a list of the words in S, using sep as the\ndelimiter string. If maxsplit is given, at most maxsplit\nsplits are done. If sep is not specified or is None,\nany whitespace string is a separator."; static PyObject* unicode_split(PyUnicodeObject *self, PyObject *args) { PyObject *substring = (&_Py_NoneStruct); Py_ssize_t maxcount = -1; if (!_PyArg_ParseTuple_SizeT(args, "|On:split", &substring, &maxcount)) return ((void *)0); if (substring == (&_Py_NoneStruct)) return split(self, ((void *)0), maxcount); else if (((substring)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((substring)->ob_type, (&PyUnicode_Type)))) return split(self, (PyUnicodeObject *)substring, maxcount); else return PyUnicodeUCS4_Split((PyObject *)self, substring, maxcount); } PyObject * PyUnicodeUCS4_Partition(PyObject *str_in, PyObject *sep_in) { PyObject* str_obj; PyObject* sep_obj; PyObject* out; str_obj = PyUnicodeUCS4_FromObject(str_in); if (!str_obj) return ((void *)0); sep_obj = PyUnicodeUCS4_FromObject(sep_in); if (!sep_obj) { if ( --(str_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(str_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str_obj)))); return ((void *)0); } out = stringlib_partition( str_obj, (((PyUnicodeObject *)(str_obj))->str), (((PyUnicodeObject *)(str_obj))->length), sep_obj, (((PyUnicodeObject *)(sep_obj))->str), (((PyUnicodeObject *)(sep_obj))->length) ); if ( --(sep_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(sep_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sep_obj)))); if ( --(str_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(str_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str_obj)))); return out; } PyObject * PyUnicodeUCS4_RPartition(PyObject *str_in, PyObject *sep_in) { PyObject* str_obj; PyObject* sep_obj; PyObject* out; str_obj = PyUnicodeUCS4_FromObject(str_in); if (!str_obj) return ((void *)0); sep_obj = PyUnicodeUCS4_FromObject(sep_in); if (!sep_obj) { if ( --(str_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(str_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str_obj)))); return ((void *)0); } out = stringlib_rpartition( str_obj, (((PyUnicodeObject *)(str_obj))->str), (((PyUnicodeObject *)(str_obj))->length), sep_obj, (((PyUnicodeObject *)(sep_obj))->str), (((PyUnicodeObject *)(sep_obj))->length) ); if ( --(sep_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(sep_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sep_obj)))); if ( --(str_obj)->ob_refcnt != 0) ; else ( (*((PyObject *)(str_obj))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str_obj)))); return out; } static char partition__doc__[] = "S.partition(sep) -> (head, sep, tail)\n\nSearches for the separator sep in S, and returns the part before it,\nthe separator itself, and the part after it. If the separator is not\nfound, returns S and two empty strings."; static PyObject* unicode_partition(PyUnicodeObject *self, PyObject *separator) { return PyUnicodeUCS4_Partition((PyObject *)self, separator); } static char rpartition__doc__[] = "S.rpartition(sep) -> (tail, sep, head)\n\nSearches for the separator sep in S, starting at the end of S, and returns\nthe part before it, the separator itself, and the part after it. If the\nseparator is not found, returns two empty strings and S."; static PyObject* unicode_rpartition(PyUnicodeObject *self, PyObject *separator) { return PyUnicodeUCS4_RPartition((PyObject *)self, separator); } PyObject *PyUnicodeUCS4_RSplit(PyObject *s, PyObject *sep, Py_ssize_t maxsplit) { PyObject *result; s = PyUnicodeUCS4_FromObject(s); if (s == ((void *)0)) return ((void *)0); if (sep != ((void *)0)) { sep = PyUnicodeUCS4_FromObject(sep); if (sep == ((void *)0)) { if ( --(s)->ob_refcnt != 0) ; else ( (*((PyObject *)(s))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(s)))); return ((void *)0); } } result = rsplit((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); if ( --(s)->ob_refcnt != 0) ; else ( (*((PyObject *)(s))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(s)))); if ((sep) == ((void *)0)) ; else if ( --(sep)->ob_refcnt != 0) ; else ( (*((PyObject *)(sep))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(sep)))); return result; } static char rsplit__doc__[] = "S.rsplit([sep [,maxsplit]]) -> list of strings\n\nReturn a list of the words in S, using sep as the\ndelimiter string, starting at the end of the string and\nworking to the front. If maxsplit is given, at most maxsplit\nsplits are done. If sep is not specified, any whitespace string\nis a separator."; # 6778 "Objects/unicodeobject.c" static PyObject* unicode_rsplit(PyUnicodeObject *self, PyObject *args) { PyObject *substring = (&_Py_NoneStruct); Py_ssize_t maxcount = -1; if (!_PyArg_ParseTuple_SizeT(args, "|On:rsplit", &substring, &maxcount)) return ((void *)0); if (substring == (&_Py_NoneStruct)) return rsplit(self, ((void *)0), maxcount); else if (((substring)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((substring)->ob_type, (&PyUnicode_Type)))) return rsplit(self, (PyUnicodeObject *)substring, maxcount); else return PyUnicodeUCS4_RSplit((PyObject *)self, substring, maxcount); } static char splitlines__doc__[] = "S.splitlines([keepends]]) -> list of strings\n\nReturn a list of the lines in S, breaking at line boundaries.\nLine breaks are not included in the resulting list unless keepends\nis given and true."; static PyObject* unicode_splitlines(PyUnicodeObject *self, PyObject *args) { int keepends = 0; if (!_PyArg_ParseTuple_SizeT(args, "|i:splitlines", &keepends)) return ((void *)0); return PyUnicodeUCS4_Splitlines((PyObject *)self, keepends); } static PyObject *unicode_str(PyUnicodeObject *self) { return PyUnicodeUCS4_AsEncodedString((PyObject *)self, ((void *)0), ((void *)0)); } static char swapcase__doc__[] = "S.swapcase() -> unicode\n\nReturn a copy of S with uppercase characters converted to lowercase\nand vice versa."; static PyObject* unicode_swapcase(PyUnicodeObject *self) { return fixup(self, fixswapcase); } static char translate__doc__[] = "S.translate(table) -> unicode\n\nReturn a copy of the string S, where all characters have been mapped\nthrough the given translation table, which must be a mapping of\nUnicode ordinals to Unicode ordinals, Unicode strings or None.\nUnmapped characters are left untouched. Characters mapped to None\nare deleted."; # 6840 "Objects/unicodeobject.c" static PyObject* unicode_translate(PyUnicodeObject *self, PyObject *table) { return PyUnicodeUCS4_TranslateCharmap(self->str, self->length, table, "ignore"); } static char upper__doc__[] = "S.upper() -> unicode\n\nReturn a copy of S converted to uppercase."; static PyObject* unicode_upper(PyUnicodeObject *self) { return fixup(self, fixupper); } static char zfill__doc__[] = "S.zfill(width) -> unicode\n\nPad a numeric string x with zeros on the left, to fill a field\nof the specified width. The string x is never truncated."; static PyObject * unicode_zfill(PyUnicodeObject *self, PyObject *args) { Py_ssize_t fill; PyUnicodeObject *u; Py_ssize_t width; if (!_PyArg_ParseTuple_SizeT(args, "n:zfill", &width)) return ((void *)0); if (self->length >= width) { if (((self)->ob_type == &PyUnicode_Type)) { ( (self)->ob_refcnt++); return (PyObject*) self; } else return PyUnicodeUCS4_FromUnicode( (((PyUnicodeObject *)(self))->str), (((PyUnicodeObject *)(self))->length) ); } fill = width - self->length; u = pad(self, fill, 0, '0'); if (u == ((void *)0)) return ((void *)0); if (u->str[fill] == '+' || u->str[fill] == '-') { u->str[0] = u->str[fill]; u->str[fill] = '0'; } return (PyObject*) u; } # 6912 "Objects/unicodeobject.c" static char startswith__doc__[] = "S.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if S starts with the specified prefix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nprefix can also be a tuple of strings to try."; static PyObject * unicode_startswith(PyUnicodeObject *self, PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; Py_ssize_t start = 0; Py_ssize_t end = ((Py_ssize_t)(((size_t)-1)>>1)); int result; if (!_PyArg_ParseTuple_SizeT(args, "O|O&O&:startswith", &subobj, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return ((void *)0); if (((subobj)->ob_type == (&PyTuple_Type) || PyType_IsSubtype((subobj)->ob_type, (&PyTuple_Type)))) { Py_ssize_t i; for (i = 0; i < (((PyTupleObject *)(subobj))->ob_size); i++) { substring = (PyUnicodeObject *)PyUnicodeUCS4_FromObject( (((PyTupleObject *)(subobj))->ob_item[i])); if (substring == ((void *)0)) return ((void *)0); result = tailmatch(self, substring, start, end, -1); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); if (result) { return ( (((PyObject *) &_Py_TrueStruct))->ob_refcnt++), ((PyObject *) &_Py_TrueStruct); } } return ( (((PyObject *) &_Py_ZeroStruct))->ob_refcnt++), ((PyObject *) &_Py_ZeroStruct); } substring = (PyUnicodeObject *)PyUnicodeUCS4_FromObject(subobj); if (substring == ((void *)0)) return ((void *)0); result = tailmatch(self, substring, start, end, -1); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); return PyBool_FromLong(result); } static char endswith__doc__[] = "S.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if S ends with the specified suffix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nsuffix can also be a tuple of strings to try."; static PyObject * unicode_endswith(PyUnicodeObject *self, PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; Py_ssize_t start = 0; Py_ssize_t end = ((Py_ssize_t)(((size_t)-1)>>1)); int result; if (!_PyArg_ParseTuple_SizeT(args, "O|O&O&:endswith", &subobj, _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return ((void *)0); if (((subobj)->ob_type == (&PyTuple_Type) || PyType_IsSubtype((subobj)->ob_type, (&PyTuple_Type)))) { Py_ssize_t i; for (i = 0; i < (((PyTupleObject *)(subobj))->ob_size); i++) { substring = (PyUnicodeObject *)PyUnicodeUCS4_FromObject( (((PyTupleObject *)(subobj))->ob_item[i])); if (substring == ((void *)0)) return ((void *)0); result = tailmatch(self, substring, start, end, +1); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); if (result) { return ( (((PyObject *) &_Py_TrueStruct))->ob_refcnt++), ((PyObject *) &_Py_TrueStruct); } } return ( (((PyObject *) &_Py_ZeroStruct))->ob_refcnt++), ((PyObject *) &_Py_ZeroStruct); } substring = (PyUnicodeObject *)PyUnicodeUCS4_FromObject(subobj); if (substring == ((void *)0)) return ((void *)0); result = tailmatch(self, substring, start, end, +1); if ( --(substring)->ob_refcnt != 0) ; else ( (*((PyObject *)(substring))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(substring)))); return PyBool_FromLong(result); } static PyObject * unicode_getnewargs(PyUnicodeObject *v) { return _Py_BuildValue_SizeT("(u#)", v->str, v->length); } static PyMethodDef unicode_methods[] = { {"encode", (PyCFunction) unicode_encode, 0x0001, encode__doc__}, {"replace", (PyCFunction) unicode_replace, 0x0001, replace__doc__}, {"split", (PyCFunction) unicode_split, 0x0001, split__doc__}, {"rsplit", (PyCFunction) unicode_rsplit, 0x0001, rsplit__doc__}, {"join", (PyCFunction) unicode_join, 0x0008, join__doc__}, {"capitalize", (PyCFunction) unicode_capitalize, 0x0004, capitalize__doc__}, {"title", (PyCFunction) unicode_title, 0x0004, title__doc__}, {"center", (PyCFunction) unicode_center, 0x0001, center__doc__}, {"count", (PyCFunction) unicode_count, 0x0001, count__doc__}, {"expandtabs", (PyCFunction) unicode_expandtabs, 0x0001, expandtabs__doc__}, {"find", (PyCFunction) unicode_find, 0x0001, find__doc__}, {"partition", (PyCFunction) unicode_partition, 0x0008, partition__doc__}, {"index", (PyCFunction) unicode_index, 0x0001, index__doc__}, {"ljust", (PyCFunction) unicode_ljust, 0x0001, ljust__doc__}, {"lower", (PyCFunction) unicode_lower, 0x0004, lower__doc__}, {"lstrip", (PyCFunction) unicode_lstrip, 0x0001, lstrip__doc__}, {"decode", (PyCFunction) unicode_decode, 0x0001, decode__doc__}, {"rfind", (PyCFunction) unicode_rfind, 0x0001, rfind__doc__}, {"rindex", (PyCFunction) unicode_rindex, 0x0001, rindex__doc__}, {"rjust", (PyCFunction) unicode_rjust, 0x0001, rjust__doc__}, {"rstrip", (PyCFunction) unicode_rstrip, 0x0001, rstrip__doc__}, {"rpartition", (PyCFunction) unicode_rpartition, 0x0008, rpartition__doc__}, {"splitlines", (PyCFunction) unicode_splitlines, 0x0001, splitlines__doc__}, {"strip", (PyCFunction) unicode_strip, 0x0001, strip__doc__}, {"swapcase", (PyCFunction) unicode_swapcase, 0x0004, swapcase__doc__}, {"translate", (PyCFunction) unicode_translate, 0x0008, translate__doc__}, {"upper", (PyCFunction) unicode_upper, 0x0004, upper__doc__}, {"startswith", (PyCFunction) unicode_startswith, 0x0001, startswith__doc__}, {"endswith", (PyCFunction) unicode_endswith, 0x0001, endswith__doc__}, {"islower", (PyCFunction) unicode_islower, 0x0004, islower__doc__}, {"isupper", (PyCFunction) unicode_isupper, 0x0004, isupper__doc__}, {"istitle", (PyCFunction) unicode_istitle, 0x0004, istitle__doc__}, {"isspace", (PyCFunction) unicode_isspace, 0x0004, isspace__doc__}, {"isdecimal", (PyCFunction) unicode_isdecimal, 0x0004, isdecimal__doc__}, {"isdigit", (PyCFunction) unicode_isdigit, 0x0004, isdigit__doc__}, {"isnumeric", (PyCFunction) unicode_isnumeric, 0x0004, isnumeric__doc__}, {"isalpha", (PyCFunction) unicode_isalpha, 0x0004, isalpha__doc__}, {"isalnum", (PyCFunction) unicode_isalnum, 0x0004, isalnum__doc__}, {"zfill", (PyCFunction) unicode_zfill, 0x0001, zfill__doc__}, # 7066 "Objects/unicodeobject.c" {"__getnewargs__", (PyCFunction)unicode_getnewargs, 0x0004}, {((void *)0), ((void *)0)} }; static PyObject * unicode_mod(PyObject *v, PyObject *w) { if (!((v)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((v)->ob_type, (&PyUnicode_Type)))) { ( ((&_Py_NotImplementedStruct))->ob_refcnt++); return (&_Py_NotImplementedStruct); } return PyUnicodeUCS4_Format(v, w); } static PyNumberMethods unicode_as_number = { 0, 0, 0, 0, unicode_mod, }; static PySequenceMethods unicode_as_sequence = { (lenfunc) unicode_length, PyUnicodeUCS4_Concat, (ssizeargfunc) unicode_repeat, (ssizeargfunc) unicode_getitem, (ssizessizeargfunc) unicode_slice, 0, 0, PyUnicodeUCS4_Contains, }; static PyObject* unicode_subscript(PyUnicodeObject* self, PyObject* item) { if (((item)->ob_type->tp_as_number != ((void *)0) && ((((item)->ob_type)->tp_flags & ((1L<<17))) != 0) && (item)->ob_type->tp_as_number->nb_index != ((void *)0))) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return ((void *)0); if (i < 0) i += (((PyUnicodeObject *)(self))->length); return unicode_getitem(self, i); } else if (((item)->ob_type == &PySlice_Type)) { Py_ssize_t start, stop, step, slicelength, cur, i; Py_UNICODE* source_buf; Py_UNICODE* result_buf; PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, (((PyUnicodeObject *)(self))->length), &start, &stop, &step, &slicelength) < 0) { return ((void *)0); } if (slicelength <= 0) { return PyUnicodeUCS4_FromUnicode(((void *)0), 0); } else { source_buf = (((PyUnicodeObject *)((PyObject*)self))->str); result_buf = (Py_UNICODE *)malloc((slicelength* sizeof(Py_UNICODE)) ? (slicelength* sizeof(Py_UNICODE)) : 1); if (result_buf == ((void *)0)) return PyErr_NoMemory(); for (cur = start, i = 0; i < slicelength; cur += step, i++) { result_buf[i] = source_buf[cur]; } result = PyUnicodeUCS4_FromUnicode(result_buf, slicelength); free(result_buf); return result; } } else { PyErr_SetString(PyExc_TypeError, "string indices must be integers"); return ((void *)0); } } static PyMappingMethods unicode_as_mapping = { (lenfunc)unicode_length, (binaryfunc)unicode_subscript, (objobjargproc)0, }; static Py_ssize_t unicode_buffer_getreadbuf(PyUnicodeObject *self, Py_ssize_t index, const void **ptr) { if (index != 0) { PyErr_SetString(PyExc_SystemError, "accessing non-existent unicode segment"); return -1; } *ptr = (void *) self->str; return (((PyUnicodeObject *)(self))->length * sizeof(Py_UNICODE)); } static Py_ssize_t unicode_buffer_getwritebuf(PyUnicodeObject *self, Py_ssize_t index, const void **ptr) { PyErr_SetString(PyExc_TypeError, "cannot use unicode as modifiable buffer"); return -1; } static int unicode_buffer_getsegcount(PyUnicodeObject *self, Py_ssize_t *lenp) { if (lenp) *lenp = (((PyUnicodeObject *)(self))->length * sizeof(Py_UNICODE)); return 1; } static Py_ssize_t unicode_buffer_getcharbuf(PyUnicodeObject *self, Py_ssize_t index, const void **ptr) { PyObject *str; if (index != 0) { PyErr_SetString(PyExc_SystemError, "accessing non-existent unicode segment"); return -1; } str = _PyUnicodeUCS4_AsDefaultEncodedString((PyObject *)self, ((void *)0)); if (str == ((void *)0)) return -1; *ptr = (void *) (((PyStringObject *)(str))->ob_sval); return (((PyStringObject *)(str))->ob_size); } static PyObject * getnextarg(PyObject *args, Py_ssize_t arglen, Py_ssize_t *p_argidx) { Py_ssize_t argidx = *p_argidx; if (argidx < arglen) { (*p_argidx)++; if (arglen < 0) return args; else return PyTuple_GetItem(args, argidx); } PyErr_SetString(PyExc_TypeError, "not enough arguments for format string"); return ((void *)0); } static Py_ssize_t strtounicode(Py_UNICODE *buffer, const char *charbuffer) { register Py_ssize_t i; Py_ssize_t len = strlen(charbuffer); for (i = len - 1; i >= 0; i--) buffer[i] = (Py_UNICODE) charbuffer[i]; return len; } static int doubletounicode(Py_UNICODE *buffer, size_t len, const char *format, double x) { Py_ssize_t result; PyOS_ascii_formatd((char *)buffer, len, format, x); result = strtounicode(buffer, (char *)buffer); return (int)(result); } static int longtounicode(Py_UNICODE *buffer, size_t len, const char *format, long x) { Py_ssize_t result; PyOS_snprintf((char *)buffer, len, format, x); result = strtounicode(buffer, (char *)buffer); return (int)(result); } static int formatfloat(Py_UNICODE *buf, size_t buflen, int flags, int prec, int type, PyObject *v) { char fmt[20]; double x; x = PyFloat_AsDouble(v); if (x == -1.0 && PyErr_Occurred()) return -1; if (prec < 0) prec = 6; if (type == 'f' && (fabs(x) / 1e25) >= 1e25) type = 'g'; # 7296 "Objects/unicodeobject.c" if (((type == 'g' || type == 'G') && buflen <= (size_t)10 + (size_t)prec) || (type == 'f' && buflen <= (size_t)53 + (size_t)prec)) { PyErr_SetString(PyExc_OverflowError, "formatted float is too long (precision too large?)"); return -1; } PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%d%c", (flags&(1<<3)) ? "#" : "", prec, type); return doubletounicode(buf, buflen, fmt, x); } static PyObject* formatlong(PyObject *val, int flags, int prec, int type) { char *buf; int i, len; PyObject *str; PyUnicodeObject *result; str = _PyString_FormatLong(val, flags, prec, type, &buf, &len); if (!str) return ((void *)0); result = _PyUnicode_New(len); if (!result) { if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); return ((void *)0); } for (i = 0; i < len; i++) result->str[i] = buf[i]; result->str[len] = 0; if ( --(str)->ob_refcnt != 0) ; else ( (*((PyObject *)(str))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(str)))); return (PyObject*)result; } static int formatint(Py_UNICODE *buf, size_t buflen, int flags, int prec, int type, PyObject *v) { char fmt[64]; char *sign; long x; x = PyInt_AsLong(v); if (x == -1 && PyErr_Occurred()) return -1; if (x < 0 && type == 'u') { type = 'd'; } if (x < 0 && (type == 'x' || type == 'X' || type == 'o')) sign = "-"; else sign = ""; if (prec < 0) prec = 1; if (buflen <= 14 || buflen <= (size_t)3 + (size_t)prec) { PyErr_SetString(PyExc_OverflowError, "formatted integer is too long (precision too large?)"); return -1; } if ((flags & (1<<3)) && (type == 'x' || type == 'X')) { # 7393 "Objects/unicodeobject.c" PyOS_snprintf(fmt, sizeof(fmt), "%s0%c%%.%dl%c", sign, type, prec, type); } else { PyOS_snprintf(fmt, sizeof(fmt), "%s%%%s.%dl%c", sign, (flags&(1<<3)) ? "#" : "", prec, type); } if (sign[0]) return longtounicode(buf, buflen, fmt, -x); else return longtounicode(buf, buflen, fmt, x); } static int formatchar(Py_UNICODE *buf, size_t buflen, PyObject *v) { if (((v)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((v)->ob_type, (&PyUnicode_Type)))) { if ((((PyUnicodeObject *)(v))->length) != 1) goto onError; buf[0] = (((PyUnicodeObject *)(v))->str)[0]; } else if (((v)->ob_type == (&PyString_Type) || PyType_IsSubtype((v)->ob_type, (&PyString_Type)))) { if ((((PyStringObject *)(v))->ob_size) != 1) goto onError; buf[0] = (Py_UNICODE)(((PyStringObject *)(v))->ob_sval)[0]; } else { long x; x = PyInt_AsLong(v); if (x == -1 && PyErr_Occurred()) goto onError; if (x < 0 || x > 0x10ffff) { PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000) " "(wide Python build)"); return -1; } # 7446 "Objects/unicodeobject.c" buf[0] = (Py_UNICODE) x; } buf[1] = '\0'; return 1; onError: PyErr_SetString(PyExc_TypeError, "%c requires int or char"); return -1; } # 7467 "Objects/unicodeobject.c" PyObject *PyUnicodeUCS4_Format(PyObject *format, PyObject *args) { Py_UNICODE *fmt, *res; Py_ssize_t fmtcnt, rescnt, reslen, arglen, argidx; int args_owned = 0; PyUnicodeObject *result = ((void *)0); PyObject *dict = ((void *)0); PyObject *uformat; if (format == ((void *)0) || args == ((void *)0)) { _PyErr_BadInternalCall("Objects/unicodeobject.c", 7478); return ((void *)0); } uformat = PyUnicodeUCS4_FromObject(format); if (uformat == ((void *)0)) return ((void *)0); fmt = (((PyUnicodeObject *)(uformat))->str); fmtcnt = (((PyUnicodeObject *)(uformat))->length); reslen = rescnt = fmtcnt + 100; result = _PyUnicode_New(reslen); if (result == ((void *)0)) goto onError; res = (((PyUnicodeObject *)(result))->str); if (((args)->ob_type == (&PyTuple_Type) || PyType_IsSubtype((args)->ob_type, (&PyTuple_Type)))) { arglen = PyTuple_Size(args); argidx = 0; } else { arglen = -1; argidx = -2; } if (args->ob_type->tp_as_mapping && !((args)->ob_type == (&PyTuple_Type) || PyType_IsSubtype((args)->ob_type, (&PyTuple_Type))) && !((args)->ob_type == (&PyBaseString_Type) || PyType_IsSubtype((args)->ob_type, (&PyBaseString_Type)))) dict = args; while (--fmtcnt >= 0) { if (*fmt != '%') { if (--rescnt < 0) { rescnt = fmtcnt + 100; reslen += rescnt; if (PyUnicodeUCS4_Resize(((PyObject **)(&result)), reslen) < 0) goto onError; res = (((PyUnicodeObject *)(result))->str) + reslen - rescnt; --rescnt; } *res++ = *fmt++; } else { int flags = 0; Py_ssize_t width = -1; int prec = -1; Py_UNICODE c = '\0'; Py_UNICODE fill; PyObject *v = ((void *)0); PyObject *temp = ((void *)0); Py_UNICODE *pbuf; Py_UNICODE sign; Py_ssize_t len; Py_UNICODE formatbuf[(size_t)120]; fmt++; if (*fmt == '(') { Py_UNICODE *keystart; Py_ssize_t keylen; PyObject *key; int pcount = 1; if (dict == ((void *)0)) { PyErr_SetString(PyExc_TypeError, "format requires a mapping"); goto onError; } ++fmt; --fmtcnt; keystart = fmt; while (pcount > 0 && --fmtcnt >= 0) { if (*fmt == ')') --pcount; else if (*fmt == '(') ++pcount; fmt++; } keylen = fmt - keystart - 1; if (fmtcnt < 0 || pcount > 0) { PyErr_SetString(PyExc_ValueError, "incomplete format key"); goto onError; } # 7569 "Objects/unicodeobject.c" key = PyUnicodeUCS4_FromUnicode(keystart, keylen); if (key == ((void *)0)) goto onError; if (args_owned) { if ( --(args)->ob_refcnt != 0) ; else ( (*((PyObject *)(args))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(args)))); args_owned = 0; } args = PyObject_GetItem(dict, key); if ( --(key)->ob_refcnt != 0) ; else ( (*((PyObject *)(key))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(key)))); if (args == ((void *)0)) { goto onError; } args_owned = 1; arglen = -1; argidx = -2; } while (--fmtcnt >= 0) { switch (c = *fmt++) { case '-': flags |= (1<<0); continue; case '+': flags |= (1<<1); continue; case ' ': flags |= (1<<2); continue; case '#': flags |= (1<<3); continue; case '0': flags |= (1<<4); continue; } break; } if (c == '*') { v = getnextarg(args, arglen, &argidx); if (v == ((void *)0)) goto onError; if (!((v)->ob_type == (&PyInt_Type) || PyType_IsSubtype((v)->ob_type, (&PyInt_Type)))) { PyErr_SetString(PyExc_TypeError, "* wants int"); goto onError; } width = PyInt_AsLong(v); if (width < 0) { flags |= (1<<0); width = -width; } if (--fmtcnt >= 0) c = *fmt++; } else if (c >= '0' && c <= '9') { width = c - '0'; while (--fmtcnt >= 0) { c = *fmt++; if (c < '0' || c > '9') break; if ((width*10) / 10 != width) { PyErr_SetString(PyExc_ValueError, "width too big"); goto onError; } width = width*10 + (c - '0'); } } if (c == '.') { prec = 0; if (--fmtcnt >= 0) c = *fmt++; if (c == '*') { v = getnextarg(args, arglen, &argidx); if (v == ((void *)0)) goto onError; if (!((v)->ob_type == (&PyInt_Type) || PyType_IsSubtype((v)->ob_type, (&PyInt_Type)))) { PyErr_SetString(PyExc_TypeError, "* wants int"); goto onError; } prec = PyInt_AsLong(v); if (prec < 0) prec = 0; if (--fmtcnt >= 0) c = *fmt++; } else if (c >= '0' && c <= '9') { prec = c - '0'; while (--fmtcnt >= 0) { c = ((*fmt++) & 0xff); if (c < '0' || c > '9') break; if ((prec*10) / 10 != prec) { PyErr_SetString(PyExc_ValueError, "prec too big"); goto onError; } prec = prec*10 + (c - '0'); } } } if (fmtcnt >= 0) { if (c == 'h' || c == 'l' || c == 'L') { if (--fmtcnt >= 0) c = *fmt++; } } if (fmtcnt < 0) { PyErr_SetString(PyExc_ValueError, "incomplete format"); goto onError; } if (c != '%') { v = getnextarg(args, arglen, &argidx); if (v == ((void *)0)) goto onError; } sign = 0; fill = ' '; switch (c) { case '%': pbuf = formatbuf; pbuf[0] = '%'; len = 1; break; case 's': case 'r': if (((v)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((v)->ob_type, (&PyUnicode_Type))) && c == 's') { temp = v; ( (temp)->ob_refcnt++); } else { PyObject *unicode; if (c == 's') temp = PyObject_Unicode(v); else temp = PyObject_Repr(v); if (temp == ((void *)0)) goto onError; if (((temp)->ob_type == (&PyUnicode_Type) || PyType_IsSubtype((temp)->ob_type, (&PyUnicode_Type)))) ; else if (((temp)->ob_type == (&PyString_Type) || PyType_IsSubtype((temp)->ob_type, (&PyString_Type)))) { unicode = PyUnicodeUCS4_Decode((((PyStringObject *)(temp))->ob_sval), (((PyStringObject *)(temp))->ob_size), ((void *)0), "strict"); if ( --(temp)->ob_refcnt != 0) ; else ( (*((PyObject *)(temp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(temp)))); temp = unicode; if (temp == ((void *)0)) goto onError; } else { if ( --(temp)->ob_refcnt != 0) ; else ( (*((PyObject *)(temp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(temp)))); PyErr_SetString(PyExc_TypeError, "%s argument has non-string str()"); goto onError; } } pbuf = (((PyUnicodeObject *)(temp))->str); len = (((PyUnicodeObject *)(temp))->length); if (prec >= 0 && len > prec) len = prec; break; case 'i': case 'd': case 'u': case 'o': case 'x': case 'X': if (c == 'i') c = 'd'; if (((v)->ob_type == (&PyLong_Type) || PyType_IsSubtype((v)->ob_type, (&PyLong_Type)))) { temp = formatlong(v, flags, prec, c); if (!temp) goto onError; pbuf = (((PyUnicodeObject *)(temp))->str); len = (((PyUnicodeObject *)(temp))->length); sign = 1; } else { pbuf = formatbuf; len = formatint(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), flags, prec, c, v); if (len < 0) goto onError; sign = 1; } if (flags & (1<<4)) fill = '0'; break; case 'e': case 'E': case 'f': case 'F': case 'g': case 'G': if (c == 'F') c = 'f'; pbuf = formatbuf; len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), flags, prec, c, v); if (len < 0) goto onError; sign = 1; if (flags & (1<<4)) fill = '0'; break; case 'c': pbuf = formatbuf; len = formatchar(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), v); if (len < 0) goto onError; break; default: PyErr_Format(PyExc_ValueError, "unsupported format character '%c' (0x%x) " "at index %zd", (31<=c && c<=126) ? (char)c : '?', (int)c, (Py_ssize_t)(fmt - 1 - (((PyUnicodeObject *)(uformat))->str))); goto onError; } if (sign) { if (*pbuf == '-' || *pbuf == '+') { sign = *pbuf++; len--; } else if (flags & (1<<1)) sign = '+'; else if (flags & (1<<2)) sign = ' '; else sign = 0; } if (width < len) width = len; if (rescnt - (sign != 0) < width) { reslen -= rescnt; rescnt = width + fmtcnt + 100; reslen += rescnt; if (reslen < 0) { if ((temp) == ((void *)0)) ; else if ( --(temp)->ob_refcnt != 0) ; else ( (*((PyObject *)(temp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(temp)))); PyErr_NoMemory(); goto onError; } if (PyUnicodeUCS4_Resize(((PyObject **)(&result)), reslen) < 0) { if ((temp) == ((void *)0)) ; else if ( --(temp)->ob_refcnt != 0) ; else ( (*((PyObject *)(temp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(temp)))); goto onError; } res = (((PyUnicodeObject *)(result))->str) + reslen - rescnt; } if (sign) { if (fill != ' ') *res++ = sign; rescnt--; if (width > len) width--; } if ((flags & (1<<3)) && (c == 'x' || c == 'X')) { ((void) (0)); ((void) (0)); if (fill != ' ') { *res++ = *pbuf++; *res++ = *pbuf++; } rescnt -= 2; width -= 2; if (width < 0) width = 0; len -= 2; } if (width > len && !(flags & (1<<0))) { do { --rescnt; *res++ = fill; } while (--width > len); } if (fill == ' ') { if (sign) *res++ = sign; if ((flags & (1<<3)) && (c == 'x' || c == 'X')) { ((void) (0)); ((void) (0)); *res++ = *pbuf++; *res++ = *pbuf++; } } memcpy((res), (pbuf), (len)*sizeof(Py_UNICODE)); res += len; rescnt -= len; while (--width >= len) { --rescnt; *res++ = ' '; } if (dict && (argidx < arglen) && c != '%') { PyErr_SetString(PyExc_TypeError, "not all arguments converted during string formatting"); if ((temp) == ((void *)0)) ; else if ( --(temp)->ob_refcnt != 0) ; else ( (*((PyObject *)(temp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(temp)))); goto onError; } if ((temp) == ((void *)0)) ; else if ( --(temp)->ob_refcnt != 0) ; else ( (*((PyObject *)(temp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(temp)))); } } if (argidx < arglen && !dict) { PyErr_SetString(PyExc_TypeError, "not all arguments converted during string formatting"); goto onError; } if (PyUnicodeUCS4_Resize(((PyObject **)(&result)), reslen - rescnt) < 0) goto onError; if (args_owned) { if ( --(args)->ob_refcnt != 0) ; else ( (*((PyObject *)(args))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(args)))); } if ( --(uformat)->ob_refcnt != 0) ; else ( (*((PyObject *)(uformat))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(uformat)))); return (PyObject *)result; onError: if ((result) == ((void *)0)) ; else if ( --(result)->ob_refcnt != 0) ; else ( (*((PyObject *)(result))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(result)))); if ( --(uformat)->ob_refcnt != 0) ; else ( (*((PyObject *)(uformat))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(uformat)))); if (args_owned) { if ( --(args)->ob_refcnt != 0) ; else ( (*((PyObject *)(args))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(args)))); } return ((void *)0); } static PyBufferProcs unicode_as_buffer = { (readbufferproc) unicode_buffer_getreadbuf, (writebufferproc) unicode_buffer_getwritebuf, (segcountproc) unicode_buffer_getsegcount, (charbufferproc) unicode_buffer_getcharbuf, }; static PyObject * unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = ((void *)0); static char *kwlist[] = {"string", "encoding", "errors", 0}; char *encoding = ((void *)0); char *errors = ((void *)0); if (type != &PyUnicode_Type) return unicode_subtype_new(type, args, kwds); if (!_PyArg_ParseTupleAndKeywords_SizeT(args, kwds, "|Oss:unicode", kwlist, &x, &encoding, &errors)) return ((void *)0); if (x == ((void *)0)) return (PyObject *)_PyUnicode_New(0); if (encoding == ((void *)0) && errors == ((void *)0)) return PyObject_Unicode(x); else return PyUnicodeUCS4_FromEncodedObject(x, encoding, errors); } static PyObject * unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyUnicodeObject *tmp, *pnew; Py_ssize_t n; ((void) (0)); tmp = (PyUnicodeObject *)unicode_new(&PyUnicode_Type, args, kwds); if (tmp == ((void *)0)) return ((void *)0); ((void) (0)); pnew = (PyUnicodeObject *) type->tp_alloc(type, n = tmp->length); if (pnew == ((void *)0)) { if ( --(tmp)->ob_refcnt != 0) ; else ( (*((PyObject *)(tmp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(tmp)))); return ((void *)0); } pnew->str = ( (Py_UNICODE *) malloc(((n+1) * sizeof(Py_UNICODE)) ? ((n+1) * sizeof(Py_UNICODE)) : 1) ); if (pnew->str == ((void *)0)) { ; PyObject_Free(pnew); if ( --(tmp)->ob_refcnt != 0) ; else ( (*((PyObject *)(tmp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(tmp)))); return PyErr_NoMemory(); } memcpy((pnew->str), (tmp->str), (n+1)*sizeof(Py_UNICODE)); pnew->length = n; pnew->hash = tmp->hash; if ( --(tmp)->ob_refcnt != 0) ; else ( (*((PyObject *)(tmp))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(tmp)))); return (PyObject *)pnew; } static char unicode_doc[] = "unicode(string [, encoding[, errors]]) -> object\n\nCreate a new Unicode object from the given encoded string.\nencoding defaults to the current default string encoding.\nerrors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'."; PyTypeObject PyUnicode_Type = { 1, &PyType_Type, 0, "unicode", sizeof(PyUnicodeObject), 0, (destructor)unicode_dealloc, 0, 0, 0, 0, unicode_repr, &unicode_as_number, &unicode_as_sequence, &unicode_as_mapping, (hashfunc) unicode_hash, 0, (reprfunc) unicode_str, PyObject_GenericGetAttr, 0, &unicode_as_buffer, ( (1L<<0) | (1L<<1) | (1L<<3) | (1L<<5) | (1L<<6) | (1L<<7) | (1L<<8) | 0 | (1L<<17) | 0) | (1L<<4) | (1L<<10), unicode_doc, 0, 0, PyUnicodeUCS4_RichCompare, 0, 0, 0, unicode_methods, 0, 0, &PyBaseString_Type, 0, 0, 0, 0, 0, 0, unicode_new, PyObject_Free, }; void _PyUnicodeUCS4_Init(void) { int i; Py_UNICODE linebreak[] = { 0x000A, 0x000D, 0x001C, 0x001D, 0x001E, 0x0085, 0x2028, 0x2029, }; unicode_freelist = ((void *)0); unicode_freelist_size = 0; unicode_empty = _PyUnicode_New(0); if (!unicode_empty) return; strcpy(unicode_default_encoding, "ascii"); for (i = 0; i < 256; i++) unicode_latin1[i] = ((void *)0); if (PyType_Ready(&PyUnicode_Type) < 0) Py_FatalError("Can't initialize 'unicode'"); bloom_linebreak = make_bloom_mask( linebreak, sizeof(linebreak) / sizeof(linebreak[0]) ); PyType_Ready(&EncodingMapType); } void _PyUnicodeUCS4_Fini(void) { PyUnicodeObject *u; int i; if ((unicode_empty) == ((void *)0)) ; else if ( --(unicode_empty)->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode_empty))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode_empty)))); unicode_empty = ((void *)0); for (i = 0; i < 256; i++) { if (unicode_latin1[i]) { if ( --(unicode_latin1[i])->ob_refcnt != 0) ; else ( (*((PyObject *)(unicode_latin1[i]))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(unicode_latin1[i])))); unicode_latin1[i] = ((void *)0); } } for (u = unicode_freelist; u != ((void *)0);) { PyUnicodeObject *v = u; u = *(PyUnicodeObject **)u; if (v->str) free(v->str); if ((v->defenc) == ((void *)0)) ; else if ( --(v->defenc)->ob_refcnt != 0) ; else ( (*((PyObject *)(v->defenc))->ob_type->tp_dealloc)((PyObject *)((PyObject *)(v->defenc)))); PyObject_Free(v); } unicode_freelist = ((void *)0); unicode_freelist_size = 0; }